@classytic/repo-core 0.31.0 → 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 +22 -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 +16 -5
  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
@@ -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 };
@@ -1,4 +1,4 @@
1
- //#region src/errors/create-error.ts
1
+ // src/errors/create-error.ts
2
2
  /**
3
3
  * Create an error with an HTTP status code attached.
4
4
  *
@@ -19,5 +19,4 @@ function isHttpError(value) {
19
19
  const status = value.status;
20
20
  return typeof status === "number" && Number.isFinite(status);
21
21
  }
22
- //#endregion
23
22
  export { createError, isHttpError };
@@ -1,5 +1,4 @@
1
1
  import { DuplicateKeyMeta, HttpError } from "./types.mjs";
2
- //#region src/errors/duplicate-key.d.ts
3
2
  /** Predicate shape kits implement and repositories expose as `isDuplicateKeyError`. */
4
3
  type IsDuplicateKeyErrorFn = (err: unknown) => boolean;
5
4
  /**
@@ -33,5 +32,4 @@ interface ToDuplicateKeyHttpErrorOptions {
33
32
  * only when `exposeValues: true`.
34
33
  */
35
34
  declare function toDuplicateKeyHttpError(meta: DuplicateKeyMeta, options?: ToDuplicateKeyHttpErrorOptions): HttpError;
36
- //#endregion
37
35
  export { IsDuplicateKeyErrorFn, ToDuplicateKeyHttpErrorOptions, conservativeMongoIsDuplicateKey, toDuplicateKeyHttpError };
@@ -1,5 +1,5 @@
1
1
  import { createError } from "./create-error.mjs";
2
- //#region src/errors/duplicate-key.ts
2
+ // src/errors/duplicate-key.ts
3
3
  /**
4
4
  * Duplicate-key detection — driver-agnostic contract.
5
5
  *
@@ -54,5 +54,4 @@ function toDuplicateKeyHttpError(meta, options = {}) {
54
54
  };
55
55
  return httpError;
56
56
  }
57
- //#endregion
58
57
  export { conservativeMongoIsDuplicateKey, toDuplicateKeyHttpError };
@@ -1,4 +1,3 @@
1
- //#region src/errors/schema.d.ts
2
1
  /**
3
2
  * Canonical JSON Schema constants for `ErrorContract` + `ErrorDetail`.
4
3
  *
@@ -97,5 +96,4 @@ declare const errorContractSchema: {
97
96
  };
98
97
  readonly required: readonly ['code', 'message'];
99
98
  };
100
- //#endregion
101
99
  export { errorContractSchema, errorDetailSchema };
@@ -1,4 +1,4 @@
1
- //#region src/errors/schema.ts
1
+ // src/errors/schema.ts
2
2
  /**
3
3
  * Canonical JSON Schema constants for `ErrorContract` + `ErrorDetail`.
4
4
  *
@@ -74,5 +74,4 @@ const errorContractSchema = {
74
74
  },
75
75
  required: ["code", "message"]
76
76
  };
77
- //#endregion
78
77
  export { errorContractSchema, errorDetailSchema };
@@ -1,4 +1,3 @@
1
- //#region src/errors/types.d.ts
2
1
  /**
3
2
  * HTTP-shaped error contracts used across every driver kit, integrator,
4
3
  * and HTTP-emitting service in the org.
@@ -124,5 +123,4 @@ interface ErrorDetail {
124
123
  message: string;
125
124
  meta?: Readonly<Record<string, unknown>>;
126
125
  }
127
- //#endregion
128
126
  export { DuplicateKeyMeta, ErrorContract, ErrorDetail, HttpError, ValidationErrorMeta };
@@ -1,6 +1,5 @@
1
1
  import { EventMeta, RepositoryEventPublisher } from "./types.mjs";
2
2
  import { RepositoryBase } from "../repository/base.mjs";
3
- //#region src/events/emit.d.ts
4
3
  /** Construction-time event wiring. */
