@goodandready/dsh-cron 0.3.43 → 0.3.45

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.
Files changed (42) hide show
  1. package/lib/client.js +998 -3987
  2. package/lib/llm-ask.js +2 -1
  3. package/lib/routes/api-actions.js +36 -6
  4. package/lib/routes/api-item.js +1 -1
  5. package/lib/routes/api-webhook.js +2 -4
  6. package/lib/runtimes/runner-external.js +2 -3
  7. package/lib/runtimes/runner-session.js +385 -0
  8. package/lib/runtimes/runner-turn.js +255 -0
  9. package/lib/runtimes/runner.js +43 -616
  10. package/lib/scheduler/scheduler-execution.js +4 -1
  11. package/lib/scheduler/scheduler-lifecycle.js +65 -0
  12. package/lib/scheduler/scheduler-parser.js +261 -0
  13. package/lib/scheduler/scheduler.js +13 -319
  14. package/lib/store/store-archive.js +195 -0
  15. package/lib/store/store-io.js +331 -0
  16. package/lib/store/store-loader.js +165 -0
  17. package/lib/store/store-migration.js +38 -0
  18. package/lib/store/store-settings.js +126 -0
  19. package/lib/store/store-stats.js +55 -0
  20. package/lib/store/store.js +75 -888
  21. package/package.json +8 -6
  22. package/lib/client-src/00-open.js +0 -63
  23. package/lib/client-src/10-locales.js +0 -540
  24. package/lib/client-src/20-styles.js +0 -64
  25. package/lib/client-src/30-utils.js +0 -372
  26. package/lib/client-src/40-delivery-settings.js +0 -96
  27. package/lib/client-src/45-dag-graph-view.js +0 -287
  28. package/lib/client-src/46-live-logs-modal.js +0 -108
  29. package/lib/client-src/47-analytics-digest-modal.js +0 -166
  30. package/lib/client-src/48-timeline-heatmap-view.js +0 -176
  31. package/lib/client-src/50-cron-screen-state.js +0 -457
  32. package/lib/client-src/52-cron-screen-actions.js +0 -330
  33. package/lib/client-src/53-cron-screen-modal-actions.js +0 -677
  34. package/lib/client-src/54-cron-screen-analytics-actions.js +0 -68
  35. package/lib/client-src/55-cron-screen-view.js +0 -378
  36. package/lib/client-src/60-modal-task-form-head.js +0 -581
  37. package/lib/client-src/62-modal-task-form-tail.js +0 -563
  38. package/lib/client-src/65-modal-dialogs.js +0 -350
  39. package/lib/client-src/70-settings-card.js +0 -453
  40. package/lib/client-src/75-quick-action-bar.js +0 -146
  41. package/lib/client-src/80-sidebar-jobs.js +0 -200
  42. package/lib/client-src/90-close.js +0 -219
