funkscript 0.2.4 → 0.2.7

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 (447) hide show
  1. package/README.md +23 -5
  2. package/dist/ast/types.d.ts.map +1 -1
  3. package/dist/ast/types.js.map +1 -1
  4. package/dist/ast/walk.d.ts.map +1 -1
  5. package/dist/ast/walk.js.map +1 -1
  6. package/dist/cli/build-bun.d.ts.map +1 -1
  7. package/dist/cli/build-bun.js.map +1 -1
  8. package/dist/cli/build-watch.d.ts.map +1 -1
  9. package/dist/cli/build-watch.js +9 -27
  10. package/dist/cli/build-watch.js.map +1 -1
  11. package/dist/cli/build.d.ts +1 -1
  12. package/dist/cli/build.d.ts.map +1 -1
  13. package/dist/cli/build.js +3 -58
  14. package/dist/cli/build.js.map +1 -1
  15. package/dist/cli/check-policy.d.ts +9 -0
  16. package/dist/cli/check-policy.d.ts.map +1 -0
  17. package/dist/cli/check-policy.js +39 -0
  18. package/dist/cli/check-policy.js.map +1 -0
  19. package/dist/cli/check.d.ts.map +1 -1
  20. package/dist/cli/check.js +16 -30
  21. package/dist/cli/check.js.map +1 -1
  22. package/dist/cli/commands.d.ts.map +1 -1
  23. package/dist/cli/commands.js +11 -0
  24. package/dist/cli/commands.js.map +1 -1
  25. package/dist/cli/doc.d.ts.map +1 -1
  26. package/dist/cli/doc.js.map +1 -1
  27. package/dist/cli/doctor.d.ts.map +1 -1
  28. package/dist/cli/doctor.js +5 -7
  29. package/dist/cli/doctor.js.map +1 -1
  30. package/dist/cli/emit.d.ts +1 -1
  31. package/dist/cli/emit.d.ts.map +1 -1
  32. package/dist/cli/emit.js.map +1 -1
  33. package/dist/cli/explain.d.ts.map +1 -1
  34. package/dist/cli/explain.js.map +1 -1
  35. package/dist/cli/fmt.d.ts.map +1 -1
  36. package/dist/cli/fmt.js.map +1 -1
  37. package/dist/cli/index.d.ts.map +1 -1
  38. package/dist/cli/index.js +3 -0
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/cli/init.d.ts +1 -1
  41. package/dist/cli/init.d.ts.map +1 -1
  42. package/dist/cli/init.js +66 -21
  43. package/dist/cli/init.js.map +1 -1
  44. package/dist/cli/io.d.ts.map +1 -1
  45. package/dist/cli/io.js.map +1 -1
  46. package/dist/cli/pipeline-style.d.ts.map +1 -1
  47. package/dist/cli/pipeline-style.js.map +1 -1
  48. package/dist/cli/query.d.ts +3 -0
  49. package/dist/cli/query.d.ts.map +1 -0
  50. package/dist/cli/query.js +152 -0
  51. package/dist/cli/query.js.map +1 -0
  52. package/dist/cli/repl.d.ts.map +1 -1
  53. package/dist/cli/repl.js.map +1 -1
  54. package/dist/cli/run.d.ts.map +1 -1
  55. package/dist/cli/run.js +2 -29
  56. package/dist/cli/run.js.map +1 -1
  57. package/dist/cli/test.d.ts +1 -1
  58. package/dist/cli/test.d.ts.map +1 -1
  59. package/dist/cli/test.js.map +1 -1
  60. package/dist/cli/tsc.d.ts.map +1 -1
  61. package/dist/cli/tsc.js +6 -8
  62. package/dist/cli/tsc.js.map +1 -1
  63. package/dist/cli/typecheck.d.ts.map +1 -1
  64. package/dist/cli/typecheck.js.map +1 -1
  65. package/dist/compiler/ast-inspection.d.ts.map +1 -1
  66. package/dist/compiler/ast-inspection.js.map +1 -1
  67. package/dist/compiler/boolean-operators.d.ts.map +1 -1
  68. package/dist/compiler/boolean-operators.js +12 -2
  69. package/dist/compiler/boolean-operators.js.map +1 -1
  70. package/dist/compiler/check.d.ts.map +1 -1
  71. package/dist/compiler/check.js +113 -131
  72. package/dist/compiler/check.js.map +1 -1
  73. package/dist/compiler/diagnostics-json.d.ts +73 -0
  74. package/dist/compiler/diagnostics-json.d.ts.map +1 -0
  75. package/dist/compiler/diagnostics-json.js +957 -0
  76. package/dist/compiler/diagnostics-json.js.map +1 -0
  77. package/dist/compiler/diagnostics.d.ts.map +1 -1
  78. package/dist/compiler/diagnostics.js.map +1 -1
  79. package/dist/compiler/effect-mutation-rule.d.ts.map +1 -1
  80. package/dist/compiler/effect-mutation-rule.js.map +1 -1
  81. package/dist/compiler/entry-rules.d.ts.map +1 -1
  82. package/dist/compiler/entry-rules.js.map +1 -1
  83. package/dist/compiler/escape-audit.d.ts +46 -0
  84. package/dist/compiler/escape-audit.d.ts.map +1 -0
  85. package/dist/compiler/escape-audit.js +682 -0
  86. package/dist/compiler/escape-audit.js.map +1 -0
  87. package/dist/compiler/incremental-build.d.ts.map +1 -1
  88. package/dist/compiler/incremental-build.js.map +1 -1
  89. package/dist/compiler/incremental-dependencies.d.ts.map +1 -1
  90. package/dist/compiler/incremental-dependencies.js.map +1 -1
  91. package/dist/compiler/js-interop-nullability.d.ts.map +1 -1
  92. package/dist/compiler/js-interop-nullability.js.map +1 -1
  93. package/dist/compiler/modules/output-collisions.d.ts.map +1 -1
  94. package/dist/compiler/modules/output-collisions.js.map +1 -1
  95. package/dist/compiler/modules/output-plan.d.ts.map +1 -1
  96. package/dist/compiler/modules/output-plan.js +10 -5
  97. package/dist/compiler/modules/output-plan.js.map +1 -1
  98. package/dist/compiler/modules/resolution.d.ts.map +1 -1
  99. package/dist/compiler/modules/resolution.js +2 -1
  100. package/dist/compiler/modules/resolution.js.map +1 -1
  101. package/dist/compiler/modules/source-files.d.ts +5 -0
  102. package/dist/compiler/modules/source-files.d.ts.map +1 -0
  103. package/dist/compiler/modules/source-files.js +13 -0
  104. package/dist/compiler/modules/source-files.js.map +1 -0
  105. package/dist/compiler/numeric-comparisons.d.ts.map +1 -1
  106. package/dist/compiler/numeric-comparisons.js +13 -7
  107. package/dist/compiler/numeric-comparisons.js.map +1 -1
  108. package/dist/compiler/optional-arguments.d.ts.map +1 -1
  109. package/dist/compiler/optional-arguments.js.map +1 -1
  110. package/dist/compiler/package-fingerprint.d.ts.map +1 -1
  111. package/dist/compiler/package-fingerprint.js.map +1 -1
  112. package/dist/compiler/package-record-contracts.d.ts.map +1 -1
  113. package/dist/compiler/package-record-contracts.js.map +1 -1
  114. package/dist/compiler/pipelines/catalog.d.ts.map +1 -1
  115. package/dist/compiler/pipelines/catalog.js.map +1 -1
  116. package/dist/compiler/pipelines/companions.d.ts.map +1 -1
  117. package/dist/compiler/pipelines/companions.js.map +1 -1
  118. package/dist/compiler/pipelines/resolution.d.ts.map +1 -1
  119. package/dist/compiler/pipelines/resolution.js +24 -23
  120. package/dist/compiler/pipelines/resolution.js.map +1 -1
  121. package/dist/compiler/project-config.d.ts.map +1 -1
  122. package/dist/compiler/project-config.js +29 -19
  123. package/dist/compiler/project-config.js.map +1 -1
  124. package/dist/compiler/query.d.ts +53 -0
  125. package/dist/compiler/query.d.ts.map +1 -0
  126. package/dist/compiler/query.js +781 -0
  127. package/dist/compiler/query.js.map +1 -0
  128. package/dist/compiler/record-contracts.d.ts.map +1 -1
  129. package/dist/compiler/record-contracts.js.map +1 -1
  130. package/dist/compiler/rules/control-flow.d.ts.map +1 -1
  131. package/dist/compiler/rules/control-flow.js.map +1 -1
  132. package/dist/compiler/rules/diagnostic.d.ts.map +1 -1
  133. package/dist/compiler/rules/diagnostic.js.map +1 -1
  134. package/dist/compiler/rules/module-scope-refs.d.ts.map +1 -1
  135. package/dist/compiler/rules/module-scope-refs.js.map +1 -1
  136. package/dist/compiler/rules/resource-escape.d.ts +7 -0
  137. package/dist/compiler/rules/resource-escape.d.ts.map +1 -0
  138. package/dist/compiler/rules/resource-escape.js +146 -0
  139. package/dist/compiler/rules/resource-escape.js.map +1 -0
  140. package/dist/compiler/rules/resource-providers.d.ts +19 -0
  141. package/dist/compiler/rules/resource-providers.d.ts.map +1 -0
  142. package/dist/compiler/rules/resource-providers.js +222 -0
  143. package/dist/compiler/rules/resource-providers.js.map +1 -0
  144. package/dist/compiler/schemas/analysis.d.ts.map +1 -1
  145. package/dist/compiler/schemas/analysis.js.map +1 -1
  146. package/dist/compiler/schemas/imported-record-functions.d.ts.map +1 -1
  147. package/dist/compiler/schemas/imported-record-functions.js.map +1 -1
  148. package/dist/compiler/schemas/imported-schemas.d.ts.map +1 -1
  149. package/dist/compiler/schemas/imported-schemas.js.map +1 -1
  150. package/dist/compiler/source-map.d.ts.map +1 -1
  151. package/dist/compiler/source-map.js +2 -7
  152. package/dist/compiler/source-map.js.map +1 -1
  153. package/dist/compiler/type-view-paths.d.ts +6 -0
  154. package/dist/compiler/type-view-paths.d.ts.map +1 -0
  155. package/dist/compiler/type-view-paths.js +12 -0
  156. package/dist/compiler/type-view-paths.js.map +1 -0
  157. package/dist/compiler/typescript-context.d.ts.map +1 -1
  158. package/dist/compiler/typescript-context.js +5 -7
  159. package/dist/compiler/typescript-context.js.map +1 -1
  160. package/dist/compiler.d.ts.map +1 -1
  161. package/dist/compiler.js.map +1 -1
  162. package/dist/emitter/assemblyscript.d.ts.map +1 -1
  163. package/dist/emitter/assemblyscript.js +120 -136
  164. package/dist/emitter/assemblyscript.js.map +1 -1
  165. package/dist/emitter/declarations.d.ts.map +1 -1
  166. package/dist/emitter/declarations.js.map +1 -1
  167. package/dist/emitter/emitter.d.ts +3 -1
  168. package/dist/emitter/emitter.d.ts.map +1 -1
  169. package/dist/emitter/emitter.js +10 -1
  170. package/dist/emitter/emitter.js.map +1 -1
  171. package/dist/emitter/imports.d.ts.map +1 -1
  172. package/dist/emitter/imports.js.map +1 -1
  173. package/dist/emitter/indent.d.ts.map +1 -1
  174. package/dist/emitter/indent.js.map +1 -1
  175. package/dist/emitter/jsx.d.ts.map +1 -1
  176. package/dist/emitter/jsx.js.map +1 -1
  177. package/dist/emitter/local-bindings.d.ts.map +1 -1
  178. package/dist/emitter/local-bindings.js.map +1 -1
  179. package/dist/emitter/match.d.ts.map +1 -1
  180. package/dist/emitter/match.js.map +1 -1
  181. package/dist/emitter/runtime-helpers.d.ts.map +1 -1
  182. package/dist/emitter/runtime-helpers.js.map +1 -1
  183. package/dist/emitter/schemas.d.ts.map +1 -1
  184. package/dist/emitter/schemas.js.map +1 -1
  185. package/dist/emitter/statements.d.ts +1 -0
  186. package/dist/emitter/statements.d.ts.map +1 -1
  187. package/dist/emitter/statements.js +1 -0
  188. package/dist/emitter/statements.js.map +1 -1
  189. package/dist/emitter/tagged-match.d.ts.map +1 -1
  190. package/dist/emitter/tagged-match.js.map +1 -1
  191. package/dist/emitter/types.d.ts.map +1 -1
  192. package/dist/emitter/types.js.map +1 -1
  193. package/dist/errors.d.ts.map +1 -1
  194. package/dist/errors.js.map +1 -1
  195. package/dist/formatter/comments.d.ts.map +1 -1
  196. package/dist/formatter/comments.js +13 -0
  197. package/dist/formatter/comments.js.map +1 -1
  198. package/dist/formatter/index.d.ts +9 -0
  199. package/dist/formatter/index.d.ts.map +1 -1
  200. package/dist/formatter/index.js +215 -5
  201. package/dist/formatter/index.js.map +1 -1
  202. package/dist/formatter/operator-precedence.d.ts.map +1 -1
  203. package/dist/formatter/operator-precedence.js.map +1 -1
  204. package/dist/formatter/prettier.d.ts.map +1 -1
  205. package/dist/formatter/prettier.js.map +1 -1
  206. package/dist/index.d.ts +3 -0
  207. package/dist/index.d.ts.map +1 -1
  208. package/dist/index.js +3 -0
  209. package/dist/index.js.map +1 -1
  210. package/dist/interop/callback.d.ts.map +1 -1
  211. package/dist/interop/callback.js.map +1 -1
  212. package/dist/interop/js.d.ts.map +1 -1
  213. package/dist/interop/js.js.map +1 -1
  214. package/dist/interop/record.d.ts.map +1 -1
  215. package/dist/interop/record.js.map +1 -1
  216. package/dist/interop/valibot.d.ts.map +1 -1
  217. package/dist/interop/valibot.js.map +1 -1
  218. package/dist/interop/zod.d.ts.map +1 -1
  219. package/dist/interop/zod.js.map +1 -1
  220. package/dist/lexer/lexer.d.ts +1 -0
  221. package/dist/lexer/lexer.d.ts.map +1 -1
  222. package/dist/lexer/lexer.js +26 -10
  223. package/dist/lexer/lexer.js.map +1 -1
  224. package/dist/lexer/tokens.d.ts.map +1 -1
  225. package/dist/lexer/tokens.js.map +1 -1
  226. package/dist/lsp/code-action-worker.d.ts.map +1 -1
  227. package/dist/lsp/code-action-worker.js.map +1 -1
  228. package/dist/lsp/completion.d.ts +25 -0
  229. package/dist/lsp/completion.d.ts.map +1 -1
  230. package/dist/lsp/completion.js +1114 -51
  231. package/dist/lsp/completion.js.map +1 -1
  232. package/dist/lsp/definition.d.ts +2 -0
  233. package/dist/lsp/definition.d.ts.map +1 -1
  234. package/dist/lsp/definition.js +52 -58
  235. package/dist/lsp/definition.js.map +1 -1
  236. package/dist/lsp/diagnostics-worker.d.ts.map +1 -1
  237. package/dist/lsp/diagnostics-worker.js +1 -1
  238. package/dist/lsp/diagnostics-worker.js.map +1 -1
  239. package/dist/lsp/docs.d.ts +1 -1
  240. package/dist/lsp/docs.d.ts.map +1 -1
  241. package/dist/lsp/docs.js +4 -3
  242. package/dist/lsp/docs.js.map +1 -1
  243. package/dist/lsp/error-channel.d.ts.map +1 -1
  244. package/dist/lsp/error-channel.js.map +1 -1
  245. package/dist/lsp/hover.d.ts +5 -1
  246. package/dist/lsp/hover.d.ts.map +1 -1
  247. package/dist/lsp/hover.js +1016 -46
  248. package/dist/lsp/hover.js.map +1 -1
  249. package/dist/lsp/imports.d.ts +2 -0
  250. package/dist/lsp/imports.d.ts.map +1 -1
  251. package/dist/lsp/imports.js +45 -21
  252. package/dist/lsp/imports.js.map +1 -1
  253. package/dist/lsp/index.d.ts.map +1 -1
  254. package/dist/lsp/index.js.map +1 -1
  255. package/dist/lsp/inlay-hints.d.ts.map +1 -1
  256. package/dist/lsp/inlay-hints.js.map +1 -1
  257. package/dist/lsp/interop-rename.d.ts.map +1 -1
  258. package/dist/lsp/interop-rename.js.map +1 -1
  259. package/dist/lsp/match-arms.d.ts.map +1 -1
  260. package/dist/lsp/match-arms.js.map +1 -1
  261. package/dist/lsp/navigation.d.ts +1 -1
  262. package/dist/lsp/navigation.d.ts.map +1 -1
  263. package/dist/lsp/navigation.js +30 -12
  264. package/dist/lsp/navigation.js.map +1 -1
  265. package/dist/lsp/parsed-documents.d.ts.map +1 -1
  266. package/dist/lsp/parsed-documents.js.map +1 -1
  267. package/dist/lsp/range-format.d.ts +4 -0
  268. package/dist/lsp/range-format.d.ts.map +1 -0
  269. package/dist/lsp/range-format.js +88 -0
  270. package/dist/lsp/range-format.js.map +1 -0
  271. package/dist/lsp/rename-worker.d.ts.map +1 -1
  272. package/dist/lsp/rename-worker.js.map +1 -1
  273. package/dist/lsp/schema-import-hover.d.ts +8 -0
  274. package/dist/lsp/schema-import-hover.d.ts.map +1 -0
  275. package/dist/lsp/schema-import-hover.js +52 -0
  276. package/dist/lsp/schema-import-hover.js.map +1 -0
  277. package/dist/lsp/server.d.ts +3 -1
  278. package/dist/lsp/server.d.ts.map +1 -1
  279. package/dist/lsp/server.js +73 -48
  280. package/dist/lsp/server.js.map +1 -1
  281. package/dist/lsp/signature-help.d.ts +6 -0
  282. package/dist/lsp/signature-help.d.ts.map +1 -0
  283. package/dist/lsp/signature-help.js +183 -0
  284. package/dist/lsp/signature-help.js.map +1 -0
  285. package/dist/lsp/thunk-pipeline.d.ts.map +1 -1
  286. package/dist/lsp/thunk-pipeline.js.map +1 -1
  287. package/dist/lsp/validation.d.ts.map +1 -1
  288. package/dist/lsp/validation.js +3 -2
  289. package/dist/lsp/validation.js.map +1 -1
  290. package/dist/lsp/workspace.d.ts +3 -1
  291. package/dist/lsp/workspace.d.ts.map +1 -1
  292. package/dist/lsp/workspace.js +66 -10
  293. package/dist/lsp/workspace.js.map +1 -1
  294. package/dist/parser/declarations.d.ts.map +1 -1
  295. package/dist/parser/declarations.js +22 -1
  296. package/dist/parser/declarations.js.map +1 -1
  297. package/dist/parser/errors.d.ts.map +1 -1
  298. package/dist/parser/errors.js.map +1 -1
  299. package/dist/parser/jsx.d.ts.map +1 -1
  300. package/dist/parser/jsx.js.map +1 -1
  301. package/dist/parser/operator-expressions.d.ts.map +1 -1
  302. package/dist/parser/operator-expressions.js.map +1 -1
  303. package/dist/parser/parser.d.ts.map +1 -1
  304. package/dist/parser/parser.js.map +1 -1
  305. package/dist/parser/patterns.d.ts.map +1 -1
  306. package/dist/parser/patterns.js.map +1 -1
  307. package/dist/parser/pipeline-expressions.d.ts.map +1 -1
  308. package/dist/parser/pipeline-expressions.js.map +1 -1
  309. package/dist/parser/scope.d.ts.map +1 -1
  310. package/dist/parser/scope.js.map +1 -1
  311. package/dist/parser/statements.d.ts.map +1 -1
  312. package/dist/parser/statements.js.map +1 -1
  313. package/dist/parser/types.d.ts.map +1 -1
  314. package/dist/parser/types.js.map +1 -1
  315. package/dist/plugins/bun-preload.d.ts.map +1 -1
  316. package/dist/plugins/bun-preload.js.map +1 -1
  317. package/dist/plugins/bun.d.ts +2 -18
  318. package/dist/plugins/bun.d.ts.map +1 -1
  319. package/dist/plugins/bun.js +5 -30
  320. package/dist/plugins/bun.js.map +1 -1
  321. package/dist/plugins/esbuild.d.ts +1 -1
  322. package/dist/plugins/esbuild.d.ts.map +1 -1
  323. package/dist/plugins/esbuild.js +10 -36
  324. package/dist/plugins/esbuild.js.map +1 -1
  325. package/dist/plugins/server-boundary.d.ts +14 -0
  326. package/dist/plugins/server-boundary.d.ts.map +1 -0
  327. package/dist/plugins/server-boundary.js +25 -0
  328. package/dist/plugins/server-boundary.js.map +1 -0
  329. package/dist/plugins/type-view.d.ts.map +1 -1
  330. package/dist/plugins/type-view.js +5 -3
  331. package/dist/plugins/type-view.js.map +1 -1
  332. package/dist/plugins/vite.d.ts +2 -18
  333. package/dist/plugins/vite.d.ts.map +1 -1
  334. package/dist/plugins/vite.js +4 -29
  335. package/dist/plugins/vite.js.map +1 -1
  336. package/dist/testing/index.d.ts.map +1 -1
  337. package/dist/testing/index.js.map +1 -1
  338. package/dist/tooling/doc.d.ts.map +1 -1
  339. package/dist/tooling/doc.js.map +1 -1
  340. package/dist/tooling/idiomatic.d.ts.map +1 -1
  341. package/dist/tooling/idiomatic.js.map +1 -1
  342. package/dist/tooling/pipeline-style.d.ts.map +1 -1
  343. package/dist/tooling/pipeline-style.js.map +1 -1
  344. package/dist/version.d.ts.map +1 -1
  345. package/dist/version.js.map +1 -1
  346. package/package.json +13 -6
  347. package/src/cli/build-watch.ts +10 -29
  348. package/src/cli/build.ts +9 -60
  349. package/src/cli/check-policy.ts +54 -0
  350. package/src/cli/check.ts +19 -31
  351. package/src/cli/commands.ts +13 -0
  352. package/src/cli/doctor.ts +10 -7
  353. package/src/cli/index.ts +3 -0
  354. package/src/cli/init.ts +66 -21
  355. package/src/cli/query.ts +191 -0
  356. package/src/cli/run.ts +5 -30
  357. package/src/cli/tsc.ts +10 -8
  358. package/src/compiler/boolean-operators.ts +11 -2
  359. package/src/compiler/check.ts +152 -180
  360. package/src/compiler/diagnostics-json.ts +1205 -0
  361. package/src/compiler/escape-audit.ts +913 -0
  362. package/src/compiler/modules/output-plan.ts +11 -9
  363. package/src/compiler/modules/resolution.ts +2 -1
  364. package/src/compiler/modules/source-files.ts +13 -0
  365. package/src/compiler/numeric-comparisons.ts +14 -8
  366. package/src/compiler/pipelines/resolution.ts +30 -26
  367. package/src/compiler/project-config.ts +30 -19
  368. package/src/compiler/query.ts +1177 -0
  369. package/src/compiler/rules/resource-escape.ts +223 -0
  370. package/src/compiler/rules/resource-providers.ts +293 -0
  371. package/src/compiler/source-map.ts +3 -7
  372. package/src/compiler/type-view-paths.ts +10 -0
  373. package/src/compiler/typescript-context.ts +6 -7
  374. package/src/emitter/assemblyscript.ts +101 -147
  375. package/src/emitter/emitter.ts +13 -1
  376. package/src/emitter/statements.ts +2 -0
  377. package/src/formatter/comments.ts +14 -0
  378. package/src/formatter/index.ts +299 -4
  379. package/src/index.ts +3 -0
  380. package/src/lexer/lexer.ts +39 -20
  381. package/src/lsp/completion.ts +1452 -66
  382. package/src/lsp/definition.ts +50 -58
  383. package/src/lsp/diagnostics-worker.ts +1 -4
  384. package/src/lsp/docs.ts +4 -3
  385. package/src/lsp/hover.ts +1465 -44
  386. package/src/lsp/imports.ts +75 -22
  387. package/src/lsp/navigation.ts +41 -22
  388. package/src/lsp/range-format.ts +102 -0
  389. package/src/lsp/schema-import-hover.ts +76 -0
  390. package/src/lsp/server.ts +99 -69
  391. package/src/lsp/signature-help.ts +226 -0
  392. package/src/lsp/validation.ts +3 -2
  393. package/src/lsp/workspace.ts +63 -9
  394. package/src/parser/declarations.ts +27 -1
  395. package/src/plugins/bun.ts +14 -66
  396. package/src/plugins/esbuild.ts +16 -55
  397. package/src/plugins/server-boundary.ts +41 -0
  398. package/src/plugins/type-view.ts +11 -3
  399. package/src/plugins/vite.ts +12 -62
  400. package/dist/Widget.tsx +0 -9
  401. package/dist/cli/output-collisions.d.ts +0 -2
  402. package/dist/cli/output-collisions.d.ts.map +0 -1
  403. package/dist/cli/output-collisions.js +0 -39
  404. package/dist/cli/output-collisions.js.map +0 -1
  405. package/dist/compiler/imported-record-functions.d.ts +0 -4
  406. package/dist/compiler/imported-record-functions.d.ts.map +0 -1
  407. package/dist/compiler/imported-record-functions.js +0 -706
  408. package/dist/compiler/imported-record-functions.js.map +0 -1
  409. package/dist/compiler/imported-schemas.d.ts +0 -21
  410. package/dist/compiler/imported-schemas.d.ts.map +0 -1
  411. package/dist/compiler/imported-schemas.js +0 -461
  412. package/dist/compiler/imported-schemas.js.map +0 -1
  413. package/dist/compiler/module-resolution.d.ts +0 -6
  414. package/dist/compiler/module-resolution.d.ts.map +0 -1
  415. package/dist/compiler/module-resolution.js +0 -44
  416. package/dist/compiler/module-resolution.js.map +0 -1
  417. package/dist/compiler/pipeline-companions.d.ts +0 -18
  418. package/dist/compiler/pipeline-companions.d.ts.map +0 -1
  419. package/dist/compiler/pipeline-companions.js +0 -1042
  420. package/dist/compiler/pipeline-companions.js.map +0 -1
  421. package/dist/compiler/providers.d.ts +0 -4
  422. package/dist/compiler/providers.d.ts.map +0 -1
  423. package/dist/compiler/providers.js +0 -101
  424. package/dist/compiler/providers.js.map +0 -1
  425. package/dist/emitter/pipeline-catalog.d.ts +0 -15
  426. package/dist/emitter/pipeline-catalog.d.ts.map +0 -1
  427. package/dist/emitter/pipeline-catalog.js +0 -55
  428. package/dist/emitter/pipeline-catalog.js.map +0 -1
  429. package/dist/emitter/pipeline-resolution.d.ts +0 -38
  430. package/dist/emitter/pipeline-resolution.d.ts.map +0 -1
  431. package/dist/emitter/pipeline-resolution.js +0 -571
  432. package/dist/emitter/pipeline-resolution.js.map +0 -1
  433. package/dist/interop/index.d.ts +0 -6
  434. package/dist/interop/index.d.ts.map +0 -1
  435. package/dist/interop/index.js +0 -6
  436. package/dist/interop/index.js.map +0 -1
  437. package/dist/math.ts +0 -1
  438. package/dist/parser/index.d.ts +0 -9
  439. package/dist/parser/index.d.ts.map +0 -1
  440. package/dist/parser/index.js +0 -9
  441. package/dist/parser/index.js.map +0 -1
  442. package/dist/service.ts +0 -3
  443. package/dist/service.ts.map +0 -1
  444. package/dist/tooling/migrate.d.ts +0 -62
  445. package/dist/tooling/migrate.d.ts.map +0 -1
  446. package/dist/tooling/migrate.js +0 -608
  447. package/dist/tooling/migrate.js.map +0 -1
