@hanzo/ui 8.27.14 → 8.27.16
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/NOTICE +19 -0
- package/dist/agents/Attachments.cjs +29 -0
- package/dist/agents/Attachments.d.ts +31 -0
- package/dist/agents/Attachments.d.ts.map +1 -0
- package/dist/agents/Attachments.js +27 -0
- package/dist/agents/Attachments.js.map +1 -0
- package/dist/agents/Choice.cjs +47 -0
- package/dist/agents/Choice.d.ts +34 -0
- package/dist/agents/Choice.d.ts.map +1 -0
- package/dist/agents/Choice.js +44 -0
- package/dist/agents/Choice.js.map +1 -0
- package/dist/agents/Console.cjs +106 -0
- package/dist/agents/Console.d.ts +54 -0
- package/dist/agents/Console.d.ts.map +1 -0
- package/dist/agents/Console.js +104 -0
- package/dist/agents/Console.js.map +1 -0
- package/dist/agents/Feedback.cjs +50 -0
- package/dist/agents/Feedback.d.ts +25 -0
- package/dist/agents/Feedback.d.ts.map +1 -0
- package/dist/agents/Feedback.js +48 -0
- package/dist/agents/Feedback.js.map +1 -0
- package/dist/agents/FileTabs.cjs +63 -0
- package/dist/agents/FileTabs.d.ts +45 -0
- package/dist/agents/FileTabs.d.ts.map +1 -0
- package/dist/agents/FileTabs.js +61 -0
- package/dist/agents/FileTabs.js.map +1 -0
- package/dist/agents/FileTree.cjs +160 -0
- package/dist/agents/FileTree.d.ts +41 -0
- package/dist/agents/FileTree.d.ts.map +1 -0
- package/dist/agents/FileTree.js +157 -0
- package/dist/agents/FileTree.js.map +1 -0
- package/dist/agents/PreviewFrame.cjs +108 -0
- package/dist/agents/PreviewFrame.d.ts +78 -0
- package/dist/agents/PreviewFrame.d.ts.map +1 -0
- package/dist/agents/PreviewFrame.js +105 -0
- package/dist/agents/PreviewFrame.js.map +1 -0
- package/dist/agents/Suggestions.cjs +29 -0
- package/dist/agents/Suggestions.d.ts +28 -0
- package/dist/agents/Suggestions.d.ts.map +1 -0
- package/dist/agents/Suggestions.js +26 -0
- package/dist/agents/Suggestions.js.map +1 -0
- package/dist/agents/Workspace.cjs +103 -0
- package/dist/agents/Workspace.d.ts +104 -0
- package/dist/agents/Workspace.d.ts.map +1 -0
- package/dist/agents/Workspace.js +98 -0
- package/dist/agents/Workspace.js.map +1 -0
- package/dist/agents/bridge.cjs +201 -0
- package/dist/agents/bridge.d.ts +102 -0
- package/dist/agents/bridge.d.ts.map +1 -0
- package/dist/agents/bridge.js +197 -0
- package/dist/agents/bridge.js.map +1 -0
- package/dist/agents/index.cjs +64 -1
- package/dist/agents/index.d.ts +23 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +23 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/log.cjs +75 -0
- package/dist/agents/log.d.ts +58 -0
- package/dist/agents/log.d.ts.map +1 -0
- package/dist/agents/log.js +65 -0
- package/dist/agents/log.js.map +1 -0
- package/dist/agents/tree.cjs +238 -0
- package/dist/agents/tree.d.ts +99 -0
- package/dist/agents/tree.d.ts.map +1 -0
- package/dist/agents/tree.js +226 -0
- package/dist/agents/tree.js.map +1 -0
- package/dist/backends/gui/3d-card.d.ts +6 -6
- package/dist/backends/gui/3d-marquee.d.ts +7 -8
- package/dist/backends/gui/3d-marquee.d.ts.map +1 -1
- package/dist/backends/gui/3d-pin.d.ts +1 -1
- package/dist/backends/gui/alert.d.ts +3 -3
- package/dist/backends/gui/android.d.ts +1 -1
- package/dist/backends/gui/animated-testimonials.d.ts +1 -1
- package/dist/backends/gui/animated-tooltip.d.ts +1 -1
- package/dist/backends/gui/announcement.d.ts +1 -1
- package/dist/backends/gui/banner.d.ts +1 -1
- package/dist/backends/gui/button.d.ts +1 -1
- package/dist/backends/gui/card.d.ts +7 -7
- package/dist/backends/gui/code-editor.cjs +2 -2
- package/dist/backends/gui/code-editor.d.ts +7 -1
- package/dist/backends/gui/code-editor.d.ts.map +1 -1
- package/dist/backends/gui/code-editor.js +2 -2
- package/dist/backends/gui/code-editor.js.map +1 -1
- package/dist/backends/gui/command.d.ts +5 -5
- package/dist/backends/gui/command.d.ts.map +1 -1
- package/dist/backends/gui/context-menu.d.ts +14 -14
- package/dist/backends/gui/context-menu.d.ts.map +1 -1
- package/dist/backends/gui/credit-card.d.ts +1 -1
- package/dist/backends/gui/desktop.d.ts +1 -1
- package/dist/backends/gui/dock.d.ts +3 -3
- package/dist/backends/gui/dropdown-menu.d.ts +16 -16
- package/dist/backends/gui/dropdown-menu.d.ts.map +1 -1
- package/dist/backends/gui/empty.d.ts +6 -6
- package/dist/backends/gui/field.d.ts +3 -3
- package/dist/backends/gui/gantt.d.ts +1 -1
- package/dist/backends/gui/grid-pattern.d.ts +1 -2
- package/dist/backends/gui/grid-pattern.d.ts.map +1 -1
- package/dist/backends/gui/image-zoom.d.ts +1 -1
- package/dist/backends/gui/iphone-15-pro.d.ts +1 -1
- package/dist/backends/gui/item.d.ts +9 -9
- package/dist/backends/gui/list.d.ts +2 -2
- package/dist/backends/gui/macos-dock.d.ts +2 -2
- package/dist/backends/gui/magnetic.d.ts +1 -1
- package/dist/backends/gui/marquee.d.ts +1 -15
- package/dist/backends/gui/marquee.d.ts.map +1 -1
- package/dist/backends/gui/menu-dock.d.ts +1 -1
- package/dist/backends/gui/menubar.d.ts +15 -15
- package/dist/backends/gui/menubar.d.ts.map +1 -1
- package/dist/backends/gui/message-dock.d.ts +1 -1
- package/dist/backends/gui/motion-highlight.d.ts +1 -12
- package/dist/backends/gui/motion-highlight.d.ts.map +1 -1
- package/dist/backends/gui/pagination.d.ts +4 -4
- package/dist/backends/gui/qr-code.d.ts +1 -2
- package/dist/backends/gui/qr-code.d.ts.map +1 -1
- package/dist/backends/gui/scroll-area.d.ts +3 -14
- package/dist/backends/gui/scroll-area.d.ts.map +1 -1
- package/dist/backends/gui/sheet.d.ts +3 -3
- package/dist/backends/gui/sheet.d.ts.map +1 -1
- package/dist/backends/gui/status.d.ts +1 -1
- package/dist/backends/gui/table.d.ts +8 -8
- package/dist/backends/gui/toaster.d.ts +1 -15
- package/dist/backends/gui/toaster.d.ts.map +1 -1
- package/dist/backends/gui/toggle.d.ts +1 -1
- package/dist/backends/gui/video-player.d.ts +1 -1
- package/dist/chat/Composer.cjs +60 -9
- package/dist/chat/Composer.d.ts +42 -2
- package/dist/chat/Composer.d.ts.map +1 -1
- package/dist/chat/Composer.js +61 -11
- package/dist/chat/Composer.js.map +1 -1
- package/dist/chat/EmptyPrompt.cjs +27 -0
- package/dist/chat/EmptyPrompt.d.ts +30 -0
- package/dist/chat/EmptyPrompt.d.ts.map +1 -0
- package/dist/chat/EmptyPrompt.js +24 -0
- package/dist/chat/EmptyPrompt.js.map +1 -0
- package/dist/chat/SessionRail.cjs +97 -0
- package/dist/chat/SessionRail.d.ts +97 -0
- package/dist/chat/SessionRail.d.ts.map +1 -0
- package/dist/chat/SessionRail.js +94 -0
- package/dist/chat/SessionRail.js.map +1 -0
- package/dist/chat/Thread.d.ts +2 -8
- package/dist/chat/Thread.d.ts.map +1 -1
- package/dist/chat/index.cjs +8 -1
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +3 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/gallery.cjs +28 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +71 -3
- package/dist/gallery.js +30 -3
- package/dist/gallery.js.map +1 -1
- package/dist/product/BranchSelect.cjs +27 -0
- package/dist/product/BranchSelect.d.ts +27 -0
- package/dist/product/BranchSelect.d.ts.map +1 -0
- package/dist/product/BranchSelect.js +23 -0
- package/dist/product/BranchSelect.js.map +1 -0
- package/dist/product/ChipSelect.cjs +267 -0
- package/dist/product/ChipSelect.d.ts +71 -0
- package/dist/product/ChipSelect.d.ts.map +1 -0
- package/dist/product/ChipSelect.js +265 -0
- package/dist/product/ChipSelect.js.map +1 -0
- package/dist/product/RepoSelect.cjs +75 -0
- package/dist/product/RepoSelect.d.ts +63 -0
- package/dist/product/RepoSelect.d.ts.map +1 -0
- package/dist/product/RepoSelect.js +69 -0
- package/dist/product/RepoSelect.js.map +1 -0
- package/dist/product/chipSelect.logic.cjs +147 -0
- package/dist/product/chipSelect.logic.d.ts +92 -0
- package/dist/product/chipSelect.logic.d.ts.map +1 -0
- package/dist/product/chipSelect.logic.js +138 -0
- package/dist/product/chipSelect.logic.js.map +1 -0
- package/dist/product/index.cjs +23 -1
- package/dist/product/index.d.ts +4 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +7 -0
- package/dist/product/index.js.map +1 -1
- package/dist/styles.css +68 -0
- package/package.json +2 -4
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bridge — the message protocol between a builder and the page it previews.
|
|
3
|
+
*
|
|
4
|
+
* Ported from build-v2 `components/editor/preview/bridge.ts` (MIT, derived from
|
|
5
|
+
* OSW Studio and DeepSite — see NOTICE). v2 wrote the preview document itself
|
|
6
|
+
* (`srcdoc`) and injected this script into it. A repository's deployed site is
|
|
7
|
+
* a page on ITS OWN origin that this package does not write, so nothing is
|
|
8
|
+
* injected: the bridge is OPT-IN. A page that wants element picking and
|
|
9
|
+
* console forwarding includes the script `script(parent)` returns — pinned to
|
|
10
|
+
* the builder's origin — and the frame speaks to it only across that pair of
|
|
11
|
+
* origins.
|
|
12
|
+
*
|
|
13
|
+
* The protocol, both directions, every message a plain object with `type`:
|
|
14
|
+
*
|
|
15
|
+
* page → builder preview:ready the bridge is listening
|
|
16
|
+
* preview:hover {selector, rect, tag} | {selector: null}
|
|
17
|
+
* preview:select {info} an element was picked
|
|
18
|
+
* preview:navigate {path} an in-site link was followed
|
|
19
|
+
* preview:console {level, text} the page's console, as text
|
|
20
|
+
* builder → page preview:editable {active} picking on/off
|
|
21
|
+
* preview:highlight {selector} outline one element
|
|
22
|
+
*
|
|
23
|
+
* What v2 also sent — live style and text edits — is not here. A change made
|
|
24
|
+
* inside the frame is gone on the next load; the builder's edits are runs that
|
|
25
|
+
* commit, and a control that edits something it cannot keep is a lie.
|
|
26
|
+
*
|
|
27
|
+
* Both sides check ORIGIN, never `'*'`: the page posts only to the builder's
|
|
28
|
+
* origin and reads only messages whose source is its parent and whose origin
|
|
29
|
+
* is that origin; the builder reads only messages whose source is the frame's
|
|
30
|
+
* window and whose origin is the frame's. `accept` is that check, in one place.
|
|
31
|
+
*/
|
|
32
|
+
import { level } from './log.js';
|
|
33
|
+
const TYPES = new Set(['preview:ready', 'preview:hover', 'preview:select', 'preview:navigate', 'preview:console']);
|
|
34
|
+
const str = (v) => typeof v === 'string';
|
|
35
|
+
const num = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
36
|
+
/** A control character or a line break: nothing a selector, a tag or a path carries. */
|
|
37
|
+
const CONTROL = /[\u0000-\u001f\u007f\u2028\u2029]/;
|
|
38
|
+
/**
|
|
39
|
+
* A selector in the one shape `script` writes — `body`, a plain `#id`, or a
|
|
40
|
+
* `body > tag:nth-of-type(n) > …` path — and nothing else. A page is free to
|
|
41
|
+
* post anything, and a free-text "selector" is the person's next ask written
|
|
42
|
+
* by the page; this shape carries no words.
|
|
43
|
+
*/
|
|
44
|
+
const SELECTOR = /^(?:body|#[A-Za-z][A-Za-z0-9_-]{0,63}|body(?: > [a-z][a-z0-9-]{0,31}(?::nth-of-type\([1-9][0-9]{0,3}\))?){1,24})$/;
|
|
45
|
+
const selector = (v) => str(v) && v.length <= 256 && SELECTOR.test(v);
|
|
46
|
+
/** An element's tag name, as the DOM spells one. */
|
|
47
|
+
const tag = (v) => str(v) && /^[a-z][a-z0-9-]{0,31}$/i.test(v);
|
|
48
|
+
/** A path on the framed page's own origin: one leading slash, never two, no backslash, no whitespace, short. */
|
|
49
|
+
const path = (v) => str(v) && v.length <= 128 && /^\/(?![\/\\])[^\s\\]*$/.test(v) && !CONTROL.test(v);
|
|
50
|
+
/**
|
|
51
|
+
* The address a frame may load: an absolute http(s) URL, resolved against
|
|
52
|
+
* `base`. Anything else — `javascript:`, `data:`, `blob:`, a malformed string —
|
|
53
|
+
* is `null`, so a frame never runs an address a string could smuggle in.
|
|
54
|
+
*/
|
|
55
|
+
export function web(url, base) {
|
|
56
|
+
if (!url)
|
|
57
|
+
return null;
|
|
58
|
+
try {
|
|
59
|
+
const u = base ? new URL(url, base) : new URL(url);
|
|
60
|
+
return u.protocol === 'https:' || u.protocol === 'http:' ? u : null;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A message from the frame, or `null`. It must come FROM the frame's window,
|
|
68
|
+
* FROM the frame's origin, and be one of the five shapes above with every
|
|
69
|
+
* field the type it claims. A message that fails any of that is dropped
|
|
70
|
+
* without a word — anything can post to a window.
|
|
71
|
+
*/
|
|
72
|
+
export function accept(event, frame, origin) {
|
|
73
|
+
if (!frame || event.source !== frame.contentWindow || event.origin !== origin)
|
|
74
|
+
return null;
|
|
75
|
+
const m = event.data;
|
|
76
|
+
if (!m || typeof m !== 'object' || !str(m.type) || !TYPES.has(m.type))
|
|
77
|
+
return null;
|
|
78
|
+
switch (m.type) {
|
|
79
|
+
case 'preview:ready':
|
|
80
|
+
return { type: 'preview:ready' };
|
|
81
|
+
case 'preview:hover': {
|
|
82
|
+
if (m.selector === null)
|
|
83
|
+
return { type: 'preview:hover', selector: null };
|
|
84
|
+
const r = m.rect;
|
|
85
|
+
if (!selector(m.selector) || !r || !num(r.top) || !num(r.left) || !num(r.width) || !num(r.height))
|
|
86
|
+
return null;
|
|
87
|
+
return {
|
|
88
|
+
type: 'preview:hover',
|
|
89
|
+
selector: m.selector,
|
|
90
|
+
rect: { top: r.top, left: r.left, width: r.width, height: r.height },
|
|
91
|
+
tag: tag(m.tag) ? m.tag : undefined,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
case 'preview:select': {
|
|
95
|
+
const i = m.info;
|
|
96
|
+
if (!i || !selector(i.selector) || !tag(i.tag) || !str(i.html))
|
|
97
|
+
return null;
|
|
98
|
+
return {
|
|
99
|
+
type: 'preview:select',
|
|
100
|
+
info: {
|
|
101
|
+
selector: i.selector,
|
|
102
|
+
tag: i.tag,
|
|
103
|
+
id: str(i.id) && i.id.length <= 128 && !CONTROL.test(i.id) ? i.id : undefined,
|
|
104
|
+
text: str(i.text) ? i.text.slice(0, 200) : undefined,
|
|
105
|
+
html: i.html.slice(0, 8000),
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
case 'preview:navigate':
|
|
110
|
+
return path(m.path) ? { type: 'preview:navigate', path: m.path } : null;
|
|
111
|
+
case 'preview:console': {
|
|
112
|
+
return str(m.text) ? { type: 'preview:console', level: level(m.level), text: m.text.slice(0, 4000) } : null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The script a previewed page includes to take part, pinned to the builder at
|
|
119
|
+
* `parent` (an origin: `https://platform.hanzo.ai`). It posts only there, and
|
|
120
|
+
* obeys only its parent window speaking from there.
|
|
121
|
+
*
|
|
122
|
+
* Serve it from the page itself (a `<script>` the site ships), never from the
|
|
123
|
+
* builder: the page decides whether it can be picked apart, not the frame
|
|
124
|
+
* around it.
|
|
125
|
+
*/
|
|
126
|
+
export function script(parent) {
|
|
127
|
+
const origin = new URL(parent).origin;
|
|
128
|
+
return `(function () {
|
|
129
|
+
if (window.__hanzoBridge || window.parent === window) return;
|
|
130
|
+
window.__hanzoBridge = true;
|
|
131
|
+
var PARENT = ${JSON.stringify(origin)};
|
|
132
|
+
var editable = false, hovered = null, marked = null;
|
|
133
|
+
function send(m) { try { window.parent.postMessage(m, PARENT); } catch (e) {} }
|
|
134
|
+
function sel(el) {
|
|
135
|
+
if (!el || el === document.body || el === document.documentElement) return 'body';
|
|
136
|
+
if (el.id && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(el.id) && document.querySelectorAll('#' + el.id).length === 1) return '#' + el.id;
|
|
137
|
+
var parts = [], node = el;
|
|
138
|
+
while (node && node !== document.body && node.nodeType === 1) {
|
|
139
|
+
var p = node.parentNode; if (!p) break;
|
|
140
|
+
var same = [], i;
|
|
141
|
+
for (i = 0; i < p.children.length; i++) if (p.children[i].tagName === node.tagName) same.push(p.children[i]);
|
|
142
|
+
var tag = node.tagName.toLowerCase();
|
|
143
|
+
parts.unshift(same.length > 1 ? tag + ':nth-of-type(' + (same.indexOf(node) + 1) + ')' : tag);
|
|
144
|
+
node = p;
|
|
145
|
+
}
|
|
146
|
+
return 'body' + (parts.length ? ' > ' + parts.join(' > ') : '');
|
|
147
|
+
}
|
|
148
|
+
function find(s) { if (!s) return null; try { return document.querySelector(s); } catch (e) { return null; } }
|
|
149
|
+
function outline(el, on) { if (el) el.style.outline = on ? '2px solid rgba(120,160,255,.9)' : ''; }
|
|
150
|
+
['log', 'info', 'warn', 'error', 'debug'].forEach(function (level) {
|
|
151
|
+
var original = console[level]; if (typeof original !== 'function') return;
|
|
152
|
+
console[level] = function () {
|
|
153
|
+
var args = Array.prototype.slice.call(arguments), out = [];
|
|
154
|
+
for (var i = 0; i < args.length; i++) {
|
|
155
|
+
var a = args[i];
|
|
156
|
+
if (typeof a === 'string') out.push(a);
|
|
157
|
+
else if (a instanceof Error) out.push(a.stack || a.name + ': ' + a.message);
|
|
158
|
+
else { try { out.push(JSON.stringify(a)); } catch (e) { out.push(String(a)); } }
|
|
159
|
+
}
|
|
160
|
+
send({ type: 'preview:console', level: level, text: out.join(' ') });
|
|
161
|
+
original.apply(console, args);
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
window.addEventListener('error', function (e) { send({ type: 'preview:console', level: 'error', text: String(e.message || 'Script error') }); });
|
|
165
|
+
document.addEventListener('mouseover', function (e) {
|
|
166
|
+
if (!editable) return;
|
|
167
|
+
var t = e.target; if (!t || t === document.body || t === hovered) return;
|
|
168
|
+
outline(hovered, false); hovered = t; outline(t, true);
|
|
169
|
+
var r = t.getBoundingClientRect();
|
|
170
|
+
send({ type: 'preview:hover', selector: sel(t), tag: t.tagName.toLowerCase(), rect: { top: r.top, left: r.left, width: r.width, height: r.height } });
|
|
171
|
+
}, true);
|
|
172
|
+
document.addEventListener('mouseout', function () {
|
|
173
|
+
if (!editable) return; outline(hovered, false); hovered = null; send({ type: 'preview:hover', selector: null });
|
|
174
|
+
}, true);
|
|
175
|
+
document.addEventListener('click', function (e) {
|
|
176
|
+
if (editable) {
|
|
177
|
+
var t = e.target; if (!t || t === document.body) return;
|
|
178
|
+
e.preventDefault(); e.stopPropagation();
|
|
179
|
+
send({ type: 'preview:select', info: { selector: sel(t), tag: t.tagName.toLowerCase(), id: t.id || undefined, text: (t.textContent || '').slice(0, 200), html: (t.outerHTML || '').slice(0, 8000) } });
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
183
|
+
if (!a) return;
|
|
184
|
+
var href = a.getAttribute('href') || '';
|
|
185
|
+
if (!href || href.charAt(0) === '#' || /^[a-z][a-z0-9+.-]*:/i.test(href) || href.indexOf('//') === 0) return;
|
|
186
|
+
send({ type: 'preview:navigate', path: href });
|
|
187
|
+
}, true);
|
|
188
|
+
window.addEventListener('message', function (e) {
|
|
189
|
+
if (e.source !== window.parent || e.origin !== PARENT) return;
|
|
190
|
+
var m = e.data; if (!m || typeof m !== 'object') return;
|
|
191
|
+
if (m.type === 'preview:editable') { editable = !!m.active; if (!editable) { outline(hovered, false); hovered = null; } }
|
|
192
|
+
else if (m.type === 'preview:highlight') { outline(marked, false); marked = find(m.selector); outline(marked, true); }
|
|
193
|
+
});
|
|
194
|
+
send({ type: 'preview:ready' });
|
|
195
|
+
})();`;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/agents/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;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I,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;oBACpD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;iBAC5B;aACF,CAAA;QACH,CAAC;QACD,KAAK,kBAAkB;YACrB,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACzE,KAAK,iBAAiB,EAAE,CAAC;YACvB,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QAC7G,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAAC,MAAc;IACnC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAA;IACrC,OAAO;;;iBAGQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgEjC,CAAA;AACN,CAAC"}
|
package/dist/agents/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TerminalViewer = exports.DriveViewer = exports.DirectoryModal = exports.ShortcutsSheet = exports.ThemeCustomizer = exports.ChannelMembers = exports.ChannelNotes = exports.LiveVoiceCall = exports.DiffViewer = exports.MCPHub = exports.SwarmBar = exports.SystemLine = exports.Pane = exports.OrgRail = exports.ChannelHeader = exports.ArtifactCard = exports.steps = exports.ProgressBlock = exports.Screen = exports.Steer = exports.MemberRow = exports.fold = exports.Transcript = exports.nest = exports.RunRow = exports.AgentBoard = void 0;
|
|
3
|
+
exports.group = exports.filter = exports.dir = exports.base = exports.ancestors = exports.Feedback = exports.Attachments = exports.SUGGESTIONS = exports.Suggestions = exports.Console = exports.PHONE = exports.PreviewFrame = exports.FileTabs = exports.glyph = exports.FileTree = exports.PageSelect = exports.ModeSelect = exports.CONTROL = exports.DEVICES = exports.CHAT = exports.VIEWS = exports.ProjectChip = exports.Views = exports.Workspace = exports.TerminalViewer = exports.DriveViewer = exports.DirectoryModal = exports.ShortcutsSheet = exports.ThemeCustomizer = exports.ChannelMembers = exports.ChannelNotes = exports.LiveVoiceCall = exports.DiffViewer = exports.MCPHub = exports.SwarmBar = exports.SystemLine = exports.Pane = exports.OrgRail = exports.ChannelHeader = exports.ArtifactCard = exports.steps = exports.ProgressBlock = exports.Screen = exports.Steer = exports.MemberRow = exports.fold = exports.Transcript = exports.nest = exports.RunRow = exports.AgentBoard = void 0;
|
|
4
|
+
exports.web = exports.script = exports.accept = exports.OPEN = exports.LIMIT = exports.HEAD = exports.split = exports.level = exports.count = exports.cap = exports.step = exports.sort = exports.rows = exports.put = exports.language = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* @hanzo/ui/agents — the agents working view, on @hanzo/gui primitives.
|
|
6
7
|
*
|
|
@@ -65,3 +66,65 @@ var DriveViewer_1 = require("./DriveViewer.cjs");
|
|
|
65
66
|
Object.defineProperty(exports, "DriveViewer", { enumerable: true, get: function () { return DriveViewer_1.DriveViewer; } });
|
|
66
67
|
var TerminalViewer_1 = require("./TerminalViewer.cjs");
|
|
67
68
|
Object.defineProperty(exports, "TerminalViewer", { enumerable: true, get: function () { return TerminalViewer_1.TerminalViewer; } });
|
|
69
|
+
/**
|
|
70
|
+
* The builder's workspace — ported from build-v2's editor (MIT, derived from
|
|
71
|
+
* OSW Studio and DeepSite; see NOTICE). The frame and its bar (`Workspace`,
|
|
72
|
+
* `Views`, `ProjectChip`, `PageSelect`), the work (`PreviewFrame`, `FileTree`,
|
|
73
|
+
* `FileTabs`), the dock (`Console`), and the chat column's own pieces
|
|
74
|
+
* (`ModeSelect`, `Suggestions`, `Attachments`, `Feedback`) — which compose with
|
|
75
|
+
* `@hanzo/ui/chat`'s `Thread`, `Message` and `Composer` rather than repeat them.
|
|
76
|
+
*
|
|
77
|
+
* `tree`, `log` and `bridge` are the pure halves: the file listing and its keys,
|
|
78
|
+
* the console's lines and height, and the origin-checked preview protocol.
|
|
79
|
+
*/
|
|
80
|
+
var Workspace_1 = require("./Workspace.cjs");
|
|
81
|
+
Object.defineProperty(exports, "Workspace", { enumerable: true, get: function () { return Workspace_1.Workspace; } });
|
|
82
|
+
Object.defineProperty(exports, "Views", { enumerable: true, get: function () { return Workspace_1.Views; } });
|
|
83
|
+
Object.defineProperty(exports, "ProjectChip", { enumerable: true, get: function () { return Workspace_1.ProjectChip; } });
|
|
84
|
+
Object.defineProperty(exports, "VIEWS", { enumerable: true, get: function () { return Workspace_1.VIEWS; } });
|
|
85
|
+
Object.defineProperty(exports, "CHAT", { enumerable: true, get: function () { return Workspace_1.CHAT; } });
|
|
86
|
+
Object.defineProperty(exports, "DEVICES", { enumerable: true, get: function () { return Workspace_1.DEVICES; } });
|
|
87
|
+
Object.defineProperty(exports, "CONTROL", { enumerable: true, get: function () { return Workspace_1.CONTROL; } });
|
|
88
|
+
var Choice_1 = require("./Choice.cjs");
|
|
89
|
+
Object.defineProperty(exports, "ModeSelect", { enumerable: true, get: function () { return Choice_1.ModeSelect; } });
|
|
90
|
+
Object.defineProperty(exports, "PageSelect", { enumerable: true, get: function () { return Choice_1.PageSelect; } });
|
|
91
|
+
var FileTree_1 = require("./FileTree.cjs");
|
|
92
|
+
Object.defineProperty(exports, "FileTree", { enumerable: true, get: function () { return FileTree_1.FileTree; } });
|
|
93
|
+
Object.defineProperty(exports, "glyph", { enumerable: true, get: function () { return FileTree_1.glyph; } });
|
|
94
|
+
var FileTabs_1 = require("./FileTabs.cjs");
|
|
95
|
+
Object.defineProperty(exports, "FileTabs", { enumerable: true, get: function () { return FileTabs_1.FileTabs; } });
|
|
96
|
+
var PreviewFrame_1 = require("./PreviewFrame.cjs");
|
|
97
|
+
Object.defineProperty(exports, "PreviewFrame", { enumerable: true, get: function () { return PreviewFrame_1.PreviewFrame; } });
|
|
98
|
+
Object.defineProperty(exports, "PHONE", { enumerable: true, get: function () { return PreviewFrame_1.PHONE; } });
|
|
99
|
+
var Console_1 = require("./Console.cjs");
|
|
100
|
+
Object.defineProperty(exports, "Console", { enumerable: true, get: function () { return Console_1.Console; } });
|
|
101
|
+
var Suggestions_1 = require("./Suggestions.cjs");
|
|
102
|
+
Object.defineProperty(exports, "Suggestions", { enumerable: true, get: function () { return Suggestions_1.Suggestions; } });
|
|
103
|
+
Object.defineProperty(exports, "SUGGESTIONS", { enumerable: true, get: function () { return Suggestions_1.SUGGESTIONS; } });
|
|
104
|
+
var Attachments_1 = require("./Attachments.cjs");
|
|
105
|
+
Object.defineProperty(exports, "Attachments", { enumerable: true, get: function () { return Attachments_1.Attachments; } });
|
|
106
|
+
var Feedback_1 = require("./Feedback.cjs");
|
|
107
|
+
Object.defineProperty(exports, "Feedback", { enumerable: true, get: function () { return Feedback_1.Feedback; } });
|
|
108
|
+
var tree_1 = require("./tree.cjs");
|
|
109
|
+
Object.defineProperty(exports, "ancestors", { enumerable: true, get: function () { return tree_1.ancestors; } });
|
|
110
|
+
Object.defineProperty(exports, "base", { enumerable: true, get: function () { return tree_1.base; } });
|
|
111
|
+
Object.defineProperty(exports, "dir", { enumerable: true, get: function () { return tree_1.dir; } });
|
|
112
|
+
Object.defineProperty(exports, "filter", { enumerable: true, get: function () { return tree_1.filter; } });
|
|
113
|
+
Object.defineProperty(exports, "group", { enumerable: true, get: function () { return tree_1.group; } });
|
|
114
|
+
Object.defineProperty(exports, "language", { enumerable: true, get: function () { return tree_1.language; } });
|
|
115
|
+
Object.defineProperty(exports, "put", { enumerable: true, get: function () { return tree_1.put; } });
|
|
116
|
+
Object.defineProperty(exports, "rows", { enumerable: true, get: function () { return tree_1.rows; } });
|
|
117
|
+
Object.defineProperty(exports, "sort", { enumerable: true, get: function () { return tree_1.sort; } });
|
|
118
|
+
Object.defineProperty(exports, "step", { enumerable: true, get: function () { return tree_1.step; } });
|
|
119
|
+
var log_1 = require("./log.cjs");
|
|
120
|
+
Object.defineProperty(exports, "cap", { enumerable: true, get: function () { return log_1.cap; } });
|
|
121
|
+
Object.defineProperty(exports, "count", { enumerable: true, get: function () { return log_1.count; } });
|
|
122
|
+
Object.defineProperty(exports, "level", { enumerable: true, get: function () { return log_1.level; } });
|
|
123
|
+
Object.defineProperty(exports, "split", { enumerable: true, get: function () { return log_1.split; } });
|
|
124
|
+
Object.defineProperty(exports, "HEAD", { enumerable: true, get: function () { return log_1.HEAD; } });
|
|
125
|
+
Object.defineProperty(exports, "LIMIT", { enumerable: true, get: function () { return log_1.LIMIT; } });
|
|
126
|
+
Object.defineProperty(exports, "OPEN", { enumerable: true, get: function () { return log_1.OPEN; } });
|
|
127
|
+
var bridge_1 = require("./bridge.cjs");
|
|
128
|
+
Object.defineProperty(exports, "accept", { enumerable: true, get: function () { return bridge_1.accept; } });
|
|
129
|
+
Object.defineProperty(exports, "script", { enumerable: true, get: function () { return bridge_1.script; } });
|
|
130
|
+
Object.defineProperty(exports, "web", { enumerable: true, get: function () { return bridge_1.web; } });
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -36,4 +36,27 @@ export { ShortcutsSheet, type ShortcutItem, type ShortcutsSheetProps, } from './
|
|
|
36
36
|
export { DirectoryModal, type DirectoryItem, type DirectoryModalProps, type DirectoryTab, } from './DirectoryModal.js';
|
|
37
37
|
export { DriveViewer, type DriveViewerProps, type StorageBucket, type StorageEntry, } from './DriveViewer.js';
|
|
38
38
|
export { TerminalViewer, type TerminalTab, type TerminalViewerProps, } from './TerminalViewer.js';
|
|
39
|
+
/**
|
|
40
|
+
* The builder's workspace — ported from build-v2's editor (MIT, derived from
|
|
41
|
+
* OSW Studio and DeepSite; see NOTICE). The frame and its bar (`Workspace`,
|
|
42
|
+
* `Views`, `ProjectChip`, `PageSelect`), the work (`PreviewFrame`, `FileTree`,
|
|
43
|
+
* `FileTabs`), the dock (`Console`), and the chat column's own pieces
|
|
44
|
+
* (`ModeSelect`, `Suggestions`, `Attachments`, `Feedback`) — which compose with
|
|
45
|
+
* `@hanzo/ui/chat`'s `Thread`, `Message` and `Composer` rather than repeat them.
|
|
46
|
+
*
|
|
47
|
+
* `tree`, `log` and `bridge` are the pure halves: the file listing and its keys,
|
|
48
|
+
* the console's lines and height, and the origin-checked preview protocol.
|
|
49
|
+
*/
|
|
50
|
+
export { Workspace, Views, ProjectChip, VIEWS, CHAT, DEVICES, CONTROL, type WorkspaceProps, type View, type ViewsProps, type ProjectChipProps, } from './Workspace.js';
|
|
51
|
+
export { ModeSelect, PageSelect, type Option, type ModeSelectProps, type PageSelectProps, } from './Choice.js';
|
|
52
|
+
export { FileTree, glyph, type FileTreeProps } from './FileTree.js';
|
|
53
|
+
export { FileTabs, type FileTabsProps, type OpenFile } from './FileTabs.js';
|
|
54
|
+
export { PreviewFrame, PHONE, type PreviewFrameProps, type PreviewHandle, } from './PreviewFrame.js';
|
|
55
|
+
export { Console, type ConsoleProps, type ConsoleTab } from './Console.js';
|
|
56
|
+
export { Suggestions, SUGGESTIONS, type SuggestionsProps } from './Suggestions.js';
|
|
57
|
+
export { Attachments, type Attachment, type AttachmentsProps } from './Attachments.js';
|
|
58
|
+
export { Feedback, type FeedbackProps, type Verdict } from './Feedback.js';
|
|
59
|
+
export { ancestors, base, dir, filter, group, language, put, rows, sort, step, type Entry, type Listing, type Move, type Row, } from './tree.js';
|
|
60
|
+
export { cap, count, level, split, HEAD, LIMIT, OPEN, type Level, type Line } from './log.js';
|
|
61
|
+
export { accept, script, web, type FrameCommand, type FrameEvent, type Picked, type Rect, } from './bridge.js';
|
|
39
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,eAAe,EACpB,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAA;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjF,OAAO,EACL,aAAa,EACb,KAAK,EACL,KAAK,KAAK,EACV,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACT,KAAK,QAAQ,GACd,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,GACrB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,eAAe,EACpB,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAA;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,OAAO,EAC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EACN,KAAK,EACL,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,GAAG,GACT,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAA;AAE1F,OAAO,EACL,MAAM,EACN,MAAM,EACN,GAAG,EACH,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,IAAI,GACV,MAAM,UAAU,CAAA"}
|
package/dist/agents/index.js
CHANGED
|
@@ -36,4 +36,27 @@ export { ShortcutsSheet, } from './ShortcutsSheet.js';
|
|
|
36
36
|
export { DirectoryModal, } from './DirectoryModal.js';
|
|
37
37
|
export { DriveViewer, } from './DriveViewer.js';
|
|
38
38
|
export { TerminalViewer, } from './TerminalViewer.js';
|
|
39
|
+
/**
|
|
40
|
+
* The builder's workspace — ported from build-v2's editor (MIT, derived from
|
|
41
|
+
* OSW Studio and DeepSite; see NOTICE). The frame and its bar (`Workspace`,
|
|
42
|
+
* `Views`, `ProjectChip`, `PageSelect`), the work (`PreviewFrame`, `FileTree`,
|
|
43
|
+
* `FileTabs`), the dock (`Console`), and the chat column's own pieces
|
|
44
|
+
* (`ModeSelect`, `Suggestions`, `Attachments`, `Feedback`) — which compose with
|
|
45
|
+
* `@hanzo/ui/chat`'s `Thread`, `Message` and `Composer` rather than repeat them.
|
|
46
|
+
*
|
|
47
|
+
* `tree`, `log` and `bridge` are the pure halves: the file listing and its keys,
|
|
48
|
+
* the console's lines and height, and the origin-checked preview protocol.
|
|
49
|
+
*/
|
|
50
|
+
export { Workspace, Views, ProjectChip, VIEWS, CHAT, DEVICES, CONTROL, } from './Workspace.js';
|
|
51
|
+
export { ModeSelect, PageSelect, } from './Choice.js';
|
|
52
|
+
export { FileTree, glyph } from './FileTree.js';
|
|
53
|
+
export { FileTabs } from './FileTabs.js';
|
|
54
|
+
export { PreviewFrame, PHONE, } from './PreviewFrame.js';
|
|
55
|
+
export { Console } from './Console.js';
|
|
56
|
+
export { Suggestions, SUGGESTIONS } from './Suggestions.js';
|
|
57
|
+
export { Attachments } from './Attachments.js';
|
|
58
|
+
export { Feedback } from './Feedback.js';
|
|
59
|
+
export { ancestors, base, dir, filter, group, language, put, rows, sort, step, } from './tree.js';
|
|
60
|
+
export { cap, count, level, split, HEAD, LIMIT, OPEN } from './log.js';
|
|
61
|
+
export { accept, script, web, } from './bridge.js';
|
|
39
62
|
//# sourceMappingURL=index.js.map
|
package/dist/agents/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,GAKL,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAE,IAAI,EAA+C,MAAM,cAAc,CAAA;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,GAKN,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,MAAM,EAAkD,MAAM,UAAU,CAAA;AAEjF,OAAO,EACL,aAAa,EACb,KAAK,GAKN,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,IAAI,EACJ,UAAU,GASX,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,QAAQ,GAGT,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,MAAM,GAGP,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,UAAU,GAEX,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,aAAa,GAEd,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,YAAY,GAEb,MAAM,gBAA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AAc,GAIf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,GAIZ,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,cAAc,GAGf,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;;;;GAUG;AACH,OAAO,EACL,SAAS,EACT,KAAK,EACL,WAAW,EACX,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAO,GAKR,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,UAAU,EACV,UAAU,GAIX,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAsB,MAAM,YAAY,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAqC,MAAM,YAAY,CAAA;AAExE,OAAO,EACL,YAAY,EACZ,KAAK,GAGN,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAsC,MAAM,WAAW,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAA;AAE/E,OAAO,EAAE,WAAW,EAA0C,MAAM,eAAe,CAAA;AAEnF,OAAO,EAAE,QAAQ,EAAoC,MAAM,YAAY,CAAA;AAEvE,OAAO,EACL,SAAS,EACT,IAAI,EACJ,GAAG,EACH,MAAM,EACN,KAAK,EACL,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,GAKL,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAyB,MAAM,OAAO,CAAA;AAE1F,OAAO,EACL,MAAM,EACN,MAAM,EACN,GAAG,GAKJ,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* log — the console dock's lines and its one dimension.
|
|
4
|
+
*
|
|
5
|
+
* Ported from build-v2 `components/editor/console/{log,dock}.ts` (MIT, derived
|
|
6
|
+
* from OSW Studio and DeepSite — see NOTICE). v2 kept the buffer at module
|
|
7
|
+
* scope inside the app; here the buffer is the HOST's (a run's events, a
|
|
8
|
+
* page's forwarded console) and this module keeps only the decisions every
|
|
9
|
+
* host would otherwise make differently: how a block of output becomes lines,
|
|
10
|
+
* how many are kept, and what a drag or a key does to the dock's height.
|
|
11
|
+
*
|
|
12
|
+
* Pure and importless.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.opened = exports.resolve = exports.ceiling = exports.SHUT = exports.STEP = exports.OPEN = exports.MIN_OPEN = exports.BODY = exports.HEAD = exports.cap = exports.LIMIT = exports.level = void 0;
|
|
16
|
+
exports.split = split;
|
|
17
|
+
exports.count = count;
|
|
18
|
+
exports.clamp = clamp;
|
|
19
|
+
const LEVELS = ['log', 'info', 'warn', 'error', 'debug'];
|
|
20
|
+
/** A level from the wire, or `log` for anything unrecognised. */
|
|
21
|
+
const level = (raw) => typeof raw === 'string' && LEVELS.includes(raw) ? raw : 'log';
|
|
22
|
+
exports.level = level;
|
|
23
|
+
/**
|
|
24
|
+
* A block of output as one line per line, trailing blank lines dropped. A
|
|
25
|
+
* build's output arrives as a paragraph; a console shows it as the lines it is,
|
|
26
|
+
* so each can be read, copied and counted.
|
|
27
|
+
*/
|
|
28
|
+
function split(text) {
|
|
29
|
+
const lines = text.replace(/\r\n?/g, '\n').split('\n');
|
|
30
|
+
while (lines.length > 0 && lines[lines.length - 1].trim() === '')
|
|
31
|
+
lines.pop();
|
|
32
|
+
return lines;
|
|
33
|
+
}
|
|
34
|
+
/** Enough to read a build, bounded so a runaway loop cannot eat memory. */
|
|
35
|
+
exports.LIMIT = 500;
|
|
36
|
+
/** The newest `limit` lines. */
|
|
37
|
+
const cap = (lines, limit = exports.LIMIT) => lines.length > limit ? lines.slice(lines.length - limit) : lines;
|
|
38
|
+
exports.cap = cap;
|
|
39
|
+
/** How many lines of each level — what a collapsed dock's badge says. */
|
|
40
|
+
function count(lines) {
|
|
41
|
+
const out = { log: 0, info: 0, warn: 0, error: 0, debug: 0 };
|
|
42
|
+
for (const l of lines)
|
|
43
|
+
out[l.level] += 1;
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The dock's ONE dimension: its height in px. An open dock IS a dock taller
|
|
48
|
+
* than its header (`open = height > HEAD`), so a dragged size and a toggled
|
|
49
|
+
* state can never disagree — there is deliberately no second boolean.
|
|
50
|
+
*/
|
|
51
|
+
exports.HEAD = 36;
|
|
52
|
+
/** The smallest body worth showing: a dock is never dragged into a sliver. */
|
|
53
|
+
exports.BODY = 96;
|
|
54
|
+
exports.MIN_OPEN = exports.HEAD + exports.BODY;
|
|
55
|
+
/** Where a first open lands before anything was dragged. */
|
|
56
|
+
exports.OPEN = 260;
|
|
57
|
+
/** Arrow-key increment; Shift moves four. */
|
|
58
|
+
exports.STEP = 24;
|
|
59
|
+
/** Dragged below this, the dock closes instead of leaving a sliver. */
|
|
60
|
+
exports.SHUT = exports.MIN_OPEN - exports.STEP;
|
|
61
|
+
/** The dock never eats the workspace: at most 70% of the viewport. */
|
|
62
|
+
const ceiling = (viewport) => Math.max(exports.MIN_OPEN, Math.round(viewport * 0.7));
|
|
63
|
+
exports.ceiling = ceiling;
|
|
64
|
+
/** An OPEN height clamped into range. */
|
|
65
|
+
function clamp(raw, viewport) {
|
|
66
|
+
if (!Number.isFinite(raw))
|
|
67
|
+
return exports.MIN_OPEN;
|
|
68
|
+
return Math.min(Math.max(raw, exports.MIN_OPEN), (0, exports.ceiling)(viewport));
|
|
69
|
+
}
|
|
70
|
+
/** Every gesture funnels through here: at or below `SHUT` is closed, anything else a clamped open height. */
|
|
71
|
+
const resolve = (raw, viewport) => (raw <= exports.SHUT ? exports.HEAD : clamp(raw, viewport));
|
|
72
|
+
exports.resolve = resolve;
|
|
73
|
+
/** Whether a height is an open dock. */
|
|
74
|
+
const opened = (height) => height > exports.HEAD;
|
|
75
|
+
exports.opened = opened;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* log — the console dock's lines and its one dimension.
|
|
3
|
+
*
|
|
4
|
+
* Ported from build-v2 `components/editor/console/{log,dock}.ts` (MIT, derived
|
|
5
|
+
* from OSW Studio and DeepSite — see NOTICE). v2 kept the buffer at module
|
|
6
|
+
* scope inside the app; here the buffer is the HOST's (a run's events, a
|
|
7
|
+
* page's forwarded console) and this module keeps only the decisions every
|
|
8
|
+
* host would otherwise make differently: how a block of output becomes lines,
|
|
9
|
+
* how many are kept, and what a drag or a key does to the dock's height.
|
|
10
|
+
*
|
|
11
|
+
* Pure and importless.
|
|
12
|
+
*/
|
|
13
|
+
export type Level = 'log' | 'info' | 'warn' | 'error' | 'debug';
|
|
14
|
+
/** One console line. `source` says who spoke — the page, the run, you. */
|
|
15
|
+
export interface Line {
|
|
16
|
+
id: string | number;
|
|
17
|
+
level: Level;
|
|
18
|
+
text: string;
|
|
19
|
+
source?: string;
|
|
20
|
+
}
|
|
21
|
+
/** A level from the wire, or `log` for anything unrecognised. */
|
|
22
|
+
export declare const level: (raw: unknown) => Level;
|
|
23
|
+
/**
|
|
24
|
+
* A block of output as one line per line, trailing blank lines dropped. A
|
|
25
|
+
* build's output arrives as a paragraph; a console shows it as the lines it is,
|
|
26
|
+
* so each can be read, copied and counted.
|
|
27
|
+
*/
|
|
28
|
+
export declare function split(text: string): string[];
|
|
29
|
+
/** Enough to read a build, bounded so a runaway loop cannot eat memory. */
|
|
30
|
+
export declare const LIMIT = 500;
|
|
31
|
+
/** The newest `limit` lines. */
|
|
32
|
+
export declare const cap: <T>(lines: T[], limit?: number) => T[];
|
|
33
|
+
/** How many lines of each level — what a collapsed dock's badge says. */
|
|
34
|
+
export declare function count(lines: Line[]): Record<Level, number>;
|
|
35
|
+
/**
|
|
36
|
+
* The dock's ONE dimension: its height in px. An open dock IS a dock taller
|
|
37
|
+
* than its header (`open = height > HEAD`), so a dragged size and a toggled
|
|
38
|
+
* state can never disagree — there is deliberately no second boolean.
|
|
39
|
+
*/
|
|
40
|
+
export declare const HEAD = 36;
|
|
41
|
+
/** The smallest body worth showing: a dock is never dragged into a sliver. */
|
|
42
|
+
export declare const BODY = 96;
|
|
43
|
+
export declare const MIN_OPEN: number;
|
|
44
|
+
/** Where a first open lands before anything was dragged. */
|
|
45
|
+
export declare const OPEN = 260;
|
|
46
|
+
/** Arrow-key increment; Shift moves four. */
|
|
47
|
+
export declare const STEP = 24;
|
|
48
|
+
/** Dragged below this, the dock closes instead of leaving a sliver. */
|
|
49
|
+
export declare const SHUT: number;
|
|
50
|
+
/** The dock never eats the workspace: at most 70% of the viewport. */
|
|
51
|
+
export declare const ceiling: (viewport: number) => number;
|
|
52
|
+
/** An OPEN height clamped into range. */
|
|
53
|
+
export declare function clamp(raw: number, viewport: number): number;
|
|
54
|
+
/** Every gesture funnels through here: at or below `SHUT` is closed, anything else a clamped open height. */
|
|
55
|
+
export declare const resolve: (raw: number, viewport: number) => number;
|
|
56
|
+
/** Whether a height is an open dock. */
|
|
57
|
+
export declare const opened: (height: number) => boolean;
|
|
58
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/agents/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAE/D,0EAA0E;AAC1E,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID,iEAAiE;AACjE,eAAO,MAAM,KAAK,QAAS,OAAO,KAAG,KAC4D,CAAA;AAEjG;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI5C;AAED,2EAA2E;AAC3E,eAAO,MAAM,KAAK,MAAM,CAAA;AAExB,gCAAgC;AAChC,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,CAAC,EAAE,qBAAkB,CAAC,EACc,CAAA;AAElE,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAI1D;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,KAAK,CAAA;AACtB,8EAA8E;AAC9E,eAAO,MAAM,IAAI,KAAK,CAAA;AACtB,eAAO,MAAM,QAAQ,QAAc,CAAA;AACnC,4DAA4D;AAC5D,eAAO,MAAM,IAAI,MAAM,CAAA;AACvB,6CAA6C;AAC7C,eAAO,MAAM,IAAI,KAAK,CAAA;AACtB,uEAAuE;AACvE,eAAO,MAAM,IAAI,QAAkB,CAAA;AAEnC,sEAAsE;AACtE,eAAO,MAAM,OAAO,aAAc,MAAM,KAAG,MAAwD,CAAA;AAEnG,yCAAyC;AACzC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,6GAA6G;AAC7G,eAAO,MAAM,OAAO,QAAS,MAAM,YAAY,MAAM,KAAG,MAAqD,CAAA;AAE7G,wCAAwC;AACxC,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,OAAwB,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* log — the console dock's lines and its one dimension.
|
|
3
|
+
*
|
|
4
|
+
* Ported from build-v2 `components/editor/console/{log,dock}.ts` (MIT, derived
|
|
5
|
+
* from OSW Studio and DeepSite — see NOTICE). v2 kept the buffer at module
|
|
6
|
+
* scope inside the app; here the buffer is the HOST's (a run's events, a
|
|
7
|
+
* page's forwarded console) and this module keeps only the decisions every
|
|
8
|
+
* host would otherwise make differently: how a block of output becomes lines,
|
|
9
|
+
* how many are kept, and what a drag or a key does to the dock's height.
|
|
10
|
+
*
|
|
11
|
+
* Pure and importless.
|
|
12
|
+
*/
|
|
13
|
+
const LEVELS = ['log', 'info', 'warn', 'error', 'debug'];
|
|
14
|
+
/** A level from the wire, or `log` for anything unrecognised. */
|
|
15
|
+
export const level = (raw) => typeof raw === 'string' && LEVELS.includes(raw) ? raw : 'log';
|
|
16
|
+
/**
|
|
17
|
+
* A block of output as one line per line, trailing blank lines dropped. A
|
|
18
|
+
* build's output arrives as a paragraph; a console shows it as the lines it is,
|
|
19
|
+
* so each can be read, copied and counted.
|
|
20
|
+
*/
|
|
21
|
+
export function split(text) {
|
|
22
|
+
const lines = text.replace(/\r\n?/g, '\n').split('\n');
|
|
23
|
+
while (lines.length > 0 && lines[lines.length - 1].trim() === '')
|
|
24
|
+
lines.pop();
|
|
25
|
+
return lines;
|
|
26
|
+
}
|
|
27
|
+
/** Enough to read a build, bounded so a runaway loop cannot eat memory. */
|
|
28
|
+
export const LIMIT = 500;
|
|
29
|
+
/** The newest `limit` lines. */
|
|
30
|
+
export const cap = (lines, limit = LIMIT) => lines.length > limit ? lines.slice(lines.length - limit) : lines;
|
|
31
|
+
/** How many lines of each level — what a collapsed dock's badge says. */
|
|
32
|
+
export function count(lines) {
|
|
33
|
+
const out = { log: 0, info: 0, warn: 0, error: 0, debug: 0 };
|
|
34
|
+
for (const l of lines)
|
|
35
|
+
out[l.level] += 1;
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The dock's ONE dimension: its height in px. An open dock IS a dock taller
|
|
40
|
+
* than its header (`open = height > HEAD`), so a dragged size and a toggled
|
|
41
|
+
* state can never disagree — there is deliberately no second boolean.
|
|
42
|
+
*/
|
|
43
|
+
export const HEAD = 36;
|
|
44
|
+
/** The smallest body worth showing: a dock is never dragged into a sliver. */
|
|
45
|
+
export const BODY = 96;
|
|
46
|
+
export const MIN_OPEN = HEAD + BODY;
|
|
47
|
+
/** Where a first open lands before anything was dragged. */
|
|
48
|
+
export const OPEN = 260;
|
|
49
|
+
/** Arrow-key increment; Shift moves four. */
|
|
50
|
+
export const STEP = 24;
|
|
51
|
+
/** Dragged below this, the dock closes instead of leaving a sliver. */
|
|
52
|
+
export const SHUT = MIN_OPEN - STEP;
|
|
53
|
+
/** The dock never eats the workspace: at most 70% of the viewport. */
|
|
54
|
+
export const ceiling = (viewport) => Math.max(MIN_OPEN, Math.round(viewport * 0.7));
|
|
55
|
+
/** An OPEN height clamped into range. */
|
|
56
|
+
export function clamp(raw, viewport) {
|
|
57
|
+
if (!Number.isFinite(raw))
|
|
58
|
+
return MIN_OPEN;
|
|
59
|
+
return Math.min(Math.max(raw, MIN_OPEN), ceiling(viewport));
|
|
60
|
+
}
|
|
61
|
+
/** Every gesture funnels through here: at or below `SHUT` is closed, anything else a clamped open height. */
|
|
62
|
+
export const resolve = (raw, viewport) => (raw <= SHUT ? HEAD : clamp(raw, viewport));
|
|
63
|
+
/** Whether a height is an open dock. */
|
|
64
|
+
export const opened = (height) => height > HEAD;
|
|
65
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/agents/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,MAAM,MAAM,GAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAE1E,iEAAiE;AACjE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAS,EAAE,CAC3C,OAAO,GAAG,KAAK,QAAQ,IAAK,MAA4B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAa,CAAC,CAAC,CAAC,KAAK,CAAA;AAEjG;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,OA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