@almadar/ui 4.43.4 → 4.44.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.
@@ -89,3 +89,13 @@ export { RichBlockEditor, type RichBlockEditorProps, type RichBlock, type BlockT
89
89
  export { ReplyTree, type ReplyTreeProps, type ReplyNode } from './ReplyTree';
90
90
  export { BranchingLogicBuilder, type BranchingLogicBuilderProps, type BranchingQuestion, type BranchingRule } from './BranchingLogicBuilder';
91
91
  export { VersionDiff, type VersionDiffProps, type DiffRevision, type DiffLine as VersionDiffLine, type DiffLineType } from './VersionDiff';
92
+ export { DocBreadcrumb, type DocBreadcrumbProps, type DocBreadcrumbItem } from './DocBreadcrumb';
93
+ export { DocCodeBlock, type DocCodeBlockProps } from './DocCodeBlock';
94
+ export { DocPagination, type DocPaginationProps, type DocPaginationLink } from './DocPagination';
95
+ export { DocSearch, type DocSearchProps, type DocSearchResult } from './DocSearch';
96
+ export { DocSidebar, type DocSidebarProps, type DocSidebarItem } from './DocSidebar';
97
+ export { DocTOC, type DocTOCProps, type DocTOCItem } from './DocTOC';
98
+ export { GradientDivider, type GradientDividerProps } from './GradientDivider';
99
+ export { PullQuote, type PullQuoteProps } from './PullQuote';
100
+ export { BehaviorView, type BehaviorViewProps } from './avl/BehaviorView';
101
+ export { ModuleCard, type ModuleCardProps } from './avl/ModuleCard';
@@ -10,6 +10,7 @@ var OrbitControls_js = require('three/examples/jsm/controls/OrbitControls.js');
10
10
  var GLTFLoader_js = require('three/examples/jsm/loaders/GLTFLoader.js');
11
11
  var OBJLoader_js = require('three/examples/jsm/loaders/OBJLoader.js');
12
12
  var providers = require('@almadar/ui/providers');
13
+ var logger = require('@almadar/logger');
13
14
  var clsx = require('clsx');
14
15
  var tailwindMerge = require('tailwind-merge');
15
16
  var postprocessing = require('@react-three/postprocessing');
@@ -1375,59 +1376,9 @@ function useRaycaster(options) {
1375
1376
  isWithinCanvas
1376
1377
  };
1377
1378
  }
