@dadado/agent-kit-cli 6.8.0 → 6.10.0
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/dashboard/README.md +31 -5
- package/dashboard/art/atmospheric-purifier.webp +0 -0
- package/dashboard/art/rover-frozen-flats.webp +0 -0
- package/dashboard/art/seed-tree-crane.webp +0 -0
- package/dashboard/art/uplink-tower-road.webp +0 -0
- package/dashboard/dashboard-data.mjs +385 -9
- package/dashboard/dashboard.html +794 -75
- package/dashboard/lib/live-refresh.mjs +1 -0
- package/dashboard/lib/outcome-ledger.d.mts +115 -0
- package/dashboard/lib/outcome-ledger.mjs +595 -0
- package/dashboard/lib/ship-lane.mjs +690 -0
- package/dashboard/serve.mjs +20 -0
- package/dist/{chunk-BCX5NDQC.js → chunk-GQ6Q3P7C.js} +1 -1
- package/dist/{chunk-67G3236R.js → chunk-K5OCGZWA.js} +2 -2
- package/dist/{chunk-3LLXDHIU.js → chunk-LFWPB2JR.js} +1 -0
- package/dist/{chunk-GO3K752H.js → chunk-SC2DBY2R.js} +2 -0
- package/dist/{chunk-3Z4PGEEJ.js → chunk-TUZVOPKY.js} +1 -1
- package/dist/{doctor-PZT7EGLQ.js → doctor-E6LOBJYK.js} +2 -2
- package/dist/{guard-ZZRQW3DJ.js → guard-M3W3QE62.js} +14 -2
- package/dist/index.js +19 -11
- package/dist/{init-MGRZ7U7A.js → init-KKVT2RW4.js} +3 -3
- package/dist/{install-432KJISB.js → install-BPZTP5KT.js} +3 -3
- package/dist/{mission-control-MHQU73XC.js → mission-control-C2QV5D25.js} +1 -1
- package/dist/outcome-ledger-XLWHWPVQ.js +297 -0
- package/dist/{run-DXGTFYJK.js → run-326EEQYY.js} +34 -11
- package/dist/{run-plan-KWGS2SOZ.js → run-plan-2IFO4G4Y.js} +2 -2
- package/dist/{scan-UX4HARMJ.js → scan-BWA64R7I.js} +1 -1
- package/dist/{status-UDM55MHU.js → status-LNXVLDMP.js} +1 -1
- package/package.json +1 -1
package/dashboard/dashboard.html
CHANGED
|
@@ -945,6 +945,42 @@ body.mc-fullscreen .top-tabs-row {
|
|
|
945
945
|
}
|
|
946
946
|
.terminal-item:hover { background: var(--bg-card-hover); }
|
|
947
947
|
|
|
948
|
+
/* ===== Colony (game panel over outcomeLedger) ===== */
|
|
949
|
+
.colony-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); gap: var(--mc-space-xl); align-items: start; }
|
|
950
|
+
.colony-map-wrap { border: 1px solid var(--border); border-radius: var(--mc-radius); padding: var(--mc-space-lg); background: var(--bg-card); }
|
|
951
|
+
.colony-map { display: block; width: 100%; max-width: 420px; margin: 0 auto; height: auto; }
|
|
952
|
+
.colony-tile { stroke: var(--bg-primary); stroke-width: 1.5; }
|
|
953
|
+
.colony-tile[data-tile="fog"] { fill: var(--bg-secondary); }
|
|
954
|
+
.colony-tile[data-tile="barren"] { fill: #4b5563; }
|
|
955
|
+
.colony-tile[data-tile="green"] { fill: #3f7d5a; }
|
|
956
|
+
.colony-glyph { font: 600 11px var(--mc-font-mono); fill: #f5e6c8; pointer-events: none; }
|
|
957
|
+
.colony-side { display: flex; flex-direction: column; gap: var(--mc-space-lg); }
|
|
958
|
+
.colony-resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--mc-space-md); }
|
|
959
|
+
.colony-resource { border: 1px solid var(--border); border-radius: var(--mc-radius); padding: var(--mc-card-padding-dense); background: var(--bg-card); display: flex; flex-direction: column; gap: 2px; }
|
|
960
|
+
.colony-resource-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
|
|
961
|
+
.colony-resource-value { font: 600 20px var(--mc-font-mono); color: var(--text-primary); }
|
|
962
|
+
.colony-resource-meta { font-size: 11px; color: var(--text-muted); }
|
|
963
|
+
.colony-panel { border: 1px solid var(--border); border-radius: var(--mc-radius); padding: var(--mc-card-padding-dense); background: var(--bg-card); }
|
|
964
|
+
.colony-panel-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--mc-space-sm); }
|
|
965
|
+
.colony-panel-meta { font-weight: 400; color: var(--text-muted); font-family: var(--mc-font-mono); }
|
|
966
|
+
.colony-queue, .colony-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
967
|
+
.colony-queue-item, .colony-log-item { display: flex; gap: var(--mc-space-md); font-size: 12px; color: var(--text-secondary); min-width: 0; }
|
|
968
|
+
.colony-queue-name { flex: 1; color: var(--text-primary); }
|
|
969
|
+
.colony-queue-time, .colony-log-kind { color: var(--text-muted); font-family: var(--mc-font-mono); white-space: nowrap; }
|
|
970
|
+
.colony-log-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
971
|
+
.colony-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--mc-space-lg); margin-top: var(--mc-space-xl); }
|
|
972
|
+
.colony-card { border: 1px solid var(--border); border-radius: var(--mc-radius); background: var(--bg-card); overflow: hidden; display: flex; flex-direction: column; }
|
|
973
|
+
.colony-card:hover { border-color: var(--border-active); }
|
|
974
|
+
.colony-card-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-secondary); }
|
|
975
|
+
.colony-card-body { padding: var(--mc-card-padding-dense); display: flex; flex-direction: column; gap: 6px; flex: 1; }
|
|
976
|
+
.colony-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
|
|
977
|
+
.colony-card-blurb { font-size: 12px; color: var(--text-secondary); margin: 0; flex: 1; }
|
|
978
|
+
.colony-card-meta { font-size: 11px; color: var(--text-muted); font-family: var(--mc-font-mono); }
|
|
979
|
+
.colony-build-btn { align-self: flex-start; }
|
|
980
|
+
.colony-build-btn:disabled { cursor: not-allowed; opacity: 0.6; }
|
|
981
|
+
.colony-note { font-size: 12px; color: var(--text-muted); margin: var(--mc-space-md) 0 0; }
|
|
982
|
+
@media (max-width: 860px) { .colony-layout { grid-template-columns: 1fr; } }
|
|
983
|
+
|
|
948
984
|
/* ===== Chats (saved agent sessions) ===== */
|
|
949
985
|
.chat-list { display: flex; flex-direction: column; gap: 4px; }
|
|
950
986
|
.chat-item {
|
|
@@ -1271,6 +1307,131 @@ body.mc-fullscreen .top-tabs-row {
|
|
|
1271
1307
|
word-break: break-all;
|
|
1272
1308
|
}
|
|
1273
1309
|
|
|
1310
|
+
/* ===== Git e CI/CD bento ===== */
|
|
1311
|
+
/* One section for the former Git and DevOps tabs (ADR 2026-10-23
|
|
1312
|
+
* git-cicd-tab-read-in-mc-act-in-colony point 1): tiles on a 6-column grid
|
|
1313
|
+
* built from the skin tokens; the Ship lane tile leads and spans two rows. */
|
|
1314
|
+
.bento {
|
|
1315
|
+
display: grid;
|
|
1316
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
1317
|
+
grid-auto-flow: row dense;
|
|
1318
|
+
gap: var(--mc-space-xl);
|
|
1319
|
+
}
|
|
1320
|
+
.bento-tile { min-width: 0; }
|
|
1321
|
+
.bento-tile[hidden] { display: none; }
|
|
1322
|
+
.bento-ship { grid-column: span 3; grid-row: span 2; }
|
|
1323
|
+
.bento-flow,
|
|
1324
|
+
.bento-prs,
|
|
1325
|
+
.bento-pipeline,
|
|
1326
|
+
.bento-deploy { grid-column: span 3; }
|
|
1327
|
+
.bento-graph {
|
|
1328
|
+
grid-column: span 6;
|
|
1329
|
+
display: grid;
|
|
1330
|
+
grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
|
|
1331
|
+
column-gap: var(--mc-space-xl);
|
|
1332
|
+
align-items: start;
|
|
1333
|
+
}
|
|
1334
|
+
.bento-pane { min-width: 0; }
|
|
1335
|
+
.bento-pane:empty { display: none; }
|
|
1336
|
+
.bento-files { grid-column: span 6; }
|
|
1337
|
+
@media (min-width: 1600px) {
|
|
1338
|
+
.bento-ship,
|
|
1339
|
+
.bento-flow,
|
|
1340
|
+
.bento-prs,
|
|
1341
|
+
.bento-pipeline,
|
|
1342
|
+
.bento-deploy { grid-column: span 2; }
|
|
1343
|
+
}
|
|
1344
|
+
@media (max-width: 1100px) {
|
|
1345
|
+
.bento-graph { grid-template-columns: minmax(0, 1fr); }
|
|
1346
|
+
}
|
|
1347
|
+
@media (max-width: 900px) {
|
|
1348
|
+
.bento { grid-template-columns: minmax(0, 1fr); }
|
|
1349
|
+
.bento-tile { grid-column: auto; grid-row: auto; }
|
|
1350
|
+
}
|
|
1351
|
+
.ship-lane-summary {
|
|
1352
|
+
font-size: 12px;
|
|
1353
|
+
color: var(--text-secondary);
|
|
1354
|
+
margin: 0 0 8px;
|
|
1355
|
+
}
|
|
1356
|
+
.ship-lane,
|
|
1357
|
+
.ship-prs {
|
|
1358
|
+
list-style: none;
|
|
1359
|
+
display: flex;
|
|
1360
|
+
flex-direction: column;
|
|
1361
|
+
gap: 6px;
|
|
1362
|
+
}
|
|
1363
|
+
.ship-row,
|
|
1364
|
+
.ship-pr {
|
|
1365
|
+
display: flex;
|
|
1366
|
+
flex-wrap: wrap;
|
|
1367
|
+
align-items: center;
|
|
1368
|
+
gap: 4px 10px;
|
|
1369
|
+
font-size: 12px;
|
|
1370
|
+
padding: 8px 10px;
|
|
1371
|
+
border: 1px solid var(--border);
|
|
1372
|
+
border-radius: var(--mc-radius);
|
|
1373
|
+
background: var(--bg-card);
|
|
1374
|
+
}
|
|
1375
|
+
.ship-row.is-red { border-color: var(--red); }
|
|
1376
|
+
.ship-row.is-yellow { border-color: var(--yellow); }
|
|
1377
|
+
.ship-row-label {
|
|
1378
|
+
font-weight: 600;
|
|
1379
|
+
color: var(--text-primary);
|
|
1380
|
+
min-width: 128px;
|
|
1381
|
+
}
|
|
1382
|
+
.ship-row-state {
|
|
1383
|
+
font-size: var(--mc-chrome-meta-size);
|
|
1384
|
+
padding: 1px 8px;
|
|
1385
|
+
border-radius: var(--mc-radius-pill);
|
|
1386
|
+
color: var(--text-muted);
|
|
1387
|
+
background: var(--bg-card-hover);
|
|
1388
|
+
}
|
|
1389
|
+
.ship-row.is-green .ship-row-state { color: var(--green); background: var(--green-bg); }
|
|
1390
|
+
.ship-row.is-yellow .ship-row-state { color: var(--yellow); background: var(--yellow-bg); }
|
|
1391
|
+
.ship-row.is-red .ship-row-state { color: var(--red); background: var(--red-bg); }
|
|
1392
|
+
.ship-row-detail {
|
|
1393
|
+
color: var(--text-secondary);
|
|
1394
|
+
flex: 1 1 180px;
|
|
1395
|
+
min-width: 0;
|
|
1396
|
+
overflow-wrap: anywhere;
|
|
1397
|
+
}
|
|
1398
|
+
.ship-row-next {
|
|
1399
|
+
display: inline-flex;
|
|
1400
|
+
align-items: center;
|
|
1401
|
+
gap: 6px;
|
|
1402
|
+
margin-left: auto;
|
|
1403
|
+
min-width: 0;
|
|
1404
|
+
}
|
|
1405
|
+
.ship-row-next:empty { display: none; }
|
|
1406
|
+
.ship-row-cmd {
|
|
1407
|
+
font-family: var(--mc-font-mono);
|
|
1408
|
+
font-size: var(--mc-chrome-meta-size);
|
|
1409
|
+
color: var(--text-secondary);
|
|
1410
|
+
background: var(--bg-secondary);
|
|
1411
|
+
border: 1px solid var(--border);
|
|
1412
|
+
border-radius: var(--mc-radius-sm);
|
|
1413
|
+
padding: 1px 6px;
|
|
1414
|
+
overflow-wrap: anywhere;
|
|
1415
|
+
}
|
|
1416
|
+
.ship-pr-num {
|
|
1417
|
+
font-family: var(--mc-font-mono);
|
|
1418
|
+
color: var(--text-secondary);
|
|
1419
|
+
}
|
|
1420
|
+
.ship-pr-title {
|
|
1421
|
+
font-weight: 600;
|
|
1422
|
+
color: var(--text-primary);
|
|
1423
|
+
flex: 1 1 160px;
|
|
1424
|
+
min-width: 0;
|
|
1425
|
+
overflow-wrap: anywhere;
|
|
1426
|
+
}
|
|
1427
|
+
.ship-pr .ship-copy { order: 2; }
|
|
1428
|
+
.ship-pr-meta {
|
|
1429
|
+
order: 3;
|
|
1430
|
+
flex-basis: 100%;
|
|
1431
|
+
color: var(--text-secondary);
|
|
1432
|
+
overflow-wrap: anywhere;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1274
1435
|
/* ===== Memory ===== */
|
|
1275
1436
|
.memory-list {
|
|
1276
1437
|
display: flex;
|
|
@@ -3604,6 +3765,13 @@ html[data-monitor-density="comfortable"] .live-activity-feed .monitor-row .monit
|
|
|
3604
3765
|
word-break: break-word;
|
|
3605
3766
|
white-space: pre-wrap;
|
|
3606
3767
|
}
|
|
3768
|
+
.flight-log-card-text code {
|
|
3769
|
+
font-family: var(--mc-font-mono);
|
|
3770
|
+
font-size: 0.92em;
|
|
3771
|
+
}
|
|
3772
|
+
.flight-log-card-text strong {
|
|
3773
|
+
font-weight: 600;
|
|
3774
|
+
}
|
|
3607
3775
|
.flight-log-card-past .flight-log-card-text {
|
|
3608
3776
|
color: var(--text-secondary);
|
|
3609
3777
|
display: -webkit-box;
|
|
@@ -3732,14 +3900,10 @@ html[data-monitor-density="comfortable"] .live-activity-feed .monitor-row .monit
|
|
|
3732
3900
|
Health
|
|
3733
3901
|
<span class="dot dot-green" id="navHealthDot" aria-hidden="true"></span>
|
|
3734
3902
|
</a>
|
|
3735
|
-
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="git" tabindex="0" onclick="return showSection('git')" aria-label="Git section">
|
|
3736
|
-
Git
|
|
3903
|
+
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="git" tabindex="0" onclick="return showSection('git')" aria-label="Git e CI/CD section">
|
|
3904
|
+
Git e CI/CD
|
|
3737
3905
|
<span class="dot dot-gray" id="navGitDot" aria-hidden="true"></span>
|
|
3738
3906
|
</a>
|
|
3739
|
-
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="devops" tabindex="0" onclick="return showSection('devops')" aria-label="DevOps section">
|
|
3740
|
-
DevOps
|
|
3741
|
-
<span class="dot dot-gray" id="navDevopsDot" aria-hidden="true"></span>
|
|
3742
|
-
</a>
|
|
3743
3907
|
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="memory" tabindex="0" onclick="return showSection('memory')" aria-label="Memory section">
|
|
3744
3908
|
Memory
|
|
3745
3909
|
</a>
|
|
@@ -3751,6 +3915,9 @@ html[data-monitor-density="comfortable"] .live-activity-feed .monitor-row .monit
|
|
|
3751
3915
|
Chats
|
|
3752
3916
|
<span class="top-tab-badge" id="navChatsBadge">0</span>
|
|
3753
3917
|
</a>
|
|
3918
|
+
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="colony" tabindex="0" onclick="return showSection('colony')" aria-label="Colony section">
|
|
3919
|
+
Colony
|
|
3920
|
+
</a>
|
|
3754
3921
|
<a class="top-tab nav-more-item" role="menuitem" href="#" data-section="processes" tabindex="0" onclick="return showSection('processes')" aria-label="Processes section">
|
|
3755
3922
|
Processes
|
|
3756
3923
|
<span class="top-tab-badge" id="navProcessesBadge">0</span>
|
|
@@ -3898,6 +4065,25 @@ function escapeAttr(value) {
|
|
|
3898
4065
|
return escapeHtml(value);
|
|
3899
4066
|
}
|
|
3900
4067
|
|
|
4068
|
+
/**
|
|
4069
|
+
* HANDOFF prose keeps its inline markdown (`**bold**`, `` `code` ``). Escape first, then turn
|
|
4070
|
+
* only those two marks into <strong> / <code>, so no raw `**` reaches the card and no input
|
|
4071
|
+
* markup survives. Never call on already-escaped text.
|
|
4072
|
+
* @param {unknown} value
|
|
4073
|
+
*/
|
|
4074
|
+
function inlineMarkdownHtml(value) {
|
|
4075
|
+
return escapeHtml(value).replace(/`([^`\n]+)`|\*\*([^*\n]+?)\*\*/g, (_m, code, bold) =>
|
|
4076
|
+
code !== undefined ? `<code>${code}</code>` : `<strong>${bold}</strong>`,
|
|
4077
|
+
);
|
|
4078
|
+
}
|
|
4079
|
+
|
|
4080
|
+
/** Same text without the inline marks (aria-label, title). @param {unknown} value */
|
|
4081
|
+
function stripInlineMarkdown(value) {
|
|
4082
|
+
return String(value ?? '').replace(/`([^`\n]+)`|\*\*([^*\n]+?)\*\*/g, (_m, code, bold) =>
|
|
4083
|
+
code !== undefined ? code : bold,
|
|
4084
|
+
);
|
|
4085
|
+
}
|
|
4086
|
+
|
|
3901
4087
|
function escapeJsString(value) {
|
|
3902
4088
|
return String(value ?? '')
|
|
3903
4089
|
.replace(/\\/g, '\\\\')
|
|
@@ -3919,18 +4105,31 @@ const SECTION_IDS = [
|
|
|
3919
4105
|
'commands',
|
|
3920
4106
|
'health',
|
|
3921
4107
|
'git',
|
|
3922
|
-
'devops',
|
|
3923
4108
|
'memory',
|
|
3924
4109
|
'terminals',
|
|
3925
4110
|
'chats',
|
|
4111
|
+
'colony',
|
|
3926
4112
|
'processes',
|
|
3927
4113
|
'config',
|
|
3928
4114
|
];
|
|
3929
4115
|
|
|
4116
|
+
/**
|
|
4117
|
+
* Retired or alternate section ids that still deep-link. Git and DevOps merged
|
|
4118
|
+
* into one Git e CI/CD section (id `git`; ADR 2026-10-23
|
|
4119
|
+
* git-cicd-tab-read-in-mc-act-in-colony point 1), so `#devops` and
|
|
4120
|
+
* `#git-cicd` land there too.
|
|
4121
|
+
*/
|
|
4122
|
+
const SECTION_ALIASES = Object.freeze({ devops: 'git', 'git-cicd': 'git' });
|
|
4123
|
+
|
|
4124
|
+
/** Canonical section id for a raw id or alias (unknown ids stay as given). */
|
|
4125
|
+
function canonicalSectionId(raw) {
|
|
4126
|
+
return Object.prototype.hasOwnProperty.call(SECTION_ALIASES, raw) ? SECTION_ALIASES[raw] : raw;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
3930
4129
|
/** Read the active section from the URL hash (`#health` -> `health`). */
|
|
3931
4130
|
function sectionFromHash() {
|
|
3932
4131
|
try {
|
|
3933
|
-
const raw = (location.hash || '').replace(/^#\/?/, '').split('/')[0];
|
|
4132
|
+
const raw = canonicalSectionId((location.hash || '').replace(/^#\/?/, '').split('/')[0]);
|
|
3934
4133
|
return SECTION_IDS.includes(raw) ? raw : 'overview';
|
|
3935
4134
|
} catch {
|
|
3936
4135
|
return 'overview';
|
|
@@ -4030,7 +4229,7 @@ function updateHeaderHomeChrome() {
|
|
|
4030
4229
|
}
|
|
4031
4230
|
|
|
4032
4231
|
function showSection(id) {
|
|
4033
|
-
activeSectionId = id || 'overview';
|
|
4232
|
+
activeSectionId = canonicalSectionId(id) || 'overview';
|
|
4034
4233
|
const menuWasOpen = isNavMoreOpen();
|
|
4035
4234
|
closeNavMore({ restoreFocus: menuWasOpen });
|
|
4036
4235
|
|
|
@@ -5374,8 +5573,13 @@ function renderNowModeHint(modeLabel) {
|
|
|
5374
5573
|
}
|
|
5375
5574
|
|
|
5376
5575
|
// ===== Git file helpers (Phase 2) =====
|
|
5576
|
+
/**
|
|
5577
|
+
* POSIX single quotes: nothing inside expands. Double quotes (the previous
|
|
5578
|
+
* form) still ran `$(...)` and backticks from a crafted tracked file name when
|
|
5579
|
+
* the copied diff command was pasted (security pass p4, 2026-10-23).
|
|
5580
|
+
*/
|
|
5377
5581
|
function shellQuotePath(path) {
|
|
5378
|
-
return `
|
|
5582
|
+
return `'${String(path ?? '').replace(/'/g, "'\\''")}'`;
|
|
5379
5583
|
}
|
|
5380
5584
|
|
|
5381
5585
|
function gitFileStatusLabel(f) {
|
|
@@ -5757,6 +5961,176 @@ function renderGitHygieneHint(git) {
|
|
|
5757
5961
|
`;
|
|
5758
5962
|
}
|
|
5759
5963
|
|
|
5964
|
+
// ===== Git e CI/CD: ship lane (snapshot 1.8.0 `shipLane`) =====
|
|
5965
|
+
// ADR 2026-10-23 git-cicd-tab-read-in-mc-act-in-colony: read-only rows that
|
|
5966
|
+
// mirror the /kit-prod Done rows, each with one copy-only next command. Forge
|
|
5967
|
+
// text (PR titles, branch and check names) is untrusted: every value goes
|
|
5968
|
+
// through escapeHtml / escapeAttr, and the copy buttons carry their command in
|
|
5969
|
+
// data-* attributes read by one delegated listener, so this section adds no
|
|
5970
|
+
// inline event handler and no innerHTML sink (CSP readiness, p4).
|
|
5971
|
+
|
|
5972
|
+
/** Ship lane row state -> existing dot tone. */
|
|
5973
|
+
const SHIP_LANE_TONES = Object.freeze({ green: 'green', red: 'red', pending: 'yellow', unknown: 'gray' });
|
|
5974
|
+
const SHIP_LANE_STATE_LABELS = Object.freeze({
|
|
5975
|
+
green: 'Done',
|
|
5976
|
+
red: 'Blocked',
|
|
5977
|
+
pending: 'Pending',
|
|
5978
|
+
unknown: 'Unknown',
|
|
5979
|
+
});
|
|
5980
|
+
|
|
5981
|
+
function shipLaneTone(state) {
|
|
5982
|
+
return Object.prototype.hasOwnProperty.call(SHIP_LANE_TONES, state) ? SHIP_LANE_TONES[state] : 'gray';
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
/** The snapshot names destinations in words; the copy seam takes PASTE_DESTINATIONS keys. */
|
|
5986
|
+
function shipLaneDestination(destination) {
|
|
5987
|
+
return destination === 'terminal' ? 'terminal' : 'chatInput';
|
|
5988
|
+
}
|
|
5989
|
+
|
|
5990
|
+
/** Copy button for one next command (delegated listener below; no inline handler). */
|
|
5991
|
+
function shipLaneCopyButton(next) {
|
|
5992
|
+
if (!next || typeof next.text !== 'string' || !next.text) return '';
|
|
5993
|
+
const dest = shipLaneDestination(next.destination);
|
|
5994
|
+
return `<button type="button" class="git-action-btn ship-copy" data-ship-copy="${escapeAttr(next.text)}" data-ship-dest="${dest}" title="${escapeAttr(copyActionTitle(next.text, dest))}">Copy</button>`;
|
|
5995
|
+
}
|
|
5996
|
+
|
|
5997
|
+
/** Ship lane card: one row per /kit-prod Done row (or the /git-prod subset in a consumer repo). */
|
|
5998
|
+
function renderShipLaneCard(shipLane) {
|
|
5999
|
+
if (!shipLane || !Array.isArray(shipLane.rows)) {
|
|
6000
|
+
return renderEmptyStateCta({
|
|
6001
|
+
headline: 'No ship lane signal',
|
|
6002
|
+
support: 'This snapshot has no shipLane field (Mission Control snapshot 1.8.0 or later). Update the kit engine to see the release rows here.',
|
|
6003
|
+
compact: true,
|
|
6004
|
+
className: 'ship-lane-empty',
|
|
6005
|
+
});
|
|
6006
|
+
}
|
|
6007
|
+
const rows = shipLane.rows;
|
|
6008
|
+
if (!rows.length) {
|
|
6009
|
+
return renderEmptyStateCta({
|
|
6010
|
+
headline: 'No ship lane rows',
|
|
6011
|
+
support: shipLane.note || 'No origin remote or release data for this repository.',
|
|
6012
|
+
compact: true,
|
|
6013
|
+
className: 'ship-lane-empty',
|
|
6014
|
+
});
|
|
6015
|
+
}
|
|
6016
|
+
const counts = { green: 0, red: 0, pending: 0, unknown: 0 };
|
|
6017
|
+
for (const r of rows) {
|
|
6018
|
+
if (Object.prototype.hasOwnProperty.call(counts, r.state)) counts[r.state] += 1;
|
|
6019
|
+
}
|
|
6020
|
+
const summary = [
|
|
6021
|
+
counts.green ? `${counts.green} done` : '',
|
|
6022
|
+
counts.red ? `${counts.red} blocked` : '',
|
|
6023
|
+
counts.pending ? `${counts.pending} pending` : '',
|
|
6024
|
+
counts.unknown ? `${counts.unknown} unknown` : '',
|
|
6025
|
+
].filter(Boolean).join(' · ');
|
|
6026
|
+
const fetched = shipLane.remote?.fetchedAt ? ` · forge read ${fmtDate(shipLane.remote.fetchedAt)}` : '';
|
|
6027
|
+
const items = rows
|
|
6028
|
+
.map((r) => {
|
|
6029
|
+
const tone = shipLaneTone(r.state);
|
|
6030
|
+
const next = r.next && typeof r.next.text === 'string' && r.next.text
|
|
6031
|
+
? `<code class="ship-row-cmd">${escapeHtml(r.next.text)}</code>${shipLaneCopyButton(r.next)}`
|
|
6032
|
+
: '';
|
|
6033
|
+
return `
|
|
6034
|
+
<li class="ship-row is-${tone}">
|
|
6035
|
+
<span class="dot dot-${tone}" aria-hidden="true"></span>
|
|
6036
|
+
<span class="ship-row-label">${escapeHtml(r.label || r.id || '')}</span>
|
|
6037
|
+
<span class="ship-row-state">${escapeHtml(SHIP_LANE_STATE_LABELS[r.state] || 'Unknown')}</span>
|
|
6038
|
+
<span class="ship-row-detail">${escapeHtml(r.detail || '')}</span>
|
|
6039
|
+
<span class="ship-row-next">${next}</span>
|
|
6040
|
+
</li>
|
|
6041
|
+
`;
|
|
6042
|
+
})
|
|
6043
|
+
.join('');
|
|
6044
|
+
const note = shipLane.note ? `<div class="devops-note">${escapeHtml(shipLane.note)}</div>` : '';
|
|
6045
|
+
return `
|
|
6046
|
+
<div class="ship-lane-summary">${escapeHtml(summary)}${escapeHtml(fetched)}</div>
|
|
6047
|
+
${note}
|
|
6048
|
+
<ol class="ship-lane" aria-label="Ship lane rows">${items}</ol>
|
|
6049
|
+
`;
|
|
6050
|
+
}
|
|
6051
|
+
|
|
6052
|
+
/** Tone of one open PR: failing checks or conflicts red, running or behind yellow, clean green. */
|
|
6053
|
+
function shipPrTone(pr) {
|
|
6054
|
+
const checks = pr?.checks || {};
|
|
6055
|
+
if ((checks.failing || []).length || pr?.mergeable === 'conflicting') return 'red';
|
|
6056
|
+
if (checks.pending > 0 || ['behind', 'blocked', 'unstable', 'draft'].includes(pr?.mergeState)) return 'yellow';
|
|
6057
|
+
if (pr?.mergeState === 'clean') return 'green';
|
|
6058
|
+
return 'gray';
|
|
6059
|
+
}
|
|
6060
|
+
|
|
6061
|
+
/** Open PRs card (base, head, stacking, mergeable state, failing checks, signature-scan). */
|
|
6062
|
+
function renderShipLanePrsCard(shipLane) {
|
|
6063
|
+
const remote = shipLane?.remote || null;
|
|
6064
|
+
if (!remote?.available) {
|
|
6065
|
+
return renderEmptyStateCta({
|
|
6066
|
+
headline: 'No pull request signal',
|
|
6067
|
+
support: shipLane?.note || 'Open pull requests are read with gh when the snapshot carries shipLane (1.8.0).',
|
|
6068
|
+
compact: true,
|
|
6069
|
+
className: 'ship-prs-empty',
|
|
6070
|
+
});
|
|
6071
|
+
}
|
|
6072
|
+
const prs = Array.isArray(remote.prs) ? remote.prs : [];
|
|
6073
|
+
if (!prs.length) {
|
|
6074
|
+
return renderEmptyStateCta({
|
|
6075
|
+
headline: 'No open pull requests',
|
|
6076
|
+
support: 'Nothing is waiting for review or merge on the forge.',
|
|
6077
|
+
compact: true,
|
|
6078
|
+
className: 'ship-prs-empty',
|
|
6079
|
+
});
|
|
6080
|
+
}
|
|
6081
|
+
const items = prs
|
|
6082
|
+
.map((pr) => {
|
|
6083
|
+
const tone = shipPrTone(pr);
|
|
6084
|
+
const n = Number(pr.number) || 0;
|
|
6085
|
+
const checks = pr.checks || {};
|
|
6086
|
+
const meta = [
|
|
6087
|
+
String(pr.head || '?') + ' → ' + String(pr.base || '?'),
|
|
6088
|
+
pr.stackedOn ? `stacked on #${Number(pr.stackedOn) || 0}` : '',
|
|
6089
|
+
pr.mergeable === 'conflicting' ? 'conflicts' : (pr.mergeState || ''),
|
|
6090
|
+
(checks.failing || []).length ? `failing: ${checks.failing.join(', ')}` : '',
|
|
6091
|
+
checks.pending ? `${checks.pending} running` : '',
|
|
6092
|
+
checks.signatureScan && checks.signatureScan !== 'missing' ? `signature-scan ${checks.signatureScan}` : '',
|
|
6093
|
+
pr.draft ? 'draft' : '',
|
|
6094
|
+
].filter(Boolean).join(' · ');
|
|
6095
|
+
return `
|
|
6096
|
+
<li class="ship-pr">
|
|
6097
|
+
<span class="dot dot-${tone}" aria-hidden="true"></span>
|
|
6098
|
+
<span class="ship-pr-num">#${n}</span>
|
|
6099
|
+
<span class="ship-pr-title">${escapeHtml(pr.title || '')}</span>
|
|
6100
|
+
<span class="ship-pr-meta">${escapeHtml(meta)}</span>
|
|
6101
|
+
${shipLaneCopyButton({ text: `gh pr checks ${n}`, destination: 'terminal' })}
|
|
6102
|
+
</li>
|
|
6103
|
+
`;
|
|
6104
|
+
})
|
|
6105
|
+
.join('');
|
|
6106
|
+
const total = Number(remote.prsTotal) || prs.length;
|
|
6107
|
+
const more = total > prs.length ? `<div class="devops-note">${escapeHtml(`${total - prs.length} more open, not shown`)}</div>` : '';
|
|
6108
|
+
return `<ul class="ship-prs" aria-label="Unmerged pull requests">${items}</ul>${more}`;
|
|
6109
|
+
}
|
|
6110
|
+
|
|
6111
|
+
/** Nav dot for the merged Git e CI/CD section (see the render call site). */
|
|
6112
|
+
function gitCicdNavTone(d) {
|
|
6113
|
+
const latestRun = (d?.devops?.pipeline?.runs || [])[0] || null;
|
|
6114
|
+
const runFailed = !!latestRun && latestRun.status === 'completed'
|
|
6115
|
+
&& ['failure', 'cancelled', 'timed_out'].includes(latestRun.conclusion);
|
|
6116
|
+
const shipRed = (d?.shipLane?.rows || []).some((r) => r && r.state === 'red');
|
|
6117
|
+
if (runFailed || shipRed) return 'red';
|
|
6118
|
+
const runOpen = !!latestRun && (latestRun.status !== 'completed' || latestRun.conclusion !== 'success');
|
|
6119
|
+
if (d?.git?.dirty || runOpen) return 'yellow';
|
|
6120
|
+
return d?.git?.branch ? 'green' : 'gray';
|
|
6121
|
+
}
|
|
6122
|
+
|
|
6123
|
+
/** One delegated listener for every ship lane copy button (data-only; goes through the copy seam). */
|
|
6124
|
+
document.addEventListener('click', (event) => {
|
|
6125
|
+
const target = event.target;
|
|
6126
|
+
const btn = target && typeof target.closest === 'function' ? target.closest('[data-ship-copy]') : null;
|
|
6127
|
+
if (!btn) return;
|
|
6128
|
+
event.preventDefault();
|
|
6129
|
+
const text = btn.getAttribute('data-ship-copy') || '';
|
|
6130
|
+
if (!text) return;
|
|
6131
|
+
copyForPaste(text, text, btn.getAttribute('data-ship-dest') === 'terminal' ? 'terminal' : 'chatInput');
|
|
6132
|
+
});
|
|
6133
|
+
|
|
5760
6134
|
// ===== Action seam (contract: docs/mission-control-embedding.md) =====
|
|
5761
6135
|
/**
|
|
5762
6136
|
* One action interface, two implementations. Every dashboard action is a typed
|
|
@@ -6457,6 +6831,351 @@ function renderChatsSection(d) {
|
|
|
6457
6831
|
`;
|
|
6458
6832
|
}
|
|
6459
6833
|
|
|
6834
|
+
// ===== Colony (game panel over the snapshot `outcomeLedger`, 1.9.0) =====
|
|
6835
|
+
// ADR 2026-10-23 colony-game-canon-outcome-ledger-art-policy points 1, 4, 6, 8.
|
|
6836
|
+
// Earned totals come only from the ledger; what the player spends, queues and
|
|
6837
|
+
// builds lives in this browser (localStorage), like the skin preference. No
|
|
6838
|
+
// server write, no route, no timer: build timers are startedAt + duration,
|
|
6839
|
+
// evaluated when the panel renders (each snapshot refresh).
|
|
6840
|
+
|
|
6841
|
+
const COLONY_STATE_KEY = 'agent-kit-colony-state-v1';
|
|
6842
|
+
const COLONY_MAP_RADIUS = 4;
|
|
6843
|
+
const COLONY_MAX_ACTIVE_BUILDS = 3;
|
|
6844
|
+
const COLONY_FLOW_STREAK = 3;
|
|
6845
|
+
const COLONY_FLOW_WINDOW_MS = 2 * 60 * 60 * 1000;
|
|
6846
|
+
const COLONY_OVERCLOCK_FACTOR = 0.75;
|
|
6847
|
+
const COLONY_STRUCTURES = Object.freeze([
|
|
6848
|
+
{ id: 'uplink', name: 'IDE-Core Uplink', glyph: 'U', cost: { logic: 0, compute: 3, rare: 0 }, minutes: 60, greens: 2, unique: true, art: '/art/uplink-tower-road.webp', blurb: 'Central command: links the colony to the work you ship. One per map.' },
|
|
6849
|
+
{ id: 'nursery', name: 'Sapling Nursery', glyph: 'N', cost: { logic: 2, compute: 0, rare: 0 }, minutes: 45, greens: 3, unique: false, art: '/art/seed-tree-crane.webp', blurb: 'First green ground around the landing site.' },
|
|
6850
|
+
{ id: 'tundra', name: 'Tundra Reforestation Node', glyph: 'T', cost: { logic: 5, compute: 2, rare: 0 }, minutes: 180, greens: 5, unique: false, art: '/art/rover-frozen-flats.webp', blurb: 'Turns frozen flats green.' },
|
|
6851
|
+
{ id: 'transit', name: 'Levitating Transit Hub', glyph: 'H', cost: { logic: 4, compute: 4, rare: 0 }, minutes: 360, greens: 4, unique: false, art: null, blurb: 'Connects settlements across the map.' },
|
|
6852
|
+
{ id: 'purifier', name: 'Atmospheric Purifier', glyph: 'P', cost: { logic: 10, compute: 6, rare: 1 }, minutes: 720, greens: 8, unique: false, art: '/art/atmospheric-purifier.webp', blurb: 'Vents clean mist and raises the atmosphere meter.' },
|
|
6853
|
+
]);
|
|
6854
|
+
|
|
6855
|
+
/** Axial hex coordinates in spiral order from the landing site (center). */
|
|
6856
|
+
function colonyHexTiles(radius) {
|
|
6857
|
+
const tiles = [{ q: 0, r: 0 }];
|
|
6858
|
+
const dirs = [[1, 0], [1, -1], [0, -1], [-1, 0], [-1, 1], [0, 1]];
|
|
6859
|
+
for (let k = 1; k <= radius; k += 1) {
|
|
6860
|
+
let q = -k;
|
|
6861
|
+
let r = k;
|
|
6862
|
+
for (let side = 0; side < 6; side += 1) {
|
|
6863
|
+
for (let step = 0; step < k; step += 1) {
|
|
6864
|
+
tiles.push({ q, r });
|
|
6865
|
+
q += dirs[side][0];
|
|
6866
|
+
r += dirs[side][1];
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
}
|
|
6870
|
+
return tiles;
|
|
6871
|
+
}
|
|
6872
|
+
|
|
6873
|
+
/** Normalized player state from storage (malformed input -> empty colony). */
|
|
6874
|
+
function parseColonyState(raw) {
|
|
6875
|
+
const empty = { v: 1, seq: 0, queue: [], built: [], spent: { logic: 0, compute: 0, rare: 0 } };
|
|
6876
|
+
if (!raw || typeof raw !== 'object' || raw.v !== 1) return empty;
|
|
6877
|
+
const ids = new Set(COLONY_STRUCTURES.map((s) => s.id));
|
|
6878
|
+
const num = (n) => (Number.isFinite(n) && n >= 0 ? Math.floor(n) : 0);
|
|
6879
|
+
const queue = (Array.isArray(raw.queue) ? raw.queue : [])
|
|
6880
|
+
.filter((b) => b && ids.has(b.structure) && Number.isFinite(b.startedAt) && Number.isFinite(b.durationMs) && b.durationMs > 0)
|
|
6881
|
+
.slice(0, COLONY_MAX_ACTIVE_BUILDS)
|
|
6882
|
+
.map((b) => ({ id: num(b.id), structure: b.structure, startedAt: b.startedAt, durationMs: b.durationMs }));
|
|
6883
|
+
const built = (Array.isArray(raw.built) ? raw.built : [])
|
|
6884
|
+
.filter((b) => b && ids.has(b.structure) && Number.isFinite(b.completedAt))
|
|
6885
|
+
.slice(0, 500)
|
|
6886
|
+
.map((b) => ({ structure: b.structure, completedAt: b.completedAt }));
|
|
6887
|
+
const spent = raw.spent && typeof raw.spent === 'object' ? raw.spent : {};
|
|
6888
|
+
return {
|
|
6889
|
+
v: 1,
|
|
6890
|
+
seq: num(raw.seq),
|
|
6891
|
+
queue,
|
|
6892
|
+
built,
|
|
6893
|
+
spent: { logic: num(spent.logic), compute: num(spent.compute), rare: num(spent.rare) },
|
|
6894
|
+
};
|
|
6895
|
+
}
|
|
6896
|
+
|
|
6897
|
+
function loadColonyState() {
|
|
6898
|
+
try {
|
|
6899
|
+
const raw = localStorage.getItem(COLONY_STATE_KEY);
|
|
6900
|
+
return parseColonyState(raw ? JSON.parse(raw) : null);
|
|
6901
|
+
} catch (e) {
|
|
6902
|
+
return parseColonyState(null);
|
|
6903
|
+
}
|
|
6904
|
+
}
|
|
6905
|
+
|
|
6906
|
+
function saveColonyState(state) {
|
|
6907
|
+
try {
|
|
6908
|
+
localStorage.setItem(COLONY_STATE_KEY, JSON.stringify(state));
|
|
6909
|
+
return true;
|
|
6910
|
+
} catch (e) {
|
|
6911
|
+
return false;
|
|
6912
|
+
}
|
|
6913
|
+
}
|
|
6914
|
+
|
|
6915
|
+
/** Earned totals from the snapshot field (zeros when absent). */
|
|
6916
|
+
function colonyEarned(ledger) {
|
|
6917
|
+
const t = ledger && ledger.totals && typeof ledger.totals === 'object' ? ledger.totals : {};
|
|
6918
|
+
const n = (v) => (Number.isFinite(v) && v >= 0 ? Math.floor(v) : 0);
|
|
6919
|
+
return { logic: n(t.logic), compute: n(t.compute), rare: n(t.rare) };
|
|
6920
|
+
}
|
|
6921
|
+
|
|
6922
|
+
/** Spendable = earned - spent, never below zero. */
|
|
6923
|
+
function colonyWallet(earned, state) {
|
|
6924
|
+
return {
|
|
6925
|
+
logic: Math.max(0, earned.logic - state.spent.logic),
|
|
6926
|
+
compute: Math.max(0, earned.compute - state.spent.compute),
|
|
6927
|
+
rare: Math.max(0, earned.rare - state.spent.rare),
|
|
6928
|
+
};
|
|
6929
|
+
}
|
|
6930
|
+
|
|
6931
|
+
/**
|
|
6932
|
+
* Flow overclock (ADR point 6): an unbroken streak of closed to-dos, the last
|
|
6933
|
+
* one recent. Tuning: COLONY_FLOW_STREAK closes, within COLONY_FLOW_WINDOW_MS.
|
|
6934
|
+
*/
|
|
6935
|
+
function colonyOverclockActive(flow, nowMs) {
|
|
6936
|
+
if (!flow || !Number.isFinite(flow.streak) || flow.streak < COLONY_FLOW_STREAK) return false;
|
|
6937
|
+
const last = Date.parse(flow.lastClosedAt || '');
|
|
6938
|
+
return Number.isFinite(last) && nowMs - last >= 0 && nowMs - last <= COLONY_FLOW_WINDOW_MS;
|
|
6939
|
+
}
|
|
6940
|
+
|
|
6941
|
+
function colonyBuildEndsAt(build, overclock) {
|
|
6942
|
+
return build.startedAt + build.durationMs * (overclock ? COLONY_OVERCLOCK_FACTOR : 1);
|
|
6943
|
+
}
|
|
6944
|
+
|
|
6945
|
+
/**
|
|
6946
|
+
* Lazy settle: queued builds whose time has come move to `built`. Returns the
|
|
6947
|
+
* next state and whether it changed (the caller persists only on change, so a
|
|
6948
|
+
* finished build never flips back when the overclock ends).
|
|
6949
|
+
*/
|
|
6950
|
+
function settleColonyState(state, nowMs, overclock) {
|
|
6951
|
+
const done = [];
|
|
6952
|
+
const queue = [];
|
|
6953
|
+
for (const b of state.queue) {
|
|
6954
|
+
const endsAt = colonyBuildEndsAt(b, overclock);
|
|
6955
|
+
if (nowMs >= endsAt) done.push({ structure: b.structure, completedAt: Math.round(endsAt) });
|
|
6956
|
+
else queue.push(b);
|
|
6957
|
+
}
|
|
6958
|
+
if (done.length === 0) return { state, changed: false };
|
|
6959
|
+
return { state: { ...state, queue, built: [...state.built, ...done] }, changed: true };
|
|
6960
|
+
}
|
|
6961
|
+
|
|
6962
|
+
/** Why a structure cannot be queued now, or null when it can. */
|
|
6963
|
+
function colonyBuildBlocker(structure, state, wallet) {
|
|
6964
|
+
if (!structure) return 'Unknown structure';
|
|
6965
|
+
if (structure.unique && (state.built.some((b) => b.structure === structure.id) || state.queue.some((b) => b.structure === structure.id))) {
|
|
6966
|
+
return 'Already on the map';
|
|
6967
|
+
}
|
|
6968
|
+
if (state.queue.length >= COLONY_MAX_ACTIVE_BUILDS) return 'Build queue full';
|
|
6969
|
+
const c = structure.cost;
|
|
6970
|
+
if (wallet.logic < c.logic || wallet.compute < c.compute || wallet.rare < c.rare) return 'Not enough resources';
|
|
6971
|
+
return null;
|
|
6972
|
+
}
|
|
6973
|
+
|
|
6974
|
+
/** Queue a build: spend its cost and start its timer. Returns the next state or null. */
|
|
6975
|
+
function queueColonyBuild(state, structureId, earned, nowMs) {
|
|
6976
|
+
const structure = COLONY_STRUCTURES.find((s) => s.id === structureId);
|
|
6977
|
+
if (colonyBuildBlocker(structure, state, colonyWallet(earned, state))) return null;
|
|
6978
|
+
const seq = state.seq + 1;
|
|
6979
|
+
return {
|
|
6980
|
+
...state,
|
|
6981
|
+
seq,
|
|
6982
|
+
queue: [...state.queue, { id: seq, structure: structure.id, startedAt: nowMs, durationMs: structure.minutes * 60 * 1000 }],
|
|
6983
|
+
spent: {
|
|
6984
|
+
logic: state.spent.logic + structure.cost.logic,
|
|
6985
|
+
compute: state.spent.compute + structure.cost.compute,
|
|
6986
|
+
rare: state.spent.rare + structure.cost.rare,
|
|
6987
|
+
},
|
|
6988
|
+
};
|
|
6989
|
+
}
|
|
6990
|
+
|
|
6991
|
+
/**
|
|
6992
|
+
* Green tiles: earned outcomes clear ground slowly (square root, so a long
|
|
6993
|
+
* history does not paint the map at once) and on their own reach at most
|
|
6994
|
+
* 60% of the map; finished buildings green the rest. Pure function of the
|
|
6995
|
+
* ledger totals and the built list.
|
|
6996
|
+
*/
|
|
6997
|
+
function colonyGreenTiles(earned, state, tileCount) {
|
|
6998
|
+
const points = earned.logic + earned.compute / 4;
|
|
6999
|
+
const fromLedger = Math.floor(Math.sqrt(points) * 2) + earned.rare;
|
|
7000
|
+
let green = Math.min(Math.floor(tileCount * 0.6), fromLedger);
|
|
7001
|
+
for (const b of state.built) {
|
|
7002
|
+
const s = COLONY_STRUCTURES.find((x) => x.id === b.structure);
|
|
7003
|
+
if (s) green += s.greens;
|
|
7004
|
+
}
|
|
7005
|
+
return Math.max(0, Math.min(tileCount, green));
|
|
7006
|
+
}
|
|
7007
|
+
|
|
7008
|
+
function formatColonyDuration(ms) {
|
|
7009
|
+
const minutes = Math.max(1, Math.ceil(ms / 60000));
|
|
7010
|
+
if (minutes < 60) return `${minutes} min`;
|
|
7011
|
+
const h = Math.floor(minutes / 60);
|
|
7012
|
+
const m = minutes % 60;
|
|
7013
|
+
return m ? `${h} h ${m} min` : `${h} h`;
|
|
7014
|
+
}
|
|
7015
|
+
|
|
7016
|
+
function formatColonyCost(cost) {
|
|
7017
|
+
const parts = [];
|
|
7018
|
+
if (cost.logic) parts.push(`${cost.logic} Logic`);
|
|
7019
|
+
if (cost.compute) parts.push(`${cost.compute} Compute`);
|
|
7020
|
+
if (cost.rare) parts.push(`${cost.rare} Rare`);
|
|
7021
|
+
return parts.join(' · ') || 'Free';
|
|
7022
|
+
}
|
|
7023
|
+
|
|
7024
|
+
/** Hex map SVG. Static geometry and constant glyphs only (no snapshot text). */
|
|
7025
|
+
function renderColonyMapSvg(green, state) {
|
|
7026
|
+
const tiles = colonyHexTiles(COLONY_MAP_RADIUS);
|
|
7027
|
+
const size = 14;
|
|
7028
|
+
const fogFrom = Math.min(tiles.length, green + 12);
|
|
7029
|
+
const placed = [];
|
|
7030
|
+
const uplink = state.built.find((b) => b.structure === 'uplink');
|
|
7031
|
+
if (uplink) placed[0] = 'U';
|
|
7032
|
+
let slot = 1;
|
|
7033
|
+
for (const b of state.built) {
|
|
7034
|
+
if (b.structure === 'uplink') continue;
|
|
7035
|
+
const s = COLONY_STRUCTURES.find((x) => x.id === b.structure);
|
|
7036
|
+
if (s && slot < tiles.length) placed[slot++] = s.glyph;
|
|
7037
|
+
}
|
|
7038
|
+
const corner = (cx, cy, i) => {
|
|
7039
|
+
const a = (Math.PI / 180) * (60 * i - 30);
|
|
7040
|
+
return `${(cx + size * Math.cos(a)).toFixed(1)},${(cy + size * Math.sin(a)).toFixed(1)}`;
|
|
7041
|
+
};
|
|
7042
|
+
const cells = tiles.map((t, i) => {
|
|
7043
|
+
const cx = size * Math.sqrt(3) * (t.q + t.r / 2);
|
|
7044
|
+
const cy = size * 1.5 * t.r;
|
|
7045
|
+
const tileState = i < green ? 'green' : i < fogFrom ? 'barren' : 'fog';
|
|
7046
|
+
const points = [0, 1, 2, 3, 4, 5].map((k) => corner(cx, cy, k)).join(' ');
|
|
7047
|
+
const glyph = placed[i]
|
|
7048
|
+
? `<text class="colony-glyph" x="${cx.toFixed(1)}" y="${(cy + 4).toFixed(1)}" text-anchor="middle">${placed[i]}</text>`
|
|
7049
|
+
: '';
|
|
7050
|
+
return `<polygon class="colony-tile" data-tile="${tileState}" points="${points}"/>${glyph}`;
|
|
7051
|
+
}).join('');
|
|
7052
|
+
const span = size * Math.sqrt(3) * (COLONY_MAP_RADIUS + 0.6);
|
|
7053
|
+
const vb = `${(-span).toFixed(1)} ${(-span).toFixed(1)} ${(span * 2).toFixed(1)} ${(span * 2).toFixed(1)}`;
|
|
7054
|
+
return `<svg class="colony-map" viewBox="${vb}" role="img" aria-label="Colony map: ${green} of ${tiles.length} tiles green">${cells}</svg>`;
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7057
|
+
/** Colony section body. Ledger labels are repo text: escapeHtml / escapeAttr only. */
|
|
7058
|
+
function renderColonySection(d, state, nowMs) {
|
|
7059
|
+
const ledger = d && d.outcomeLedger && typeof d.outcomeLedger === 'object' ? d.outcomeLedger : null;
|
|
7060
|
+
const tileCount = colonyHexTiles(COLONY_MAP_RADIUS).length;
|
|
7061
|
+
const earned = colonyEarned(ledger);
|
|
7062
|
+
const wallet = colonyWallet(earned, state);
|
|
7063
|
+
const overclock = colonyOverclockActive(ledger && ledger.flow, nowMs);
|
|
7064
|
+
const green = colonyGreenTiles(earned, state, tileCount);
|
|
7065
|
+
const title = (subtitle, body) => `
|
|
7066
|
+
<div class="content-section" id="section-colony">
|
|
7067
|
+
<div class="section-title">
|
|
7068
|
+
Colony
|
|
7069
|
+
<span class="section-subtitle">${escapeHtml(subtitle)}</span>
|
|
7070
|
+
</div>
|
|
7071
|
+
${body}
|
|
7072
|
+
</div>
|
|
7073
|
+
`;
|
|
7074
|
+
if (!ledger) {
|
|
7075
|
+
return title('no ledger', renderEmptyStateCta({
|
|
7076
|
+
iconKind: 'colony',
|
|
7077
|
+
headline: 'No outcome ledger in this snapshot',
|
|
7078
|
+
support: 'The Colony grows from the outcome ledger (Mission Control snapshot 1.9.0 or later). Update the kit engine to play.',
|
|
7079
|
+
}));
|
|
7080
|
+
}
|
|
7081
|
+
const res = (label, key) => `
|
|
7082
|
+
<div class="colony-resource">
|
|
7083
|
+
<span class="colony-resource-label">${label}</span>
|
|
7084
|
+
<span class="colony-resource-value">${wallet[key]}</span>
|
|
7085
|
+
<span class="colony-resource-meta">${earned[key]} earned · ${state.spent[key]} spent</span>
|
|
7086
|
+
</div>`;
|
|
7087
|
+
const flow = ledger.flow;
|
|
7088
|
+
const flowText = overclock
|
|
7089
|
+
? `Flow overclock on: streak of ${flow.streak} closed to-dos, builds run 25% faster`
|
|
7090
|
+
: flow && Number.isFinite(flow.streak)
|
|
7091
|
+
? `Flow streak ${flow.streak} (overclock at ${COLONY_FLOW_STREAK} closes in a row, the last within 2 h)`
|
|
7092
|
+
: 'Flow: no closed to-do in a mission yet';
|
|
7093
|
+
const queueRows = state.queue.map((b) => {
|
|
7094
|
+
const s = COLONY_STRUCTURES.find((x) => x.id === b.structure);
|
|
7095
|
+
const endsAt = colonyBuildEndsAt(b, overclock);
|
|
7096
|
+
const left = formatColonyDuration(endsAt - nowMs);
|
|
7097
|
+
const at = new Date(endsAt);
|
|
7098
|
+
const clock = `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`;
|
|
7099
|
+
return `<li class="colony-queue-item"><span class="colony-queue-name">${escapeHtml(s ? s.name : b.structure)}</span><span class="colony-queue-time" title="${escapeAttr(at.toISOString())}">${escapeHtml(`${left} left · ready at ${clock}`)}</span></li>`;
|
|
7100
|
+
}).join('');
|
|
7101
|
+
const queueBlock = `
|
|
7102
|
+
<div class="colony-panel">
|
|
7103
|
+
<div class="colony-panel-title">Build queue <span class="colony-panel-meta">${state.queue.length}/${COLONY_MAX_ACTIVE_BUILDS}</span></div>
|
|
7104
|
+
${queueRows ? `<ul class="colony-queue">${queueRows}</ul>` : '<p class="colony-note">Nothing under construction. Timers are read when this panel refreshes; nothing runs in the background.</p>'}
|
|
7105
|
+
</div>`;
|
|
7106
|
+
const cards = COLONY_STRUCTURES.map((s) => {
|
|
7107
|
+
const blocker = colonyBuildBlocker(s, state, wallet);
|
|
7108
|
+
const count = state.built.filter((b) => b.structure === s.id).length;
|
|
7109
|
+
const art = s.art
|
|
7110
|
+
? `<img class="colony-card-art" src="${escapeAttr(s.art)}" alt="" loading="lazy" decoding="async">`
|
|
7111
|
+
: '<div class="colony-card-art colony-card-art-none" aria-hidden="true"></div>';
|
|
7112
|
+
return `
|
|
7113
|
+
<div class="colony-card">
|
|
7114
|
+
${art}
|
|
7115
|
+
<div class="colony-card-body">
|
|
7116
|
+
<div class="colony-card-name">${escapeHtml(s.name)}${count ? ` <span class="colony-panel-meta">×${count}</span>` : ''}</div>
|
|
7117
|
+
<p class="colony-card-blurb">${escapeHtml(s.blurb)}</p>
|
|
7118
|
+
<div class="colony-card-meta">${escapeHtml(`${formatColonyCost(s.cost)} · ${formatColonyDuration(s.minutes * 60000)}`)}</div>
|
|
7119
|
+
<button type="button" class="process-copy-btn colony-build-btn" data-colony-build="${escapeAttr(s.id)}"${blocker ? ` disabled title="${escapeAttr(blocker)}"` : ` title="${escapeAttr(`Spend ${formatColonyCost(s.cost)} and start building`)}"`} aria-label="${escapeAttr(`Build ${s.name}`)}">${blocker ? escapeHtml(blocker) : 'Build'}</button>
|
|
7120
|
+
</div>
|
|
7121
|
+
</div>`;
|
|
7122
|
+
}).join('');
|
|
7123
|
+
const recent = (Array.isArray(ledger.recent) ? ledger.recent : []).slice(0, 6).map((e) => {
|
|
7124
|
+
const kindLabel = { todo: 'To-do done', test: 'Tests passed', ci: 'CI passed', releaseCut: 'Release cut', plan: 'Plan closed', review: 'Clean review', releasePublished: 'Release published' }[e && e.kind] || 'Outcome';
|
|
7125
|
+
return `<li class="colony-log-item"><span class="colony-log-kind">${escapeHtml(kindLabel)}</span><span class="colony-log-label" title="${escapeAttr(String(e.label || ''))}">${escapeHtml(String(e.label || ''))}</span></li>`;
|
|
7126
|
+
}).join('');
|
|
7127
|
+
const skipped = ledger.available === false
|
|
7128
|
+
? '<p class="colony-note">The ledger was not read on this refresh (snapshot budget); totals come back on the next one.</p>'
|
|
7129
|
+
: '';
|
|
7130
|
+
const emptyNote = ledger.available !== false && ledger.entries === 0
|
|
7131
|
+
? '<p class="colony-note">Nothing earned yet. Close a to-do, pass the tests (agent-kit outcome-ledger test) or ship a green CI run and the ground starts to turn.</p>'
|
|
7132
|
+
: '';
|
|
7133
|
+
const body = `
|
|
7134
|
+
<div class="colony-layout">
|
|
7135
|
+
<div class="colony-map-wrap">
|
|
7136
|
+
${renderColonyMapSvg(green, state)}
|
|
7137
|
+
<p class="colony-note">${escapeHtml(flowText)}</p>
|
|
7138
|
+
${emptyNote}${skipped}
|
|
7139
|
+
</div>
|
|
7140
|
+
<div class="colony-side">
|
|
7141
|
+
<div class="colony-resources">${res('Logic', 'logic')}${res('Compute', 'compute')}${res('Rare', 'rare')}</div>
|
|
7142
|
+
${queueBlock}
|
|
7143
|
+
<div class="colony-panel">
|
|
7144
|
+
<div class="colony-panel-title">Ship log</div>
|
|
7145
|
+
${recent ? `<ul class="colony-log">${recent}</ul>` : '<p class="colony-note">No outcomes yet.</p>'}
|
|
7146
|
+
</div>
|
|
7147
|
+
</div>
|
|
7148
|
+
</div>
|
|
7149
|
+
<div class="colony-cards">${cards}</div>
|
|
7150
|
+
<p class="colony-note">Resources come only from verified outcomes in the ledger, never from lines of code, commits or time. What you build is kept in this browser.</p>`;
|
|
7151
|
+
return title(`${green} of ${tileCount} tiles green`, body);
|
|
7152
|
+
}
|
|
7153
|
+
|
|
7154
|
+
/** Settle finished builds before render (persist only on change). */
|
|
7155
|
+
function colonyStateForRender(d, nowMs) {
|
|
7156
|
+
const loaded = loadColonyState();
|
|
7157
|
+
const flow = d && d.outcomeLedger ? d.outcomeLedger.flow : null;
|
|
7158
|
+
const { state, changed } = settleColonyState(loaded, nowMs, colonyOverclockActive(flow, nowMs));
|
|
7159
|
+
if (changed) saveColonyState(state);
|
|
7160
|
+
return state;
|
|
7161
|
+
}
|
|
7162
|
+
|
|
7163
|
+
function wireColonyButtons() {
|
|
7164
|
+
document.querySelectorAll('.colony-build-btn[data-colony-build]').forEach((btn) => {
|
|
7165
|
+
btn.addEventListener('click', (e) => {
|
|
7166
|
+
e.stopPropagation();
|
|
7167
|
+
if (btn.disabled || !data) return;
|
|
7168
|
+
const now = Date.now();
|
|
7169
|
+
const next = queueColonyBuild(colonyStateForRender(data, now), btn.dataset.colonyBuild, colonyEarned(data.outcomeLedger), now);
|
|
7170
|
+
if (next && saveColonyState(next)) render();
|
|
7171
|
+
});
|
|
7172
|
+
});
|
|
7173
|
+
// The panel works with no image at all: hide art a host cannot serve.
|
|
7174
|
+
document.querySelectorAll('img.colony-card-art').forEach((img) => {
|
|
7175
|
+
img.addEventListener('error', () => { img.hidden = true; }, { once: true });
|
|
7176
|
+
});
|
|
7177
|
+
}
|
|
7178
|
+
|
|
6460
7179
|
function wireChatResumeButtons() {
|
|
6461
7180
|
document.querySelectorAll('.chat-resume-btn[data-chat-resume]').forEach((btn) => {
|
|
6462
7181
|
btn.addEventListener('click', (e) => {
|
|
@@ -7252,7 +7971,7 @@ function nowMetaIconSvg(kind, opts) {
|
|
|
7252
7971
|
* features >= 1 unit. Detail that cannot meet the floor is drawn filled
|
|
7253
7972
|
* (fill="currentColor" stroke="none"), never as a sub-stroke stroked shape.
|
|
7254
7973
|
* Static path markup only; never concatenate untrusted text into the SVG.
|
|
7255
|
-
* @param {'current-mission'|'monitor'|'field-report'|'checklist'|'more-sections'|'overview'|'plans'|'activity'|'agents'|'skills'|'skins'|'commands'|'health'|'git'|'devops'|'memory'|'terminals'|'chats'|'processes'|'config'} kind
|
|
7974
|
+
* @param {'current-mission'|'monitor'|'field-report'|'checklist'|'more-sections'|'overview'|'plans'|'activity'|'agents'|'skills'|'skins'|'commands'|'health'|'git'|'devops'|'memory'|'terminals'|'chats'|'colony'|'processes'|'config'} kind
|
|
7256
7975
|
* @param {{ decorative?: boolean }} [opts] decorative true (default): aria-hidden next to a visible label.
|
|
7257
7976
|
* decorative false: role=img + aria-label + title for icon-only controls (e.g. more-sections).
|
|
7258
7977
|
*/
|
|
@@ -7278,6 +7997,7 @@ function spaceIconSvg(kind, opts) {
|
|
|
7278
7997
|
memory: 'Memory',
|
|
7279
7998
|
terminals: 'Terminals',
|
|
7280
7999
|
chats: 'Chats',
|
|
8000
|
+
colony: 'Colony',
|
|
7281
8001
|
processes: 'Processes',
|
|
7282
8002
|
config: 'Config',
|
|
7283
8003
|
};
|
|
@@ -7361,6 +8081,10 @@ function spaceIconSvg(kind, opts) {
|
|
|
7361
8081
|
// Speech bubble (chats) — Feather message-square on the 16 grid
|
|
7362
8082
|
chats:
|
|
7363
8083
|
'<path d="M14 10a1.5 1.5 0 01-1.5 1.5H5L2 14.5v-11A1.5 1.5 0 013.5 2h9A1.5 1.5 0 0114 3.5z"/>',
|
|
8084
|
+
// Hexagon with a sprout (colony)
|
|
8085
|
+
colony:
|
|
8086
|
+
'<path d="M8 1.75l5.5 3.125v6.25L8 14.25l-5.5-3.125v-6.25z"/>' +
|
|
8087
|
+
'<path d="M8 11V7.5M8 8.5c0-1.25 1-2 2.25-2M8 9.25c0-1-.85-1.75-2-1.75"/>',
|
|
7364
8088
|
// Layers (processes)
|
|
7365
8089
|
processes:
|
|
7366
8090
|
'<path d="M8 2.5l6 3-6 3-6-3 6-3z"/>' +
|
|
@@ -7514,11 +8238,11 @@ function renderFlightLogCard(entry, idx) {
|
|
|
7514
8238
|
variant === 'current'
|
|
7515
8239
|
? `flight-log-card flight-log-card-current ${kindClass}`
|
|
7516
8240
|
: `flight-log-card flight-log-card-past ${kindClass}`;
|
|
7517
|
-
const aria = `${label}: ${text}`;
|
|
8241
|
+
const aria = `${label}: ${stripInlineMarkdown(text)}`;
|
|
7518
8242
|
return `
|
|
7519
8243
|
<div class="${cardClass}" role="listitem" tabindex="0" data-focus-key="flight-log-${variant}-${idx}" data-flight-log-kind="${escapeAttr(kind)}" aria-label="${escapeAttr(aria)}">
|
|
7520
8244
|
<span class="flight-log-card-label">${escapeHtml(label)}</span>
|
|
7521
|
-
<div class="flight-log-card-text">${
|
|
8245
|
+
<div class="flight-log-card-text">${inlineMarkdownHtml(text)}</div>
|
|
7522
8246
|
<div class="flight-log-card-meta">${metaBits.join(' · ')}</div>
|
|
7523
8247
|
<div class="flight-log-card-actions">
|
|
7524
8248
|
<button type="button" class="status-bar-btn" data-focus-key="flight-log-action-${variant}-${idx}" onclick="${copyActionHandler}" style="font-size:11px;padding:3px 10px" title="${escapeAttr(copyActionTitle('fix prompt', 'chatInput'))}">${escapeHtml(actionLabel)}</button>
|
|
@@ -7557,11 +8281,11 @@ function renderFlightLogWarningCard(warning, idx) {
|
|
|
7557
8281
|
? action.command
|
|
7558
8282
|
: `${kind === 'api_limit' ? 'Resume after this quota pause:' : 'Act on this heads-up:'}\n${text}\n${sourcePath}`;
|
|
7559
8283
|
const copyActionHandler = copyForPasteHandler(actionCommand, actionSubject, 'chatInput');
|
|
7560
|
-
const aria = `${title}: ${text}`;
|
|
8284
|
+
const aria = `${title}: ${stripInlineMarkdown(text)}`;
|
|
7561
8285
|
return `
|
|
7562
8286
|
<div class="flight-log-card flight-log-card-warning" role="listitem" tabindex="0" data-focus-key="flight-log-warning-${idx}" data-warning-kind="${escapeAttr(kind)}" aria-label="${escapeAttr(aria)}">
|
|
7563
8287
|
<span class="flight-log-card-label">${escapeHtml(title)}</span>
|
|
7564
|
-
<div class="flight-log-card-text">${
|
|
8288
|
+
<div class="flight-log-card-text">${inlineMarkdownHtml(text)}</div>
|
|
7565
8289
|
<div class="flight-log-card-meta">${escapeHtml(sourcePath)}</div>
|
|
7566
8290
|
<div class="flight-log-card-actions">
|
|
7567
8291
|
<button type="button" class="status-bar-btn" data-focus-key="flight-log-warning-action-${idx}" onclick="${copyActionHandler}" style="font-size:11px;padding:3px 10px" title="${escapeAttr(copyActionTitle(actionSubject, 'chatInput'))}">${escapeHtml(actionLabel)}</button>
|
|
@@ -7644,12 +8368,12 @@ function renderFlightLogTicketCard(ticket, idx) {
|
|
|
7644
8368
|
);
|
|
7645
8369
|
if (typeof ticket?.url === 'string' && /^https?:\/\//.test(ticket.url)) metaBits.push(escapeHtml(ticket.url));
|
|
7646
8370
|
const triage = typeof ticket?.triage === 'string' && ticket.triage.trim() ? ticket.triage.trim() : '';
|
|
7647
|
-
const aria = `${title} ${stamp}: ${text}`;
|
|
8371
|
+
const aria = `${title} ${stamp}: ${stripInlineMarkdown(text)}`;
|
|
7648
8372
|
const kindClass = flightLogKindClassName('prompt');
|
|
7649
8373
|
return `
|
|
7650
8374
|
<div class="flight-log-card flight-log-card-current flight-log-card-ticket ${kindClass}" role="listitem" tabindex="0" data-focus-key="flight-log-ticket-${idx}" data-flight-log-kind="prompt" data-ticket-stamp="${escapeAttr(stamp)}" aria-label="${escapeAttr(aria)}">
|
|
7651
8375
|
<span class="flight-log-card-label">${escapeHtml(title)} · ${escapeHtml(stamp)}</span>
|
|
7652
|
-
<div class="flight-log-card-text">${
|
|
8376
|
+
<div class="flight-log-card-text">${inlineMarkdownHtml(text)}</div>
|
|
7653
8377
|
<div class="flight-log-card-meta">${metaBits.join(' · ')}</div>
|
|
7654
8378
|
${triage ? `<div class="flight-log-card-code">${escapeHtml(triage)}</div>` : ''}
|
|
7655
8379
|
</div>
|
|
@@ -8320,31 +9044,12 @@ function renderUnsafe() {
|
|
|
8320
9044
|
const healthDot = document.getElementById('navHealthDot');
|
|
8321
9045
|
healthDot.className = `dot dot-${health.status === 'ok' ? 'green' : health.status === 'warning' ? 'yellow' : 'red'}`;
|
|
8322
9046
|
|
|
8323
|
-
// Git nav dot
|
|
9047
|
+
// Git e CI/CD nav dot (Git and DevOps merged): red when the latest pipeline
|
|
9048
|
+
// run failed/cancelled/timed out or a ship lane row is red; yellow when the
|
|
9049
|
+
// tree is dirty or the latest run is in progress / non-success; green on a
|
|
9050
|
+
// clean branch; gray without a Git signal.
|
|
8324
9051
|
const gitDot = document.getElementById('navGitDot');
|
|
8325
|
-
if (
|
|
8326
|
-
gitDot.className = 'dot dot-yellow';
|
|
8327
|
-
} else if (d.git?.branch) {
|
|
8328
|
-
gitDot.className = 'dot dot-green';
|
|
8329
|
-
}
|
|
8330
|
-
|
|
8331
|
-
// DevOps nav dot: state of the most recent pipeline run only (gray = no
|
|
8332
|
-
// signal / gh unavailable, green = latest run succeeded, yellow = latest
|
|
8333
|
-
// run in progress or non-success conclusion other than a hard failure,
|
|
8334
|
-
// red = latest run failed/cancelled/timed out).
|
|
8335
|
-
const devopsDot = document.getElementById('navDevopsDot');
|
|
8336
|
-
const latestRun = (d.devops?.pipeline?.runs || [])[0] || null;
|
|
8337
|
-
if (!latestRun) {
|
|
8338
|
-
devopsDot.className = 'dot dot-gray';
|
|
8339
|
-
} else if (latestRun.status !== 'completed') {
|
|
8340
|
-
devopsDot.className = 'dot dot-yellow';
|
|
8341
|
-
} else if (latestRun.conclusion === 'success') {
|
|
8342
|
-
devopsDot.className = 'dot dot-green';
|
|
8343
|
-
} else if (['failure', 'cancelled', 'timed_out'].includes(latestRun.conclusion)) {
|
|
8344
|
-
devopsDot.className = 'dot dot-red';
|
|
8345
|
-
} else {
|
|
8346
|
-
devopsDot.className = 'dot dot-yellow';
|
|
8347
|
-
}
|
|
9052
|
+
if (gitDot) gitDot.className = `dot dot-${gitCicdNavTone(d)}`;
|
|
8348
9053
|
|
|
8349
9054
|
// Terminals / processes nav items carry count badges only (no decorative dots).
|
|
8350
9055
|
|
|
@@ -8714,11 +9419,20 @@ function renderUnsafe() {
|
|
|
8714
9419
|
`);
|
|
8715
9420
|
|
|
8716
9421
|
// ===== Git =====
|
|
9422
|
+
// Git e CI/CD (ADR 2026-10-23 git-cicd-tab-read-in-mc-act-in-colony): the
|
|
9423
|
+
// former Git and DevOps tabs on one bento grid, led by the Ship lane card.
|
|
9424
|
+
// Read-only and copy-only; `#devops` and `#git-cicd` alias here
|
|
9425
|
+
// (SECTION_ALIASES). DevOps stays distinct from Processes (local ps only):
|
|
9426
|
+
// CI/CD runs + an honestly-scoped deploy-activity proxy, no fabricated
|
|
9427
|
+
// service-health widgets for infra this dashboard does not poll.
|
|
9428
|
+
const devopsPipelineRuns = d.devops?.pipeline?.runs || [];
|
|
9429
|
+
const devopsRunCount = devopsPipelineRuns.length;
|
|
9430
|
+
const gitBranchHidden = d.git?.branch ? '' : ' hidden';
|
|
8717
9431
|
parts.push(`
|
|
8718
9432
|
<div class="content-section" id="section-git">
|
|
8719
9433
|
<div class="section-title">
|
|
8720
|
-
Git
|
|
8721
|
-
<span class="section-subtitle">${escapeHtml(d.git?.branch || '\u2014')}${d.git?.branch ? (d.git?.dirty ? ` · ${d.git.dirtyCount} changed` : ' · clean') : ''}</span>
|
|
9434
|
+
Git e CI/CD
|
|
9435
|
+
<span class="section-subtitle">${escapeHtml(d.git?.branch || '\u2014')}${d.git?.branch ? (d.git?.dirty ? ` · ${d.git.dirtyCount} changed` : ' · clean') : ''} · ${devopsRunCount} pipeline run${devopsRunCount !== 1 ? 's' : ''}</span>
|
|
8722
9436
|
</div>
|
|
8723
9437
|
${!d.git?.branch
|
|
8724
9438
|
? renderEmptyStateCta({
|
|
@@ -8726,39 +9440,39 @@ function renderUnsafe() {
|
|
|
8726
9440
|
support: 'No Git data available.',
|
|
8727
9441
|
})
|
|
8728
9442
|
: ''}
|
|
8729
|
-
<div class="
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
9443
|
+
<div class="bento" aria-label="Git e CI/CD">
|
|
9444
|
+
<section class="card bento-tile bento-ship" aria-label="Ship lane">
|
|
9445
|
+
<div class="git-graph-title">Ship lane</div>
|
|
9446
|
+
${renderShipLaneCard(d.shipLane)}
|
|
9447
|
+
</section>
|
|
9448
|
+
<section class="card bento-tile bento-flow" aria-label="Promotion flow"${gitBranchHidden}>
|
|
9449
|
+
${renderGitHygieneHint(d.git)}
|
|
9450
|
+
<div class="git-graph-title">Promotion flow</div>
|
|
9451
|
+
${renderGitFlowCard(d.git)}
|
|
9452
|
+
<div class="git-info">
|
|
9453
|
+
<div class="git-row">
|
|
9454
|
+
<span class="git-label">Last commit</span>
|
|
9455
|
+
<span class="git-value">${escapeHtml(d.git?.lastCommit || '\u2014')}</span>
|
|
9456
|
+
</div>
|
|
8736
9457
|
</div>
|
|
8737
|
-
</
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
<span class="section-subtitle">${devopsRunCount} pipeline run${devopsRunCount !== 1 ? 's' : ''}</span>
|
|
8756
|
-
</div>
|
|
8757
|
-
<div class="card">
|
|
8758
|
-
<div class="git-graph-title">CI/CD pipeline</div>
|
|
8759
|
-
${renderDevopsPipelineCard(d.devops)}
|
|
8760
|
-
<div class="git-graph-title">Deploy activity</div>
|
|
8761
|
-
${renderDevopsDeployCard(d.devops)}
|
|
9458
|
+
</section>
|
|
9459
|
+
<section class="card bento-tile bento-prs" aria-label="Unmerged pull requests">
|
|
9460
|
+
<div class="git-graph-title">Open pull requests</div>
|
|
9461
|
+
${renderShipLanePrsCard(d.shipLane)}
|
|
9462
|
+
</section>
|
|
9463
|
+
<section class="card bento-tile bento-pipeline" aria-label="CI/CD pipeline">
|
|
9464
|
+
<div class="git-graph-title">CI/CD pipeline</div>
|
|
9465
|
+
${renderDevopsPipelineCard(d.devops)}
|
|
9466
|
+
</section>
|
|
9467
|
+
<section class="card bento-tile bento-deploy" aria-label="Deploy activity">
|
|
9468
|
+
<div class="git-graph-title">Deploy activity</div>
|
|
9469
|
+
${renderDevopsDeployCard(d.devops)}
|
|
9470
|
+
</section>
|
|
9471
|
+
<section class="card bento-tile bento-graph" aria-label="Branch graph"${gitBranchHidden}>
|
|
9472
|
+
<div class="bento-pane">${renderGitGraphCard(d.git)}</div>
|
|
9473
|
+
<div class="bento-pane">${renderGitVisualTree(d.git)}</div>
|
|
9474
|
+
</section>
|
|
9475
|
+
${d.git?.dirty ? `<section class="card bento-tile bento-files" aria-label="Changed files">${renderGitFileList(d.git)}</section>` : ''}
|
|
8762
9476
|
</div>
|
|
8763
9477
|
</div>
|
|
8764
9478
|
`);
|
|
@@ -8889,6 +9603,10 @@ function renderUnsafe() {
|
|
|
8889
9603
|
// ===== Chats =====
|
|
8890
9604
|
parts.push(renderChatsSection(d));
|
|
8891
9605
|
|
|
9606
|
+
// ===== Colony =====
|
|
9607
|
+
const colonyNow = Date.now();
|
|
9608
|
+
parts.push(renderColonySection(d, colonyStateForRender(d, colonyNow), colonyNow));
|
|
9609
|
+
|
|
8892
9610
|
// ===== Processes =====
|
|
8893
9611
|
const processes = d.processes || [];
|
|
8894
9612
|
// Detached audit-session visibility (phase3): host-wide agent-kit-audit-* PTYs.
|
|
@@ -9052,6 +9770,7 @@ function renderUnsafe() {
|
|
|
9052
9770
|
|
|
9053
9771
|
wireTerminalExpandButtons();
|
|
9054
9772
|
wireChatResumeButtons();
|
|
9773
|
+
wireColonyButtons();
|
|
9055
9774
|
|
|
9056
9775
|
updateTransportChrome();
|
|
9057
9776
|
|