@almadar/ui 4.44.1 → 4.46.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/avl/index.cjs +249 -174
- package/dist/avl/index.js +250 -175
- package/dist/components/atoms/index.d.ts +1 -1
- package/dist/components/index.cjs +185 -131
- package/dist/components/index.js +186 -132
- package/dist/components/molecules/game/ResourceBar.d.ts +1 -1
- package/dist/components/organisms/game/three/index.cjs +18 -15
- package/dist/components/organisms/game/three/index.js +18 -15
- package/dist/components/organisms/layout/{MasterDetail.d.ts → MasterDetailLayout.d.ts} +3 -3
- package/dist/components/organisms/layout/index.d.ts +1 -1
- package/dist/context/index.cjs +17 -12
- package/dist/context/index.js +17 -12
- package/dist/docs/index.cjs +2 -2
- package/dist/docs/index.js +2 -2
- package/dist/hooks/index.cjs +52 -40
- package/dist/hooks/index.js +52 -40
- package/dist/lib/debug.d.ts +15 -22
- package/dist/lib/index.cjs +61 -47
- package/dist/lib/index.js +62 -48
- package/dist/marketing/index.cjs +2 -2
- package/dist/marketing/index.js +2 -2
- package/dist/providers/EventBusProvider.d.ts +6 -2
- package/dist/providers/index.cjs +184 -115
- package/dist/providers/index.js +184 -115
- package/dist/renderer/index.cjs +57 -56
- package/dist/renderer/index.js +57 -56
- package/dist/runtime/index.cjs +174 -100
- package/dist/runtime/index.js +175 -101
- package/package.json +3 -3
- /package/dist/components/atoms/{StatCard.d.ts → MarketingStatCard.d.ts} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import React131__default, { useContext, useMemo, useRef, useEffect, useCallback,
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
7
|
-
import { createLogger } from '@almadar/logger';
|
|
7
|
+
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
8
8
|
import * as LucideIcons from 'lucide-react';
|
|
9
9
|
import { Loader2, X, AlertTriangle, Info, AlertCircle, CheckCircle, List, Printer, ChevronRight, ChevronLeft, XCircle, Wrench, RotateCcw, Send, Code, FileText, WrapText, Check, Copy, Trash2, Menu as Menu$1, Search, Bell, ChevronDown, LogOut, ChevronUp, MoreHorizontal, Bug, ZoomOut, ZoomIn, Download, Pause, Play, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ArrowRight, ArrowLeft, Eraser, SkipForward, TrendingUp, TrendingDown, Minus, ArrowUp, ArrowDown, MoreVertical, Circle, Clock, CheckCircle2, HelpCircle, FileQuestion, Inbox, Plus, Filter, Star, FileWarning, Camera, RefreshCw, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, MessageSquare, Flag, GitBranch, Trash, GitCommit, AlignLeft, Columns, Tag, User, DollarSign, Sun, Moon, Zap, Sword, Move, Heart, Shield, Coffee, Users } from 'lucide-react';
|
|
10
10
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
@@ -1030,7 +1030,7 @@ var init_useEventBus = __esm({
|
|
|
1030
1030
|
try {
|
|
1031
1031
|
handler(event);
|
|
1032
1032
|
} catch (error) {
|
|
1033
|
-
|
|
1033
|
+
log.error("Error in listener", { type, error: error instanceof Error ? error : String(error) });
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
1036
|
}
|
|
@@ -1038,7 +1038,7 @@ var init_useEventBus = __esm({
|
|
|
1038
1038
|
try {
|
|
1039
1039
|
handler(event);
|
|
1040
1040
|
} catch (error) {
|
|
1041
|
-
|
|
1041
|
+
log.error("Error in onAny listener", { type, error: error instanceof Error ? error : String(error) });
|
|
1042
1042
|
}
|
|
1043
1043
|
});
|
|
1044
1044
|
},
|
|
@@ -3091,6 +3091,7 @@ var BUILT_IN_THEMES, ThemeContext;
|
|
|
3091
3091
|
var init_ThemeContext = __esm({
|
|
3092
3092
|
"context/ThemeContext.tsx"() {
|
|
3093
3093
|
"use client";
|
|
3094
|
+
createLogger("almadar:ui:theme");
|
|
3094
3095
|
BUILT_IN_THEMES = [
|
|
3095
3096
|
{
|
|
3096
3097
|
name: "wireframe",
|
|
@@ -4426,8 +4427,8 @@ var init_SectionHeader = __esm({
|
|
|
4426
4427
|
}
|
|
4427
4428
|
});
|
|
4428
4429
|
var sizeClasses4, MarketingStatCard;
|
|
4429
|
-
var
|
|
4430
|
-
"components/atoms/
|
|
4430
|
+
var init_MarketingStatCard = __esm({
|
|
4431
|
+
"components/atoms/MarketingStatCard.tsx"() {
|
|
4431
4432
|
init_cn();
|
|
4432
4433
|
init_Stack();
|
|
4433
4434
|
init_Typography();
|
|
@@ -8293,7 +8294,7 @@ function ActionButton({
|
|
|
8293
8294
|
disabled: isDisabled,
|
|
8294
8295
|
onClick,
|
|
8295
8296
|
className: cn(
|
|
8296
|
-
"relative inline-flex items-center gap-1.5 rounded-md border font-medium
|
|
8297
|
+
"relative inline-flex items-center gap-1.5 rounded-md border font-medium overflow-hidden transition-colors duration-150",
|
|
8297
8298
|
sizes.button,
|
|
8298
8299
|
variantStyles7[variant],
|
|
8299
8300
|
isDisabled && "opacity-60 cursor-not-allowed",
|
|
@@ -8303,7 +8304,7 @@ function ActionButton({
|
|
|
8303
8304
|
onCooldown && /* @__PURE__ */ jsx(
|
|
8304
8305
|
"div",
|
|
8305
8306
|
{
|
|
8306
|
-
className: "absolute inset-0 bg-
|
|
8307
|
+
className: "absolute inset-0 bg-foreground/40 pointer-events-none",
|
|
8307
8308
|
style: {
|
|
8308
8309
|
clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
8309
8310
|
WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
@@ -8311,13 +8312,16 @@ function ActionButton({
|
|
|
8311
8312
|
}
|
|
8312
8313
|
}
|
|
8313
8314
|
),
|
|
8314
|
-
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon
|
|
8315
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
|
|
8316
|
+
const I = resolveIcon(icon);
|
|
8317
|
+
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
|
|
8318
|
+
})() : icon }),
|
|
8315
8319
|
/* @__PURE__ */ jsx("span", { className: "relative z-10", children: label }),
|
|
8316
8320
|
hotkey && /* @__PURE__ */ jsx(
|
|
8317
8321
|
"span",
|
|
8318
8322
|
{
|
|
8319
8323
|
className: cn(
|
|
8320
|
-
"absolute top-0.5 right-0.5 bg-
|
|
8324
|
+
"absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
|
|
8321
8325
|
sizes.hotkey
|
|
8322
8326
|
),
|
|
8323
8327
|
children: hotkey
|
|
@@ -8331,15 +8335,16 @@ var sizeMap, variantStyles7;
|
|
|
8331
8335
|
var init_ActionButton = __esm({
|
|
8332
8336
|
"components/atoms/game/ActionButton.tsx"() {
|
|
8333
8337
|
init_cn();
|
|
8338
|
+
init_Icon();
|
|
8334
8339
|
sizeMap = {
|
|
8335
8340
|
sm: { button: "px-3 py-1.5 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
|
|
8336
8341
|
md: { button: "px-4 py-2 text-sm", hotkey: "text-[10px] px-1.5", icon: "text-sm" },
|
|
8337
8342
|
lg: { button: "px-5 py-2.5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
|
|
8338
8343
|
};
|
|
8339
8344
|
variantStyles7 = {
|
|
8340
|
-
primary: "bg-
|
|
8341
|
-
secondary: "bg-
|
|
8342
|
-
danger: "bg-
|
|
8345
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
|
|
8346
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
8347
|
+
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
8343
8348
|
};
|
|
8344
8349
|
ActionButton.displayName = "ActionButton";
|
|
8345
8350
|
}
|
|
@@ -8408,12 +8413,15 @@ function ControlButton({
|
|
|
8408
8413
|
sizeMap2[size] ?? sizeMap2.md,
|
|
8409
8414
|
shapeMap[shape] ?? shapeMap.circle,
|
|
8410
8415
|
variantMap[variant] ?? variantMap.secondary,
|
|
8411
|
-
actualPressed && "scale-95 brightness-110 border-
|
|
8416
|
+
actualPressed && "scale-95 brightness-110 border-foreground",
|
|
8412
8417
|
disabled && "opacity-50 cursor-not-allowed",
|
|
8413
8418
|
className
|
|
8414
8419
|
),
|
|
8415
8420
|
children: [
|
|
8416
|
-
icon && /* @__PURE__ */ jsx("span", { className: "text-2xl", children: icon
|
|
8421
|
+
icon && /* @__PURE__ */ jsx("span", { className: "text-2xl", children: typeof icon === "string" ? (() => {
|
|
8422
|
+
const I = resolveIcon(icon);
|
|
8423
|
+
return I ? /* @__PURE__ */ jsx(I, { className: "w-6 h-6" }) : null;
|
|
8424
|
+
})() : icon }),
|
|
8417
8425
|
label && !icon && /* @__PURE__ */ jsx("span", { children: label })
|
|
8418
8426
|
]
|
|
8419
8427
|
}
|
|
@@ -8425,6 +8433,7 @@ var init_ControlButton = __esm({
|
|
|
8425
8433
|
"use client";
|
|
8426
8434
|
init_cn();
|
|
8427
8435
|
init_useEventBus();
|
|
8436
|
+
init_Icon();
|
|
8428
8437
|
sizeMap2 = {
|
|
8429
8438
|
sm: "w-10 h-10 text-sm",
|
|
8430
8439
|
md: "w-14 h-14 text-base",
|
|
@@ -8437,9 +8446,9 @@ var init_ControlButton = __esm({
|
|
|
8437
8446
|
square: "rounded-md"
|
|
8438
8447
|
};
|
|
8439
8448
|
variantMap = {
|
|
8440
|
-
primary: "bg-
|
|
8441
|
-
secondary: "bg-
|
|
8442
|
-
ghost: "bg-transparent text-
|
|
8449
|
+
primary: "bg-primary text-primary-foreground border-primary hover:bg-primary-hover",
|
|
8450
|
+
secondary: "bg-secondary text-secondary-foreground border-border hover:bg-secondary-hover",
|
|
8451
|
+
ghost: "bg-transparent text-foreground border-border hover:bg-muted"
|
|
8443
8452
|
};
|
|
8444
8453
|
ControlButton.displayName = "ControlButton";
|
|
8445
8454
|
}
|
|
@@ -8905,7 +8914,7 @@ function getTraitSnapshots() {
|
|
|
8905
8914
|
try {
|
|
8906
8915
|
snapshots.push(getter());
|
|
8907
8916
|
} catch (err) {
|
|
8908
|
-
|
|
8917
|
+
log3.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
8909
8918
|
}
|
|
8910
8919
|
}
|
|
8911
8920
|
return snapshots;
|
|
@@ -8968,10 +8977,10 @@ function updateAssetStatus(url, status) {
|
|
|
8968
8977
|
window.__orbitalVerification.assetStatus[url] = status;
|
|
8969
8978
|
}
|
|
8970
8979
|
}
|
|
8971
|
-
var
|
|
8980
|
+
var log3;
|
|
8972
8981
|
var init_verificationRegistry = __esm({
|
|
8973
8982
|
"lib/verificationRegistry.ts"() {
|
|
8974
|
-
|
|
8983
|
+
log3 = createLogger("almadar:bridge");
|
|
8975
8984
|
exposeOnWindow();
|
|
8976
8985
|
}
|
|
8977
8986
|
});
|
|
@@ -10999,7 +11008,7 @@ var init_avl_elk_layout = __esm({
|
|
|
10999
11008
|
elk = new ELK();
|
|
11000
11009
|
}
|
|
11001
11010
|
});
|
|
11002
|
-
var SWIM_GUTTER, CENTER_W, BehaviorView;
|
|
11011
|
+
var log4, SWIM_GUTTER, CENTER_W, BehaviorView;
|
|
11003
11012
|
var init_BehaviorView = __esm({
|
|
11004
11013
|
"components/molecules/avl/BehaviorView.tsx"() {
|
|
11005
11014
|
"use client";
|
|
@@ -11008,6 +11017,7 @@ var init_BehaviorView = __esm({
|
|
|
11008
11017
|
init_AvlSwimLane();
|
|
11009
11018
|
init_types();
|
|
11010
11019
|
init_avl_elk_layout();
|
|
11020
|
+
log4 = createLogger("almadar:ui:avl:behavior-view");
|
|
11011
11021
|
SWIM_GUTTER = 120;
|
|
11012
11022
|
CENTER_W = 360;
|
|
11013
11023
|
BehaviorView = ({ data }) => {
|
|
@@ -11017,7 +11027,7 @@ var init_BehaviorView = __esm({
|
|
|
11017
11027
|
const dataKey = useMemo(() => JSON.stringify(traitData), [traitData]);
|
|
11018
11028
|
useEffect(() => {
|
|
11019
11029
|
if (!traitData) return;
|
|
11020
|
-
computeTraitLayout(traitData).then(setLayout).catch(
|
|
11030
|
+
computeTraitLayout(traitData).then(setLayout).catch((err) => log4.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
|
|
11021
11031
|
}, [dataKey]);
|
|
11022
11032
|
if (!traitData) {
|
|
11023
11033
|
return /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-4 text-center text-[var(--color-muted-foreground)] text-sm", children: "No trait data" });
|
|
@@ -11362,7 +11372,7 @@ function computeFoldRegions(code) {
|
|
|
11362
11372
|
}
|
|
11363
11373
|
return regions.sort((a, b) => a.start - b.start);
|
|
11364
11374
|
}
|
|
11365
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
11375
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
11366
11376
|
var init_CodeBlock = __esm({
|
|
11367
11377
|
"components/molecules/markdown/CodeBlock.tsx"() {
|
|
11368
11378
|
init_Box();
|
|
@@ -11439,6 +11449,7 @@ var init_CodeBlock = __esm({
|
|
|
11439
11449
|
"lolo-op-async": { color: ORB_COLORS.dark.async }
|
|
11440
11450
|
};
|
|
11441
11451
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
11452
|
+
log5 = createLogger("almadar:ui:markdown-code");
|
|
11442
11453
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
11443
11454
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
11444
11455
|
CodeBlock = React131__default.memo(
|
|
@@ -11637,7 +11648,7 @@ var init_CodeBlock = __esm({
|
|
|
11637
11648
|
eventBus.emit("UI:COPY_CODE", { language, success: true });
|
|
11638
11649
|
setTimeout(() => setCopied(false), 2e3);
|
|
11639
11650
|
} catch (err) {
|
|
11640
|
-
|
|
11651
|
+
log5.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
11641
11652
|
eventBus.emit("UI:COPY_CODE", { language, success: false });
|
|
11642
11653
|
}
|
|
11643
11654
|
};
|
|
@@ -15199,13 +15210,14 @@ function useSafeEventBus2() {
|
|
|
15199
15210
|
} };
|
|
15200
15211
|
}
|
|
15201
15212
|
}
|
|
15202
|
-
var ButtonGroup;
|
|
15213
|
+
var log6, ButtonGroup;
|
|
15203
15214
|
var init_ButtonGroup = __esm({
|
|
15204
15215
|
"components/molecules/ButtonGroup.tsx"() {
|
|
15205
15216
|
"use client";
|
|
15206
15217
|
init_cn();
|
|
15207
15218
|
init_atoms();
|
|
15208
15219
|
init_useEventBus();
|
|
15220
|
+
log6 = createLogger("almadar:ui:button-group");
|
|
15209
15221
|
ButtonGroup = ({
|
|
15210
15222
|
children,
|
|
15211
15223
|
primary,
|
|
@@ -15278,7 +15290,7 @@ var init_ButtonGroup = __esm({
|
|
|
15278
15290
|
{
|
|
15279
15291
|
variant: "ghost",
|
|
15280
15292
|
onClick: () => {
|
|
15281
|
-
|
|
15293
|
+
log6.debug("Filter clicked", { field: filter.field });
|
|
15282
15294
|
},
|
|
15283
15295
|
children: filter.label
|
|
15284
15296
|
},
|
|
@@ -18056,8 +18068,8 @@ function ChoiceButton({
|
|
|
18056
18068
|
className: cn(
|
|
18057
18069
|
"w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
|
|
18058
18070
|
"flex items-center gap-2",
|
|
18059
|
-
selected ? "bg-
|
|
18060
|
-
disabled && "opacity-40 cursor-not-allowed hover:bg-
|
|
18071
|
+
selected ? "bg-accent/15 border-accent text-foreground" : "bg-muted/40 border-border text-foreground hover:bg-muted hover:border-border",
|
|
18072
|
+
disabled && "opacity-40 cursor-not-allowed hover:bg-muted/40 hover:border-border",
|
|
18061
18073
|
className
|
|
18062
18074
|
),
|
|
18063
18075
|
children: [
|
|
@@ -18066,7 +18078,7 @@ function ChoiceButton({
|
|
|
18066
18078
|
{
|
|
18067
18079
|
className: cn(
|
|
18068
18080
|
"flex-shrink-0 font-mono font-bold text-sm",
|
|
18069
|
-
selected ? "text-
|
|
18081
|
+
selected ? "text-accent" : "text-muted-foreground"
|
|
18070
18082
|
),
|
|
18071
18083
|
children: [
|
|
18072
18084
|
index,
|
|
@@ -20270,7 +20282,7 @@ function DataGrid({
|
|
|
20270
20282
|
onClick: handleActionClick(action, itemData),
|
|
20271
20283
|
"data-testid": `action-${action.event}`,
|
|
20272
20284
|
"data-row-id": String(itemData.id),
|
|
20273
|
-
className: "text-error hover:bg-error/10 px-2",
|
|
20285
|
+
className: "text-error hover:text-error hover:bg-error/10 px-2",
|
|
20274
20286
|
children: [
|
|
20275
20287
|
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
|
|
20276
20288
|
action.label
|
|
@@ -21534,31 +21546,56 @@ var init_InputGroup = __esm({
|
|
|
21534
21546
|
InputGroup.displayName = "InputGroup";
|
|
21535
21547
|
}
|
|
21536
21548
|
});
|
|
21537
|
-
|
|
21538
|
-
|
|
21549
|
+
function gateEnabled(level, ns = NAMESPACE) {
|
|
21550
|
+
return isLogLevelEnabled(level, ns);
|
|
21551
|
+
}
|
|
21539
21552
|
function isDebugEnabled() {
|
|
21540
|
-
|
|
21541
|
-
return typeof window !== "undefined" && window.__ALMADAR_DEBUG_VERIFY__ === true;
|
|
21553
|
+
return gateEnabled("DEBUG");
|
|
21542
21554
|
}
|
|
21543
21555
|
function debug(...args) {
|
|
21544
|
-
if (
|
|
21545
|
-
|
|
21556
|
+
if (!gateEnabled("DEBUG")) return;
|
|
21557
|
+
const [first, ...rest] = args;
|
|
21558
|
+
const message = typeof first === "string" ? first : "<debug>";
|
|
21559
|
+
if (rest.length === 0 && typeof first === "string") {
|
|
21560
|
+
log7.debug(message);
|
|
21561
|
+
} else {
|
|
21562
|
+
log7.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
21546
21563
|
}
|
|
21547
21564
|
}
|
|
21548
21565
|
function debugGroup(label) {
|
|
21549
|
-
if (
|
|
21550
|
-
console.group(`[DEBUG] ${label}`);
|
|
21551
|
-
}
|
|
21566
|
+
if (gateEnabled("DEBUG")) console.group(`[${NAMESPACE}] ${label}`);
|
|
21552
21567
|
}
|
|
21553
21568
|
function debugGroupEnd() {
|
|
21554
|
-
if (
|
|
21555
|
-
|
|
21569
|
+
if (gateEnabled("DEBUG")) console.groupEnd();
|
|
21570
|
+
}
|
|
21571
|
+
function formatArgs(values) {
|
|
21572
|
+
if (values.length === 1) return toLogMetaValue(values[0]);
|
|
21573
|
+
return values.map(toLogMetaValue);
|
|
21574
|
+
}
|
|
21575
|
+
function toLogMetaValue(v) {
|
|
21576
|
+
if (v === null || v === void 0) return v;
|
|
21577
|
+
if (v instanceof Error) return v;
|
|
21578
|
+
const t = typeof v;
|
|
21579
|
+
if (t === "string" || t === "number" || t === "boolean") return v;
|
|
21580
|
+
if (Array.isArray(v)) return v.map(toLogMetaValue);
|
|
21581
|
+
if (t === "object") {
|
|
21582
|
+
const out = {};
|
|
21583
|
+
for (const [k, val] of Object.entries(v)) {
|
|
21584
|
+
out[k] = toLogMetaValue(val);
|
|
21585
|
+
}
|
|
21586
|
+
return out;
|
|
21556
21587
|
}
|
|
21588
|
+
return String(v);
|
|
21557
21589
|
}
|
|
21558
|
-
var
|
|
21590
|
+
var NAMESPACE, log7;
|
|
21559
21591
|
var init_debug = __esm({
|
|
21560
21592
|
"lib/debug.ts"() {
|
|
21561
|
-
|
|
21593
|
+
NAMESPACE = "almadar:ui:debug";
|
|
21594
|
+
log7 = createLogger(NAMESPACE);
|
|
21595
|
+
createLogger("almadar:ui:debug:input");
|
|
21596
|
+
createLogger("almadar:ui:debug:collision");
|
|
21597
|
+
createLogger("almadar:ui:debug:physics");
|
|
21598
|
+
createLogger("almadar:ui:debug:game-state");
|
|
21562
21599
|
}
|
|
21563
21600
|
});
|
|
21564
21601
|
var isRelationsDebugEnabled, RelationSelect;
|
|
@@ -22987,7 +23024,7 @@ function StatBadge({
|
|
|
22987
23024
|
const I = resolveIcon(icon);
|
|
22988
23025
|
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : icon;
|
|
22989
23026
|
})() : icon }),
|
|
22990
|
-
/* @__PURE__ */ jsx("span", { className: "text-
|
|
23027
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-medium", children: label }),
|
|
22991
23028
|
format === "hearts" && max && /* @__PURE__ */ jsx(
|
|
22992
23029
|
HealthBar,
|
|
22993
23030
|
{
|
|
@@ -23014,7 +23051,7 @@ function StatBadge({
|
|
|
23014
23051
|
animated: true
|
|
23015
23052
|
}
|
|
23016
23053
|
),
|
|
23017
|
-
format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-
|
|
23054
|
+
format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-foreground", children: value })
|
|
23018
23055
|
]
|
|
23019
23056
|
}
|
|
23020
23057
|
);
|
|
@@ -23032,11 +23069,11 @@ var init_StatBadge = __esm({
|
|
|
23032
23069
|
lg: "text-base px-4 py-2"
|
|
23033
23070
|
};
|
|
23034
23071
|
variantMap2 = {
|
|
23035
|
-
default: "bg-
|
|
23036
|
-
primary: "bg-
|
|
23037
|
-
success: "bg-
|
|
23038
|
-
warning: "bg-
|
|
23039
|
-
danger: "bg-
|
|
23072
|
+
default: "bg-card/80 border-border text-foreground",
|
|
23073
|
+
primary: "bg-primary/15 border-primary/40 text-foreground",
|
|
23074
|
+
success: "bg-success/15 border-success/40 text-foreground",
|
|
23075
|
+
warning: "bg-warning/15 border-warning/40 text-foreground",
|
|
23076
|
+
danger: "bg-error/15 border-error/40 text-foreground"
|
|
23040
23077
|
};
|
|
23041
23078
|
StatBadge.displayName = "StatBadge";
|
|
23042
23079
|
}
|
|
@@ -35945,9 +35982,45 @@ var init_List = __esm({
|
|
|
35945
35982
|
List3.displayName = "List";
|
|
35946
35983
|
}
|
|
35947
35984
|
});
|
|
35948
|
-
|
|
35985
|
+
function MasterDetail({
|
|
35986
|
+
entity,
|
|
35987
|
+
masterFields,
|
|
35988
|
+
detailFields: _detailFields,
|
|
35989
|
+
// Captured but not used here - detail handled separately
|
|
35990
|
+
loading: externalLoading,
|
|
35991
|
+
isLoading: externalIsLoading,
|
|
35992
|
+
error: externalError,
|
|
35993
|
+
className,
|
|
35994
|
+
...rest
|
|
35995
|
+
}) {
|
|
35996
|
+
const loading = externalLoading ?? false;
|
|
35997
|
+
const isLoading = externalIsLoading ?? false;
|
|
35998
|
+
const error = externalError ?? null;
|
|
35999
|
+
return /* @__PURE__ */ jsx(
|
|
36000
|
+
DataTable,
|
|
36001
|
+
{
|
|
36002
|
+
fields: masterFields,
|
|
36003
|
+
columns: masterFields,
|
|
36004
|
+
entity,
|
|
36005
|
+
isLoading: loading || isLoading,
|
|
36006
|
+
error,
|
|
36007
|
+
className,
|
|
36008
|
+
emptyTitle: "No items found",
|
|
36009
|
+
emptyDescription: "Create your first item to get started.",
|
|
36010
|
+
...rest
|
|
36011
|
+
}
|
|
36012
|
+
);
|
|
36013
|
+
}
|
|
35949
36014
|
var init_MasterDetail = __esm({
|
|
35950
|
-
"components/organisms/
|
|
36015
|
+
"components/organisms/MasterDetail.tsx"() {
|
|
36016
|
+
"use client";
|
|
36017
|
+
init_DataTable();
|
|
36018
|
+
MasterDetail.displayName = "MasterDetail";
|
|
36019
|
+
}
|
|
36020
|
+
});
|
|
36021
|
+
var DefaultEmptyDetail, MasterDetailLayout;
|
|
36022
|
+
var init_MasterDetailLayout = __esm({
|
|
36023
|
+
"components/organisms/layout/MasterDetailLayout.tsx"() {
|
|
35951
36024
|
init_cn();
|
|
35952
36025
|
init_Typography();
|
|
35953
36026
|
DefaultEmptyDetail = () => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full border-2 border-dashed border-border", children: /* @__PURE__ */ jsx(
|
|
@@ -35958,7 +36031,7 @@ var init_MasterDetail = __esm({
|
|
|
35958
36031
|
children: "Select an item to view details"
|
|
35959
36032
|
}
|
|
35960
36033
|
) });
|
|
35961
|
-
|
|
36034
|
+
MasterDetailLayout = ({
|
|
35962
36035
|
master,
|
|
35963
36036
|
detail,
|
|
35964
36037
|
emptyDetail,
|
|
@@ -35993,7 +36066,7 @@ var init_MasterDetail = __esm({
|
|
|
35993
36066
|
}
|
|
35994
36067
|
);
|
|
35995
36068
|
};
|
|
35996
|
-
|
|
36069
|
+
MasterDetailLayout.displayName = "MasterDetailLayout";
|
|
35997
36070
|
}
|
|
35998
36071
|
});
|
|
35999
36072
|
var COLUMN_CLASSES, ASPECT_CLASSES, MediaGallery;
|
|
@@ -38530,7 +38603,7 @@ function getAllEvents(traits2) {
|
|
|
38530
38603
|
}
|
|
38531
38604
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
38532
38605
|
const eventBus = useEventBus();
|
|
38533
|
-
const [
|
|
38606
|
+
const [log18, setLog] = React131.useState([]);
|
|
38534
38607
|
const prevStatesRef = React131.useRef(/* @__PURE__ */ new Map());
|
|
38535
38608
|
React131.useEffect(() => {
|
|
38536
38609
|
for (const trait of traits2) {
|
|
@@ -38594,9 +38667,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
38594
38667
|
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: "Other Events (not available from current state)" }),
|
|
38595
38668
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
|
|
38596
38669
|
] }),
|
|
38597
|
-
|
|
38670
|
+
log18.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
38598
38671
|
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: "Recent Transitions" }),
|
|
38599
|
-
/* @__PURE__ */ jsx(Stack, { gap: "xs", children:
|
|
38672
|
+
/* @__PURE__ */ jsx(Stack, { gap: "xs", children: log18.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
|
|
38600
38673
|
/* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
|
|
38601
38674
|
" ",
|
|
38602
38675
|
/* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
|
|
@@ -40807,7 +40880,7 @@ var init_Sprite = __esm({
|
|
|
40807
40880
|
}
|
|
40808
40881
|
});
|
|
40809
40882
|
var StatCard;
|
|
40810
|
-
var
|
|
40883
|
+
var init_StatCard = __esm({
|
|
40811
40884
|
"components/organisms/StatCard.tsx"() {
|
|
40812
40885
|
"use client";
|
|
40813
40886
|
init_cn();
|
|
@@ -43167,6 +43240,7 @@ var init_component_registry_generated = __esm({
|
|
|
43167
43240
|
init_LoadingState();
|
|
43168
43241
|
init_MarkdownContent();
|
|
43169
43242
|
init_MasterDetail();
|
|
43243
|
+
init_MasterDetailLayout();
|
|
43170
43244
|
init_MatrixQuestion();
|
|
43171
43245
|
init_MediaGallery();
|
|
43172
43246
|
init_Meter();
|
|
@@ -43234,7 +43308,7 @@ var init_component_registry_generated = __esm({
|
|
|
43234
43308
|
init_Stack();
|
|
43235
43309
|
init_StarRating();
|
|
43236
43310
|
init_StatBadge();
|
|
43237
|
-
|
|
43311
|
+
init_StatCard();
|
|
43238
43312
|
init_StatDisplay();
|
|
43239
43313
|
init_StateArchitectBoard();
|
|
43240
43314
|
init_StateIndicator();
|
|
@@ -43461,6 +43535,7 @@ var init_component_registry_generated = __esm({
|
|
|
43461
43535
|
"MapViewPattern": MapViewPattern,
|
|
43462
43536
|
"MarkdownContent": MarkdownContent,
|
|
43463
43537
|
"MasterDetail": MasterDetail,
|
|
43538
|
+
"MasterDetailLayout": MasterDetailLayout,
|
|
43464
43539
|
"MatrixQuestion": MatrixQuestion,
|
|
43465
43540
|
"MediaGallery": MediaGallery,
|
|
43466
43541
|
"Menu": MenuPattern,
|
|
@@ -44560,7 +44635,7 @@ var init_atoms = __esm({
|
|
|
44560
44635
|
init_ConfettiEffect();
|
|
44561
44636
|
init_TypewriterText();
|
|
44562
44637
|
init_SectionHeader();
|
|
44563
|
-
|
|
44638
|
+
init_MarketingStatCard();
|
|
44564
44639
|
init_ContentSection();
|
|
44565
44640
|
init_PatternTile();
|
|
44566
44641
|
init_AnimatedReveal();
|
|
@@ -44577,7 +44652,7 @@ init_molecules();
|
|
|
44577
44652
|
// components/organisms/index.ts
|
|
44578
44653
|
init_types3();
|
|
44579
44654
|
init_DataTable();
|
|
44580
|
-
|
|
44655
|
+
init_StatCard();
|
|
44581
44656
|
init_PageHeader();
|
|
44582
44657
|
init_DetailPanel();
|
|
44583
44658
|
|
|
@@ -44715,41 +44790,7 @@ init_Split();
|
|
|
44715
44790
|
init_Table();
|
|
44716
44791
|
init_List();
|
|
44717
44792
|
init_CardGrid();
|
|
44718
|
-
|
|
44719
|
-
// components/organisms/MasterDetail.tsx
|
|
44720
|
-
init_DataTable();
|
|
44721
|
-
function MasterDetail2({
|
|
44722
|
-
entity,
|
|
44723
|
-
masterFields,
|
|
44724
|
-
detailFields: _detailFields,
|
|
44725
|
-
// Captured but not used here - detail handled separately
|
|
44726
|
-
loading: externalLoading,
|
|
44727
|
-
isLoading: externalIsLoading,
|
|
44728
|
-
error: externalError,
|
|
44729
|
-
className,
|
|
44730
|
-
...rest
|
|
44731
|
-
}) {
|
|
44732
|
-
const loading = externalLoading ?? false;
|
|
44733
|
-
const isLoading = externalIsLoading ?? false;
|
|
44734
|
-
const error = externalError ?? null;
|
|
44735
|
-
return /* @__PURE__ */ jsx(
|
|
44736
|
-
DataTable,
|
|
44737
|
-
{
|
|
44738
|
-
fields: masterFields,
|
|
44739
|
-
columns: masterFields,
|
|
44740
|
-
entity,
|
|
44741
|
-
isLoading: loading || isLoading,
|
|
44742
|
-
error,
|
|
44743
|
-
className,
|
|
44744
|
-
emptyTitle: "No items found",
|
|
44745
|
-
emptyDescription: "Create your first item to get started.",
|
|
44746
|
-
...rest
|
|
44747
|
-
}
|
|
44748
|
-
);
|
|
44749
|
-
}
|
|
44750
|
-
MasterDetail2.displayName = "MasterDetail";
|
|
44751
|
-
|
|
44752
|
-
// components/organisms/index.ts
|
|
44793
|
+
init_MasterDetail();
|
|
44753
44794
|
init_ConfirmDialog();
|
|
44754
44795
|
init_WizardContainer();
|
|
44755
44796
|
init_OrbitalVisualization();
|
|
@@ -44767,6 +44808,7 @@ init_types2();
|
|
|
44767
44808
|
|
|
44768
44809
|
// components/organisms/layout/index.ts
|
|
44769
44810
|
init_SplitPane();
|
|
44811
|
+
init_MasterDetailLayout();
|
|
44770
44812
|
init_DashboardGrid();
|
|
44771
44813
|
init_TabbedContainer();
|
|
44772
44814
|
|
|
@@ -45896,6 +45938,7 @@ init_AboutPageTemplate();
|
|
|
45896
45938
|
|
|
45897
45939
|
// components/index.ts
|
|
45898
45940
|
init_cn();
|
|
45941
|
+
var log8 = createLogger("almadar:ui:orbital-history");
|
|
45899
45942
|
function useOrbitalHistory(options) {
|
|
45900
45943
|
const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
|
|
45901
45944
|
const getHeaders = useCallback(() => {
|
|
@@ -45957,7 +46000,7 @@ function useOrbitalHistory(options) {
|
|
|
45957
46000
|
setCurrentVersion(mergedTimeline[0].version);
|
|
45958
46001
|
}
|
|
45959
46002
|
} catch (err) {
|
|
45960
|
-
|
|
46003
|
+
log8.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
|
|
45961
46004
|
setError(err instanceof Error ? err.message : "Failed to load history");
|
|
45962
46005
|
} finally {
|
|
45963
46006
|
setIsLoading(false);
|
|
@@ -45990,7 +46033,7 @@ function useOrbitalHistory(options) {
|
|
|
45990
46033
|
error: data.error || "Unknown error during revert"
|
|
45991
46034
|
};
|
|
45992
46035
|
} catch (err) {
|
|
45993
|
-
|
|
46036
|
+
log8.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
|
|
45994
46037
|
return {
|
|
45995
46038
|
success: false,
|
|
45996
46039
|
error: err instanceof Error ? err.message : "Failed to revert"
|
|
@@ -46014,6 +46057,7 @@ function useOrbitalHistory(options) {
|
|
|
46014
46057
|
refresh
|
|
46015
46058
|
};
|
|
46016
46059
|
}
|
|
46060
|
+
var log9 = createLogger("almadar:ui:filesystem");
|
|
46017
46061
|
function useFileSystem() {
|
|
46018
46062
|
const [status, setStatus] = useState("idle");
|
|
46019
46063
|
const [error, setError] = useState(null);
|
|
@@ -46028,7 +46072,7 @@ function useFileSystem() {
|
|
|
46028
46072
|
setError(null);
|
|
46029
46073
|
setIsLoading(true);
|
|
46030
46074
|
try {
|
|
46031
|
-
|
|
46075
|
+
log9.debug("Booting WebContainer");
|
|
46032
46076
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46033
46077
|
setStatus("ready");
|
|
46034
46078
|
} catch (err) {
|
|
@@ -46091,7 +46135,7 @@ function useFileSystem() {
|
|
|
46091
46135
|
setFiles(newTree);
|
|
46092
46136
|
setStatus("running");
|
|
46093
46137
|
} catch (err) {
|
|
46094
|
-
|
|
46138
|
+
log9.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
|
|
46095
46139
|
} finally {
|
|
46096
46140
|
setIsLoading(false);
|
|
46097
46141
|
}
|
|
@@ -46132,7 +46176,7 @@ function useFileSystem() {
|
|
|
46132
46176
|
const path = contentArg !== void 0 ? pathOrContent : selectedPath;
|
|
46133
46177
|
const content = contentArg !== void 0 ? contentArg : pathOrContent;
|
|
46134
46178
|
if (!path) {
|
|
46135
|
-
|
|
46179
|
+
log9.warn("updateContent called without path and no file selected");
|
|
46136
46180
|
return;
|
|
46137
46181
|
}
|
|
46138
46182
|
setFileContents((prev) => {
|
|
@@ -46148,14 +46192,14 @@ function useFileSystem() {
|
|
|
46148
46192
|
setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
|
|
46149
46193
|
}, []);
|
|
46150
46194
|
const refreshTree = useCallback(async () => {
|
|
46151
|
-
|
|
46195
|
+
log9.debug("Refreshing tree");
|
|
46152
46196
|
}, []);
|
|
46153
46197
|
const runCommand = useCallback(async (command) => {
|
|
46154
|
-
|
|
46198
|
+
log9.debug("Running command", { command });
|
|
46155
46199
|
return { exitCode: 0, output: "" };
|
|
46156
46200
|
}, []);
|
|
46157
46201
|
const startDevServer = useCallback(async () => {
|
|
46158
|
-
|
|
46202
|
+
log9.debug("Starting dev server");
|
|
46159
46203
|
setPreviewUrl("http://localhost:5173");
|
|
46160
46204
|
}, []);
|
|
46161
46205
|
return {
|
|
@@ -46178,6 +46222,7 @@ function useFileSystem() {
|
|
|
46178
46222
|
startDevServer
|
|
46179
46223
|
};
|
|
46180
46224
|
}
|
|
46225
|
+
var log10 = createLogger("almadar:ui:extensions");
|
|
46181
46226
|
var defaultManifest = {
|
|
46182
46227
|
languages: {
|
|
46183
46228
|
typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
|
|
@@ -46196,7 +46241,7 @@ function useExtensions(options) {
|
|
|
46196
46241
|
const [isLoading, setIsLoading] = useState(false);
|
|
46197
46242
|
const [error, setError] = useState(null);
|
|
46198
46243
|
const loadExtension = useCallback(async (extensionId) => {
|
|
46199
|
-
|
|
46244
|
+
log10.debug("Loading extension", { extensionId });
|
|
46200
46245
|
}, []);
|
|
46201
46246
|
const loadExtensions = useCallback(async () => {
|
|
46202
46247
|
setIsLoading(true);
|
|
@@ -46268,6 +46313,7 @@ function useExtensions(options) {
|
|
|
46268
46313
|
getExtensionForFile
|
|
46269
46314
|
};
|
|
46270
46315
|
}
|
|
46316
|
+
var log11 = createLogger("almadar:ui:file-editor");
|
|
46271
46317
|
function useFileEditor(options) {
|
|
46272
46318
|
const { extensions, fileSystem, onSchemaUpdate } = options;
|
|
46273
46319
|
const [openFiles, setOpenFiles] = useState([]);
|
|
@@ -46292,7 +46338,7 @@ function useFileEditor(options) {
|
|
|
46292
46338
|
setOpenFiles((prev) => [...prev, newFile]);
|
|
46293
46339
|
setActiveFilePath(path);
|
|
46294
46340
|
} catch (err) {
|
|
46295
|
-
|
|
46341
|
+
log11.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
|
|
46296
46342
|
}
|
|
46297
46343
|
}, [openFiles, fileSystem, extensions]);
|
|
46298
46344
|
const closeFile = useCallback((path) => {
|
|
@@ -46353,7 +46399,7 @@ function useFileEditor(options) {
|
|
|
46353
46399
|
}
|
|
46354
46400
|
}
|
|
46355
46401
|
} catch (err) {
|
|
46356
|
-
|
|
46402
|
+
log11.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
|
|
46357
46403
|
} finally {
|
|
46358
46404
|
setIsSaving(false);
|
|
46359
46405
|
}
|
|
@@ -46382,6 +46428,7 @@ function useFileEditor(options) {
|
|
|
46382
46428
|
saveAllFiles
|
|
46383
46429
|
};
|
|
46384
46430
|
}
|
|
46431
|
+
var log12 = createLogger("almadar:ui:compile");
|
|
46385
46432
|
function useCompile() {
|
|
46386
46433
|
const [isCompiling, setIsCompiling] = useState(false);
|
|
46387
46434
|
const [stage, setStage] = useState("idle");
|
|
@@ -46392,7 +46439,7 @@ function useCompile() {
|
|
|
46392
46439
|
setStage("compiling");
|
|
46393
46440
|
setError(null);
|
|
46394
46441
|
try {
|
|
46395
|
-
|
|
46442
|
+
log12.debug("Compiling schema", { name: schema.name });
|
|
46396
46443
|
const result = {
|
|
46397
46444
|
success: true,
|
|
46398
46445
|
files: []
|
|
@@ -46418,6 +46465,7 @@ function useCompile() {
|
|
|
46418
46465
|
compileSchema
|
|
46419
46466
|
};
|
|
46420
46467
|
}
|
|
46468
|
+
var log13 = createLogger("almadar:ui:preview");
|
|
46421
46469
|
function usePreview(options) {
|
|
46422
46470
|
const [previewUrl, setPreviewUrl] = useState(null);
|
|
46423
46471
|
const [isLoading, setIsLoading] = useState(!!options?.appId);
|
|
@@ -46451,17 +46499,17 @@ function usePreview(options) {
|
|
|
46451
46499
|
setIsLoading(false);
|
|
46452
46500
|
return;
|
|
46453
46501
|
}
|
|
46454
|
-
|
|
46502
|
+
log13.debug("Setting up preview for app", { appId });
|
|
46455
46503
|
setPreviewUrl(`/api/orbitals/${appId}`);
|
|
46456
46504
|
setIsLoading(false);
|
|
46457
46505
|
}, [options?.appId]);
|
|
46458
46506
|
const startPreview = useCallback(async () => {
|
|
46459
|
-
|
|
46507
|
+
log13.debug("startPreview called");
|
|
46460
46508
|
}, []);
|
|
46461
46509
|
const stopPreview = useCallback(async () => {
|
|
46462
46510
|
setIsLoading(true);
|
|
46463
46511
|
try {
|
|
46464
|
-
|
|
46512
|
+
log13.debug("Stopping preview server");
|
|
46465
46513
|
setPreviewUrl(null);
|
|
46466
46514
|
setApp(null);
|
|
46467
46515
|
} finally {
|
|
@@ -46470,15 +46518,15 @@ function usePreview(options) {
|
|
|
46470
46518
|
}, []);
|
|
46471
46519
|
const refresh = useCallback(async () => {
|
|
46472
46520
|
if (!previewUrl) return;
|
|
46473
|
-
|
|
46521
|
+
log13.debug("Refreshing preview");
|
|
46474
46522
|
setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
|
|
46475
46523
|
}, [previewUrl]);
|
|
46476
46524
|
const handleRefresh = useCallback(async () => {
|
|
46477
|
-
|
|
46525
|
+
log13.debug("Handle refresh");
|
|
46478
46526
|
await refresh();
|
|
46479
46527
|
}, [refresh]);
|
|
46480
46528
|
const handleReset = useCallback(async () => {
|
|
46481
|
-
|
|
46529
|
+
log13.debug("Resetting preview");
|
|
46482
46530
|
setError(null);
|
|
46483
46531
|
setLoadError(null);
|
|
46484
46532
|
setErrorToast(null);
|
|
@@ -46512,6 +46560,7 @@ function usePreview(options) {
|
|
|
46512
46560
|
dismissErrorToast
|
|
46513
46561
|
};
|
|
46514
46562
|
}
|
|
46563
|
+
var log14 = createLogger("almadar:ui:agent-chat");
|
|
46515
46564
|
function useAgentChat(options) {
|
|
46516
46565
|
const [messages, setMessages] = useState([]);
|
|
46517
46566
|
const [status, setStatus] = useState("idle");
|
|
@@ -46534,7 +46583,7 @@ function useAgentChat(options) {
|
|
|
46534
46583
|
timestamp: Date.now()
|
|
46535
46584
|
};
|
|
46536
46585
|
setMessages((prev) => [...prev, userMessage]);
|
|
46537
|
-
|
|
46586
|
+
log14.debug("Sending message", { content });
|
|
46538
46587
|
const assistantMessage = {
|
|
46539
46588
|
id: (Date.now() + 1).toString(),
|
|
46540
46589
|
role: "assistant",
|
|
@@ -46557,7 +46606,7 @@ function useAgentChat(options) {
|
|
|
46557
46606
|
setError(null);
|
|
46558
46607
|
const skillName = Array.isArray(skill) ? skill[0] : skill;
|
|
46559
46608
|
try {
|
|
46560
|
-
|
|
46609
|
+
log14.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
|
|
46561
46610
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46562
46611
|
setStatus("complete");
|
|
46563
46612
|
options?.onComplete?.();
|
|
@@ -46569,10 +46618,10 @@ function useAgentChat(options) {
|
|
|
46569
46618
|
}
|
|
46570
46619
|
}, [options]);
|
|
46571
46620
|
const continueConversation = useCallback(async (message) => {
|
|
46572
|
-
|
|
46621
|
+
log14.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
|
|
46573
46622
|
}, []);
|
|
46574
46623
|
const resumeWithDecision = useCallback(async (decisions) => {
|
|
46575
|
-
|
|
46624
|
+
log14.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
46576
46625
|
setInterrupt(null);
|
|
46577
46626
|
}, []);
|
|
46578
46627
|
const cancel = useCallback(() => {
|
|
@@ -46609,6 +46658,7 @@ function useAgentChat(options) {
|
|
|
46609
46658
|
clearHistory
|
|
46610
46659
|
};
|
|
46611
46660
|
}
|
|
46661
|
+
var log15 = createLogger("almadar:ui:validation");
|
|
46612
46662
|
function useValidation() {
|
|
46613
46663
|
const [result, setResult] = useState(null);
|
|
46614
46664
|
const [isValidating, setIsValidating] = useState(false);
|
|
@@ -46622,7 +46672,7 @@ function useValidation() {
|
|
|
46622
46672
|
setStage("validating");
|
|
46623
46673
|
setProgressMessage("Validating schema...");
|
|
46624
46674
|
try {
|
|
46625
|
-
|
|
46675
|
+
log15.debug("Validating app", { appId });
|
|
46626
46676
|
const validationResult = {
|
|
46627
46677
|
valid: true,
|
|
46628
46678
|
errors: [],
|
|
@@ -46675,6 +46725,7 @@ function useValidation() {
|
|
|
46675
46725
|
reset
|
|
46676
46726
|
};
|
|
46677
46727
|
}
|
|
46728
|
+
var log16 = createLogger("almadar:ui:deep-agent");
|
|
46678
46729
|
function useDeepAgentGeneration() {
|
|
46679
46730
|
const [requests, setRequests] = useState([]);
|
|
46680
46731
|
const [currentRequest, setCurrentRequest] = useState(null);
|
|
@@ -46698,7 +46749,7 @@ function useDeepAgentGeneration() {
|
|
|
46698
46749
|
setCurrentRequest(request);
|
|
46699
46750
|
setRequests((prev) => [...prev, request]);
|
|
46700
46751
|
try {
|
|
46701
|
-
|
|
46752
|
+
log16.debug("Generating from prompt", { prompt });
|
|
46702
46753
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46703
46754
|
request.status = "completed";
|
|
46704
46755
|
setCurrentRequest(request);
|
|
@@ -46718,7 +46769,7 @@ function useDeepAgentGeneration() {
|
|
|
46718
46769
|
}
|
|
46719
46770
|
}, []);
|
|
46720
46771
|
const startGeneration = useCallback(async (skill, prompt, _options) => {
|
|
46721
|
-
|
|
46772
|
+
log16.debug("Starting generation with skill", { skill });
|
|
46722
46773
|
await generate(prompt);
|
|
46723
46774
|
}, [generate]);
|
|
46724
46775
|
const cancelGeneration = useCallback(() => {
|
|
@@ -46740,7 +46791,7 @@ function useDeepAgentGeneration() {
|
|
|
46740
46791
|
setIsComplete(false);
|
|
46741
46792
|
}, []);
|
|
46742
46793
|
const submitInterruptDecisions = useCallback((decisions) => {
|
|
46743
|
-
|
|
46794
|
+
log16.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
46744
46795
|
setInterrupt(null);
|
|
46745
46796
|
}, []);
|
|
46746
46797
|
return {
|
|
@@ -46762,7 +46813,7 @@ function useDeepAgentGeneration() {
|
|
|
46762
46813
|
|
|
46763
46814
|
// hooks/index.ts
|
|
46764
46815
|
init_useEventBus();
|
|
46765
|
-
var
|
|
46816
|
+
var log17 = createLogger("almadar:ui:ui-slots");
|
|
46766
46817
|
var DEFAULT_SOURCE_KEY = "__default__";
|
|
46767
46818
|
var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
|
|
46768
46819
|
var ALL_SLOTS2 = [
|
|
@@ -46844,7 +46895,7 @@ function useUISlotManager() {
|
|
|
46844
46895
|
try {
|
|
46845
46896
|
callback(slot, content);
|
|
46846
46897
|
} catch (error) {
|
|
46847
|
-
|
|
46898
|
+
log17.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
|
|
46848
46899
|
}
|
|
46849
46900
|
});
|
|
46850
46901
|
}, []);
|
|
@@ -46856,7 +46907,7 @@ function useUISlotManager() {
|
|
|
46856
46907
|
try {
|
|
46857
46908
|
callback(content);
|
|
46858
46909
|
} catch (error) {
|
|
46859
|
-
|
|
46910
|
+
log17.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
|
|
46860
46911
|
}
|
|
46861
46912
|
});
|
|
46862
46913
|
},
|
|
@@ -46907,9 +46958,12 @@ function useUISlotManager() {
|
|
|
46907
46958
|
const slotSources = prev[config.target] ?? {};
|
|
46908
46959
|
const existing = slotSources[sourceKey];
|
|
46909
46960
|
if (existing && existing.priority > content.priority) {
|
|
46910
|
-
|
|
46911
|
-
|
|
46912
|
-
|
|
46961
|
+
log17.warn("Slot already has higher priority content", {
|
|
46962
|
+
slot: config.target,
|
|
46963
|
+
sourceKey,
|
|
46964
|
+
existingPriority: existing.priority,
|
|
46965
|
+
newPriority: content.priority
|
|
46966
|
+
});
|
|
46913
46967
|
return prev;
|
|
46914
46968
|
}
|
|
46915
46969
|
const nextSources = {
|
|
@@ -46921,7 +46975,7 @@ function useUISlotManager() {
|
|
|
46921
46975
|
indexTraitRender(content.sourceTrait, content);
|
|
46922
46976
|
notifyTraitSubscribers(content.sourceTrait, content);
|
|
46923
46977
|
}
|
|
46924
|
-
|
|
46978
|
+
log17.info("slot:written", {
|
|
46925
46979
|
slot: config.target,
|
|
46926
46980
|
sourceKey,
|
|
46927
46981
|
sourceTrait: content.sourceTrait,
|
|
@@ -46966,7 +47020,7 @@ function useUISlotManager() {
|
|
|
46966
47020
|
setSources((prev) => {
|
|
46967
47021
|
const slotSources = prev[slot];
|
|
46968
47022
|
if (!slotSources || !(sourceKey in slotSources)) {
|
|
46969
|
-
|
|
47023
|
+
log17.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
|
|
46970
47024
|
return prev;
|
|
46971
47025
|
}
|
|
46972
47026
|
const content = slotSources[sourceKey];
|
|
@@ -46982,7 +47036,7 @@ function useUISlotManager() {
|
|
|
46982
47036
|
}
|
|
46983
47037
|
const nextSources = { ...slotSources };
|
|
46984
47038
|
delete nextSources[sourceKey];
|
|
46985
|
-
|
|
47039
|
+
log17.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
|
|
46986
47040
|
notifySubscribers(slot, aggregateSlot(nextSources));
|
|
46987
47041
|
return { ...prev, [slot]: nextSources };
|
|
46988
47042
|
});
|
|
@@ -47498,4 +47552,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
|
|
|
47498
47552
|
});
|
|
47499
47553
|
}
|
|
47500
47554
|
|
|
47501
|
-
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingStatCard,
|
|
47555
|
+
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, Table, Tabs, TagCloud, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEntities, useEntitiesByType, useEntity as useEntityById, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTraitListens, useTranslate, useUIEvents, useUISlotManager, useValidation };
|