1378
-
1379
- // lib/logger.ts
1380
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
1381
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
1382
- function envGet(key) {
1383
- return ENV[key] ?? ENV[`VITE_${key}`];
1384
- }
1385
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
1386
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
1387
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
1388
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
1389
- function matchesNamespace(namespace) {
1390
- if (DEBUG_FILTER.length === 0) return true;
1391
- return DEBUG_FILTER.some((pattern) => {
1392
- if (pattern === "*" || pattern === "almadar:*") return true;
1393
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
1394
- return namespace === pattern;
1395
- });
1396
- }
1397
- function createLogger(namespace) {
1398
- const nsAllowed = matchesNamespace(namespace);
1399
- const log2 = (level, message, data, correlationId) => {
1400
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
1401
- if (level === "DEBUG" && !nsAllowed) return;
1402
- const prefix = `[${namespace}]`;
1403
- const logData = correlationId ? { ...data, cid: correlationId } : data;
1404
- switch (level) {
1405
- case "DEBUG":
1406
- console.debug(prefix, message, logData ?? "");
1407
- break;
1408
- case "INFO":
1409
- console.info(prefix, message, logData ?? "");
1410
- break;
1411
- case "WARN":
1412
- console.warn(prefix, message, logData ?? "");
1413
- break;
1414
- case "ERROR":
1415
- console.error(prefix, message, logData ?? "");
1416
- break;
1417
- }
1418
- };
1419
- return {
1420
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
1421
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
1422
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
1423
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
1424
- };
1425
- }
1426
-
1427
- // hooks/useEventBus.ts
1428
- var log = createLogger("almadar:eventbus");
1429
- var subLog = createLogger("almadar:eventbus:subscribe");
1430
- var scopeLog = createLogger("almadar:ui:trait-scope");
1379
+ var log = logger.createLogger("almadar:eventbus");
1380
+ var subLog = logger.createLogger("almadar:eventbus:subscribe");
1381
+ var scopeLog = logger.createLogger("almadar:ui:trait-scope");
1431
1382
  function getGlobalEventBus() {
1432
1383
  if (typeof window !== "undefined") {
1433
1384
  return window.__kflowEventBus ?? null;
@@ -1521,7 +1472,12 @@ function useEventBus() {
1521
1472
  const tail = type.slice(3);
1522
1473
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
1523
1474
  if (qualified !== type) {
1524
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
1475
+ scopeLog.info("emit:qualified", {
1476
+ from: type,
1477
+ to: qualified,
1478
+ scopeOrbital: scope.orbital,
1479
+ scopeTrait: scope.trait
1480
+ });
1525
1481
  }
1526
1482
  baseBus.emit(qualified, payload, source);
1527
1483
  return;
@@ -9,6 +9,7 @@ import { OrbitControls as OrbitControls$1 } from 'three/examples/jsm/controls/Or
9
9
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
10
10
  import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js';
11
11
  import { EventBusContext, useTraitScope } from '@almadar/ui/providers';
12
+ import { createLogger } from '@almadar/logger';
12
13
  import { clsx } from 'clsx';
13
14
  import { twMerge } from 'tailwind-merge';
14
15
  import { EffectComposer, Bloom, DepthOfField, Vignette } from '@react-three/postprocessing';
@@ -1351,56 +1352,6 @@ function useRaycaster(options) {
1351
1352
  isWithinCanvas
1352
1353
  };
1353
1354
  }
1354
-
1355
- // lib/logger.ts
1356
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
1357
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
1358
- function envGet(key) {
1359
- return ENV[key] ?? ENV[`VITE_${key}`];
1360
- }
1361
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
1362
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
1363
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
1364
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
1365
- function matchesNamespace(namespace) {
1366
- if (DEBUG_FILTER.length === 0) return true;
1367
- return DEBUG_FILTER.some((pattern) => {
1368
- if (pattern === "*" || pattern === "almadar:*") return true;
1369
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
1370
- return namespace === pattern;
1371
- });
1372
- }
1373
- function createLogger(namespace) {
1374
- const nsAllowed = matchesNamespace(namespace);
1375
- const log2 = (level, message, data, correlationId) => {
1376
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
1377
- if (level === "DEBUG" && !nsAllowed) return;
1378
- const prefix = `[${namespace}]`;
1379
- const logData = correlationId ? { ...data, cid: correlationId } : data;
1380
- switch (level) {
1381
- case "DEBUG":
1382
- console.debug(prefix, message, logData ?? "");
1383
- break;
1384
- case "INFO":
1385
- console.info(prefix, message, logData ?? "");
1386
- break;
1387
- case "WARN":
1388
- console.warn(prefix, message, logData ?? "");
1389
- break;
1390
- case "ERROR":
1391
- console.error(prefix, message, logData ?? "");
1392
- break;
1393
- }
1394
- };
1395
- return {
1396
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
1397
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
1398
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
1399
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
1400
- };
1401
- }
1402
-
1403
- // hooks/useEventBus.ts
1404
1355
  var log = createLogger("almadar:eventbus");
1405
1356
  var subLog = createLogger("almadar:eventbus:subscribe");
1406
1357
  var scopeLog = createLogger("almadar:ui:trait-scope");
@@ -1497,7 +1448,12 @@ function useEventBus() {
1497
1448
  const tail = type.slice(3);
1498
1449
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
1499
1450
  if (qualified !== type) {
1500
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
1451
+ scopeLog.info("emit:qualified", {
1452
+ from: type,
1453
+ to: qualified,
1454
+ scopeOrbital: scope.orbital,
1455
+ scopeTrait: scope.trait
1456
+ });
1501
1457
  }
1502
1458
  baseBus.emit(qualified, payload, source);
1503
1459
  return;
@@ -45,3 +45,4 @@ export { StepFlowOrganism, type StepFlowOrganismProps, } from "./StepFlowOrganis
45
45
  export { ShowcaseOrganism, type ShowcaseOrganismProps, } from "./ShowcaseOrganism";
46
46
  export { TeamOrganism, type TeamOrganismProps, } from "./TeamOrganism";
47
47
  export { CaseStudyOrganism, type CaseStudyOrganismProps, } from "./CaseStudyOrganism";
48
+ export { FeatureRenderer, type FeatureRendererProps } from './game/three/renderers/FeatureRenderer';
@@ -1,58 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var react = require('react');
4
+ var logger = require('@almadar/logger');
4
5
  var jsxRuntime = require('react/jsx-runtime');
5
6
 
6
- // lib/logger.ts
7
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
8
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
9
- function envGet(key) {
10
- return ENV[key] ?? ENV[`VITE_${key}`];
11
- }
12
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
13
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
14
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
15
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
16
- function matchesNamespace(namespace) {
17
- if (DEBUG_FILTER.length === 0) return true;
18
- return DEBUG_FILTER.some((pattern) => {
19
- if (pattern === "*" || pattern === "almadar:*") return true;
20
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
21
- return namespace === pattern;
22
- });
23
- }
24
- function createLogger(namespace) {
25
- const nsAllowed = matchesNamespace(namespace);
26
- const log = (level, message, data, correlationId) => {
27
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
28
- if (level === "DEBUG" && !nsAllowed) return;
29
- const prefix = `[${namespace}]`;
30
- const logData = correlationId ? { ...data, cid: correlationId } : data;
31
- switch (level) {
32
- case "DEBUG":
33
- console.debug(prefix, message, logData ?? "");
34
- break;
35
- case "INFO":
36
- console.info(prefix, message, logData ?? "");
37
- break;
38
- case "WARN":
39
- console.warn(prefix, message, logData ?? "");
40
- break;
41
- case "ERROR":
42
- console.error(prefix, message, logData ?? "");
43
- break;
44
- }
45
- };
46
- return {
47
- debug: (msg, data, cid) => log("DEBUG", msg, data, cid),
48
- info: (msg, data, cid) => log("INFO", msg, data, cid),
49
- warn: (msg, data, cid) => log("WARN", msg, data, cid),
50
- error: (msg, data, cid) => log("ERROR", msg, data, cid)
51
- };
52
- }
53
-
54
- // hooks/useUISlots.ts
55
- var slotLog = createLogger("almadar:ui:useUISlots");
7
+ var slotLog = logger.createLogger("almadar:ui:useUISlots");
56
8
  var DEFAULT_SOURCE_KEY = "__default__";
57
9
  var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
58
10
  var ALL_SLOTS = [
@@ -1,55 +1,7 @@
1
1
  import { createContext, useMemo, useContext, useState, useEffect, useCallback, useRef } from 'react';
2
+ import { createLogger } from '@almadar/logger';
2
3
  import { jsx } from 'react/jsx-runtime';
3
4
 
4
- // lib/logger.ts
5
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
6
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
7
- function envGet(key) {
8
- return ENV[key] ?? ENV[`VITE_${key}`];
9
- }
10
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
11
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
12
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
13
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
14
- function matchesNamespace(namespace) {
15
- if (DEBUG_FILTER.length === 0) return true;
16
- return DEBUG_FILTER.some((pattern) => {
17
- if (pattern === "*" || pattern === "almadar:*") return true;
18
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
19
- return namespace === pattern;
20
- });
21
- }
22
- function createLogger(namespace) {
23
- const nsAllowed = matchesNamespace(namespace);
24
- const log = (level, message, data, correlationId) => {
25
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
26
- if (level === "DEBUG" && !nsAllowed) return;
27
- const prefix = `[${namespace}]`;
28
- const logData = correlationId ? { ...data, cid: correlationId } : data;
29
- switch (level) {
30
- case "DEBUG":
31
- console.debug(prefix, message, logData ?? "");
32
- break;
33
- case "INFO":
34
- console.info(prefix, message, logData ?? "");
35
- break;
36
- case "WARN":
37
- console.warn(prefix, message, logData ?? "");
38
- break;
39
- case "ERROR":
40
- console.error(prefix, message, logData ?? "");
41
- break;
42
- }
43
- };
44
- return {
45
- debug: (msg, data, cid) => log("DEBUG", msg, data, cid),
46
- info: (msg, data, cid) => log("INFO", msg, data, cid),
47
- warn: (msg, data, cid) => log("WARN", msg, data, cid),
48
- error: (msg, data, cid) => log("ERROR", msg, data, cid)
49
- };
50
- }
51
-
52
- // hooks/useUISlots.ts
53
5
  var slotLog = createLogger("almadar:ui:useUISlots");
54
6
  var DEFAULT_SOURCE_KEY = "__default__";
55
7
  var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React5 = require('react');
4
+ var logger = require('@almadar/logger');
4
5
  var jsxRuntime = require('react/jsx-runtime');
5
6
  var LucideIcons = require('lucide-react');
6
7
 
@@ -2506,66 +2507,16 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
2506
2507
  function cn(...inputs) {
2507
2508
  return twMerge(clsx(inputs));
2508
2509
  }
2509
-
2510
- // lib/logger.ts
2511
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
2512
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
2513
- function envGet(key) {
2514
- return ENV[key] ?? ENV[`VITE_${key}`];
2515
- }
2516
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
2517
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
2518
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
2519
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
2520
- function matchesNamespace(namespace) {
2521
- if (DEBUG_FILTER.length === 0) return true;
2522
- return DEBUG_FILTER.some((pattern) => {
2523
- if (pattern === "*" || pattern === "almadar:*") return true;
2524
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
2525
- return namespace === pattern;
2526
- });
2527
- }
2528
- function createLogger(namespace) {
2529
- const nsAllowed = matchesNamespace(namespace);
2530
- const log2 = (level, message, data, correlationId) => {
2531
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
2532
- if (level === "DEBUG" && !nsAllowed) return;
2533
- const prefix = `[${namespace}]`;
2534
- const logData = correlationId ? { ...data, cid: correlationId } : data;
2535
- switch (level) {
2536
- case "DEBUG":
2537
- console.debug(prefix, message, logData ?? "");
2538
- break;
2539
- case "INFO":
2540
- console.info(prefix, message, logData ?? "");
2541
- break;
2542
- case "WARN":
2543
- console.warn(prefix, message, logData ?? "");
2544
- break;
2545
- case "ERROR":
2546
- console.error(prefix, message, logData ?? "");
2547
- break;
2548
- }
2549
- };
2550
- return {
2551
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
2552
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
2553
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
2554
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
2555
- };
2556
- }
2557
- createLogger("almadar:eventbus");
2558
- createLogger("almadar:eventbus:subscribe");
2510
+ logger.createLogger("almadar:eventbus");
2511
+ logger.createLogger("almadar:eventbus:subscribe");
2559
2512
  var EventBusContext = React5.createContext(null);
2560
2513
  var TraitScopeContext = React5.createContext(null);
2561
2514
  function useTraitScope() {
2562
2515
  return React5.useContext(TraitScopeContext);
2563
2516
  }
2564
-
2565
- // hooks/useEventBus.ts
2566
- var log = createLogger("almadar:eventbus");
2567
- var subLog2 = createLogger("almadar:eventbus:subscribe");
2568
- var scopeLog = createLogger("almadar:ui:trait-scope");
2517
+ var log = logger.createLogger("almadar:eventbus");
2518
+ var subLog2 = logger.createLogger("almadar:eventbus:subscribe");
2519
+ var scopeLog = logger.createLogger("almadar:ui:trait-scope");
2569
2520
  function getGlobalEventBus() {
2570
2521
  if (typeof window !== "undefined") {
2571
2522
  return window.__kflowEventBus ?? null;
@@ -2659,7 +2610,12 @@ function useEventBus() {
2659
2610
  const tail = type.slice(3);
2660
2611
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
2661
2612
  if (qualified !== type) {
2662
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
2613
+ scopeLog.info("emit:qualified", {
2614
+ from: type,
2615
+ to: qualified,
2616
+ scopeOrbital: scope.orbital,
2617
+ scopeTrait: scope.trait
2618
+ });
2663
2619
  }
2664
2620
  baseBus.emit(qualified, payload, source);
2665
2621
  return;
@@ -1,4 +1,5 @@
1
1
  import React5, { createContext, useCallback, useContext, useMemo, useState, useRef, useEffect } from 'react';
2
+ import { createLogger } from '@almadar/logger';
2
3
  import { jsx, jsxs } from 'react/jsx-runtime';
3
4
  import * as LucideIcons from 'lucide-react';
4
5
  import { Loader2, ChevronDown, X } from 'lucide-react';
@@ -2482,54 +2483,6 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
2482
2483
  function cn(...inputs) {
2483
2484
  return twMerge(clsx(inputs));
2484
2485
  }
2485
-
2486
- // lib/logger.ts
2487
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
2488
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
2489
- function envGet(key) {
2490
- return ENV[key] ?? ENV[`VITE_${key}`];
2491
- }
2492
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
2493
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
2494
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
2495
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
2496
- function matchesNamespace(namespace) {
2497
- if (DEBUG_FILTER.length === 0) return true;
2498
- return DEBUG_FILTER.some((pattern) => {
2499
- if (pattern === "*" || pattern === "almadar:*") return true;
2500
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
2501
- return namespace === pattern;
2502
- });
2503
- }
2504
- function createLogger(namespace) {
2505
- const nsAllowed = matchesNamespace(namespace);
2506
- const log2 = (level, message, data, correlationId) => {
2507
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
2508
- if (level === "DEBUG" && !nsAllowed) return;
2509
- const prefix = `[${namespace}]`;
2510
- const logData = correlationId ? { ...data, cid: correlationId } : data;
2511
- switch (level) {
2512
- case "DEBUG":
2513
- console.debug(prefix, message, logData ?? "");
2514
- break;
2515
- case "INFO":
2516
- console.info(prefix, message, logData ?? "");
2517
- break;
2518
- case "WARN":
2519
- console.warn(prefix, message, logData ?? "");
2520
- break;
2521
- case "ERROR":
2522
- console.error(prefix, message, logData ?? "");
2523
- break;
2524
- }
2525
- };
2526
- return {
2527
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
2528
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
2529
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
2530
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
2531
- };
2532
- }
2533
2486
  createLogger("almadar:eventbus");
2534
2487
  createLogger("almadar:eventbus:subscribe");
2535
2488
  var EventBusContext = createContext(null);
@@ -2537,8 +2490,6 @@ var TraitScopeContext = createContext(null);
2537
2490
  function useTraitScope() {
2538
2491
  return useContext(TraitScopeContext);
2539
2492
  }
2540
-
2541
- // hooks/useEventBus.ts
2542
2493
  var log = createLogger("almadar:eventbus");
2543
2494
  var subLog2 = createLogger("almadar:eventbus:subscribe");
2544
2495
  var scopeLog = createLogger("almadar:ui:trait-scope");
@@ -2635,7 +2586,12 @@ function useEventBus() {
2635
2586
  const tail = type.slice(3);
2636
2587
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
2637
2588
  if (qualified !== type) {
2638
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
2589
+ scopeLog.info("emit:qualified", {
2590
+ from: type,
2591
+ to: qualified,
2592
+ scopeOrbital: scope.orbital,
2593
+ scopeTrait: scope.trait
2594
+ });
2639
2595
  }
2640
2596
  baseBus.emit(qualified, payload, source);
2641
2597
  return;
@@ -2,6 +2,7 @@
2
2
 
3
3
  var react = require('react');
4
4
  var providers = require('@almadar/ui/providers');
5
+ var logger = require('@almadar/logger');
5
6
  var reactQuery = require('@tanstack/react-query');
6
7
 
7
8
  function useOrbitalHistory(options) {
@@ -867,59 +868,9 @@ function useDeepAgentGeneration() {
867
868
  submitInterruptDecisions
868
869
  };
869
870
  }
870
-
871
- // lib/logger.ts
872
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
873
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
874
- function envGet(key) {
875
- return ENV[key] ?? ENV[`VITE_${key}`];
876
- }
877
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
878
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
879
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
880
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
881
- function matchesNamespace(namespace) {
882
- if (DEBUG_FILTER.length === 0) return true;
883
- return DEBUG_FILTER.some((pattern) => {
884
- if (pattern === "*" || pattern === "almadar:*") return true;
885
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
886
- return namespace === pattern;
887
- });
888
- }
889
- function createLogger(namespace) {
890
- const nsAllowed = matchesNamespace(namespace);
891
- const log2 = (level, message, data, correlationId) => {
892
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
893
- if (level === "DEBUG" && !nsAllowed) return;
894
- const prefix = `[${namespace}]`;
895
- const logData = correlationId ? { ...data, cid: correlationId } : data;
896
- switch (level) {
897
- case "DEBUG":
898
- console.debug(prefix, message, logData ?? "");
899
- break;
900
- case "INFO":
901
- console.info(prefix, message, logData ?? "");
902
- break;
903
- case "WARN":
904
- console.warn(prefix, message, logData ?? "");
905
- break;
906
- case "ERROR":
907
- console.error(prefix, message, logData ?? "");
908
- break;
909
- }
910
- };
911
- return {
912
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
913
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
914
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
915
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
916
- };
917
- }
918
-
919
- // hooks/useEventBus.ts
920
- var log = createLogger("almadar:eventbus");
921
- var subLog = createLogger("almadar:eventbus:subscribe");
922
- var scopeLog = createLogger("almadar:ui:trait-scope");
871
+ var log = logger.createLogger("almadar:eventbus");
872
+ var subLog = logger.createLogger("almadar:eventbus:subscribe");
873
+ var scopeLog = logger.createLogger("almadar:ui:trait-scope");
923
874
  function getGlobalEventBus() {
924
875
  if (typeof window !== "undefined") {
925
876
  return window.__kflowEventBus ?? null;
@@ -1013,7 +964,12 @@ function useEventBus() {
1013
964
  const tail = type.slice(3);
1014
965
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
1015
966
  if (qualified !== type) {
1016
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
967
+ scopeLog.info("emit:qualified", {
968
+ from: type,
969
+ to: qualified,
970
+ scopeOrbital: scope.orbital,
971
+ scopeTrait: scope.trait
972
+ });
1017
973
  }
1018
974
  baseBus.emit(qualified, payload, source);
1019
975
  return;
@@ -1046,7 +1002,7 @@ function useEmitEvent() {
1046
1002
  [eventBus]
1047
1003
  );
1048
1004
  }
1049
- var slotLog = createLogger("almadar:ui:useUISlots");
1005
+ var slotLog = logger.createLogger("almadar:ui:useUISlots");
1050
1006
  var DEFAULT_SOURCE_KEY = "__default__";
1051
1007
  var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
1052
1008
  var ALL_SLOTS = [
@@ -1,5 +1,6 @@
1
1
  import { createContext, useCallback, useState, useEffect, useMemo, useContext, useRef, useSyncExternalStore } from 'react';
2
2
  import { EventBusContext, useTraitScope } from '@almadar/ui/providers';
3
+ import { createLogger } from '@almadar/logger';
3
4
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
5
 
5
6
  function useOrbitalHistory(options) {
@@ -865,56 +866,6 @@ function useDeepAgentGeneration() {
865
866
  submitInterruptDecisions
866
867
  };
867
868
  }
868
-
869
- // lib/logger.ts
870
- var LEVEL_PRIORITY = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
871
- var ENV = typeof process !== "undefined" && process.env ? process.env : {};
872
- function envGet(key) {
873
- return ENV[key] ?? ENV[`VITE_${key}`];
874
- }
875
- var NODE_ENV = envGet("NODE_ENV") ?? "development";
876
- var CONFIGURED_LEVEL = (envGet("LOG_LEVEL") ?? (NODE_ENV === "production" ? "info" : "debug")).toUpperCase();
877
- var MIN_PRIORITY = LEVEL_PRIORITY[CONFIGURED_LEVEL] ?? 0;
878
- var DEBUG_FILTER = (envGet("ALMADAR_DEBUG") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
879
- function matchesNamespace(namespace) {
880
- if (DEBUG_FILTER.length === 0) return true;
881
- return DEBUG_FILTER.some((pattern) => {
882
- if (pattern === "*" || pattern === "almadar:*") return true;
883
- if (pattern.endsWith(":*")) return namespace.startsWith(pattern.slice(0, -1));
884
- return namespace === pattern;
885
- });
886
- }
887
- function createLogger(namespace) {
888
- const nsAllowed = matchesNamespace(namespace);
889
- const log2 = (level, message, data, correlationId) => {
890
- if (LEVEL_PRIORITY[level] < MIN_PRIORITY) return;
891
- if (level === "DEBUG" && !nsAllowed) return;
892
- const prefix = `[${namespace}]`;
893
- const logData = correlationId ? { ...data, cid: correlationId } : data;
894
- switch (level) {
895
- case "DEBUG":
896
- console.debug(prefix, message, logData ?? "");
897
- break;
898
- case "INFO":
899
- console.info(prefix, message, logData ?? "");
900
- break;
901
- case "WARN":
902
- console.warn(prefix, message, logData ?? "");
903
- break;
904
- case "ERROR":
905
- console.error(prefix, message, logData ?? "");
906
- break;
907
- }
908
- };
909
- return {
910
- debug: (msg, data, cid) => log2("DEBUG", msg, data, cid),
911
- info: (msg, data, cid) => log2("INFO", msg, data, cid),
912
- warn: (msg, data, cid) => log2("WARN", msg, data, cid),
913
- error: (msg, data, cid) => log2("ERROR", msg, data, cid)
914
- };
915
- }
916
-
917
- // hooks/useEventBus.ts
918
869
  var log = createLogger("almadar:eventbus");
919
870
  var subLog = createLogger("almadar:eventbus:subscribe");
920
871
  var scopeLog = createLogger("almadar:ui:trait-scope");
@@ -1011,7 +962,12 @@ function useEventBus() {
1011
962
  const tail = type.slice(3);
1012
963
  const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
1013
964
  if (qualified !== type) {
1014
- scopeLog.info("emit:qualified", { from: type, to: qualified, scope });
965
+ scopeLog.info("emit:qualified", {
966
+ from: type,
967
+ to: qualified,
968
+ scopeOrbital: scope.orbital,
969
+ scopeTrait: scope.trait
970
+ });
1015
971
  }
1016
972
  baseBus.emit(qualified, payload, source);
1017
973
  return;