@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/CHANGELOG.md +21 -0
- package/dist/convert.cjs +36 -292
- package/dist/convert.cjs.map +1 -1
- package/dist/convert.js +35 -291
- package/dist/convert.js.map +1 -1
- package/dist/core.cjs +3 -290
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +2 -289
- package/dist/core.js.map +1 -1
- package/dist/directives.cjs +3 -37
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.js +2 -36
- package/dist/directives.js.map +1 -1
- package/dist/index.cjs +235 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +227 -310
- package/dist/index.js.map +1 -1
- package/dist/json-extract.cjs +942 -0
- package/dist/json-extract.cjs.map +1 -0
- package/dist/json-extract.d.cts +176 -0
- package/dist/json-extract.d.ts +176 -0
- package/dist/json-extract.js +928 -0
- package/dist/json-extract.js.map +1 -0
- package/dist/source.cjs +199 -0
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +138 -1
- package/dist/source.d.ts +138 -1
- package/dist/source.js +193 -1
- package/dist/source.js.map +1 -1
- package/dist/surfaces.cjs +4 -40
- package/dist/surfaces.cjs.map +1 -1
- package/dist/surfaces.js +2 -38
- package/dist/surfaces.js.map +1 -1
- package/package.json +28 -7
- package/dist/text-case.cjs +0 -333
- package/dist/text-case.cjs.map +0 -1
- package/dist/text-case.d.cts +0 -87
- package/dist/text-case.d.ts +0 -87
- package/dist/text-case.js +0 -320
- package/dist/text-case.js.map +0 -1
package/dist/core.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { formatText } from '@ai-matrx/kit/text-case';
|
|
2
|
+
|
|
1
3
|
// core/ir-types.ts
|
|
2
4
|
var IR_VERSION = 1;
|
|
3
5
|
var IR_ENVELOPE_KEY = "__ir";
|
|
@@ -2119,295 +2121,6 @@ function stripKindDeep(value) {
|
|
|
2119
2121
|
}
|
|
2120
2122
|
return value;
|
|
2121
2123
|
}
|
|
2122
|
-
|
|
2123
|
-
// text-case.ts
|
|
2124
|
-
var DEFAULT_WORD_REPLACEMENTS = {
|
|
2125
|
-
// Acronyms & initialisms
|
|
2126
|
-
"api": "API",
|
|
2127
|
-
"apis": "APIs",
|
|
2128
|
-
"ui": "UI",
|
|
2129
|
-
"ux": "UX",
|
|
2130
|
-
"id": "ID",
|
|
2131
|
-
"ids": "IDs",
|
|
2132
|
-
"qr": "QR",
|
|
2133
|
-
"ssr": "SSR",
|
|
2134
|
-
"csr": "CSR",
|
|
2135
|
-
"ssg": "SSG",
|
|
2136
|
-
"isr": "ISR",
|
|
2137
|
-
"spa": "SPA",
|
|
2138
|
-
"pwa": "PWA",
|
|
2139
|
-
"sdk": "SDK",
|
|
2140
|
-
"sdks": "SDKs",
|
|
2141
|
-
"cli": "CLI",
|
|
2142
|
-
"tty": "TTY",
|
|
2143
|
-
"repl": "REPL",
|
|
2144
|
-
"ci": "CI",
|
|
2145
|
-
"cd": "CD",
|
|
2146
|
-
"cpu": "CPU",
|
|
2147
|
-
"cpus": "CPUs",
|
|
2148
|
-
"gpu": "GPU",
|
|
2149
|
-
"gpus": "GPUs",
|
|
2150
|
-
"ram": "RAM",
|
|
2151
|
-
"rom": "ROM",
|
|
2152
|
-
"ssd": "SSD",
|
|
2153
|
-
"ssds": "SSDs",
|
|
2154
|
-
"hdd": "HDD",
|
|
2155
|
-
"hdds": "HDDs",
|
|
2156
|
-
"kpi": "KPI",
|
|
2157
|
-
"kpis": "KPIs",
|
|
2158
|
-
"sla": "SLA",
|
|
2159
|
-
"slas": "SLAs",
|
|
2160
|
-
"slo": "SLO",
|
|
2161
|
-
"slos": "SLOs",
|
|
2162
|
-
"sli": "SLI",
|
|
2163
|
-
"slis": "SLIs",
|
|
2164
|
-
"dom": "DOM",
|
|
2165
|
-
// Web, formats, protocols
|
|
2166
|
-
"url": "URL",
|
|
2167
|
-
"urls": "URLs",
|
|
2168
|
-
"uri": "URI",
|
|
2169
|
-
"uris": "URIs",
|
|
2170
|
-
"http": "HTTP",
|
|
2171
|
-
"https": "HTTPS",
|
|
2172
|
-
"html": "HTML",
|
|
2173
|
-
"css": "CSS",
|
|
2174
|
-
"json": "JSON",
|
|
2175
|
-
"yaml": "YAML",
|
|
2176
|
-
"yml": "YML",
|
|
2177
|
-
"toml": "TOML",
|
|
2178
|
-
"csv": "CSV",
|
|
2179
|
-
"pdf": "PDF",
|
|
2180
|
-
"tsv": "TSV",
|
|
2181
|
-
"jpg": "JPG",
|
|
2182
|
-
"jpeg": "JPEG",
|
|
2183
|
-
"png": "PNG",
|
|
2184
|
-
"gif": "GIF",
|
|
2185
|
-
"webp": "WebP",
|
|
2186
|
-
"heic": "HEIC",
|
|
2187
|
-
"heif": "HEIF",
|
|
2188
|
-
"bmp": "BMP",
|
|
2189
|
-
"tiff": "TIFF",
|
|
2190
|
-
"ico": "ICO",
|
|
2191
|
-
"xml": "XML",
|
|
2192
|
-
"sql": "SQL",
|
|
2193
|
-
"db": "DB",
|
|
2194
|
-
"dbs": "DBs",
|
|
2195
|
-
"nosql": "NoSQL",
|
|
2196
|
-
"graphql": "GraphQL",
|
|
2197
|
-
"grpc": "gRPC",
|
|
2198
|
-
"rest": "REST",
|
|
2199
|
-
"restful": "RESTful",
|
|
2200
|
-
"websocket": "WebSocket",
|
|
2201
|
-
"websockets": "WebSockets",
|
|
2202
|
-
"webrtc": "WebRTC",
|
|
2203
|
-
// Networking
|
|
2204
|
-
"ip": "IP",
|
|
2205
|
-
"ipv4": "IPv4",
|
|
2206
|
-
"ipv6": "IPv6",
|
|
2207
|
-
"dns": "DNS",
|
|
2208
|
-
"dhcp": "DHCP",
|
|
2209
|
-
"nat": "NAT",
|
|
2210
|
-
"tcp": "TCP",
|
|
2211
|
-
"udp": "UDP",
|
|
2212
|
-
"icmp": "ICMP",
|
|
2213
|
-
"ttl": "TTL",
|
|
2214
|
-
"lan": "LAN",
|
|
2215
|
-
"wan": "WAN",
|
|
2216
|
-
"vlan": "VLAN",
|
|
2217
|
-
"cdn": "CDN",
|
|
2218
|
-
"ftp": "FTP",
|
|
2219
|
-
"ssh": "SSH",
|
|
2220
|
-
"tls": "TLS",
|
|
2221
|
-
"ssl": "SSL",
|
|
2222
|
-
// Security & crypto
|
|
2223
|
-
"jwt": "JWT",
|
|
2224
|
-
"jws": "JWS",
|
|
2225
|
-
"jwe": "JWE",
|
|
2226
|
-
"hmac": "HMAC",
|
|
2227
|
-
"rsa": "RSA",
|
|
2228
|
-
"ecdsa": "ECDSA",
|
|
2229
|
-
"aes": "AES",
|
|
2230
|
-
"pbkdf2": "PBKDF2",
|
|
2231
|
-
"argon2": "Argon2",
|
|
2232
|
-
"scrypt": "scrypt",
|
|
2233
|
-
"totp": "TOTP",
|
|
2234
|
-
"hotp": "HOTP",
|
|
2235
|
-
"mfa": "MFA",
|
|
2236
|
-
"2fa": "2FA",
|
|
2237
|
-
"csrf": "CSRF",
|
|
2238
|
-
"xss": "XSS",
|
|
2239
|
-
"ssrf": "SSRF",
|
|
2240
|
-
"rce": "RCE",
|
|
2241
|
-
"dos": "DoS",
|
|
2242
|
-
"ddos": "DDoS",
|
|
2243
|
-
"mitm": "MITM",
|
|
2244
|
-
"csp": "CSP",
|
|
2245
|
-
"cors": "CORS",
|
|
2246
|
-
"pii": "PII",
|
|
2247
|
-
"phi": "PHI",
|
|
2248
|
-
"gdpr": "GDPR",
|
|
2249
|
-
"ccpa": "CCPA",
|
|
2250
|
-
"hipaa": "HIPAA",
|
|
2251
|
-
"rfc": "RFC",
|
|
2252
|
-
// Platforms, langs, tools (single-token)
|
|
2253
|
-
"javascript": "JavaScript",
|
|
2254
|
-
"typescript": "TypeScript",
|
|
2255
|
-
"jsx": "JSX",
|
|
2256
|
-
"tsx": "TSX",
|
|
2257
|
-
"node": "Node",
|
|
2258
|
-
// (used when tokenized alone)
|
|
2259
|
-
"deno": "Deno",
|
|
2260
|
-
"bun": "Bun",
|
|
2261
|
-
"react": "React",
|
|
2262
|
-
"nextjs": "Next.js",
|
|
2263
|
-
// if your tokenizer drops dots, keep this
|
|
2264
|
-
"nodejs": "Node.js",
|
|
2265
|
-
"postgresql": "PostgreSQL",
|
|
2266
|
-
"postgres": "Postgres",
|
|
2267
|
-
"mysql": "MySQL",
|
|
2268
|
-
"sqlite": "SQLite",
|
|
2269
|
-
"redis": "Redis",
|
|
2270
|
-
"supabase": "Supabase",
|
|
2271
|
-
"docker": "Docker",
|
|
2272
|
-
"kubernetes": "Kubernetes",
|
|
2273
|
-
"k8s": "Kubernetes",
|
|
2274
|
-
"helm": "Helm",
|
|
2275
|
-
"npm": "npm",
|
|
2276
|
-
"pnpm": "pnpm",
|
|
2277
|
-
"yarn": "Yarn",
|
|
2278
|
-
"eslint": "ESLint",
|
|
2279
|
-
"prettier": "Prettier",
|
|
2280
|
-
"vite": "Vite",
|
|
2281
|
-
"webpack": "Webpack",
|
|
2282
|
-
"babel": "Babel",
|
|
2283
|
-
// OS & vendors
|
|
2284
|
-
"macos": "macOS",
|
|
2285
|
-
"ios": "iOS",
|
|
2286
|
-
"ipados": "iPadOS",
|
|
2287
|
-
"watchos": "watchOS",
|
|
2288
|
-
"tvos": "tvOS",
|
|
2289
|
-
"windows": "Windows",
|
|
2290
|
-
"linux": "Linux",
|
|
2291
|
-
"ubuntu": "Ubuntu",
|
|
2292
|
-
"github": "GitHub",
|
|
2293
|
-
"gitlab": "GitLab",
|
|
2294
|
-
"bitbucket": "Bitbucket",
|
|
2295
|
-
// Data & analytics
|
|
2296
|
-
"etl": "ETL",
|
|
2297
|
-
"elt": "ELT",
|
|
2298
|
-
"olap": "OLAP",
|
|
2299
|
-
"oltp": "OLTP",
|
|
2300
|
-
"bi": "BI",
|
|
2301
|
-
// Time & locales
|
|
2302
|
-
"utc": "UTC",
|
|
2303
|
-
"gmt": "GMT",
|
|
2304
|
-
"pst": "PST",
|
|
2305
|
-
"pdt": "PDT",
|
|
2306
|
-
"pt": "PT",
|
|
2307
|
-
// Common “small words” to keep lowercase (unless first/last word)
|
|
2308
|
-
"or": "or",
|
|
2309
|
-
"and": "and",
|
|
2310
|
-
"the": "the",
|
|
2311
|
-
"of": "of",
|
|
2312
|
-
"in": "in",
|
|
2313
|
-
"to": "to",
|
|
2314
|
-
"with": "with",
|
|
2315
|
-
"as": "as",
|
|
2316
|
-
"by": "by",
|
|
2317
|
-
"for": "for",
|
|
2318
|
-
"on": "on",
|
|
2319
|
-
"at": "at",
|
|
2320
|
-
"up": "up",
|
|
2321
|
-
"a": "a",
|
|
2322
|
-
"an": "an",
|
|
2323
|
-
"is": "is",
|
|
2324
|
-
"are": "are",
|
|
2325
|
-
"was": "was",
|
|
2326
|
-
"were": "were",
|
|
2327
|
-
"be": "be",
|
|
2328
|
-
"but": "but",
|
|
2329
|
-
"nor": "nor",
|
|
2330
|
-
"so": "so",
|
|
2331
|
-
"yet": "yet",
|
|
2332
|
-
"per": "per",
|
|
2333
|
-
"via": "via",
|
|
2334
|
-
// Latin abbreviations (tokenized as words in some pipelines)
|
|
2335
|
-
"eg": "e.g.",
|
|
2336
|
-
"ie": "i.e.",
|
|
2337
|
-
"etc": "etc.",
|
|
2338
|
-
"aka": "aka",
|
|
2339
|
-
"vs": "vs.",
|
|
2340
|
-
"v": "v.",
|
|
2341
|
-
// Client abbreviations
|
|
2342
|
-
"CIC": "CIC",
|
|
2343
|
-
"AGR": "AGR",
|
|
2344
|
-
"AGER": "AGER",
|
|
2345
|
-
"DD": "DD",
|
|
2346
|
-
"TS": "TS",
|
|
2347
|
-
"TM": "TM",
|
|
2348
|
-
"arman": "Arman"
|
|
2349
|
-
};
|
|
2350
|
-
var DEFAULT_OPTIONS = {
|
|
2351
|
-
textCase: "title",
|
|
2352
|
-
wordReplacements: DEFAULT_WORD_REPLACEMENTS,
|
|
2353
|
-
trim: true
|
|
2354
|
-
};
|
|
2355
|
-
function formatText(text, options = {}) {
|
|
2356
|
-
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
2357
|
-
if (!text) return "";
|
|
2358
|
-
let normalized = text.replace(/_/g, " ").replace(/-/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ");
|
|
2359
|
-
if (opts.trim) {
|
|
2360
|
-
normalized = normalized.trim();
|
|
2361
|
-
}
|
|
2362
|
-
let caseTransformed = normalized;
|
|
2363
|
-
switch (opts.textCase) {
|
|
2364
|
-
case "title":
|
|
2365
|
-
caseTransformed = normalized.replace(
|
|
2366
|
-
/\w\S*/g,
|
|
2367
|
-
(word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
|
|
2368
|
-
);
|
|
2369
|
-
break;
|
|
2370
|
-
case "sentence":
|
|
2371
|
-
if (normalized.length > 0) {
|
|
2372
|
-
caseTransformed = normalized.charAt(0).toUpperCase() + normalized.slice(1).toLowerCase();
|
|
2373
|
-
}
|
|
2374
|
-
break;
|
|
2375
|
-
case "lower":
|
|
2376
|
-
caseTransformed = normalized.toLowerCase();
|
|
2377
|
-
break;
|
|
2378
|
-
case "upper":
|
|
2379
|
-
caseTransformed = normalized.toUpperCase();
|
|
2380
|
-
break;
|
|
2381
|
-
}
|
|
2382
|
-
let result = caseTransformed;
|
|
2383
|
-
if (opts.wordReplacements) {
|
|
2384
|
-
Object.entries(opts.wordReplacements).forEach(([key, value]) => {
|
|
2385
|
-
const regex = new RegExp(`\\b${key}\\b`, "gi");
|
|
2386
|
-
result = result.replace(regex, value);
|
|
2387
|
-
});
|
|
2388
|
-
}
|
|
2389
|
-
return result;
|
|
2390
|
-
}
|
|
2391
|
-
var IDENTIFIER_ACRONYMS = [
|
|
2392
|
-
"ID",
|
|
2393
|
-
"URL",
|
|
2394
|
-
"PDF",
|
|
2395
|
-
"HTML",
|
|
2396
|
-
"JSON",
|
|
2397
|
-
"API",
|
|
2398
|
-
"AI",
|
|
2399
|
-
"UI",
|
|
2400
|
-
"CSV",
|
|
2401
|
-
"SMS",
|
|
2402
|
-
"SEO",
|
|
2403
|
-
"LLM",
|
|
2404
|
-
"MCP",
|
|
2405
|
-
"UUID",
|
|
2406
|
-
"ISO"
|
|
2407
|
-
];
|
|
2408
|
-
new Set(IDENTIFIER_ACRONYMS.map((a) => a.toLowerCase()));
|
|
2409
|
-
|
|
2410
|
-
// core/schema-structure.ts
|
|
2411
2124
|
function formatBlockLabel(key) {
|
|
2412
2125
|
return formatText(key, { textCase: "title" });
|
|
2413
2126
|
}
|