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.
@@ -23,27 +23,27 @@ export const auditPageHtml = `<!doctype html>
23
23
  <meta name="viewport" content="width=device-width, initial-scale=1">
24
24
  <title>Audit</title>
25
25
  <style>${devUiCss}
26
- .au { max-width: 1080px; display: grid; gap: 14px; }
27
- .au-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
28
- .au-bar select, .au-bar input { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); max-width: 180px; }
29
- .au-bar input[type="search"] { flex: 1; min-width: 160px; max-width: none; }
30
- .au-bar [hidden] { display: none; }
31
- .au-actions { display: inline-flex; gap: 8px; margin-left: auto; }
32
- .au-verify { font-size: 13px; }
33
- .au-check { padding: 10px 14px; border-radius: 10px; font-size: 13px; background: var(--good-soft); color: var(--good); }
26
+ .au { max-width: 1180px; display: grid; gap: 14px; }
27
+ .au-topbar { flex-wrap: wrap; row-gap: 8px; }
28
+ .au-tool { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 13.5px; font-weight: 500; color: var(--ink); }
29
+ .au-tool:hover:not(:disabled) { background: var(--surface); }
30
+ .au-grid { grid-template-columns: minmax(0, 1fr); }
31
+ .au-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; background: var(--bg); }
32
+ .au-bar select { height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--surface); font-size: 13px; color: var(--ink); max-width: 200px; }
33
+ .au-check { padding: 12px 16px; border-radius: 10px; font-size: 13px; background: var(--good-soft); color: var(--good); }
34
34
  .au-check.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
35
35
  .au-check .hint { display: block; margin-top: 2px; font-weight: 400; }
36
- .au-summary { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; background: var(--bg); }
36
+ .au-summary { border: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 10px; background: var(--bg); }
37
37
  .au-summary[hidden], .au-check[hidden] { display: none; }
38
- .au-summary h2 { margin: 0; font-size: 15px; }
38
+ .au-summary h2 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
39
39
  .au-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.5; }
40
40
  .au-summary-tools { display: flex; gap: 8px; flex-wrap: wrap; }
41
- .au-summary-tools a { font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; }
41
+ .au-summary-tools a { display: inline-flex; align-items: center; height: 32px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }
42
42
  .au-summary-tools a.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
43
- .au-export { font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
44
- .au-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
45
- .au-row, .au-head { display: grid; grid-template-columns: 136px minmax(0, 170px) minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
46
- .au-head { border-top: 0; padding-top: 8px; padding-bottom: 8px; background: var(--surface); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
43
+ .au-list { background: var(--bg); }
44
+ .au-row, .au-head { display: grid; grid-template-columns: 136px minmax(0, 170px) minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13.5px; }
45
+ .au-row:hover { background: var(--surface); }
46
+ .au-head { padding-top: 10px; padding-bottom: 10px; background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink-faint); }
47
47
  .au-who { overflow-wrap: anywhere; }
48
48
  .au-who.system { color: var(--ink-muted); font-style: italic; }
49
49
  .au-res { display: grid; gap: 1px; min-width: 0; }
@@ -71,10 +71,11 @@ export const auditPageHtml = `<!doctype html>
71
71
  .chg-ins { background: var(--good-soft); color: var(--good); padding: 1px 6px; }
72
72
  .chg-note { color: var(--ink-muted); font-family: inherit; font-weight: 400; }
73
73
  .chg details summary { cursor: pointer; color: var(--accent-ink); font-family: var(--font-sans, inherit); font-size: 12px; margin-top: 2px; }
