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":"hash.js","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAgB;IACjD,4CAA4C;IAC5C,MAAM,WAAW,GAA4B;QAC3C,IAAI,EAAE,IAAI,CAAC,IAA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M,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,UAAU,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,CAAa,EAAE,CAAa;IACvD,OAAO,kBAAkB,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ID generation for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* Uses hash-based IDs with type prefixes for collision resistance
|
|
5
|
+
* in multi-agent/multi-threaded environments.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Node type for ID generation
|
|
9
|
+
*/
|
|
10
|
+
export type IdNodeType = 'context' | 'task' | 'feedback' | 'external' | 'edge';
|
|
11
|
+
/**
|
|
12
|
+
* Convert a hex string to base36
|
|
13
|
+
*/
|
|
14
|
+
export declare function hexToBase36(hex: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get the type prefix for a node type
|
|
17
|
+
*/
|
|
18
|
+
export declare function typePrefix(type: IdNodeType | string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Calculate adaptive ID length based on entity count
|
|
21
|
+
*
|
|
22
|
+
* Uses birthday paradox to target <1% collision probability.
|
|
23
|
+
*
|
|
24
|
+
* For base36 (36 characters):
|
|
25
|
+
* - 4 chars: 36^4 = 1,679,616 possibilities → safe up to ~980 entities
|
|
26
|
+
* - 5 chars: 36^5 = 60,466,176 possibilities → safe up to ~5,900 entities
|
|
27
|
+
* - 6 chars: 36^6 = 2,176,782,336 possibilities → safe up to ~35,000 entities
|
|
28
|
+
* - 7 chars: 36^7 = 78,364,164,096 possibilities → safe up to ~212,000 entities
|
|
29
|
+
* - 8 chars: 36^8 = 2,821,109,907,456 possibilities → safe up to ~1.3M entities
|
|
30
|
+
*/
|
|
31
|
+
export declare function adaptiveLength(count: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Result of ID generation
|
|
34
|
+
*/
|
|
35
|
+
export interface GeneratedId {
|
|
36
|
+
/** Short hash-based ID (e.g., "s-a2b3") */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Full UUID v4 */
|
|
39
|
+
uuid: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generate a new ID for a node
|
|
43
|
+
*
|
|
44
|
+
* @param type - The node type (determines prefix)
|
|
45
|
+
* @param existingCount - Number of existing entities (for adaptive length)
|
|
46
|
+
* @returns Object with short id and full uuid
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const { id, uuid } = generateId('task')
|
|
51
|
+
* // id: "t-x7k9"
|
|
52
|
+
* // uuid: "550e8400-e29b-41d4-a716-446655440000"
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function generateId(type: IdNodeType | string, existingCount?: number): GeneratedId;
|
|
56
|
+
/**
|
|
57
|
+
* Generate an ID from a specific UUID (for deterministic testing)
|
|
58
|
+
*
|
|
59
|
+
* @param type - The node type
|
|
60
|
+
* @param uuid - The UUID to use
|
|
61
|
+
* @param existingCount - Number of existing entities
|
|
62
|
+
* @returns Object with short id and the provided uuid
|
|
63
|
+
*/
|
|
64
|
+
export declare function generateIdFromUuid(type: IdNodeType | string, uuid: string, existingCount?: number): GeneratedId;
|
|
65
|
+
/**
|
|
66
|
+
* Parse an ID to extract its type prefix
|
|
67
|
+
*
|
|
68
|
+
* @param id - The ID to parse (e.g., "s-a2b3")
|
|
69
|
+
* @returns The type prefix or null if invalid format
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseIdPrefix(id: string): string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Infer node type from ID prefix
|
|
74
|
+
*
|
|
75
|
+
* @param id - The ID to check
|
|
76
|
+
* @returns The inferred node type or null if unknown
|
|
77
|
+
*/
|
|
78
|
+
export declare function inferTypeFromId(id: string): IdNodeType | null;
|
|
79
|
+
//# sourceMappingURL=id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/core/id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAkB/E;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAe/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,aAAa,GAAE,MAAU,GAAG,WAAW,CAkB5F;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,IAAI,EAAE,MAAM,EACZ,aAAa,GAAE,MAAU,GACxB,WAAW,CAQb;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAa7D"}
|
package/dist/core/id.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ID generation for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* Uses hash-based IDs with type prefixes for collision resistance
|
|
5
|
+
* in multi-agent/multi-threaded environments.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
8
|
+
/**
|
|
9
|
+
* ID prefixes by type
|
|
10
|
+
*/
|
|
11
|
+
const TYPE_PREFIXES = {
|
|
12
|
+
context: 'c',
|
|
13
|
+
task: 't',
|
|
14
|
+
feedback: 'f',
|
|
15
|
+
external: 'e',
|
|
16
|
+
edge: 'x',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Base36 character set (0-9, a-z)
|
|
20
|
+
*/
|
|
21
|
+
const BASE36_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz';
|
|
22
|
+
/**
|
|
23
|
+
* Convert a hex string to base36
|
|
24
|
+
*/
|
|
25
|
+
export function hexToBase36(hex) {
|
|
26
|
+
// Convert hex to BigInt, then to base36
|
|
27
|
+
const num = BigInt('0x' + hex);
|
|
28
|
+
let result = '';
|
|
29
|
+
let remaining = num;
|
|
30
|
+
if (remaining === 0n)
|
|
31
|
+
return '0';
|
|
32
|
+
while (remaining > 0n) {
|
|
33
|
+
const digit = Number(remaining % 36n);
|
|
34
|
+
result = BASE36_CHARS[digit] + result;
|
|
35
|
+
remaining = remaining / 36n;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get the type prefix for a node type
|
|
41
|
+
*/
|
|
42
|
+
export function typePrefix(type) {
|
|
43
|
+
return TYPE_PREFIXES[type] || 'n';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Calculate adaptive ID length based on entity count
|
|
47
|
+
*
|
|
48
|
+
* Uses birthday paradox to target <1% collision probability.
|
|
49
|
+
*
|
|
50
|
+
* For base36 (36 characters):
|
|
51
|
+
* - 4 chars: 36^4 = 1,679,616 possibilities → safe up to ~980 entities
|
|
52
|
+
* - 5 chars: 36^5 = 60,466,176 possibilities → safe up to ~5,900 entities
|
|
53
|
+
* - 6 chars: 36^6 = 2,176,782,336 possibilities → safe up to ~35,000 entities
|
|
54
|
+
* - 7 chars: 36^7 = 78,364,164,096 possibilities → safe up to ~212,000 entities
|
|
55
|
+
* - 8 chars: 36^8 = 2,821,109,907,456 possibilities → safe up to ~1.3M entities
|
|
56
|
+
*/
|
|
57
|
+
export function adaptiveLength(count) {
|
|
58
|
+
if (count < 980)
|
|
59
|
+
return 4;
|
|
60
|
+
if (count < 5900)
|
|
61
|
+
return 5;
|
|
62
|
+
if (count < 35000)
|
|
63
|
+
return 6;
|
|
64
|
+
if (count < 212000)
|
|
65
|
+
return 7;
|
|
66
|
+
return 8;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Generate a new ID for a node
|
|
70
|
+
*
|
|
71
|
+
* @param type - The node type (determines prefix)
|
|
72
|
+
* @param existingCount - Number of existing entities (for adaptive length)
|
|
73
|
+
* @returns Object with short id and full uuid
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const { id, uuid } = generateId('task')
|
|
78
|
+
* // id: "t-x7k9"
|
|
79
|
+
* // uuid: "550e8400-e29b-41d4-a716-446655440000"
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export function generateId(type, existingCount = 0) {
|
|
83
|
+
// 1. Generate UUID v4
|
|
84
|
+
const uuid = randomUUID();
|
|
85
|
+
// 2. SHA256 hash the UUID
|
|
86
|
+
const hash = createHash('sha256').update(uuid).digest('hex');
|
|
87
|
+
// 3. Convert to base36
|
|
88
|
+
const base36 = hexToBase36(hash);
|
|
89
|
+
// 4. Get adaptive length
|
|
90
|
+
const length = adaptiveLength(existingCount);
|
|
91
|
+
// 5. Prepend type prefix
|
|
92
|
+
const prefix = typePrefix(type);
|
|
93
|
+
const id = `${prefix}-${base36.slice(0, length)}`;
|
|
94
|
+
return { id, uuid };
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Generate an ID from a specific UUID (for deterministic testing)
|
|
98
|
+
*
|
|
99
|
+
* @param type - The node type
|
|
100
|
+
* @param uuid - The UUID to use
|
|
101
|
+
* @param existingCount - Number of existing entities
|
|
102
|
+
* @returns Object with short id and the provided uuid
|
|
103
|
+
*/
|
|
104
|
+
export function generateIdFromUuid(type, uuid, existingCount = 0) {
|
|
105
|
+
const hash = createHash('sha256').update(uuid).digest('hex');
|
|
106
|
+
const base36 = hexToBase36(hash);
|
|
107
|
+
const length = adaptiveLength(existingCount);
|
|
108
|
+
const prefix = typePrefix(type);
|
|
109
|
+
const id = `${prefix}-${base36.slice(0, length)}`;
|
|
110
|
+
return { id, uuid };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Parse an ID to extract its type prefix
|
|
114
|
+
*
|
|
115
|
+
* @param id - The ID to parse (e.g., "s-a2b3")
|
|
116
|
+
* @returns The type prefix or null if invalid format
|
|
117
|
+
*/
|
|
118
|
+
export function parseIdPrefix(id) {
|
|
119
|
+
const match = id.match(/^([a-z])-/);
|
|
120
|
+
return match ? match[1] : null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Infer node type from ID prefix
|
|
124
|
+
*
|
|
125
|
+
* @param id - The ID to check
|
|
126
|
+
* @returns The inferred node type or null if unknown
|
|
127
|
+
*/
|
|
128
|
+
export function inferTypeFromId(id) {
|
|
129
|
+
const prefix = parseIdPrefix(id);
|
|
130
|
+
if (!prefix)
|
|
131
|
+
return null;
|
|
132
|
+
const prefixToType = {
|
|
133
|
+
c: 'context',
|
|
134
|
+
t: 'task',
|
|
135
|
+
f: 'feedback',
|
|
136
|
+
e: 'external',
|
|
137
|
+
x: 'edge',
|
|
138
|
+
};
|
|
139
|
+
return prefixToType[prefix] || null;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,YAAY,GAA+B;QAC/C,CAAC,EAAE,SAAS;QACZ,CAAC,EAAE,MAAM;QACT,CAAC,EAAE,UAAU;QACb,CAAC,EAAE,UAAU;QACb,CAAC,EAAE,MAAM;KACV,CAAC;IAEF,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core utilities for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { generateId, generateIdFromUuid, typePrefix, adaptiveLength, hexToBase36, parseIdPrefix, inferTypeFromId, type IdNodeType, type GeneratedId, } from './id.js';
|
|
7
|
+
export { sha256, computeContentHash, contentEqual } from './hash.js';
|
|
8
|
+
export { generateLocationHash, generateLocationHashFallback, generateLocationIdentity, getGitRemoteUrl, getGitRoot, isValidLocationHash, type LocationIdentity, } from './location.js';
|
|
9
|
+
export { parseOpentasksUri, resolveLocationTarget, resolveOpentasksUri, isOpentasksUri, buildOpentasksUri, buildLocalUri, type ParsedOpentasksUri, type ResolvedLocationTarget, type ResolvedLocation, } from './uri.js';
|
|
10
|
+
export { createConnection, checkConnectionHealth, addConnection, removeConnection, findConnection, checkAllConnectionHealth, type Connection, type ConnectionRole, type ConnectionHealth, type ConnectionStatus, } from './connections.js';
|
|
11
|
+
export { matchPattern, findRedirectRule, resolveRedirect, resolveOperationRedirect, type RedirectOperation, type RedirectRule, type RedirectResult, } from './redirects.js';
|
|
12
|
+
export { evaluateConditions, findConditionalRedirectRule, type RedirectCondition, type ConditionalRedirectRule, type RedirectContext, } from './conditional-redirects.js';
|
|
13
|
+
export { worktreeSetup, worktreeTeardown, registerWorktree, unregisterWorktree, findWorktree, listWorktrees, readWorktreeRegistry, writeWorktreeRegistry, getGitCommonDir, getCurrentBranch, getRegistryPath, type WorktreeEntry, type WorktreeRegistry, type WorktreeSetupOptions, type WorktreeTeardownOptions, } from './worktree.js';
|
|
14
|
+
export { mergeJsonl, parseJsonlToMap, writeJsonlFromMap, fieldLevelMerge, deepEqual, installMergeDriver, } from './merge-driver.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,EACf,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGrE,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core utilities for OpenTasks
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
// ID generation
|
|
7
|
+
export { generateId, generateIdFromUuid, typePrefix, adaptiveLength, hexToBase36, parseIdPrefix, inferTypeFromId, } from './id.js';
|
|
8
|
+
// Content hashing
|
|
9
|
+
export { sha256, computeContentHash, contentEqual } from './hash.js';
|
|
10
|
+
// Location identity (Phase 2)
|
|
11
|
+
export { generateLocationHash, generateLocationHashFallback, generateLocationIdentity, getGitRemoteUrl, getGitRoot, isValidLocationHash, } from './location.js';
|
|
12
|
+
// URI scheme (Phase 2)
|
|
13
|
+
export { parseOpentasksUri, resolveLocationTarget, resolveOpentasksUri, isOpentasksUri, buildOpentasksUri, buildLocalUri, } from './uri.js';
|
|
14
|
+
// Connections (Phase 2)
|
|
15
|
+
export { createConnection, checkConnectionHealth, addConnection, removeConnection, findConnection, checkAllConnectionHealth, } from './connections.js';
|
|
16
|
+
// Redirects (Phase 2)
|
|
17
|
+
export { matchPattern, findRedirectRule, resolveRedirect, resolveOperationRedirect, } from './redirects.js';
|
|
18
|
+
// Conditional Redirects (Phase 3)
|
|
19
|
+
export { evaluateConditions, findConditionalRedirectRule, } from './conditional-redirects.js';
|
|
20
|
+
// Worktree Management (Phase 3)
|
|
21
|
+
export { worktreeSetup, worktreeTeardown, registerWorktree, unregisterWorktree, findWorktree, listWorktrees, readWorktreeRegistry, writeWorktreeRegistry, getGitCommonDir, getCurrentBranch, getRegistryPath, } from './worktree.js';
|
|
22
|
+
// Merge Driver (Phase 3)
|
|
23
|
+
export { mergeJsonl, parseJsonlToMap, writeJsonlFromMap, fieldLevelMerge, deepEqual, installMergeDriver, } from './merge-driver.js';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,GAGhB,MAAM,SAAS,CAAC;AAEjB,kBAAkB;AAClB,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErE,8BAA8B;AAC9B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,UAAU,EACV,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,uBAAuB;AACvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,GAId,MAAM,UAAU,CAAC;AAElB,wBAAwB;AACxB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GAKzB,MAAM,kBAAkB,CAAC;AAE1B,sBAAsB;AACtB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,GAIzB,MAAM,gBAAgB,CAAC;AAExB,kCAAkC;AAClC,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAI5B,MAAM,4BAA4B,CAAC;AAEpC,gCAAgC;AAChC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAKhB,MAAM,eAAe,CAAC;AAEvB,yBAAyB;AACzB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Identity for OpenTasks (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* Generates deterministic location hashes from git remote URL + path.
|
|
5
|
+
* Used for cross-location references in opentasks:// URIs.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Location identity stored in config.json
|
|
9
|
+
*/
|
|
10
|
+
export interface LocationIdentity {
|
|
11
|
+
/** 8-char base36 hash (deterministic from git remote + path) */
|
|
12
|
+
hash: string;
|
|
13
|
+
/** UUID v4 (uniqueness guarantee) */
|
|
14
|
+
uuid: string;
|
|
15
|
+
/** Human-readable name */
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the git remote URL for a repository
|
|
20
|
+
*
|
|
21
|
+
* @param repoRoot - Path to the repository root
|
|
22
|
+
* @returns The remote URL or null if no remote is configured
|
|
23
|
+
*/
|
|
24
|
+
export declare function getGitRemoteUrl(repoRoot: string): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get the git repository root directory
|
|
27
|
+
*
|
|
28
|
+
* @param cwd - Working directory to start from
|
|
29
|
+
* @returns The repository root or null if not in a git repo
|
|
30
|
+
*/
|
|
31
|
+
export declare function getGitRoot(cwd: string): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Generate a deterministic location hash from git remote URL and relative path
|
|
34
|
+
*
|
|
35
|
+
* The hash is stable across machines for the same repo + path combination.
|
|
36
|
+
*
|
|
37
|
+
* @param remoteUrl - Git remote URL (e.g., "git@github.com:user/repo.git")
|
|
38
|
+
* @param relativePath - Path relative to repo root (e.g., "." or "packages/app")
|
|
39
|
+
* @returns 8-character base36 hash
|
|
40
|
+
*/
|
|
41
|
+
export declare function generateLocationHash(remoteUrl: string, relativePath: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Generate a fallback location hash from an absolute path
|
|
44
|
+
*
|
|
45
|
+
* Used when the repository has no remote configured.
|
|
46
|
+
* NOT stable across machines.
|
|
47
|
+
*
|
|
48
|
+
* @param absolutePath - Absolute path to the .opentasks directory
|
|
49
|
+
* @returns 8-character base36 hash
|
|
50
|
+
*/
|
|
51
|
+
export declare function generateLocationHashFallback(absolutePath: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Generate a complete location identity
|
|
54
|
+
*
|
|
55
|
+
* Attempts deterministic hash from git remote URL first,
|
|
56
|
+
* falls back to absolute path hash if no remote is available.
|
|
57
|
+
*
|
|
58
|
+
* @param opentasksDir - Path to the .opentasks directory
|
|
59
|
+
* @param name - Optional human-readable name (defaults to directory name)
|
|
60
|
+
* @returns Location identity object
|
|
61
|
+
*/
|
|
62
|
+
export declare function generateLocationIdentity(opentasksDir: string, name?: string): LocationIdentity;
|
|
63
|
+
/**
|
|
64
|
+
* Validate a location hash format
|
|
65
|
+
*
|
|
66
|
+
* @param hash - The hash to validate
|
|
67
|
+
* @returns true if the hash is a valid 8-char base36 string
|
|
68
|
+
*/
|
|
69
|
+
export declare function isValidLocationHash(hash: string): boolean;
|
|
70
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/core/location.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW/D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CA0B9F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Identity for OpenTasks (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* Generates deterministic location hashes from git remote URL + path.
|
|
5
|
+
* Used for cross-location references in opentasks:// URIs.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
8
|
+
import { execSync } from 'node:child_process';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { hexToBase36 } from './id.js';
|
|
11
|
+
/**
|
|
12
|
+
* Get the git remote URL for a repository
|
|
13
|
+
*
|
|
14
|
+
* @param repoRoot - Path to the repository root
|
|
15
|
+
* @returns The remote URL or null if no remote is configured
|
|
16
|
+
*/
|
|
17
|
+
export function getGitRemoteUrl(repoRoot) {
|
|
18
|
+
try {
|
|
19
|
+
const url = execSync('git remote get-url origin', {
|
|
20
|
+
cwd: repoRoot,
|
|
21
|
+
encoding: 'utf-8',
|
|
22
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
23
|
+
}).trim();
|
|
24
|
+
return url || null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the git repository root directory
|
|
32
|
+
*
|
|
33
|
+
* @param cwd - Working directory to start from
|
|
34
|
+
* @returns The repository root or null if not in a git repo
|
|
35
|
+
*/
|
|
36
|
+
export function getGitRoot(cwd) {
|
|
37
|
+
try {
|
|
38
|
+
const root = execSync('git rev-parse --show-toplevel', {
|
|
39
|
+
cwd,
|
|
40
|
+
encoding: 'utf-8',
|
|
41
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
42
|
+
}).trim();
|
|
43
|
+
return root || null;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generate a deterministic location hash from git remote URL and relative path
|
|
51
|
+
*
|
|
52
|
+
* The hash is stable across machines for the same repo + path combination.
|
|
53
|
+
*
|
|
54
|
+
* @param remoteUrl - Git remote URL (e.g., "git@github.com:user/repo.git")
|
|
55
|
+
* @param relativePath - Path relative to repo root (e.g., "." or "packages/app")
|
|
56
|
+
* @returns 8-character base36 hash
|
|
57
|
+
*/
|
|
58
|
+
export function generateLocationHash(remoteUrl, relativePath) {
|
|
59
|
+
const normalized = relativePath === '.' ? '' : relativePath;
|
|
60
|
+
const input = `${remoteUrl}:${normalized}`;
|
|
61
|
+
const hash = createHash('sha256').update(input).digest('hex');
|
|
62
|
+
return hexToBase36(hash).slice(0, 8);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Generate a fallback location hash from an absolute path
|
|
66
|
+
*
|
|
67
|
+
* Used when the repository has no remote configured.
|
|
68
|
+
* NOT stable across machines.
|
|
69
|
+
*
|
|
70
|
+
* @param absolutePath - Absolute path to the .opentasks directory
|
|
71
|
+
* @returns 8-character base36 hash
|
|
72
|
+
*/
|
|
73
|
+
export function generateLocationHashFallback(absolutePath) {
|
|
74
|
+
const hash = createHash('sha256').update(absolutePath).digest('hex');
|
|
75
|
+
return hexToBase36(hash).slice(0, 8);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Generate a complete location identity
|
|
79
|
+
*
|
|
80
|
+
* Attempts deterministic hash from git remote URL first,
|
|
81
|
+
* falls back to absolute path hash if no remote is available.
|
|
82
|
+
*
|
|
83
|
+
* @param opentasksDir - Path to the .opentasks directory
|
|
84
|
+
* @param name - Optional human-readable name (defaults to directory name)
|
|
85
|
+
* @returns Location identity object
|
|
86
|
+
*/
|
|
87
|
+
export function generateLocationIdentity(opentasksDir, name) {
|
|
88
|
+
const parentDir = path.dirname(opentasksDir);
|
|
89
|
+
const resolvedDir = path.resolve(parentDir);
|
|
90
|
+
const gitRoot = getGitRoot(resolvedDir);
|
|
91
|
+
let hash;
|
|
92
|
+
if (gitRoot) {
|
|
93
|
+
const remoteUrl = getGitRemoteUrl(gitRoot);
|
|
94
|
+
if (remoteUrl) {
|
|
95
|
+
const relativePath = path.relative(gitRoot, resolvedDir);
|
|
96
|
+
hash = generateLocationHash(remoteUrl, relativePath || '.');
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
hash = generateLocationHashFallback(path.resolve(opentasksDir));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
hash = generateLocationHashFallback(path.resolve(opentasksDir));
|
|
104
|
+
}
|
|
105
|
+
const locationName = name || path.basename(resolvedDir);
|
|
106
|
+
return {
|
|
107
|
+
hash,
|
|
108
|
+
uuid: randomUUID(),
|
|
109
|
+
name: locationName,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Validate a location hash format
|
|
114
|
+
*
|
|
115
|
+
* @param hash - The hash to validate
|
|
116
|
+
* @returns true if the hash is a valid 8-char base36 string
|
|
117
|
+
*/
|
|
118
|
+
export function isValidLocationHash(hash) {
|
|
119
|
+
return /^[a-z0-9]{8}$/.test(hash);
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/core/location.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AActC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,QAAQ,CAAC,2BAA2B,EAAE;YAChD,GAAG,EAAE,QAAQ;YACb,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,GAAG,IAAI,IAAI,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED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G,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAExC,IAAI,IAAY,CAAC;IAEjB,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YACzD,IAAI,GAAG,oBAAoB,CAAC,SAAS,EAAE,YAAY,IAAI,GAAG,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAExD,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU,EAAE;QAClB,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom JSONL Merge Driver for OpenTasks (Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Three-way merge for graph.jsonl files with field-level resolution.
|
|
5
|
+
* Registered as a git merge driver via .gitattributes.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A parsed JSONL line as a record
|
|
9
|
+
*/
|
|
10
|
+
type JsonLine = Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Parse a JSONL file into a Map keyed by ID
|
|
13
|
+
*
|
|
14
|
+
* For entries with the same ID, keeps the one with the latest updated_at.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseJsonlToMap(filePath: string): Map<string, JsonLine>;
|
|
17
|
+
/**
|
|
18
|
+
* Write a map of entries back to a JSONL file
|
|
19
|
+
*/
|
|
20
|
+
export declare function writeJsonlFromMap(filePath: string, entries: Map<string, JsonLine>): void;
|
|
21
|
+
/**
|
|
22
|
+
* Deep equality check for JSON values
|
|
23
|
+
*/
|
|
24
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Field-level three-way merge
|
|
27
|
+
*
|
|
28
|
+
* For each field:
|
|
29
|
+
* - Both sides agree → use that value
|
|
30
|
+
* - Only one side changed → use the changed value
|
|
31
|
+
* - Both changed differently → last-writer-wins by updated_at
|
|
32
|
+
*/
|
|
33
|
+
export declare function fieldLevelMerge(base: JsonLine, ours: JsonLine, theirs: JsonLine): JsonLine;
|
|
34
|
+
/**
|
|
35
|
+
* Three-way merge of JSONL files
|
|
36
|
+
*
|
|
37
|
+
* @param basePath - Base version (common ancestor)
|
|
38
|
+
* @param oursPath - Our version (current branch)
|
|
39
|
+
* @param theirsPath - Their version (merging branch)
|
|
40
|
+
* @returns 0 on success, 1 on conflict (should not happen with this algorithm)
|
|
41
|
+
*/
|
|
42
|
+
export declare function mergeJsonl(basePath: string, oursPath: string, theirsPath: string): number;
|
|
43
|
+
/**
|
|
44
|
+
* Install the merge driver in git config and .gitattributes
|
|
45
|
+
*
|
|
46
|
+
* @param worktreePath - Path to the worktree root
|
|
47
|
+
*/
|
|
48
|
+
export declare function installMergeDriver(worktreePath: string): void;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=merge-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-driver.d.ts","sourceRoot":"","sources":["../../src/core/merge-driver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CA6BvE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAoBxF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAsBzD;AAWD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAmD1F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CA0DzF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CA6B7D"}
|