nuclie 1.0.7 → 1.0.10
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.
- package/README.md +20 -20
- package/dist/ai/analyzer.d.ts +0 -10
- package/dist/ai/analyzer.js +0 -27
- package/dist/ai/client.js +0 -4
- package/dist/ai/cloud/api.js +4 -4
- package/dist/ai/cloud/modelSync.js +1 -13
- package/dist/ai/cloud/telemetry.js +0 -1
- package/dist/ai/config.js +1 -1
- package/dist/ai/core/errorMemory.js +2 -7
- package/dist/ai/dashboard/cli.js +0 -2
- package/dist/ai/healer/applier.js +1 -9
- package/dist/ai/healer/cli.js +0 -2
- package/dist/ai/healer/collector.js +0 -1
- package/dist/ai/healer/fixer.js +1 -3
- package/dist/ai/healer/llm.js +0 -1
- package/dist/ai/healer/parser.js +0 -9
- package/dist/ai/learning/evolver.js +0 -5
- package/dist/ai/llm/fixGenerator.js +0 -6
- package/dist/ai/llm/ollama.js +2 -0
- package/dist/ai/local/fixStore.js +2 -5
- package/dist/ai/optimizer/analyzer.js +1 -2
- package/dist/ai/optimizer/engine.js +0 -3
- package/dist/ai/optimizer/llm.js +0 -3
- package/dist/ai/optimizer/profiler.js +3 -5
- package/dist/ai/optimizer/rules.js +0 -4
- package/dist/ai/reporter/assembler.js +1 -1
- package/dist/ai/reporter/generator.js +0 -3
- package/dist/ai/reporter/narrator.js +0 -1
- package/dist/ai/schema.js +1 -1
- package/dist/ai/telemetry.js +0 -4
- package/dist/audit/a11y.js +0 -9
- package/dist/audit/best-practices.js +0 -5
- package/dist/audit/build-integration.d.ts +0 -22
- package/dist/audit/build-integration.js +1 -30
- package/dist/audit/core.d.ts +0 -40
- package/dist/audit/core.js +2 -69
- package/dist/audit/index.js +1 -5
- package/dist/audit/perf.js +0 -5
- package/dist/audit/seo.js +0 -5
- package/dist/build/bundler.js +1 -3
- package/dist/build/index.d.ts +0 -12
- package/dist/build/index.js +0 -12
- package/dist/build/pipeline.d.ts +3 -11
- package/dist/build/pipeline.js +109 -22
- package/dist/builder/server.d.ts +0 -4
- package/dist/builder/server.js +1 -28
- package/dist/cache/incremental.d.ts +0 -34
- package/dist/cache/incremental.js +0 -40
- package/dist/cache/index.js +14 -24
- package/dist/cache/rocksdb.js +0 -3
- package/dist/cli/css-cli.js +0 -9
- package/dist/cli/inspect.js +0 -23
- package/dist/cli.js +87 -266
- package/dist/commands/analyze.js +1 -8
- package/dist/commands/doctor.js +1 -15
- package/dist/commands/lib-build.d.ts +17 -0
- package/dist/commands/lib-build.js +101 -0
- package/dist/commands/preview.d.ts +9 -0
- package/dist/commands/preview.js +157 -0
- package/dist/commands/ssr.d.ts +0 -6
- package/dist/commands/ssr.js +0 -9
- package/dist/commands/verify.d.ts +0 -12
- package/dist/commands/verify.js +0 -59
- package/dist/commands/workspaces.d.ts +1 -0
- package/dist/commands/workspaces.js +66 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +44 -22
- package/dist/config/live-config.d.ts +1 -0
- package/dist/config/live-config.js +18 -7
- package/dist/config-loader.d.ts +15 -0
- package/dist/config-loader.js +144 -0
- package/dist/core/build/globalOptimizer.d.ts +0 -4
- package/dist/core/build/globalOptimizer.js +0 -5
- package/dist/core/build/incremental.d.ts +0 -7
- package/dist/core/build/incremental.js +0 -10
- package/dist/core/bundler-rolldown.d.ts +0 -13
- package/dist/core/bundler-rolldown.js +4 -26
- package/dist/core/cache/lazy-init.d.ts +0 -24
- package/dist/core/cache/lazy-init.js +0 -32
- package/dist/core/cache-manager.d.ts +0 -22
- package/dist/core/cache-manager.js +1 -36
- package/dist/core/css/engine.d.ts +0 -18
- package/dist/core/css/engine.js +2 -35
- package/dist/core/css-framework-detector.d.ts +0 -3
- package/dist/core/css-framework-detector.js +1 -40
- package/dist/core/detection/files.js +0 -11
- package/dist/core/detection/index.d.ts +0 -5
- package/dist/core/detection/index.js +0 -19
- package/dist/core/detection/resolver.js +7 -36
- package/dist/core/detection/scanner.js +7 -18
- package/dist/core/detection/types.js +0 -2
- package/dist/core/engine/cache.d.ts +2 -1
- package/dist/core/engine/cache.js +26 -26
- package/dist/core/engine/config.d.ts +0 -5
- package/dist/core/engine/config.js +18 -61
- package/dist/core/engine/emit.d.ts +0 -5
- package/dist/core/engine/emit.js +0 -12
- package/dist/core/engine/events.js +0 -2
- package/dist/core/engine/execute.d.ts +0 -3
- package/dist/core/engine/execute.js +65 -44
- package/dist/core/engine/hash.d.ts +0 -7
- package/dist/core/engine/hash.js +2 -11
- package/dist/core/engine/index.d.ts +1 -20
- package/dist/core/engine/index.js +36 -42
- package/dist/core/engine/optimize.js +7 -10
- package/dist/core/engine/plan.d.ts +0 -5
- package/dist/core/engine/plan.js +5 -30
- package/dist/core/errors/hero-errors.d.ts +0 -26
- package/dist/core/errors/hero-errors.js +0 -41
- package/dist/core/framework-detector.d.ts +1 -5
- package/dist/core/framework-detector.js +16 -10
- package/dist/core/graph/js-graph-analyzer.d.ts +0 -28
- package/dist/core/graph/js-graph-analyzer.js +1 -42
- package/dist/core/graph/serializer.d.ts +2 -0
- package/dist/core/graph/serializer.js +3 -2
- package/dist/core/interop/analyze.d.ts +0 -6
- package/dist/core/interop/analyze.js +2 -24
- package/dist/core/interop/analyze_ast.d.ts +0 -7
- package/dist/core/interop/analyze_ast.js +3 -48
- package/dist/core/interop/index.d.ts +0 -5
- package/dist/core/interop/index.js +2 -12
- package/dist/core/interop/resolve.d.ts +0 -6
- package/dist/core/interop/resolve.js +0 -16
- package/dist/core/interop/types.js +0 -1
- package/dist/core/interop/wrapper.d.ts +0 -9
- package/dist/core/interop/wrapper.js +0 -28
- package/dist/core/parser-bun.d.ts +0 -13
- package/dist/core/parser-bun.js +1 -25
- package/dist/core/permissions.js +2 -2
- package/dist/core/pipeline/framework-pipeline.d.ts +0 -10
- package/dist/core/pipeline/framework-pipeline.js +16 -26
- package/dist/core/plugins/manager.d.ts +2 -15
- package/dist/core/plugins/manager.js +13 -21
- package/dist/core/plugins/sandbox_js.js +0 -6
- package/dist/core/plugins/sandbox_wasm.d.ts +2 -0
- package/dist/core/plugins/sandbox_wasm.js +41 -32
- package/dist/core/plugins/types.d.ts +0 -6
- package/dist/core/plugins/types.js +0 -1
- package/dist/core/plugins/validation.d.ts +0 -4
- package/dist/core/plugins/validation.js +1 -11
- package/dist/core/sandbox.js +23 -5
- package/dist/core/steps/css-optimization.d.ts +0 -40
- package/dist/core/steps/css-optimization.js +0 -70
- package/dist/core/steps.d.ts +0 -4
- package/dist/core/steps.js +0 -6
- package/dist/core/transform/batchTransformer.d.ts +0 -3
- package/dist/core/transform/batchTransformer.js +1 -6
- package/dist/core/transform/transformer.js +5 -23
- package/dist/core/universal-transformer.d.ts +0 -42
- package/dist/core/universal-transformer.js +112 -136
- package/dist/create/index.js +2 -49
- package/dist/create/ui.d.ts +0 -9
- package/dist/create/ui.js +0 -9
- package/dist/create-nuclie/cli.d.ts +0 -5
- package/dist/create-nuclie/cli.js +23 -28
- package/dist/dashboard/metrics.d.ts +0 -4
- package/dist/dashboard/metrics.js +1 -7
- package/dist/dashboard/server/router.d.ts +0 -4
- package/dist/dashboard/server/router.js +0 -13
- package/dist/dev/configWatcher.js +1 -1
- package/dist/dev/devServer.js +303 -317
- package/dist/dev/devServer.minimal.d.ts +0 -5
- package/dist/dev/devServer.minimal.js +21 -47
- package/dist/dev/federation-dev.d.ts +3 -0
- package/dist/dev/federation-dev.js +88 -10
- package/dist/dev/hmr-engine.js +0 -6
- package/dist/dev/hmr-v2.d.ts +0 -13
- package/dist/dev/hmr-v2.js +35 -34
- package/dist/dev/hmrThrottle.js +0 -6
- package/dist/dev/overlay/overlay-client.d.ts +0 -5
- package/dist/dev/overlay/overlay-client.js +0 -9
- package/dist/dev/overlay/overlay-ui.d.ts +0 -5
- package/dist/dev/overlay/overlay-ui.js +0 -10
- package/dist/dev/preBundler.d.ts +0 -10
- package/dist/dev/preBundler.js +25 -53
- package/dist/dev/statusHandler.js +0 -2
- package/dist/dev-middleware.d.ts +7 -0
- package/dist/dev-middleware.js +117 -0
- package/dist/dev-server-manual.d.ts +0 -4
- package/dist/dev-server-manual.js +0 -4
- package/dist/dev-server.d.ts +0 -7
- package/dist/dev-server.js +10 -26
- package/dist/env/api.d.ts +0 -12
- package/dist/env/api.js +0 -12
- package/dist/env.d.ts +12 -0
- package/dist/env.js +109 -0
- package/dist/federation/index.d.ts +23 -0
- package/dist/federation/index.js +405 -0
- package/dist/fix/ast-transforms.d.ts +0 -43
- package/dist/fix/ast-transforms.js +1 -65
- package/dist/hmr/classifier.d.ts +0 -15
- package/dist/hmr/classifier.js +0 -30
- package/dist/hmr/index.d.ts +0 -3
- package/dist/hmr/index.js +0 -3
- package/dist/hmr/overlay.d.ts +0 -12
- package/dist/hmr/overlay.js +1 -23
- package/dist/index.d.ts +12 -27
- package/dist/index.js +6 -46
- package/dist/init/bootstrap.d.ts +1 -1
- package/dist/init/bootstrap.js +54 -30
- package/dist/init/index.js +0 -9
- package/dist/marketplace/client.d.ts +9 -15
- package/dist/marketplace/client.js +29 -33
- package/dist/marketplace/db.d.ts +5 -5
- package/dist/marketplace/db.js +36 -9
- package/dist/marketplace/plugin-adapter.d.ts +0 -4
- package/dist/marketplace/plugin-adapter.js +5 -15
- package/dist/marketplace/server.d.ts +25 -16
- package/dist/marketplace/server.js +27 -23
- package/dist/meta-frameworks/base-router.d.ts +0 -43
- package/dist/meta-frameworks/base-router.js +1 -62
- package/dist/meta-frameworks/index.d.ts +0 -3
- package/dist/meta-frameworks/index.js +0 -3
- package/dist/meta-frameworks/nextjs/router.d.ts +0 -22
- package/dist/meta-frameworks/nextjs/router.js +6 -44
- package/dist/meta-frameworks/nuxt/router.d.ts +0 -13
- package/dist/meta-frameworks/nuxt/router.js +4 -23
- package/dist/meta-frameworks/remix/router.d.ts +0 -19
- package/dist/meta-frameworks/remix/router.js +1 -28
- package/dist/meta-frameworks/ssr/react-renderer.d.ts +0 -12
- package/dist/meta-frameworks/ssr/react-renderer.js +0 -15
- package/dist/meta-frameworks/ssr/server.d.ts +0 -55
- package/dist/meta-frameworks/ssr/server.js +2 -72
- package/dist/meta-frameworks/ssr/vue-renderer.d.ts +0 -7
- package/dist/meta-frameworks/ssr/vue-renderer.js +0 -11
- package/dist/meta-frameworks/types.d.ts +0 -36
- package/dist/meta-frameworks/types.js +0 -4
- package/dist/migrate/analyzer.d.ts +0 -6
- package/dist/migrate/analyzer.js +0 -20
- package/dist/migrate/cli.d.ts +0 -5
- package/dist/migrate/cli.js +0 -7
- package/dist/migrate/generator.d.ts +0 -6
- package/dist/migrate/generator.js +0 -22
- package/dist/native/cache.d.ts +0 -66
- package/dist/native/cache.js +0 -67
- package/dist/native/index.js +24 -10
- package/dist/native/orchestrator.d.ts +0 -60
- package/dist/native/orchestrator.js +0 -62
- package/dist/native/wasm.d.ts +0 -16
- package/dist/native/wasm.js +0 -18
- package/dist/plugins/assets.js +1 -5
- package/dist/plugins/compat/adapter.d.ts +0 -22
- package/dist/plugins/compat/adapter.js +3 -45
- package/dist/plugins/compat/deferred.d.ts +0 -10
- package/dist/plugins/compat/deferred.js +0 -14
- package/dist/plugins/compat/index.d.ts +1 -6
- package/dist/plugins/compat/index.js +4 -9
- package/dist/plugins/compat/rollup.d.ts +22 -11
- package/dist/plugins/compat/rollup.js +27 -14
- package/dist/plugins/compat/tier-a.d.ts +0 -45
- package/dist/plugins/compat/tier-a.js +0 -47
- package/dist/plugins/compat/tier-b.d.ts +0 -16
- package/dist/plugins/compat/tier-b.js +0 -12
- package/dist/plugins/compat/tier-c.d.ts +0 -24
- package/dist/plugins/compat/tier-c.js +0 -21
- package/dist/plugins/compat/webpack.d.ts +0 -4
- package/dist/plugins/compat/webpack.js +0 -13
- package/dist/plugins/core/linker.d.ts +0 -6
- package/dist/plugins/core/linker.js +0 -16
- package/dist/plugins/css/bootstrap.d.ts +0 -13
- package/dist/plugins/css/bootstrap.js +1 -23
- package/dist/plugins/css/bulma.d.ts +0 -13
- package/dist/plugins/css/bulma.js +0 -16
- package/dist/plugins/css/css-modules.d.ts +0 -10
- package/dist/plugins/css/css-modules.js +0 -17
- package/dist/plugins/css/css-optimizer.d.ts +0 -16
- package/dist/plugins/css/css-optimizer.js +1 -23
- package/dist/plugins/css/emotion.d.ts +0 -13
- package/dist/plugins/css/emotion.js +0 -18
- package/dist/plugins/css/material.d.ts +0 -13
- package/dist/plugins/css/material.js +0 -17
- package/dist/plugins/css/postcss.js +0 -7
- package/dist/plugins/css/sass.js +0 -2
- package/dist/plugins/css/styled-components.d.ts +0 -13
- package/dist/plugins/css/styled-components.js +1 -17
- package/dist/plugins/css/stylus.js +0 -1
- package/dist/plugins/css/tailwind.js +0 -16
- package/dist/plugins/css-in-js.d.ts +0 -5
- package/dist/plugins/css-in-js.js +0 -17
- package/dist/plugins/edge.js +0 -5
- package/dist/plugins/esbuildAdapter.js +3 -10
- package/dist/plugins/federation_next.js +64 -18
- package/dist/plugins/framework-plugins.js +1 -7
- package/dist/plugins/frameworks/index.d.ts +0 -3
- package/dist/plugins/frameworks/index.js +0 -5
- package/dist/plugins/frameworks/lit.d.ts +0 -24
- package/dist/plugins/frameworks/lit.js +0 -17
- package/dist/plugins/frameworks/react.d.ts +0 -25
- package/dist/plugins/frameworks/react.js +1 -29
- package/dist/plugins/frameworks/solid.d.ts +0 -24
- package/dist/plugins/frameworks/solid.js +1 -21
- package/dist/plugins/frameworks/svelte.d.ts +0 -28
- package/dist/plugins/frameworks/svelte.js +1 -23
- package/dist/plugins/frameworks/vue.d.ts +0 -28
- package/dist/plugins/frameworks/vue.js +0 -28
- package/dist/plugins/governance.d.ts +0 -19
- package/dist/plugins/governance.js +2 -25
- package/dist/plugins/implementations/analytics.d.ts +0 -4
- package/dist/plugins/implementations/analytics.js +0 -5
- package/dist/plugins/implementations/apollo.d.ts +0 -4
- package/dist/plugins/implementations/apollo.js +0 -5
- package/dist/plugins/implementations/audit.d.ts +0 -4
- package/dist/plugins/implementations/audit.js +0 -7
- package/dist/plugins/implementations/auto-fix.d.ts +0 -4
- package/dist/plugins/implementations/auto-fix.js +0 -5
- package/dist/plugins/implementations/avif.d.ts +0 -4
- package/dist/plugins/implementations/avif.js +0 -6
- package/dist/plugins/implementations/babel.d.ts +0 -4
- package/dist/plugins/implementations/babel.js +0 -5
- package/dist/plugins/implementations/bundle-analyzer.d.ts +0 -4
- package/dist/plugins/implementations/bundle-analyzer.js +0 -5
- package/dist/plugins/implementations/bundle-size.d.ts +0 -4
- package/dist/plugins/implementations/bundle-size.js +0 -5
- package/dist/plugins/implementations/checker.d.ts +0 -4
- package/dist/plugins/implementations/checker.js +0 -5
- package/dist/plugins/implementations/chromatic.d.ts +0 -4
- package/dist/plugins/implementations/chromatic.js +0 -5
- package/dist/plugins/implementations/cloudflare.d.ts +0 -4
- package/dist/plugins/implementations/cloudflare.js +0 -5
- package/dist/plugins/implementations/code-split.d.ts +0 -4
- package/dist/plugins/implementations/code-split.js +0 -5
- package/dist/plugins/implementations/compression.d.ts +0 -4
- package/dist/plugins/implementations/compression.js +0 -5
- package/dist/plugins/implementations/copy.d.ts +0 -4
- package/dist/plugins/implementations/copy.js +0 -5
- package/dist/plugins/implementations/critical-css.d.ts +0 -4
- package/dist/plugins/implementations/critical-css.js +0 -8
- package/dist/plugins/implementations/crypto-sign.d.ts +0 -4
- package/dist/plugins/implementations/crypto-sign.js +0 -7
- package/dist/plugins/implementations/css-framework.d.ts +0 -4
- package/dist/plugins/implementations/css-framework.js +0 -8
- package/dist/plugins/implementations/css.d.ts +0 -4
- package/dist/plugins/implementations/css.js +0 -8
- package/dist/plugins/implementations/cypress.d.ts +0 -4
- package/dist/plugins/implementations/cypress.js +0 -5
- package/dist/plugins/implementations/determinism.d.ts +0 -4
- package/dist/plugins/implementations/determinism.js +0 -5
- package/dist/plugins/implementations/edge.d.ts +0 -5
- package/dist/plugins/implementations/edge.js +0 -8
- package/dist/plugins/implementations/env-validation.d.ts +0 -4
- package/dist/plugins/implementations/env-validation.js +0 -7
- package/dist/plugins/implementations/eslint.d.ts +0 -4
- package/dist/plugins/implementations/eslint.js +0 -5
- package/dist/plugins/implementations/federation.d.ts +0 -4
- package/dist/plugins/implementations/federation.js +0 -5
- package/dist/plugins/implementations/file.d.ts +0 -4
- package/dist/plugins/implementations/file.js +0 -6
- package/dist/plugins/implementations/font-subset.d.ts +0 -4
- package/dist/plugins/implementations/font-subset.js +0 -6
- package/dist/plugins/implementations/fonts.d.ts +0 -4
- package/dist/plugins/implementations/fonts.js +0 -6
- package/dist/plugins/implementations/formatjs.d.ts +0 -4
- package/dist/plugins/implementations/formatjs.js +0 -5
- package/dist/plugins/implementations/graphql.d.ts +0 -4
- package/dist/plugins/implementations/graphql.js +0 -5
- package/dist/plugins/implementations/hmr-classify.d.ts +0 -4
- package/dist/plugins/implementations/hmr-classify.js +0 -5
- package/dist/plugins/implementations/html.d.ts +0 -4
- package/dist/plugins/implementations/html.js +0 -5
- package/dist/plugins/implementations/i18n.d.ts +0 -4
- package/dist/plugins/implementations/i18n.js +0 -5
- package/dist/plugins/implementations/icon.d.ts +0 -4
- package/dist/plugins/implementations/icon.js +0 -6
- package/dist/plugins/implementations/imagemin.d.ts +0 -4
- package/dist/plugins/implementations/imagemin.js +0 -6
- package/dist/plugins/implementations/inspect.d.ts +0 -4
- package/dist/plugins/implementations/inspect.js +0 -5
- package/dist/plugins/implementations/jest.d.ts +0 -4
- package/dist/plugins/implementations/jest.js +0 -6
- package/dist/plugins/implementations/jotai.d.ts +0 -5
- package/dist/plugins/implementations/jotai.js +0 -8
- package/dist/plugins/implementations/lazy-load.d.ts +0 -4
- package/dist/plugins/implementations/lazy-load.js +0 -5
- package/dist/plugins/implementations/legacy.d.ts +0 -4
- package/dist/plugins/implementations/legacy.js +0 -5
- package/dist/plugins/implementations/lighthouse.d.ts +0 -4
- package/dist/plugins/implementations/lighthouse.js +0 -5
- package/dist/plugins/implementations/manifest.d.ts +0 -4
- package/dist/plugins/implementations/manifest.js +0 -5
- package/dist/plugins/implementations/markdown.d.ts +0 -4
- package/dist/plugins/implementations/markdown.js +0 -5
- package/dist/plugins/implementations/md.d.ts +0 -4
- package/dist/plugins/implementations/md.js +0 -5
- package/dist/plugins/implementations/mdx.d.ts +0 -4
- package/dist/plugins/implementations/mdx.js +0 -5
- package/dist/plugins/implementations/meta-tags.d.ts +0 -4
- package/dist/plugins/implementations/meta-tags.js +0 -5
- package/dist/plugins/implementations/mini-css-extract-plugin.d.ts +0 -4
- package/dist/plugins/implementations/mini-css-extract-plugin.js +0 -8
- package/dist/plugins/implementations/mobx.d.ts +0 -5
- package/dist/plugins/implementations/mobx.js +0 -8
- package/dist/plugins/implementations/mock.d.ts +0 -4
- package/dist/plugins/implementations/mock.js +0 -5
- package/dist/plugins/implementations/msw.d.ts +0 -4
- package/dist/plugins/implementations/msw.js +0 -6
- package/dist/plugins/implementations/nanostores.d.ts +0 -4
- package/dist/plugins/implementations/nanostores.js +0 -5
- package/dist/plugins/implementations/netlify.d.ts +0 -4
- package/dist/plugins/implementations/netlify.js +0 -5
- package/dist/plugins/implementations/observability.d.ts +0 -4
- package/dist/plugins/implementations/observability.js +0 -5
- package/dist/plugins/implementations/og-image.d.ts +0 -4
- package/dist/plugins/implementations/og-image.js +0 -5
- package/dist/plugins/implementations/pages.d.ts +0 -4
- package/dist/plugins/implementations/pages.js +0 -5
- package/dist/plugins/implementations/pinia.d.ts +0 -5
- package/dist/plugins/implementations/pinia.js +0 -8
- package/dist/plugins/implementations/plausible.d.ts +0 -4
- package/dist/plugins/implementations/plausible.js +0 -5
- package/dist/plugins/implementations/playwright.d.ts +0 -4
- package/dist/plugins/implementations/playwright.js +0 -5
- package/dist/plugins/implementations/postcss.d.ts +0 -4
- package/dist/plugins/implementations/postcss.js +0 -8
- package/dist/plugins/implementations/posthog.d.ts +0 -4
- package/dist/plugins/implementations/posthog.js +0 -5
- package/dist/plugins/implementations/prebundle.d.ts +0 -4
- package/dist/plugins/implementations/prebundle.js +0 -5
- package/dist/plugins/implementations/prefetch.d.ts +0 -4
- package/dist/plugins/implementations/prefetch.js +0 -5
- package/dist/plugins/implementations/preload.d.ts +0 -4
- package/dist/plugins/implementations/preload.js +0 -5
- package/dist/plugins/implementations/prisma.d.ts +0 -4
- package/dist/plugins/implementations/prisma.js +0 -5
- package/dist/plugins/implementations/pwa.d.ts +0 -4
- package/dist/plugins/implementations/pwa.js +0 -5
- package/dist/plugins/implementations/qr-code.d.ts +0 -4
- package/dist/plugins/implementations/qr-code.js +0 -6
- package/dist/plugins/implementations/razorpay.d.ts +0 -4
- package/dist/plugins/implementations/razorpay.js +0 -6
- package/dist/plugins/implementations/react-i18next.d.ts +0 -4
- package/dist/plugins/implementations/react-i18next.js +0 -5
- package/dist/plugins/implementations/react-query.d.ts +0 -5
- package/dist/plugins/implementations/react-query.js +0 -8
- package/dist/plugins/implementations/react.d.ts +0 -5
- package/dist/plugins/implementations/react.js +0 -8
- package/dist/plugins/implementations/recoil.d.ts +0 -5
- package/dist/plugins/implementations/recoil.js +0 -8
- package/dist/plugins/implementations/redux.d.ts +0 -5
- package/dist/plugins/implementations/redux.js +0 -8
- package/dist/plugins/implementations/relay.d.ts +0 -4
- package/dist/plugins/implementations/relay.js +0 -5
- package/dist/plugins/implementations/repro.d.ts +0 -4
- package/dist/plugins/implementations/repro.js +0 -5
- package/dist/plugins/implementations/robots.d.ts +0 -4
- package/dist/plugins/implementations/robots.js +0 -5
- package/dist/plugins/implementations/root-cause.d.ts +0 -4
- package/dist/plugins/implementations/root-cause.js +0 -5
- package/dist/plugins/implementations/rss.d.ts +0 -4
- package/dist/plugins/implementations/rss.js +0 -5
- package/dist/plugins/implementations/sass.d.ts +0 -4
- package/dist/plugins/implementations/sass.js +0 -8
- package/dist/plugins/implementations/sentry.d.ts +0 -4
- package/dist/plugins/implementations/sentry.js +0 -5
- package/dist/plugins/implementations/sitemap.d.ts +0 -4
- package/dist/plugins/implementations/sitemap.js +0 -5
- package/dist/plugins/implementations/solid.d.ts +0 -5
- package/dist/plugins/implementations/solid.js +0 -8
- package/dist/plugins/implementations/sprite.d.ts +0 -4
- package/dist/plugins/implementations/sprite.js +0 -6
- package/dist/plugins/implementations/ssr.d.ts +0 -5
- package/dist/plugins/implementations/ssr.js +0 -8
- package/dist/plugins/implementations/storybook.d.ts +0 -4
- package/dist/plugins/implementations/storybook.js +0 -5
- package/dist/plugins/implementations/stripe.d.ts +0 -4
- package/dist/plugins/implementations/stripe.js +0 -6
- package/dist/plugins/implementations/style.d.ts +0 -4
- package/dist/plugins/implementations/style.js +0 -8
- package/dist/plugins/implementations/svelte.d.ts +0 -5
- package/dist/plugins/implementations/svelte.js +0 -8
- package/dist/plugins/implementations/tailwind.d.ts +0 -4
- package/dist/plugins/implementations/tailwind.js +0 -8
- package/dist/plugins/implementations/tanstack-query.d.ts +0 -4
- package/dist/plugins/implementations/tanstack-query.js +0 -5
- package/dist/plugins/implementations/terser.d.ts +0 -4
- package/dist/plugins/implementations/terser.js +0 -5
- package/dist/plugins/implementations/testing-library-react.d.ts +0 -4
- package/dist/plugins/implementations/testing-library-react.js +0 -6
- package/dist/plugins/implementations/testing-library.d.ts +0 -4
- package/dist/plugins/implementations/testing-library.js +0 -5
- package/dist/plugins/implementations/tree-shake.d.ts +0 -4
- package/dist/plugins/implementations/tree-shake.js +0 -5
- package/dist/plugins/implementations/trpc.d.ts +0 -4
- package/dist/plugins/implementations/trpc.js +0 -5
- package/dist/plugins/implementations/ts.d.ts +0 -4
- package/dist/plugins/implementations/ts.js +0 -5
- package/dist/plugins/implementations/typescript.d.ts +0 -4
- package/dist/plugins/implementations/typescript.js +0 -5
- package/dist/plugins/implementations/unocss.d.ts +0 -4
- package/dist/plugins/implementations/unocss.js +0 -8
- package/dist/plugins/implementations/upi-payment.d.ts +0 -4
- package/dist/plugins/implementations/upi-payment.js +0 -6
- package/dist/plugins/implementations/url.d.ts +0 -4
- package/dist/plugins/implementations/url.js +0 -6
- package/dist/plugins/implementations/vercel.d.ts +0 -4
- package/dist/plugins/implementations/vercel.js +0 -5
- package/dist/plugins/implementations/visualizer.d.ts +0 -4
- package/dist/plugins/implementations/visualizer.js +0 -5
- package/dist/plugins/implementations/vite-svg-loader.d.ts +0 -4
- package/dist/plugins/implementations/vite-svg-loader.js +0 -6
- package/dist/plugins/implementations/vitest.d.ts +0 -4
- package/dist/plugins/implementations/vitest.js +0 -5
- package/dist/plugins/implementations/vue-i18n-next.d.ts +0 -4
- package/dist/plugins/implementations/vue-i18n-next.js +0 -5
- package/dist/plugins/implementations/vue-i18n.d.ts +0 -4
- package/dist/plugins/implementations/vue-i18n.js +0 -5
- package/dist/plugins/implementations/vue-layouts.d.ts +0 -5
- package/dist/plugins/implementations/vue-layouts.js +0 -8
- package/dist/plugins/implementations/vue.d.ts +0 -5
- package/dist/plugins/implementations/vue.js +0 -8
- package/dist/plugins/implementations/vuex.d.ts +0 -5
- package/dist/plugins/implementations/vuex.js +0 -8
- package/dist/plugins/implementations/wasm-sandbox.d.ts +0 -4
- package/dist/plugins/implementations/wasm-sandbox.js +0 -7
- package/dist/plugins/implementations/webp.d.ts +0 -4
- package/dist/plugins/implementations/webp.js +0 -6
- package/dist/plugins/implementations/windicss.d.ts +0 -4
- package/dist/plugins/implementations/windicss.js +0 -8
- package/dist/plugins/implementations/workbox.d.ts +0 -4
- package/dist/plugins/implementations/workbox.js +0 -5
- package/dist/plugins/implementations/xstate.d.ts +0 -4
- package/dist/plugins/implementations/xstate.js +0 -5
- package/dist/plugins/implementations/zod.d.ts +0 -4
- package/dist/plugins/implementations/zod.js +0 -5
- package/dist/plugins/implementations/zustand-devtools.d.ts +0 -4
- package/dist/plugins/implementations/zustand-devtools.js +0 -5
- package/dist/plugins/implementations/zustand.d.ts +0 -5
- package/dist/plugins/implementations/zustand.js +0 -8
- package/dist/plugins/index.js +14 -11
- package/dist/plugins/js-transform.js +0 -2
- package/dist/plugins/json.js +0 -2
- package/dist/plugins/ported/adapter.d.ts +0 -39
- package/dist/plugins/ported/adapter.js +0 -55
- package/dist/plugins/registry.d.ts +0 -27
- package/dist/plugins/registry.js +0 -36
- package/dist/plugins/reporter.js +0 -5
- package/dist/plugins/sandbox.js +2 -14
- package/dist/plugins/signer.d.ts +0 -30
- package/dist/plugins/signer.js +1 -39
- package/dist/plugins/static.js +0 -1
- package/dist/plugins/svelte.js +3 -3
- package/dist/plugins/verify.js +0 -12
- package/dist/plugins/vue.js +1 -11
- package/dist/plugins/wasm-runtime.d.ts +0 -6
- package/dist/plugins/wasm-runtime.js +3 -10
- package/dist/plugins/wasm.js +1 -4
- package/dist/polyfills/corejs.d.ts +0 -4
- package/dist/polyfills/corejs.js +0 -6
- package/dist/presets/core.d.ts +0 -75
- package/dist/presets/core.js +0 -58
- package/dist/presets/frameworks.d.ts +0 -4
- package/dist/presets/frameworks.js +34 -4
- package/dist/presets/infrastructure.js +0 -10
- package/dist/presets/spa.js +0 -3
- package/dist/presets/ssg.js +0 -1
- package/dist/presets/ssr.js +1 -5
- package/dist/repro/dashboard.d.ts +0 -40
- package/dist/repro/dashboard.js +0 -47
- package/dist/repro/github.d.ts +0 -10
- package/dist/repro/github.js +2 -10
- package/dist/resolve/css-precedence.js +0 -9
- package/dist/resolve/graph.js +8 -16
- package/dist/resolve/utils.d.ts +0 -11
- package/dist/resolve/utils.js +0 -28
- package/dist/runtime/client.js +41 -50
- package/dist/runtime/error-overlay.js +3 -4
- package/dist/runtime/federation-fallback.d.ts +2 -30
- package/dist/runtime/federation-fallback.js +4 -47
- package/dist/runtime/federation_runtime.js +1 -1
- package/dist/runtime/hmr-client.d.ts +0 -4
- package/dist/runtime/hmr-client.js +0 -10
- package/dist/security/anomaly.d.ts +0 -17
- package/dist/security/anomaly.js +2 -23
- package/dist/server/security-headers.d.ts +0 -18
- package/dist/server/security-headers.js +3 -30
- package/dist/ssr/adapters/edge.d.ts +0 -7
- package/dist/ssr/adapters/edge.js +0 -8
- package/dist/ssr/adapters/index.d.ts +0 -5
- package/dist/ssr/adapters/index.js +4 -21
- package/dist/ssr/app-router.d.ts +0 -15
- package/dist/ssr/app-router.js +0 -23
- package/dist/ssr/edge/handlers.d.ts +0 -18
- package/dist/ssr/edge/handlers.js +0 -18
- package/dist/ssr/image.d.ts +0 -13
- package/dist/ssr/image.js +0 -18
- package/dist/ssr/isr.d.ts +0 -4
- package/dist/ssr/isr.js +0 -6
- package/dist/ssr/rsc.d.ts +0 -11
- package/dist/ssr/rsc.js +0 -14
- package/dist/ssr/streaming.d.ts +0 -16
- package/dist/ssr/streaming.js +0 -18
- package/dist/ssr/universal-engine.d.ts +0 -17
- package/dist/ssr/universal-engine.js +0 -31
- package/dist/templates/manager.d.ts +0 -9
- package/dist/templates/manager.js +1 -19
- package/dist/templates/starters/angular-spa.d.ts +0 -4
- package/dist/templates/starters/angular-spa.js +0 -4
- package/dist/templates/starters/edge.d.ts +0 -4
- package/dist/templates/starters/edge.js +0 -4
- package/dist/templates/starters/fintech.d.ts +0 -4
- package/dist/templates/starters/fintech.js +0 -4
- package/dist/templates/starters/monorepo.d.ts +0 -4
- package/dist/templates/starters/monorepo.js +0 -6
- package/dist/templates/starters/nextjs-app.js +0 -1
- package/dist/templates/starters/preact-spa.d.ts +0 -4
- package/dist/templates/starters/preact-spa.js +1 -5
- package/dist/templates/starters/premium-dashboard.d.ts +0 -4
- package/dist/templates/starters/premium-dashboard.js +0 -4
- package/dist/templates/starters/react-spa.d.ts +0 -4
- package/dist/templates/starters/react-spa.js +0 -4
- package/dist/templates/starters/react-ssr.d.ts +0 -4
- package/dist/templates/starters/react-ssr.js +0 -4
- package/dist/templates/starters/remix-app.js +0 -1
- package/dist/templates/starters/solid-spa.d.ts +0 -4
- package/dist/templates/starters/solid-spa.js +0 -4
- package/dist/templates/starters/svelte-spa.d.ts +0 -4
- package/dist/templates/starters/svelte-spa.js +0 -4
- package/dist/templates/starters/vue-spa.d.ts +0 -4
- package/dist/templates/starters/vue-spa.js +0 -4
- package/dist/test/api.d.ts +0 -4
- package/dist/test/api.js +1 -10
- package/dist/test/coverage.js +2 -10
- package/dist/test/determinism.js +0 -3
- package/dist/test/regression.js +0 -1
- package/dist/test/runner.js +1 -19
- package/dist/test-server.js +0 -1
- package/dist/ui/types.d.ts +0 -4
- package/dist/ui/types.js +0 -4
- package/dist/ui/warning-detector.d.ts +0 -31
- package/dist/ui/warning-detector.js +3 -51
- package/dist/ui/warning-library.d.ts +0 -7
- package/dist/ui/warning-library.js +0 -14
- package/dist/utils/fetch.d.ts +1 -0
- package/dist/utils/fetch.js +21 -0
- package/dist/utils/logger.js +0 -7
- package/dist/utils/path-normalize.d.ts +0 -18
- package/dist/utils/path-normalize.js +0 -21
- package/dist/utils/templates.d.ts +36 -0
- package/dist/utils/templates.js +1077 -0
- package/dist/visual/chart-generator.d.ts +0 -7
- package/dist/visual/chart-generator.js +0 -9
- package/dist/visual/client/renderer.d.ts +0 -12
- package/dist/visual/client/renderer.js +2 -26
- package/dist/visual/graph-engine.d.ts +0 -13
- package/dist/visual/graph-engine.js +2 -27
- package/dist/visual/graph-visualizer.d.ts +0 -25
- package/dist/visual/graph-visualizer.js +0 -51
- package/dist/visual/root-cause.d.ts +0 -34
- package/dist/visual/root-cause.js +7 -55
- package/package.json +45 -23
- package/dist/core/__tests__/permissions.test.d.ts +0 -1
- package/dist/core/__tests__/permissions.test.js +0 -16
- package/dist/core/__tests__/universal-transformer.test.d.ts +0 -1
- package/dist/core/__tests__/universal-transformer.test.js +0 -27
- package/dist/create-nuclie/templates.d.ts +0 -18
- package/dist/create-nuclie/templates.js +0 -263
- package/dist/dev/__tests__/preBundler.test.d.ts +0 -1
- package/dist/dev/__tests__/preBundler.test.js +0 -51
- package/dist/init/templates.d.ts +0 -2
- package/dist/init/templates.js +0 -227
- package/native/README.md +0 -10
- package/native/index.cjs +0 -117
- package/native/index.d.ts +0 -232
- package/native/index.js +0 -594
- package/native/nuclie_native.linux-x64-gnu.node +0 -0
- package/native/package.json +0 -7
package/README.md
CHANGED
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](#test-status)
|
|
7
7
|
[](https://nodejs.org)
|
|
8
|
-
[](https://avinash-1994.github.io/Nuclie/)
|
|
9
8
|
|
|
10
|
-
Nuclie is a build tool
|
|
11
|
-
|
|
12
|
-
**[📖 Documentation Website →](https://avinash-1994.github.io/Nuclie/)**
|
|
9
|
+
Nuclie is a modern JavaScript build tool powered by SWC (Rust) and LightningCSS. It delivers fast HMR, native module federation for micro-frontends, automatic tree shaking, and deep multi-framework support (React, Vue, Svelte, Solid, Preact, Qwik) — a modern alternative with a Rust-native core.
|
|
13
10
|
|
|
14
11
|
---
|
|
15
12
|
|
|
16
13
|
## ✨ Features
|
|
17
14
|
|
|
18
15
|
- ⚡ **Fast Builds** — Parallel pipeline with Rust-native transforms (SWC)
|
|
19
|
-
- 🔥 **Hot Module Replacement** — Framework-aware HMR
|
|
16
|
+
- 🔥 **Hot Module Replacement** — Framework-aware HMR with low-latency updates
|
|
20
17
|
- 🗺️ **Source Maps** — `inline`, `external`, and `hidden` modes
|
|
21
18
|
- 🌳 **Tree Shaking** — AST-based dead code elimination in production
|
|
22
19
|
- 📦 **Module Federation** — Micro-frontend support built in
|
|
@@ -432,14 +429,21 @@ nuclie bootstrap --name my-app --template svelte-ts
|
|
|
432
429
|
nuclie bootstrap --name my-app --template solid-ts
|
|
433
430
|
nuclie bootstrap --name my-app --template preact-ts
|
|
434
431
|
nuclie bootstrap --name my-app --template lit-ts
|
|
432
|
+
nuclie bootstrap --name my-app --template mithril-ts
|
|
433
|
+
nuclie bootstrap --name my-app --template alpine-ts
|
|
435
434
|
nuclie bootstrap --name my-app --template vanilla-ts
|
|
436
435
|
|
|
437
436
|
# JavaScript
|
|
438
|
-
nuclie bootstrap --name my-app --template react
|
|
439
|
-
nuclie bootstrap --name my-app --template vue
|
|
440
|
-
nuclie bootstrap --name my-app --template svelte
|
|
441
|
-
nuclie bootstrap --name my-app --template
|
|
442
|
-
nuclie bootstrap --name my-app --template
|
|
437
|
+
nuclie bootstrap --name my-app --template react
|
|
438
|
+
nuclie bootstrap --name my-app --template vue
|
|
439
|
+
nuclie bootstrap --name my-app --template svelte
|
|
440
|
+
nuclie bootstrap --name my-app --template solid
|
|
441
|
+
nuclie bootstrap --name my-app --template preact
|
|
442
|
+
nuclie bootstrap --name my-app --template lit
|
|
443
|
+
nuclie bootstrap --name my-app --template qwik
|
|
444
|
+
nuclie bootstrap --name my-app --template mithril
|
|
445
|
+
nuclie bootstrap --name my-app --template alpine
|
|
446
|
+
nuclie bootstrap --name my-app --template vanilla
|
|
443
447
|
```
|
|
444
448
|
|
|
445
449
|
---
|
|
@@ -454,9 +458,9 @@ nuclie bootstrap --name my-app --template vanilla-js
|
|
|
454
458
|
| SolidJS | ✅ Stable | ✅ Signal-aware | ✅ | |
|
|
455
459
|
| Preact | ✅ Stable | ✅ Fast Refresh | ✅ | React compat |
|
|
456
460
|
| Lit | ✅ Verified | ✅ Web Component | ✅ | |
|
|
457
|
-
| Alpine.js | ✅ Verified | ✅ Core Reload |
|
|
461
|
+
| Alpine.js | ✅ Verified | ✅ Core Reload | ✅ | HTML-first |
|
|
458
462
|
| Qwik | 🔶 Experimental | ✅ | ✅ | |
|
|
459
|
-
| Mithril.js |
|
|
463
|
+
| Mithril.js | ✅ Stable | ✅ | ✅ | |
|
|
460
464
|
| Vanilla JS | ✅ Stable | ✅ | ✅ | |
|
|
461
465
|
|
|
462
466
|
---
|
|
@@ -485,15 +489,11 @@ module.exports = {
|
|
|
485
489
|
|
|
486
490
|
## 📖 Documentation
|
|
487
491
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
**[https://avinash-1994.github.io/Nuclie/](https://avinash-1994.github.io/Nuclie/)**
|
|
492
|
+
Project documentation and guides are maintained in the repository:
|
|
491
493
|
|
|
492
|
-
- [
|
|
493
|
-
- [
|
|
494
|
-
- [
|
|
495
|
-
- [Plugin Development](https://avinash-1994.github.io/Nuclie/#/plugins)
|
|
496
|
-
- [Changelog](./CHANGELOG.md)
|
|
494
|
+
- [docs/](./docs)
|
|
495
|
+
- [CHANGELOG.md](./CHANGELOG.md)
|
|
496
|
+
- [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
497
497
|
|
|
498
498
|
---
|
|
499
499
|
|
package/dist/ai/analyzer.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Analyzer - Project analysis and optimization suggestions
|
|
3
|
-
* Simple rule-based system (can be upgraded to LLM later)
|
|
4
|
-
*/
|
|
5
1
|
export interface ProjectAnalysis {
|
|
6
2
|
framework: 'react' | 'vue' | 'svelte' | 'vanilla' | 'unknown';
|
|
7
3
|
typescript: boolean;
|
|
@@ -19,11 +15,5 @@ export interface Suggestion {
|
|
|
19
15
|
action: string;
|
|
20
16
|
priority: number;
|
|
21
17
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Analyze project structure and detect framework
|
|
24
|
-
*/
|
|
25
18
|
export declare function analyzeProject(root: string): Promise<ProjectAnalysis>;
|
|
26
|
-
/**
|
|
27
|
-
* Generate optimization suggestions based on project analysis
|
|
28
|
-
*/
|
|
29
19
|
export declare function generateSuggestions(analysis: ProjectAnalysis): Promise<Suggestion[]>;
|
package/dist/ai/analyzer.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI Analyzer - Project analysis and optimization suggestions
|
|
3
|
-
* Simple rule-based system (can be upgraded to LLM later)
|
|
4
|
-
*/
|
|
5
1
|
import fs from 'fs/promises';
|
|
6
2
|
import path from 'path';
|
|
7
|
-
/**
|
|
8
|
-
* Analyze project structure and detect framework
|
|
9
|
-
*/
|
|
10
3
|
export async function analyzeProject(root) {
|
|
11
4
|
const analysis = {
|
|
12
5
|
framework: 'unknown',
|
|
@@ -18,12 +11,10 @@ export async function analyzeProject(root) {
|
|
|
18
11
|
entryPoints: []
|
|
19
12
|
};
|
|
20
13
|
try {
|
|
21
|
-
// Check for package.json
|
|
22
14
|
const packagePath = path.join(root, 'package.json');
|
|
23
15
|
try {
|
|
24
16
|
const packageData = await fs.readFile(packagePath, 'utf-8');
|
|
25
17
|
const pkg = JSON.parse(packageData);
|
|
26
|
-
// Detect framework
|
|
27
18
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
28
19
|
analysis.dependencies = Object.keys(deps);
|
|
29
20
|
if (deps['react'] || deps['react-dom']) {
|
|
@@ -38,13 +29,10 @@ export async function analyzeProject(root) {
|
|
|
38
29
|
else {
|
|
39
30
|
analysis.framework = 'vanilla';
|
|
40
31
|
}
|
|
41
|
-
// Detect TypeScript
|
|
42
32
|
analysis.typescript = !!(deps['typescript'] || deps['@types/node']);
|
|
43
33
|
}
|
|
44
34
|
catch (error) {
|
|
45
|
-
// No package.json
|
|
46
35
|
}
|
|
47
|
-
// Detect package manager
|
|
48
36
|
try {
|
|
49
37
|
await fs.access(path.join(root, 'pnpm-lock.yaml'));
|
|
50
38
|
analysis.packageManager = 'pnpm';
|
|
@@ -58,18 +46,15 @@ export async function analyzeProject(root) {
|
|
|
58
46
|
analysis.packageManager = 'npm';
|
|
59
47
|
}
|
|
60
48
|
}
|
|
61
|
-
// Count files in src/
|
|
62
49
|
try {
|
|
63
50
|
const srcPath = path.join(root, 'src');
|
|
64
51
|
const files = await getFiles(srcPath);
|
|
65
52
|
analysis.fileCount = files.length;
|
|
66
53
|
analysis.totalSize = await getTotalSize(files);
|
|
67
|
-
// Find entry points
|
|
68
54
|
const entryFiles = files.filter(f => f.includes('main.') || f.includes('index.') || f.includes('app.'));
|
|
69
55
|
analysis.entryPoints = entryFiles.map(f => path.relative(root, f));
|
|
70
56
|
}
|
|
71
57
|
catch (error) {
|
|
72
|
-
// No src directory
|
|
73
58
|
}
|
|
74
59
|
}
|
|
75
60
|
catch (error) {
|
|
@@ -77,12 +62,8 @@ export async function analyzeProject(root) {
|
|
|
77
62
|
}
|
|
78
63
|
return analysis;
|
|
79
64
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Generate optimization suggestions based on project analysis
|
|
82
|
-
*/
|
|
83
65
|
export async function generateSuggestions(analysis) {
|
|
84
66
|
const suggestions = [];
|
|
85
|
-
// Performance suggestions
|
|
86
67
|
if (analysis.fileCount > 100) {
|
|
87
68
|
suggestions.push({
|
|
88
69
|
type: 'performance',
|
|
@@ -103,7 +84,6 @@ export async function generateSuggestions(analysis) {
|
|
|
103
84
|
priority: 8
|
|
104
85
|
});
|
|
105
86
|
}
|
|
106
|
-
// Framework-specific suggestions
|
|
107
87
|
if (analysis.framework === 'react') {
|
|
108
88
|
suggestions.push({
|
|
109
89
|
type: 'dx',
|
|
@@ -124,7 +104,6 @@ export async function generateSuggestions(analysis) {
|
|
|
124
104
|
priority: 7
|
|
125
105
|
});
|
|
126
106
|
}
|
|
127
|
-
// TypeScript suggestions
|
|
128
107
|
if (analysis.typescript) {
|
|
129
108
|
suggestions.push({
|
|
130
109
|
type: 'best-practice',
|
|
@@ -135,7 +114,6 @@ export async function generateSuggestions(analysis) {
|
|
|
135
114
|
priority: 6
|
|
136
115
|
});
|
|
137
116
|
}
|
|
138
|
-
// Development suggestions
|
|
139
117
|
suggestions.push({
|
|
140
118
|
type: 'best-practice',
|
|
141
119
|
icon: '🗺️',
|
|
@@ -152,7 +130,6 @@ export async function generateSuggestions(analysis) {
|
|
|
152
130
|
action: 'Enable',
|
|
153
131
|
priority: 7
|
|
154
132
|
});
|
|
155
|
-
// Security suggestions
|
|
156
133
|
suggestions.push({
|
|
157
134
|
type: 'security',
|
|
158
135
|
icon: '🔒',
|
|
@@ -161,10 +138,8 @@ export async function generateSuggestions(analysis) {
|
|
|
161
138
|
action: 'Review',
|
|
162
139
|
priority: 8
|
|
163
140
|
});
|
|
164
|
-
// Sort by priority (highest first)
|
|
165
141
|
return suggestions.sort((a, b) => b.priority - a.priority);
|
|
166
142
|
}
|
|
167
|
-
// ===== Helper Functions =====
|
|
168
143
|
async function getFiles(dir) {
|
|
169
144
|
const files = [];
|
|
170
145
|
try {
|
|
@@ -183,7 +158,6 @@ async function getFiles(dir) {
|
|
|
183
158
|
}
|
|
184
159
|
}
|
|
185
160
|
catch (error) {
|
|
186
|
-
// Directory doesn't exist or not accessible
|
|
187
161
|
}
|
|
188
162
|
return files;
|
|
189
163
|
}
|
|
@@ -195,7 +169,6 @@ async function getTotalSize(files) {
|
|
|
195
169
|
total += stats.size;
|
|
196
170
|
}
|
|
197
171
|
catch (error) {
|
|
198
|
-
// File not accessible
|
|
199
172
|
}
|
|
200
173
|
}
|
|
201
174
|
return total;
|
package/dist/ai/client.js
CHANGED
|
@@ -24,8 +24,6 @@ export class AIClient {
|
|
|
24
24
|
response = await this.mockLocalInference(prompt);
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
// Placeholder for real API calls
|
|
28
|
-
// await this.callProvider(prompt, systemPrompt);
|
|
29
27
|
response = `[Mock AI Response] Analysis of: ${prompt.substring(0, 50)}...`;
|
|
30
28
|
}
|
|
31
29
|
await this.saveToCache(cacheKey, response);
|
|
@@ -57,11 +55,9 @@ export class AIClient {
|
|
|
57
55
|
await fs.writeFile(path.join(this.cacheDir, key), content);
|
|
58
56
|
}
|
|
59
57
|
catch (e) {
|
|
60
|
-
// Ignore cache write errors
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
async mockLocalInference(prompt) {
|
|
64
|
-
// Simulate latency
|
|
65
61
|
await new Promise(r => setTimeout(r, 500));
|
|
66
62
|
return "Local AI: I see you're trying to build something cool. Here is a suggestion...";
|
|
67
63
|
}
|
package/dist/ai/cloud/api.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { log } from '../../utils/logger.js';
|
|
2
|
+
import { getFetch } from '../../utils/fetch.js';
|
|
2
3
|
export class CloudAPI {
|
|
3
4
|
constructor(config) {
|
|
4
5
|
this.config = config;
|
|
5
|
-
// Production API endpoint
|
|
6
6
|
this.baseUrl = process.env.NUCLIE_CLOUD_API || 'https://api.nuclie.build';
|
|
7
7
|
this.apiKey = config.apiKey || process.env.NUCLIE_API_KEY || '';
|
|
8
8
|
this.userId = this.getOrCreateUserId();
|
|
9
9
|
}
|
|
10
10
|
getOrCreateUserId() {
|
|
11
|
-
// Generate anonymous user ID (stored locally)
|
|
12
11
|
const fs = require('fs');
|
|
13
12
|
const path = require('path');
|
|
14
13
|
const configPath = path.join(process.env.HOME || process.env.USERPROFILE || '', '.nuclie', 'user.json');
|
|
@@ -19,9 +18,7 @@ export class CloudAPI {
|
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
catch (e) {
|
|
22
|
-
// Ignore
|
|
23
21
|
}
|
|
24
|
-
// Create new anonymous ID
|
|
25
22
|
const userId = 'anon-' + Math.random().toString(36).substring(2, 15);
|
|
26
23
|
try {
|
|
27
24
|
const dir = path.dirname(configPath);
|
|
@@ -45,6 +42,7 @@ export class CloudAPI {
|
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
44
|
try {
|
|
45
|
+
const fetch = await getFetch();
|
|
48
46
|
const response = await fetch(`${this.baseUrl}/api/v1/learnings`, {
|
|
49
47
|
method: 'POST',
|
|
50
48
|
headers: {
|
|
@@ -85,6 +83,7 @@ export class CloudAPI {
|
|
|
85
83
|
return [];
|
|
86
84
|
}
|
|
87
85
|
try {
|
|
86
|
+
const fetch = await getFetch();
|
|
88
87
|
const response = await fetch(`${this.baseUrl}/api/v1/patterns?limit=${limit}`, {
|
|
89
88
|
method: 'GET',
|
|
90
89
|
headers: {
|
|
@@ -105,6 +104,7 @@ export class CloudAPI {
|
|
|
105
104
|
}
|
|
106
105
|
async checkHealth() {
|
|
107
106
|
try {
|
|
107
|
+
const fetch = await getFetch();
|
|
108
108
|
const response = await fetch(`${this.baseUrl}/health`, {
|
|
109
109
|
method: 'GET',
|
|
110
110
|
headers: { 'X-User-Id': this.userId }
|
|
@@ -12,27 +12,22 @@ export class ModelSync {
|
|
|
12
12
|
}
|
|
13
13
|
log.info('Syncing with global learning network...', { category: 'ai' });
|
|
14
14
|
try {
|
|
15
|
-
// 1. Check API health
|
|
16
15
|
const healthy = await this.api.checkHealth();
|
|
17
16
|
if (!healthy) {
|
|
18
17
|
log.error('Cloud API is unavailable', { category: 'ai' });
|
|
19
18
|
return { synced: 0, merged: 0, conflicts: 0 };
|
|
20
19
|
}
|
|
21
|
-
// 2. Download global patterns
|
|
22
20
|
const globalPatterns = await this.api.downloadPatterns();
|
|
23
21
|
if (globalPatterns.length === 0) {
|
|
24
22
|
log.info('No new patterns available', { category: 'ai' });
|
|
25
23
|
return { synced: 0, merged: 0, conflicts: 0 };
|
|
26
24
|
}
|
|
27
|
-
// 3. Merge with local patterns
|
|
28
25
|
let merged = 0;
|
|
29
26
|
let conflicts = 0;
|
|
30
27
|
for (const pattern of globalPatterns) {
|
|
31
28
|
try {
|
|
32
|
-
// Check if we already have this error
|
|
33
29
|
const localFixes = this.store.findFixes(pattern.errorSignature);
|
|
34
30
|
if (localFixes.length === 0) {
|
|
35
|
-
// New pattern - add it
|
|
36
31
|
this.store.saveError({
|
|
37
32
|
id: pattern.errorSignature,
|
|
38
33
|
signature: pattern.errorSignature,
|
|
@@ -41,7 +36,6 @@ export class ModelSync {
|
|
|
41
36
|
timestamp: Date.now()
|
|
42
37
|
});
|
|
43
38
|
const fixId = this.store.saveFix(pattern.errorSignature, pattern.fix);
|
|
44
|
-
// Simulate success based on global success rate
|
|
45
39
|
const successCount = Math.floor(pattern.usageCount * pattern.successRate);
|
|
46
40
|
const failCount = pattern.usageCount - successCount;
|
|
47
41
|
for (let i = 0; i < successCount; i++) {
|
|
@@ -53,10 +47,7 @@ export class ModelSync {
|
|
|
53
47
|
merged++;
|
|
54
48
|
}
|
|
55
49
|
else {
|
|
56
|
-
// Conflict: we have local data
|
|
57
|
-
// Strategy: Global wins if success rate > local
|
|
58
50
|
conflicts++;
|
|
59
|
-
// TODO: Implement conflict resolution
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
53
|
catch (e) {
|
|
@@ -82,17 +73,14 @@ export class ModelSync {
|
|
|
82
73
|
}
|
|
83
74
|
log.info('Contributing local patterns to global network...', { category: 'ai' });
|
|
84
75
|
try {
|
|
85
|
-
// Get local stats
|
|
86
76
|
const stats = this.store.getStats();
|
|
87
77
|
if (stats.successfulFixes === 0) {
|
|
88
78
|
log.info('No successful fixes to contribute', { category: 'ai' });
|
|
89
79
|
return { uploaded: 0, success: true };
|
|
90
80
|
}
|
|
91
|
-
// TODO: Extract and anonymize local learnings
|
|
92
|
-
// For now, just report intent
|
|
93
81
|
log.success(`Ready to contribute ${stats.successfulFixes} successful fixes`, { category: 'ai' });
|
|
94
82
|
return {
|
|
95
|
-
uploaded: 0,
|
|
83
|
+
uploaded: 0,
|
|
96
84
|
success: true
|
|
97
85
|
};
|
|
98
86
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
export class TelemetryCollector {
|
|
3
3
|
static anonymize(error, fix, success, durationMs, projectSize) {
|
|
4
|
-
// Hash everything - NO source code, NO file contents, NO config values
|
|
5
4
|
const errorSignature = crypto
|
|
6
5
|
.createHash('sha256')
|
|
7
6
|
.update(error.signature + JSON.stringify(error.context))
|
package/dist/ai/config.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
export class ErrorMemory {
|
|
3
3
|
static normalize(rawError, context = {}) {
|
|
4
|
-
// 1. Strip volatile data (timestamps, absolute paths, line numbers)
|
|
5
|
-
// We want the "shape" of the error, not the specific instance
|
|
6
4
|
const cleanError = rawError
|
|
7
5
|
.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/g, '<TIMESTAMP>')
|
|
8
|
-
.replace(/\/[\w\-\.]+(\/[\w\-\.]+)+/g, '<PATH>')
|
|
9
|
-
.replace(/[A-Z]:\\[\w\-\.]+(\\[\w\-\.]+)+/g, '<PATH>')
|
|
6
|
+
.replace(/\/[\w\-\.]+(\/[\w\-\.]+)+/g, '<PATH>')
|
|
7
|
+
.replace(/[A-Z]:\\[\w\-\.]+(\\[\w\-\.]+)+/g, '<PATH>')
|
|
10
8
|
.replace(/\(\d+,\d+\)/g, '(<LINE>,<COL>)')
|
|
11
9
|
.replace(/line \d+/g, 'line <LINE>');
|
|
12
|
-
// 2. Generate Signature
|
|
13
10
|
const signature = crypto.createHash('sha256').update(cleanError).digest('hex');
|
|
14
|
-
// 3. Generate ID (Signature + Context helps, but for now ID = Signature for deduplication)
|
|
15
11
|
const id = signature;
|
|
16
|
-
// 4. Determine Type (Simple heuristic, can be expanded)
|
|
17
12
|
let type = 'unknown';
|
|
18
13
|
if (rawError.includes('Module not found') || rawError.includes('Cannot find module'))
|
|
19
14
|
type = 'missingDep';
|
package/dist/ai/dashboard/cli.js
CHANGED
|
@@ -8,14 +8,12 @@ export class DashboardCLI {
|
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
console.log('\n📊 Build History (Last 10)\n');
|
|
11
|
-
// Header
|
|
12
11
|
console.log('ID'.padEnd(10) +
|
|
13
12
|
'Date'.padEnd(25) +
|
|
14
13
|
'Duration'.padEnd(15) +
|
|
15
14
|
'Status'.padEnd(10) +
|
|
16
15
|
'Modules');
|
|
17
16
|
console.log('-'.repeat(70));
|
|
18
|
-
// Rows
|
|
19
17
|
for (const s of sessions) {
|
|
20
18
|
const date = new Date(s.timestamp).toLocaleString();
|
|
21
19
|
const duration = (s.duration / 1000).toFixed(2) + 's';
|
|
@@ -12,7 +12,6 @@ export class FixApplier {
|
|
|
12
12
|
}
|
|
13
13
|
async apply(fix, fixId) {
|
|
14
14
|
log.info(`Applying fix: ${fix.description}`, { category: 'ai' });
|
|
15
|
-
// 1. Backup
|
|
16
15
|
const backupFiles = [];
|
|
17
16
|
if (fix.type === 'FILE_EDIT' && fix.file) {
|
|
18
17
|
const filePath = path.join(this.root, fix.file);
|
|
@@ -20,20 +19,15 @@ export class FixApplier {
|
|
|
20
19
|
backupFiles.push(filePath);
|
|
21
20
|
}
|
|
22
21
|
try {
|
|
23
|
-
// 2. Apply
|
|
24
22
|
let success = false;
|
|
25
23
|
if (fix.type === 'SHELL_COMMAND' && fix.command) {
|
|
26
24
|
await execAsync(fix.command, { cwd: this.root });
|
|
27
|
-
success = true;
|
|
25
|
+
success = true;
|
|
28
26
|
}
|
|
29
27
|
else if (fix.type === 'FILE_EDIT' && fix.file && fix.diff) {
|
|
30
|
-
// TODO: Real patch application. For now, we assume success if we could write
|
|
31
28
|
log.warn('File edit application not fully implemented yet', { category: 'ai' });
|
|
32
29
|
success = false;
|
|
33
30
|
}
|
|
34
|
-
// 3. Verify (Optional: could run build here)
|
|
35
|
-
// For Phase 1, we assume if the command/edit succeeded, the fix is "applied".
|
|
36
|
-
// Real verification happens on the NEXT build.
|
|
37
31
|
if (success && fixId) {
|
|
38
32
|
this.store.recordOutcome(fixId, true);
|
|
39
33
|
}
|
|
@@ -41,7 +35,6 @@ export class FixApplier {
|
|
|
41
35
|
}
|
|
42
36
|
catch (e) {
|
|
43
37
|
log.error('Failed to apply fix', { error: e });
|
|
44
|
-
// 4. Rollback
|
|
45
38
|
for (const file of backupFiles) {
|
|
46
39
|
await this.rollback(file);
|
|
47
40
|
}
|
|
@@ -57,7 +50,6 @@ export class FixApplier {
|
|
|
57
50
|
await fs.writeFile(`${filePath}.bak`, content);
|
|
58
51
|
}
|
|
59
52
|
catch (e) {
|
|
60
|
-
// Ignore if file doesn't exist
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
async rollback(filePath) {
|
package/dist/ai/healer/cli.js
CHANGED
|
@@ -11,9 +11,7 @@ export class HealerCLI {
|
|
|
11
11
|
static async handle(error) {
|
|
12
12
|
const parsed = ErrorParser.parse(error.message);
|
|
13
13
|
log.error(`Build Failed: ${parsed.message}`, { category: 'ai' });
|
|
14
|
-
// 1. Static Pattern Fixes
|
|
15
14
|
let fixes = FixGenerator.generate(parsed);
|
|
16
|
-
// 2. LLM Fallback
|
|
17
15
|
if (fixes.length === 0 || fixes[0].confidence < 0.7) {
|
|
18
16
|
log.info('No high-confidence local fix. Consulting AI...', { category: 'ai' });
|
|
19
17
|
const llm = new LLMFixer(DEFAULT_AI_CONFIG);
|
|
@@ -12,7 +12,6 @@ export class ErrorCollector {
|
|
|
12
12
|
}
|
|
13
13
|
normalize(raw) {
|
|
14
14
|
const message = raw.message || raw.toString();
|
|
15
|
-
// Simple heuristic normalization
|
|
16
15
|
if (message.includes('Module not found') || message.includes('Cannot find module')) {
|
|
17
16
|
return {
|
|
18
17
|
type: 'MISSING_DEPENDENCY',
|
package/dist/ai/healer/fixer.js
CHANGED
|
@@ -2,7 +2,6 @@ import { CommonPatterns } from '../patterns/common.js';
|
|
|
2
2
|
export class FixGenerator {
|
|
3
3
|
static generate(error) {
|
|
4
4
|
const fixes = [];
|
|
5
|
-
// 1. Check Pattern Library
|
|
6
5
|
for (const pattern of CommonPatterns) {
|
|
7
6
|
const match = error.originalError.match(pattern.regex);
|
|
8
7
|
if (match) {
|
|
@@ -11,13 +10,12 @@ export class FixGenerator {
|
|
|
11
10
|
}
|
|
12
11
|
if (fixes.length > 0)
|
|
13
12
|
return fixes;
|
|
14
|
-
// 2. Fallback to Heuristics (Legacy)
|
|
15
13
|
if (error.type === 'MISSING_DEPENDENCY' && error.context.package) {
|
|
16
14
|
const pkg = error.context.package;
|
|
17
15
|
fixes.push({
|
|
18
16
|
type: 'SHELL_COMMAND',
|
|
19
17
|
description: `Install missing dependency: ${pkg}`,
|
|
20
|
-
command: `npm install ${pkg}`,
|
|
18
|
+
command: `npm install ${pkg}`,
|
|
21
19
|
confidence: 0.95
|
|
22
20
|
});
|
|
23
21
|
}
|
package/dist/ai/healer/llm.js
CHANGED
|
@@ -10,7 +10,6 @@ export class LLMFixer {
|
|
|
10
10
|
if (this.config.provider === 'ollama') {
|
|
11
11
|
return await this.ollama.suggestFix(error);
|
|
12
12
|
}
|
|
13
|
-
// Generic fallback for other cloud providers
|
|
14
13
|
return [{
|
|
15
14
|
type: 'MANUAL_INSTRUCTION',
|
|
16
15
|
description: `Cloud provider ${this.config.provider} not yet fully implemented.`,
|
package/dist/ai/healer/parser.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export class ErrorParser {
|
|
2
2
|
static parse(error) {
|
|
3
|
-
// 1. Missing Dependency
|
|
4
|
-
// "Module not found: Error: Can't resolve 'react'"
|
|
5
|
-
// "Error: Cannot find module 'react'"
|
|
6
3
|
const missingDepMatch = error.match(/Can't resolve '(@?[\w-]+(?:\/[\w-]+)*)'/i) ||
|
|
7
4
|
error.match(/Cannot find module '(@?[\w-]+(?:\/[\w-]+)*)'/i);
|
|
8
5
|
if (missingDepMatch) {
|
|
@@ -13,9 +10,6 @@ export class ErrorParser {
|
|
|
13
10
|
originalError: error
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
|
-
// 2. Syntax Error
|
|
17
|
-
// "SyntaxError: Unexpected token (10:5)"
|
|
18
|
-
// "file.ts(10,5): error TS1005: ')' expected."
|
|
19
13
|
const syntaxMatch = error.match(/(.*?)\((\d+),(\d+)\): error TS/);
|
|
20
14
|
if (syntaxMatch) {
|
|
21
15
|
return {
|
|
@@ -29,7 +23,6 @@ export class ErrorParser {
|
|
|
29
23
|
originalError: error
|
|
30
24
|
};
|
|
31
25
|
}
|
|
32
|
-
// 3. React Version Mismatch
|
|
33
26
|
if (error.includes('Invalid hook call') || error.includes('more than one copy of React')) {
|
|
34
27
|
return {
|
|
35
28
|
type: 'CONFIG_ERROR',
|
|
@@ -38,7 +31,6 @@ export class ErrorParser {
|
|
|
38
31
|
originalError: error
|
|
39
32
|
};
|
|
40
33
|
}
|
|
41
|
-
// 4. Missing Loader
|
|
42
34
|
const loaderMatch = error.match(/You may need an appropriate loader to handle this file type/);
|
|
43
35
|
if (loaderMatch) {
|
|
44
36
|
return {
|
|
@@ -48,7 +40,6 @@ export class ErrorParser {
|
|
|
48
40
|
originalError: error
|
|
49
41
|
};
|
|
50
42
|
}
|
|
51
|
-
// 5. Config Error (Generic heuristic)
|
|
52
43
|
if (error.toLowerCase().includes('config') || error.toLowerCase().includes('json')) {
|
|
53
44
|
return {
|
|
54
45
|
type: 'CONFIG_ERROR',
|
|
@@ -6,9 +6,6 @@ export class Evolver {
|
|
|
6
6
|
const fixes = this.store.findFixes(errorId);
|
|
7
7
|
if (fixes.length === 0)
|
|
8
8
|
return null;
|
|
9
|
-
// Simple A/B testing logic:
|
|
10
|
-
// 90% time pick best fix
|
|
11
|
-
// 10% time pick random fix (exploration)
|
|
12
9
|
if (Math.random() > 0.1) {
|
|
13
10
|
return fixes[0];
|
|
14
11
|
}
|
|
@@ -18,7 +15,5 @@ export class Evolver {
|
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
async evolve(errorId, failedFix) {
|
|
21
|
-
// If a fix failed, we might want to trigger LLM to generate a variant
|
|
22
|
-
// For Phase 2, we just record the failure (handled by FixStore)
|
|
23
18
|
}
|
|
24
19
|
}
|
|
@@ -4,18 +4,12 @@ export class LLMFixGenerator {
|
|
|
4
4
|
}
|
|
5
5
|
async generateFix(error, profile) {
|
|
6
6
|
if (!this.config.enabled || this.config.provider === 'local') {
|
|
7
|
-
// Local fallback: return empty or generic suggestion
|
|
8
7
|
return [{
|
|
9
8
|
type: 'MANUAL_INSTRUCTION',
|
|
10
9
|
description: 'Complex error detected. Please check online documentation or enable Cloud AI.',
|
|
11
10
|
confidence: 0.1
|
|
12
11
|
}];
|
|
13
12
|
}
|
|
14
|
-
// TODO: Implement Cloud Provider Call
|
|
15
|
-
// Prompt:
|
|
16
|
-
// Error: ${error.signature}
|
|
17
|
-
// Context: ${JSON.stringify(error.context)}
|
|
18
|
-
// Framework: ${profile.framework}
|
|
19
13
|
return [];
|
|
20
14
|
}
|
|
21
15
|
}
|
package/dist/ai/llm/ollama.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getFetch } from '../../utils/fetch.js';
|
|
1
2
|
export class OllamaProvider {
|
|
2
3
|
constructor(config) {
|
|
3
4
|
this.endpoint = config.endpoint || 'http://localhost:11434/api/generate';
|
|
@@ -6,6 +7,7 @@ export class OllamaProvider {
|
|
|
6
7
|
async suggestFix(error) {
|
|
7
8
|
const prompt = this.generatePrompt(error);
|
|
8
9
|
try {
|
|
10
|
+
const fetch = await getFetch();
|
|
9
11
|
const response = await fetch(this.endpoint, {
|
|
10
12
|
method: 'POST',
|
|
11
13
|
body: JSON.stringify({
|
|
@@ -47,8 +47,6 @@ export class FixStore {
|
|
|
47
47
|
return fixId;
|
|
48
48
|
}
|
|
49
49
|
findFixes(errorId) {
|
|
50
|
-
// Score = (success / (success + fail + 1)) * log(last_used)
|
|
51
|
-
// This favors successful fixes, but also gives a slight boost to recently used ones
|
|
52
50
|
const stmt = this.db.prepare(`
|
|
53
51
|
SELECT recipe, success_count, fail_count
|
|
54
52
|
FROM fixes
|
|
@@ -65,7 +63,7 @@ export class FixStore {
|
|
|
65
63
|
const total = success + fail;
|
|
66
64
|
if (total === 0)
|
|
67
65
|
return 0;
|
|
68
|
-
return success / total;
|
|
66
|
+
return success / total;
|
|
69
67
|
}
|
|
70
68
|
recordOutcome(fixId, success) {
|
|
71
69
|
const stmt = this.db.prepare(`
|
|
@@ -78,13 +76,12 @@ export class FixStore {
|
|
|
78
76
|
stmt.run(success ? 1 : 0, success ? 0 : 1, Date.now(), fixId);
|
|
79
77
|
}
|
|
80
78
|
generateFixId(errorId, fix) {
|
|
81
|
-
// Simple hash of errorId + fix content
|
|
82
79
|
const content = errorId + JSON.stringify(fix);
|
|
83
80
|
let hash = 0;
|
|
84
81
|
for (let i = 0; i < content.length; i++) {
|
|
85
82
|
const char = content.charCodeAt(i);
|
|
86
83
|
hash = ((hash << 5) - hash) + char;
|
|
87
|
-
hash = hash & hash;
|
|
84
|
+
hash = hash & hash;
|
|
88
85
|
}
|
|
89
86
|
return Math.abs(hash).toString(16);
|
|
90
87
|
}
|
|
@@ -12,7 +12,6 @@ export class Analyzer {
|
|
|
12
12
|
pkg = JSON.parse(content);
|
|
13
13
|
}
|
|
14
14
|
catch (e) {
|
|
15
|
-
// Ignore missing package.json
|
|
16
15
|
}
|
|
17
16
|
return {
|
|
18
17
|
framework: this.detectFramework(pkg),
|
|
@@ -20,7 +19,7 @@ export class Analyzer {
|
|
|
20
19
|
packageManager: await this.detectPackageManager(),
|
|
21
20
|
dependencies: pkg.dependencies || {},
|
|
22
21
|
devDependencies: pkg.devDependencies || {},
|
|
23
|
-
configSummary: {}
|
|
22
|
+
configSummary: {}
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
detectFramework(pkg) {
|