@xenosystem/agent-interface-ui 0.1.178 → 0.1.180

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.
Files changed (40) hide show
  1. package/dist/adapters/agentHostPlatformBridge.d.ts +2 -0
  2. package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -1
  3. package/dist/adapters/agentHostPlatformBridge.js +11 -0
  4. package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
  5. package/dist/agent.css +50 -1
  6. package/dist/components/agent/AgentBrowserConnect.d.ts +3 -0
  7. package/dist/components/agent/AgentBrowserConnect.d.ts.map +1 -0
  8. package/dist/components/agent/AgentBrowserConnect.js +46 -0
  9. package/dist/components/agent/AgentBrowserConnect.js.map +1 -0
  10. package/dist/components/agent/AgentInterface.d.ts.map +1 -1
  11. package/dist/components/agent/AgentInterface.js +186 -16
  12. package/dist/components/agent/AgentInterface.js.map +1 -1
  13. package/dist/components/agent/AgentPreviewPanel.d.ts +6 -0
  14. package/dist/components/agent/AgentPreviewPanel.d.ts.map +1 -0
  15. package/dist/components/agent/AgentPreviewPanel.js +103 -0
  16. package/dist/components/agent/AgentPreviewPanel.js.map +1 -0
  17. package/dist/components/agent/AgentWorkbenchPanel.js +3 -3
  18. package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -1
  19. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts +2 -1
  20. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts.map +1 -1
  21. package/dist/components/agent/AgentWorkspaceBrowserPanel.js +8 -2
  22. package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -1
  23. package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts +7 -1
  24. package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts.map +1 -1
  25. package/dist/components/agent/MonacoDiffWorkbenchEditor.js +83 -3
  26. package/dist/components/agent/MonacoDiffWorkbenchEditor.js.map +1 -1
  27. package/dist/components/agent/diffComments.d.ts +6 -0
  28. package/dist/components/agent/diffComments.d.ts.map +1 -0
  29. package/dist/components/agent/diffComments.js +17 -0
  30. package/dist/components/agent/diffComments.js.map +1 -0
  31. package/dist/components/product/XenoAgentSessionTabs.d.ts +10 -1
  32. package/dist/components/product/XenoAgentSessionTabs.d.ts.map +1 -1
  33. package/dist/components/product/XenoAgentSessionTabs.js +22 -5
  34. package/dist/components/product/XenoAgentSessionTabs.js.map +1 -1
  35. package/dist/components/product/sessionSplit.d.ts +7 -0
  36. package/dist/components/product/sessionSplit.d.ts.map +1 -0
  37. package/dist/components/product/sessionSplit.js +19 -0
  38. package/dist/components/product/sessionSplit.js.map +1 -0
  39. package/package.json +6 -6
  40. package/src/agent.css +49 -0
