@andorra-labs/code 0.1.9 → 0.1.11
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/README.md +28 -208
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/dist/src/agent-execution.js +56 -0
- package/dist/src/app-server/protocol.d.ts +109 -1
- package/dist/src/app-server/protocol.js +8 -1
- package/dist/src/app-server.d.ts +59 -1
- package/dist/src/app-server.js +418 -63
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +17 -1
- package/dist/src/auth/store.js +25 -2
- package/dist/src/automation-service.js +1 -1
- package/dist/src/browser-session.d.ts +8 -0
- package/dist/src/browser-session.js +27 -1
- package/dist/src/browser-ui/app.js +255 -33
- package/dist/src/browser-ui/index.html +9 -9
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/cli.js +10 -5
- package/dist/src/coding-tools.d.ts +24 -0
- package/dist/src/coding-tools.js +71 -8
- package/dist/src/command-screens.js +1 -1
- package/dist/src/commands.d.ts +1 -1
- package/dist/src/commands.js +2 -2
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +9 -1
- package/dist/src/completion.js +20 -2
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/decision/checks.js +1 -1
- package/dist/src/file-diff.d.ts +105 -0
- package/dist/src/file-diff.js +244 -0
- package/dist/src/graph-manager-chat.js +4 -4
- package/dist/src/graph-runner.js +39 -2
- package/dist/src/graph-sync.d.ts +8 -0
- package/dist/src/graph-sync.js +54 -3
- package/dist/src/graph-tool.js +1 -1
- package/dist/src/graph-ui/app.js +303 -129
- package/dist/src/graph-ui/controls.css +43 -22
- package/dist/src/graph-ui/controls.js +31 -1
- package/dist/src/graph-ui/embed.js +56 -7
- package/dist/src/graph-ui/icons.js +5 -0
- package/dist/src/graph-ui/index.html +3 -3
- package/dist/src/graph-ui/manager-state.js +2 -2
- package/dist/src/graph-ui/manager.css +19 -18
- package/dist/src/graph-ui/manager.js +5 -5
- package/dist/src/graph-ui/skill-picker.js +5 -5
- package/dist/src/graph-ui/studio-canvas.js +16 -16
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +99 -42
- package/dist/src/graph-ui/style.css +125 -80
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +10 -3
- package/dist/src/graphs.js +15 -4
- package/dist/src/mcp.d.ts +75 -0
- package/dist/src/mcp.js +240 -8
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/provider-keys.d.ts +5 -1
- package/dist/src/provider-keys.js +7 -3
- package/dist/src/provider-settings.d.ts +4 -1
- package/dist/src/provider-settings.js +46 -5
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/qa/guidance.js +6 -19
- package/dist/src/qa/index.d.ts +0 -2
- package/dist/src/qa/index.js +0 -2
- package/dist/src/qa/profile/QaProfile.d.ts +5 -1
- package/dist/src/qa/profile/QaProfile.js +6 -2
- package/dist/src/qa/tools.d.ts +19 -1
- package/dist/src/qa/tools.js +20 -145
- package/dist/src/react-runtime.js +134 -16
- package/dist/src/read-document-doc.d.ts +20 -0
- package/dist/src/read-document-doc.js +524 -0
- package/dist/src/read-document-docx.d.ts +21 -0
- package/dist/src/read-document-docx.js +584 -0
- package/dist/src/read-document-text.d.ts +29 -0
- package/dist/src/read-document-text.js +67 -0
- package/dist/src/read-document-tool.d.ts +48 -0
- package/dist/src/read-document-tool.js +162 -0
- package/dist/src/read-document.d.ts +78 -0
- package/dist/src/read-document.js +353 -0
- package/dist/src/read-image.d.ts +29 -2
- package/dist/src/read-image.js +42 -17
- package/dist/src/remote/engine-pool.js +18 -6
- package/dist/src/runtime.d.ts +19 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/screen-selection.d.ts +38 -0
- package/dist/src/screen-selection.js +103 -0
- package/dist/src/session-changes.d.ts +122 -0
- package/dist/src/session-changes.js +804 -0
- package/dist/src/side-panel.d.ts +6 -1
- package/dist/src/side-panel.js +12 -10
- package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
- package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
- package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
- package/dist/src/skills/bundled/provenance.json +4 -4
- package/dist/src/skills/runtime-skills.js +3 -3
- package/dist/src/stall-recovery.d.ts +15 -0
- package/dist/src/stall-recovery.js +17 -0
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +1 -2
- package/dist/src/terminal-ui.d.ts +64 -20
- package/dist/src/terminal-ui.js +312 -82
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tool-diff-stats.d.ts +9 -0
- package/dist/src/tool-diff-stats.js +20 -0
- package/dist/src/tool-names.d.ts +1 -1
- package/dist/src/tool-result-filter.js +1 -1
- package/dist/src/tools.js +118 -9
- package/dist/src/transcript.d.ts +11 -0
- package/dist/src/transcript.js +15 -3
- package/dist/src/types.d.ts +12 -0
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/package.json +6 -26
- package/dist/src/qa/api/http-runner.d.ts +0 -3
- package/dist/src/qa/api/http-runner.js +0 -47
- package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
- package/dist/src/qa/git/ChangeDetector.js +0 -177
- package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
- package/dist/src/qa/git/DiffReviewer.js +0 -115
- package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
- package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
- package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
- package/dist/src/qa/orchestrator/MergeGate.js +0 -40
- package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
- package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
- package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
- package/dist/src/qa/runners/CommandRunner.js +0 -96
- package/dist/src/qa/runners/TestRunner.d.ts +0 -21
- package/dist/src/qa/runners/TestRunner.js +0 -66
- package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
- package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
- package/dist/src/qa/runtime-detect.d.ts +0 -10
- package/dist/src/qa/runtime-detect.js +0 -72
- package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
- package/dist/src/qa/security/DependencyScanner.js +0 -167
- package/dist/src/qa/security/SecretScanner.d.ts +0 -3
- package/dist/src/qa/security/SecretScanner.js +0 -55
- package/docs/README.md +0 -36
- package/docs/agents/README.md +0 -62
- package/docs/agents/install-for-agents.md +0 -56
- package/docs/agents/mcp-server.md +0 -212
- package/docs/agents/subagent-mode.md +0 -149
- package/docs/concepts/README.md +0 -47
- package/docs/concepts/jev-actionable-routing.md +0 -113
- package/docs/concepts/jev-decision-thresholds.md +0 -412
- package/docs/concepts/jev-efficiency.md +0 -217
- package/docs/concepts/jev-eval-2026-11-01.md +0 -78
- package/docs/concepts/limits.md +0 -52
- package/docs/concepts/memory.md +0 -10
- package/docs/concepts/security.md +0 -50
- package/docs/concepts/workspace-instructions.md +0 -29
- package/docs/getting-started/README.md +0 -82
- package/docs/getting-started/accounts.md +0 -78
- package/docs/getting-started/configure-providers.md +0 -132
- package/docs/guides/README.md +0 -13
- package/docs/guides/browser.md +0 -39
- package/docs/guides/desktop-app.md +0 -414
- package/docs/guides/extensions.md +0 -102
- package/docs/guides/graph-builder.md +0 -116
- package/docs/guides/headless.md +0 -46
- package/docs/guides/tui.md +0 -75
- package/docs/guides/update.md +0 -70
- package/docs/guides/web-search.md +0 -51
- package/docs/guides/windows-code-signing.md +0 -319
- package/docs/llms.txt +0 -45
- package/docs/reference/README.md +0 -7
- package/docs/reference/cli.md +0 -76
- package/docs/reference/config.md +0 -91
- package/docs/reference/slash-commands.md +0 -59
- package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
- package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
- package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
- package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
- package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
- package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
- package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
- package/scripts/jev-efficiency-eval.mjs +0 -187
- package/scripts/jev-efficiency-live.mjs +0 -193
- package/scripts/zcode-engine-replay.mjs +0 -223
- package/tests/agent-centric-mcp-test-plan.md +0 -208
- package/tests/analytics-settings-test-plan.md +0 -165
- package/tests/browser-cli-smoke.mjs +0 -276
- package/tests/browser-test-plan.md +0 -280
- package/tests/chat-side-panel-test-plan.md +0 -309
- package/tests/decision-engine-test-plan.md +0 -163
- package/tests/default-active-jev-test-plan.md +0 -85
- package/tests/harness-extensions-test-plan.md +0 -113
- package/tests/jev-all-decisions-test-plan.md +0 -156
- package/tests/jev-efficiency/criteria.json +0 -158
- package/tests/jev-efficiency/workloads.mjs +0 -242
- package/tests/jev-efficiency-test-plan.md +0 -198
- package/tests/permissions-sandbox-probe.mjs +0 -74
- package/tests/permissions-test-plan.md +0 -191
- package/tests/product-telemetry-test-plan.md +0 -536
- package/tests/thinking-stream-preview-test-plan.md +0 -136
- package/tests/zcode-react-engine-test-plan.md +0 -396
|
@@ -57,6 +57,174 @@
|
|
|
57
57
|
// The page's static controls name their glyph with a placeholder; each takes its icon here, once.
|
|
58
58
|
for (const slot of document.querySelectorAll('[data-icon]')) slot.replaceWith(icon(slot.dataset.icon, Number(slot.dataset.size) || 16));
|
|
59
59
|
function text(value) { return typeof value === 'string' ? value : value == null ? '' : JSON.stringify(value, null, 2); }
|
|
60
|
+
// Words a person reads, with their inline code set as code: a `span` between single backticks
|
|
61
|
+
// becomes a <code> element holding the span as text. Nothing else is interpreted — no markup is
|
|
62
|
+
// parsed, so the words stay literal text however they were written — and a value with no code
|
|
63
|
+
// span is one text node, as before.
|
|
64
|
+
function prose(tag, className, value) {
|
|
65
|
+
const el = element(tag, className); const source = String(value ?? '');
|
|
66
|
+
const parts = source.split(/`([^`\n]+)`/);
|
|
67
|
+
if (parts.length === 1) { el.textContent = source; return el; }
|
|
68
|
+
parts.forEach((part, index) => { if (index % 2) el.append(element('code', '', part)); else if (part) el.append(part); });
|
|
69
|
+
return el;
|
|
70
|
+
}
|
|
71
|
+
// Inline code, as CommonMark reads it: a run of n backticks opens a span that the next run of exactly
|
|
72
|
+
// n closes, so ``a`b`` holds a backtick and a run with no partner is literal text. One space just
|
|
73
|
+
// inside both ends is padding and is dropped; a line break inside a span reads as a space.
|
|
74
|
+
function codeSpans(source) {
|
|
75
|
+
const tokens = []; let text = '', at = 0;
|
|
76
|
+
const runEnd = from => { let end = from; while (source[end] === '`') end++; return end; };
|
|
77
|
+
while (at < source.length) {
|
|
78
|
+
if (source[at] !== '`') { text += source[at++]; continue; }
|
|
79
|
+
const open = runEnd(at), ticks = open - at;
|
|
80
|
+
let close = -1;
|
|
81
|
+
for (let scan = source.indexOf('`', open); scan >= 0; scan = source.indexOf('`', runEnd(scan))) {
|
|
82
|
+
if (runEnd(scan) - scan === ticks) { close = scan; break; }
|
|
83
|
+
}
|
|
84
|
+
if (close < 0) { text += source.slice(at, open); at = open; continue; }
|
|
85
|
+
if (text) { tokens.push(text); text = ''; }
|
|
86
|
+
let code = source.slice(open, close).replace(/\n/g, ' ');
|
|
87
|
+
if (code.length > 2 && code[0] === ' ' && code.at(-1) === ' ' && code.trim()) code = code.slice(1, -1);
|
|
88
|
+
tokens.push({ code });
|
|
89
|
+
at = close + ticks;
|
|
90
|
+
}
|
|
91
|
+
if (text) tokens.push(text);
|
|
92
|
+
return tokens;
|
|
93
|
+
}
|
|
94
|
+
// A span of an answer's text: its code spans set as code and **bold** as strong, each holding its words
|
|
95
|
+
// as text. Bold pairs its markers in order, outside code spans; a marker left without a partner stays
|
|
96
|
+
// as typed, as do underscores and single asterisks.
|
|
97
|
+
function inline(el, source) {
|
|
98
|
+
const pieces = [];
|
|
99
|
+
for (const token of codeSpans(String(source))) {
|
|
100
|
+
if (typeof token !== 'string') pieces.push(token);
|
|
101
|
+
else for (const part of token.split(/(\*\*)/)) if (part) pieces.push(part === '**' ? { marker: true } : part);
|
|
102
|
+
}
|
|
103
|
+
let pairs = pieces.filter(piece => piece.marker).length & ~1, target = el;
|
|
104
|
+
for (const piece of pieces) {
|
|
105
|
+
if (piece.marker && pairs > 0) {
|
|
106
|
+
pairs--;
|
|
107
|
+
if (target === el) { target = element('strong'); el.append(target); } else target = el;
|
|
108
|
+
} else if (piece.marker) target.append('**');
|
|
109
|
+
else if (typeof piece === 'string') target.append(piece);
|
|
110
|
+
else target.append(element('code', '', piece.code));
|
|
111
|
+
}
|
|
112
|
+
return el;
|
|
113
|
+
}
|
|
114
|
+
// An answer's Markdown, the subset a run's summary uses: headings, bullet and numbered lists, fenced
|
|
115
|
+
// code, paragraphs, and inline code and bold. Each block is an element built here with its words set
|
|
116
|
+
// as text (`inline`), so no markup in an answer is ever parsed as HTML, and anything else — tables,
|
|
117
|
+
// links, quotes — stays as the literal text it was written as.
|
|
118
|
+
//
|
|
119
|
+
// The structure is CommonMark's container model: a list item's content — its first line and every
|
|
120
|
+
// line that belongs to it, with the item's indentation removed — is a document of its own, read by
|
|
121
|
+
// the same block parser. So whatever an answer can open with, an item can too, on its first line or
|
|
122
|
+
// later: a fence (`- ```js`), a heading, a nested list (`- - x`), a paragraph. The block rules:
|
|
123
|
+
// - a fence is three or more backticks or tildes; only a bare line of the same character, at least as
|
|
124
|
+
// long, closes it (a four-backtick block can show a three-backtick example), and a fence left open
|
|
125
|
+
// runs to the end of the document it is in;
|
|
126
|
+
// - a line belongs to an item when it is indented to the item's text, or when it is a plain line
|
|
127
|
+
// that continues the item's paragraph (lazy continuation); a blank line keeps the item open only
|
|
128
|
+
// if the next line is indented under it, and a blank line between two items keeps one list.
|
|
129
|
+
const MD_FENCE = /^( {0,3})(`{3,}|~{3,})(.*)$/;
|
|
130
|
+
const MD_HEADING = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/;
|
|
131
|
+
const MD_ITEM = /^( {0,3})([-*+]|\d{1,9}[.)])(?:( +)(.*))?$/;
|
|
132
|
+
const mdIndent = line => line.length - line.trimStart().length;
|
|
133
|
+
const mdFence = line => { const open = MD_FENCE.exec(line); return open && !(open[2][0] === '`' && open[3].includes('`')) ? open : null; };
|
|
134
|
+
const mdBlank = line => !line.trim();
|
|
135
|
+
const mdStartsBlock = line => !!mdFence(line) || MD_HEADING.test(line) || MD_ITEM.test(line);
|
|
136
|
+
/** Whether a fence opened in these lines is still open at their end. */
|
|
137
|
+
function mdFenceOpen(lines) {
|
|
138
|
+
let open = null;
|
|
139
|
+
for (const line of lines) {
|
|
140
|
+
if (open) { if (new RegExp(`^ {0,3}\\${open.mark}{${open.length},}[ \\t]*$`).test(line)) open = null; }
|
|
141
|
+
else { const fence = mdFence(line); if (fence) open = { mark: fence[2][0], length: fence[2].length }; }
|
|
142
|
+
}
|
|
143
|
+
return !!open;
|
|
144
|
+
}
|
|
145
|
+
/** Read `lines` as a document into `container`. In an item (`bare`) a paragraph is the item's own text
|
|
146
|
+
* rather than a <p>, as a list item's text is in the desktop's transcript. */
|
|
147
|
+
function mdBlocks(container, lines, bare) {
|
|
148
|
+
let paragraph = [], tail = 'none';
|
|
149
|
+
const place = node => { container.append(node); tail = 'block'; };
|
|
150
|
+
const flush = () => {
|
|
151
|
+
if (!paragraph.length) return;
|
|
152
|
+
const text = paragraph.join('\n'); paragraph = [];
|
|
153
|
+
if (!bare) { place(inline(element('p'), text)); return; }
|
|
154
|
+
if (tail === 'text') container.append('\n\n');
|
|
155
|
+
inline(container, text); tail = 'text';
|
|
156
|
+
};
|
|
157
|
+
for (let index = 0; index < lines.length;) {
|
|
158
|
+
const line = lines[index];
|
|
159
|
+
if (mdBlank(line)) { flush(); index++; continue; }
|
|
160
|
+
const fence = mdFence(line);
|
|
161
|
+
if (fence) {
|
|
162
|
+
flush();
|
|
163
|
+
const mark = fence[2][0], length = fence[2].length, pad = fence[1].length, code = [];
|
|
164
|
+
const closes = new RegExp(`^ {0,3}\\${mark}{${length},}[ \\t]*$`);
|
|
165
|
+
for (index++; index < lines.length && !closes.test(lines[index]); index++) code.push(lines[index].slice(Math.min(pad, mdIndent(lines[index]))));
|
|
166
|
+
index++;
|
|
167
|
+
const pre = element('pre'); pre.append(element('code', '', code.join('\n'))); place(pre);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const heading = MD_HEADING.exec(line);
|
|
171
|
+
if (heading) {
|
|
172
|
+
flush();
|
|
173
|
+
const level = heading[1].length, title = inline(element('div', 'markdown-heading'), heading[2] ?? '');
|
|
174
|
+
title.setAttribute('role', 'heading'); title.setAttribute('aria-level', String(level)); title.dataset.level = String(Math.min(level, 4));
|
|
175
|
+
place(title); index++;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (MD_ITEM.test(line)) { flush(); index = mdList(lines, index, place); continue; }
|
|
179
|
+
paragraph.push(line.trim()); index++;
|
|
180
|
+
}
|
|
181
|
+
flush();
|
|
182
|
+
}
|
|
183
|
+
/** Read the list starting at `lines[start]`; return the index after it. */
|
|
184
|
+
function mdList(lines, start, place) {
|
|
185
|
+
const first = MD_ITEM.exec(lines[start]);
|
|
186
|
+
const ordered = /\d/.test(first[2]), kind = ordered ? first[2].slice(-1) : first[2];
|
|
187
|
+
const list = element(ordered ? 'ol' : 'ul');
|
|
188
|
+
if (ordered && parseInt(first[2], 10) !== 1) list.start = parseInt(first[2], 10);
|
|
189
|
+
place(list);
|
|
190
|
+
let index = start;
|
|
191
|
+
while (index < lines.length) {
|
|
192
|
+
const item = MD_ITEM.exec(lines[index]);
|
|
193
|
+
if (!item || (/\d/.test(item[2]) ? item[2].slice(-1) : item[2]) !== kind || /\d/.test(item[2]) !== ordered) break;
|
|
194
|
+
// The item's text starts one to four spaces after its marker; more than four is one space and the
|
|
195
|
+
// rest is text. Its content is that text and every following line that belongs to it.
|
|
196
|
+
const gap = item[3]?.length ?? 1, wide = gap > 4;
|
|
197
|
+
const column = item[1].length + item[2].length + (wide ? 1 : gap);
|
|
198
|
+
const content = [wide ? item[3].slice(1) + (item[4] ?? '') : item[4] ?? ''];
|
|
199
|
+
for (index++; index < lines.length; index++) {
|
|
200
|
+
const line = lines[index];
|
|
201
|
+
if (mdBlank(line)) {
|
|
202
|
+
// A blank line stays in the item only if the next text is indented under it.
|
|
203
|
+
let next = index; while (next < lines.length && mdBlank(lines[next])) next++;
|
|
204
|
+
if (next < lines.length && mdIndent(lines[next]) >= column) { for (; index < next; index++) content.push(''); index--; continue; }
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
if (mdIndent(line) >= column) { content.push(line.slice(column)); continue; }
|
|
208
|
+
// A plain line right after the item's paragraph continues it (lazy continuation).
|
|
209
|
+
const previous = content.at(-1);
|
|
210
|
+
if (previous && !mdBlank(previous) && !mdStartsBlock(line) && !mdFenceOpen(content) && !MD_HEADING.test(previous) && !MD_FENCE.test(previous)) { content.push(line); continue; }
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
const li = element('li'); mdBlocks(li, content, true); list.append(li);
|
|
214
|
+
// Blank lines between two items of the list keep it one list.
|
|
215
|
+
let next = index; while (next < lines.length && mdBlank(lines[next])) next++;
|
|
216
|
+
const sibling = next < lines.length && MD_ITEM.exec(lines[next]);
|
|
217
|
+
if (!sibling || (/\d/.test(sibling[2]) ? sibling[2].slice(-1) : sibling[2]) !== kind) break;
|
|
218
|
+
index = next;
|
|
219
|
+
}
|
|
220
|
+
return index;
|
|
221
|
+
}
|
|
222
|
+
function markdown(className, value) {
|
|
223
|
+
const root = element('div', className ? `${className} markdown` : 'markdown');
|
|
224
|
+
const lines = String(value ?? '').replace(/\r\n?/g, '\n').split('\n').map(line => line.replace(/^\t+/, tabs => ' '.repeat(tabs.length)));
|
|
225
|
+
mdBlocks(root, lines, false);
|
|
226
|
+
return root;
|
|
227
|
+
}
|
|
60
228
|
function error(value, id = 'error', source = 'action') {
|
|
61
229
|
if (id === 'error') globalErrorSource = value ? source : null;
|
|
62
230
|
$(id).textContent = value || ''; $(id).hidden = !value;
|
|
@@ -159,9 +327,9 @@
|
|
|
159
327
|
const sessionRow = s => {
|
|
160
328
|
// The status mark, always in the row's fixed 16px leading slot so the names keep one edge.
|
|
161
329
|
const kind = statusMark(s, unread);
|
|
162
|
-
const row = element('button', `session-row${s.id === selectedId ? ' active' : ''}${kind ? ` row-${kind}` : ''}`); row.setAttribute('aria-current', s.id === selectedId ? 'page' : 'false'); row.title = `${s.name || 'Untitled
|
|
330
|
+
const row = element('button', `session-row${s.id === selectedId ? ' active' : ''}${kind ? ` row-${kind}` : ''}`); row.setAttribute('aria-current', s.id === selectedId ? 'page' : 'false'); row.title = `${s.name || 'Untitled task'} · ${statusWord(s)} · Right-click for actions`;
|
|
163
331
|
const mark = element('span', `mark${kind ? ` ${kind}` : ''}`); if (kind) mark.append(element('span', 'sr-only', MARK_LABELS[kind]));
|
|
164
|
-
const timestamp = element('time', '', age(s.updatedAt)); timestamp.dateTime = s.updatedAt || ''; row.append(mark, element('span', 'name', s.name || 'Untitled
|
|
332
|
+
const timestamp = element('time', '', age(s.updatedAt)); timestamp.dateTime = s.updatedAt || ''; row.append(mark, element('span', 'name', s.name || 'Untitled task'), timestamp); row.onclick = () => select(s.id);
|
|
165
333
|
// From the keyboard the menu opens under the row: the menu key and Shift+F10 are taken here, and a
|
|
166
334
|
// contextmenu event a browser raises for them anyway arrives at (0, 0).
|
|
167
335
|
const atRow = () => { const box = row.getBoundingClientRect(); openMenu(s, box.left + 24, box.bottom, row); };
|
|
@@ -197,7 +365,7 @@
|
|
|
197
365
|
if (commitProjectMove(project, move)) focusProjectGrip(project);
|
|
198
366
|
};
|
|
199
367
|
const name = element('span', 'project-name'); name.append(icon('folder', 14), element('span', 'project-label', folder(workspace))); name.title = workspace;
|
|
200
|
-
const add = element('button', 'project-add'); add.append(icon('plus', 14)); add.type = 'button'; add.title = `New
|
|
368
|
+
const add = element('button', 'project-add'); add.append(icon('plus', 14)); add.type = 'button'; add.title = `New task in ${workspace}`; add.setAttribute('aria-label', add.title); add.onclick = () => createSession(undefined, list[0].id);
|
|
201
369
|
heading.append(grip, name, add); group.append(heading);
|
|
202
370
|
// Where the carried group would land: the edge of the group under the pointer, marked while the
|
|
203
371
|
// pointer is over it and cleared the moment it moves on, so the line always reads as the next
|
|
@@ -236,7 +404,7 @@
|
|
|
236
404
|
}
|
|
237
405
|
$('projects').append(group);
|
|
238
406
|
}
|
|
239
|
-
if (!sessions.length) $('projects').append(element('p', 'empty-projects', state.sessions.length ? 'No
|
|
407
|
+
if (!sessions.length) $('projects').append(element('p', 'empty-projects', state.sessions.length ? 'No tasks match your search or history setting.' : 'Your CLI tasks will appear here. Open a project to start a new one.'));
|
|
240
408
|
}
|
|
241
409
|
// Project arrangement: the order the groups are listed in, saved in localStorage and keyed by the
|
|
242
410
|
// server's opaque project identity, so redacted display paths that collide stay separate projects.
|
|
@@ -347,15 +515,27 @@
|
|
|
347
515
|
// ring), and a finished run not opened since it changed (a small muted dot). Anything else draws
|
|
348
516
|
// the empty slot.
|
|
349
517
|
const MARK_LABELS = { waiting: 'Needs your input', running: 'Running', failed: 'Failed', stopped: 'Stopped', unread: 'Finished, not yet opened' };
|
|
350
|
-
|
|
518
|
+
// Where a session stands, in the one set of words every surface here uses — the title strip's
|
|
519
|
+
// badge, a row's tooltip, the marks above. The engine's own status (`awaiting_input`,
|
|
520
|
+
// `infrastructure_error`, `succeeded`…) is an identifier and is never shown. A session with no run
|
|
521
|
+
// yet, or one in a state this page does not know, is Ready.
|
|
522
|
+
const STATUS_WORDS = { waiting: 'Needs your input', running: 'Running', failed: 'Failed', stopped: 'Stopped', finished: 'Finished' };
|
|
523
|
+
function statusKind(s) {
|
|
351
524
|
const status = String(s?.status || '');
|
|
352
525
|
if (s?.pending || ['waiting', 'awaiting_input', 'awaiting-input', 'needs_clarification'].includes(status)) return 'waiting';
|
|
353
526
|
if (running(s)) return 'running';
|
|
354
527
|
if (['error', 'failed', 'infrastructure_error', 'exhausted'].includes(status)) return 'failed';
|
|
355
528
|
if (['cancelled', 'interrupted', 'disconnected', 'stopped'].includes(status)) return 'stopped';
|
|
356
|
-
if (
|
|
529
|
+
if (['succeeded', 'completed'].includes(status)) return 'finished';
|
|
357
530
|
return '';
|
|
358
531
|
}
|
|
532
|
+
function statusWord(s) { return STATUS_WORDS[statusKind(s)] || 'Ready'; }
|
|
533
|
+
function statusMark(s, unread) {
|
|
534
|
+
const kind = statusKind(s);
|
|
535
|
+
// A finished run carries a mark only until it is opened: the record below says which are unread.
|
|
536
|
+
if (kind === 'finished' || !kind) return unread.has(s.id) ? 'unread' : '';
|
|
537
|
+
return kind;
|
|
538
|
+
}
|
|
359
539
|
// What this browser has seen of each session: the stamp it carried when it was last on screen. A
|
|
360
540
|
// session met for the first time is taken as read at that moment, so opening the workspace does not
|
|
361
541
|
// flag every finished session in the history window; a later finish moves its stamp past the record
|
|
@@ -385,7 +565,29 @@
|
|
|
385
565
|
}
|
|
386
566
|
function message(role, value, target = $('conversation')) {
|
|
387
567
|
if (!value) return;
|
|
388
|
-
|
|
568
|
+
// A person's words stay as written; Andorra's answer is Markdown, drawn in its safe subset.
|
|
569
|
+
const item = element('article', `message ${role}`); item.append(element('div', 'message-label', role === 'user' ? 'You' : 'Andorra'), role === 'user' ? prose('div', 'body', value) : markdown('body', value)); target.append(item);
|
|
570
|
+
}
|
|
571
|
+
// The words for what a run recorded, shared by the conversation's notes and the Activity log. An
|
|
572
|
+
// event's type (`graph.node.started`, `session.prompt`…) is an identifier and is never shown: a type
|
|
573
|
+
// this table does not name yet still reads as words, its parts with the product's own nouns.
|
|
574
|
+
const KIND_WORDS = {
|
|
575
|
+
'graph.started': 'Graph started', 'graph.completed': 'Graph finished', 'graph.stopped': 'Graph stopped',
|
|
576
|
+
'graph.node.started': 'Step started', 'graph.node.completed': 'Step finished', 'graph.node.failed': 'Step failed',
|
|
577
|
+
'graph.todos.updated': 'Plan updated', 'agent.modifier.todos.updated': 'Plan updated',
|
|
578
|
+
'node.tool.started': 'Tool started', 'node.tool.completed': 'Tool finished', 'node.tool.failed': 'Tool failed',
|
|
579
|
+
'node.model.response': 'Model response', 'agent.message': 'Message', 'node.assistant.message': 'Message', 'assistant.message': 'Message', 'agent.assistant.text': 'Message',
|
|
580
|
+
'subagent.started': 'Subagent started', 'subagent.completed': 'Subagent finished', 'browser.notice': 'Notice',
|
|
581
|
+
'session.prompt': 'Prompt', 'session.started': 'Task started', 'session.reopened': 'Task reopened', 'session.resumed': 'Task resumed', 'session.ended': 'Task ended', 'session.context': 'Context',
|
|
582
|
+
'run.started': 'Run started', 'run.finished': 'Run finished', 'run.steered': 'Direction added',
|
|
583
|
+
'model.request': 'Model request', 'model.response': 'Model response', 'model.error': 'Model error',
|
|
584
|
+
};
|
|
585
|
+
const KIND_NOUNS = { graph: 'graph', node: 'step', session: 'task', todos: 'plan' };
|
|
586
|
+
function kindWords(type) {
|
|
587
|
+
const kind = String(type || '');
|
|
588
|
+
if (Object.hasOwn(KIND_WORDS, kind)) return KIND_WORDS[kind];
|
|
589
|
+
const words = kind.split(/[._-]+/).filter(Boolean).map(part => KIND_NOUNS[part.toLowerCase()] || part.toLowerCase()).join(' ');
|
|
590
|
+
return words ? words[0].toUpperCase() + words.slice(1) : 'Event';
|
|
389
591
|
}
|
|
390
592
|
function renderConversation(s) {
|
|
391
593
|
const key = JSON.stringify([s?.id, s?.history, s?.events, s?.status, s?.prompt]);
|
|
@@ -393,7 +595,7 @@
|
|
|
393
595
|
const container = $('conversation'); const atBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 100;
|
|
394
596
|
const open = new Set([...container.querySelectorAll('details[open]')].map(d => d.dataset.key));
|
|
395
597
|
const oldScroll = container.scrollTop; container.replaceChildren();
|
|
396
|
-
if (!s) { const welcome = element('div', 'welcome'); const mark = element('img', 'welcome-mark'); mark.src = '/andorra-logo.png'; mark.alt = ''; welcome.append(mark, element('h1', '', 'A place for your work'), element('p', '', 'Select a
|
|
598
|
+
if (!s) { const welcome = element('div', 'welcome'); const mark = element('img', 'welcome-mark'); mark.src = '/andorra-logo.png'; mark.alt = ''; welcome.append(mark, element('h1', '', 'A place for your work'), element('p', '', 'Select a task or open a project to start.')); container.append(welcome); return; }
|
|
397
599
|
const events = s.events || [];
|
|
398
600
|
const completionSummaries = new Set((s.history || []).map(turn => text(turn.completion?.summary || turn.outcome?.completion?.summary || turn.outcome?.summary || (typeof turn.outcome === 'string' ? turn.outcome : ''))).filter(Boolean));
|
|
399
601
|
const tools = new Map();
|
|
@@ -411,7 +613,7 @@
|
|
|
411
613
|
if (!group) {
|
|
412
614
|
const disclosure = element('details', 'run-activity'); disclosure.dataset.key = `run-${runKey}`; disclosure.open = open.has(disclosure.dataset.key) || (running(s) && runKey === lastRunKey);
|
|
413
615
|
const stamp = event.time ? new Date(event.time).toLocaleString() : '';
|
|
414
|
-
disclosure.append(element('summary', '', `${runKey === 'session' ? '
|
|
616
|
+
disclosure.append(element('summary', '', `${runKey === 'session' ? 'Task' : 'Run'} activity${stamp ? ` · ${stamp}` : ''}`));
|
|
415
617
|
const body = element('div', 'activity-body'); disclosure.append(body); group = { disclosure, body, stream: '' }; activities.set(runKey, group);
|
|
416
618
|
}
|
|
417
619
|
const activity = group.body;
|
|
@@ -427,7 +629,7 @@
|
|
|
427
629
|
} else if (/text.*delta|delta.*text/.test(event.type)) { group.stream += text(data.delta || data.text); }
|
|
428
630
|
else if (event.type === 'browser.notice') activity.append(element('div', 'event-note', text(data.message)));
|
|
429
631
|
else if (event.type === 'node.model.response' || event.type === 'agent.message' || event.type === 'node.assistant.message' || event.type === 'assistant.message' || event.type === 'agent.assistant.text') { if (data.text || data.content) { const value = text(data.text || data.content); if (!completionSummaries.has(value)) message('assistant', value, activity); group.stream = ''; } }
|
|
430
|
-
else if (/failed|error|retry|subagent\.(started|completed)|graph.node.started/.test(event.type))
|
|
632
|
+
else if (/failed|error|retry|subagent\.(started|completed)|graph.node.started/.test(event.type)) { const detail = text(data.reason || data.message || data.nodeName || data.nodeId || data.role); activity.append(element('div', 'event-note', `${kindWords(event.type)}${detail ? ` · ${detail}` : ''}`)); }
|
|
431
633
|
}
|
|
432
634
|
for (const group of activities.values()) if (group.stream && !completionSummaries.has(group.stream)) message('assistant', group.stream, group.body);
|
|
433
635
|
// Associate each run's activity with its saved turn rather than replaying all
|
|
@@ -441,7 +643,7 @@
|
|
|
441
643
|
const completion = turn.completion || outcome?.completion;
|
|
442
644
|
const summary = text(completion?.summary) || (typeof outcome === 'string' ? outcome : text(outcome?.summary || outcome?.reason));
|
|
443
645
|
const tests = Array.isArray(completion?.tests) ? completion.tests : [];
|
|
444
|
-
message('assistant', [summary, tests.length ?
|
|
646
|
+
message('assistant', [summary, tests.length ? `### Tests\n${tests.map(result => `- ${text(result)}`).join('\n')}` : ''].filter(Boolean).join('\n\n'));
|
|
445
647
|
}
|
|
446
648
|
if (s.prompt) {
|
|
447
649
|
message('user', s.prompt);
|
|
@@ -451,18 +653,20 @@
|
|
|
451
653
|
}
|
|
452
654
|
for (const group of activities.values()) {
|
|
453
655
|
const summary = group.disclosure.querySelector('summary');
|
|
454
|
-
summary.textContent = summary.textContent.replace(/^(Run|
|
|
656
|
+
summary.textContent = summary.textContent.replace(/^(Run|Task) activity/, 'Earlier activity');
|
|
455
657
|
container.append(group.disclosure);
|
|
456
658
|
}
|
|
457
|
-
if (!container.childElementCount) container.append(element('p', 'muted', 'This
|
|
458
|
-
|
|
659
|
+
if (!container.childElementCount) container.append(element('p', 'muted', 'This task is ready. Send a prompt to begin.'));
|
|
660
|
+
// The run waiting on the person says the one phrase its card and badge say (P-ATN-07).
|
|
661
|
+
if (running(s)) container.append(element('div', 'event-note', s.pending ? 'Needs your input' : 'Andorra is working…'));
|
|
459
662
|
container.scrollTop = atBottom ? container.scrollHeight : oldScroll;
|
|
460
663
|
}
|
|
461
664
|
function renderPending(s) {
|
|
462
665
|
const pending = s?.pending; const key = JSON.stringify([s?.id, pending]);
|
|
463
666
|
if (key === pendingKey) return; pendingKey = key;
|
|
464
667
|
const panel = $('pending'); panel.hidden = !pending; panel.replaceChildren(); if (!pending) return;
|
|
465
|
-
|
|
668
|
+
// One phrase for a run waiting on the person, whatever it asks (P-ATN-07): the question says what.
|
|
669
|
+
panel.append(element('h3', '', 'Needs your input'), prose('p', '', pending.question || pending.message));
|
|
466
670
|
const form = element('form');
|
|
467
671
|
const answer = async value => answerSession(s, pending, value);
|
|
468
672
|
if (pending.kind === 'approval') {
|
|
@@ -490,7 +694,7 @@
|
|
|
490
694
|
function render() {
|
|
491
695
|
const s = current(); renderProjects(); renderConversation(s); renderPending(s); renderControls();
|
|
492
696
|
$('session-title').textContent = s?.name || 'Your workspace'; $('workspace-path').textContent = s?.workspace || ''; $('workspace-path').title = s?.workspace || '';
|
|
493
|
-
$('run-status').textContent = s
|
|
697
|
+
$('run-status').textContent = statusWord(s);
|
|
494
698
|
const todos = s?.todos || []; $('todos').replaceChildren();
|
|
495
699
|
// A to-do is a plain line in every state — the marker and the ink say where it stands; only the
|
|
496
700
|
// approval card above the composer is a card.
|
|
@@ -557,8 +761,17 @@
|
|
|
557
761
|
catch (e) { error(e.message); }
|
|
558
762
|
finally { if (themeSaving === saving) { themeSaving = null; refresh(); } }
|
|
559
763
|
};
|
|
764
|
+
// The toast: one notice at a time, its own close button, and Escape when nothing else claims the key.
|
|
560
765
|
let toastTimer;
|
|
561
|
-
function toast(value) { clearTimeout(toastTimer); $('toast').textContent = value; $('toast').hidden = false; toastTimer = setTimeout(
|
|
766
|
+
function toast(value) { clearTimeout(toastTimer); $('toast-text').textContent = value; $('toast').hidden = false; toastTimer = setTimeout(hideToast, 2500); }
|
|
767
|
+
function hideToast() {
|
|
768
|
+
clearTimeout(toastTimer); if ($('toast').hidden) return;
|
|
769
|
+
// The close button is about to vanish: a keyboard user who pressed it keeps a place on the page.
|
|
770
|
+
const hadFocus = $('toast').contains(document.activeElement);
|
|
771
|
+
$('toast').hidden = true;
|
|
772
|
+
if (hadFocus) $('conversation').focus();
|
|
773
|
+
}
|
|
774
|
+
$('toast-close').onclick = hideToast;
|
|
562
775
|
// The session menu: the desktop rail's right-click actions. It belongs to a session id, not a row, because
|
|
563
776
|
// the sidebar re-renders on every poll that changes it.
|
|
564
777
|
let menu = null;
|
|
@@ -573,13 +786,13 @@
|
|
|
573
786
|
const items = [
|
|
574
787
|
['Open', () => select(s.id)],
|
|
575
788
|
['Rename…', () => openRename(s), locked],
|
|
576
|
-
['View
|
|
789
|
+
['View Activity', () => openTrajectory(s)],
|
|
577
790
|
[archived(s) ? 'Unarchive' : 'Archive', () => setArchived(s, !archived(s)), locked],
|
|
578
|
-
['Copy
|
|
791
|
+
['Copy Task ID', () => navigator.clipboard.writeText(s.id).then(() => toast('Task ID copied'), () => error('Copying needs clipboard permission in this browser.'))],
|
|
579
792
|
null,
|
|
580
793
|
['Delete…', () => openDelete(s), locked, 'danger'],
|
|
581
794
|
];
|
|
582
|
-
const el = element('div', 'context-menu'); el.setAttribute('role', 'menu'); el.setAttribute('aria-label', `${s.name || 'Untitled
|
|
795
|
+
const el = element('div', 'context-menu'); el.setAttribute('role', 'menu'); el.setAttribute('aria-label', `${s.name || 'Untitled task'} actions`);
|
|
583
796
|
for (const item of items) {
|
|
584
797
|
if (!item) { const rule = element('div', 'menu-separator'); rule.setAttribute('role', 'separator'); el.append(rule); continue; }
|
|
585
798
|
const [label, run, disabled, kind] = item;
|
|
@@ -604,8 +817,15 @@
|
|
|
604
817
|
}
|
|
605
818
|
document.addEventListener('pointerdown', e => { if (menu && !menu.el.contains(e.target)) closeMenu(false); }, true);
|
|
606
819
|
// Escape is the way out of a drag as of everything else here: the carried group goes back, the
|
|
607
|
-
// landing line and any refresh that queued itself mid-drag go with it.
|
|
608
|
-
|
|
820
|
+
// landing line and any refresh that queued itself mid-drag go with it. With no drag it dismisses the
|
|
821
|
+
// toast, unless an open menu or dialog, or a field with text in it (a search box clears itself on
|
|
822
|
+
// Escape), has claimed the key.
|
|
823
|
+
document.addEventListener('keydown', e => {
|
|
824
|
+
if (e.key !== 'Escape' || e.isComposing) return;
|
|
825
|
+
if (projectDragId !== null) { endProjectDrag(); return; }
|
|
826
|
+
const field = e.target instanceof HTMLInputElement && e.target.value !== '';
|
|
827
|
+
if (!e.defaultPrevented && !menu && !field && !document.querySelector('dialog[open]')) hideToast();
|
|
828
|
+
});
|
|
609
829
|
addEventListener('blur', () => closeMenu(false)); addEventListener('resize', () => closeMenu(false));
|
|
610
830
|
$('projects').addEventListener('scroll', () => closeMenu(false));
|
|
611
831
|
let renaming = null, deleting = null;
|
|
@@ -615,27 +835,29 @@
|
|
|
615
835
|
if (await action(`/api/sessions/${encodeURIComponent(renaming)}/rename`, { name }, 'rename-error')) $('rename-dialog').close();
|
|
616
836
|
};
|
|
617
837
|
async function setArchived(s, value) {
|
|
618
|
-
if (await action(`/api/sessions/${encodeURIComponent(s.id)}/archive`, { archived: value })) toast(`${value ? 'Archived' : 'Restored'} “${s.name || 'Untitled
|
|
838
|
+
if (await action(`/api/sessions/${encodeURIComponent(s.id)}/archive`, { archived: value })) toast(`${value ? 'Archived' : 'Restored'} “${s.name || 'Untitled task'}”`);
|
|
619
839
|
}
|
|
620
840
|
function openDelete(s) {
|
|
621
841
|
deleting = s; error('', 'delete-error');
|
|
622
|
-
$('delete-text').textContent = `Delete “${s.name || 'Untitled
|
|
842
|
+
$('delete-text').textContent = `Delete “${s.name || 'Untitled task'}”? Its saved conversation is removed from this computer. Its activity log is kept.`;
|
|
623
843
|
$('delete-dialog').showModal(); $('delete-form').querySelector('footer [data-close]').focus();
|
|
624
844
|
}
|
|
625
845
|
$('delete-form').onsubmit = async e => {
|
|
626
846
|
e.preventDefault(); const s = deleting; if (!s) return;
|
|
627
|
-
if (await action(`/api/sessions/${encodeURIComponent(s.id)}/delete`, {}, 'delete-error')) { $('delete-dialog').close(); drafts.delete(s.id); toast(`Deleted “${s.name || 'Untitled
|
|
847
|
+
if (await action(`/api/sessions/${encodeURIComponent(s.id)}/delete`, {}, 'delete-error')) { $('delete-dialog').close(); drafts.delete(s.id); toast(`Deleted “${s.name || 'Untitled task'}”`); }
|
|
628
848
|
};
|
|
629
849
|
// The trajectory panel: one page of the session's log at a time, each record a line that opens to its JSON.
|
|
630
850
|
// Runtime events this page's runs recorded; the engine's model calls, from the desktop or this page; a terminal's own log.
|
|
631
|
-
const logLabels = { browser: 'Browser events', engine: '
|
|
851
|
+
const logLabels = { browser: 'Browser events', engine: 'Model calls', terminal: 'Terminal log' };
|
|
632
852
|
let trajectory = null, trajectoryGeneration = 0;
|
|
633
853
|
function recordSummary(record) {
|
|
634
854
|
const data = record.data || {}, event = data.event || {}, detail = event.data || {};
|
|
635
|
-
if (data.oversized) return [record.type, `${Math.round(data.bytes / 1024)} KB — too large to show here; download the log to read it`];
|
|
636
|
-
const kind = record.type === 'runtime.event' ? event.type
|
|
855
|
+
if (data.oversized) return [kindWords(record.type), `${Math.round(data.bytes / 1024)} KB — too large to show here; download the log to read it`];
|
|
856
|
+
const kind = kindWords(record.type === 'runtime.event' ? event.type : record.type);
|
|
637
857
|
const duration = Number.isFinite(data.durationMs) ? ` · ${(data.durationMs / 1000).toFixed(1)}s` : '';
|
|
638
|
-
|
|
858
|
+
// A run's own status is the engine's identifier; the log names it with the page's status words.
|
|
859
|
+
const status = typeof data.status === 'string' && data.status ? STATUS_WORDS[statusKind({ status: data.status })] ?? data.status : undefined;
|
|
860
|
+
const first = [data.task, detail.name, detail.nodeName, detail.nodeId, detail.message, detail.reason, detail.text, detail.content, data.model && `${data.model}${duration}`, status, data.error?.message || data.error]
|
|
639
861
|
.find(value => typeof value === 'string' && value.trim());
|
|
640
862
|
return [kind, first ? first.trim().split('\n')[0].slice(0, 200) : ''];
|
|
641
863
|
}
|
|
@@ -666,16 +888,16 @@
|
|
|
666
888
|
}) : []));
|
|
667
889
|
renderRecords(result.page?.records || []);
|
|
668
890
|
const page = result.page;
|
|
669
|
-
$('trajectory-meta').textContent = page ? `${logLabels[result.source] || result.source} · ${t.loaded} of ${page.total}${page.truncated ? '+' : ''}
|
|
670
|
-
$('trajectory-empty').hidden = !!page?.count || offset > 0; $('trajectory-empty').textContent = page ? 'This log has no
|
|
891
|
+
$('trajectory-meta').textContent = page ? `${logLabels[result.source] || result.source} · ${t.loaded} of ${page.total}${page.truncated ? '+' : ''} entries` : '';
|
|
892
|
+
$('trajectory-empty').hidden = !!page?.count || offset > 0; $('trajectory-empty').textContent = page ? 'This log has no entries.' : 'No activity has been recorded for this task yet.';
|
|
671
893
|
$('trajectory-download').disabled = !page; $('trajectory-more').hidden = !page?.hasMore;
|
|
672
894
|
}
|
|
673
895
|
catch (e) { if (generation === trajectoryGeneration) error(e.message, 'trajectory-error'); }
|
|
674
896
|
finally { if (generation === trajectoryGeneration) $('trajectory-more').disabled = false; }
|
|
675
897
|
}
|
|
676
898
|
function openTrajectory(s) {
|
|
677
|
-
trajectory = { id: s.id, name: s.name || 'Untitled
|
|
678
|
-
$('trajectory-title').textContent = `
|
|
899
|
+
trajectory = { id: s.id, name: s.name || 'Untitled task', loaded: 0 };
|
|
900
|
+
$('trajectory-title').textContent = `Activity · ${trajectory.name}`; $('trajectory-meta').textContent = 'Loading…';
|
|
679
901
|
$('trajectory-records').replaceChildren(); $('trajectory-sources').replaceChildren(); $('trajectory-empty').hidden = true; $('trajectory-more').hidden = true; $('trajectory-download').disabled = true;
|
|
680
902
|
$('trajectory-dialog').showModal(); loadTrajectory();
|
|
681
903
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="dark light"><title>Andorra Code
|
|
3
|
+
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="dark light"><title>Workspace · Andorra Code</title><link rel="icon" type="image/png" href="/andorra-logo.png"><link rel="stylesheet" href="/tokens.css"><link rel="stylesheet" href="/style.css"><script src="/app.js" defer></script></head>
|
|
4
4
|
<body>
|
|
5
|
-
<aside class="sidebar"><header class="brand"><img class="brand-mark" src="/andorra-logo.png" alt=""><div>Andorra Code<small>Workspace</small></div></header><button class="new-session" id="new-session"><i data-icon="plus"></i>New
|
|
6
|
-
<main><header class="topbar"><div class="session-heading"><strong id="session-title">Your workspace</strong><span id="workspace-path"></span></div><span id="run-status" class="badge">Ready</span><button id="toggle-progress" aria-expanded="true" aria-controls="progress-panel">Progress</button><button id="theme" class="icon-button" aria-label="Switch to light theme"><i data-icon="sun-moon"></i></button></header><div class="work-area"><section class="chat"><div id="conversation" class="conversation" tabindex="0" aria-label="Conversation"><div class="welcome"><img class="welcome-mark" src="/andorra-logo.png" alt=""><h1>A place for your work</h1><p>Select a
|
|
7
|
-
<dialog id="new-dialog"><form id="new-form"><header><h2>Open a project</h2><button type="button" class="icon-button" data-close="new-dialog" aria-label="Close"><i data-icon="x"></i></button></header><p>Create a
|
|
8
|
-
<dialog id="settings-dialog"><form id="settings-form"><header><h2>Workspace settings</h2><button type="button" class="icon-button" data-close="settings-dialog" aria-label="Close"><i data-icon="x"></i></button></header><label for="max-age">Show
|
|
9
|
-
<dialog id="rename-dialog"><form id="rename-form"><header><h2>Rename
|
|
10
|
-
<dialog id="delete-dialog"><form id="delete-form"><header><h2>Delete
|
|
11
|
-
<dialog id="trajectory-dialog" class="trajectory-dialog" aria-labelledby="trajectory-title"><header><div class="trajectory-heading"><h2 id="trajectory-title">
|
|
12
|
-
<div id="toast" class="toast"
|
|
5
|
+
<aside class="sidebar"><header class="brand"><img class="brand-mark" src="/andorra-logo.png" alt=""><div>Andorra Code<small>Workspace</small></div></header><button class="new-session" id="new-session"><i data-icon="plus"></i>New Task</button><label class="search"><span class="sr-only">Search projects and tasks</span><input id="search" type="search" placeholder="Search tasks…"></label><div class="section-label">Projects <span id="session-count"></span></div><nav id="projects" aria-label="Projects and tasks"></nav><footer class="sidebar-footer"><span id="connection" role="status">Connecting…</span><button id="settings" aria-label="Open settings"><i data-icon="settings"></i><span class="button-label">Settings</span></button></footer></aside>
|
|
6
|
+
<main><header class="topbar"><div class="session-heading"><strong id="session-title">Your workspace</strong><span id="workspace-path"></span></div><span id="run-status" class="badge">Ready</span><button id="toggle-progress" aria-expanded="true" aria-controls="progress-panel">Progress</button><button id="theme" class="icon-button" aria-label="Switch to light theme"><i data-icon="sun-moon"></i></button></header><div class="work-area"><section class="chat"><div id="conversation" class="conversation" tabindex="0" aria-label="Conversation"><div class="welcome"><img class="welcome-mark" src="/andorra-logo.png" alt=""><h1>A place for your work</h1><p>Select a task or open a project to start.</p></div></div><section id="pending" class="pending-card" aria-label="Your input is needed" hidden></section><div class="composer-wrap"><form id="composer" class="composer"><label class="sr-only" for="prompt">Prompt or direction for this task</label><textarea id="prompt" placeholder="Ask Andorra to work on your project…" rows="3"></textarea><div class="composer-footer"><span id="composer-hint">Enter to send · Shift+Enter for a new line</span><div><button id="cancel" type="button" hidden>Stop Run</button><button id="send" type="submit" disabled><span id="send-label">Send</span><i data-icon="arrow-up"></i></button></div></div></form><div id="error" class="error" role="alert" hidden></div></div></section><aside class="progress-panel" id="progress-panel"><header><strong>Progress</strong><span id="todo-count">0/0</span></header><ol id="todos"></ol><p id="progress-empty" class="muted">The agent’s plan will appear here as it works.</p><div class="run-details" id="run-details"></div></aside></div></main>
|
|
7
|
+
<dialog id="new-dialog"><form id="new-form"><header><h2>Open a project</h2><button type="button" class="icon-button" data-close="new-dialog" aria-label="Close"><i data-icon="x"></i></button></header><p>Create a task in a folder on this computer. Existing CLI projects appear automatically.</p><label>Project folder<input id="new-workspace" required placeholder="~/projects/my-project" autocomplete="off"></label><div id="new-error" class="error" role="alert" hidden></div><footer><button type="button" data-close="new-dialog">Cancel</button><button type="submit" class="primary">Create Task</button></footer></form></dialog>
|
|
8
|
+
<dialog id="settings-dialog"><form id="settings-form"><header><h2>Workspace settings</h2><button type="button" class="icon-button" data-close="settings-dialog" aria-label="Close"><i data-icon="x"></i></button></header><label for="max-age">Show tasks active in the last</label><input id="max-age" type="number" min="0" max="36500" step="1" required aria-describedby="max-age-help"><span class="muted" id="max-age-help">days. Use 0 to show all history. Hidden tasks remain saved.</span><label for="theme-setting">Appearance</label><select id="theme-setting"><option value="system">System default</option><option value="light">Light</option><option value="dark">Dark</option></select><div id="settings-error" class="error" role="alert" hidden></div><footer><button type="button" data-close="settings-dialog">Cancel</button><button type="submit" class="primary">Save Settings</button></footer></form></dialog>
|
|
9
|
+
<dialog id="rename-dialog"><form id="rename-form"><header><h2>Rename task</h2><button type="button" class="icon-button" data-close="rename-dialog" aria-label="Close"><i data-icon="x"></i></button></header><label for="rename-name">Name</label><input id="rename-name" required maxlength="200" autocomplete="off"><div id="rename-error" class="error" role="alert" hidden></div><footer><button type="button" data-close="rename-dialog">Cancel</button><button type="submit" class="primary">Rename</button></footer></form></dialog>
|
|
10
|
+
<dialog id="delete-dialog"><form id="delete-form"><header><h2>Delete task</h2><button type="button" class="icon-button" data-close="delete-dialog" aria-label="Close"><i data-icon="x"></i></button></header><p id="delete-text"></p><div id="delete-error" class="error" role="alert" hidden></div><footer><button type="button" data-close="delete-dialog">Cancel</button><button type="submit" class="primary">Delete</button></footer></form></dialog>
|
|
11
|
+
<dialog id="trajectory-dialog" class="trajectory-dialog" aria-labelledby="trajectory-title"><header><div class="trajectory-heading"><h2 id="trajectory-title">Activity</h2><span id="trajectory-meta"></span></div><div class="trajectory-actions"><div id="trajectory-sources" role="group" aria-label="Log"></div><button id="trajectory-download" type="button">Download .jsonl</button><button type="button" class="icon-button" data-close="trajectory-dialog" aria-label="Close"><i data-icon="x"></i></button></div></header><ol id="trajectory-records" class="trajectory-records" aria-label="Activity entries"></ol><p id="trajectory-empty" class="muted" hidden></p><div id="trajectory-error" class="error" role="alert" hidden></div><footer><button id="trajectory-more" type="button" hidden>Load More</button></footer></dialog>
|
|
12
|
+
<div id="toast-region" role="status" aria-live="polite"><div id="toast" class="toast" hidden><span id="toast-text"></span><button id="toast-close" type="button" class="icon-button" aria-label="Dismiss"><i data-icon="x"></i></button></div></div>
|
|
13
13
|
</body></html>
|