@andorra-labs/code 0.1.9 → 0.1.10
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/dist/src/agent-execution.js +20 -0
- package/dist/src/app-server/protocol.d.ts +108 -1
- package/dist/src/app-server/protocol.js +8 -1
- package/dist/src/app-server.d.ts +25 -0
- package/dist/src/app-server.js +156 -11
- 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/browser-ui/app.js +19 -19
- package/dist/src/browser-ui/index.html +7 -7
- package/dist/src/cli.js +10 -5
- package/dist/src/commands.d.ts +1 -1
- package/dist/src/commands.js +1 -1
- package/dist/src/completion-gates.js +1 -1
- package/dist/src/completion.d.ts +1 -1
- package/dist/src/completion.js +1 -1
- 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 +15 -15
- package/dist/src/graph-server.js +9 -9
- package/dist/src/graph-ui/app.js +123 -118
- package/dist/src/graph-ui/embed.js +9 -9
- package/dist/src/graph-ui/icons.js +1 -0
- package/dist/src/graph-ui/index.html +3 -3
- package/dist/src/graph-ui/manager-state.js +3 -3
- package/dist/src/graph-ui/manager.js +14 -14
- package/dist/src/graph-ui/skill-picker.js +6 -6
- package/dist/src/graph-ui/studio-canvas.js +15 -15
- package/dist/src/graph-ui/studio.js +40 -40
- package/dist/src/graph-ui/style.css +3 -1
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graphs.d.ts +7 -1
- package/dist/src/graphs.js +12 -2
- package/dist/src/mcp.d.ts +75 -0
- package/dist/src/mcp.js +240 -8
- package/dist/src/membership-errors.js +1 -1
- 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/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 +13 -2
- package/dist/src/remote/engine-pool.js +18 -6
- package/dist/src/screen-selection.d.ts +38 -0
- package/dist/src/screen-selection.js +103 -0
- package/dist/src/session-changes.d.ts +117 -0
- package/dist/src/session-changes.js +796 -0
- package/dist/src/stall-recovery.d.ts +11 -0
- package/dist/src/stall-recovery.js +12 -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 +310 -80
- 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 +26 -2
- package/dist/src/transcript.d.ts +11 -0
- package/dist/src/transcript.js +14 -2
- package/dist/src/types.d.ts +6 -0
- package/docs/guides/desktop-app.md +1 -1
- package/docs/guides/tui.md +9 -9
- package/package.json +1 -1
- 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
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
const id = graph.id;
|
|
97
97
|
section.append(part('h3', 'Project visibility'));
|
|
98
98
|
if (id === 'default') {
|
|
99
|
-
section.append(part('p', 'This bundled
|
|
99
|
+
section.append(part('p', 'This bundled workflow is always visible in every project.', 'help'));
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (!visibilityProjects) {
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
if (!visibilityAvailable) {
|
|
107
|
-
section.append(part('p', 'Project visibility is unavailable until
|
|
107
|
+
section.append(part('p', 'Project visibility is unavailable until Andorra Code can read your signed-in account. This workflow remains visible in every project.', 'help'));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
section.append(part('p', 'Choose the project folders where this
|
|
110
|
+
section.append(part('p', 'Choose the project folders where this workflow appears in the desktop New Task and task Workflow pickers. This choice stays on this desktop; it is not saved in the workflow.', 'help'));
|
|
111
111
|
const allowed = visibilityChoices.get(id);
|
|
112
112
|
if (allowed === undefined) {
|
|
113
113
|
section.append(part('p', 'Loading project assignment…', 'help'));
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
row.append(input, part('span', `${project.name} `), part('span', project.path, 'mono'));
|
|
145
145
|
section.append(row);
|
|
146
146
|
}
|
|
147
|
-
if (visibilityProjects.length === 0) section.append(part('p', 'Add a project folder in the desktop app to assign this
|
|
148
|
-
else if (allowed.length === 0) section.append(part('p', 'This
|
|
147
|
+
if (visibilityProjects.length === 0) section.append(part('p', 'Add a project folder in the desktop app to assign this workflow.', 'help'));
|
|
148
|
+
else if (allowed.length === 0) section.append(part('p', 'This workflow is hidden in every project until you select one.', 'help'));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -182,9 +182,9 @@
|
|
|
182
182
|
if (actions.includes('back')) {
|
|
183
183
|
const back = part('button', undefined, 'ghost btn-small');
|
|
184
184
|
back.type = 'button'; back.disabled = busy;
|
|
185
|
-
back.setAttribute('aria-label', 'Back to
|
|
185
|
+
back.setAttribute('aria-label', 'Back to Workflows'); back.title = 'Back to Workflows';
|
|
186
186
|
const mark = icon('arrow-left'); if (mark) back.append(mark);
|
|
187
|
-
back.append(part('span', '
|
|
187
|
+
back.append(part('span', 'Workflows'));
|
|
188
188
|
back.onclick = () => hostAction('back');
|
|
189
189
|
slot.append(back);
|
|
190
190
|
}
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
openProviderSettings() { if (hostChrome) hostAction('providers'); },
|
|
210
210
|
exportGraph(graphId) {
|
|
211
211
|
if (!hostChrome || !safeGraphId(graphId)) {
|
|
212
|
-
return Promise.resolve({ ok: false, error: 'That
|
|
212
|
+
return Promise.resolve({ ok: false, error: 'That workflow cannot be exported here.' })
|
|
213
213
|
.then(result => { status(result.error, true); return result; });
|
|
214
214
|
}
|
|
215
215
|
return requestExport({ type: 'andorra.graph.export', graphId }).then(result => {
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
const snapshot = copy(state.graph);
|
|
327
327
|
await api('/api/drafts', snapshot);
|
|
328
328
|
if (JSON.stringify(state.graph) !== JSON.stringify(snapshot)) {
|
|
329
|
-
throw new Error('The
|
|
329
|
+
throw new Error('The workflow changed while saving; try closing again.');
|
|
330
330
|
}
|
|
331
331
|
clearTimeout(draftTimer);
|
|
332
332
|
pendingDraft = null;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
globalThis.AndorraIcons = (() => {
|
|
18
18
|
const GLYPHS = {
|
|
19
19
|
'arrow-left': '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',
|
|
20
|
+
'chevron-right': '<path d="m9 18 6-6-6-6"/>',
|
|
20
21
|
undo: '<path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"/>',
|
|
21
22
|
redo: '<path d="m15 14 5-5-5-5"/><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"/>',
|
|
22
23
|
'zoom-in': '<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',
|
|
@@ -1,7 +1,7 @@
|
|
|
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"><title>
|
|
3
|
+
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Workflow Editor · 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"><link rel="stylesheet" href="/library.css"><link rel="stylesheet" href="/studio.css"><link rel="stylesheet" href="/controls.css"><link rel="stylesheet" href="/manager.css"><script src="/theme.js"></script></head>
|
|
4
4
|
<body>
|
|
5
|
-
<aside class="rail" id="library-rail"><div id="rail-resize" role="separator" aria-label="Resize library sidebar" aria-orientation="vertical" aria-controls="library-rail" tabindex="0"></div><div class="rail-body" tabindex="0" aria-label="
|
|
6
|
-
<main><header class="chrome"><div id="host-chrome" class="host-chrome" hidden></div><div class="graph-heading"><strong id="graph-title">
|
|
5
|
+
<aside class="rail" id="library-rail"><div id="rail-resize" role="separator" aria-label="Resize library sidebar" aria-orientation="vertical" aria-controls="library-rail" tabindex="0"></div><div class="rail-body" tabindex="0" aria-label="Workflow and step library"><div class="section-label">Your workflows <button id="new-graph" aria-label="Create workflow" title="Create workflow" data-icon="plus"></button></div><input id="search" type="search" placeholder="Find a workflow" aria-label="Find a workflow"><nav id="graphs" aria-label="Workflows" tabindex="0"></nav><div class="section-label library-label">Step library</div><input id="node-search" type="search" placeholder="Search steps…" aria-label="Search steps"><nav id="node-library" aria-label="Step library"></nav><p class="hint">Drag a step onto the canvas, or select it and press Enter to add it. Connect each outcome to one or more destinations.</p></div><footer class="rail-footer">Your account <span id="sync-status" role="status">Saved locally; cloud sync pending</span></footer></aside>
|
|
6
|
+
<main><header class="chrome"><div id="host-chrome" class="host-chrome" hidden></div><div class="graph-heading"><strong id="graph-title">Workflow Editor</strong><span id="revision">Loading workflows…</span><span id="host-notice" class="chip chip-accent" role="status" hidden></span></div><div class="chrome-actions" id="chrome-actions"><button id="toggle-inspector" class="icon-button" aria-expanded="true" aria-label="Inspector" title="Show or hide the inspector" data-icon="panel-right"></button><div class="menu" id="more-wrap"><button id="more" class="icon-button" aria-haspopup="menu" aria-expanded="false" aria-controls="more-menu" aria-label="More actions" title="More actions" data-icon="more"></button><div id="more-menu" class="menu-list" role="menu" aria-label="More actions" hidden><button id="duplicate" type="button" role="menuitem" data-icon="copy">Duplicate</button></div></div><div class="manager-anchor" hidden><button id="graph-manager" class="btn-small studio-secondary" type="button" aria-label="Workflow Manager" aria-expanded="false" aria-controls="manager-panel" title="Build or change this workflow with Workflow Manager" data-icon="bot" hidden><span>Workflow Manager</span></button><div id="manager-tip" class="manager-tip" role="note" hidden><span>Let Workflow Manager build this workflow with you.</span><button id="manager-tip-close" type="button" class="icon-button" aria-label="Dismiss" title="Dismiss" data-icon="x"></button></div></div><button id="save" class="primary btn-small">Save</button></div></header><div class="workspace"><section id="canvas" aria-label="Workflow canvas"><div id="scene"><svg id="edges" aria-label="Workflow connections"></svg><div id="nodes"></div></div><div id="empty">Create a workflow to get started.</div><div id="canvas-hint" class="canvas-hint" role="note"><span id="canvas-hint-text">Drag or scroll to pan · Pinch or Ctrl/Cmd+scroll to zoom</span><button id="canvas-hint-close" type="button" class="icon-button" aria-label="Dismiss canvas tips" title="Dismiss" data-icon="x"></button></div><div class="canvas-toolbar" role="toolbar" aria-label="Canvas controls"><button id="undo" aria-label="Undo" title="Undo (Ctrl/Cmd+Z)" data-icon="undo"></button><button id="redo" aria-label="Redo" title="Redo (Ctrl/Cmd+Y)" data-icon="redo"></button><span class="toolbar-divider" aria-hidden="true"></span><button id="zoom-out" aria-label="Zoom out" title="Zoom out" data-icon="zoom-out"></button><output id="zoom" aria-label="Zoom level">100%</output><button id="zoom-in" aria-label="Zoom in" title="Zoom in" data-icon="zoom-in"></button><button id="fit" aria-label="Fit workflow" title="Fit workflow" data-icon="fit"></button><button id="layout" aria-label="Arrange" title="Arrange steps" data-icon="arrange"></button></div></section><aside id="inspector"><div id="resize" role="separator" aria-label="Resize inspector" aria-orientation="vertical" tabindex="0"></div><header class="panel-header"><strong id="inspector-title">Workflow settings</strong><button id="graph-settings" class="btn-small" title="Show the workflow's own settings">Workflow Settings</button></header><div id="inspector-body"></div></aside><aside id="manager-panel" aria-label="Workflow Manager" hidden><div id="manager-resize" role="separator" aria-label="Resize Workflow Manager" aria-orientation="vertical" tabindex="0"></div><header class="panel-header"><strong>Workflow Manager</strong><span class="manager-header-actions"><button id="manager-new-chat" type="button" class="btn-small" title="Start a new conversation. The current one stays in your history.">New Chat</button><button id="manager-close" type="button" class="icon-button" aria-label="Close Workflow Manager" title="Close" data-icon="x"></button></span></header><div class="manager-models"><select id="manager-provider" aria-label="Workflow Manager provider"></select><select id="manager-model" aria-label="Workflow Manager model"></select></div><div id="manager-notices"></div><div id="manager-transcript" role="log" aria-label="Workflow Manager conversation" tabindex="0"></div><footer class="manager-composer"><textarea id="manager-input" rows="3" placeholder="Ask Workflow Manager to build or change this workflow" aria-label="Message Workflow Manager"></textarea><div class="manager-composer-actions"><span id="manager-run-state" role="status"></span><button id="manager-stop" type="button" class="btn-small" hidden>Stop</button><button id="manager-send" type="button" class="primary btn-small">Send</button></div></footer></aside></div><footer class="status"><span id="status" role="status" aria-live="polite">Connecting to your workspace…</span><span class="status-actions"><button id="theme-toggle" type="button" hidden>Light</button><button id="export">Export JSON</button></span></footer></main>
|
|
7
7
|
<script src="/compat.js" defer></script><script src="/icons.js" defer></script><script src="/controls.js" defer></script><script src="/skill-picker.js" defer></script><script src="/edge-router.js" defer></script><script src="/drafts.js" defer></script><script src="/app.js" defer></script><script src="/manager-markdown.js" defer></script><script src="/manager-state.js" defer></script><script src="/manager.js" defer></script><script src="/embed.js" defer></script><script src="/sidebar.js" defer></script><script src="/studio.js" defer></script><script src="/studio-canvas.js" defer></script></body></html>
|
|
@@ -156,7 +156,7 @@ globalThis.AndorraManagerState = (() => {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/** Graph actions that change the draft; the summary counts them as edits. */
|
|
159
|
-
const EDITS = new Set(['Set
|
|
159
|
+
const EDITS = new Set(['Set step', 'Edit step', 'Remove step', 'Connect', 'Remove connection', 'Edit workflow']);
|
|
160
160
|
const plural = (count, one, many) => `${count} ${count === 1 ? one : many}`;
|
|
161
161
|
/**
|
|
162
162
|
* What a settled stretch did, in one sentence: `Thought for 12s, made 5 edits, ran 3 other steps`.
|
|
@@ -167,11 +167,11 @@ globalThis.AndorraManagerState = (() => {
|
|
|
167
167
|
const parts = [];
|
|
168
168
|
if (thoughts.length) parts.push(thoughtLabel(thoughts.reduce((sum, entry) => sum + (typeof entry.durationMs === 'number' ? entry.durationMs : 0), 0)).toLowerCase());
|
|
169
169
|
const edits = tools.filter(entry => EDITS.has(entry.verb)).length;
|
|
170
|
-
const saves = tools.filter(entry => entry.verb === 'Save
|
|
170
|
+
const saves = tools.filter(entry => entry.verb === 'Save version' && entry.status === 'done').length;
|
|
171
171
|
// A save that failed or was denied is a step like any other, not a save.
|
|
172
172
|
const other = tools.length - edits - saves;
|
|
173
173
|
if (edits) parts.push(`made ${plural(edits, 'edit', 'edits')}`);
|
|
174
|
-
if (saves) parts.push('saved the
|
|
174
|
+
if (saves) parts.push('saved the workflow');
|
|
175
175
|
if (other) parts.push(`ran ${plural(other, edits || saves ? 'other step' : 'step', edits || saves ? 'other steps' : 'steps')}`);
|
|
176
176
|
if (!parts.length) return 'Worked';
|
|
177
177
|
const sentence = parts.join(', ');
|
|
@@ -15,7 +15,7 @@ globalThis.AndorraManager = (() => {
|
|
|
15
15
|
try { return window.localStorage; } catch { return undefined; }
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const RUN_LABELS = { starting: 'Starting
|
|
18
|
+
const RUN_LABELS = { starting: 'Starting…', working: 'Working…', awaiting: 'Waiting for you' };
|
|
19
19
|
const MIN_WIDTH = 300, MAX_WIDTH = 640;
|
|
20
20
|
|
|
21
21
|
let open = false;
|
|
@@ -325,7 +325,7 @@ globalThis.AndorraManager = (() => {
|
|
|
325
325
|
if (createdOffer?.id === event.graphId) createdOffer = null;
|
|
326
326
|
if (state.graph?.id !== event.graphId) return;
|
|
327
327
|
offeredRevision = null;
|
|
328
|
-
status('
|
|
328
|
+
status('Workflow Manager deleted this workflow.');
|
|
329
329
|
}
|
|
330
330
|
/** Opens the graph the agent created. Unsaved edits on the canvas are asked about first, as for any other graph. */
|
|
331
331
|
async function openCreated(offer) {
|
|
@@ -346,7 +346,7 @@ globalThis.AndorraManager = (() => {
|
|
|
346
346
|
sentCanvas = JSON.stringify(state.graph);
|
|
347
347
|
beforeLastMessage = null; unsureCanvas = false;
|
|
348
348
|
offeredRevision = null;
|
|
349
|
-
status(`
|
|
349
|
+
status(`Workflow Manager saved version ${state.graph.revision}`);
|
|
350
350
|
renderNotices();
|
|
351
351
|
return true;
|
|
352
352
|
}
|
|
@@ -362,7 +362,7 @@ globalThis.AndorraManager = (() => {
|
|
|
362
362
|
async function send() {
|
|
363
363
|
const text = input.value.trim();
|
|
364
364
|
if (!text || !state.graph) return;
|
|
365
|
-
if (!choice) { localError = 'Add a model provider to use
|
|
365
|
+
if (!choice) { localError = 'Add a model provider to use Workflow Manager.'; renderNotices(); return; }
|
|
366
366
|
const revision = Number.isInteger(state.graph.revision) ? state.graph.revision : 0;
|
|
367
367
|
// The canvas is recorded with the message and becomes the comparison baseline only when the
|
|
368
368
|
// stream echoes that message; a refused request puts the words back and leaves the baseline alone.
|
|
@@ -524,11 +524,11 @@ globalThis.AndorraManager = (() => {
|
|
|
524
524
|
if (entry.type === 'graph.saved') {
|
|
525
525
|
// A save of another graph than the conversation's own names it.
|
|
526
526
|
const other = entry.graphId !== chatGraphId && entry.graphId !== state.graph?.id;
|
|
527
|
-
return node('div', other ? `Saved ${entry.name || entry.graphId},
|
|
527
|
+
return node('div', other ? `Saved ${entry.name || entry.graphId}, version ${entry.revision}` : `Saved version ${entry.revision}`, 'manager-row manager-saved');
|
|
528
528
|
}
|
|
529
529
|
if (entry.type === 'graph.deleted') {
|
|
530
530
|
const other = entry.graphId !== chatGraphId && entry.graphId !== state.graph?.id;
|
|
531
|
-
return node('div', other ? `Deleted ${entry.graphId}` : 'Deleted this
|
|
531
|
+
return node('div', other ? `Deleted ${entry.graphId}` : 'Deleted this workflow', 'manager-row manager-saved');
|
|
532
532
|
}
|
|
533
533
|
if (entry.type === 'approval') return approvalCard(entry);
|
|
534
534
|
if (entry.type === 'question') return questionCard(entry);
|
|
@@ -554,7 +554,7 @@ globalThis.AndorraManager = (() => {
|
|
|
554
554
|
return item;
|
|
555
555
|
}
|
|
556
556
|
function approvalCard(entry) {
|
|
557
|
-
const item = card(entry, '
|
|
557
|
+
const item = card(entry, 'Workflow Manager asks to', entry.text);
|
|
558
558
|
if (entry.answered) return closed(item, entry, 'Answered');
|
|
559
559
|
return actions(item, entry, [
|
|
560
560
|
control('Approve', () => settle(entry, '/api/manager/approve', { id: entry.id, approved: true }, 'Approved'), 'btn-small primary'),
|
|
@@ -562,7 +562,7 @@ globalThis.AndorraManager = (() => {
|
|
|
562
562
|
]);
|
|
563
563
|
}
|
|
564
564
|
function questionCard(entry) {
|
|
565
|
-
const item = card(entry, '
|
|
565
|
+
const item = card(entry, 'Workflow Manager asks', entry.question);
|
|
566
566
|
if (entry.answered) return closed(item, entry, 'Answered');
|
|
567
567
|
const answer = value => settle(entry, '/api/manager/answer', { id: entry.id, value }, `Answered: ${value}`);
|
|
568
568
|
if (Array.isArray(entry.choices) && entry.choices.length) {
|
|
@@ -588,7 +588,7 @@ globalThis.AndorraManager = (() => {
|
|
|
588
588
|
const atEnd = log.scrollHeight - log.scrollTop - log.clientHeight < 40;
|
|
589
589
|
const next = [];
|
|
590
590
|
if (!transcript.length) {
|
|
591
|
-
log.replaceChildren(node('p', 'Ask
|
|
591
|
+
log.replaceChildren(node('p', 'Ask Workflow Manager to build or change this workflow. It sees the canvas as it is now, unsaved edits included, and asks before it saves anything.', 'help manager-empty'));
|
|
592
592
|
rendered = [];
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
@@ -628,23 +628,23 @@ globalThis.AndorraManager = (() => {
|
|
|
628
628
|
}
|
|
629
629
|
function renderNotices() {
|
|
630
630
|
const bars = [];
|
|
631
|
-
if (!state.providers.length) bars.push(notice('manager-warning', 'Add a model provider to use
|
|
631
|
+
if (!state.providers.length) bars.push(notice('manager-warning', 'Add a model provider to use Workflow Manager.', []));
|
|
632
632
|
if (switchOffer && state.graph?.id === switchOffer) {
|
|
633
|
-
bars.push(notice('manager-switch', `Start a new chat about ${state.graph.name || 'this
|
|
633
|
+
bars.push(notice('manager-switch', `Start a new chat about ${state.graph.name || 'this workflow'}?`, [
|
|
634
634
|
control('New chat', () => { void newChat(); }, 'btn-small primary'),
|
|
635
635
|
control('Keep this chat', () => { switchOffer = null; renderNotices(); }),
|
|
636
636
|
]));
|
|
637
637
|
}
|
|
638
638
|
if (offeredRevision !== null && state.graph) {
|
|
639
639
|
const id = state.graph.id;
|
|
640
|
-
bars.push(notice('manager-load', `
|
|
640
|
+
bars.push(notice('manager-load', `Workflow Manager saved version ${offeredRevision}. Load it?`, [
|
|
641
641
|
control('Load', () => { void loadRevision(id); }, 'btn-small primary'),
|
|
642
642
|
control('Not now', () => { offeredRevision = null; renderNotices(); }),
|
|
643
643
|
]));
|
|
644
644
|
}
|
|
645
645
|
if (createdOffer && state.graph?.id === 'default') {
|
|
646
646
|
const offer = createdOffer;
|
|
647
|
-
bars.push(notice('manager-created', `
|
|
647
|
+
bars.push(notice('manager-created', `Workflow Manager created ${offer.label}. Open it?`, [
|
|
648
648
|
control('Open', () => { void openCreated(offer); }, 'btn-small primary'),
|
|
649
649
|
control('Not now', () => { createdOffer = null; renderNotices(); }),
|
|
650
650
|
]));
|
|
@@ -657,7 +657,7 @@ globalThis.AndorraManager = (() => {
|
|
|
657
657
|
notices.replaceChildren(...bars);
|
|
658
658
|
}
|
|
659
659
|
function renderRunState() {
|
|
660
|
-
runLabel.textContent = RUN_LABELS[runState] || (open && source && !connected ? 'Connecting
|
|
660
|
+
runLabel.textContent = RUN_LABELS[runState] || (open && source && !connected ? 'Connecting…' : '');
|
|
661
661
|
stopButton.hidden = runState === 'idle';
|
|
662
662
|
}
|
|
663
663
|
function render() { renderTranscript(); renderNotices(); renderRunState(); startTicker(); }
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function problemText({ name, state }) {
|
|
75
|
-
if (state === 'disabled') return `/${name} is turned off in Skills settings. The
|
|
76
|
-
if (state === 'unavailable') return `/${name} is installed but cannot be loaded; repair it in Skills settings. The
|
|
77
|
-
return `Skill /${name} not found on this machine. The
|
|
75
|
+
if (state === 'disabled') return `/${name} is turned off in Skills settings. The step still runs, without it.`;
|
|
76
|
+
if (state === 'unavailable') return `/${name} is installed but cannot be loaded; repair it in Skills settings. The step still runs, without it.`;
|
|
77
|
+
return `Skill /${name} not found on this machine. The step still runs, without it.`;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function matching(skills, query) {
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
warnings.replaceChildren();
|
|
124
124
|
for (const problem of problems(textarea.value, value)) {
|
|
125
125
|
const row = el('p', undefined, 'skill-warning');
|
|
126
|
-
row.title = 'A skill in a project\'s .agents/skills folder is found when the
|
|
126
|
+
row.title = 'A skill in a project\'s .agents/skills folder is found when the workflow runs in that project. Install or turn on skills in Settings > Skills.';
|
|
127
127
|
const glyph = icon('warning'); if (glyph) row.append(glyph);
|
|
128
128
|
row.append(el('span', problemText(problem)));
|
|
129
129
|
warnings.append(row);
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
}
|
|
202
202
|
if (!found.length) {
|
|
203
203
|
const text = !value ? `Skills could not be loaded${cache.error ? `: ${cache.error}` : ''}. A /name you type still runs.`
|
|
204
|
-
: !value.skills.length ? 'No skills are installed on this machine. A /name you type is kept, and the
|
|
205
|
-
: `No skill on this machine matches /${query.text}. You can keep it; the
|
|
204
|
+
: !value.skills.length ? 'No skills are installed on this machine. A /name you type is kept, and the step runs without a skill it cannot find.'
|
|
205
|
+
: `No skill on this machine matches /${query.text}. You can keep it; the step runs without a skill it cannot find.`;
|
|
206
206
|
list.append(el('p', text, 'help skill-picker-empty'));
|
|
207
207
|
}
|
|
208
208
|
panel.append(el('div', found.length ? 'Up/Down to choose, Enter to insert, Esc to close' : 'Esc to close', 'skill-picker-hint'));
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
Object.assign(box.style, { left: x + 'px', top: y + 'px', width: w + 'px', height: h + 'px' });
|
|
40
40
|
const title = make('button', group.name, 'studio-group-title');
|
|
41
41
|
title.type = 'button';
|
|
42
|
-
title.title = 'Select the
|
|
42
|
+
title.title = 'Select the steps in this layout group';
|
|
43
43
|
title.onclick = event => {
|
|
44
44
|
event.stopPropagation();
|
|
45
45
|
clearSelection(); state.selectedIds = nodes.map(node => node.id); state.selected = state.selectedIds.at(-1);
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
};
|
|
48
48
|
const remove = make('button', '×', 'studio-group-remove');
|
|
49
49
|
remove.type = 'button';
|
|
50
|
-
remove.title = 'Remove group, keeping its
|
|
50
|
+
remove.title = 'Remove group, keeping its steps';
|
|
51
51
|
remove.onclick = event => {
|
|
52
52
|
event.stopPropagation();
|
|
53
53
|
mutate(() => { state.graph.metadata.studioLayoutGroupsV1 = state.graph.metadata.studioLayoutGroupsV1.filter(item => item.id !== group.id); }, true);
|
|
@@ -175,11 +175,11 @@
|
|
|
175
175
|
const targetNode = document.elementFromPoint(e.clientX, e.clientY)?.closest('.node');
|
|
176
176
|
const targetId = targetNode?.getAttribute('data-node-id');
|
|
177
177
|
if (!targetId || targetId === sourceId || state.graph?.nodes[targetId]?.agentRole === 'orchestrator') {
|
|
178
|
-
status('Drop a connection on a different destination
|
|
178
|
+
status('Drop a connection on a different destination step (not the Orchestrator).', true); return;
|
|
179
179
|
}
|
|
180
180
|
if (!state.graph?.nodes[sourceId] || !outcomes(state.graph.nodes[sourceId]).includes(outcome)) return;
|
|
181
181
|
if (state.graph.edges.some(edge => edge.source === sourceId && edge.target === targetId && (edge.outcome || 'completed') === outcome)) {
|
|
182
|
-
status('This connection already exists. Click its line to
|
|
182
|
+
status('This connection already exists. Click its line to edit it.'); return;
|
|
183
183
|
}
|
|
184
184
|
mutate(() => {
|
|
185
185
|
const edge = { id: 'edge-' + crypto.randomUUID().slice(0, 8), source: sourceId, target: targetId, outcome };
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
clearSelection(); state.selectedEdge = edge;
|
|
188
188
|
}, true);
|
|
189
189
|
showInspector();
|
|
190
|
-
status('Connection added.
|
|
190
|
+
status('Connection added. Set its inputs and save the workflow.');
|
|
191
191
|
};
|
|
192
192
|
const cancel = e => {
|
|
193
193
|
if (!active || !matchesPointer(e)) return;
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
copied = { graphId: state.graph.id, nodes: snapshots, edges: copy(state.graph.edges.filter(edge => ids.has(edge.source) && ids.has(edge.target))),
|
|
279
279
|
pendingProviderIds: selected.filter(node => state.pendingProviderNodes?.has(node.id)).map(node => node.id) };
|
|
280
280
|
pasteOffset = 0;
|
|
281
|
-
status('Copied ' + selected.length + '
|
|
281
|
+
status('Copied ' + selected.length + ' steps. Ctrl/Cmd+V pastes them.');
|
|
282
282
|
return true;
|
|
283
283
|
}
|
|
284
284
|
function pasteNodes() {
|
|
@@ -292,14 +292,14 @@
|
|
|
292
292
|
// the same ID), or if the source was removed in the current graph.
|
|
293
293
|
if (externalSources.length && (copied.graphId !== state.graph.id ||
|
|
294
294
|
externalSources.some(source => !Object.hasOwn(state.graph.nodes, source)))) {
|
|
295
|
-
status('Copy Condition
|
|
295
|
+
status('Copy Condition steps with their source steps before pasting into another workflow.', true);
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
298
|
// The free-tier rules live in app.js; a page or harness without them has no allowance to apply.
|
|
299
299
|
const freeRefusal = typeof freeNodeRefusal === 'function' ? freeNodeRefusal(copied.nodes) : undefined;
|
|
300
300
|
if (freeRefusal) { status(freeRefusal, true); return; }
|
|
301
301
|
if (Object.keys(state.graph.nodes).length + copied.nodes.length > nodeLimit(state.graph)) {
|
|
302
|
-
status('
|
|
302
|
+
status('Workflow step limit reached. Remove steps before pasting.', true); return;
|
|
303
303
|
}
|
|
304
304
|
pasteOffset += 40;
|
|
305
305
|
const positions = copied.nodes.map(node => node.position || { x: 120, y: 120 });
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
};
|
|
316
316
|
const dx = shift('x'), dy = shift('y');
|
|
317
317
|
if (dx === null || dy === null) {
|
|
318
|
-
status('The selected
|
|
318
|
+
status('The selected step positions are outside the supported canvas bounds.', true); return;
|
|
319
319
|
}
|
|
320
320
|
mutate(() => {
|
|
321
321
|
const ids = new Map();
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
clearSelection();
|
|
349
349
|
state.selectedIds = [...ids.values()]; state.selected = state.selectedIds.at(-1);
|
|
350
350
|
}, true);
|
|
351
|
-
showInspector(); status('Pasted ' + copied.nodes.length + '
|
|
351
|
+
showInspector(); status('Pasted ' + copied.nodes.length + ' steps and their internal connections.');
|
|
352
352
|
}
|
|
353
353
|
function installKeyboard() {
|
|
354
354
|
window.addEventListener('keydown', event => {
|
|
@@ -386,18 +386,18 @@
|
|
|
386
386
|
* Keys are drawn as keycaps; a pointer gesture is said in words beside them.
|
|
387
387
|
*/
|
|
388
388
|
const SHORTCUTS = [
|
|
389
|
-
{ keys: ['Ctrl/Cmd', 'C'], action: 'Copy
|
|
389
|
+
{ keys: ['Ctrl/Cmd', 'C'], action: 'Copy steps' }, { keys: ['Ctrl/Cmd', 'V'], action: 'Paste steps' },
|
|
390
390
|
{ keys: ['Ctrl/Cmd', 'D'], action: 'Duplicate' }, { keys: ['Ctrl/Cmd', 'A'], action: 'Select all' },
|
|
391
391
|
{ keys: ['Ctrl/Cmd', 'G'], action: 'Group' }, { keys: ['Ctrl/Cmd', 'Z'], action: 'Undo' }, { keys: ['Ctrl/Cmd', 'Y'], action: 'Redo' },
|
|
392
392
|
{ keys: ['Shift'], gesture: 'drag the background', action: 'Marquee select' },
|
|
393
|
-
{ keys: [], gesture: 'Drag an output port to a
|
|
393
|
+
{ keys: [], gesture: 'Drag an output port to a step', action: 'Connect' },
|
|
394
394
|
{ keys: ['Delete'], action: 'Remove selection' },
|
|
395
395
|
];
|
|
396
396
|
const shortcutText = item => [item.keys.join('+'), item.gesture].filter(Boolean).join(item.keys.length ? ' + ' : '');
|
|
397
397
|
function showShortcuts() {
|
|
398
398
|
const controls = globalThis.AndorraControls;
|
|
399
399
|
if (typeof controls?.alert !== 'function') {
|
|
400
|
-
alert('
|
|
400
|
+
alert('Workflow Editor shortcuts:\n' + SHORTCUTS.map(item => shortcutText(item) + ': ' + item.action).join('\n'));
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
403
|
const list = document.createElement('dl');
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
description.textContent = item.action;
|
|
416
416
|
list.append(term, description);
|
|
417
417
|
}
|
|
418
|
-
void controls.alert({ title: '
|
|
418
|
+
void controls.alert({ title: 'Workflow Editor shortcuts', content: list });
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
function installToolbar() {
|
|
@@ -436,7 +436,7 @@
|
|
|
436
436
|
const canvas = byId('canvas');
|
|
437
437
|
const map = svg('svg');
|
|
438
438
|
map.id = 'studio-minimap'; map.setAttribute('viewBox', '0 0 160 100');
|
|
439
|
-
map.setAttribute('role', 'img'); map.setAttribute('aria-label', '
|
|
439
|
+
map.setAttribute('role', 'img'); map.setAttribute('aria-label', 'Workflow minimap. Click to center on an area.');
|
|
440
440
|
canvas.append(map);
|
|
441
441
|
}
|
|
442
442
|
function refreshSnap() {
|