@@ -0,0 +1,6 @@
1
+ /** The app you are building, in a sandboxed view of this window. Localhost only. */
2
+ export declare function AgentPreviewPanel({ rootDirectory, visible }: {
3
+ rootDirectory: string | null;
4
+ visible: boolean;
5
+ }): import("react").JSX.Element;
6
+ //# sourceMappingURL=AgentPreviewPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentPreviewPanel.d.ts","sourceRoot":"","sources":["../../../src/components/agent/AgentPreviewPanel.tsx"],"names":[],"mappings":"AAWA,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE;IAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,+BAiI/G"}
@@ -0,0 +1,103 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { ArrowLeft, ArrowRight, Globe2, RotateCw } from '@xenosystem/agent-conversation/icons';
4
+ import { getOptionalAgentPlatformBridge } from '@xenosystem/agent-conversation/platformBridge';
5
+ import { AgentBrowserConnect } from './AgentBrowserConnect.js';
6
+ function addressOf(value) {
7
+ const text = value.trim();
8
+ return /^https?:\/\//i.test(text) ? text : `http://${text}`;
9
+ }
10
+ /** The app you are building, in a sandboxed view of this window. Localhost only. */
11
+ export function AgentPreviewPanel({ rootDirectory, visible }) {
12
+ const bridge = getOptionalAgentPlatformBridge();
13
+ const preview = bridge?.preview;
14
+ const engineering = bridge?.engineering;
15
+ const viewportRef = useRef(null);
16
+ const [servers, setServers] = useState([]);
17
+ const [listError, setListError] = useState(null);
18
+ const [address, setAddress] = useState('');
19
+ const [opened, setOpened] = useState(false);
20
+ const [notice, setNotice] = useState(null);
21
+ const [waitingFor, setWaitingFor] = useState(null);
22
+ const bounds = useCallback(() => {
23
+ const box = viewportRef.current?.getBoundingClientRect();
24
+ return { x: box?.left ?? 0, y: box?.top ?? 0, width: box?.width ?? 0, height: box?.height ?? 0 };
25
+ }, []);
26
+ const open = useCallback(async (url) => {
27
+ setAddress(url);
28
+ const result = await preview?.open(url, bounds());
29
+ setOpened(result?.success === true);
30
+ setNotice(result?.success ? null : result?.error || 'The preview could not open this address.');
31
+ }, [bounds, preview]);
32
+ useEffect(() => preview?.subscribe((state) => {
33
+ if (state.url)
34
+ setAddress(state.url);
35
+ setNotice(state.error ? `${state.url || 'This page'}: ${state.error}` : null);
36
+ }), [preview]);
37
+ useEffect(() => {
38
+ if (!opened)
39
+ return undefined;
40
+ if (!visible) {
41
+ void preview?.hide();
42
+ return undefined;
43
+ }
44
+ void preview?.show();
45
+ const place = () => { void preview?.setBounds(bounds()); };
46
+ place();
47
+ const observer = new ResizeObserver(place);
48
+ if (viewportRef.current)
49
+ observer.observe(viewportRef.current);
50
+ window.addEventListener('resize', place);
51
+ return () => { observer.disconnect(); window.removeEventListener('resize', place); };
52
+ }, [bounds, opened, preview, visible]);
53
+ useEffect(() => () => { void preview?.hide(); }, [preview]);
54
+ useEffect(() => {
55
+ if (!rootDirectory || !engineering?.devServerList || !visible)
56
+ return undefined;
57
+ let cancelled = false;
58
+ const read = async () => {
59
+ const listed = await engineering.devServerList({ rootDirectory, allowedDirectories: [rootDirectory] });
60
+ if (cancelled)
61
+ return;
62
+ setServers(listed.servers);
63
+ setListError(listed.error ?? null);
64
+ const ready = listed.servers.find((server) => server.name === waitingFor);
65
+ if (ready?.status === 'running' && ready.url) {
66
+ setWaitingFor(null);
67
+ void open(ready.url);
68
+ }
69
+ if (ready?.status === 'exited')
70
+ setWaitingFor(null);
71
+ };
72
+ void read();
73
+ const timer = window.setInterval(() => { void read(); }, 1_500);
74
+ return () => { cancelled = true; window.clearInterval(timer); };
75
+ }, [engineering, open, rootDirectory, visible, waitingFor]);
76
+ const start = async (name) => {
77
+ if (!rootDirectory)
78
+ return;
79
+ const started = await engineering?.devServerStart({ rootDirectory, allowedDirectories: [rootDirectory], name, confirmed: true });
80
+ if (started?.success)
81
+ setWaitingFor(name);
82
+ else
83
+ setNotice(started?.error || 'The dev server could not start.');
84
+ };
85
+ const stop = (name) => {
86
+ if (rootDirectory)
87
+ void engineering?.devServerStop({ rootDirectory, allowedDirectories: [rootDirectory], name });
88
+ };
89
+ const command = (name) => { void preview?.command(name); };
90
+ const navButton = 'h-7 w-7 flex items-center justify-center text-white/55 disabled:opacity-25';
91
+ return (_jsxs("div", { className: "h-full min-h-0 bg-[#08080a] flex flex-col overflow-hidden", "data-xeno-preview-panel": "true", children: [_jsx(AgentBrowserConnect, {}), _jsxs("div", { className: "h-10 px-2 flex-shrink-0 border-b border-white/[0.06] bg-[#0d0d10] flex items-center gap-1.5", children: [_jsx("button", { type: "button", title: "Back", disabled: !opened, onClick: () => command('back'), className: navButton, children: _jsx(ArrowLeft, { className: "w-3.5 h-3.5" }) }), _jsx("button", { type: "button", title: "Forward", disabled: !opened, onClick: () => command('forward'), className: navButton, children: _jsx(ArrowRight, { className: "w-3.5 h-3.5" }) }), _jsx("button", { type: "button", title: "Reload", disabled: !opened, onClick: () => command('reload'), className: navButton, children: _jsx(RotateCw, { className: "w-3.5 h-3.5" }) }), _jsx("form", { className: "min-w-0 flex-1", onSubmit: (event) => {
92
+ event.preventDefault();
93
+ if (address.trim())
94
+ void open(addressOf(address));
95
+ }, children: _jsx("input", { value: address, onChange: (event) => setAddress(event.target.value), placeholder: "localhost:3000", "aria-label": "Preview address", className: "h-7 w-full rounded-[6px] border border-white/[0.07] bg-white/[0.03] px-2 text-[12px] text-white/80 outline-none", "data-xeno-preview-address": "true" }) })] }), notice && _jsx("p", { role: "status", className: "flex-shrink-0 border-b border-white/[0.06] px-2 py-1 text-[11px] text-red-300/80", children: notice }), servers.length > 0 && (_jsx("div", { className: "flex-shrink-0 border-b border-white/[0.06] px-2 py-1 space-y-1", "aria-label": "Dev servers", children: servers.map((server) => {
96
+ const active = server.status === 'starting' || server.status === 'running';
97
+ return (_jsxs("div", { className: "flex items-center justify-between gap-2 text-[11px] text-white/60", "data-xeno-dev-server": server.name, "data-status": server.status, children: [_jsxs("span", { className: "min-w-0 truncate", title: server.detail || server.command, children: [server.name, " \u00B7 ", server.status] }), _jsx("button", { type: "button", onClick: () => { if (active)
98
+ stop(server.name);
99
+ else
100
+ void start(server.name); }, className: "h-6 flex-shrink-0 rounded border border-white/[0.1] px-2 text-white/75", title: active ? 'Stop this server' : `Run: ${server.command}`, "data-xeno-dev-server-action": "true", children: active ? 'Stop' : 'Start' })] }, server.name));
101
+ }) })), _jsx("div", { ref: viewportRef, className: "relative flex-1 min-h-0", "data-xeno-preview-viewport": "true", children: !opened && (_jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-2 px-6 text-center text-[12px] text-white/40", children: [_jsx(Globe2, { className: "w-5 h-5" }), _jsx("p", { children: listError || (servers.length > 0 ? 'Start a dev server to see your app here.' : 'Type a localhost address, or add .xeno/launch.json to start your dev server from here.') })] })) })] }));
102
+ }
103
+ //# sourceMappingURL=AgentPreviewPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentPreviewPanel.js","sourceRoot":"","sources":["../../../src/components/agent/AgentPreviewPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,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AC9E,SAAS,EAAC,wEAAwE,EAClF,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,OAAO,EAAE,iCACjC,MAAM,YAEjC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GACnB,KAVD,MAAM,CAAC,IAAI,CAWf,CACP,CAAA;gBACH,CAAC,CAAC,GACE,CACP,EACD,cAAK,GAAG,EAAE,WAAW,EAAE,SAAS,EAAC,yBAAyB,gCAA4B,MAAM,YACzF,CAAC,MAAM,IAAI,CACV,eAAK,SAAS,EAAC,6GAA6G,aAC1H,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,EAC9B,sBAAI,SAAS,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,wFAAwF,CAAC,GAAK,IAC9K,CACP,GACG,IACF,CACP,CAAA;AACH,CAAC"}
@@ -435,14 +435,14 @@ export function AgentWorkbenchPanel(props) {
435
435
  : !engineeringWorkbench.git.isGitRepo
436
436
  ? 'Not a git repository'
437
437
  : `${engineeringWorkbench.git.branch || 'detached'} / ${engineeringWorkbench.git.clean ? 'clean' : `${engineeringWorkbench.git.files.length} changed`}` })] }), _jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringStage(engineeringWorkbench.selectedPaths), disabled: engineeringWorkbench.loading || engineeringWorkbench.selectedPaths.length === 0, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Stage" }), _jsx("button", { type: "button", onClick: () => onEngineeringUnstage(engineeringWorkbench.selectedPaths), disabled: engineeringWorkbench.loading || engineeringWorkbench.selectedPaths.length === 0, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Unstage" })] })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: !engineeringWorkbench.rootDirectory ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Open a folder for this conversation before using engineering tools." })) : !engineeringWorkbench.git ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Refresh to load git status, test scripts, and diagnostics." })) : !engineeringWorkbench.git.isGitRepo ? (_jsx("p", { className: "text-[11px] text-white/28", children: "This workspace is not currently inside a git repository." })) : engineeringWorkbench.git.files.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Git working tree is clean." })) : (_jsx("div", { className: "space-y-1.5", children: engineeringWorkbench.git.files.map((file) => {
