@classytic/repo-core 0.31.1 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  3. package/dist/adapter/index.mjs +1 -2
  4. package/dist/adapter/types.d.mts +0 -2
  5. package/dist/adapter/widen.d.mts +0 -2
  6. package/dist/adapter/widen.mjs +1 -2
  7. package/dist/aggregate/keyset.d.mts +0 -2
  8. package/dist/aggregate/keyset.mjs +1 -2
  9. package/dist/aggregate/normalize.d.mts +0 -2
  10. package/dist/aggregate/normalize.mjs +1 -2
  11. package/dist/better-auth/index.d.mts +0 -2
  12. package/dist/better-auth/index.mjs +1 -2
  13. package/dist/cache/engine.d.mts +0 -2
  14. package/dist/cache/engine.mjs +1 -2
  15. package/dist/cache/envelope.mjs +1 -2
  16. package/dist/cache/keys.mjs +1 -2
  17. package/dist/cache/memo.d.mts +0 -2
  18. package/dist/cache/memo.mjs +1 -2
  19. package/dist/cache/memory-adapter.d.mts +0 -2
  20. package/dist/cache/memory-adapter.mjs +1 -2
  21. package/dist/cache/options.d.mts +0 -2
  22. package/dist/cache/options.mjs +1 -2
  23. package/dist/cache/plugin/context.d.mts +0 -2
  24. package/dist/cache/plugin/context.mjs +1 -2
  25. package/dist/cache/plugin/index.d.mts +0 -2
  26. package/dist/cache/plugin/index.mjs +1 -2
  27. package/dist/cache/plugin/invalidation-hooks.mjs +1 -2
  28. package/dist/cache/plugin/read-hooks.mjs +1 -2
  29. package/dist/cache/plugin/swr.mjs +1 -2
  30. package/dist/cache/runtime.d.mts +0 -2
  31. package/dist/cache/runtime.mjs +0 -1
  32. package/dist/cache/stable-stringify.d.mts +0 -2
  33. package/dist/cache/stable-stringify.mjs +1 -2
  34. package/dist/cache/tag-index.mjs +1 -2
  35. package/dist/cache/timeout-adapter.d.mts +0 -2
  36. package/dist/cache/timeout-adapter.mjs +1 -2
  37. package/dist/cache/types.d.mts +0 -2
  38. package/dist/cache/version-store.mjs +1 -2
  39. package/dist/cleanup/define-purge-step.d.mts +0 -2
  40. package/dist/cleanup/define-purge-step.mjs +1 -2
  41. package/dist/cleanup/index.mjs +1 -2
  42. package/dist/cleanup/types.d.mts +0 -2
  43. package/dist/context/types.d.mts +0 -2
  44. package/dist/errors/codes.d.mts +0 -2
  45. package/dist/errors/codes.mjs +1 -2
  46. package/dist/errors/conflict.d.mts +0 -2
  47. package/dist/errors/conflict.mjs +1 -2
  48. package/dist/errors/contract.d.mts +0 -2
  49. package/dist/errors/contract.mjs +1 -2
  50. package/dist/errors/create-error.d.mts +0 -2
  51. package/dist/errors/create-error.mjs +1 -2
  52. package/dist/errors/duplicate-key.d.mts +0 -2
  53. package/dist/errors/duplicate-key.mjs +1 -2
  54. package/dist/errors/schema.d.mts +0 -2
  55. package/dist/errors/schema.mjs +1 -2
  56. package/dist/errors/types.d.mts +0 -2
  57. package/dist/events/emit.d.mts +0 -2
  58. package/dist/events/emit.mjs +1 -2
  59. package/dist/events/index.mjs +1 -2
  60. package/dist/events/types.d.mts +0 -2
  61. package/dist/filter/builders.d.mts +0 -2
  62. package/dist/filter/builders.mjs +1 -2
  63. package/dist/filter/coerce-dates.d.mts +0 -2
  64. package/dist/filter/coerce-dates.mjs +1 -2
  65. package/dist/filter/from-record.d.mts +0 -2
  66. package/dist/filter/from-record.mjs +1 -2
  67. package/dist/filter/guard.d.mts +0 -2
  68. package/dist/filter/guard.mjs +1 -2
  69. package/dist/filter/match-record.d.mts +0 -2
  70. package/dist/filter/match-record.mjs +1 -2
  71. package/dist/filter/match.d.mts +0 -2
  72. package/dist/filter/match.mjs +1 -2
  73. package/dist/filter/scope.d.mts +0 -2
  74. package/dist/filter/scope.mjs +1 -2
  75. package/dist/filter/types.d.mts +0 -2
  76. package/dist/filter/walk.d.mts +0 -2
  77. package/dist/filter/walk.mjs +1 -2
  78. package/dist/hash/index.d.mts +0 -2
  79. package/dist/hash/index.mjs +1 -2
  80. package/dist/hooks/engine.d.mts +0 -2
  81. package/dist/hooks/engine.mjs +1 -2
  82. package/dist/hooks/events.d.mts +0 -2
  83. package/dist/hooks/events.mjs +1 -2
  84. package/dist/hooks/priority.d.mts +0 -2
  85. package/dist/hooks/priority.mjs +1 -2
  86. package/dist/hooks/types.d.mts +0 -2
  87. package/dist/idempotency/index.d.mts +0 -2
  88. package/dist/idempotency/index.mjs +1 -2
  89. package/dist/loader/batch-loader.d.mts +0 -2
  90. package/dist/loader/batch-loader.mjs +1 -2
  91. package/dist/loader/index.mjs +1 -2
  92. package/dist/lock/index.d.mts +0 -2
  93. package/dist/lock/index.mjs +1 -2
  94. package/dist/lookup/types.d.mts +0 -2
  95. package/dist/operations/index.mjs +1 -2
  96. package/dist/operations/registry.d.mts +0 -2
  97. package/dist/operations/registry.mjs +1 -2
  98. package/dist/operations/types.d.mts +0 -2
  99. package/dist/pagination/canonical.d.mts +0 -2
  100. package/dist/pagination/canonical.mjs +1 -2
  101. package/dist/pagination/cursor.d.mts +0 -2
  102. package/dist/pagination/cursor.mjs +1 -2
  103. package/dist/pagination/keyset.d.mts +0 -2
  104. package/dist/pagination/keyset.mjs +1 -2
  105. package/dist/pagination/merge-keyset.d.mts +0 -2
  106. package/dist/pagination/merge-keyset.mjs +1 -2
  107. package/dist/pagination/offset.d.mts +0 -2
  108. package/dist/pagination/offset.mjs +1 -2
  109. package/dist/pagination/types.d.mts +0 -2
  110. package/dist/plugins/index.mjs +1 -2
  111. package/dist/plugins/tenant-helpers.d.mts +0 -2
  112. package/dist/plugins/tenant-helpers.mjs +1 -2
  113. package/dist/query-parser/coerce.d.mts +0 -2
  114. package/dist/query-parser/coerce.mjs +1 -2
  115. package/dist/query-parser/errors.d.mts +0 -2
  116. package/dist/query-parser/errors.mjs +1 -2
  117. package/dist/query-parser/format-query.d.mts +30 -0
  118. package/dist/query-parser/format-query.mjs +90 -0
  119. package/dist/query-parser/grammar.d.mts +0 -2
  120. package/dist/query-parser/grammar.mjs +1 -2
  121. package/dist/query-parser/index.d.mts +2 -1
  122. package/dist/query-parser/index.mjs +2 -1
  123. package/dist/query-parser/parse-url.d.mts +0 -2
  124. package/dist/query-parser/parse-url.mjs +1 -2
  125. package/dist/query-parser/regex-safety.d.mts +0 -2
  126. package/dist/query-parser/regex-safety.mjs +1 -2
  127. package/dist/query-parser/reserved.d.mts +0 -2
  128. package/dist/query-parser/reserved.mjs +1 -2
  129. package/dist/query-parser/types.d.mts +0 -2
  130. package/dist/repository/agg-output.d.mts +0 -2
  131. package/dist/repository/agg-output.mjs +1 -2
  132. package/dist/repository/archive.d.mts +0 -2
  133. package/dist/repository/archive.mjs +1 -2
  134. package/dist/repository/base.d.mts +0 -2
  135. package/dist/repository/base.mjs +1 -2
  136. package/dist/repository/bulk-upsert.d.mts +0 -2
  137. package/dist/repository/bulk-upsert.mjs +1 -2
  138. package/dist/repository/capabilities.d.mts +0 -2
  139. package/dist/repository/distribution.d.mts +0 -2
  140. package/dist/repository/distribution.mjs +1 -2
  141. package/dist/repository/options.d.mts +0 -2
  142. package/dist/repository/options.mjs +1 -2
  143. package/dist/repository/plugin-types.d.mts +0 -2
  144. package/dist/repository/plugin-types.mjs +1 -2
  145. package/dist/repository/purge.d.mts +0 -2
  146. package/dist/repository/purge.mjs +1 -2
  147. package/dist/repository/read-only.d.mts +0 -2
  148. package/dist/repository/read-only.mjs +1 -2
  149. package/dist/repository/resilience.d.mts +0 -2
  150. package/dist/repository/resilience.mjs +1 -2
  151. package/dist/repository/retrying-transaction.d.mts +0 -2
  152. package/dist/repository/retrying-transaction.mjs +1 -2
  153. package/dist/repository/types.d.mts +0 -2
  154. package/dist/schema/field-rules.d.mts +0 -2
  155. package/dist/schema/field-rules.mjs +1 -2
  156. package/dist/schema/generator.d.mts +0 -2
  157. package/dist/schema/generator.mjs +1 -2
  158. package/dist/schema/standard-schema.d.mts +0 -2
  159. package/dist/schema/standard-schema.mjs +1 -2
  160. package/dist/schema/types.d.mts +0 -2
  161. package/dist/sync/index.d.mts +0 -2
  162. package/dist/sync/index.mjs +0 -0
  163. package/dist/tenant/index.mjs +1 -2
  164. package/dist/tenant/resolve.d.mts +0 -2
  165. package/dist/tenant/resolve.mjs +1 -2
  166. package/dist/tenant/types.d.mts +0 -2
  167. package/dist/testing/change-log-conformance.d.mts +0 -2
  168. package/dist/testing/change-log-conformance.mjs +1 -2
  169. package/dist/testing/command-stream-conformance.d.mts +0 -2
  170. package/dist/testing/command-stream-conformance.mjs +1 -2
  171. package/dist/testing/conformance.d.mts +0 -2
  172. package/dist/testing/conformance.mjs +1 -2
  173. package/dist/testing/data-access-conformance.d.mts +0 -2
  174. package/dist/testing/data-access-conformance.mjs +1 -2
  175. package/dist/testing/idempotency-conformance.d.mts +0 -2
  176. package/dist/testing/idempotency-conformance.mjs +1 -2
  177. package/dist/testing/lock-conformance.d.mts +0 -2
  178. package/dist/testing/lock-conformance.mjs +1 -2
  179. package/dist/testing/merge-keyset-conformance.d.mts +0 -2
  180. package/dist/testing/merge-keyset-conformance.mjs +1 -2
  181. package/dist/testing/pagination-property-conformance.d.mts +0 -2
  182. package/dist/testing/pagination-property-conformance.mjs +1 -2
  183. package/dist/testing/purge-conformance.d.mts +0 -2
  184. package/dist/testing/purge-conformance.mjs +1 -2
  185. package/dist/testing/query-grammar-conformance.d.mts +0 -2
  186. package/dist/testing/query-grammar-conformance.mjs +1 -2
  187. package/dist/testing/read-model-property-conformance.d.mts +0 -2
  188. package/dist/testing/read-model-property-conformance.mjs +1 -2
  189. package/dist/testing/types.d.mts +0 -2
  190. package/dist/testing/usage-conformance.d.mts +0 -2
  191. package/dist/testing/usage-conformance.mjs +1 -2
  192. package/dist/update/builders.d.mts +0 -2
  193. package/dist/update/builders.mjs +1 -2
  194. package/dist/update/compile.d.mts +0 -2
  195. package/dist/update/compile.mjs +1 -2
  196. package/dist/update/guard.d.mts +0 -2
  197. package/dist/update/guard.mjs +1 -2
  198. package/dist/update/types.d.mts +0 -2
  199. package/dist/usage/index.d.mts +0 -2
  200. package/dist/usage/index.mjs +1 -2
  201. package/llms.txt +29 -0
  202. package/package.json +7 -4
  203. package/skills/repo-core/SKILL.md +108 -0
  204. package/skills/repo-core/references/contracts.md +69 -0
  205. package/skills/repo-core/references/kit-authoring.md +75 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to `@classytic/repo-core` are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.32.0] - 2026-10-23
