@crossworks/content-core 0.400.5 → 0.400.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/content-core",
3
- "version": "0.400.5",
3
+ "version": "0.400.11",
4
4
  "description": "Browser-safe content logic — markdown, blocks, pages, tables, formulas — shared by the server and any client. Zero server deps by design: nothing here may reach @mantle/db, node-only APIs, or the network (the jackdaw-repo-split P0 boundary).",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  "./tree": "./src/tree.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@mantle/client-types": "npm:@crossworks/client-types@0.400.5",
39
+ "@mantle/client-types": "npm:@crossworks/client-types@0.400.11",
40
40
  "marked": "^18.1.0",
41
41
  "mathjs": "15.2.0"
42
42
  },
@@ -526,6 +526,19 @@ export function projectAppOpens(raw: unknown): Record<string, AppOpenStat> | und
526
526
  return Object.fromEntries(rows.slice(0, APP_OPENS_MAX));
527
527
  }
528
528
 
529
+ /** The content-kind groups granted per agent id (contentKindGroupsGranted):
530
+ * uuid keys, each a list of group slugs; anything else is dropped. */
531
+ export function projectGrantedGroups(raw: unknown): Record<string, string[]> | undefined {
532
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return undefined;
533
+ const rows: [string, string[]][] = [];
534
+ for (const [k, v] of Object.entries(raw as Record<string, unknown>)) {
535
+ if (!UUID_RE.test(k) || !Array.isArray(v)) continue;
536
+ const slugs = [...new Set(v.filter((s): s is string => typeof s === 'string' && s !== ''))];
537
+ rows.push([k.toLowerCase(), slugs]);
538
+ }
539
+ return rows.length ? Object.fromEntries(rows) : undefined;
540
+ }
541
+
529
542
  /** The house style a NEW brain starts with (Settings, Profile). Seeded only when
530
543
  * a profile row is first created, so an owner who edits or clears it keeps
531
544
  * their choice. The dash characters are escapes so the source holds none. */