loopengine 0.5.11 → 0.5.13
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/agents-config-page.js +351 -138
- package/dist/web/agents-list-page.js +2 -2
- package/dist/web/console-shell.js +9 -5
- package/dist/web/dev-ui-styles.js +21 -5
- package/dist/web/goals-page.js +4 -4
- package/dist/web/schedules-page.js +3 -3
- package/dist/web/workflows-overview-page.js +4 -4
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ import { devUiCss } from './dev-ui-styles.js';
|
|
|
30
30
|
import { MESSAGING_ICONS } from './messaging-icons.js';
|
|
31
31
|
import { renderMarkdownScript } from './markdown-script.js';
|
|
32
32
|
import { consoleShellScript, consoleSidebarHtml } from './console-shell.js';
|
|
33
|
+
import { MASCOT_CSS, mascotSvg } from './mascot.js';
|
|
33
34
|
import { REASONING_PROVIDERS } from './agent-file-admin.js';
|
|
34
35
|
export const agentsConfigPageHtml = `<!doctype html>
|
|
35
36
|
<html lang="en">
|
|
@@ -37,7 +38,7 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
37
38
|
<meta charset="utf-8">
|
|
38
39
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
39
40
|
<title>LoopEngine Console</title>
|
|
40
|
-
<style>${devUiCss}
|
|
41
|
+
<style>${devUiCss}${MASCOT_CSS}
|
|
41
42
|
/* Each tab panel is a .le-page column inside the shell's scrolling
|
|
42
43
|
main area (see web/console-shell.ts); everything below styles the
|
|
43
44
|
panels' own content. */
|
|
@@ -71,19 +72,27 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
71
72
|
/* A workflow's own page: the agent's header and list intro give way to it. */
|
|
72
73
|
.wf-page-mode > .le-head, .wf-page-mode .wf-tab-head { display: none; }
|
|
73
74
|
.wf-page { display: grid; gap: 20px; }
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.wf-page-
|
|
78
|
-
.wf-page-
|
|
79
|
-
.wf-page-
|
|
80
|
-
|
|
81
|
-
.wf-page-
|
|
82
|
-
.wf-page
|
|
83
|
-
.wf-page-
|
|
84
|
-
.wf-page-
|
|
75
|
+
/* Its header, in the other pages' style: a top bar (Workflows / its
|
|
76
|
+
agent / its name, and Edit workflow), then a big, light title, what
|
|
77
|
+
it does and its facts as chips. */
|
|
78
|
+
.wf-page-head { display: grid; gap: 0; }
|
|
79
|
+
.wf-page-crumb-row { display: flex; align-items: center; gap: 12px; margin: -28px -32px 28px; padding: 10px 20px; min-height: 58px; box-sizing: border-box; border-bottom: 1px solid var(--line); }
|
|
80
|
+
.wf-page-crumb-row .le-crumb { flex: 1; }
|
|
81
|
+
/* The top bar spans the page; the rest keeps the page's width. */
|
|
82
|
+
.wf-page-mode .le-page { max-width: none; }
|
|
83
|
+
.wf-page > :not(.wf-page-head), .wf-page-hero { max-width: 1076px; }
|
|
84
|
+
.wf-page-crumb-row .wf-row-actions .le-btn-dark:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); }
|
|
85
|
+
.wf-page-hero { display: grid; gap: 12px; padding: 32px 22px 26px; border: 1px solid var(--line); }
|
|
86
|
+
.wf-page-hero h1 { margin: 0; font-size: 36px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
|
|
87
|
+
.wf-page-desc { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-muted); max-width: 80ch; }
|
|
88
|
+
.wf-page-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; margin-top: 4px; }
|
|
89
|
+
.wf-page-meta-item { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 7px; min-width: 0; color: var(--ink); }
|
|
90
|
+
.wf-page-meta-k { font-size: 12px; font-weight: 400; color: var(--ink-faint); }
|
|
91
|
+
.wf-page-meta-item a { color: var(--ink); font-weight: 600; text-decoration: none; }
|
|
92
|
+
.wf-page-meta-item a:hover { text-decoration: underline; }
|
|
93
|
+
@media (max-width: 860px) { .wf-page-crumb-row { margin: -28px -16px 20px; } .wf-page-hero { padding: 22px; } .wf-page-hero h1 { font-size: 28px; } }
|
|
85
94
|
.wf-page .wf-page-body { padding: 0; gap: 16px; }
|
|
86
|
-
.wf-page-starts { display:
|
|
95
|
+
.wf-page-starts { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; color: var(--ink); }
|
|
87
96
|
.wf-page-last { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
|
|
88
97
|
.wf-list-box.wf-page-box { border: 0; border-radius: 0; background: none; overflow: visible; }
|
|
89
98
|
.wf-page .workflow-steps-text { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--surface); font-size: 13.5px; line-height: 1.6; max-height: 480px; overflow: auto; white-space: pre-wrap; }
|
|
@@ -99,8 +108,8 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
99
108
|
.wf-card-title p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); }
|
|
100
109
|
.wf-card-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 50%; }
|
|
101
110
|
.wf-card-actions button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
|
|
102
|
-
.wf-card-actions .workflow-edit { border-color: var(--
|
|
103
|
-
.wf-card-actions .workflow-edit:hover:not(:disabled) { background: var(--
|
|
111
|
+
.wf-card-actions .workflow-edit { border-color: var(--line); background: var(--bg); color: var(--ink); font-weight: 600; }
|
|
112
|
+
.wf-card-actions .workflow-edit:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
|
|
104
113
|
.wf-card-actions .wf-remove { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); font-weight: 600; }
|
|
105
114
|
.wf-card-actions .wf-remove:hover:not(:disabled) { background: var(--bad); color: var(--bg); }
|
|
106
115
|
.wf-card-actions .wf-remove[data-confirming="1"] { height: auto; min-height: 32px; padding: 6px 12px; text-align: left; white-space: normal; }
|
|
@@ -108,16 +117,17 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
108
117
|
.wf-card > .workflow-result:empty { display: none; }
|
|
109
118
|
.wf-card > .workflow-result { padding: 10px 20px; border-top: 1px solid var(--line); }
|
|
110
119
|
/* The list: one row per workflow; a row opens to its tabs. */
|
|
111
|
-
.wf-list-box { border: 1px solid var(--line); border-radius:
|
|
120
|
+
.wf-list-box { border: 1px solid var(--line); border-radius: 0; background: var(--bg); overflow: hidden; }
|
|
112
121
|
.wf-row + .wf-row { border-top: 1px solid var(--line); }
|
|
113
122
|
.wf-row.workflow-focus { box-shadow: inset 3px 0 0 var(--accent); }
|
|
114
|
-
.wf-row-head { display: grid; grid-template-columns:
|
|
123
|
+
.wf-row-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) 210px 200px auto; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; }
|
|
115
124
|
.wf-row-head:hover, .wf-row.is-open .wf-row-head { background: var(--surface); }
|
|
116
125
|
.wf-row-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
117
126
|
.wf-row-job { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
118
127
|
.wf-row-job a { color: var(--accent-ink); }
|
|
119
|
-
.wf-row-
|
|
120
|
-
.wf-row
|
|
128
|
+
.wf-row-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-muted); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
|
|
129
|
+
.wf-row-icon svg { width: 15px; height: 15px; }
|
|
130
|
+
.wf-row-icon.live { color: var(--good); }
|
|
121
131
|
.wf-row-main { min-width: 0; display: grid; gap: 2px; }
|
|
122
132
|
.wf-row-main strong { font-size: 14px; font-weight: 650; color: var(--ink); }
|
|
123
133
|
.wf-desc { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); overflow-wrap: anywhere; }
|
|
@@ -134,14 +144,16 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
134
144
|
"+2 more schedules") at the same size as its schedule lines. */
|
|
135
145
|
.wf-row-starts .hint, .wf-row-last .hint { font-size: 12.5px; }
|
|
136
146
|
.wf-row-actions { display: flex; gap: 6px; }
|
|
137
|
-
.wf-row-actions button, .wf-row-foot button { height: 30px; padding: 0 12px; border-radius:
|
|
138
|
-
.wf-row-actions button:hover:not(:disabled) { background: var(--
|
|
147
|
+
.wf-row-actions button, .wf-row-foot button { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
|
|
148
|
+
.wf-row-actions button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
|
|
139
149
|
.wf-row-body { padding: 4px 16px 16px 44px; display: grid; gap: 12px; }
|
|
140
150
|
.wf-row-body[hidden], .wf-panel[hidden] { display: none; }
|
|
141
|
-
|
|
142
|
-
.wf-
|
|
151
|
+
/* Its tabs, as the segmented control the other pages use. */
|
|
152
|
+
.wf-tabs { display: flex; gap: 2px; width: fit-content; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--surface); overflow-x: auto; scrollbar-width: none; }
|
|
153
|
+
.wf-tab { border: 0; border-radius: 8px; background: none; height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
|
|
143
154
|
.wf-tab:hover:not(:disabled) { background: none; color: var(--ink); }
|
|
144
|
-
.wf-tab[aria-selected="true"] { color: var(--
|
|
155
|
+
.wf-tab[aria-selected="true"] { color: var(--ink); background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
|
|
156
|
+
.wf-tab[aria-selected="true"]:hover:not(:disabled) { background: var(--bg); }
|
|
145
157
|
.wf-msg-form { display: flex; flex-direction: column; gap: 14px; }
|
|
146
158
|
.wf-draft-note { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--ink-muted); }
|
|
147
159
|
.wf-msg-dests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
|
|
@@ -183,10 +195,10 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
183
195
|
.wf-cb-decision.ask { background: var(--warn-soft); color: var(--warn); }
|
|
184
196
|
.wf-cb-decision.deny { background: var(--bad-soft); color: var(--bad); }
|
|
185
197
|
@media (max-width: 520px) { .wf-cb { grid-template-columns: minmax(0, 1fr); gap: 2px; } .wf-cb-v { margin-bottom: 8px; } }
|
|
186
|
-
.wf-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:
|
|
198
|
+
.wf-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
|
|
187
199
|
@media (max-width: 900px) { .wf-ways { grid-template-columns: minmax(0, 1fr); } }
|
|
188
|
-
.wf-way { margin: 0; display: grid; gap:
|
|
189
|
-
.wf-way h4 { margin: 0; font-size:
|
|
200
|
+
.wf-way { margin: 0; display: grid; gap: 10px; align-content: start; padding: 20px 22px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: var(--bg); min-width: 0; font-size: 13px; }
|
|
201
|
+
.wf-way h4 { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }
|
|
190
202
|
.wf-way-what { margin: 0; font-size: 12.5px; color: var(--ink-muted); }
|
|
191
203
|
.wf-way .hint[hidden], .wf-way [hidden] { display: none; }
|
|
192
204
|
.wf-way .workflow-hooks:empty { display: none; }
|
|
@@ -199,11 +211,12 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
199
211
|
.wf-run-bar { display: grid; gap: 10px; }
|
|
200
212
|
.wf-run-bar .workflow-params { margin: 0; }
|
|
201
213
|
.wf-run-bar-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
|
|
202
|
-
.wf-sub { margin: 6px 0 0; font-size:
|
|
203
|
-
|
|
204
|
-
.wf-
|
|
205
|
-
.wf-score
|
|
206
|
-
.wf-score-
|
|
214
|
+
.wf-sub { margin: 6px 0 0; font-size: 18px; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }
|
|
215
|
+
/* Its numbers, in a hairline grid of cells. */
|
|
216
|
+
.wf-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
|
|
217
|
+
.wf-score { display: grid; gap: 2px; align-content: start; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
|
|
218
|
+
.wf-score-k { font-size: 12.5px; font-weight: 400; color: var(--ink-muted); }
|
|
219
|
+
.wf-score-v { font-size: 28px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
|
|
207
220
|
.wf-evals-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
|
|
208
221
|
.wf-evals-bar button, .wf-case-actions button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
|
|
209
222
|
.wf-crits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
|
|
@@ -293,13 +306,16 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
293
306
|
.wf-sub-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
294
307
|
.wf-act-main[hidden], .wf-trace[hidden] { display: none; }
|
|
295
308
|
.wf-act-main > .wf-section + .wf-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
|
|
296
|
-
|
|
297
|
-
.wf-run-
|
|
298
|
-
.wf-run-card
|
|
309
|
+
/* Runs, as rows sharing their lines. */
|
|
310
|
+
.wf-run-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); }
|
|
311
|
+
.wf-run-card { display: grid; gap: 6px; padding: 14px 18px; border: 0; border-radius: 0; background: var(--bg); min-width: 0; font-size: 13px; }
|
|
312
|
+
.wf-run-card + .wf-run-card { border-top: 1px solid var(--line); }
|
|
313
|
+
.wf-run-card:hover { background: var(--surface); }
|
|
314
|
+
.wf-run-card.is-failed { box-shadow: inset 3px 0 0 var(--bad); }
|
|
299
315
|
.wf-run-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
|
|
300
316
|
.wf-run-card-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
|
|
301
|
-
.wf-run-card-actions .wf-run-trace { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--
|
|
302
|
-
.wf-run-card-actions .wf-run-trace:hover { background: var(--
|
|
317
|
+
.wf-run-card-actions .wf-run-trace { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
|
|
318
|
+
.wf-run-card-actions .wf-run-trace:hover { background: var(--surface); color: var(--ink); }
|
|
303
319
|
.wf-run-version { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
|
|
304
320
|
.wf-run-card-inputs { color: var(--ink-muted); overflow-wrap: anywhere; }
|
|
305
321
|
.wf-run-card-out { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
@@ -414,7 +430,10 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
414
430
|
.wf-pub-stale { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft, #fff8e1); font-size: 13px; }
|
|
415
431
|
.wf-publish .ed-actions { align-items: center; }
|
|
416
432
|
.wf-publish .ed-actions .hint { margin-right: auto; }
|
|
417
|
-
.workflow-editor-dialog .ed-actions .hint { margin-right: auto; font-size: 12.5px; }
|
|
433
|
+
.workflow-editor-dialog .ed-actions .hint { margin-right: auto; font-size: 12.5px; flex: 1 1 auto; min-width: 0; line-height: 1.4; }
|
|
434
|
+
/* With Save and publish there, Save as draft is the plain one. */
|
|
435
|
+
.workflow-editor-dialog .ed-actions .wp-save-draft:not(.primary) { background: var(--bg); border-color: var(--line); color: var(--ink); }
|
|
436
|
+
.workflow-editor-dialog .ed-actions .wp-save-draft:not(.primary):hover:not(:disabled) { background: var(--surface); opacity: 1; }
|
|
418
437
|
.wp-schema { font-family: var(--font-mono); font-size: 12.5px; }
|
|
419
438
|
.wf-schema { display: block; flex-basis: 100%; width: 100%; }
|
|
420
439
|
.wf-schema summary { cursor: pointer; color: var(--ink-muted); font-size: 12.5px; }
|
|
@@ -431,7 +450,7 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
431
450
|
.wf-row-foot .wf-remove { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
|
|
432
451
|
.wf-row-foot .wf-remove:hover:not(:disabled) { background: var(--bad); color: var(--bg); }
|
|
433
452
|
@media (max-width: 760px) {
|
|
434
|
-
.wf-row-head { grid-template-columns:
|
|
453
|
+
.wf-row-head { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 6px; }
|
|
435
454
|
.wf-row-starts, .wf-row-last { white-space: normal; }
|
|
436
455
|
.wf-row-starts, .wf-row-last { grid-column: 2 / 3; }
|
|
437
456
|
.wf-row-actions { grid-column: 3; grid-row: 1; }
|
|
@@ -525,7 +544,7 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
525
544
|
.ed-body textarea.ed-tall { min-height: min(55vh, 520px); font-family: var(--font-mono); font-size: 13px; }
|
|
526
545
|
.ed-body input:focus, .ed-body select:focus, .ed-body textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
|
|
527
546
|
.ed-actions { position: sticky; bottom: -20px; z-index: 1; display: flex; justify-content: flex-end; gap: 8px; margin: 6px -24px -20px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
|
|
528
|
-
.ed-actions button { height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 600; }
|
|
547
|
+
.ed-actions button { height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 600; flex: none; white-space: nowrap; }
|
|
529
548
|
.edit-dialog [data-dialog-cancel] { display: inline-block !important; }
|
|
530
549
|
.ov-name { margin: 0; font-size: 15px; }
|
|
531
550
|
.ov-name code { font-size: 12.5px; }
|
|
@@ -598,6 +617,21 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
598
617
|
form.add-source.env-inline textarea { flex: 1 1 100%; }
|
|
599
618
|
form.add-source.env-inline button { padding: 4px 10px; }
|
|
600
619
|
.tab-panel .le-table-wrap table { border: 0; border-radius: 0; }
|
|
620
|
+
/* Overview, in the other pages' style: a big title with the agent's
|
|
621
|
+
instructions and the mascot, its parts in a hairline grid of cards,
|
|
622
|
+
then its settings in another. */
|
|
623
|
+
.ov-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 22px 28px; border: 1px solid var(--line); border-bottom: 0; }
|
|
624
|
+
.ov-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
|
|
625
|
+
.ov-hero-text { display: grid; gap: 10px; min-width: 0; }
|
|
626
|
+
.ov-hero-sub { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-muted); max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
|
|
627
|
+
.ov-section-title { margin: 0; padding: 30px 22px 16px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
|
|
628
|
+
.ov-cards.le-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
629
|
+
.ov-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
630
|
+
.ov-settings > section { margin: 0; padding: 20px 22px; background: var(--bg); min-width: 0; }
|
|
631
|
+
.ov-settings > section.ov-wide { grid-column: 1 / -1; }
|
|
632
|
+
.ov-settings pre { margin: 0; }
|
|
633
|
+
@media (max-width: 1100px) { .ov-cards.le-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
634
|
+
@media (max-width: 860px) { .ov-hero { padding: 24px 22px 20px; } .ov-hero .le-mascot { display: none; } .ov-settings, .ov-cards.le-grid { grid-template-columns: minmax(0, 1fr); } .ov-section-title { padding: 24px 22px 14px; } }
|
|
601
635
|
section { margin-bottom: 28px; }
|
|
602
636
|
section h3 {
|
|
603
637
|
font-size: 15px;
|
|
@@ -872,9 +906,101 @@ export const agentsConfigPageHtml = `<!doctype html>
|
|
|
872
906
|
.app-pick-tool code { overflow-wrap: anywhere; }
|
|
873
907
|
.app-pick-tool select { font: inherit; font-size: 11.5px; padding: 1px 4px; }
|
|
874
908
|
.app-pick-desc { display: block; }
|
|
909
|
+
|
|
910
|
+
/* ---------- the new style, across the tabs ----------
|
|
911
|
+
Headings in the big, light type; boxes square, and side by side or
|
|
912
|
+
one under another they share their lines; the teal-tinted buttons
|
|
913
|
+
plain, as on the other pages. */
|
|
914
|
+
.tab-panel:not([data-tab-panel="overview"]) section h3 { font-size: 20px; font-weight: 400; letter-spacing: -0.01em; }
|
|
915
|
+
.advanced-part { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
|
|
916
|
+
/* Side by side: a hairline grid. */
|
|
917
|
+
.wf-msg-dests, .wf-fb-stats, .wf-fb-ways { gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
|
|
918
|
+
.wf-msg-dest, .wf-fb-stat, .wf-fb-way { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; }
|
|
919
|
+
.wf-fb-stat strong, .wf-fb-stat b { font-weight: 400; }
|
|
920
|
+
/* One under another: rows sharing their lines. */
|
|
921
|
+
.wf-crits, .wf-fb-list, .msg-conns, .wf-version-cards { gap: 0; border: 1px solid var(--line); }
|
|
922
|
+
.wf-crit, .wf-fb-item, .msg-conn, .wf-version-card { border: 0; border-radius: 0; }
|
|
923
|
+
.wf-crit + .wf-crit, .wf-fb-item + .wf-fb-item, .msg-conn + .msg-conn, .wf-version-card + .wf-version-card { border-top: 1px solid var(--line); }
|
|
924
|
+
.wf-fb-item, .wf-version-card { padding: 14px 18px; }
|
|
925
|
+
.msg-conn { background: var(--bg); }
|
|
926
|
+
.wf-version-card { background: var(--bg); }
|
|
927
|
+
.wf-version-card.is-current { box-shadow: inset 3px 0 0 var(--accent); }
|
|
928
|
+
.wf-version-cards { list-style: none; margin: 0; padding: 0; display: grid; }
|
|
929
|
+
/* Boxes on their own: square. */
|
|
930
|
+
.wf-cb, .wf-fb-improve, .approvals-nudge, .le-table-wrap, .source, .workflow-steps-text, .wf-run-lines, .wf-cand-list, .tab-panel form.add-source, .tab-panel table { border-radius: 0; }
|
|
931
|
+
/* Plain buttons, as on the other pages. */
|
|
932
|
+
.wf-evals-bar button, .wf-case-actions button, .wf-crit-bar button, .wf-crit-edit { border-color: var(--line); background: var(--bg); color: var(--ink); }
|
|
933
|
+
.wf-evals-bar button:hover:not(:disabled), .wf-case-actions button:hover:not(:disabled), .wf-crit-bar button:hover:not(:disabled), .wf-crit-edit:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
|
|
934
|
+
|
|
935
|
+
/* The Schedules tab: + Add schedule, and its dialog, like Create
|
|
936
|
+
schedule on the Schedules page. */
|
|
937
|
+
.sched-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
|
|
938
|
+
.sched-top .le-btn-dark { flex: none; }
|
|
939
|
+
.sched-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .22); overflow: hidden; }
|
|
940
|
+
.sched-dialog::backdrop { background: rgba(20, 24, 25, .35); backdrop-filter: blur(3px); }
|
|
941
|
+
.sched-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 50px); margin: 0; }
|
|
942
|
+
.sched-dlg-head { display: flex; align-items: center; gap: 8px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
|
|
943
|
+
.sched-dlg-head h2 { margin: 0 auto 0 0; font-size: 18px; font-weight: 500; }
|
|
944
|
+
.sched-dlg-head button { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
|
|
945
|
+
.sched-dlg-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: auto; }
|
|
946
|
+
.sched-dlg-col { display: grid; align-content: start; }
|
|
947
|
+
.sched-dlg-col + .sched-dlg-col { border-left: 1px solid var(--line); background: var(--surface); }
|
|
948
|
+
.sched-field { display: grid; gap: 9px; padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 13px; }
|
|
949
|
+
.sched-field[hidden] { display: none; }
|
|
950
|
+
.sched-field-k { font-size: 14px; font-weight: 500; color: var(--ink); }
|
|
951
|
+
.sched-field textarea { min-height: 90px; border-radius: 9px; }
|
|
952
|
+
.sched-field input:not([type="radio"]):not([type="checkbox"]), .sched-field select { height: 36px; border-radius: 9px; }
|
|
953
|
+
.sched-field .le-seg { display: flex; }
|
|
954
|
+
.sched-field .le-seg button { flex: 1; justify-content: center; }
|
|
955
|
+
.sched-field .le-seg[hidden], .sched-row[hidden], .sched-field select[hidden] { display: none; }
|
|
956
|
+
.sched-row { display: flex; gap: 8px; }
|
|
957
|
+
.sched-message { display: grid; gap: 6px; }
|
|
958
|
+
.sched-message[hidden] { display: none; }
|
|
959
|
+
.sched-row > * { flex: 1; min-width: 0; }
|
|
960
|
+
.sched-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
961
|
+
.sched-dlg-foot { padding: 12px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); min-height: 46px; display: flex; align-items: center; }
|
|
962
|
+
.sched-dlg-foot:has(#scheduleResult:empty) { display: none; }
|
|
963
|
+
@media (max-width: 760px) { .sched-dlg-body { grid-template-columns: minmax(0, 1fr); } .sched-dlg-col + .sched-dlg-col { border-left: 0; border-top: 1px solid var(--line); } .sched-top { flex-direction: column; } }
|
|
964
|
+
|
|
965
|
+
/* Its schedules, as cards like the Schedules page's. */
|
|
966
|
+
.sched-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
967
|
+
.sched-card { display: grid; gap: 14px; align-content: start; padding: 20px 22px; background: var(--bg); min-width: 0; }
|
|
968
|
+
.sched-card.is-off .sched-card-text { opacity: .55; }
|
|
969
|
+
.sched-card.schedule-focus { background: var(--accent-soft); }
|
|
970
|
+
.sched-card-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: start; }
|
|
971
|
+
.sched-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); }
|
|
972
|
+
.sched-icon svg { width: 16px; height: 16px; }
|
|
973
|
+
.sched-card-text { display: grid; gap: 3px; min-width: 0; }
|
|
974
|
+
.sched-card-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
|
|
975
|
+
.sched-card-desc { font-size: 13px; color: var(--ink-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
976
|
+
.sched-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
|
|
977
|
+
.sched-chip { display: inline-flex; align-items: center; gap: 6px; 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; }
|
|
978
|
+
.sched-chip.strong { background: var(--surface); border-color: transparent; color: var(--ink); font-weight: 500; }
|
|
979
|
+
.sched-chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
|
|
980
|
+
.sched-chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
|
|
981
|
+
a.sched-chip:hover { color: var(--ink); border-color: var(--ink-faint); }
|
|
982
|
+
.sched-chip input { margin: 0; }
|
|
983
|
+
.sched-next { font-size: 12px; color: var(--ink-faint); margin-left: 4px; white-space: nowrap; }
|
|
984
|
+
.sched-last { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
|
|
985
|
+
.sched-last-k { font-size: 12.5px; color: var(--ink-muted); margin-right: 2px; }
|
|
986
|
+
.sched-last .schedule-result { flex-basis: 100%; font-size: 13px; color: var(--ink); max-height: 4.5em; overflow: hidden; }
|
|
987
|
+
.sched-history summary { cursor: pointer; }
|
|
988
|
+
.sched-menu { position: relative; }
|
|
989
|
+
.sched-menu summary { list-style: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--ink-muted); }
|
|
990
|
+
.sched-menu summary::-webkit-details-marker { display: none; }
|
|
991
|
+
.sched-menu summary:hover { background: var(--surface); color: var(--ink); }
|
|
992
|
+
.sched-menu[open] .sched-menu-list { display: grid; }
|
|
993
|
+
.sched-menu-list { display: none; position: absolute; right: 0; top: 32px; z-index: 20; min-width: 180px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
|
|
994
|
+
.sched-menu-list a, .sched-menu-list button { display: block; width: 100%; text-align: left; height: auto; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font-size: 13px; font-weight: 400; color: var(--ink); text-decoration: none; cursor: pointer; }
|
|
995
|
+
.sched-menu-list a:hover, .sched-menu-list button:hover:not(:disabled) { background: var(--surface); }
|
|
996
|
+
.sched-menu-list .delete-btn { color: var(--bad); }
|
|
997
|
+
.sched-ended { margin-top: 18px; }
|
|
998
|
+
.sched-ended summary { cursor: pointer; margin-bottom: 12px; }
|
|
999
|
+
@media (max-width: 860px) { .sched-cards { grid-template-columns: minmax(0, 1fr); } }
|
|
875
1000
|
</style>
|
|
876
1001
|
</head>
|
|
877
1002
|
<body data-le-page="agent-config">
|
|
1003
|
+
<template id="ovMascot">${mascotSvg(92)}</template>
|
|
878
1004
|
<div class="le-app">
|
|
879
1005
|
${consoleSidebarHtml}
|
|
880
1006
|
<main class="le-main">
|
|
@@ -1084,7 +1210,7 @@ ${renderMarkdownScript}
|
|
|
1084
1210
|
? '<a class="le-card" data-tab="' + tab + '" href="' + leShell.tabHref(cfg.name, tab) + '">' + inner + '</a>'
|
|
1085
1211
|
: '<div class="le-card">' + inner + '</div>';
|
|
1086
1212
|
}
|
|
1087
|
-
return '<div class="le-cards
|
|
1213
|
+
return '<div class="le-cards le-grid ov-cards">' +
|
|
1088
1214
|
card(null, 'Model', escapeHtml(modelValue), escapeHtml(modelDetail)) +
|
|
1089
1215
|
(cfg.abilityCount != null
|
|
1090
1216
|
? card('abilities', 'Apps', String(cfg.abilityCount), cfg.abilityCount ? 'Apps and abilities added to this agent' : 'Add apps and abilities, with the tools you choose')
|
|
@@ -2143,19 +2269,20 @@ ${renderMarkdownScript}
|
|
|
2143
2269
|
document.title = w.title + ' ' + String.fromCharCode(183) + ' ' + agentLabel;
|
|
2144
2270
|
return '<article class="workflow-card wf-page is-open" data-workflow="' + escapeHtml(w.id) + '">' +
|
|
2145
2271
|
'<header class="wf-page-head">' +
|
|
2272
|
+
// A top bar like the other pages': where you are, and Edit.
|
|
2146
2273
|
'<div class="wf-page-crumb-row"><button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">☰</button>' +
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2274
|
+
'<div class="le-crumb"><a href="/workflows">Workflows</a><span class="le-crumb-sep" aria-hidden="true">/</span><a href="/agents/config?agent=' + encodeURIComponent(name) + '&tab=workflows">' + escapeHtml(agentLabel) + '</a><span class="le-crumb-sep" aria-hidden="true">/</span><span class="le-crumb-here">' + escapeHtml(w.title) + '</span></div>' +
|
|
2275
|
+
'<span class="wf-row-actions"><button type="button" class="workflow-edit le-btn-dark">Edit workflow</button></span></div>' +
|
|
2276
|
+
'<div class="wf-page-hero"><h1>' + escapeHtml(w.title) + '</h1>' +
|
|
2150
2277
|
(w.description && w.description !== w.title ? '<p class="wf-page-desc">' + escapeHtml(w.description) + '</p>' : '') +
|
|
2151
2278
|
'<div class="wf-page-meta">' +
|
|
2152
2279
|
'<span class="wf-page-meta-item"><span class="wf-page-meta-k">Agent</span><a href="/agents/config?agent=' + encodeURIComponent(name) + '">' + escapeHtml(agentLabel) + '</a></span>' +
|
|
2153
2280
|
'<span class="wf-page-meta-item"><span class="wf-page-meta-k">Starts</span><span class="wf-page-starts">' + workflowStartsSummary(w) + '</span></span>' +
|
|
2154
|
-
'<span class="wf-page-meta-item"><span class="wf-page-
|
|
2281
|
+
'<span class="wf-page-meta-item"><span class="wf-page-last">' + workflowLastRunHtml(last) + '</span></span>' +
|
|
2155
2282
|
// Filled by loadWorkflowVersions.
|
|
2156
2283
|
'<span class="wf-page-meta-item wf-page-version-item" hidden><span class="wf-page-meta-k">Version</span><span class="wf-page-version"></span></span>' +
|
|
2157
2284
|
(w.jobs && w.jobs.length ? '<span class="wf-page-meta-item"><span class="wf-page-meta-k">For goal</span><span>' + w.jobs.map(function (j) { return '<a href="/goals?goal=' + encodeURIComponent(j.id) + '">' + escapeHtml(j.title) + '</a>'; }).join(', ') + '</span></span>' : '') +
|
|
2158
|
-
'</div>' +
|
|
2285
|
+
'</div></div>' +
|
|
2159
2286
|
'</header>' +
|
|
2160
2287
|
workflowDraftBannerHtml(w) +
|
|
2161
2288
|
'<div class="wf-row-body wf-page-body">' +
|
|
@@ -2175,7 +2302,9 @@ ${renderMarkdownScript}
|
|
|
2175
2302
|
}
|
|
2176
2303
|
return '<article class="workflow-card wf-row' + (open ? ' is-open' : '') + '" data-workflow="' + escapeHtml(w.id) + '">' +
|
|
2177
2304
|
'<div class="wf-row-head" role="button" tabindex="0" aria-expanded="' + open + '">' +
|
|
2178
|
-
|
|
2305
|
+
// The workflow icon the Workflows page uses; green when a
|
|
2306
|
+
// schedule or webhook starts it.
|
|
2307
|
+
'<span class="wf-row-icon' + (w.webhooks || (w.schedules || []).some(function (x) { return x.status !== 'paused' && x.status !== 'cancelled' && x.status !== 'done'; }) ? ' live' : '') + '" aria-hidden="true"><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></span>' +
|
|
2179
2308
|
'<div class="wf-row-main"><strong>' + escapeHtml(w.title) + '</strong>' +
|
|
2180
2309
|
// The job(s) it does, linking back to each job's page.
|
|
2181
2310
|
(w.jobs && w.jobs.length ? '<span class="wf-row-job">For goal: ' + w.jobs.map(function (j) { return '<a href="/goals?goal=' + encodeURIComponent(j.id) + '">' + escapeHtml(j.title) + '</a>'; }).join(', ') + '</span>' : '') + '</div>' +
|
|
@@ -3827,11 +3956,16 @@ ${renderMarkdownScript}
|
|
|
3827
3956
|
'</form>');
|
|
3828
3957
|
}
|
|
3829
3958
|
|
|
3830
|
-
|
|
3959
|
+
var mascotTpl = document.getElementById('ovMascot');
|
|
3960
|
+
return '<div class="ov-hero"><div class="ov-hero-text"><h2 class="le-display">' + escapeHtml(cfg.displayName || cfg.name) + '</h2>' +
|
|
3961
|
+
(cfg.systemPrompt ? '<p class="ov-hero-sub">' + escapeHtml(cfg.systemPrompt) + '</p>' : '') + '</div>' + (mascotTpl ? mascotTpl.innerHTML : '') + '</div>' +
|
|
3962
|
+
renderOverviewCards(cfg) +
|
|
3963
|
+
'<h3 class="ov-section-title">Settings</h3>' +
|
|
3964
|
+
'<div class="le-grid ov-settings">' +
|
|
3831
3965
|
'<section>' + nameSection + '</section>' +
|
|
3832
|
-
'<section>' + systemPromptSection + '</section>' +
|
|
3833
3966
|
'<section>' + modelSection + '</section>' +
|
|
3834
|
-
'<section
|
|
3967
|
+
'<section class="ov-wide">' + systemPromptSection + '</section>' +
|
|
3968
|
+
'<section class="ov-wide"><h3>Limits <button type="button" class="edit-btn" id="editLimitsBtn">Edit</button></h3>' +
|
|
3835
3969
|
'<dl class="kv kv-wide" id="limitsDisplay">' +
|
|
3836
3970
|
'<dt>Model turns per run</dt><dd>' + escapeHtml(cfg.maxTurns) + ' <span class="hint">then the run stops</span></dd>' +
|
|
3837
3971
|
'<dt>Conversation size</dt><dd>' + escapeHtml(Number(cfg.contextBudgetTokens).toLocaleString()) + ' tokens <span class="hint">older steps are summarised beyond this</span></dd>' +
|
|
@@ -3851,7 +3985,7 @@ ${renderMarkdownScript}
|
|
|
3851
3985
|
'<div class="error" id="limitsError"></div>' +
|
|
3852
3986
|
'<div class="ed-actions"><button type="button" id="cancelLimitsBtn" data-dialog-cancel>Cancel</button><button type="submit" class="primary">Save</button></div>' +
|
|
3853
3987
|
'</form>') +
|
|
3854
|
-
'</section>';
|
|
3988
|
+
'</section></div>';
|
|
3855
3989
|
}
|
|
3856
3990
|
|
|
3857
3991
|
// Wires the Instructions / Model / Limits Edit buttons rendered by
|
|
@@ -4996,83 +5130,127 @@ ${renderMarkdownScript}
|
|
|
4996
5130
|
return s.run_at ? 'Once, ' + escapeHtml(fmtScheduleTime(s.run_at)) : 'Every ' + escapeHtml(s.every) + (s.anchor ? '<div class="hint">from ' + escapeHtml(fmtScheduleTime(s.anchor)) + '</div>' : '');
|
|
4997
5131
|
}
|
|
4998
5132
|
|
|
5133
|
+
// How often, in words, as the Schedules page says it: Daily at 09:00,
|
|
5134
|
+
// Weekly on Friday at 10:30, Every 6 hours, Once, Nov 27, 09:00.
|
|
5135
|
+
function scheduleClock(ms) {
|
|
5136
|
+
try { return new Date(ms).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', timeZone: schedulesTimeZone || undefined }); }
|
|
5137
|
+
catch (e) { return new Date(ms).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' }); }
|
|
5138
|
+
}
|
|
5139
|
+
function describeSchedule(t) {
|
|
5140
|
+
var s = t.schedule || {};
|
|
5141
|
+
if (s.run_at) return 'Once, ' + fmtScheduleTime(s.run_at);
|
|
5142
|
+
var m = String(s.every || '').match(/^([0-9]+)([smhd])$/);
|
|
5143
|
+
if (!m) return String(s.every || '');
|
|
5144
|
+
var n = Number(m[1]);
|
|
5145
|
+
var at = t.next_run_at ? Date.parse(t.next_run_at) : (s.anchor ? Date.parse(s.anchor) : 0);
|
|
5146
|
+
var weekday = function (ms) { try { return new Date(ms).toLocaleDateString('en-US', { weekday: 'long', timeZone: schedulesTimeZone || undefined }); } catch (e) { return ''; } };
|
|
5147
|
+
if (m[2] === 'd' && n === 1 && at) return 'Daily at ' + scheduleClock(at);
|
|
5148
|
+
if (m[2] === 'd' && n === 7 && at) return 'Weekly on ' + weekday(at) + ' at ' + scheduleClock(at);
|
|
5149
|
+
if (m[2] === 'd') return 'Every ' + n + ' days' + (at ? ' at ' + scheduleClock(at) : '');
|
|
5150
|
+
var unit = { s: 'second', m: 'minute', h: 'hour' }[m[2]];
|
|
5151
|
+
return n === 1 ? 'Every ' + unit : 'Every ' + n + ' ' + unit + 's';
|
|
5152
|
+
}
|
|
5153
|
+
function scheduleUntil(iso) {
|
|
5154
|
+
var ms = Date.parse(iso) - Date.now();
|
|
5155
|
+
if (!(ms > 0)) return 'any moment';
|
|
5156
|
+
var min = Math.round(ms / 60000);
|
|
5157
|
+
if (min < 60) return 'in ' + min + 'm';
|
|
5158
|
+
var h = Math.floor(min / 60);
|
|
5159
|
+
if (h < 48) return 'in ' + h + 'h ' + (min % 60) + 'm';
|
|
5160
|
+
return 'in ' + Math.round(h / 24) + ' days';
|
|
5161
|
+
}
|
|
5162
|
+
var SCHED_ICON_REPEAT = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 0 1-15.5 6.2"/><path d="M3 12A9 9 0 0 1 18.5 5.8"/><path d="M18 2v4h-4"/><path d="M6 22v-4h4"/></svg>';
|
|
5163
|
+
var SCHED_ICON_ONCE = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M16 3v4"/><path d="M8 3v4"/><path d="M3 11h18"/></svg>';
|
|
5164
|
+
var SCHED_ICON_DOTS = '<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="12" cy="19" r="1.7"/></svg>';
|
|
5165
|
+
|
|
5166
|
+
// A schedule as a card, as on the Schedules page: what it runs, a switch
|
|
5167
|
+
// to pause or resume it, Run now and the rest in its menu; how often, its
|
|
5168
|
+
// state and next run as chips; then its last run and history.
|
|
4999
5169
|
function renderScheduleRow(t) {
|
|
5000
|
-
var
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5170
|
+
var ended = t.status === 'cancelled' || t.status === 'done';
|
|
5171
|
+
var on = t.status !== 'paused';
|
|
5172
|
+
var title = t.task_name || (t.workflow && t.workflow.title) || String(t.message || '').split(String.fromCharCode(10))[0] || 'Untitled';
|
|
5173
|
+
var desc = t.workflow ? (t.workflow.description || t.workflow.start_message || '') : t.workflow_missing ? '' : (t.task_name ? t.message : '');
|
|
5174
|
+
var params = t.params ? Object.keys(t.params).map(function (k) { return escapeHtml(k) + ': ' + escapeHtml(t.params[k]); }).join(' ' + String.fromCharCode(183) + ' ') : '';
|
|
5175
|
+
var menu = [];
|
|
5176
|
+
if (t.status !== 'running' && t.status !== 'awaiting_approval' && !ended) menu.push('<button type="button" class="schedule-action" data-id="' + escapeHtml(t.task_id) + '" data-action="run">Run now</button>');
|
|
5177
|
+
if (t.workflow) menu.push('<a href="' + escapeHtml(workflowPageHref(currentName, t.workflow.id)) + '">Open its workflow</a>');
|
|
5178
|
+
menu.push(ended
|
|
5179
|
+
? '<button type="button" class="schedule-action delete-btn" data-id="' + escapeHtml(t.task_id) + '" data-action="delete">Delete</button>'
|
|
5180
|
+
: '<button type="button" class="schedule-action delete-btn" data-id="' + escapeHtml(t.task_id) + '" data-action="cancel">Remove</button>');
|
|
5181
|
+
var state = t.status === 'awaiting_approval' ? '<a href="#" class="sched-chip warn schedule-to-approvals">Waiting for approval</a>'
|
|
5182
|
+
: t.status === 'running' ? '<span class="sched-chip strong">Running now</span>'
|
|
5183
|
+
: t.status === 'done' ? '<span class="sched-chip">Done</span>'
|
|
5184
|
+
: t.status === 'cancelled' ? '<span class="sched-chip">Removed</span>'
|
|
5185
|
+
: t.last_status === 'error' ? '<span class="sched-chip bad">Last run failed</span>' : '';
|
|
5186
|
+
var next = ended ? '' : !on ? 'Paused' : t.next_run_at ? 'Next run ' + scheduleUntil(t.next_run_at) : '';
|
|
5006
5187
|
var lastOutcome = t.last_status === 'ok' ? (t.last_result || '') : (t.last_error || '');
|
|
5007
5188
|
var last = t.last_run_at
|
|
5008
|
-
? '<span class="le-pill ' + (t.last_status === 'ok' ? 'good' : 'bad') + '">' + escapeHtml(t.last_status) + '</span> ' +
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
: '<span class="hint">not run yet</span>';
|
|
5189
|
+
? '<div class="sched-last"><span class="sched-last-k">Last run</span><span class="le-pill ' + (t.last_status === 'ok' ? 'good' : 'bad') + '">' + escapeHtml(t.last_status === 'ok' ? 'done' : t.last_status) + '</span> <span class="hint">' + escapeHtml(fmtScheduleTime(t.last_run_at)) + '</span>' +
|
|
5190
|
+
(lastOutcome ? '<div class="schedule-result workflow-markdown">' + renderMarkdownPreview(lastOutcome) + '</div>' : '') + '</div>'
|
|
5191
|
+
: '';
|
|
5012
5192
|
var history = (t.history || []).slice().reverse().map(function (h) {
|
|
5013
5193
|
var outcome = h.status === 'ok' ? (h.result || '') : (h.error || '');
|
|
5014
5194
|
return '<li><span class="le-pill ' + (h.status === 'ok' ? 'good' : 'bad') + '">' + escapeHtml(h.status) + '</span> <span class="hint">' + escapeHtml(fmtScheduleTime(h.ran_at)) + '</span>' +
|
|
5015
5195
|
(outcome ? '<div class="schedule-result workflow-markdown">' + renderMarkdownPreview(outcome) + '</div>' : '') + '</li>';
|
|
5016
5196
|
}).join('');
|
|
5017
|
-
return '<
|
|
5018
|
-
'<
|
|
5019
|
-
(
|
|
5020
|
-
? '<
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
// A workflow's
|
|
5027
|
-
|
|
5028
|
-
(
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
'<td><span class="le-pill ' + (SCHEDULE_PILLS[t.status] || 'neutral') + '">' + escapeHtml(SCHEDULE_LABELS[t.status] || t.status) + '</span>' +
|
|
5033
|
-
(t.status === 'awaiting_approval' ? '<div class="hint"><a href="#" class="schedule-to-approvals">Decide in Messaging</a></div>' : '') + '</td>' +
|
|
5034
|
-
'<td style="min-width:200px">' + last + (history ? '<details><summary class="hint">History (' + (t.history || []).length + ')</summary><ul class="schedule-history">' + history + '</ul></details>' : '') + '</td>' +
|
|
5035
|
-
'<td><div style="display:flex;gap:6px;flex-wrap:wrap">' + actions.map(function (a) {
|
|
5036
|
-
return '<button type="button" class="schedule-action' + (a[0] === 'run' ? ' primary' : '') + (a[0] === 'cancel' || a[0] === 'delete' ? ' delete-btn' : '') + '" data-id="' + escapeHtml(t.task_id) + '" data-action="' + a[0] + '"' + (t.workflow_id ? ' data-workflow="' + escapeHtml(t.workflow_id) + '"' : '') + '>' + a[1] + '</button>';
|
|
5037
|
-
}).join('') + '</div></td></tr>';
|
|
5197
|
+
return '<div class="sched-card' + (on && !ended ? '' : ' is-off') + '" id="schedule-' + escapeHtml(t.task_id) + '">' +
|
|
5198
|
+
'<div class="sched-card-head"><span class="sched-icon">' + (t.schedule && t.schedule.run_at ? SCHED_ICON_ONCE : SCHED_ICON_REPEAT) + '</span>' +
|
|
5199
|
+
'<span class="sched-card-text"><span class="sched-card-title">' + escapeHtml(title) + '</span>' +
|
|
5200
|
+
(t.workflow_missing ? '<span class="le-pill bad" style="justify-self:start">Its workflow was removed</span>' : desc ? '<span class="sched-card-desc">' + escapeHtml(desc) + '</span>' : '') +
|
|
5201
|
+
(params ? '<span class="hint">' + params + '</span>' : '') + '</span>' +
|
|
5202
|
+
(ended ? '<span></span>' : '<button type="button" class="le-switch schedule-action" role="switch" aria-checked="' + on + '" aria-label="' + (on ? 'Pause ' : 'Resume ') + escapeHtml(title) + '" data-id="' + escapeHtml(t.task_id) + '" data-action="' + (on ? 'pause' : 'resume') + '"' + (t.status === 'running' || t.status === 'awaiting_approval' ? ' disabled' : '') + '></button>') +
|
|
5203
|
+
'<details class="sched-menu"><summary aria-label="More">' + SCHED_ICON_DOTS + '</summary><div class="sched-menu-list">' + menu.join('') + '</div></details></div>' +
|
|
5204
|
+
'<div class="sched-chips"><span class="sched-chip strong">' + escapeHtml(describeSchedule(t)) + '</span>' +
|
|
5205
|
+
(t.workflow ? '<a class="sched-chip" href="' + escapeHtml(workflowPageHref(currentName, t.workflow.id)) + '">Workflow: ' + escapeHtml(t.workflow.title) + '</a>' : !t.workflow_id ? '<span class="sched-chip">Message</span>' : '') +
|
|
5206
|
+
// A message's result to chat, switched here; a workflow's follows its Messaging tab.
|
|
5207
|
+
(!ended && !t.workflow_id ? '<label class="sched-chip"><input type="checkbox" class="schedule-notify-toggle" data-id="' + escapeHtml(t.task_id) + '"' + (t.notify ? ' checked' : '') + '> Result to chat</label>' : '') +
|
|
5208
|
+
state + (next ? '<span class="sched-next">' + escapeHtml(next) + '</span>' : '') + '</div>' +
|
|
5209
|
+
last +
|
|
5210
|
+
(history ? '<details class="sched-history"><summary class="hint">History (' + (t.history || []).length + ')</summary><ul class="schedule-history">' + history + '</ul></details>' : '') +
|
|
5211
|
+
'</div>';
|
|
5038
5212
|
}
|
|
5039
5213
|
|
|
5040
5214
|
function renderSchedulesHtml(tasks) {
|
|
5041
5215
|
var active = tasks.filter(function (t) { return t.status !== 'cancelled' && t.status !== 'done'; });
|
|
5042
|
-
var
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5216
|
+
var ended = tasks.filter(function (t) { return t.status === 'cancelled' || t.status === 'done'; });
|
|
5217
|
+
var grid = function (list) { return '<div class="le-grid sched-cards">' + list.map(renderScheduleRow).join('') + (list.length % 2 ? '<div class="sched-card" aria-hidden="true"></div>' : '') + '</div>'; };
|
|
5218
|
+
var list = (active.length ? grid(active) : '<p class="hint">Nothing scheduled yet. Add one with + Add schedule.</p>') +
|
|
5219
|
+
(ended.length ? '<details class="sched-ended"><summary class="hint">Ended (' + ended.length + ')</summary>' + grid(ended) + '</details>' : '');
|
|
5220
|
+
return '<div class="sched-top"><p class="muted" style="margin:0">Workflows and messages this agent runs on a timer, like a cron job. A workflow schedule runs the workflow's instructions as they are at each run. Each run works like an app calling it over HTTP: an approval goes wherever the Messaging Apps tab sends it, and with nowhere set, a call that needs approval is denied. The agent can also schedule its own tasks when asked in Chat (“remind me tomorrow at 9”); they appear here too.</p><button type="button" class="le-btn-dark" id="scheduleAddBtn">+ Add schedule</button></div>' +
|
|
5046
5221
|
'<section><h3>Scheduled (' + active.length + ' active)</h3>' + list + '</section>' +
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
'</
|
|
5059
|
-
: '') +
|
|
5060
|
-
|
|
5061
|
-
'<div class="body-field">When' +
|
|
5062
|
-
'<div class="schedule-when"><input type="radio" name="when" value="every" id="whenEvery" checked><label for="whenEvery">Every</label>' +
|
|
5063
|
-
'<input type="number" name="everyN" value="1" min="1" aria-label="How many">' +
|
|
5064
|
-
'<select name="everyUnit" aria-label="Unit"><option value="m">minutes</option><option value="h" selected>hours</option><option value="d">days</option><option value="w">weeks</option></select>' +
|
|
5065
|
-
'<label for="everyStart">starting</label><input type="datetime-local" name="everyStart" id="everyStart" aria-label="First run"></div>' +
|
|
5066
|
-
'<p class="hint" style="margin:0 0 4px 22px">Optional. The first run, which sets the time of day (and the weekday, for weeks) every later run keeps, e.g. every 1 day starting tomorrow 09:00. Without it, the first run is one interval from now.' +
|
|
5067
|
-
(schedulesTimeZone ? ' Times are in ' + escapeHtml(schedulesTimeZone.replace(/_/g, ' ')) + ' (<a href="/config?section=settings">change</a>).' : '') + '</p>' +
|
|
5068
|
-
'<div class="schedule-when"><input type="radio" name="when" value="once" id="whenOnce"><label for="whenOnce">Once at</label>' +
|
|
5069
|
-
'<input type="datetime-local" name="runAt" aria-label="Date and time"></div>' +
|
|
5222
|
+
// + Add schedule opens this, like Create schedule on the Schedules page.
|
|
5223
|
+
'<dialog class="sched-dialog" id="scheduleDialog" aria-labelledby="scheduleDlgTitle">' +
|
|
5224
|
+
'<form id="scheduleForm">' +
|
|
5225
|
+
'<div class="sched-dlg-head"><h2 id="scheduleDlgTitle">Create schedule</h2><button type="button" id="scheduleCancel">Cancel</button><button type="submit" class="primary">Save</button></div>' +
|
|
5226
|
+
// The same settings as Create schedule on the Schedules page, and
|
|
5227
|
+
// here a message can run instead of a workflow.
|
|
5228
|
+
'<div class="sched-dlg-body"><div class="sched-dlg-col">' +
|
|
5229
|
+
'<div class="sched-field"><span class="sched-field-k">Runs</span>' +
|
|
5230
|
+
'<input type="hidden" name="runs" value="' + (schedulesWorkflows.length ? 'workflow' : 'message') + '">' +
|
|
5231
|
+
(schedulesWorkflows.length ? '<span class="le-seg" id="scheduleRuns"><button type="button" data-runs="workflow" aria-pressed="true">A workflow</button><button type="button" data-runs="message" aria-pressed="false">A message</button></span>' : '') +
|
|
5232
|
+
(schedulesWorkflows.length ? '<select name="workflow_id" aria-label="Workflow" id="scheduleWorkflowField">' + schedulesWorkflows.map(function (w) {
|
|
5233
|
+
return '<option value="' + escapeHtml(w.id) + '">' + escapeHtml(w.title) + '</option>';
|
|
5234
|
+
}).join('') + '</select>' : '') +
|
|
5235
|
+
'<div id="scheduleMessageField" class="sched-message"' + (schedulesWorkflows.length ? ' hidden' : '') + '><textarea name="message" placeholder="Summarize yesterday's support tickets and post the summary."></textarea><span class="hint">What the agent receives each time, as if someone typed it.</span></div>' +
|
|
5070
5236
|
'</div>' +
|
|
5071
|
-
'<label>Name <span class="hint">(optional)</span><input name="task_name" placeholder="
|
|
5072
|
-
'<
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5237
|
+
'<label class="sched-field"><span class="sched-field-k">Name <span class="hint">(optional)</span></span><input name="task_name" maxlength="80" placeholder="e.g. Monday sales summary"></label>' +
|
|
5238
|
+
'<div class="sched-field"><span class="sched-field-k">Schedule</span>' +
|
|
5239
|
+
'<span class="le-seg" id="scheduleKind"><button type="button" data-skind="repeat" aria-pressed="true">Recurring</button><button type="button" data-skind="once" aria-pressed="false">One time</button></span>' +
|
|
5240
|
+
'<span class="le-seg" id="scheduleFreq"><button type="button" data-sfreq="interval" aria-pressed="false">Interval</button><button type="button" data-sfreq="daily" aria-pressed="true">Daily</button><button type="button" data-sfreq="weekly" aria-pressed="false">Weekly</button></span>' +
|
|
5241
|
+
'<div class="sched-row" data-swhen="interval" hidden><input type="number" name="everyN" min="1" step="1" value="1" aria-label="Every"><select name="everyUnit" aria-label="Unit"><option value="m">minutes</option><option value="h" selected>hours</option><option value="d">days</option></select></div>' +
|
|
5242
|
+
'<div class="sched-row" data-swhen="daily"><input type="time" name="dailyAt" value="09:00" aria-label="At"></div>' +
|
|
5243
|
+
'<div class="sched-row" data-swhen="weekly" hidden><select name="weekday" aria-label="On">' + ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'].map(function (d) { return '<option value="' + d + '">' + d.charAt(0).toUpperCase() + d.slice(1) + '</option>'; }).join('') + '</select><input type="time" name="weeklyAt" value="09:00" aria-label="At"></div>' +
|
|
5244
|
+
'<div class="sched-row" data-swhen="once" hidden><input type="date" name="onceDate" aria-label="Date"><input type="time" name="onceAt" value="09:00" aria-label="At"></div>' +
|
|
5245
|
+
(schedulesTimeZone ? '<p class="hint" style="margin:0">Times are in ' + escapeHtml(schedulesTimeZone.replace(/_/g, ' ')) + ', the workspace' + String.fromCharCode(8217) + 's time zone (<a href="/config?section=settings">change</a>).</p>' : '') +
|
|
5246
|
+
'</div>' +
|
|
5247
|
+
'</div><div class="sched-dlg-col">' +
|
|
5248
|
+
(schedulesWorkflows.length ? '<div class="sched-field" id="scheduleInputsField"><span class="sched-field-k">Inputs for every run</span><div class="workflow-params" id="scheduleParams"></div><p class="hint" style="margin:0">Each run follows the workflow's instructions as they are then, so changing the workflow changes what runs.</p></div>' : '') +
|
|
5249
|
+
'<div class="sched-field" id="scheduleNotifyField"' + (schedulesWorkflows.length ? ' hidden' : '') + '><div class="sched-switch-row"><span class="sched-field-k">Send each result to chat</span><input type="checkbox" name="notify" aria-label="Send each result to chat"></div><p class="hint" style="margin:0">After every run, its result goes to the agent's messaging app (Slack, Telegram, Lark or email), if it has one. A workflow's results go where its Messaging tab says.</p></div>' +
|
|
5250
|
+
'<div class="sched-field"><span class="sched-field-k">When it starts</span><p class="hint" style="margin:0">Right away: the first run is at the next time you chose. Pause or remove it from the list.</p></div>' +
|
|
5251
|
+
'</div></div>' +
|
|
5252
|
+
'<div class="sched-dlg-foot"><span id="scheduleResult"></span></div>' +
|
|
5253
|
+
'</form></dialog>';
|
|
5076
5254
|
}
|
|
5077
5255
|
|
|
5078
5256
|
// The New schedule form's parameter fields ("param:<name>"), filled ones only.
|
|
@@ -5101,7 +5279,7 @@ ${renderMarkdownScript}
|
|
|
5101
5279
|
var action = btn.dataset.action;
|
|
5102
5280
|
if ((action === 'cancel' || action === 'delete') && btn.dataset.confirming !== '1') {
|
|
5103
5281
|
btn.dataset.confirming = '1';
|
|
5104
|
-
btn.textContent = 'Click again to '
|
|
5282
|
+
btn.textContent = action === 'cancel' ? 'Click again to remove' : 'Click again to delete';
|
|
5105
5283
|
return;
|
|
5106
5284
|
}
|
|
5107
5285
|
btn.disabled = true;
|
|
@@ -5131,7 +5309,6 @@ ${renderMarkdownScript}
|
|
|
5131
5309
|
var form = content.querySelector('#scheduleForm');
|
|
5132
5310
|
var result = content.querySelector('#scheduleResult');
|
|
5133
5311
|
var messageField = content.querySelector('#scheduleMessageField');
|
|
5134
|
-
var runsRadios = content.querySelectorAll('input[name="runs"]');
|
|
5135
5312
|
var paramsBox = content.querySelector('#scheduleParams');
|
|
5136
5313
|
var workflowSelect = form.querySelector('select[name="workflow_id"]');
|
|
5137
5314
|
// One field per parameter of the chosen workflow.
|
|
@@ -5144,42 +5321,74 @@ ${renderMarkdownScript}
|
|
|
5144
5321
|
inputControlHtml('param:' + p, parameters[p], false) + '</label>';
|
|
5145
5322
|
}).join('');
|
|
5146
5323
|
}
|
|
5324
|
+
// + Add schedule opens the form in a dialog.
|
|
5325
|
+
var dialog = content.querySelector('#scheduleDialog');
|
|
5326
|
+
var openDialog = function () { result.textContent = ''; if (!dialog.open) dialog.showModal(); };
|
|
5327
|
+
content.querySelector('#scheduleAddBtn').addEventListener('click', openDialog);
|
|
5328
|
+
content.querySelector('#scheduleCancel').addEventListener('click', function () { dialog.close(); });
|
|
5329
|
+
dialog.addEventListener('click', function (ev) { if (ev.target === dialog) dialog.close(); });
|
|
5147
5330
|
// Opened from a workflow's "Add a schedule": that workflow, chosen.
|
|
5148
5331
|
if (pendingScheduleWorkflow && workflowSelect) {
|
|
5149
5332
|
workflowSelect.value = pendingScheduleWorkflow;
|
|
5150
|
-
|
|
5151
|
-
if (runsWorkflowRadio) runsWorkflowRadio.checked = true;
|
|
5152
|
-
form.scrollIntoView({ block: 'start' });
|
|
5333
|
+
openDialog();
|
|
5153
5334
|
}
|
|
5154
5335
|
pendingScheduleWorkflow = null;
|
|
5155
5336
|
focusScheduleRow();
|
|
5156
5337
|
renderScheduleParams();
|
|
5157
5338
|
if (workflowSelect) workflowSelect.addEventListener('change', renderScheduleParams);
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5339
|
+
// A workflow or a message; Recurring (an interval, daily or weekly) or
|
|
5340
|
+
// one time: segmented controls, as on the Schedules page.
|
|
5341
|
+
var press = function (box, attr, value) {
|
|
5342
|
+
var bs = box ? box.querySelectorAll('[' + attr + ']') : [];
|
|
5343
|
+
for (var q = 0; q < bs.length; q++) bs[q].setAttribute('aria-pressed', String(bs[q].getAttribute(attr) === value));
|
|
5344
|
+
};
|
|
5345
|
+
var runsBox = form.querySelector('#scheduleRuns');
|
|
5346
|
+
if (runsBox) runsBox.addEventListener('click', function (ev) {
|
|
5347
|
+
var bt = ev.target.closest('[data-runs]');
|
|
5348
|
+
if (!bt) return;
|
|
5349
|
+
var byMessage = bt.getAttribute('data-runs') === 'message';
|
|
5350
|
+
form.runs.value = byMessage ? 'message' : 'workflow';
|
|
5351
|
+
press(runsBox, 'data-runs', form.runs.value);
|
|
5352
|
+
messageField.hidden = byMessage ? false : true;
|
|
5353
|
+
if (workflowSelect) workflowSelect.hidden = byMessage;
|
|
5354
|
+
var inputs = form.querySelector('#scheduleInputsField');
|
|
5355
|
+
if (inputs) inputs.hidden = byMessage;
|
|
5356
|
+
// A workflow's result goes where its Messaging tab says.
|
|
5357
|
+
form.querySelector('#scheduleNotifyField').hidden = !byMessage;
|
|
5358
|
+
});
|
|
5359
|
+
var skind = 'repeat', sfreq = 'daily';
|
|
5360
|
+
var showWhen = function () {
|
|
5361
|
+
form.querySelector('#scheduleFreq').hidden = skind !== 'repeat';
|
|
5362
|
+
var rows = form.querySelectorAll('[data-swhen]');
|
|
5363
|
+
for (var q = 0; q < rows.length; q++) rows[q].hidden = rows[q].getAttribute('data-swhen') !== (skind === 'once' ? 'once' : sfreq);
|
|
5364
|
+
};
|
|
5365
|
+
form.querySelector('#scheduleKind').addEventListener('click', function (ev) {
|
|
5366
|
+
var bt = ev.target.closest('[data-skind]');
|
|
5367
|
+
if (!bt) return;
|
|
5368
|
+
skind = bt.getAttribute('data-skind'); press(form.querySelector('#scheduleKind'), 'data-skind', skind); showWhen();
|
|
5369
|
+
});
|
|
5370
|
+
form.querySelector('#scheduleFreq').addEventListener('click', function (ev) {
|
|
5371
|
+
var bt = ev.target.closest('[data-sfreq]');
|
|
5372
|
+
if (!bt) return;
|
|
5373
|
+
sfreq = bt.getAttribute('data-sfreq'); press(form.querySelector('#scheduleFreq'), 'data-sfreq', sfreq); showWhen();
|
|
5374
|
+
});
|
|
5375
|
+
var tomorrow = new Date(Date.now() + 86400000);
|
|
5376
|
+
form.onceDate.value = tomorrow.getFullYear() + '-' + String(tomorrow.getMonth() + 1).padStart(2, '0') + '-' + String(tomorrow.getDate()).padStart(2, '0');
|
|
5168
5377
|
form.addEventListener('submit', function (ev) {
|
|
5169
5378
|
ev.preventDefault();
|
|
5170
5379
|
var data = new FormData(form);
|
|
5171
5380
|
var runsWorkflow = data.get('runs') === 'workflow';
|
|
5172
5381
|
if (!runsWorkflow && !String(data.get('message') || '').trim()) { result.textContent = 'Write the message the agent receives.'; return; }
|
|
5173
5382
|
var schedule;
|
|
5174
|
-
if (
|
|
5175
|
-
if (!data.get('
|
|
5176
|
-
schedule = { run_at: scheduleFormTime(data.get('
|
|
5383
|
+
if (skind === 'once') {
|
|
5384
|
+
if (!data.get('onceDate') || !data.get('onceAt')) { result.textContent = 'Pick a date and time.'; return; }
|
|
5385
|
+
schedule = { run_at: scheduleFormTime(data.get('onceDate') + 'T' + data.get('onceAt')) };
|
|
5386
|
+
} else if (sfreq === 'interval') {
|
|
5387
|
+
schedule = { every: String(Math.max(1, Number(data.get('everyN')) || 1)) + data.get('everyUnit') };
|
|
5388
|
+
} else if (sfreq === 'weekly') {
|
|
5389
|
+
schedule = { every: '7d', at: data.get('weeklyAt') || '09:00', weekday: data.get('weekday') };
|
|
5177
5390
|
} else {
|
|
5178
|
-
|
|
5179
|
-
var unit = data.get('everyUnit');
|
|
5180
|
-
var n = Number(data.get('everyN')) || 1;
|
|
5181
|
-
schedule = { every: unit === 'w' ? String(n * 7) + 'd' : String(n) + unit };
|
|
5182
|
-
if (data.get('everyStart')) schedule.start_at = scheduleFormTime(data.get('everyStart'));
|
|
5391
|
+
schedule = { every: '1d', at: data.get('dailyAt') || '09:00' };
|
|
5183
5392
|
}
|
|
5184
5393
|
result.textContent = 'Scheduling' + String.fromCharCode(8230);
|
|
5185
5394
|
// Live at once, a workflow's schedule too (it's how the workflow
|
|
@@ -5192,7 +5401,8 @@ ${renderMarkdownScript}
|
|
|
5192
5401
|
{ schedule: schedule, task_name: data.get('task_name'), result_to_chat: !runsWorkflow && data.get('notify') === 'on' }
|
|
5193
5402
|
)),
|
|
5194
5403
|
}).then(function (r) {
|
|
5195
|
-
if (!r.ok) { result.
|
|
5404
|
+
if (!r.ok) { result.innerHTML = '<span class="error">' + escapeHtml(r.body.error || 'Could not schedule') + '</span>'; return; }
|
|
5405
|
+
dialog.close();
|
|
5196
5406
|
loadSchedulesTab(name);
|
|
5197
5407
|
});
|
|
5198
5408
|
});
|
|
@@ -5202,6 +5412,9 @@ ${renderMarkdownScript}
|
|
|
5202
5412
|
var content = schedulesContentEl();
|
|
5203
5413
|
if (!content) return;
|
|
5204
5414
|
if (schedulesRefreshTimer) { clearTimeout(schedulesRefreshTimer); schedulesRefreshTimer = null; }
|
|
5415
|
+
// Not while someone is filling in Create schedule: try again shortly.
|
|
5416
|
+
var openDlg = content.querySelector('#scheduleDialog');
|
|
5417
|
+
if (openDlg && openDlg.open) { schedulesRefreshTimer = setTimeout(function () { loadSchedulesTab(name); }, 3000); return; }
|
|
5205
5418
|
fetchJsonRetryOnce('/agents/' + encodeURIComponent(name) + '/schedules').then(function (r) {
|
|
5206
5419
|
if (currentName !== name) return;
|
|
5207
5420
|
if (!r.ok) throw new Error(r.body.error || 'request failed');
|
|
@@ -16,7 +16,7 @@ export const agentsListPageHtml = `<!doctype html>
|
|
|
16
16
|
<title>LoopEngine Agents</title>
|
|
17
17
|
<style>${devUiCss}${MASCOT_CSS}
|
|
18
18
|
.ag { max-width: 1120px; display: grid; gap: 0; }
|
|
19
|
-
.ag-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px
|
|
19
|
+
.ag-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 22px 28px; border: 1px solid var(--line); border-bottom: 0; }
|
|
20
20
|
.ag-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
|
|
21
21
|
.ag-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
22
22
|
.ag-cols1 { grid-template-columns: minmax(0, 1fr); }
|
|
@@ -72,7 +72,7 @@ export const agentsListPageHtml = `<!doctype html>
|
|
|
72
72
|
.ag-dlg-foot { padding: 12px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); min-height: 46px; display: flex; align-items: center; }
|
|
73
73
|
.ag-dlg-foot:not(:has(.error[style*="block"])) { display: none; }
|
|
74
74
|
@media (max-width: 860px) {
|
|
75
|
-
.ag-hero { padding: 24px
|
|
75
|
+
.ag-hero { padding: 24px 22px 20px; }
|
|
76
76
|
.ag-hero .le-mascot { display: none; }
|
|
77
77
|
.ag-cols2 { grid-template-columns: minmax(0, 1fr); }
|
|
78
78
|
.ag-dlg-body { grid-template-columns: minmax(0, 1fr); }
|
|
@@ -325,11 +325,15 @@ export const consoleShellScript = `<script>
|
|
|
325
325
|
: (counts[t[0]] != null ? '<span class="le-count">' + counts[t[0]] + '</span>' : '');
|
|
326
326
|
return '<a class="le-tab" data-tab="' + t[0] + '" href="' + tabHref(opts.name, t[0]) + '" aria-selected="' + (t[0] === opts.tab) + '">' + t[1] + count + '</a>';
|
|
327
327
|
}).join('');
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
'<
|
|
328
|
+
// A top bar like the other pages': where you are (Agents / its name),
|
|
329
|
+
// its model and permissions as chips; then its tabs, as a segmented
|
|
330
|
+
// control. Its instructions are on Overview.
|
|
331
|
+
return '<div class="le-head le-agent-head"><div class="le-agent-bar">' +
|
|
332
|
+
'<button type="button" class="le-menu-btn" data-le-menu aria-label="Open navigation">☰</button>' +
|
|
333
|
+
'<h1 class="le-crumb"><a href="/agents">Agents</a><span class="le-crumb-sep" aria-hidden="true">/</span>' +
|
|
334
|
+
'<span class="le-crumb-here"><span data-le-head-name>' + esc(opts.displayName || opts.name) + '</span>' +
|
|
335
|
+
'<span class="le-head-id" data-le-head-id' + (opts.displayName ? '' : ' hidden') + '>' + esc(opts.name) + '</span></span></h1>' +
|
|
336
|
+
'<span class="le-topbar-gap"></span><div class="le-chips">' + chips + '</div></div>' +
|
|
333
337
|
'<nav class="le-tabs" aria-label="Agent sections">' + tabs + '</nav></div>';
|
|
334
338
|
}
|
|
335
339
|
|
|
@@ -209,16 +209,32 @@ export const devUiCss = `
|
|
|
209
209
|
.le-head-id { margin-left: 10px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0; vertical-align: middle; }
|
|
210
210
|
.le-title p { margin: 4px 0 0; color: var(--ink-muted); max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
211
211
|
.le-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
|
|
212
|
-
.le-chip { font-size: 12px; padding:
|
|
212
|
+
.le-chip { display: inline-flex; align-items: center; height: 26px; font-size: 12px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-muted); white-space: nowrap; }
|
|
213
213
|
.le-chip.mono { font-family: var(--font-mono); font-size: 11.5px; }
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
/* An agent's header: a top bar (Agents / its name, its chips), then its
|
|
215
|
+
tabs as a segmented control. */
|
|
216
|
+
.le-agent-head { padding: 0; gap: 0; }
|
|
217
|
+
.le-agent-bar { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 10px 20px; }
|
|
218
|
+
.le-crumb { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
|
|
219
|
+
.le-crumb a { color: var(--ink-muted); text-decoration: none; }
|
|
220
|
+
.le-crumb a:hover { color: var(--ink); }
|
|
221
|
+
.le-crumb-sep { color: var(--ink-faint); font-weight: 400; }
|
|
222
|
+
.le-crumb-here { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
223
|
+
.le-agent-head .le-head-id { font-size: 12px; margin-left: 8px; }
|
|
224
|
+
.le-tabs { display: flex; gap: 2px; width: fit-content; max-width: calc(100% - 40px); margin: 0 20px 14px; padding: 3px; border-radius: 10px; background: var(--surface); overflow-x: auto; scrollbar-width: none; }
|
|
225
|
+
.le-tab { height: 30px; padding: 0 12px; border-radius: 8px; color: var(--ink-muted); white-space: nowrap; display: flex; gap: 6px; align-items: center; text-decoration: none; font-size: 13px; font-weight: 500; }
|
|
216
226
|
.le-tab:hover { color: var(--ink); }
|
|
217
|
-
.le-tab[aria-selected="true"] { color: var(--ink);
|
|
218
|
-
.le-count { font-size: 11px; background: var(--surface-2); color: var(--ink-muted); padding: 0 6px; border-radius:
|
|
227
|
+
.le-tab[aria-selected="true"] { color: var(--ink); background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
|
|
228
|
+
.le-count { font-size: 11px; background: var(--surface-2); color: var(--ink-muted); padding: 0 6px; border-radius: 6px; }
|
|
219
229
|
.le-count.warn { background: var(--warn-soft); color: var(--warn); }
|
|
220
230
|
.le-menu-btn { display: none; border: 0; background: transparent; padding: 2px 6px; font-size: 18px; line-height: 1; color: var(--ink-muted); }
|
|
221
231
|
.le-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
|
|
232
|
+
/* Cards in a hairline grid (.le-grid): cells share their lines. */
|
|
233
|
+
.le-grid.le-cards { gap: 0; }
|
|
234
|
+
.le-grid > .le-card { border-width: 0 1px 1px 0; border-radius: 0; padding: 20px 22px; gap: 4px; }
|
|
235
|
+
.le-grid > a.le-card:hover { border-color: var(--line); box-shadow: none; background: var(--surface); }
|
|
236
|
+
.le-grid > .le-card .le-card-value { font-size: 28px; font-weight: 400; letter-spacing: -0.02em; }
|
|
237
|
+
.le-grid > .le-card.attention { box-shadow: none; background: var(--warn-soft); }
|
|
222
238
|
.le-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; align-content: start; color: var(--ink); text-decoration: none; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
|
|
223
239
|
a.le-card:hover { border-color: var(--ink-faint); box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
|
|
224
240
|
.le-card .le-card-label { font-size: 12px; color: var(--ink-faint); display: flex; justify-content: space-between; }
|
package/dist/web/goals-page.js
CHANGED
|
@@ -42,13 +42,13 @@ const goalsPageTemplate = `<!doctype html>
|
|
|
42
42
|
.gl-new-btn { text-decoration: none; }
|
|
43
43
|
.gl-new-btn[hidden], .le-search[hidden] { display: none; }
|
|
44
44
|
/* The top of each view: a big, light title, a line under it, the mascot. */
|
|
45
|
-
.gl-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px
|
|
45
|
+
.gl-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 22px 28px; border: 1px solid var(--line); border-bottom: 0; }
|
|
46
46
|
.gl-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
|
|
47
47
|
.gl-hero-text { display: grid; gap: 10px; min-width: 0; }
|
|
48
48
|
.gl-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
|
|
49
49
|
.gl-display { margin: 0; font-size: 32px; line-height: 1.18; font-weight: 400; letter-spacing: -0.025em; color: var(--ink); overflow-wrap: anywhere; }
|
|
50
50
|
.gl-hero-sub { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-muted); max-width: 70ch; }
|
|
51
|
-
.gl-section-title { margin: 0; padding: 30px
|
|
51
|
+
.gl-section-title { margin: 0; padding: 30px 22px 16px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; border-left: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
|
|
52
52
|
.gl-section-title .hint { font-size: 13px; letter-spacing: 0; }
|
|
53
53
|
.gl-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; }
|
|
54
54
|
.gl-cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
@@ -171,10 +171,10 @@ const goalsPageTemplate = `<!doctype html>
|
|
|
171
171
|
.hint { font-size: 12.5px; color: var(--ink-muted); }
|
|
172
172
|
.error { font-size: 13px; color: var(--bad); margin: 0; }
|
|
173
173
|
@media (max-width: 860px) {
|
|
174
|
-
.gl-hero { padding: 24px
|
|
174
|
+
.gl-hero { padding: 24px 22px 20px; }
|
|
175
175
|
.gl-hero .le-mascot { display: none; }
|
|
176
176
|
.gl-cols2, .gl-cols3 { grid-template-columns: minmax(0, 1fr); }
|
|
177
|
-
.gl-section-title { padding: 24px
|
|
177
|
+
.gl-section-title { padding: 24px 22px 14px; }
|
|
178
178
|
.le-search { display: none; }
|
|
179
179
|
}
|
|
180
180
|
</style>
|
|
@@ -31,7 +31,7 @@ export const schedulesPageHtml = `<!doctype html>
|
|
|
31
31
|
<title>Schedules</title>
|
|
32
32
|
<style>${devUiCss}${MASCOT_CSS}
|
|
33
33
|
.sc { max-width: 1120px; display: grid; gap: 0; }
|
|
34
|
-
.sc-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px
|
|
34
|
+
.sc-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 22px 28px; border: 1px solid var(--line); border-bottom: 0; }
|
|
35
35
|
.sc-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
|
|
36
36
|
.sc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
37
37
|
.sc-card { display: grid; gap: 14px; padding: 20px 22px; background: var(--bg); }
|
|
@@ -57,7 +57,7 @@ export const schedulesPageHtml = `<!doctype html>
|
|
|
57
57
|
.sc-menu-list { display: none; position: absolute; right: 0; top: 32px; z-index: 20; min-width: 170px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
|
|
58
58
|
.sc-menu-list a, .sc-menu-list button { display: block; width: 100%; text-align: left; height: auto; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font-size: 13px; color: var(--ink); text-decoration: none; }
|
|
59
59
|
.sc-menu-list a:hover, .sc-menu-list button:hover:not(:disabled) { background: var(--surface); }
|
|
60
|
-
.sc-section-title { margin: 0; padding: 30px
|
|
60
|
+
.sc-section-title { margin: 0; padding: 30px 22px 16px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
|
|
61
61
|
.sc-adds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
62
62
|
.sc-add { display: grid; gap: 6px; align-content: start; padding: 22px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: var(--bg); text-align: left; height: auto; cursor: pointer; transition: background .15s; }
|
|
63
63
|
.sc-add:hover:not(:disabled) { background: var(--surface); }
|
|
@@ -119,7 +119,7 @@ export const schedulesPageHtml = `<!doctype html>
|
|
|
119
119
|
.hint { font-size: 12.5px; color: var(--ink-muted); }
|
|
120
120
|
.error { font-size: 13px; color: var(--bad); margin: 0; }
|
|
121
121
|
@media (max-width: 860px) {
|
|
122
|
-
.sc-hero { padding: 24px
|
|
122
|
+
.sc-hero { padding: 24px 22px 20px; }
|
|
123
123
|
.sc-cards, .sc-adds { grid-template-columns: minmax(0, 1fr); }
|
|
124
124
|
.sc-week { grid-template-columns: minmax(0, 1fr); }
|
|
125
125
|
.sc-day { min-height: 0; }
|
|
@@ -14,7 +14,7 @@ export const workflowsOverviewPageHtml = `<!doctype html>
|
|
|
14
14
|
<title>Workflows</title>
|
|
15
15
|
<style>${devUiCss}${MASCOT_CSS}
|
|
16
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
|
|
17
|
+
.wo-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 22px 28px; border: 1px solid var(--line); border-bottom: 0; }
|
|
18
18
|
.wo-hero .le-mascot { flex: none; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .12)); }
|
|
19
19
|
.wo-cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
20
20
|
.wo-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
@@ -24,7 +24,7 @@ export const workflowsOverviewPageHtml = `<!doctype html>
|
|
|
24
24
|
.wo-stat span { font-size: 13px; color: var(--ink-muted); }
|
|
25
25
|
.wo-stat.warn b { color: var(--warn); }
|
|
26
26
|
.wo-stat.bad b { color: var(--bad); }
|
|
27
|
-
.wo-section-title { margin: 0; padding: 30px
|
|
27
|
+
.wo-section-title { margin: 0; padding: 30px 22px 16px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
|
|
28
28
|
.wo-card { display: grid; gap: 14px; align-content: start; padding: 20px 22px; background: var(--bg); }
|
|
29
29
|
.wo-card-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
|
|
30
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); }
|
|
@@ -55,11 +55,11 @@ export const workflowsOverviewPageHtml = `<!doctype html>
|
|
|
55
55
|
.hint { font-size: 12.5px; color: var(--ink-muted); }
|
|
56
56
|
.error { font-size: 13px; color: var(--bad); margin: 0; }
|
|
57
57
|
@media (max-width: 860px) {
|
|
58
|
-
.wo-hero { padding: 24px
|
|
58
|
+
.wo-hero { padding: 24px 22px 20px; }
|
|
59
59
|
.wo-hero .le-mascot { display: none; }
|
|
60
60
|
.wo-cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
61
61
|
.wo-cols2 { grid-template-columns: minmax(0, 1fr); }
|
|
62
|
-
.wo-section-title { padding: 24px
|
|
62
|
+
.wo-section-title { padding: 24px 22px 14px; }
|
|
63
63
|
.le-search { display: none; }
|
|
64
64
|
}
|
|
65
65
|
</style>
|