8
+
9
+ ### Added - `formatQuery` / `stringifyQuery` (`./query-parser`)
10
+
11
+ The inverse of `parseUrl`: typed filter terms `{ field, op?, value, flags? }` plus `sort`, `page`, `limit`, `search` become the flat bracket params the parser accepts. Operators come from `URL_OPERATORS`; `between` is sent as `gte` + `lte`; `in`/`nin` take arrays; Dates go as ISO; empty values are no filter; a value the grammar cannot carry (comma in a list value, the text `null`, a repeated field and operator) throws `QueryGrammarError`. Round-trip tests cover every operator. Types: `FilterTerm`, `FilterOperator`, `FormatQueryInput`, `QueryParams`.
12
+
13
+ ### Added - agent skill and `llms.txt`
14
+
15
+ `skills/repo-core` and `llms.txt` ship in the package, and `npm run check:skills` (part of `prepublishOnly`) verifies that every import, subpath and API name they mention exists in the built package.
16
+
17
+ ### Changed - peer floor to the latest published
18
+
19
+ `fast-check` `^4.10.2` (optional peer of `./testing`).
20
+
7
21
  ## [0.31.1] - 2026-10-13
8
22
 
9
23
  ### Fixed — `fast-check` is an optional peer of `./testing`
@@ -1,7 +1,6 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
3
3
  if (typeof require !== "undefined") return require.apply(this, arguments);