74
- .au-empty { padding: 28px 16px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
75
- .au-more { justify-self: center; }
74
+ .au-empty { margin: 0; padding: 40px 20px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
75
+ .au-more { justify-self: center; height: 34px; padding: 0 14px; border-radius: 9px; }
76
76
  .error { font-size: 13px; color: var(--bad); margin: 0; }
77
77
  @media (max-width: 720px) {
78
+ .le-search { display: none; }
78
79
  .au-head { display: none; }
79
80
  .au-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
80
81
  }
@@ -84,31 +85,34 @@ export const auditPageHtml = `<!doctype html>
84
85
  <div class="le-app">
85
86
  ${consoleSidebarHtml}
86
87
  <main class="le-main">
87
- <div class="le-head plain">
88
- <div class="le-head-row">
89
- <div class="le-title"><button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
90
- <div><h1>Audit</h1><p>Who did what, when, and to which resource, across the workspace: workflows created, edited, published and deleted, and every other setting changed. Runs are on each workflow's Activity tab.</p></div>
91
- </div>
92
- </div>
93
- </div>
88
+ <header class="le-topbar au-topbar">
89
+ <button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">&#9776;</button>
90
+ <h1 class="le-topbar-title">Audit</h1>
91
+ <span class="le-seg" role="tablist" aria-label="Show" id="auKinds">
92
+ <button type="button" role="tab" data-kind="change" aria-selected="true">Changes</button><button type="button" role="tab" data-kind="decision" aria-selected="false">Approvals</button><button type="button" role="tab" data-kind="answer" aria-selected="false">Answers</button><button type="button" role="tab" data-kind="feedback" aria-selected="false">Feedback</button><button type="button" role="tab" data-kind="all" aria-selected="false">Everything</button>
93
+ </span>
94
+ <span class="le-topbar-gap"></span>
95
+ <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="auQ" placeholder="Search the log" aria-label="Search"></label>
96
+ <button type="button" class="au-tool" id="auVerify">Verify log</button>
97
+ <a class="le-btn-dark" id="auExport" href="/audit/events.csv" download>Export CSV</a>
98
+ </header>
94
99
  <div class="le-scroll"><div class="le-page"><div class="au">
95
- <div class="au-bar">
96
- <select id="auAgent" aria-label="Agent"><option value="">All agents</option></select>
97
- <select id="auWorkflow" aria-label="Workflow"><option value="">All workflows</option></select>
98
- <select id="auBy" aria-label="Person"><option value="">Anyone</option></select>
99
- <select id="auKind" aria-label="Kind">
100
- <option value="change">Changes to workflows and settings</option><option value="decision">Approvals in runs</option><option value="answer">Answers in runs</option><option value="feedback">Feedback on runs</option><option value="all">Everything</option>
101
- </select>
102
- <select id="auPeriod" aria-label="Period">
103
- <option value="7">Last 7 days</option><option value="30" selected>Last 30 days</option><option value="90">Last 90 days</option><option value="365">Last year</option><option value="">All time</option>
104
- </select>
105
- <input type="search" id="auQ" placeholder="Search" aria-label="Search">
106
- <span class="au-actions"><button type="button" class="au-verify" id="auVerify">Verify log</button>
107
- <a class="au-export" id="auExport" href="/audit/events.csv" download>Export CSV</a></span>
108
- </div>
100
+ <select id="auKind" aria-label="Kind" hidden>
101
+ <option value="change">Changes to workflows and settings</option><option value="decision">Approvals in runs</option><option value="answer">Answers in runs</option><option value="feedback">Feedback on runs</option><option value="all">Everything</option>
102
+ </select>
109
103
  <div class="au-check" id="auCheck" role="status" hidden></div>
110
104
  <section class="au-summary" id="auSummary" hidden></section>
111
- <div id="auList"><p class="hint">Loading&hellip;</p></div>
105
+ <div class="le-grid au-grid">
106
+ <div class="au-bar">
107
+ <select id="auAgent" aria-label="Agent"><option value="">All agents</option></select>
108
+ <select id="auWorkflow" aria-label="Workflow"><option value="">All workflows</option></select>
109
+ <select id="auBy" aria-label="Person"><option value="">Anyone</option></select>
110
+ <select id="auPeriod" aria-label="Period">
111
+ <option value="7">Last 7 days</option><option value="30" selected>Last 30 days</option><option value="90">Last 90 days</option><option value="365">Last year</option><option value="">All time</option>
112
+ </select>
113
+ </div>
114
+ <div id="auList"><p class="hint" style="padding:16px 20px;margin:0">Loading&hellip;</p></div>
115
+ </div>
112
116
  <button type="button" class="au-more" id="auMore" hidden>Load older</button>
113
117
  </div></div></div>
114
118
  </main>
@@ -259,7 +263,7 @@ ${consoleShellScript}
259
263
  var url = '/audit/events?';
260
264
  var extra = append && next != null ? { before: String(next) } : {};
261
265
  extra.limit = '100';
262
- if (!append) list.innerHTML = '<p class="hint">Loading' + String.fromCharCode(8230) + '</p>';
266
+ if (!append) list.innerHTML = '<p class="hint" style="padding:16px 20px;margin:0">Loading' + String.fromCharCode(8230) + '</p>';
263
267
  more.hidden = true;
264
268
  return fetch(url + query(extra), { headers: { accept: 'application/json' } })
265
269
  .then(function (r) { return r.ok ? r.json() : r.json().then(function (b) { throw new Error(b.error || 'HTTP ' + r.status); }); })
@@ -357,6 +361,21 @@ ${consoleShellScript}
357
361
 
358
362
  el.q.value = state.q;
359
363
  el.kind.value = state.kind;
364
+ // The kinds, as the top bar's segmented control: each picks the hidden
365
+ // select's value, so the rest reads it as before.
366
+ var kinds = document.getElementById('auKinds');
367
+ function markKind() {
368
+ var bs = kinds.querySelectorAll('[data-kind]');
369
+ for (var b = 0; b < bs.length; b++) bs[b].setAttribute('aria-selected', String(bs[b].getAttribute('data-kind') === el.kind.value));
370
+ }
371
+ kinds.addEventListener('click', function (ev) {
372
+ var b = ev.target.closest('[data-kind]');
373
+ if (!b || b.getAttribute('data-kind') === el.kind.value) return;
374
+ el.kind.value = b.getAttribute('data-kind');
375
+ markKind();
376
+ el.kind.dispatchEvent(new Event('change'));
377
+ });
378
+ markKind();
360
379
  el.period.value = state.period;
361
380
  function fillFilters(f) {
362
381
  filters = f;
@@ -72,7 +72,7 @@ export const consoleSidebarHtml = `<aside class="le-sidebar" aria-label="Console
72
72
  </section>
73
73
  <section class="le-pane" data-le-pane="workflows">
74
74
  <div class="le-pane-head"><a href="/workflows">Workflows</a><a class="le-pane-new" href="/workflows/new">+ New</a></div>
75
- <ul class="le-agent-list le-goal-list" id="leWorkflowList"></ul>
75
+ <ul class="le-agent-list le-goal-list le-wf-list" id="leWorkflowList"></ul>
76
76
  </section>
77
77
  <section class="le-pane" data-le-pane="settings">
78
78
  <div class="le-pane-head"><a href="/config?section=settings">Settings</a></div>
@@ -262,7 +262,7 @@ export const consoleShellScript = `<script>
262
262
  workflowList.innerHTML = list.length ? list.map(function (w) {
263
263
  var on = w.agent === currentAgent && w.id === currentId;
264
264
  return '<li><a class="le-agent-item le-goal-item" href="/agents/config?agent=' + enc(w.agent) + '&tab=workflows&workflow=' + enc(w.id) + '" title="' + esc(w.title) + ' (' + esc(w.agentLabel) + DOT_SEP + (w.live ? 'Running' : 'Pending') + ')"' + (on ? ' aria-current="page"' : '') + '>' +
265
- '<span class="le-dot ' + (w.live ? 'tint' : 'pending') + '" aria-hidden="true"></span><span class="le-name">' + esc(w.title) + '</span></a></li>';
265
+ '<span class="le-dot ' + (w.live ? 'tint' : 'pending') + '" aria-hidden="true"></span><span class="le-wf-text"><span class="le-name">' + esc(w.title) + '</span><span class="le-meta">' + esc(w.agentLabel) + '</span></span></a></li>';
266
266
  }).join('') : '<li class="le-agent-item"><span></span><span class="le-meta">No workflows yet</span><span></span></li>';
267
267
  });
268
268
  }
@@ -164,13 +164,18 @@ export const devUiCss = `
164
164
  .le-pane-head a.le-pane-new[aria-current="page"] { text-decoration: underline; }
165
165
  .le-pane .le-agent-list { max-height: none; }
166
166
  .le-goal-item .le-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
167
- .le-agent-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 0 1 auto; max-height: 40vh; min-height: 0; }
167
+ /* Workflows: each with its agent under its name. */
168
+ .le-wf-list .le-agent-item { align-items: start; }
169
+ .le-wf-list .le-dot { margin-top: 5px; }
170
+ .le-wf-text { display: grid; gap: 1px; min-width: 0; }
171
+ .le-wf-text .le-name, .le-wf-text .le-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
172
+ .le-agent-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 0 1 auto; max-height: 40vh; min-height: 0; display: grid; gap: 2px; align-content: start; }
168
173
  /* Find your first agent: one more item under Agents. */
