@happyvertical/smrt-agents 0.60.16 → 0.60.17

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.
@@ -43,35 +43,35 @@ function handleEntryKeydown(entry: AgentRunHistoryEntry, event: KeyboardEvent) {
43
43
  }
44
44
  </script>
45
45
 
46
- <div class="run-history-container" data-smrt-component="AgentRunHistory">
47
- <table class="run-history" class:loading>
48
- <thead class="run-history__head">
46
+ <div class="smrt-agent-run-history__root" data-smrt-component="AgentRunHistory">
47
+ <table class="smrt-agent-run-history__table" data-smrt-part="table" class:smrt-agent-run-history__loading={loading}>
48
+ <thead class="smrt-agent-run-history__head" data-smrt-part="header">
49
49
  <tr>
50
- <th class="run-history__cell">Status</th>
51
- <th class="run-history__cell">Agent</th>
52
- <th class="run-history__cell">Started</th>
53
- <th class="run-history__cell">Duration</th>
54
- <th class="run-history__cell">Error</th>
50
+ <th class="smrt-agent-run-history__cell" data-smrt-part="cell">Status</th>
51
+ <th class="smrt-agent-run-history__cell" data-smrt-part="cell">Agent</th>
52
+ <th class="smrt-agent-run-history__cell" data-smrt-part="cell">Started</th>
53
+ <th class="smrt-agent-run-history__cell" data-smrt-part="cell">Duration</th>
54
+ <th class="smrt-agent-run-history__cell" data-smrt-part="cell">Error</th>
55
55
  </tr>
56
56
  </thead>
57
57
 