4
4
  throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
5
5
  });
6
- //#endregion
7
6
  export { __require };
@@ -1,2 +1 @@
1
- import { asRepositoryLike, isRepository } from "./widen.mjs";
2
- export { asRepositoryLike, isRepository };
1
+ export { asRepositoryLike, isRepository } from "./widen.mjs";
@@ -1,6 +1,5 @@
1
1
  import { DeleteResult, MinimalRepo, StandardRepo } from "../repository/types.mjs";
2
2
  import { SchemaBuilderOptions } from "../schema/types.mjs";
3
- //#region src/adapter/types.d.ts
4
3
  /**
5
4
  * Cross-kit repository contract.
6
5
  *
@@ -235,5 +234,4 @@ interface DataAdapter<TDoc = unknown> {
235
234
  * options (e.g. `{ model, schemaGenerator, ... }`).
236
235
  */
237
236
  type AdapterFactory<TDoc = unknown> = (config: unknown) => DataAdapter<TDoc>;
238
- //#endregion
239
237
  export { AdapterFactory, AdapterRepositoryInput, AdapterSchemaContext, AdapterValidationResult, DataAdapter, FieldMetadata, OpenApiSchemas, RelationMetadata, RepositoryLike, SchemaMetadata };
@@ -1,5 +1,4 @@
1
1
  import { AdapterRepositoryInput, RepositoryLike } from "./types.mjs";
2
- //#region src/adapter/widen.d.ts
3
2
  /**
4
3
  * Widen a permissive `AdapterRepositoryInput<TDoc>` to the strict
5
4
  * `RepositoryLike<TDoc>` view used by host internals.
@@ -17,5 +16,4 @@ declare function asRepositoryLike<TDoc = unknown>(input: AdapterRepositoryInput<
17
16
  * factories to validate input before wrapping.
18
17
  */
19
18
  declare function isRepository<TDoc = unknown>(value: unknown): value is RepositoryLike<TDoc>;
20
- //#endregion
21
19
  export { asRepositoryLike, isRepository };
@@ -1,4 +1,4 @@
1
- //#region src/adapter/widen.ts
1
+ // src/adapter/widen.ts
2
2
  /**
3
3
  * Widen a permissive `AdapterRepositoryInput<TDoc>` to the strict
4
4
  * `RepositoryLike<TDoc>` view used by host internals.
@@ -22,5 +22,4 @@ function isRepository(value) {
22
22
  const v = value;
23
23
  return typeof v["getAll"] === "function" && typeof v["getById"] === "function" && typeof v["create"] === "function" && typeof v["update"] === "function" && typeof v["delete"] === "function";
24
24
  }
25
- //#endregion
26
25
  export { asRepositoryLike, isRepository };
@@ -1,4 +1,3 @@
1
- //#region src/aggregate/keyset.d.ts
2
1
  /**
3
2
  * Keyset (cursor) pagination helpers — the portable, kit-neutral half.
4
3
  *
@@ -53,5 +52,4 @@ declare function isKeysetMode(req: {
53
52
  pagination?: string;
54
53
  after?: string;
55
54
  }): boolean;
56
- //#endregion
57
55
  export { DecodedCursor, decodeAggCursor, encodeAggCursor, isKeysetMode };
@@ -1,4 +1,4 @@
1
- //#region src/aggregate/keyset.ts
1
+ // src/aggregate/keyset.ts
2
2
  /**
3
3
  * Encode a cursor from the last row of a page given the sort spec.
4
4
  *
@@ -41,5 +41,4 @@ function isKeysetMode(req) {
41
41
  if (typeof req.after === "string" && req.after.length > 0) return true;
42
42
  return false;
43
43
  }
44
- //#endregion
45
44
  export { decodeAggCursor, encodeAggCursor, isKeysetMode };
@@ -1,5 +1,4 @@
1
1
  import { AggRequest } from "../repository/types.mjs";
2
- //#region src/aggregate/normalize.d.ts
3
2
  /**
4
3
  * Normalize `AggRequest['groupBy']` into a readonly string array.
5
4
  * Returns `[]` for scalar aggregation (no groupBy). Downstream
@@ -19,5 +18,4 @@ declare function normalizeGroupBy(groupBy: AggRequest['groupBy']): readonly stri
19
18
  * to walk the trace.
20
19
  */
