opentasks 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +344 -1
- package/dist/__tests__/cli-tools.test.d.ts +8 -0
- package/dist/__tests__/cli-tools.test.d.ts.map +1 -0
- package/dist/__tests__/cli-tools.test.js +546 -0
- package/dist/__tests__/cli-tools.test.js.map +1 -0
- package/dist/__tests__/cli.test.d.ts +5 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/cli.test.js +77 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/__tests__/p1-p3-gaps.test.d.ts +2 -0
- package/dist/__tests__/p1-p3-gaps.test.d.ts.map +1 -0
- package/dist/__tests__/p1-p3-gaps.test.js +463 -0
- package/dist/__tests__/p1-p3-gaps.test.js.map +1 -0
- package/dist/cli.d.ts +19 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +702 -23
- package/dist/cli.js.map +1 -1
- package/dist/client/__tests__/client-crud.test.d.ts +7 -0
- package/dist/client/__tests__/client-crud.test.d.ts.map +1 -0
- package/dist/client/__tests__/client-crud.test.js +404 -0
- package/dist/client/__tests__/client-crud.test.js.map +1 -0
- package/dist/client/__tests__/client.test.d.ts +5 -0
- package/dist/client/__tests__/client.test.d.ts.map +1 -0
- package/dist/client/__tests__/client.test.js +518 -0
- package/dist/client/__tests__/client.test.js.map +1 -0
- package/dist/client/client.d.ts +228 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +393 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +9 -0
- package/dist/client/index.js.map +1 -0
- package/dist/config/__tests__/defaults.test.d.ts +2 -0
- package/dist/config/__tests__/defaults.test.d.ts.map +1 -0
- package/dist/config/__tests__/defaults.test.js +57 -0
- package/dist/config/__tests__/defaults.test.js.map +1 -0
- package/dist/config/__tests__/env.test.d.ts +2 -0
- package/dist/config/__tests__/env.test.d.ts.map +1 -0
- package/dist/config/__tests__/env.test.js +136 -0
- package/dist/config/__tests__/env.test.js.map +1 -0
- package/dist/config/__tests__/index.test.d.ts +2 -0
- package/dist/config/__tests__/index.test.d.ts.map +1 -0
- package/dist/config/__tests__/index.test.js +113 -0
- package/dist/config/__tests__/index.test.js.map +1 -0
- package/dist/config/__tests__/loader.test.d.ts +2 -0
- package/dist/config/__tests__/loader.test.d.ts.map +1 -0
- package/dist/config/__tests__/loader.test.js +128 -0
- package/dist/config/__tests__/loader.test.js.map +1 -0
- package/dist/config/__tests__/merge.test.d.ts +2 -0
- package/dist/config/__tests__/merge.test.d.ts.map +1 -0
- package/dist/config/__tests__/merge.test.js +79 -0
- package/dist/config/__tests__/merge.test.js.map +1 -0
- package/dist/config/__tests__/schema.test.d.ts +2 -0
- package/dist/config/__tests__/schema.test.d.ts.map +1 -0
- package/dist/config/__tests__/schema.test.js +300 -0
- package/dist/config/__tests__/schema.test.js.map +1 -0
- package/dist/config/defaults.d.ts +13 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +15 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/env.d.ts +14 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +130 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/errors.d.ts +21 -0
- package/dist/config/errors.d.ts.map +1 -0
- package/dist/config/errors.js +30 -0
- package/dist/config/errors.js.map +1 -0
- package/dist/config/index.d.ts +21 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +41 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +8 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +87 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/merge.d.ts +12 -0
- package/dist/config/merge.d.ts.map +1 -0
- package/dist/config/merge.js +54 -0
- package/dist/config/merge.js.map +1 -0
- package/dist/config/schema.d.ts +644 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +491 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/__tests__/conditional-redirects.test.d.ts +2 -0
- package/dist/core/__tests__/conditional-redirects.test.d.ts.map +1 -0
- package/dist/core/__tests__/conditional-redirects.test.js +83 -0
- package/dist/core/__tests__/conditional-redirects.test.js.map +1 -0
- package/dist/core/__tests__/connections.test.d.ts +2 -0
- package/dist/core/__tests__/connections.test.d.ts.map +1 -0
- package/dist/core/__tests__/connections.test.js +158 -0
- package/dist/core/__tests__/connections.test.js.map +1 -0
- package/dist/core/__tests__/hash.test.d.ts +2 -0
- package/dist/core/__tests__/hash.test.d.ts.map +1 -0
- package/dist/core/__tests__/hash.test.js +139 -0
- package/dist/core/__tests__/hash.test.js.map +1 -0
- package/dist/core/__tests__/id.test.d.ts +2 -0
- package/dist/core/__tests__/id.test.d.ts.map +1 -0
- package/dist/core/__tests__/id.test.js +142 -0
- package/dist/core/__tests__/id.test.js.map +1 -0
- package/dist/core/__tests__/location.test.d.ts +2 -0
- package/dist/core/__tests__/location.test.d.ts.map +1 -0
- package/dist/core/__tests__/location.test.js +77 -0
- package/dist/core/__tests__/location.test.js.map +1 -0
- package/dist/core/__tests__/merge-driver.test.d.ts +2 -0
- package/dist/core/__tests__/merge-driver.test.d.ts.map +1 -0
- package/dist/core/__tests__/merge-driver.test.js +218 -0
- package/dist/core/__tests__/merge-driver.test.js.map +1 -0
- package/dist/core/__tests__/redirects.test.d.ts +2 -0
- package/dist/core/__tests__/redirects.test.d.ts.map +1 -0
- package/dist/core/__tests__/redirects.test.js +123 -0
- package/dist/core/__tests__/redirects.test.js.map +1 -0
- package/dist/core/__tests__/resolve-location-target.test.d.ts +8 -0
- package/dist/core/__tests__/resolve-location-target.test.d.ts.map +1 -0
- package/dist/core/__tests__/resolve-location-target.test.js +303 -0
- package/dist/core/__tests__/resolve-location-target.test.js.map +1 -0
- package/dist/core/__tests__/uri.test.d.ts +2 -0
- package/dist/core/__tests__/uri.test.d.ts.map +1 -0
- package/dist/core/__tests__/uri.test.js +159 -0
- package/dist/core/__tests__/uri.test.js.map +1 -0
- package/dist/core/__tests__/worktree.test.d.ts +2 -0
- package/dist/core/__tests__/worktree.test.d.ts.map +1 -0
- package/dist/core/__tests__/worktree.test.js +120 -0
- package/dist/core/__tests__/worktree.test.js.map +1 -0
- package/dist/core/conditional-redirects.d.ts +42 -0
- package/dist/core/conditional-redirects.d.ts.map +1 -0
- package/dist/core/conditional-redirects.js +59 -0
- package/dist/core/conditional-redirects.js.map +1 -0
- package/dist/core/connections.d.ts +87 -0
- package/dist/core/connections.d.ts.map +1 -0
- package/dist/core/connections.js +160 -0
- package/dist/core/connections.js.map +1 -0
- package/dist/core/discover.d.ts +39 -0
- package/dist/core/discover.d.ts.map +1 -0
- package/dist/core/discover.js +136 -0
- package/dist/core/discover.js.map +1 -0
- package/dist/core/hash.d.ts +25 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +62 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/id.d.ts +79 -0
- package/dist/core/id.d.ts.map +1 -0
- package/dist/core/id.js +141 -0
- package/dist/core/id.js.map +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +24 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/location.d.ts +70 -0
- package/dist/core/location.d.ts.map +1 -0
- package/dist/core/location.js +121 -0
- package/dist/core/location.js.map +1 -0
- package/dist/core/merge-driver.d.ts +50 -0
- package/dist/core/merge-driver.d.ts.map +1 -0
- package/dist/core/merge-driver.js +258 -0
- package/dist/core/merge-driver.js.map +1 -0
- package/dist/core/redirects.d.ts +91 -0
- package/dist/core/redirects.d.ts.map +1 -0
- package/dist/core/redirects.js +113 -0
- package/dist/core/redirects.js.map +1 -0
- package/dist/core/uri.d.ts +105 -0
- package/dist/core/uri.d.ts.map +1 -0
- package/dist/core/uri.js +190 -0
- package/dist/core/uri.js.map +1 -0
- package/dist/core/worktree.d.ts +106 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +394 -0
- package/dist/core/worktree.js.map +1 -0
- package/dist/daemon/__tests__/flush.test.d.ts +5 -0
- package/dist/daemon/__tests__/flush.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/flush.test.js +213 -0
- package/dist/daemon/__tests__/flush.test.js.map +1 -0
- package/dist/daemon/__tests__/integration.test.d.ts +7 -0
- package/dist/daemon/__tests__/integration.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/integration.test.js +276 -0
- package/dist/daemon/__tests__/integration.test.js.map +1 -0
- package/dist/daemon/__tests__/ipc.test.d.ts +5 -0
- package/dist/daemon/__tests__/ipc.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/ipc.test.js +314 -0
- package/dist/daemon/__tests__/ipc.test.js.map +1 -0
- package/dist/daemon/__tests__/lifecycle.test.d.ts +5 -0
- package/dist/daemon/__tests__/lifecycle.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/lifecycle.test.js +301 -0
- package/dist/daemon/__tests__/lifecycle.test.js.map +1 -0
- package/dist/daemon/__tests__/lock.test.d.ts +5 -0
- package/dist/daemon/__tests__/lock.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/lock.test.js +192 -0
- package/dist/daemon/__tests__/lock.test.js.map +1 -0
- package/dist/daemon/__tests__/methods/graph.test.d.ts +5 -0
- package/dist/daemon/__tests__/methods/graph.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/methods/graph.test.js +309 -0
- package/dist/daemon/__tests__/methods/graph.test.js.map +1 -0
- package/dist/daemon/__tests__/methods/provider.test.d.ts +7 -0
- package/dist/daemon/__tests__/methods/provider.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/methods/provider.test.js +181 -0
- package/dist/daemon/__tests__/methods/provider.test.js.map +1 -0
- package/dist/daemon/__tests__/methods/tools.test.d.ts +5 -0
- package/dist/daemon/__tests__/methods/tools.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/methods/tools.test.js +587 -0
- package/dist/daemon/__tests__/methods/tools.test.js.map +1 -0
- package/dist/daemon/__tests__/multi-location.test.d.ts +8 -0
- package/dist/daemon/__tests__/multi-location.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/multi-location.test.js +669 -0
- package/dist/daemon/__tests__/multi-location.test.js.map +1 -0
- package/dist/daemon/__tests__/registry.test.d.ts +5 -0
- package/dist/daemon/__tests__/registry.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/registry.test.js +208 -0
- package/dist/daemon/__tests__/registry.test.js.map +1 -0
- package/dist/daemon/__tests__/watcher.test.d.ts +5 -0
- package/dist/daemon/__tests__/watcher.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/watcher.test.js +234 -0
- package/dist/daemon/__tests__/watcher.test.js.map +1 -0
- package/dist/daemon/entire-linker.d.ts +68 -0
- package/dist/daemon/entire-linker.d.ts.map +1 -0
- package/dist/daemon/entire-linker.js +439 -0
- package/dist/daemon/entire-linker.js.map +1 -0
- package/dist/daemon/entire-watcher.d.ts +66 -0
- package/dist/daemon/entire-watcher.d.ts.map +1 -0
- package/dist/daemon/entire-watcher.js +258 -0
- package/dist/daemon/entire-watcher.js.map +1 -0
- package/dist/daemon/factory.d.ts +59 -0
- package/dist/daemon/factory.d.ts.map +1 -0
- package/dist/daemon/factory.js +72 -0
- package/dist/daemon/factory.js.map +1 -0
- package/dist/daemon/flush.d.ts +51 -0
- package/dist/daemon/flush.d.ts.map +1 -0
- package/dist/daemon/flush.js +89 -0
- package/dist/daemon/flush.js.map +1 -0
- package/dist/daemon/index.d.ts +39 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +24 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/ipc.d.ts +97 -0
- package/dist/daemon/ipc.d.ts.map +1 -0
- package/dist/daemon/ipc.js +304 -0
- package/dist/daemon/ipc.js.map +1 -0
- package/dist/daemon/lifecycle.d.ts +85 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +754 -0
- package/dist/daemon/lifecycle.js.map +1 -0
- package/dist/daemon/location-state.d.ts +85 -0
- package/dist/daemon/location-state.d.ts.map +1 -0
- package/dist/daemon/location-state.js +291 -0
- package/dist/daemon/location-state.js.map +1 -0
- package/dist/daemon/lock.d.ts +29 -0
- package/dist/daemon/lock.d.ts.map +1 -0
- package/dist/daemon/lock.js +131 -0
- package/dist/daemon/lock.js.map +1 -0
- package/dist/daemon/methods/__tests__/graph.test.d.ts +5 -0
- package/dist/daemon/methods/__tests__/graph.test.d.ts.map +1 -0
- package/dist/daemon/methods/__tests__/graph.test.js +274 -0
- package/dist/daemon/methods/__tests__/graph.test.js.map +1 -0
- package/dist/daemon/methods/__tests__/provider.test.d.ts +5 -0
- package/dist/daemon/methods/__tests__/provider.test.d.ts.map +1 -0
- package/dist/daemon/methods/__tests__/provider.test.js +184 -0
- package/dist/daemon/methods/__tests__/provider.test.js.map +1 -0
- package/dist/daemon/methods/__tests__/tools.test.d.ts +5 -0
- package/dist/daemon/methods/__tests__/tools.test.d.ts.map +1 -0
- package/dist/daemon/methods/__tests__/tools.test.js +295 -0
- package/dist/daemon/methods/__tests__/tools.test.js.map +1 -0
- package/dist/daemon/methods/archive.d.ts +22 -0
- package/dist/daemon/methods/archive.d.ts.map +1 -0
- package/dist/daemon/methods/archive.js +107 -0
- package/dist/daemon/methods/archive.js.map +1 -0
- package/dist/daemon/methods/graph.d.ts +26 -0
- package/dist/daemon/methods/graph.d.ts.map +1 -0
- package/dist/daemon/methods/graph.js +157 -0
- package/dist/daemon/methods/graph.js.map +1 -0
- package/dist/daemon/methods/lifecycle.d.ts +54 -0
- package/dist/daemon/methods/lifecycle.d.ts.map +1 -0
- package/dist/daemon/methods/lifecycle.js +46 -0
- package/dist/daemon/methods/lifecycle.js.map +1 -0
- package/dist/daemon/methods/location.d.ts +24 -0
- package/dist/daemon/methods/location.d.ts.map +1 -0
- package/dist/daemon/methods/location.js +72 -0
- package/dist/daemon/methods/location.js.map +1 -0
- package/dist/daemon/methods/provider.d.ts +22 -0
- package/dist/daemon/methods/provider.d.ts.map +1 -0
- package/dist/daemon/methods/provider.js +72 -0
- package/dist/daemon/methods/provider.js.map +1 -0
- package/dist/daemon/methods/tools.d.ts +23 -0
- package/dist/daemon/methods/tools.d.ts.map +1 -0
- package/dist/daemon/methods/tools.js +111 -0
- package/dist/daemon/methods/tools.js.map +1 -0
- package/dist/daemon/registry.d.ts +35 -0
- package/dist/daemon/registry.d.ts.map +1 -0
- package/dist/daemon/registry.js +189 -0
- package/dist/daemon/registry.js.map +1 -0
- package/dist/daemon/types.d.ts +101 -0
- package/dist/daemon/types.d.ts.map +1 -0
- package/dist/daemon/types.js +19 -0
- package/dist/daemon/types.js.map +1 -0
- package/dist/daemon/watcher.d.ts +62 -0
- package/dist/daemon/watcher.d.ts.map +1 -0
- package/dist/daemon/watcher.js +142 -0
- package/dist/daemon/watcher.js.map +1 -0
- package/dist/graph/EdgeTypeRegistry.d.ts +134 -0
- package/dist/graph/EdgeTypeRegistry.d.ts.map +1 -0
- package/dist/graph/EdgeTypeRegistry.js +255 -0
- package/dist/graph/EdgeTypeRegistry.js.map +1 -0
- package/dist/graph/FederatedGraph.d.ts +296 -0
- package/dist/graph/FederatedGraph.d.ts.map +1 -0
- package/dist/graph/FederatedGraph.js +406 -0
- package/dist/graph/FederatedGraph.js.map +1 -0
- package/dist/graph/GraphologyAdapter.d.ts +151 -0
- package/dist/graph/GraphologyAdapter.d.ts.map +1 -0
- package/dist/graph/GraphologyAdapter.js +209 -0
- package/dist/graph/GraphologyAdapter.js.map +1 -0
- package/dist/graph/HydratingFederatedGraph.d.ts +151 -0
- package/dist/graph/HydratingFederatedGraph.d.ts.map +1 -0
- package/dist/graph/HydratingFederatedGraph.js +327 -0
- package/dist/graph/HydratingFederatedGraph.js.map +1 -0
- package/dist/graph/__tests__/EdgeTypeRegistry.test.d.ts +2 -0
- package/dist/graph/__tests__/EdgeTypeRegistry.test.d.ts.map +1 -0
- package/dist/graph/__tests__/EdgeTypeRegistry.test.js +212 -0
- package/dist/graph/__tests__/EdgeTypeRegistry.test.js.map +1 -0
- package/dist/graph/__tests__/FederatedGraph.test.d.ts +2 -0
- package/dist/graph/__tests__/FederatedGraph.test.d.ts.map +1 -0
- package/dist/graph/__tests__/FederatedGraph.test.js +661 -0
- package/dist/graph/__tests__/FederatedGraph.test.js.map +1 -0
- package/dist/graph/__tests__/GraphologyAdapter.test.d.ts +2 -0
- package/dist/graph/__tests__/GraphologyAdapter.test.d.ts.map +1 -0
- package/dist/graph/__tests__/GraphologyAdapter.test.js +326 -0
- package/dist/graph/__tests__/GraphologyAdapter.test.js.map +1 -0
- package/dist/graph/__tests__/HydratingFederatedGraph.test.d.ts +2 -0
- package/dist/graph/__tests__/HydratingFederatedGraph.test.d.ts.map +1 -0
- package/dist/graph/__tests__/HydratingFederatedGraph.test.js +587 -0
- package/dist/graph/__tests__/HydratingFederatedGraph.test.js.map +1 -0
- package/dist/graph/__tests__/debounce.test.d.ts +5 -0
- package/dist/graph/__tests__/debounce.test.d.ts.map +1 -0
- package/dist/graph/__tests__/debounce.test.js +195 -0
- package/dist/graph/__tests__/debounce.test.js.map +1 -0
- package/dist/graph/__tests__/edge-cases.test.d.ts +8 -0
- package/dist/graph/__tests__/edge-cases.test.d.ts.map +1 -0
- package/dist/graph/__tests__/edge-cases.test.js +472 -0
- package/dist/graph/__tests__/edge-cases.test.js.map +1 -0
- package/dist/graph/__tests__/expansion.test.d.ts +2 -0
- package/dist/graph/__tests__/expansion.test.d.ts.map +1 -0
- package/dist/graph/__tests__/expansion.test.js +105 -0
- package/dist/graph/__tests__/expansion.test.js.map +1 -0
- package/dist/graph/__tests__/provider-store.test.d.ts +5 -0
- package/dist/graph/__tests__/provider-store.test.d.ts.map +1 -0
- package/dist/graph/__tests__/provider-store.test.js +791 -0
- package/dist/graph/__tests__/provider-store.test.js.map +1 -0
- package/dist/graph/__tests__/query.test.d.ts +5 -0
- package/dist/graph/__tests__/query.test.d.ts.map +1 -0
- package/dist/graph/__tests__/query.test.js +774 -0
- package/dist/graph/__tests__/query.test.js.map +1 -0
- package/dist/graph/__tests__/store.test.d.ts +5 -0
- package/dist/graph/__tests__/store.test.d.ts.map +1 -0
- package/dist/graph/__tests__/store.test.js +489 -0
- package/dist/graph/__tests__/store.test.js.map +1 -0
- package/dist/graph/__tests__/sync.test.d.ts +5 -0
- package/dist/graph/__tests__/sync.test.d.ts.map +1 -0
- package/dist/graph/__tests__/sync.test.js +129 -0
- package/dist/graph/__tests__/sync.test.js.map +1 -0
- package/dist/graph/__tests__/validation.test.d.ts +2 -0
- package/dist/graph/__tests__/validation.test.d.ts.map +1 -0
- package/dist/graph/__tests__/validation.test.js +521 -0
- package/dist/graph/__tests__/validation.test.js.map +1 -0
- package/dist/graph/coordination.d.ts +190 -0
- package/dist/graph/coordination.d.ts.map +1 -0
- package/dist/graph/coordination.js +180 -0
- package/dist/graph/coordination.js.map +1 -0
- package/dist/graph/debounce.d.ts +47 -0
- package/dist/graph/debounce.d.ts.map +1 -0
- package/dist/graph/debounce.js +95 -0
- package/dist/graph/debounce.js.map +1 -0
- package/dist/graph/expansion.d.ts +64 -0
- package/dist/graph/expansion.d.ts.map +1 -0
- package/dist/graph/expansion.js +205 -0
- package/dist/graph/expansion.js.map +1 -0
- package/dist/graph/history.d.ts +186 -0
- package/dist/graph/history.d.ts.map +1 -0
- package/dist/graph/history.js +155 -0
- package/dist/graph/history.js.map +1 -0
- package/dist/graph/index.d.ts +35 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +22 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/provider-store.d.ts +211 -0
- package/dist/graph/provider-store.d.ts.map +1 -0
- package/dist/graph/provider-store.js +568 -0
- package/dist/graph/provider-store.js.map +1 -0
- package/dist/graph/query.d.ts +90 -0
- package/dist/graph/query.d.ts.map +1 -0
- package/dist/graph/query.js +463 -0
- package/dist/graph/query.js.map +1 -0
- package/dist/graph/store.d.ts +71 -0
- package/dist/graph/store.d.ts.map +1 -0
- package/dist/graph/store.js +530 -0
- package/dist/graph/store.js.map +1 -0
- package/dist/graph/sync.d.ts +48 -0
- package/dist/graph/sync.d.ts.map +1 -0
- package/dist/graph/sync.js +60 -0
- package/dist/graph/sync.js.map +1 -0
- package/dist/graph/types.d.ts +289 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +19 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/validation.d.ts +26 -0
- package/dist/graph/validation.d.ts.map +1 -0
- package/dist/graph/validation.js +338 -0
- package/dist/graph/validation.js.map +1 -0
- package/dist/index.d.ts +25 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -25
- package/dist/index.js.map +1 -1
- package/dist/materialization/archiver.d.ts +12 -0
- package/dist/materialization/archiver.d.ts.map +1 -0
- package/dist/materialization/archiver.js +273 -0
- package/dist/materialization/archiver.js.map +1 -0
- package/dist/materialization/git-archive-store.d.ts +17 -0
- package/dist/materialization/git-archive-store.d.ts.map +1 -0
- package/dist/materialization/git-archive-store.js +509 -0
- package/dist/materialization/git-archive-store.js.map +1 -0
- package/dist/materialization/git-remote-store.d.ts +22 -0
- package/dist/materialization/git-remote-store.d.ts.map +1 -0
- package/dist/materialization/git-remote-store.js +448 -0
- package/dist/materialization/git-remote-store.js.map +1 -0
- package/dist/materialization/graph-id.d.ts +53 -0
- package/dist/materialization/graph-id.d.ts.map +1 -0
- package/dist/materialization/graph-id.js +163 -0
- package/dist/materialization/graph-id.js.map +1 -0
- package/dist/materialization/http-remote-store.d.ts +12 -0
- package/dist/materialization/http-remote-store.d.ts.map +1 -0
- package/dist/materialization/http-remote-store.js +143 -0
- package/dist/materialization/http-remote-store.js.map +1 -0
- package/dist/materialization/index.d.ts +15 -0
- package/dist/materialization/index.d.ts.map +1 -0
- package/dist/materialization/index.js +17 -0
- package/dist/materialization/index.js.map +1 -0
- package/dist/materialization/remote-store-factory.d.ts +17 -0
- package/dist/materialization/remote-store-factory.d.ts.map +1 -0
- package/dist/materialization/remote-store-factory.js +46 -0
- package/dist/materialization/remote-store-factory.js.map +1 -0
- package/dist/materialization/snapshot.d.ts +34 -0
- package/dist/materialization/snapshot.d.ts.map +1 -0
- package/dist/materialization/snapshot.js +177 -0
- package/dist/materialization/snapshot.js.map +1 -0
- package/dist/materialization/types.d.ts +300 -0
- package/dist/materialization/types.d.ts.map +1 -0
- package/dist/materialization/types.js +17 -0
- package/dist/materialization/types.js.map +1 -0
- package/dist/providers/__tests__/beads.test.d.ts +5 -0
- package/dist/providers/__tests__/beads.test.d.ts.map +1 -0
- package/dist/providers/__tests__/beads.test.js +591 -0
- package/dist/providers/__tests__/beads.test.js.map +1 -0
- package/dist/providers/__tests__/claude-tasks.test.d.ts +5 -0
- package/dist/providers/__tests__/claude-tasks.test.d.ts.map +1 -0
- package/dist/providers/__tests__/claude-tasks.test.js +392 -0
- package/dist/providers/__tests__/claude-tasks.test.js.map +1 -0
- package/dist/providers/__tests__/from-config.test.d.ts +5 -0
- package/dist/providers/__tests__/from-config.test.d.ts.map +1 -0
- package/dist/providers/__tests__/from-config.test.js +152 -0
- package/dist/providers/__tests__/from-config.test.js.map +1 -0
- package/dist/providers/__tests__/materialization.test.d.ts +5 -0
- package/dist/providers/__tests__/materialization.test.d.ts.map +1 -0
- package/dist/providers/__tests__/materialization.test.js +407 -0
- package/dist/providers/__tests__/materialization.test.js.map +1 -0
- package/dist/providers/__tests__/native.test.d.ts +5 -0
- package/dist/providers/__tests__/native.test.d.ts.map +1 -0
- package/dist/providers/__tests__/native.test.js +566 -0
- package/dist/providers/__tests__/native.test.js.map +1 -0
- package/dist/providers/__tests__/registry.test.d.ts +5 -0
- package/dist/providers/__tests__/registry.test.d.ts.map +1 -0
- package/dist/providers/__tests__/registry.test.js +183 -0
- package/dist/providers/__tests__/registry.test.js.map +1 -0
- package/dist/providers/beads.d.ts +46 -0
- package/dist/providers/beads.d.ts.map +1 -0
- package/dist/providers/beads.js +865 -0
- package/dist/providers/beads.js.map +1 -0
- package/dist/providers/claude-tasks.d.ts +56 -0
- package/dist/providers/claude-tasks.d.ts.map +1 -0
- package/dist/providers/claude-tasks.js +282 -0
- package/dist/providers/claude-tasks.js.map +1 -0
- package/dist/providers/entire.d.ts +88 -0
- package/dist/providers/entire.d.ts.map +1 -0
- package/dist/providers/entire.js +409 -0
- package/dist/providers/entire.js.map +1 -0
- package/dist/providers/from-config.d.ts +47 -0
- package/dist/providers/from-config.d.ts.map +1 -0
- package/dist/providers/from-config.js +150 -0
- package/dist/providers/from-config.js.map +1 -0
- package/dist/providers/index.d.ts +26 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +29 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/location.d.ts +44 -0
- package/dist/providers/location.d.ts.map +1 -0
- package/dist/providers/location.js +157 -0
- package/dist/providers/location.js.map +1 -0
- package/dist/providers/materialization.d.ts +46 -0
- package/dist/providers/materialization.d.ts.map +1 -0
- package/dist/providers/materialization.js +237 -0
- package/dist/providers/materialization.js.map +1 -0
- package/dist/providers/native.d.ts +32 -0
- package/dist/providers/native.d.ts.map +1 -0
- package/dist/providers/native.js +552 -0
- package/dist/providers/native.js.map +1 -0
- package/dist/providers/registry.d.ts +11 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +97 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/sudocode.d.ts +49 -0
- package/dist/providers/sudocode.d.ts.map +1 -0
- package/dist/providers/sudocode.js +945 -0
- package/dist/providers/sudocode.js.map +1 -0
- package/dist/providers/sync.d.ts +299 -0
- package/dist/providers/sync.d.ts.map +1 -0
- package/dist/providers/sync.js +93 -0
- package/dist/providers/sync.js.map +1 -0
- package/dist/providers/traits/RelationshipQueryable.d.ts +129 -0
- package/dist/providers/traits/RelationshipQueryable.d.ts.map +1 -0
- package/dist/providers/traits/RelationshipQueryable.js +68 -0
- package/dist/providers/traits/RelationshipQueryable.js.map +1 -0
- package/dist/providers/traits/TaskManageable.d.ts +157 -0
- package/dist/providers/traits/TaskManageable.d.ts.map +1 -0
- package/dist/providers/traits/TaskManageable.js +37 -0
- package/dist/providers/traits/TaskManageable.js.map +1 -0
- package/dist/providers/traits/Watchable.d.ts +216 -0
- package/dist/providers/traits/Watchable.d.ts.map +1 -0
- package/dist/providers/traits/Watchable.js +37 -0
- package/dist/providers/traits/Watchable.js.map +1 -0
- package/dist/providers/traits/__tests__/RelationshipQueryable.test.d.ts +2 -0
- package/dist/providers/traits/__tests__/RelationshipQueryable.test.d.ts.map +1 -0
- package/dist/providers/traits/__tests__/RelationshipQueryable.test.js +169 -0
- package/dist/providers/traits/__tests__/RelationshipQueryable.test.js.map +1 -0
- package/dist/providers/traits/__tests__/TaskManageable.test.d.ts +2 -0
- package/dist/providers/traits/__tests__/TaskManageable.test.d.ts.map +1 -0
- package/dist/providers/traits/__tests__/TaskManageable.test.js +172 -0
- package/dist/providers/traits/__tests__/TaskManageable.test.js.map +1 -0
- package/dist/providers/traits/index.d.ts +13 -0
- package/dist/providers/traits/index.d.ts.map +1 -0
- package/dist/providers/traits/index.js +10 -0
- package/dist/providers/traits/index.js.map +1 -0
- package/dist/providers/types.d.ts +284 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +30 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/schema/__tests__/validation.test.d.ts +2 -0
- package/dist/schema/__tests__/validation.test.d.ts.map +1 -0
- package/dist/schema/__tests__/validation.test.js +241 -0
- package/dist/schema/__tests__/validation.test.js.map +1 -0
- package/dist/schema/base.d.ts +68 -0
- package/dist/schema/base.d.ts.map +1 -0
- package/dist/schema/base.js +5 -0
- package/dist/schema/base.js.map +1 -0
- package/dist/schema/edges.d.ts +49 -0
- package/dist/schema/edges.d.ts.map +1 -0
- package/dist/schema/edges.js +9 -0
- package/dist/schema/edges.js.map +1 -0
- package/dist/schema/index.d.ts +11 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +8 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/nodes.d.ts +97 -0
- package/dist/schema/nodes.d.ts.map +1 -0
- package/dist/schema/nodes.js +5 -0
- package/dist/schema/nodes.js.map +1 -0
- package/dist/schema/storage.d.ts +107 -0
- package/dist/schema/storage.d.ts.map +1 -0
- package/dist/schema/storage.js +10 -0
- package/dist/schema/storage.js.map +1 -0
- package/dist/schema/validation.d.ts +61 -0
- package/dist/schema/validation.d.ts.map +1 -0
- package/dist/schema/validation.js +170 -0
- package/dist/schema/validation.js.map +1 -0
- package/dist/storage/__tests__/atomic-write.test.d.ts +5 -0
- package/dist/storage/__tests__/atomic-write.test.d.ts.map +1 -0
- package/dist/storage/__tests__/atomic-write.test.js +170 -0
- package/dist/storage/__tests__/atomic-write.test.js.map +1 -0
- package/dist/storage/__tests__/file-lock.test.d.ts +2 -0
- package/dist/storage/__tests__/file-lock.test.d.ts.map +1 -0
- package/dist/storage/__tests__/file-lock.test.js +89 -0
- package/dist/storage/__tests__/file-lock.test.js.map +1 -0
- package/dist/storage/__tests__/jsonl.test.d.ts +2 -0
- package/dist/storage/__tests__/jsonl.test.d.ts.map +1 -0
- package/dist/storage/__tests__/jsonl.test.js +228 -0
- package/dist/storage/__tests__/jsonl.test.js.map +1 -0
- package/dist/storage/__tests__/locked-writer.test.d.ts +2 -0
- package/dist/storage/__tests__/locked-writer.test.d.ts.map +1 -0
- package/dist/storage/__tests__/locked-writer.test.js +109 -0
- package/dist/storage/__tests__/locked-writer.test.js.map +1 -0
- package/dist/storage/__tests__/sqlite.test.d.ts +2 -0
- package/dist/storage/__tests__/sqlite.test.d.ts.map +1 -0
- package/dist/storage/__tests__/sqlite.test.js +470 -0
- package/dist/storage/__tests__/sqlite.test.js.map +1 -0
- package/dist/storage/atomic-write.d.ts +38 -0
- package/dist/storage/atomic-write.d.ts.map +1 -0
- package/dist/storage/atomic-write.js +83 -0
- package/dist/storage/atomic-write.js.map +1 -0
- package/dist/storage/file-lock.d.ts +66 -0
- package/dist/storage/file-lock.d.ts.map +1 -0
- package/dist/storage/file-lock.js +176 -0
- package/dist/storage/file-lock.js.map +1 -0
- package/dist/storage/index.d.ts +11 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +13 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/interface.d.ts +219 -0
- package/dist/storage/interface.d.ts.map +1 -0
- package/dist/storage/interface.js +22 -0
- package/dist/storage/interface.js.map +1 -0
- package/dist/storage/jsonl.d.ts +106 -0
- package/dist/storage/jsonl.d.ts.map +1 -0
- package/dist/storage/jsonl.js +218 -0
- package/dist/storage/jsonl.js.map +1 -0
- package/dist/storage/locked-writer.d.ts +67 -0
- package/dist/storage/locked-writer.d.ts.map +1 -0
- package/dist/storage/locked-writer.js +105 -0
- package/dist/storage/locked-writer.js.map +1 -0
- package/dist/storage/sqlite-schema.d.ts +48 -0
- package/dist/storage/sqlite-schema.d.ts.map +1 -0
- package/dist/storage/sqlite-schema.js +169 -0
- package/dist/storage/sqlite-schema.js.map +1 -0
- package/dist/storage/sqlite.d.ts +73 -0
- package/dist/storage/sqlite.d.ts.map +1 -0
- package/dist/storage/sqlite.js +698 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/tools/__tests__/annotate.test.d.ts +5 -0
- package/dist/tools/__tests__/annotate.test.d.ts.map +1 -0
- package/dist/tools/__tests__/annotate.test.js +314 -0
- package/dist/tools/__tests__/annotate.test.js.map +1 -0
- package/dist/tools/__tests__/link.test.d.ts +5 -0
- package/dist/tools/__tests__/link.test.d.ts.map +1 -0
- package/dist/tools/__tests__/link.test.js +245 -0
- package/dist/tools/__tests__/link.test.js.map +1 -0
- package/dist/tools/__tests__/query.test.d.ts +5 -0
- package/dist/tools/__tests__/query.test.d.ts.map +1 -0
- package/dist/tools/__tests__/query.test.js +288 -0
- package/dist/tools/__tests__/query.test.js.map +1 -0
- package/dist/tools/__tests__/task.test.d.ts +5 -0
- package/dist/tools/__tests__/task.test.d.ts.map +1 -0
- package/dist/tools/__tests__/task.test.js +178 -0
- package/dist/tools/__tests__/task.test.js.map +1 -0
- package/dist/tools/annotate.d.ts +17 -0
- package/dist/tools/annotate.d.ts.map +1 -0
- package/dist/tools/annotate.js +218 -0
- package/dist/tools/annotate.js.map +1 -0
- package/dist/tools/index.d.ts +14 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +14 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/link.d.ts +17 -0
- package/dist/tools/link.d.ts.map +1 -0
- package/dist/tools/link.js +127 -0
- package/dist/tools/link.js.map +1 -0
- package/dist/tools/query.d.ts +17 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +342 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/task.d.ts +20 -0
- package/dist/tools/task.d.ts.map +1 -0
- package/dist/tools/task.js +161 -0
- package/dist/tools/task.js.map +1 -0
- package/dist/tools/types.d.ts +334 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +19 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +40 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.test.js","sourceRoot":"","sources":["../../../src/core/__tests__/worktree.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACpE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,GAEd,MAAM,gBAAgB,CAAA;AA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MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditional Redirect Rules for OpenTasks (Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Extends Phase 2 redirect rules with role and branch conditions.
|
|
5
|
+
*/
|
|
6
|
+
import type { RedirectRule, RedirectOperation } from './redirects.js';
|
|
7
|
+
/**
|
|
8
|
+
* Conditions for when a redirect rule applies
|
|
9
|
+
*/
|
|
10
|
+
export interface RedirectCondition {
|
|
11
|
+
/** Role condition (exact match) */
|
|
12
|
+
role?: string;
|
|
13
|
+
/** Branch condition (glob pattern) */
|
|
14
|
+
branch?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extended redirect rule with conditions
|
|
18
|
+
*/
|
|
19
|
+
export interface ConditionalRedirectRule extends RedirectRule {
|
|
20
|
+
/** Conditions that must be met for this rule to apply */
|
|
21
|
+
when?: RedirectCondition;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Runtime context for evaluating redirect conditions
|
|
25
|
+
*/
|
|
26
|
+
export interface RedirectContext {
|
|
27
|
+
/** Current location role */
|
|
28
|
+
role: string;
|
|
29
|
+
/** Current git branch (cached) */
|
|
30
|
+
branch?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if conditions are met
|
|
34
|
+
*/
|
|
35
|
+
export declare function evaluateConditions(conditions: RedirectCondition | undefined, context: RedirectContext): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Find the first matching conditional redirect rule
|
|
38
|
+
*
|
|
39
|
+
* Extends findRedirectRule with condition evaluation.
|
|
40
|
+
*/
|
|
41
|
+
export declare function findConditionalRedirectRule(operation: RedirectOperation, nodeId: string, rules: ConditionalRedirectRule[], context: RedirectContext): ConditionalRedirectRule | null;
|
|
42
|
+
//# sourceMappingURL=conditional-redirects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional-redirects.d.ts","sourceRoot":"","sources":["../../src/core/conditional-redirects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGtE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,yDAAyD;IACzD,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqBD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,OAAO,EAAE,eAAe,GACvB,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,uBAAuB,EAAE,EAChC,OAAO,EAAE,eAAe,GACvB,uBAAuB,GAAG,IAAI,CAYhC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditional Redirect Rules for OpenTasks (Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Extends Phase 2 redirect rules with role and branch conditions.
|
|
5
|
+
*/
|
|
6
|
+
import { matchPattern } from './redirects.js';
|
|
7
|
+
/**
|
|
8
|
+
* Simple glob match for branch patterns
|
|
9
|
+
*
|
|
10
|
+
* Supports: "feature-*", "main", "*"
|
|
11
|
+
*/
|
|
12
|
+
function branchMatch(pattern, branch) {
|
|
13
|
+
if (pattern === '*')
|
|
14
|
+
return true;
|
|
15
|
+
if (pattern.endsWith('*')) {
|
|
16
|
+
return branch.startsWith(pattern.slice(0, -1));
|
|
17
|
+
}
|
|
18
|
+
if (pattern.startsWith('*')) {
|
|
19
|
+
return branch.endsWith(pattern.slice(1));
|
|
20
|
+
}
|
|
21
|
+
return pattern === branch;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if conditions are met
|
|
25
|
+
*/
|
|
26
|
+
export function evaluateConditions(conditions, context) {
|
|
27
|
+
if (!conditions)
|
|
28
|
+
return true;
|
|
29
|
+
if (conditions.role && conditions.role !== context.role) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (conditions.branch) {
|
|
33
|
+
if (!context.branch)
|
|
34
|
+
return false;
|
|
35
|
+
if (!branchMatch(conditions.branch, context.branch))
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Find the first matching conditional redirect rule
|
|
42
|
+
*
|
|
43
|
+
* Extends findRedirectRule with condition evaluation.
|
|
44
|
+
*/
|
|
45
|
+
export function findConditionalRedirectRule(operation, nodeId, rules, context) {
|
|
46
|
+
// Sort by priority (ascending — lower = higher priority)
|
|
47
|
+
const sorted = [...rules].sort((a, b) => a.priority - b.priority);
|
|
48
|
+
for (const rule of sorted) {
|
|
49
|
+
if (!rule.operations.includes(operation))
|
|
50
|
+
continue;
|
|
51
|
+
if (!matchPattern(rule.pattern, nodeId))
|
|
52
|
+
continue;
|
|
53
|
+
if (!evaluateConditions(rule.when, context))
|
|
54
|
+
continue;
|
|
55
|
+
return rule;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=conditional-redirects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional-redirects.js","sourceRo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GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IAElE,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,SAAS;QACnD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;YAAE,SAAS;QAClD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;YAAE,SAAS;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection Management for OpenTasks (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* Manages explicit connections between OpenTasks locations.
|
|
5
|
+
* No filesystem discovery — all connections are declared in config.json.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Connection role
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectionRole = 'peer' | 'parent' | 'child';
|
|
11
|
+
/**
|
|
12
|
+
* Connection to another OpenTasks location
|
|
13
|
+
*/
|
|
14
|
+
export interface Connection {
|
|
15
|
+
/** Location hash of the target */
|
|
16
|
+
hash: string;
|
|
17
|
+
/** Path to the target .opentasks directory (relative or absolute) */
|
|
18
|
+
path: string;
|
|
19
|
+
/** Relationship role */
|
|
20
|
+
role: ConnectionRole;
|
|
21
|
+
/** Human-readable name */
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Health status of a connection
|
|
26
|
+
*/
|
|
27
|
+
export type ConnectionHealth = 'reachable' | 'unreachable' | 'hash-mismatch';
|
|
28
|
+
/**
|
|
29
|
+
* Connection with health information
|
|
30
|
+
*/
|
|
31
|
+
export interface ConnectionStatus {
|
|
32
|
+
connection: Connection;
|
|
33
|
+
health: ConnectionHealth;
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a connection to another OpenTasks location
|
|
38
|
+
*
|
|
39
|
+
* Reads the target's config.json to get its hash and name.
|
|
40
|
+
*
|
|
41
|
+
* @param targetPath - Path to the target .opentasks directory
|
|
42
|
+
* @param role - Relationship role (default: 'peer')
|
|
43
|
+
* @param basePath - Base path for computing relative paths
|
|
44
|
+
* @returns New connection, or throws on error
|
|
45
|
+
*/
|
|
46
|
+
export declare function createConnection(targetPath: string, role?: ConnectionRole, basePath?: string): Connection;
|
|
47
|
+
/**
|
|
48
|
+
* Check the health of a connection
|
|
49
|
+
*
|
|
50
|
+
* @param connection - The connection to check
|
|
51
|
+
* @param basePath - Base path for resolving relative paths
|
|
52
|
+
* @returns Connection status with health information
|
|
53
|
+
*/
|
|
54
|
+
export declare function checkConnectionHealth(connection: Connection, basePath?: string): ConnectionStatus;
|
|
55
|
+
/**
|
|
56
|
+
* Add a connection to a list, replacing any existing connection with the same hash
|
|
57
|
+
*
|
|
58
|
+
* @param connections - Existing connections
|
|
59
|
+
* @param newConnection - Connection to add
|
|
60
|
+
* @returns Updated connections list
|
|
61
|
+
*/
|
|
62
|
+
export declare function addConnection(connections: Connection[], newConnection: Connection): Connection[];
|
|
63
|
+
/**
|
|
64
|
+
* Remove a connection by hash
|
|
65
|
+
*
|
|
66
|
+
* @param connections - Existing connections
|
|
67
|
+
* @param hash - Hash of the connection to remove
|
|
68
|
+
* @returns Updated connections list
|
|
69
|
+
*/
|
|
70
|
+
export declare function removeConnection(connections: Connection[], hash: string): Connection[];
|
|
71
|
+
/**
|
|
72
|
+
* Find a connection by hash
|
|
73
|
+
*
|
|
74
|
+
* @param connections - Connections to search
|
|
75
|
+
* @param hash - Location hash to find
|
|
76
|
+
* @returns The connection or undefined
|
|
77
|
+
*/
|
|
78
|
+
export declare function findConnection(connections: Connection[], hash: string): Connection | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Get health status for all connections
|
|
81
|
+
*
|
|
82
|
+
* @param connections - Connections to check
|
|
83
|
+
* @param basePath - Base path for resolving relative paths
|
|
84
|
+
* @returns Array of connection statuses
|
|
85
|
+
*/
|
|
86
|
+
export declare function checkAllConnectionHealth(connections: Connection[], basePath?: string): ConnectionStatus[];
|
|
87
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/core/connections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiCD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,cAAuB,EAC7B,QAAQ,CAAC,EAAE,MAAM,GAChB,UAAU,CAuBZ;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,CA8CjG;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,UAAU,EAAE,CAIhG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAEtF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE9F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,gBAAgB,EAAE,CAEpB"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection Management for OpenTasks (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* Manages explicit connections between OpenTasks locations.
|
|
5
|
+
* No filesystem discovery — all connections are declared in config.json.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* Read the config.json of a target location
|
|
11
|
+
*
|
|
12
|
+
* @param opentasksPath - Path to the target .opentasks directory
|
|
13
|
+
* @returns The parsed config or null if not readable
|
|
14
|
+
*/
|
|
15
|
+
function readTargetConfig(opentasksPath) {
|
|
16
|
+
try {
|
|
17
|
+
const configPath = path.join(opentasksPath, 'config.json');
|
|
18
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
19
|
+
return JSON.parse(content);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract location identity from a config object
|
|
27
|
+
*/
|
|
28
|
+
function extractLocation(config) {
|
|
29
|
+
const loc = config.location;
|
|
30
|
+
if (!loc || typeof loc.hash !== 'string' || typeof loc.uuid !== 'string') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
hash: loc.hash,
|
|
35
|
+
uuid: loc.uuid,
|
|
36
|
+
name: loc.name || '',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a connection to another OpenTasks location
|
|
41
|
+
*
|
|
42
|
+
* Reads the target's config.json to get its hash and name.
|
|
43
|
+
*
|
|
44
|
+
* @param targetPath - Path to the target .opentasks directory
|
|
45
|
+
* @param role - Relationship role (default: 'peer')
|
|
46
|
+
* @param basePath - Base path for computing relative paths
|
|
47
|
+
* @returns New connection, or throws on error
|
|
48
|
+
*/
|
|
49
|
+
export function createConnection(targetPath, role = 'peer', basePath) {
|
|
50
|
+
const resolvedTarget = path.resolve(targetPath);
|
|
51
|
+
// Read target config
|
|
52
|
+
const config = readTargetConfig(resolvedTarget);
|
|
53
|
+
if (!config) {
|
|
54
|
+
throw new Error(`Cannot read config at: ${resolvedTarget}/config.json`);
|
|
55
|
+
}
|
|
56
|
+
const location = extractLocation(config);
|
|
57
|
+
if (!location) {
|
|
58
|
+
throw new Error(`No valid location identity in: ${resolvedTarget}/config.json`);
|
|
59
|
+
}
|
|
60
|
+
// Compute relative path if base is provided
|
|
61
|
+
const connectionPath = basePath ? path.relative(basePath, resolvedTarget) : resolvedTarget;
|
|
62
|
+
return {
|
|
63
|
+
hash: location.hash,
|
|
64
|
+
path: connectionPath,
|
|
65
|
+
role,
|
|
66
|
+
name: location.name,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Check the health of a connection
|
|
71
|
+
*
|
|
72
|
+
* @param connection - The connection to check
|
|
73
|
+
* @param basePath - Base path for resolving relative paths
|
|
74
|
+
* @returns Connection status with health information
|
|
75
|
+
*/
|
|
76
|
+
export function checkConnectionHealth(connection, basePath) {
|
|
77
|
+
const resolvedPath = basePath
|
|
78
|
+
? path.resolve(basePath, connection.path)
|
|
79
|
+
: path.resolve(connection.path);
|
|
80
|
+
// 1. Does the path exist?
|
|
81
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
82
|
+
return {
|
|
83
|
+
connection,
|
|
84
|
+
health: 'unreachable',
|
|
85
|
+
error: `Path does not exist: ${resolvedPath}`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// 2. Is there a valid config.json?
|
|
89
|
+
const config = readTargetConfig(resolvedPath);
|
|
90
|
+
if (!config) {
|
|
91
|
+
return {
|
|
92
|
+
connection,
|
|
93
|
+
health: 'unreachable',
|
|
94
|
+
error: `Cannot read config.json at: ${resolvedPath}`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// 3. Does the hash match?
|
|
98
|
+
const location = extractLocation(config);
|
|
99
|
+
if (!location) {
|
|
100
|
+
return {
|
|
101
|
+
connection,
|
|
102
|
+
health: 'unreachable',
|
|
103
|
+
error: `No valid location identity in config.json`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (location.hash !== connection.hash) {
|
|
107
|
+
return {
|
|
108
|
+
connection,
|
|
109
|
+
health: 'hash-mismatch',
|
|
110
|
+
error: `Expected hash ${connection.hash}, found ${location.hash}`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
connection,
|
|
115
|
+
health: 'reachable',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Add a connection to a list, replacing any existing connection with the same hash
|
|
120
|
+
*
|
|
121
|
+
* @param connections - Existing connections
|
|
122
|
+
* @param newConnection - Connection to add
|
|
123
|
+
* @returns Updated connections list
|
|
124
|
+
*/
|
|
125
|
+
export function addConnection(connections, newConnection) {
|
|
126
|
+
// Remove existing with same hash
|
|
127
|
+
const filtered = connections.filter((c) => c.hash !== newConnection.hash);
|
|
128
|
+
return [...filtered, newConnection];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Remove a connection by hash
|
|
132
|
+
*
|
|
133
|
+
* @param connections - Existing connections
|
|
134
|
+
* @param hash - Hash of the connection to remove
|
|
135
|
+
* @returns Updated connections list
|
|
136
|
+
*/
|
|
137
|
+
export function removeConnection(connections, hash) {
|
|
138
|
+
return connections.filter((c) => c.hash !== hash);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Find a connection by hash
|
|
142
|
+
*
|
|
143
|
+
* @param connections - Connections to search
|
|
144
|
+
* @param hash - Location hash to find
|
|
145
|
+
* @returns The connection or undefined
|
|
146
|
+
*/
|
|
147
|
+
export function findConnection(connections, hash) {
|
|
148
|
+
return connections.find((c) => c.hash === hash);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get health status for all connections
|
|
152
|
+
*
|
|
153
|
+
* @param connections - Connections to check
|
|
154
|
+
* @param basePath - Base path for resolving relative paths
|
|
155
|
+
* @returns Array of connection statuses
|
|
156
|
+
*/
|
|
157
|
+
export function checkAllConnectionHealth(connections, basePath) {
|
|
158
|
+
return connections.map((c) => checkConnectionHealth(c, basePath));
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/core/connections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAoClC;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,aAAqB;IAC7C,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;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MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,QAAQ,EAAE,aAAa,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAyB,EAAE,IAAY;IACtE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,WAAyB,EAAE,IAAY;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,WAAyB,EACzB,QAAiB;IAEjB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Discovery for OpenTasks (Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Finds nearby OpenTasks locations by walking the filesystem
|
|
5
|
+
* in configurable directions from the current working directory.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Discovered OpenTasks location
|
|
9
|
+
*/
|
|
10
|
+
export interface DiscoveredLocation {
|
|
11
|
+
/** Absolute path to the .opentasks directory */
|
|
12
|
+
opentasksPath: string;
|
|
13
|
+
/** Location hash (from config.json) */
|
|
14
|
+
hash: string;
|
|
15
|
+
/** Human-readable name */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Relative direction from search origin */
|
|
18
|
+
direction: 'up' | 'down' | 'self';
|
|
19
|
+
/** Filesystem depth from search origin */
|
|
20
|
+
depth: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Discovery options
|
|
24
|
+
*/
|
|
25
|
+
export interface DiscoverOptions {
|
|
26
|
+
/** Search direction: 'up' (parents), 'down' (children), 'both' */
|
|
27
|
+
direction?: 'up' | 'down' | 'both';
|
|
28
|
+
/** Maximum depth to traverse (default: 5) */
|
|
29
|
+
maxDepth?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Discover OpenTasks locations near the given directory
|
|
33
|
+
*
|
|
34
|
+
* @param startDir - Directory to start searching from
|
|
35
|
+
* @param options - Discovery options
|
|
36
|
+
* @returns Array of discovered locations
|
|
37
|
+
*/
|
|
38
|
+
export declare function discoverLocations(startDir: string, options?: DiscoverOptions): DiscoveredLocation[];
|
|
39
|
+
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/core/discover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,eAAoB,GAC5B,kBAAkB,EAAE,CA+BtB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Discovery for OpenTasks (Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Finds nearby OpenTasks locations by walking the filesystem
|
|
5
|
+
* in configurable directions from the current working directory.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* Read location identity from a .opentasks/config.json file
|
|
11
|
+
*/
|
|
12
|
+
function readLocationConfig(opentasksDir) {
|
|
13
|
+
const configPath = path.join(opentasksDir, 'config.json');
|
|
14
|
+
try {
|
|
15
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
16
|
+
const config = JSON.parse(content);
|
|
17
|
+
if (config.location?.hash) {
|
|
18
|
+
return {
|
|
19
|
+
hash: config.location.hash,
|
|
20
|
+
name: config.location.name || '',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Walk upward from a directory looking for .opentasks locations
|
|
31
|
+
*/
|
|
32
|
+
function discoverUp(startDir, maxDepth) {
|
|
33
|
+
const results = [];
|
|
34
|
+
let currentDir = path.dirname(startDir); // Start from parent
|
|
35
|
+
let depth = 1;
|
|
36
|
+
while (depth <= maxDepth) {
|
|
37
|
+
// Check if this directory has a .opentasks
|
|
38
|
+
const opentasksDir = path.join(currentDir, '.opentasks');
|
|
39
|
+
if (fs.existsSync(opentasksDir)) {
|
|
40
|
+
const config = readLocationConfig(opentasksDir);
|
|
41
|
+
if (config) {
|
|
42
|
+
results.push({
|
|
43
|
+
opentasksPath: opentasksDir,
|
|
44
|
+
hash: config.hash,
|
|
45
|
+
name: config.name,
|
|
46
|
+
direction: 'up',
|
|
47
|
+
depth,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Move to parent
|
|
52
|
+
const parentDir = path.dirname(currentDir);
|
|
53
|
+
if (parentDir === currentDir)
|
|
54
|
+
break; // Reached filesystem root
|
|
55
|
+
currentDir = parentDir;
|
|
56
|
+
depth++;
|
|
57
|
+
}
|
|
58
|
+
return results;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Walk downward from a directory looking for .opentasks locations
|
|
62
|
+
*/
|
|
63
|
+
function discoverDown(startDir, maxDepth) {
|
|
64
|
+
const results = [];
|
|
65
|
+
function walk(dir, depth) {
|
|
66
|
+
if (depth > maxDepth)
|
|
67
|
+
return;
|
|
68
|
+
let entries;
|
|
69
|
+
try {
|
|
70
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (!entry.isDirectory())
|
|
77
|
+
continue;
|
|
78
|
+
// Skip hidden directories (except .opentasks itself) and node_modules
|
|
79
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules')
|
|
80
|
+
continue;
|
|
81
|
+
const childDir = path.join(dir, entry.name);
|
|
82
|
+
const opentasksDir = path.join(childDir, '.opentasks');
|
|
83
|
+
if (fs.existsSync(opentasksDir)) {
|
|
84
|
+
const config = readLocationConfig(opentasksDir);
|
|
85
|
+
if (config) {
|
|
86
|
+
results.push({
|
|
87
|
+
opentasksPath: opentasksDir,
|
|
88
|
+
hash: config.hash,
|
|
89
|
+
name: config.name,
|
|
90
|
+
direction: 'down',
|
|
91
|
+
depth,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Continue walking into subdirectories
|
|
96
|
+
walk(childDir, depth + 1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
walk(startDir, 1);
|
|
100
|
+
return results;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Discover OpenTasks locations near the given directory
|
|
104
|
+
*
|
|
105
|
+
* @param startDir - Directory to start searching from
|
|
106
|
+
* @param options - Discovery options
|
|
107
|
+
* @returns Array of discovered locations
|
|
108
|
+
*/
|
|
109
|
+
export function discoverLocations(startDir, options = {}) {
|
|
110
|
+
const direction = options.direction ?? 'both';
|
|
111
|
+
const maxDepth = options.maxDepth ?? 5;
|
|
112
|
+
const resolvedStart = path.resolve(startDir);
|
|
113
|
+
const results = [];
|
|
114
|
+
// Check self first
|
|
115
|
+
const selfOpentasks = path.join(resolvedStart, '.opentasks');
|
|
116
|
+
if (fs.existsSync(selfOpentasks)) {
|
|
117
|
+
const config = readLocationConfig(selfOpentasks);
|
|
118
|
+
if (config) {
|
|
119
|
+
results.push({
|
|
120
|
+
opentasksPath: selfOpentasks,
|
|
121
|
+
hash: config.hash,
|
|
122
|
+
name: config.name,
|
|
123
|
+
direction: 'self',
|
|
124
|
+
depth: 0,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (direction === 'up' || direction === 'both') {
|
|
129
|
+
results.push(...discoverUp(resolvedStart, maxDepth));
|
|
130
|
+
}
|
|
131
|
+
if (direction === 'down' || direction === 'both') {
|
|
132
|
+
results.push(...discoverDown(resolvedStart, maxDepth));
|
|
133
|
+
}
|
|
134
|
+
return results;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/core/discover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA4BlC;;GAEG;AACH,SAAS,kBAAkB,CAAC,YAAoB;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IAC1D,IAAI,CAAC;QACH,MAAM,OAAO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,IAAI,CAAC,GAAG,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content hashing for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* Used for deduplication during merge and change detection.
|
|
5
|
+
*/
|
|
6
|
+
import type { StoredNode } from '../schema/storage.js';
|
|
7
|
+
/**
|
|
8
|
+
* Compute SHA256 hash of a string
|
|
9
|
+
*/
|
|
10
|
+
export declare function sha256(input: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Compute content hash for a node
|
|
13
|
+
*
|
|
14
|
+
* Only includes substantive fields (content that affects semantics).
|
|
15
|
+
* Excludes: id, uuid, timestamps, coordination fields, metadata.
|
|
16
|
+
*
|
|
17
|
+
* @param node - The node to hash
|
|
18
|
+
* @returns SHA256 hash as hex string
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeContentHash(node: StoredNode): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if two nodes have the same content (ignoring non-substantive fields)
|
|
23
|
+
*/
|
|
24
|
+
export declare function contentEqual(a: StoredNode, b: StoredNode): boolean;
|
|
25
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAyC3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAElE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content hashing for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* Used for deduplication during merge and change detection.
|
|
5
|
+
*/
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
/**
|
|
8
|
+
* Compute SHA256 hash of a string
|
|
9
|
+
*/
|
|
10
|
+
export function sha256(input) {
|
|
11
|
+
return createHash('sha256').update(input).digest('hex');
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Compute content hash for a node
|
|
15
|
+
*
|
|
16
|
+
* Only includes substantive fields (content that affects semantics).
|
|
17
|
+
* Excludes: id, uuid, timestamps, coordination fields, metadata.
|
|
18
|
+
*
|
|
19
|
+
* @param node - The node to hash
|
|
20
|
+
* @returns SHA256 hash as hex string
|
|
21
|
+
*/
|
|
22
|
+
export function computeContentHash(node) {
|
|
23
|
+
// Build object with only substantive fields
|
|
24
|
+
const substantive = {
|
|
25
|
+
type: node.type,
|
|
26
|
+
title: node.title,
|
|
27
|
+
content: node.content,
|
|
28
|
+
status: node.status,
|
|
29
|
+
priority: node.priority,
|
|
30
|
+
tags: node.tags ? [...node.tags].sort() : undefined,
|
|
31
|
+
parent_id: node.parent_id,
|
|
32
|
+
};
|
|
33
|
+
// Add type-specific substantive fields
|
|
34
|
+
if (node.type === 'task') {
|
|
35
|
+
substantive.assignee = node.assignee;
|
|
36
|
+
}
|
|
37
|
+
if (node.type === 'feedback') {
|
|
38
|
+
substantive.target_id = node.target_id;
|
|
39
|
+
substantive.feedback_type = node.feedback_type;
|
|
40
|
+
substantive.target_anchor = node.target_anchor;
|
|
41
|
+
}
|
|
42
|
+
if (node.type === 'external') {
|
|
43
|
+
substantive.uri = node.uri;
|
|
44
|
+
substantive.source = node.source;
|
|
45
|
+
}
|
|
46
|
+
// Remove undefined values for consistent hashing
|
|
47
|
+
const cleaned = Object.fromEntries(Object.entries(substantive).filter(([_, v]) => v !== undefined));
|
|
48
|
+
// Sort keys for deterministic JSON
|
|
49
|
+
const sortedKeys = Object.keys(cleaned).sort();
|
|
50
|
+
const orderedObj = {};
|
|
51
|
+
for (const key of sortedKeys) {
|
|
52
|
+
orderedObj[key] = cleaned[key];
|
|
53
|
+
}
|
|
54
|
+
return sha256(JSON.stringify(orderedObj));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if two nodes have the same content (ignoring non-substantive fields)
|
|
58
|
+
*/
|
|
59
|
+
export function contentEqual(a, b) {
|
|
60
|
+
return computeContentHash(a) === computeContentHash(b);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=hash.js.map
|