loopengine 0.5.9 → 0.5.11

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.
@@ -22,43 +22,42 @@ export const inboxPageHtml = `<!doctype html>
22
22
  <title>Inbox</title>
23
23
  <style>${devUiCss}
24
24
  .ib { max-width: 980px; display: grid; gap: 16px; }
25
- .ib-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
26
- .ib-bar select, .ib-bar input { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
27
- .ib-bar input { flex: 1; min-width: 160px; }
28
- .ib-state { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
25
+ .ib-state { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--ink-muted); white-space: nowrap; }
29
26
  .ib-state.warn { background: var(--warn-soft); color: var(--warn); }
30
27
  .ib-state.good { background: var(--good-soft); color: var(--good); }
31
28
  .ib-state.bad { background: var(--bad-soft); color: var(--bad); }
32
29
  .ib-state.run { background: var(--accent-soft); color: var(--accent-ink); }
33
30
  body[data-le-page="inbox"] .le-page { max-width: 1320px; }
34
31
  .ib.is-inbox { max-width: none; }
35
- .ib-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
36
- .ib-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; height: auto; padding: 8px 12px; margin-bottom: -1px; font-size: 13.5px; font-weight: 600; color: var(--ink-muted); }
37
- .ib-tabs button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
38
- .ib-tabs .ib-count { margin-left: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
32
+ .ib-topbar { flex-wrap: wrap; row-gap: 8px; }
33
+ .ib-tabs { flex-wrap: wrap; }
34
+ .ib-tabs .ib-count { margin-left: 6px; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-muted); }
35
+ .ib-select { height: 36px; padding: 0 10px; border-radius: 10px; border: 0; background: var(--surface); font-size: 13px; color: var(--ink); max-width: 220px; }
39
36
  .ib-tabs button[data-view="needs"] .ib-count.on { background: var(--warn-soft); color: var(--warn); }
40
- .ib-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
41
- .ib-items { display: grid; gap: 8px; align-content: start; max-height: calc(100vh - 230px); overflow: auto; padding: 2px; }
42
- .ib-item { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; }
43
- .ib-item:hover { border-color: var(--ink-faint); }
44
- .ib-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
45
- .ib-item.is-needs { border-left: 3px solid var(--warn); }
46
- .ib-item-title { font-weight: 700; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
37
+ /* The list and the open conversation side by side, in one hairline grid. */
38
+ .ib-split { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: stretch; }
39
+ .ib-items { display: grid; align-content: start; max-height: calc(100vh - 150px); overflow: auto; background: var(--bg); }
40
+ .ib-item { position: relative; display: grid; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; transition: background .15s; }
41
+ .ib-item:hover { background: var(--surface); }
42
+ .ib-item.is-selected { background: var(--surface); }
43
+ .ib-item.is-selected::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
44
+ .ib-item.is-needs .ib-item-title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--warn); vertical-align: 1px; }
45
+ .ib-item-title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
47
46
  .ib-item-meta { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
48
47
  .ib-item .ib-state { justify-self: start; }
49
48
  .ib-item-summary { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
50
49
  .ib-item-time { font-size: 12px; color: var(--ink-faint); }
51
50
  .ib-item-time.late { color: var(--warn); font-weight: 700; }
52
- .ib-thread { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100vh - 230px); }
51
+ .ib-thread { background: var(--bg); min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100vh - 150px); }
53
52
  .ib-thread-empty { padding: 48px 24px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
54
- .ib-thread-head { display: grid; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
55
- .ib-thread-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
53
+ .ib-thread-head { display: grid; gap: 8px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
54
+ .ib-thread-head h2 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; overflow-wrap: anywhere; }
56
55
  .ib-thread-top { display: flex; align-items: flex-start; gap: 10px; }
57
56
  .ib-thread-top h2 { flex: 1; min-width: 0; }
58
57
  .ib-thread-tools { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
59
- .ib-thread-tools a, .ib-thread-tools button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
58
+ .ib-thread-tools a, .ib-thread-tools button { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
60
59
  .ib-thread-tools .ib-thread-back { display: none; }
61
- .ib-msgs { list-style: none; margin: 0; padding: 16px 18px 20px; display: grid; gap: 12px; overflow: auto; align-content: start; }
60
+ .ib-msgs { list-style: none; margin: 0; padding: 18px 22px 22px; display: grid; gap: 12px; overflow: auto; align-content: start; }
62
61
  .ib-msg { display: grid; gap: 4px; max-width: 86%; min-width: 0; }
63
62
  .ib-msg.person { justify-self: end; justify-items: end; }
64
63
  .ib-msg.system { justify-self: center; justify-items: center; max-width: 100%; }
@@ -98,8 +97,10 @@ export const inboxPageHtml = `<!doctype html>
98
97
  .ib-split:not(.has-thread) .ib-thread { display: none; }
