@almadar/ui 4.44.1 → 4.45.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 +170 -141
- package/dist/avl/index.js +171 -142
- package/dist/components/index.cjs +103 -62
- package/dist/components/index.js +104 -63
- package/dist/components/organisms/game/three/index.cjs +18 -15
- package/dist/components/organisms/game/three/index.js +18 -15
- 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 +111 -88
- package/dist/providers/index.js +111 -88
- package/dist/renderer/index.cjs +57 -56
- package/dist/renderer/index.js +57 -56
- package/dist/runtime/index.cjs +101 -73
- package/dist/runtime/index.js +102 -74
- package/package.json +3 -3
|
@@ -1076,7 +1076,7 @@ var init_useEventBus = __esm({
|
|
|
1076
1076
|
try {
|
|
1077
1077
|
handler(event);
|
|
1078
1078
|
} catch (error) {
|
|
1079
|
-
|
|
1079
|
+
log.error("Error in listener", { type, error: error instanceof Error ? error : String(error) });
|
|
1080
1080
|
}
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
@@ -1084,7 +1084,7 @@ var init_useEventBus = __esm({
|
|
|
1084
1084
|
try {
|
|
1085
1085
|
handler(event);
|
|
1086
1086
|
} catch (error) {
|
|
1087
|
-
|
|
1087
|
+
log.error("Error in onAny listener", { type, error: error instanceof Error ? error : String(error) });
|
|
1088
1088
|
}
|
|
1089
1089
|
});
|
|
1090
1090
|
},
|
|
@@ -3137,6 +3137,7 @@ var BUILT_IN_THEMES, ThemeContext;
|
|
|
3137
3137
|
var init_ThemeContext = __esm({
|
|
3138
3138
|
"context/ThemeContext.tsx"() {
|
|
3139
3139
|
"use client";
|
|
3140
|
+
logger.createLogger("almadar:ui:theme");
|
|
3140
3141
|
BUILT_IN_THEMES = [
|
|
3141
3142
|
{
|
|
3142
3143
|
name: "wireframe",
|
|
@@ -8951,7 +8952,7 @@ function getTraitSnapshots() {
|
|
|
8951
8952
|
try {
|
|
8952
8953
|
snapshots.push(getter());
|
|
8953
8954
|
} catch (err) {
|
|
8954
|
-
|
|
8955
|
+
log3.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
8955
8956
|
}
|
|
8956
8957
|
}
|
|
8957
8958
|
return snapshots;
|
|
@@ -9014,10 +9015,10 @@ function updateAssetStatus(url, status) {
|
|
|
9014
9015
|
window.__orbitalVerification.assetStatus[url] = status;
|
|
9015
9016
|
}
|
|
9016
9017
|
}
|
|
9017
|
-
var
|
|
9018
|
+
var log3;
|
|
9018
9019
|
var init_verificationRegistry = __esm({
|
|
9019
9020
|
"lib/verificationRegistry.ts"() {
|
|
9020
|
-
|
|
9021
|
+
log3 = logger.createLogger("almadar:bridge");
|
|
9021
9022
|
exposeOnWindow();
|
|
9022
9023
|
}
|
|
9023
9024
|
});
|
|
@@ -11045,7 +11046,7 @@ var init_avl_elk_layout = __esm({
|
|
|
11045
11046
|
elk = new ELK__default.default();
|
|
11046
11047
|
}
|
|
11047
11048
|
});
|
|
11048
|
-
var SWIM_GUTTER, CENTER_W; exports.BehaviorView = void 0;
|
|
11049
|
+
var log4, SWIM_GUTTER, CENTER_W; exports.BehaviorView = void 0;
|
|
11049
11050
|
var init_BehaviorView = __esm({
|
|
11050
11051
|
"components/molecules/avl/BehaviorView.tsx"() {
|
|
11051
11052
|
"use client";
|
|
@@ -11054,6 +11055,7 @@ var init_BehaviorView = __esm({
|
|
|
11054
11055
|
init_AvlSwimLane();
|
|
11055
11056
|
init_types();
|
|
11056
11057
|
init_avl_elk_layout();
|
|
11058
|
+
log4 = logger.createLogger("almadar:ui:avl:behavior-view");
|
|
11057
11059
|
SWIM_GUTTER = 120;
|
|
11058
11060
|
CENTER_W = 360;
|
|
11059
11061
|
exports.BehaviorView = ({ data }) => {
|
|
@@ -11063,7 +11065,7 @@ var init_BehaviorView = __esm({
|
|
|
11063
11065
|
const dataKey = React131.useMemo(() => JSON.stringify(traitData), [traitData]);
|
|
11064
11066
|
React131.useEffect(() => {
|
|
11065
11067
|
if (!traitData) return;
|
|
11066
|
-
computeTraitLayout(traitData).then(setLayout).catch(
|
|
11068
|
+
computeTraitLayout(traitData).then(setLayout).catch((err) => log4.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
|
|
11067
11069
|
}, [dataKey]);
|
|
11068
11070
|
if (!traitData) {
|
|
11069
11071
|
return /* @__PURE__ */ jsxRuntime.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" });
|
|
@@ -11408,7 +11410,7 @@ function computeFoldRegions(code) {
|
|
|
11408
11410
|
}
|
|
11409
11411
|
return regions.sort((a, b) => a.start - b.start);
|
|
11410
11412
|
}
|
|
11411
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
|
|
11413
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
|
|
11412
11414
|
var init_CodeBlock = __esm({
|
|
11413
11415
|
"components/molecules/markdown/CodeBlock.tsx"() {
|
|
11414
11416
|
init_Box();
|
|
@@ -11485,6 +11487,7 @@ var init_CodeBlock = __esm({
|
|
|
11485
11487
|
"lolo-op-async": { color: syntax.ORB_COLORS.dark.async }
|
|
11486
11488
|
};
|
|
11487
11489
|
loloStyle = { ...dark__default.default, ...loloStyleOverrides };
|
|
11490
|
+
log5 = logger.createLogger("almadar:ui:markdown-code");
|
|
11488
11491
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
11489
11492
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
11490
11493
|
exports.CodeBlock = React131__namespace.default.memo(
|
|
@@ -11683,7 +11686,7 @@ var init_CodeBlock = __esm({
|
|
|
11683
11686
|
eventBus.emit("UI:COPY_CODE", { language, success: true });
|
|
11684
11687
|
setTimeout(() => setCopied(false), 2e3);
|
|
11685
11688
|
} catch (err) {
|
|
11686
|
-
|
|
11689
|
+
log5.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
11687
11690
|
eventBus.emit("UI:COPY_CODE", { language, success: false });
|
|
11688
11691
|
}
|
|
11689
11692
|
};
|
|
@@ -15245,13 +15248,14 @@ function useSafeEventBus2() {
|
|
|
15245
15248
|
} };
|
|
15246
15249
|
}
|
|
15247
15250
|
}
|
|
15248
|
-
exports.ButtonGroup = void 0;
|
|
15251
|
+
var log6; exports.ButtonGroup = void 0;
|
|
15249
15252
|
var init_ButtonGroup = __esm({
|
|
15250
15253
|
"components/molecules/ButtonGroup.tsx"() {
|
|
15251
15254
|
"use client";
|
|
15252
15255
|
init_cn();
|
|
15253
15256
|
init_atoms();
|
|
15254
15257
|
init_useEventBus();
|
|
15258
|
+
log6 = logger.createLogger("almadar:ui:button-group");
|
|
15255
15259
|
exports.ButtonGroup = ({
|
|
15256
15260
|
children,
|
|
15257
15261
|
primary,
|
|
@@ -15324,7 +15328,7 @@ var init_ButtonGroup = __esm({
|
|
|
15324
15328
|
{
|
|
15325
15329
|
variant: "ghost",
|
|
15326
15330
|
onClick: () => {
|
|
15327
|
-
|
|
15331
|
+
log6.debug("Filter clicked", { field: filter.field });
|
|
15328
15332
|
},
|
|
15329
15333
|
children: filter.label
|
|
15330
15334
|
},
|
|
@@ -21580,31 +21584,56 @@ var init_InputGroup = __esm({
|
|
|
21580
21584
|
exports.InputGroup.displayName = "InputGroup";
|
|
21581
21585
|
}
|
|
21582
21586
|
});
|
|
21583
|
-
|
|
21584
|
-
|
|
21587
|
+
function gateEnabled(level, ns = NAMESPACE) {
|
|
21588
|
+
return logger.isLogLevelEnabled(level, ns);
|
|
21589
|
+
}
|
|
21585
21590
|
function isDebugEnabled() {
|
|
21586
|
-
|
|
21587
|
-
return typeof window !== "undefined" && window.__ALMADAR_DEBUG_VERIFY__ === true;
|
|
21591
|
+
return gateEnabled("DEBUG");
|
|
21588
21592
|
}
|
|
21589
21593
|
function debug(...args) {
|
|
21590
|
-
if (
|
|
21591
|
-
|
|
21594
|
+
if (!gateEnabled("DEBUG")) return;
|
|
21595
|
+
const [first, ...rest] = args;
|
|
21596
|
+
const message = typeof first === "string" ? first : "<debug>";
|
|
21597
|
+
if (rest.length === 0 && typeof first === "string") {
|
|
21598
|
+
log7.debug(message);
|
|
21599
|
+
} else {
|
|
21600
|
+
log7.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
21592
21601
|
}
|
|
21593
21602
|
}
|
|
21594
21603
|
function debugGroup(label) {
|
|
21595
|
-
if (
|
|
21596
|
-
console.group(`[DEBUG] ${label}`);
|
|
21597
|
-
}
|
|
21604
|
+
if (gateEnabled("DEBUG")) console.group(`[${NAMESPACE}] ${label}`);
|
|
21598
21605
|
}
|
|
21599
21606
|
function debugGroupEnd() {
|
|
21600
|
-
if (
|
|
21601
|
-
|
|
21607
|
+
if (gateEnabled("DEBUG")) console.groupEnd();
|
|
21608
|
+
}
|
|
21609
|
+
function formatArgs(values) {
|
|
21610
|
+
if (values.length === 1) return toLogMetaValue(values[0]);
|
|
21611
|
+
return values.map(toLogMetaValue);
|
|
21612
|
+
}
|
|
21613
|
+
function toLogMetaValue(v) {
|
|
21614
|
+
if (v === null || v === void 0) return v;
|
|
21615
|
+
if (v instanceof Error) return v;
|
|
21616
|
+
const t = typeof v;
|
|
21617
|
+
if (t === "string" || t === "number" || t === "boolean") return v;
|
|
21618
|
+
if (Array.isArray(v)) return v.map(toLogMetaValue);
|
|
21619
|
+
if (t === "object") {
|
|
21620
|
+
const out = {};
|
|
21621
|
+
for (const [k, val] of Object.entries(v)) {
|
|
21622
|
+
out[k] = toLogMetaValue(val);
|
|
21623
|
+
}
|
|
21624
|
+
return out;
|
|
21602
21625
|
}
|
|
21626
|
+
return String(v);
|
|
21603
21627
|
}
|
|
21604
|
-
var
|
|
21628
|
+
var NAMESPACE, log7;
|
|
21605
21629
|
var init_debug = __esm({
|
|
21606
21630
|
"lib/debug.ts"() {
|
|
21607
|
-
|
|
21631
|
+
NAMESPACE = "almadar:ui:debug";
|
|
21632
|
+
log7 = logger.createLogger(NAMESPACE);
|
|
21633
|
+
logger.createLogger("almadar:ui:debug:input");
|
|
21634
|
+
logger.createLogger("almadar:ui:debug:collision");
|
|
21635
|
+
logger.createLogger("almadar:ui:debug:physics");
|
|
21636
|
+
logger.createLogger("almadar:ui:debug:game-state");
|
|
21608
21637
|
}
|
|
21609
21638
|
});
|
|
21610
21639
|
var isRelationsDebugEnabled; exports.RelationSelect = void 0;
|
|
@@ -38576,7 +38605,7 @@ function getAllEvents(traits2) {
|
|
|
38576
38605
|
}
|
|
38577
38606
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
38578
38607
|
const eventBus = useEventBus();
|
|
38579
|
-
const [
|
|
38608
|
+
const [log18, setLog] = React131__namespace.useState([]);
|
|
38580
38609
|
const prevStatesRef = React131__namespace.useRef(/* @__PURE__ */ new Map());
|
|
38581
38610
|
React131__namespace.useEffect(() => {
|
|
38582
38611
|
for (const trait of traits2) {
|
|
@@ -38640,9 +38669,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
38640
38669
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: "Other Events (not available from current state)" }),
|
|
38641
38670
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
|
|
38642
38671
|
] }),
|
|
38643
|
-
|
|
38672
|
+
log18.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
38644
38673
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: "Recent Transitions" }),
|
|
38645
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children:
|
|
38674
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children: log18.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(exports.Typography, { variant: "small", className: "font-mono text-xs", children: [
|
|
38646
38675
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
|
|
38647
38676
|
" ",
|
|
38648
38677
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
|
|
@@ -45942,6 +45971,7 @@ init_AboutPageTemplate();
|
|
|
45942
45971
|
|
|
45943
45972
|
// components/index.ts
|
|
45944
45973
|
init_cn();
|
|
45974
|
+
var log8 = logger.createLogger("almadar:ui:orbital-history");
|
|
45945
45975
|
function useOrbitalHistory(options) {
|
|
45946
45976
|
const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
|
|
45947
45977
|
const getHeaders = React131.useCallback(() => {
|
|
@@ -46003,7 +46033,7 @@ function useOrbitalHistory(options) {
|
|
|
46003
46033
|
setCurrentVersion(mergedTimeline[0].version);
|
|
46004
46034
|
}
|
|
46005
46035
|
} catch (err) {
|
|
46006
|
-
|
|
46036
|
+
log8.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
|
|
46007
46037
|
setError(err instanceof Error ? err.message : "Failed to load history");
|
|
46008
46038
|
} finally {
|
|
46009
46039
|
setIsLoading(false);
|
|
@@ -46036,7 +46066,7 @@ function useOrbitalHistory(options) {
|
|
|
46036
46066
|
error: data.error || "Unknown error during revert"
|
|
46037
46067
|
};
|
|
46038
46068
|
} catch (err) {
|
|
46039
|
-
|
|
46069
|
+
log8.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
|
|
46040
46070
|
return {
|
|
46041
46071
|
success: false,
|
|
46042
46072
|
error: err instanceof Error ? err.message : "Failed to revert"
|
|
@@ -46060,6 +46090,7 @@ function useOrbitalHistory(options) {
|
|
|
46060
46090
|
refresh
|
|
46061
46091
|
};
|
|
46062
46092
|
}
|
|
46093
|
+
var log9 = logger.createLogger("almadar:ui:filesystem");
|
|
46063
46094
|
function useFileSystem() {
|
|
46064
46095
|
const [status, setStatus] = React131.useState("idle");
|
|
46065
46096
|
const [error, setError] = React131.useState(null);
|
|
@@ -46074,7 +46105,7 @@ function useFileSystem() {
|
|
|
46074
46105
|
setError(null);
|
|
46075
46106
|
setIsLoading(true);
|
|
46076
46107
|
try {
|
|
46077
|
-
|
|
46108
|
+
log9.debug("Booting WebContainer");
|
|
46078
46109
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46079
46110
|
setStatus("ready");
|
|
46080
46111
|
} catch (err) {
|
|
@@ -46137,7 +46168,7 @@ function useFileSystem() {
|
|
|
46137
46168
|
setFiles(newTree);
|
|
46138
46169
|
setStatus("running");
|
|
46139
46170
|
} catch (err) {
|
|
46140
|
-
|
|
46171
|
+
log9.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
|
|
46141
46172
|
} finally {
|
|
46142
46173
|
setIsLoading(false);
|
|
46143
46174
|
}
|
|
@@ -46178,7 +46209,7 @@ function useFileSystem() {
|
|
|
46178
46209
|
const path = contentArg !== void 0 ? pathOrContent : selectedPath;
|
|
46179
46210
|
const content = contentArg !== void 0 ? contentArg : pathOrContent;
|
|
46180
46211
|
if (!path) {
|
|
46181
|
-
|
|
46212
|
+
log9.warn("updateContent called without path and no file selected");
|
|
46182
46213
|
return;
|
|
46183
46214
|
}
|
|
46184
46215
|
setFileContents((prev) => {
|
|
@@ -46194,14 +46225,14 @@ function useFileSystem() {
|
|
|
46194
46225
|
setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
|
|
46195
46226
|
}, []);
|
|
46196
46227
|
const refreshTree = React131.useCallback(async () => {
|
|
46197
|
-
|
|
46228
|
+
log9.debug("Refreshing tree");
|
|
46198
46229
|
}, []);
|
|
46199
46230
|
const runCommand = React131.useCallback(async (command) => {
|
|
46200
|
-
|
|
46231
|
+
log9.debug("Running command", { command });
|
|
46201
46232
|
return { exitCode: 0, output: "" };
|
|
46202
46233
|
}, []);
|
|
46203
46234
|
const startDevServer = React131.useCallback(async () => {
|
|
46204
|
-
|
|
46235
|
+
log9.debug("Starting dev server");
|
|
46205
46236
|
setPreviewUrl("http://localhost:5173");
|
|
46206
46237
|
}, []);
|
|
46207
46238
|
return {
|
|
@@ -46224,6 +46255,7 @@ function useFileSystem() {
|
|
|
46224
46255
|
startDevServer
|
|
46225
46256
|
};
|
|
46226
46257
|
}
|
|
46258
|
+
var log10 = logger.createLogger("almadar:ui:extensions");
|
|
46227
46259
|
var defaultManifest = {
|
|
46228
46260
|
languages: {
|
|
46229
46261
|
typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
|
|
@@ -46242,7 +46274,7 @@ function useExtensions(options) {
|
|
|
46242
46274
|
const [isLoading, setIsLoading] = React131.useState(false);
|
|
46243
46275
|
const [error, setError] = React131.useState(null);
|
|
46244
46276
|
const loadExtension = React131.useCallback(async (extensionId) => {
|
|
46245
|
-
|
|
46277
|
+
log10.debug("Loading extension", { extensionId });
|
|
46246
46278
|
}, []);
|
|
46247
46279
|
const loadExtensions = React131.useCallback(async () => {
|
|
46248
46280
|
setIsLoading(true);
|
|
@@ -46314,6 +46346,7 @@ function useExtensions(options) {
|
|
|
46314
46346
|
getExtensionForFile
|
|
46315
46347
|
};
|
|
46316
46348
|
}
|
|
46349
|
+
var log11 = logger.createLogger("almadar:ui:file-editor");
|
|
46317
46350
|
function useFileEditor(options) {
|
|
46318
46351
|
const { extensions, fileSystem, onSchemaUpdate } = options;
|
|
46319
46352
|
const [openFiles, setOpenFiles] = React131.useState([]);
|
|
@@ -46338,7 +46371,7 @@ function useFileEditor(options) {
|
|
|
46338
46371
|
setOpenFiles((prev) => [...prev, newFile]);
|
|
46339
46372
|
setActiveFilePath(path);
|
|
46340
46373
|
} catch (err) {
|
|
46341
|
-
|
|
46374
|
+
log11.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
|
|
46342
46375
|
}
|
|
46343
46376
|
}, [openFiles, fileSystem, extensions]);
|
|
46344
46377
|
const closeFile = React131.useCallback((path) => {
|
|
@@ -46399,7 +46432,7 @@ function useFileEditor(options) {
|
|
|
46399
46432
|
}
|
|
46400
46433
|
}
|
|
46401
46434
|
} catch (err) {
|
|
46402
|
-
|
|
46435
|
+
log11.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
|
|
46403
46436
|
} finally {
|
|
46404
46437
|
setIsSaving(false);
|
|
46405
46438
|
}
|
|
@@ -46428,6 +46461,7 @@ function useFileEditor(options) {
|
|
|
46428
46461
|
saveAllFiles
|
|
46429
46462
|
};
|
|
46430
46463
|
}
|
|
46464
|
+
var log12 = logger.createLogger("almadar:ui:compile");
|
|
46431
46465
|
function useCompile() {
|
|
46432
46466
|
const [isCompiling, setIsCompiling] = React131.useState(false);
|
|
46433
46467
|
const [stage, setStage] = React131.useState("idle");
|
|
@@ -46438,7 +46472,7 @@ function useCompile() {
|
|
|
46438
46472
|
setStage("compiling");
|
|
46439
46473
|
setError(null);
|
|
46440
46474
|
try {
|
|
46441
|
-
|
|
46475
|
+
log12.debug("Compiling schema", { name: schema.name });
|
|
46442
46476
|
const result = {
|
|
46443
46477
|
success: true,
|
|
46444
46478
|
files: []
|
|
@@ -46464,6 +46498,7 @@ function useCompile() {
|
|
|
46464
46498
|
compileSchema
|
|
46465
46499
|
};
|
|
46466
46500
|
}
|
|
46501
|
+
var log13 = logger.createLogger("almadar:ui:preview");
|
|
46467
46502
|
function usePreview(options) {
|
|
46468
46503
|
const [previewUrl, setPreviewUrl] = React131.useState(null);
|
|
46469
46504
|
const [isLoading, setIsLoading] = React131.useState(!!options?.appId);
|
|
@@ -46497,17 +46532,17 @@ function usePreview(options) {
|
|
|
46497
46532
|
setIsLoading(false);
|
|
46498
46533
|
return;
|
|
46499
46534
|
}
|
|
46500
|
-
|
|
46535
|
+
log13.debug("Setting up preview for app", { appId });
|
|
46501
46536
|
setPreviewUrl(`/api/orbitals/${appId}`);
|
|
46502
46537
|
setIsLoading(false);
|
|
46503
46538
|
}, [options?.appId]);
|
|
46504
46539
|
const startPreview = React131.useCallback(async () => {
|
|
46505
|
-
|
|
46540
|
+
log13.debug("startPreview called");
|
|
46506
46541
|
}, []);
|
|
46507
46542
|
const stopPreview = React131.useCallback(async () => {
|
|
46508
46543
|
setIsLoading(true);
|
|
46509
46544
|
try {
|
|
46510
|
-
|
|
46545
|
+
log13.debug("Stopping preview server");
|
|
46511
46546
|
setPreviewUrl(null);
|
|
46512
46547
|
setApp(null);
|
|
46513
46548
|
} finally {
|
|
@@ -46516,15 +46551,15 @@ function usePreview(options) {
|
|
|
46516
46551
|
}, []);
|
|
46517
46552
|
const refresh = React131.useCallback(async () => {
|
|
46518
46553
|
if (!previewUrl) return;
|
|
46519
|
-
|
|
46554
|
+
log13.debug("Refreshing preview");
|
|
46520
46555
|
setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
|
|
46521
46556
|
}, [previewUrl]);
|
|
46522
46557
|
const handleRefresh = React131.useCallback(async () => {
|
|
46523
|
-
|
|
46558
|
+
log13.debug("Handle refresh");
|
|
46524
46559
|
await refresh();
|
|
46525
46560
|
}, [refresh]);
|
|
46526
46561
|
const handleReset = React131.useCallback(async () => {
|
|
46527
|
-
|
|
46562
|
+
log13.debug("Resetting preview");
|
|
46528
46563
|
setError(null);
|
|
46529
46564
|
setLoadError(null);
|
|
46530
46565
|
setErrorToast(null);
|
|
@@ -46558,6 +46593,7 @@ function usePreview(options) {
|
|
|
46558
46593
|
dismissErrorToast
|
|
46559
46594
|
};
|
|
46560
46595
|
}
|
|
46596
|
+
var log14 = logger.createLogger("almadar:ui:agent-chat");
|
|
46561
46597
|
function useAgentChat(options) {
|
|
46562
46598
|
const [messages, setMessages] = React131.useState([]);
|
|
46563
46599
|
const [status, setStatus] = React131.useState("idle");
|
|
@@ -46580,7 +46616,7 @@ function useAgentChat(options) {
|
|
|
46580
46616
|
timestamp: Date.now()
|
|
46581
46617
|
};
|
|
46582
46618
|
setMessages((prev) => [...prev, userMessage]);
|
|
46583
|
-
|
|
46619
|
+
log14.debug("Sending message", { content });
|
|
46584
46620
|
const assistantMessage = {
|
|
46585
46621
|
id: (Date.now() + 1).toString(),
|
|
46586
46622
|
role: "assistant",
|
|
@@ -46603,7 +46639,7 @@ function useAgentChat(options) {
|
|
|
46603
46639
|
setError(null);
|
|
46604
46640
|
const skillName = Array.isArray(skill) ? skill[0] : skill;
|
|
46605
46641
|
try {
|
|
46606
|
-
|
|
46642
|
+
log14.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
|
|
46607
46643
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46608
46644
|
setStatus("complete");
|
|
46609
46645
|
options?.onComplete?.();
|
|
@@ -46615,10 +46651,10 @@ function useAgentChat(options) {
|
|
|
46615
46651
|
}
|
|
46616
46652
|
}, [options]);
|
|
46617
46653
|
const continueConversation = React131.useCallback(async (message) => {
|
|
46618
|
-
|
|
46654
|
+
log14.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
|
|
46619
46655
|
}, []);
|
|
46620
46656
|
const resumeWithDecision = React131.useCallback(async (decisions) => {
|
|
46621
|
-
|
|
46657
|
+
log14.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
46622
46658
|
setInterrupt(null);
|
|
46623
46659
|
}, []);
|
|
46624
46660
|
const cancel = React131.useCallback(() => {
|
|
@@ -46655,6 +46691,7 @@ function useAgentChat(options) {
|
|
|
46655
46691
|
clearHistory
|
|
46656
46692
|
};
|
|
46657
46693
|
}
|
|
46694
|
+
var log15 = logger.createLogger("almadar:ui:validation");
|
|
46658
46695
|
function useValidation() {
|
|
46659
46696
|
const [result, setResult] = React131.useState(null);
|
|
46660
46697
|
const [isValidating, setIsValidating] = React131.useState(false);
|
|
@@ -46668,7 +46705,7 @@ function useValidation() {
|
|
|
46668
46705
|
setStage("validating");
|
|
46669
46706
|
setProgressMessage("Validating schema...");
|
|
46670
46707
|
try {
|
|
46671
|
-
|
|
46708
|
+
log15.debug("Validating app", { appId });
|
|
46672
46709
|
const validationResult = {
|
|
46673
46710
|
valid: true,
|
|
46674
46711
|
errors: [],
|
|
@@ -46721,6 +46758,7 @@ function useValidation() {
|
|
|
46721
46758
|
reset
|
|
46722
46759
|
};
|
|
46723
46760
|
}
|
|
46761
|
+
var log16 = logger.createLogger("almadar:ui:deep-agent");
|
|
46724
46762
|
function useDeepAgentGeneration() {
|
|
46725
46763
|
const [requests, setRequests] = React131.useState([]);
|
|
46726
46764
|
const [currentRequest, setCurrentRequest] = React131.useState(null);
|
|
@@ -46744,7 +46782,7 @@ function useDeepAgentGeneration() {
|
|
|
46744
46782
|
setCurrentRequest(request);
|
|
46745
46783
|
setRequests((prev) => [...prev, request]);
|
|
46746
46784
|
try {
|
|
46747
|
-
|
|
46785
|
+
log16.debug("Generating from prompt", { prompt });
|
|
46748
46786
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
46749
46787
|
request.status = "completed";
|
|
46750
46788
|
setCurrentRequest(request);
|
|
@@ -46764,7 +46802,7 @@ function useDeepAgentGeneration() {
|
|
|
46764
46802
|
}
|
|
46765
46803
|
}, []);
|
|
46766
46804
|
const startGeneration = React131.useCallback(async (skill, prompt, _options) => {
|
|
46767
|
-
|
|
46805
|
+
log16.debug("Starting generation with skill", { skill });
|
|
46768
46806
|
await generate(prompt);
|
|
46769
46807
|
}, [generate]);
|
|
46770
46808
|
const cancelGeneration = React131.useCallback(() => {
|
|
@@ -46786,7 +46824,7 @@ function useDeepAgentGeneration() {
|
|
|
46786
46824
|
setIsComplete(false);
|
|
46787
46825
|
}, []);
|
|
46788
46826
|
const submitInterruptDecisions = React131.useCallback((decisions) => {
|
|
46789
|
-
|
|
46827
|
+
log16.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
46790
46828
|
setInterrupt(null);
|
|
46791
46829
|
}, []);
|
|
46792
46830
|
return {
|
|
@@ -46808,7 +46846,7 @@ function useDeepAgentGeneration() {
|
|
|
46808
46846
|
|
|
46809
46847
|
// hooks/index.ts
|
|
46810
46848
|
init_useEventBus();
|
|
46811
|
-
var
|
|
46849
|
+
var log17 = logger.createLogger("almadar:ui:ui-slots");
|
|
46812
46850
|
var DEFAULT_SOURCE_KEY = "__default__";
|
|
46813
46851
|
var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
|
|
46814
46852
|
var ALL_SLOTS2 = [
|
|
@@ -46890,7 +46928,7 @@ function useUISlotManager() {
|
|
|
46890
46928
|
try {
|
|
46891
46929
|
callback(slot, content);
|
|
46892
46930
|
} catch (error) {
|
|
46893
|
-
|
|
46931
|
+
log17.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
|
|
46894
46932
|
}
|
|
46895
46933
|
});
|
|
46896
46934
|
}, []);
|
|
@@ -46902,7 +46940,7 @@ function useUISlotManager() {
|
|
|
46902
46940
|
try {
|
|
46903
46941
|
callback(content);
|
|
46904
46942
|
} catch (error) {
|
|
46905
|
-
|
|
46943
|
+
log17.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
|
|
46906
46944
|
}
|
|
46907
46945
|
});
|
|
46908
46946
|
},
|
|
@@ -46953,9 +46991,12 @@ function useUISlotManager() {
|
|
|
46953
46991
|
const slotSources = prev[config.target] ?? {};
|
|
46954
46992
|
const existing = slotSources[sourceKey];
|
|
46955
46993
|
if (existing && existing.priority > content.priority) {
|
|
46956
|
-
|
|
46957
|
-
|
|
46958
|
-
|
|
46994
|
+
log17.warn("Slot already has higher priority content", {
|
|
46995
|
+
slot: config.target,
|
|
46996
|
+
sourceKey,
|
|
46997
|
+
existingPriority: existing.priority,
|
|
46998
|
+
newPriority: content.priority
|
|
46999
|
+
});
|
|
46959
47000
|
return prev;
|
|
46960
47001
|
}
|
|
46961
47002
|
const nextSources = {
|
|
@@ -46967,7 +47008,7 @@ function useUISlotManager() {
|
|
|
46967
47008
|
indexTraitRender(content.sourceTrait, content);
|
|
46968
47009
|
notifyTraitSubscribers(content.sourceTrait, content);
|
|
46969
47010
|
}
|
|
46970
|
-
|
|
47011
|
+
log17.info("slot:written", {
|
|
46971
47012
|
slot: config.target,
|
|
46972
47013
|
sourceKey,
|
|
46973
47014
|
sourceTrait: content.sourceTrait,
|
|
@@ -47012,7 +47053,7 @@ function useUISlotManager() {
|
|
|
47012
47053
|
setSources((prev) => {
|
|
47013
47054
|
const slotSources = prev[slot];
|
|
47014
47055
|
if (!slotSources || !(sourceKey in slotSources)) {
|
|
47015
|
-
|
|
47056
|
+
log17.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
|
|
47016
47057
|
return prev;
|
|
47017
47058
|
}
|
|
47018
47059
|
const content = slotSources[sourceKey];
|
|
@@ -47028,7 +47069,7 @@ function useUISlotManager() {
|
|
|
47028
47069
|
}
|
|
47029
47070
|
const nextSources = { ...slotSources };
|
|
47030
47071
|
delete nextSources[sourceKey];
|
|
47031
|
-
|
|
47072
|
+
log17.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
|
|
47032
47073
|
notifySubscribers(slot, aggregateSlot(nextSources));
|
|
47033
47074
|
return { ...prev, [slot]: nextSources };
|
|
47034
47075
|
});
|