@nudojs/cli 0.1.0 → 0.2.1

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 (65) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +34 -0
  4. package/dist/chunk-3HCPXPEW.js +5286 -0
  5. package/dist/evaluator-api.d.ts +96 -2
  6. package/dist/evaluator-api.js +191 -3
  7. package/dist/index.js +595 -120
  8. package/examples/real-world.js +66 -0
  9. package/examples/validate-real-world.ts +160 -0
  10. package/package.json +28 -3
  11. package/src/__tests__/builtin-advanced.test.ts +292 -0
  12. package/src/__tests__/builtin-api.test.ts +308 -0
  13. package/src/__tests__/builtin-functions.test.ts +313 -0
  14. package/src/__tests__/builtin-map.test.ts +129 -0
  15. package/src/__tests__/builtin-promise.test.ts +150 -0
  16. package/src/__tests__/builtin-regexp.test.ts +133 -0
  17. package/src/__tests__/builtin-set.test.ts +163 -0
  18. package/src/__tests__/builtin-url.test.ts +256 -0
  19. package/src/__tests__/builtin-web.test.ts +340 -0
  20. package/src/__tests__/combination-scenarios.test.ts +384 -0
  21. package/src/__tests__/edge-cases.test.ts +749 -0
  22. package/src/__tests__/evaluator-loops.test.ts +283 -0
  23. package/src/__tests__/evaluator-nullish-coalescing.test.ts +86 -0
  24. package/src/__tests__/evaluator-optional-chaining.test.ts +37 -0
  25. package/src/__tests__/evaluator-phase3.test.ts +353 -2
  26. package/src/__tests__/evaluator-refined.test.ts +121 -0
  27. package/src/__tests__/evaluator-string-methods.test.ts +151 -0
  28. package/src/__tests__/evaluator.test.ts +702 -2
  29. package/src/__tests__/mock-arrow-function.test.ts +169 -0
  30. package/src/__tests__/mock-comparison.test.ts +221 -0
  31. package/src/__tests__/mock-comprehensive.test.ts +250 -0
  32. package/src/__tests__/mock-final-integration.test.ts +263 -0
  33. package/src/__tests__/mock-helpers.test.ts +174 -0
  34. package/src/__tests__/mock-realworld.test.ts +191 -0
  35. package/src/__tests__/mock-rest-debug.test.ts +110 -0
  36. package/src/__tests__/mock-rest-edge.test.ts +176 -0
  37. package/src/__tests__/mock-sinon-runtime.test.ts +168 -0
  38. package/src/__tests__/narrowing-discriminated.test.ts +35 -0
  39. package/src/__tests__/narrowing-in-operator.test.ts +56 -0
  40. package/src/__tests__/narrowing-switch.test.ts +56 -0
  41. package/src/__tests__/narrowing-truthiness.test.ts +52 -0
  42. package/src/__tests__/nudo-mock-syntax.test.ts +245 -0
  43. package/src/__tests__/realworld-patterns.test.ts +430 -0
  44. package/src/__tests__/syntax-sugar.test.ts +345 -0
  45. package/src/builtins/builtin-intl.ts +17 -0
  46. package/src/builtins/builtin-map.ts +174 -0
  47. package/src/builtins/builtin-promise.ts +116 -0
  48. package/src/builtins/builtin-reflect.ts +30 -0
  49. package/src/builtins/builtin-regexp.ts +34 -0
  50. package/src/builtins/builtin-set.ts +131 -0
  51. package/src/builtins/builtin-symbol.ts +16 -0
  52. package/src/builtins/builtin-url.ts +58 -0
  53. package/src/builtins/builtin-weak.ts +22 -0
  54. package/src/builtins/builtin-web.ts +111 -0
  55. package/src/builtins/index.ts +61 -0
  56. package/src/config.ts +32 -0
  57. package/src/env-loader.ts +174 -0
  58. package/src/evaluator-api.ts +22 -0
  59. package/src/evaluator.ts +4218 -171
  60. package/src/index.ts +776 -125
  61. package/src/narrowing.ts +286 -15
  62. package/src/resolve-npm.ts +63 -0
  63. package/dist/chunk-JW3RMCNY.js +0 -1467
  64. package/dist/chunk-RBHWWZII.js +0 -1467
  65. package/dist/chunk-VN5HMBGB.js +0 -1467
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # nudo
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fd0718: Merge the three environment packages into one: `@nudojs/env-es`, `@nudojs/env-web`, `@nudojs/env-node` are replaced by a single `@nudojs/env` package with subpath exports `@nudojs/env/es`, `@nudojs/env/web`, `@nudojs/env/node`.
8
+
9
+ Move agent-facing tools from the standalone MCP server into the language server: `@nudojs/mcp` is removed. `@nudojs/lsp` now exposes `nudo.whatIf`, `nudo.suggestCase`, `nudo.trace`, `nudo.selectCase`, and `nudo.getActiveCases` via `workspace/executeCommand` (custom-request aliases `nudo/whatIf` etc. included), adds pull-mode diagnostics, and works on files that are not open in the editor (disk fallback). `nudo.whatIf` now actually applies the given type bindings — previously they were ignored. AI agents connect through any LSP↔MCP bridge (cclsp, mcpls, agent-lsp) or a native LSP client; an installable agent skill ships at `packages/lsp/agent-skill/SKILL.md`.
10
+
11
+ - Updated dependencies [0fd0718]
12
+ - @nudojs/env@0.2.0
13
+ - @nudojs/service@0.2.1
14
+
15
+ ## 0.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 6c38283: docs and ci
20
+ - 9f7f819: fix pkg info
21
+ - c175f71: version
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [6c38283]
26
+ - Updated dependencies [9f7f819]
27
+ - Updated dependencies [c175f71]
28
+ - @nudojs/core@0.2.0
29
+ - @nudojs/parser@0.2.0
30
+
3
31
  ## 0.1.0
4
32
 
5
33
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nudo Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @nudojs/cli
2
+
3
+ CLI and evaluator API for the [Nudo](https://github.com/nudojs/nudo) type inference engine.
4
+
5
+ ## What is Nudo?
6
+
7
+ Nudo is a type inference engine for JavaScript. Instead of a separate type system, it runs your code with symbolic type values via abstract interpretation — no TypeScript, no build step.
8
+
9
+ ## This package
10
+
11
+ `@nudojs/cli` provides:
12
+
13
+ - **CLI tool** — the `nudo` command for inferring types and generating `.d.ts` files
14
+ - **Evaluator API** — programmatic access to `evaluateFunction`, `evaluateProgram`, and module resolution
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ npm install @nudojs/cli
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```bash
25
+ # Infer types for a file
26
+ npx nudo infer src/utils.js
27
+
28
+ # Generate .d.ts output
29
+ npx nudo infer src/utils.js --dts
30
+ ```
31
+
32
+ ## License
33
+
34
+ [MIT](https://github.com/nudojs/nudo/blob/main/LICENSE)