@ai-matrx/content-ir 0.22.6 → 0.23.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.
package/dist/surfaces.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var textCase = require('@ai-matrx/kit/text-case');
4
+
3
5
  // source/fence-nesting.ts
4
6
  var NESTING_FENCE_LANGUAGES = /* @__PURE__ */ new Set([
5
7
  "markdown",
@@ -1879,42 +1881,6 @@ function deriveInstanceTitle(data, explicit, titleKey) {
1879
1881
  }
1880
1882
  return null;
1881
1883
  }
1882
- var IDENTIFIER_ACRONYMS = [
1883
- "ID",
1884
- "URL",
1885
- "PDF",
1886
- "HTML",
1887
- "JSON",
1888
- "API",
1889
- "AI",
1890
- "UI",
1891
- "CSV",
1892
- "SMS",
1893
- "SEO",
1894
- "LLM",
1895
- "MCP",
1896
- "UUID",
1897
- "ISO"
1898
- ];
1899
- var IDENTIFIER_ACRONYM_SET = new Set(IDENTIFIER_ACRONYMS.map((a) => a.toLowerCase()));
1900
- function humanizeIdentifier(identifier) {
1901
- const text = (identifier ?? "").trim();
1902
- if (text === "") return "";
1903
- if (!text.includes("_") && /\s/.test(text)) {
1904
- return /^\p{Ll}/u.test(text) ? text.charAt(0).toUpperCase() + text.slice(1) : text;
1905
- }
1906
- return text.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)(?![A-Z]s(?![a-z]))([A-Z][a-z])/g, "$1 $2").split(/[_\-.\s]+/).filter((part) => part.length > 0).map(identifierWord).join(" ");
1907
- }
1908
- function identifierWord(part) {
1909
- const lower = part.toLowerCase();
1910
- if (IDENTIFIER_ACRONYM_SET.has(lower)) return part.toUpperCase();
1911
- if (lower.length > 1 && lower.endsWith("s") && IDENTIFIER_ACRONYM_SET.has(lower.slice(0, -1))) {
1912
- return `${lower.slice(0, -1).toUpperCase()}s`;
1913
- }
1914
- return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();
1915
- }
1916
-
1917
- // surfaces/kind-markdown-utils.ts
1918
1884
  function isRecordValue(value) {
1919
1885
  return typeof value === "object" && value !== null && !Array.isArray(value);
1920
1886
  }
@@ -1986,7 +1952,7 @@ function joinBlocks(blocks) {
1986
1952
  return blocks.map((block) => typeof block === "string" ? block.trim() : "").filter((block) => block.length > 0).join("\n\n");
1987
1953
  }
1988
1954
  function humanizeKind(kind) {
1989
- return humanizeIdentifier(kind) || "Artifact";
1955
+ return textCase.humanizeIdentifier(kind) || "Artifact";
1990
1956
  }
1991
1957
  function isKindValue2(value) {
1992
1958
  return isRecordValue(value) && typeof value[KIND_KEY2] === "string" && value[KIND_KEY2].trim().length > 0;
@@ -2542,11 +2508,9 @@ function kindTextPreview(raw) {
2542
2508
  const slug = firstKindSlug(md.slice(keyIndex));
2543
2509
  return { text: head.trimEnd(), pendingKind: slug, pendingUnnamed: slug === null };
2544
2510
  }
2545
-
2546
- // surfaces/kind-one-line.ts
2547
2511
  var UNNAMED = "Structured output";
2548
2512
  function kindName(slug) {
2549
- return slug && humanizeIdentifier(slug) || UNNAMED;
2513
+ return slug && textCase.humanizeIdentifier(slug) || UNNAMED;
2550
2514
  }
2551
2515
  function kindOneLine(value, options = {}) {
2552
2516
  if (!value || typeof value !== "object" || Array.isArray(value)) return UNNAMED;