438
- const selected = selectedEngineeringPaths.has(file.path);
439
- return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onEngineeringTogglePath(file.path), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onEngineeringOpenPath(file.path), className: "min-w-0 flex-1 text-left", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: file.relativePath || file.path }), _jsx("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [
438
+ const selected = selectedEngineeringPaths.has(file.relativePath);
439
+ return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onEngineeringTogglePath(file.relativePath), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onEngineeringOpenPath(file.path), className: "min-w-0 flex-1 text-left", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: file.relativePath || file.path }), _jsx("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [
440
440
  file.status,
441
441
  file.indexStatus !== ' ' ? `index ${file.indexStatus}` : null,
442
442
  file.workTreeStatus !== ' ' ? `worktree ${file.workTreeStatus}` : null,
443
443
  typeof file.additions === 'number' ? `+${file.additions}` : null,
444
444
  typeof file.deletions === 'number' ? `-${file.deletions}` : null,
445
- ].filter(Boolean).join(' / ') })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff([file.path]), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Diff" })] }) }, `${file.status}:${file.path}`));
445
+ ].filter(Boolean).join(' / ') })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff([file.relativePath]), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Diff" })] }) }, `${file.status}:${file.path}`));
446
446
  }) })) }), _jsx("div", { className: "border-t border-white/[0.06] px-3 py-2 bg-[#08080a]", children: _jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2", children: [_jsx("input", { value: engineeringWorkbench.commitMessage, onChange: (event) => onEngineeringCommitMessageChange(event.target.value), placeholder: "Commit message", disabled: !engineeringWorkbench.git?.isGitRepo, className: "h-8 rounded-[4px] border border-white/[0.06] bg-black/20 px-2.5 text-[11px] text-white/78 placeholder:text-white/18 outline-none focus:border-white/[0.12] disabled:opacity-35" }), _jsx("button", { type: "button", onClick: () => onEngineeringStage(undefined), disabled: !engineeringWorkbench.git?.isGitRepo || engineeringWorkbench.git.clean || engineeringWorkbench.loading, className: "h-8 px-3 rounded-[4px] border border-white/[0.06] text-[10px] uppercase tracking-[0.12em] text-white/45 hover:text-white/72 hover:bg-white/[0.045] transition-colors disabled:opacity-35", children: "Stage all" }), _jsx("button", { type: "button", onClick: onEngineeringCommit, disabled: !engineeringWorkbench.git?.isGitRepo || !engineeringWorkbench.commitMessage.trim() || engineeringWorkbench.loading, className: "h-8 px-3 rounded-[4px] bg-white/[0.08] hover:bg-white/[0.12] text-[10px] uppercase tracking-[0.12em] text-white/72 transition-colors disabled:opacity-35", children: "Commit" })] }) })] }), _jsxs("aside", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.05]", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Checks and diagnostics" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: engineeringWorkbench.diagnosticsSummary || `${engineeringWorkbench.checks.length} runnable checks detected` })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff(undefined), disabled: !engineeringWorkbench.git?.isGitRepo || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Full diff" })] }) }), _jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-3", children: [_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Runnable checks" }), engineeringWorkbench.checks.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No npm test, typecheck, build, or lint scripts discovered yet." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.checks.map((check) => (_jsxs("div", { className: "px-2.5 py-2 flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: check.name }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [check.kind, " / ", check.command, " ", check.args.join(' ')] })] }), _jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringRunCheck(check.id), disabled: engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Run" }), _jsx("button", { type: "button", onClick: () => onEngineeringStartBackgroundCheck(check.id), disabled: engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "BG" })] })] }, check.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Background checks" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.backgroundRuns.filter((run) => run.status === 'running').length, " active"] })] }), engineeringWorkbench.backgroundRuns.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No background checks yet. Use BG to run a check without blocking the interface." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.backgroundRuns.slice(0, 6).map((run) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: run.check.name }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [run.status, " / ", formatEngineeringDuration(run.durationMs || (run.status === 'running' ? Date.now() - run.startedAt : 0)), " / ", formatEngineeringTimestamp(run.updatedAt)] })] }), _jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringReadBackgroundRunOutput(run.id), className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors", children: "Output" }), run.status === 'running' && (_jsx("button", { type: "button", onClick: () => onEngineeringStopBackgroundRun(run.id), className: "h-6 px-2 rounded-[4px] bg-[#3a1518] text-[10px] text-[#ffb0b0] hover:bg-[#4a1b20] transition-colors", children: "Stop" }))] })] }), (run.stdout.trim() || run.stderr.trim() || run.error) && (_jsx("pre", { className: "mt-1 max-h-[62px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono text-white/34", children: [run.error, run.stderr.trim(), run.stdout.trim()].filter(Boolean).join('\n\n') }))] }, run.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Parsed diagnostics" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.diagnosticIssues.length, " issues"] })] }), engineeringWorkbench.diagnosticIssues.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No parsed diagnostics from recent or background runs." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.diagnosticIssues.slice(0, 8).map((issue) => (_jsxs("button", { type: "button", onClick: () => issue.filePath && onEngineeringOpenPath(issue.filePath), className: "w-full text-left px-2.5 py-2 hover:bg-white/[0.025] transition-colors", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: `text-[10px] uppercase tracking-[0.1em] ${issue.severity === 'error' ? 'text-[#ff9a9a]' : issue.severity === 'warning' ? 'text-[#ffd38a]' : 'text-[#8ad7ff]'}`, children: [issue.severity, issue.code ? ` ${issue.code}` : ''] }), _jsx("span", { className: "text-[10px] text-white/20 tabular-nums", children: issue.line ? `${issue.line}:${issue.column || 1}` : issue.source })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/30 truncate", children: issue.relativePath || issue.filePath || issue.source }), _jsx("p", { className: "mt-1 text-[11px] leading-relaxed text-white/52", children: issue.message })] }, issue.id))) }))] }), engineeringWorkbench.diff && (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24 truncate", children: engineeringWorkbench.diffLabel || 'Diff preview' }), _jsxs("div", { className: "flex items-center gap-2", children: [engineeringWorkbench.diffTruncated && _jsx("span", { className: "text-[10px] text-[#ffd38a]", children: "truncated" }), _jsx("button", { type: "button", onClick: onEngineeringQueuePatchReview, disabled: engineeringWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Queue review" })] })] }), _jsx("pre", { className: "max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words px-2.5 py-2 text-[10px] leading-relaxed font-mono text-white/42", children: engineeringWorkbench.diff })] })), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Patch review queue" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.patchReviews.length, " items"] })] }), engineeringWorkbench.patchReviews.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No queued patch reviews. Preview a diff, then queue it for review." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.patchReviews.slice(0, 5).map((item) => (_jsx("div", { className: "px-2.5 py-2", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: item.title }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [item.status, " / ", item.files.length, " files / ", formatEngineeringTimestamp(item.updatedAt)] })] }), _jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringUpdatePatchReview(item.id, 'approved'), disabled: engineeringWorkbench.loading || item.status === 'approved', className: "h-6 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Approve" }), _jsx("button", { type: "button", onClick: () => onEngineeringUpdatePatchReview(item.id, 'changes-requested'), disabled: engineeringWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Changes" })] })] }) }, item.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Recent runs" }), engineeringWorkbench.runs.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No check runs recorded for this workspace." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.runs.slice(0, 6).map((run) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/62", children: run.check.name }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("span", { className: `text-[10px] ${run.success ? 'text-[#96e59d]' : 'text-[#ff9a9a]'}`, children: run.success ? 'pass' : 'fail' }), _jsx("span", { className: "text-[10px] text-white/20", children: formatEngineeringDuration(run.durationMs) }), _jsx("span", { className: "text-[10px] text-white/20", children: formatEngineeringTimestamp(run.endedAt) })] })] }), (run.stdout.trim() || run.stderr.trim() || run.error) && (_jsx("pre", { className: "mt-1 max-h-[70px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono text-white/34", children: [run.error, run.stderr.trim(), run.stdout.trim()].filter(Boolean).join('\n\n') }))] }, run.id))) }))] })] })] })] })] })), tab === 'learned' && (
447
447
  /*
448
448
  * ADE §5.8, MOUNTED.