@code-yeongyu/senpi 2026.7.10 → 2026.7.13

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 (547) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +4 -2
  3. package/dist/core/agent-session.d.ts +9 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +56 -15
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/extensions/builtin/bash-timeout/timeout.js +2 -2
  8. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  9. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  10. package/dist/core/extensions/builtin/compaction/index.js +10 -1
  11. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  12. package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
  13. package/dist/core/extensions/builtin/goal/store.js +88 -3
  14. package/dist/core/extensions/builtin/goal/store.js.map +1 -1
  15. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +3 -0
  16. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -0
  17. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +134 -0
  18. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -0
  19. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  20. package/dist/core/extensions/builtin/prompt-preset/presets.js +6 -0
  21. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  22. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  23. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  24. package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
  25. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  26. package/dist/core/extensions/builtin/terminal/notify.d.ts +3 -3
  27. package/dist/core/extensions/builtin/terminal/notify.d.ts.map +1 -1
  28. package/dist/core/extensions/builtin/terminal/notify.js +7 -4
  29. package/dist/core/extensions/builtin/terminal/notify.js.map +1 -1
  30. package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +5 -3
  31. package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
  32. package/dist/core/extensions/builtin/terminal/runtime-session.js +32 -16
  33. package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
  34. package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts +1 -1
  35. package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
  36. package/dist/core/extensions/builtin/terminal/tools/bash-output.js +10 -4
  37. package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
  38. package/dist/core/extensions/builtin/todotools/tools/todowrite.d.ts.map +1 -1
  39. package/dist/core/extensions/builtin/todotools/tools/todowrite.js +5 -8
  40. package/dist/core/extensions/builtin/todotools/tools/todowrite.js.map +1 -1
  41. package/dist/core/extensions/runner.d.ts +1 -0
  42. package/dist/core/extensions/runner.d.ts.map +1 -1
  43. package/dist/core/extensions/runner.js +5 -0
  44. package/dist/core/extensions/runner.js.map +1 -1
  45. package/dist/core/extensions/types.d.ts +5 -8
  46. package/dist/core/extensions/types.d.ts.map +1 -1
  47. package/dist/core/extensions/types.js.map +1 -1
  48. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  49. package/dist/core/extensions/wrapper.js +22 -3
  50. package/dist/core/extensions/wrapper.js.map +1 -1
  51. package/dist/core/keybindings.d.ts +8 -3
  52. package/dist/core/keybindings.d.ts.map +1 -1
  53. package/dist/core/keybindings.js +7 -3
  54. package/dist/core/keybindings.js.map +1 -1
  55. package/dist/core/model-registry.d.ts +1 -6
  56. package/dist/core/model-registry.d.ts.map +1 -1
  57. package/dist/core/model-registry.js +19 -6
  58. package/dist/core/model-registry.js.map +1 -1
  59. package/dist/core/resource-loader.d.ts +1 -0
  60. package/dist/core/resource-loader.d.ts.map +1 -1
  61. package/dist/core/resource-loader.js +20 -2
  62. package/dist/core/resource-loader.js.map +1 -1
  63. package/dist/core/settings-manager.d.ts +4 -3
  64. package/dist/core/settings-manager.d.ts.map +1 -1
  65. package/dist/core/settings-manager.js +2 -1
  66. package/dist/core/settings-manager.js.map +1 -1
  67. package/dist/index.d.ts +1 -0
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +1 -0
  70. package/dist/index.js.map +1 -1
  71. package/dist/modes/interactive/compaction-queue-transfer.d.ts +22 -0
  72. package/dist/modes/interactive/compaction-queue-transfer.d.ts.map +1 -0
  73. package/dist/modes/interactive/compaction-queue-transfer.js +82 -0
  74. package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -0
  75. package/dist/modes/interactive/components/custom-editor.js +1 -1
  76. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  77. package/dist/modes/interactive/components/login-dialog.d.ts +4 -0
  78. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  79. package/dist/modes/interactive/components/login-dialog.js +9 -2
  80. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  81. package/dist/modes/interactive/components/settings-selector.js +1 -1
  82. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  83. package/dist/modes/interactive/components/thinking-selector.js +1 -1
  84. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  85. package/dist/modes/interactive/components/tool-execution-fallback.d.ts +6 -0
  86. package/dist/modes/interactive/components/tool-execution-fallback.d.ts.map +1 -0
  87. package/dist/modes/interactive/components/tool-execution-fallback.js +40 -0
  88. package/dist/modes/interactive/components/tool-execution-fallback.js.map +1 -0
  89. package/dist/modes/interactive/components/tool-execution-images.d.ts +23 -0
  90. package/dist/modes/interactive/components/tool-execution-images.d.ts.map +1 -0
  91. package/dist/modes/interactive/components/tool-execution-images.js +104 -0
  92. package/dist/modes/interactive/components/tool-execution-images.js.map +1 -0
  93. package/dist/modes/interactive/components/tool-execution-renderer.d.ts +28 -0
  94. package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -0
  95. package/dist/modes/interactive/components/tool-execution-renderer.js +135 -0
  96. package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -0
  97. package/dist/modes/interactive/components/tool-execution-types.d.ts +23 -0
  98. package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -0
  99. package/dist/modes/interactive/components/tool-execution-types.js +2 -0
  100. package/dist/modes/interactive/components/tool-execution-types.js.map +1 -0
  101. package/dist/modes/interactive/components/tool-execution.d.ts +13 -39
  102. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  103. package/dist/modes/interactive/components/tool-execution.js +51 -294
  104. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  105. package/dist/modes/interactive/components/tool-renderer-boundary.d.ts +17 -0
  106. package/dist/modes/interactive/components/tool-renderer-boundary.d.ts.map +1 -0
  107. package/dist/modes/interactive/components/tool-renderer-boundary.js +75 -0
  108. package/dist/modes/interactive/components/tool-renderer-boundary.js.map +1 -0
  109. package/dist/modes/interactive/components/tree-selector.d.ts +5 -0
  110. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  111. package/dist/modes/interactive/components/tree-selector.js +50 -17
  112. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  113. package/dist/modes/interactive/interactive-mode.d.ts +5 -2
  114. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  115. package/dist/modes/interactive/interactive-mode.js +127 -109
  116. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  117. package/dist/modes/interactive/theme/dark.json +1 -0
  118. package/dist/modes/interactive/theme/light.json +1 -0
  119. package/dist/modes/interactive/theme/theme-schema.json +6 -2
  120. package/dist/modes/interactive/theme/theme.d.ts +3 -2
  121. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  122. package/dist/modes/interactive/theme/theme.js +11 -4
  123. package/dist/modes/interactive/theme/theme.js.map +1 -1
  124. package/dist/utils/clipboard-native.d.ts +1 -0
  125. package/dist/utils/clipboard-native.d.ts.map +1 -1
  126. package/dist/utils/clipboard-native.js.map +1 -1
  127. package/dist/utils/clipboard.d.ts +2 -0
  128. package/dist/utils/clipboard.d.ts.map +1 -1
  129. package/dist/utils/clipboard.js +13 -0
  130. package/dist/utils/clipboard.js.map +1 -1
  131. package/docs/custom-provider.md +4 -3
  132. package/docs/extensions.md +140 -1
  133. package/docs/keybindings.md +1 -0
  134. package/docs/models.md +45 -4
  135. package/docs/providers.md +3 -0
  136. package/docs/quickstart.md +1 -1
  137. package/docs/rpc.md +2 -2
  138. package/docs/sdk.md +1 -1
  139. package/docs/settings.md +3 -3
  140. package/docs/themes.md +5 -3
  141. package/docs/tui.md +1 -1
  142. package/docs/usage.md +2 -1
  143. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  144. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  145. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  146. package/examples/extensions/gondolin/package-lock.json +2 -2
  147. package/examples/extensions/gondolin/package.json +1 -1
  148. package/examples/extensions/sandbox/package-lock.json +2 -2
  149. package/examples/extensions/sandbox/package.json +1 -1
  150. package/examples/extensions/with-deps/package-lock.json +2 -2
  151. package/examples/extensions/with-deps/package.json +1 -1
  152. package/node_modules/@babel/helper-string-parser/LICENSE +22 -0
  153. package/node_modules/@babel/helper-string-parser/README.md +19 -0
  154. package/node_modules/@babel/helper-string-parser/lib/index.js +295 -0
  155. package/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -0
  156. package/node_modules/@babel/helper-string-parser/package.json +31 -0
  157. package/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
  158. package/node_modules/@babel/helper-validator-identifier/README.md +19 -0
  159. package/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
  160. package/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  161. package/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
  162. package/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  163. package/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
  164. package/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
  165. package/node_modules/@babel/helper-validator-identifier/package.json +31 -0
  166. package/node_modules/@babel/parser/LICENSE +19 -0
  167. package/node_modules/@babel/parser/README.md +19 -0
  168. package/node_modules/@babel/parser/bin/babel-parser.js +15 -0
  169. package/node_modules/@babel/parser/lib/index.js +14599 -0
  170. package/node_modules/@babel/parser/lib/index.js.map +1 -0
  171. package/node_modules/@babel/parser/package.json +50 -0
  172. package/node_modules/@babel/parser/typings/babel-parser.d.ts +262 -0
  173. package/node_modules/@babel/types/LICENSE +22 -0
  174. package/node_modules/@babel/types/README.md +19 -0
  175. package/node_modules/@babel/types/lib/asserts/assertNode.js +16 -0
  176. package/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -0
  177. package/node_modules/@babel/types/lib/asserts/generated/index.js +1251 -0
  178. package/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -0
  179. package/node_modules/@babel/types/lib/ast-types/generated/index.js +3 -0
  180. package/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -0
  181. package/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +18 -0
  182. package/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -0
  183. package/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +31 -0
  184. package/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -0
  185. package/node_modules/@babel/types/lib/builders/generated/index.js +29 -0
  186. package/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -0
  187. package/node_modules/@babel/types/lib/builders/generated/lowercase.js +2902 -0
  188. package/node_modules/@babel/types/lib/builders/generated/lowercase.js.map +1 -0
  189. package/node_modules/@babel/types/lib/builders/generated/uppercase.js +272 -0
  190. package/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -0
  191. package/node_modules/@babel/types/lib/builders/productions.js +12 -0
  192. package/node_modules/@babel/types/lib/builders/productions.js.map +1 -0
  193. package/node_modules/@babel/types/lib/builders/react/buildChildren.js +24 -0
  194. package/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -0
  195. package/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +22 -0
  196. package/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -0
  197. package/node_modules/@babel/types/lib/builders/validateNode.js +21 -0
  198. package/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -0
  199. package/node_modules/@babel/types/lib/clone/clone.js +12 -0
  200. package/node_modules/@babel/types/lib/clone/clone.js.map +1 -0
  201. package/node_modules/@babel/types/lib/clone/cloneDeep.js +12 -0
  202. package/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -0
  203. package/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +12 -0
  204. package/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -0
  205. package/node_modules/@babel/types/lib/clone/cloneNode.js +107 -0
  206. package/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -0
  207. package/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +12 -0
  208. package/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -0
  209. package/node_modules/@babel/types/lib/comments/addComment.js +15 -0
  210. package/node_modules/@babel/types/lib/comments/addComment.js.map +1 -0
  211. package/node_modules/@babel/types/lib/comments/addComments.js +22 -0
  212. package/node_modules/@babel/types/lib/comments/addComments.js.map +1 -0
  213. package/node_modules/@babel/types/lib/comments/inheritInnerComments.js +12 -0
  214. package/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -0
  215. package/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +12 -0
  216. package/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -0
  217. package/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +12 -0
  218. package/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -0
  219. package/node_modules/@babel/types/lib/comments/inheritsComments.js +17 -0
  220. package/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -0
  221. package/node_modules/@babel/types/lib/comments/removeComments.js +15 -0
  222. package/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -0
  223. package/node_modules/@babel/types/lib/constants/generated/index.js +60 -0
  224. package/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -0
  225. package/node_modules/@babel/types/lib/constants/index.js +31 -0
  226. package/node_modules/@babel/types/lib/constants/index.js.map +1 -0
  227. package/node_modules/@babel/types/lib/converters/ensureBlock.js +14 -0
  228. package/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -0
  229. package/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +65 -0
  230. package/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -0
  231. package/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +14 -0
  232. package/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -0
  233. package/node_modules/@babel/types/lib/converters/toBlock.js +29 -0
  234. package/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -0
  235. package/node_modules/@babel/types/lib/converters/toComputedKey.js +14 -0
  236. package/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -0
  237. package/node_modules/@babel/types/lib/converters/toExpression.js +28 -0
  238. package/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -0
  239. package/node_modules/@babel/types/lib/converters/toIdentifier.js +25 -0
  240. package/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -0
  241. package/node_modules/@babel/types/lib/converters/toKeyAlias.js +38 -0
  242. package/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -0
  243. package/node_modules/@babel/types/lib/converters/toSequenceExpression.js +19 -0
  244. package/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -0
  245. package/node_modules/@babel/types/lib/converters/toStatement.js +39 -0
  246. package/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -0
  247. package/node_modules/@babel/types/lib/converters/valueToNode.js +89 -0
  248. package/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -0
  249. package/node_modules/@babel/types/lib/definitions/core.js +1725 -0
  250. package/node_modules/@babel/types/lib/definitions/core.js.map +1 -0
  251. package/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +11 -0
  252. package/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
  253. package/node_modules/@babel/types/lib/definitions/experimental.js +124 -0
  254. package/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -0
  255. package/node_modules/@babel/types/lib/definitions/flow.js +495 -0
  256. package/node_modules/@babel/types/lib/definitions/flow.js.map +1 -0
  257. package/node_modules/@babel/types/lib/definitions/index.js +106 -0
  258. package/node_modules/@babel/types/lib/definitions/index.js.map +1 -0
  259. package/node_modules/@babel/types/lib/definitions/jsx.js +157 -0
  260. package/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -0
  261. package/node_modules/@babel/types/lib/definitions/misc.js +31 -0
  262. package/node_modules/@babel/types/lib/definitions/misc.js.map +1 -0
  263. package/node_modules/@babel/types/lib/definitions/placeholders.js +27 -0
  264. package/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -0
  265. package/node_modules/@babel/types/lib/definitions/typescript.js +528 -0
  266. package/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -0
  267. package/node_modules/@babel/types/lib/definitions/utils.js +296 -0
  268. package/node_modules/@babel/types/lib/definitions/utils.js.map +1 -0
  269. package/node_modules/@babel/types/lib/index-legacy.d.ts +2797 -0
  270. package/node_modules/@babel/types/lib/index.d.ts +3617 -0
  271. package/node_modules/@babel/types/lib/index.js +582 -0
  272. package/node_modules/@babel/types/lib/index.js.flow +2650 -0
  273. package/node_modules/@babel/types/lib/index.js.map +1 -0
  274. package/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +15 -0
  275. package/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -0
  276. package/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +65 -0
  277. package/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -0
  278. package/node_modules/@babel/types/lib/modifications/inherits.js +28 -0
  279. package/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -0
  280. package/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +17 -0
  281. package/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -0
  282. package/node_modules/@babel/types/lib/modifications/removeProperties.js +24 -0
  283. package/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -0
  284. package/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +14 -0
  285. package/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -0
  286. package/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +66 -0
  287. package/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -0
  288. package/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js +48 -0
  289. package/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js.map +1 -0
  290. package/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +102 -0
  291. package/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -0
  292. package/node_modules/@babel/types/lib/retrievers/getFunctionName.js +63 -0
  293. package/node_modules/@babel/types/lib/retrievers/getFunctionName.js.map +1 -0
  294. package/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +13 -0
  295. package/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -0
  296. package/node_modules/@babel/types/lib/traverse/traverse.js +50 -0
  297. package/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -0
  298. package/node_modules/@babel/types/lib/traverse/traverseFast.js +40 -0
  299. package/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -0
  300. package/node_modules/@babel/types/lib/utils/deprecationWarning.js +44 -0
  301. package/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
  302. package/node_modules/@babel/types/lib/utils/inherit.js +13 -0
  303. package/node_modules/@babel/types/lib/utils/inherit.js.map +1 -0
  304. package/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +40 -0
  305. package/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -0
  306. package/node_modules/@babel/types/lib/utils/shallowEqual.js +17 -0
  307. package/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -0
  308. package/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +13 -0
  309. package/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -0
  310. package/node_modules/@babel/types/lib/validators/generated/index.js +2797 -0
  311. package/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -0
  312. package/node_modules/@babel/types/lib/validators/is.js +27 -0
  313. package/node_modules/@babel/types/lib/validators/is.js.map +1 -0
  314. package/node_modules/@babel/types/lib/validators/isBinding.js +27 -0
  315. package/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -0
  316. package/node_modules/@babel/types/lib/validators/isBlockScoped.js +13 -0
  317. package/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -0
  318. package/node_modules/@babel/types/lib/validators/isImmutable.js +21 -0
  319. package/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -0
  320. package/node_modules/@babel/types/lib/validators/isLet.js +13 -0
  321. package/node_modules/@babel/types/lib/validators/isLet.js.map +1 -0
  322. package/node_modules/@babel/types/lib/validators/isNode.js +12 -0
  323. package/node_modules/@babel/types/lib/validators/isNode.js.map +1 -0
  324. package/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +57 -0
  325. package/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -0
  326. package/node_modules/@babel/types/lib/validators/isPlaceholderType.js +15 -0
  327. package/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -0
  328. package/node_modules/@babel/types/lib/validators/isReferenced.js +96 -0
  329. package/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -0
  330. package/node_modules/@babel/types/lib/validators/isScope.js +18 -0
  331. package/node_modules/@babel/types/lib/validators/isScope.js.map +1 -0
  332. package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +14 -0
  333. package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -0
  334. package/node_modules/@babel/types/lib/validators/isType.js +17 -0
  335. package/node_modules/@babel/types/lib/validators/isType.js.map +1 -0
  336. package/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +13 -0
  337. package/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -0
  338. package/node_modules/@babel/types/lib/validators/isValidIdentifier.js +18 -0
  339. package/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -0
  340. package/node_modules/@babel/types/lib/validators/isVar.js +15 -0
  341. package/node_modules/@babel/types/lib/validators/isVar.js.map +1 -0
  342. package/node_modules/@babel/types/lib/validators/matchesPattern.js +44 -0
  343. package/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -0
  344. package/node_modules/@babel/types/lib/validators/react/isCompatTag.js +11 -0
  345. package/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -0
  346. package/node_modules/@babel/types/lib/validators/react/isReactComponent.js +11 -0
  347. package/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -0
  348. package/node_modules/@babel/types/lib/validators/validate.js +42 -0
  349. package/node_modules/@babel/types/lib/validators/validate.js.map +1 -0
  350. package/node_modules/@babel/types/package.json +39 -0
  351. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +13 -2
  352. package/node_modules/@code-yeongyu/senpi-codemode/README.md +128 -78
  353. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -3
  354. package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/protocol.ts +22 -9
  355. package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/reserved.ts +9 -0
  356. package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/agent-bridge.ts +197 -0
  357. package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/output-bridge.ts +96 -0
  358. package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/schema-injection.ts +3 -0
  359. package/node_modules/@code-yeongyu/senpi-codemode/src/completion/handler.ts +95 -26
  360. package/node_modules/@code-yeongyu/senpi-codemode/src/completion/tool-bridge.ts +14 -2
  361. package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +96 -8
  362. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +92 -10
  363. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +187 -27
  364. package/node_modules/@code-yeongyu/senpi-codemode/src/interpreters/detect.ts +1 -1
  365. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/prelude.jl +252 -48
  366. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/runner.jl +263 -83
  367. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +198 -149
  368. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/inline-worker-entry.js +23 -0
  369. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/inline-worker.ts +4 -175
  370. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/kernel-contract.ts +38 -0
  371. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/local-module-loader.ts +108 -0
  372. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +8 -6
  373. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/rewrite-imports.ts +164 -0
  374. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/run-queue.ts +82 -0
  375. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-core.js +13 -4
  376. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-host.ts +117 -0
  377. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +307 -41
  378. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel-contract.ts +32 -0
  379. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +232 -199
  380. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +792 -79
  381. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/process.ts +119 -0
  382. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/transport.ts +237 -0
  383. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/prelude.rb +234 -21
  384. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/runner.rb +154 -51
  385. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-contract.ts +22 -0
  386. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +214 -189
  387. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-process.ts +174 -0
  388. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-queue.ts +101 -0
  389. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-run.ts +98 -0
  390. package/node_modules/@code-yeongyu/senpi-codemode/src/output/output-meta.ts +89 -0
  391. package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output.ts +296 -0
  392. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +107 -30
  393. package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/bridge-timeout.ts +2 -0
  394. package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/idle-timeout.ts +8 -19
  395. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +267 -0
  396. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +226 -211
  397. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/image.ts +274 -0
  398. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/json-tree.ts +247 -0
  399. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +828 -35
  400. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/status-events.ts +12 -0
  401. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +30 -1
  402. package/node_modules/@earendil-works/pi-agent-core/README.md +1 -1
  403. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -0
  404. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  405. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -3
  406. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  407. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  408. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  409. package/node_modules/@earendil-works/pi-ai/README.md +4 -2
  410. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  411. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +89 -40
  412. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  413. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +1 -1
  414. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  415. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  416. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  417. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +7 -7
  418. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  419. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +1 -1
  420. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  421. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +10 -3
  422. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  423. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +1 -1
  424. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  425. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -1
  426. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  427. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +3 -1
  428. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  429. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +35 -4
  430. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  431. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +1 -1
  432. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  433. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +7 -3
  434. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  435. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  436. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +8 -3
  437. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  438. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.d.ts.map +1 -1
  439. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +4 -3
  440. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
  441. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
  442. package/node_modules/@earendil-works/pi-ai/dist/compat.js +2 -1
  443. package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
  444. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  445. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +483 -61
  446. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  447. package/node_modules/@earendil-works/pi-ai/dist/models.js +13 -4
  448. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  449. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  450. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +5 -1
  451. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  452. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +62 -5
  453. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
  454. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +32 -20
  455. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -1
  456. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +11 -1
  457. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts.map +1 -1
  458. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +6 -4
  459. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js.map +1 -1
  460. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +7 -8
  461. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +1 -1
  462. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +20 -21
  463. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +1 -1
  464. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +11 -1
  465. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
  466. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +6 -4
  467. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
  468. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.d.ts.map +1 -1
  469. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +9 -6
  470. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js.map +1 -1
  471. package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts +2 -2
  472. package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts.map +1 -1
  473. package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -2
  474. package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js.map +1 -1
  475. package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +2 -2
  476. package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts.map +1 -1
  477. package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +2 -2
  478. package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js.map +1 -1
  479. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +100 -2
  480. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts.map +1 -1
  481. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +64 -5
  482. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js.map +1 -1
  483. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts +56 -0
  484. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts.map +1 -1
  485. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js +20 -9
  486. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js.map +1 -1
  487. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts +77 -8
  488. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts.map +1 -1
  489. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js +37 -24
  490. package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js.map +1 -1
  491. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts +3 -3
  492. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -1
  493. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +3 -3
  494. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -1
  495. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +80 -4
  496. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts.map +1 -1
  497. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +64 -8
  498. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js.map +1 -1
  499. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +25 -22
  500. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
  501. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +68 -83
  502. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
  503. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +45 -1
  504. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
  505. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +49 -13
  506. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
  507. package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts +1 -1
  508. package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts.map +1 -1
  509. package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +1 -1
  510. package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js.map +1 -1
  511. package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts +1 -1
  512. package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts.map +1 -1
  513. package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +1 -1
  514. package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js.map +1 -1
  515. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +30 -7
  516. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  517. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  518. package/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.d.ts +9 -0
  519. package/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.d.ts.map +1 -0
  520. package/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js +36 -0
  521. package/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js.map +1 -0
  522. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.d.ts +3 -3
  523. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.d.ts.map +1 -1
  524. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +35 -14
  525. package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
  526. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  527. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  528. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  529. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +2 -1
  530. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  531. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +2 -1
  532. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  533. package/node_modules/@earendil-works/pi-tui/dist/index.js +2 -1
  534. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  535. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  536. package/node_modules/@earendil-works/pi-tui/dist/keys.js +6 -5
  537. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  538. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -1
  539. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  540. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -9
  541. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  542. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +4 -0
  543. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -0
  544. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +18 -0
  545. package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -0
  546. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  547. package/package.json +6 -6
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("../validators/generated/index.js");
8
+ var _default = exports.default = toExpression;
9
+ function toExpression(node) {
10
+ if ((0, _index.isExpressionStatement)(node)) {
11
+ node = node.expression;
12
+ }
13
+ if ((0, _index.isExpression)(node)) {
14
+ return node;
15
+ }
16
+ if ((0, _index.isClass)(node)) {
17
+ node.type = "ClassExpression";
18
+ node.abstract = false;
19
+ } else if ((0, _index.isFunction)(node)) {
20
+ node.type = "FunctionExpression";
21
+ }
22
+ if (!(0, _index.isExpression)(node)) {
23
+ throw new Error(`cannot turn ${node.type} to an expression`);
24
+ }
25
+ return node;
26
+ }
27
+
28
+ //# sourceMappingURL=toExpression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_index","require","_default","exports","default","toExpression","node","isExpressionStatement","expression","isExpression","isClass","type","abstract","isFunction","Error"],"sources":["../../src/converters/toExpression.ts"],"sourcesContent":["import {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default toExpression as {\n (node: t.Function): t.FunctionExpression;\n (node: t.Class): t.ClassExpression;\n (\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n ): t.Expression;\n};\n\nfunction toExpression(\n node: t.ExpressionStatement | t.Expression | t.Class | t.Function,\n): t.Expression {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"ClassExpression\";\n // abstract modifiers are only allowed on class declarations\n node.abstract = false;\n } else if (isFunction(node)) {\n // @ts-expect-error todo(flow->ts): avoid type unsafe mutations\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAK0C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAG3BC,YAAY;AAQ3B,SAASA,YAAYA,CACnBC,IAAiE,EACnD;EACd,IAAI,IAAAC,4BAAqB,EAACD,IAAI,CAAC,EAAE;IAC/BA,IAAI,GAAGA,IAAI,CAACE,UAAU;EACxB;EAQA,IAAI,IAAAC,mBAAY,EAACH,IAAI,CAAC,EAAE;IACtB,OAAOA,IAAI;EACb;EAKA,IAAI,IAAAI,cAAO,EAACJ,IAAI,CAAC,EAAE;IAEjBA,IAAI,CAACK,IAAI,GAAG,iBAAiB;IAE7BL,IAAI,CAACM,QAAQ,GAAG,KAAK;EACvB,CAAC,MAAM,IAAI,IAAAC,iBAAU,EAACP,IAAI,CAAC,EAAE;IAE3BA,IAAI,CAACK,IAAI,GAAG,oBAAoB;EAClC;EAGA,IAAI,CAAC,IAAAF,mBAAY,EAACH,IAAI,CAAC,EAAE;IACvB,MAAM,IAAIQ,KAAK,CAAC,eAAeR,IAAI,CAACK,IAAI,mBAAmB,CAAC;EAC9D;EAEA,OAAOL,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = toIdentifier;
7
+ var _isValidIdentifier = require("../validators/isValidIdentifier.js");
8
+ var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
9
+ function toIdentifier(input) {
10
+ input = input + "";
11
+ let name = "";
12
+ for (const c of input) {
13
+ name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
14
+ }
15
+ name = name.replace(/^[-0-9]+/, "");
16
+ name = name.replace(/[-\s]+(.)?/g, function (match, c) {
17
+ return c ? c.toUpperCase() : "";
18
+ });
19
+ if (!(0, _isValidIdentifier.default)(name)) {
20
+ name = `_${name}`;
21
+ }
22
+ return name || "_";
23
+ }
24
+
25
+ //# sourceMappingURL=toIdentifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_isValidIdentifier","require","_helperValidatorIdentifier","toIdentifier","input","name","c","isIdentifierChar","codePointAt","replace","match","toUpperCase","isValidIdentifier"],"sources":["../../src/converters/toIdentifier.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier.ts\";\nimport { isIdentifierChar } from \"@babel/helper-validator-identifier\";\n\nexport default function toIdentifier(input: string): string {\n input = input + \"\";\n\n // replace all non-valid identifiers with dashes\n let name = \"\";\n for (const c of input) {\n name += isIdentifierChar(c.codePointAt(0)) ? c : \"-\";\n }\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function (match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AAEe,SAASE,YAAYA,CAACC,KAAa,EAAU;EAC1DA,KAAK,GAAGA,KAAK,GAAG,EAAE;EAGlB,IAAIC,IAAI,GAAG,EAAE;EACb,KAAK,MAAMC,CAAC,IAAIF,KAAK,EAAE;IACrBC,IAAI,IAAI,IAAAE,2CAAgB,EAACD,CAAC,CAACE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAGF,CAAC,GAAG,GAAG;EACtD;EAGAD,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;EAGnCJ,IAAI,GAAGA,IAAI,CAACI,OAAO,CAAC,aAAa,EAAE,UAAUC,KAAK,EAAEJ,CAAC,EAAE;IACrD,OAAOA,CAAC,GAAGA,CAAC,CAACK,WAAW,CAAC,CAAC,GAAG,EAAE;EACjC,CAAC,CAAC;EAEF,IAAI,CAAC,IAAAC,0BAAiB,EAACP,IAAI,CAAC,EAAE;IAC5BA,IAAI,GAAG,IAAIA,IAAI,EAAE;EACnB;EAEA,OAAOA,IAAI,IAAI,GAAG;AACpB","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = toKeyAlias;
7
+ var _index = require("../validators/generated/index.js");
8
+ var _cloneNode = require("../clone/cloneNode.js");
9
+ var _removePropertiesDeep = require("../modifications/removePropertiesDeep.js");
10
+ function toKeyAlias(node, key = node.key) {
11
+ let alias;
12
+ if (node.kind === "method") {
13
+ return toKeyAlias.increment() + "";
14
+ } else if ((0, _index.isIdentifier)(key)) {
15
+ alias = key.name;
16
+ } else if ((0, _index.isStringLiteral)(key)) {
17
+ alias = JSON.stringify(key.value);
18
+ } else {
19
+ alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
20
+ }
21
+ if (node.computed) {
22
+ alias = `[${alias}]`;
23
+ }
24
+ if (node.static) {
25
+ alias = `static:${alias}`;
26
+ }
27
+ return alias;
28
+ }
29
+ toKeyAlias.uid = 0;
30
+ toKeyAlias.increment = function () {
31
+ if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
32
+ return toKeyAlias.uid = 0;
33
+ } else {
34
+ return toKeyAlias.uid++;
35
+ }
36
+ };
37
+
38
+ //# sourceMappingURL=toKeyAlias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_index","require","_cloneNode","_removePropertiesDeep","toKeyAlias","node","key","alias","kind","increment","isIdentifier","name","isStringLiteral","JSON","stringify","value","removePropertiesDeep","cloneNode","computed","static","uid","Number","MAX_SAFE_INTEGER"],"sources":["../../src/converters/toKeyAlias.ts"],"sourcesContent":["import {\n isIdentifier,\n isStringLiteral,\n} from \"../validators/generated/index.ts\";\nimport cloneNode from \"../clone/cloneNode.ts\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function toKeyAlias(\n node: t.Method | t.Property,\n key: t.Node = node.key,\n): string {\n let alias;\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.kind`\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.computed`\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n // @ts-expect-error todo(flow->ts): maybe add node type check before checking `.static`\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function () {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAGe,SAASG,UAAUA,CAChCC,IAA2B,EAC3BC,GAAW,GAAGD,IAAI,CAACC,GAAG,EACd;EACR,IAAIC,KAAK;EAGT,IAAIF,IAAI,CAACG,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOJ,UAAU,CAACK,SAAS,CAAC,CAAC,GAAG,EAAE;EACpC,CAAC,MAAM,IAAI,IAAAC,mBAAY,EAACJ,GAAG,CAAC,EAAE;IAC5BC,KAAK,GAAGD,GAAG,CAACK,IAAI;EAClB,CAAC,MAAM,IAAI,IAAAC,sBAAe,EAACN,GAAG,CAAC,EAAE;IAC/BC,KAAK,GAAGM,IAAI,CAACC,SAAS,CAACR,GAAG,CAACS,KAAK,CAAC;EACnC,CAAC,MAAM;IACLR,KAAK,GAAGM,IAAI,CAACC,SAAS,CAAC,IAAAE,6BAAoB,EAAC,IAAAC,kBAAS,EAACX,GAAG,CAAC,CAAC,CAAC;EAC9D;EAGA,IAAID,IAAI,CAACa,QAAQ,EAAE;IACjBX,KAAK,GAAG,IAAIA,KAAK,GAAG;EACtB;EAGA,IAAIF,IAAI,CAACc,MAAM,EAAE;IACfZ,KAAK,GAAG,UAAUA,KAAK,EAAE;EAC3B;EAEA,OAAOA,KAAK;AACd;AAEAH,UAAU,CAACgB,GAAG,GAAG,CAAC;AAElBhB,UAAU,CAACK,SAAS,GAAG,YAAY;EACjC,IAAIL,UAAU,CAACgB,GAAG,IAAIC,MAAM,CAACC,gBAAgB,EAAE;IAC7C,OAAQlB,UAAU,CAACgB,GAAG,GAAG,CAAC;EAC5B,CAAC,MAAM;IACL,OAAOhB,UAAU,CAACgB,GAAG,EAAE;EACzB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = toSequenceExpression;
7
+ var _gatherSequenceExpressions = require("./gatherSequenceExpressions.js");
8
+ function toSequenceExpression(nodes, scope) {
9
+ if (!(nodes != null && nodes.length)) return;
10
+ const declars = [];
11
+ const result = (0, _gatherSequenceExpressions.default)(nodes, declars);
12
+ if (!result) return;
13
+ for (const declar of declars) {
14
+ scope.push(declar);
15
+ }
16
+ return result;
17
+ }
18
+
19
+ //# sourceMappingURL=toSequenceExpression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_gatherSequenceExpressions","require","toSequenceExpression","nodes","scope","length","declars","result","gatherSequenceExpressions","declar","push"],"sources":["../../src/converters/toSequenceExpression.ts"],"sourcesContent":["// TODO(Babel 8) Remove this file\nif (process.env.BABEL_8_BREAKING && process.env.IS_PUBLISH) {\n throw new Error(\n \"Internal Babel error: This file should only be loaded in Babel 7\",\n );\n}\n\nimport gatherSequenceExpressions from \"./gatherSequenceExpressions.ts\";\nimport type * as t from \"../index.ts\";\nimport type { DeclarationInfo } from \"./gatherSequenceExpressions.ts\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: readonly t.Node[],\n scope: any,\n): t.SequenceExpression | undefined {\n if (!nodes?.length) return;\n\n const declars: DeclarationInfo[] = [];\n const result = gatherSequenceExpressions(nodes, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n // @ts-expect-error fixme: gatherSequenceExpressions will return an Expression when there are only one element\n return result;\n}\n"],"mappings":";;;;;;AAOA,IAAAA,0BAAA,GAAAC,OAAA;AAYe,SAASC,oBAAoBA,CAC1CC,KAAwB,EACxBC,KAAU,EACwB;EAClC,IAAI,EAACD,KAAK,YAALA,KAAK,CAAEE,MAAM,GAAE;EAEpB,MAAMC,OAA0B,GAAG,EAAE;EACrC,MAAMC,MAAM,GAAG,IAAAC,kCAAyB,EAACL,KAAK,EAAEG,OAAO,CAAC;EACxD,IAAI,CAACC,MAAM,EAAE;EAEb,KAAK,MAAME,MAAM,IAAIH,OAAO,EAAE;IAC5BF,KAAK,CAACM,IAAI,CAACD,MAAM,CAAC;EACpB;EAGA,OAAOF,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _index = require("../validators/generated/index.js");
8
+ var _index2 = require("../builders/generated/index.js");
9
+ var _default = exports.default = toStatement;
10
+ function toStatement(node, ignore) {
11
+ if ((0, _index.isStatement)(node)) {
12
+ return node;
13
+ }
14
+ let mustHaveId = false;
15
+ let newType;
16
+ if ((0, _index.isClass)(node)) {
17
+ mustHaveId = true;
18
+ newType = "ClassDeclaration";
19
+ } else if ((0, _index.isFunction)(node)) {
20
+ mustHaveId = true;
21
+ newType = "FunctionDeclaration";
22
+ } else if ((0, _index.isAssignmentExpression)(node)) {
23
+ return (0, _index2.expressionStatement)(node);
24
+ }
25
+ if (mustHaveId && !node.id) {
26
+ newType = false;
27
+ }
28
+ if (!newType) {
29
+ if (ignore) {
30
+ return false;
31
+ } else {
32
+ throw new Error(`cannot turn ${node.type} to a statement`);
33
+ }
34
+ }
35
+ node.type = newType;
36
+ return node;
37
+ }
38
+
39
+ //# sourceMappingURL=toStatement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_index","require","_index2","_default","exports","default","toStatement","node","ignore","isStatement","mustHaveId","newType","isClass","isFunction","isAssignmentExpression","expressionStatement","id","Error","type"],"sources":["../../src/converters/toStatement.ts"],"sourcesContent":["import {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated/index.ts\";\nimport { expressionStatement } from \"../builders/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default toStatement as {\n (node: t.AssignmentExpression, ignore?: boolean): t.ExpressionStatement;\n\n <T extends t.Statement>(node: T, ignore: false): T;\n <T extends t.Statement>(node: T, ignore?: boolean): T | false;\n\n (node: t.Class, ignore: false): t.ClassDeclaration;\n (node: t.Class, ignore?: boolean): t.ClassDeclaration | false;\n\n (node: t.Function, ignore: false): t.FunctionDeclaration;\n (node: t.Function, ignore?: boolean): t.FunctionDeclaration | false;\n\n (node: t.Node, ignore: false): t.Statement;\n (node: t.Node, ignore?: boolean): t.Statement | false;\n};\n\nfunction toStatement(node: t.Node, ignore?: boolean): t.Statement | false {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\" as const;\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\" as const;\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n // @ts-expect-error todo(flow->ts): node.id might be missing\n if (mustHaveId && !node.id) {\n newType = false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n // @ts-expect-error manipulating node.type\n node.type = newType;\n\n // @ts-expect-error todo(flow->ts) refactor to avoid type unsafe mutations like reassigning node type above\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,OAAA,GAAAD,OAAA;AAAqE,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGtDC,WAAW;AAgB1B,SAASA,WAAWA,CAACC,IAAY,EAAEC,MAAgB,EAAuB;EACxE,IAAI,IAAAC,kBAAW,EAACF,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI;EACb;EAEA,IAAIG,UAAU,GAAG,KAAK;EACtB,IAAIC,OAAO;EAEX,IAAI,IAAAC,cAAO,EAACL,IAAI,CAAC,EAAE;IACjBG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,kBAA2B;EACvC,CAAC,MAAM,IAAI,IAAAE,iBAAU,EAACN,IAAI,CAAC,EAAE;IAC3BG,UAAU,GAAG,IAAI;IACjBC,OAAO,GAAG,qBAA8B;EAC1C,CAAC,MAAM,IAAI,IAAAG,6BAAsB,EAACP,IAAI,CAAC,EAAE;IACvC,OAAO,IAAAQ,2BAAmB,EAACR,IAAI,CAAC;EAClC;EAGA,IAAIG,UAAU,IAAI,CAACH,IAAI,CAACS,EAAE,EAAE;IAC1BL,OAAO,GAAG,KAAK;EACjB;EAEA,IAAI,CAACA,OAAO,EAAE;IACZ,IAAIH,MAAM,EAAE;MACV,OAAO,KAAK;IACd,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CAAC,eAAeV,IAAI,CAACW,IAAI,iBAAiB,CAAC;IAC5D;EACF;EAGAX,IAAI,CAACW,IAAI,GAAGP,OAAO;EAGnB,OAAOJ,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _isValidIdentifier = require("../validators/isValidIdentifier.js");
8
+ var _index = require("../builders/generated/index.js");
9
+ var _default = exports.default = valueToNode;
10
+ const objectToString = Function.call.bind(Object.prototype.toString);
11
+ function isRegExp(value) {
12
+ return objectToString(value) === "[object RegExp]";
13
+ }
14
+ function isPlainObject(value) {
15
+ if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
16
+ return false;
17
+ }
18
+ const proto = Object.getPrototypeOf(value);
19
+ return proto === null || Object.getPrototypeOf(proto) === null;
20
+ }
21
+ function valueToNode(value) {
22
+ if (value === undefined) {
23
+ return (0, _index.identifier)("undefined");
24
+ }
25
+ if (value === true || value === false) {
26
+ return (0, _index.booleanLiteral)(value);
27
+ }
28
+ if (value === null) {
29
+ return (0, _index.nullLiteral)();
30
+ }
31
+ if (typeof value === "string") {
32
+ return (0, _index.stringLiteral)(value);
33
+ }
34
+ if (typeof value === "number") {
35
+ let result;
36
+ if (Number.isFinite(value)) {
37
+ result = (0, _index.numericLiteral)(Math.abs(value));
38
+ } else {
39
+ let numerator;
40
+ if (Number.isNaN(value)) {
41
+ numerator = (0, _index.numericLiteral)(0);
42
+ } else {
43
+ numerator = (0, _index.numericLiteral)(1);
44
+ }
45
+ result = (0, _index.binaryExpression)("/", numerator, (0, _index.numericLiteral)(0));
46
+ }
47
+ if (value < 0 || Object.is(value, -0)) {
48
+ result = (0, _index.unaryExpression)("-", result);
49
+ }
50
+ return result;
51
+ }
52
+ if (typeof value === "bigint") {
53
+ if (value < 0) {
54
+ return (0, _index.unaryExpression)("-", (0, _index.bigIntLiteral)(-value));
55
+ } else {
56
+ return (0, _index.bigIntLiteral)(value);
57
+ }
58
+ }
59
+ if (isRegExp(value)) {
60
+ const pattern = value.source;
61
+ const flags = /\/([a-z]*)$/.exec(value.toString())[1];
62
+ return (0, _index.regExpLiteral)(pattern, flags);
63
+ }
64
+ if (Array.isArray(value)) {
65
+ return (0, _index.arrayExpression)(value.map(valueToNode));
66
+ }
67
+ if (isPlainObject(value)) {
68
+ const props = [];
69
+ for (const key of Object.keys(value)) {
70
+ let nodeKey,
71
+ computed = false;
72
+ if ((0, _isValidIdentifier.default)(key)) {
73
+ if (key === "__proto__") {
74
+ computed = true;
75
+ nodeKey = (0, _index.stringLiteral)(key);
76
+ } else {
77
+ nodeKey = (0, _index.identifier)(key);
78
+ }
79
+ } else {
80
+ nodeKey = (0, _index.stringLiteral)(key);
81
+ }
82
+ props.push((0, _index.objectProperty)(nodeKey, valueToNode(value[key]), computed));
83
+ }
84
+ return (0, _index.objectExpression)(props);
85
+ }
86
+ throw new Error("don't know how to turn this value into a node");
87
+ }
88
+
89
+ //# sourceMappingURL=valueToNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_isValidIdentifier","require","_index","_default","exports","default","valueToNode","objectToString","Function","call","bind","Object","prototype","toString","isRegExp","value","isPlainObject","proto","getPrototypeOf","undefined","identifier","booleanLiteral","nullLiteral","stringLiteral","result","Number","isFinite","numericLiteral","Math","abs","numerator","isNaN","binaryExpression","is","unaryExpression","bigIntLiteral","pattern","source","flags","exec","regExpLiteral","Array","isArray","arrayExpression","map","props","key","keys","nodeKey","computed","isValidIdentifier","push","objectProperty","objectExpression","Error"],"sources":["../../src/converters/valueToNode.ts"],"sourcesContent":["import isValidIdentifier from \"../validators/isValidIdentifier.ts\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n bigIntLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default valueToNode as {\n (value: undefined): t.Identifier; // TODO: This should return \"void 0\"\n (value: boolean): t.BooleanLiteral;\n (value: null): t.NullLiteral;\n (value: string): t.StringLiteral;\n // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression\n (value: number): t.NumericLiteral | t.BinaryExpression | t.UnaryExpression;\n (value: bigint): t.BigIntLiteral;\n (value: RegExp): t.RegExpLiteral;\n (value: readonly unknown[]): t.ArrayExpression;\n\n // this throws with objects that are not plain objects,\n // or if there are non-valueToNode-able values\n (value: object): t.ObjectExpression;\n\n (value: unknown): t.Expression;\n};\n\n// @ts-expect-error: Object.prototype.toString must return a string\nconst objectToString: (value: unknown) => string = Function.call.bind(\n Object.prototype.toString,\n);\n\nfunction isRegExp(value: unknown): value is RegExp {\n return objectToString(value) === \"[object RegExp]\";\n}\n\nfunction isPlainObject(value: unknown): value is object {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Object.prototype.toString.call(value) !== \"[object Object]\"\n ) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n // Object.prototype's __proto__ is null. Every other class's __proto__.__proto__ is\n // not null by default. We cannot check if proto === Object.prototype because it\n // could come from another realm.\n return proto === null || Object.getPrototypeOf(proto) === null;\n}\n\nfunction valueToNode(value: unknown): t.Expression {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // bigints\n if (typeof value === \"bigint\") {\n if (value < 0) {\n return unaryExpression(\"-\", bigIntLiteral(-value));\n } else {\n return bigIntLiteral(value);\n }\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = /\\/([a-z]*)$/.exec(value.toString())[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey,\n computed = false;\n if (isValidIdentifier(key)) {\n if (key === \"__proto__\") {\n computed = true;\n nodeKey = stringLiteral(key);\n } else {\n nodeKey = identifier(key);\n }\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(\n objectProperty(\n nodeKey,\n valueToNode(\n // @ts-expect-error key must present in value\n value[key],\n ),\n computed,\n ),\n );\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAawC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGzBC,WAAW;AAmB1B,MAAMC,cAA0C,GAAGC,QAAQ,CAACC,IAAI,CAACC,IAAI,CACnEC,MAAM,CAACC,SAAS,CAACC,QACnB,CAAC;AAED,SAASC,QAAQA,CAACC,KAAc,EAAmB;EACjD,OAAOR,cAAc,CAACQ,KAAK,CAAC,KAAK,iBAAiB;AACpD;AAEA,SAASC,aAAaA,CAACD,KAAc,EAAmB;EACtD,IACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACdJ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACJ,IAAI,CAACM,KAAK,CAAC,KAAK,iBAAiB,EAC3D;IACA,OAAO,KAAK;EACd;EACA,MAAME,KAAK,GAAGN,MAAM,CAACO,cAAc,CAACH,KAAK,CAAC;EAI1C,OAAOE,KAAK,KAAK,IAAI,IAAIN,MAAM,CAACO,cAAc,CAACD,KAAK,CAAC,KAAK,IAAI;AAChE;AAEA,SAASX,WAAWA,CAACS,KAAc,EAAgB;EAEjD,IAAIA,KAAK,KAAKI,SAAS,EAAE;IACvB,OAAO,IAAAC,iBAAU,EAAC,WAAW,CAAC;EAChC;EAGA,IAAIL,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,EAAE;IACrC,OAAO,IAAAM,qBAAc,EAACN,KAAK,CAAC;EAC9B;EAGA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAClB,OAAO,IAAAO,kBAAW,EAAC,CAAC;EACtB;EAGA,IAAI,OAAOP,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAAQ,oBAAa,EAACR,KAAK,CAAC;EAC7B;EAGA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,IAAIS,MAAM;IACV,IAAIC,MAAM,CAACC,QAAQ,CAACX,KAAK,CAAC,EAAE;MAC1BS,MAAM,GAAG,IAAAG,qBAAc,EAACC,IAAI,CAACC,GAAG,CAACd,KAAK,CAAC,CAAC;IAC1C,CAAC,MAAM;MACL,IAAIe,SAAS;MACb,IAAIL,MAAM,CAACM,KAAK,CAAChB,KAAK,CAAC,EAAE;QAEvBe,SAAS,GAAG,IAAAH,qBAAc,EAAC,CAAC,CAAC;MAC/B,CAAC,MAAM;QAELG,SAAS,GAAG,IAAAH,qBAAc,EAAC,CAAC,CAAC;MAC/B;MAEAH,MAAM,GAAG,IAAAQ,uBAAgB,EAAC,GAAG,EAAEF,SAAS,EAAE,IAAAH,qBAAc,EAAC,CAAC,CAAC,CAAC;IAC9D;IAEA,IAAIZ,KAAK,GAAG,CAAC,IAAIJ,MAAM,CAACsB,EAAE,CAAClB,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;MACrCS,MAAM,GAAG,IAAAU,sBAAe,EAAC,GAAG,EAAEV,MAAM,CAAC;IACvC;IAEA,OAAOA,MAAM;EACf;EAGA,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;IAC7B,IAAIA,KAAK,GAAG,CAAC,EAAE;MACb,OAAO,IAAAmB,sBAAe,EAAC,GAAG,EAAE,IAAAC,oBAAa,EAAC,CAACpB,KAAK,CAAC,CAAC;IACpD,CAAC,MAAM;MACL,OAAO,IAAAoB,oBAAa,EAACpB,KAAK,CAAC;IAC7B;EACF;EAGA,IAAID,QAAQ,CAACC,KAAK,CAAC,EAAE;IACnB,MAAMqB,OAAO,GAAGrB,KAAK,CAACsB,MAAM;IAC5B,MAAMC,KAAK,GAAG,aAAa,CAACC,IAAI,CAACxB,KAAK,CAACF,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,IAAA2B,oBAAa,EAACJ,OAAO,EAAEE,KAAK,CAAC;EACtC;EAGA,IAAIG,KAAK,CAACC,OAAO,CAAC3B,KAAK,CAAC,EAAE;IACxB,OAAO,IAAA4B,sBAAe,EAAC5B,KAAK,CAAC6B,GAAG,CAACtC,WAAW,CAAC,CAAC;EAChD;EAGA,IAAIU,aAAa,CAACD,KAAK,CAAC,EAAE;IACxB,MAAM8B,KAAK,GAAG,EAAE;IAChB,KAAK,MAAMC,GAAG,IAAInC,MAAM,CAACoC,IAAI,CAAChC,KAAK,CAAC,EAAE;MACpC,IAAIiC,OAAO;QACTC,QAAQ,GAAG,KAAK;MAClB,IAAI,IAAAC,0BAAiB,EAACJ,GAAG,CAAC,EAAE;QAC1B,IAAIA,GAAG,KAAK,WAAW,EAAE;UACvBG,QAAQ,GAAG,IAAI;UACfD,OAAO,GAAG,IAAAzB,oBAAa,EAACuB,GAAG,CAAC;QAC9B,CAAC,MAAM;UACLE,OAAO,GAAG,IAAA5B,iBAAU,EAAC0B,GAAG,CAAC;QAC3B;MACF,CAAC,MAAM;QACLE,OAAO,GAAG,IAAAzB,oBAAa,EAACuB,GAAG,CAAC;MAC9B;MACAD,KAAK,CAACM,IAAI,CACR,IAAAC,qBAAc,EACZJ,OAAO,EACP1C,WAAW,CAETS,KAAK,CAAC+B,GAAG,CACX,CAAC,EACDG,QACF,CACF,CAAC;IACH;IACA,OAAO,IAAAI,uBAAgB,EAACR,KAAK,CAAC;EAChC;EAEA,MAAM,IAAIS,KAAK,CAAC,+CAA+C,CAAC;AAClE","ignoreList":[]}