21
20
  declare function validateMeasures(measures: AggRequest['measures'], kitName: string): void;
22
- //#endregion
23
21
  export { normalizeGroupBy, validateMeasures };
@@ -1,4 +1,4 @@
1
- //#region src/aggregate/normalize.ts
1
+ // src/aggregate/normalize.ts
2
2
  /**
3
3
  * Normalize `AggRequest['groupBy']` into a readonly string array.
4
4
  * Returns `[]` for scalar aggregation (no groupBy). Downstream
@@ -24,5 +24,4 @@ function normalizeGroupBy(groupBy) {
24
24
  function validateMeasures(measures, kitName) {
25
25
  if (!measures || Object.keys(measures).length === 0) throw new Error(`${kitName}/aggregate: AggRequest requires at least one measure — empty measures bag is a wiring bug`);
26
26
  }
27
- //#endregion
28
27
  export { normalizeGroupBy, validateMeasures };
@@ -1,4 +1,3 @@
1
- //#region src/better-auth/index.d.ts
2
1
  /**
3
2
  * Better Auth — kit-agnostic registry of which collections each plugin owns.
4
3
  *
@@ -118,5 +117,4 @@ interface ResolveBetterAuthCollectionsOptions {
118
117
  * collection names. `core` is always included.
119
118
  */
120
119
  declare function resolveBetterAuthCollections(options?: ResolveBetterAuthCollectionsOptions): string[];
121
- //#endregion
122
120
  export { BA_COLLECTIONS_BY_PLUGIN, BetterAuthPluginKey, ResolveBetterAuthCollectionsOptions, pluralizeBetterAuthCollection, resolveBetterAuthCollections };
@@ -1,4 +1,4 @@
1
- //#region src/better-auth/index.ts
1
+ // src/better-auth/index.ts
2
2
  /**
3
3
  * Canonical collection lists per plugin. `core` is always implied by
4
4
  * `resolveBetterAuthCollections` — callers don't need to pass it.
@@ -74,5 +74,4 @@ function resolveBetterAuthCollections(options = {}) {
74
74
  }
75
75
  return unique;
76
76
  }
77
- //#endregion
78
77
  export { BA_COLLECTIONS_BY_PLUGIN, pluralizeBetterAuthCollection, resolveBetterAuthCollections };
@@ -1,6 +1,5 @@
1
1
  import { CacheReadResult, ResolvedCacheOptions } from "./options.mjs";
2
2
  import { CacheAdapter } from "./types.mjs";
3
- //#region src/cache/engine.d.ts
4
3
  interface CacheEngineOptions {
5
4
  /** Cache key namespace prefix. Default: `'rc'`. */
6
5
  prefix?: string;
@@ -152,5 +151,4 @@ declare class CacheEngine {
152
151
  */
153
152
  prefetch<TData>(key: string, opts: ResolvedCacheOptions, fetcher: () => Promise<TData>): Promise<TData>;
154
153
  }
155
- //#endregion
156
154
  export { CacheAdapterResolver, CacheAdapterSource, CacheEngine, CacheEngineOptions, SingleFlightClaim };
@@ -1,7 +1,7 @@
1
1
  import { buildEnvelope, inspectEnvelope } from "./envelope.mjs";
2
2
  import { appendKeyToTags, invalidateByTags } from "./tag-index.mjs";
3
3
  import { bumpModelVersion, getModelVersion } from "./version-store.mjs";
4
- //#region src/cache/engine.ts
4
+ // src/cache/engine.ts
5
5
  /**
6
6
  * `CacheEngine` — the SWR + TTL + tag-invalidation behavior on top of
7
7
  * a `CacheAdapter`. ONE implementation of the cache-flow primitives,
@@ -274,5 +274,4 @@ function resolveJitter(jitter) {
274
274
  return Math.max(1, Math.round(jittered));
275
275
  };
276
276
  }
277
- //#endregion
278
277
  export { CacheEngine };
@@ -1,4 +1,4 @@
1
- //#region src/cache/envelope.ts
1
+ // src/cache/envelope.ts
2
2
  /** Build an envelope from raw data + freshness windows (seconds). */
3
3
  function buildEnvelope(data, staleTimeSeconds, gcTimeSeconds, tags, now = Date.now()) {
4
4
  const staleAfter = now + Math.max(0, staleTimeSeconds) * 1e3;
@@ -28,5 +28,4 @@ function inspectEnvelope(envelope, now = Date.now()) {
28
28
  envelope
29
29
  };
30
30
  }
31
- //#endregion
32
31
  export { buildEnvelope, inspectEnvelope };
@@ -1,5 +1,5 @@
1
1
  import { stableStringify } from "./stable-stringify.mjs";