5
4
  interface RepositoryEventsOptions {
6
5
  /** Any arc / primitives-compatible transport. Only `publish` is consumed. */
@@ -17,5 +16,4 @@ interface RepositoryEventsOptions {
17
16
  }
18
17
  /** Install the after-hooks. Called by `RepositoryBase`; not host-facing. */
19
18
  declare function registerRepositoryEvents(repo: RepositoryBase, options: RepositoryEventsOptions): void;
20
- //#endregion
21
19
  export { RepositoryEventsOptions, registerRepositoryEvents };
@@ -1,5 +1,5 @@
1
1
  import { HOOK_PRIORITY } from "../hooks/priority.mjs";
2
- //#region src/events/emit.ts
2
+ // src/events/emit.ts
3
3
  const CREATED_OPS = ["create"];
4
4
  const UPDATED_OPS = [
5
5
  "update",
@@ -101,5 +101,4 @@ function registerRepositoryEvents(repo, options) {
101
101
  await publish(buildEvent(verb, result, context, void 0));
102
102
  }, observe);
103
103
  }
104
- //#endregion
105
104
  export { registerRepositoryEvents };
@@ -1,2 +1 @@
1
- import { registerRepositoryEvents } from "./emit.mjs";
2
- export { registerRepositoryEvents };
1
+ export { registerRepositoryEvents } from "./emit.mjs";
@@ -1,4 +1,3 @@
1
- //#region src/events/types.d.ts
2
1
  /**
3
2
  * Domain-event types — structural mirror of the org-wide event contract.
4
3
  *
@@ -69,5 +68,4 @@ interface RepositoryEventPublisher {
69
68
  /** Batch publish (optional). Used for `createMany` when available. */
70
69
  publishMany?(events: readonly DomainEvent[]): Promise<PublishManyResult>;
71
70
  }
72
- //#endregion
73
71
  export { DomainEvent, EventMeta, PublishManyResult, RepositoryEventPublisher };
@@ -1,5 +1,4 @@
1
1
  import { Filter, FilterEq, FilterExists, FilterFalse, FilterGt, FilterGte, FilterIn, FilterLike, FilterLt, FilterLte, FilterNe, FilterNin, FilterRaw, FilterRegex, FilterTrue } from "./types.mjs";
2
- //#region src/filter/builders.d.ts
3
2
  declare const eq: (field: string, value: unknown) => FilterEq;
4
3
  declare const ne: (field: string, value: unknown) => FilterNe;
5
4
  declare const gt: (field: string, value: unknown) => FilterGt;
@@ -55,5 +54,4 @@ declare function isNotNull(field: string): FilterExists;
55
54
  * predicates used in client-side filtering don't rely on `raw`.
56
55
  */
57
56
  declare function raw(sql: string, params?: readonly unknown[]): FilterRaw;
58
- //#endregion
59
57
  export { FALSE, type FilterRaw, TRUE, and, in_ as anyOf, in_, between, contains, endsWith, eq, exists, gt, gte, iEq, not as invert, not, isNotNull, isNull, like, lt, lte, ne, nin, nin as noneOf, or, raw, regex, startsWith };
