@ai-matrx/associations 0.14.87 → 0.14.89

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.
@@ -46,6 +46,7 @@ __export(core_exports, {
46
46
  isContentSourceEdge: () => isContentSourceEdge,
47
47
  isMembershipMetadata: () => isMembershipMetadata,
48
48
  ok: () => ok,
49
+ pluralizeLabel: () => pluralizeLabel,
49
50
  resolveEntityToken: () => resolveEntityToken
50
51
  });
51
52
  module.exports = __toCommonJS(core_exports);
@@ -237,6 +238,7 @@ var ENTITY_TYPE_METADATA = {
237
238
  "billing_coupon_redemption": { token: "billing_coupon_redemption", schema: "billing", table: "coupon_redemption", label: "Coupon redemption", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
238
239
  "billing_customer": { token: "billing_customer", schema: "billing", table: "customer", label: "Billing customer", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
239
240
  "billing_external_call_vendor": { token: "billing_external_call_vendor", schema: "billing", table: "external_call_vendor", label: "External Call Vendor", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
241
+ "billing_free_network_counter": { token: "billing_free_network_counter", schema: "billing", table: "free_network_counter", label: "Free network counter", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
240
242
  "billing_free_period_grant": { token: "billing_free_period_grant", schema: "billing", table: "free_period_grant", label: "Free period grant", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
241
243
  "billing_free_use_counter": { token: "billing_free_use_counter", schema: "billing", table: "free_use_counter", label: "Free use counter", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
242
244
  "billing_hard_cost_reconciliation": { token: "billing_hard_cost_reconciliation", schema: "billing", table: "hard_cost_reconciliation", label: "Hard-cost reconciliation", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1020,6 +1022,7 @@ var ENTITY_TYPE_METADATA = {
1020
1022
  "scrape_retry_queue": { token: "scrape_retry_queue", schema: "scraper", table: "scrape_retry_queue", label: "Scrape Retry Queue", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1021
1023
  "scraper_comparison_run": { token: "scraper_comparison_run", schema: "scraper", table: "comparison_run", label: "Comparison", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1022
1024
  "scraper_data_fetch_job": { token: "scraper_data_fetch_job", schema: "scraper", table: "data_fetch_job", label: "Data fetch", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1025
+ "scraper_data_fetch_job_row": { token: "scraper_data_fetch_job_row", schema: "scraper", table: "data_fetch_job_row", label: "Data fetch run row keys", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1023
1026
  "scraper_data_source": { token: "scraper_data_source", schema: "scraper", table: "data_source", label: "Data source", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1024
1027
  "search_item": { token: "search_item", schema: "platform", table: "search_item", label: "Search item", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
1025
1028
  "seo_ai_capability": { token: "seo_ai_capability", schema: "seo", table: "ai_capability", label: "SEO AI capability", baseTier: 1, isComponent: false, isModule: false, isListed: false, scopeable: true, category: null, referencePickable: false, titleColumn: null, contentRole: null, referenceCategory: null },
@@ -1492,6 +1495,7 @@ var ENTITY_TYPE_TOKENS = [
1492
1495
  "billing_coupon_redemption",
1493
1496
  "billing_customer",
1494
1497
  "billing_external_call_vendor",
1498
+ "billing_free_network_counter",
1495
1499
  "billing_free_period_grant",
1496
1500
  "billing_free_use_counter",
1497
1501
  "billing_hard_cost_reconciliation",
@@ -2275,6 +2279,7 @@ var ENTITY_TYPE_TOKENS = [
2275
2279
  "scrape_retry_queue",
2276
2280
  "scraper_comparison_run",
2277
2281
  "scraper_data_fetch_job",
2282
+ "scraper_data_fetch_job_row",
2278
2283
  "scraper_data_source",
2279
2284
  "search_item",
2280
2285
  "seo_ai_capability",
@@ -2782,6 +2787,36 @@ function createRpcResultHelpers(errorSink, sessionAttached) {
2782
2787
  return { ok, err, mapPgError, mapPgErrorPair };
2783
2788
  }
2784
2789
 
2790
+ // src/core/pluralizeLabel.ts
2791
+ var UNCOUNTABLE = /* @__PURE__ */ new Set([
2792
+ "data",
2793
+ "media",
2794
+ "research",
2795
+ "information",
2796
+ "feedback",
2797
+ "content",
2798
+ "software",
2799
+ "evidence",
2800
+ "equipment",
2801
+ "metadata",
2802
+ "knowledge",
2803
+ "news",
2804
+ "series",
2805
+ "species"
2806
+ ]);
2807
+ function pluralizeLabel(label) {
2808
+ const m = /^(.*?)([A-Za-z]+)$/.exec(label);
2809
+ const head = m?.[1];
2810
+ const word = m?.[2];
2811
+ if (head === void 0 || word === void 0) return label;
2812
+ const lower = word.toLowerCase();
2813
+ if (UNCOUNTABLE.has(lower)) return label;
2814
+ if (lower.endsWith("sis")) return `${head}${word.slice(0, -2)}es`;
2815
+ if (/[^aeiou]y$/.test(lower)) return `${head}${word.slice(0, -1)}ies`;
2816
+ if (/(s|x|z|ch|sh)$/.test(lower)) return `${head}${word}es`;
2817
+ return `${label}s`;
2818
+ }
2819
+
2785
2820
  // src/record-store-nouns.ts
2786
2821
  var RECORD_STORE_NOUNS = {
2787
2822
  /** The canonical Table token (2026-10-07). */
@@ -2893,7 +2928,7 @@ function createEntityRegistry(errorSink, initialOverlay) {
2893
2928
  function getEntityInfo(token) {
2894
2929
  const meta = ENTITY_TYPE_METADATA[token] ?? recordStoreMeta(token) ?? retiredTokenMeta(token);
2895
2930
  const overlay = overlayByToken[token];
2896
- const labelPlural = overlay?.labelPlural ?? `${meta.label}s`;
2931
+ const labelPlural = overlay?.labelPlural ?? pluralizeLabel(meta.label);
2897
2932
  const titleColumn = meta.titleColumn;
2898
2933
  const contentRole = isContentRole(meta.contentRole) ? meta.contentRole : "destination";
2899
2934
  if (meta.contentRole !== null && !isContentRole(meta.contentRole)) {