2
- //#region src/cache/keys.ts
2
+ // src/cache/keys.ts
3
3
  /**
4
4
  * Cache key derivation. Builds stable keys from operation context so
5
5
  * any kit + arc + Express/Nest hosts compute the same key for the
@@ -127,5 +127,4 @@ function fnv1a64(str) {
127
127
  }
128
128
  return hash.toString(36);
129
129
  }
130
- //#endregion
131
130
  export { buildCacheKey, extractScopeTags, mergeTags, scopeKeyFromTags, tagIndexKey, versionKey };
@@ -1,4 +1,3 @@
1
- //#region src/cache/memo.d.ts
2
1
  /**
3
2
  * `createTtlMemo` — memoise a keyed async load for `ttlMs`, single-flight.
4
3
  *
@@ -30,5 +29,4 @@ interface TtlMemo<K, V> {
30
29
  invalidate(key?: K): Promise<void>;
31
30
  }
32
31
  declare function createTtlMemo<K, V>(load: (key: K) => Promise<V>, options: TtlMemoOptions<K>): TtlMemo<K, V>;
33
- //#endregion
34
32
  export { TtlMemo, TtlMemoOptions, createTtlMemo };
@@ -1,6 +1,6 @@
1
1
  import { CacheEngine } from "./engine.mjs";
2
2
  import { createMemoryCacheAdapter } from "./memory-adapter.mjs";
3
- //#region src/cache/memo.ts
3
+ // src/cache/memo.ts
4
4
  /**
5
5
  * `createTtlMemo` — memoise a keyed async load for `ttlMs`, single-flight.
6
6
  *
@@ -56,5 +56,4 @@ function createTtlMemo(load, options) {
56
56
  }
57
57
  };
58
58
  }
59
- //#endregion
60
59
  export { createTtlMemo };
@@ -1,5 +1,4 @@
1
1
  import { CacheAdapter } from "./types.mjs";
2
- //#region src/cache/memory-adapter.d.ts
3
2
  interface MemoryCacheAdapterOptions {
4
3
  /**
5
4
  * Hard entry ceiling; the least-recently-used entry is evicted past it.
@@ -20,5 +19,4 @@ interface MemoryCacheAdapterOptions {
20
19
  /** Minimal in-memory `Map`-backed adapter with per-key TTL, LRU eviction and
21
20
  * prefix invalidation. */
22
21
  declare function createMemoryCacheAdapter(options?: MemoryCacheAdapterOptions): CacheAdapter;
23
- //#endregion
24
22
  export { MemoryCacheAdapterOptions, createMemoryCacheAdapter };
@@ -1,4 +1,4 @@
1
- //#region src/cache/memory-adapter.ts
1
+ // src/cache/memory-adapter.ts
2
2
  /** Minimal in-memory `Map`-backed adapter with per-key TTL, LRU eviction and
3
3
  * prefix invalidation. */
4
4
  function createMemoryCacheAdapter(options = {}) {
@@ -100,5 +100,4 @@ function createMemoryCacheAdapter(options = {}) {
100
100
  }
101
101
  };
102
102
  }
103
- //#endregion
104
103
  export { createMemoryCacheAdapter };
@@ -1,4 +1,3 @@
1
- //#region src/cache/options.d.ts
2
1
  /**
3
2
  * Canonical per-call cache options. TanStack Query-shaped — the same
4
3
  * `staleTime` / `gcTime` mental model browser developers already know,
@@ -108,5 +107,4 @@ interface ResolvedCacheOptions {
108
107
  enabled: boolean;
109
108
  key?: string;
110
109
  }
111
- //#endregion
112
110
  export { CacheOptions, CacheReadResult, ResolvedCacheOptions };
@@ -1,4 +1,4 @@
1
- //#region src/cache/options.ts
1
+ // src/cache/options.ts
2
2
  /**
3
3
  * Merge precedence (highest wins): per-call > per-op-default > plugin-default > built-in.
4
4
  *
@@ -21,5 +21,4 @@ function resolveCacheOptions(callOpts, perOpDefaults, pluginDefaults) {
21
21
  ...merged.key !== void 0 ? { key: merged.key } : {}
22
22
  };
23
23
  }
24
- //#endregion
25
24
  export { resolveCacheOptions };
@@ -1,4 +1,3 @@
1
- //#region src/cache/plugin/context.d.ts
2
1
  /**
3
2
  * Default per-op allowlist of context fields that affect result shape
4
3
  * (and therefore must participate in the cache key). Hosts can extend
@@ -14,5 +13,4 @@
14
13
  * option (e.g. mongoose's `lean`, prisma's `select` shape, etc.).
15
14
  */
16
15
  declare const DEFAULT_SHAPE_KEYS_BY_OP: Readonly<Record<string, readonly string[]>>;
17
- //#endregion
18
16
  export { DEFAULT_SHAPE_KEYS_BY_OP };
@@ -1,4 +1,4 @@
1
- //#region src/cache/plugin/context.ts
1
+ // src/cache/plugin/context.ts
2
2
  /**
3
3
  * Cast a raw hook context into the typed slots view. One call per
4
4
  * hook entry; subsequent slot reads/writes use plain dotted access.
@@ -119,5 +119,4 @@ function extractCallCacheOptions(context, op) {
119
119
  const inOptions = context["options"]?.["cache"];
120
120
  if (inOptions && typeof inOptions === "object") return inOptions;
121
121
  }
122
- //#endregion
123
122
  export { AGGREGATE_OPS, DEFAULT_SHAPE_KEYS_BY_OP, ctx, extractCallCacheOptions, extractShapeFields };
@@ -2,7 +2,6 @@ import { Plugin } from "../../repository/plugin-types.mjs";
2
2
  import { CacheOptions, CacheReadResult } from "../options.mjs";
3
3
  import { CacheAdapterSource, CacheEngine } from "../engine.mjs";
4
4
  import { DEFAULT_SHAPE_KEYS_BY_OP } from "./context.mjs";
5
- //#region src/cache/plugin/index.d.ts
6
5
  /** Default read ops the plugin caches. Kits may override per resource. */