package/src/cli/init.ts CHANGED
@@ -67,17 +67,17 @@ dist/
67
67
  check: "funkscript check",
68
68
  },
69
69
  dependencies: {
70
- effect: "^3.10.0",
70
+ effect: "^4.1.2",
71
+ funkscript: `^${FUNSCRIPT_VERSION}`,
71
72
  },
72
73
  devDependencies: {
73
- "@types/bun": "latest",
74
- funkscript: `^${FUNSCRIPT_VERSION}`,
74
+ "@types/bun": "^1.4.4",
75
75
  },
76
76
  },
77
77
  null,
78
78
  2,
79
79
  ),
80
- "bunfig.toml": `preload = ["funkscript/bun"]\n`,
80
+ "bunfig.toml": `preload = ["funkscript/bun/preload"]\n`,
81
81
  "tsconfig.json": JSON.stringify(
82
82
  {
83
83
  compilerOptions: {
@@ -94,21 +94,18 @@ dist/
94
94
  2,
95
95
  ),
96
96
  ".gitignore": gitignore,
97
- "src/index.fun": `import { Console } from "effect"
97
+ "src/index.fun": `ts { const startServer = (handler: (req: Request) => Response) => Bun.serve({ port: 3000, fetch: handler }); }
98
98
 
99
- export handleRequest = (req: Request): Response =>
100
- new Response("Hello from FunkScript on Bun!", {
101
- headers: { "content-type": "text/plain" }
102
- })
99
+ export handleRequest = (_req: Request): Response => Response("Hello from FunkScript on Bun!")
103
100
 
104
- export main = Console.log("FunkScript Bun server ready on http://localhost:3000")
101
+ export main = () => startServer(handleRequest)
105
102
  `,
106
103
  "tests/server.test.fun": `import { describe, it, expect } from "funkscript/test"
107
104
  import { handleRequest } from "../src/index.fun"
108
105
 
109
106
  suite = describe("HTTP Server", () =>
110
107
  it("returns 200 OK greeting", () =>
111
- req = new Request("http://localhost:3000/")
108
+ req = Request("http://localhost:3000/")
112
109
  res = handleRequest(req)
113
110
  => expect(res.status).toBe(200)
114
111
  )
@@ -123,7 +120,7 @@ FunkScript application running on the Bun runtime with native \`bunfig.toml\` pr
123
120
  bun install
124
121
  bun run dev # run live in watch mode with Bun
125
122
  bun run test # run tests with native bun test
126
- bun run build # bundle standalone executable with fast native Bun
123
+ bun run build # bundle an executable for Bun
127
124
  \`\`\`
128
125
  `,
129
126
  };
@@ -137,11 +134,13 @@ bun run build # bundle standalone executable with fast native Bun
137
134
  type: "module",
138
135
  scripts: {
139
136
  dev: "vite",
140
- build: "vite build",
137
+ build: "vite build && tsc --noEmit",
141
138
  test: "funkscript test",
142
139
  fmt: "funkscript fmt src",
143
140
  },
144
141
  dependencies: {
142
+ effect: "^4.1.2",
143
+ funkscript: `^${FUNSCRIPT_VERSION}`,
145
144
  react: "^19.0.0",
146
145
  "react-dom": "^19.0.0",
147
146
  },
@@ -149,7 +148,6 @@ bun run build # bundle standalone executable with fast native Bun
149
148
  "@types/react": "^19.0.0",
150
149
  "@types/react-dom": "^19.0.0",
151
150
  "@vitejs/plugin-react": "^4.3.4",
152
- funkscript: `^${FUNSCRIPT_VERSION}`,
153
151
  typescript: "^5.6.3",
154
152
  vite: "^5.4.11",
155
153
  vitest: "^2.1.8",
@@ -163,7 +161,7 @@ import react from "@vitejs/plugin-react";
163
161
  import { funscriptPlugin } from "funkscript/vite";
164
162
 
165
163
  export default defineConfig({
166
- plugins: [funscriptPlugin(), react()],
164
+ plugins: [funscriptPlugin({ types: { include: ["src"] } }), react()],
167
165
  });
168
166
  `,
169
167
  "index.html": `<!DOCTYPE html>
@@ -186,6 +184,8 @@ export default defineConfig({
186
184
  module: "ESNext",
187
185
  moduleResolution: "bundler",
188
186
  jsx: "react-jsx",
187
+ allowArbitraryExtensions: true,
188
+ rootDirs: [".", "./.funscript/types"],
189
189
  strict: true,
190
190
  skipLibCheck: true,
191
191
  },
@@ -217,6 +217,19 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
217
217
  <App />
218
218
  </React.StrictMode>
219
219
  );
220
+ `,
221
+ "tests/app.test.ts": `import { describe, it, expect } from "vitest";
222
+ import React from "react";
223
+ import { renderToStaticMarkup } from "react-dom/server";
224
+ import { App } from "../src/App.funx";
225
+
226
+ describe("App", () => {
227
+ it("renders the initial page", () => {
228
+ const html = renderToStaticMarkup(React.createElement(App));
229
+ expect(html).toContain("FunkScript + React");
230
+ expect(html).toContain("Count: 0");
231
+ });
232
+ });
220
233
  `,
221
234
  "README.md": `# ${projectName}
222
235
 
@@ -240,15 +253,16 @@ npm run build # build production bundle
240
253
  type: "module",
241
254
  scripts: {
242
255
  dev: "vite",
243
- build: "vite build",
256
+ build: "vite build && tsc --noEmit",
244
257
  test: "funkscript test",
245
258
  fmt: "funkscript fmt src",
246
259
  },
247
260
  dependencies: {
261
+ effect: "^4.1.2",
262
+ funkscript: `^${FUNSCRIPT_VERSION}`,
248
263
  "solid-js": "^1.9.3",
249
264
  },
250
265
  devDependencies: {
251
- funkscript: `^${FUNSCRIPT_VERSION}`,
252
266
  typescript: "^5.6.3",
253
267
  vite: "^5.4.11",
254
268
  "vite-plugin-solid": "^2.11.0",
@@ -263,7 +277,16 @@ import solid from "vite-plugin-solid";
263
277
  import { funscriptPlugin } from "funkscript/vite";
264
278
 
265
279
  export default defineConfig({
266
- plugins: [funscriptPlugin(), solid()],
280
+ plugins: [funscriptPlugin({ types: { include: ["src"] } }), solid({ extensions: [[".funx", { typescript: true }]] })],
281
+ });
282
+ `,
283
+ "vitest.config.ts": `import { defineConfig } from "vitest/config";
284
+ import solid from "vite-plugin-solid";
285
+ import { funscriptPlugin } from "funkscript/vite";
286
+
287
+ export default defineConfig({
288
+ plugins: [funscriptPlugin(), solid({ ssr: true, extensions: [[".funx", { typescript: true }]] })],
289
+ test: { environment: "node" },
267
290
  });
268
291
  `,
269
292
  "index.html": `<!DOCTYPE html>
@@ -287,6 +310,8 @@ export default defineConfig({
287
310
  moduleResolution: "bundler",
288
311
  jsx: "preserve",
289
312
  jsxImportSource: "solid-js",
313
+ allowArbitraryExtensions: true,
314
+ rootDirs: [".", "./.funscript/types"],
290
315
  strict: true,
291
316
  skipLibCheck: true,
292
317
  },
@@ -301,7 +326,7 @@ export default defineConfig({
301
326
  export App = () =>
302
327
  [count, setCount] = createSignal(0)
303
328
 
304
- => <div style={{ padding: "2rem", fontFamily: "sans-serif" }}>
329
+ => <div style="padding: 2rem; font-family: sans-serif">
305
330
  <h1>FunkScript + Solid</h1>
306
331
  <p>Fine-grained reactive UI built with FunkScript JSX.</p>
307
332
  <button onClick={() => setCount(count() + 1)}>
@@ -313,6 +338,18 @@ export App = () =>
313
338
  import { App } from "./App.funx";
314
339
 
315
340
  render(() => <App />, document.getElementById("root")!);
341
+ `,
342
+ "tests/app.test.ts": `import { describe, it, expect } from "vitest";
343
+ import { renderToString } from "solid-js/web";
344
+ import { App } from "../src/App.funx";
345
+
346
+ describe("App", () => {
347
+ it("renders the initial page", () => {
348
+ const html = renderToString(() => App());
349
+ expect(html).toContain("FunkScript + Solid");
350
+ expect(html).toContain("Count:");
351
+ });
352
+ });
316
353
  `,
317
354
  "README.md": `# ${projectName}
318
355
 
@@ -343,10 +380,10 @@ npm run build # build production bundle
343
380
  check: "funkscript check",
344
381
  },
345
382
  dependencies: {
346
- effect: "^3.10.0",
383
+ effect: "^4.1.2",
384
+ funkscript: `^${FUNSCRIPT_VERSION}`,
347
385
  },
348
386
  devDependencies: {
349
- funkscript: `^${FUNSCRIPT_VERSION}`,
350
387
  typescript: "^5.6.3",
351
388
  vitest: "^2.1.8",
352
389
  },
@@ -369,6 +406,14 @@ npm run build # build production bundle
369
406
  null,
370
407
  2,
371
408
  ),
409
+ "vitest.config.ts": `import { defineConfig, configDefaults } from "vitest/config";
410
+ import { funscriptPlugin } from "funkscript/vite";
411
+
412
+ export default defineConfig({
413
+ plugins: [funscriptPlugin()],
414
+ test: { globals: true, include: [...configDefaults.include, "**/*.{test,spec}.{fun,funx}"] },
415
+ });
416
+ `,
372
417
  ".gitignore": gitignore,
373
418
  "src/main.fun": `import { Console, pipe, Array } from "effect"
374
419
 
@@ -0,0 +1,191 @@
1
+ import * as Console from "effect/Console";
2
+ import * as Effect from "effect/Effect";
3
+ import * as fs from "node:fs/promises";
4
+ import {
5
+ auditEscapeHatchesFiles,
6
+ formatEscapeAudit,
7
+ type EscapeAuditReport,
8
+ } from "../compiler/escape-audit.js";
9
+ import { formatQueryReport, queryFiles } from "../compiler/query.js";
10
+ import { toErrorMessage } from "../errors.js";
11
+ import { findFunFiles } from "./io.js";
12
+
13
+ const USAGE =
14
+ "Usage: funkscript query [file.fun|file.funx...] [--symbol <name>] [--escapes] [--json]";
15
+
16
+ interface ParsedQueryArgs {
17
+ files: string[];
18
+ symbol?: string;
19
+ escapes: boolean;
20
+ json: boolean;
21
+ }
22
+
23
+ function parseQueryArgs(args: string[]): ParsedQueryArgs | string {
24
+ const files: string[] = [];
25
+ let symbol: string | undefined;
26
+ let escapes = false;
27
+ let json = false;
28
+
29
+ for (let i = 0; i < args.length; i++) {
30
+ const arg = args[i];
31
+ if (arg === "--json") {
32
+ json = true;
33
+ } else if (arg === "--escapes") {
34
+ escapes = true;
35
+ } else if (arg === "--symbol") {
36
+ const value = args[i + 1];
37
+ if (!value || value.startsWith("-")) {
38
+ return "Option '--symbol' requires a value.";
39
+ }
40
+ symbol = value;
41
+ i++;
42
+ } else if (arg.startsWith("--symbol=")) {
43
+ const value = arg.slice("--symbol=".length);
44
+ if (!value) {
45
+ return "Option '--symbol' requires a value.";
46
+ }
47
+ symbol = value;
48
+ } else if (arg.startsWith("-")) {
49
+ return `Unknown option '${arg}' for 'query'. ${USAGE}`;
50
+ } else {
51
+ files.push(arg);
52
+ }
53
+ }
54
+
55
+ return { files, symbol, escapes, json };
56
+ }
57
+
58
+ function filterEscapeReportBySymbol(
59
+ report: EscapeAuditReport,
60
+ symbol: string,
61
+ ): EscapeAuditReport {
62
+ const counts = {
63
+ rawTs: 0,
64
+ jsInterop: 0,
65
+ wildcardMatch: 0,
66
+ typedHole: 0,
67
+ total: 0,
68
+ };
69
+ const files = report.files.map((fileReport) => {
70
+ const findings = fileReport.findings.filter(
71
+ (f) => f.declaration === symbol,
72
+ );
73
+ const fileCounts = {
74
+ rawTs: 0,
75
+ jsInterop: 0,
76
+ wildcardMatch: 0,
77
+ typedHole: 0,
78
+ total: findings.length,
79
+ };
80
+ for (const finding of findings) {
81
+ switch (finding.kind) {
82
+ case "raw-ts":
83
+ fileCounts.rawTs += 1;
84
+ counts.rawTs += 1;
85
+ break;
86
+ case "js-interop":
87
+ fileCounts.jsInterop += 1;
88
+ counts.jsInterop += 1;
89
+ break;
90
+ case "wildcard-match":
91
+ fileCounts.wildcardMatch += 1;
92
+ counts.wildcardMatch += 1;
93
+ break;
94
+ case "typed-hole":
95
+ fileCounts.typedHole += 1;
96
+ counts.typedHole += 1;
97
+ break;
98
+ }
99
+ }
100
+ counts.total += fileCounts.total;
101
+ return {
102
+ file: fileReport.file,
103
+ counts: fileCounts,
104
+ findings,
105
+ };
106
+ });
107
+
108
+ return {
109
+ schemaVersion: 1,
110
+ counts,
111
+ files,
112
+ };
113
+ }
114
+
115
+ function resolveQueryTargets(
116
+ rawTargets: string[],
117
+ ): Effect.Effect<string[], Error> {
118
+ return Effect.gen(function* () {
119
+ if (rawTargets.length === 0) {
120
+ const hasSrc = yield* Effect.promise(() =>
121
+ fs
122
+ .stat("src")
123
+ .then((stat) => stat.isDirectory())
124
+ .catch(() => false),
125
+ );
126
+ const searchDir = hasSrc ? "src" : ".";
127
+ return yield* Effect.tryPromise({
128
+ try: () => findFunFiles(searchDir),
129
+ catch: (error: unknown) =>
130
+ new Error(
131
+ `Failed to scan files in '${searchDir}': ${toErrorMessage(error)}`,
132
+ ),
133
+ });
134
+ }
135
+
136
+ const resolved: string[] = [];
137
+ for (const target of rawTargets) {
138
+ const stat = yield* Effect.tryPromise({
139
+ try: () => fs.stat(target),
140
+ catch: (error: unknown) =>
141
+ new Error(
142
+ `File or directory '${target}' not found: ${toErrorMessage(error)}`,
143
+ ),
144
+ });
145
+ if (stat.isDirectory()) {
146
+ const nested = yield* Effect.tryPromise({
147
+ try: () => findFunFiles(target),
148
+ catch: (error: unknown) =>
149
+ new Error(
150
+ `Failed to scan files in '${target}': ${toErrorMessage(error)}`,
151
+ ),
152
+ });
153
+ resolved.push(...nested);
154
+ } else {
155
+ resolved.push(target);
156
+ }
157
+ }
158
+ return resolved;
159
+ });
160
+ }
161
+
162
+ export const queryCommand = (args: string[]): Effect.Effect<void, Error> =>
163
+ Effect.gen(function* () {
164
+ const parsed = parseQueryArgs(args);
165
+ if (typeof parsed === "string") {
166
+ process.exitCode = 1;
167
+ yield* Console.error(parsed);
168
+ return;
169
+ }
170
+
171
+ const filesToQuery = yield* resolveQueryTargets(parsed.files);
172
+ if (filesToQuery.length === 0) {
173
+ yield* Console.error(USAGE);
174
+ return;
175
+ }
176
+
177
+ if (parsed.escapes) {
178
+ const rawReport = yield* auditEscapeHatchesFiles(filesToQuery);
179
+ const report = parsed.symbol
180
+ ? filterEscapeReportBySymbol(rawReport, parsed.symbol)
181
+ : rawReport;
182
+ yield* Console.log(formatEscapeAudit(report, { json: parsed.json }));
183
+ return;
184
+ }
185
+
186
+ const report = yield* queryFiles(
187
+ filesToQuery,
188
+ parsed.symbol ? { symbol: parsed.symbol } : undefined,
189
+ );
190
+ yield* Console.log(formatQueryReport(report, { json: parsed.json }));
191
+ });
package/src/cli/run.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  import { buildRunBundle, isBunAvailable } from "./build-bun.js";
11
11
  import { checkNoTsPaths } from "./io.js";
12
12
  import { checkCliFiles } from "./typecheck.js";
13
+ import { commandCheckOptions } from "./check-policy.js";
13
14
 
14
15
  let projectPolicy: FunScriptProjectConfig = {};
15
16
  const checkNoTsPathsProxy = (
@@ -69,36 +70,10 @@ export const runCommand = (
69
70
  return;
70
71
  if (
71
72
  !commandArgs.includes("--no-check") &&
72
- !(yield* checkCliFiles([filePath], {
73
- noTs: commandArgs.includes("--no-ts"),
74
- noGlobalThis: commandArgs.includes("--no-global-this"),
75
- barePipelines: commandArgs.includes("--bare-pipelines"),
76
- noDeepDestructure:
77
- commandArgs.includes("--no-deep-destructure") ||
78
- projectPolicy.noDeepDestructure === true,
79
- maxDestructureDepth: projectPolicy.maxDestructureDepth,
80
- effectOnly: projectPolicy.effectOnly,
81
- noTsPaths: Array.isArray(projectPolicy.noTs)
82
- ? projectPolicy.noTs
83
- : undefined,
84
- noGlobalThisPaths: Array.isArray(projectPolicy.noGlobalThis)
85
- ? projectPolicy.noGlobalThis
86
- : undefined,
87
- barePipelinesPaths: Array.isArray(projectPolicy.barePipelines)
88
- ? projectPolicy.barePipelines
89
- : undefined,
90
- noDeepDestructurePaths: Array.isArray(projectPolicy.noDeepDestructure)
91
- ? projectPolicy.noDeepDestructure
92
- : undefined,
93
- allowHoles: projectPolicy.allowHoles === true,
94
- allowHolesPaths: Array.isArray(projectPolicy.allowHoles)
95
- ? projectPolicy.allowHoles
96
- : undefined,
97
- allowEarlyReturns: projectPolicy.allowEarlyReturns === true,
98
- allowEarlyReturnsPaths: Array.isArray(projectPolicy.allowEarlyReturns)
99
- ? projectPolicy.allowEarlyReturns
100
- : undefined,
101
- }))
73
+ !(yield* checkCliFiles(
74
+ [filePath],
75
+ commandCheckOptions(projectPolicy, commandArgs),
76
+ ))
102
77
  )
103
78
  return;
104
79
 
package/src/cli/tsc.ts CHANGED
@@ -12,6 +12,12 @@ import {
12
12
  typeCheckFiles,
13
13
  } from "../compiler/check.js";
14
14
  import { FunScriptError, isFileNotFoundError } from "../errors.js";
15
+ import {
16
+ DEFAULT_TYPE_VIEW_DIR,
17
+ TYPE_VIEW_MANIFEST,
18
+ typeViewManifestSources,
19
+ } from "../compiler/type-view-paths.js";
20
+ import { isFunSourceFile } from "../compiler/modules/source-files.js";
15
21
  import { rewriteRelativeImports } from "../plugins/type-view.js";
16
22
 
17
23
  /** Run the project's TypeScript compiler, mapping verified type-view diagnostics. */
@@ -46,9 +52,9 @@ export async function runTsc(
46
52
  child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 1 }));
47
53
  });
48
54
 
49
- const outDir = path.join(cwd, ".funscript", "types");
55
+ const outDir = path.join(cwd, DEFAULT_TYPE_VIEW_DIR);
50
56
  const manifest: unknown = await fs
51
- .readFile(path.join(outDir, ".funscript-type-view.json"), "utf8")
57
+ .readFile(path.join(outDir, TYPE_VIEW_MANIFEST), "utf8")
52
58
  .then(
53
59
  (text) => {
54
60
  try {
@@ -61,13 +67,9 @@ export async function runTsc(
61
67
  () => [],
62
68
  );
63
69
  const views = new Map<string, string>();
64
- const manifestFiles = Array.isArray(manifest)
65
- ? manifest
66
- : manifest && typeof manifest === "object"
67
- ? Object.keys(manifest)
68
- : [];
70
+ const manifestFiles = typeViewManifestSources(manifest);
69
71
  for (const item of manifestFiles) {
70
- if (typeof item !== "string" || !/\.funx?$/.test(item)) continue;
72
+ if (typeof item !== "string" || !isFunSourceFile(item)) continue;
71
73
  const original = path.resolve(cwd, item);
72
74
  const relative = path.relative(cwd, original);
73
75
  if (relative.startsWith("..") || path.isAbsolute(relative)) continue;
@@ -92,8 +92,17 @@ export function validateBooleanOperators(
92
92
  ts.isNumericLiteral(node.arguments[0]) &&
93
93
  ts.isStringLiteral(node.arguments[1])
94
94
  ) {
95
- const type = checker.getTypeAtLocation(node.arguments[2]);
96
- if (!isDefinitelyBoolean(type)) {
95
+ const operand = node.arguments[2];
96
+ const type = checker.getTypeAtLocation(operand);
97
+ let definitelyBoolean = isDefinitelyBoolean(type);
98
+ if (!definitelyBoolean && ts.isCallExpression(operand)) {
99
+ const signature = checker.getResolvedSignature(operand);
100
+ const predicate = signature
101
+ ? checker.getTypePredicateOfSignature(signature)
102
+ : undefined;
103
+ if (predicate) definitelyBoolean = true;
104
+ }
105
+ if (!definitelyBoolean) {
97
106
  const operator = node.arguments[1].text;
98
107
  const received = checker.typeToString(type);
99
108
  throw new FunScriptError(