dsh-hive-panel 0.1.4 → 0.1.5
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/CHANGELOG.md +31 -0
- package/SPEC.md +70 -3
- package/docs/DESIGN.md +20 -5
- package/lib/client.js +1193 -299
- package/lib/index.js +166 -1
- package/package.json +1 -1
- package/scripts/verify.mjs +177 -6
- package/src/panel.js +1193 -299
package/lib/client.js
CHANGED
|
@@ -41,23 +41,26 @@ const QUEEN_DISMISS_KEY = "hive.queenNoticeDismissed";
|
|
|
41
41
|
const DEFAULT_INTERVAL_MS = 3000;
|
|
42
42
|
|
|
43
43
|
const CARD_ACTIONS = Object.freeze({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// remove is available in every stored state; the drawer renders it as a
|
|
45
|
+
// danger button, disabled with an explanation while the card is claimed
|
|
46
|
+
// (the panel never sends --force, so the CLI would refuse).
|
|
47
|
+
pending: Object.freeze(["claim", "remove"]),
|
|
48
|
+
claimed: Object.freeze(["done", "fail", "remove"]),
|
|
49
|
+
done: Object.freeze(["remove"]),
|
|
50
|
+
blocked: Object.freeze(["retry", "remove"]),
|
|
51
|
+
failed: Object.freeze(["retry", "remove"]),
|
|
49
52
|
});
|
|
50
53
|
|
|
51
54
|
const ACTION_META = Object.freeze({
|
|
52
|
-
freeze: { labelKey: "action.freeze", helpKey: "help.action.freeze"
|
|
53
|
-
unfreeze: { labelKey: "action.unfreeze", helpKey: "help.action.unfreeze"
|
|
54
|
-
add: { labelKey: "action.add", helpKey: "help.action.add"
|
|
55
|
-
plan: { labelKey: "action.plan", helpKey: "help.action.plan"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
freeze: { labelKey: "action.freeze", helpKey: "help.action.freeze" },
|
|
56
|
+
unfreeze: { labelKey: "action.unfreeze", helpKey: "help.action.unfreeze" },
|
|
57
|
+
add: { labelKey: "action.add", helpKey: "help.action.add" },
|
|
58
|
+
plan: { labelKey: "action.plan", helpKey: "help.action.plan" },
|
|
59
|
+
claim: { labelKey: "action.claim", helpKey: "help.action.claim" },
|
|
60
|
+
done: { labelKey: "action.done", helpKey: "help.action.done" },
|
|
61
|
+
fail: { labelKey: "action.fail", helpKey: "help.action.fail" },
|
|
62
|
+
retry: { labelKey: "action.retry", helpKey: "help.action.retry" },
|
|
63
|
+
remove: { labelKey: "action.remove", helpKey: "help.action.remove" },
|
|
61
64
|
});
|
|
62
65
|
|
|
63
66
|
const MIN_PLAN_CARDS = 1;
|
|
@@ -130,6 +133,23 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
130
133
|
font-weight: 700;
|
|
131
134
|
}
|
|
132
135
|
|
|
136
|
+
/* Destructive card action: the drawer's delete control. */
|
|
137
|
+
.hive-btn-danger {
|
|
138
|
+
border-color: color-mix(in srgb, var(--hive-danger) 55%, var(--hive-line, #232b38));
|
|
139
|
+
background: color-mix(in srgb, var(--hive-danger) 12%, transparent);
|
|
140
|
+
color: color-mix(in srgb, var(--hive-danger) 88%, var(--hive-fg, #e6edf3));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.hive-btn-danger:hover:not(:disabled) {
|
|
144
|
+
border-color: color-mix(in srgb, var(--hive-danger) 75%, var(--hive-line, #232b38));
|
|
145
|
+
background: color-mix(in srgb, var(--hive-danger) 22%, transparent);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.hive-btn-danger:disabled {
|
|
149
|
+
opacity: 0.5;
|
|
150
|
+
cursor: not-allowed;
|
|
151
|
+
}
|
|
152
|
+
|
|
133
153
|
.hive-overlay { position: absolute; inset: 0; z-index: 2147483000; }
|
|
134
154
|
.hive-help-scrim { background: transparent; }
|
|
135
155
|
.hive-dialog-scrim {
|
|
@@ -938,7 +958,7 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
938
958
|
|
|
939
959
|
.hive-limits-row {
|
|
940
960
|
display: grid;
|
|
941
|
-
grid-template-columns: minmax(0, 1fr)
|
|
961
|
+
grid-template-columns: minmax(0, 1fr) 96px 48px 48px;
|
|
942
962
|
align-items: center;
|
|
943
963
|
gap: 6px;
|
|
944
964
|
min-width: 0;
|
|
@@ -1034,6 +1054,95 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1034
1054
|
overflow-wrap: anywhere;
|
|
1035
1055
|
}
|
|
1036
1056
|
|
|
1057
|
+
.hive-supervisor-inline {
|
|
1058
|
+
display: inline-flex;
|
|
1059
|
+
flex-wrap: wrap;
|
|
1060
|
+
align-items: center;
|
|
1061
|
+
gap: 5px;
|
|
1062
|
+
min-width: 0;
|
|
1063
|
+
padding: 1px 8px;
|
|
1064
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1065
|
+
border-radius: 999px;
|
|
1066
|
+
background: var(--hive-surface);
|
|
1067
|
+
color: var(--hive-fg-soft);
|
|
1068
|
+
font-size: 10px;
|
|
1069
|
+
line-height: 1.6;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.hive-supervisor-inline.is-hidden { display: none; }
|
|
1073
|
+
|
|
1074
|
+
.hive-supervisor-inline-label {
|
|
1075
|
+
color: var(--hive-fg-faint);
|
|
1076
|
+
font-size: 9.5px;
|
|
1077
|
+
font-weight: 650;
|
|
1078
|
+
letter-spacing: 0.1em;
|
|
1079
|
+
text-transform: uppercase;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.hive-supervisor-inline-state {
|
|
1083
|
+
color: var(--hive-fg-soft);
|
|
1084
|
+
font-weight: 600;
|
|
1085
|
+
white-space: nowrap;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.hive-supervisor-inline-state.is-running { color: var(--hive-ok); }
|
|
1089
|
+
.hive-supervisor-inline-state.is-idle { color: var(--hive-fg-soft); }
|
|
1090
|
+
.hive-supervisor-inline-state.is-backoff { color: var(--hive-warn); }
|
|
1091
|
+
.hive-supervisor-inline-state.is-paused { color: var(--hive-danger); }
|
|
1092
|
+
|
|
1093
|
+
.hive-supervisor-inline-resume {
|
|
1094
|
+
padding: 1px 6px;
|
|
1095
|
+
font-size: 9.5px;
|
|
1096
|
+
line-height: 1.3;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.hive-supervisor-inline-resume.is-hidden { display: none; }
|
|
1100
|
+
|
|
1101
|
+
.hive-settings-trigger {
|
|
1102
|
+
flex: 0 0 auto;
|
|
1103
|
+
min-width: 28px;
|
|
1104
|
+
padding-inline: 8px;
|
|
1105
|
+
font-size: 14px;
|
|
1106
|
+
line-height: 1.2;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
.hive-settings-section {
|
|
1110
|
+
display: flex;
|
|
1111
|
+
flex-direction: column;
|
|
1112
|
+
gap: 8px;
|
|
1113
|
+
min-width: 0;
|
|
1114
|
+
padding-top: 12px;
|
|
1115
|
+
border-top: 1px solid color-mix(in srgb, var(--hive-line, #232b38) 70%, transparent);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.hive-settings-section:first-of-type { padding-top: 0; border-top: 0; }
|
|
1119
|
+
|
|
1120
|
+
.hive-settings-section-title {
|
|
1121
|
+
color: var(--hive-fg, #e6edf3);
|
|
1122
|
+
font-size: 11px;
|
|
1123
|
+
font-weight: 650;
|
|
1124
|
+
letter-spacing: 0.08em;
|
|
1125
|
+
text-transform: uppercase;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
.hive-settings-role-form { align-items: flex-end; }
|
|
1129
|
+
|
|
1130
|
+
.hive-settings-role-description { width: 100%; }
|
|
1131
|
+
|
|
1132
|
+
.hive-settings-role-description .hive-textarea { width: 100%; }
|
|
1133
|
+
|
|
1134
|
+
.hive-settings-role-form .hive-field:first-child { flex: 1 1 200px; }
|
|
1135
|
+
|
|
1136
|
+
.hive-settings-note {
|
|
1137
|
+
padding: 8px 10px;
|
|
1138
|
+
border: 1px solid color-mix(in srgb, var(--hive-warn) 38%, var(--hive-line, #232b38));
|
|
1139
|
+
border-radius: 6px;
|
|
1140
|
+
background: color-mix(in srgb, var(--hive-warn) 9%, transparent);
|
|
1141
|
+
color: var(--hive-warn);
|
|
1142
|
+
font-size: 10.5px;
|
|
1143
|
+
line-height: 1.55;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1037
1146
|
/* -------------------------------------------------------------------- spacing */
|
|
1038
1147
|
.hive {
|
|
1039
1148
|
gap: 8px;
|
|
@@ -1107,6 +1216,46 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1107
1216
|
line-height: 1.55;
|
|
1108
1217
|
}
|
|
1109
1218
|
|
|
1219
|
+
.hive-icon-button {
|
|
1220
|
+
display: inline-flex;
|
|
1221
|
+
flex: 0 0 28px;
|
|
1222
|
+
align-items: center;
|
|
1223
|
+
justify-content: center;
|
|
1224
|
+
width: 28px;
|
|
1225
|
+
min-width: 28px;
|
|
1226
|
+
height: 28px;
|
|
1227
|
+
padding: 0;
|
|
1228
|
+
border: 0;
|
|
1229
|
+
border-color: transparent;
|
|
1230
|
+
background: transparent;
|
|
1231
|
+
color: color-mix(in srgb, var(--hive-fg, #e6edf3) 80%, transparent);
|
|
1232
|
+
font-size: 0;
|
|
1233
|
+
line-height: 1;
|
|
1234
|
+
box-shadow: none;
|
|
1235
|
+
cursor: pointer;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.hive-icon-button:hover {
|
|
1239
|
+
border: 0;
|
|
1240
|
+
border-color: transparent;
|
|
1241
|
+
background: transparent;
|
|
1242
|
+
color: var(--hive-fg, #e6edf3);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.hive-icon-button:active { transform: none; }
|
|
1246
|
+
|
|
1247
|
+
.hive-icon-button:focus-visible {
|
|
1248
|
+
outline: 2px solid var(--hive-accent, #58c4dc);
|
|
1249
|
+
outline-offset: 1px;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
.hive-icon-button svg {
|
|
1253
|
+
display: block;
|
|
1254
|
+
width: 16px;
|
|
1255
|
+
height: 16px;
|
|
1256
|
+
pointer-events: none;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1110
1259
|
@media (max-width: 520px) {
|
|
1111
1260
|
.hive { gap: 6px; padding: 12px; }
|
|
1112
1261
|
.hive-bar,
|
|
@@ -1131,7 +1280,183 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1131
1280
|
.hive-dialog-foot .hive-btn { flex: 1 1 auto; }
|
|
1132
1281
|
.hive-help { right: 8px; width: calc(100% - 16px); max-height: 66vh; }
|
|
1133
1282
|
.hive-toast { right: 8px; bottom: 8px; width: calc(100% - 16px); }
|
|
1134
|
-
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.hive-settings-actions {
|
|
1286
|
+
display: flex;
|
|
1287
|
+
align-items: center;
|
|
1288
|
+
justify-content: flex-end;
|
|
1289
|
+
gap: 8px;
|
|
1290
|
+
width: 100%;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.hive-settings-actions .hive-btn {
|
|
1294
|
+
display: inline-flex;
|
|
1295
|
+
flex: 0 0 auto;
|
|
1296
|
+
align-items: center;
|
|
1297
|
+
justify-content: center;
|
|
1298
|
+
height: 28px;
|
|
1299
|
+
min-height: 28px;
|
|
1300
|
+
padding: 0 14px;
|
|
1301
|
+
border-radius: 7px;
|
|
1302
|
+
font-size: 11.5px;
|
|
1303
|
+
line-height: 1;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.hive-settings-primary {
|
|
1307
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
|
|
1308
|
+
background: var(--hive-accent, #58c4dc);
|
|
1309
|
+
color: var(--hive-bg, #0b0f17);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
.hive-settings-primary:hover {
|
|
1313
|
+
border-color: var(--hive-accent, #58c4dc);
|
|
1314
|
+
background: color-mix(in srgb, var(--hive-accent, #58c4dc) 86%, white);
|
|
1315
|
+
color: var(--hive-bg, #0b0f17);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
.hive-settings-secondary {
|
|
1319
|
+
border-color: var(--hive-line, #232b38);
|
|
1320
|
+
background: var(--hive-surface-strong);
|
|
1321
|
+
color: var(--hive-fg, #e6edf3);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.hive-settings-secondary:hover {
|
|
1325
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 40%, var(--hive-line, #232b38));
|
|
1326
|
+
background: var(--hive-surface-hover);
|
|
1327
|
+
color: var(--hive-fg, #e6edf3);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.hive-settings-actions .hive-btn:disabled {
|
|
1331
|
+
opacity: 0.55;
|
|
1332
|
+
cursor: not-allowed;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
@media (max-width: 420px) {
|
|
1336
|
+
.hive-settings-actions { justify-content: stretch; }
|
|
1337
|
+
.hive-settings-actions .hive-btn { flex: 1 1 0; }
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
@container hiveboard (max-width: 419px) {
|
|
1341
|
+
.hive-settings-actions { justify-content: stretch; }
|
|
1342
|
+
.hive-settings-actions .hive-btn { flex: 1 1 0; }
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.hive-card-scrim { padding: 12px; }
|
|
1346
|
+
|
|
1347
|
+
.hive-card-dialog {
|
|
1348
|
+
position: relative;
|
|
1349
|
+
inset: auto;
|
|
1350
|
+
width: min(720px, 92vw);
|
|
1351
|
+
max-width: 92vw;
|
|
1352
|
+
height: auto;
|
|
1353
|
+
max-height: 80vh;
|
|
1354
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1355
|
+
border-radius: 12px;
|
|
1356
|
+
background: color-mix(in srgb, var(--hive-bg, #0b0f17) 97%, var(--hive-fg, #e6edf3) 3%);
|
|
1357
|
+
box-shadow: 0 24px 70px rgb(0 0 0 / 52%);
|
|
1358
|
+
overflow: hidden;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
.hive-card-dialog .hive-dialog-head { align-items: flex-start; }
|
|
1362
|
+
|
|
1363
|
+
.hive-card-subline {
|
|
1364
|
+
margin-top: 3px;
|
|
1365
|
+
overflow-wrap: anywhere;
|
|
1366
|
+
color: var(--hive-fg-soft);
|
|
1367
|
+
font-family: var(--hive-mono);
|
|
1368
|
+
font-size: 10.5px;
|
|
1369
|
+
line-height: 1.5;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
.hive-card-close {
|
|
1373
|
+
min-width: 28px;
|
|
1374
|
+
height: 28px;
|
|
1375
|
+
padding: 0 6px;
|
|
1376
|
+
color: var(--hive-fg-soft);
|
|
1377
|
+
font-size: 18px;
|
|
1378
|
+
line-height: 1;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.hive-card-body {
|
|
1382
|
+
display: flex;
|
|
1383
|
+
flex-direction: column;
|
|
1384
|
+
gap: 12px;
|
|
1385
|
+
min-height: 0;
|
|
1386
|
+
overflow: auto;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
.hive-card-json {
|
|
1390
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1391
|
+
border-radius: 8px;
|
|
1392
|
+
background: var(--hive-surface);
|
|
1393
|
+
overflow: hidden;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
.hive-card-json-summary {
|
|
1397
|
+
padding: 8px 10px;
|
|
1398
|
+
color: var(--hive-fg-soft);
|
|
1399
|
+
font-size: 10px;
|
|
1400
|
+
font-weight: 650;
|
|
1401
|
+
letter-spacing: 0.08em;
|
|
1402
|
+
line-height: 1.5;
|
|
1403
|
+
text-transform: uppercase;
|
|
1404
|
+
cursor: pointer;
|
|
1405
|
+
user-select: none;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.hive-card-json .hive-json {
|
|
1409
|
+
max-height: 300px;
|
|
1410
|
+
margin: 0;
|
|
1411
|
+
padding: 10px;
|
|
1412
|
+
overflow: auto;
|
|
1413
|
+
border-top: 1px solid var(--hive-line, #232b38);
|
|
1414
|
+
font-family: var(--hive-mono);
|
|
1415
|
+
font-size: 10.5px;
|
|
1416
|
+
line-height: 1.5;
|
|
1417
|
+
white-space: pre-wrap;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
.hive-card-actions {
|
|
1421
|
+
justify-content: flex-end;
|
|
1422
|
+
gap: 8px;
|
|
1423
|
+
flex-wrap: wrap;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.hive-add-dialog {
|
|
1427
|
+
width: min(560px, 92vw);
|
|
1428
|
+
max-width: 92vw;
|
|
1429
|
+
max-height: 80vh;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
.hive-add-body {
|
|
1433
|
+
display: flex;
|
|
1434
|
+
flex-direction: column;
|
|
1435
|
+
gap: 10px;
|
|
1436
|
+
min-height: 0;
|
|
1437
|
+
overflow: auto;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
.hive-add-body .hive-field { width: 100%; }
|
|
1441
|
+
|
|
1442
|
+
.hive-add-body .hive-input,
|
|
1443
|
+
.hive-add-body .hive-textarea { width: 100%; }
|
|
1444
|
+
|
|
1445
|
+
.hive-add-acceptance { min-height: 70px; }
|
|
1446
|
+
|
|
1447
|
+
.hive-add-submit {
|
|
1448
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
|
|
1449
|
+
background: var(--hive-accent, #58c4dc);
|
|
1450
|
+
color: var(--hive-bg, #0b0f17);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
.hive-add-submit:hover:not(:disabled) {
|
|
1454
|
+
border-color: var(--hive-accent, #58c4dc);
|
|
1455
|
+
background: color-mix(in srgb, var(--hive-accent, #58c4dc) 86%, white);
|
|
1456
|
+
color: var(--hive-bg, #0b0f17);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
`;
|
|
1135
1460
|
|
|
1136
1461
|
const LANE_LABEL_KEYS = Object.freeze({
|
|
1137
1462
|
pending: "lane.pending",
|
|
@@ -1152,13 +1477,13 @@ const messages = Object.freeze({
|
|
|
1152
1477
|
"actions.aria": "board actions",
|
|
1153
1478
|
"action.add": "New task",
|
|
1154
1479
|
"action.claim": "claim",
|
|
1155
|
-
"action.commit": "commit",
|
|
1156
1480
|
"action.done": "done",
|
|
1157
1481
|
"action.fail": "fail",
|
|
1158
|
-
"action.freeze": "
|
|
1482
|
+
"action.freeze": "Pause",
|
|
1159
1483
|
"action.modeTitle": "Toggle board mode",
|
|
1484
|
+
"action.remove": "Delete task",
|
|
1160
1485
|
"action.retry": "retry",
|
|
1161
|
-
"action.unfreeze": "
|
|
1486
|
+
"action.unfreeze": "Resume",
|
|
1162
1487
|
"pane.agents": "agents",
|
|
1163
1488
|
"pane.board": "board",
|
|
1164
1489
|
"pane.events": "events",
|
|
@@ -1177,7 +1502,7 @@ const messages = Object.freeze({
|
|
|
1177
1502
|
"mode.freeze": "freeze",
|
|
1178
1503
|
"mode.free.help": "Free: anyone can claim tasks.",
|
|
1179
1504
|
"mode.freeze.help": "Freeze: only tasks tagged fix can be claimed; use this while the pipeline is red.",
|
|
1180
|
-
"mode.freeze.banner": "
|
|
1505
|
+
"mode.freeze.banner": "Paused: only tasks tagged fix can be claimed.",
|
|
1181
1506
|
"mode.title": "mode:",
|
|
1182
1507
|
"stats.cards": "tasks",
|
|
1183
1508
|
"stats.oldest": "oldest",
|
|
@@ -1208,6 +1533,7 @@ const messages = Object.freeze({
|
|
|
1208
1533
|
"drawer.cardActions": "task actions",
|
|
1209
1534
|
"drawer.noActions": "No actions for this state.",
|
|
1210
1535
|
"drawer.readOnly": "Read-only: writable=false.",
|
|
1536
|
+
"drawer.removeClaimed": "A claimed task must be released or reopened before it can be deleted.",
|
|
1211
1537
|
"drawer.rawJson": "raw json",
|
|
1212
1538
|
"events.empty": "No events yet.",
|
|
1213
1539
|
"events.showAll": "Show all events",
|
|
@@ -1223,45 +1549,85 @@ const messages = Object.freeze({
|
|
|
1223
1549
|
"supervisor.resumeAria": "Resume the supervisor for {repo}",
|
|
1224
1550
|
"supervisor.resumeFailed": "Could not resume the supervisor",
|
|
1225
1551
|
"limits.open": "Settings",
|
|
1226
|
-
"limits.openAria": "
|
|
1227
|
-
"limits.title": "
|
|
1228
|
-
"limits.aria": "
|
|
1229
|
-
"limits.description": "
|
|
1552
|
+
"limits.openAria": "Open agent concurrency settings",
|
|
1553
|
+
"limits.title": "Agent concurrency",
|
|
1554
|
+
"limits.aria": "Agent concurrency for this repository",
|
|
1555
|
+
"limits.description": "Max agents working at the same time, per role; 0 pauses the role",
|
|
1230
1556
|
"limits.role": "Role",
|
|
1231
|
-
"limits.limit": "
|
|
1557
|
+
"limits.limit": "Concurrency limit",
|
|
1232
1558
|
"limits.inFlight": "In flight",
|
|
1233
1559
|
"limits.queued": "Queued",
|
|
1234
1560
|
"limits.defaultHint": "0-999, default 5",
|
|
1235
1561
|
"limits.limitAria": "Concurrency limit for {role}",
|
|
1236
1562
|
"limits.save": "Save",
|
|
1237
|
-
"limits.saveAria": "Save
|
|
1563
|
+
"limits.saveAria": "Save agent concurrency for {repo}",
|
|
1238
1564
|
"limits.saving": "Saving...",
|
|
1239
|
-
"limits.saved": "
|
|
1240
|
-
"limits.failed": "Could not save
|
|
1565
|
+
"limits.saved": "Agent concurrency saved.",
|
|
1566
|
+
"limits.failed": "Could not save agent concurrency",
|
|
1241
1567
|
"limits.invalid": "Every limit must be an integer from 0 to 999.",
|
|
1242
1568
|
"limits.none": "No role data for this repository.",
|
|
1243
1569
|
"limits.close": "Close",
|
|
1244
|
-
"limits.closeAria": "Close
|
|
1570
|
+
"limits.closeAria": "Close agent concurrency settings",
|
|
1571
|
+
"settings.openAria": "Open settings for this repository",
|
|
1572
|
+
"settings.title": "Settings",
|
|
1573
|
+
"settings.aria": "Settings for this repository",
|
|
1574
|
+
"settings.addRole": "Add role",
|
|
1575
|
+
"settings.roleName": "Role name",
|
|
1576
|
+
"settings.roleNameHint": "start with a lowercase letter; 2-32 characters; lowercase letters, digits and hyphens only",
|
|
1577
|
+
"settings.roleNameAria": "New role name",
|
|
1578
|
+
"settings.roleNameExample": "e.g. reviewer",
|
|
1579
|
+
"settings.roleDescription": "Responsibilities",
|
|
1580
|
+
"settings.roleDescriptionAria": "Responsibilities for the new role (optional)",
|
|
1581
|
+
"settings.roleDescriptionHint": "Written to .hive/roles/<name>.md; the agent reads it when it starts.",
|
|
1582
|
+
"settings.roleDescriptionMax": "optional, up to 2000 characters",
|
|
1583
|
+
"settings.descriptionTooLong": "Responsibilities must be at most 2000 characters.",
|
|
1584
|
+
"settings.adapter": "Adapter",
|
|
1585
|
+
"settings.adapterAria": "Adapter for the new role",
|
|
1586
|
+
"settings.model": "Model",
|
|
1587
|
+
"settings.modelOptional": "optional",
|
|
1588
|
+
"settings.modelAria": "Optional model for the new role",
|
|
1589
|
+
"settings.addRoleButton": "Add role",
|
|
1590
|
+
"settings.addRoleAria": "Add this role",
|
|
1591
|
+
"settings.addingRole": "Adding...",
|
|
1592
|
+
"settings.roleInvalid": "Role name must start with a lowercase letter, be 2-32 characters, and use lowercase letters, digits and hyphens only.",
|
|
1593
|
+
"settings.modelInvalid": "Model may use letters, digits, dot, underscore, colon and hyphen (max 64).",
|
|
1594
|
+
"settings.roleExists": "Role already exists.",
|
|
1595
|
+
"settings.roleAdded": "Role added.",
|
|
1596
|
+
"settings.roleFailed": "Could not add role",
|
|
1597
|
+
"settings.readOnly": "Read-only: roles and limits cannot be changed.",
|
|
1598
|
+
"settings.supervisorUnavailable": "Supervisor unavailable; role limits cannot load.",
|
|
1599
|
+
"settings.saveLimits": "Save limits",
|
|
1600
|
+
"settings.close": "Close",
|
|
1601
|
+
"settings.closeAria": "Close settings",
|
|
1245
1602
|
"event.unknown": "event",
|
|
1603
|
+
"add.dialogTitle": "New task",
|
|
1604
|
+
"add.title": "Title",
|
|
1605
|
+
"add.titleAria": "New task title",
|
|
1606
|
+
"add.role": "Role",
|
|
1607
|
+
"add.roleAria": "Role for the new task",
|
|
1608
|
+
"add.scope": "Scope (comma separated, optional)",
|
|
1609
|
+
"add.scopeAria": "File scope for the new task",
|
|
1610
|
+
"add.after": "After task ids (comma separated, optional)",
|
|
1611
|
+
"add.afterAria": "Tasks that must finish first",
|
|
1612
|
+
"add.acceptance": "Acceptance criteria (optional)",
|
|
1613
|
+
"add.acceptanceAria": "Acceptance criteria for the new task",
|
|
1614
|
+
"add.cancel": "Cancel",
|
|
1615
|
+
"add.submit": "Add task",
|
|
1616
|
+
"add.submitting": "Adding…",
|
|
1617
|
+
"add.required": "A title is required.",
|
|
1246
1618
|
"prompt.newTitle": "New task title",
|
|
1247
1619
|
"prompt.role": "Role",
|
|
1248
1620
|
"prompt.scope": "Scope (comma separated, optional)",
|
|
1249
1621
|
"prompt.after": "After task ids (comma separated, optional)",
|
|
1250
|
-
"prompt.commitMessage": "Commit message",
|
|
1251
|
-
"prompt.paths": "Paths (comma separated, optional)",
|
|
1252
1622
|
"prompt.claimAgent": "Claim as agent",
|
|
1253
1623
|
"prompt.commitSha": "Commit sha (optional)",
|
|
1254
1624
|
"prompt.failReason": "Failure reason",
|
|
1255
|
-
"action.plan": "
|
|
1256
|
-
"help.open": "What these buttons do",
|
|
1625
|
+
"action.plan": "Set the Queen a goal",
|
|
1257
1626
|
"menu.open": "More actions and help",
|
|
1258
|
-
"help.title": "
|
|
1259
|
-
"help.aria": "
|
|
1627
|
+
"help.title": "Menu",
|
|
1628
|
+
"help.aria": "Menu",
|
|
1260
1629
|
"help.close": "close",
|
|
1261
|
-
"help.closeAria": "Close the
|
|
1262
|
-
"help.board": "board actions",
|
|
1263
|
-
"help.tasks": "task actions",
|
|
1264
|
-
"help.params": "Parameters: ",
|
|
1630
|
+
"help.closeAria": "Close the menu",
|
|
1265
1631
|
"help.readOnly": "The panel started read-only; add --write to show the write-action buttons.",
|
|
1266
1632
|
"help.uninitialised": "Initialise Hive with the button in the main area before using board actions.",
|
|
1267
1633
|
"init.repo": "repository",
|
|
@@ -1291,29 +1657,20 @@ const messages = Object.freeze({
|
|
|
1291
1657
|
"queen.takeover": "Let the Queen take over",
|
|
1292
1658
|
"queen.takeoverAria": "Let the Queen take over this session",
|
|
1293
1659
|
"queen.takeoverBusy": "Taking over...",
|
|
1294
|
-
"help.
|
|
1295
|
-
"help.action.
|
|
1296
|
-
"help.action.unfreeze": "Unfreeze: agents can claim pending tasks again.",
|
|
1660
|
+
"help.action.freeze": "Pause: only tasks tagged fix can be claimed.",
|
|
1661
|
+
"help.action.unfreeze": "Resume: agents can claim pending tasks again.",
|
|
1297
1662
|
"help.action.add": "New task: create a pending task with a role and file scope.",
|
|
1298
|
-
"help.action.plan": "
|
|
1299
|
-
"help.action.commit": "Commit: commit the selected paths with a message.",
|
|
1663
|
+
"help.action.plan": "Set the Queen a goal: split a goal into tasks, preview the plan, then write it to the board.",
|
|
1300
1664
|
"help.action.claim": "Claim: lease a pending task for an agent.",
|
|
1301
1665
|
"help.action.done": "Done: mark a claimed task complete, optionally with a commit sha.",
|
|
1302
1666
|
"help.action.fail": "Fail: mark a claimed task failed and record the reason.",
|
|
1303
1667
|
"help.action.retry": "Retry: put a failed or blocked task back in the queue.",
|
|
1304
|
-
"help.
|
|
1305
|
-
"
|
|
1306
|
-
"help.params.plan": "goal, maxCards",
|
|
1307
|
-
"help.params.commit": "message, set[]",
|
|
1308
|
-
"help.params.claim": "id, agent",
|
|
1309
|
-
"help.params.done": "id, sha?",
|
|
1310
|
-
"help.params.fail": "id, reason",
|
|
1311
|
-
"help.params.retry": "id",
|
|
1312
|
-
"plan.dialogTitle": "Give the Queen a goal",
|
|
1668
|
+
"help.action.remove": "Delete this task card permanently. A claimed task has to be released or reopened first.",
|
|
1669
|
+
"plan.dialogTitle": "Set the Queen a goal",
|
|
1313
1670
|
"plan.dialogAria": "Plan tasks from a goal",
|
|
1314
1671
|
"plan.goal": "Goal",
|
|
1315
1672
|
"plan.goalHint": "Describe the outcome; the Queen will split it into tasks.",
|
|
1316
|
-
"plan.maxCards": "Max
|
|
1673
|
+
"plan.maxCards": "Max tasks",
|
|
1317
1674
|
"plan.maxCardsHint": "1+",
|
|
1318
1675
|
"plan.preview": "Preview plan",
|
|
1319
1676
|
"plan.previewAria": "Ask the Queen to draft a task plan without writing it",
|
|
@@ -1334,14 +1691,16 @@ const messages = Object.freeze({
|
|
|
1334
1691
|
"plan.deps": "deps",
|
|
1335
1692
|
"plan.none": "—",
|
|
1336
1693
|
"plan.goalRequired": "Enter a goal first.",
|
|
1337
|
-
"plan.maxInvalid": "Max
|
|
1694
|
+
"plan.maxInvalid": "Max tasks must be a positive whole number.",
|
|
1338
1695
|
"plan.previewFirst": "Preview the plan before writing tasks.",
|
|
1339
1696
|
"plan.previewFailed": "Could not read the plan.",
|
|
1340
1697
|
"plan.applyHint": "The preview is read-only; writing calls plan again with apply=true.",
|
|
1341
|
-
"plan.stale": "The goal or max
|
|
1698
|
+
"plan.stale": "The goal or max tasks changed; preview the plan again.",
|
|
1342
1699
|
"plan.error": "Plan failed",
|
|
1700
|
+
"confirm.remove": "Delete task \"{title}\" permanently? This cannot be undone.",
|
|
1343
1701
|
"toast.dismiss": "Dismiss",
|
|
1344
1702
|
"toast.planWritten": "Tasks written",
|
|
1703
|
+
"toast.taskRemoved": "Task deleted",
|
|
1345
1704
|
"toast.pickupHint": "The supervisor will pick them up automatically.",
|
|
1346
1705
|
}),
|
|
1347
1706
|
zh: Object.freeze({
|
|
@@ -1349,13 +1708,13 @@ const messages = Object.freeze({
|
|
|
1349
1708
|
"actions.aria": "看板操作",
|
|
1350
1709
|
"action.add": "新建任务",
|
|
1351
1710
|
"action.claim": "认领",
|
|
1352
|
-
"action.commit": "提交",
|
|
1353
1711
|
"action.done": "完成",
|
|
1354
1712
|
"action.fail": "标记失败",
|
|
1355
|
-
"action.freeze": "
|
|
1713
|
+
"action.freeze": "暂停",
|
|
1356
1714
|
"action.modeTitle": "切换看板模式",
|
|
1715
|
+
"action.remove": "删除任务",
|
|
1357
1716
|
"action.retry": "重试",
|
|
1358
|
-
"action.unfreeze": "
|
|
1717
|
+
"action.unfreeze": "恢复",
|
|
1359
1718
|
"pane.agents": "智能体",
|
|
1360
1719
|
"pane.board": "任务",
|
|
1361
1720
|
"pane.events": "事件",
|
|
@@ -1374,7 +1733,7 @@ const messages = Object.freeze({
|
|
|
1374
1733
|
"mode.freeze": "冻结",
|
|
1375
1734
|
"mode.free.help": "正常:任何人都可以认领任务。",
|
|
1376
1735
|
"mode.freeze.help": "冻结:只有带 fix 标签的任务能被认领;流水线红时使用。",
|
|
1377
|
-
"mode.freeze.banner": "
|
|
1736
|
+
"mode.freeze.banner": "已暂停:只有带 fix 标签的任务能被认领",
|
|
1378
1737
|
"mode.title": "模式:",
|
|
1379
1738
|
"stats.cards": "个任务",
|
|
1380
1739
|
"stats.oldest": "最久待办",
|
|
@@ -1405,6 +1764,7 @@ const messages = Object.freeze({
|
|
|
1405
1764
|
"drawer.cardActions": "任务操作",
|
|
1406
1765
|
"drawer.noActions": "该状态没有可用操作。",
|
|
1407
1766
|
"drawer.readOnly": "只读:writable=false。",
|
|
1767
|
+
"drawer.removeClaimed": "已认领的任务必须先释放或重开才能删除。",
|
|
1408
1768
|
"drawer.rawJson": "原始 JSON",
|
|
1409
1769
|
"events.empty": "暂无事件。",
|
|
1410
1770
|
"events.showAll": "展开全部事件",
|
|
@@ -1420,45 +1780,85 @@ const messages = Object.freeze({
|
|
|
1420
1780
|
"supervisor.resumeAria": "恢复 {repo} 的 supervisor",
|
|
1421
1781
|
"supervisor.resumeFailed": "恢复 supervisor 失败",
|
|
1422
1782
|
"limits.open": "设置",
|
|
1423
|
-
"limits.openAria": "
|
|
1424
|
-
"limits.title": "
|
|
1425
|
-
"limits.aria": "
|
|
1426
|
-
"limits.description": "
|
|
1783
|
+
"limits.openAria": "打开智能体并发上限设置",
|
|
1784
|
+
"limits.title": "智能体的并发上限",
|
|
1785
|
+
"limits.aria": "这个仓库的智能体并发上限",
|
|
1786
|
+
"limits.description": "同时干活的智能体数量上限,按角色分别设置;0 表示暂停该角色",
|
|
1427
1787
|
"limits.role": "角色",
|
|
1428
|
-
"limits.limit": "
|
|
1788
|
+
"limits.limit": "并发上限",
|
|
1429
1789
|
"limits.inFlight": "在飞",
|
|
1430
1790
|
"limits.queued": "排队",
|
|
1431
1791
|
"limits.defaultHint": "0–999,默认 5",
|
|
1432
1792
|
"limits.limitAria": "{role} 的并发上限",
|
|
1433
1793
|
"limits.save": "保存",
|
|
1434
|
-
"limits.saveAria": "保存 {repo}
|
|
1794
|
+
"limits.saveAria": "保存 {repo} 的智能体并发上限",
|
|
1435
1795
|
"limits.saving": "正在保存…",
|
|
1436
|
-
"limits.saved": "
|
|
1437
|
-
"limits.failed": "
|
|
1796
|
+
"limits.saved": "智能体的并发上限已保存。",
|
|
1797
|
+
"limits.failed": "保存智能体的并发上限失败",
|
|
1438
1798
|
"limits.invalid": "每个上限都必须是 0–999 的整数。",
|
|
1439
1799
|
"limits.none": "这个仓库没有角色数据。",
|
|
1440
1800
|
"limits.close": "关闭",
|
|
1441
|
-
"limits.closeAria": "
|
|
1801
|
+
"limits.closeAria": "关闭智能体的并发上限设置",
|
|
1802
|
+
"settings.openAria": "打开这个仓库的设置",
|
|
1803
|
+
"settings.title": "设置",
|
|
1804
|
+
"settings.aria": "这个仓库的设置",
|
|
1805
|
+
"settings.addRole": "新增角色",
|
|
1806
|
+
"settings.roleName": "角色名",
|
|
1807
|
+
"settings.roleNameHint": "以小写字母开头,2–32 个字符,只能包含小写字母、数字和连字符",
|
|
1808
|
+
"settings.roleNameAria": "新角色名",
|
|
1809
|
+
"settings.roleNameExample": "例如 reviewer",
|
|
1810
|
+
"settings.roleDescription": "职责描述",
|
|
1811
|
+
"settings.roleDescriptionAria": "新角色的职责描述(可空)",
|
|
1812
|
+
"settings.roleDescriptionHint": "会写进 .hive/roles/<name>.md,agent 开工时读它",
|
|
1813
|
+
"settings.roleDescriptionMax": "可空,最多 2000 字",
|
|
1814
|
+
"settings.descriptionTooLong": "职责描述不能超过 2000 字。",
|
|
1815
|
+
"settings.adapter": "适配器",
|
|
1816
|
+
"settings.adapterAria": "新角色的适配器",
|
|
1817
|
+
"settings.model": "模型",
|
|
1818
|
+
"settings.modelOptional": "可空",
|
|
1819
|
+
"settings.modelAria": "新角色的可选模型",
|
|
1820
|
+
"settings.addRoleButton": "新增角色",
|
|
1821
|
+
"settings.addRoleAria": "新增这个角色",
|
|
1822
|
+
"settings.addingRole": "正在新增…",
|
|
1823
|
+
"settings.roleInvalid": "角色名必须以小写字母开头,2–32 个字符,只能包含小写字母、数字和连字符。",
|
|
1824
|
+
"settings.modelInvalid": "模型只能包含字母、数字、点、下划线、冒号和连字符,最长 64 位。",
|
|
1825
|
+
"settings.roleExists": "角色已存在。",
|
|
1826
|
+
"settings.roleAdded": "角色已新增。",
|
|
1827
|
+
"settings.roleFailed": "新增角色失败",
|
|
1828
|
+
"settings.readOnly": "只读模式:无法修改角色和限额。",
|
|
1829
|
+
"settings.supervisorUnavailable": "取不到 supervisor,无法读取角色限额。",
|
|
1830
|
+
"settings.saveLimits": "保存限额",
|
|
1831
|
+
"settings.close": "关闭",
|
|
1832
|
+
"settings.closeAria": "关闭设置",
|
|
1442
1833
|
"event.unknown": "事件",
|
|
1834
|
+
"add.dialogTitle": "新建任务",
|
|
1835
|
+
"add.title": "标题",
|
|
1836
|
+
"add.titleAria": "新任务标题",
|
|
1837
|
+
"add.role": "角色",
|
|
1838
|
+
"add.roleAria": "新任务角色",
|
|
1839
|
+
"add.scope": "范围(逗号分隔,可选)",
|
|
1840
|
+
"add.scopeAria": "新任务的文件范围",
|
|
1841
|
+
"add.after": "依赖任务(任务 ID,逗号分隔,可选)",
|
|
1842
|
+
"add.afterAria": "需要先完成的任务",
|
|
1843
|
+
"add.acceptance": "验收标准(可选)",
|
|
1844
|
+
"add.acceptanceAria": "新任务的验收标准",
|
|
1845
|
+
"add.cancel": "取消",
|
|
1846
|
+
"add.submit": "新建任务",
|
|
1847
|
+
"add.submitting": "正在新建…",
|
|
1848
|
+
"add.required": "标题不能为空。",
|
|
1443
1849
|
"prompt.newTitle": "新任务标题",
|
|
1444
1850
|
"prompt.role": "角色",
|
|
1445
1851
|
"prompt.scope": "范围(逗号分隔,可选)",
|
|
1446
1852
|
"prompt.after": "排在哪些任务之后(任务 ID,逗号分隔,可选)",
|
|
1447
|
-
"prompt.commitMessage": "提交信息",
|
|
1448
|
-
"prompt.paths": "路径(逗号分隔,可选)",
|
|
1449
1853
|
"prompt.claimAgent": "以哪个智能体认领",
|
|
1450
1854
|
"prompt.commitSha": "提交 SHA(可选)",
|
|
1451
1855
|
"prompt.failReason": "失败原因",
|
|
1452
|
-
"action.plan": "
|
|
1453
|
-
"help.open": "这些按钮是做什么的",
|
|
1856
|
+
"action.plan": "给女王设目标",
|
|
1454
1857
|
"menu.open": "更多操作与说明",
|
|
1455
|
-
"help.title": "
|
|
1456
|
-
"help.aria": "
|
|
1858
|
+
"help.title": "菜单",
|
|
1859
|
+
"help.aria": "菜单",
|
|
1457
1860
|
"help.close": "关闭",
|
|
1458
|
-
"help.closeAria": "
|
|
1459
|
-
"help.board": "看板操作",
|
|
1460
|
-
"help.tasks": "任务操作",
|
|
1461
|
-
"help.params": "参数:",
|
|
1861
|
+
"help.closeAria": "关闭菜单",
|
|
1462
1862
|
"help.readOnly": "面板以只读启动,加 --write 才有写操作按钮。",
|
|
1463
1863
|
"help.uninitialised": "请先用主区的按钮初始化 Hive,再使用看板操作。",
|
|
1464
1864
|
"init.repo": "仓库",
|
|
@@ -1488,29 +1888,20 @@ const messages = Object.freeze({
|
|
|
1488
1888
|
"queen.takeover": "让女王接管",
|
|
1489
1889
|
"queen.takeoverAria": "让女王接管本会话",
|
|
1490
1890
|
"queen.takeoverBusy": "正在接管…",
|
|
1491
|
-
"help.
|
|
1492
|
-
"help.action.
|
|
1493
|
-
"help.action.unfreeze": "解冻:恢复认领,智能体可以继续接取待办任务。",
|
|
1891
|
+
"help.action.freeze": "暂停:只有带 fix 标签的任务能被认领。",
|
|
1892
|
+
"help.action.unfreeze": "恢复:恢复认领,智能体可以继续接取待办任务。",
|
|
1494
1893
|
"help.action.add": "新建任务:添加一条带角色和文件范围的待办任务。",
|
|
1495
|
-
"help.action.plan": "
|
|
1496
|
-
"help.action.commit": "提交:按提交信息提交选中的路径。",
|
|
1894
|
+
"help.action.plan": "给女王设目标:让女王把目标拆成任务计划,预览后再写入看板。",
|
|
1497
1895
|
"help.action.claim": "认领:以某个智能体的名义短期租下这条待办任务。",
|
|
1498
1896
|
"help.action.done": "完成:把已认领的任务标为完成,可选填写提交 SHA。",
|
|
1499
1897
|
"help.action.fail": "标记失败:把已认领的任务标为失败,并写明原因。",
|
|
1500
1898
|
"help.action.retry": "重试:把失败或受阻的任务放回队列。",
|
|
1501
|
-
"help.
|
|
1502
|
-
"
|
|
1503
|
-
"help.params.plan": "goal、maxCards",
|
|
1504
|
-
"help.params.commit": "message、set[]",
|
|
1505
|
-
"help.params.claim": "id、智能体",
|
|
1506
|
-
"help.params.done": "id、sha?",
|
|
1507
|
-
"help.params.fail": "id、reason",
|
|
1508
|
-
"help.params.retry": "id",
|
|
1509
|
-
"plan.dialogTitle": "给女王下目标",
|
|
1899
|
+
"help.action.remove": "永久删除这张任务卡;已认领的任务需要先释放或重开。",
|
|
1900
|
+
"plan.dialogTitle": "给女王设目标",
|
|
1510
1901
|
"plan.dialogAria": "按目标规划任务",
|
|
1511
1902
|
"plan.goal": "目标",
|
|
1512
1903
|
"plan.goalHint": "描述想达成的结果,女王会把它拆成任务。",
|
|
1513
|
-
"plan.maxCards": "
|
|
1904
|
+
"plan.maxCards": "最大任务数",
|
|
1514
1905
|
"plan.maxCardsHint": "至少 1",
|
|
1515
1906
|
"plan.preview": "预览计划",
|
|
1516
1907
|
"plan.previewAria": "让女王先给出任务计划,不写入看板",
|
|
@@ -1531,14 +1922,16 @@ const messages = Object.freeze({
|
|
|
1531
1922
|
"plan.deps": "依赖",
|
|
1532
1923
|
"plan.none": "—",
|
|
1533
1924
|
"plan.goalRequired": "请先填写目标。",
|
|
1534
|
-
"plan.maxInvalid": "
|
|
1925
|
+
"plan.maxInvalid": "最大任务数必须是正整数。",
|
|
1535
1926
|
"plan.previewFirst": "请先预览计划,再写入任务。",
|
|
1536
1927
|
"plan.previewFailed": "无法解析计划。",
|
|
1537
1928
|
"plan.applyHint": "预览不会写入;写入时会带 apply=true 再调用一次 plan。",
|
|
1538
|
-
"plan.stale": "
|
|
1929
|
+
"plan.stale": "目标或最大任务数已修改,请重新预览计划。",
|
|
1539
1930
|
"plan.error": "计划失败",
|
|
1931
|
+
"confirm.remove": "确定永久删除任务「{title}」?此操作不可撤销。",
|
|
1540
1932
|
"toast.dismiss": "关闭",
|
|
1541
1933
|
"toast.planWritten": "任务已写入",
|
|
1934
|
+
"toast.taskRemoved": "任务已删除",
|
|
1542
1935
|
"toast.pickupHint": "supervisor 会自动接卡。",
|
|
1543
1936
|
}),
|
|
1544
1937
|
});
|
|
@@ -1707,22 +2100,12 @@ function modeAction(mode) {
|
|
|
1707
2100
|
return { name: "mode", ...meta, body: { mode: nextMode, reason: "panel" } };
|
|
1708
2101
|
}
|
|
1709
2102
|
|
|
1710
|
-
function toolbarActions(writable) {
|
|
2103
|
+
function toolbarActions(writable, mode) {
|
|
1711
2104
|
if (!writable) return [];
|
|
1712
2105
|
return [
|
|
1713
2106
|
{ name: "add", ...ACTION_META.add },
|
|
1714
2107
|
{ name: "plan", ...ACTION_META.plan },
|
|
1715
|
-
|
|
1716
|
-
];
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
|
-
function helpGroups(mode) {
|
|
1720
|
-
return [
|
|
1721
|
-
{ titleKey: "help.board", actions: [modeAction(mode), ...toolbarActions(true)] },
|
|
1722
|
-
{
|
|
1723
|
-
titleKey: "help.tasks",
|
|
1724
|
-
actions: ["claim", "done", "fail", "retry"].map((name) => ({ name, ...ACTION_META[name] })),
|
|
1725
|
-
},
|
|
2108
|
+
modeAction(mode),
|
|
1726
2109
|
];
|
|
1727
2110
|
}
|
|
1728
2111
|
|
|
@@ -1733,6 +2116,7 @@ function helpGroups(mode) {
|
|
|
1733
2116
|
* @returns {{
|
|
1734
2117
|
* at: string, repo: string, mode: string, initialised: boolean, writable: boolean,
|
|
1735
2118
|
* queen: {active:boolean, source:"auto"|"manual"|null, repo:string}|null,
|
|
2119
|
+
* roles: {list:Array<{name:string,adapter:string|null,model:string|null,prompt:string|null,promptExists:boolean,limit:number|null}>, limits:Record<string,number>, error:string|null},
|
|
1736
2120
|
* lanes: Record<string, Array<{id:string,title:string,role:string,owner:string,scope:string[],reason:string}>>,
|
|
1737
2121
|
* laneOrder: string[],
|
|
1738
2122
|
* stats: {total:number, byState:Record<string,number>, byRole:Record<string,number>, oldestPending:{id:string,createdAt:string}|null},
|
|
@@ -1776,6 +2160,32 @@ function renderModel(snapshot) {
|
|
|
1776
2160
|
: null,
|
|
1777
2161
|
repo: typeof rawQueen.repo === "string" ? rawQueen.repo : "",
|
|
1778
2162
|
};
|
|
2163
|
+
const rawRoles = isRecord(source.roles) ? source.roles : null;
|
|
2164
|
+
const rolesLimits = {};
|
|
2165
|
+
if (rawRoles && isRecord(rawRoles.limits)) {
|
|
2166
|
+
for (const [name, value] of Object.entries(rawRoles.limits)) {
|
|
2167
|
+
const number = Number(value);
|
|
2168
|
+
if (name && Number.isFinite(number)) rolesLimits[name] = number;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
const roles = {
|
|
2172
|
+
list:
|
|
2173
|
+
rawRoles && Array.isArray(rawRoles.list)
|
|
2174
|
+
? rawRoles.list
|
|
2175
|
+
.filter(isRecord)
|
|
2176
|
+
.map((entry) => ({
|
|
2177
|
+
name: asString(entry.name),
|
|
2178
|
+
adapter: typeof entry.adapter === "string" ? entry.adapter : null,
|
|
2179
|
+
model: typeof entry.model === "string" ? entry.model : null,
|
|
2180
|
+
prompt: typeof entry.prompt === "string" ? entry.prompt : null,
|
|
2181
|
+
promptExists: entry.promptExists === true,
|
|
2182
|
+
limit: typeof entry.limit === "number" && Number.isFinite(entry.limit) ? entry.limit : null,
|
|
2183
|
+
}))
|
|
2184
|
+
.filter((entry) => entry.name)
|
|
2185
|
+
: [],
|
|
2186
|
+
limits: rolesLimits,
|
|
2187
|
+
error: rawRoles ? asString(rawRoles.error) || null : null,
|
|
2188
|
+
};
|
|
1779
2189
|
|
|
1780
2190
|
return {
|
|
1781
2191
|
at: asString(source.at),
|
|
@@ -1783,13 +2193,14 @@ function renderModel(snapshot) {
|
|
|
1783
2193
|
mode,
|
|
1784
2194
|
initialised,
|
|
1785
2195
|
queen,
|
|
2196
|
+
roles,
|
|
1786
2197
|
writable,
|
|
1787
2198
|
lanes,
|
|
1788
2199
|
laneOrder: [...LANE_ORDER],
|
|
1789
2200
|
stats: normalizeStats(source.stats, tasks),
|
|
1790
2201
|
agents: normalizeAgents(source.board),
|
|
1791
2202
|
events: normalizeEvents(source.events),
|
|
1792
|
-
actions: initialised ? toolbarActions(writable) : [],
|
|
2203
|
+
actions: initialised ? toolbarActions(writable, mode) : [],
|
|
1793
2204
|
};
|
|
1794
2205
|
}
|
|
1795
2206
|
|
|
@@ -1971,6 +2382,52 @@ function element(doc, tag, className, text) {
|
|
|
1971
2382
|
return node;
|
|
1972
2383
|
}
|
|
1973
2384
|
|
|
2385
|
+
function svgNode(doc, tag) {
|
|
2386
|
+
const node =
|
|
2387
|
+
typeof doc.createElementNS === "function"
|
|
2388
|
+
? doc.createElementNS("http://www.w3.org/2000/svg", tag)
|
|
2389
|
+
: doc.createElement(tag);
|
|
2390
|
+
return node;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
function makeHiveIcon(doc, kind) {
|
|
2394
|
+
const svg = svgNode(doc, "svg");
|
|
2395
|
+
setAttr(svg, "viewBox", "0 0 24 24");
|
|
2396
|
+
setAttr(svg, "width", "16");
|
|
2397
|
+
setAttr(svg, "height", "16");
|
|
2398
|
+
setAttr(svg, "aria-hidden", "true");
|
|
2399
|
+
setAttr(svg, "focusable", "false");
|
|
2400
|
+
if (kind === "menu") {
|
|
2401
|
+
for (const cx of [5, 12, 19]) {
|
|
2402
|
+
const dot = svgNode(doc, "circle");
|
|
2403
|
+
setAttr(dot, "cx", String(cx));
|
|
2404
|
+
setAttr(dot, "cy", "12");
|
|
2405
|
+
setAttr(dot, "r", "1.25");
|
|
2406
|
+
setAttr(dot, "fill", "currentColor");
|
|
2407
|
+
svg.appendChild(dot);
|
|
2408
|
+
}
|
|
2409
|
+
return svg;
|
|
2410
|
+
}
|
|
2411
|
+
setAttr(svg, "fill", "none");
|
|
2412
|
+
setAttr(svg, "stroke", "currentColor");
|
|
2413
|
+
setAttr(svg, "stroke-width", "1.75");
|
|
2414
|
+
setAttr(svg, "stroke-linecap", "round");
|
|
2415
|
+
setAttr(svg, "stroke-linejoin", "round");
|
|
2416
|
+
const center = svgNode(doc, "circle");
|
|
2417
|
+
setAttr(center, "cx", "12");
|
|
2418
|
+
setAttr(center, "cy", "12");
|
|
2419
|
+
setAttr(center, "r", "3");
|
|
2420
|
+
svg.appendChild(center);
|
|
2421
|
+
const path = svgNode(doc, "path");
|
|
2422
|
+
setAttr(
|
|
2423
|
+
path,
|
|
2424
|
+
"d",
|
|
2425
|
+
"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",
|
|
2426
|
+
);
|
|
2427
|
+
svg.appendChild(path);
|
|
2428
|
+
return svg;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
1974
2431
|
function setAttr(node, name, value) {
|
|
1975
2432
|
if (node && typeof node.setAttribute === "function") {
|
|
1976
2433
|
node.setAttribute(name, value === null || value === undefined ? "" : String(value));
|
|
@@ -2049,22 +2506,6 @@ function formatTime(value) {
|
|
|
2049
2506
|
}
|
|
2050
2507
|
}
|
|
2051
2508
|
|
|
2052
|
-
function formatStamp(value) {
|
|
2053
|
-
const date = parseDate(value);
|
|
2054
|
-
if (!date) return asString(value);
|
|
2055
|
-
try {
|
|
2056
|
-
return date.toLocaleString([], {
|
|
2057
|
-
month: "short",
|
|
2058
|
-
day: "2-digit",
|
|
2059
|
-
hour: "2-digit",
|
|
2060
|
-
minute: "2-digit",
|
|
2061
|
-
second: "2-digit",
|
|
2062
|
-
});
|
|
2063
|
-
} catch {
|
|
2064
|
-
return date.toISOString();
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
2509
|
function safeClassToken(value) {
|
|
2069
2510
|
const token = asString(value).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
2070
2511
|
return token || "unknown";
|
|
@@ -2177,6 +2618,7 @@ function extractPlan(payload) {
|
|
|
2177
2618
|
* intervalMs?: number,
|
|
2178
2619
|
* onError?: (error: Error) => void,
|
|
2179
2620
|
* fetch?: typeof fetch,
|
|
2621
|
+
* confirm?: (message: string) => boolean,
|
|
2180
2622
|
* t?: (key: string) => string,
|
|
2181
2623
|
* subscribeLocale?: (listener: () => void) => (() => void)
|
|
2182
2624
|
* }} [options]
|
|
@@ -2230,6 +2672,18 @@ function mount(root, options = {}) {
|
|
|
2230
2672
|
? globalThis.prompt.bind(globalThis)
|
|
2231
2673
|
: null;
|
|
2232
2674
|
|
|
2675
|
+
// Destructive actions ask through the host's confirm when it provides one
|
|
2676
|
+
// (tests, embedded hosts), then the global confirm. Without either, a
|
|
2677
|
+
// destructive action is refused rather than run unconfirmed.
|
|
2678
|
+
const confirmImpl =
|
|
2679
|
+
typeof opts.confirm === "function"
|
|
2680
|
+
? opts.confirm
|
|
2681
|
+
: typeof view.confirm === "function"
|
|
2682
|
+
? view.confirm.bind(view)
|
|
2683
|
+
: typeof globalThis.confirm === "function"
|
|
2684
|
+
? globalThis.confirm.bind(globalThis)
|
|
2685
|
+
: null;
|
|
2686
|
+
|
|
2233
2687
|
const schedule =
|
|
2234
2688
|
typeof view.setInterval === "function" ? view.setInterval.bind(view) : globalThis.setInterval.bind(globalThis);
|
|
2235
2689
|
const unschedule =
|
|
@@ -2267,6 +2721,7 @@ function mount(root, options = {}) {
|
|
|
2267
2721
|
let lastModel = null;
|
|
2268
2722
|
let drawerNode = null;
|
|
2269
2723
|
let drawerState = null;
|
|
2724
|
+
let drawerTrigger = null;
|
|
2270
2725
|
let unsubscribeLocale = null;
|
|
2271
2726
|
let statusKey = null;
|
|
2272
2727
|
let statusKind = "info";
|
|
@@ -2279,6 +2734,11 @@ function mount(root, options = {}) {
|
|
|
2279
2734
|
let planState = null;
|
|
2280
2735
|
let planTriggerButton = null;
|
|
2281
2736
|
let planFocusables = [];
|
|
2737
|
+
let addOverlay = null;
|
|
2738
|
+
let addDialogNode = null;
|
|
2739
|
+
let addState = null;
|
|
2740
|
+
let addTriggerButton = null;
|
|
2741
|
+
let addFocusables = [];
|
|
2282
2742
|
let toastNode = null;
|
|
2283
2743
|
let stageFilter = "all";
|
|
2284
2744
|
let stageChipEntries = [];
|
|
@@ -2292,6 +2752,7 @@ function mount(root, options = {}) {
|
|
|
2292
2752
|
const queenDismissedFallback = new Set();
|
|
2293
2753
|
let supervisorData = [];
|
|
2294
2754
|
let supervisorRequest = null;
|
|
2755
|
+
let supervisorInlineRow = null;
|
|
2295
2756
|
let limitsOverlay = null;
|
|
2296
2757
|
let limitsDialogNode = null;
|
|
2297
2758
|
let limitsState = null;
|
|
@@ -2309,8 +2770,19 @@ function mount(root, options = {}) {
|
|
|
2309
2770
|
ident.appendChild(repoNode);
|
|
2310
2771
|
bar.appendChild(ident);
|
|
2311
2772
|
|
|
2312
|
-
const
|
|
2313
|
-
|
|
2773
|
+
const supervisorInline = element(doc, "span", "hive-supervisor-inline is-hidden");
|
|
2774
|
+
setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
|
|
2775
|
+
const supervisorInlineLabel = element(doc, "span", "hive-supervisor-inline-label", translate("supervisor.label"));
|
|
2776
|
+
const supervisorInlineState = element(doc, "span", "hive-supervisor-inline-state", "");
|
|
2777
|
+
const supervisorInlineResume = element(doc, "button", "hive-btn hive-supervisor-inline-resume is-hidden", translate("supervisor.resume"));
|
|
2778
|
+
setAttr(supervisorInlineResume, "type", "button");
|
|
2779
|
+
supervisorInlineResume.addEventListener("click", () => {
|
|
2780
|
+
if (supervisorInlineRow) void resumeSupervisor(supervisorInlineRow, supervisorInlineResume);
|
|
2781
|
+
});
|
|
2782
|
+
supervisorInline.appendChild(supervisorInlineLabel);
|
|
2783
|
+
supervisorInline.appendChild(supervisorInlineState);
|
|
2784
|
+
supervisorInline.appendChild(supervisorInlineResume);
|
|
2785
|
+
bar.appendChild(supervisorInline);
|
|
2314
2786
|
|
|
2315
2787
|
const statsNode = element(doc, "div", "hive-stats");
|
|
2316
2788
|
bar.appendChild(statsNode);
|
|
@@ -2325,8 +2797,9 @@ function mount(root, options = {}) {
|
|
|
2325
2797
|
const actionsNode = element(doc, "div", "hive-actions");
|
|
2326
2798
|
actionGroup.appendChild(actionsNode);
|
|
2327
2799
|
|
|
2328
|
-
const helpButton = element(doc, "button", "hive-btn hive-help-trigger hive-menu-trigger"
|
|
2800
|
+
const helpButton = element(doc, "button", "hive-btn hive-btn-ghost hive-icon-button hive-help-trigger hive-menu-trigger");
|
|
2329
2801
|
setAttr(helpButton, "type", "button");
|
|
2802
|
+
helpButton.appendChild(makeHiveIcon(doc, "menu"));
|
|
2330
2803
|
setAttr(helpButton, "aria-haspopup", "dialog");
|
|
2331
2804
|
setAttr(helpButton, "aria-expanded", "false");
|
|
2332
2805
|
setAttr(helpButton, "title", translate("menu.open"));
|
|
@@ -2334,23 +2807,17 @@ function mount(root, options = {}) {
|
|
|
2334
2807
|
helpButton.addEventListener("click", () => {
|
|
2335
2808
|
toggleHelp();
|
|
2336
2809
|
});
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
setAttr(
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
setAttr(supervisorLimitsButton, "type", "button");
|
|
2346
|
-
setAttr(supervisorLimitsButton, "title", translate("limits.openAria"));
|
|
2347
|
-
setAttr(supervisorLimitsButton, "aria-label", translate("limits.openAria"));
|
|
2348
|
-
supervisorLimitsButton.addEventListener("click", () => {
|
|
2349
|
-
openLimitsDialog(supervisorLimitsButton);
|
|
2810
|
+
// The previous "⋯" action menu has no entries left; settings carries the Queen section.
|
|
2811
|
+
const settingsButton = element(doc, "button", "hive-btn hive-btn-ghost hive-icon-button hive-settings-trigger");
|
|
2812
|
+
setAttr(settingsButton, "type", "button");
|
|
2813
|
+
settingsButton.appendChild(makeHiveIcon(doc, "gear"));
|
|
2814
|
+
setAttr(settingsButton, "title", translate("settings.openAria"));
|
|
2815
|
+
setAttr(settingsButton, "aria-label", translate("settings.openAria"));
|
|
2816
|
+
settingsButton.addEventListener("click", () => {
|
|
2817
|
+
openLimitsDialog(settingsButton);
|
|
2350
2818
|
});
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
supervisorBar.appendChild(supervisorLimitsButton);
|
|
2819
|
+
actionGroup.appendChild(settingsButton);
|
|
2820
|
+
bar.appendChild(actionGroup);
|
|
2354
2821
|
|
|
2355
2822
|
const freezeSlot = element(doc, "div", "hive-freeze-slot");
|
|
2356
2823
|
|
|
@@ -2479,7 +2946,6 @@ function mount(root, options = {}) {
|
|
|
2479
2946
|
});
|
|
2480
2947
|
|
|
2481
2948
|
frame.appendChild(bar);
|
|
2482
|
-
frame.appendChild(supervisorBar);
|
|
2483
2949
|
frame.appendChild(freezeSlot);
|
|
2484
2950
|
frame.appendChild(queenHint);
|
|
2485
2951
|
frame.appendChild(agentsStrip);
|
|
@@ -2536,6 +3002,15 @@ function mount(root, options = {}) {
|
|
|
2536
3002
|
return answer === null || answer === undefined ? null : String(answer);
|
|
2537
3003
|
}
|
|
2538
3004
|
|
|
3005
|
+
function askConfirm(message) {
|
|
3006
|
+
if (!confirmImpl) return false;
|
|
3007
|
+
try {
|
|
3008
|
+
return confirmImpl(message) === true;
|
|
3009
|
+
} catch {
|
|
3010
|
+
return false;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
|
|
2539
3014
|
function emptyState(text) {
|
|
2540
3015
|
return element(doc, "div", "hive-empty", text);
|
|
2541
3016
|
}
|
|
@@ -2603,36 +3078,22 @@ function mount(root, options = {}) {
|
|
|
2603
3078
|
if (!model || !model.writable) {
|
|
2604
3079
|
body.appendChild(element(doc, "div", "hive-help-note", translate("help.readOnly")));
|
|
2605
3080
|
}
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
const button = element(doc, "button", "hive-btn hive-help-mode-action", translate(action.labelKey));
|
|
2620
|
-
setAttr(button, "type", "button");
|
|
2621
|
-
setAttr(button, "title", translate(action.helpKey));
|
|
2622
|
-
setAttr(button, "aria-label", translate(action.helpKey));
|
|
2623
|
-
button.addEventListener("click", () => {
|
|
2624
|
-
closeHelp();
|
|
2625
|
-
void postAction("mode", action.body || { mode: "freeze", reason: "panel" });
|
|
2626
|
-
});
|
|
2627
|
-
row.appendChild(button);
|
|
2628
|
-
item.appendChild(row);
|
|
2629
|
-
}
|
|
2630
|
-
body.appendChild(item);
|
|
2631
|
-
}
|
|
3081
|
+
if (model && model.writable && model.initialised !== false) {
|
|
3082
|
+
const action = modeAction(model.mode);
|
|
3083
|
+
const row = element(doc, "div", "hive-help-actionrow");
|
|
3084
|
+
const button = element(doc, "button", "hive-btn hive-help-mode-action", translate(action.labelKey));
|
|
3085
|
+
setAttr(button, "type", "button");
|
|
3086
|
+
setAttr(button, "title", translate(action.helpKey));
|
|
3087
|
+
setAttr(button, "aria-label", translate(action.helpKey));
|
|
3088
|
+
button.addEventListener("click", () => {
|
|
3089
|
+
closeHelp();
|
|
3090
|
+
void postAction("mode", action.body || { mode: "freeze", reason: "panel" });
|
|
3091
|
+
});
|
|
3092
|
+
row.appendChild(button);
|
|
3093
|
+
body.appendChild(row);
|
|
2632
3094
|
}
|
|
2633
3095
|
body.appendChild(element(doc, "div", "hive-help-section", translate("help.queen")));
|
|
2634
3096
|
body.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
|
|
2635
|
-
body.appendChild(element(doc, "div", "hive-help-hint", translate("help.hint")));
|
|
2636
3097
|
}
|
|
2637
3098
|
|
|
2638
3099
|
function positionHelp(panel) {
|
|
@@ -2879,6 +3340,7 @@ function mount(root, options = {}) {
|
|
|
2879
3340
|
function openPlanDialog(trigger) {
|
|
2880
3341
|
if (destroyed || !lastModel || !lastModel.writable) return;
|
|
2881
3342
|
closeHelp(false);
|
|
3343
|
+
closeAddDialog(false);
|
|
2882
3344
|
closeDrawer();
|
|
2883
3345
|
planTriggerButton = trigger || planTriggerButton || null;
|
|
2884
3346
|
|
|
@@ -3005,7 +3467,7 @@ function mount(root, options = {}) {
|
|
|
3005
3467
|
focusNode(goalInput);
|
|
3006
3468
|
}
|
|
3007
3469
|
|
|
3008
|
-
// ---
|
|
3470
|
+
// --- agent concurrency settings -----------------------------------------
|
|
3009
3471
|
|
|
3010
3472
|
function currentSupervisorRow() {
|
|
3011
3473
|
if (!lastModel) return null;
|
|
@@ -3013,14 +3475,42 @@ function mount(root, options = {}) {
|
|
|
3013
3475
|
}
|
|
3014
3476
|
|
|
3015
3477
|
function roleRowsForCurrentRepo(row) {
|
|
3016
|
-
const
|
|
3478
|
+
const supervisorRoles = new Map();
|
|
3017
3479
|
if (row && Array.isArray(row.roles)) {
|
|
3018
3480
|
for (const role of row.roles) {
|
|
3019
3481
|
if (!isRecord(role)) continue;
|
|
3020
3482
|
const name = asString(role.role);
|
|
3021
|
-
if (name)
|
|
3483
|
+
if (name) supervisorRoles.set(name, role);
|
|
3022
3484
|
}
|
|
3023
3485
|
}
|
|
3486
|
+
const modelRoles = lastModel && lastModel.roles && Array.isArray(lastModel.roles.list) ? lastModel.roles.list : [];
|
|
3487
|
+
if (modelRoles.length > 0) {
|
|
3488
|
+
return modelRoles
|
|
3489
|
+
.map((entry) => {
|
|
3490
|
+
const name = asString(entry.name);
|
|
3491
|
+
if (!name) return null;
|
|
3492
|
+
const savedLimit = lastModel.roles.limits[name];
|
|
3493
|
+
const limit = Number.isFinite(savedLimit)
|
|
3494
|
+
? savedLimit
|
|
3495
|
+
: Number.isFinite(entry.limit)
|
|
3496
|
+
? entry.limit
|
|
3497
|
+
: null;
|
|
3498
|
+
const effective = supervisorRoles.get(name);
|
|
3499
|
+
return {
|
|
3500
|
+
role: name,
|
|
3501
|
+
adapter: entry.adapter,
|
|
3502
|
+
model: entry.model,
|
|
3503
|
+
limit,
|
|
3504
|
+
inFlight: effective ? effective.inFlight : null,
|
|
3505
|
+
queued: effective ? effective.queued : null,
|
|
3506
|
+
};
|
|
3507
|
+
})
|
|
3508
|
+
.filter(Boolean)
|
|
3509
|
+
.sort((left, right) => left.role.localeCompare(right.role));
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
const roles = new Map();
|
|
3513
|
+
for (const [name, role] of supervisorRoles) roles.set(name, { ...role, role: name });
|
|
3024
3514
|
if (roles.size === 0 && lastModel) {
|
|
3025
3515
|
for (const cards of Object.values(lastModel.lanes)) {
|
|
3026
3516
|
for (const card of cards) {
|
|
@@ -3087,15 +3577,18 @@ function mount(root, options = {}) {
|
|
|
3087
3577
|
}
|
|
3088
3578
|
|
|
3089
3579
|
function openLimitsDialog(trigger) {
|
|
3090
|
-
if (destroyed || !lastModel
|
|
3580
|
+
if (destroyed || !lastModel) return;
|
|
3091
3581
|
closeHelp(false);
|
|
3092
3582
|
closePlanDialog(false);
|
|
3583
|
+
closeAddDialog(false);
|
|
3093
3584
|
closeDrawer();
|
|
3094
3585
|
closeToast();
|
|
3095
3586
|
if (limitsDialogNode) closeLimitsDialog(false);
|
|
3096
|
-
limitsTriggerButton = trigger ||
|
|
3587
|
+
limitsTriggerButton = trigger || settingsButton;
|
|
3097
3588
|
|
|
3098
3589
|
const repo = lastModel.repo || "";
|
|
3590
|
+
const writable = Boolean(lastModel.writable);
|
|
3591
|
+
const supervisorAvailable = supervisorData.length > 0;
|
|
3099
3592
|
const rows = roleRowsForCurrentRepo(currentSupervisorRow());
|
|
3100
3593
|
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim");
|
|
3101
3594
|
overlay.addEventListener("click", (event) => {
|
|
@@ -3105,16 +3598,16 @@ function mount(root, options = {}) {
|
|
|
3105
3598
|
const dialog = element(doc, "div", "hive-dialog");
|
|
3106
3599
|
setAttr(dialog, "role", "dialog");
|
|
3107
3600
|
setAttr(dialog, "aria-modal", "true");
|
|
3108
|
-
setAttr(dialog, "aria-label", translate("
|
|
3601
|
+
setAttr(dialog, "aria-label", translate("settings.aria"));
|
|
3109
3602
|
|
|
3110
3603
|
const head = element(doc, "div", "hive-dialog-head");
|
|
3111
3604
|
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
3112
|
-
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("
|
|
3605
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("settings.title")));
|
|
3113
3606
|
head.appendChild(titleBox);
|
|
3114
|
-
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("
|
|
3607
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("settings.close"));
|
|
3115
3608
|
setAttr(closeButton, "type", "button");
|
|
3116
|
-
setAttr(closeButton, "title", translate("
|
|
3117
|
-
setAttr(closeButton, "aria-label", translate("
|
|
3609
|
+
setAttr(closeButton, "title", translate("settings.closeAria"));
|
|
3610
|
+
setAttr(closeButton, "aria-label", translate("settings.closeAria"));
|
|
3118
3611
|
closeButton.addEventListener("click", () => {
|
|
3119
3612
|
closeLimitsDialog();
|
|
3120
3613
|
});
|
|
@@ -3128,11 +3621,93 @@ function mount(root, options = {}) {
|
|
|
3128
3621
|
setAttr(repoPath, "title", repo);
|
|
3129
3622
|
repoLine.appendChild(repoPath);
|
|
3130
3623
|
body.appendChild(repoLine);
|
|
3131
|
-
|
|
3624
|
+
if (!writable) {
|
|
3625
|
+
body.appendChild(element(doc, "div", "hive-settings-note", translate("settings.readOnly")));
|
|
3626
|
+
}
|
|
3132
3627
|
|
|
3628
|
+
const roleSection = element(doc, "section", "hive-settings-section");
|
|
3629
|
+
roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
|
|
3630
|
+
const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
|
|
3631
|
+
const roleNameField = element(doc, "label", "hive-field");
|
|
3632
|
+
roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
|
|
3633
|
+
const roleNameInput = element(doc, "input", "hive-input hive-settings-role-name");
|
|
3634
|
+
setAttr(roleNameInput, "type", "text");
|
|
3635
|
+
setAttr(roleNameInput, "autocomplete", "off");
|
|
3636
|
+
setAttr(roleNameInput, "placeholder", translate("settings.roleNameExample"));
|
|
3637
|
+
setAttr(roleNameInput, "aria-label", translate("settings.roleNameAria"));
|
|
3638
|
+
setAttr(roleNameInput, "pattern", "[a-z0-9]+(?:-[a-z0-9]+)*");
|
|
3639
|
+
roleNameField.appendChild(roleNameInput);
|
|
3640
|
+
roleNameField.appendChild(element(doc, "span", "hive-field-hint", translate("settings.roleNameHint")));
|
|
3641
|
+
roleForm.appendChild(roleNameField);
|
|
3642
|
+
|
|
3643
|
+
const adapterField = element(doc, "label", "hive-field is-narrow");
|
|
3644
|
+
adapterField.appendChild(element(doc, "span", "hive-field-label", translate("settings.adapter")));
|
|
3645
|
+
const adapterInput = element(doc, "select", "hive-input hive-settings-role-adapter");
|
|
3646
|
+
setAttr(adapterInput, "aria-label", translate("settings.adapterAria"));
|
|
3647
|
+
for (const adapter of ["dsh", "claude", "codex"]) {
|
|
3648
|
+
const option = element(doc, "option", null, adapter);
|
|
3649
|
+
setAttr(option, "value", adapter);
|
|
3650
|
+
adapterInput.appendChild(option);
|
|
3651
|
+
}
|
|
3652
|
+
adapterInput.value = "dsh";
|
|
3653
|
+
adapterField.appendChild(adapterInput);
|
|
3654
|
+
roleForm.appendChild(adapterField);
|
|
3655
|
+
|
|
3656
|
+
const modelField = element(doc, "label", "hive-field is-narrow");
|
|
3657
|
+
modelField.appendChild(element(doc, "span", "hive-field-label", translate("settings.model")));
|
|
3658
|
+
const modelInput = element(doc, "input", "hive-input hive-settings-role-model");
|
|
3659
|
+
setAttr(modelInput, "type", "text");
|
|
3660
|
+
setAttr(modelInput, "autocomplete", "off");
|
|
3661
|
+
setAttr(modelInput, "placeholder", translate("settings.modelOptional"));
|
|
3662
|
+
setAttr(modelInput, "aria-label", translate("settings.modelAria"));
|
|
3663
|
+
modelField.appendChild(modelInput);
|
|
3664
|
+
roleForm.appendChild(modelField);
|
|
3665
|
+
roleSection.appendChild(roleForm);
|
|
3666
|
+
|
|
3667
|
+
const roleDescriptionField = element(doc, "label", "hive-field hive-settings-role-description");
|
|
3668
|
+
roleDescriptionField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleDescription")));
|
|
3669
|
+
const roleDescriptionInput = element(doc, "textarea", "hive-textarea hive-settings-role-description-input");
|
|
3670
|
+
setAttr(roleDescriptionInput, "maxlength", "2000");
|
|
3671
|
+
setAttr(roleDescriptionInput, "rows", "3");
|
|
3672
|
+
setAttr(roleDescriptionInput, "aria-label", translate("settings.roleDescriptionAria"));
|
|
3673
|
+
roleDescriptionField.appendChild(roleDescriptionInput);
|
|
3674
|
+
roleDescriptionField.appendChild(
|
|
3675
|
+
element(
|
|
3676
|
+
doc,
|
|
3677
|
+
"span",
|
|
3678
|
+
"hive-field-hint",
|
|
3679
|
+
translate("settings.roleDescriptionHint") + " · " + translate("settings.roleDescriptionMax"),
|
|
3680
|
+
),
|
|
3681
|
+
);
|
|
3682
|
+
roleSection.appendChild(roleDescriptionField);
|
|
3683
|
+
|
|
3684
|
+
const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
3685
|
+
roleSection.appendChild(roleErrorNode);
|
|
3686
|
+
const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
|
|
3687
|
+
setAttr(addRoleButton, "type", "button");
|
|
3688
|
+
setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
|
|
3689
|
+
setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
|
|
3690
|
+
addRoleButton.disabled = !writable;
|
|
3691
|
+
addRoleButton.addEventListener("click", () => {
|
|
3692
|
+
void saveRole();
|
|
3693
|
+
});
|
|
3694
|
+
if (!writable) {
|
|
3695
|
+
roleNameInput.disabled = true;
|
|
3696
|
+
adapterInput.disabled = true;
|
|
3697
|
+
modelInput.disabled = true;
|
|
3698
|
+
roleDescriptionInput.disabled = true;
|
|
3699
|
+
}
|
|
3700
|
+
body.appendChild(roleSection);
|
|
3701
|
+
|
|
3702
|
+
const limitsSection = element(doc, "section", "hive-settings-section");
|
|
3703
|
+
limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
|
|
3704
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
|
|
3133
3705
|
const rowNodes = [];
|
|
3706
|
+
if (!supervisorAvailable) {
|
|
3707
|
+
limitsSection.appendChild(element(doc, "div", "hive-settings-note", translate("settings.supervisorUnavailable")));
|
|
3708
|
+
}
|
|
3134
3709
|
if (rows.length === 0) {
|
|
3135
|
-
|
|
3710
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-empty", translate("limits.none")));
|
|
3136
3711
|
} else {
|
|
3137
3712
|
const table = element(doc, "div", "hive-limits-table");
|
|
3138
3713
|
const header = element(doc, "div", "hive-limits-row is-head");
|
|
@@ -3153,30 +3728,41 @@ function mount(root, options = {}) {
|
|
|
3153
3728
|
setAttr(input, "inputmode", "numeric");
|
|
3154
3729
|
setAttr(input, "aria-label", translate("limits.limitAria").replace("{role}", role.role));
|
|
3155
3730
|
input.value = supervisorNumber(role.limit) === null ? "5" : String(supervisorNumber(role.limit));
|
|
3731
|
+
input.disabled = !writable || !supervisorAvailable;
|
|
3156
3732
|
roleRow.appendChild(input);
|
|
3157
3733
|
roleRow.appendChild(element(doc, "span", "hive-limits-cell is-number", limitsNumberText(role.inFlight)));
|
|
3158
3734
|
roleRow.appendChild(element(doc, "span", "hive-limits-cell is-number", limitsNumberText(role.queued)));
|
|
3159
3735
|
table.appendChild(roleRow);
|
|
3160
3736
|
rowNodes.push({ role: role.role, input });
|
|
3161
3737
|
}
|
|
3162
|
-
|
|
3163
|
-
|
|
3738
|
+
limitsSection.appendChild(table);
|
|
3739
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-hint", translate("limits.defaultHint")));
|
|
3164
3740
|
}
|
|
3165
3741
|
|
|
3166
3742
|
const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
3167
|
-
|
|
3743
|
+
limitsSection.appendChild(errorNode);
|
|
3744
|
+
body.appendChild(limitsSection);
|
|
3745
|
+
|
|
3746
|
+
const queenSection = element(doc, "section", "hive-settings-section");
|
|
3747
|
+
queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
|
|
3748
|
+
queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
|
|
3749
|
+
body.appendChild(queenSection);
|
|
3168
3750
|
dialog.appendChild(body);
|
|
3169
3751
|
|
|
3170
3752
|
const foot = element(doc, "div", "hive-dialog-foot");
|
|
3171
|
-
const
|
|
3753
|
+
const settingsActions = element(doc, "div", "hive-settings-actions");
|
|
3754
|
+
addRoleButton.className = "hive-btn hive-settings-add-role hive-settings-secondary";
|
|
3755
|
+
const saveButton = element(doc, "button", "hive-btn hive-settings-save hive-settings-primary", translate("settings.saveLimits"));
|
|
3172
3756
|
setAttr(saveButton, "type", "button");
|
|
3173
3757
|
setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
|
|
3174
3758
|
setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
|
|
3175
|
-
saveButton.disabled = rows.length === 0;
|
|
3759
|
+
saveButton.disabled = !writable || !supervisorAvailable || rows.length === 0;
|
|
3176
3760
|
saveButton.addEventListener("click", () => {
|
|
3177
3761
|
void saveBeeCounts();
|
|
3178
3762
|
});
|
|
3179
|
-
|
|
3763
|
+
settingsActions.appendChild(addRoleButton);
|
|
3764
|
+
settingsActions.appendChild(saveButton);
|
|
3765
|
+
foot.appendChild(settingsActions);
|
|
3180
3766
|
dialog.appendChild(foot);
|
|
3181
3767
|
|
|
3182
3768
|
overlay.appendChild(dialog);
|
|
@@ -3189,17 +3775,105 @@ function mount(root, options = {}) {
|
|
|
3189
3775
|
errorNode,
|
|
3190
3776
|
saveButton,
|
|
3191
3777
|
busy: false,
|
|
3778
|
+
writable,
|
|
3779
|
+
supervisorAvailable,
|
|
3780
|
+
roleName: roleNameInput,
|
|
3781
|
+
roleAdapter: adapterInput,
|
|
3782
|
+
roleModel: modelInput,
|
|
3783
|
+
roleDescription: roleDescriptionInput,
|
|
3784
|
+
roleButton: addRoleButton,
|
|
3785
|
+
roleErrorNode,
|
|
3786
|
+
roleBusy: false,
|
|
3192
3787
|
};
|
|
3193
|
-
limitsFocusables = [
|
|
3788
|
+
limitsFocusables = [
|
|
3789
|
+
closeButton,
|
|
3790
|
+
roleNameInput,
|
|
3791
|
+
adapterInput,
|
|
3792
|
+
modelInput,
|
|
3793
|
+
roleDescriptionInput,
|
|
3794
|
+
addRoleButton,
|
|
3795
|
+
...rowNodes.map((entry) => entry.input),
|
|
3796
|
+
saveButton,
|
|
3797
|
+
];
|
|
3194
3798
|
if (typeof doc.addEventListener === "function") {
|
|
3195
3799
|
doc.addEventListener("keydown", onLimitsKeydown);
|
|
3196
3800
|
}
|
|
3197
|
-
focusNode(
|
|
3801
|
+
focusNode(writable ? roleNameInput : closeButton);
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
function setRoleError(message) {
|
|
3805
|
+
if (!limitsState) return;
|
|
3806
|
+
limitsState.roleErrorNode.textContent = message || "";
|
|
3807
|
+
limitsState.roleErrorNode.className = "hive-limits-error" + (message ? "" : " is-hidden");
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
async function saveRole() {
|
|
3811
|
+
const state = limitsState;
|
|
3812
|
+
if (!state || state.roleBusy || !state.writable) return;
|
|
3813
|
+
const name = String(state.roleName.value === null || state.roleName.value === undefined ? "" : state.roleName.value).trim();
|
|
3814
|
+
if (!/^[a-z][a-z0-9-]{1,31}$/.test(name)) {
|
|
3815
|
+
setRoleError(translate("settings.roleInvalid"));
|
|
3816
|
+
focusNode(state.roleName);
|
|
3817
|
+
return;
|
|
3818
|
+
}
|
|
3819
|
+
const adapter = ["dsh", "claude", "codex"].includes(String(state.roleAdapter.value || "dsh"))
|
|
3820
|
+
? String(state.roleAdapter.value || "dsh")
|
|
3821
|
+
: "dsh";
|
|
3822
|
+
const model = String(state.roleModel.value === null || state.roleModel.value === undefined ? "" : state.roleModel.value).trim();
|
|
3823
|
+
if (model && !/^[A-Za-z0-9._:-]{1,64}$/.test(model)) {
|
|
3824
|
+
setRoleError(translate("settings.modelInvalid"));
|
|
3825
|
+
focusNode(state.roleModel);
|
|
3826
|
+
return;
|
|
3827
|
+
}
|
|
3828
|
+
const description = String(
|
|
3829
|
+
state.roleDescription.value === null || state.roleDescription.value === undefined ? "" : state.roleDescription.value,
|
|
3830
|
+
).trim();
|
|
3831
|
+
if (description.length > 2000) {
|
|
3832
|
+
setRoleError(translate("settings.descriptionTooLong"));
|
|
3833
|
+
focusNode(state.roleDescription);
|
|
3834
|
+
return;
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
state.roleBusy = true;
|
|
3838
|
+
state.roleName.disabled = true;
|
|
3839
|
+
state.roleAdapter.disabled = true;
|
|
3840
|
+
state.roleModel.disabled = true;
|
|
3841
|
+
state.roleDescription.disabled = true;
|
|
3842
|
+
state.roleButton.disabled = true;
|
|
3843
|
+
state.roleButton.textContent = translate("settings.addingRole");
|
|
3844
|
+
setRoleError("");
|
|
3845
|
+
try {
|
|
3846
|
+
const body = { name, adapter, description };
|
|
3847
|
+
if (model) body.model = model;
|
|
3848
|
+
const result = await requestAction("roles-add", body);
|
|
3849
|
+
if (!result.ok) {
|
|
3850
|
+
const detail = actionErrorDetail(result.error) || translate("settings.roleFailed");
|
|
3851
|
+
setRoleError(/already exists/i.test(detail) ? translate("settings.roleExists") : detail);
|
|
3852
|
+
return;
|
|
3853
|
+
}
|
|
3854
|
+
await refresh();
|
|
3855
|
+
await refreshSupervisor(true);
|
|
3856
|
+
if (destroyed) return;
|
|
3857
|
+
const trigger = limitsTriggerButton;
|
|
3858
|
+
closeLimitsDialog(false);
|
|
3859
|
+
openLimitsDialog(trigger);
|
|
3860
|
+
showToast("success", translate("settings.roleAdded"), name);
|
|
3861
|
+
} finally {
|
|
3862
|
+
if (!destroyed && limitsState === state) {
|
|
3863
|
+
state.roleBusy = false;
|
|
3864
|
+
state.roleName.disabled = false;
|
|
3865
|
+
state.roleAdapter.disabled = false;
|
|
3866
|
+
state.roleModel.disabled = false;
|
|
3867
|
+
state.roleDescription.disabled = false;
|
|
3868
|
+
state.roleButton.disabled = false;
|
|
3869
|
+
state.roleButton.textContent = translate("settings.addRoleButton");
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3198
3872
|
}
|
|
3199
3873
|
|
|
3200
3874
|
async function saveBeeCounts() {
|
|
3201
3875
|
const state = limitsState;
|
|
3202
|
-
if (!state || state.busy) return;
|
|
3876
|
+
if (!state || state.busy || !state.writable || !state.supervisorAvailable) return;
|
|
3203
3877
|
const roleLimits = {};
|
|
3204
3878
|
let invalid = false;
|
|
3205
3879
|
for (const entry of state.rows) {
|
|
@@ -3346,25 +4020,212 @@ function mount(root, options = {}) {
|
|
|
3346
4020
|
if (!destroyed) showToast("success", translate("toast.planWritten"), translate("toast.pickupHint"));
|
|
3347
4021
|
}
|
|
3348
4022
|
|
|
4023
|
+
|
|
4024
|
+
// --- new task dialog -----------------------------------------------------
|
|
4025
|
+
|
|
4026
|
+
function onAddKeydown(event) {
|
|
4027
|
+
if (event && (event.key === "Escape" || event.key === "Esc")) closeAddDialog();
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
function closeAddDialog(restoreFocus = true) {
|
|
4031
|
+
if (addOverlay && addOverlay.parentNode) addOverlay.parentNode.removeChild(addOverlay);
|
|
4032
|
+
addOverlay = null;
|
|
4033
|
+
addDialogNode = null;
|
|
4034
|
+
addState = null;
|
|
4035
|
+
addFocusables = [];
|
|
4036
|
+
if (typeof doc.removeEventListener === "function") {
|
|
4037
|
+
doc.removeEventListener("keydown", onAddKeydown);
|
|
4038
|
+
}
|
|
4039
|
+
if (restoreFocus && !destroyed) focusNode(addTriggerButton);
|
|
4040
|
+
addTriggerButton = null;
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
function setAddError(message) {
|
|
4044
|
+
if (!addState) return;
|
|
4045
|
+
addState.error.textContent = message || "";
|
|
4046
|
+
addState.error.className = message ? "hive-limits-error" : "hive-limits-error is-hidden";
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
function addField(labelKey, input, hintKey) {
|
|
4050
|
+
const field = element(doc, "label", "hive-field");
|
|
4051
|
+
field.appendChild(element(doc, "span", "hive-field-label", translate(labelKey)));
|
|
4052
|
+
field.appendChild(input);
|
|
4053
|
+
if (hintKey) field.appendChild(element(doc, "span", "hive-field-hint", translate(hintKey)));
|
|
4054
|
+
return field;
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
function openAddDialog(trigger) {
|
|
4058
|
+
if (destroyed || !lastModel || !lastModel.writable) return;
|
|
4059
|
+
closeHelp(false);
|
|
4060
|
+
closePlanDialog(false);
|
|
4061
|
+
closeLimitsDialog(false);
|
|
4062
|
+
closeDrawer(false);
|
|
4063
|
+
closeAddDialog(false);
|
|
4064
|
+
addTriggerButton = trigger || null;
|
|
4065
|
+
|
|
4066
|
+
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim");
|
|
4067
|
+
overlay.addEventListener("click", (event) => {
|
|
4068
|
+
if (!event || !event.target || event.target === overlay) closeAddDialog();
|
|
4069
|
+
});
|
|
4070
|
+
|
|
4071
|
+
const dialog = element(doc, "div", "hive-dialog hive-add-dialog");
|
|
4072
|
+
setAttr(dialog, "role", "dialog");
|
|
4073
|
+
setAttr(dialog, "aria-modal", "true");
|
|
4074
|
+
setAttr(dialog, "aria-label", translate("add.dialogTitle"));
|
|
4075
|
+
|
|
4076
|
+
const head = element(doc, "div", "hive-dialog-head");
|
|
4077
|
+
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
4078
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("add.dialogTitle")));
|
|
4079
|
+
head.appendChild(titleBox);
|
|
4080
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost hive-add-close", "×");
|
|
4081
|
+
setAttr(closeButton, "type", "button");
|
|
4082
|
+
setAttr(closeButton, "title", translate("settings.closeAria"));
|
|
4083
|
+
setAttr(closeButton, "aria-label", translate("settings.closeAria"));
|
|
4084
|
+
closeButton.addEventListener("click", () => {
|
|
4085
|
+
closeAddDialog();
|
|
4086
|
+
});
|
|
4087
|
+
head.appendChild(closeButton);
|
|
4088
|
+
dialog.appendChild(head);
|
|
4089
|
+
|
|
4090
|
+
const body = element(doc, "div", "hive-dialog-body hive-add-body");
|
|
4091
|
+
const titleInput = element(doc, "input", "hive-input hive-add-title");
|
|
4092
|
+
setAttr(titleInput, "type", "text");
|
|
4093
|
+
setAttr(titleInput, "maxlength", "2000");
|
|
4094
|
+
setAttr(titleInput, "autocomplete", "off");
|
|
4095
|
+
setAttr(titleInput, "aria-label", translate("add.titleAria"));
|
|
4096
|
+
body.appendChild(addField("add.title", titleInput));
|
|
4097
|
+
|
|
4098
|
+
const roleInput = element(doc, "input", "hive-input hive-add-role");
|
|
4099
|
+
setAttr(roleInput, "type", "text");
|
|
4100
|
+
setAttr(roleInput, "autocomplete", "off");
|
|
4101
|
+
setAttr(roleInput, "aria-label", translate("add.roleAria"));
|
|
4102
|
+
roleInput.value = "coder";
|
|
4103
|
+
body.appendChild(addField("add.role", roleInput));
|
|
4104
|
+
|
|
4105
|
+
const scopeInput = element(doc, "input", "hive-input hive-add-scope");
|
|
4106
|
+
setAttr(scopeInput, "type", "text");
|
|
4107
|
+
setAttr(scopeInput, "autocomplete", "off");
|
|
4108
|
+
setAttr(scopeInput, "aria-label", translate("add.scopeAria"));
|
|
4109
|
+
body.appendChild(addField("add.scope", scopeInput));
|
|
4110
|
+
|
|
4111
|
+
const afterInput = element(doc, "input", "hive-input hive-add-after");
|
|
4112
|
+
setAttr(afterInput, "type", "text");
|
|
4113
|
+
setAttr(afterInput, "autocomplete", "off");
|
|
4114
|
+
setAttr(afterInput, "aria-label", translate("add.afterAria"));
|
|
4115
|
+
body.appendChild(addField("add.after", afterInput));
|
|
4116
|
+
|
|
4117
|
+
const acceptanceInput = element(doc, "textarea", "hive-textarea hive-add-acceptance");
|
|
4118
|
+
setAttr(acceptanceInput, "maxlength", "2000");
|
|
4119
|
+
setAttr(acceptanceInput, "rows", "3");
|
|
4120
|
+
setAttr(acceptanceInput, "aria-label", translate("add.acceptanceAria"));
|
|
4121
|
+
body.appendChild(addField("add.acceptance", acceptanceInput));
|
|
4122
|
+
|
|
4123
|
+
const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
4124
|
+
body.appendChild(errorNode);
|
|
4125
|
+
dialog.appendChild(body);
|
|
4126
|
+
|
|
4127
|
+
const foot = element(doc, "div", "hive-dialog-foot");
|
|
4128
|
+
const cancelButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("add.cancel"));
|
|
4129
|
+
setAttr(cancelButton, "type", "button");
|
|
4130
|
+
cancelButton.addEventListener("click", () => {
|
|
4131
|
+
closeAddDialog();
|
|
4132
|
+
});
|
|
4133
|
+
const submitButton = element(doc, "button", "hive-btn hive-add-submit", translate("add.submit"));
|
|
4134
|
+
setAttr(submitButton, "type", "button");
|
|
4135
|
+
submitButton.addEventListener("click", () => {
|
|
4136
|
+
void submitAdd();
|
|
4137
|
+
});
|
|
4138
|
+
foot.appendChild(cancelButton);
|
|
4139
|
+
foot.appendChild(submitButton);
|
|
4140
|
+
dialog.appendChild(foot);
|
|
4141
|
+
|
|
4142
|
+
overlay.appendChild(dialog);
|
|
4143
|
+
frame.appendChild(overlay);
|
|
4144
|
+
addOverlay = overlay;
|
|
4145
|
+
addDialogNode = dialog;
|
|
4146
|
+
addState = {
|
|
4147
|
+
overlay,
|
|
4148
|
+
dialog,
|
|
4149
|
+
title: titleInput,
|
|
4150
|
+
role: roleInput,
|
|
4151
|
+
scope: scopeInput,
|
|
4152
|
+
after: afterInput,
|
|
4153
|
+
acceptance: acceptanceInput,
|
|
4154
|
+
error: errorNode,
|
|
4155
|
+
submit: submitButton,
|
|
4156
|
+
cancel: cancelButton,
|
|
4157
|
+
busy: false,
|
|
4158
|
+
};
|
|
4159
|
+
addFocusables = [closeButton, titleInput, roleInput, scopeInput, afterInput, acceptanceInput, cancelButton, submitButton];
|
|
4160
|
+
if (typeof doc.addEventListener === "function") {
|
|
4161
|
+
doc.addEventListener("keydown", onAddKeydown);
|
|
4162
|
+
}
|
|
4163
|
+
focusNode(titleInput);
|
|
4164
|
+
}
|
|
4165
|
+
|
|
4166
|
+
function setAddBusy(busy) {
|
|
4167
|
+
if (!addState) return;
|
|
4168
|
+
addState.busy = busy;
|
|
4169
|
+
addState.title.disabled = busy;
|
|
4170
|
+
addState.role.disabled = busy;
|
|
4171
|
+
addState.scope.disabled = busy;
|
|
4172
|
+
addState.after.disabled = busy;
|
|
4173
|
+
addState.acceptance.disabled = busy;
|
|
4174
|
+
addState.cancel.disabled = busy;
|
|
4175
|
+
addState.submit.disabled = busy;
|
|
4176
|
+
addState.submit.textContent = busy ? translate("add.submitting") : translate("add.submit");
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
async function submitAdd() {
|
|
4180
|
+
if (!addState || addState.busy) return;
|
|
4181
|
+
const title = String(addState.title.value || "").trim();
|
|
4182
|
+
if (!title) {
|
|
4183
|
+
setAddError(translate("add.required"));
|
|
4184
|
+
focusNode(addState.title);
|
|
4185
|
+
return;
|
|
4186
|
+
}
|
|
4187
|
+
const role = String(addState.role.value || "").trim() || "coder";
|
|
4188
|
+
const body = {
|
|
4189
|
+
title,
|
|
4190
|
+
role,
|
|
4191
|
+
scope: splitList(String(addState.scope.value || "")),
|
|
4192
|
+
after: splitList(String(addState.after.value || "")),
|
|
4193
|
+
acceptance: String(addState.acceptance.value || "").trim(),
|
|
4194
|
+
};
|
|
4195
|
+
setAddError("");
|
|
4196
|
+
setAddBusy(true);
|
|
4197
|
+
const result = await postAction("add", body);
|
|
4198
|
+
if (destroyed || !addState) return;
|
|
4199
|
+
if (result) {
|
|
4200
|
+
closeAddDialog();
|
|
4201
|
+
return;
|
|
4202
|
+
}
|
|
4203
|
+
setAddBusy(false);
|
|
4204
|
+
setAddError(translate("status.actionFailed"));
|
|
4205
|
+
}
|
|
4206
|
+
|
|
3349
4207
|
// --- drawer --------------------------------------------------------------
|
|
3350
4208
|
|
|
3351
4209
|
function onDrawerKeydown(event) {
|
|
3352
4210
|
if (event && (event.key === "Escape" || event.key === "Esc")) closeDrawer();
|
|
3353
4211
|
}
|
|
3354
4212
|
|
|
3355
|
-
function closeDrawer() {
|
|
4213
|
+
function closeDrawer(restoreFocus = true) {
|
|
3356
4214
|
if (drawerNode && drawerNode.parentNode) drawerNode.parentNode.removeChild(drawerNode);
|
|
3357
4215
|
drawerNode = null;
|
|
3358
4216
|
drawerState = null;
|
|
3359
4217
|
if (typeof doc.removeEventListener === "function") {
|
|
3360
4218
|
doc.removeEventListener("keydown", onDrawerKeydown);
|
|
3361
4219
|
}
|
|
4220
|
+
if (restoreFocus && !destroyed) focusNode(drawerTrigger);
|
|
4221
|
+
drawerTrigger = null;
|
|
3362
4222
|
}
|
|
3363
4223
|
|
|
3364
4224
|
function mountDrawer(eyebrow, title, ariaLabel) {
|
|
3365
4225
|
closeHelp(false);
|
|
3366
4226
|
closePlanDialog(false);
|
|
3367
|
-
|
|
4227
|
+
closeAddDialog(false);
|
|
4228
|
+
closeDrawer(false);
|
|
3368
4229
|
|
|
3369
4230
|
const panel = element(doc, "aside", "hive-drawer");
|
|
3370
4231
|
setAttr(panel, "role", "dialog");
|
|
@@ -3409,45 +4270,108 @@ function mount(root, options = {}) {
|
|
|
3409
4270
|
body.appendChild(element(doc, "pre", "hive-json", JSON.stringify(raw, null, 2)));
|
|
3410
4271
|
}
|
|
3411
4272
|
|
|
3412
|
-
function openDrawer(card, lane) {
|
|
4273
|
+
function openDrawer(card, lane, trigger) {
|
|
4274
|
+
closeHelp(false);
|
|
4275
|
+
closePlanDialog(false);
|
|
4276
|
+
closeAddDialog(false);
|
|
4277
|
+
closeDrawer(false);
|
|
4278
|
+
drawerTrigger = trigger || null;
|
|
4279
|
+
|
|
3413
4280
|
const raw = findRawTask(card) || { ...card, state: lane };
|
|
3414
4281
|
const title = card.title || translate("card.untitled");
|
|
3415
|
-
const
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
);
|
|
3420
|
-
|
|
3421
|
-
const
|
|
4282
|
+
const id = card.id || translate("card.noId");
|
|
4283
|
+
const role = asString(card.role) || "—";
|
|
4284
|
+
const status = laneLabel(lane);
|
|
4285
|
+
const repo = lastModel ? lastModel.repo : "";
|
|
4286
|
+
const ariaLabel = translate("drawer.cardAria") + " " + (card.title || card.id || translate("card.untitled"));
|
|
4287
|
+
|
|
4288
|
+
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim hive-card-scrim");
|
|
4289
|
+
overlay.addEventListener("click", (event) => {
|
|
4290
|
+
if (!event || !event.target || event.target === overlay) closeDrawer();
|
|
4291
|
+
});
|
|
3422
4292
|
|
|
4293
|
+
const dialog = element(doc, "div", "hive-dialog hive-card-dialog hive-drawer");
|
|
4294
|
+
setAttr(dialog, "role", "dialog");
|
|
4295
|
+
setAttr(dialog, "aria-modal", "true");
|
|
4296
|
+
setAttr(dialog, "aria-label", ariaLabel);
|
|
4297
|
+
|
|
4298
|
+
const head = element(doc, "div", "hive-dialog-head");
|
|
4299
|
+
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
4300
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", title));
|
|
4301
|
+
const subline = element(doc, "div", "hive-card-subline");
|
|
4302
|
+
const sublineText = [id, role, status, repo].filter(Boolean).join(" · ");
|
|
4303
|
+
subline.textContent = sublineText;
|
|
4304
|
+
setAttr(subline, "title", sublineText);
|
|
4305
|
+
titleBox.appendChild(subline);
|
|
4306
|
+
head.appendChild(titleBox);
|
|
4307
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost hive-card-close", "×");
|
|
4308
|
+
setAttr(closeButton, "type", "button");
|
|
4309
|
+
setAttr(closeButton, "title", translate("drawer.closeAria"));
|
|
4310
|
+
setAttr(closeButton, "aria-label", translate("drawer.closeAria"));
|
|
4311
|
+
closeButton.addEventListener("click", () => {
|
|
4312
|
+
closeDrawer();
|
|
4313
|
+
});
|
|
4314
|
+
head.appendChild(closeButton);
|
|
4315
|
+
dialog.appendChild(head);
|
|
4316
|
+
|
|
4317
|
+
const body = element(doc, "div", "hive-dialog-body hive-card-body");
|
|
4318
|
+
const details = element(doc, "details", "hive-card-json");
|
|
4319
|
+
const summary = element(doc, "summary", "hive-card-json-summary", translate("drawer.rawJson"));
|
|
4320
|
+
const pre = element(doc, "pre", "hive-json", JSON.stringify(raw, null, 2));
|
|
4321
|
+
details.appendChild(summary);
|
|
4322
|
+
details.appendChild(pre);
|
|
4323
|
+
body.appendChild(details);
|
|
4324
|
+
dialog.appendChild(body);
|
|
4325
|
+
|
|
4326
|
+
const actions = actionsForState(lane, lastModel ? lastModel.writable : false);
|
|
4327
|
+
if (actions.length === 0) {
|
|
4328
|
+
body.appendChild(
|
|
4329
|
+
element(
|
|
4330
|
+
doc,
|
|
4331
|
+
"div",
|
|
4332
|
+
"hive-note",
|
|
4333
|
+
lastModel && lastModel.writable ? translate("drawer.noActions") : translate("drawer.readOnly"),
|
|
4334
|
+
),
|
|
4335
|
+
);
|
|
4336
|
+
}
|
|
3423
4337
|
if (actions.length > 0) {
|
|
3424
|
-
const
|
|
3425
|
-
setAttr(
|
|
4338
|
+
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
4339
|
+
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
4340
|
+
const claimed = asString(card.state || lane) === "claimed";
|
|
3426
4341
|
for (const action of actions) {
|
|
3427
|
-
const
|
|
4342
|
+
const destructive = action.name === "remove";
|
|
4343
|
+
const button = element(
|
|
4344
|
+
doc,
|
|
4345
|
+
"button",
|
|
4346
|
+
"hive-btn" + (destructive ? " hive-btn-danger" : ""),
|
|
4347
|
+
translate(action.labelKey),
|
|
4348
|
+
);
|
|
3428
4349
|
setAttr(button, "type", "button");
|
|
3429
|
-
|
|
3430
|
-
|
|
4350
|
+
// The panel never sends --force, so a claimed card's delete control is
|
|
4351
|
+
// rendered but disabled, with the release/reopen reason in its title.
|
|
4352
|
+
const hint = destructive && claimed ? translate("drawer.removeClaimed") : translate(action.helpKey);
|
|
4353
|
+
setAttr(button, "title", hint);
|
|
4354
|
+
setAttr(button, "aria-label", hint);
|
|
4355
|
+
if (destructive && claimed) {
|
|
4356
|
+
button.disabled = true;
|
|
4357
|
+
setAttr(button, "aria-disabled", "true");
|
|
4358
|
+
}
|
|
3431
4359
|
button.addEventListener("click", () => {
|
|
3432
4360
|
void runCardAction(action.name, card, lane);
|
|
3433
4361
|
});
|
|
3434
|
-
|
|
4362
|
+
foot.appendChild(button);
|
|
3435
4363
|
}
|
|
3436
|
-
|
|
3437
|
-
} else {
|
|
3438
|
-
const note = element(
|
|
3439
|
-
doc,
|
|
3440
|
-
"div",
|
|
3441
|
-
"hive-note",
|
|
3442
|
-
lastModel && lastModel.writable ? translate("drawer.noActions") : translate("drawer.readOnly"),
|
|
3443
|
-
);
|
|
3444
|
-
body.appendChild(note);
|
|
4364
|
+
dialog.appendChild(foot);
|
|
3445
4365
|
}
|
|
3446
4366
|
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
4367
|
+
overlay.appendChild(dialog);
|
|
4368
|
+
frame.appendChild(overlay);
|
|
4369
|
+
drawerNode = overlay;
|
|
4370
|
+
drawerState = { kind: "card", card, lane };
|
|
4371
|
+
if (typeof doc.addEventListener === "function") {
|
|
4372
|
+
doc.addEventListener("keydown", onDrawerKeydown);
|
|
4373
|
+
}
|
|
4374
|
+
focusNode(closeButton);
|
|
3451
4375
|
}
|
|
3452
4376
|
|
|
3453
4377
|
// --- actions -------------------------------------------------------------
|
|
@@ -3596,34 +4520,12 @@ function mount(root, options = {}) {
|
|
|
3596
4520
|
case "mode":
|
|
3597
4521
|
await postAction("mode", action.body || { mode: "free", reason: "panel" });
|
|
3598
4522
|
break;
|
|
3599
|
-
case "add":
|
|
3600
|
-
|
|
3601
|
-
if (title === null || !title.trim()) return;
|
|
3602
|
-
const role = ask(translate("prompt.role"), "coder");
|
|
3603
|
-
if (role === null) return;
|
|
3604
|
-
const scope = ask(translate("prompt.scope"), "");
|
|
3605
|
-
if (scope === null) return;
|
|
3606
|
-
const after = ask(translate("prompt.after"), "");
|
|
3607
|
-
if (after === null) return;
|
|
3608
|
-
await postAction("add", {
|
|
3609
|
-
title: title.trim(),
|
|
3610
|
-
role: role.trim() || "coder",
|
|
3611
|
-
scope: splitList(scope),
|
|
3612
|
-
after: splitList(after),
|
|
3613
|
-
});
|
|
4523
|
+
case "add":
|
|
4524
|
+
openAddDialog(triggerButton);
|
|
3614
4525
|
break;
|
|
3615
|
-
}
|
|
3616
4526
|
case "plan":
|
|
3617
4527
|
openPlanDialog(triggerButton);
|
|
3618
4528
|
break;
|
|
3619
|
-
case "commit": {
|
|
3620
|
-
const message = ask(translate("prompt.commitMessage"), "panel commit");
|
|
3621
|
-
if (message === null) return;
|
|
3622
|
-
const paths = ask(translate("prompt.paths"), "");
|
|
3623
|
-
if (paths === null) return;
|
|
3624
|
-
await postAction("commit", { message: message.trim() || "panel commit", set: splitList(paths) });
|
|
3625
|
-
break;
|
|
3626
|
-
}
|
|
3627
4529
|
default:
|
|
3628
4530
|
break;
|
|
3629
4531
|
}
|
|
@@ -3656,10 +4558,18 @@ function mount(root, options = {}) {
|
|
|
3656
4558
|
case "retry":
|
|
3657
4559
|
ok = await postAction("retry", { id: card.id });
|
|
3658
4560
|
break;
|
|
4561
|
+
case "remove": {
|
|
4562
|
+
const name = card.title || card.id || translate("card.untitled");
|
|
4563
|
+
const message = translate("confirm.remove").replace("{title}", name);
|
|
4564
|
+
if (!askConfirm(message)) return;
|
|
4565
|
+
ok = await postAction("remove", { id: card.id });
|
|
4566
|
+
break;
|
|
4567
|
+
}
|
|
3659
4568
|
default:
|
|
3660
4569
|
break;
|
|
3661
4570
|
}
|
|
3662
4571
|
if (ok && !destroyed) {
|
|
4572
|
+
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
3663
4573
|
closeDrawer();
|
|
3664
4574
|
void refresh();
|
|
3665
4575
|
}
|
|
@@ -3808,10 +4718,9 @@ function mount(root, options = {}) {
|
|
|
3808
4718
|
renderSupervisorContent();
|
|
3809
4719
|
} catch {
|
|
3810
4720
|
supervisorData = [];
|
|
4721
|
+
supervisorInlineRow = null;
|
|
3811
4722
|
try {
|
|
3812
|
-
|
|
3813
|
-
supervisorLimitsButton.className = "hive-btn hive-btn-ghost hive-supervisor-limits is-hidden";
|
|
3814
|
-
if (limitsDialogNode) closeLimitsDialog(false);
|
|
4723
|
+
supervisorInline.className = "hive-supervisor-inline is-hidden";
|
|
3815
4724
|
} catch {
|
|
3816
4725
|
// Supervisor rendering is optional; never let it break the panel.
|
|
3817
4726
|
}
|
|
@@ -3819,53 +4728,38 @@ function mount(root, options = {}) {
|
|
|
3819
4728
|
}
|
|
3820
4729
|
|
|
3821
4730
|
function renderSupervisorContent() {
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
const canConfigure = Boolean(lastModel && lastModel.writable);
|
|
3833
|
-
supervisorLimitsButton.className = "hive-btn hive-btn-ghost hive-supervisor-limits" + (canConfigure ? "" : " is-hidden");
|
|
3834
|
-
supervisorLimitsButton.textContent = translate("limits.open");
|
|
3835
|
-
setAttr(supervisorLimitsButton, "title", translate("limits.openAria"));
|
|
3836
|
-
setAttr(supervisorLimitsButton, "aria-label", translate("limits.openAria"));
|
|
3837
|
-
if (!canConfigure && limitsDialogNode) closeLimitsDialog(false);
|
|
3838
|
-
for (const row of supervisorData) {
|
|
3839
|
-
const item = element(doc, "span", "hive-supervisor-item");
|
|
3840
|
-
const path = element(doc, "code", "hive-supervisor-path", row.repo);
|
|
3841
|
-
setAttr(path, "title", row.repo);
|
|
3842
|
-
item.appendChild(path);
|
|
3843
|
-
|
|
3844
|
-
let stateLabel = translate("supervisor.idle");
|
|
3845
|
-
if (row.state === "running") {
|
|
3846
|
-
stateLabel =
|
|
3847
|
-
row.running === null || row.running === undefined
|
|
3848
|
-
? translate("supervisor.running")
|
|
3849
|
-
: translate("supervisor.runningCount").replace("{count}", String(row.running));
|
|
3850
|
-
} else if (row.state === "backoff") {
|
|
3851
|
-
stateLabel = translate("supervisor.backoff");
|
|
3852
|
-
} else if (row.state === "paused") {
|
|
3853
|
-
stateLabel = translate("supervisor.paused");
|
|
3854
|
-
}
|
|
3855
|
-
item.appendChild(element(doc, "span", "hive-supervisor-state is-" + row.state, stateLabel));
|
|
4731
|
+
supervisorInlineRow = null;
|
|
4732
|
+
supervisorInline.className = "hive-supervisor-inline is-hidden";
|
|
4733
|
+
supervisorInlineState.className = "hive-supervisor-inline-state";
|
|
4734
|
+
supervisorInlineState.textContent = "";
|
|
4735
|
+
supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume is-hidden";
|
|
4736
|
+
setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
|
|
4737
|
+
supervisorInlineLabel.textContent = translate("supervisor.label");
|
|
4738
|
+
if (!lastModel || !Array.isArray(supervisorData) || supervisorData.length === 0) return;
|
|
4739
|
+
const row = supervisorData.find((entry) => entry.repo === lastModel.repo);
|
|
4740
|
+
if (!row) return;
|
|
3856
4741
|
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
4742
|
+
supervisorInlineRow = row;
|
|
4743
|
+
supervisorInline.className = "hive-supervisor-inline";
|
|
4744
|
+
let stateLabel = translate("supervisor.idle");
|
|
4745
|
+
if (row.state === "running") {
|
|
4746
|
+
stateLabel =
|
|
4747
|
+
row.running === null || row.running === undefined
|
|
4748
|
+
? translate("supervisor.running")
|
|
4749
|
+
: translate("supervisor.runningCount").replace("{count}", String(row.running));
|
|
4750
|
+
} else if (row.state === "backoff") {
|
|
4751
|
+
stateLabel = translate("supervisor.backoff");
|
|
4752
|
+
} else if (row.state === "paused") {
|
|
4753
|
+
stateLabel = translate("supervisor.paused");
|
|
4754
|
+
}
|
|
4755
|
+
supervisorInlineState.className = "hive-supervisor-inline-state is-" + row.state;
|
|
4756
|
+
supervisorInlineState.textContent = stateLabel;
|
|
4757
|
+
|
|
4758
|
+
if (row.state === "paused") {
|
|
4759
|
+
const aria = translate("supervisor.resumeAria").replace("{repo}", row.repo);
|
|
4760
|
+
supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume";
|
|
4761
|
+
setAttr(supervisorInlineResume, "title", aria);
|
|
4762
|
+
setAttr(supervisorInlineResume, "aria-label", aria);
|
|
3869
4763
|
}
|
|
3870
4764
|
}
|
|
3871
4765
|
|
|
@@ -4103,11 +4997,11 @@ function mount(root, options = {}) {
|
|
|
4103
4997
|
foot.appendChild(element(doc, "span", "hive-card-state", laneLabel(lane)));
|
|
4104
4998
|
node.appendChild(foot);
|
|
4105
4999
|
|
|
4106
|
-
node.addEventListener("click", () => openDrawer(card, lane));
|
|
5000
|
+
node.addEventListener("click", () => openDrawer(card, lane, node));
|
|
4107
5001
|
node.addEventListener("keydown", (event) => {
|
|
4108
5002
|
if (!event || (event.key !== "Enter" && event.key !== " ")) return;
|
|
4109
5003
|
if (typeof event.preventDefault === "function") event.preventDefault();
|
|
4110
|
-
openDrawer(card, lane);
|
|
5004
|
+
openDrawer(card, lane, node);
|
|
4111
5005
|
});
|
|
4112
5006
|
return node;
|
|
4113
5007
|
}
|
|
@@ -4233,8 +5127,6 @@ function mount(root, options = {}) {
|
|
|
4233
5127
|
function render(model) {
|
|
4234
5128
|
repoNode.textContent = model.repo || "—";
|
|
4235
5129
|
setAttr(repoNode, "title", model.repo);
|
|
4236
|
-
timeNode.textContent = model.at ? formatStamp(model.at) : "—";
|
|
4237
|
-
setAttr(timeNode, "datetime", model.at);
|
|
4238
5130
|
|
|
4239
5131
|
renderInit(model);
|
|
4240
5132
|
renderQueenHint(model);
|
|
@@ -4257,6 +5149,7 @@ function mount(root, options = {}) {
|
|
|
4257
5149
|
if (helpWasOpen) closeHelp(false);
|
|
4258
5150
|
if (planDialogNode) closePlanDialog(false);
|
|
4259
5151
|
if (limitsDialogNode) closeLimitsDialog(false);
|
|
5152
|
+
if (addDialogNode) closeAddDialog(false);
|
|
4260
5153
|
try {
|
|
4261
5154
|
applyChrome();
|
|
4262
5155
|
if (lastModel) render(lastModel);
|
|
@@ -4381,6 +5274,7 @@ function mount(root, options = {}) {
|
|
|
4381
5274
|
closeHelp(false);
|
|
4382
5275
|
closePlanDialog(false);
|
|
4383
5276
|
closeLimitsDialog(false);
|
|
5277
|
+
closeAddDialog(false);
|
|
4384
5278
|
closeToast();
|
|
4385
5279
|
closeDrawer();
|
|
4386
5280
|
if (frame.parentNode) frame.parentNode.removeChild(frame);
|