7
6
  declare const DEFAULT_CACHEABLE_OPS: readonly ['getById', 'getAll', 'getOne', 'getByQuery', 'count', 'exists', 'distinct', 'aggregate', 'aggregatePaginate'];
8
7
  /** Default mutating ops that bump version + invalidate tags on success. */
@@ -99,5 +98,4 @@ interface RepositoryCacheHandle {
99
98
  * and `softDelete` so policy filters land in the cache key.
100
99
  */
101
100
  declare function cachePlugin(options: RepositoryCachePluginOptions): Plugin;
102
- //#endregion
103
101
  export { DEFAULT_CACHEABLE_OPS, DEFAULT_INVALIDATING_OPS, DEFAULT_SHAPE_KEYS_BY_OP, LogCallbacks, RepositoryCacheHandle, RepositoryCachePluginOptions, cachePlugin };
@@ -2,7 +2,7 @@ import { CacheEngine } from "../engine.mjs";
2
2
  import { DEFAULT_SHAPE_KEYS_BY_OP } from "./context.mjs";
3
3
  import { registerInvalidationHooks } from "./invalidation-hooks.mjs";
4
4
  import { registerReadHooks } from "./read-hooks.mjs";
5
- //#region src/cache/plugin/index.ts
5
+ // src/cache/plugin/index.ts
6
6
  /** Default read ops the plugin caches. Kits may override per resource. */
7
7
  const DEFAULT_CACHEABLE_OPS = [
8
8
  "getById",
@@ -74,5 +74,4 @@ function cachePlugin(options) {
74
74
  }
75
75
  };
76
76
  }
77
- //#endregion
78
77
  export { DEFAULT_CACHEABLE_OPS, DEFAULT_INVALIDATING_OPS, DEFAULT_SHAPE_KEYS_BY_OP, cachePlugin };
@@ -1,7 +1,7 @@
1
1
  import { HOOK_PRIORITY } from "../../hooks/priority.mjs";
2
2
  import { extractScopeTags, mergeTags, scopeKeyFromTags } from "../keys.mjs";
3
3
  import { ctx } from "./context.mjs";
4
- //#region src/cache/plugin/invalidation-hooks.ts
4
+ // src/cache/plugin/invalidation-hooks.ts
5
5
  /**
6
6
  * Write-side hook registration: `after:<op>` for every mutating op
7
7
  * bumps the model's version (per-scope when possible) and invalidates
@@ -31,5 +31,4 @@ function registerInvalidationHooks(repo, op, engine, hookCtx) {
31
31
  hookCtx.log.onInvalidate?.(model, version, count);
32
32
  }, { priority: HOOK_PRIORITY.CACHE });
33
33
  }
34
- //#endregion
35
34
  export { registerInvalidationHooks };
@@ -3,7 +3,7 @@ import { buildCacheKey, extractScopeTags, mergeTags, scopeKeyFromTags } from "..
3
3
  import { ctx, extractCallCacheOptions, extractShapeFields } from "./context.mjs";
4
4
  import { resolveCacheOptions } from "../options.mjs";
5
5
  import { scheduleSwrRefresh } from "./swr.mjs";
6
- //#region src/cache/plugin/read-hooks.ts
6
+ // src/cache/plugin/read-hooks.ts
7
7
  /**
8
8
  * Read-side hook registration: `before:<op>` (cache check + single-
9
9
  * flight claim), `after:<op>` (cache write + resolve waiters), and
@@ -93,5 +93,4 @@ async function deriveKey(engine, op, context, scopeTags, hookCtx) {
93
93
  scopeTags
94
94
  });
95
95
  }
96
- //#endregion
97
96
  export { registerReadHooks };
@@ -1,6 +1,6 @@
1
1
  import { AGGREGATE_OPS } from "./context.mjs";
2
2
  import { scheduleBackground } from "../runtime.mjs";
3
- //#region src/cache/plugin/swr.ts
3
+ // src/cache/plugin/swr.ts
4
4
  function scheduleSwrRefresh(op, repo, context) {
5
5
  if (!AGGREGATE_OPS.has(op)) return;
6
6
  const aggReq = context["aggRequest"];
@@ -16,5 +16,4 @@ function scheduleSwrRefresh(op, repo, context) {
16
16
  repo[op]?.(refreshReq).catch(() => {});
17
17
  });
18
18
  }
19
- //#endregion
20
19
  export { scheduleSwrRefresh };
@@ -1,4 +1,3 @@
1
- //#region src/cache/runtime.d.ts
2
1
  /**
3
2
  * Cross-runtime scheduling primitives.
4
3
  *
@@ -39,5 +38,4 @@
39
38
  * error handling — this helper does NOT add a default `.catch`.
40
39
  */
41
40
  declare const scheduleBackground: (fn: () => void) => void;
42
- //#endregion
43
41
  export { scheduleBackground };
@@ -10,5 +10,4 @@ const scheduleBackground = typeof globalThis.setImmediate === "function" ? (fn)
10
10
  } : (fn) => {
11
11
  setTimeout(fn, 0);
12
12
  };
13
- //#endregion
14
13
  export { scheduleBackground };
@@ -1,4 +1,3 @@
1
- //#region src/cache/stable-stringify.d.ts
2
1
  /**
3
2
  * Deterministic JSON stringify — equivalent values produce identical output, different values
4
3
  * never do. Every cache key and `contentHash` is built on it.
@@ -10,5 +9,4 @@
10
9
  * locale: a key that moves with the server's ICU data changes every digest. Arrays keep order.
11
10
  */
12
11
  declare function stableStringify(value: unknown): string;
13
- //#endregion
14
12
  export { stableStringify };
