@gitkraken/core-gitlens 0.37.1 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/dist/git/cache.d.ts +128 -8
  3. package/dist/git/cache.js +425 -46
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/features.d.ts +1 -1
  6. package/dist/git/features.js +3 -0
  7. package/dist/git/features.js.map +1 -1
  8. package/dist/git/providers/branches.d.ts +42 -1
  9. package/dist/git/providers/diff.d.ts +17 -0
  10. package/dist/git/providers/provider.d.ts +7 -0
  11. package/dist/git/providers/shared/remotes.js +8 -4
  12. package/dist/git/providers/shared/remotes.js.map +1 -1
  13. package/dist/git/remotes/matcher.js +2 -2
  14. package/dist/git/remotes/matcher.js.map +1 -1
  15. package/dist/git/repositoryService.d.ts +16 -1
  16. package/dist/git/repositoryService.js +51 -3
  17. package/dist/git/repositoryService.js.map +1 -1
  18. package/dist/git/run.types.d.ts +1 -0
  19. package/dist/git/service.js +6 -2
  20. package/dist/git/service.js.map +1 -1
  21. package/dist/git/utils/fileStatus.utils.d.ts +5 -0
  22. package/dist/git/utils/fileStatus.utils.js +18 -1
  23. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  24. package/dist/git/watching/changeEvent.d.ts +13 -3
  25. package/dist/git/watching/changeEvent.js +15 -4
  26. package/dist/git/watching/changeEvent.js.map +1 -1
  27. package/dist/git/watching/changeOrdinal.d.ts +9 -0
  28. package/dist/git/watching/changeOrdinal.js +14 -0
  29. package/dist/git/watching/changeOrdinal.js.map +1 -0
  30. package/dist/git/watching/unwatchedCacheValidator.d.ts +38 -5
  31. package/dist/git/watching/unwatchedCacheValidator.js +180 -36
  32. package/dist/git/watching/unwatchedCacheValidator.js.map +1 -1
  33. package/dist/git/watching/watchGroup.d.ts +63 -14
  34. package/dist/git/watching/watchGroup.js +213 -74
  35. package/dist/git/watching/watchGroup.js.map +1 -1
  36. package/dist/git/watching/watchService.js +4 -3
  37. package/dist/git/watching/watchService.js.map +1 -1
  38. package/dist/git/watching/watchSession.d.ts +10 -2
  39. package/dist/git/watching/watchSession.js +18 -4
  40. package/dist/git/watching/watchSession.js.map +1 -1
  41. package/dist/git/watching/watcherPatterns.d.ts +18 -4
  42. package/dist/git/watching/watcherPatterns.js +39 -8
  43. package/dist/git/watching/watcherPatterns.js.map +1 -1
  44. package/dist/git/watching/worktreeSummary.d.ts +23 -12
  45. package/dist/git/watching/worktreeSummary.js +164 -41
  46. package/dist/git/watching/worktreeSummary.js.map +1 -1
  47. package/dist/git-cli/cliGitProvider.d.ts +1 -0
  48. package/dist/git-cli/cliGitProvider.js +11 -2
  49. package/dist/git-cli/cliGitProvider.js.map +1 -1
  50. package/dist/git-cli/exec/git.d.ts +7 -2
  51. package/dist/git-cli/exec/git.js +46 -10
  52. package/dist/git-cli/exec/git.js.map +1 -1
  53. package/dist/git-cli/exec/headState.d.ts +24 -0
  54. package/dist/git-cli/exec/headState.js +46 -6
  55. package/dist/git-cli/exec/headState.js.map +1 -1
  56. package/dist/git-cli/parsers/logParser.js +6 -3
  57. package/dist/git-cli/parsers/logParser.js.map +1 -1
  58. package/dist/git-cli/providers/branches.d.ts +135 -10
  59. package/dist/git-cli/providers/branches.js +622 -80
  60. package/dist/git-cli/providers/branches.js.map +1 -1
  61. package/dist/git-cli/providers/commits.d.ts +16 -0
  62. package/dist/git-cli/providers/commits.js +80 -28
  63. package/dist/git-cli/providers/commits.js.map +1 -1
  64. package/dist/git-cli/providers/config.d.ts +10 -0
  65. package/dist/git-cli/providers/config.js +50 -12
  66. package/dist/git-cli/providers/config.js.map +1 -1
  67. package/dist/git-cli/providers/contributors.js +11 -7
  68. package/dist/git-cli/providers/contributors.js.map +1 -1
  69. package/dist/git-cli/providers/diff.d.ts +12 -0
  70. package/dist/git-cli/providers/diff.js +107 -15
  71. package/dist/git-cli/providers/diff.js.map +1 -1
  72. package/dist/git-cli/providers/graph.js +32 -25
  73. package/dist/git-cli/providers/graph.js.map +1 -1
  74. package/dist/git-cli/providers/operations.d.ts +37 -3
  75. package/dist/git-cli/providers/operations.js +124 -46
  76. package/dist/git-cli/providers/operations.js.map +1 -1
  77. package/dist/git-cli/providers/patch.js +1 -1
  78. package/dist/git-cli/providers/patch.js.map +1 -1
  79. package/dist/git-cli/providers/refs.d.ts +1 -1
  80. package/dist/git-cli/providers/refs.js +10 -11
  81. package/dist/git-cli/providers/refs.js.map +1 -1
  82. package/dist/git-cli/providers/status.d.ts +4 -5
  83. package/dist/git-cli/providers/status.js +36 -33
  84. package/dist/git-cli/providers/status.js.map +1 -1
  85. package/dist/git-cli/providers/tags.d.ts +8 -0
  86. package/dist/git-cli/providers/tags.js +53 -34
  87. package/dist/git-cli/providers/tags.js.map +1 -1
  88. package/dist/git-cli/service.d.ts +15 -0
  89. package/dist/git-cli/service.js +19 -1
  90. package/dist/git-cli/service.js.map +1 -1
  91. package/dist/plus/git-github/providers/github/diff.d.ts +1 -0
  92. package/dist/plus/git-github/providers/github/diff.js +6 -1
  93. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  94. package/dist/plus/integrations/integrationService.js +9 -0
  95. package/dist/plus/integrations/integrationService.js.map +1 -1
  96. package/dist/plus/integrations/providers/jira-server.js +1 -1
  97. package/dist/plus/integrations/providers/jira-server.js.map +1 -1
  98. package/dist/plus/integrations/providers/jira.d.ts +20 -9
  99. package/dist/plus/integrations/providers/jira.js +114 -99
  100. package/dist/plus/integrations/providers/jira.js.map +1 -1
  101. package/dist/plus/integrations/providers/linear.d.ts +11 -4
  102. package/dist/plus/integrations/providers/linear.js +75 -32
  103. package/dist/plus/integrations/providers/linear.js.map +1 -1
  104. package/dist/plus/integrations/providers/utils/discoveryCache.d.ts +35 -4
  105. package/dist/plus/integrations/providers/utils/discoveryCache.js +45 -11
  106. package/dist/plus/integrations/providers/utils/discoveryCache.js.map +1 -1
  107. package/dist/utils/env/node/exec.d.ts +8 -4
  108. package/dist/utils/env/node/exec.js +115 -9
  109. package/dist/utils/env/node/exec.js.map +1 -1
  110. package/dist/utils/holdOffMap.d.ts +23 -0
  111. package/dist/utils/holdOffMap.js +43 -0
  112. package/dist/utils/holdOffMap.js.map +1 -0
  113. package/dist/utils/promiseCache.d.ts +15 -2
  114. package/dist/utils/promiseCache.js +34 -4
  115. package/dist/utils/promiseCache.js.map +1 -1
  116. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"promiseCache.js","names":[],"sources":["../../../utils/src/promiseCache.ts"],"sourcesContent":["import { AbortAggregate, CancellationError, raceWithSignal } from './cancellation.js';\n\n/** Deletes `key` from `map` only if it still maps to `owner`. A `delete(key)` + fresh `getOrCreate` can install\n * a successor under the same key while our factory is in flight; our late settle must not evict the successor. */\nfunction deleteIfOwned<K, V>(map: Map<K, V>, key: K, owner: V): void {\n\tif (map.get(key) === owner) {\n\t\tmap.delete(key);\n\t}\n}\n\ninterface CacheEntry<V> {\n\tpromise: Promise<V>;\n\taccessed: number;\n\tcreated: number;\n\n\tcreateTTL: number | undefined;\n\taccessTTL: number | undefined;\n}\n\nexport class CacheController {\n\t#invalidated = false;\n\tget invalidated(): boolean {\n\t\treturn this.#invalidated;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.#invalidated = true;\n\t}\n}\n\ninterface PromiseCacheOptions {\n\t/** TTL (time-to-live) in milliseconds since creation */\n\tcreateTTL?: number;\n\t/** TTL (time-to-live) in milliseconds since last access */\n\taccessTTL?: number;\n\t/** Whether to expire the entry if the promise fails (default: true) */\n\texpireOnError?: boolean;\n\t/**\n\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t * Only used when `onError` is not provided. Mutually exclusive with `expireOnError`.\n\t */\n\terrorTTL?: number;\n\t/** Maximum number of entries in the cache (LRU eviction when exceeded) */\n\tcapacity?: number;\n}\n\nexport class PromiseCache<K, V> {\n\tprivate readonly cache = new Map<K, CacheEntry<V>>();\n\tprivate readonly aborts = new Map<K, AbortAggregate>();\n\tprivate readonly controllers = new Map<K, CacheController>();\n\tprivate readonly options: PromiseCacheOptions;\n\n\tconstructor(options?: PromiseCacheOptions) {\n\t\tthis.options = { expireOnError: true, ...options };\n\t}\n\n\t/** Clears all entries. Like `delete`, does NOT dispose in-flight abort aggregates — that would detach a running\n\t * op's cancellation (a later caller-abort couldn't cancel it); each factory's settle handler disposes its own. */\n\tclear(): void {\n\t\tthis.aborts.clear();\n\t\tthis.controllers.clear();\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Removes a promise from the cache.\n\t * Does NOT dispose the abort aggregate: while a factory is in flight, disposing would detach\n\t * its callers' cancellation and orphan the underlying op (a later caller-abort could no longer cancel the\n\t * running `git status`). The factory's own settle handler disposes the aggregate (see `getOrCreate`). */\n\tdelete(key: K): void {\n\t\tthis.aborts.delete(key);\n\t\tthis.controllers.delete(key);\n\t\tthis.cache.delete(key);\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated.\n\t * - If the entry has a `CacheController` (created via `getOrCreate`), it is soft-invalidated:\n\t * existing waiters complete normally, new callers joining during the remainder of the\n\t * in-flight operation share the same promise, and the entry self-evicts on settle.\n\t * - If the entry was set via plain `.set()` (no controller), it is hard-deleted — there is\n\t * no in-flight factory to ride along with.\n\t *\n\t * No-op if the key is not cached.\n\t */\n\tinvalidate(key: K): void {\n\t\tif (this.controllers.has(key)) {\n\t\t\tthis.controllers.get(key)!.invalidate();\n\t\t} else {\n\t\t\tthis.delete(key);\n\t\t}\n\t}\n\n\tkeys(): IterableIterator<K> {\n\t\treturn this.cache.keys();\n\t}\n\n\t/**\n\t * Returns the number of entries in the cache, including expired entries that haven't been evicted yet\n\t * (they are only evicted on access), so this reflects what's actually retained in memory.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it and updates accessed time\n\t * @param key - The cache key\n\t * @returns The cached promise, or undefined if not cached or expired\n\t */\n\tget(key: K): Promise<V> | undefined {\n\t\tconst now = Date.now();\n\t\tconst entry = this.cache.get(key);\n\t\tif (entry == null || this.expired(entry, now)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Update accessed time\n\t\tentry.accessed = now;\n\t\treturn entry.promise;\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t *\n\t * When `cancellation` is provided:\n\t * - The factory receives an aggregate `AbortSignal` that only fires when **all** callers cancel\n\t * - The returned promise rejects with `CancellationError` if this caller's signal fires\n\t * - Other callers sharing the same cached promise are unaffected\n\t *\n\t * @param key - The cache key\n\t * @param factory - Factory function to create the value if not cached\n\t * @param cancellation - Optional per-caller AbortSignal\n\t * @param options - Optional TTL and error handling options that override the defaults\n\t */\n\tasync getOrCreate(\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\toptions?: {\n\t\t\t/** Per-caller AbortSignal — the factory receives an aggregate signal that only fires when all callers cancel */\n\t\t\tcancellation?: AbortSignal;\n\t\t\t/** TTL (time-to-live) in milliseconds since creation */\n\t\t\tcreateTTL?: number;\n\t\t\t/** TTL (time-to-live) in milliseconds since last access */\n\t\t\taccessTTL?: number;\n\t\t\t/** Whether to expire the entry if the promise fails */\n\t\t\texpireOnError?: boolean;\n\t\t\t/**\n\t\t\t * Called after the factory resolves. If the predicate resolves to true, the entry is evicted while\n\t\t\t * the current caller still receives the resolved value.\n\t\t\t */\n\t\t\tevictWhen?: (value: V) => boolean | Promise<boolean>;\n\t\t\t/**\n\t\t\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t\t\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t\t\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t\t\t * Only used when `onError` is not provided.\n\t\t\t */\n\t\t\terrorTTL?: number;\n\t\t\t/**\n\t\t\t * Called when the factory promise rejects. Return a fallback result to cache\n\t\t\t * instead of expiring. The fallback value is cached with the specified `createTTL`\n\t\t\t * (defaults to the cache's `createTTL`). By default, the error is re-thrown to the\n\t\t\t * first caller after caching the fallback. Set `suppress: true` to return the fallback\n\t\t\t * value to the first caller instead. Return `undefined` to expire normally and re-throw.\n\t\t\t */\n\t\t\tonError?: (error: unknown) => { value: V; createTTL?: number; suppress?: boolean } | undefined;\n\t\t},\n\t): Promise<V> {\n\t\tconst cancellation = options?.cancellation;\n\t\tif (cancellation?.aborted) return Promise.reject(new CancellationError());\n\n\t\tconst now = Date.now();\n\n\t\toptions = { ...this.options, ...options };\n\n\t\tlet entry = this.cache.get(key);\n\t\tif (entry != null && !this.expired(entry, now)) {\n\t\t\t// Cache hit — but don't join an entry whose aggregate has already permanently aborted (all prior\n\t\t\t// callers cancelled, so the shared run is failing): that would hand this caller a doomed promise.\n\t\t\t// Fall through to create a fresh entry; the doomed entry's late settle is `deleteIfOwned`-guarded.\n\t\t\tconst existingAborts = this.aborts.get(key);\n\t\t\tif (existingAborts == null || !existingAborts.signal.aborted) {\n\t\t\t\tentry.accessed = now;\n\t\t\t\tconst cleanup = existingAborts != null ? existingAborts.add(cancellation) : undefined;\n\t\t\t\treturn this.attachCallerLifecycle(entry.promise, cancellation, cleanup);\n\t\t\t}\n\t\t}\n\n\t\tconst cacheable = new CacheController();\n\t\t// Always create the aggregate so subsequent callers (with or without signals) can contribute,\n\t\t// and so delete/invalidate has a controller to interact with\n\t\tconst abortAgg = new AbortAggregate();\n\t\tconst cleanup = abortAgg.add(cancellation);\n\t\tthis.aborts.set(key, abortAgg);\n\t\tthis.controllers.set(key, cacheable);\n\n\t\tconst promise = factory(cacheable, abortAgg.signal);\n\t\tvoid promise\n\t\t\t.finally(() => {\n\t\t\t\t// All three deletes are ownership-guarded — a hard `delete(key)` + fresh `getOrCreate` while our\n\t\t\t\t// factory is in flight installs a successor under `key`; our late settle must not evict it.\n\t\t\t\tif (cacheable.invalidated) {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, entry!);\n\t\t\t\t}\n\t\t\t\tabortAgg.dispose();\n\t\t\t\tdeleteIfOwned(this.aborts, key, abortAgg);\n\t\t\t\tdeleteIfOwned(this.controllers, key, cacheable);\n\t\t\t})\n\t\t\t// Swallow the cleanup chain's rejection so it doesn't surface as an unhandled rejection\n\t\t\t// separate from the caller-facing promise's own handling (e.g. on cancellation).\n\t\t\t.catch(() => {});\n\n\t\tif (options?.onError != null) {\n\t\t\t// Wrap the promise to handle errors with the onError callback\n\t\t\tconst errorHandled = promise.catch((ex: unknown) => {\n\t\t\t\tconst result = options.onError!(ex);\n\t\t\t\t// A hard `delete(key)` + fresh `getOrCreate` while we were in flight installs a successor;\n\t\t\t\t// don't clobber it. But an EMPTY key (our entry already evicted, e.g. by the invalidated-finally)\n\t\t\t\t// still takes the fallback — preserving base behavior of caching the error fallback.\n\t\t\t\tconst occupant = this.cache.get(key);\n\t\t\t\tconst clobbersSuccessor = occupant != null && occupant !== entry;\n\t\t\t\tif (result != null) {\n\t\t\t\t\t// Replace the entry with a resolved fallback value for subsequent callers\n\t\t\t\t\tif (!clobbersSuccessor) {\n\t\t\t\t\t\tconst errorNow = Date.now();\n\t\t\t\t\t\tthis.cache.set(key, {\n\t\t\t\t\t\t\tpromise: Promise.resolve(result.value),\n\t\t\t\t\t\t\tcreated: errorNow,\n\t\t\t\t\t\t\taccessed: errorNow,\n\t\t\t\t\t\t\tcreateTTL: result.createTTL ?? options.createTTL,\n\t\t\t\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// suppress: return fallback to first caller; otherwise re-throw\n\t\t\t\t\tif (result.suppress) return result.value;\n\t\t\t\t} else {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, entry!);\n\t\t\t\t}\n\t\t\t\tthrow ex;\n\t\t\t});\n\n\t\t\tentry = {\n\t\t\t\tpromise: errorHandled,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\t\t} else if (options?.errorTTL != null) {\n\t\t\t// Cache resolved undefined for subsequent callers, re-throw to first caller\n\t\t\tconst errorTTL = options.errorTTL;\n\t\t\tconst errorHandled = promise.catch((ex: unknown) => {\n\t\t\t\t// Overwrite unless a successor now owns the key (empty key still takes it — see onError above).\n\t\t\t\tconst occupant = this.cache.get(key);\n\t\t\t\tif (occupant == null || occupant === entry) {\n\t\t\t\t\tconst errorNow = Date.now();\n\t\t\t\t\tthis.cache.set(key, {\n\t\t\t\t\t\tpromise: Promise.resolve(undefined as V),\n\t\t\t\t\t\tcreated: errorNow,\n\t\t\t\t\t\taccessed: errorNow,\n\t\t\t\t\t\tcreateTTL: errorTTL,\n\t\t\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow ex;\n\t\t\t});\n\n\t\t\tentry = {\n\t\t\t\tpromise: errorHandled,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\t\t} else {\n\t\t\tentry = {\n\t\t\t\tpromise: promise,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\n\t\t\tif (options?.expireOnError ?? true) {\n\t\t\t\t// Ownership-guarded: a hard `delete(key)` + fresh `getOrCreate` replacing us while in flight must\n\t\t\t\t// not have its entry evicted by our rejection.\n\t\t\t\tconst ourEntry = entry;\n\t\t\t\tpromise.catch(() => deleteIfOwned(this.cache, key, ourEntry));\n\t\t\t}\n\t\t}\n\n\t\tconst evictWhen = options?.evictWhen;\n\t\tif (evictWhen != null) {\n\t\t\tconst candidate = entry;\n\t\t\tvoid candidate.promise\n\t\t\t\t.then(value => evictWhen(value))\n\t\t\t\t.then(evict => {\n\t\t\t\t\tif (evict) {\n\t\t\t\t\t\tdeleteIfOwned(this.cache, key, candidate);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t// A retention policy must not surface a rejection independently of the caller-facing operation.\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\t// Clean up expired entries and enforce capacity limit in one pass\n\t\tif (this.cache.size > 1) {\n\t\t\tqueueMicrotask(() => this.cleanup());\n\t\t}\n\n\t\treturn this.attachCallerLifecycle(entry.promise, cancellation, cleanup);\n\t}\n\n\tprivate attachCallerLifecycle(\n\t\tpromise: Promise<V>,\n\t\tcancellation: AbortSignal | undefined,\n\t\tcleanup: (() => void) | undefined,\n\t): Promise<V> {\n\t\tconst returned = cancellation != null ? raceWithSignal(promise, cancellation) : promise;\n\t\tif (cleanup != null) {\n\t\t\t// Release this caller's aggregate slot when their wait ends.\n\t\t\t// Attach .catch to swallow any rejection in the cleanup chain so it doesn't surface\n\t\t\t// as an unhandled rejection separate from the caller's own handling of `returned`.\n\t\t\tvoid returned.finally(cleanup).catch(() => {});\n\t\t}\n\t\treturn returned;\n\t}\n\n\tprivate cleanup(): void {\n\t\tconst now = Date.now();\n\t\tconst capacity = this.options.capacity;\n\n\t\t// If no capacity limit, just remove expired entries\n\t\tif (capacity == null) {\n\t\t\tfor (const [key, entry] of this.cache.entries()) {\n\t\t\t\tif (this.expired(entry, now)) {\n\t\t\t\t\tthis.cache.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Single pass: collect non-expired entries and find LRU candidates\n\t\tconst entries: Array<[K, CacheEntry<V>]> = [];\n\t\tfor (const [key, entry] of this.cache.entries()) {\n\t\t\tif (!this.expired(entry, now)) {\n\t\t\t\tentries.push([key, entry]);\n\t\t\t} else {\n\t\t\t\tthis.cache.delete(key);\n\t\t\t}\n\t\t}\n\n\t\t// If still over capacity, remove LRU entries\n\t\tconst excess = entries.length - capacity;\n\t\tif (excess > 0) {\n\t\t\t// Sort by accessed time (oldest first) and remove the excess\n\t\t\t// Note: O(N log N) sort — acceptable at current cache sizes; replace with a linked-list LRU if capacity grows\n\t\t\tentries.sort((a, b) => a[1].accessed - b[1].accessed);\n\t\t\tfor (let i = 0; i < excess; i++) {\n\t\t\t\tthis.cache.delete(entries[i][0]);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate expired(entry: CacheEntry<V>, now: number): boolean {\n\t\treturn (\n\t\t\t(entry.createTTL != null && now - entry.created >= entry.createTTL) ||\n\t\t\t(entry.accessTTL != null && now - entry.accessed >= entry.accessTTL)\n\t\t);\n\t}\n\n\t/**\n\t * Sets a promise in the cache.\n\t * The promise will use the default options from the cache constructor, unless overridden.\n\t *\n\t * @param key - The cache key\n\t * @param promise - The promise to cache\n\t * @param options - Optional TTL options that override the defaults\n\t */\n\tset(key: K, promise: Promise<V>, options?: { accessTTL?: number; createTTL?: number }): void {\n\t\tconst now = Date.now();\n\t\tconst entry: CacheEntry<V> = {\n\t\t\tpromise: promise,\n\t\t\tcreated: now,\n\t\t\taccessed: now,\n\t\t\tcreateTTL: options?.createTTL ?? this.options.createTTL,\n\t\t\taccessTTL: options?.accessTTL ?? this.options.accessTTL,\n\t\t};\n\t\tthis.cache.set(key, entry);\n\n\t\tif (this.options.expireOnError ?? true) {\n\t\t\tpromise.catch(() => deleteIfOwned(this.cache, key, entry));\n\t\t}\n\t}\n}\n\n/**\n * A Map-like wrapper for promises that automatically removes failed promises from the cache.\n * This provides a drop-in replacement for Map<K, Promise<V>> with automatic error cleanup.\n */\nexport class PromiseMap<K, V> {\n\tprivate readonly cache = new Map<K, Promise<V>>();\n\tprivate readonly aborts = new Map<K, AbortAggregate>();\n\tprivate readonly controllers = new Map<K, CacheController>();\n\t/** Each cached promise's value once it fulfills, for {@link getSettled} */\n\tprivate readonly settled = new WeakMap<Promise<V>, { value: V }>();\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'PromiseMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Failed promises are automatically removed from the cache.\n\t *\n\t * When `cancellation` is provided:\n\t * - The factory receives an aggregate `AbortSignal` that only fires when **all** callers cancel\n\t * - The returned promise rejects with `CancellationError` if this caller's signal fires\n\t * - Other callers sharing the same cached promise are unaffected\n\t *\n\t * Callers without a `cancellation` signal count as \"permanent\" subscribers — the aggregate\n\t * cannot fire while at least one is active. The slot is released when the caller's returned\n\t * promise settles.\n\t */\n\tgetOrCreate(\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\tcancellation?: AbortSignal,\n\t): Promise<V> {\n\t\tif (cancellation?.aborted) return Promise.reject(new CancellationError());\n\n\t\tconst cached = this.cache.get(key);\n\t\tif (cached != null) {\n\t\t\t// Cache hit — but don't join an entry whose aggregate has already permanently aborted (all prior\n\t\t\t// callers cancelled, so the shared run is failing): joining hands this caller a doomed promise.\n\t\t\t// Fall through to a fresh entry; the doomed entry's late settle is `deleteIfOwned`-guarded.\n\t\t\tconst existingAborts = this.aborts.get(key);\n\t\t\tif (existingAborts == null || !existingAborts.signal.aborted) {\n\t\t\t\tconst cleanup = existingAborts != null ? existingAborts.add(cancellation) : undefined;\n\t\t\t\treturn this.attachCallerLifecycle(cached, cancellation, cleanup);\n\t\t\t}\n\t\t}\n\n\t\t// Cache miss — always create the aggregate so subsequent callers (with or without signals)\n\t\t// can contribute, and so delete/invalidate has a controller to interact with\n\t\tconst cacheable = new CacheController();\n\t\tconst aborts = new AbortAggregate();\n\t\tconst cleanup = aborts.add(cancellation);\n\t\tthis.aborts.set(key, aborts);\n\t\tthis.controllers.set(key, cacheable);\n\n\t\tconst promise = factory(cacheable, aborts.signal);\n\t\tthis.track(key, promise);\n\t\tvoid promise\n\t\t\t.finally(() => {\n\t\t\t\tif (cacheable.invalidated) {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, promise);\n\t\t\t\t}\n\t\t\t\taborts.dispose();\n\t\t\t\tdeleteIfOwned(this.aborts, key, aborts);\n\t\t\t\tdeleteIfOwned(this.controllers, key, cacheable);\n\t\t\t})\n\t\t\t// Swallow the cleanup chain's rejection so it doesn't surface as an unhandled rejection\n\t\t\t// separate from the caller-facing promise's own handling (e.g. on cancellation).\n\t\t\t.catch(() => {});\n\n\t\tthis.cache.set(key, promise);\n\n\t\treturn this.attachCallerLifecycle(promise, cancellation, cleanup);\n\t}\n\n\tprivate attachCallerLifecycle(\n\t\tpromise: Promise<V>,\n\t\tcancellation: AbortSignal | undefined,\n\t\tcleanup: (() => void) | undefined,\n\t): Promise<V> {\n\t\tconst returned = cancellation != null ? raceWithSignal(promise, cancellation) : promise;\n\t\tif (cleanup != null) {\n\t\t\t// Release this caller's aggregate slot when their wait ends.\n\t\t\t// Attach .catch to swallow any rejection in the cleanup chain so it doesn't surface\n\t\t\t// as an unhandled rejection separate from the caller's own handling of `returned`.\n\t\t\tvoid returned.finally(cleanup).catch(() => {});\n\t\t}\n\t\treturn returned;\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated.\n\t * - If the entry has a `CacheController` (created via `getOrCreate`), it is soft-invalidated:\n\t * existing waiters complete normally, new callers joining during the remainder of the\n\t * in-flight operation share the same promise, and the entry self-evicts on settle.\n\t * - If the entry was set via plain `.set()` (no controller), it is hard-deleted — there is\n\t * no in-flight factory to ride along with.\n\t *\n\t * No-op if the key is not cached.\n\t */\n\tinvalidate(key: K): void {\n\t\tif (this.controllers.has(key)) {\n\t\t\tthis.controllers.get(key)!.invalidate();\n\t\t} else {\n\t\t\tthis.delete(key);\n\t\t}\n\t}\n\n\t/**\n\t * Gets a promise from the cache, or undefined if not found.\n\t */\n\tget(key: K): Promise<V> | undefined {\n\t\treturn this.cache.get(key);\n\t}\n\n\t/**\n\t * Sets a promise in the cache. The promise will be automatically removed if it fails.\n\t */\n\tset(key: K, promise: Promise<V>): this {\n\t\tthis.cache.set(key, promise);\n\t\tthis.track(key, promise);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * The value `key`'s cached promise fulfilled with, or `undefined` while it is pending (or nothing is cached), so a\n\t * caller can tell a settled entry from a read still in flight without joining it.\n\t */\n\tgetSettled(key: K): { value: V } | undefined {\n\t\tconst promise = this.cache.get(key);\n\t\treturn promise != null ? this.settled.get(promise) : undefined;\n\t}\n\n\tprivate track(key: K, promise: Promise<V>): void {\n\t\tpromise.then(\n\t\t\tvalue => {\n\t\t\t\tthis.settled.set(promise, { value: value });\n\t\t\t},\n\t\t\t// Automatically remove failed promises from the cache (ownership-guarded — see `deleteIfOwned`).\n\t\t\t() => deleteIfOwned(this.cache, key, promise),\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a key exists in the cache.\n\t */\n\thas(key: K): boolean {\n\t\treturn this.cache.has(key);\n\t}\n\n\t/**\n\t * Removes a key from the cache.\n\t * Does NOT dispose the abort aggregate: while a factory is in flight, disposing would detach\n\t * its callers' cancellation and orphan the underlying op (a later caller-abort could no longer cancel the\n\t * running `git status`). The factory's own settle handler disposes the aggregate (see `getOrCreate`). */\n\tdelete(key: K): boolean {\n\t\tthis.aborts.delete(key);\n\t\tthis.controllers.delete(key);\n\t\treturn this.cache.delete(key);\n\t}\n\n\t/**\n\t * Clears all entries. Like `delete`, does NOT dispose in-flight abort aggregates — that would detach a running\n\t * op's cancellation (a later caller-abort couldn't cancel it); each factory's settle handler disposes its own.\n\t */\n\tclear(): void {\n\t\tthis.aborts.clear();\n\t\tthis.controllers.clear();\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the number of entries in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n\n\t/**\n\t * Returns an iterator for the cache keys.\n\t */\n\tkeys(): IterableIterator<K> {\n\t\treturn this.cache.keys();\n\t}\n\n\t/**\n\t * Returns an iterator for the cache values.\n\t */\n\tvalues(): IterableIterator<Promise<V>> {\n\t\treturn this.cache.values();\n\t}\n\n\t/**\n\t * Returns an iterator for the cache entries.\n\t */\n\tentries(): IterableIterator<[K, Promise<V>]> {\n\t\treturn this.cache.entries();\n\t}\n\n\t/**\n\t * Executes a provided function once for each cache entry.\n\t */\n\tforEach(callbackfn: (value: Promise<V>, key: K, map: Map<K, Promise<V>>) => void, thisArg?: any): void {\n\t\tthis.cache.forEach(callbackfn, thisArg);\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, Promise<V>]> {\n\t\treturn this.cache[Symbol.iterator]();\n\t}\n}\n\n/**\n * A two-level cache that organizes PromiseCaches by repository path.\n * Automatically creates and manages inner PromiseCaches per repository.\n *\n * This is useful for caching data that varies by both repository and some other key,\n * with TTL and capacity management provided by PromiseCache.\n */\nexport class RepoPromiseCacheMap<K, V> {\n\tprivate readonly cache = new Map<string, PromiseCache<K, V>>();\n\tprivate readonly options: PromiseCacheOptions;\n\n\tconstructor(options?: PromiseCacheOptions) {\n\t\tthis.options = { expireOnError: true, ...options };\n\t}\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'RepoPromiseCacheMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Automatically creates the inner PromiseCache for the repository if it doesn't exist.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param factory - Factory function to create the value if not cached\n\t * @param options - Optional TTL and error handling options that override the defaults\n\t */\n\tgetOrCreate(\n\t\trepoPath: string,\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\toptions?: {\n\t\t\t/** Per-caller AbortSignal — the factory receives an aggregate signal that only fires when all callers cancel */\n\t\t\tcancellation?: AbortSignal;\n\t\t\t/** TTL (time-to-live) in milliseconds since creation */\n\t\t\tcreateTTL?: number;\n\t\t\t/** TTL (time-to-live) in milliseconds since last access */\n\t\t\taccessTTL?: number;\n\t\t\t/** Whether to expire the entry if the promise fails */\n\t\t\texpireOnError?: boolean;\n\t\t\t/**\n\t\t\t * Called after the factory resolves. If the predicate resolves to true, the entry is evicted while\n\t\t\t * the current caller still receives the resolved value.\n\t\t\t */\n\t\t\tevictWhen?: (value: V) => boolean | Promise<boolean>;\n\t\t\t/**\n\t\t\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t\t\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t\t\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t\t\t * Only used when `onError` is not provided.\n\t\t\t */\n\t\t\terrorTTL?: number;\n\t\t\t/**\n\t\t\t * Called when the factory promise rejects. Return a fallback result to cache\n\t\t\t * instead of expiring. The fallback value is cached with the specified `createTTL`\n\t\t\t * (defaults to the cache's `createTTL`). By default, the error is re-thrown to the\n\t\t\t * first caller after caching the fallback. Set `suppress: true` to return the fallback\n\t\t\t * value to the first caller instead. Return `undefined` to expire normally and re-throw.\n\t\t\t */\n\t\t\tonError?: (error: unknown) => { value: V; createTTL?: number; suppress?: boolean } | undefined;\n\t\t},\n\t): Promise<V> {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseCache<K, V>(this.options);\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\treturn repoCache.getOrCreate(key, factory, options);\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @returns The cached promise, or undefined if not cached\n\t */\n\tget(repoPath: string, key: K): Promise<V> | undefined {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return undefined;\n\n\t\treturn repoCache.get(key);\n\t}\n\n\t/**\n\t * Sets a promise in the cache.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param promise - The promise to cache\n\t * @param options - Optional TTL options that override the defaults\n\t */\n\tset(repoPath: string, key: K, promise: Promise<V>, options?: { accessTTL?: number; createTTL?: number }): void {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseCache<K, V>(this.options);\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\trepoCache.set(key, promise, options);\n\t}\n\n\t/**\n\t * Deletes a specific key from a repository's cache, or all keys for a repository.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to delete. If omitted, deletes the entire repository cache.\n\t * @returns true if something was deleted, false otherwise\n\t */\n\tdelete(repoPath: string, key?: K): boolean {\n\t\tif (key === undefined) {\n\t\t\treturn this.cache.delete(repoPath);\n\t\t}\n\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\trepoCache.delete(key);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated. See `PromiseCache.invalidate` for semantics.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to invalidate. If omitted, invalidates every entry for the repository.\n\t */\n\tinvalidate(repoPath: string, key?: K): void {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return;\n\n\t\tif (key === undefined) {\n\t\t\tfor (const k of repoCache.keys()) {\n\t\t\t\trepoCache.invalidate(k);\n\t\t\t}\n\t\t} else {\n\t\t\trepoCache.invalidate(key);\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all keys matching a prefix from a repository's cache.\n\t * @param repoPath - The repository path\n\t * @param prefix - Key prefix to match\n\t * @returns true if something was deleted\n\t */\n\tdeleteByKeyPrefix(this: RepoPromiseCacheMap<string, V>, repoPath: string, prefix: string): boolean {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\tlet deleted = false;\n\t\tfor (const key of repoCache.keys()) {\n\t\t\tif (key.startsWith(prefix)) {\n\t\t\t\trepoCache.delete(key);\n\t\t\t\tdeleted = true;\n\t\t\t}\n\t\t}\n\t\treturn deleted;\n\t}\n\n\t/**\n\t * Invalidates all keys matching a prefix from a repository's cache. See `PromiseCache.invalidate`\n\t * for semantics — in-flight entries are marked invalidated and shared with new callers; settled\n\t * entries are hard-deleted. Prefer over `deleteByKeyPrefix` when the eviction is a \"data has\n\t * changed\" event and in-flight factories' results would still be valid for current waiters.\n\t * @param repoPath - The repository path\n\t * @param prefix - Key prefix to match\n\t * @returns true if something was invalidated\n\t */\n\tinvalidateByKeyPrefix(this: RepoPromiseCacheMap<string, V>, repoPath: string, prefix: string): boolean {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\tlet invalidated = false;\n\t\tfor (const key of repoCache.keys()) {\n\t\t\tif (key.startsWith(prefix)) {\n\t\t\t\trepoCache.invalidate(key);\n\t\t\t\tinvalidated = true;\n\t\t\t}\n\t\t}\n\t\treturn invalidated;\n\t}\n\n\t/**\n\t * Clears all caches for all repositories.\n\t */\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the total number of entries across all repository caches.\n\t */\n\tget entryCount(): number {\n\t\tlet count = 0;\n\t\tfor (const repoCache of this.cache.values()) {\n\t\t\tcount += repoCache.size;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns the number of repositories in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n}\n\n/**\n * A two-level cache that organizes PromiseMaps by repository path.\n * Automatically creates and manages inner PromiseMaps per repository.\n *\n * This is useful for caching data that varies by both repository and some other key,\n * with simple promise deduplication and automatic error cleanup.\n */\nexport class RepoPromiseMap<K, V> {\n\tprivate readonly cache = new Map<string, PromiseMap<K, V>>();\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'RepoPromiseMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Automatically creates the inner PromiseMap for the repository if it doesn't exist.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param factory - Factory function to create the value if not cached\n\t */\n\tgetOrCreate(\n\t\trepoPath: string,\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\tcancellation?: AbortSignal,\n\t): Promise<V> {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseMap<K, V>();\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\treturn repoCache.getOrCreate(key, factory, cancellation);\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @returns The cached promise, or undefined if not found\n\t */\n\tget(repoPath: string, key: K): Promise<V> | undefined {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\treturn repoCache?.get(key);\n\t}\n\n\t/**\n\t * Deletes a specific key from a repository's cache, or all keys for a repository.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to delete. If omitted, deletes the entire repository cache.\n\t * @returns true if something was deleted, false otherwise\n\t */\n\tdelete(repoPath: string, key?: K): boolean {\n\t\tif (key === undefined) {\n\t\t\treturn this.cache.delete(repoPath);\n\t\t}\n\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\treturn repoCache.delete(key);\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated. See `PromiseMap.invalidate` for semantics.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to invalidate. If omitted, invalidates every entry for the repository.\n\t */\n\tinvalidate(repoPath: string, key?: K): void {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return;\n\n\t\tif (key === undefined) {\n\t\t\tfor (const k of repoCache.keys()) {\n\t\t\t\trepoCache.invalidate(k);\n\t\t\t}\n\t\t} else {\n\t\t\trepoCache.invalidate(key);\n\t\t}\n\t}\n\n\t/**\n\t * Clears all caches for all repositories.\n\t */\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the number of repositories in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n}\n"],"mappings":";;;;AAIA,SAAS,cAAoB,KAAgB,KAAQ,OAAgB;CACpE,IAAI,IAAI,IAAI,GAAG,MAAM,OACpB,IAAI,OAAO,GAAG;AAEhB;AAWA,IAAa,kBAAb,MAA6B;CAC5B,eAAe;CACf,IAAI,cAAuB;EAC1B,OAAO,KAAK;CACb;CAEA,aAAmB;EAClB,KAAK,eAAe;CACrB;AACD;AAoBA,IAAa,eAAb,MAAgC;CAC/B,wBAAyB,IAAI,IAAsB;CACnD,yBAA0B,IAAI,IAAuB;CACrD,8BAA+B,IAAI,IAAwB;CAC3D;CAEA,YAAY,SAA+B;EAC1C,KAAK,UAAU;GAAE,eAAe;GAAM,GAAG;EAAQ;CAClD;;;CAIA,QAAc;EACb,KAAK,OAAO,MAAM;EAClB,KAAK,YAAY,MAAM;EACvB,KAAK,MAAM,MAAM;CAClB;;;;;;CAOA,OAAO,KAAc;EACpB,KAAK,OAAO,OAAO,GAAG;EACtB,KAAK,YAAY,OAAO,GAAG;EAC3B,KAAK,MAAM,OAAO,GAAG;CACtB;;;;;;;;;;;CAYA,WAAW,KAAc;EACxB,IAAI,KAAK,YAAY,IAAI,GAAG,GAC3B,KAAK,YAAY,IAAI,GAAG,CAAC,CAAE,WAAW;OAEtC,KAAK,OAAO,GAAG;CAEjB;CAEA,OAA4B;EAC3B,OAAO,KAAK,MAAM,KAAK;CACxB;;;;;CAMA,IAAI,OAAe;EAClB,OAAO,KAAK,MAAM;CACnB;;;;;;CAOA,IAAI,KAAgC;EACnC,MAAM,MAAM,KAAK,IAAI;EACrB,MAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;EAChC,IAAI,SAAS,QAAQ,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EAEpB,OAAO;CACR;;;;CAKA,IAAI,OAAe;EAClB,OAAO,KAAK,MAAM;CACnB;AACD;;;;;;;;AASA,IAAa,iBAAb,MAAkC;CACjC,wBAAyB,IAAI,IAA8B;CAE3D,KAAK,OAAO,eAAuB;EAClC,OAAO;CACR;;;;;;;;;CAUA,YACC,UACA,KACA,SACA,cACa;EACb,IAAI,YAAY,KAAK,MAAM,IAAI,QAAQ;EACvC,IAAI,aAAa,MAAM;GACtB,YAAY,IAAI,WAAiB;GACjC,KAAK,MAAM,IAAI,UAAU,SAAS;EACnC;EAEA,OAAO,UAAU,YAAY,KAAK,SAAS,YAAY;CACxD;;;;;;;;CASA,IAAI,UAAkB,KAAgC;EAErD,OADkB,KAAK,MAAM,IAAI,QAClB,CAAC,EAAE,IAAI,GAAG;CAC1B;;;;;;;;CASA,OAAO,UAAkB,KAAkB;EAC1C,IAAI,QAAQ,KAAA,GACX,OAAO,KAAK,MAAM,OAAO,QAAQ;EAGlC,MAAM,YAAY,KAAK,MAAM,IAAI,QAAQ;EACzC,IAAI,aAAa,MAAM,OAAO;EAE9B,OAAO,UAAU,OAAO,GAAG;CAC5B;;;;;;;CAQA,WAAW,UAAkB,KAAe;EAC3C,MAAM,YAAY,KAAK,MAAM,IAAI,QAAQ;EACzC,IAAI,aAAa,MAAM;EAEvB,IAAI,QAAQ,KAAA,GACX,KAAK,MAAM,KAAK,UAAU,KAAK,GAC9B,UAAU,WAAW,CAAC;OAGvB,UAAU,WAAW,GAAG;CAE1B;;;;CAKA,QAAc;EACb,KAAK,MAAM,MAAM;CAClB;;;;CAKA,IAAI,OAAe;EAClB,OAAO,KAAK,MAAM;CACnB;AACD"}