99
98
  .ib-thread-tools .ib-thread-back { display: inline-flex; }
100
99
  .ib-items, .ib-thread { max-height: none; }
100
+ .ib-split { grid-template-columns: minmax(0, 1fr); }
101
+ .le-search { min-width: 0; flex: 1; }
101
102
  }
102
- .ib-empty { padding: 28px 16px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
103
+ .ib-empty { margin: 0; padding: 36px 20px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
103
104
  .ib-link { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
104
105
  .ib-link:hover { text-decoration: underline; }
105
106
  .ib-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-muted); }
@@ -114,7 +115,7 @@ export const inboxPageHtml = `<!doctype html>
114
115
  .ib-card textarea { width: 100%; box-sizing: border-box; min-height: 80px; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); resize: vertical; }
115
116
  .ib-card textarea.mono { font-family: var(--font-mono); font-size: 12.5px; min-height: 200px; }
116
117
  .ib-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
117
- .ib-btn { height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); cursor: pointer; }
118
+ .ib-btn { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); cursor: pointer; }
118
119
  .ib-btn.plain { background: none; border-color: var(--line); color: var(--ink); font-weight: 500; }
119
120
  .ib-btn.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
120
121
  .ib-btn.opt { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 500; }
@@ -146,13 +147,14 @@ export const inboxPageHtml = `<!doctype html>
146
147
  <div class="le-app">
147
148
  ${consoleSidebarHtml}
148
149
  <main class="le-main">
149
- <div class="le-head plain">
150
- <div class="le-head-row">
151
- <div class="le-title"><button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
152
- <div><h1>Inbox</h1><p>Your conversations with your agents' workflow runs: what each asks you, what it did, and how it ended.</p></div>
153
- </div>
154
- </div>
155
- </div>
150
+ <header class="le-topbar ib-topbar">
151
+ <button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
152
+ <h1 class="le-topbar-title">Inbox</h1>
153
+ <span class="le-seg ib-tabs" role="tablist" aria-label="Show"></span>
154
+ <span class="le-topbar-gap"></span>
155
+ <select id="ibWorkflow" class="ib-select" aria-label="Workflow"><option value="">All workflows</option></select>
156
+ <label class="le-search"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg><input id="ibSearch" type="search" placeholder="Search conversations" aria-label="Search conversations, inputs or people"></label>
157
+ </header>
156
158
  <div class="le-scroll"><div class="le-page"><div class="ib" id="ibPage"><p class="hint">Loading&hellip;</p></div></div></div>
157
159
  </main>
158
160
  </div>
@@ -267,21 +269,17 @@ ${renderMarkdownScript}
267
269
  function renderInbox() {
268
270
  page.classList.add('is-inbox');
269
271
  page.innerHTML =
270
- '<div class="ib-tabs" role="tablist" aria-label="Show"></div>' +
271
- '<div class="ib-bar">' +
272
- '<select id="ibWorkflow" aria-label="Workflow"><option value="">All workflows</option></select>' +
273
- '<input id="ibSearch" type="search" placeholder="Search conversations, inputs or people" value="' + esc(state.q) + '" aria-label="Search">' +
274
- '</div>' +
275
- '<div class="ib-split"><div class="ib-items" role="list"><p class="hint">Loading' + ELLIPSIS + '</p></div>' +
272
+ '<div class="ib-split le-grid"><div class="ib-items" role="list"><p class="hint" style="padding:16px">Loading' + ELLIPSIS + '</p></div>' +
276
273
  '<section class="ib-thread" aria-live="polite"><div class="ib-thread-empty">Pick a conversation to see it here.</div></section></div>';
277
- page.querySelector('.ib-tabs').addEventListener('click', function (ev) {
274
+ document.getElementById('ibSearch').value = state.q;
275
+ document.querySelector('.ib-tabs').addEventListener('click', function (ev) {
278
276
  var b = ev.target.closest('[data-view]');
279
277
  if (!b) return;
280
278
  state.view = b.getAttribute('data-view');
281
279
  refreshList();
282
280
  });
283
- page.querySelector('#ibWorkflow').addEventListener('change', function (ev) { state.workflow = ev.currentTarget.value; refreshList(); });
284
- var search = page.querySelector('#ibSearch');
281
+ document.getElementById('ibWorkflow').addEventListener('change', function (ev) { state.workflow = ev.currentTarget.value; refreshList(); });
282
+ var search = document.getElementById('ibSearch');
285
283
  var timer = null;
286
284
  search.addEventListener('input', function () {
287
285
  clearTimeout(timer);
@@ -301,12 +299,12 @@ ${renderMarkdownScript}
301
299
  (data.workflows || []).forEach(function (w) { workflows[w.id] = w.title; });
302
300
  state.view = data.view || state.view || 'all';
303
301
  var counts = data.counts || {};
304
- page.querySelector('.ib-tabs').innerHTML = VIEWS.map(function (v) {
302
+ document.querySelector('.ib-tabs').innerHTML = VIEWS.map(function (v) {
305
303
  var n = counts[v[0]];
306
304
  return '<button type="button" role="tab" data-view="' + v[0] + '" aria-selected="' + (state.view === v[0]) + '">' + v[1] +
307
305
  (n ? '<span class="ib-count' + (v[0] === 'needs' ? ' on' : '') + '">' + n + '</span>' : '') + '</button>';
308
306
  }).join('');
309
- var select = page.querySelector('#ibWorkflow');
307
+ var select = document.getElementById('ibWorkflow');
310
308
  select.innerHTML = '<option value="">All workflows</option>' + Object.keys(workflows).sort(function (a, b) { return workflows[a].localeCompare(workflows[b]); })
311
309
  .map(function (id) { return '<option value="' + esc(id) + '"' + (id === state.workflow ? ' selected' : '') + '>' + esc(workflows[id]) + '</option>'; }).join('');
312
310
  var box = page.querySelector('.ib-items');
@@ -5,70 +5,90 @@
5
5
  // template placeholders, since it lives inside a template literal.
6
6
  import { devUiCss } from './dev-ui-styles.js';
7
7
  import { consoleShellScript, consoleSidebarHtml } from './console-shell.js';
8
+ import { MASCOT_CSS, mascotSvg } from './mascot.js';
8
9
  export const workflowsOverviewPageHtml = `<!doctype html>
9
10
  <html lang="en">
10
11
  <head>
11
12
  <meta charset="utf-8">
12
13
  <meta name="viewport" content="width=device-width, initial-scale=1">
13
14
  <title>Workflows</title>
14
- <style>${devUiCss}
15
- .wo { max-width: 1040px; display: grid; gap: 20px; }
16
- .wo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
17
- .wo-stat { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 14px 16px; display: grid; gap: 2px; color: var(--ink); text-decoration: none; }
18
- a.wo-stat:hover { border-color: var(--accent); }
19
- .wo-stat b { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
20
- .wo-stat span { font-size: 12.5px; color: var(--ink-muted); }
21
- .wo-stat.warn { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
15
+ <style>${devUiCss}${MASCOT_CSS}
16
+ .wo { max-width: 1120px; display: grid; gap: 0; }
17
+ .wo-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 32px 28px; border: 1px solid var(--line); border-bottom: 0; }
18
+ .wo-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
19
+ .wo-cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
20
+ .wo-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
21
+ .wo-stat { padding: 20px 22px; background: var(--bg); display: grid; gap: 2px; color: var(--ink); text-decoration: none; }
22
+ a.wo-stat:hover { background: var(--surface); }
23
+ .wo-stat b { font-size: 34px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
24
+ .wo-stat span { font-size: 13px; color: var(--ink-muted); }
22
25
  .wo-stat.warn b { color: var(--warn); }
23
- .wo-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
24
- .wo-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
25
- .wo-row:first-child { border-top: 0; }
26
- .wo-row:hover { background: var(--surface); }
27
- .wo-head { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface); }
28
- .wo-head:hover { background: var(--surface); }
29
- .wo-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
30
- .wo-sub { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
31
- .wo-runs { font-size: 13px; display: grid; gap: 2px; }
32
- .wo-side { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
33
- .wo-pill { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; }
34
- .wo-pill.warn { background: var(--warn-soft); color: var(--warn); }
35
- .wo-pill.good { background: var(--good-soft); color: var(--good); }
36
- .wo-pill.bad { background: var(--bad-soft); color: var(--bad); }
37
- .wo-pill.run { background: var(--accent-soft); color: var(--accent-ink); }
38
- .wo-new { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; background: var(--primary); color: var(--on-primary); text-decoration: none; white-space: nowrap; }
39
- .wo-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 28px 24px; display: grid; gap: 14px; }
40
- .wo-empty h2 { margin: 0; font-size: 17px; }
41
- .wo-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
42
- .wo-way { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 4px; color: var(--ink); text-decoration: none; background: var(--bg); }
43
- .wo-way:hover { border-color: var(--accent); }
44
- .wo-way b { font-size: 14px; }
45
- .wo-way span { font-size: 12.5px; color: var(--ink-muted); }
26
+ .wo-stat.bad b { color: var(--bad); }
27
+ .wo-section-title { margin: 0; padding: 30px 32px 16px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
28
+ .wo-card { display: grid; gap: 14px; align-content: start; padding: 20px 22px; background: var(--bg); }
29
+ .wo-card-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
30
+ .wo-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-muted); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
31
+ .wo-icon svg { width: 16px; height: 16px; }
32
+ .wo-icon.live { color: var(--good); }
33
+ .wo-card-text { display: grid; gap: 3px; min-width: 0; }
34
+ .wo-card-title { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
35
+ a.wo-card-title:hover { text-decoration: underline; }
36
+ .wo-card-desc { font-size: 13px; color: var(--ink-muted); }
37
+ .wo-open { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--bg); }
38
+ .wo-open:hover { background: var(--surface); }
39
+ .wo-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
40
+ .wo-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); font-size: 12px; color: var(--ink-muted); white-space: nowrap; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
41
+ .wo-chip.strong { background: var(--surface); border-color: transparent; color: var(--ink); font-weight: 500; }
42
+ .wo-chip.good { background: var(--good-soft); border-color: transparent; color: var(--good); font-weight: 600; }
43
+ .wo-chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
44
+ .wo-chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); font-weight: 600; }
45
+ .wo-chip.run { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
46
+ .wo-chip-k { color: var(--ink-faint); font-weight: 400; margin-right: 6px; }
47
+ a.wo-chip:hover { color: var(--ink); border-color: var(--ink-faint); }
48
+ .wo-next { font-size: 12px; color: var(--ink-faint); margin-left: 4px; white-space: nowrap; }
49
+ .wo-tile { display: grid; gap: 6px; align-content: start; padding: 22px; background: var(--bg); text-decoration: none; color: inherit; transition: background .15s; }
50
+ .wo-tile:hover { background: var(--surface); }
51
+ .wo-tile b { font-size: 15px; font-weight: 600; color: var(--ink); }
52
+ .wo-tile span { font-size: 13px; color: var(--ink-muted); line-height: 1.45; }
53
+ .wo-filler { background: var(--bg); }
54
+ .wo-empty { padding: 40px 32px; text-align: center; color: var(--ink-muted); font-size: 14px; background: var(--bg); grid-column: 1 / -1; margin: 0; }
46
55
  .hint { font-size: 12.5px; color: var(--ink-muted); }
47
56
  .error { font-size: 13px; color: var(--bad); margin: 0; }
48
- @media (max-width: 760px) { .wo-row { grid-template-columns: minmax(0, 1fr) auto; } .wo-row .wo-col-starts, .wo-row .wo-col-runs { display: none; } .wo-head { display: none; } }
57
+ @media (max-width: 860px) {
58
+ .wo-hero { padding: 24px 18px 20px; }
59
+ .wo-hero .le-mascot { display: none; }
60
+ .wo-cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
61
+ .wo-cols2 { grid-template-columns: minmax(0, 1fr); }
62
+ .wo-section-title { padding: 24px 18px 14px; }
63
+ .le-search { display: none; }
64
+ }
49
65
  </style>
50
66
  </head>
51
67
  <body data-le-page="workflows-overview">
52
68
  <div class="le-app">
53
69
  ${consoleSidebarHtml}
54
70
  <main class="le-main">
55
- <div class="le-head plain">
56
- <div class="le-head-row">
57
- <div class="le-title"><button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
58
- <div><h1>Workflows</h1><p>Every workflow your agents run: how each one starts, how it's been going, and what's waiting for you.</p></div>
59
- </div>
60
- <a class="wo-new" href="/workflows/new">New workflow</a>
61
- </div>
62
- </div>
71
+ <header class="le-topbar">
72
+ <button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
73
+ <h1 class="le-topbar-title">Workflows</h1>
74
+ <span class="le-topbar-gap"></span>
75
+ <label class="le-search"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg><input type="search" id="woSearch" placeholder="Search workflows" aria-label="Search workflows"></label>
76
+ <a class="le-btn-dark" href="/workflows/new">+ New workflow</a>
77
+ </header>
63
78
  <div class="le-scroll"><div class="le-page"><div class="wo" id="woPage"><p class="hint">Loading&hellip;</p></div></div></div>
64
79
  </main>
65
80
  </div>
81
+ <template id="woMascot">${mascotSvg(92)}</template>
66
82
  ${consoleShellScript}
67
83
  <script>
68
84
  (function () {
69
85
  var page = document.getElementById('woPage');
86
+ var search = document.getElementById('woSearch');
87
+ var mascot = document.getElementById('woMascot').innerHTML;
70
88
  var DOT = ' ' + String.fromCharCode(183) + ' ';
71
89
  var esc = window.leShell.esc;
90
+ var ICON_FLOW = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="8" height="8" rx="2"/><rect x="13" y="13" width="8" height="8" rx="2"/><path d="M7 11v3a3 3 0 0 0 3 3h3"/></svg>';
91
+ var data = null;
72
92
 
73
93
  function ago(iso) {
74
94
  var s = Math.max(0, (Date.now() - Date.parse(iso)) / 1000);
@@ -77,59 +97,67 @@ ${consoleShellScript}
77
97
  if (s < 86400) return Math.round(s / 3600) + ' h ago';
78
98
  return Math.round(s / 86400) + ' d ago';
79
99
  }
80
- function lastRunPill(w) {
81
- if (w.waiting) return '<span class="wo-pill warn">' + w.waiting + ' waiting</span>';
82
- if (!w.lastRun) return '<span class="wo-pill">Not run yet</span>';
100
+ function lastRunChip(w) {
101
+ if (w.waiting) return '<a class="wo-chip warn" href="/inbox?view=needs">' + w.waiting + ' waiting for you</a>';
102
+ if (!w.lastRun) return '<span class="wo-chip">Not run yet</span>';
83
103
  var st = w.lastRun.status;
84
- if (st === 'running') return '<span class="wo-pill run">Running</span>';
85
- if (st === 'error') return '<span class="wo-pill bad">Last run failed</span>';
86
- if (st === 'awaiting_approval') return '<span class="wo-pill warn">Waiting</span>';
87
- return '<span class="wo-pill good">Done</span>';
104
+ if (st === 'running') return '<span class="wo-chip run">Running now</span>';
105
+ if (st === 'error') return '<span class="wo-chip bad">Last run failed</span>';
106
+ if (st === 'awaiting_approval') return '<span class="wo-chip warn">Waiting</span>';
107
+ return '<span class="wo-chip good">Last run done</span>';
88
108
  }
89
109
  function href(w) {
90
110
  return '/agents/config?agent=' + encodeURIComponent(w.agent) + '&tab=workflows&workflow=' + encodeURIComponent(w.id);
91
111
  }
92
112
  function plural(n, one, many) { return n + ' ' + (n === 1 ? one : many); }
113
+ function hero(sub) {
114
+ return '<div class="wo-hero"><div><h2 class="le-display">Your workflows</h2><p class="le-display-sub">' + sub + '</p></div>' + mascot + '</div>';
115
+ }
116
+ var TILES = '<a class="wo-tile" href="/workflows/new"><b>Describe a workflow</b><span>Say what the agent should do in a sentence or two, and review the plan.</span></a>' +
117
+ '<a class="wo-tile" href="/workflows/new#examples"><b>Start from an example</b><span>A ready-made workflow for a common task.</span></a>';
93
118
 
94
- function renderEmpty() {
95
- page.innerHTML =
96
- '<div class="wo-empty"><h2>No workflows yet</h2>' +
97
- '<p class="hint" style="margin:0">A workflow is how an agent does something again and again: it runs on a schedule, from a webhook or from your app, asks you when it needs to, and every run is kept to check and improve.</p>' +
98
- '<div class="wo-ways">' +
99
- '<a class="wo-way" href="/workflows/new"><b>Describe a workflow</b><span>Say what the agent should do in a sentence or two and review the plan.</span></a>' +
100
- '<a class="wo-way" href="/workflows/new#examples"><b>Start from an example</b><span>A ready-made workflow for a common task.</span></a>' +
101
- '</div></div>';
119
+ function cardHtml(w) {
120
+ var decided = w.approved + w.refused;
121
+ return '<div class="wo-card">' +
122
+ '<div class="wo-card-head"><span class="wo-icon' + (w.live ? ' live' : '') + '">' + ICON_FLOW + '</span>' +
123
+ '<span class="wo-card-text"><a class="wo-card-title" href="' + href(w) + '">' + esc(w.title) + '</a>' +
124
+ '<span class="wo-card-desc">' + plural(w.runsThisWeek, 'run', 'runs') + ' this week' + (w.failedThisWeek ? ', <span style="color:var(--bad)">' + w.failedThisWeek + ' failed</span>' : '') + (decided ? DOT + w.approved + ' of ' + decided + ' approved' : '') + '</span></span>' +
125
+ '<a class="wo-open" href="' + href(w) + '">Open</a></div>' +
126
+ '<div class="wo-chips">' + w.starts.map(function (x, i) { var t = x === 'Run now' ? 'when someone runs it' : x; return '<span class="wo-chip' + (i === 0 ? ' strong' : '') + '" title="' + esc(t) + '">' + (i === 0 ? '<span class="wo-chip-k">Starts</span>' : '') + esc(t) + '</span>'; }).join('') +
127
+ '<a class="wo-chip" href="/agents/config?agent=' + encodeURIComponent(w.agent) + '">' + esc(w.agentLabel) + '</a>' +
128
+ lastRunChip(w) + (w.lastRun ? '<span class="wo-next">Last run ' + esc(ago(w.lastRun.at)) + '</span>' : '') + '</div>' +
129
+ '</div>';
102
130
  }
103
131
 
104
- function render(d) {
105
- if (!d.workflows.length) return renderEmpty();
132
+ function render() {
133
+ var d = data;
134
+ if (!d.workflows.length) {
135
+ page.innerHTML = hero('A workflow is how an agent does something again and again: on a schedule, from a webhook or your app. It asks you when it needs to, and every run is kept to check and improve.') +
136
+ '<div class="le-grid wo-cols2">' + TILES + '</div>';
137
+ return;
138
+ }
106
139
  var s = d.summary;
107
- var stats =
108
- '<div class="wo-stats">' +
109
- '<a class="wo-stat' + (s.waiting ? ' warn' : '') + '" href="/inbox"><b>' + s.waiting + '</b><span>' + 'Waiting for you' + '</span></a>' +
140
+ var q = (search.value || '').trim().toLowerCase();
141
+ var shown = d.workflows.filter(function (w) { return !q || [w.title, w.agentLabel, w.starts.join(' ')].join(' ').toLowerCase().indexOf(q) !== -1; });
142
+ var stats = '<div class="le-grid wo-cols4">' +
143
+ '<a class="wo-stat' + (s.waiting ? ' warn' : '') + '" href="/inbox"><b>' + s.waiting + '</b><span>Waiting for you</span></a>' +
110
144
  '<div class="wo-stat"><b>' + s.runsThisWeek + '</b><span>Runs in the last 7 days</span></div>' +
111
- '<div class="wo-stat"><b>' + s.failedThisWeek + '</b><span>Failed in the last 7 days</span></div>' +
145
+ '<div class="wo-stat' + (s.failedThisWeek ? ' bad' : '') + '"><b>' + s.failedThisWeek + '</b><span>Failed in the last 7 days</span></div>' +
112
146
  '<div class="wo-stat"><b>' + s.workflows + '</b><span>' + (s.workflows === 1 ? 'Workflow' : 'Workflows') + '</span></div>' +
113
147
  '</div>';
114
- var rows = d.workflows.map(function (w) {
115
- var decided = w.approved + w.refused;
116
- return '<a class="wo-row" href="' + href(w) + '">' +
117
- '<span style="min-width:0"><div class="wo-title">' + esc(w.title) + '</div><div class="wo-sub">' + esc(w.agentLabel) + '</div></span>' +
118
- '<span class="wo-col-starts wo-sub" title="' + esc(w.starts.join(', ')) + '">' + esc(w.starts.join(DOT)) + '</span>' +
119
- '<span class="wo-col-runs wo-runs"><span>' + plural(w.runsThisWeek, 'run', 'runs') + ' this week' + (w.failedThisWeek ? ', <span style="color:var(--bad)">' + w.failedThisWeek + ' failed</span>' : '') + '</span>' +
120
- '<span class="wo-sub">' + (w.lastRun ? 'Last run ' + esc(ago(w.lastRun.at)) : 'Not run yet') + (decided ? DOT + w.approved + ' of ' + decided + ' approved' : '') + '</span></span>' +
121
- '<span class="wo-side">' + lastRunPill(w) + '</span>' +
122
- '</a>';
123
- }).join('');
124
- page.innerHTML = stats +
125
- '<div class="wo-list"><div class="wo-row wo-head"><span>Workflow</span><span class="wo-col-starts">Starts</span><span class="wo-col-runs">Runs</span><span>Last run</span></div>' + rows + '</div>';
148
+ var cells = shown.map(cardHtml);
149
+ page.innerHTML = hero(plural(s.workflows, 'workflow', 'workflows') + ': how each one starts, how it' + String.fromCharCode(8217) + 's been going, and what' + String.fromCharCode(8217) + 's waiting for you.') + stats +
150
+ '<h3 class="wo-section-title">All workflows</h3>' +
151
+ '<div class="le-grid wo-cols2">' + (cells.length ? cells.join('') + (cells.length % 2 ? '<div class="wo-filler" aria-hidden="true"></div>' : '') : '<p class="wo-empty">No workflow matches.</p>') + '</div>' +
152
+ (q ? '' : '<h3 class="wo-section-title">Add a workflow</h3><div class="le-grid wo-cols2">' + TILES + '</div>');
126
153
  }
154
+ search.addEventListener('input', function () { if (data) render(); });
127
155
 
128
156
  // The sidebar asks for the same list as the page opens: one request.
129
157
  (window.leShell && window.leShell.getJson
130
158
  ? window.leShell.getJson('/workflows/overview').then(function (d) { if (!d) throw new Error('could not reach the server'); return d; })
131
159
  : fetch('/workflows/overview', { cache: 'no-store' }).then(function (r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); }))
132
- .then(render)
160
+ .then(function (d) { data = d; render(); })
133
161
  .catch(function (err) { page.innerHTML = '<p class="error">Couldn' + String.fromCharCode(8217) + 't load your workflows: ' + esc(err.message) + '</p>'; });
134
162
  })();
135
163
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopengine",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "type": "module",
5
5
  "description": "Runtime for tool-using AI agents with a transparent ReAct loop.",
6
6
  "license": "MIT",