@@ -1,4 +1,4 @@
1
- //#region src/cache/stable-stringify.ts
1
+ // src/cache/stable-stringify.ts
2
2
  /**
3
3
  * Deterministic JSON stringify — equivalent values produce identical output, different values
4
4
  * never do. Every cache key and `contentHash` is built on it.
@@ -18,5 +18,4 @@ function stableStringify(value) {
18
18
  const record = value;
19
19
  return `{${Object.keys(record).filter((k) => record[k] !== void 0).sort((a, b) => a < b ? -1 : a > b ? 1 : 0).map((k) => `${JSON.stringify(k)}:${stableStringify(record[k])}`).join(",")}}`;
20
20
  }
21
- //#endregion
22
21
  export { stableStringify };
@@ -1,5 +1,5 @@
1
1
  import { tagIndexKey } from "./keys.mjs";
2
- //#region src/cache/tag-index.ts
2
+ // src/cache/tag-index.ts
3
3
  /**
4
4
  * Tag side-index — non-pattern-dependent tag invalidation.
5
5
  *
@@ -79,5 +79,4 @@ async function invalidateByTags(adapter, prefix, tags) {
79
79
  await Promise.all(deletions);
80
80
  return cacheKeys.size;
81
81
  }
82
- //#endregion
83
82
  export { appendKeyToTags, invalidateByTags };
@@ -1,5 +1,4 @@
1
1
  import { CacheAdapter } from "./types.mjs";
2
- //#region src/cache/timeout-adapter.d.ts
3
2
  declare class CacheTimeoutError extends Error {
4
3
  readonly op: string;
5
4
  readonly key?: string;
@@ -25,5 +24,4 @@ interface TimeoutAdapterOptions {
25
24
  * complete before the deadline pass through unchanged.
26
25
  */
27
26
  declare function withTimeout(adapter: CacheAdapter, options?: TimeoutAdapterOptions): CacheAdapter;
28
- //#endregion
29
27
  export { CacheTimeoutError, TimeoutAdapterOptions, withTimeout };
@@ -1,4 +1,4 @@
1
- //#region src/cache/timeout-adapter.ts
1
+ // src/cache/timeout-adapter.ts
2
2
  var CacheTimeoutError = class extends Error {
3
3
  op;
4
4
  key;
@@ -54,5 +54,4 @@ function withTimeout(adapter, options = {}) {
54
54
  } } : {}
55
55
  };
56
56
  }
57
- //#endregion
58
57
  export { CacheTimeoutError, withTimeout };
@@ -1,4 +1,3 @@
1
- //#region src/cache/types.d.ts
2
1
  /**
3
2
  * Portable cache adapter contract.
4
3
  *
@@ -101,5 +100,4 @@ interface CacheAdapter {
101
100
  */
102
101
  increment?(key: string, by?: number, ttlSeconds?: number): Promise<number> | number;
103
102
  }
104
- //#endregion
105
103
  export { CacheAdapter };
@@ -1,5 +1,5 @@
1
1
  import { versionKey } from "./keys.mjs";
2
- //#region src/cache/version-store.ts
2
+ // src/cache/version-store.ts
3
3
  /**
4
4
  * Collection-version store — O(1) bulk invalidation by bumping a
5
5
  * counter that's embedded in every cache key.
@@ -53,5 +53,4 @@ async function bumpModelVersion(adapter, prefix, model, scopeKey) {
53
53
  await adapter.set(key, next, VERSION_TTL_SECONDS);
54
54
  return next;
55
55
  }
56
- //#endregion
57
56
  export { bumpModelVersion, getModelVersion };
@@ -1,6 +1,5 @@
1
1
  import { TenantPurgeOptions, TenantPurgeStrategy } from "../repository/types.mjs";
2
2
  import { CleanupStep, CleanupStepContext } from "./types.mjs";
3
- //#region src/cleanup/define-purge-step.d.ts
4
3
  /**
5
4
  * The repository surface a purge step needs — a structural subset of
6
5
  * `StandardRepo`, so any kit repository satisfies it without an adapter.
@@ -72,5 +71,4 @@ declare const REPOSITORY_UNAVAILABLE = "CLEANUP_REPOSITORY_UNAVAILABLE";
72
71
  * processed count alone is never proof (§9).
73
72
  */
74
73
  declare function definePurgeStep(repository: PurgeStepRepository | undefined, spec: PurgeStepSpec): CleanupStep;
75
- //#endregion
76
74
  export { PurgeStepRepository, PurgeStepSpec, REPOSITORY_UNAVAILABLE, SCOPE_REQUIRED, definePurgeStep };
@@ -1,4 +1,4 @@
1
- //#region src/cleanup/define-purge-step.ts
1
+ // src/cleanup/define-purge-step.ts
2
2
  /** Prefix for the blocker raised when the run carries no scope value. */
3
3
  const SCOPE_REQUIRED = "CLEANUP_SCOPE_REQUIRED";
4
4
  /** Prefix for the blocker raised when the repository cannot be reached. */
@@ -103,5 +103,4 @@ function definePurgeStep(repository, spec) {
103
103
  }
104
104
  };
105
105
  }
106
- //#endregion
107
106
  export { REPOSITORY_UNAVAILABLE, SCOPE_REQUIRED, definePurgeStep };
@@ -1,2 +1 @@
1
- import { REPOSITORY_UNAVAILABLE, SCOPE_REQUIRED, definePurgeStep } from "./define-purge-step.mjs";
2
- export { REPOSITORY_UNAVAILABLE, SCOPE_REQUIRED, definePurgeStep };
1
+ export { REPOSITORY_UNAVAILABLE, SCOPE_REQUIRED, definePurgeStep } from "./define-purge-step.mjs";
@@ -1,4 +1,3 @@
1
- //#region src/cleanup/types.d.ts
2
1
  /**
3
2
  * `@classytic/repo-core/cleanup` — the framework-free **cleanup provider step**
4
3
  * contract (data-cleanup / retention design §6.3, §6.6).
@@ -196,5 +195,4 @@ interface CleanupStep {
196
195
  */
197
196
  verify?(ctx: CleanupStepContext): Promise<readonly CleanupStepCheck[]>;
