loopengine 0.3.97 → 0.3.98
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/web/console-shell.js +87 -21
- package/dist/web/dev-ui-styles.js +40 -26
- package/package.json +1 -1
|
@@ -36,26 +36,53 @@ const AGENTS_ICON = '<svg class="le-nav-icon" viewBox="3 3 18 18" fill="currentC
|
|
|
36
36
|
const WORKFLOWS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/><path d="M10 6.5h4a3.5 3.5 0 0 1 3.5 3.5v4"/><path d="M14 17.5h-4A3.5 3.5 0 0 1 6.5 14v-4"/></svg>';
|
|
37
37
|
// An inbox tray, for the Inbox.
|
|
38
38
|
const INBOX_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>';
|
|
39
|
+
// A gear, for Settings.
|
|
40
|
+
const SETTINGS_ICON = '<svg class="le-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';
|
|
41
|
+
// Two columns: the sections (Inbox, Goals, Jobs, Agents, Workflows,
|
|
42
|
+
// Settings), and beside them what's in the current one. Pointing at
|
|
43
|
+
// another section shows its column instead, until the pointer leaves.
|
|
44
|
+
// Inbox and Home have no second column; pointing at a section there
|
|
45
|
+
// opens its column over the page.
|
|
39
46
|
export const consoleSidebarHtml = `<aside class="le-sidebar" aria-label="Console navigation">
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div class="le-nav-label"><a class="le-nav-head" href="/jobs" data-le-nav-head="jobs">${JOBS_ICON}Jobs</a><a href="/jobs?new=1" data-le-job-new>+ New</a></div>
|
|
50
|
-
<ul class="le-agent-list le-goal-list" id="leJobList"></ul>
|
|
51
|
-
<a class="le-find" href="/interview" data-le-nav="interview">Find your first agent</a>
|
|
52
|
-
<nav class="le-foot" aria-label="Settings">
|
|
53
|
-
<a href="/config?section=models" data-le-nav="models">Models</a>
|
|
54
|
-
<a href="/config?section=apps" data-le-nav="apps">Apps</a>
|
|
55
|
-
<a href="/config?section=abilities" data-le-nav="abilities">Abilities</a>
|
|
56
|
-
<a href="/config?section=settings" data-le-nav="settings">Settings</a>
|
|
47
|
+
<nav class="le-rail" aria-label="Sections">
|
|
48
|
+
<a class="le-brand" href="/" title="Home"><span class="le-brand-mark">${BRAND_MARK}</span></a>
|
|
49
|
+
<a class="le-rail-item" href="/inbox" data-le-nav-head="inbox" data-le-section="inbox">${INBOX_ICON}<span>Inbox</span><span class="le-pill warn le-inbox-count" id="leInboxCount" hidden></span></a>
|
|
50
|
+
<a class="le-rail-item" href="/goals" data-le-nav-head="goals" data-le-section="goals">${GOALS_ICON}<span>Goals</span></a>
|
|
51
|
+
<a class="le-rail-item" href="/jobs" data-le-nav-head="jobs" data-le-section="jobs">${JOBS_ICON}<span>Jobs</span></a>
|
|
52
|
+
<a class="le-rail-item" href="/agents" data-le-nav-head="agents" data-le-section="agents">${AGENTS_ICON}<span>Agents</span></a>
|
|
53
|
+
<a class="le-rail-item" href="/workflows" data-le-nav-head="workflows" data-le-section="workflows">${WORKFLOWS_ICON}<span>Workflows</span></a>
|
|
54
|
+
<span class="le-rail-gap"></span>
|
|
55
|
+
<a class="le-rail-item" href="/config?section=settings" data-le-nav-head="settings" data-le-section="settings">${SETTINGS_ICON}<span>Settings</span></a>
|
|
57
56
|
<div class="le-who" id="leWho" hidden></div>
|
|
58
57
|
</nav>
|
|
58
|
+
<div class="le-panel" hidden>
|
|
59
|
+
<section class="le-pane" data-le-pane="goals">
|
|
60
|
+
<div class="le-pane-head"><a href="/goals">Goals</a><a class="le-pane-new" href="/goals?new=1" data-le-goal-new>+ New</a></div>
|
|
61
|
+
<ul class="le-agent-list le-goal-list" id="leGoalList"></ul>
|
|
62
|
+
</section>
|
|
63
|
+
<section class="le-pane" data-le-pane="jobs">
|
|
64
|
+
<div class="le-pane-head"><a href="/jobs">Jobs</a><a class="le-pane-new" href="/jobs?new=1" data-le-job-new>+ New</a></div>
|
|
65
|
+
<ul class="le-agent-list le-goal-list" id="leJobList"></ul>
|
|
66
|
+
</section>
|
|
67
|
+
<section class="le-pane" data-le-pane="agents">
|
|
68
|
+
<div class="le-pane-head"><a href="/agents">Agents</a><a class="le-pane-new" href="/agents?new=1">+ New</a></div>
|
|
69
|
+
<ul class="le-agent-list" id="leAgentList"></ul>
|
|
70
|
+
<a class="le-sub-link" href="/interview" data-le-nav="interview">Find your first agent</a>
|
|
71
|
+
</section>
|
|
72
|
+
<section class="le-pane" data-le-pane="workflows">
|
|
73
|
+
<div class="le-pane-head"><a href="/workflows">Workflows</a><a class="le-pane-new" href="/workflows/new">+ New</a></div>
|
|
74
|
+
<ul class="le-agent-list le-goal-list" id="leWorkflowList"></ul>
|
|
75
|
+
</section>
|
|
76
|
+
<section class="le-pane" data-le-pane="settings">
|
|
77
|
+
<div class="le-pane-head"><a href="/config?section=settings">Settings</a></div>
|
|
78
|
+
<nav class="le-settings-menu" aria-label="Settings">
|
|
79
|
+
<a href="/config?section=models" data-le-nav="models">Models</a>
|
|
80
|
+
<a href="/config?section=apps" data-le-nav="apps">Apps</a>
|
|
81
|
+
<a href="/config?section=abilities" data-le-nav="abilities">Abilities</a>
|
|
82
|
+
<a href="/config?section=settings" data-le-nav="settings">General settings</a>
|
|
83
|
+
</nav>
|
|
84
|
+
</section>
|
|
85
|
+
</div>
|
|
59
86
|
</aside>`;
|
|
60
87
|
export const consoleShellScript = `<script>
|
|
61
88
|
(function () {
|
|
@@ -364,26 +391,65 @@ export const consoleShellScript = `<script>
|
|
|
364
391
|
|
|
365
392
|
var section = params.get('section');
|
|
366
393
|
var foot = page === 'config' ? (section === 'abilities' || section === 'gateways' ? 'abilities' : section === 'apps' ? 'apps' : section === 'settings' ? 'settings' : 'models') : page === 'interview' || page === 'workflows' ? page : '';
|
|
394
|
+
// The section this page is in, whose column shows beside the sections.
|
|
395
|
+
var sidebar = document.querySelector('.le-sidebar');
|
|
396
|
+
var panel = document.querySelector('.le-panel');
|
|
397
|
+
var section0 = page === 'goals' ? (location.pathname === '/jobs' ? 'jobs' : 'goals')
|
|
398
|
+
: page === 'agent-config' && params.get('tab') === 'workflows' && params.get('workflow') ? 'workflows'
|
|
399
|
+
: page === 'agents' || page === 'agent-config' || page === 'chat' || page === 'interview' ? 'agents'
|
|
400
|
+
: page === 'workflows' || page === 'workflows-overview' ? 'workflows'
|
|
401
|
+
: page === 'config' ? 'settings'
|
|
402
|
+
: page === 'inbox' ? 'inbox' : '';
|
|
403
|
+
var railItems = document.querySelectorAll('[data-le-section]');
|
|
404
|
+
for (var ri = 0; ri < railItems.length; ri++) {
|
|
405
|
+
if (railItems[ri].getAttribute('data-le-section') === section0) railItems[ri].classList.add('is-current');
|
|
406
|
+
}
|
|
407
|
+
function showPane(name, preview) {
|
|
408
|
+
if (!panel || markedInboxOnly) return;
|
|
409
|
+
var pane = name ? document.querySelector('[data-le-pane="' + name + '"]') : null;
|
|
410
|
+
if (!pane && preview) return;
|
|
411
|
+
var panes = document.querySelectorAll('[data-le-pane]');
|
|
412
|
+
for (var pi = 0; pi < panes.length; pi++) panes[pi].classList.toggle('is-shown', panes[pi] === pane);
|
|
413
|
+
panel.hidden = !pane;
|
|
414
|
+
// With no column of its own, the page gets one over it while pointing.
|
|
415
|
+
sidebar.classList.toggle('previewing', Boolean(pane) && name !== section0 && !document.querySelector('[data-le-pane="' + section0 + '"]'));
|
|
416
|
+
}
|
|
417
|
+
showPane(section0, false);
|
|
418
|
+
if (sidebar) {
|
|
419
|
+
for (var rj = 0; rj < railItems.length; rj++) {
|
|
420
|
+
railItems[rj].addEventListener('mouseenter', function (ev) { showPane(ev.currentTarget.getAttribute('data-le-section'), true); });
|
|
421
|
+
railItems[rj].addEventListener('focus', function (ev) { showPane(ev.currentTarget.getAttribute('data-le-section'), true); });
|
|
422
|
+
}
|
|
423
|
+
sidebar.addEventListener('mouseleave', function () { showPane(section0, false); });
|
|
424
|
+
}
|
|
425
|
+
var settingsHead = document.querySelector('[data-le-nav-head="settings"]');
|
|
426
|
+
if (settingsHead && page === 'config') settingsHead.setAttribute('aria-current', 'page');
|
|
367
427
|
var footLinks = document.querySelectorAll('[data-le-nav]');
|
|
368
428
|
for (var i = 0; i < footLinks.length; i++) {
|
|
369
429
|
if (footLinks[i].getAttribute('data-le-nav') === foot) footLinks[i].setAttribute('aria-current', 'page');
|
|
370
430
|
}
|
|
371
431
|
|
|
372
|
-
// Who is signed in
|
|
373
|
-
//
|
|
432
|
+
// Who is signed in, at the foot of the sections: a round badge with
|
|
433
|
+
// their initial, and on pointing, the email and a link back to the
|
|
434
|
+
// dashboard when a hosting router signs requests, otherwise how this
|
|
435
|
+
// server is protected.
|
|
374
436
|
var who = document.getElementById('leWho');
|
|
375
437
|
if (who) {
|
|
376
438
|
settings
|
|
377
439
|
.then(function (s) {
|
|
378
440
|
if (!s || !s.signIn) return;
|
|
379
441
|
var si = s.signIn;
|
|
442
|
+
var card, initial;
|
|
380
443
|
if (si.mode === 'hosted') {
|
|
381
444
|
var roleName = si.role && si.role !== 'owner' ? si.role.charAt(0).toUpperCase() + si.role.slice(1) : '';
|
|
382
|
-
|
|
445
|
+
initial = (si.email || '?').charAt(0).toUpperCase();
|
|
446
|
+
card = '<span class="le-who-name">' + esc(si.email || 'Signed in') + (roleName ? ' (' + esc(roleName) + ')' : '') + '</span>' +
|
|
383
447
|
(si.dashboardUrl ? '<a href="' + esc(si.dashboardUrl) + '">Dashboard</a>' : '');
|
|
384
448
|
} else {
|
|
385
|
-
|
|
449
|
+
initial = '?';
|
|
450
|
+
card = '<span class="le-who-name">' + (si.mode === 'basic' ? 'Signed in with Basic Auth' : 'No sign-in configured') + '</span>';
|
|
386
451
|
}
|
|
452
|
+
who.innerHTML = '<button type="button" class="le-who-badge" aria-label="Account">' + esc(initial) + '</button><span class="le-who-card">' + card + '</span>';
|
|
387
453
|
who.hidden = false;
|
|
388
454
|
})
|
|
389
455
|
.catch(function () {});
|
|
@@ -123,27 +123,38 @@ export const devUiCss = `
|
|
|
123
123
|
.le-pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
|
|
124
124
|
|
|
125
125
|
/* ---------- app shell (web/console-shell.ts) ---------- */
|
|
126
|
-
.le-app { display: grid; grid-template-columns:
|
|
127
|
-
|
|
128
|
-
.le-
|
|
129
|
-
.le-
|
|
130
|
-
.le-brand
|
|
131
|
-
.le-
|
|
132
|
-
.le-
|
|
133
|
-
.le-
|
|
134
|
-
.le-
|
|
135
|
-
.le-
|
|
126
|
+
.le-app { display: grid; grid-template-columns: auto minmax(0, 1fr); height: 100%; }
|
|
127
|
+
/* Two columns: the sections, and what's in the current one. */
|
|
128
|
+
.le-sidebar { position: relative; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; min-height: 0; }
|
|
129
|
+
.le-rail { width: 76px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 6px 10px; min-height: 0; }
|
|
130
|
+
.le-brand { display: grid; place-items: center; height: 36px; margin-bottom: 8px; text-decoration: none; }
|
|
131
|
+
.le-brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
|
|
132
|
+
.le-rail-item { position: relative; display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 8px; color: var(--ink-muted); text-decoration: none; font-size: 11px; font-weight: 600; }
|
|
133
|
+
.le-rail-item .le-nav-icon { width: 19px; height: 19px; }
|
|
134
|
+
.le-rail-item:hover { background: var(--surface-2); color: var(--ink); }
|
|
135
|
+
.le-rail-item.is-current { background: var(--accent-soft); color: var(--accent-ink); }
|
|
136
|
+
.le-rail-item .le-inbox-count { position: absolute; top: 3px; right: 6px; margin: 0; padding: 0 6px; font-size: 10.5px; }
|
|
137
|
+
.le-inbox-count[hidden] { display: none; }
|
|
138
|
+
.le-rail-gap { flex: 1; }
|
|
136
139
|
.le-nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
|
|
137
|
-
.le-
|
|
138
|
-
.le-
|
|
139
|
-
.le-
|
|
140
|
+
.le-panel { width: 228px; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); padding-top: 14px; }
|
|
141
|
+
.le-panel[hidden] { display: none; }
|
|
142
|
+
.le-sidebar.previewing .le-panel { position: absolute; left: 100%; top: 0; bottom: 0; z-index: 30; background: var(--sidebar); border: 1px solid var(--line); border-width: 0 1px 0 0; box-shadow: 8px 0 24px rgba(0, 0, 0, .12); }
|
|
143
|
+
.le-pane { display: none; flex-direction: column; min-height: 0; flex: 1; }
|
|
144
|
+
.le-pane.is-shown { display: flex; }
|
|
145
|
+
.le-pane-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px 10px; }
|
|
146
|
+
.le-pane-head a { color: var(--ink); font-size: 15px; font-weight: 650; text-decoration: none; }
|
|
147
|
+
.le-pane-head a:hover { text-decoration: underline; }
|
|
148
|
+
.le-pane-head a.le-pane-new { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
|
|
149
|
+
.le-pane-head a.le-pane-new[aria-current="page"] { text-decoration: underline; }
|
|
150
|
+
.le-pane .le-agent-list { max-height: none; }
|
|
140
151
|
.le-name.le-slug { font-family: var(--font-mono); font-size: 12.5px; }
|
|
141
152
|
.le-goal-item .le-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
|
|
142
153
|
.le-agent-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 0 1 auto; max-height: 40vh; min-height: 0; }
|
|
143
|
-
/*
|
|
144
|
-
.le-
|
|
145
|
-
.le-
|
|
146
|
-
.le-
|
|
154
|
+
/* Find your first agent: one more item under Agents. */
|
|
155
|
+
.le-sub-link { margin: 2px 8px 0; padding: 5px 8px 5px 26px; flex: none; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--accent-ink); text-decoration: none; }
|
|
156
|
+
.le-sub-link:hover { background: var(--surface-2); }
|
|
157
|
+
.le-sub-link[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
|
|
147
158
|
/* List items read smaller than their section's head. */
|
|
148
159
|
.le-agent-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
|
|
149
160
|
.le-agent-item:hover { background: var(--surface-2); }
|
|
@@ -155,17 +166,19 @@ export const devUiCss = `
|
|
|
155
166
|
.le-dot.tint { background: var(--accent); }
|
|
156
167
|
.le-dot.pending { background: #E8B06A; }
|
|
157
168
|
.le-inbox-count { margin-left: auto; font-size: 11px; padding: 0 7px; }
|
|
158
|
-
.le-inbox-only .le-
|
|
169
|
+
.le-inbox-only .le-rail-item:not([data-le-section="inbox"]), .le-inbox-only .le-panel { display: none; }
|
|
159
170
|
.le-dot.idle { background: var(--ink-faint); }
|
|
160
|
-
.le-
|
|
161
|
-
.le-
|
|
162
|
-
.le-
|
|
163
|
-
.le-
|
|
164
|
-
.le-who {
|
|
171
|
+
.le-settings-menu { display: grid; gap: 2px; padding: 0 8px; }
|
|
172
|
+
.le-settings-menu a { padding: 6px 10px; border-radius: 6px; color: var(--ink-muted); text-decoration: none; font-size: 13px; }
|
|
173
|
+
.le-settings-menu a:hover { background: var(--surface-2); color: var(--ink); }
|
|
174
|
+
.le-settings-menu a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
|
|
175
|
+
.le-who { position: relative; display: grid; place-items: center; padding-top: 8px; }
|
|
165
176
|
.le-who[hidden] { display: none; }
|
|
177
|
+
.le-who-badge { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: default; }
|
|
178
|
+
.le-who-card { position: absolute; left: calc(100% - 4px); bottom: 0; z-index: 40; display: none; gap: 6px; min-width: 200px; max-width: 280px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); font-size: 12.5px; color: var(--ink-muted); }
|
|
179
|
+
.le-who:hover .le-who-card, .le-who:focus-within .le-who-card { display: grid; }
|
|
166
180
|
.le-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
167
|
-
.le-
|
|
168
|
-
.le-foot .le-who a:hover { background: none; text-decoration: underline; }
|
|
181
|
+
.le-who-card a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
|
|
169
182
|
.le-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
|
|
170
183
|
.le-scroll { flex: 1; min-height: 0; overflow-y: auto; }
|
|
171
184
|
.le-page { padding: 24px; max-width: 1100px; display: grid; gap: 24px; }
|
|
@@ -197,8 +210,9 @@ export const devUiCss = `
|
|
|
197
210
|
.le-empty { color: var(--ink-faint); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
|
|
198
211
|
@media (max-width: 860px) {
|
|
199
212
|
.le-app { grid-template-columns: minmax(0, 1fr); }
|
|
200
|
-
.le-sidebar { position: fixed; inset: 0 auto 0 0;
|
|
213
|
+
.le-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
|
|
201
214
|
.le-app.nav-open .le-sidebar { transform: none; }
|
|
215
|
+
.le-panel { width: 204px; }
|
|
202
216
|
.le-menu-btn { display: block; }
|
|
203
217
|
.le-head, .le-page { padding-left: 16px; padding-right: 16px; }
|
|
204
218
|
}
|