@@ -1,4 +1,4 @@
1
- //#region src/filter/builders.ts
1
+ // src/filter/builders.ts
2
2
  const eq = (field, value) => Object.freeze({
3
3
  op: "eq",
4
4
  field,
@@ -168,5 +168,4 @@ function raw(sql, params = []) {
168
168
  function escapeLikePattern(value) {
169
169
  return value.replace(/[\\%_]/g, (c) => `\\${c}`);
170
170
  }
171
- //#endregion
172
171
  export { FALSE, TRUE, and, in_ as anyOf, in_, between, contains, endsWith, eq, exists, gt, gte, iEq, not as invert, not, isNotNull, isNull, like, lt, lte, ne, nin, nin as noneOf, or, raw, regex, startsWith };
@@ -1,4 +1,3 @@
1
- //#region src/filter/coerce-dates.d.ts
2
1
  /**
3
2
  * ISO-date coercion for record-shape filters — the canonical helper every
4
3
  * kit shares.
@@ -83,5 +82,4 @@ interface CoerceFilterDatesOptions {
83
82
  isDateField?: (field: string) => boolean;
84
83
  }
85
84
  declare function coerceFilterDates(filter: Record<string, unknown>, options?: CoerceFilterDatesOptions): Record<string, unknown>;
86
- //#endregion
87
85
  export { CoerceFilterDatesOptions, ISO_DATE_PATTERN, coerceFilterDates, tryCoerceIsoDate };
@@ -1,4 +1,4 @@
1
- //#region src/filter/coerce-dates.ts
1
+ // src/filter/coerce-dates.ts
2
2
  /**
3
3
  * ISO-date coercion for record-shape filters — the canonical helper every
4
4
  * kit shares.
@@ -110,5 +110,4 @@ function coerceFilterDates(filter, options) {
110
110
  }
111
111
  return out;
112
112
  }
113
- //#endregion
114
113
  export { ISO_DATE_PATTERN, coerceFilterDates, tryCoerceIsoDate };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/from-record.d.ts
3
2
  /**
4
3
  * Convert a plain record (Mongo-style query object) into a Filter IR
5
4
  * tree. Multiple top-level keys AND together. Empty record → `TRUE`.
@@ -8,5 +7,4 @@ import { Filter } from "./types.mjs";
8
7
  * unchanged so callers can mix-and-match without branching.
9
8
  */
10
9
  declare function recordToFilter(input: Filter | Record<string, unknown>): Filter;
11
- //#endregion
12
10
  export { recordToFilter };
@@ -1,5 +1,5 @@
1
1
  import { TRUE, and, anyOf as in_, contains, endsWith, eq, gt, gte, isNotNull, isNull, like, lt, lte, ne, nin, startsWith } from "./builders.mjs";
2
- //#region src/filter/from-record.ts
2
+ // src/filter/from-record.ts
3
3
  /**
4
4
  * Plain-record → Filter IR conversion — the canonical normalizer every
5
5
  * kit shares (promoted from per-kit copies in repo-core 0.6.0).
@@ -129,5 +129,4 @@ function recordToFilter(input) {
129
129
  if (leaves.length === 1) return leaves[0];
130
130
  return and(...leaves);
131
131
  }
132
- //#endregion
133
132
  export { recordToFilter };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/guard.d.ts
3
2
  /**
4
3
  * True when `value` is a Filter IR node.
5
4
  *
@@ -8,5 +7,4 @@ import { Filter } from "./types.mjs";
8
7
  * values is an array) is left to the compiler — this is the fast-path gate.
9
8
  */
10
9
  declare function isFilter(value: unknown): value is Filter;
11
- //#endregion
12
10
  export { isFilter };
@@ -1,4 +1,4 @@
1
- //#region src/filter/guard.ts
1
+ // src/filter/guard.ts
2
2
  const FILTER_OPS = /* @__PURE__ */ new Set([
3
3
  "eq",
4
4
  "ne",
@@ -30,5 +30,4 @@ function isFilter(value) {
30
30
  const op = value.op;
31
31
  return typeof op === "string" && FILTER_OPS.has(op);
32
32
  }
33
- //#endregion
34
33
  export { isFilter };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/match-record.d.ts
3
2
  /**
4
3
  * Convert an arc Mongo-record `_policyFilters` object into Filter IR.
5
4
  * `{}` → `TRUE`. Throws on unsupported top-level operators.
@@ -15,5 +14,4 @@ declare function policyRecordToFilter(record: Record<string, unknown>): Filter;
15
14
  * @param filters Arc's `_policyFilters` in Mongo record syntax.
16
15
  */
17
16
  declare function matchesRecordFilter(item: unknown, filters: Record<string, unknown>): boolean;
18
- //#endregion
19
17
  export { matchesRecordFilter, policyRecordToFilter };
@@ -1,6 +1,6 @@
1
1
  import { FALSE, TRUE, and, anyOf as in_, eq, gt, gte, invert as not, isNotNull, isNull, lt, lte, nin, or, regex } from "./builders.mjs";
2
2
  import { matchFilter } from "./match.mjs";
3
- //#region src/filter/match-record.ts
3
+ // src/filter/match-record.ts
4
4
  /**
5
5
  * Mongo-record `_policyFilters` → Filter IR conversion + in-memory match.
6
6
  *
@@ -189,5 +189,4 @@ function matchesRecordFilter(item, filters) {
189
189
  if (item === null || typeof item !== "object") return false;
190
190
  return matchFilter(item, policyRecordToFilter(filters));
191
191
  }
192
- //#endregion
193
192
  export { matchesRecordFilter, policyRecordToFilter };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/match.d.ts
3
2
  /** Evaluate a filter against a single document. Returns true iff the doc matches. */
4
3
  declare function matchFilter(doc: unknown, filter: Filter): boolean;
5
4
  /**
@@ -7,5 +6,4 @@ declare function matchFilter(doc: unknown, filter: Filter): boolean;
7
6
  * `array.filter(asPredicate(myFilter))`.
8
7
  */
9
8
  declare function asPredicate<T>(filter: Filter): (doc: T) => boolean;
10
- //#endregion
11
9
  export { asPredicate, matchFilter };
@@ -1,4 +1,4 @@
1
- //#region src/filter/match.ts
1
+ // src/filter/match.ts
2
2
  /** Evaluate a filter against a single document. Returns true iff the doc matches. */
3
3
  function matchFilter(doc, filter) {
4
4
  switch (filter.op) {
@@ -210,5 +210,4 @@ function likeToRegex(pattern) {
210
210
  }
211
211
  return out;
212
212
  }
213
- //#endregion
214
213
  export { asPredicate, matchFilter };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/scope.d.ts
3
2
  /**
4
3
  * Inject a tenant-scope predicate into an existing filter.
5
4
  *
@@ -26,5 +25,4 @@ declare function buildTenantScope(existing: Filter | Record<string, unknown> | u
26
25
  declare function mergeScope(existing: Filter | Record<string, unknown> | undefined, scope: Filter): Filter;
27
26
  /** Convenience: scope that matches everything — the identity under AND. */
28
27
  declare const SCOPE_ANY: Filter;
29
- //#endregion
30
28
  export { SCOPE_ANY, buildTenantScope, mergeScope };
@@ -1,6 +1,6 @@
1
1
  import { isFilter } from "./guard.mjs";
2
2
  import { TRUE, and, eq } from "./builders.mjs";
3
- //#region src/filter/scope.ts
3
+ // src/filter/scope.ts
4
4
  /**
5
5
  * Scope-injection helpers.
6
6
  *
@@ -50,5 +50,4 @@ function mergeScope(existing, scope) {
50
50
  }
51
51
  /** Convenience: scope that matches everything — the identity under AND. */
52
52
  const SCOPE_ANY = TRUE;
53
- //#endregion
54
53
  export { SCOPE_ANY, buildTenantScope, mergeScope };
@@ -1,4 +1,3 @@
1
- //#region src/filter/types.d.ts
2
1
  /**
3
2
  * Filter IR — driver-agnostic query AST.
4
3
  *
@@ -139,5 +138,4 @@ interface FilterRaw {
139
138
  type Filter = FilterEq | FilterNe | FilterGt | FilterGte | FilterLt | FilterLte | FilterIn | FilterNin | FilterLike | FilterRegex | FilterExists | FilterAnd | FilterOr | FilterNot | FilterTrue | FilterFalse | FilterRaw;
140
139
  /** Narrow set of ops for pattern-matching exhaustiveness checks. */
141
140
  type FilterOp = Filter['op'];
142
- //#endregion
143
141
  export { Filter, FilterAnd, FilterEq, FilterExists, FilterFalse, FilterGt, FilterGte, FilterIn, FilterLike, FilterLt, FilterLte, FilterNe, FilterNin, FilterNot, FilterOp, FilterOr, FilterRaw, FilterRegex, FilterTrue };
@@ -1,5 +1,4 @@
1
1
  import { Filter } from "./types.mjs";
2
- //#region src/filter/walk.d.ts
3
2
  /**
4
3
  * Depth-first visit of every node. Visitor returns `false` to stop descent
5
4
  * into the current subtree (e.g. optimization prunes). Otherwise visits
@@ -19,5 +18,4 @@ declare function walkFilter(filter: Filter, visit: (node: Filter) => boolean | u
19
18
  declare function mapFilter(filter: Filter, transform: (node: Filter) => Filter): Filter;
20
19
  /** Collect every field name referenced in the tree. Useful for index hints, policy checks. */
21
20
  declare function collectFields(filter: Filter): string[];
22
- //#endregion
23
21
  export { collectFields, mapFilter, walkFilter };
@@ -1,4 +1,4 @@
1
- //#region src/filter/walk.ts
1
+ // src/filter/walk.ts
2
2
  /**
3
3
  * Depth-first visit of every node. Visitor returns `false` to stop descent
4
4
  * into the current subtree (e.g. optimization prunes). Otherwise visits
@@ -73,5 +73,4 @@ function collectFields(filter) {
73
73
  });
74
74
  return [...seen];
75
75
  }
76
- //#endregion
77
76
  export { collectFields, mapFilter, walkFilter };
@@ -1,5 +1,4 @@
1
1
  import { stableStringify } from "../cache/stable-stringify.mjs";
2
- //#region src/hash/index.d.ts
3
2
  /**
4
3
  * SHA-256 hex digest of a value's canonical (key-order-independent) JSON form.
5
4
  * Equivalent inputs → identical digest. `algorithm` may be any hash Node's
@@ -10,5 +9,4 @@ declare function contentHash(value: unknown, options?: {
10
9
  algorithm?: string;
11
10
  encoding?: 'hex' | 'base64' | 'base64url';
12
11
  }): string;
13
- //#endregion
14
12
  export { contentHash, stableStringify };
@@ -1,6 +1,6 @@
1
1
  import { stableStringify } from "../cache/stable-stringify.mjs";
2
2
  import { createHash } from "node:crypto";
3
- //#region src/hash/index.ts
3
+ // src/hash/index.ts
4
4
  /**
5
5
  * Content-addressing — a stable cryptographic hash of any JSON-serializable value.
6
6
  *
@@ -27,5 +27,4 @@ function contentHash(value, options = {}) {
27
27
  const { algorithm = "sha256", encoding = "hex" } = options;
28
28
  return createHash(algorithm).update(stableStringify(value)).digest(encoding);
29
29
  }
30
- //#endregion
31
30
  export { contentHash, stableStringify };
@@ -1,5 +1,4 @@
1
1
  import { HookListener, HookMode, PrioritizedHook } from "./types.mjs";
2
- //#region src/hooks/engine.d.ts
3
2
  /** The default priority assigned when a user omits one on `on(...)`. */
4
3
  declare const DEFAULT_LISTENER_PRIORITY = 500;
5
4
  declare class HookEngine {
@@ -43,5 +42,4 @@ declare class HookEngine {
43
42
  */
44
43
  listeners(): Map<string, readonly PrioritizedHook[]>;
45
44
  }
46
- //#endregion
47
45
  export { DEFAULT_LISTENER_PRIORITY, HookEngine };
@@ -1,4 +1,4 @@
1
- //#region src/hooks/engine.ts
1
+ // src/hooks/engine.ts
2
2
  /** The default priority assigned when a user omits one on `on(...)`. */
3
3
  const DEFAULT_LISTENER_PRIORITY = 500;
4
4
  var HookEngine = class {
@@ -97,5 +97,4 @@ var HookEngine = class {
97
97
  return snapshot;
98
98
  }
99
99
  };
100
- //#endregion
101
100
  export { DEFAULT_LISTENER_PRIORITY, HookEngine };
@@ -1,4 +1,3 @@
1
- //#region src/hooks/events.d.ts
2
1
  /**
3
2
  * Canonical repository-operation event names.
4
3
  *
@@ -91,5 +90,4 @@ declare const HOOK_EVENTS: {
91
90
  };
92
91
  /** String-literal union of every canonical hook event name. */
93
92
  type HookEventName = (typeof HOOK_EVENTS)[keyof typeof HOOK_EVENTS];
94
- //#endregion
95
93
  export { HOOK_EVENTS, HookEventName };
@@ -1,4 +1,4 @@
1
- //#region src/hooks/events.ts
1
+ // src/hooks/events.ts
2
2
  /**
3
3
  * Canonical repository-operation event names.
4
4
  *
@@ -89,5 +89,4 @@ const HOOK_EVENTS = {
89
89
  AFTER_DISTINCT: "after:distinct",
90
90
  ERROR_DISTINCT: "error:distinct"
91
91
  };
92
- //#endregion
93
92
  export { HOOK_EVENTS };
@@ -1,4 +1,3 @@
1
- //#region src/hooks/priority.d.ts
2
1
  /**
3
2
  * Hook priority constants for the repository lifecycle.
4
3
  *
@@ -29,5 +28,4 @@ declare const HOOK_PRIORITY: {
29
28
  };
30
29
  /** The numeric type of any `HOOK_PRIORITY` value. */
31
30
  type HookPriority = (typeof HOOK_PRIORITY)[keyof typeof HOOK_PRIORITY];
32
- //#endregion
33
31
  export { HOOK_PRIORITY, HookPriority };
@@ -1,4 +1,4 @@
1
- //#region src/hooks/priority.ts
1
+ // src/hooks/priority.ts
2
2
  /**
3
3
  * Hook priority constants for the repository lifecycle.
4
4
  *
@@ -27,5 +27,4 @@ const HOOK_PRIORITY = {
27
27
  /** Default priority for user-registered hooks with no explicit priority. */
28
28
  DEFAULT: 500
29
29
  };
30
- //#endregion
31
30
  export { HOOK_PRIORITY };
@@ -1,4 +1,3 @@
1
- //#region src/hooks/types.d.ts
2
1
  /**
3
2
  * Hook system types.
4
3
  *
@@ -33,5 +32,4 @@ interface PrioritizedHook {
33
32
  }
34
33
  /** Event phase discriminator for hook names. */
35
34
  type EventPhase = 'before' | 'after' | 'error';
36
- //#endregion
37
35
  export { EventPhase, HookListener, HookMode, PrioritizedHook };
@@ -1,4 +1,3 @@
1
- //#region src/idempotency/index.d.ts
2
1
  /**
3
2
  * Idempotency — the ONE contract for "run this command at most once per key".
4
3
  *
@@ -458,5 +457,4 @@ declare function createMemoryIdempotencyStore(): IdempotencyClaimStore & {
458
457
  /** Every stored claim — for assertions. */
459
458
  readonly claims: () => IdempotencyClaim<unknown>[];
460
459
  };
461
- //#endregion
462
460
  export { ClaimDecision, ClaimError, ClaimOutcome, ClaimRequest, ClaimResult, ClaimState, ClaimedDecision, DEFAULT_LEASE_MS, ExhaustedDecision, FailureDisposition, IdempotencyClaim, IdempotencyClaimStore, IdempotencyError, IdempotencyErrorCode, IdempotencyIdentity, IdempotencyStoreCallOptions, IdempotentAttempt, IdempotentReplayError, IdempotentRun, InFlightDecision, MAX_FINGERPRINT_DEPTH, ReplayedDecision, RunIdempotentOptions, completeClaim, createMemoryIdempotencyStore, decideClaim, fingerprintRequest, holdsLease, identityKey, isInFlight, isLeaseExpired, newLeaseToken, renewLease, runIdempotent, sameIdentity };
@@ -1,5 +1,5 @@
1
1
  import { contentHash } from "../hash/index.mjs";
2
- //#region src/idempotency/index.ts
2
+ // src/idempotency/index.ts
3
3
  /**
4
4
  * Idempotency — the ONE contract for "run this command at most once per key".
5
5
  *
@@ -415,5 +415,4 @@ function createMemoryIdempotencyStore() {
415
415
  claims: () => [...rows.values()]
416
416
  };
417
417
  }
418
- //#endregion
419
418
  export { DEFAULT_LEASE_MS, IdempotencyError, IdempotentReplayError, MAX_FINGERPRINT_DEPTH, completeClaim, createMemoryIdempotencyStore, decideClaim, fingerprintRequest, holdsLease, identityKey, isInFlight, isLeaseExpired, newLeaseToken, renewLease, runIdempotent, sameIdentity };
@@ -1,4 +1,3 @@
1
- //#region src/loader/batch-loader.d.ts
2
1
  /**
3
2
  * Collapse many per-item reads issued in one operation into ONE round trip.
4
3
  *
@@ -90,5 +89,4 @@ interface BatchLoader<K, V> {
90
89
  };
91
90
  }
92
91
  declare function createBatchLoader<K, V>(options: BatchLoaderOptions<K, V>): BatchLoader<K, V>;
93
- //#endregion
94
92
  export { BatchLoader, BatchLoaderOptions, DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
@@ -1,4 +1,4 @@
1
- //#region src/loader/batch-loader.ts
1
+ // src/loader/batch-loader.ts
2
2
  /**
3
3
  * Collapse many per-item reads issued in one operation into ONE round trip.
4
4
  *
@@ -149,5 +149,4 @@ function createBatchLoader(options) {
149
149
  stats
150
150
  };
151
151
  }
152
- //#endregion
153
152
  export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
@@ -1,2 +1 @@
1
- import { DEFAULT_MAX_BATCH_SIZE, createBatchLoader } from "./batch-loader.mjs";
2
- export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
1
+ export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader } from "./batch-loader.mjs";
@@ -1,4 +1,3 @@
1
- //#region src/lock/index.d.ts
2
1
  /**
3
2
  * Distributed lock contract for the @classytic ecosystem.
4
3
  *
@@ -149,5 +148,4 @@ declare function getInstanceId(): string;
149
148
  * simulate multiple replicas in one process. Pass `null` to reset.
150
149
  */
151
150
  declare function setInstanceIdForTesting(id: string | null): void;
152
- //#endregion
153
151
  export { BaseLockAdapterOptions, LockAdapter, LockState, createMemoryLockAdapter, getInstanceId, setInstanceIdForTesting };
@@ -1,6 +1,6 @@
1
1
  import { __require } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
- //#region src/lock/index.ts
3
+ // src/lock/index.ts
4
4
  /**
5
5
  * Distributed lock contract for the @classytic ecosystem.
6
6
  *
@@ -165,5 +165,4 @@ function buildInstanceId() {
165
165
  function setInstanceIdForTesting(id) {
166
166
  cachedInstanceId = id;
167
167
  }
168
- //#endregion
169
168
  export { createMemoryLockAdapter, getInstanceId, setInstanceIdForTesting };
@@ -1,6 +1,5 @@
1
1
  import { Filter } from "../filter/types.mjs";
2
2
  import { KeysetPaginationResultCore, OffsetPaginationResultCore } from "../pagination/types.mjs";
3
- //#region src/lookup/types.d.ts
4
3
  /**
5
4
  * Single lookup join. Reads like a `LEFT JOIN from ON from.foreignField
6
5
  * = this.localField`, with the joined payload landing on `as`.
@@ -165,5 +164,4 @@ type LookupRow<TBase = Record<string, unknown>, TExtra extends Record<string, un
165
164
  * uniformly so callers don't branch on the kit.
166
165
  */
167
166
  type LookupPopulateResult<TBase = Record<string, unknown>, TExtra extends Record<string, unknown> = Record<string, unknown>> = OffsetPaginationResultCore<LookupRow<TBase, TExtra>> | KeysetPaginationResultCore<LookupRow<TBase, TExtra>>;
168
- //#endregion
169
167
  export { LookupPopulateOptions, LookupPopulateResult, LookupRow, LookupSpec };
@@ -1,2 +1 @@
1
- import { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations } from "./registry.mjs";
2
- export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
1
+ export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations } from "./registry.mjs";
@@ -1,5 +1,4 @@
1
1
  import { CoreRepositoryOperation, OperationDescriptor, OperationRegistry, PolicyKey, RepositoryOperation } from "./types.mjs";
2
- //#region src/operations/registry.d.ts
3
2
  /**
4
3
  * The core registry. Driver kits merge their own descriptors on top of this
5
4
  * via `extendRegistry`.
@@ -36,5 +35,4 @@ declare function operationsByPolicyKey<Op extends string>(registry: OperationReg
36
35
  * kits can introduce operations without every plugin needing an update.
37
36
  */
38
37
  declare function describe<Op extends string>(registry: OperationRegistry<Op>, op: RepositoryOperation): OperationDescriptor | undefined;
39
- //#endregion
40
38
  export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
@@ -1,4 +1,4 @@
1
- //#region src/operations/registry.ts
1
+ // src/operations/registry.ts
2
2
  /**
3
3
  * The core registry. Driver kits merge their own descriptors on top of this
4
4
  * via `extendRegistry`.
@@ -136,5 +136,4 @@ function operationsByPolicyKey(registry, key) {
136
136
  function describe(registry, op) {
137
137
  return Object.hasOwn(registry, op) ? registry[op] : void 0;
138
138
  }
139
- //#endregion
140
139
  export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
@@ -1,4 +1,3 @@
1
- //#region src/operations/types.d.ts
2
1
  /**
3
2
  * Operation-registry type definitions.
4
3
  *
@@ -45,5 +44,4 @@ interface OperationDescriptor {
45
44
  * additions (see `extendRegistry`).
46
45
  */
47
46
  type OperationRegistry<Op extends string = RepositoryOperation> = Readonly<Record<Op, OperationDescriptor>>;
48
- //#endregion
49
47
  export { CoreRepositoryOperation, OperationDescriptor, OperationRegistry, PolicyKey, RepositoryOperation };
@@ -1,5 +1,4 @@
1
1
  import { AnyPaginationResult, BareListResult, PaginatedResult } from "./types.mjs";
2
- //#region src/pagination/canonical.d.ts
3
2
  /**
4
3
  * Type guard: is this value a paginated result envelope (vs a bare array
5
4
  * or some other shape)?
@@ -30,5 +29,4 @@ declare function toCanonicalList<TDoc>(input: TDoc[]): BareListResult<TDoc>;
30
29
  declare function toCanonicalList<TDoc>(input: readonly TDoc[]): BareListResult<TDoc>;
31
30
  declare function toCanonicalList<TDoc, TExtra extends Record<string, unknown>>(input: AnyPaginationResult<TDoc, TExtra>): PaginatedResult<TDoc, TExtra>;
32
31
  declare function toCanonicalList<TDoc>(input: readonly TDoc[] | AnyPaginationResult<TDoc>): PaginatedResult<TDoc>;
33
- //#endregion
34
32
  export { isPaginatedResult, toCanonicalList };
@@ -1,4 +1,4 @@
1
- //#region src/pagination/canonical.ts
1
+ // src/pagination/canonical.ts
2
2
  /**
3
3
  * Type guard: is this value a paginated result envelope (vs a bare array
4
4
  * or some other shape)?
@@ -22,5 +22,4 @@ function toCanonicalList(input) {
22
22
  if (isPaginatedResult(input)) return { ...input };
23
23
  return { data: [...input] };
24
24
  }
25
- //#endregion
26
25
  export { isPaginatedResult, toCanonicalList };
@@ -1,5 +1,4 @@
1
1
  import { DecodedCursor, SortSpec } from "./types.mjs";
2
- //#region src/pagination/cursor.d.ts
3
2
  /**
4
3
  * Encode a document's sort values and id into a base64url cursor token.
5
4
  *
@@ -39,5 +38,4 @@ declare function validateCursorSort(cursorSort: SortSpec, currentSort: SortSpec)
39
38
  * pre-breaking-change deploy; reject so pagination restarts cleanly.
40
39
  */
41
40
  declare function validateCursorVersion(cursorVersion: number, expectedVersion: number, minVersion?: number): void;
42
- //#endregion
43
41
  export { decodeCursor, encodeCursor, validateCursorSort, validateCursorVersion };