198
197
  }
199
- //#endregion
200
198
  export { CleanupStep, CleanupStepCheck, CleanupStepContext, CleanupStepDisposition, CleanupStepEstimate, CleanupStepExecuteContext, CleanupStepLogger, CleanupStepOutcome, CleanupStepProgress };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "../filter/types.mjs";
2
- //#region src/context/types.d.ts
3
2
  /** The canonical lifecycle-hook context. */
4
3
  interface RepositoryContext {
5
4
  /** Operation name (`'create'`, `'getAll'`, `'update'`, ...). */
@@ -19,5 +18,4 @@ interface RepositoryContext {
19
18
  /** Arbitrary plugin-owned fields (cache markers, soft-delete flags, ...). */
20
19
  [key: string]: unknown;
21
20
  }
22
- //#endregion
23
21
  export { RepositoryContext };
@@ -1,4 +1,3 @@
1
- //#region src/errors/codes.d.ts
2
1
  /**
3
2
  * The error-code vocabulary of the wire — every value a client may see in
4
3
  * `ErrorContract.code`, in one place.
@@ -122,5 +121,4 @@ declare const CURSOR_ERROR_CODES: {
122
121
  };
123
122
  type CursorErrorCode = (typeof CURSOR_ERROR_CODES)[keyof typeof CURSOR_ERROR_CODES];
124
123
  declare const DUPLICATE_KEY_DETAIL_CODE = "duplicate_key";
125
- //#endregion
126
124
  export { ARC_ERROR_CODES, ARC_REASON_CODES, ArcErrorCode, ArcReasonCode, CURSOR_ERROR_CODES, CursorErrorCode, DUPLICATE_KEY_DETAIL_CODE, ERROR_CODES, ErrorCode };
@@ -1,4 +1,4 @@
1
- //#region src/errors/codes.ts
1
+ // src/errors/codes.ts
2
2
  /**
3
3
  * The error-code vocabulary of the wire — every value a client may see in
4
4
  * `ErrorContract.code`, in one place.
@@ -118,5 +118,4 @@ const CURSOR_ERROR_CODES = {
118
118
  SCOPE_MISMATCH: "repo.cursor.scope_mismatch"
119
119
  };
120
120
  const DUPLICATE_KEY_DETAIL_CODE = "duplicate_key";
121
- //#endregion
122
121
  export { ARC_ERROR_CODES, ARC_REASON_CODES, CURSOR_ERROR_CODES, DUPLICATE_KEY_DETAIL_CODE, ERROR_CODES };
@@ -1,4 +1,3 @@
1
- //#region src/errors/conflict.d.ts
2
1
  /**
3
2
  * Concurrency-conflict taxonomy — driver-agnostic contract.
4
3
  *
@@ -80,5 +79,4 @@ declare class VersionConflictError extends Error {
80
79
  * graph, where `instanceof` silently fails across the boundary.
81
80
  */
82
81
  declare function isVersionConflictError(err: unknown): err is VersionConflictError;
83
- //#endregion
84
82
  export { IsTransientConflictFn, VersionConflictError, conservativeMongoIsTransientConflict, isVersionConflictError, neverTransient };
@@ -1,4 +1,4 @@
1
- //#region src/errors/conflict.ts
1
+ // src/errors/conflict.ts
2
2
  /**
3
3
  * Safe default: nothing is transient until the kit says so. The opposite
4
4
  * default (retry everything) turns a deterministic failure into N delayed
@@ -59,5 +59,4 @@ var VersionConflictError = class extends Error {
59
59
  function isVersionConflictError(err) {
60
60
  return err instanceof VersionConflictError || typeof err === "object" && err !== null && err.name === "VersionConflictError" && err.code === "version_conflict";
61
61
  }
62
- //#endregion
63
62
  export { VersionConflictError, conservativeMongoIsTransientConflict, isVersionConflictError, neverTransient };
@@ -1,6 +1,5 @@
1
1
  import { ErrorCode } from "./codes.mjs";
2
2
  import { ErrorContract } from "./types.mjs";
3
- //#region src/errors/contract.d.ts
4
3
  /**
5
4
  * Map an HTTP status code to the canonical {@link ErrorCode}. Used as a
6
5
  * fallback when a thrown `HttpError` lacks an explicit `code` field.
@@ -34,5 +33,4 @@ declare function statusToErrorCode(status: number): ErrorCode;
34
33
  * wire.
35
34
  */
36
35
  declare function toErrorContract(error: unknown): ErrorContract;
37
- //#endregion
38
36
  export { statusToErrorCode, toErrorContract };
@@ -1,5 +1,5 @@
1
1
  import { DUPLICATE_KEY_DETAIL_CODE, ERROR_CODES } from "./codes.mjs";
2
- //#region src/errors/contract.ts
2
+ // src/errors/contract.ts
3
3
  /**
4
4
  * Wire-contract helpers — convert throwable {@link HttpError} into the
5
5
  * serializable {@link ErrorContract} shape, with a `code` cascade so any
@@ -80,5 +80,4 @@ function toErrorContract(error) {
80
80
  if (e.meta) contract.meta = e.meta;
81
81
  return contract;
82
82
  }
83
- //#endregion
84
83
  export { statusToErrorCode, toErrorContract };
@@ -1,5 +1,4 @@
1
1
  import { HttpError } from "./types.mjs";
2
- //#region src/errors/create-error.d.ts
3
2
  /**
4
3
  * Create an error with an HTTP status code attached.
5
4
  *
@@ -14,5 +13,4 @@ import { HttpError } from "./types.mjs";
14
13
  declare function createError(status: number, message: string): HttpError;
15
14
  /** Runtime predicate — true when `value` already carries an `HttpError` shape. */
16
15
  declare function isHttpError(value: unknown): value is HttpError;
17
- //#endregion
18
16
  export { createError, isHttpError };