1
+ {"version":3,"file":"promiseCache.js","names":[],"sources":["../../../utils/src/promiseCache.ts"],"sourcesContent":["import { AbortAggregate, CancellationError, raceWithSignal } from './cancellation.js';\n\n/** Deletes `key` from `map` only if it still maps to `owner`. A `delete(key)` + fresh `getOrCreate` can install\n * a successor under the same key while our factory is in flight; our late settle must not evict the successor. */\nfunction deleteIfOwned<K, V>(map: Map<K, V>, key: K, owner: V): void {\n\tif (map.get(key) === owner) {\n\t\tmap.delete(key);\n\t}\n}\n\ninterface CacheEntry<V> {\n\tpromise: Promise<V>;\n\taccessed: number;\n\tcreated: number;\n\n\tcreateTTL: number | undefined;\n\taccessTTL: number | undefined;\n}\n\nexport class CacheController {\n\t#invalidated = false;\n\tget invalidated(): boolean {\n\t\treturn this.#invalidated;\n\t}\n\n\tinvalidate(): void {\n\t\tthis.#invalidated = true;\n\t}\n}\n\ninterface PromiseCacheOptions {\n\t/** TTL (time-to-live) in milliseconds since creation */\n\tcreateTTL?: number;\n\t/** TTL (time-to-live) in milliseconds since last access */\n\taccessTTL?: number;\n\t/** Whether to expire the entry if the promise fails (default: true) */\n\texpireOnError?: boolean;\n\t/**\n\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t * Only used when `onError` is not provided. Mutually exclusive with `expireOnError`.\n\t */\n\terrorTTL?: number;\n\t/** Maximum number of entries in the cache (LRU eviction when exceeded) */\n\tcapacity?: number;\n}\n\nexport class PromiseCache<K, V> {\n\tprivate readonly cache = new Map<K, CacheEntry<V>>();\n\tprivate readonly aborts = new Map<K, AbortAggregate>();\n\tprivate readonly controllers = new Map<K, CacheController>();\n\tprivate readonly options: PromiseCacheOptions;\n\tprivate cleanupQueued = false;\n\n\tconstructor(options?: PromiseCacheOptions) {\n\t\tthis.options = { expireOnError: true, ...options };\n\t}\n\n\t/** Clears all entries. Like `delete`, does NOT dispose in-flight abort aggregates — that would detach a running\n\t * op's cancellation (a later caller-abort couldn't cancel it); each factory's settle handler disposes its own. */\n\tclear(): void {\n\t\tthis.aborts.clear();\n\t\tthis.controllers.clear();\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Removes a promise from the cache.\n\t * Does NOT dispose the abort aggregate: while a factory is in flight, disposing would detach\n\t * its callers' cancellation and orphan the underlying op (a later caller-abort could no longer cancel the\n\t * running `git status`). The factory's own settle handler disposes the aggregate (see `getOrCreate`). */\n\tdelete(key: K): void {\n\t\tthis.aborts.delete(key);\n\t\tthis.controllers.delete(key);\n\t\tthis.cache.delete(key);\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated.\n\t * - If the entry has a `CacheController` (created via `getOrCreate`), it is soft-invalidated:\n\t * existing waiters complete normally, new callers joining during the remainder of the\n\t * in-flight operation share the same promise, and the entry self-evicts on settle.\n\t * - If the entry was set via plain `.set()` (no controller), it is hard-deleted — there is\n\t * no in-flight factory to ride along with.\n\t *\n\t * No-op if the key is not cached.\n\t */\n\tinvalidate(key: K): void {\n\t\tif (this.controllers.has(key)) {\n\t\t\tthis.controllers.get(key)!.invalidate();\n\t\t} else {\n\t\t\tthis.delete(key);\n\t\t}\n\t}\n\n\tkeys(): IterableIterator<K> {\n\t\treturn this.cache.keys();\n\t}\n\n\t/**\n\t * Returns the number of entries in the cache, including expired entries that haven't been evicted yet\n\t * (they are only evicted on access), so this reflects what's actually retained in memory.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it and updates accessed time\n\t * @param key - The cache key\n\t * @returns The cached promise, or undefined if not cached, expired, or in flight with every caller cancelled\n\t */\n\tget(key: K): Promise<V> | undefined {\n\t\tconst now = Date.now();\n\t\tconst entry = this.cache.get(key);\n\t\tif (entry == null || this.expired(entry, now) || this.aborts.get(key)?.signal.aborted) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Update accessed time\n\t\tentry.accessed = now;\n\t\treturn entry.promise;\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t *\n\t * When `cancellation` is provided:\n\t * - The factory receives an aggregate `AbortSignal` that only fires when **all** callers cancel\n\t * - The returned promise rejects with `CancellationError` if this caller's signal fires\n\t * - Other callers sharing the same cached promise are unaffected\n\t *\n\t * @param key - The cache key\n\t * @param factory - Factory function to create the value if not cached\n\t * @param cancellation - Optional per-caller AbortSignal\n\t * @param options - Optional TTL and error handling options that override the defaults\n\t */\n\tasync getOrCreate(\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\toptions?: {\n\t\t\t/** Per-caller AbortSignal — the factory receives an aggregate signal that only fires when all callers cancel */\n\t\t\tcancellation?: AbortSignal;\n\t\t\t/** TTL (time-to-live) in milliseconds since creation */\n\t\t\tcreateTTL?: number;\n\t\t\t/** TTL (time-to-live) in milliseconds since last access */\n\t\t\taccessTTL?: number;\n\t\t\t/** Whether to expire the entry if the promise fails */\n\t\t\texpireOnError?: boolean;\n\t\t\t/**\n\t\t\t * Called after the factory resolves. If the predicate resolves to true, the entry is evicted while\n\t\t\t * the current caller still receives the resolved value.\n\t\t\t */\n\t\t\tevictWhen?: (value: V) => boolean | Promise<boolean>;\n\t\t\t/**\n\t\t\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t\t\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t\t\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t\t\t * Only used when `onError` is not provided.\n\t\t\t */\n\t\t\terrorTTL?: number;\n\t\t\t/**\n\t\t\t * Called when the factory promise rejects. Return a fallback result to cache\n\t\t\t * instead of expiring. The fallback value is cached with the specified `createTTL`\n\t\t\t * (defaults to the cache's `createTTL`). By default, the error is re-thrown to the\n\t\t\t * first caller after caching the fallback. Set `suppress: true` to return the fallback\n\t\t\t * value to the first caller instead. Return `undefined` to expire normally and re-throw.\n\t\t\t */\n\t\t\tonError?: (error: unknown) => { value: V; createTTL?: number; suppress?: boolean } | undefined;\n\t\t},\n\t): Promise<V> {\n\t\tconst cancellation = options?.cancellation;\n\t\tif (cancellation?.aborted) return Promise.reject(new CancellationError());\n\n\t\tconst now = Date.now();\n\n\t\toptions = { ...this.options, ...options };\n\n\t\tlet entry = this.cache.get(key);\n\t\tif (entry != null && !this.expired(entry, now)) {\n\t\t\t// Cache hit — but don't join an entry whose aggregate has already permanently aborted (all prior\n\t\t\t// callers cancelled, so the shared run is failing): that would hand this caller a doomed promise.\n\t\t\t// Fall through to create a fresh entry; the doomed entry's late settle is `deleteIfOwned`-guarded.\n\t\t\tconst existingAborts = this.aborts.get(key);\n\t\t\tif (existingAborts == null || !existingAborts.signal.aborted) {\n\t\t\t\tentry.accessed = now;\n\t\t\t\tconst cleanup = existingAborts != null ? existingAborts.add(cancellation) : undefined;\n\t\t\t\treturn this.attachCallerLifecycle(entry.promise, cancellation, cleanup);\n\t\t\t}\n\t\t}\n\n\t\tconst cacheable = new CacheController();\n\t\t// Always create the aggregate so subsequent callers (with or without signals) can contribute,\n\t\t// and so delete/invalidate has a controller to interact with\n\t\tconst abortAgg = new AbortAggregate();\n\t\tconst cleanup = abortAgg.add(cancellation);\n\t\tthis.aborts.set(key, abortAgg);\n\t\tthis.controllers.set(key, cacheable);\n\n\t\tconst promise = factory(cacheable, abortAgg.signal);\n\t\tvoid promise\n\t\t\t.finally(() => {\n\t\t\t\t// All three deletes are ownership-guarded — a hard `delete(key)` + fresh `getOrCreate` while our\n\t\t\t\t// factory is in flight installs a successor under `key`; our late settle must not evict it.\n\t\t\t\tif (cacheable.invalidated) {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, entry!);\n\t\t\t\t}\n\t\t\t\tabortAgg.dispose();\n\t\t\t\tdeleteIfOwned(this.aborts, key, abortAgg);\n\t\t\t\tdeleteIfOwned(this.controllers, key, cacheable);\n\t\t\t})\n\t\t\t// Swallow the cleanup chain's rejection so it doesn't surface as an unhandled rejection\n\t\t\t// separate from the caller-facing promise's own handling (e.g. on cancellation).\n\t\t\t.catch(() => {});\n\n\t\tif (options?.onError != null) {\n\t\t\t// Wrap the promise to handle errors with the onError callback\n\t\t\tconst errorHandled = promise.catch((ex: unknown) => {\n\t\t\t\tconst result = options.onError!(ex);\n\t\t\t\t// A hard `delete(key)` + fresh `getOrCreate` while we were in flight installs a successor;\n\t\t\t\t// don't clobber it. But an EMPTY key (our entry already evicted, e.g. by the invalidated-finally)\n\t\t\t\t// still takes the fallback — preserving base behavior of caching the error fallback.\n\t\t\t\tconst occupant = this.cache.get(key);\n\t\t\t\tconst clobbersSuccessor = occupant != null && occupant !== entry;\n\t\t\t\tif (result != null) {\n\t\t\t\t\t// Replace the entry with a resolved fallback value for subsequent callers\n\t\t\t\t\tif (!clobbersSuccessor) {\n\t\t\t\t\t\tconst errorNow = Date.now();\n\t\t\t\t\t\tthis.cache.set(key, {\n\t\t\t\t\t\t\tpromise: Promise.resolve(result.value),\n\t\t\t\t\t\t\tcreated: errorNow,\n\t\t\t\t\t\t\taccessed: errorNow,\n\t\t\t\t\t\t\tcreateTTL: result.createTTL ?? options.createTTL,\n\t\t\t\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// suppress: return fallback to first caller; otherwise re-throw\n\t\t\t\t\tif (result.suppress) return result.value;\n\t\t\t\t} else {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, entry!);\n\t\t\t\t}\n\t\t\t\tthrow ex;\n\t\t\t});\n\n\t\t\tentry = {\n\t\t\t\tpromise: errorHandled,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\t\t} else if (options?.errorTTL != null) {\n\t\t\t// Cache resolved undefined for subsequent callers, re-throw to first caller\n\t\t\tconst errorTTL = options.errorTTL;\n\t\t\tconst errorHandled = promise.catch((ex: unknown) => {\n\t\t\t\t// Overwrite unless a successor now owns the key (empty key still takes it — see onError above).\n\t\t\t\tconst occupant = this.cache.get(key);\n\t\t\t\tif (occupant == null || occupant === entry) {\n\t\t\t\t\tconst errorNow = Date.now();\n\t\t\t\t\tthis.cache.set(key, {\n\t\t\t\t\t\tpromise: Promise.resolve(undefined as V),\n\t\t\t\t\t\tcreated: errorNow,\n\t\t\t\t\t\taccessed: errorNow,\n\t\t\t\t\t\tcreateTTL: errorTTL,\n\t\t\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow ex;\n\t\t\t});\n\n\t\t\tentry = {\n\t\t\t\tpromise: errorHandled,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\t\t} else {\n\t\t\tentry = {\n\t\t\t\tpromise: promise,\n\t\t\t\tcreated: now,\n\t\t\t\taccessed: now,\n\t\t\t\tcreateTTL: options.createTTL,\n\t\t\t\taccessTTL: options.accessTTL,\n\t\t\t};\n\t\t\tthis.cache.set(key, entry);\n\n\t\t\tif (options?.expireOnError ?? true) {\n\t\t\t\t// Ownership-guarded: a hard `delete(key)` + fresh `getOrCreate` replacing us while in flight must\n\t\t\t\t// not have its entry evicted by our rejection.\n\t\t\t\tconst ourEntry = entry;\n\t\t\t\tpromise.catch(() => deleteIfOwned(this.cache, key, ourEntry));\n\t\t\t}\n\t\t}\n\n\t\tconst evictWhen = options?.evictWhen;\n\t\tif (evictWhen != null) {\n\t\t\tconst candidate = entry;\n\t\t\tvoid candidate.promise\n\t\t\t\t.then(value => evictWhen(value))\n\t\t\t\t.then(evict => {\n\t\t\t\t\tif (evict) {\n\t\t\t\t\t\tdeleteIfOwned(this.cache, key, candidate);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t// A retention policy must not surface a rejection independently of the caller-facing operation.\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tthis.queueCleanup();\n\n\t\treturn this.attachCallerLifecycle(entry.promise, cancellation, cleanup);\n\t}\n\n\t/** Queues one pass that drops expired entries and enforces the capacity; writes before it runs share it */\n\tprivate queueCleanup(): void {\n\t\tif (this.cleanupQueued || this.cache.size <= 1) return;\n\n\t\tthis.cleanupQueued = true;\n\t\tqueueMicrotask(() => {\n\t\t\tthis.cleanupQueued = false;\n\t\t\tthis.cleanup();\n\t\t});\n\t}\n\n\tprivate attachCallerLifecycle(\n\t\tpromise: Promise<V>,\n\t\tcancellation: AbortSignal | undefined,\n\t\tcleanup: (() => void) | undefined,\n\t): Promise<V> {\n\t\tconst returned = cancellation != null ? raceWithSignal(promise, cancellation) : promise;\n\t\tif (cleanup != null) {\n\t\t\t// Release this caller's aggregate slot when their wait ends.\n\t\t\t// Attach .catch to swallow any rejection in the cleanup chain so it doesn't surface\n\t\t\t// as an unhandled rejection separate from the caller's own handling of `returned`.\n\t\t\tvoid returned.finally(cleanup).catch(() => {});\n\t\t}\n\t\treturn returned;\n\t}\n\n\tprivate cleanup(): void {\n\t\tconst now = Date.now();\n\t\tconst capacity = this.options.capacity;\n\n\t\t// If no capacity limit, just remove expired entries\n\t\tif (capacity == null) {\n\t\t\tfor (const [key, entry] of this.cache.entries()) {\n\t\t\t\tif (this.expired(entry, now)) {\n\t\t\t\t\tthis.cache.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Single pass: collect non-expired entries and find LRU candidates\n\t\tconst entries: Array<[K, CacheEntry<V>]> = [];\n\t\tfor (const [key, entry] of this.cache.entries()) {\n\t\t\tif (!this.expired(entry, now)) {\n\t\t\t\tentries.push([key, entry]);\n\t\t\t} else {\n\t\t\t\tthis.cache.delete(key);\n\t\t\t}\n\t\t}\n\n\t\t// If still over capacity, remove LRU entries\n\t\tconst excess = entries.length - capacity;\n\t\tif (excess > 0) {\n\t\t\t// Sort by accessed time (oldest first) and remove the excess\n\t\t\t// Note: O(N log N) sort — acceptable at current cache sizes; replace with a linked-list LRU if capacity grows\n\t\t\tentries.sort((a, b) => a[1].accessed - b[1].accessed);\n\t\t\tfor (let i = 0; i < excess; i++) {\n\t\t\t\tthis.cache.delete(entries[i][0]);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate expired(entry: CacheEntry<V>, now: number): boolean {\n\t\treturn (\n\t\t\t(entry.createTTL != null && now - entry.created >= entry.createTTL) ||\n\t\t\t(entry.accessTTL != null && now - entry.accessed >= entry.accessTTL)\n\t\t);\n\t}\n\n\t/**\n\t * Sets a promise in the cache.\n\t * The promise will use the default options from the cache constructor, unless overridden.\n\t *\n\t * @param key - The cache key\n\t * @param promise - The promise to cache\n\t * @param options - Optional TTL options that override the defaults\n\t */\n\tset(key: K, promise: Promise<V>, options?: { accessTTL?: number; createTTL?: number }): void {\n\t\tconst now = Date.now();\n\t\tconst entry: CacheEntry<V> = {\n\t\t\tpromise: promise,\n\t\t\tcreated: now,\n\t\t\taccessed: now,\n\t\t\tcreateTTL: options?.createTTL ?? this.options.createTTL,\n\t\t\taccessTTL: options?.accessTTL ?? this.options.accessTTL,\n\t\t};\n\t\tthis.cache.set(key, entry);\n\n\t\tif (this.options.expireOnError ?? true) {\n\t\t\tpromise.catch(() => deleteIfOwned(this.cache, key, entry));\n\t\t}\n\n\t\tthis.queueCleanup();\n\t}\n}\n\n/**\n * A Map-like wrapper for promises that automatically removes failed promises from the cache.\n * This provides a drop-in replacement for Map<K, Promise<V>> with automatic error cleanup.\n */\nexport class PromiseMap<K, V> {\n\tprivate readonly cache = new Map<K, Promise<V>>();\n\tprivate readonly aborts = new Map<K, AbortAggregate>();\n\tprivate readonly controllers = new Map<K, CacheController>();\n\t/** Each cached promise's value once it fulfills, for {@link getSettled} */\n\tprivate readonly settled = new WeakMap<Promise<V>, { value: V }>();\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'PromiseMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Failed promises are automatically removed from the cache.\n\t *\n\t * When `cancellation` is provided:\n\t * - The factory receives an aggregate `AbortSignal` that only fires when **all** callers cancel\n\t * - The returned promise rejects with `CancellationError` if this caller's signal fires\n\t * - Other callers sharing the same cached promise are unaffected\n\t *\n\t * Callers without a `cancellation` signal count as \"permanent\" subscribers — the aggregate\n\t * cannot fire while at least one is active. The slot is released when the caller's returned\n\t * promise settles.\n\t */\n\tgetOrCreate(\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\tcancellation?: AbortSignal,\n\t): Promise<V> {\n\t\tif (cancellation?.aborted) return Promise.reject(new CancellationError());\n\n\t\tconst cached = this.cache.get(key);\n\t\tif (cached != null) {\n\t\t\t// Cache hit — but don't join an entry whose aggregate has already permanently aborted (all prior\n\t\t\t// callers cancelled, so the shared run is failing): joining hands this caller a doomed promise.\n\t\t\t// Fall through to a fresh entry; the doomed entry's late settle is `deleteIfOwned`-guarded.\n\t\t\tconst existingAborts = this.aborts.get(key);\n\t\t\tif (existingAborts == null || !existingAborts.signal.aborted) {\n\t\t\t\tconst cleanup = existingAborts != null ? existingAborts.add(cancellation) : undefined;\n\t\t\t\treturn this.attachCallerLifecycle(cached, cancellation, cleanup);\n\t\t\t}\n\t\t}\n\n\t\t// Cache miss — always create the aggregate so subsequent callers (with or without signals)\n\t\t// can contribute, and so delete/invalidate has a controller to interact with\n\t\tconst cacheable = new CacheController();\n\t\tconst aborts = new AbortAggregate();\n\t\tconst cleanup = aborts.add(cancellation);\n\t\tthis.aborts.set(key, aborts);\n\t\tthis.controllers.set(key, cacheable);\n\n\t\tconst promise = factory(cacheable, aborts.signal);\n\t\tthis.track(key, promise);\n\t\tvoid promise\n\t\t\t.finally(() => {\n\t\t\t\tif (cacheable.invalidated) {\n\t\t\t\t\tdeleteIfOwned(this.cache, key, promise);\n\t\t\t\t}\n\t\t\t\taborts.dispose();\n\t\t\t\tdeleteIfOwned(this.aborts, key, aborts);\n\t\t\t\tdeleteIfOwned(this.controllers, key, cacheable);\n\t\t\t})\n\t\t\t// Swallow the cleanup chain's rejection so it doesn't surface as an unhandled rejection\n\t\t\t// separate from the caller-facing promise's own handling (e.g. on cancellation).\n\t\t\t.catch(() => {});\n\n\t\tthis.cache.set(key, promise);\n\n\t\treturn this.attachCallerLifecycle(promise, cancellation, cleanup);\n\t}\n\n\tprivate attachCallerLifecycle(\n\t\tpromise: Promise<V>,\n\t\tcancellation: AbortSignal | undefined,\n\t\tcleanup: (() => void) | undefined,\n\t): Promise<V> {\n\t\tconst returned = cancellation != null ? raceWithSignal(promise, cancellation) : promise;\n\t\tif (cleanup != null) {\n\t\t\t// Release this caller's aggregate slot when their wait ends.\n\t\t\t// Attach .catch to swallow any rejection in the cleanup chain so it doesn't surface\n\t\t\t// as an unhandled rejection separate from the caller's own handling of `returned`.\n\t\t\tvoid returned.finally(cleanup).catch(() => {});\n\t\t}\n\t\treturn returned;\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated.\n\t * - If the entry has a `CacheController` (created via `getOrCreate`), it is soft-invalidated:\n\t * existing waiters complete normally, new callers joining during the remainder of the\n\t * in-flight operation share the same promise, and the entry self-evicts on settle.\n\t * - If the entry was set via plain `.set()` (no controller), it is hard-deleted — there is\n\t * no in-flight factory to ride along with.\n\t *\n\t * No-op if the key is not cached.\n\t */\n\tinvalidate(key: K): void {\n\t\tif (this.controllers.has(key)) {\n\t\t\tthis.controllers.get(key)!.invalidate();\n\t\t} else {\n\t\t\tthis.delete(key);\n\t\t}\n\t}\n\n\t/**\n\t * Gets a promise from the cache, or undefined if not found or in flight with every caller cancelled.\n\t */\n\tget(key: K): Promise<V> | undefined {\n\t\tif (this.aborts.get(key)?.signal.aborted) return undefined;\n\n\t\treturn this.cache.get(key);\n\t}\n\n\t/**\n\t * Sets a promise in the cache. The promise will be automatically removed if it fails.\n\t */\n\tset(key: K, promise: Promise<V>): this {\n\t\tthis.cache.set(key, promise);\n\t\tthis.track(key, promise);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * The value `key`'s cached promise fulfilled with, or `undefined` while it is pending (or nothing is cached), so a\n\t * caller can tell a settled entry from a read still in flight without joining it.\n\t */\n\tgetSettled(key: K): { value: V } | undefined {\n\t\tconst promise = this.cache.get(key);\n\t\treturn promise != null ? this.settled.get(promise) : undefined;\n\t}\n\n\tprivate track(key: K, promise: Promise<V>): void {\n\t\tpromise.then(\n\t\t\tvalue => {\n\t\t\t\tthis.settled.set(promise, { value: value });\n\t\t\t},\n\t\t\t// Automatically remove failed promises from the cache (ownership-guarded — see `deleteIfOwned`).\n\t\t\t() => deleteIfOwned(this.cache, key, promise),\n\t\t);\n\t}\n\n\t/**\n\t * Checks if a key exists in the cache.\n\t */\n\thas(key: K): boolean {\n\t\treturn this.cache.has(key);\n\t}\n\n\t/**\n\t * Removes a key from the cache.\n\t * Does NOT dispose the abort aggregate: while a factory is in flight, disposing would detach\n\t * its callers' cancellation and orphan the underlying op (a later caller-abort could no longer cancel the\n\t * running `git status`). The factory's own settle handler disposes the aggregate (see `getOrCreate`). */\n\tdelete(key: K): boolean {\n\t\tthis.aborts.delete(key);\n\t\tthis.controllers.delete(key);\n\t\treturn this.cache.delete(key);\n\t}\n\n\t/**\n\t * Clears all entries. Like `delete`, does NOT dispose in-flight abort aggregates — that would detach a running\n\t * op's cancellation (a later caller-abort couldn't cancel it); each factory's settle handler disposes its own.\n\t */\n\tclear(): void {\n\t\tthis.aborts.clear();\n\t\tthis.controllers.clear();\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the number of entries in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n\n\t/**\n\t * Returns an iterator for the cache keys.\n\t */\n\tkeys(): IterableIterator<K> {\n\t\treturn this.cache.keys();\n\t}\n\n\t/**\n\t * Returns an iterator for the cache values.\n\t */\n\tvalues(): IterableIterator<Promise<V>> {\n\t\treturn this.cache.values();\n\t}\n\n\t/**\n\t * Returns an iterator for the cache entries.\n\t */\n\tentries(): IterableIterator<[K, Promise<V>]> {\n\t\treturn this.cache.entries();\n\t}\n\n\t/**\n\t * Executes a provided function once for each cache entry.\n\t */\n\tforEach(callbackfn: (value: Promise<V>, key: K, map: Map<K, Promise<V>>) => void, thisArg?: any): void {\n\t\tthis.cache.forEach(callbackfn, thisArg);\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, Promise<V>]> {\n\t\treturn this.cache[Symbol.iterator]();\n\t}\n}\n\n/**\n * A two-level cache that organizes PromiseCaches by repository path.\n * Automatically creates and manages inner PromiseCaches per repository.\n *\n * This is useful for caching data that varies by both repository and some other key,\n * with TTL and capacity management provided by PromiseCache.\n */\nexport class RepoPromiseCacheMap<K, V> {\n\tprivate readonly cache = new Map<string, PromiseCache<K, V>>();\n\tprivate readonly options: PromiseCacheOptions;\n\n\tconstructor(options?: PromiseCacheOptions) {\n\t\tthis.options = { expireOnError: true, ...options };\n\t}\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'RepoPromiseCacheMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Automatically creates the inner PromiseCache for the repository if it doesn't exist.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param factory - Factory function to create the value if not cached\n\t * @param options - Optional TTL and error handling options that override the defaults\n\t */\n\tgetOrCreate(\n\t\trepoPath: string,\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\toptions?: {\n\t\t\t/** Per-caller AbortSignal — the factory receives an aggregate signal that only fires when all callers cancel */\n\t\t\tcancellation?: AbortSignal;\n\t\t\t/** TTL (time-to-live) in milliseconds since creation */\n\t\t\tcreateTTL?: number;\n\t\t\t/** TTL (time-to-live) in milliseconds since last access */\n\t\t\taccessTTL?: number;\n\t\t\t/** Whether to expire the entry if the promise fails */\n\t\t\texpireOnError?: boolean;\n\t\t\t/**\n\t\t\t * Called after the factory resolves. If the predicate resolves to true, the entry is evicted while\n\t\t\t * the current caller still receives the resolved value.\n\t\t\t */\n\t\t\tevictWhen?: (value: V) => boolean | Promise<boolean>;\n\t\t\t/**\n\t\t\t * TTL (time-to-live) in milliseconds for caching errors. When the factory rejects and `errorTTL` is set,\n\t\t\t * the cache entry is replaced with `Promise.resolve(undefined)` for subsequent callers, and the error\n\t\t\t * is re-thrown to the first caller. After `errorTTL` expires, the next call retries.\n\t\t\t * Only used when `onError` is not provided.\n\t\t\t */\n\t\t\terrorTTL?: number;\n\t\t\t/**\n\t\t\t * Called when the factory promise rejects. Return a fallback result to cache\n\t\t\t * instead of expiring. The fallback value is cached with the specified `createTTL`\n\t\t\t * (defaults to the cache's `createTTL`). By default, the error is re-thrown to the\n\t\t\t * first caller after caching the fallback. Set `suppress: true` to return the fallback\n\t\t\t * value to the first caller instead. Return `undefined` to expire normally and re-throw.\n\t\t\t */\n\t\t\tonError?: (error: unknown) => { value: V; createTTL?: number; suppress?: boolean } | undefined;\n\t\t},\n\t): Promise<V> {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseCache<K, V>(this.options);\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\treturn repoCache.getOrCreate(key, factory, options);\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @returns The cached promise, or undefined if not cached\n\t */\n\tget(repoPath: string, key: K): Promise<V> | undefined {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return undefined;\n\n\t\treturn repoCache.get(key);\n\t}\n\n\t/**\n\t * Sets a promise in the cache.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param promise - The promise to cache\n\t * @param options - Optional TTL options that override the defaults\n\t */\n\tset(repoPath: string, key: K, promise: Promise<V>, options?: { accessTTL?: number; createTTL?: number }): void {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseCache<K, V>(this.options);\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\trepoCache.set(key, promise, options);\n\t}\n\n\t/**\n\t * Deletes a specific key from a repository's cache, or all keys for a repository.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to delete. If omitted, deletes the entire repository cache.\n\t * @returns true if something was deleted, false otherwise\n\t */\n\tdelete(repoPath: string, key?: K): boolean {\n\t\tif (key === undefined) {\n\t\t\treturn this.cache.delete(repoPath);\n\t\t}\n\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\trepoCache.delete(key);\n\t\tthis.dropIfEmpty(repoPath, repoCache);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Whether any entry is kept for `repoPath`, settled or in flight. Right after `invalidate(repoPath)`, only an entry\n\t * in flight is, which a new caller still joins.\n\t */\n\thas(repoPath: string): boolean {\n\t\treturn (this.cache.get(repoPath)?.size ?? 0) > 0;\n\t}\n\n\t/**\n\t * Drops `repoPath`'s cache once it holds nothing, so a removed worktree leaves no cache behind. One that still holds\n\t * an in-flight entry `invalidate` only marked stays, so a new caller still joins that entry.\n\t */\n\tprivate dropIfEmpty(repoPath: string, repoCache: PromiseCache<K, V>): void {\n\t\tif (repoCache.size === 0) {\n\t\t\tthis.cache.delete(repoPath);\n\t\t}\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated. See `PromiseCache.invalidate` for semantics.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to invalidate. If omitted, invalidates every entry for the repository.\n\t */\n\tinvalidate(repoPath: string, key?: K): void {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return;\n\n\t\tif (key === undefined) {\n\t\t\tfor (const k of repoCache.keys()) {\n\t\t\t\trepoCache.invalidate(k);\n\t\t\t}\n\t\t} else {\n\t\t\trepoCache.invalidate(key);\n\t\t}\n\t\tthis.dropIfEmpty(repoPath, repoCache);\n\t}\n\n\t/**\n\t * Deletes all keys matching a prefix from a repository's cache.\n\t * @param repoPath - The repository path\n\t * @param prefix - Key prefix to match\n\t * @returns true if something was deleted\n\t */\n\tdeleteByKeyPrefix(this: RepoPromiseCacheMap<string, V>, repoPath: string, prefix: string): boolean {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\tlet deleted = false;\n\t\tfor (const key of repoCache.keys()) {\n\t\t\tif (key.startsWith(prefix)) {\n\t\t\t\trepoCache.delete(key);\n\t\t\t\tdeleted = true;\n\t\t\t}\n\t\t}\n\t\tthis.dropIfEmpty(repoPath, repoCache);\n\t\treturn deleted;\n\t}\n\n\t/**\n\t * Invalidates all keys matching a prefix from a repository's cache. See `PromiseCache.invalidate`\n\t * for semantics — in-flight entries are marked invalidated and shared with new callers; settled\n\t * entries are hard-deleted. Prefer over `deleteByKeyPrefix` when the eviction is a \"data has\n\t * changed\" event and in-flight factories' results would still be valid for current waiters.\n\t * @param repoPath - The repository path\n\t * @param prefix - Key prefix to match\n\t * @returns true if something was invalidated\n\t */\n\tinvalidateByKeyPrefix(this: RepoPromiseCacheMap<string, V>, repoPath: string, prefix: string): boolean {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\tlet invalidated = false;\n\t\tfor (const key of repoCache.keys()) {\n\t\t\tif (key.startsWith(prefix)) {\n\t\t\t\trepoCache.invalidate(key);\n\t\t\t\tinvalidated = true;\n\t\t\t}\n\t\t}\n\t\tthis.dropIfEmpty(repoPath, repoCache);\n\t\treturn invalidated;\n\t}\n\n\t/**\n\t * Clears all caches for all repositories.\n\t */\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the total number of entries across all repository caches.\n\t */\n\tget entryCount(): number {\n\t\tlet count = 0;\n\t\tfor (const repoCache of this.cache.values()) {\n\t\t\tcount += repoCache.size;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns the number of repositories in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n}\n\n/**\n * A two-level cache that organizes PromiseMaps by repository path.\n * Automatically creates and manages inner PromiseMaps per repository.\n *\n * This is useful for caching data that varies by both repository and some other key,\n * with simple promise deduplication and automatic error cleanup.\n */\nexport class RepoPromiseMap<K, V> {\n\tprivate readonly cache = new Map<string, PromiseMap<K, V>>();\n\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'RepoPromiseMap';\n\t}\n\n\t/**\n\t * Gets a promise from the cache or creates a new one using the factory function.\n\t * Automatically creates the inner PromiseMap for the repository if it doesn't exist.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @param factory - Factory function to create the value if not cached\n\t */\n\tgetOrCreate(\n\t\trepoPath: string,\n\t\tkey: K,\n\t\tfactory: (cacheable: CacheController, cancellation?: AbortSignal) => Promise<V>,\n\t\tcancellation?: AbortSignal,\n\t): Promise<V> {\n\t\tlet repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) {\n\t\t\trepoCache = new PromiseMap<K, V>();\n\t\t\tthis.cache.set(repoPath, repoCache);\n\t\t}\n\n\t\treturn repoCache.getOrCreate(key, factory, cancellation);\n\t}\n\n\t/**\n\t * Gets a promise from the cache without creating it.\n\t *\n\t * @param repoPath - The repository path (outer key)\n\t * @param key - The cache key within the repository (inner key)\n\t * @returns The cached promise, or undefined if not found\n\t */\n\tget(repoPath: string, key: K): Promise<V> | undefined {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\treturn repoCache?.get(key);\n\t}\n\n\t/**\n\t * Deletes a specific key from a repository's cache, or all keys for a repository.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to delete. If omitted, deletes the entire repository cache.\n\t * @returns true if something was deleted, false otherwise\n\t */\n\tdelete(repoPath: string, key?: K): boolean {\n\t\tif (key === undefined) {\n\t\t\treturn this.cache.delete(repoPath);\n\t\t}\n\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return false;\n\n\t\treturn repoCache.delete(key);\n\t}\n\n\t/**\n\t * Marks a cached entry as invalidated. See `PromiseMap.invalidate` for semantics.\n\t *\n\t * @param repoPath - The repository path\n\t * @param key - Optional specific key to invalidate. If omitted, invalidates every entry for the repository.\n\t */\n\tinvalidate(repoPath: string, key?: K): void {\n\t\tconst repoCache = this.cache.get(repoPath);\n\t\tif (repoCache == null) return;\n\n\t\tif (key === undefined) {\n\t\t\tfor (const k of repoCache.keys()) {\n\t\t\t\trepoCache.invalidate(k);\n\t\t\t}\n\t\t} else {\n\t\t\trepoCache.invalidate(key);\n\t\t}\n\t}\n\n\t/**\n\t * Clears all caches for all repositories.\n\t */\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\t/**\n\t * Returns the number of repositories in the cache.\n\t */\n\tget size(): number {\n\t\treturn this.cache.size;\n\t}\n}\n"],"mappings":";;;;AAIA,SAAS,cAAoB,KAAgB,KAAQ,OAAgB;CACpE,IAAI,IAAI,IAAI,GAAG,MAAM,OACpB,IAAI,OAAO,GAAG;AAEhB;AAWA,IAAa,kBAAb,MAA6B;CAC5B,eAAe;CACf,IAAI,cAAuB;EAC1B,OAAO,KAAK;CACb;CAEA,aAAmB;EAClB,KAAK,eAAe;CACrB;AACD;AAoBA,IAAa,eAAb,MAAgC;CAC/B,wBAAyB,IAAI,IAAsB;CACnD,yBAA0B,IAAI,IAAuB;CACrD,8BAA+B,IAAI,IAAwB;CAC3D;CACA,gBAAwB;CAExB,YAAY,SAA+B;EAC1C,KAAK,UAAU;GAAE,eAAe;GAAM,GAAG;EAAQ;CAClD;;;CAIA,QAAc;EACb,KAAK,OAAO,MAAM;EAClB,KAAK,YAAY,MAAM;EACvB,KAAK,MAAM,MAAM;CAClB;;;;;;CAOA,OAAO,KAAc;EACpB,KAAK,OAAO,OAAO,GAAG;EACtB,KAAK,YAAY,OAAO,GAAG;EAC3B,KAAK,MAAM,OAAO,GAAG;CACtB;;;;;;;;;;;CAYA,WAAW,KAAc;EACxB,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AAI,UAAU,SAAS;EACnC;EAEA,OAAO,UAAU,YAAY,KAAK,SAAS,YAAY;CACxD;;;;;;;;CASA,IAAI,UAAkB,KAAgC;EAErD,OADkB,KAAK,MAAM,IAAI,QAClB,CAAC,EAAE,IAAI,GAAG;CAC1B;;;;;;;;CASA,OAAO,UAAkB,KAAkB;EAC1C,IAAI,QAAQ,KAAA,GACX,OAAO,KAAK,MAAM,OAAO,QAAQ;EAGlC,MAAM,YAAY,KAAK,MAAM,IAAI,QAAQ;EACzC,IAAI,aAAa,MAAM,OAAO;EAE9B,OAAO,UAAU,OAAO,GAAG;CAC5B;;;;;;;CAQA,WAAW,UAAkB,KAAe;EAC3C,MAAM,YAAY,KAAK,MAAM,IAAI,QAAQ;EACzC,IAAI,aAAa,MAAM;EAEvB,IAAI,QAAQ,KAAA,GACX,KAAK,MAAM,KAAK,UAAU,KAAK,GAC9B,UAAU,WAAW,CAAC;OAGvB,UAAU,WAAW,GAAG;CAE1B;;;;CAKA,QAAc;EACb,KAAK,MAAM,MAAM;CAClB;;;;CAKA,IAAI,OAAe;EAClB,OAAO,KAAK,MAAM;CACnB;AACD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitkraken/core-gitlens",
3
3
  "description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
4
- "version": "0.37.1",
4
+ "version": "0.38.1",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",