58
- <tbody class="run-history__body">
58
+ <tbody class="smrt-agent-run-history__body" data-smrt-part="body">
59
59
  {#if loading}
60
- <tr class="run-history__row run-history__row--loading">
61
- <td class="run-history__cell run-history__cell--loading" colspan="5">
62
- <div class="run-history__loading">
63
- <span class="run-history__spinner"></span>
60
+ <tr class="smrt-agent-run-history__row smrt-agent-run-history__row-loading" data-smrt-part="row">
61
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-loading" data-smrt-part="cell" colspan="5">
62
+ <div class="smrt-agent-run-history__progress" data-smrt-part="progress">
63
+ <span class="smrt-agent-run-history__spinner" data-smrt-part="spinner"></span>
64
64
  <span>{t(M['agents.run_history.loading_history'])}</span>
65
65
  </div>
66
66
  </td>
67
67
  </tr>
68
68
  {:else if history.length === 0}
69
- <tr class="run-history__row run-history__row--empty">
70
- <td class="run-history__cell run-history__cell--empty" colspan="5">
69
+ <tr class="smrt-agent-run-history__row smrt-agent-run-history__row-empty" data-smrt-part="row">
70
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-empty" data-smrt-part="cell" colspan="5">
71
71
  {#if empty}
72
72
  {@render empty()}
73
73
  {:else}
74
- <div class="run-history__empty">
74
+ <div class="smrt-agent-run-history__empty" data-smrt-part="empty">
75
75
  <span>{t(M['agents.run_history.no_run_history'])}</span>
76
76
  </div>
77
77
  {/if}
@@ -80,33 +80,33 @@ function handleEntryKeydown(entry: AgentRunHistoryEntry, event: KeyboardEvent) {
80
80
  {:else}
81
81
  {#each history as entry (entry.id)}
82
82
  <tr
83
- class="run-history__row"
83
+ class="smrt-agent-run-history__row" data-smrt-part="row"
84
84
  onclick={() => handleEntryClick(entry)}
85
85
  onkeydown={(event) => handleEntryKeydown(entry, event)}
86
86
  role={onEntryClick ? 'button' : undefined}
87
87
  tabindex={onEntryClick ? 0 : undefined}
88
88
  >
89
- <td class="run-history__cell">
89
+ <td class="smrt-agent-run-history__cell" data-smrt-part="cell">
90
90
  <Badge variant={getRunStatusVariant(entry.status)} size="sm">
91
91
  {entry.status === 'success' ? 'Success' : 'Failed'}
92
92
  </Badge>
93
93
  </td>
94
- <td class="run-history__cell run-history__cell--agent">
94
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-agent" data-smrt-part="cell">
95
95
  {entry.agentType}
96
96
  </td>
97
- <td class="run-history__cell run-history__cell--date">
97
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-date" data-smrt-part="cell">
98
98
  {formatRelativeTime(entry.startedAt)}
99
99
  </td>
100
- <td class="run-history__cell run-history__cell--duration">
100
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-duration" data-smrt-part="cell">
101
101
  {formatDuration(entry.duration)}
102
102
  </td>
103
- <td class="run-history__cell run-history__cell--error">
103
+ <td class="smrt-agent-run-history__cell smrt-agent-run-history__cell-error" data-smrt-part="cell">
104
104
  {#if entry.error}
105
- <span class="error-text" title={entry.error}>
105
+ <span class="smrt-agent-run-history__error" data-smrt-part="error" title={entry.error}>
106
106
  {entry.error.length > 50 ? entry.error.slice(0, 50) + '...' : entry.error}
107
107
  </span>
108
108
  {:else}
109
- <span class="no-error">-</span>
109
+ <span class="smrt-agent-run-history__no-error" data-smrt-part="meta">-</span>
110
110
  {/if}
111
111
  </td>
112
112
  </tr>
@@ -118,121 +118,126 @@ function handleEntryKeydown(entry: AgentRunHistoryEntry, event: KeyboardEvent) {
118
118
 
119
119
  <style>
120
120
  @layer smrt.reset, smrt.structure, smrt.theme;
121
- @layer smrt.theme {
122
- .run-history-container {
121
+ @layer smrt.structure {
122
+ .smrt-agent-run-history__root {
123
123
  width: 100%;
124
124
  overflow-x: auto;
125
125
  }
126
-
127
- .run-history {
126
+ .smrt-agent-run-history__table {
128
127
  width: 100%;
128
+ }
129
+ .smrt-agent-run-history__head th {
130
+ padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 1rem);
131
+ white-space: nowrap;
132
+ }
133
+ .smrt-agent-run-history__body tr:hover:not(.smrt-agent-run-history__row-loading):not(.smrt-agent-run-history__row-empty) {
134
+ cursor: pointer;
135
+ }
136
+ .smrt-agent-run-history__cell {
137
+ padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 1rem);
138
+ }
139
+ .smrt-agent-run-history__cell-date {
140
+ white-space: nowrap;
141
+ }
142
+ .smrt-agent-run-history__cell-error {
143
+ max-width: 300px;
144
+ }
145
+ .smrt-agent-run-history__error {
146
+ cursor: help;
147
+ }
148
+ .smrt-agent-run-history__cell-loading,
149
+ .smrt-agent-run-history__cell-empty {
150
+ padding: var(--smrt-spacing-xl, 2rem);
151
+ }
152
+ .smrt-agent-run-history__progress {
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ gap: var(--smrt-spacing-sm, 0.5rem);
157
+ }
158
+ .smrt-agent-run-history__spinner {
159
+ width: 20px;
160
+ height: 20px;
161
+ }
162
+ .smrt-agent-run-history__table.smrt-agent-run-history__loading {
163
+ pointer-events: none;
164
+ }
165
+ }
166
+
167
+ @layer smrt.theme {
168
+ .smrt-agent-run-history__table {
129
169
  border-collapse: collapse;
130
170
  border-spacing: 0;
131
171
  font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
132
172
  background: var(--smrt-color-surface);
133
173
  }
134
-
135
- .run-history.loading {
174
+ .smrt-agent-run-history__table.smrt-agent-run-history__loading {
136
175
  opacity: 0.7;
137
- pointer-events: none;
138
176
  }
139
-
140
- .run-history__head {
177
+ .smrt-agent-run-history__head {
141
178
  background: var(--smrt-color-surface-container);
142
179
  }
143
-
144
- .run-history__head th {
145
- padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 1rem);
180
+ .smrt-agent-run-history__head th {
146
181
  font-weight: var(--smrt-typography-weight-semibold, 600);
147
182
  text-align: left;
148
- white-space: nowrap;
149
183
  border-bottom: var(--smrt-hairline);
150
184
  }
151
-
152
- .run-history__body tr {
185
+ .smrt-agent-run-history__body tr {
153
186
  border-bottom: var(--smrt-hairline);
154
187
  transition: background-color var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
155
188
  }
156
-
157
- .run-history__body tr:hover:not(.run-history__row--loading):not(.run-history__row--empty) {
189
+ .smrt-agent-run-history__body tr:hover:not(.smrt-agent-run-history__row-loading):not(.smrt-agent-run-history__row-empty) {
158
190
  background: var(--smrt-color-surface-container-low);
159
- cursor: pointer;
160
191
  }
161
-
162
192
  @media (prefers-reduced-motion: reduce) {
163
- .run-history__body tr {
193
+ .smrt-agent-run-history__body tr {
164
194
  transition: none;
165
195
  }
166
-
167
- .run-history__spinner {
196
+ .smrt-agent-run-history__spinner {
168
197
  animation: none;
169
198
  }
170
199
  }
171
-
172
- .run-history__cell {
173
- padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 1rem);
200
+ .smrt-agent-run-history__cell {
174
201
  vertical-align: middle;
175
202
  }
176
-
177
- .run-history__cell--agent {
203
+ .smrt-agent-run-history__cell-agent {
178
204
  font-weight: var(--smrt-typography-weight-medium, 500);
179
205
  }
180
-
181
- .run-history__cell--date {
206
+ .smrt-agent-run-history__cell-date {
182
207
  color: var(--smrt-color-on-surface-variant);
183
- white-space: nowrap;
184
208
  }
185
-
186
- .run-history__cell--duration {
209
+ .smrt-agent-run-history__cell-duration {
187
210
  font-family: var(--smrt-font-family-mono, ui-monospace, monospace);
188
211
  text-align: center;
189
212
  }
190
-
191
- .run-history__cell--error {
192
- max-width: 300px;
193
- }
194
-
195
- .error-text {
213
+ .smrt-agent-run-history__error {
196
214
  color: var(--smrt-color-error);
197
215
  font: var(--smrt-typography-body-small-font, 0.75rem / 1.25 sans-serif);
198
- cursor: help;
199
216
  }
200
-
201
- .no-error {
217
+ .smrt-agent-run-history__no-error {
202
218
  color: var(--smrt-color-on-surface-variant);
203
219
  }
204
-
205
- .run-history__cell--loading,
206
- .run-history__cell--empty {
207
- padding: var(--smrt-spacing-xl, 2rem);
220
+ .smrt-agent-run-history__cell-loading,
221
+ .smrt-agent-run-history__cell-empty {
208
222
  text-align: center;
209
223
  }
210
-
211
- .run-history__loading {
212
- display: flex;
213
- align-items: center;
214
- justify-content: center;
215
- gap: var(--smrt-spacing-sm, 0.5rem);
224
+ .smrt-agent-run-history__progress {
216
225
  color: var(--smrt-color-on-surface-variant);
217
226
  }
218
-
219
- .run-history__spinner {
220
- width: 20px;
221
- height: 20px;
227
+ .smrt-agent-run-history__spinner {
222
228
  border: 2px solid var(--smrt-color-outline-variant);
223
229
  border-top-color: var(--smrt-color-primary);
224
230
  border-radius: var(--smrt-radius-full);
225
231
  animation: spin 0.8s linear infinite;
226
232
  }
227
-
228
233
  @keyframes spin {
229
234
  to {
230
235
  transform: rotate(360deg);
231
236
  }
232
237
  }
233
-
234
- .run-history__empty {
238
+ .smrt-agent-run-history__empty {
235
239
  color: var(--smrt-color-on-surface-variant);
236
240
  }
237
241
  }
242
+
238
243
  </style>
@@ -133,11 +133,11 @@ function handleCronPreset(preset: string) {
133
133
  <h2>{editMode ? 'Edit Schedule' : 'Create Schedule'}</h2>
134
134
  {/snippet}
135
135
 
136
- <div class="schedule-form-shell">
136
+ <div class="smrt-agent-schedule-form__root" data-smrt-part="body">
137
137
  <Form class="schedule-form" onsubmit={handleSubmit}>
138
- <div class="form-grid">
138
+ <div class="smrt-agent-schedule-form__grid" data-smrt-part="grid">
139
139
  <!-- Agent Type -->
140
- <div class="form-field">
140
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
141
141
  <label for="agentType">{t(M['agents.schedule_form.agent_type'])}</label>
142
142
  {#if agentTypes.length > 0}
143
143
  <Select id="agentType" bind:value={agentType} required disabled={loading}>
@@ -159,7 +159,7 @@ function handleCronPreset(preset: string) {
159
159
  </div>
160
160
 
161
161
  <!-- Agent ID (optional) -->
162
- <div class="form-field">
162
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
163
163
  <label for="agentId">{t(M['agents.schedule_form.agent_id'])}</label>
164
164
  <Input
165
165
  type="text"
@@ -172,7 +172,7 @@ function handleCronPreset(preset: string) {
172
172
  </div>
173
173
 
174
174
  <!-- Method -->
175
- <div class="form-field">
175
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
176
176
  <label for="method">Method</label>
177
177
  <Input
178
178
  type="text"
@@ -185,7 +185,7 @@ function handleCronPreset(preset: string) {
185
185
  </div>
186
186
 
187
187
  <!-- Cron Expression -->
188
- <div class="form-field form-field--full">
188
+ <div class="smrt-agent-schedule-form__field smrt-agent-schedule-form__field-full" data-smrt-part="field">
189
189
  <label for="cron">{t(M['agents.schedule_form.cron_schedule'])}</label>
190
190
  <Input
191
191
  type="text"
@@ -195,7 +195,7 @@ function handleCronPreset(preset: string) {
195
195
  required
196
196
  disabled={loading}
197
197
  />
198
- <div class="cron-presets">
198
+ <div class="smrt-agent-schedule-form__presets" data-smrt-part="list">
199
199
  {#each cronPresets as preset}
200
200
  <Button
201
201
  variant="secondary"
@@ -211,7 +211,7 @@ function handleCronPreset(preset: string) {
211
211
  </div>
212
212
 
213
213
  <!-- Timezone -->
214
- <div class="form-field">
214
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
215
215
  <label for="timezone">Timezone</label>
216
216
  <Select id="timezone" bind:value={timezone} disabled={loading}>
217
217
  {#each timezones as tz}
@@ -221,7 +221,7 @@ function handleCronPreset(preset: string) {
221
221
  </div>
222
222
 
223
223
  <!-- Max Concurrent -->
224
- <div class="form-field">
224
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
225
225
  <label for="maxConcurrent">{t(M['agents.schedule_form.max_concurrent'])}</label>
226
226
  <Input
227
227
  type="number"
@@ -235,7 +235,7 @@ function handleCronPreset(preset: string) {
235
235
  </div>
236
236
 
237
237
  <!-- Timeout -->
238
- <div class="form-field">
238
+ <div class="smrt-agent-schedule-form__field" data-smrt-part="field">
239
239
  <label for="timeout">Timeout (ms)</label>
240
240
  <Input
241
241
  type="number"
@@ -249,7 +249,7 @@ function handleCronPreset(preset: string) {
249
249
  </div>
250
250
 
251
251
  <!-- Enabled -->
252
- <div class="form-field form-field--checkbox">
252
+ <div class="smrt-agent-schedule-form__field smrt-agent-schedule-form__field-checkbox" data-smrt-part="field">
253
253
  <Checkbox
254
254
  name="enabled"
255
255
  label={t(M['agents.schedule_form.enable_schedule_immediately'])}
@@ -259,7 +259,7 @@ function handleCronPreset(preset: string) {
259
259
  </div>
260
260
  </div>
261
261
 
262
- <div class="form-actions">
262
+ <div class="smrt-agent-schedule-form__actions" data-smrt-part="actions">
263
263
  {#if onCancel}
264
264
  <Button variant="secondary" onclick={onCancel} disabled={loading}>
265
265
  Cancel
@@ -275,58 +275,56 @@ function handleCronPreset(preset: string) {
275
275
 
276
276
  <style>
277
277
  @layer smrt.reset, smrt.structure, smrt.theme;
278
- @layer smrt.theme {
279
- .schedule-form-shell :global(.schedule-form) {
278
+ @layer smrt.structure {
279
+ .smrt-agent-schedule-form__root :global(.schedule-form) {
280
280
  padding: var(--smrt-spacing-sm, 0.5rem) 0;
281
281
  }
282
-
283
- .form-grid {
282
+ .smrt-agent-schedule-form__grid {
284
283
  display: grid;
285
284
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
286
285
  gap: var(--smrt-spacing-md, 1rem);
287
286
  }
288
-
289
- .form-field {
287
+ .smrt-agent-schedule-form__field {
290
288
  display: flex;
291
289
  flex-direction: column;
292
290
  gap: var(--smrt-spacing-xs, 0.25rem);
293
291
  }
294
-
295
- .form-field--full {
292
+ .smrt-agent-schedule-form__field-full {
296
293
  grid-column: 1 / -1;
297
294
  }
298
-
299
- .form-field--checkbox {
295
+ .smrt-agent-schedule-form__field-checkbox {
300
296
  flex-direction: row;
301
297
  align-items: center;
302
298
  gap: var(--smrt-spacing-sm, 0.5rem);
303
299
  }
304
-
305
- .form-field label {
306
- font-weight: var(--smrt-typography-weight-medium, 500);
307
- font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
308
- color: var(--smrt-color-on-surface);
309
- }
310
-
311
- .form-field small {
312
- font: var(--smrt-typography-body-small-font, 0.75rem / 1.25 sans-serif);
313
- color: var(--smrt-color-on-surface-variant);
314
- }
315
-
316
- .cron-presets {
300
+ .smrt-agent-schedule-form__presets {
317
301
  display: flex;
318
302
  flex-wrap: wrap;
319
303
  gap: var(--smrt-spacing-xs, 0.25rem);
320
304
  margin-top: var(--smrt-spacing-xs, 0.25rem);
321
305
  }
322
-
323
- .form-actions {
306
+ .smrt-agent-schedule-form__actions {
324
307
  display: flex;
325
308
  justify-content: flex-end;
326
309
  gap: var(--smrt-spacing-sm, 0.5rem);
327
310
  margin-top: var(--smrt-spacing-lg, 1.5rem);
328
311
  padding-top: var(--smrt-spacing-md, 1rem);
312
+ }
313
+ }
314
+
315
+ @layer smrt.theme {
316
+ .smrt-agent-schedule-form__field label {
317
+ font-weight: var(--smrt-typography-weight-medium, 500);
318
+ font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
319
+ color: var(--smrt-color-on-surface);
320
+ }
321
+ .smrt-agent-schedule-form__field small {
322
+ font: var(--smrt-typography-body-small-font, 0.75rem / 1.25 sans-serif);
323
+ color: var(--smrt-color-on-surface-variant);
324
+ }
325
+ .smrt-agent-schedule-form__actions {
329
326
  border-top: var(--smrt-hairline);
330
327
  }
331
328
  }
329
+
332
330
  </style>