@@ -1,581 +0,0 @@
1
- manualModalOpen && React.createElement('div', {
2
- className: 'dsh-cron-modal-overlay',
3
- onClick: (e) => {
4
- if (e.target === e.currentTarget) closeManualModalWithConfirm();
5
- }
6
- },
7
- React.createElement('div', {
8
- className: 'dsh-cron-modal dsh-cron-modal-scroll',
9
- style: { maxWidth: '640px' },
10
- role: 'dialog',
11
- 'aria-modal': 'true',
12
- onClick: (e) => e.stopPropagation()
13
- },
14
- React.createElement('div', { className: 'dsh-cron-modal-head', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: formId ? '12px' : '18px' } },
15
- React.createElement('div', { className: 'dsh-cron-modal-title', style: { margin: 0 } }, formId ? T_KEY(t, 'modal.editTitle') : T_KEY(t, 'modal.newTitle')),
16
- selectedTaskMeta && React.createElement('span', {
17
- style: {
18
- fontSize: '12px',
19
- padding: '3px 8px',
20
- borderRadius: '6px',
21
- background: selectedTaskMeta.status === 'active' ? 'var(--dsh-cron-success-bg)' : 'var(--dsh-cron-danger-bg)',
22
- color: selectedTaskMeta.status === 'active' ? 'var(--dsh-cron-success)' : 'var(--dsh-cron-danger)'
23
- }
24
- }, selectedTaskMeta.status === 'active' ? T_KEY(t, 'modal.statusActive') : T_KEY(t, 'modal.statusPaused'))
25
- ),
26
-
27
- formId && React.createElement('div', { className: 'dsh-cron-modal-nav' },
28
- React.createElement('button', {
29
- type: 'button',
30
- className: 'dsh-cron-modal-tab',
31
- 'data-active': modalTab === 'params' ? 'true' : undefined,
32
- onClick: () => setModalTab('params')
33
- }, T_KEY(t, 'modal.params')),
34
- React.createElement('button', {
35
- type: 'button',
36
- className: 'dsh-cron-modal-tab',
37
- 'data-active': modalTab === 'history' ? 'true' : undefined,
38
- onClick: () => { setModalTab('history'); if (formId) loadTaskHistory(formId); }
39
- }, T_KEY(t, 'modal.history', { count: taskHistory.length || 0 }))
40
- ),
41
-
42
- modalTab === 'history' && formId ? React.createElement('div', null,
43
- historyLoading ? React.createElement('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'history.loading')) :
44
- taskHistory.length === 0 ? React.createElement('div', { className: 'dsh-cron-history-empty' }, T_KEY(t, 'history.empty')) :
45
- React.createElement('div', { className: 'dsh-cron-history-list' },
46
- taskHistory.map((run) => React.createElement('div', { key: run.id, className: 'dsh-cron-history-item' },
47
- React.createElement('div', { className: 'dsh-cron-history-head' },
48
- React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
49
- React.createElement('span', {
50
- className: 'dsh-cron-history-status',
51
- 'data-status': run.status
52
- }, statusLabel(t, run.status)),
53
- React.createElement('span', { className: 'dsh-cron-history-time' }, run.at ? new Date(run.at).toLocaleString() : '')
54
- ),
55
- React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: '8px' } },
56
- run.costUsd > 0 && React.createElement('span', { className: 'dsh-cron-cost-tag' }, '$' + run.costUsd.toFixed(5)),
57
- run.usage && (run.usage.inputTokens > 0 || run.usage.outputTokens > 0) && React.createElement('span', { className: 'dsh-cron-tokens-tag' }, (run.usage.inputTokens + run.usage.outputTokens) + ' tok'),
58
- React.createElement('span', { style: { color: 'var(--dsw-alias-label-tertiary, #888)', fontSize: '11.5px' } }, (run.durationMs || 0) + ' ms')
59
- )
60
- ),
61
- // #315: Run card with stages flow, cost, stopped reason and delivery retry
62
- run.stoppedReason && React.createElement('div', {
63
- className: 'dsh-cron-hint',
64
- style: { display: 'flex', gap: '6px', alignItems: 'center', marginTop: '6px' }
65
- },
66
- React.createElement('span', { className: 'dsh-cron-badge-ref' }, T_KEY(t, 'history.stoppedReasonTitle')),
67
- React.createElement('span', null, run.stoppedReason)
68
- ),
69
- Array.isArray(run.stages) && run.stages.length > 0 && React.createElement('div', {
70
- className: 'dsh-cron-stages-flow',
71
- style: { display: 'flex', gap: '6px', flexWrap: 'wrap', marginTop: '6px' }
72
- },
73
- run.stages.map((st) => React.createElement('span', {
74
- key: st.name,
75
- className: 'dsh-cron-stage-pill',
76
- 'data-status': st.status || 'unknown',
77
- title: st.error ? (st.name + ': ' + st.error) : (st.name + (st.durationMs !== undefined ? ' (' + st.durationMs + 'ms)' : ''))
78
- }, (T_KEY(t, 'history.stage_' + st.name) || st.name) + (st.durationMs !== undefined ? ' ' + st.durationMs + 'ms' : '')))
79
- ),
80
- run.delivery && React.createElement('div', {
81
- style: { display: 'flex', alignItems: 'center', gap: '8px', marginTop: '6px' }
82
- },
83
- React.createElement('span', {
84
- className: 'dsh-cron-badge-ref',
85
- 'data-status': run.delivery.status
86
- }, 'Delivery: ' + run.delivery.status),
87
- (run.delivery.status === 'failed' || run.delivery.status === 'partial') && React.createElement('button', {
88
- type: 'button',
89
- className: 'dsh-cron-btn-secondary',
90
- style: { padding: '2px 8px', fontSize: '11px' },
91
- disabled: retryingDeliveryId === run.id,
92
- onClick: () => handleRetryDelivery(formId, run.id)
93
- }, retryingDeliveryId === run.id ? T_KEY(t, 'history.retryingDelivery') : T_KEY(t, 'history.retryDelivery'))
94
- ),
95
- run.artifacts && run.artifacts.length > 0 && React.createElement('div', {
96
- style: { display: 'flex', flexWrap: 'wrap', gap: '6px', marginTop: '6px', alignItems: 'center' }
97
- },
98
- React.createElement('span', { className: 'dsh-cron-hint', style: { fontSize: '11px' } }, '📦 ' + T_KEY(t, 'history.artifacts') + ':'),
99
- run.artifacts.map((art) => React.createElement('a', {
100
- key: art.name || art.id,
101
- href: '/dsh-cron/runs/' + encodeURIComponent(run.id) + '/artifacts/' + encodeURIComponent(art.name) + '/preview',
102
- target: '_blank',
103
- rel: 'noopener noreferrer',
104
- className: 'dsh-cron-btn-secondary',
105
- style: { padding: '2px 8px', fontSize: '11px', textDecoration: 'none' },
106
- title: art.name + ' (' + Math.round((art.size || 0) / 1024 * 10) / 10 + ' KB)'
107
- }, art.name))
108
- ),
109
- run.status === 'uncertain' && React.createElement('div', {
110
- className: 'dsh-cron-status-banner',
111
- 'data-type': 'warning',
112
- style: { marginTop: '8px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '8px' }
113
- },
114
- React.createElement('span', null, '⚠️ ' + T_KEY(t, 'history.statusUncertainHint')),
115
- React.createElement('div', { style: { display: 'flex', gap: '6px' } },
116
- React.createElement('button', {
117
- type: 'button',
118
- className: 'dsh-cron-btn-secondary',
119
- style: { padding: '2px 8px', fontSize: '11px' },
120
- onClick: () => handleResolveUncertain(formId, run.id, 'completed')
121
- }, '✓ ' + T_KEY(t, 'history.resolveCompleted')),
122
- React.createElement('button', {
123
- type: 'button',
124
- className: 'dsh-cron-btn-secondary',
125
- style: { padding: '2px 8px', fontSize: '11px' },
126
- onClick: () => handleResolveUncertain(formId, run.id, 'failed')
127
- }, '✕ ' + T_KEY(t, 'history.resolveFailed'))
128
- )
129
- ),
130
- // #43, #353: Self-Healing Doctor Diagnosis & 1-Click Fix
131
- (run.diagnosis || run.doctorReport) && React.createElement('div', {
132
- className: 'dsh-cron-status-banner',
133
- 'data-type': 'info',
134
- style: { marginTop: '8px', display: 'flex', flexDirection: 'column', gap: '6px' }
135
- },
136
- React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
137
- React.createElement('strong', null, '🩺 ' + T_KEY(t, run.doctorReport ? 'history.doctorDiagnosis' : 'history.diagnosis')),
138
- React.createElement('div', { style: { display: 'flex', gap: '6px', alignItems: 'center' } },
139
- (run.autoHealed || run.doctorReport?.autoHealed) && React.createElement('span', {
140
- style: { fontSize: '10px', background: 'var(--dsh-cron-success-bg)', color: 'var(--dsh-cron-success)', padding: '1px 6px', borderRadius: '8px', fontWeight: '600' }
141
- }, '✨ ' + T_KEY(t, 'history.autoHealed')),
142
- (run.doctorReport?.category || run.category) && React.createElement('span', {
143
- style: { fontSize: '10px', background: 'var(--dsw-alias-bg-layer-3)', padding: '1px 6px', borderRadius: '4px' }
144
- }, run.doctorReport?.category || run.category),
145
- run.confidence ? React.createElement('span', { style: { fontSize: '10px', color: 'var(--dsw-alias-label-secondary)' } }, '(' + run.confidence + ')') : null
146
- )
147
- ),
148
- React.createElement('div', null, run.doctorReport?.cause || run.diagnosis),
149
- run.doctorReport?.diff && React.createElement('div', {
150
- style: {
151
- background: 'var(--dsw-alias-bg-layer-2)',
152
- border: '1px solid var(--dsw-alias-border-l2)',
153
- borderRadius: '4px',
154
- padding: '6px',
155
- fontFamily: 'monospace',
156
- fontSize: '11px',
157
- maxHeight: '120px',
158
- overflowY: 'auto',
159
- whiteSpace: 'pre'
160
- }
161
- }, run.doctorReport.diff),
162
- (run.doctorReport?.suggestedFix || run.suggestion) && React.createElement('div', { style: { display: 'flex', gap: '8px', marginTop: '4px' } },
163
- typeof handleApplyDoctorFix === 'function' && React.createElement('button', {
164
- type: 'button',
165
- className: 'dsh-cron-btn-primary',
166
- style: { padding: '3px 10px', fontSize: '12px' },
167
- onClick: () => handleApplyDoctorFix(formId, run.doctorReport || { suggestedFix: run.suggestion })
168
- }, '⚡ ' + T_KEY(t, 'history.doctorApply')),
169
- React.createElement('button', {
170
- type: 'button',
171
- className: 'dsh-cron-btn-secondary',
172
- style: { padding: '3px 10px', fontSize: '12px' },
173
- onClick: () => openEditModal(selectedTaskMeta, { prompt: run.suggestion })
174
- }, T_KEY(t, 'history.applySuggestion'))
175
- )
176
- ),
177
- // #350 Swarm Workers Breakdown
178
- run.subtaskRuns && Array.isArray(run.subtaskRuns) && run.subtaskRuns.length > 0 && React.createElement('div', {
179
- style: { marginTop: '8px', padding: '8px', background: 'var(--dsw-alias-bg-layer-2)', borderRadius: '6px', fontSize: '12px' }
180
- },
181
- React.createElement('div', { style: { fontWeight: '600', marginBottom: '4px' } }, '🐝 ' + T_KEY(t, 'history.swarmBadge') + ' (' + run.subtaskRuns.filter(r => r.status === 'success').length + '/' + run.subtaskRuns.length + ')'),
182
- React.createElement('div', { style: { display: 'flex', flexDirection: 'column', gap: '4px' } },
183
- run.subtaskRuns.map((st, sidx) => React.createElement('div', {
184
- key: sidx,
185
- style: { display: 'flex', justifyContent: 'space-between', padding: '2px 6px', background: 'var(--dsw-alias-bg-layer-3)', borderRadius: '4px' }
186
- },
187
- React.createElement('span', null, (st.status === 'success' ? '✅ ' : '❌ ') + st.title),
188
- React.createElement('span', { style: { color: 'var(--dsw-alias-label-tertiary)', fontSize: '11px' } }, (st.durationMs || 0) + 'ms')
189
- ))
190
- )
191
- ),
192
- // #351 Git Diff & Patch Review
193
- run.gitDiff && run.gitDiff.hasChanges && React.createElement('div', {
194
- className: 'dsh-cron-status-banner',
195
- style: { marginTop: '8px', display: 'flex', flexDirection: 'column', gap: '6px' }
196
- },
197
- React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
198
- React.createElement('strong', null, '📝 ' + T_KEY(t, 'history.gitDiff')),
199
- React.createElement('span', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary)' } }, run.gitDiff.stat || '')
200
- ),
201
- run.gitDiff.diff && React.createElement('div', {
202
- style: {
203
- background: 'var(--dsw-alias-bg-layer-2)',
204
- border: '1px solid var(--dsw-alias-border-l2)',
205
- borderRadius: '4px',
206
- padding: '6px',
207
- fontFamily: 'monospace',
208
- fontSize: '11px',
209
- maxHeight: '140px',
210
- overflowY: 'auto',
211
- whiteSpace: 'pre'
212
- }
213
- }, run.gitDiff.diff),
214
- React.createElement('div', { style: { display: 'flex', gap: '8px', marginTop: '4px' } },
215
- React.createElement('button', {
216
- type: 'button',
217
- className: 'dsh-cron-btn-secondary',
218
- style: { padding: '2px 8px', fontSize: '12px' },
219
- onClick: async () => {
220
- if (!confirm('Discard all uncommitted changes in task directory?')) return;
221
- const c = typeof AbortController !== 'undefined' ? new AbortController() : null;
222
- const tId = c ? setTimeout(() => c.abort(), 15000) : null;
223
- try {
224
- const res = await fetch('/dsh-cron/tasks/' + encodeURIComponent(formId) + '/git-diff/discard', {
225
- method: 'POST',
226
- signal: c ? c.signal : undefined
227
- });
228
- const d = await res.json();
229
- if (d.ok) { alert('Working directory reset successfully.'); if (formId) loadTaskHistory(formId); }
230
- else alert(d.error || 'Failed to discard changes');
231
- } catch (e) { alert(e.message); }
232
- finally { if (tId) clearTimeout(tId); }
233
- }
234
- }, '🗑️ ' + T_KEY(t, 'history.discardDiff')),
235
- React.createElement('button', {
236
- type: 'button',
237
- className: 'dsh-cron-btn-primary',
238
- style: { padding: '2px 8px', fontSize: '12px' },
239
- onClick: async () => {
240
- const c = typeof AbortController !== 'undefined' ? new AbortController() : null;
241
- const tId = c ? setTimeout(() => c.abort(), 15000) : null;
242
- try {
243
- const res = await fetch('/dsh-cron/tasks/' + encodeURIComponent(formId) + '/git-diff/apply', {
244
- method: 'POST',
245
- headers: { 'Content-Type': 'application/json' },
246
- signal: c ? c.signal : undefined,
247
- body: JSON.stringify({ diff: run.gitDiff.diff })
248
- });
249
- const d = await res.json();
250
- if (d.ok) { alert('Patch applied successfully.'); if (formId) loadTaskHistory(formId); }
251
- else alert(d.error || 'Failed to apply patch');
252
- } catch (e) { alert(e.message); }
253
- finally { if (tId) clearTimeout(tId); }
254
- }
255
- }, '✅ ' + T_KEY(t, 'history.applyDiff'))
256
- )
257
- ),
258
- // #44: a run suppressed by its silent rule says why.
259
- run.silentSkip && React.createElement('div', {
260
- className: 'dsh-cron-hint',
261
- style: { display: 'flex', gap: '6px', alignItems: 'center' }
262
- },
263
- React.createElement('span', { className: 'dsh-cron-badge-ref' }, T_KEY(t, 'history.silentSkip')),
264
- React.createElement('span', null, run.silentReason || '')
265
- ),
266
- run.output && React.createElement('div', { className: 'dsh-cron-history-output' }, run.output),
267
- run.error && React.createElement('div', { className: 'dsh-cron-history-output', style: { color: 'var(--dsh-cron-danger)', borderColor: 'var(--dsh-cron-danger-bg)' } }, run.error),
268
- run.sessionId && React.createElement('button', {
269
- type: 'button',
270
- className: 'dsh-cron-btn-secondary',
271
- style: { marginTop: '8px', fontSize: '12px', padding: '4px 10px' },
272
- onClick: () => openSession(ctx, run.sessionId)
273
- }, T_KEY(t, 'history.openSession'))
274
- ))
275
- ),
276
- React.createElement('div', { className: 'dsh-cron-modal-foot', style: { marginTop: '18px' } },
277
- React.createElement('button', {
278
- type: 'button',
279
- className: 'dsh-cron-btn-secondary',
280
- onClick: () => { if (formId) loadTaskHistory(formId); }
281
- }, T_KEY(t, 'history.refresh')),
282
- React.createElement('button', {
283
- type: 'button',
284
- className: 'dsh-cron-btn-primary',
285
- onClick: closeManualModalWithConfirm
286
- }, T_KEY(t, 'modal.close'))
287
- )
288
- ) :
289
-
290
- React.createElement('form', { onSubmit: handleSaveManual },
291
- React.createElement('div', { className: 'dsh-cron-form-group' },
292
- React.createElement('label', null, T_KEY(t, 'form.nameLabel')),
293
- React.createElement('input', {
294
- required: true,
295
- autoFocus: true,
296
- value: formTitle,
297
- placeholder: T_KEY(t, 'form.namePlaceholder'),
298
- onChange: (e) => setFormTitle(e.target.value)
299
- })
300
- ),
301
- React.createElement('div', { className: 'dsh-cron-form-row' },
302
- React.createElement('div', { className: 'dsh-cron-form-group' },
303
- React.createElement('label', null, T_KEY(t, 'form.typeLabel')),
304
- React.createElement('select', {
305
- value: formType,
306
- onChange: (e) => setFormType(e.target.value)
307
- },
308
- React.createElement('option', { value: 'llm' }, T_KEY(t, 'form.typeLlm')),
309
- React.createElement('option', { value: 'script' }, T_KEY(t, 'form.typeScript')),
310
- React.createElement('option', { value: 'node' }, T_KEY(t, 'form.typeNode')),
311
- React.createElement('option', { value: 'python' }, T_KEY(t, 'form.typePython')),
312
- React.createElement('option', { value: 'http' }, T_KEY(t, 'form.typeHttp')),
313
- React.createElement('option', { value: 'ssh' }, T_KEY(t, 'form.typeSsh')),
314
- React.createElement('option', { value: 'docker' }, T_KEY(t, 'form.typeDocker')),
315
- React.createElement('option', { value: 'skill' }, T_KEY(t, 'form.typeSkill')),
316
- React.createElement('option', { value: 'workflow' }, T_KEY(t, 'form.typeWorkflow')),
317
- React.createElement('option', { value: 'digest' }, T_KEY(t, 'form.typeDigest'))
318
- )
319
- ),
320
- React.createElement('div', { className: 'dsh-cron-form-group' },
321
- React.createElement('label', null, T_KEY(t, 'form.scheduleLabel')),
322
- React.createElement('input', {
323
- required: true,
324
- value: formSchedule,
325
- placeholder: T_KEY(t, 'form.schedulePlaceholder'),
326
- onChange: (e) => setFormSchedule(e.target.value)
327
- }),
328
- React.createElement('div', { style: { display: 'flex', gap: '5px', flexWrap: 'wrap', marginTop: '5px' } },
329
- [
330
- { label: '15m', expr: '*/15 * * * *' },
331
- { label: '1h', expr: '0 * * * *' },
332
- { label: 'Daily 09:00', expr: '0 9 * * *' },
333
- { label: 'Weekdays', expr: '0 9 * * 1-5' },
334
- { label: 'Weekly Mon', expr: '0 9 * * 1' },
335
- ].map((p) => React.createElement('button', {
336
- key: p.label,
337
- type: 'button',
338
- className: 'dsh-cron-btn-secondary',
339
- style: { padding: '2px 7px', fontSize: '11px', borderRadius: '4px' },
340
- onClick: () => { setFormSchedule(p.expr); handlePreviewSchedule(p.expr); }
341
- }, p.label))
342
- ),
343
- React.createElement('div', { style: { display: 'flex', gap: '8px', alignItems: 'center', marginTop: '6px' } },
344
- React.createElement('button', {
345
- type: 'button',
346
- className: 'dsh-cron-btn-secondary',
347
- style: { padding: '3px 8px', fontSize: '11.5px' },
348
- onClick: () => handlePreviewSchedule(formSchedule)
349
- }, T_KEY(t, 'form.previewSchedule')),
350
- schedulePreviewRuns && schedulePreviewRuns.length > 0 && React.createElement('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-secondary, #999)' } },
351
- T_KEY(t, 'form.previewScheduleTitle') + ' ' + schedulePreviewRuns.slice(0, 3).map(r => new Date(r).toLocaleTimeString()).join(', ')
352
- )
353
- )
354
- )
355
- ),
356
- React.createElement('div', { className: 'dsh-cron-form-row' },
357
- React.createElement('div', { className: 'dsh-cron-form-group' },
358
- React.createElement('label', null, T_KEY(t, 'form.timeoutLabel')),
359
- React.createElement('input', {
360
- type: 'number',
361
- min: 1,
362
- value: formTimeoutSeconds,
363
- placeholder: '1800',
364
- onChange: (e) => setFormTimeoutSeconds(e.target.value)
365
- })
366
- ),
367
- React.createElement('div', { className: 'dsh-cron-form-group' },
368
- React.createElement('label', null, T_KEY(t, 'form.overlapLabel')),
369
- React.createElement('select', {
370
- value: formOverlapPolicy,
371
- onChange: (e) => setFormOverlapPolicy(e.target.value)
372
- },
373
- React.createElement('option', { value: 'skip' }, T_KEY(t, 'form.overlapSkip')),
374
- React.createElement('option', { value: 'queue' }, T_KEY(t, 'form.overlapQueue')),
375
- React.createElement('option', { value: 'replace' }, T_KEY(t, 'form.overlapReplace'))
376
- )
377
- )
378
- ),
379
- React.createElement('div', { className: 'dsh-cron-form-row' },
380
- React.createElement('div', { className: 'dsh-cron-form-group' },
381
- React.createElement('label', null, T_KEY(t, 'form.timezoneLabel')),
382
- React.createElement('input', {
383
- value: formTimezone,
384
- placeholder: T_KEY(t, 'form.timezonePlaceholder'),
385
- onChange: (e) => setFormTimezone(e.target.value)
386
- })
387
- ),
388
- React.createElement('div', { className: 'dsh-cron-form-group' },
389
- React.createElement('label', null, T_KEY(t, 'form.misfireLabel')),
390
- React.createElement('select', {
391
- value: formMisfirePolicy,
392
- onChange: (e) => setFormMisfirePolicy(e.target.value)
393
- },
394
- React.createElement('option', { value: 'skip' }, T_KEY(t, 'form.misfireSkip')),
395
- React.createElement('option', { value: 'runOnce' }, T_KEY(t, 'form.misfireRunOnce')),
396
- React.createElement('option', { value: 'catchUpAll' }, T_KEY(t, 'form.misfireCatchUp'))
397
- )
398
- )
399
- ),
400
- AGENT_FORM_TYPES.includes(formType) ? (
401
- React.createElement('div', { className: 'dsh-cron-form-row' },
402
- React.createElement('div', { className: 'dsh-cron-form-group' },
403
- React.createElement('label', null, T_KEY(t, 'form.retriesLabel')),
404
- React.createElement('input', {
405
- type: 'number',
406
- min: 0,
407
- value: formMaxRetries,
408
- placeholder: '0',
409
- onChange: (e) => setFormMaxRetries(e.target.value)
410
- })
411
- ),
412
- React.createElement('div', { className: 'dsh-cron-form-group' },
413
- React.createElement('label', null, T_KEY(t, 'form.permissionLabel')),
414
- React.createElement('select', {
415
- value: formPermissionPreset,
416
- onChange: (e) => setFormPermissionPreset(e.target.value)
417
- },
418
- React.createElement('option', { value: 'default' }, T_KEY(t, 'form.permissionDefault')),
419
- React.createElement('option', { value: 'read-only' }, T_KEY(t, 'form.permissionReadonly')),
420
- React.createElement('option', { value: 'workspace-write' }, T_KEY(t, 'form.permissionWrite')),
421
- React.createElement('option', { value: 'danger-full-access' }, T_KEY(t, 'form.permissionFull'))
422
- )
423
- )
424
- )
425
- ) : (
426
- React.createElement('div', { className: 'dsh-cron-form-group' },
427
- React.createElement('label', null, T_KEY(t, 'form.retriesLabel')),
428
- React.createElement('input', {
429
- type: 'number',
430
- min: 0,
431
- value: formMaxRetries,
432
- placeholder: '0',
433
- onChange: (e) => setFormMaxRetries(e.target.value)
434
- })
435
- )
436
- ),
437
- React.createElement('div', { className: 'dsh-cron-form-group' },
438
- React.createElement('label', null, T_KEY(t, 'form.kanbanLabel')),
439
- React.createElement('select', {
440
- value: formKanbanMode,
441
- onChange: (e) => setFormKanbanMode(e.target.value)
442
- },
443
- React.createElement('option', { value: 'none' }, T_KEY(t, 'form.kanbanNone')),
444
- React.createElement('option', { value: 'on_failure' }, T_KEY(t, 'form.kanbanOnFailure')),
445
- React.createElement('option', { value: 'always' }, T_KEY(t, 'form.kanbanAlways'))
446
- )
447
- ),
448
- AGENT_FORM_TYPES.includes(formType) && React.createElement('div', { className: 'dsh-cron-form-group' },
449
- React.createElement('label', null, T_KEY(t, 'form.agentPresetLabel')),
450
- React.createElement('input', {
451
- type: 'text',
452
- value: formAgentPreset,
453
- placeholder: T_KEY(t, 'form.agentPresetPlaceholder'),
454
- onChange: (e) => setFormAgentPreset(e.target.value)
455
- }),
456
- React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.agentPresetHint'))
457
- ),
458
- AGENT_FORM_TYPES.includes(formType) && React.createElement('div', { className: 'dsh-cron-form-group' },
459
- React.createElement('label', null, T_KEY(t, 'form.sessionTitleLabel')),
460
- React.createElement('input', {
461
- type: 'text',
462
- value: formSessionTitle,
463
- placeholder: T_KEY(t, 'form.sessionTitlePlaceholder'),
464
- onChange: (e) => setFormSessionTitle(e.target.value)
465
- }),
466
- React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.sessionTitleHint'))
467
- ),
468
- AGENT_FORM_TYPES.includes(formType) && React.createElement('div', { className: 'dsh-cron-form-row' },
469
- React.createElement('div', { className: 'dsh-cron-form-group' },
470
- React.createElement('label', null, T_KEY(t, 'form.targetSessionIdLabel')),
471
- React.createElement('input', {
472
- type: 'text',
473
- value: formTargetSessionId,
474
- placeholder: T_KEY(t, 'form.targetSessionIdPlaceholder'),
475
- onChange: (e) => setFormTargetSessionId(e.target.value)
476
- }),
477
- React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.targetSessionIdHint'))
478
- ),
479
- React.createElement('div', { className: 'dsh-cron-form-group' },
480
- React.createElement('label', null, T_KEY(t, 'form.targetSessionResetLabel')),
481
- React.createElement('select', {
482
- value: formTargetSessionReset,
483
- onChange: (e) => setFormTargetSessionReset(e.target.value)
484
- },
485
- React.createElement('option', { value: 'never' }, T_KEY(t, 'form.targetSessionResetNever')),
486
- React.createElement('option', { value: 'daily' }, T_KEY(t, 'form.targetSessionResetDaily')),
487
- React.createElement('option', { value: 'weekly' }, T_KEY(t, 'form.targetSessionResetWeekly'))
488
- ),
489
- React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.targetSessionResetHint'))
490
- )
491
- ),
492
- AGENT_FORM_TYPES.includes(formType) && React.createElement('div', { className: 'dsh-cron-form-row' },
493
- React.createElement('div', { className: 'dsh-cron-form-group' },
494
- React.createElement('label', null, T_KEY(t, 'form.providerLabel')),
495
- React.createElement('select', {
496
- value: formProvider,
497
- onChange: handleProviderChange
498
- },
499
- React.createElement('option', { value: '' }, T_KEY(t, 'form.providerDefault')),
500
- providers.map((p) => React.createElement('option', { key: p.id, value: p.id }, p.name || p.id))
501
- )
502
- ),
503
- React.createElement('div', { className: 'dsh-cron-form-group' },
504
- React.createElement('label', null, T_KEY(t, 'form.modelLabel')),
505
- React.createElement('select', {
506
- value: formModel,
507
- onChange: (e) => setFormModel(e.target.value)
508
- },
509
- React.createElement('option', { value: '' }, T_KEY(t, 'form.modelDefault')),
510
- models.map((m) => React.createElement('option', { key: m.id, value: m.id }, m.name || m.id))
511
- )
512
- ),
513
- // #45: one retry on a stronger model when the cheap one fails.
514
- React.createElement('div', { className: 'dsh-cron-form-group' },
515
- React.createElement('label', null, T_KEY(t, 'form.fallbackModelLabel')),
516
- React.createElement('input', {
517
- type: 'text',
518
- value: formFallbackModel,
519
- placeholder: T_KEY(t, 'form.fallbackModelPlaceholder'),
520
- onChange: (e) => setFormFallbackModel(e.target.value)
521
- }),
522
- React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.fallbackModelHint'))
523
- ),
524
- // #43: diagnose failures with a model.
525
- React.createElement('label', { className: 'dsh-cron-checkbox-row', style: { marginTop: '4px' } },
526
- React.createElement('input', {
527
- type: 'checkbox',
528
- checked: formInspectOnFailure,
529
- onChange: (e) => setFormInspectOnFailure(e.target.checked)
530
- }),
531
- React.createElement('span', null, T_KEY(t, 'form.inspectOnFailureLabel'))
532
- ),
533
- formInspectOnFailure && React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.inspectOnFailureHint')),
534
- // #318: require approval checkbox
535
- React.createElement('label', { className: 'dsh-cron-checkbox-row', style: { marginTop: '8px' } },
536
- React.createElement('input', {
537
- type: 'checkbox',
538
- checked: formRequireApproval,
539
- onChange: (e) => setFormRequireApproval(e.target.checked)
540
- }),
541
- React.createElement('span', null, T_KEY(t, 'form.requireApprovalLabel'))
542
- ),
543
- formRequireApproval && React.createElement('div', { className: 'dsh-cron-hint' }, T_KEY(t, 'form.requireApprovalHint'))
544
- ),
545
- formType === 'http' && React.createElement('div', { className: 'dsh-cron-form-row' },
546
- React.createElement('div', { className: 'dsh-cron-form-group' },
547
- React.createElement('label', null, T_KEY(t, 'form.httpMethodLabel')),
548
- React.createElement('select', {
549
- value: formHttpMethod,
550
- onChange: (e) => setFormHttpMethod(e.target.value)
551
- },
552
- ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD'].map((m) => React.createElement('option', { key: m, value: m }, m))
553
- )
554
- ),
555
- React.createElement('div', { className: 'dsh-cron-form-group' },
556
- React.createElement('label', null, T_KEY(t, 'form.httpUrlLabel')),
557
- React.createElement('input', {
558
- required: true,
559
- value: formHttpUrl,
560
- placeholder: 'https://example.test/webhook',
561
- onChange: (e) => setFormHttpUrl(e.target.value)
562
- })
563
- )
564
- ),
565
- formType === 'http' && React.createElement('div', { className: 'dsh-cron-form-row' },
566
- React.createElement('div', { className: 'dsh-cron-form-group' },
567
- React.createElement('label', null, T_KEY(t, 'form.httpHeadersLabel')),
568
- React.createElement('input', {
569
- value: formHttpHeaders,
570
- placeholder: '{"Authorization":"Bearer ..."}',
571
- onChange: (e) => setFormHttpHeaders(e.target.value)
572
- })
573
- ),
574
- React.createElement('div', { className: 'dsh-cron-form-group' },
575
- React.createElement('label', null, T_KEY(t, 'form.httpBodyLabel')),
576
- React.createElement('input', {
577
- value: formHttpBody,
578
- onChange: (e) => setFormHttpBody(e.target.value)
579
- })
580
- )
581
- ),