@legioncodeinc/nectar 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +662 -0
- package/README.md +307 -0
- package/dist/api/daemon-api-wiring.d.ts +72 -0
- package/dist/api/daemon-api-wiring.d.ts.map +1 -0
- package/dist/api/daemon-api-wiring.js +150 -0
- package/dist/api/daemon-api-wiring.js.map +1 -0
- package/dist/api/hive-graph-api.d.ts +136 -0
- package/dist/api/hive-graph-api.d.ts.map +1 -0
- package/dist/api/hive-graph-api.js +234 -0
- package/dist/api/hive-graph-api.js.map +1 -0
- package/dist/api/loopback-client.d.ts +27 -0
- package/dist/api/loopback-client.d.ts.map +1 -0
- package/dist/api/loopback-client.js +87 -0
- package/dist/api/loopback-client.js.map +1 -0
- package/dist/api/router.d.ts +172 -0
- package/dist/api/router.d.ts.map +1 -0
- package/dist/api/router.js +212 -0
- package/dist/api/router.js.map +1 -0
- package/dist/api/status-query.d.ts +49 -0
- package/dist/api/status-query.d.ts.map +1 -0
- package/dist/api/status-query.js +103 -0
- package/dist/api/status-query.js.map +1 -0
- package/dist/brood-guard.d.ts +24 -0
- package/dist/brood-guard.d.ts.map +1 -0
- package/dist/brood-guard.js +19 -0
- package/dist/brood-guard.js.map +1 -0
- package/dist/brood-prereqs.d.ts +62 -0
- package/dist/brood-prereqs.d.ts.map +1 -0
- package/dist/brood-prereqs.js +87 -0
- package/dist/brood-prereqs.js.map +1 -0
- package/dist/brooding/bucketing.d.ts +68 -0
- package/dist/brooding/bucketing.d.ts.map +1 -0
- package/dist/brooding/bucketing.js +122 -0
- package/dist/brooding/bucketing.js.map +1 -0
- package/dist/brooding/cli.d.ts +78 -0
- package/dist/brooding/cli.d.ts.map +1 -0
- package/dist/brooding/cli.js +140 -0
- package/dist/brooding/cli.js.map +1 -0
- package/dist/brooding/constants.d.ts +75 -0
- package/dist/brooding/constants.d.ts.map +1 -0
- package/dist/brooding/constants.js +91 -0
- package/dist/brooding/constants.js.map +1 -0
- package/dist/brooding/cost.d.ts +110 -0
- package/dist/brooding/cost.d.ts.map +1 -0
- package/dist/brooding/cost.js +96 -0
- package/dist/brooding/cost.js.map +1 -0
- package/dist/brooding/describe.d.ts +152 -0
- package/dist/brooding/describe.d.ts.map +1 -0
- package/dist/brooding/describe.js +281 -0
- package/dist/brooding/describe.js.map +1 -0
- package/dist/brooding/discovery.d.ts +116 -0
- package/dist/brooding/discovery.d.ts.map +1 -0
- package/dist/brooding/discovery.js +179 -0
- package/dist/brooding/discovery.js.map +1 -0
- package/dist/brooding/index.d.ts +23 -0
- package/dist/brooding/index.d.ts.map +1 -0
- package/dist/brooding/index.js +33 -0
- package/dist/brooding/index.js.map +1 -0
- package/dist/brooding/pipeline-async.d.ts +97 -0
- package/dist/brooding/pipeline-async.d.ts.map +1 -0
- package/dist/brooding/pipeline-async.js +364 -0
- package/dist/brooding/pipeline-async.js.map +1 -0
- package/dist/brooding/pipeline.d.ts +198 -0
- package/dist/brooding/pipeline.d.ts.map +1 -0
- package/dist/brooding/pipeline.js +454 -0
- package/dist/brooding/pipeline.js.map +1 -0
- package/dist/brooding/precheck.d.ts +52 -0
- package/dist/brooding/precheck.d.ts.map +1 -0
- package/dist/brooding/precheck.js +143 -0
- package/dist/brooding/precheck.js.map +1 -0
- package/dist/brooding/resumability.d.ts +57 -0
- package/dist/brooding/resumability.d.ts.map +1 -0
- package/dist/brooding/resumability.js +46 -0
- package/dist/brooding/resumability.js.map +1 -0
- package/dist/cli.d.ts +139 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +912 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-file.d.ts +52 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +130 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +98 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon.d.ts +265 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +664 -0
- package/dist/daemon.js.map +1 -0
- package/dist/doctor-registry.d.ts +134 -0
- package/dist/doctor-registry.d.ts.map +1 -0
- package/dist/doctor-registry.js +173 -0
- package/dist/doctor-registry.js.map +1 -0
- package/dist/embeddings/cohere-portkey.d.ts +67 -0
- package/dist/embeddings/cohere-portkey.d.ts.map +1 -0
- package/dist/embeddings/cohere-portkey.js +171 -0
- package/dist/embeddings/cohere-portkey.js.map +1 -0
- package/dist/embeddings/config.d.ts +74 -0
- package/dist/embeddings/config.d.ts.map +1 -0
- package/dist/embeddings/config.js +131 -0
- package/dist/embeddings/config.js.map +1 -0
- package/dist/embeddings/guard.d.ts +34 -0
- package/dist/embeddings/guard.d.ts.map +1 -0
- package/dist/embeddings/guard.js +67 -0
- package/dist/embeddings/guard.js.map +1 -0
- package/dist/embeddings/hosted-portkey.d.ts +73 -0
- package/dist/embeddings/hosted-portkey.d.ts.map +1 -0
- package/dist/embeddings/hosted-portkey.js +179 -0
- package/dist/embeddings/hosted-portkey.js.map +1 -0
- package/dist/embeddings/http.d.ts +33 -0
- package/dist/embeddings/http.d.ts.map +1 -0
- package/dist/embeddings/http.js +19 -0
- package/dist/embeddings/http.js.map +1 -0
- package/dist/embeddings/index.d.ts +17 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +17 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/embeddings/local-nomic.d.ts +78 -0
- package/dist/embeddings/local-nomic.d.ts.map +1 -0
- package/dist/embeddings/local-nomic.js +126 -0
- package/dist/embeddings/local-nomic.js.map +1 -0
- package/dist/embeddings/provider.d.ts +79 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +50 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/enricher/config.d.ts +43 -0
- package/dist/enricher/config.d.ts.map +1 -0
- package/dist/enricher/config.js +34 -0
- package/dist/enricher/config.js.map +1 -0
- package/dist/enricher/content-cache.d.ts +29 -0
- package/dist/enricher/content-cache.d.ts.map +1 -0
- package/dist/enricher/content-cache.js +24 -0
- package/dist/enricher/content-cache.js.map +1 -0
- package/dist/enricher/cycle.d.ts +71 -0
- package/dist/enricher/cycle.d.ts.map +1 -0
- package/dist/enricher/cycle.js +319 -0
- package/dist/enricher/cycle.js.map +1 -0
- package/dist/enricher/describe.d.ts +61 -0
- package/dist/enricher/describe.d.ts.map +1 -0
- package/dist/enricher/describe.js +175 -0
- package/dist/enricher/describe.js.map +1 -0
- package/dist/enricher/failure.d.ts +25 -0
- package/dist/enricher/failure.d.ts.map +1 -0
- package/dist/enricher/failure.js +46 -0
- package/dist/enricher/failure.js.map +1 -0
- package/dist/enricher/index.d.ts +22 -0
- package/dist/enricher/index.d.ts.map +1 -0
- package/dist/enricher/index.js +22 -0
- package/dist/enricher/index.js.map +1 -0
- package/dist/enricher/jaccard.d.ts +11 -0
- package/dist/enricher/jaccard.d.ts.map +1 -0
- package/dist/enricher/jaccard.js +29 -0
- package/dist/enricher/jaccard.js.map +1 -0
- package/dist/enricher/loop.d.ts +22 -0
- package/dist/enricher/loop.d.ts.map +1 -0
- package/dist/enricher/loop.js +34 -0
- package/dist/enricher/loop.js.map +1 -0
- package/dist/enricher/meaningful-change.d.ts +28 -0
- package/dist/enricher/meaningful-change.d.ts.map +1 -0
- package/dist/enricher/meaningful-change.js +41 -0
- package/dist/enricher/meaningful-change.js.map +1 -0
- package/dist/enricher/observability.d.ts +22 -0
- package/dist/enricher/observability.d.ts.map +1 -0
- package/dist/enricher/observability.js +55 -0
- package/dist/enricher/observability.js.map +1 -0
- package/dist/enricher/pending-query.d.ts +35 -0
- package/dist/enricher/pending-query.d.ts.map +1 -0
- package/dist/enricher/pending-query.js +54 -0
- package/dist/enricher/pending-query.js.map +1 -0
- package/dist/enricher/sql-update.d.ts +7 -0
- package/dist/enricher/sql-update.d.ts.map +1 -0
- package/dist/enricher/sql-update.js +22 -0
- package/dist/enricher/sql-update.js.map +1 -0
- package/dist/enricher/store-adapter.d.ts +98 -0
- package/dist/enricher/store-adapter.d.ts.map +1 -0
- package/dist/enricher/store-adapter.js +129 -0
- package/dist/enricher/store-adapter.js.map +1 -0
- package/dist/enricher/store.d.ts +58 -0
- package/dist/enricher/store.d.ts.map +1 -0
- package/dist/enricher/store.js +126 -0
- package/dist/enricher/store.js.map +1 -0
- package/dist/enricher/tokenize.d.ts +10 -0
- package/dist/enricher/tokenize.d.ts.map +1 -0
- package/dist/enricher/tokenize.js +28 -0
- package/dist/enricher/tokenize.js.map +1 -0
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/health.d.ts +147 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +168 -0
- package/dist/health.js.map +1 -0
- package/dist/hive-graph/deeplake-credentials.d.ts +68 -0
- package/dist/hive-graph/deeplake-credentials.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-credentials.js +135 -0
- package/dist/hive-graph/deeplake-credentials.js.map +1 -0
- package/dist/hive-graph/deeplake-heal.d.ts +63 -0
- package/dist/hive-graph/deeplake-heal.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-heal.js +118 -0
- package/dist/hive-graph/deeplake-heal.js.map +1 -0
- package/dist/hive-graph/deeplake-store.d.ts +199 -0
- package/dist/hive-graph/deeplake-store.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-store.js +541 -0
- package/dist/hive-graph/deeplake-store.js.map +1 -0
- package/dist/hive-graph/deeplake-transport.d.ts +89 -0
- package/dist/hive-graph/deeplake-transport.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-transport.js +145 -0
- package/dist/hive-graph/deeplake-transport.js.map +1 -0
- package/dist/hive-graph/hash.d.ts +3 -0
- package/dist/hive-graph/hash.d.ts.map +1 -0
- package/dist/hive-graph/hash.js +12 -0
- package/dist/hive-graph/hash.js.map +1 -0
- package/dist/hive-graph/memory-store.d.ts +39 -0
- package/dist/hive-graph/memory-store.d.ts.map +1 -0
- package/dist/hive-graph/memory-store.js +125 -0
- package/dist/hive-graph/memory-store.js.map +1 -0
- package/dist/hive-graph/model.d.ts +109 -0
- package/dist/hive-graph/model.d.ts.map +1 -0
- package/dist/hive-graph/model.js +36 -0
- package/dist/hive-graph/model.js.map +1 -0
- package/dist/hive-graph/paths.d.ts +7 -0
- package/dist/hive-graph/paths.d.ts.map +1 -0
- package/dist/hive-graph/paths.js +26 -0
- package/dist/hive-graph/paths.js.map +1 -0
- package/dist/hive-graph/project-scope.d.ts +99 -0
- package/dist/hive-graph/project-scope.d.ts.map +1 -0
- package/dist/hive-graph/project-scope.js +286 -0
- package/dist/hive-graph/project-scope.js.map +1 -0
- package/dist/hive-graph/schema.d.ts +53 -0
- package/dist/hive-graph/schema.d.ts.map +1 -0
- package/dist/hive-graph/schema.js +139 -0
- package/dist/hive-graph/schema.js.map +1 -0
- package/dist/hive-graph/search-types.d.ts +82 -0
- package/dist/hive-graph/search-types.d.ts.map +1 -0
- package/dist/hive-graph/search-types.js +2 -0
- package/dist/hive-graph/search-types.js.map +1 -0
- package/dist/hive-graph/search.d.ts +51 -0
- package/dist/hive-graph/search.d.ts.map +1 -0
- package/dist/hive-graph/search.js +417 -0
- package/dist/hive-graph/search.js.map +1 -0
- package/dist/hive-graph/sql-guards.d.ts +99 -0
- package/dist/hive-graph/sql-guards.d.ts.map +1 -0
- package/dist/hive-graph/sql-guards.js +129 -0
- package/dist/hive-graph/sql-guards.js.map +1 -0
- package/dist/hive-graph/store.d.ts +151 -0
- package/dist/hive-graph/store.d.ts.map +1 -0
- package/dist/hive-graph/store.js +2 -0
- package/dist/hive-graph/store.js.map +1 -0
- package/dist/hive-graph/ulid.d.ts +14 -0
- package/dist/hive-graph/ulid.d.ts.map +1 -0
- package/dist/hive-graph/ulid.js +109 -0
- package/dist/hive-graph/ulid.js.map +1 -0
- package/dist/hivedoctor-registry.d.ts +111 -0
- package/dist/hivedoctor-registry.d.ts.map +1 -0
- package/dist/hivedoctor-registry.js +143 -0
- package/dist/hivedoctor-registry.js.map +1 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/lock.d.ts +66 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/lock.js +282 -0
- package/dist/lock.js.map +1 -0
- package/dist/poll-loop.d.ts +71 -0
- package/dist/poll-loop.d.ts.map +1 -0
- package/dist/poll-loop.js +130 -0
- package/dist/poll-loop.js.map +1 -0
- package/dist/portkey/config.d.ts +46 -0
- package/dist/portkey/config.d.ts.map +1 -0
- package/dist/portkey/config.js +68 -0
- package/dist/portkey/config.js.map +1 -0
- package/dist/portkey/describe-model.d.ts +53 -0
- package/dist/portkey/describe-model.d.ts.map +1 -0
- package/dist/portkey/describe-model.js +56 -0
- package/dist/portkey/describe-model.js.map +1 -0
- package/dist/portkey/headers.d.ts +31 -0
- package/dist/portkey/headers.d.ts.map +1 -0
- package/dist/portkey/headers.js +37 -0
- package/dist/portkey/headers.js.map +1 -0
- package/dist/portkey/transport.d.ts +89 -0
- package/dist/portkey/transport.d.ts.map +1 -0
- package/dist/portkey/transport.js +167 -0
- package/dist/portkey/transport.js.map +1 -0
- package/dist/projection/format.d.ts +51 -0
- package/dist/projection/format.d.ts.map +1 -0
- package/dist/projection/format.js +81 -0
- package/dist/projection/format.js.map +1 -0
- package/dist/projection/generate.d.ts +31 -0
- package/dist/projection/generate.d.ts.map +1 -0
- package/dist/projection/generate.js +83 -0
- package/dist/projection/generate.js.map +1 -0
- package/dist/projection/inherit.d.ts +27 -0
- package/dist/projection/inherit.d.ts.map +1 -0
- package/dist/projection/inherit.js +128 -0
- package/dist/projection/inherit.js.map +1 -0
- package/dist/projection/load.d.ts +47 -0
- package/dist/projection/load.d.ts.map +1 -0
- package/dist/projection/load.js +258 -0
- package/dist/projection/load.js.map +1 -0
- package/dist/projection/store-adapter.d.ts +42 -0
- package/dist/projection/store-adapter.d.ts.map +1 -0
- package/dist/projection/store-adapter.js +42 -0
- package/dist/projection/store-adapter.js.map +1 -0
- package/dist/projection/write.d.ts +79 -0
- package/dist/projection/write.d.ts.map +1 -0
- package/dist/projection/write.js +122 -0
- package/dist/projection/write.js.map +1 -0
- package/dist/registration/classify.d.ts +33 -0
- package/dist/registration/classify.d.ts.map +1 -0
- package/dist/registration/classify.js +32 -0
- package/dist/registration/classify.js.map +1 -0
- package/dist/registration/copy-detect.d.ts +22 -0
- package/dist/registration/copy-detect.d.ts.map +1 -0
- package/dist/registration/copy-detect.js +12 -0
- package/dist/registration/copy-detect.js.map +1 -0
- package/dist/registration/disk-fs.d.ts +41 -0
- package/dist/registration/disk-fs.d.ts.map +1 -0
- package/dist/registration/disk-fs.js +175 -0
- package/dist/registration/disk-fs.js.map +1 -0
- package/dist/registration/fs-watch.d.ts +114 -0
- package/dist/registration/fs-watch.d.ts.map +1 -0
- package/dist/registration/fs-watch.js +266 -0
- package/dist/registration/fs-watch.js.map +1 -0
- package/dist/registration/ignore.d.ts +77 -0
- package/dist/registration/ignore.d.ts.map +1 -0
- package/dist/registration/ignore.js +249 -0
- package/dist/registration/ignore.js.map +1 -0
- package/dist/registration/ladder.d.ts +211 -0
- package/dist/registration/ladder.d.ts.map +1 -0
- package/dist/registration/ladder.js +378 -0
- package/dist/registration/ladder.js.map +1 -0
- package/dist/registration/paths-safe.d.ts +21 -0
- package/dist/registration/paths-safe.d.ts.map +1 -0
- package/dist/registration/paths-safe.js +88 -0
- package/dist/registration/paths-safe.js.map +1 -0
- package/dist/registration/prune-cli.d.ts +48 -0
- package/dist/registration/prune-cli.d.ts.map +1 -0
- package/dist/registration/prune-cli.js +57 -0
- package/dist/registration/prune-cli.js.map +1 -0
- package/dist/registration/review-cli.d.ts +42 -0
- package/dist/registration/review-cli.d.ts.map +1 -0
- package/dist/registration/review-cli.js +110 -0
- package/dist/registration/review-cli.js.map +1 -0
- package/dist/registration/review-store.d.ts +73 -0
- package/dist/registration/review-store.d.ts.map +1 -0
- package/dist/registration/review-store.js +243 -0
- package/dist/registration/review-store.js.map +1 -0
- package/dist/registration/service.d.ts +196 -0
- package/dist/registration/service.d.ts.map +1 -0
- package/dist/registration/service.js +384 -0
- package/dist/registration/service.js.map +1 -0
- package/dist/registration/store-bridge.d.ts +133 -0
- package/dist/registration/store-bridge.d.ts.map +1 -0
- package/dist/registration/store-bridge.js +159 -0
- package/dist/registration/store-bridge.js.map +1 -0
- package/dist/registration/tlsh.d.ts +125 -0
- package/dist/registration/tlsh.d.ts.map +1 -0
- package/dist/registration/tlsh.js +274 -0
- package/dist/registration/tlsh.js.map +1 -0
- package/dist/server.d.ts +26 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +156 -0
- package/dist/server.js.map +1 -0
- package/dist/service/argv.d.ts +52 -0
- package/dist/service/argv.d.ts.map +1 -0
- package/dist/service/argv.js +127 -0
- package/dist/service/argv.js.map +1 -0
- package/dist/service/command-runner.d.ts +54 -0
- package/dist/service/command-runner.d.ts.map +1 -0
- package/dist/service/command-runner.js +55 -0
- package/dist/service/command-runner.js.map +1 -0
- package/dist/service/index.d.ts +83 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +270 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/platform.d.ts +110 -0
- package/dist/service/platform.d.ts.map +1 -0
- package/dist/service/platform.js +157 -0
- package/dist/service/platform.js.map +1 -0
- package/dist/service/templates.d.ts +88 -0
- package/dist/service/templates.d.ts.map +1 -0
- package/dist/service/templates.js +212 -0
- package/dist/service/templates.js.map +1 -0
- package/dist/source-graph/deeplake-credentials.d.ts +57 -0
- package/dist/source-graph/deeplake-credentials.d.ts.map +1 -0
- package/dist/source-graph/deeplake-credentials.js +109 -0
- package/dist/source-graph/deeplake-credentials.js.map +1 -0
- package/dist/source-graph/deeplake-heal.d.ts +53 -0
- package/dist/source-graph/deeplake-heal.d.ts.map +1 -0
- package/dist/source-graph/deeplake-heal.js +41 -0
- package/dist/source-graph/deeplake-heal.js.map +1 -0
- package/dist/source-graph/deeplake-store.d.ts +151 -0
- package/dist/source-graph/deeplake-store.d.ts.map +1 -0
- package/dist/source-graph/deeplake-store.js +389 -0
- package/dist/source-graph/deeplake-store.js.map +1 -0
- package/dist/source-graph/deeplake-transport.d.ts +74 -0
- package/dist/source-graph/deeplake-transport.d.ts.map +1 -0
- package/dist/source-graph/deeplake-transport.js +107 -0
- package/dist/source-graph/deeplake-transport.js.map +1 -0
- package/dist/source-graph/hash.d.ts +3 -0
- package/dist/source-graph/hash.d.ts.map +1 -0
- package/dist/source-graph/hash.js +12 -0
- package/dist/source-graph/hash.js.map +1 -0
- package/dist/source-graph/memory-store.d.ts +32 -0
- package/dist/source-graph/memory-store.d.ts.map +1 -0
- package/dist/source-graph/memory-store.js +81 -0
- package/dist/source-graph/memory-store.js.map +1 -0
- package/dist/source-graph/model.d.ts +102 -0
- package/dist/source-graph/model.d.ts.map +1 -0
- package/dist/source-graph/model.js +36 -0
- package/dist/source-graph/model.js.map +1 -0
- package/dist/source-graph/paths.d.ts +7 -0
- package/dist/source-graph/paths.d.ts.map +1 -0
- package/dist/source-graph/paths.js +26 -0
- package/dist/source-graph/paths.js.map +1 -0
- package/dist/source-graph/schema.d.ts +44 -0
- package/dist/source-graph/schema.d.ts.map +1 -0
- package/dist/source-graph/schema.js +123 -0
- package/dist/source-graph/schema.js.map +1 -0
- package/dist/source-graph/sql-guards.d.ts +99 -0
- package/dist/source-graph/sql-guards.d.ts.map +1 -0
- package/dist/source-graph/sql-guards.js +129 -0
- package/dist/source-graph/sql-guards.js.map +1 -0
- package/dist/source-graph/store.d.ts +101 -0
- package/dist/source-graph/store.d.ts.map +1 -0
- package/dist/source-graph/store.js +2 -0
- package/dist/source-graph/store.js.map +1 -0
- package/dist/source-graph/ulid.d.ts +9 -0
- package/dist/source-graph/ulid.d.ts.map +1 -0
- package/dist/source-graph/ulid.js +61 -0
- package/dist/source-graph/ulid.js.map +1 -0
- package/dist/telemetry/checkin.d.ts +66 -0
- package/dist/telemetry/checkin.d.ts.map +1 -0
- package/dist/telemetry/checkin.js +142 -0
- package/dist/telemetry/checkin.js.map +1 -0
- package/dist/telemetry/db.d.ts +34 -0
- package/dist/telemetry/db.d.ts.map +1 -0
- package/dist/telemetry/db.js +122 -0
- package/dist/telemetry/db.js.map +1 -0
- package/dist/telemetry/index.d.ts +76 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +98 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/logs.d.ts +83 -0
- package/dist/telemetry/logs.d.ts.map +1 -0
- package/dist/telemetry/logs.js +110 -0
- package/dist/telemetry/logs.js.map +1 -0
- package/dist/telemetry/metrics.d.ts +82 -0
- package/dist/telemetry/metrics.d.ts.map +1 -0
- package/dist/telemetry/metrics.js +148 -0
- package/dist/telemetry/metrics.js.map +1 -0
- package/dist/telemetry-usage/emit.d.ts +105 -0
- package/dist/telemetry-usage/emit.d.ts.map +1 -0
- package/dist/telemetry-usage/emit.js +267 -0
- package/dist/telemetry-usage/emit.js.map +1 -0
- package/dist/telemetry-usage/posthog-key.d.ts +22 -0
- package/dist/telemetry-usage/posthog-key.d.ts.map +1 -0
- package/dist/telemetry-usage/posthog-key.js +22 -0
- package/dist/telemetry-usage/posthog-key.js.map +1 -0
- package/dist/worker.d.ts +69 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +91 -0
- package/dist/worker.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-fs.js","sourceRoot":"","sources":["../../src/registration/disk-fs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAe,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM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AAC,CAAC;IACtC,IAAI,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,CAAC,iEAAiE;IACjF,CAAC;IACD,IAAI,CAAC;QACH,0EAA0E;QAC1E,sEAAsE;QACtE,qEAAqE;QACrE,yEAAyE;QACzE,qEAAqE;QACrE,2DAA2D;QAC3D,IAAI,SAAS,CAAC;QACd,IAAI,CAAC;YACH,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC,CAAC,yDAAyD;QACzE,CAAC;QACD,IAAI,SAAS,CAAC;QACd,IAAI,CAAC;YACH,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC,CAAC,2DAA2D;QAC3E,CAAC;QACD,OAAO,SAAS,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC;IAC5E,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,UAAU,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;QACtE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type Timer } from "../poll-loop.js";
|
|
2
|
+
import type { IgnorePredicate } from "./ignore.js";
|
|
3
|
+
/** The watcher's own liveness state (PRD-018c AC-018c.6/7), independent of debounce state. */
|
|
4
|
+
export type WatcherState = "stopped" | "running" | "restarting" | "degraded";
|
|
5
|
+
/** The minimal shape `WatchIntake` needs from a watch handle - `node:fs`'s real `FSWatcher` satisfies this structurally. */
|
|
6
|
+
export interface WatchHandle {
|
|
7
|
+
on(event: "error", listener: (err: unknown) => void): unknown;
|
|
8
|
+
close(): void;
|
|
9
|
+
}
|
|
10
|
+
/** The raw `fs.watch`-shaped constructor. Injectable (PRD-018c AC-018c.6/7) so a test can simulate a watcher error/restart cycle without a real filesystem. Defaults to `node:fs`'s `watch`. */
|
|
11
|
+
export type WatchFn = (path: string, options: {
|
|
12
|
+
readonly recursive: boolean;
|
|
13
|
+
}, listener: (eventType: string, filename: string | null) => void) => WatchHandle;
|
|
14
|
+
export interface WatchIntakeOptions {
|
|
15
|
+
readonly root: string;
|
|
16
|
+
/** DEFAULT - confirm before implementation. Mirrors honeycomb's file-watcher debounce. */
|
|
17
|
+
readonly debounceMs?: number;
|
|
18
|
+
readonly onPathChanged: (relPath: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Max total deferral for a single path (NEC-042 item 9 / AC-018l.16). A path
|
|
21
|
+
* written more often than `debounceMs` never settles under a pure debounce; a
|
|
22
|
+
* max-wait cap forces the change through once this window elapses since the
|
|
23
|
+
* FIRST observation of the burst, regardless of continuing events. Default:
|
|
24
|
+
* {@link DEFAULT_MAX_WAIT_MULTIPLIER} x `debounceMs`.
|
|
25
|
+
*/
|
|
26
|
+
readonly maxWaitMs?: number;
|
|
27
|
+
/** Fired (debounced) when a null-filename observation demands a full workspace resync (AC-3). */
|
|
28
|
+
readonly onResync?: () => void;
|
|
29
|
+
/** Ignore contract; an ignored path never reaches the scheduler (AC-5). Defaults to allow-all. */
|
|
30
|
+
readonly isIgnored?: IgnorePredicate;
|
|
31
|
+
readonly timer?: Timer;
|
|
32
|
+
readonly onError?: (err: unknown) => void;
|
|
33
|
+
/** Fired whenever the watcher's liveness state changes (AC-018c.6/7). Defaults to a no-op. */
|
|
34
|
+
readonly onStateChange?: (state: WatcherState) => void;
|
|
35
|
+
/** Backoff floor for a restart-after-error (ms). DEFAULT 1000. */
|
|
36
|
+
readonly restartBackoffFloorMs?: number;
|
|
37
|
+
/** Backoff ceiling for a restart-after-error (ms). DEFAULT 30000. */
|
|
38
|
+
readonly restartBackoffCeilingMs?: number;
|
|
39
|
+
/** Consecutive restart failures before parking "degraded" (AC-018c.7). DEFAULT 5. */
|
|
40
|
+
readonly maxRestartAttempts?: number;
|
|
41
|
+
/** The raw watch constructor (default: `node:fs`'s `watch`). Injectable for deterministic error/restart tests (AC-018c.6/7). */
|
|
42
|
+
readonly watchFn?: WatchFn;
|
|
43
|
+
}
|
|
44
|
+
export declare const DEFAULT_DEBOUNCE_MS = 500;
|
|
45
|
+
/** Default max-wait cap as a multiple of the debounce window (NEC-042 item 9 / AC-018l.16). */
|
|
46
|
+
export declare const DEFAULT_MAX_WAIT_MULTIPLIER = 10;
|
|
47
|
+
export declare const DEFAULT_RESTART_BACKOFF_FLOOR_MS = 1000;
|
|
48
|
+
export declare const DEFAULT_RESTART_BACKOFF_CEILING_MS = 30000;
|
|
49
|
+
export declare const DEFAULT_MAX_RESTART_ATTEMPTS = 5;
|
|
50
|
+
export declare class WatchIntake {
|
|
51
|
+
private readonly root;
|
|
52
|
+
private readonly debounceMs;
|
|
53
|
+
private readonly maxWaitMs;
|
|
54
|
+
private readonly onPathChanged;
|
|
55
|
+
private readonly onResync;
|
|
56
|
+
private readonly isIgnored;
|
|
57
|
+
private readonly timer;
|
|
58
|
+
private readonly onError;
|
|
59
|
+
private readonly onStateChange;
|
|
60
|
+
private readonly restartBackoffFloorMs;
|
|
61
|
+
private readonly restartBackoffCeilingMs;
|
|
62
|
+
private readonly maxRestartAttempts;
|
|
63
|
+
private readonly watchFn;
|
|
64
|
+
private watcher;
|
|
65
|
+
private readonly pending;
|
|
66
|
+
/** Per-key max-wait timers (AC-018l.16): armed once per burst, NOT reset per observation. */
|
|
67
|
+
private readonly maxWaitPending;
|
|
68
|
+
/** Per-key burst guard so the debounce timer and the max-wait cap fire the settle at most once. */
|
|
69
|
+
private readonly bursts;
|
|
70
|
+
private state;
|
|
71
|
+
private restartAttempts;
|
|
72
|
+
private restartHandle;
|
|
73
|
+
/** Set by `stop()`; suppresses any restart scheduled by a since-superseded error. */
|
|
74
|
+
private stopped;
|
|
75
|
+
constructor(opts: WatchIntakeOptions);
|
|
76
|
+
/** The watcher's current liveness state (AC-018c.6/7). */
|
|
77
|
+
get watcherState(): WatcherState;
|
|
78
|
+
/**
|
|
79
|
+
* Route one raw `fs.watch` observation. A null/undefined filename (a
|
|
80
|
+
* directory-level event with no specific path on some platforms) requests a
|
|
81
|
+
* full resync; a concrete filename goes through the per-path debounce. Public
|
|
82
|
+
* so tests can drive both branches without a real filesystem.
|
|
83
|
+
*/
|
|
84
|
+
observeRaw(filename: string | null | undefined): void;
|
|
85
|
+
/**
|
|
86
|
+
* Feed a concrete path observation into the debouncer. Ignored paths are
|
|
87
|
+
* dropped before scheduling. Public so tests can drive it without a real
|
|
88
|
+
* filesystem; `start()` wires `fs.watch` through `observeRaw` to call this.
|
|
89
|
+
*/
|
|
90
|
+
observe(relPath: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Request a debounced full-workspace resync settle (AC-3). Collapses a burst
|
|
93
|
+
* of null-filename events into a single `onResync` the same way a per-path
|
|
94
|
+
* burst collapses into one signal.
|
|
95
|
+
*/
|
|
96
|
+
requestResync(): void;
|
|
97
|
+
private schedule;
|
|
98
|
+
/** Begin watching the root recursively. Idempotent. */
|
|
99
|
+
start(): void;
|
|
100
|
+
private attach;
|
|
101
|
+
/**
|
|
102
|
+
* PRD-018c NEC-009 / AC-018c.6/7: an `fs.watch` error means the underlying
|
|
103
|
+
* `FSWatcher` is typically dead. Close it, log via `onError` (preserving the
|
|
104
|
+
* pre-018c logging behavior), and - unless `stop()` already superseded this
|
|
105
|
+
* error - schedule a backoff-guarded restart rather than leaving live
|
|
106
|
+
* updates dead while `/health` still reports the daemon healthy.
|
|
107
|
+
*/
|
|
108
|
+
private handleWatcherError;
|
|
109
|
+
private scheduleRestart;
|
|
110
|
+
private setState;
|
|
111
|
+
/** Stop watching, cancel every pending debounce, and cancel any scheduled restart. Idemp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AAS;IACjD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;IAC7D,mGAAmG;IACnG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,aAAa,CAAiB;IACtC,qFAAqF;IACrF,OAAO,CAAC,OAAO,CAAQ;gBAEX,IAAI,EAAE,kBAAkB;IAqBpC,0DAA0D;IAC1D,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAQrD;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAU9B;;;;OAIG;IACH,aAAa,IAAI,IAAI;IAIrB,OAAO,CAAC,QAAQ;IA4ChB,uDAAuD;IACvD,KAAK,IAAI,IAAI;IAWb,OAAO,CAAC,MAAM;IAQd;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,QAAQ;IAMhB,kGAAkG;IAClG,IAAI,IAAI,IAAI;CAiBb"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-watch intake with debounce (PRD-006a).
|
|
3
|
+
*
|
|
4
|
+
* Wraps `node:fs.watch` (directory-level, recursive) and debounces per path with
|
|
5
|
+
* `setTimeout`/`clearTimeout`: multiple uncorrelated `(eventType, filename)`
|
|
6
|
+
* observations on the same path within the window collapse to one "path changed"
|
|
7
|
+
* signal, which then enters the re-association ladder. This mirrors honeycomb's
|
|
8
|
+
* `file-watcher.ts` pattern; chokidar is deliberately NOT a dependency (decision #4).
|
|
9
|
+
*
|
|
10
|
+
* Two intake behaviors beyond the plain per-path debounce:
|
|
11
|
+
* - A `null`/`undefined` filename observation (some platforms emit null on a
|
|
12
|
+
* directory-level event, per honeycomb `file-watcher.ts:342-345`) triggers a
|
|
13
|
+
* debounced FULL resync settle via `onResync`, not a dropped event (AC-3).
|
|
14
|
+
* - Every observation is filtered through the injected ignore contract before
|
|
15
|
+
* it reaches the debounce scheduler, so ignored paths (`.git/`,
|
|
16
|
+
* `node_modules/`, the per-repo `graph-ignore.json` set) never trigger a
|
|
17
|
+
* cycle (AC-5). No nectar-specific ignore list is invented.
|
|
18
|
+
*
|
|
19
|
+
* PRD-018c NEC-009 / AC-018c.6/7: a raw `fs.watch` error (Linux `ENOSPC`,
|
|
20
|
+
* `EPERM`/`EBUSY` on a renamed/recreated root) no longer kills live updates
|
|
21
|
+
* permanently. The watcher is closed and re-`watch()`ed with exponential
|
|
22
|
+
* backoff; a successful re-attach requests a full resync (via the SAME
|
|
23
|
+
* debounced `requestResync` path AC-3 already established) so the outage
|
|
24
|
+
* window is reconciled; repeated failures beyond `maxRestartAttempts` park the
|
|
25
|
+
* intake in a "degraded" state instead of looping hot. `onStateChange`
|
|
26
|
+
* surfaces "running" / "restarting" / "degraded" / "stopped" so `/health` can
|
|
27
|
+
* show watcher liveness (AC-018c.6/7).
|
|
28
|
+
*
|
|
29
|
+
* The timer seam is injected so tests are deterministic under a manual clock.
|
|
30
|
+
*/
|
|
31
|
+
import { watch } from "node:fs";
|
|
32
|
+
import { realTimer } from "../poll-loop.js";
|
|
33
|
+
import { isSafeRelPath } from "./paths-safe.js";
|
|
34
|
+
export const DEFAULT_DEBOUNCE_MS = 500;
|
|
35
|
+
/** Default max-wait cap as a multiple of the debounce window (NEC-042 item 9 / AC-018l.16). */
|
|
36
|
+
export const DEFAULT_MAX_WAIT_MULTIPLIER = 10;
|
|
37
|
+
export const DEFAULT_RESTART_BACKOFF_FLOOR_MS = 1_000;
|
|
38
|
+
export const DEFAULT_RESTART_BACKOFF_CEILING_MS = 30_000;
|
|
39
|
+
export const DEFAULT_MAX_RESTART_ATTEMPTS = 5;
|
|
40
|
+
/** The sentinel debounce key for the full-resync settle (kept distinct from any real path). */
|
|
41
|
+
const RESYNC_KEY = "\u0000resync";
|
|
42
|
+
export class WatchIntake {
|
|
43
|
+
root;
|
|
44
|
+
debounceMs;
|
|
45
|
+
maxWaitMs;
|
|
46
|
+
onPathChanged;
|
|
47
|
+
onResync;
|
|
48
|
+
isIgnored;
|
|
49
|
+
timer;
|
|
50
|
+
onError;
|
|
51
|
+
onStateChange;
|
|
52
|
+
restartBackoffFloorMs;
|
|
53
|
+
restartBackoffCeilingMs;
|
|
54
|
+
maxRestartAttempts;
|
|
55
|
+
watchFn;
|
|
56
|
+
watcher = null;
|
|
57
|
+
pending = new Map();
|
|
58
|
+
/** Per-key max-wait timers (AC-018l.16): armed once per burst, NOT reset per observation. */
|
|
59
|
+
maxWaitPending = new Map();
|
|
60
|
+
/** Per-key burst guard so the debounce timer and the max-wait cap fire the settle at most once. */
|
|
61
|
+
bursts = new Map();
|
|
62
|
+
state = "stopped";
|
|
63
|
+
restartAttempts = 0;
|
|
64
|
+
restartHandle = null;
|
|
65
|
+
/** Set by `stop()`; suppresses any restart scheduled by a since-superseded error. */
|
|
66
|
+
stopped = true;
|
|
67
|
+
constructor(opts) {
|
|
68
|
+
this.root = opts.root;
|
|
69
|
+
this.debounceMs = Math.max(0, opts.debounceMs ?? DEFAULT_DEBOUNCE_MS);
|
|
70
|
+
// The cap never sits below the debounce window (a cap shorter than the
|
|
71
|
+
// debounce would defeat the debounce entirely).
|
|
72
|
+
this.maxWaitMs = Math.max(this.debounceMs, opts.maxWaitMs ?? this.debounceMs * DEFAULT_MAX_WAIT_MULTIPLIER);
|
|
73
|
+
this.onPathChanged = opts.onPathChanged;
|
|
74
|
+
this.onResync = opts.onResync ?? (() => { });
|
|
75
|
+
this.isIgnored = opts.isIgnored ?? (() => false);
|
|
76
|
+
this.timer = opts.timer ?? realTimer;
|
|
77
|
+
this.onError = opts.onError ?? (() => { });
|
|
78
|
+
this.onStateChange = opts.onStateChange ?? (() => { });
|
|
79
|
+
this.restartBackoffFloorMs = Math.max(1, opts.restartBackoffFloorMs ?? DEFAULT_RESTART_BACKOFF_FLOOR_MS);
|
|
80
|
+
this.restartBackoffCeilingMs = Math.max(this.restartBackoffFloorMs, opts.restartBackoffCeilingMs ?? DEFAULT_RESTART_BACKOFF_CEILING_MS);
|
|
81
|
+
this.maxRestartAttempts = Math.max(1, opts.maxRestartAttempts ?? DEFAULT_MAX_RESTART_ATTEMPTS);
|
|
82
|
+
this.watchFn = opts.watchFn ?? watch;
|
|
83
|
+
}
|
|
84
|
+
/** The watcher's current liveness state (AC-018c.6/7). */
|
|
85
|
+
get watcherState() {
|
|
86
|
+
return this.state;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Route one raw `fs.watch` observation. A null/undefined filename (a
|
|
90
|
+
* directory-level event with no specific path on some platforms) requests a
|
|
91
|
+
* full resync; a concrete filename goes through the per-path debounce. Public
|
|
92
|
+
* so tests can drive both branches without a real filesystem.
|
|
93
|
+
*/
|
|
94
|
+
observeRaw(filename) {
|
|
95
|
+
if (filename === null || filename === undefined) {
|
|
96
|
+
this.requestResync();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.observe(String(filename));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Feed a concrete path observation into the debouncer. Ignored paths are
|
|
103
|
+
* dropped before scheduling. Public so tests can drive it without a real
|
|
104
|
+
* filesystem; `start()` wires `fs.watch` through `observeRaw` to call this.
|
|
105
|
+
*/
|
|
106
|
+
observe(relPath) {
|
|
107
|
+
if (relPath === "")
|
|
108
|
+
return;
|
|
109
|
+
const normalized = relPath.replace(/\\/g, "/");
|
|
110
|
+
// Containment first (CWE-22): an absolute path or a `..` traversal is dropped
|
|
111
|
+
// before it can be ignore-tested, scheduled, or ever reach a stat/read.
|
|
112
|
+
if (!isSafeRelPath(normalized))
|
|
113
|
+
return;
|
|
114
|
+
if (this.isIgnored(normalized))
|
|
115
|
+
return;
|
|
116
|
+
this.schedule(normalized, () => this.onPathChanged(normalized));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Request a debounced full-workspace resync settle (AC-3). Collapses a burst
|
|
120
|
+
* of null-filename events into a single `onResync` the same way a per-path
|
|
121
|
+
* burst collapses into one signal.
|
|
122
|
+
*/
|
|
123
|
+
requestResync() {
|
|
124
|
+
this.schedule(RESYNC_KEY, () => this.onResync());
|
|
125
|
+
}
|
|
126
|
+
schedule(key, fire) {
|
|
127
|
+
// One guard per burst, shared by the debounce timer AND the max-wait cap so
|
|
128
|
+
// whichever elapses first fires the settle exactly once and the other becomes
|
|
129
|
+
// a no-op (even if a test timer fires both from one snapshot).
|
|
130
|
+
let burst = this.bursts.get(key);
|
|
131
|
+
if (burst === undefined) {
|
|
132
|
+
burst = { fired: false };
|
|
133
|
+
this.bursts.set(key, burst);
|
|
134
|
+
}
|
|
135
|
+
const guard = burst;
|
|
136
|
+
const fireOnce = () => {
|
|
137
|
+
if (guard.fired)
|
|
138
|
+
return;
|
|
139
|
+
guard.fired = true;
|
|
140
|
+
const debounceHandle = this.pending.get(key);
|
|
141
|
+
if (debounceHandle !== undefined) {
|
|
142
|
+
this.timer.clear(debounceHandle);
|
|
143
|
+
this.pending.delete(key);
|
|
144
|
+
}
|
|
145
|
+
const maxWaitHandle = this.maxWaitPending.get(key);
|
|
146
|
+
if (maxWaitHandle !== undefined) {
|
|
147
|
+
this.timer.clear(maxWaitHandle);
|
|
148
|
+
this.maxWaitPending.delete(key);
|
|
149
|
+
}
|
|
150
|
+
this.bursts.delete(key);
|
|
151
|
+
try {
|
|
152
|
+
fire();
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
this.onError(err);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
// (Re)arm the per-observation debounce timer.
|
|
159
|
+
const existing = this.pending.get(key);
|
|
160
|
+
if (existing !== undefined)
|
|
161
|
+
this.timer.clear(existing);
|
|
162
|
+
this.pending.set(key, this.timer.set(fireOnce, this.debounceMs));
|
|
163
|
+
// Arm the max-wait cap ONCE per burst (AC-018l.16): it is NOT reset by later
|
|
164
|
+
// observations, so a path written faster than the debounce still settles when
|
|
165
|
+
// the cap elapses. Only meaningful when the cap exceeds the debounce window.
|
|
166
|
+
if (this.maxWaitMs > this.debounceMs && !this.maxWaitPending.has(key)) {
|
|
167
|
+
this.maxWaitPending.set(key, this.timer.set(fireOnce, this.maxWaitMs));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/** Begin watching the root recursively. Idempotent. */
|
|
171
|
+
start() {
|
|
172
|
+
if (this.watcher !== null)
|
|
173
|
+
return;
|
|
174
|
+
this.stopped = false;
|
|
175
|
+
this.restartAttempts = 0;
|
|
176
|
+
if (this.restartHandle !== null) {
|
|
177
|
+
this.timer.clear(this.restartHandle);
|
|
178
|
+
this.restartHandle = null;
|
|
179
|
+
}
|
|
180
|
+
this.attach();
|
|
181
|
+
}
|
|
182
|
+
attach() {
|
|
183
|
+
this.watcher = this.watchFn(this.root, { recursive: true }, (_eventType, filename) => {
|
|
184
|
+
this.observeRaw(filename === null ? null : String(filename));
|
|
185
|
+
});
|
|
186
|
+
this.watcher.on("error", (err) => this.handleWatcherError(err));
|
|
187
|
+
this.setState("running");
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* PRD-018c NEC-009 / AC-018c.6/7: an `fs.watch` error means the underlying
|
|
191
|
+
* `FSWatcher` is typically dead. Close it, log via `onError` (preserving the
|
|
192
|
+
* pre-018c logging behavior), and - unless `stop()` already superseded this
|
|
193
|
+
* error - schedule a backoff-guarded restart rather than leaving live
|
|
194
|
+
* updates dead while `/health` still reports the daemon healthy.
|
|
195
|
+
*/
|
|
196
|
+
handleWatcherError(err) {
|
|
197
|
+
this.onError(err);
|
|
198
|
+
if (this.watcher !== null) {
|
|
199
|
+
try {
|
|
200
|
+
this.watcher.close();
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// already dead; nothing to clean up
|
|
204
|
+
}
|
|
205
|
+
this.watcher = null;
|
|
206
|
+
}
|
|
207
|
+
if (this.stopped)
|
|
208
|
+
return; // an owner-initiated stop() wins; never restart after that
|
|
209
|
+
this.scheduleRestart();
|
|
210
|
+
}
|
|
211
|
+
scheduleRestart() {
|
|
212
|
+
this.restartAttempts += 1;
|
|
213
|
+
if (this.restartAttempts > this.maxRestartAttempts) {
|
|
214
|
+
// AC-018c.7: repeated failures park the watcher degraded instead of
|
|
215
|
+
// looping hot. The periodic resync backstop (service.ts) is the
|
|
216
|
+
// remaining reconciliation path while degraded.
|
|
217
|
+
this.setState("degraded");
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.setState("restarting");
|
|
221
|
+
const delay = Math.min(this.restartBackoffCeilingMs, Math.round(this.restartBackoffFloorMs * Math.pow(2, this.restartAttempts - 1)));
|
|
222
|
+
this.restartHandle = this.timer.set(() => {
|
|
223
|
+
this.restartHandle = null;
|
|
224
|
+
if (this.stopped)
|
|
225
|
+
return;
|
|
226
|
+
try {
|
|
227
|
+
this.attach();
|
|
228
|
+
this.restartAttempts = 0; // a successful re-attach resets the backoff
|
|
229
|
+
// AC-018c.6: reconcile the outage window through the SAME debounced
|
|
230
|
+
// resync path a null-filename observation already uses (AC-3).
|
|
231
|
+
this.requestResync();
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
this.onError(err);
|
|
235
|
+
this.scheduleRestart(); // still failing; keep backing off
|
|
236
|
+
}
|
|
237
|
+
}, delay);
|
|
238
|
+
}
|
|
239
|
+
setState(next) {
|
|
240
|
+
if (this.state === next)
|
|
241
|
+
return;
|
|
242
|
+
this.state = next;
|
|
243
|
+
this.onStateChange(next);
|
|
244
|
+
}
|
|
245
|
+
/** Stop watching, cancel every pending debounce, and cancel any scheduled restart. Idempotent. */
|
|
246
|
+
stop() {
|
|
247
|
+
this.stopped = true;
|
|
248
|
+
for (const handle of this.pending.values())
|
|
249
|
+
this.timer.clear(handle);
|
|
250
|
+
this.pending.clear();
|
|
251
|
+
for (const handle of this.maxWaitPending.values())
|
|
252
|
+
this.timer.clear(handle);
|
|
253
|
+
this.maxWaitPending.clear();
|
|
254
|
+
this.bursts.clear();
|
|
255
|
+
if (this.restartHandle !== null) {
|
|
256
|
+
this.timer.clear(this.restartHandle);
|
|
257
|
+
this.restartHandle = null;
|
|
258
|
+
}
|
|
259
|
+
if (this.watcher !== null) {
|
|
260
|
+
this.watcher.close();
|
|
261
|
+
this.watcher = null;
|
|
262
|
+
}
|
|
263
|
+
this.setState("stopped");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=fs-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-watch.js","sourceRoot":"","sources":["../../src/registration/fs-watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiDhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAC9C,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,CAAC;AACtD,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC;AACzD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,+FAA+F;AAC/F,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,OAAO,WAAW;IACL,IAAI,CAAS;I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AC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5E,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** A predicate over a repo-relative (forward-slashed) path: true means "drop, never register". */
|
|
2
|
+
export type IgnorePredicate = (relPath: string) => boolean;
|
|
3
|
+
/** Path segments always dropped, independent of any ignore file. */
|
|
4
|
+
export declare const ALWAYS_IGNORED_SEGMENTS: readonly string[];
|
|
5
|
+
/** The per-repo ignore file the CodeGraph discovery convention uses (relative to the workspace root). */
|
|
6
|
+
export declare const GRAPH_IGNORE_FILE = ".honeycomb/graph-ignore.json";
|
|
7
|
+
/**
|
|
8
|
+
* Read the per-repo ignore file (a JSON array of prefixes, or `{ "ignore": [...] }`).
|
|
9
|
+
* Missing or malformed files yield an empty list (fail-open to the built-in
|
|
10
|
+
* segment rules); a hard read error other than "not found" is swallowed so the
|
|
11
|
+
* intake never crashes on a bad ignore file.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadIgnorePrefixes(root: string, readFile?: (p: string) => string | null): readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Build the default ignore predicate for a workspace root. Combines the built-in
|
|
16
|
+
* segment rules with any prefixes declared in the repo's `graph-ignore.json`.
|
|
17
|
+
* A path is ignored if it (a) contains an always-ignored segment, or (b) equals
|
|
18
|
+
* or sits under one of the declared ignore prefixes.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createDefaultIgnore(root: string, readFile?: (p: string) => string | null): IgnorePredicate;
|
|
21
|
+
/**
|
|
22
|
+
* The 3-way result NEC-039 requires: git may be genuinely absent (no `.git`,
|
|
23
|
+
* no `git` on PATH - degrading to the segment/graph-ignore-only predicate is
|
|
24
|
+
* correct and silent), or present but ERRORING (non-zero exit, `ENOBUFS` -
|
|
25
|
+
* this must never silently collapse the predicate), or a clean snapshot.
|
|
26
|
+
*/
|
|
27
|
+
export type GitLsFilesProbe = {
|
|
28
|
+
readonly status: "absent";
|
|
29
|
+
} | {
|
|
30
|
+
readonly status: "error";
|
|
31
|
+
readonly reason: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly status: "ok";
|
|
34
|
+
readonly paths: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
export type GitLsFilesRunner = (root: string) => GitLsFilesProbe;
|
|
37
|
+
/** The real `git ls-files` runner: spawns synchronously, never throws. */
|
|
38
|
+
export declare const runGitLsFiles: GitLsFilesRunner;
|
|
39
|
+
/** Per-path `git check-ignore` fallback for a snapshot cache miss. Returns null when it cannot be determined (git errored/absent). */
|
|
40
|
+
export type GitCheckIgnoreRunner = (root: string, relPath: string) => boolean | null;
|
|
41
|
+
export declare const runGitCheckIgnore: GitCheckIgnoreRunner;
|
|
42
|
+
/** The composed shared predicate (PRD-018c AC-018c.1) plus its resync-refresh and observability seams. */
|
|
43
|
+
export interface SharedIgnore {
|
|
44
|
+
/** segments ∪ graph-ignore ∪ gitignore semantics. The SAME function reference every consumer shares. */
|
|
45
|
+
readonly isIgnored: IgnorePredicate;
|
|
46
|
+
/** Refresh the cached gitignore snapshot (call once per resync, NEC-007 point 1). */
|
|
47
|
+
refresh(): void;
|
|
48
|
+
/** Whether git participates at all in this workspace right now (false => the predicate is segments+graph-ignore only). */
|
|
49
|
+
isGitAvailable(): boolean;
|
|
50
|
+
/** The reason the last refresh degraded (git present but errored), or null when healthy or git is absent. */
|
|
51
|
+
lastGitError(): string | null;
|
|
52
|
+
}
|
|
53
|
+
export interface SharedIgnoreOptions {
|
|
54
|
+
/** Read the per-repo ignore file (default: real disk read). */
|
|
55
|
+
readonly readFile?: (p: string) => string | null;
|
|
56
|
+
/** The git ls-files snapshot runner (default: {@link runGitLsFiles}). Injectable for tests. */
|
|
57
|
+
readonly gitLsFiles?: GitLsFilesRunner;
|
|
58
|
+
/** The git check-ignore per-path fallback runner (default: {@link runGitCheckIgnore}). Injectable for tests. */
|
|
59
|
+
readonly gitCheckIgnore?: GitCheckIgnoreRunner;
|
|
60
|
+
/**
|
|
61
|
+
* Called whenever a refresh finds git PRESENT but ERRORING (NEC-039): the
|
|
62
|
+
* last good snapshot (if any) is kept rather than silently discarded, and
|
|
63
|
+
* this hook lets the caller log or otherwise surface the degradation loudly.
|
|
64
|
+
* Defaults to a no-op.
|
|
65
|
+
*/
|
|
66
|
+
readonly onGitError?: (reason: string) => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the ONE shared ignore predicate for a workspace (PRD-018c AC-018c.1):
|
|
70
|
+
* {@link createDefaultIgnore}'s segments+graph-ignore UNION gitignore
|
|
71
|
+
* semantics, approximated by a cached `git ls-files` snapshot with a
|
|
72
|
+
* per-path `git check-ignore` fallback for cache misses. Call {@link
|
|
73
|
+
* SharedIgnore.refresh} once per resync to keep the snapshot warm without
|
|
74
|
+
* spawning git on every watch event.
|
|
75
|
+
*/
|
|
76
|
+
export declare function createSharedIgnore(root: string, opts?: SharedIgnoreOptions): SharedIgnore;
|
|
77
|
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