@happyvertical/smrt-core 0.30.0
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/AGENTS.md +124 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +265 -0
- package/bin/smrt-prebuild.js +26 -0
- package/dist/__tests__/fixtures/advisor-test-classes.d.ts +28 -0
- package/dist/__tests__/fixtures/advisor-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/collection-coverage-fixtures.d.ts +12 -0
- package/dist/__tests__/fixtures/collection-coverage-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/inheritance-resolver-fixtures.d.ts +28 -0
- package/dist/__tests__/fixtures/inheritance-resolver-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/inheritance-test-classes.d.ts +43 -0
- package/dist/__tests__/fixtures/inheritance-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mcp-integration-test-classes.d.ts +18 -0
- package/dist/__tests__/fixtures/mcp-integration-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/object-ai-memory-fixtures.d.ts +15 -0
- package/dist/__tests__/fixtures/object-ai-memory-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/object-spec-test-classes.d.ts +13 -0
- package/dist/__tests__/fixtures/object-spec-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/registry-test-classes.d.ts +23 -0
- package/dist/__tests__/fixtures/registry-test-classes.d.ts.map +1 -0
- package/dist/adapters/ai-usage.d.ts +23 -0
- package/dist/adapters/ai-usage.d.ts.map +1 -0
- package/dist/adapters/ai-usage.js +105 -0
- package/dist/adapters/ai-usage.js.map +1 -0
- package/dist/adapters/cost-rates.d.ts +20 -0
- package/dist/adapters/cost-rates.d.ts.map +1 -0
- package/dist/adapters/cost-rates.js +40 -0
- package/dist/adapters/cost-rates.js.map +1 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/metrics.d.ts +111 -0
- package/dist/adapters/metrics.d.ts.map +1 -0
- package/dist/adapters/metrics.js +169 -0
- package/dist/adapters/metrics.js.map +1 -0
- package/dist/adapters/pubsub.d.ts +124 -0
- package/dist/adapters/pubsub.d.ts.map +1 -0
- package/dist/adapters/pubsub.js +121 -0
- package/dist/adapters/pubsub.js.map +1 -0
- package/dist/browser.d.ts +32 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +68 -0
- package/dist/browser.js.map +1 -0
- package/dist/child-accessors.d.ts +27 -0
- package/dist/child-accessors.d.ts.map +1 -0
- package/dist/child-accessors.js +35 -0
- package/dist/child-accessors.js.map +1 -0
- package/dist/class.d.ts +313 -0
- package/dist/class.d.ts.map +1 -0
- package/dist/class.js +896 -0
- package/dist/class.js.map +1 -0
- package/dist/collection-cache.d.ts +110 -0
- package/dist/collection-cache.d.ts.map +1 -0
- package/dist/collection-cache.js +187 -0
- package/dist/collection-cache.js.map +1 -0
- package/dist/collection.d.ts +894 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +1987 -0
- package/dist/collection.js.map +1 -0
- package/dist/config/global-config.d.ts +3 -0
- package/dist/config/global-config.d.ts.map +1 -0
- package/dist/config/global-config.js +19 -0
- package/dist/config/global-config.js.map +1 -0
- package/dist/config.d.ts +145 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/consumer-plugin/index.d.ts +22 -0
- package/dist/consumer-plugin/index.d.ts.map +1 -0
- package/dist/consumer-plugin/index.js +452 -0
- package/dist/consumer-plugin/index.js.map +1 -0
- package/dist/consumer-plugin.d.ts +8 -0
- package/dist/consumer-plugin.d.ts.map +1 -0
- package/dist/consumer-plugin.js +5 -0
- package/dist/consumer-plugin.js.map +1 -0
- package/dist/database.d.ts +95 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +32 -0
- package/dist/database.js.map +1 -0
- package/dist/decorators/compatibility.d.ts +14 -0
- package/dist/decorators/compatibility.d.ts.map +1 -0
- package/dist/decorators/compatibility.js +111 -0
- package/dist/decorators/compatibility.js.map +1 -0
- package/dist/decorators/index.d.ts +381 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +104 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/dispatch/bus.d.ts +306 -0
- package/dist/dispatch/bus.d.ts.map +1 -0
- package/dist/dispatch/bus.js +583 -0
- package/dist/dispatch/bus.js.map +1 -0
- package/dist/dispatch/collections/DispatchSubscriptions.d.ts +79 -0
- package/dist/dispatch/collections/DispatchSubscriptions.d.ts.map +1 -0
- package/dist/dispatch/collections/DispatchSubscriptions.js +243 -0
- package/dist/dispatch/collections/DispatchSubscriptions.js.map +1 -0
- package/dist/dispatch/collections/Dispatches.d.ts +98 -0
- package/dist/dispatch/collections/Dispatches.d.ts.map +1 -0
- package/dist/dispatch/collections/Dispatches.js +358 -0
- package/dist/dispatch/collections/Dispatches.js.map +1 -0
- package/dist/dispatch/index.d.ts +47 -0
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/models/Dispatch.d.ts +101 -0
- package/dist/dispatch/models/Dispatch.d.ts.map +1 -0
- package/dist/dispatch/models/Dispatch.js +162 -0
- package/dist/dispatch/models/Dispatch.js.map +1 -0
- package/dist/dispatch/models/DispatchSubscription.d.ts +83 -0
- package/dist/dispatch/models/DispatchSubscription.d.ts.map +1 -0
- package/dist/dispatch/models/DispatchSubscription.js +112 -0
- package/dist/dispatch/models/DispatchSubscription.js.map +1 -0
- package/dist/dispatch/tenant-resolver.d.ts +98 -0
- package/dist/dispatch/tenant-resolver.d.ts.map +1 -0
- package/dist/dispatch/tenant-resolver.js +32 -0
- package/dist/dispatch/tenant-resolver.js.map +1 -0
- package/dist/dispatch/types.d.ts +149 -0
- package/dist/dispatch/types.d.ts.map +1 -0
- package/dist/embeddings/hash.d.ts +33 -0
- package/dist/embeddings/hash.d.ts.map +1 -0
- package/dist/embeddings/hash.js +37 -0
- package/dist/embeddings/hash.js.map +1 -0
- package/dist/embeddings/index.d.ts +36 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/provider.d.ts +75 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +170 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/embeddings/similarity.d.ts +47 -0
- package/dist/embeddings/similarity.d.ts.map +1 -0
- package/dist/embeddings/similarity.js +64 -0
- package/dist/embeddings/similarity.js.map +1 -0
- package/dist/embeddings/storage.d.ts +125 -0
- package/dist/embeddings/storage.d.ts.map +1 -0
- package/dist/embeddings/storage.js +283 -0
- package/dist/embeddings/storage.js.map +1 -0
- package/dist/embeddings/types.d.ts +250 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/errors.d.ts +363 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +669 -0
- package/dist/errors.js.map +1 -0
- package/dist/generators/cli.d.ts +162 -0
- package/dist/generators/cli.d.ts.map +1 -0
- package/dist/generators/cli.js +462 -0
- package/dist/generators/cli.js.map +1 -0
- package/dist/generators/index.d.ts +13 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/mcp-runtime-template.d.ts +60 -0
- package/dist/generators/mcp-runtime-template.d.ts.map +1 -0
- package/dist/generators/mcp-runtime-template.js +509 -0
- package/dist/generators/mcp-runtime-template.js.map +1 -0
- package/dist/generators/mcp.d.ts +231 -0
- package/dist/generators/mcp.d.ts.map +1 -0
- package/dist/generators/mcp.js +1220 -0
- package/dist/generators/mcp.js.map +1 -0
- package/dist/generators/rest.d.ts +171 -0
- package/dist/generators/rest.d.ts.map +1 -0
- package/dist/generators/rest.js +591 -0
- package/dist/generators/rest.js.map +1 -0
- package/dist/generators/swagger.d.ts +21 -0
- package/dist/generators/swagger.d.ts.map +1 -0
- package/dist/generators/swagger.js +307 -0
- package/dist/generators/swagger.js.map +1 -0
- package/dist/generators/tenant-gate.d.ts +74 -0
- package/dist/generators/tenant-gate.d.ts.map +1 -0
- package/dist/generators/tenant-gate.js +15 -0
- package/dist/generators/tenant-gate.js.map +1 -0
- package/dist/generators.d.ts +8 -0
- package/dist/generators.d.ts.map +1 -0
- package/dist/generators.js +19 -0
- package/dist/generators.js.map +1 -0
- package/dist/hierarchical.d.ts +103 -0
- package/dist/hierarchical.d.ts.map +1 -0
- package/dist/hierarchical.js +184 -0
- package/dist/hierarchical.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +202 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors.d.ts +251 -0
- package/dist/interceptors.d.ts.map +1 -0
- package/dist/interceptors.js +259 -0
- package/dist/interceptors.js.map +1 -0
- package/dist/junction.d.ts +99 -0
- package/dist/junction.d.ts.map +1 -0
- package/dist/junction.js +136 -0
- package/dist/junction.js.map +1 -0
- package/dist/knowledge.d.ts +11 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +310 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/lazy-config.d.ts +160 -0
- package/dist/lazy-config.d.ts.map +1 -0
- package/dist/lazy-config.js +146 -0
- package/dist/lazy-config.js.map +1 -0
- package/dist/manifest/discover-base-classes.d.ts +78 -0
- package/dist/manifest/discover-base-classes.d.ts.map +1 -0
- package/dist/manifest/discover-base-classes.js +85 -0
- package/dist/manifest/discover-base-classes.js.map +1 -0
- package/dist/manifest/discover-smrt-packages.d.ts +48 -0
- package/dist/manifest/discover-smrt-packages.d.ts.map +1 -0
- package/dist/manifest/discover-smrt-packages.js +361 -0
- package/dist/manifest/discover-smrt-packages.js.map +1 -0
- package/dist/manifest/generator.d.ts +93 -0
- package/dist/manifest/generator.d.ts.map +1 -0
- package/dist/manifest/generator.js +380 -0
- package/dist/manifest/generator.js.map +1 -0
- package/dist/manifest/index.d.ts +16 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +51 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/manager.d.ts +51 -0
- package/dist/manifest/manager.d.ts.map +1 -0
- package/dist/manifest/manager.js +89 -0
- package/dist/manifest/manager.js.map +1 -0
- package/dist/manifest/manifest-loader.d.ts +187 -0
- package/dist/manifest/manifest-loader.d.ts.map +1 -0
- package/dist/manifest/manifest-loader.js +847 -0
- package/dist/manifest/manifest-loader.js.map +1 -0
- package/dist/manifest/sources/composite.d.ts +22 -0
- package/dist/manifest/sources/composite.d.ts.map +1 -0
- package/dist/manifest/sources/composite.js +60 -0
- package/dist/manifest/sources/composite.js.map +1 -0
- package/dist/manifest/sources/embedded.d.ts +7 -0
- package/dist/manifest/sources/embedded.d.ts.map +1 -0
- package/dist/manifest/sources/embedded.js +30 -0
- package/dist/manifest/sources/embedded.js.map +1 -0
- package/dist/manifest/sources/explicit-paths.d.ts +17 -0
- package/dist/manifest/sources/explicit-paths.d.ts.map +1 -0
- package/dist/manifest/sources/explicit-paths.js +35 -0
- package/dist/manifest/sources/explicit-paths.js.map +1 -0
- package/dist/manifest/sources/fallback.d.ts +25 -0
- package/dist/manifest/sources/fallback.d.ts.map +1 -0
- package/dist/manifest/sources/fallback.js +63 -0
- package/dist/manifest/sources/fallback.js.map +1 -0
- package/dist/manifest/sources/index.d.ts +17 -0
- package/dist/manifest/sources/index.d.ts.map +1 -0
- package/dist/manifest/sources/local-test.d.ts +7 -0
- package/dist/manifest/sources/local-test.d.ts.map +1 -0
- package/dist/manifest/sources/local-test.js +21 -0
- package/dist/manifest/sources/local-test.js.map +1 -0
- package/dist/manifest/sources/static.d.ts +7 -0
- package/dist/manifest/sources/static.d.ts.map +1 -0
- package/dist/manifest/sources/static.js +19 -0
- package/dist/manifest/sources/static.js.map +1 -0
- package/dist/manifest/sources/test.d.ts +7 -0
- package/dist/manifest/sources/test.d.ts.map +1 -0
- package/dist/manifest/sources/test.js +21 -0
- package/dist/manifest/sources/test.js.map +1 -0
- package/dist/manifest/sources/types.d.ts +79 -0
- package/dist/manifest/sources/types.d.ts.map +1 -0
- package/dist/manifest/sources/types.js +61 -0
- package/dist/manifest/sources/types.js.map +1 -0
- package/dist/manifest/static-manifest.d.ts +4 -0
- package/dist/manifest/static-manifest.d.ts.map +1 -0
- package/dist/manifest/static-manifest.js +1535 -0
- package/dist/manifest/static-manifest.js.map +1 -0
- package/dist/manifest/store.d.ts +111 -0
- package/dist/manifest/store.d.ts.map +1 -0
- package/dist/manifest/store.js +431 -0
- package/dist/manifest/store.js.map +1 -0
- package/dist/manifest/test-manifest-loader.d.ts +3 -0
- package/dist/manifest/test-manifest-loader.d.ts.map +1 -0
- package/dist/manifest/test-manifest-stub.d.ts +4 -0
- package/dist/manifest/test-manifest-stub.d.ts.map +1 -0
- package/dist/manifest/test-manifest-stub.js +80013 -0
- package/dist/manifest/test-manifest-stub.js.map +1 -0
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +20 -0
- package/dist/manifest.js.map +1 -0
- package/dist/manifest.json +1489 -0
- package/dist/mcp-advisor/index.d.ts +499 -0
- package/dist/mcp-advisor/index.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/add-ai-methods.d.ts +6 -0
- package/dist/mcp-advisor/tools/add-ai-methods.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/configure-decorators.d.ts +6 -0
- package/dist/mcp-advisor/tools/configure-decorators.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-collection.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-collection.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-field-definitions.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-field-definitions.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-smrt-class.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-smrt-class.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/get-object-config.d.ts +6 -0
- package/dist/mcp-advisor/tools/get-object-config.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/get-object-schema.d.ts +10 -0
- package/dist/mcp-advisor/tools/get-object-schema.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/list-registered-objects.d.ts +9 -0
- package/dist/mcp-advisor/tools/list-registered-objects.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/preview-api-endpoints.d.ts +9 -0
- package/dist/mcp-advisor/tools/preview-api-endpoints.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/preview-mcp-tools.d.ts +9 -0
- package/dist/mcp-advisor/tools/preview-mcp-tools.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/validate-smrt-object.d.ts +6 -0
- package/dist/mcp-advisor/tools/validate-smrt-object.d.ts.map +1 -0
- package/dist/mcp-advisor/types.d.ts +209 -0
- package/dist/mcp-advisor/types.d.ts.map +1 -0
- package/dist/migrations/backfill-tracker.d.ts +84 -0
- package/dist/migrations/backfill-tracker.d.ts.map +1 -0
- package/dist/migrations/backfill-tracker.js +118 -0
- package/dist/migrations/backfill-tracker.js.map +1 -0
- package/dist/migrations/checksum.d.ts +43 -0
- package/dist/migrations/checksum.d.ts.map +1 -0
- package/dist/migrations/checksum.js +32 -0
- package/dist/migrations/checksum.js.map +1 -0
- package/dist/migrations/differ.d.ts +186 -0
- package/dist/migrations/differ.d.ts.map +1 -0
- package/dist/migrations/differ.js +601 -0
- package/dist/migrations/differ.js.map +1 -0
- package/dist/migrations/generator.d.ts +133 -0
- package/dist/migrations/generator.d.ts.map +1 -0
- package/dist/migrations/generator.js +328 -0
- package/dist/migrations/generator.js.map +1 -0
- package/dist/migrations/index.d.ts +20 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/orchestrate.d.ts +148 -0
- package/dist/migrations/orchestrate.d.ts.map +1 -0
- package/dist/migrations/orchestrate.js +118 -0
- package/dist/migrations/orchestrate.js.map +1 -0
- package/dist/migrations/tracker.d.ts +134 -0
- package/dist/migrations/tracker.d.ts.map +1 -0
- package/dist/migrations/tracker.js +624 -0
- package/dist/migrations/tracker.js.map +1 -0
- package/dist/migrations/types.d.ts +221 -0
- package/dist/migrations/types.d.ts.map +1 -0
- package/dist/migrations.d.ts +7 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +26 -0
- package/dist/migrations.js.map +1 -0
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +56 -0
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js +163 -0
- package/dist/node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js +13 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/ast.js +654 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/brace-expressions.js +111 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/escape.js +10 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/index.js +824 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/unescape.js +10 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/dist/object.d.ts +1202 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/object.js +2731 -0
- package/dist/object.js.map +1 -0
- package/dist/polymorphic-association.d.ts +69 -0
- package/dist/polymorphic-association.d.ts.map +1 -0
- package/dist/polymorphic-association.js +96 -0
- package/dist/polymorphic-association.js.map +1 -0
- package/dist/prebuild/cli.d.ts +7 -0
- package/dist/prebuild/cli.d.ts.map +1 -0
- package/dist/prebuild/cli.js +29 -0
- package/dist/prebuild/cli.js.map +1 -0
- package/dist/prebuild/index.d.ts +22 -0
- package/dist/prebuild/index.d.ts.map +1 -0
- package/dist/prebuild/index.js +239 -0
- package/dist/prebuild/index.js.map +1 -0
- package/dist/prebuild.d.ts +8 -0
- package/dist/prebuild.d.ts.map +1 -0
- package/dist/prebuild.js +6 -0
- package/dist/prebuild.js.map +1 -0
- package/dist/registry/cache-config.d.ts +13 -0
- package/dist/registry/cache-config.d.ts.map +1 -0
- package/dist/registry/cache-config.js +17 -0
- package/dist/registry/cache-config.js.map +1 -0
- package/dist/registry/class-registration.d.ts +31 -0
- package/dist/registry/class-registration.d.ts.map +1 -0
- package/dist/registry/class-registration.js +1074 -0
- package/dist/registry/class-registration.js.map +1 -0
- package/dist/registry/collection-resolution.d.ts +45 -0
- package/dist/registry/collection-resolution.d.ts.map +1 -0
- package/dist/registry/collection-resolution.js +121 -0
- package/dist/registry/collection-resolution.js.map +1 -0
- package/dist/registry/collision-policy.d.ts +179 -0
- package/dist/registry/collision-policy.d.ts.map +1 -0
- package/dist/registry/collision-policy.js +153 -0
- package/dist/registry/collision-policy.js.map +1 -0
- package/dist/registry/diagnostics.d.ts +58 -0
- package/dist/registry/diagnostics.d.ts.map +1 -0
- package/dist/registry/diagnostics.js +54 -0
- package/dist/registry/diagnostics.js.map +1 -0
- package/dist/registry/embedding-manager.d.ts +23 -0
- package/dist/registry/embedding-manager.d.ts.map +1 -0
- package/dist/registry/embedding-manager.js +62 -0
- package/dist/registry/embedding-manager.js.map +1 -0
- package/dist/registry/index.d.ts +13 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/inheritance-resolver.d.ts +13 -0
- package/dist/registry/inheritance-resolver.d.ts.map +1 -0
- package/dist/registry/inheritance-resolver.js +244 -0
- package/dist/registry/inheritance-resolver.js.map +1 -0
- package/dist/registry/manifest-field-merge.d.ts +4 -0
- package/dist/registry/manifest-field-merge.d.ts.map +1 -0
- package/dist/registry/manifest-field-merge.js +82 -0
- package/dist/registry/manifest-field-merge.js.map +1 -0
- package/dist/registry/name-resolver.d.ts +102 -0
- package/dist/registry/name-resolver.d.ts.map +1 -0
- package/dist/registry/name-resolver.js +241 -0
- package/dist/registry/name-resolver.js.map +1 -0
- package/dist/registry/relationship-graph.d.ts +16 -0
- package/dist/registry/relationship-graph.d.ts.map +1 -0
- package/dist/registry/relationship-graph.js +79 -0
- package/dist/registry/relationship-graph.js.map +1 -0
- package/dist/registry/schema-builder.d.ts +113 -0
- package/dist/registry/schema-builder.d.ts.map +1 -0
- package/dist/registry/schema-builder.js +474 -0
- package/dist/registry/schema-builder.js.map +1 -0
- package/dist/registry/shared-state.d.ts +62 -0
- package/dist/registry/shared-state.d.ts.map +1 -0
- package/dist/registry/shared-state.js +135 -0
- package/dist/registry/shared-state.js.map +1 -0
- package/dist/registry/types.d.ts +667 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/validator.d.ts +13 -0
- package/dist/registry/validator.d.ts.map +1 -0
- package/dist/registry/validator.js +138 -0
- package/dist/registry/validator.js.map +1 -0
- package/dist/registry.d.ts +1358 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +2301 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime/client.d.ts +34 -0
- package/dist/runtime/client.d.ts.map +1 -0
- package/dist/runtime/client.js +104 -0
- package/dist/runtime/client.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/mcp.d.ts +47 -0
- package/dist/runtime/mcp.d.ts.map +1 -0
- package/dist/runtime/mcp.js +72 -0
- package/dist/runtime/mcp.js.map +1 -0
- package/dist/runtime/server.d.ts +92 -0
- package/dist/runtime/server.d.ts.map +1 -0
- package/dist/runtime/server.js +390 -0
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/types.d.ts +58 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime.d.ts +8 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +10 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scanner/import-scanner.d.ts +7 -0
- package/dist/scanner/import-scanner.d.ts.map +1 -0
- package/dist/scanner/index.d.ts +12 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/manifest-generator.d.ts +304 -0
- package/dist/scanner/manifest-generator.d.ts.map +1 -0
- package/dist/scanner/manifest-generator.js +1707 -0
- package/dist/scanner/manifest-generator.js.map +1 -0
- package/dist/scanner/test-file-patterns.d.ts +18 -0
- package/dist/scanner/test-file-patterns.d.ts.map +1 -0
- package/dist/scanner/test-file-patterns.js +16 -0
- package/dist/scanner/test-file-patterns.js.map +1 -0
- package/dist/scanner/types.d.ts +313 -0
- package/dist/scanner/types.d.ts.map +1 -0
- package/dist/scanner/types.js +2 -0
- package/dist/scanner/types.js.map +1 -0
- package/dist/scanner.d.ts +6 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +6 -0
- package/dist/scanner.js.map +1 -0
- package/dist/schema/code-generator.d.ts +53 -0
- package/dist/schema/code-generator.d.ts.map +1 -0
- package/dist/schema/ddl/base-strategy.d.ts +80 -0
- package/dist/schema/ddl/base-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/base-strategy.js +240 -0
- package/dist/schema/ddl/base-strategy.js.map +1 -0
- package/dist/schema/ddl/duckdb-strategy.d.ts +33 -0
- package/dist/schema/ddl/duckdb-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/duckdb-strategy.js +74 -0
- package/dist/schema/ddl/duckdb-strategy.js.map +1 -0
- package/dist/schema/ddl/index.d.ts +53 -0
- package/dist/schema/ddl/index.d.ts.map +1 -0
- package/dist/schema/ddl/index.js +80 -0
- package/dist/schema/ddl/index.js.map +1 -0
- package/dist/schema/ddl/json-duckdb-strategy.d.ts +8 -0
- package/dist/schema/ddl/json-duckdb-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/json-duckdb-strategy.js +14 -0
- package/dist/schema/ddl/json-duckdb-strategy.js.map +1 -0
- package/dist/schema/ddl/postgres-strategy.d.ts +29 -0
- package/dist/schema/ddl/postgres-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/postgres-strategy.js +102 -0
- package/dist/schema/ddl/postgres-strategy.js.map +1 -0
- package/dist/schema/ddl/sqlite-strategy.d.ts +38 -0
- package/dist/schema/ddl/sqlite-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/sqlite-strategy.js +74 -0
- package/dist/schema/ddl/sqlite-strategy.js.map +1 -0
- package/dist/schema/ddl/types.d.ts +114 -0
- package/dist/schema/ddl/types.d.ts.map +1 -0
- package/dist/schema/generator.d.ts +176 -0
- package/dist/schema/generator.d.ts.map +1 -0
- package/dist/schema/generator.js +1076 -0
- package/dist/schema/generator.js.map +1 -0
- package/dist/schema/index-utils.d.ts +19 -0
- package/dist/schema/index-utils.d.ts.map +1 -0
- package/dist/schema/index-utils.js +32 -0
- package/dist/schema/index-utils.js.map +1 -0
- package/dist/schema/index.d.ts +13 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/override-system.d.ts +43 -0
- package/dist/schema/override-system.d.ts.map +1 -0
- package/dist/schema/schema-aggregator.d.ts +112 -0
- package/dist/schema/schema-aggregator.d.ts.map +1 -0
- package/dist/schema/schema-manager.d.ts +95 -0
- package/dist/schema/schema-manager.d.ts.map +1 -0
- package/dist/schema/schema-manager.js +283 -0
- package/dist/schema/schema-manager.js.map +1 -0
- package/dist/schema/sql-identifiers.d.ts +107 -0
- package/dist/schema/sql-identifiers.d.ts.map +1 -0
- package/dist/schema/sql-identifiers.js +190 -0
- package/dist/schema/sql-identifiers.js.map +1 -0
- package/dist/schema/table-verifier.d.ts +10 -0
- package/dist/schema/table-verifier.d.ts.map +1 -0
- package/dist/schema/table-verifier.js +37 -0
- package/dist/schema/table-verifier.js.map +1 -0
- package/dist/schema/types.d.ts +241 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/utils.d.ts +32 -0
- package/dist/schema/utils.d.ts.map +1 -0
- package/dist/schema/utils.js +134 -0
- package/dist/schema/utils.js.map +1 -0
- package/dist/scripts/create-wrappers.js +89 -0
- package/dist/scripts/generate-manifest.js +155 -0
- package/dist/scripts/generate-test-manifest.js +77 -0
- package/dist/scripts/migrate-datetime-to-timestamp.ts +310 -0
- package/dist/scripts/prepack.js +49 -0
- package/dist/signals/bus.d.ts +64 -0
- package/dist/signals/bus.d.ts.map +1 -0
- package/dist/signals/bus.js +102 -0
- package/dist/signals/bus.js.map +1 -0
- package/dist/signals/index.d.ts +11 -0
- package/dist/signals/index.d.ts.map +1 -0
- package/dist/signals/sanitizer.d.ts +54 -0
- package/dist/signals/sanitizer.d.ts.map +1 -0
- package/dist/signals/sanitizer.js +111 -0
- package/dist/signals/sanitizer.js.map +1 -0
- package/dist/smrt-knowledge.json +335 -0
- package/dist/system/compatibility.d.ts +8 -0
- package/dist/system/compatibility.d.ts.map +1 -0
- package/dist/system/compatibility.js +409 -0
- package/dist/system/compatibility.js.map +1 -0
- package/dist/system/index.d.ts +9 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/schema.d.ts +69 -0
- package/dist/system/schema.d.ts.map +1 -0
- package/dist/system/schema.js +271 -0
- package/dist/system/schema.js.map +1 -0
- package/dist/system/types.d.ts +135 -0
- package/dist/system/types.d.ts.map +1 -0
- package/dist/system-fields.d.ts +44 -0
- package/dist/system-fields.d.ts.map +1 -0
- package/dist/system-fields.js +55 -0
- package/dist/system-fields.js.map +1 -0
- package/dist/table-cache.d.ts +28 -0
- package/dist/table-cache.d.ts.map +1 -0
- package/dist/table-cache.js +21 -0
- package/dist/table-cache.js.map +1 -0
- package/dist/test-utils.d.ts +140 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/testing/database.d.ts +73 -0
- package/dist/testing/database.d.ts.map +1 -0
- package/dist/testing/database.js +204 -0
- package/dist/testing/database.js.map +1 -0
- package/dist/testing/index.d.ts +21 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing.d.ts +6 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +5 -0
- package/dist/testing.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/tool-executor.d.ts +101 -0
- package/dist/tools/tool-executor.d.ts.map +1 -0
- package/dist/tools/tool-executor.js +142 -0
- package/dist/tools/tool-executor.js.map +1 -0
- package/dist/tools/tool-generator.d.ts +54 -0
- package/dist/tools/tool-generator.d.ts.map +1 -0
- package/dist/tools/tool-generator.js +121 -0
- package/dist/tools/tool-generator.js.map +1 -0
- package/dist/utils/chunk.d.ts +32 -0
- package/dist/utils/chunk.d.ts.map +1 -0
- package/dist/utils/chunk.js +14 -0
- package/dist/utils/chunk.js.map +1 -0
- package/dist/utils/import-workspace-module.d.ts +8 -0
- package/dist/utils/import-workspace-module.d.ts.map +1 -0
- package/dist/utils/import-workspace-module.js +81 -0
- package/dist/utils/import-workspace-module.js.map +1 -0
- package/dist/utils/json.d.ts +102 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +43 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/lru-cache.d.ts +69 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/lru-cache.js +100 -0
- package/dist/utils/lru-cache.js.map +1 -0
- package/dist/utils/naming.d.ts +16 -0
- package/dist/utils/naming.d.ts.map +1 -0
- package/dist/utils/naming.js +23 -0
- package/dist/utils/naming.js.map +1 -0
- package/dist/utils/qualified-names.d.ts +122 -0
- package/dist/utils/qualified-names.d.ts.map +1 -0
- package/dist/utils/qualified-names.js +82 -0
- package/dist/utils/qualified-names.js.map +1 -0
- package/dist/utils/scanner-module.d.ts +37 -0
- package/dist/utils/scanner-module.d.ts.map +1 -0
- package/dist/utils.d.ts +177 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +185 -0
- package/dist/utils.js.map +1 -0
- package/dist/vite-plugin/import-build-aware.d.ts +68 -0
- package/dist/vite-plugin/import-build-aware.d.ts.map +1 -0
- package/dist/vite-plugin/import-build-aware.js +72 -0
- package/dist/vite-plugin/import-build-aware.js.map +1 -0
- package/dist/vite-plugin/index.d.ts +59 -0
- package/dist/vite-plugin/index.d.ts.map +1 -0
- package/dist/vite-plugin/index.js +1400 -0
- package/dist/vite-plugin/index.js.map +1 -0
- package/dist/vite-plugin/sveltekit-generator.d.ts +66 -0
- package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -0
- package/dist/vite-plugin/sveltekit-generator.js +1375 -0
- package/dist/vite-plugin/sveltekit-generator.js.map +1 -0
- package/dist/vite-plugin/templates/default-ui.ts +432 -0
- package/dist/vite-plugin/templates/default.html +206 -0
- package/dist/vite-plugin.d.ts +8 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +11 -0
- package/dist/vite-plugin.js.map +1 -0
- package/package.json +208 -0
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import { parseClass } from "./brace-expressions.js";
|
|
2
|
+
import { unescape } from "./unescape.js";
|
|
3
|
+
var _a;
|
|
4
|
+
const types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
5
|
+
const isExtglobType = (c) => types.has(c);
|
|
6
|
+
const isExtglobAST = (c) => isExtglobType(c.type);
|
|
7
|
+
const adoptionMap = /* @__PURE__ */ new Map([
|
|
8
|
+
["!", ["@"]],
|
|
9
|
+
["?", ["?", "@"]],
|
|
10
|
+
["@", ["@"]],
|
|
11
|
+
["*", ["*", "+", "?", "@"]],
|
|
12
|
+
["+", ["+", "@"]]
|
|
13
|
+
]);
|
|
14
|
+
const adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
15
|
+
["!", ["?"]],
|
|
16
|
+
["@", ["?"]],
|
|
17
|
+
["+", ["?", "*"]]
|
|
18
|
+
]);
|
|
19
|
+
const adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
20
|
+
["!", ["?", "@"]],
|
|
21
|
+
["?", ["?", "@"]],
|
|
22
|
+
["@", ["?", "@"]],
|
|
23
|
+
["*", ["*", "+", "?", "@"]],
|
|
24
|
+
["+", ["+", "@", "?", "*"]]
|
|
25
|
+
]);
|
|
26
|
+
const usurpMap = /* @__PURE__ */ new Map([
|
|
27
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
28
|
+
[
|
|
29
|
+
"?",
|
|
30
|
+
/* @__PURE__ */ new Map([
|
|
31
|
+
["*", "*"],
|
|
32
|
+
["+", "*"]
|
|
33
|
+
])
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"@",
|
|
37
|
+
/* @__PURE__ */ new Map([
|
|
38
|
+
["!", "!"],
|
|
39
|
+
["?", "?"],
|
|
40
|
+
["@", "@"],
|
|
41
|
+
["*", "*"],
|
|
42
|
+
["+", "+"]
|
|
43
|
+
])
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"+",
|
|
47
|
+
/* @__PURE__ */ new Map([
|
|
48
|
+
["?", "*"],
|
|
49
|
+
["*", "*"]
|
|
50
|
+
])
|
|
51
|
+
]
|
|
52
|
+
]);
|
|
53
|
+
const startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
54
|
+
const startNoDot = "(?!\\.)";
|
|
55
|
+
const addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
56
|
+
const justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
57
|
+
const reSpecials = new Set("().*{}+?[]^$\\!");
|
|
58
|
+
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
59
|
+
const qmark = "[^/]";
|
|
60
|
+
const star = qmark + "*?";
|
|
61
|
+
const starNoEmpty = qmark + "+?";
|
|
62
|
+
let ID = 0;
|
|
63
|
+
class AST {
|
|
64
|
+
type;
|
|
65
|
+
#root;
|
|
66
|
+
#hasMagic;
|
|
67
|
+
#uflag = false;
|
|
68
|
+
#parts = [];
|
|
69
|
+
#parent;
|
|
70
|
+
#parentIndex;
|
|
71
|
+
#negs;
|
|
72
|
+
#filledNegs = false;
|
|
73
|
+
#options;
|
|
74
|
+
#toString;
|
|
75
|
+
// set to true if it's an extglob with no children
|
|
76
|
+
// (which really means one child of '')
|
|
77
|
+
#emptyExt = false;
|
|
78
|
+
id = ++ID;
|
|
79
|
+
get depth() {
|
|
80
|
+
return (this.#parent?.depth ?? -1) + 1;
|
|
81
|
+
}
|
|
82
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
83
|
+
return {
|
|
84
|
+
"@@type": "AST",
|
|
85
|
+
id: this.id,
|
|
86
|
+
type: this.type,
|
|
87
|
+
root: this.#root.id,
|
|
88
|
+
parent: this.#parent?.id,
|
|
89
|
+
depth: this.depth,
|
|
90
|
+
partsLength: this.#parts.length,
|
|
91
|
+
parts: this.#parts
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
constructor(type, parent, options = {}) {
|
|
95
|
+
this.type = type;
|
|
96
|
+
if (type)
|
|
97
|
+
this.#hasMagic = true;
|
|
98
|
+
this.#parent = parent;
|
|
99
|
+
this.#root = this.#parent ? this.#parent.#root : this;
|
|
100
|
+
this.#options = this.#root === this ? options : this.#root.#options;
|
|
101
|
+
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
|
102
|
+
if (type === "!" && !this.#root.#filledNegs)
|
|
103
|
+
this.#negs.push(this);
|
|
104
|
+
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
|
105
|
+
}
|
|
106
|
+
get hasMagic() {
|
|
107
|
+
if (this.#hasMagic !== void 0)
|
|
108
|
+
return this.#hasMagic;
|
|
109
|
+
for (const p of this.#parts) {
|
|
110
|
+
if (typeof p === "string")
|
|
111
|
+
continue;
|
|
112
|
+
if (p.type || p.hasMagic)
|
|
113
|
+
return this.#hasMagic = true;
|
|
114
|
+
}
|
|
115
|
+
return this.#hasMagic;
|
|
116
|
+
}
|
|
117
|
+
// reconstructs the pattern
|
|
118
|
+
toString() {
|
|
119
|
+
if (this.#toString !== void 0)
|
|
120
|
+
return this.#toString;
|
|
121
|
+
if (!this.type) {
|
|
122
|
+
return this.#toString = this.#parts.map((p) => String(p)).join("");
|
|
123
|
+
} else {
|
|
124
|
+
return this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
#fillNegs() {
|
|
128
|
+
if (this !== this.#root)
|
|
129
|
+
throw new Error("should only call on root");
|
|
130
|
+
if (this.#filledNegs)
|
|
131
|
+
return this;
|
|
132
|
+
this.toString();
|
|
133
|
+
this.#filledNegs = true;
|
|
134
|
+
let n;
|
|
135
|
+
while (n = this.#negs.pop()) {
|
|
136
|
+
if (n.type !== "!")
|
|
137
|
+
continue;
|
|
138
|
+
let p = n;
|
|
139
|
+
let pp = p.#parent;
|
|
140
|
+
while (pp) {
|
|
141
|
+
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
|
|
142
|
+
for (const part of n.#parts) {
|
|
143
|
+
if (typeof part === "string") {
|
|
144
|
+
throw new Error("string part in extglob AST??");
|
|
145
|
+
}
|
|
146
|
+
part.copyIn(pp.#parts[i]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
p = pp;
|
|
150
|
+
pp = p.#parent;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
push(...parts) {
|
|
156
|
+
for (const p of parts) {
|
|
157
|
+
if (p === "")
|
|
158
|
+
continue;
|
|
159
|
+
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
|
160
|
+
throw new Error("invalid part: " + p);
|
|
161
|
+
}
|
|
162
|
+
this.#parts.push(p);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
toJSON() {
|
|
166
|
+
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
167
|
+
if (this.isStart() && !this.type)
|
|
168
|
+
ret.unshift([]);
|
|
169
|
+
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
|
|
170
|
+
ret.push({});
|
|
171
|
+
}
|
|
172
|
+
return ret;
|
|
173
|
+
}
|
|
174
|
+
isStart() {
|
|
175
|
+
if (this.#root === this)
|
|
176
|
+
return true;
|
|
177
|
+
if (!this.#parent?.isStart())
|
|
178
|
+
return false;
|
|
179
|
+
if (this.#parentIndex === 0)
|
|
180
|
+
return true;
|
|
181
|
+
const p = this.#parent;
|
|
182
|
+
for (let i = 0; i < this.#parentIndex; i++) {
|
|
183
|
+
const pp = p.#parts[i];
|
|
184
|
+
if (!(pp instanceof _a && pp.type === "!")) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
isEnd() {
|
|
191
|
+
if (this.#root === this)
|
|
192
|
+
return true;
|
|
193
|
+
if (this.#parent?.type === "!")
|
|
194
|
+
return true;
|
|
195
|
+
if (!this.#parent?.isEnd())
|
|
196
|
+
return false;
|
|
197
|
+
if (!this.type)
|
|
198
|
+
return this.#parent?.isEnd();
|
|
199
|
+
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
200
|
+
return this.#parentIndex === pl - 1;
|
|
201
|
+
}
|
|
202
|
+
copyIn(part) {
|
|
203
|
+
if (typeof part === "string")
|
|
204
|
+
this.push(part);
|
|
205
|
+
else
|
|
206
|
+
this.push(part.clone(this));
|
|
207
|
+
}
|
|
208
|
+
clone(parent) {
|
|
209
|
+
const c = new _a(this.type, parent);
|
|
210
|
+
for (const p of this.#parts) {
|
|
211
|
+
c.copyIn(p);
|
|
212
|
+
}
|
|
213
|
+
return c;
|
|
214
|
+
}
|
|
215
|
+
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
216
|
+
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
217
|
+
let escaping = false;
|
|
218
|
+
let inBrace = false;
|
|
219
|
+
let braceStart = -1;
|
|
220
|
+
let braceNeg = false;
|
|
221
|
+
if (ast.type === null) {
|
|
222
|
+
let i2 = pos;
|
|
223
|
+
let acc2 = "";
|
|
224
|
+
while (i2 < str.length) {
|
|
225
|
+
const c = str.charAt(i2++);
|
|
226
|
+
if (escaping || c === "\\") {
|
|
227
|
+
escaping = !escaping;
|
|
228
|
+
acc2 += c;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (inBrace) {
|
|
232
|
+
if (i2 === braceStart + 1) {
|
|
233
|
+
if (c === "^" || c === "!") {
|
|
234
|
+
braceNeg = true;
|
|
235
|
+
}
|
|
236
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
237
|
+
inBrace = false;
|
|
238
|
+
}
|
|
239
|
+
acc2 += c;
|
|
240
|
+
continue;
|
|
241
|
+
} else if (c === "[") {
|
|
242
|
+
inBrace = true;
|
|
243
|
+
braceStart = i2;
|
|
244
|
+
braceNeg = false;
|
|
245
|
+
acc2 += c;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
|
|
249
|
+
if (doRecurse) {
|
|
250
|
+
ast.push(acc2);
|
|
251
|
+
acc2 = "";
|
|
252
|
+
const ext = new _a(c, ast);
|
|
253
|
+
i2 = _a.#parseAST(str, ext, i2, opt, extDepth + 1);
|
|
254
|
+
ast.push(ext);
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
acc2 += c;
|
|
258
|
+
}
|
|
259
|
+
ast.push(acc2);
|
|
260
|
+
return i2;
|
|
261
|
+
}
|
|
262
|
+
let i = pos + 1;
|
|
263
|
+
let part = new _a(null, ast);
|
|
264
|
+
const parts = [];
|
|
265
|
+
let acc = "";
|
|
266
|
+
while (i < str.length) {
|
|
267
|
+
const c = str.charAt(i++);
|
|
268
|
+
if (escaping || c === "\\") {
|
|
269
|
+
escaping = !escaping;
|
|
270
|
+
acc += c;
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (inBrace) {
|
|
274
|
+
if (i === braceStart + 1) {
|
|
275
|
+
if (c === "^" || c === "!") {
|
|
276
|
+
braceNeg = true;
|
|
277
|
+
}
|
|
278
|
+
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
|
|
279
|
+
inBrace = false;
|
|
280
|
+
}
|
|
281
|
+
acc += c;
|
|
282
|
+
continue;
|
|
283
|
+
} else if (c === "[") {
|
|
284
|
+
inBrace = true;
|
|
285
|
+
braceStart = i;
|
|
286
|
+
braceNeg = false;
|
|
287
|
+
acc += c;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
291
|
+
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
|
292
|
+
if (doRecurse) {
|
|
293
|
+
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
294
|
+
part.push(acc);
|
|
295
|
+
acc = "";
|
|
296
|
+
const ext = new _a(c, part);
|
|
297
|
+
part.push(ext);
|
|
298
|
+
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
if (c === "|") {
|
|
302
|
+
part.push(acc);
|
|
303
|
+
acc = "";
|
|
304
|
+
parts.push(part);
|
|
305
|
+
part = new _a(null, ast);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
if (c === ")") {
|
|
309
|
+
if (acc === "" && ast.#parts.length === 0) {
|
|
310
|
+
ast.#emptyExt = true;
|
|
311
|
+
}
|
|
312
|
+
part.push(acc);
|
|
313
|
+
acc = "";
|
|
314
|
+
ast.push(...parts, part);
|
|
315
|
+
return i;
|
|
316
|
+
}
|
|
317
|
+
acc += c;
|
|
318
|
+
}
|
|
319
|
+
ast.type = null;
|
|
320
|
+
ast.#hasMagic = void 0;
|
|
321
|
+
ast.#parts = [str.substring(pos - 1)];
|
|
322
|
+
return i;
|
|
323
|
+
}
|
|
324
|
+
#canAdoptWithSpace(child) {
|
|
325
|
+
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
326
|
+
}
|
|
327
|
+
#canAdopt(child, map = adoptionMap) {
|
|
328
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
const gc = child.#parts[0];
|
|
332
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
return this.#canAdoptType(gc.type, map);
|
|
336
|
+
}
|
|
337
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
338
|
+
return !!map.get(this.type)?.includes(c);
|
|
339
|
+
}
|
|
340
|
+
#adoptWithSpace(child, index) {
|
|
341
|
+
const gc = child.#parts[0];
|
|
342
|
+
const blank = new _a(null, gc, this.options);
|
|
343
|
+
blank.#parts.push("");
|
|
344
|
+
gc.push(blank);
|
|
345
|
+
this.#adopt(child, index);
|
|
346
|
+
}
|
|
347
|
+
#adopt(child, index) {
|
|
348
|
+
const gc = child.#parts[0];
|
|
349
|
+
this.#parts.splice(index, 1, ...gc.#parts);
|
|
350
|
+
for (const p of gc.#parts) {
|
|
351
|
+
if (typeof p === "object")
|
|
352
|
+
p.#parent = this;
|
|
353
|
+
}
|
|
354
|
+
this.#toString = void 0;
|
|
355
|
+
}
|
|
356
|
+
#canUsurpType(c) {
|
|
357
|
+
const m = usurpMap.get(this.type);
|
|
358
|
+
return !!m?.has(c);
|
|
359
|
+
}
|
|
360
|
+
#canUsurp(child) {
|
|
361
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
const gc = child.#parts[0];
|
|
365
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
return this.#canUsurpType(gc.type);
|
|
369
|
+
}
|
|
370
|
+
#usurp(child) {
|
|
371
|
+
const m = usurpMap.get(this.type);
|
|
372
|
+
const gc = child.#parts[0];
|
|
373
|
+
const nt = m?.get(gc.type);
|
|
374
|
+
if (!nt)
|
|
375
|
+
return false;
|
|
376
|
+
this.#parts = gc.#parts;
|
|
377
|
+
for (const p of this.#parts) {
|
|
378
|
+
if (typeof p === "object") {
|
|
379
|
+
p.#parent = this;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
this.type = nt;
|
|
383
|
+
this.#toString = void 0;
|
|
384
|
+
this.#emptyExt = false;
|
|
385
|
+
}
|
|
386
|
+
static fromGlob(pattern, options = {}) {
|
|
387
|
+
const ast = new _a(null, void 0, options);
|
|
388
|
+
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
389
|
+
return ast;
|
|
390
|
+
}
|
|
391
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
392
|
+
// string if not.
|
|
393
|
+
toMMPattern() {
|
|
394
|
+
if (this !== this.#root)
|
|
395
|
+
return this.#root.toMMPattern();
|
|
396
|
+
const glob = this.toString();
|
|
397
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
398
|
+
const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
399
|
+
if (!anyMagic) {
|
|
400
|
+
return body;
|
|
401
|
+
}
|
|
402
|
+
const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
|
|
403
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
404
|
+
_src: re,
|
|
405
|
+
_glob: glob
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
get options() {
|
|
409
|
+
return this.#options;
|
|
410
|
+
}
|
|
411
|
+
// returns the string match, the regexp source, whether there's magic
|
|
412
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
413
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
414
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
415
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
416
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
417
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
418
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
419
|
+
//
|
|
420
|
+
// In part-matching mode, the start is:
|
|
421
|
+
// - if not isStart: nothing
|
|
422
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
423
|
+
// - if dots allowed or not possible: ^
|
|
424
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
425
|
+
// end is:
|
|
426
|
+
// - if not isEnd(): nothing
|
|
427
|
+
// - else: $
|
|
428
|
+
//
|
|
429
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
430
|
+
// pattern, so start is:
|
|
431
|
+
// - if first pattern: same as part-matching mode
|
|
432
|
+
// - if not isStart(): nothing
|
|
433
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
434
|
+
// - if dots allowed or not possible: /
|
|
435
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
436
|
+
// end is:
|
|
437
|
+
// - if last pattern, same as part-matching mode
|
|
438
|
+
// - else nothing
|
|
439
|
+
//
|
|
440
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
441
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
442
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
443
|
+
// the pattern.
|
|
444
|
+
//
|
|
445
|
+
// We can just always return the same end, and leave it up to the caller
|
|
446
|
+
// to know whether it's going to be used joined or in parts.
|
|
447
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
448
|
+
// - if not isStart: nothing
|
|
449
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
450
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
451
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
452
|
+
//
|
|
453
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
454
|
+
// performance, so probably better to return both start options.
|
|
455
|
+
//
|
|
456
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
457
|
+
// and the start always gets applied.
|
|
458
|
+
//
|
|
459
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
460
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
461
|
+
//
|
|
462
|
+
// So the todo is:
|
|
463
|
+
// - better detect what kind of start is needed
|
|
464
|
+
// - return both flavors of starting pattern
|
|
465
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
466
|
+
//
|
|
467
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
468
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
469
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
470
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
471
|
+
//
|
|
472
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
473
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
474
|
+
// use the (?:^|/) style of start binding.
|
|
475
|
+
//
|
|
476
|
+
// Even simplified further:
|
|
477
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
478
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
479
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
480
|
+
toRegExpSource(allowDot) {
|
|
481
|
+
const dot = allowDot ?? !!this.#options.dot;
|
|
482
|
+
if (this.#root === this) {
|
|
483
|
+
this.#flatten();
|
|
484
|
+
this.#fillNegs();
|
|
485
|
+
}
|
|
486
|
+
if (!isExtglobAST(this)) {
|
|
487
|
+
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
|
488
|
+
const src = this.#parts.map((p) => {
|
|
489
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
490
|
+
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
491
|
+
this.#uflag = this.#uflag || uflag;
|
|
492
|
+
return re;
|
|
493
|
+
}).join("");
|
|
494
|
+
let start2 = "";
|
|
495
|
+
if (this.isStart()) {
|
|
496
|
+
if (typeof this.#parts[0] === "string") {
|
|
497
|
+
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
|
|
498
|
+
if (!dotTravAllowed) {
|
|
499
|
+
const aps = addPatternStart;
|
|
500
|
+
const needNoTrav = (
|
|
501
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
502
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
503
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
504
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
505
|
+
);
|
|
506
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
507
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
let end = "";
|
|
512
|
+
if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
|
|
513
|
+
end = "(?:$|\\/)";
|
|
514
|
+
}
|
|
515
|
+
const final2 = start2 + src + end;
|
|
516
|
+
return [
|
|
517
|
+
final2,
|
|
518
|
+
unescape(src),
|
|
519
|
+
this.#hasMagic = !!this.#hasMagic,
|
|
520
|
+
this.#uflag
|
|
521
|
+
];
|
|
522
|
+
}
|
|
523
|
+
const repeated = this.type === "*" || this.type === "+";
|
|
524
|
+
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
525
|
+
let body = this.#partsToRegExp(dot);
|
|
526
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
527
|
+
const s = this.toString();
|
|
528
|
+
const me = this;
|
|
529
|
+
me.#parts = [s];
|
|
530
|
+
me.type = null;
|
|
531
|
+
me.#hasMagic = void 0;
|
|
532
|
+
return [s, unescape(this.toString()), false, false];
|
|
533
|
+
}
|
|
534
|
+
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
|
535
|
+
if (bodyDotAllowed === body) {
|
|
536
|
+
bodyDotAllowed = "";
|
|
537
|
+
}
|
|
538
|
+
if (bodyDotAllowed) {
|
|
539
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
540
|
+
}
|
|
541
|
+
let final = "";
|
|
542
|
+
if (this.type === "!" && this.#emptyExt) {
|
|
543
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
544
|
+
} else {
|
|
545
|
+
const close = this.type === "!" ? (
|
|
546
|
+
// !() must match something,but !(x) can match ''
|
|
547
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
548
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
549
|
+
final = start + body + close;
|
|
550
|
+
}
|
|
551
|
+
return [
|
|
552
|
+
final,
|
|
553
|
+
unescape(body),
|
|
554
|
+
this.#hasMagic = !!this.#hasMagic,
|
|
555
|
+
this.#uflag
|
|
556
|
+
];
|
|
557
|
+
}
|
|
558
|
+
#flatten() {
|
|
559
|
+
if (!isExtglobAST(this)) {
|
|
560
|
+
for (const p of this.#parts) {
|
|
561
|
+
if (typeof p === "object") {
|
|
562
|
+
p.#flatten();
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
} else {
|
|
566
|
+
let iterations = 0;
|
|
567
|
+
let done = false;
|
|
568
|
+
do {
|
|
569
|
+
done = true;
|
|
570
|
+
for (let i = 0; i < this.#parts.length; i++) {
|
|
571
|
+
const c = this.#parts[i];
|
|
572
|
+
if (typeof c === "object") {
|
|
573
|
+
c.#flatten();
|
|
574
|
+
if (this.#canAdopt(c)) {
|
|
575
|
+
done = false;
|
|
576
|
+
this.#adopt(c, i);
|
|
577
|
+
} else if (this.#canAdoptWithSpace(c)) {
|
|
578
|
+
done = false;
|
|
579
|
+
this.#adoptWithSpace(c, i);
|
|
580
|
+
} else if (this.#canUsurp(c)) {
|
|
581
|
+
done = false;
|
|
582
|
+
this.#usurp(c);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
} while (!done && ++iterations < 10);
|
|
587
|
+
}
|
|
588
|
+
this.#toString = void 0;
|
|
589
|
+
}
|
|
590
|
+
#partsToRegExp(dot) {
|
|
591
|
+
return this.#parts.map((p) => {
|
|
592
|
+
if (typeof p === "string") {
|
|
593
|
+
throw new Error("string type in extglob ast??");
|
|
594
|
+
}
|
|
595
|
+
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
|
596
|
+
this.#uflag = this.#uflag || uflag;
|
|
597
|
+
return re;
|
|
598
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
599
|
+
}
|
|
600
|
+
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
|
601
|
+
let escaping = false;
|
|
602
|
+
let re = "";
|
|
603
|
+
let uflag = false;
|
|
604
|
+
let inStar = false;
|
|
605
|
+
for (let i = 0; i < glob.length; i++) {
|
|
606
|
+
const c = glob.charAt(i);
|
|
607
|
+
if (escaping) {
|
|
608
|
+
escaping = false;
|
|
609
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
if (c === "*") {
|
|
613
|
+
if (inStar)
|
|
614
|
+
continue;
|
|
615
|
+
inStar = true;
|
|
616
|
+
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
|
617
|
+
hasMagic = true;
|
|
618
|
+
continue;
|
|
619
|
+
} else {
|
|
620
|
+
inStar = false;
|
|
621
|
+
}
|
|
622
|
+
if (c === "\\") {
|
|
623
|
+
if (i === glob.length - 1) {
|
|
624
|
+
re += "\\\\";
|
|
625
|
+
} else {
|
|
626
|
+
escaping = true;
|
|
627
|
+
}
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
if (c === "[") {
|
|
631
|
+
const [src, needUflag, consumed, magic] = parseClass(glob, i);
|
|
632
|
+
if (consumed) {
|
|
633
|
+
re += src;
|
|
634
|
+
uflag = uflag || needUflag;
|
|
635
|
+
i += consumed - 1;
|
|
636
|
+
hasMagic = hasMagic || magic;
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if (c === "?") {
|
|
641
|
+
re += qmark;
|
|
642
|
+
hasMagic = true;
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
re += regExpEscape(c);
|
|
646
|
+
}
|
|
647
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
_a = AST;
|
|
651
|
+
export {
|
|
652
|
+
AST
|
|
653
|
+
};
|
|
654
|
+
//# sourceMappingURL=ast.js.map
|