@qlingzzy/qling 1.0.0 → 1.1.1
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 +158 -0
- package/README.en.md +83 -18
- package/README.md +19 -9
- package/dist/agent/main-loop.d.ts +120 -0
- package/dist/agent/main-loop.d.ts.map +1 -0
- package/dist/agent/main-loop.js +279 -0
- package/dist/agent/subtask-parallel.d.ts +29 -0
- package/dist/agent/subtask-parallel.d.ts.map +1 -0
- package/dist/agent/subtask-parallel.js +107 -0
- package/dist/agent/subtask.d.ts +13 -0
- package/dist/agent/subtask.d.ts.map +1 -1
- package/dist/agent/subtask.js +79 -24
- package/dist/agent/system-prompt.d.ts +39 -0
- package/dist/agent/system-prompt.d.ts.map +1 -0
- package/dist/agent/system-prompt.js +89 -0
- package/dist/agent/tool-orchestrator.d.ts +66 -0
- package/dist/agent/tool-orchestrator.d.ts.map +1 -0
- package/dist/agent/tool-orchestrator.js +355 -0
- package/dist/agent-loop.d.ts +29 -16
- package/dist/agent-loop.d.ts.map +1 -1
- package/dist/agent-loop.js +262 -807
- package/dist/agents/roles.d.ts +57 -0
- package/dist/agents/roles.d.ts.map +1 -0
- package/dist/agents/roles.js +198 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +17 -3
- package/dist/commands/claude-style.d.ts.map +1 -1
- package/dist/commands/claude-style.js +19 -10
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +3 -2
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/mode.d.ts +16 -0
- package/dist/commands/mode.d.ts.map +1 -0
- package/dist/commands/mode.js +67 -0
- package/dist/commands/recover.d.ts +3 -0
- package/dist/commands/recover.d.ts.map +1 -0
- package/dist/commands/recover.js +69 -0
- package/dist/commands/runtime.d.ts +2 -0
- package/dist/commands/runtime.d.ts.map +1 -1
- package/dist/commands/runtime.js +2 -0
- package/dist/commands/trace.d.ts +3 -0
- package/dist/commands/trace.d.ts.map +1 -0
- package/dist/commands/trace.js +45 -0
- package/dist/commands/verify.js +2 -2
- package/dist/config-report.d.ts +0 -1
- package/dist/config-report.d.ts.map +1 -1
- package/dist/config-report.js +1 -2
- package/dist/config.d.ts +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -1
- package/dist/context-report.d.ts +13 -7
- package/dist/context-report.d.ts.map +1 -1
- package/dist/context-report.js +64 -61
- package/dist/context-tool-hygiene.d.ts +36 -0
- package/dist/context-tool-hygiene.d.ts.map +1 -0
- package/dist/context-tool-hygiene.js +125 -0
- package/dist/dashboard/client.d.ts +2 -0
- package/dist/dashboard/client.d.ts.map +1 -0
- package/dist/dashboard/client.js +305 -0
- package/dist/dashboard/model.d.ts +13 -0
- package/dist/dashboard/model.d.ts.map +1 -0
- package/dist/dashboard/model.js +112 -0
- package/dist/dashboard/page.d.ts +3 -0
- package/dist/dashboard/page.d.ts.map +1 -0
- package/dist/dashboard/page.js +204 -0
- package/dist/dashboard/types.d.ts +63 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +1 -0
- package/dist/dashboard-server.d.ts +24 -4
- package/dist/dashboard-server.d.ts.map +1 -1
- package/dist/dashboard-server.js +397 -302
- package/dist/discovery-registry.d.ts +17 -3
- package/dist/discovery-registry.d.ts.map +1 -1
- package/dist/discovery-registry.js +78 -3
- package/dist/doctor.d.ts +8 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +116 -0
- package/dist/eval/llm-tasks.d.ts +5 -0
- package/dist/eval/llm-tasks.d.ts.map +1 -0
- package/dist/eval/llm-tasks.js +125 -0
- package/dist/eval/repo-tasks.d.ts +12 -0
- package/dist/eval/repo-tasks.d.ts.map +1 -0
- package/dist/eval/repo-tasks.js +220 -0
- package/dist/eval/runner.d.ts +3 -1
- package/dist/eval/runner.d.ts.map +1 -1
- package/dist/eval/runner.js +23 -4
- package/dist/eval/tasks.d.ts.map +1 -1
- package/dist/eval/tasks.js +186 -0
- package/dist/eval/types.d.ts +8 -5
- package/dist/eval/types.d.ts.map +1 -1
- package/dist/execution/event-bus.d.ts +44 -0
- package/dist/execution/event-bus.d.ts.map +1 -0
- package/dist/execution/event-bus.js +76 -0
- package/dist/execution/failure-classifier.d.ts +11 -0
- package/dist/execution/failure-classifier.d.ts.map +1 -0
- package/dist/execution/failure-classifier.js +66 -0
- package/dist/execution/progress-detector.d.ts +3 -0
- package/dist/execution/progress-detector.d.ts.map +1 -0
- package/dist/execution/progress-detector.js +23 -0
- package/dist/execution/recovery-controller.d.ts +24 -0
- package/dist/execution/recovery-controller.d.ts.map +1 -0
- package/dist/execution/recovery-controller.js +114 -0
- package/dist/execution/recovery-messages.d.ts +24 -0
- package/dist/execution/recovery-messages.d.ts.map +1 -0
- package/dist/execution/recovery-messages.js +48 -0
- package/dist/execution/recovery-metrics.d.ts +16 -0
- package/dist/execution/recovery-metrics.d.ts.map +1 -0
- package/dist/execution/recovery-metrics.js +73 -0
- package/dist/execution/recovery-strategy-planner.d.ts +6 -0
- package/dist/execution/recovery-strategy-planner.d.ts.map +1 -0
- package/dist/execution/recovery-strategy-planner.js +24 -0
- package/dist/execution/run-trace-store.d.ts +29 -0
- package/dist/execution/run-trace-store.d.ts.map +1 -0
- package/dist/execution/run-trace-store.js +140 -0
- package/dist/execution/staged-verifier.d.ts +33 -0
- package/dist/execution/staged-verifier.d.ts.map +1 -0
- package/dist/execution/staged-verifier.js +39 -0
- package/dist/execution/types.d.ts +58 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +1 -0
- package/dist/execution/verification-loop.d.ts +58 -0
- package/dist/execution/verification-loop.d.ts.map +1 -0
- package/dist/execution/verification-loop.js +195 -0
- package/dist/execution/verification-stages.d.ts +17 -0
- package/dist/execution/verification-stages.d.ts.map +1 -0
- package/dist/execution/verification-stages.js +102 -0
- package/dist/help-topics.d.ts.map +1 -1
- package/dist/help-topics.js +11 -0
- package/dist/index.js +0 -8
- package/dist/lsp/ts-service.d.ts +36 -0
- package/dist/lsp/ts-service.d.ts.map +1 -0
- package/dist/lsp/ts-service.js +291 -0
- package/dist/memory/lifecycle.d.ts +19 -0
- package/dist/memory/lifecycle.d.ts.map +1 -0
- package/dist/memory/lifecycle.js +53 -0
- package/dist/memory.d.ts +0 -16
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +0 -36
- package/dist/metrics/collector.d.ts +7 -0
- package/dist/metrics/collector.d.ts.map +1 -1
- package/dist/metrics/collector.js +60 -0
- package/dist/mission/manager.d.ts +1 -0
- package/dist/mission/manager.d.ts.map +1 -1
- package/dist/mission/manager.js +9 -0
- package/dist/mission/progress-notify.d.ts +39 -0
- package/dist/mission/progress-notify.d.ts.map +1 -0
- package/dist/mission/progress-notify.js +386 -0
- package/dist/pipeline/hooks.d.ts +1 -1
- package/dist/pipeline/hooks.d.ts.map +1 -1
- package/dist/pipeline/hooks.js +1 -0
- package/dist/pipeline/sections.d.ts +8 -4
- package/dist/pipeline/sections.d.ts.map +1 -1
- package/dist/pipeline/sections.js +70 -27
- package/dist/pipeline/verification.d.ts +1 -0
- package/dist/pipeline/verification.d.ts.map +1 -1
- package/dist/pipeline/verification.js +10 -7
- package/dist/providers/llm-client.d.ts +38 -0
- package/dist/providers/llm-client.d.ts.map +1 -0
- package/dist/providers/llm-client.js +105 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +1 -0
- package/dist/session/durable-session-supervisor.d.ts.map +1 -1
- package/dist/session/durable-session-supervisor.js +13 -6
- package/dist/session/session-persistence.d.ts +29 -0
- package/dist/session/session-persistence.d.ts.map +1 -0
- package/dist/session/session-persistence.js +45 -0
- package/dist/session/session-scheduler.d.ts +8 -1
- package/dist/session/session-scheduler.d.ts.map +1 -1
- package/dist/session/session-scheduler.js +33 -4
- package/dist/session-task-report.d.ts +1 -0
- package/dist/session-task-report.d.ts.map +1 -1
- package/dist/session-task-report.js +2 -1
- package/dist/shortcuts.d.ts.map +1 -1
- package/dist/shortcuts.js +1 -0
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +10 -0
- package/dist/skills/security-scan.d.ts +15 -0
- package/dist/skills/security-scan.d.ts.map +1 -0
- package/dist/skills/security-scan.js +95 -0
- package/dist/skills/types.d.ts +2 -0
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/statusline.d.ts +3 -3
- package/dist/statusline.d.ts.map +1 -1
- package/dist/statusline.js +9 -17
- package/dist/token-usage.d.ts +27 -0
- package/dist/token-usage.d.ts.map +1 -0
- package/dist/token-usage.js +107 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +5 -3
- package/dist/tools/browser-act-session.d.ts +48 -0
- package/dist/tools/browser-act-session.d.ts.map +1 -0
- package/dist/tools/browser-act-session.js +168 -0
- package/dist/tools/browser-act.d.ts +14 -0
- package/dist/tools/browser-act.d.ts.map +1 -0
- package/dist/tools/browser-act.js +297 -0
- package/dist/tools/code-symbols.d.ts +35 -0
- package/dist/tools/code-symbols.d.ts.map +1 -0
- package/dist/tools/code-symbols.js +257 -0
- package/dist/tools/index.d.ts +4 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +22 -2
- package/dist/tools/lsp.d.ts +13 -0
- package/dist/tools/lsp.d.ts.map +1 -0
- package/dist/tools/lsp.js +136 -0
- package/dist/tools/patch.d.ts +5 -0
- package/dist/tools/patch.d.ts.map +1 -1
- package/dist/tools/patch.js +25 -4
- package/dist/tools/search.d.ts +7 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +20 -3
- package/dist/tools/skill.d.ts +2 -0
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +47 -14
- package/dist/tools/subtask.d.ts +3 -1
- package/dist/tools/subtask.d.ts.map +1 -1
- package/dist/tools/subtask.js +151 -56
- package/dist/tui/shell.d.ts +12 -0
- package/dist/tui/shell.d.ts.map +1 -1
- package/dist/tui/shell.js +36 -3
- package/dist/tui/streaming-repl.d.ts +1 -0
- package/dist/tui/streaming-repl.d.ts.map +1 -1
- package/dist/tui/streaming-repl.js +27 -4
- package/dist/tui/streaming-tui.d.ts +10 -0
- package/dist/tui/streaming-tui.d.ts.map +1 -1
- package/dist/tui/streaming-tui.js +70 -12
- package/dist/types.d.ts +0 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow-runtime.d.ts.map +1 -1
- package/dist/workflow-runtime.js +10 -2
- package/dist/workflow-types.d.ts +2 -0
- package/dist/workflow-types.d.ts.map +1 -1
- package/docs/install.md +46 -12
- package/docs/skills.md +56 -7
- package/docs/web-routing.md +83 -0
- package/package.json +18 -4
- package/scripts/dep-layers.mjs +275 -0
- package/scripts/eval-llm.mjs +27 -0
- package/scripts/eval-recovery.mjs +101 -0
- package/scripts/eval-tasks.mjs +20 -0
- package/scripts/validate-packaging.mjs +57 -0
- package/skills/examples/README.md +23 -0
- package/skills/examples/add-function/SKILL.md +31 -0
- package/skills/examples/fix-failing-test/SKILL.md +32 -0
- package/skills/examples/pr-summary/SKILL.md +34 -0
- package/skills/lifecycle-build/SKILL.md +22 -0
- package/skills/lifecycle-plan/SKILL.md +32 -0
- package/skills/lifecycle-review/SKILL.md +25 -0
- package/skills/lifecycle-ship/SKILL.md +22 -0
- package/skills/lifecycle-spec/SKILL.md +24 -0
- package/skills/lifecycle-test/SKILL.md +21 -0
- package/skills/opencli/SKILL.md +222 -0
- package/skills/qling.md +14 -3
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta name="color-scheme" content="dark">
|
|
7
|
+
<title>轻灵 · 任务工作台</title>
|
|
8
|
+
<link rel="stylesheet" href="/assets/dashboard.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div class="shell">
|
|
12
|
+
<header class="topbar">
|
|
13
|
+
<div class="brand-block">
|
|
14
|
+
<span class="brand-mark" aria-hidden="true">QL</span>
|
|
15
|
+
<div><p class="eyebrow">LOCAL AGENT CONTROL</p><h1>轻灵任务工作台</h1></div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="runtime-strip" aria-live="polite">
|
|
18
|
+
<span class="signal" id="runtime-signal"></span>
|
|
19
|
+
<span id="runtime-label">正在连接本地运行时</span>
|
|
20
|
+
<span class="divider"></span>
|
|
21
|
+
<span id="source-label">LOCAL</span>
|
|
22
|
+
<button class="icon-button" id="refresh-button" type="button">刷新</button>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
|
|
26
|
+
<section class="summary-band" aria-label="任务摘要">
|
|
27
|
+
<div class="summary-lead"><span>当前态势</span><strong id="summary-total">—</strong></div>
|
|
28
|
+
<div class="summary-item"><span>运行</span><strong id="summary-running">—</strong></div>
|
|
29
|
+
<div class="summary-item"><span>等待</span><strong id="summary-queued">—</strong></div>
|
|
30
|
+
<div class="summary-item"><span>阻塞</span><strong id="summary-blocked">—</strong></div>
|
|
31
|
+
<div class="summary-item"><span>失败</span><strong id="summary-failed">—</strong></div>
|
|
32
|
+
<time id="updated-at">尚未同步</time>
|
|
33
|
+
</section>
|
|
34
|
+
|
|
35
|
+
<main class="workbench">
|
|
36
|
+
<section class="task-rail" aria-labelledby="task-heading">
|
|
37
|
+
<div class="section-heading">
|
|
38
|
+
<div><p class="eyebrow">TASK RAIL</p><h2 id="task-heading">任务轨道</h2></div>
|
|
39
|
+
<span id="visible-count">0 项</span>
|
|
40
|
+
</div>
|
|
41
|
+
<label class="search-box">
|
|
42
|
+
<span aria-hidden="true">⌕</span>
|
|
43
|
+
<input id="task-search" type="search" placeholder="搜索任务、会话或状态" autocomplete="off">
|
|
44
|
+
</label>
|
|
45
|
+
<div class="filter-row" id="kind-filters" aria-label="任务类型筛选">
|
|
46
|
+
<button class="filter active" data-filter-kind="all" type="button">全部</button>
|
|
47
|
+
<button class="filter" data-filter-kind="mission" type="button">使命</button>
|
|
48
|
+
<button class="filter" data-filter-kind="loop" type="button">循环</button>
|
|
49
|
+
<button class="filter" data-filter-kind="workflow" type="button">工作流</button>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="filter-row" id="status-filters" aria-label="任务状态筛选">
|
|
52
|
+
<button class="filter active" data-filter-status="all" type="button">活跃优先</button>
|
|
53
|
+
<button class="filter" data-filter-status="active" type="button">仅活跃</button>
|
|
54
|
+
<button class="filter" data-filter-status="failed" type="button">仅失败</button>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="task-list skeleton-stack" id="task-list" aria-live="polite" aria-busy="true">
|
|
57
|
+
<div class="skeleton"></div><div class="skeleton"></div><div class="skeleton"></div>
|
|
58
|
+
</div>
|
|
59
|
+
</section>
|
|
60
|
+
|
|
61
|
+
<aside class="detail-pane" id="detail-pane" aria-label="任务详情">
|
|
62
|
+
<div class="detail-empty" id="detail-empty">
|
|
63
|
+
<span class="crosshair" aria-hidden="true">+</span>
|
|
64
|
+
<h2 id="detail-heading">选择一项任务</h2>
|
|
65
|
+
<p>查看执行来源、进度、日志和当前可用操作。</p>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="detail-content" id="detail-content" hidden></div>
|
|
68
|
+
</aside>
|
|
69
|
+
</main>
|
|
70
|
+
|
|
71
|
+
<section class="activity-panel" aria-labelledby="activity-heading">
|
|
72
|
+
<div class="section-heading"><div><p class="eyebrow">RECENT SIGNALS</p><h2 id="activity-heading">最近活动</h2></div><span id="activity-boundary">最多 20 条</span></div>
|
|
73
|
+
<ol id="activity-list" class="activity-list"><li class="muted">等待本地指标…</li></ol>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<footer class="boundary-bar">
|
|
77
|
+
<span>仅监听 127.0.0.1</span><span>任务正文不外传</span><span id="permission-label">权限 —</span>
|
|
78
|
+
</footer>
|
|
79
|
+
</div>
|
|
80
|
+
<div id="toast" class="toast" role="status" aria-live="polite" hidden></div>
|
|
81
|
+
<script type="module" src="/assets/dashboard.js"></script>
|
|
82
|
+
</body>
|
|
83
|
+
</html>`;
|
|
84
|
+
export const DASHBOARD_CSS = `
|
|
85
|
+
:root {
|
|
86
|
+
--ink: #dce8e2; --muted: #81928b; --dim: #53635d;
|
|
87
|
+
--ground: #0b100e; --surface: #111815; --raised: #17201c;
|
|
88
|
+
--line: #28372f; --line-strong: #3b5046; --accent: #63d5a2;
|
|
89
|
+
--running: #63d5a2; --queued: #d6b865; --blocked: #df9665;
|
|
90
|
+
--failed: #e27676; --paused: #8ca7d8; --radius: 3px;
|
|
91
|
+
}
|
|
92
|
+
* { box-sizing: border-box; }
|
|
93
|
+
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--ground); font-family: "Aptos", "Microsoft YaHei UI", sans-serif; }
|
|
94
|
+
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .25; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
|
|
95
|
+
button, input { font: inherit; }
|
|
96
|
+
button { color: inherit; }
|
|
97
|
+
.shell { position: relative; width: min(1540px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 42px); }
|
|
98
|
+
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); }
|
|
99
|
+
.brand-block { display: flex; align-items: center; gap: 14px; }
|
|
100
|
+
.brand-mark { display: grid; place-items: center; width: 44px; aspect-ratio: 1; border: 1px solid var(--accent); color: var(--accent); font: 700 13px/1 "Cascadia Code", monospace; letter-spacing: .12em; transform: rotate(-3deg); }
|
|
101
|
+
.eyebrow { margin: 0 0 4px; color: var(--accent); font: 600 10px/1.2 "Cascadia Code", monospace; letter-spacing: .2em; }
|
|
102
|
+
h1, h2, p { margin-top: 0; }
|
|
103
|
+
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 34px); font-weight: 650; letter-spacing: -.04em; }
|
|
104
|
+
h2 { margin-bottom: 0; font-size: 18px; font-weight: 620; }
|
|
105
|
+
.runtime-strip { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 12px "Cascadia Code", monospace; }
|
|
106
|
+
.signal { width: 8px; height: 8px; border-radius: 50%; background: var(--queued); box-shadow: 0 0 0 4px color-mix(in srgb, var(--queued) 14%, transparent); }
|
|
107
|
+
.signal.ready { background: var(--running); box-shadow: 0 0 0 4px color-mix(in srgb, var(--running) 14%, transparent); }
|
|
108
|
+
.divider { width: 1px; height: 18px; background: var(--line-strong); }
|
|
109
|
+
.icon-button, .filter, .action-button { border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
|
|
110
|
+
.icon-button { padding: 7px 11px; }
|
|
111
|
+
.icon-button:hover, .filter:hover, .action-button:hover { border-color: var(--accent); }
|
|
112
|
+
.icon-button:active, .action-button:active { transform: translateY(1px); }
|
|
113
|
+
button:focus-visible, input:focus-visible, .task-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
114
|
+
.summary-band { display: grid; grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(90px, .55fr)) minmax(170px, 1fr); border-bottom: 1px solid var(--line); }
|
|
115
|
+
.summary-band > * { min-height: 88px; padding: 20px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
|
|
116
|
+
.summary-band > *:last-child { border-right: 0; }
|
|
117
|
+
.summary-band span, .summary-band time { color: var(--muted); font: 11px "Cascadia Code", monospace; }
|
|
118
|
+
.summary-band strong { margin-top: 5px; font: 650 26px "Cascadia Code", monospace; }
|
|
119
|
+
.summary-lead { background: var(--accent); color: #092016; }
|
|
120
|
+
.summary-lead span { color: #244d3b; }
|
|
121
|
+
.summary-band time { align-items: flex-end; text-align: right; }
|
|
122
|
+
.workbench { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.35fr); min-height: 560px; border-bottom: 1px solid var(--line-strong); }
|
|
123
|
+
.task-rail { padding: 28px 26px 28px 0; border-right: 1px solid var(--line-strong); }
|
|
124
|
+
.detail-pane { position: relative; padding: 32px 0 32px 34px; min-width: 0; }
|
|
125
|
+
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
|
|
126
|
+
.section-heading > span { color: var(--muted); font: 11px "Cascadia Code", monospace; }
|
|
127
|
+
.search-box { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); }
|
|
128
|
+
.search-box span { color: var(--accent); font-size: 20px; }
|
|
129
|
+
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
|
|
130
|
+
.search-box input::placeholder { color: var(--dim); }
|
|
131
|
+
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
|
|
132
|
+
.filter { padding: 6px 10px; color: var(--muted); font-size: 11px; }
|
|
133
|
+
.filter.active { color: #092016; border-color: var(--accent); background: var(--accent); }
|
|
134
|
+
.task-list { display: grid; gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); max-height: 620px; overflow: auto; }
|
|
135
|
+
.task-row { position: relative; display: grid; grid-template-columns: 7px 1fr auto; gap: 13px; width: 100%; padding: 16px 14px 15px 0; border: 0; text-align: left; background: var(--surface); cursor: pointer; }
|
|
136
|
+
.task-row:hover, .task-row.selected { background: var(--raised); }
|
|
137
|
+
.task-row.selected::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--accent); pointer-events: none; }
|
|
138
|
+
.status-line { width: 3px; height: 100%; justify-self: center; background: var(--dim); }
|
|
139
|
+
.status-line.running { background: var(--running); } .status-line.queued { background: var(--queued); } .status-line.blocked { background: var(--blocked); } .status-line.failed { background: var(--failed); } .status-line.paused { background: var(--paused); }
|
|
140
|
+
.task-copy { min-width: 0; }
|
|
141
|
+
.task-meta { display: flex; gap: 8px; margin-bottom: 7px; color: var(--muted); font: 10px "Cascadia Code", monospace; text-transform: uppercase; letter-spacing: .08em; }
|
|
142
|
+
.task-title { display: block; margin-bottom: 6px; overflow: hidden; color: var(--ink); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
|
|
143
|
+
.task-description { display: block; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
|
|
144
|
+
.task-time { color: var(--dim); font: 10px "Cascadia Code", monospace; white-space: nowrap; }
|
|
145
|
+
.detail-empty { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
|
|
146
|
+
.detail-empty p { max-width: 300px; margin-top: 10px; line-height: 1.6; }
|
|
147
|
+
.crosshair { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px; border: 1px dashed var(--line-strong); color: var(--accent); font: 28px "Cascadia Code", monospace; }
|
|
148
|
+
.detail-content { position: relative; animation: reveal .28s cubic-bezier(.22,1,.36,1); }
|
|
149
|
+
.detail-close { position: absolute; top: 0; right: 0; }
|
|
150
|
+
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
|
|
151
|
+
.detail-kicker { color: var(--accent); font: 11px "Cascadia Code", monospace; text-transform: uppercase; letter-spacing: .12em; }
|
|
152
|
+
.detail-title { max-width: 760px; margin: 10px 0 14px; font-size: clamp(25px, 3vw, 40px); line-height: 1.05; letter-spacing: -.04em; }
|
|
153
|
+
.detail-description { max-width: 760px; color: var(--muted); line-height: 1.7; }
|
|
154
|
+
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0; border-block: 1px solid var(--line); }
|
|
155
|
+
.detail-stat { padding: 16px 12px 16px 0; }
|
|
156
|
+
.detail-stat span { display: block; color: var(--dim); font: 10px "Cascadia Code", monospace; text-transform: uppercase; }
|
|
157
|
+
.detail-stat strong { display: block; margin-top: 7px; font: 600 14px "Cascadia Code", monospace; }
|
|
158
|
+
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
|
|
159
|
+
.action-button { padding: 9px 14px; }
|
|
160
|
+
.action-button.primary { color: #092016; border-color: var(--accent); background: var(--accent); }
|
|
161
|
+
.action-button.danger { color: var(--failed); border-color: color-mix(in srgb, var(--failed) 65%, var(--line)); }
|
|
162
|
+
.event-log { display: grid; gap: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
|
|
163
|
+
.event-log li { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
|
|
164
|
+
.event-log time { color: var(--dim); font: 10px "Cascadia Code", monospace; }
|
|
165
|
+
.activity-panel { padding: 28px 0; }
|
|
166
|
+
.activity-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; padding: 0; list-style: none; }
|
|
167
|
+
.activity-list li { display: grid; grid-template-columns: 88px 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
|
|
168
|
+
.activity-list time, .activity-type { color: var(--dim); font: 10px "Cascadia Code", monospace; }
|
|
169
|
+
.boundary-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 18px; border-top: 1px solid var(--line-strong); color: var(--dim); font: 10px "Cascadia Code", monospace; text-transform: uppercase; letter-spacing: .08em; }
|
|
170
|
+
.boundary-bar span::before { content: "□"; margin-right: 7px; color: var(--accent); }
|
|
171
|
+
.skeleton-stack { background: transparent; border: 0; }
|
|
172
|
+
.skeleton { height: 78px; margin-bottom: 1px; background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: scan 1.4s linear infinite; }
|
|
173
|
+
@keyframes scan { to { background-position: -200% 0; } }
|
|
174
|
+
.muted, .empty-copy { color: var(--muted); }
|
|
175
|
+
.empty-copy { padding: 34px 20px; text-align: center; background: var(--surface); }
|
|
176
|
+
.error-copy { color: var(--failed); }
|
|
177
|
+
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid var(--line-strong); background: var(--raised); box-shadow: 0 16px 50px #0008; font-size: 13px; }
|
|
178
|
+
.toast.error { border-color: var(--failed); }
|
|
179
|
+
@media (max-width: 880px) {
|
|
180
|
+
.shell { padding: 18px; }
|
|
181
|
+
.topbar { align-items: flex-start; }
|
|
182
|
+
.runtime-strip { flex-wrap: wrap; justify-content: flex-end; }
|
|
183
|
+
.summary-band { grid-template-columns: repeat(3, 1fr); }
|
|
184
|
+
.summary-band > * { min-height: 68px; padding: 13px; }
|
|
185
|
+
.summary-band time { align-items: flex-start; text-align: left; }
|
|
186
|
+
.workbench { display: block; }
|
|
187
|
+
.task-rail { padding-right: 0; border-right: 0; }
|
|
188
|
+
.detail-pane { position: fixed; inset: auto 0 0; z-index: 8; max-height: 78vh; padding: 24px 20px; overflow: auto; border-top: 1px solid var(--accent); background: var(--ground); transform: translateY(105%); transition: transform .28s cubic-bezier(.22,1,.36,1); }
|
|
189
|
+
.detail-pane.open { transform: none; }
|
|
190
|
+
.detail-empty { display: none; }
|
|
191
|
+
.detail-grid { grid-template-columns: repeat(2, 1fr); }
|
|
192
|
+
.activity-list { grid-template-columns: 1fr; }
|
|
193
|
+
}
|
|
194
|
+
@media (max-width: 560px) {
|
|
195
|
+
.brand-mark { width: 38px; }
|
|
196
|
+
.runtime-strip .divider, #source-label { display: none; }
|
|
197
|
+
.summary-band { grid-template-columns: repeat(2, 1fr); }
|
|
198
|
+
.summary-lead { grid-column: span 2; }
|
|
199
|
+
.summary-band time { grid-column: span 2; }
|
|
200
|
+
.task-rail { padding-top: 22px; }
|
|
201
|
+
.activity-list li { grid-template-columns: 72px 88px 1fr; }
|
|
202
|
+
}
|
|
203
|
+
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
|
|
204
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { MetricEvent } from "../metrics/types.js";
|
|
2
|
+
import type { MissionStatus } from "../mission/types.js";
|
|
3
|
+
import type { SessionTaskStatus } from "../session/session-scheduler.js";
|
|
4
|
+
import type { WorkflowCheckpoint } from "../workflow-types.js";
|
|
5
|
+
export type DashboardTaskKind = "mission" | "loop" | "workflow";
|
|
6
|
+
export type DashboardTaskStatus = "queued" | "running" | "blocked" | "paused" | "succeeded" | "failed" | "canceled";
|
|
7
|
+
export type DashboardTaskAction = "pause" | "resume" | "cancel" | "retry";
|
|
8
|
+
export interface DashboardTask {
|
|
9
|
+
id: string;
|
|
10
|
+
kind: DashboardTaskKind;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
status: DashboardTaskStatus;
|
|
14
|
+
rawStatus: MissionStatus | SessionTaskStatus | WorkflowCheckpoint["status"];
|
|
15
|
+
source: "daemon" | "local" | "session";
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
updatedAt: number;
|
|
19
|
+
startedAt?: number;
|
|
20
|
+
endedAt?: number;
|
|
21
|
+
nextRunAt?: number;
|
|
22
|
+
progress?: {
|
|
23
|
+
turns?: number;
|
|
24
|
+
tokens?: number;
|
|
25
|
+
toolCalls?: number;
|
|
26
|
+
};
|
|
27
|
+
error?: {
|
|
28
|
+
code?: string;
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
31
|
+
actions: DashboardTaskAction[];
|
|
32
|
+
}
|
|
33
|
+
export interface DashboardSnapshot {
|
|
34
|
+
generatedAt: number;
|
|
35
|
+
revision: string;
|
|
36
|
+
runtime: {
|
|
37
|
+
ready: boolean;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
daemonHealthy: boolean;
|
|
40
|
+
daemonSource: "daemon" | "local";
|
|
41
|
+
permissionMode: string;
|
|
42
|
+
};
|
|
43
|
+
summary: Record<DashboardTaskStatus | "total", number>;
|
|
44
|
+
tasks: DashboardTask[];
|
|
45
|
+
activity: MetricEvent[];
|
|
46
|
+
boundary: {
|
|
47
|
+
localOnly: true;
|
|
48
|
+
activityTruncated: boolean;
|
|
49
|
+
activityScannedBytes: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface DashboardTaskDetail {
|
|
53
|
+
task: DashboardTask;
|
|
54
|
+
detail: Record<string, unknown>;
|
|
55
|
+
events: Array<Record<string, unknown>>;
|
|
56
|
+
}
|
|
57
|
+
export interface DashboardControlResult {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
source: "daemon" | "local";
|
|
60
|
+
task?: DashboardTask;
|
|
61
|
+
message: string;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAChE,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,UAAU,CAAC;AACf,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,aAAa,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5E,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC;QACjC,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,mBAAmB,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE;QACR,SAAS,EAAE,IAAI,CAAC;QAChB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { AgentLoop } from "./agent-loop.js";
|
|
2
|
+
import type { MetricsCollector } from "./metrics/collector.js";
|
|
3
|
+
import type { WorkflowRuntime } from "./workflow-runtime.js";
|
|
4
4
|
export interface DashboardOptions {
|
|
5
5
|
port: number;
|
|
6
6
|
collector: MetricsCollector;
|
|
@@ -9,10 +9,30 @@ export interface DashboardOptions {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class DashboardServer {
|
|
11
11
|
private server;
|
|
12
|
-
private options;
|
|
12
|
+
private readonly options;
|
|
13
|
+
private snapshotCache;
|
|
14
|
+
private daemonHealthy;
|
|
15
|
+
private daemonTimer;
|
|
16
|
+
private clientSource;
|
|
13
17
|
listening: boolean;
|
|
14
18
|
constructor(options: DashboardOptions);
|
|
15
19
|
start(): Promise<void>;
|
|
16
20
|
stop(): void;
|
|
21
|
+
private setSecurityHeaders;
|
|
22
|
+
private sameOriginAllowed;
|
|
23
|
+
private handleRequest;
|
|
24
|
+
private serveSnapshot;
|
|
25
|
+
private getSnapshot;
|
|
26
|
+
private buildTaskDetail;
|
|
27
|
+
private controlTask;
|
|
28
|
+
private controlMissionViaDaemon;
|
|
29
|
+
private probeDaemon;
|
|
30
|
+
private permissionsReport;
|
|
31
|
+
private getStateDir;
|
|
32
|
+
private getSessionId;
|
|
33
|
+
private getPermissionMode;
|
|
34
|
+
private daemonUrl;
|
|
35
|
+
private actionLabel;
|
|
36
|
+
private invalidateSnapshot;
|
|
17
37
|
}
|
|
18
38
|
//# sourceMappingURL=dashboard-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-server.d.ts","sourceRoot":"","sources":["../src/dashboard-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-server.d.ts","sourceRoot":"","sources":["../src/dashboard-server.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAUjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,gBAAgB,CAAC;IAC5B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;CACtB;AA2DD,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,YAAY,CAAuB;IACpC,SAAS,UAAS;gBAEb,OAAO,EAAE,gBAAgB;IAI/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB5B,IAAI,IAAI,IAAI;IAOZ,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,iBAAiB;YAMX,aAAa;YAmHb,aAAa;YAeb,WAAW;YAoDX,eAAe;YAgCf,WAAW;YAsCX,uBAAuB;YAwBvB,WAAW;IAgBzB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,kBAAkB;CAG3B"}
|