169
- .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; }
174
+ .le-sub-link { margin: 2px 8px 0; padding: 8px 10px 8px 28px; flex: none; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--accent-ink); text-decoration: none; }
170
175
  .le-sub-link:hover { background: var(--surface-2); }
171
176
  .le-sub-link[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
172
177
  /* List items read smaller than their section's head. */
173
- .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; }
178
+ .le-agent-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
174
179
  .le-agent-item:hover { background: var(--surface-2); }
175
180
  .le-agent-item[aria-current="page"] { background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
176
181
  .le-agent-item .le-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@@ -183,7 +188,7 @@ export const devUiCss = `
183
188
  .le-inbox-only .le-rail-item:not([data-le-section="inbox"]), .le-inbox-only .le-panel { display: none; }
184
189
  .le-dot.idle { background: var(--ink-faint); }
185
190
  .le-settings-menu { display: grid; gap: 2px; padding: 0 8px; }
186
- .le-settings-menu a { padding: 6px 10px; border-radius: 6px; color: var(--ink-muted); text-decoration: none; font-size: 13px; }
191
+ .le-settings-menu a { padding: 8px 10px; border-radius: 8px; color: var(--ink-muted); text-decoration: none; font-size: 13px; }
187
192
  .le-settings-menu a:hover { background: var(--surface-2); color: var(--ink); }
188
193
  .le-settings-menu a[aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
189
194
  .le-who { position: relative; display: grid; place-items: center; padding-top: 8px; }