@njeybe/nativ 2.5.1 → 2.7.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/CHANGELOG.md +67 -0
- package/README.md +100 -5
- package/dist/commands/design-check.d.ts +4 -0
- package/dist/commands/design-check.js +76 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +55 -11
- package/dist/commands/notify.d.ts +2 -0
- package/dist/commands/notify.js +25 -0
- package/dist/commands/session.d.ts +22 -0
- package/dist/commands/session.js +106 -0
- package/dist/commands/task/task-add.js +1 -1
- package/dist/commands/task/task-common.js +6 -6
- package/dist/commands/task/task-escalate.js +8 -10
- package/dist/commands/task/task-lifecycle.d.ts +7 -1
- package/dist/commands/task/task-lifecycle.js +30 -5
- package/dist/commands/task/task-query.d.ts +2 -0
- package/dist/commands/task/task-query.js +27 -12
- package/dist/commands/task/task-reclaim.d.ts +20 -0
- package/dist/commands/task/task-reclaim.js +87 -0
- package/dist/commands/task.d.ts +2 -0
- package/dist/commands/task.js +1 -0
- package/dist/commands/triage.js +3 -3
- package/dist/commands/update.js +46 -0
- package/dist/commands/validate.js +1 -0
- package/dist/commands/verify.js +21 -5
- package/dist/core/design-rules.d.ts +23 -0
- package/dist/core/design-rules.js +115 -0
- package/dist/core/enforcement.js +18 -17
- package/dist/core/harness-integrity.js +26 -7
- package/dist/core/lock-manager.d.ts +6 -0
- package/dist/core/lock-manager.js +50 -41
- package/dist/core/notify.d.ts +38 -0
- package/dist/core/notify.js +133 -0
- package/dist/core/profiles.js +7 -16
- package/dist/core/session-memory.d.ts +42 -0
- package/dist/core/session-memory.js +121 -0
- package/dist/core/setup/pm-playbook.d.ts +5 -0
- package/dist/core/setup/pm-playbook.js +26 -0
- package/dist/core/setup/session-context.js +35 -2
- package/dist/core/setup/setup-planner.js +2 -2
- package/dist/core/setup/types.d.ts +2 -0
- package/dist/core/setup/types.js +5 -1
- package/dist/core/task-claims.d.ts +15 -0
- package/dist/core/task-claims.js +32 -0
- package/dist/core/tier1-liaison.d.ts +1 -0
- package/dist/core/tier1-liaison.js +25 -27
- package/dist/core/verifier/output-digest.d.ts +19 -0
- package/dist/core/verifier/output-digest.js +48 -0
- package/dist/db/data-engine.js +33 -32
- package/dist/db/introspector.js +61 -60
- package/dist/db/sqlite.d.ts +3 -0
- package/dist/db/sqlite.js +10 -0
- package/dist/governor/circuit-breaker.js +12 -0
- package/dist/governor/patch-applier.d.ts +1 -0
- package/dist/governor/patch-applier.js +3 -7
- package/dist/index.js +40 -6
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +53 -14
- package/dist/providers/claude-api.js +3 -0
- package/dist/providers/gemini.js +4 -1
- package/dist/providers/registry.d.ts +6 -2
- package/dist/providers/registry.js +28 -16
- package/dist/providers/types.d.ts +4 -1
- package/dist/runner/agent-supervisor.js +2 -2
- package/dist/runner/cli-config.js +1 -1
- package/dist/scanner/types.d.ts +5 -1
- package/dist/scanner/types.js +7 -0
- package/dist/server/routes/task-routes.d.ts +2 -0
- package/dist/server/routes/triage-routes.js +3 -18
- package/dist/server/studio-ui/pages/benchmarks/styles.js +8 -5
- package/dist/server/studio-ui/pages/database/browser.js +1 -1
- package/dist/server/studio-ui/pages/database/connection.js +1 -1
- package/dist/server/studio-ui/pages/database/data-shell.js +5 -5
- package/dist/server/studio-ui/pages/database/drift.js +1 -1
- package/dist/server/studio-ui/pages/database/explorer.js +2 -2
- package/dist/server/studio-ui/pages/database/styles.js +5 -5
- package/dist/server/studio-ui/pages/flow/styles.js +3 -3
- package/dist/server/studio-ui/pages/home/script.js +110 -91
- package/dist/server/studio-ui/pages/home/styles.js +33 -45
- package/dist/server/studio-ui/pages/tasks/script.js +150 -3
- package/dist/server/studio-ui/pages/tasks/styles.js +63 -6
- package/dist/server/studio-ui/pages/team/script.js +49 -52
- package/dist/server/studio-ui/pages/team/styles.js +21 -20
- package/dist/server/studio-ui/pages/worktrees/script.js +47 -35
- package/dist/server/studio-ui/pages/worktrees/styles.js +12 -10
- package/dist/server/studio-ui/shell/brand.d.ts +4 -0
- package/dist/server/studio-ui/shell/brand.js +16 -0
- package/dist/server/studio-ui/shell/console.js +61 -2
- package/dist/server/studio-ui/shell/core.js +8 -8
- package/dist/server/studio-ui/shell/detail-view.js +1 -1
- package/dist/server/studio-ui/shell/dispatch.js +18 -0
- package/dist/server/studio-ui/shell/events-tools.js +5 -1
- package/dist/server/studio-ui/shell/format.js +5 -6
- package/dist/server/studio-ui/shell/icons.js +23 -15
- package/dist/server/studio-ui/shell/markup-head.js +11 -6
- package/dist/server/studio-ui/shell/markup-tools.js +19 -10
- package/dist/server/studio-ui/shell/paint.js +3 -0
- package/dist/server/studio-ui/shell/pipeline-state.js +1 -1
- package/dist/server/studio-ui/shell/proposals.js +6 -2
- package/dist/server/studio-ui/shell/pulse.d.ts +1 -0
- package/dist/server/studio-ui/shell/pulse.js +67 -0
- package/dist/server/studio-ui/shell/router.js +25 -0
- package/dist/server/studio-ui/shell/sidebar-view.js +6 -3
- package/dist/server/studio-ui/shell/toasts-format.js +4 -4
- package/dist/server/studio-ui/styles/console.js +33 -13
- package/dist/server/studio-ui/styles/dialogs.js +4 -4
- package/dist/server/studio-ui/styles/responsive.js +8 -0
- package/dist/server/studio-ui/styles/shell.js +24 -5
- package/dist/server/studio-ui/styles/strategist.js +10 -10
- package/dist/server/studio-ui/styles/tokens-base.js +23 -23
- package/dist/server/studio-ui.js +2 -0
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/architect.md +11 -12
- package/plugin/agents/explorer.md +1 -1
- package/plugin/agents/verifier.md +2 -2
- package/plugin/agents/worker.md +5 -7
- package/plugin/skills/nativ/SKILL.md +36 -49
- package/templates/AGENTS.md +36 -49
- package/templates/CLAUDE.md +1 -41
- package/templates/GEMINI.md +3 -2
- package/templates/claude-agents/architect.md +11 -12
- package/templates/claude-agents/explorer.md +1 -1
- package/templates/claude-agents/verifier.md +2 -2
- package/templates/claude-agents/worker.md +5 -7
- package/templates/design/taste/LICENSE +21 -0
- package/templates/design/taste/SOURCE.md +28 -0
- package/templates/design/taste/v1/DIGEST.md +57 -0
- package/templates/design/taste/v1/SKILL.md +226 -0
- package/templates/design/taste/v2/DIGEST.md +62 -0
- package/templates/design/taste/v2/SKILL.md +1206 -0
- package/templates/dot-ai/api_contracts.json +66 -66
- package/templates/dot-ai/context.md +38 -38
- package/templates/dot-ai/db_schema.json +39 -39
- package/templates/dot-ai/subagents/architect.md +6 -0
- package/templates/dot-ai/subagents/flutter-developer.md +2 -11
- package/templates/dot-ai/subagents/frontend.md +47 -44
- package/templates/dot-ai/ui_specs.md +15 -36
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Board and history styles, scoped under the Tasks panel.
|
|
1
|
+
// List, Board and history styles, scoped under the Tasks panel (Ink: 6px radius, 1px dividers).
|
|
2
2
|
export const tasksCss = String.raw `#panel-tasks .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
|
|
3
|
-
#panel-tasks .col { background: var(--surface-2); border-radius:
|
|
3
|
+
#panel-tasks .col { background: var(--surface-2); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
|
4
4
|
#panel-tasks .col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 2px; font-weight: 500; font-size: 13px; }
|
|
5
5
|
#panel-tasks .col-head .count { margin-left: auto; background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--fg-2); }
|
|
6
|
-
#panel-tasks .col-empty { font-size: 12.5px; color: var(--fg-3); padding: 14px 8px; text-align: center; border: 1px dashed var(--line-2); border-radius:
|
|
7
|
-
#panel-tasks .tcard { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius:
|
|
8
|
-
#panel-tasks .tcard:hover { border-color: var(--line-2);
|
|
6
|
+
#panel-tasks .col-empty { font-size: 12.5px; color: var(--fg-3); padding: 14px 8px; text-align: center; border: 1px dashed var(--line-2); border-radius: 6px; }
|
|
7
|
+
#panel-tasks .tcard { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px; text-align: left; width: 100%; cursor: pointer; }
|
|
8
|
+
#panel-tasks .tcard:hover { border-color: var(--line-2); }
|
|
9
9
|
#panel-tasks .tcard.in_progress { border-color: color-mix(in srgb, var(--run) 45%, var(--line)); }
|
|
10
10
|
#panel-tasks .tcard.blocked { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
|
|
11
11
|
#panel-tasks .tcard .l1 { display: flex; align-items: center; gap: 6px; }
|
|
@@ -17,7 +17,7 @@ export const tasksCss = String.raw `#panel-tasks .board { display: grid; grid-te
|
|
|
17
17
|
#panel-tasks .more { border: 0; background: none; color: var(--accent); font-size: 12.5px; padding: 6px; cursor: pointer; text-align: center; }
|
|
18
18
|
#panel-tasks .more:hover { text-decoration: underline; }
|
|
19
19
|
#panel-tasks .section-title { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
|
|
20
|
-
#panel-tasks .hist { background: var(--surface); border: 1px solid var(--line); border-radius:
|
|
20
|
+
#panel-tasks .hist { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
|
|
21
21
|
#panel-tasks .hist-row { display: grid; grid-template-columns: 16px 34px minmax(0, 1fr) auto 70px 90px 60px; gap: 12px; align-items: center; padding: 9px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%; cursor: pointer; }
|
|
22
22
|
#panel-tasks .hist > div:first-child .hist-row { border-top: 0; }
|
|
23
23
|
#panel-tasks .hist-row:hover { background: var(--surface-2); }
|
|
@@ -28,6 +28,63 @@ export const tasksCss = String.raw `#panel-tasks .board { display: grid; grid-te
|
|
|
28
28
|
#panel-tasks .hist-row .small { font-size: 12px; }
|
|
29
29
|
#panel-tasks .hist-tasks { background: var(--surface-2); }
|
|
30
30
|
#panel-tasks .hist-tasks .row-btn { padding-left: 46px; }
|
|
31
|
+
#panel-tasks .tbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
|
32
|
+
#panel-tasks .tfilters, #panel-tasks .tseg { display: flex; gap: 4px; }
|
|
33
|
+
#panel-tasks .tseg { margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
|
|
34
|
+
#panel-tasks .tf, #panel-tasks .seg {
|
|
35
|
+
border: 1px solid transparent; background: none; color: var(--fg-2); border-radius: 6px;
|
|
36
|
+
padding: 4px 10px; font-size: 12.5px; cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
#panel-tasks .tf { border-color: var(--line); }
|
|
39
|
+
#panel-tasks .tf .num { font-variant-numeric: tabular-nums; color: var(--fg-3); }
|
|
40
|
+
#panel-tasks .tf.on, #panel-tasks .seg.on { background: var(--surface-2); color: var(--fg); border-color: var(--line-2); }
|
|
41
|
+
#panel-tasks .tlist { border-top: 1px solid var(--line); }
|
|
42
|
+
#panel-tasks .tg-head {
|
|
43
|
+
display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 8px; border: 0;
|
|
44
|
+
border-bottom: 1px solid var(--line); background: none; color: var(--fg); text-align: left;
|
|
45
|
+
cursor: pointer; font-weight: 600;
|
|
46
|
+
}
|
|
47
|
+
#panel-tasks .tg-head .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
48
|
+
#panel-tasks .tg-head .num { font-variant-numeric: tabular-nums; font-weight: 400; font-size: 12px; }
|
|
49
|
+
#panel-tasks .tg-head .chev { display: inline-grid; transition: transform .15s; }
|
|
50
|
+
#panel-tasks .tg-head .chev svg { width: 14px; height: 14px; }
|
|
51
|
+
#panel-tasks .tg-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
|
|
52
|
+
#panel-tasks .trow {
|
|
53
|
+
display: grid; grid-template-columns: 76px minmax(0, 1fr) 110px 150px 72px; gap: 12px;
|
|
54
|
+
align-items: center; height: 36px; padding: 0 8px; border-bottom: 1px solid var(--line);
|
|
55
|
+
font-size: 13px; cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
#panel-tasks .trow:hover, #panel-tasks .trow:focus-visible { background: var(--surface-2); }
|
|
58
|
+
#panel-tasks .trow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
59
|
+
#panel-tasks .trow.thead { cursor: default; color: var(--fg-3); font-size: 12px; background: none; }
|
|
60
|
+
#panel-tasks .trow .mono { font-variant-numeric: tabular-nums; font-size: 12px; }
|
|
61
|
+
#panel-tasks .c-id { color: var(--fg-3); }
|
|
62
|
+
#panel-tasks .c-title, #panel-tasks .c-agent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
63
|
+
#panel-tasks .c-agent { color: var(--fg-2); }
|
|
64
|
+
#panel-tasks .c-time { text-align: right; color: var(--fg-2); }
|
|
65
|
+
#panel-tasks .c-status { display: flex; align-items: center; gap: 6px; }
|
|
66
|
+
#panel-tasks .c-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
|
|
67
|
+
#panel-tasks .st-ok { color: var(--ok); }
|
|
68
|
+
#panel-tasks .st-run { color: var(--run); }
|
|
69
|
+
#panel-tasks .st-bad { color: var(--bad); }
|
|
70
|
+
#panel-tasks .st-fg { color: var(--fg); }
|
|
71
|
+
#panel-tasks .st-faint { color: var(--fg-3); }
|
|
72
|
+
#panel-tasks .tdispatch {
|
|
73
|
+
display: none; margin-left: auto; border: 1px solid var(--line-2); background: var(--surface);
|
|
74
|
+
color: var(--fg); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
#panel-tasks .trow:hover .tdispatch, #panel-tasks .trow:focus-within .tdispatch { display: inline-block; }
|
|
77
|
+
#panel-tasks .tskel span { height: 10px; border-radius: 6px; background: var(--surface-2); }
|
|
78
|
+
#panel-tasks .tempty { padding: 36px 16px; text-align: center; color: var(--fg-2); }
|
|
79
|
+
#panel-tasks .tempty .btn { margin-top: 8px; }
|
|
80
|
+
@media (max-width: 1024px) {
|
|
81
|
+
#panel-tasks .trow { grid-template-columns: 76px minmax(0, 1fr) 150px 72px; }
|
|
82
|
+
#panel-tasks .c-agent { display: none; }
|
|
83
|
+
}
|
|
84
|
+
@media (max-width: 768px) {
|
|
85
|
+
#panel-tasks .trow { grid-template-columns: 76px minmax(0, 1fr) 120px; }
|
|
86
|
+
#panel-tasks .c-time { display: none; }
|
|
87
|
+
}
|
|
31
88
|
@media (max-width: 1100px) { #panel-tasks .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
32
89
|
@media (max-width: 640px) {
|
|
33
90
|
#panel-tasks .board { grid-template-columns: minmax(0, 1fr); }
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
// Team page client script: one pure render, one
|
|
1
|
+
// Team page client script: one pure render, one roster row per agent.
|
|
2
2
|
export const teamScript = String.raw ` var esc = Studio.ui.esc;
|
|
3
|
-
var DASH = '
|
|
3
|
+
var DASH = '-';
|
|
4
4
|
|
|
5
5
|
function head() {
|
|
6
|
-
return '<div class="page-head"><div><h1>Team</h1><p>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function sum(list) {
|
|
10
|
-
return list.reduce(function (total, n) { return total + n; }, 0);
|
|
6
|
+
return '<div class="page-head"><div><h1>Team</h1><p>Who is working on what, and how much each agent has finished.</p></div></div>';
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
function statsFor(key, tasks) {
|
|
14
10
|
var done = tasks.filter(function (t) { return t.status === 'completed'; });
|
|
15
11
|
var timed = done.filter(function (t) { return t.durationMs; });
|
|
16
|
-
var work = sum(timed.map(function (t) { return t.durationMs; }));
|
|
17
12
|
var costs = tasks.filter(function (t) { return t.costUsd != null; });
|
|
18
13
|
var stamps = tasks.map(function (t) { return t.status === 'in_progress' ? (t.startT || 0) : (t.endT || 0); });
|
|
19
14
|
return {
|
|
20
15
|
agent: key || null,
|
|
21
16
|
total: tasks.length,
|
|
22
17
|
done: done.length,
|
|
23
|
-
work: timed.length ?
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
work: timed.length ? timed.reduce(function (n, t) { return n + t.durationMs; }, 0) : null,
|
|
19
|
+
cost: costs.length ? costs.reduce(function (n, t) { return n + t.costUsd; }, 0) : null,
|
|
20
|
+
blocked: tasks.filter(function (t) { return t.status === 'blocked'; }).length,
|
|
26
21
|
last: Math.max.apply(null, [0].concat(stamps)) || null,
|
|
27
|
-
running: tasks.filter(function (t) { return t.status === 'in_progress'; })[0] || null
|
|
28
|
-
stuck: tasks.filter(function (t) { return t.status === 'blocked'; })[0] || null
|
|
22
|
+
running: tasks.filter(function (t) { return t.status === 'in_progress'; })[0] || null
|
|
29
23
|
};
|
|
30
24
|
}
|
|
31
25
|
|
|
@@ -41,71 +35,74 @@ export const teamScript = String.raw ` var esc = Studio.ui.esc;
|
|
|
41
35
|
.sort(function (a, b) { return b.total - a.total; });
|
|
42
36
|
}
|
|
43
37
|
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
function currentTask(r) {
|
|
39
|
+
var t = r.running;
|
|
40
|
+
if (!t) return '<span class="idle">Idle</span>';
|
|
41
|
+
return '<button type="button" class="cur" data-act="team-open" data-tid="' + esc(t.id) +
|
|
42
|
+
'" title="' + esc(t.title || t.id) + '"><span class="mono">' + esc(t.id) + '</span>' +
|
|
43
|
+
'<span class="ttl">' + esc(t.title || '') + '</span></button>';
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return '<span class="faint">Idle</span>';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function shareBar(r, max) {
|
|
56
|
-
var info = Studio.agentInfo(r.agent);
|
|
57
|
-
var pct = max ? Math.round((r.total / max) * 100) : 0;
|
|
58
|
-
return '<div class="bar"><i style="width:' + pct + '%;background:var(' + info.token + ')"></i></div>';
|
|
46
|
+
function rate(r) {
|
|
47
|
+
var fin = r.done + r.blocked;
|
|
48
|
+
return fin ? Math.round((r.done / fin) * 100) + '%' : DASH;
|
|
59
49
|
}
|
|
60
50
|
|
|
61
51
|
function lastActive(r) {
|
|
62
52
|
return r.last ? Studio.ui.when(r.last) : DASH;
|
|
63
53
|
}
|
|
64
54
|
|
|
65
|
-
function row(r
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'<td
|
|
70
|
-
'<td class="r">' +
|
|
71
|
-
'<td class="r">' + (r.work == null ? DASH : esc(Studio.fmt.dur(r.work))) + '</td>' +
|
|
72
|
-
'<td class="r">' + (r.cost == null ? DASH : esc(Studio.fmt.money(r.cost))) + '</td>' +
|
|
73
|
-
'<td class="r
|
|
55
|
+
function row(r) {
|
|
56
|
+
var dot = r.running ? '<i class="run-dot"></i>' : '';
|
|
57
|
+
return '<tr data-agent="' + esc(r.agent || 'unassigned') + '"><td class="who">' + dot +
|
|
58
|
+
esc(r.agent || 'unassigned') + '</td>' +
|
|
59
|
+
'<td>' + currentTask(r) + '</td>' +
|
|
60
|
+
'<td class="mono r">' + r.done + '</td>' +
|
|
61
|
+
'<td class="mono r hide-sm">' + (r.work == null ? DASH : esc(Studio.fmt.dur(r.work))) + '</td>' +
|
|
62
|
+
'<td class="mono r hide-sm">' + (r.cost == null ? DASH : esc(Studio.fmt.money(r.cost))) + '</td>' +
|
|
63
|
+
'<td class="mono r hide-sm">' + rate(r) + '</td>' +
|
|
64
|
+
'<td class="mono r hide-sm">' + lastActive(r) + '</td></tr>';
|
|
74
65
|
}
|
|
75
66
|
|
|
76
67
|
function table(rows) {
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
var th = cols.map(function (c
|
|
80
|
-
var
|
|
81
|
-
return '<th' +
|
|
68
|
+
var cols = [['Agent', ''], ['Current task', ''], ['Tasks done', 'r'],
|
|
69
|
+
['Time', 'r hide-sm'], ['Cost', 'r hide-sm'], ['Success rate', 'r hide-sm'], ['Last active', 'r hide-sm']];
|
|
70
|
+
var th = cols.map(function (c) {
|
|
71
|
+
var tip = c[0] === 'Success rate' ? ' title="Completed / (completed + blocked)"' : '';
|
|
72
|
+
return '<th' + tip + (c[1] ? ' class="' + c[1] + '"' : '') + '>' + c[0] + '</th>';
|
|
82
73
|
}).join('');
|
|
83
|
-
return '<
|
|
84
|
-
rows.map(
|
|
74
|
+
return '<div class="roster"><table><thead><tr>' + th + '</tr></thead><tbody>' +
|
|
75
|
+
rows.map(row).join('') + '</tbody></table></div>' + defs();
|
|
85
76
|
}
|
|
86
77
|
|
|
87
78
|
function defs() {
|
|
88
|
-
|
|
89
|
-
'
|
|
90
|
-
'
|
|
91
|
-
'
|
|
92
|
-
|
|
79
|
+
var items = [['Tasks done', 'finished and checked by the gatekeeper.'],
|
|
80
|
+
['Time', 'total time on completed tasks that recorded timing.'],
|
|
81
|
+
['Cost', 'estimated from token counts; the real bill is on Home.'],
|
|
82
|
+
['Current task', 'the task this agent is working on right now.']];
|
|
83
|
+
return '<details class="defs"><summary>What these columns mean</summary>' + items.map(function (i) {
|
|
84
|
+
return '<div><b>' + i[0] + '</b><span>' + i[1] + '</span></div>';
|
|
85
|
+
}).join('') + '</details>';
|
|
93
86
|
}
|
|
94
87
|
|
|
95
88
|
function skeleton() {
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
var line = function (w) {
|
|
90
|
+
return '<tr><td colspan="6"><div class="skel" style="width:' + w + '"></div></td></tr>';
|
|
91
|
+
};
|
|
92
|
+
var rows = ['92%', '78%', '86%', '70%'].map(line).join('');
|
|
93
|
+
return head() + '<div class="roster"><table><thead>' + line('100%') + '</thead><tbody>' +
|
|
94
|
+
rows + '</tbody></table></div>';
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
function render(ctx) {
|
|
102
98
|
var rows = buildRows(ctx.model);
|
|
103
|
-
if (!rows.length) return head() + '<
|
|
104
|
-
return head() + table(rows)
|
|
99
|
+
if (!rows.length) return head() + '<p class="empty">No agents have worked on this project yet.</p>';
|
|
100
|
+
return head() + table(rows);
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
Studio.registerPage('team', {
|
|
108
104
|
deps: ['tasks', 'telemetry', 'runs'],
|
|
105
|
+
actions: { 'team-open': function (el) { Studio.taskAction('logs', el.getAttribute('data-tid')); } },
|
|
109
106
|
render: render,
|
|
110
107
|
skeleton: skeleton
|
|
111
108
|
});
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
// Team page styles, all scoped under #panel-team.
|
|
2
|
-
export const teamCss = String.raw `#panel-team .page-head {
|
|
3
|
-
#panel-team .page-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
|
|
1
|
+
// Team page styles, all scoped under #panel-team. Ink look: no cards, 1px dividers.
|
|
2
|
+
export const teamCss = String.raw `#panel-team .page-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
|
|
4
3
|
#panel-team .page-head p { margin: 4px 0 0; color: var(--fg-2); }
|
|
5
|
-
#panel-team .
|
|
6
|
-
#panel-team
|
|
7
|
-
#panel-team
|
|
8
|
-
#panel-team
|
|
9
|
-
#panel-team .
|
|
10
|
-
#panel-team
|
|
11
|
-
#panel-team
|
|
12
|
-
#panel-team
|
|
13
|
-
#panel-team
|
|
14
|
-
#panel-team
|
|
15
|
-
#panel-team .
|
|
16
|
-
#panel-team .
|
|
17
|
-
#panel-team .
|
|
18
|
-
#panel-team .
|
|
19
|
-
#panel-team .
|
|
20
|
-
#panel-team .defs { display:
|
|
21
|
-
#panel-team .defs b {
|
|
4
|
+
#panel-team .roster { margin-top: 16px; overflow-x: auto; }
|
|
5
|
+
#panel-team table { width: 100%; border-collapse: collapse; }
|
|
6
|
+
#panel-team th { text-align: left; font-weight: 500; font-size: 12px; color: var(--fg-3); height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
|
|
7
|
+
#panel-team td { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
|
|
8
|
+
#panel-team .r { text-align: right; }
|
|
9
|
+
#panel-team .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
|
|
10
|
+
#panel-team .who { font-weight: 500; }
|
|
11
|
+
#panel-team .run-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--run); margin-right: 8px; }
|
|
12
|
+
#panel-team .idle { color: var(--fg-3); }
|
|
13
|
+
#panel-team .cur { display: inline-flex; gap: 8px; max-width: 360px; padding: 0; border: 0; background: none; color: var(--fg); font: inherit; cursor: pointer; }
|
|
14
|
+
#panel-team .cur:hover .ttl { text-decoration: underline; }
|
|
15
|
+
#panel-team .ttl { overflow: hidden; text-overflow: ellipsis; color: var(--fg-2); }
|
|
16
|
+
#panel-team .empty { margin: 24px 0; color: var(--fg-3); }
|
|
17
|
+
#panel-team .defs { margin-top: 24px; }
|
|
18
|
+
#panel-team .defs summary { cursor: pointer; color: var(--fg-2); height: 36px; line-height: 36px; }
|
|
19
|
+
#panel-team .defs div { display: flex; gap: 16px; height: 36px; align-items: center; border-bottom: 1px solid var(--line); }
|
|
20
|
+
#panel-team .defs b { width: 120px; font-weight: 500; }
|
|
21
|
+
#panel-team .defs span { color: var(--fg-2); }
|
|
22
|
+
@media (max-width: 1023px) { #panel-team .hide-sm { display: none; } }
|
|
22
23
|
`;
|
|
@@ -11,50 +11,62 @@ export const worktreesScript = String.raw ` // ─── View 3: Agent worktree
|
|
|
11
11
|
return task ? task.status : null;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function
|
|
15
|
-
if (!w.isAgentWorktree) return '
|
|
16
|
-
if (status === 'completed') return '
|
|
17
|
-
if (status === 'in_progress') return '
|
|
18
|
-
if (status === 'blocked') return '
|
|
19
|
-
if (status === 'pending') return '
|
|
20
|
-
return '
|
|
14
|
+
function wtStatus(w, status) {
|
|
15
|
+
if (!w.isAgentWorktree) return ['neutral', 'main'];
|
|
16
|
+
if (status === 'completed') return ['ok', 'ready to merge'];
|
|
17
|
+
if (status === 'in_progress') return ['run', 'agent working'];
|
|
18
|
+
if (status === 'blocked') return ['err', 'blocked'];
|
|
19
|
+
if (status === 'pending') return ['neutral', 'open'];
|
|
20
|
+
return ['neutral', 'stale'];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function wtChanges(w) {
|
|
24
|
+
var n = w.changedFiles != null ? w.changedFiles : w.files;
|
|
25
|
+
return n != null ? esc(String(n)) + ' files' : '<span class="muted">-</span>';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function wtActions(w, status) {
|
|
29
|
+
var id = esc(w.taskId);
|
|
30
|
+
var canMerge = w.mergeEligible != null ? !!w.mergeEligible : status === 'completed';
|
|
31
|
+
var why = w.mergeBlockedReason || 'Available once the task is completed';
|
|
32
|
+
var busy = pipe.busy['wt:' + w.taskId];
|
|
33
|
+
if (busy) {
|
|
34
|
+
return '<button class="btn small" type="button" disabled><span class="spinner" aria-hidden="true"></span>' +
|
|
35
|
+
(busy === 'merge' ? 'Merging...' : 'Deleting...') + '</button>';
|
|
36
|
+
}
|
|
37
|
+
return '<button class="btn small" type="button" data-act="wt-diff" data-key="' + id +
|
|
38
|
+
'" aria-label="Inspect diff for ' + id + '">View changes</button>' +
|
|
39
|
+
'<button class="btn small primary" type="button" data-act="wt-merge" data-key="' + id +
|
|
40
|
+
'" aria-label="Merge ' + id + ' to main"' + (canMerge ? '' : ' disabled title="' + esc(why) + '"') +
|
|
41
|
+
'>Merge</button>' +
|
|
42
|
+
'<button class="btn small danger" type="button" data-act="wt-remove" data-key="' + id +
|
|
43
|
+
'" aria-label="Delete workspace for ' + id + '">Remove</button>';
|
|
21
44
|
}
|
|
22
45
|
|
|
23
46
|
function worktreeRow(w) {
|
|
24
47
|
var status = worktreeTaskStatus(w);
|
|
25
48
|
var task = w.taskId ? taskById(w.taskId) : null;
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'<button class="btn small primary" type="button" data-act="wt-merge" data-key="' + esc(w.taskId) + '"' + (canMerge ? '' : ' disabled title="' + esc(blockedWhy) + '"') + '>Merge to Main</button>' +
|
|
36
|
-
'<button class="btn small danger" type="button" data-act="wt-remove" data-key="' + esc(w.taskId) + '">Delete Workspace</button>';
|
|
37
|
-
}
|
|
38
|
-
return '<tr><td data-label="Branch"><code>' + esc(w.branch) + '</code></td>' +
|
|
39
|
-
'<td data-label="Task ID">' + (w.taskId ? '<div><code>' + esc(w.taskId) + '</code>' + (task ? '<div class="cell-sub" title="' + esc(task.title) + '">' + esc(task.title) + '</div>' : '') + '</div>' : '<span class="muted">–</span>') + '</td>' +
|
|
40
|
-
'<td data-label="Workspace Folder"><code class="path" title="' + esc(w.path) + '">' + esc(shortPath(w.path)) + '</code></td>' +
|
|
41
|
-
'<td data-label="Latest Commit"><code>' + esc(String(w.head || '').slice(0, 7) || '–') + '</code></td>' +
|
|
42
|
-
'<td data-label="Status">' + worktreeBadge(w, status) + '</td>' +
|
|
43
|
-
'<td data-label="Actions"><div class="row-actions">' + actions + '</div></td></tr>';
|
|
49
|
+
var st = wtStatus(w, status);
|
|
50
|
+
var actions = w.isAgentWorktree && w.taskId ? wtActions(w, status) : '<span class="muted">-</span>';
|
|
51
|
+
var title = task ? task.title : '';
|
|
52
|
+
return '<tr class="wt-row"><td class="wt-task">' + (w.taskId ? '<code>' + esc(w.taskId) + '</code>' : '') +
|
|
53
|
+
'<span class="wt-title" title="' + esc(title) + '">' + esc(title) + '</span></td>' +
|
|
54
|
+
'<td><code>' + esc(w.branch) + '</code></td>' +
|
|
55
|
+
'<td><span class="wt-dot" data-tone="' + st[0] + '"></span>' + esc(st[1]) + '</td>' +
|
|
56
|
+
'<td class="wt-num">' + wtChanges(w) + '</td>' +
|
|
57
|
+
'<td><div class="row-actions">' + actions + '</div></td></tr>';
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
function renderWorktrees() {
|
|
47
|
-
var head = panelHead('
|
|
48
|
-
if (!pipe.loaded.worktrees) return head + '<div class="
|
|
61
|
+
var head = panelHead('Worktrees', 'Isolated git workspaces for tasks.');
|
|
62
|
+
if (!pipe.loaded.worktrees) return head + '<div class="section" aria-hidden="true"><div class="skeleton"></div><div class="skeleton short"></div></div>';
|
|
49
63
|
if (pipe.errors.worktrees && !pipe.worktrees.length) return head + errorCard('worktrees', pipe.errors.worktrees, 'worktrees');
|
|
50
|
-
var rows = pipe.worktrees.
|
|
51
|
-
if (!rows.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'<th scope="col">Branch Name</th><th scope="col">Task ID</th><th scope="col">Workspace Folder</th><th scope="col">Latest Commit</th><th scope="col">Status</th><th scope="col">Actions</th>' +
|
|
57
|
-
'</tr></thead><tbody>' + rows.map(worktreeRow).join('') + '</tbody></table></div>';
|
|
64
|
+
var rows = pipe.worktrees.filter(function (w) { return w.isAgentWorktree; });
|
|
65
|
+
if (!rows.length) return head + staleNote('worktrees') + '<div class="state"><p>No worktrees open.</p></div>';
|
|
66
|
+
return head + staleNote('worktrees') + '<table class="grid wt-table"><thead><tr>' +
|
|
67
|
+
'<th scope="col">Task</th><th scope="col">Branch</th><th scope="col">Status</th>' +
|
|
68
|
+
'<th scope="col">Changes</th><th scope="col">Actions</th>' +
|
|
69
|
+
'</tr></thead><tbody>' + rows.map(worktreeRow).join('') + '</tbody></table>';
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
function confirmWorktree(action, taskId) {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// Worktrees view styles.
|
|
2
|
-
export const worktreesCss = String.raw `/*
|
|
3
|
-
.
|
|
4
|
-
table.grid {
|
|
5
|
-
table.grid th { padding: 10px 16px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
|
|
2
|
+
export const worktreesCss = String.raw `/* Worktrees table */
|
|
3
|
+
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
4
|
+
table.grid th { height: 32px; padding: 0 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
|
|
6
5
|
table.grid th:last-child { text-align: right; }
|
|
7
|
-
table.grid td { padding: 12px
|
|
8
|
-
table.grid
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
.
|
|
6
|
+
table.grid td { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
|
|
7
|
+
table.grid code { font-family: var(--mono); font-size: 12px; }
|
|
8
|
+
.wt-task { display: flex; align-items: center; gap: 8px; height: 36px; max-width: 320px; }
|
|
9
|
+
.wt-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
|
|
10
|
+
.wt-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
|
|
11
|
+
.wt-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--muted); }
|
|
12
|
+
.wt-dot[data-tone="ok"] { background: var(--ok); }
|
|
13
|
+
.wt-dot[data-tone="err"] { background: var(--danger); }
|
|
14
|
+
.wt-dot[data-tone="run"] { background: var(--warn); }
|
|
13
15
|
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
|
|
14
16
|
|
|
15
17
|
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// The nativ wordmark: path from assets/brand/nativ-dark.svg, filled with currentColor.
|
|
2
|
+
export const WORDMARK_PATH = 'M88.9141 114.148H69.6172V69.6172C69.6172 67.0938 69.1719 64.8424 68.2812 62.8633C67.4401 60.8346 66.2773 59.1029 64.793 57.668C63.3086 56.2331 61.5521 55.1445 59.5234 54.4023C57.5443 53.6107 55.3919 53.2148 53.0664 53.2148H19.2969V114.148H0V43.4922C0 42.1562 0.247396 40.9193 0.742188 39.7812C1.23698 38.5938 1.92969 37.5794 2.82031 36.7383C3.71094 35.8477 4.75 35.1549 5.9375 34.6602C7.125 34.1654 8.38672 33.918 9.72266 33.918H53.2148C55.6393 33.918 58.1875 34.1901 60.8594 34.7344C63.5807 35.2786 66.2526 36.1693 68.875 37.4062C71.5469 38.5938 74.0703 40.1276 76.4453 42.0078C78.8698 43.8385 80.9974 46.0898 82.8281 48.7617C84.7083 51.3841 86.1927 54.4271 87.2812 57.8906C88.3698 61.3542 88.9141 65.263 88.9141 69.6172V114.148' +
|
|
3
|
+
'ZM188.664 87.5781C188.664 90.25 188.194 93.1445 187.254 96.2617C186.314 99.3294 184.78 102.199 182.652 104.871C180.574 107.493 177.828 109.695 174.414 111.477C171.049 113.258 166.943 114.148 162.094 114.148H127.285C124.613 114.148 121.719 113.678 118.602 112.738C115.534 111.798 112.664 110.289 109.992 108.211C107.37 106.083 105.168 103.337 103.387 99.9727C101.605 96.5586 100.715 92.4271 100.715 87.5781C100.715 84.9062 101.185 82.0117 102.125 78.8945C103.065 75.7773 104.574 72.9076 106.652 70.2852C108.78 67.6133 111.526 65.3867 114.891 63.6055C118.305 61.8242 122.436 60.9336 127.285 60.9336H162.094V79.3398H127.285C124.663 79.3398 122.634 80.1562 121.199 81.7891C119.764 83.3724 119.047 85.3516 119.047 87.7266C119.047 90.25 119.863 92.2292 121.496 93.6641C123.178 95.0495 125.158 95.7422 127.434 95.7422H162.094C164.716 95.7422 166.745 94.9505 168.18 93.3672C169.615 91.7839 170.332 89.8047 170.332 87.4297V60.4883C170.332 57.9648 169.54 55.9609 167.957 54.4766C166.423 52.9922 164.469 52.25 162.094 52.25H119.715V33.918H162.094C164.766 33.918 167.635 34.388 170.703 35.3281C173.82 36.2682 176.69 37.8021 179.312 39.9297C181.984 42.0078 184.211 44.7539 185.992 48.168C187.773 51.5326 188.664 55.6393 188.664 60.4883V87.5781' +
|
|
4
|
+
'ZM277.801 53.2148H244.105V114.148H224.586V53.2148H199.5V33.918H224.586V7.71875H244.105V33.918H277.801V53.2148' +
|
|
5
|
+
'ZM310.086 17.4414H290.789V0H310.086V17.4414' +
|
|
6
|
+
'ZM310.086 114.148H290.789V33.918H310.086V114.148' +
|
|
7
|
+
'ZM424.383 33.918C422.206 40.6966 419.658 47.3763 416.738 53.957C413.819 60.5378 410.454 66.8216 406.645 72.8086C402.884 78.7461 398.654 84.263 393.953 89.3594C389.302 94.4062 384.132 98.7852 378.441 102.496C372.801 106.158 366.641 109.052 359.961 111.18C353.331 113.258 346.132 114.297 338.363 114.297C337.027 114.297 335.766 114.049 334.578 113.555C333.391 113.06 332.352 112.392 331.461 111.551C330.57 110.66 329.878 109.646 329.383 108.508C328.888 107.32 328.641 106.059 328.641 104.723V33.918H347.938V94.2578C352.638 94.2578 357.141 93.2435 361.445 91.2148C365.799 89.1862 369.906 86.5143 373.766 83.1992C377.625 79.8346 381.188 76.0247 384.453 71.7695C387.768 67.5143 390.712 63.1602 393.285 58.707C395.858 54.2044 398.035 49.8008 399.816 45.4961C401.647 41.1914 403.008 37.332 403.898 33.918H424.383' +
|
|
8
|
+
'Z';
|
|
9
|
+
// Rail variant clips to the n glyph for the collapsed sidebar.
|
|
10
|
+
export function wordmark(opts = {}) {
|
|
11
|
+
const rail = opts.rail === true;
|
|
12
|
+
const cls = rail ? 'wordmark is-rail' : 'wordmark';
|
|
13
|
+
const box = rail ? '0 0 90 115' : '0 0 425 115';
|
|
14
|
+
return '<svg class="' + cls + '" viewBox="' + box + '" role="img" aria-label="nativ" ' +
|
|
15
|
+
'focusable="false"><path fill="currentColor" d="' + WORDMARK_PATH + '"/></svg>';
|
|
16
|
+
}
|
|
@@ -57,11 +57,13 @@ export const consoleScript = String.raw ` // ─── Live runner console draw
|
|
|
57
57
|
function syncConsole() {
|
|
58
58
|
var run = rc.taskId ? runFor(rc.taskId) : null;
|
|
59
59
|
var task = rc.taskId ? taskById(rc.taskId) : null;
|
|
60
|
-
$('rc-task').textContent = rc.taskId || '
|
|
60
|
+
$('rc-task').textContent = rc.taskId || '';
|
|
61
61
|
$('rc-title').textContent = task ? task.title : '';
|
|
62
62
|
$('rc-steps').innerHTML = rcStepper(run);
|
|
63
63
|
$('rc-abort').disabled = !isRunActive(run);
|
|
64
64
|
$('rc-elapsed').textContent = mmss(elapsedOf(run) || 0);
|
|
65
|
+
$('rc-clock').textContent = $('rc-elapsed').textContent;
|
|
66
|
+
syncInspectorStatus(run);
|
|
65
67
|
$('rc-bytes').textContent = formatBytes((run && run.logBytes) || 0);
|
|
66
68
|
var gate = 'Idle';
|
|
67
69
|
if (run && run.verification) gate = run.verification.success ? 'Passed' : 'Failed';
|
|
@@ -90,6 +92,7 @@ export const consoleScript = String.raw ` // ─── Live runner console draw
|
|
|
90
92
|
var run = rc.taskId ? runFor(rc.taskId) : null;
|
|
91
93
|
if (!rc.taskId || !isRunActive(run)) { clearInterval(rc.ticker); rc.ticker = null; return; }
|
|
92
94
|
$('rc-elapsed').textContent = mmss(elapsedOf(run) || 0);
|
|
95
|
+
$('rc-clock').textContent = $('rc-elapsed').textContent;
|
|
93
96
|
}, 1000);
|
|
94
97
|
}
|
|
95
98
|
|
|
@@ -135,7 +138,7 @@ export const consoleScript = String.raw ` // ─── Live runner console draw
|
|
|
135
138
|
$('rc-diff-files').innerHTML = (files || []).map(function (f) { return '<li title="' + esc(f) + '">' + esc(f) + '</li>'; }).join('');
|
|
136
139
|
$('rc-diff-files').hidden = !(files && files.length);
|
|
137
140
|
$('rc-diff-body').innerHTML = bodyHtml;
|
|
138
|
-
$('rc-diff-count').textContent = count == null ? '
|
|
141
|
+
$('rc-diff-count').textContent = count == null ? '-' : String(count);
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
function loadConsoleDiff(taskId) {
|
|
@@ -191,4 +194,60 @@ export const consoleScript = String.raw ` // ─── Live runner console draw
|
|
|
191
194
|
return ['logs', 'diff', 'heal'].filter(function (name) { return !$('rc-tab-' + name).hidden; });
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
// Inspector header status: dot color follows the run state only.
|
|
198
|
+
function syncInspectorStatus(run) {
|
|
199
|
+
var st = run ? run.status : '';
|
|
200
|
+
var tone = !st ? 'idle' : st === 'completed' ? 'ok' : (st === 'failed' || st === 'aborted') ? 'err' : 'run';
|
|
201
|
+
$('rc-status').setAttribute('data-tone', tone);
|
|
202
|
+
$('rc-status-text').textContent = st ? (RUN_LABEL[st] || st) : 'Idle';
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Below 1024px the inspector is a modal sheet over the content.
|
|
206
|
+
function inspectorIsSheet() {
|
|
207
|
+
return window.matchMedia && window.matchMedia('(max-width: 1023px)').matches;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Remembers the opener so closing hands focus back to it.
|
|
211
|
+
function rememberInspectorOpener() {
|
|
212
|
+
var drawer = $('runner-console-drawer');
|
|
213
|
+
var active = document.activeElement;
|
|
214
|
+
if (drawer.hidden && active && !drawer.contains(active)) rc.opener = active;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function applyInspectorMode() {
|
|
218
|
+
var drawer = $('runner-console-drawer');
|
|
219
|
+
var sheet = inspectorIsSheet() && !drawer.hidden;
|
|
220
|
+
if (sheet) drawer.setAttribute('aria-modal', 'true');
|
|
221
|
+
else drawer.removeAttribute('aria-modal');
|
|
222
|
+
drawer.setAttribute('role', sheet ? 'dialog' : 'region');
|
|
223
|
+
if ($('task-drawer').hidden) $('scrim').hidden = !sheet;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function restoreInspectorFocus() {
|
|
227
|
+
if ($('task-drawer').hidden) $('scrim').hidden = true;
|
|
228
|
+
var opener = rc.opener;
|
|
229
|
+
rc.opener = null;
|
|
230
|
+
if (opener && document.contains(opener) && opener.focus) opener.focus();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Keeps Tab inside the sheet while it is modal.
|
|
234
|
+
function trapInspectorFocus(e) {
|
|
235
|
+
var drawer = $('runner-console-drawer');
|
|
236
|
+
if (e.key !== 'Tab' || drawer.hidden || !inspectorIsSheet()) return;
|
|
237
|
+
var items = Array.prototype.filter.call(
|
|
238
|
+
drawer.querySelectorAll('button, [href], [tabindex]:not([tabindex="-1"]), textarea, input'),
|
|
239
|
+
function (el) { return !el.disabled && el.offsetParent !== null; });
|
|
240
|
+
if (!items.length) return;
|
|
241
|
+
var first = items[0], last = items[items.length - 1];
|
|
242
|
+
if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }
|
|
243
|
+
else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
document.addEventListener('keydown', trapInspectorFocus);
|
|
247
|
+
document.addEventListener('click', function (e) {
|
|
248
|
+
var t = e.target && e.target.closest ? e.target.closest('#rc-open-diff') : null;
|
|
249
|
+
if (t) setConsoleTab('diff', true);
|
|
250
|
+
});
|
|
251
|
+
window.addEventListener('resize', applyInspectorMode);
|
|
252
|
+
|
|
194
253
|
`;
|
|
@@ -6,14 +6,14 @@ export const coreScript = String.raw `<script>
|
|
|
6
6
|
var $ = function (id) { return document.getElementById(id); };
|
|
7
7
|
|
|
8
8
|
var ICON = {
|
|
9
|
-
spark: '<svg class="icon t1-spark" width="14" height="14" viewBox="0 0
|
|
10
|
-
check: '<svg class="icon" width="12" height="12" viewBox="0 0
|
|
11
|
-
x: '<svg class="icon" width="12" height="12" viewBox="0 0
|
|
12
|
-
shield: '<svg class="icon" width="14" height="14" viewBox="0 0
|
|
13
|
-
play: '<svg class="icon" width="12" height="12" viewBox="0 0
|
|
14
|
-
alert: '<svg class="icon" width="28" height="28" viewBox="0 0
|
|
15
|
-
branch: '<svg class="icon" width="28" height="28" viewBox="0 0
|
|
16
|
-
gauge: '<svg class="icon" width="28" height="28" viewBox="0 0
|
|
9
|
+
spark: '<svg class="icon t1-spark" width="14" height="14" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"/></svg>',
|
|
10
|
+
check: '<svg class="icon" width="12" height="12" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',
|
|
11
|
+
x: '<svg class="icon" width="12" height="12" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',
|
|
12
|
+
shield: '<svg class="icon" width="14" height="14" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"/></svg>',
|
|
13
|
+
play: '<svg class="icon" width="12" height="12" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',
|
|
14
|
+
alert: '<svg class="icon" width="28" height="28" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"/></svg>',
|
|
15
|
+
branch: '<svg class="icon" width="28" height="28" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',
|
|
16
|
+
gauge: '<svg class="icon" width="28" height="28" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>'
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
function formatBytes(n) {
|