@andorra-labs/code 0.1.5 → 0.1.7
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/account-presentation.js +3 -3
- package/dist/src/agent-execution.d.ts +2 -0
- package/dist/src/agent-execution.js +526 -41
- package/dist/src/agent-mcp-catalog.d.ts +21 -0
- package/dist/src/agent-mcp-catalog.js +40 -0
- package/dist/src/agent-mcp.d.ts +36 -3
- package/dist/src/agent-mcp.js +114 -45
- package/dist/src/app-server/protocol.d.ts +57 -5
- package/dist/src/app-server/protocol.js +18 -1
- package/dist/src/app-server/workspace.d.ts +9 -1
- package/dist/src/app-server/workspace.js +50 -3
- package/dist/src/app-server.d.ts +115 -41
- package/dist/src/app-server.js +1316 -221
- package/dist/src/auth/AuthManager.d.ts +33 -1
- package/dist/src/auth/AuthManager.js +138 -10
- package/dist/src/auth/callback-page.d.ts +4 -0
- package/dist/src/auth/callback-page.js +70 -0
- package/dist/src/auth/callback.d.ts +39 -0
- package/dist/src/auth/callback.js +146 -22
- package/dist/src/auth/index.d.ts +10 -6
- package/dist/src/auth/index.js +2 -2
- package/dist/src/auth/store.d.ts +142 -3
- package/dist/src/auth/store.js +334 -13
- package/dist/src/auth/types.d.ts +17 -1
- package/dist/src/auth-commands.d.ts +11 -2
- package/dist/src/auth-commands.js +14 -7
- package/dist/src/automation-runner.d.ts +9 -0
- package/dist/src/automation-runner.js +22 -1
- package/dist/src/automation-tool.js +18 -3
- package/dist/src/automations.d.ts +5 -0
- package/dist/src/automations.js +11 -1
- package/dist/src/browser-captcha-tool.d.ts +54 -0
- package/dist/src/browser-captcha-tool.js +374 -0
- package/dist/src/browser-panel-tool.d.ts +7 -0
- package/dist/src/browser-panel-tool.js +74 -3
- package/dist/src/browser-runner.js +19 -4
- package/dist/src/browser-server.js +21 -1
- package/dist/src/browser-session.d.ts +16 -0
- package/dist/src/browser-session.js +35 -0
- package/dist/src/browser-ui/app.js +193 -3
- package/dist/src/browser-ui/style.css +15 -1
- package/dist/src/browser-view.d.ts +72 -4
- package/dist/src/browser-view.js +229 -17
- package/dist/src/capabilities.d.ts +9 -3
- package/dist/src/capabilities.js +20 -5
- package/dist/src/capsolver.d.ts +60 -0
- package/dist/src/capsolver.js +101 -0
- package/dist/src/claude-provider.d.ts +6 -0
- package/dist/src/claude-provider.js +34 -3
- package/dist/src/cli-executable.d.ts +33 -0
- package/dist/src/cli-executable.js +64 -0
- package/dist/src/cli-process.d.ts +47 -0
- package/dist/src/cli-process.js +113 -0
- package/dist/src/cli-sign-in.d.ts +68 -0
- package/dist/src/cli-sign-in.js +224 -0
- package/dist/src/cli.js +84 -26
- package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +1 -1
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +5 -5
- package/dist/src/codex-provider.js +12 -0
- package/dist/src/coding-tools.d.ts +5 -0
- package/dist/src/coding-tools.js +98 -53
- package/dist/src/command-output-tap.d.ts +16 -0
- package/dist/src/command-output-tap.js +45 -0
- package/dist/src/command-screens.js +3 -3
- package/dist/src/commands.d.ts +15 -2
- package/dist/src/commands.js +14 -13
- package/dist/src/completion.d.ts +23 -5
- package/dist/src/completion.js +380 -17
- package/dist/src/config.d.ts +61 -0
- package/dist/src/config.js +276 -12
- package/dist/src/context-budget.d.ts +7 -0
- package/dist/src/context-budget.js +18 -1
- package/dist/src/deadline.js +6 -0
- package/dist/src/decision/FactContinuations.d.ts +41 -6
- package/dist/src/decision/FactContinuations.js +211 -64
- package/dist/src/decision/PreparedSteps.js +3 -1
- package/dist/src/decision/checks.d.ts +25 -0
- package/dist/src/decision/checks.js +77 -6
- package/dist/src/delegation-changes.d.ts +109 -0
- package/dist/src/delegation-changes.js +431 -0
- package/dist/src/extensions.d.ts +1 -0
- package/dist/src/extensions.js +16 -3
- package/dist/src/graph-provider-portability.js +2 -2
- package/dist/src/graph-quota.d.ts +1 -1
- package/dist/src/graph-quota.js +1 -1
- package/dist/src/graph-runner.js +35 -21
- package/dist/src/graph-selection.d.ts +6 -0
- package/dist/src/graph-selection.js +10 -0
- package/dist/src/graph-server.d.ts +8 -0
- package/dist/src/graph-server.js +76 -6
- package/dist/src/graph-sync.d.ts +65 -0
- package/dist/src/graph-sync.js +433 -13
- package/dist/src/graph-tool.d.ts +52 -0
- package/dist/src/graph-tool.js +136 -0
- package/dist/src/graph-ui/app.js +272 -50
- package/dist/src/graph-ui/controls.js +6 -0
- package/dist/src/graph-ui/drafts.js +39 -0
- package/dist/src/graph-ui/embed.js +1 -1
- package/dist/src/graph-ui/icons.js +1 -0
- package/dist/src/graph-ui/index.html +2 -2
- package/dist/src/graph-ui/skill-picker.js +242 -0
- package/dist/src/graph-ui/studio.css +7 -5
- package/dist/src/graph-ui/style.css +65 -12
- package/dist/src/graphs.d.ts +60 -5
- package/dist/src/graphs.js +191 -37
- package/dist/src/grok-provider.d.ts +50 -0
- package/dist/src/grok-provider.js +186 -0
- package/dist/src/handoffs.d.ts +13 -0
- package/dist/src/handoffs.js +31 -1
- package/dist/src/hardened-runtime.d.ts +4 -4
- package/dist/src/hardened-runtime.js +109 -9
- package/dist/src/managed-sign-in.d.ts +38 -0
- package/dist/src/managed-sign-in.js +169 -0
- package/dist/src/markdown.d.ts +5 -0
- package/dist/src/markdown.js +5 -2
- package/dist/src/mcp.js +11 -0
- package/dist/src/membership.d.ts +8 -1
- package/dist/src/membership.js +15 -5
- package/dist/src/model-metadata.js +14 -2
- package/dist/src/model-override.d.ts +10 -0
- package/dist/src/model-override.js +20 -0
- package/dist/src/opencode-cli-provider.d.ts +122 -0
- package/dist/src/opencode-cli-provider.js +415 -0
- package/dist/src/opencode-provider.js +23 -8
- package/dist/src/palette.d.ts +2 -0
- package/dist/src/palette.js +2 -0
- package/dist/src/permissions.d.ts +19 -1
- package/dist/src/permissions.js +30 -1
- package/dist/src/powershell-pool.d.ts +11 -2
- package/dist/src/powershell-pool.js +34 -5
- package/dist/src/provider-connection.js +36 -0
- package/dist/src/provider-engine.d.ts +2 -1
- package/dist/src/provider-engine.js +64 -13
- package/dist/src/provider-import.js +6 -1
- package/dist/src/provider-keys.d.ts +48 -0
- package/dist/src/provider-keys.js +121 -0
- package/dist/src/provider-settings.js +22 -3
- package/dist/src/providers.d.ts +12 -1
- package/dist/src/providers.js +27 -8
- package/dist/src/pull-requests.d.ts +123 -20
- package/dist/src/pull-requests.js +334 -84
- package/dist/src/qa/qa-authorize.js +9 -1
- package/dist/src/qa/runtime/ProcessManager.d.ts +6 -0
- package/dist/src/qa/runtime/ProcessManager.js +16 -0
- package/dist/src/react-runtime.js +106 -7
- package/dist/src/read-image.d.ts +30 -0
- package/dist/src/read-image.js +97 -0
- package/dist/src/remote/engine-pool.js +1 -1
- package/dist/src/run-progress.js +6 -1
- package/dist/src/run-records.d.ts +133 -27
- package/dist/src/run-records.js +320 -40
- package/dist/src/runtime.d.ts +38 -1
- package/dist/src/runtime.js +27 -4
- package/dist/src/save-lock.d.ts +11 -0
- package/dist/src/save-lock.js +29 -2
- package/dist/src/secret-redaction.d.ts +13 -0
- package/dist/src/secret-redaction.js +71 -0
- package/dist/src/session-summary.d.ts +10 -4
- package/dist/src/session-summary.js +14 -7
- package/dist/src/sessions.js +8 -2
- package/dist/src/shell.js +4 -1
- package/dist/src/side-panel.d.ts +1 -1
- package/dist/src/side-panel.js +1 -1
- package/dist/src/skill-commands.d.ts +2 -0
- package/dist/src/skill-commands.js +2 -0
- package/dist/src/skills/bundled/create-agent/SKILL.md +81 -0
- package/dist/src/skills/bundled/create-skill/SKILL.md +81 -0
- package/dist/src/skills/bundled/doctor/SKILL.md +43 -0
- package/dist/src/skills/bundled/graph-manager/SKILL.md +100 -0
- package/dist/src/skills/bundled/graph-manager/errors.md +38 -0
- package/dist/src/skills/bundled/graph-manager/patterns.md +78 -0
- package/dist/src/skills/bundled/manage-mcp/SKILL.md +75 -0
- package/dist/src/skills/bundled/manage-mcp/probe.md +165 -0
- package/dist/src/skills/bundled/manage-skills/SKILL.md +67 -0
- package/dist/src/skills/bundled/provenance.json +50 -0
- package/dist/src/skills/bundled/write-instructions/SKILL.md +42 -0
- package/dist/src/skills/invocable-skills.d.ts +41 -0
- package/dist/src/skills/invocable-skills.js +49 -0
- package/dist/src/skills/prompt-skills.d.ts +1 -0
- package/dist/src/skills/prompt-skills.js +33 -0
- package/dist/src/skills/runtime-skills.d.ts +4 -0
- package/dist/src/skills/runtime-skills.js +21 -0
- package/dist/src/structured-step.d.ts +55 -0
- package/dist/src/structured-step.js +85 -0
- package/dist/src/subagent-run.d.ts +1 -1
- package/dist/src/subagent-run.js +29 -33
- package/dist/src/telemetry/schema.d.ts +2 -2
- package/dist/src/telemetry/schema.js +3 -2
- package/dist/src/terminal-ui.d.ts +38 -0
- package/dist/src/terminal-ui.js +126 -28
- package/dist/src/timers.d.ts +21 -2
- package/dist/src/timers.js +12 -4
- package/dist/src/tool-dependencies.js +4 -0
- package/dist/src/tool-names.d.ts +18 -0
- package/dist/src/tool-names.js +26 -0
- package/dist/src/tools.d.ts +9 -0
- package/dist/src/tools.js +159 -20
- package/dist/src/trajectory.js +32 -12
- package/dist/src/transcript.js +5 -0
- package/dist/src/types.d.ts +36 -0
- package/dist/src/web-search.d.ts +59 -0
- package/dist/src/web-search.js +216 -0
- package/docs/agents/README.md +2 -2
- package/docs/agents/mcp-server.md +28 -3
- package/docs/agents/subagent-mode.md +7 -4
- package/docs/concepts/README.md +1 -1
- package/docs/concepts/security.md +4 -2
- package/docs/getting-started/accounts.md +15 -4
- package/docs/getting-started/configure-providers.md +30 -3
- package/docs/guides/README.md +1 -0
- package/docs/guides/browser.md +12 -0
- package/docs/guides/desktop-app.md +11 -4
- package/docs/guides/graph-builder.md +9 -1
- package/docs/guides/web-search.md +47 -0
- package/docs/reference/cli.md +4 -3
- package/docs/reference/config.md +4 -4
- package/docs/reference/slash-commands.md +2 -1
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +125 -0
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +295 -0
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +7 -0
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +206 -0
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +291 -0
- package/package.json +1 -1
- package/tests/permissions-test-plan.md +2 -1
|
@@ -368,6 +368,11 @@
|
|
|
368
368
|
current?.close();
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
+
/** Redraw an open panel after its select's options changed; a closed select needs nothing. */
|
|
372
|
+
function refreshSelect(select) {
|
|
373
|
+
if (openSelect?.select === select && select.isConnected) openPanel(select);
|
|
374
|
+
}
|
|
375
|
+
|
|
371
376
|
function installSelects() {
|
|
372
377
|
// The platform opens its list on the press itself, so the press is where it is stopped.
|
|
373
378
|
document.addEventListener('mousedown', event => {
|
|
@@ -563,5 +568,6 @@
|
|
|
563
568
|
prompt: promptDialog,
|
|
564
569
|
filePicker,
|
|
565
570
|
closeSelect: closePanel,
|
|
571
|
+
refreshSelect,
|
|
566
572
|
});
|
|
567
573
|
})();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* Which autosaved drafts the sidebar offers, and how a draft's age reads; no DOM dependencies. */
|
|
2
|
+
'use strict';
|
|
3
|
+
globalThis.AndorraDrafts = (() => {
|
|
4
|
+
/**
|
|
5
|
+
* The drafts worth a row: for each graph its newest one, and only while it still holds work the
|
|
6
|
+
* saved graph does not. A draft made from a revision older than the graph's saved one was either
|
|
7
|
+
* saved since or overtaken, so it is history, not something waiting to be picked up. `drafts`
|
|
8
|
+
* arrives newest first.
|
|
9
|
+
*/
|
|
10
|
+
function currentDrafts(drafts, graphs) {
|
|
11
|
+
const saved = new Map((graphs || []).map(graph => [graph.id, graph.revision]));
|
|
12
|
+
const seen = new Set(), current = [];
|
|
13
|
+
for (const draft of drafts || []) {
|
|
14
|
+
if (seen.has(draft.graphId)) continue;
|
|
15
|
+
seen.add(draft.graphId);
|
|
16
|
+
if (saved.has(draft.graphId) && draft.revision < saved.get(draft.graphId)) continue;
|
|
17
|
+
current.push(draft);
|
|
18
|
+
}
|
|
19
|
+
return current;
|
|
20
|
+
}
|
|
21
|
+
/** "now", "5m", "3h", "2d", then a short date: a row has room for a glance, not a timestamp. */
|
|
22
|
+
function age(updatedAt, now = Date.now()) {
|
|
23
|
+
if (!updatedAt) return '';
|
|
24
|
+
const minutes = Math.floor(Math.max(0, now - updatedAt) / 60_000);
|
|
25
|
+
if (minutes < 1) return 'now';
|
|
26
|
+
if (minutes < 60) return `${minutes}m`;
|
|
27
|
+
if (minutes < 60 * 24) return `${Math.floor(minutes / 60)}h`;
|
|
28
|
+
if (minutes < 60 * 24 * 7) return `${Math.floor(minutes / (60 * 24))}d`;
|
|
29
|
+
return new Date(updatedAt).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether an edit is worth a draft. A graph that is exactly what New or Duplicate produced holds
|
|
33
|
+
* nothing a click cannot make again, so it is not saved until it differs from that start.
|
|
34
|
+
*/
|
|
35
|
+
function worthSaving(graph, untouched) {
|
|
36
|
+
return !untouched || JSON.stringify(graph) !== untouched;
|
|
37
|
+
}
|
|
38
|
+
return { currentDrafts, age, worthSaving };
|
|
39
|
+
})();
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
// Text fields commit through onchange, usually on blur. Flush the current edited
|
|
308
308
|
// graph rather than the debounce's potentially older pending snapshot.
|
|
309
309
|
document.activeElement?.blur();
|
|
310
|
-
if (state.dirty && state.graph) {
|
|
310
|
+
if (typeof hasDraftableEdits === 'function' ? hasDraftableEdits() : state.dirty && state.graph) {
|
|
311
311
|
const snapshot = copy(state.graph);
|
|
312
312
|
await api('/api/drafts', snapshot);
|
|
313
313
|
if (JSON.stringify(state.graph) !== JSON.stringify(snapshot)) {
|
|
@@ -32,6 +32,7 @@ globalThis.AndorraIcons = (() => {
|
|
|
32
32
|
template: '<rect width="18" height="7" x="3" y="3" rx="1"/><rect width="9" height="7" x="3" y="14" rx="1"/><rect width="5" height="7" x="16" y="14" rx="1"/>',
|
|
33
33
|
upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" x2="12" y1="3" y2="15"/>',
|
|
34
34
|
download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
|
|
35
|
+
trash: '<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>',
|
|
35
36
|
history: '<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/>',
|
|
36
37
|
refresh: '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
|
|
37
38
|
bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>',
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Graph studio - 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"><script src="/theme.js"></script></head>
|
|
4
4
|
<body>
|
|
5
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="Graph and node library"><div class="section-label">Your graphs <button id="new-graph" aria-label="Create graph" title="Create graph" data-icon="plus"></button></div><input id="search" type="search" placeholder="Find a graph" aria-label="Find a graph"><nav id="graphs" aria-label="Graphs" tabindex="0"></nav><div class="section-label library-label">Node library</div><input id="node-search" type="search" placeholder="Search nodes..." aria-label="Search nodes"><nav id="node-library" aria-label="Node library"></nav><p class="hint">Drag a node 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">Graph studio</strong><span id="revision">Loading graphs...</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><button id="save" class="primary">Save revision</button></div></header><div class="workspace"><section id="canvas" aria-label="Graph canvas"><div id="scene"><svg id="edges" aria-label="Graph connections"></svg><div id="nodes"></div></div><div id="empty">Create a graph to get started.</div><div id="canvas-hint" class="canvas-hint" role="note"><span id="canvas-hint-text">Drag the background to pan - 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 graph" title="Fit graph" data-icon="fit"></button><button id="layout" aria-label="Arrange" title="Arrange nodes" 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">Graph settings</strong><button id="graph-settings" class="btn-small">Graph</button></header><div id="inspector-body"></div></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
|
-
<script src="/compat.js" defer></script><script src="/icons.js" defer></script><script src="/controls.js" defer></script><script src="/edge-router.js" defer></script><script src="/app.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>
|
|
6
|
+
<main><header class="chrome"><div id="host-chrome" class="host-chrome" hidden></div><div class="graph-heading"><strong id="graph-title">Graph studio</strong><span id="revision">Loading graphs...</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><button id="save" class="primary">Save revision</button></div></header><div class="workspace"><section id="canvas" aria-label="Graph canvas"><div id="scene"><svg id="edges" aria-label="Graph connections"></svg><div id="nodes"></div></div><div id="empty">Create a graph to get started.</div><div id="canvas-hint" class="canvas-hint" role="note"><span id="canvas-hint-text">Drag the background to pan - 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 graph" title="Fit graph" data-icon="fit"></button><button id="layout" aria-label="Arrange" title="Arrange nodes" 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">Graph settings</strong><button id="graph-settings" class="btn-small" title="Show the graph's own settings">Graph settings</button></header><div id="inspector-body"></div></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
|
+
<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="/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>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Skills in graph prompts. Typing `/` in a prompt opens a browser of this machine's skills, and
|
|
3
|
+
* picking one writes its `/command` where the slash was. When the graph runs, the node loads every
|
|
4
|
+
* skill its prompts name (src/skills/prompt-skills.ts finds them with the same pattern as below).
|
|
5
|
+
*
|
|
6
|
+
* A name no skill on this machine answers to is a warning under the prompt, never an error: the
|
|
7
|
+
* graph still saves and runs, and the agent is told to go on without that skill. A graph can be
|
|
8
|
+
* built on one machine and run on another, and a project's own skills (.agents/skills) are only
|
|
9
|
+
* known when the run starts in that project.
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
(() => {
|
|
13
|
+
const REFERENCE = /(^|[\s([{])\/((?:skill::)?[A-Za-z0-9][\w-]*(?::(?:\.|[\w-]+(?:\.[\w-]+)*(?:\/[\w-]+(?:\.[\w-]+)*)*))?)(?![\w:/-])(?!\.\w)/g;
|
|
14
|
+
// A qualified command (`/team:skills/review`) keeps filtering through its slashes and dots.
|
|
15
|
+
const QUERY = /(^|[\s([{])\/([\w-]*(?::[\w.\/:-]*)?)$/;
|
|
16
|
+
const STALE_MS = 15_000;
|
|
17
|
+
const MAX_SHOWN = 60;
|
|
18
|
+
let cache = { at: 0, value: undefined, error: undefined, pending: undefined };
|
|
19
|
+
let pickerSeq = 0;
|
|
20
|
+
// One picker is open at a time; a window resize moves that one. The inspector redraws its fields
|
|
21
|
+
// often, so no per-field window listener is left behind.
|
|
22
|
+
let openPlace;
|
|
23
|
+
window.addEventListener('resize', () => openPlace?.());
|
|
24
|
+
|
|
25
|
+
const el = (tag, text, className) => { const item = document.createElement(tag); if (text !== undefined) item.textContent = text; if (className) item.className = className; return item; };
|
|
26
|
+
const icon = (name, size = 14) => globalThis.AndorraIcons?.icon?.(name, size);
|
|
27
|
+
|
|
28
|
+
/** The catalog, refetched when older than a few seconds so a skill turned on in Settings shows up. */
|
|
29
|
+
function catalog(load, force = false) {
|
|
30
|
+
if (cache.pending) return cache.pending;
|
|
31
|
+
if (!force && cache.value && Date.now() - cache.at < STALE_MS) return Promise.resolve(cache.value);
|
|
32
|
+
cache.pending = Promise.resolve().then(load).then(value => {
|
|
33
|
+
cache = { at: Date.now(), value: { skills: Array.isArray(value?.skills) ? value.skills : [], inactive: Array.isArray(value?.inactive) ? value.inactive : [], reserved: Array.isArray(value?.reserved) ? value.reserved : [] }, error: undefined, pending: undefined };
|
|
34
|
+
return cache.value;
|
|
35
|
+
}, error => {
|
|
36
|
+
// A failed refresh keeps the last catalog that loaded; with none, nothing is judged missing.
|
|
37
|
+
cache = { ...cache, at: Date.now(), error: error?.message || String(error), pending: undefined };
|
|
38
|
+
return cache.value;
|
|
39
|
+
});
|
|
40
|
+
return cache.pending;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Every `/name` a prompt names, in order, without built-in commands. */
|
|
44
|
+
function references(text, reserved = []) {
|
|
45
|
+
const names = [];
|
|
46
|
+
if (typeof text !== 'string' || !text.includes('/')) return names;
|
|
47
|
+
for (const match of text.matchAll(REFERENCE)) {
|
|
48
|
+
const name = match[2];
|
|
49
|
+
if (!reserved.includes(name) && !names.includes(name)) names.push(name);
|
|
50
|
+
}
|
|
51
|
+
return names;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const named = (skill, name) => skill.command === '/' + name || skill.id === name;
|
|
55
|
+
const answers = (skill, name) => named(skill, name) || skill.name === name;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The names in a prompt this machine cannot load, each with the reason. An installed skill owns
|
|
59
|
+
* its name even while turned off or broken, as it does for a typed command: Andorra's skill of the
|
|
60
|
+
* same name then answers only to `/andorra:name`, so the short name is reported, not substituted.
|
|
61
|
+
*/
|
|
62
|
+
function problems(text, value) {
|
|
63
|
+
if (!value) return [];
|
|
64
|
+
const result = [];
|
|
65
|
+
for (const name of references(text, value.reserved)) {
|
|
66
|
+
if (value.skills.some(skill => named(skill, name))) continue;
|
|
67
|
+
const inactive = value.inactive.find(skill => answers(skill, name));
|
|
68
|
+
if (!inactive && value.skills.some(skill => skill.source === 'installed' && answers(skill, name))) continue;
|
|
69
|
+
result.push({ name, state: inactive?.state ?? 'missing' });
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function problemText({ name, state }) {
|
|
75
|
+
if (state === 'disabled') return `/${name} is turned off in Skills settings. The node still runs, without it.`;
|
|
76
|
+
if (state === 'unavailable') return `/${name} is installed but cannot be loaded; repair it in Skills settings. The node still runs, without it.`;
|
|
77
|
+
return `Skill /${name} not found on this machine. The node still runs, without it.`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function matching(skills, query) {
|
|
81
|
+
const needle = query.toLowerCase();
|
|
82
|
+
const rank = skill => skill.command.slice(1).toLowerCase().startsWith(needle) ? 0 : String(skill.name).toLowerCase().startsWith(needle) ? 1 : 2;
|
|
83
|
+
return skills
|
|
84
|
+
.filter(skill => typeof skill.command === 'string' && `${skill.command}\n${skill.name}\n${skill.id}\n${skill.description ?? ''}`.toLowerCase().includes(needle))
|
|
85
|
+
.sort((a, b) => rank(a) - rank(b) || (a.source === b.source ? 0 : a.source === 'installed' ? -1 : 1) || a.command.localeCompare(b.command));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The caret's box in the viewport, measured on a mirror of the textarea. */
|
|
89
|
+
function caretRect(textarea) {
|
|
90
|
+
const box = textarea.getBoundingClientRect();
|
|
91
|
+
try {
|
|
92
|
+
const style = getComputedStyle(textarea);
|
|
93
|
+
const mirror = document.createElement('div');
|
|
94
|
+
for (const property of ['boxSizing', 'width', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle', 'letterSpacing', 'lineHeight', 'tabSize', 'textTransform', 'wordSpacing', 'textIndent']) mirror.style[property] = style[property];
|
|
95
|
+
Object.assign(mirror.style, { position: 'fixed', visibility: 'hidden', top: '0', left: '-9999px', whiteSpace: 'pre-wrap', overflowWrap: 'break-word', overflow: 'hidden', height: 'auto' });
|
|
96
|
+
mirror.textContent = textarea.value.slice(0, textarea.selectionStart);
|
|
97
|
+
const marker = el('span', '\u200b'); mirror.append(marker);
|
|
98
|
+
document.body.append(mirror);
|
|
99
|
+
const top = marker.offsetTop - textarea.scrollTop, left = marker.offsetLeft - textarea.scrollLeft;
|
|
100
|
+
const height = parseFloat(style.lineHeight) || marker.offsetHeight || 18;
|
|
101
|
+
mirror.remove();
|
|
102
|
+
const y = Math.min(Math.max(box.top + top, box.top), box.bottom - height);
|
|
103
|
+
const x = Math.min(Math.max(box.left + left, box.left), box.right);
|
|
104
|
+
return { left: x, top: y, bottom: y + height };
|
|
105
|
+
} catch { return { left: box.left, top: box.bottom, bottom: box.bottom }; }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Gives a prompt textarea the `/` picker and the warning row. `load` fetches the catalog;
|
|
110
|
+
* `onPick` runs after a picked command is written, so the caller can record the change.
|
|
111
|
+
*/
|
|
112
|
+
function attach(textarea, { load, onPick } = {}) {
|
|
113
|
+
if (!textarea || typeof load !== 'function' || textarea.dataset?.skillPicker) return;
|
|
114
|
+
textarea.dataset.skillPicker = 'on';
|
|
115
|
+
const id = `skill-picker-${++pickerSeq}`;
|
|
116
|
+
textarea.setAttribute('aria-autocomplete', 'list');
|
|
117
|
+
textarea.setAttribute('aria-haspopup', 'listbox');
|
|
118
|
+
textarea.setAttribute('aria-expanded', 'false');
|
|
119
|
+
|
|
120
|
+
const warnings = el('div', undefined, 'skill-warnings'); warnings.setAttribute('role', 'status'); warnings.hidden = true;
|
|
121
|
+
textarea.after(warnings);
|
|
122
|
+
const renderWarnings = value => {
|
|
123
|
+
warnings.replaceChildren();
|
|
124
|
+
for (const problem of problems(textarea.value, value)) {
|
|
125
|
+
const row = el('p', undefined, 'skill-warning');
|
|
126
|
+
row.title = 'A skill in a project\'s .agents/skills folder is found when the graph runs in that project. Install or turn on skills in Settings > Skills.';
|
|
127
|
+
const glyph = icon('warning'); if (glyph) row.append(glyph);
|
|
128
|
+
row.append(el('span', problemText(problem)));
|
|
129
|
+
warnings.append(row);
|
|
130
|
+
}
|
|
131
|
+
warnings.hidden = !warnings.childElementCount;
|
|
132
|
+
};
|
|
133
|
+
let warnTimer;
|
|
134
|
+
const refreshWarnings = (force = false) => { void catalog(load, force).then(renderWarnings); };
|
|
135
|
+
|
|
136
|
+
let panel, list, options = [], active = 0, query;
|
|
137
|
+
const close = () => {
|
|
138
|
+
panel?.remove(); panel = undefined; list = undefined; options = []; query = undefined;
|
|
139
|
+
if (openPlace === place) openPlace = undefined;
|
|
140
|
+
textarea.setAttribute('aria-expanded', 'false'); textarea.removeAttribute('aria-controls'); textarea.removeAttribute('aria-activedescendant');
|
|
141
|
+
};
|
|
142
|
+
const highlight = index => {
|
|
143
|
+
active = index;
|
|
144
|
+
options.forEach((option, i) => { option.row.dataset.active = String(i === index); option.row.setAttribute('aria-selected', String(i === index)); });
|
|
145
|
+
const current = options[index]?.row;
|
|
146
|
+
if (current) { textarea.setAttribute('aria-activedescendant', current.id); current.scrollIntoView?.({ block: 'nearest' }); }
|
|
147
|
+
else textarea.removeAttribute('aria-activedescendant');
|
|
148
|
+
};
|
|
149
|
+
const accept = skill => {
|
|
150
|
+
if (!query || !skill) return;
|
|
151
|
+
const value = textarea.value;
|
|
152
|
+
// A pick replaces the whole token under the caret, including any part typed after it.
|
|
153
|
+
const tail = /^[\w:.\/-]*/.exec(value.slice(query.end))[0].length;
|
|
154
|
+
const after = value.slice(query.end + tail);
|
|
155
|
+
const insert = skill.command + (/^\s/.test(after) ? '' : ' ');
|
|
156
|
+
textarea.value = value.slice(0, query.start) + insert + after;
|
|
157
|
+
const caret = query.start + insert.length;
|
|
158
|
+
textarea.setSelectionRange(caret, caret);
|
|
159
|
+
close();
|
|
160
|
+
textarea.dispatchEvent(new Event('input', { bubbles: true }));
|
|
161
|
+
textarea.dispatchEvent(new Event('change', { bubbles: true }));
|
|
162
|
+
onPick?.(skill);
|
|
163
|
+
};
|
|
164
|
+
const place = () => {
|
|
165
|
+
if (!panel) return;
|
|
166
|
+
const caret = caretRect(textarea);
|
|
167
|
+
const width = Math.min(380, window.innerWidth - 16);
|
|
168
|
+
panel.style.width = `${width}px`;
|
|
169
|
+
panel.style.left = `${Math.min(Math.max(8, caret.left - 12), window.innerWidth - width - 8)}px`;
|
|
170
|
+
const below = window.innerHeight - caret.bottom - 12, above = caret.top - 12;
|
|
171
|
+
if (below >= 180 || below >= above) { panel.style.top = `${caret.bottom + 4}px`; panel.style.bottom = ''; panel.style.maxHeight = `${Math.max(120, below)}px`; }
|
|
172
|
+
else { panel.style.bottom = `${window.innerHeight - caret.top + 4}px`; panel.style.top = ''; panel.style.maxHeight = `${Math.max(120, above)}px`; }
|
|
173
|
+
};
|
|
174
|
+
const render = value => {
|
|
175
|
+
if (!query) return;
|
|
176
|
+
if (!panel) {
|
|
177
|
+
panel = el('div', undefined, 'select-panel skill-picker'); panel.id = id;
|
|
178
|
+
panel.setAttribute('role', 'listbox'); panel.setAttribute('aria-label', 'Skills');
|
|
179
|
+
// Keep focus in the prompt while the pointer chooses.
|
|
180
|
+
panel.addEventListener('mousedown', event => event.preventDefault());
|
|
181
|
+
(textarea.closest('dialog') ?? document.body).append(panel);
|
|
182
|
+
textarea.setAttribute('aria-expanded', 'true'); textarea.setAttribute('aria-controls', id);
|
|
183
|
+
openPlace = place;
|
|
184
|
+
}
|
|
185
|
+
panel.replaceChildren();
|
|
186
|
+
list = el('div', undefined, 'select-list'); panel.append(list);
|
|
187
|
+
const found = value ? matching(value.skills, query.text).slice(0, MAX_SHOWN) : [];
|
|
188
|
+
options = [];
|
|
189
|
+
let group;
|
|
190
|
+
for (const skill of found) {
|
|
191
|
+
const source = skill.source === 'installed' ? 'Installed' : 'Andorra';
|
|
192
|
+
if (source !== group) { group = source; list.append(el('div', source, 'select-group')); }
|
|
193
|
+
const row = el('div', undefined, 'select-option skill-option'); row.id = `${id}-${options.length}`;
|
|
194
|
+
row.setAttribute('role', 'option');
|
|
195
|
+
row.append(el('span', skill.command, 'skill-option-command'));
|
|
196
|
+
if (skill.description) { const description = el('span', skill.description, 'skill-option-description'); row.title = skill.description; row.append(description); }
|
|
197
|
+
const index = options.length;
|
|
198
|
+
row.addEventListener('mousemove', () => { if (active !== index) highlight(index); });
|
|
199
|
+
row.addEventListener('click', () => accept(skill));
|
|
200
|
+
options.push({ skill, row }); list.append(row);
|
|
201
|
+
}
|
|
202
|
+
if (!found.length) {
|
|
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 node runs without a skill it cannot find.'
|
|
205
|
+
: `No skill on this machine matches /${query.text}. You can keep it; the node runs without a skill it cannot find.`;
|
|
206
|
+
list.append(el('p', text, 'help skill-picker-empty'));
|
|
207
|
+
}
|
|
208
|
+
panel.append(el('div', found.length ? 'Up/Down to choose, Enter to insert, Esc to close' : 'Esc to close', 'skill-picker-hint'));
|
|
209
|
+
highlight(Math.min(active, Math.max(0, options.length - 1)));
|
|
210
|
+
place();
|
|
211
|
+
};
|
|
212
|
+
const update = () => {
|
|
213
|
+
const start = textarea.selectionStart, end = textarea.selectionEnd;
|
|
214
|
+
const match = start === end ? QUERY.exec(textarea.value.slice(0, start)) : null;
|
|
215
|
+
if (!match || document.activeElement !== textarea) { close(); return; }
|
|
216
|
+
const next = { start: match.index + match[1].length, end: start, text: match[2] };
|
|
217
|
+
if (query?.text !== next.text) active = 0;
|
|
218
|
+
query = next;
|
|
219
|
+
render(cache.value);
|
|
220
|
+
void catalog(load).then(value => { if (query === next) render(value); });
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
textarea.addEventListener('input', () => { update(); clearTimeout(warnTimer); warnTimer = setTimeout(() => refreshWarnings(), 200); });
|
|
224
|
+
textarea.addEventListener('click', update);
|
|
225
|
+
textarea.addEventListener('focus', () => refreshWarnings());
|
|
226
|
+
textarea.addEventListener('blur', close);
|
|
227
|
+
textarea.addEventListener('scroll', () => place());
|
|
228
|
+
// Capture runs before the prompt's own Escape handling (leaving full screen), so Escape closes
|
|
229
|
+
// only the picker while it is open.
|
|
230
|
+
textarea.addEventListener('keydown', event => {
|
|
231
|
+
if (!panel || event.isComposing) return;
|
|
232
|
+
if (event.key === 'Escape') { event.preventDefault(); event.stopImmediatePropagation(); close(); return; }
|
|
233
|
+
if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey || !options.length) return;
|
|
234
|
+
if (event.key === 'ArrowDown') { event.preventDefault(); highlight((active + 1) % options.length); }
|
|
235
|
+
else if (event.key === 'ArrowUp') { event.preventDefault(); highlight((active - 1 + options.length) % options.length); }
|
|
236
|
+
else if (event.key === 'Enter' || event.key === 'Tab') { event.preventDefault(); accept(options[active]?.skill); }
|
|
237
|
+
}, true);
|
|
238
|
+
refreshWarnings();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
globalThis.AndorraSkillPicker = { attach, references, problems, problemText, invalidate: () => { cache = { at: 0, value: undefined, error: undefined, pending: undefined }; } };
|
|
242
|
+
})();
|
|
@@ -73,14 +73,16 @@
|
|
|
73
73
|
|
|
74
74
|
#studio-minimap {
|
|
75
75
|
position: absolute; bottom: var(--space-4); right: var(--space-4); width: 160px; height: 100px;
|
|
76
|
-
border: 1px solid var(--border); background: var(--bg-input); border-radius:
|
|
77
|
-
box-shadow: var(--shadow-menu); z-index: 4; cursor: crosshair;
|
|
76
|
+
border: 1px solid var(--border); background: var(--bg-input); border-radius: var(--card-radius);
|
|
77
|
+
box-shadow: var(--shadow-menu); z-index: 4; cursor: crosshair; overflow: hidden;
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
/* The map is a sketch of the canvas: nodes are quiet blocks in the card's own outline colour, so
|
|
80
|
+
the viewport's frame is the brightest thing on it. */
|
|
81
|
+
#studio-minimap .studio-minimap-node { fill: var(--border-strong); stroke: none; rx: 2px; }
|
|
82
|
+
#studio-minimap .studio-minimap-end { fill: var(--ok); stroke: none; rx: 2px; opacity: .8; }
|
|
81
83
|
/* The viewport is a faint wash. A webview without `color-mix()` keeps the fallback, which leaves
|
|
82
84
|
the rectangle unfilled rather than drawing it as a solid block. */
|
|
83
|
-
#studio-minimap .studio-minimap-viewport { fill: transparent; fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--
|
|
85
|
+
#studio-minimap .studio-minimap-viewport { fill: transparent; fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--border-strong); stroke-width: 1; rx: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
|
|
84
86
|
|
|
85
87
|
/* Node run states. The live state is the register's own "alive" colour; the settled states are
|
|
86
88
|
the two colours the chrome allows, done and error. */
|
|
@@ -113,7 +113,9 @@ textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
|
|
|
113
113
|
}
|
|
114
114
|
.rail > * { position: relative; z-index: 1; }
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
/* The footer is one status line under a quiet label: a dot, then what the account's sync is doing. */
|
|
117
|
+
.rail-footer span { display: flex; align-items: baseline; gap: 6px; font-size: var(--type-xs); font-weight: var(--weight-regular); color: var(--text-2); margin-top: 2px; line-height: 1.4; }
|
|
118
|
+
.rail-footer span::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transform: translateY(-1px); }
|
|
117
119
|
|
|
118
120
|
/* The window title already names the product, so the rail opens straight onto the graphs. */
|
|
119
121
|
.rail-body { padding: var(--space-3) var(--space-2) var(--space-4); overflow: auto; flex: 1; min-height: 0; }
|
|
@@ -129,9 +131,34 @@ textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
|
|
|
129
131
|
.section-label button:hover:not(:disabled) { background: var(--rail-wash); color: var(--text); }
|
|
130
132
|
|
|
131
133
|
#search, #node-search { margin-bottom: var(--space-3); }
|
|
134
|
+
/* The rail's two filters rest as a quiet wash with a magnifier, not an outlined box: the rail is a
|
|
135
|
+
list of rows, and an outline at rest read as a form. The outline returns under the pointer and
|
|
136
|
+
the accent ring on focus. The glyph is a mid grey that holds on both grounds. */
|
|
137
|
+
.rail input[type="search"] {
|
|
138
|
+
padding-left: 30px; border-color: transparent; background-color: var(--rail-wash);
|
|
139
|
+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23858585' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.6-3.6'/></svg>");
|
|
140
|
+
background-repeat: no-repeat; background-position: 9px 50%; background-size: 14px 14px;
|
|
141
|
+
}
|
|
142
|
+
.rail input[type="search"]:hover { border-color: var(--border-strong); }
|
|
143
|
+
.rail input[type="search"]:focus-visible { border-color: var(--accent); background-color: var(--bg-input); }
|
|
132
144
|
|
|
133
145
|
/* Rows: one anatomy, everywhere. */
|
|
134
|
-
#graphs { display: grid; gap: 1px; }
|
|
146
|
+
#graphs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
|
|
147
|
+
/* Drafts are a second, quieter group under the saved graphs. */
|
|
148
|
+
.graph-drafts-head {
|
|
149
|
+
display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
|
|
150
|
+
margin-top: var(--space-2); padding: var(--space-1) var(--space-2) 2px;
|
|
151
|
+
font-size: var(--type-xs); color: var(--text-3);
|
|
152
|
+
}
|
|
153
|
+
.graph-drafts-clear, .graph-drafts-toggle {
|
|
154
|
+
border: 0; background: transparent; min-height: 0; height: auto; width: auto;
|
|
155
|
+
padding: 2px var(--space-1); border-radius: var(--row-radius);
|
|
156
|
+
font: inherit; font-size: var(--type-xs); color: var(--text-3); cursor: pointer;
|
|
157
|
+
}
|
|
158
|
+
.graph-drafts-clear:hover:not(:disabled), .graph-drafts-toggle:hover { background: var(--rail-wash); color: var(--text); }
|
|
159
|
+
.graph-drafts-toggle { justify-self: start; margin: 2px var(--space-1) 0; }
|
|
160
|
+
.graph-row.draft-row span { color: var(--text-2); }
|
|
161
|
+
.graph-row.draft-row small { font-variant-numeric: tabular-nums; }
|
|
135
162
|
.graph-row {
|
|
136
163
|
display: flex; align-items: center; justify-content: space-between; width: 100%;
|
|
137
164
|
min-height: var(--row-height); padding: 0 var(--space-2); gap: var(--space-2);
|
|
@@ -163,7 +190,7 @@ textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
|
|
|
163
190
|
|
|
164
191
|
.hint { color: var(--text-3); line-height: 1.5; font-size: var(--type-xs); margin: var(--space-3) var(--space-2); }
|
|
165
192
|
|
|
166
|
-
.rail-footer { padding:
|
|
193
|
+
.rail-footer { padding: var(--space-2) var(--space-3) 10px; border-top: 1px solid var(--border); font-size: var(--type-xs); color: var(--text-3); }
|
|
167
194
|
|
|
168
195
|
/* The workspace ----------------------------------------------------------- */
|
|
169
196
|
|
|
@@ -371,11 +398,13 @@ body.prompt-fullscreen #inspector { z-index: 60; }
|
|
|
371
398
|
.section h3 .info-tip { margin-left: var(--space-1); }
|
|
372
399
|
|
|
373
400
|
.section { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-4); }
|
|
374
|
-
|
|
401
|
+
/* A heading names a group of fields, so it reads a step above their labels rather than as one. */
|
|
402
|
+
.section h3 { display: flex; align-items: center; font-size: var(--type-row); font-weight: var(--weight-strong); margin: 0 0 var(--space-3); color: var(--text); }
|
|
375
403
|
.section > button + button { margin-left: var(--space-1); }
|
|
376
404
|
.section > .primary { max-width: 100%; white-space: normal; }
|
|
377
405
|
|
|
378
|
-
.disclosure > summary { font-size: var(--type-
|
|
406
|
+
.disclosure > summary { font-size: var(--type-row); cursor: pointer; color: var(--text); font-weight: var(--weight-strong); margin-bottom: var(--space-3); }
|
|
407
|
+
.disclosure > summary:hover { color: var(--text); }
|
|
379
408
|
/* A closed group keeps the gap an open one gets from its last field, so the heading does not sit
|
|
380
409
|
on the field that follows it. */
|
|
381
410
|
.disclosure:not([open]) > summary { margin-bottom: 0; }
|
|
@@ -389,9 +418,32 @@ body.prompt-fullscreen #inspector { z-index: 60; }
|
|
|
389
418
|
.link-button:hover:not(:disabled) { background: transparent; color: var(--text); }
|
|
390
419
|
.provider-warning { margin: 0 0 var(--space-3); }
|
|
391
420
|
|
|
421
|
+
/* Skills in prompts (skill-picker.js): the `/` picker reuses the dropdown panel, and a name this
|
|
422
|
+
machine has no skill for is a warning row under its field, not a validation error. */
|
|
423
|
+
.field > .skill-warnings { grid-column: 1 / -1; grid-row: 3; }
|
|
424
|
+
.skill-warnings { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-1); }
|
|
425
|
+
.skill-warnings[hidden] { display: none; }
|
|
426
|
+
.skill-warning {
|
|
427
|
+
display: flex; align-items: flex-start; gap: var(--space-1); margin: 0; padding: 4px var(--space-2);
|
|
428
|
+
border-radius: var(--row-radius); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn);
|
|
429
|
+
font-size: var(--type-xs); line-height: 1.5; cursor: help;
|
|
430
|
+
}
|
|
431
|
+
.skill-warning > svg { flex: none; margin-top: 2px; }
|
|
432
|
+
/* controls.css loads after this file, so the picker's rules are scoped to win over .select-option. */
|
|
433
|
+
.skill-picker.select-panel { z-index: 450; }
|
|
434
|
+
.skill-picker .skill-option { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; min-height: 36px; padding: 4px 8px; text-align: left; }
|
|
435
|
+
.skill-picker .skill-option-command { display: block; min-width: 0; font-family: var(--font-mono); font-size: var(--type-row); overflow: hidden; text-overflow: ellipsis; }
|
|
436
|
+
.skill-picker .skill-option-description { display: block; min-width: 0; color: var(--text-3); font-size: var(--type-xs); overflow: hidden; text-overflow: ellipsis; }
|
|
437
|
+
.skill-picker-empty { margin: 6px 8px; white-space: normal; }
|
|
438
|
+
.skill-picker-hint { padding: 6px 8px 2px; border-top: 1px solid var(--border); margin-top: 4px; color: var(--text-3); font-size: var(--type-xs); }
|
|
439
|
+
|
|
392
440
|
/* A validation problem is an error, and errors are the one colour the chrome allows. */
|
|
393
441
|
.validation { font-size: var(--type-xs); line-height: 1.5; padding-left: 18px; color: var(--err-text); }
|
|
394
|
-
.valid { color: var(--text-2); font-size: var(--type-xs); }
|
|
442
|
+
.valid { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-2); font-size: var(--type-xs); }
|
|
443
|
+
/* A graph that passed validation says so with the one "done" colour the chrome allows. */
|
|
444
|
+
.valid.ok::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
|
|
445
|
+
/* The graph's id is a reference, not a field: one quiet line that never wraps the panel. */
|
|
446
|
+
.graph-meta { margin: calc(-1 * var(--space-1)) 0 var(--space-3); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; -webkit-user-select: text; }
|
|
395
447
|
.danger { color: var(--err-text); }
|
|
396
448
|
|
|
397
449
|
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
|
|
@@ -406,13 +458,13 @@ body.prompt-fullscreen #inspector { z-index: 60; }
|
|
|
406
458
|
/* The status strip -------------------------------------------------------- */
|
|
407
459
|
|
|
408
460
|
.status {
|
|
409
|
-
height:
|
|
410
|
-
gap: var(--space-4); border-top: 1px solid var(--border); padding: 0 var(--space-3); font-size: var(--type-xs);
|
|
411
|
-
color: var(--text-
|
|
461
|
+
height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
|
|
462
|
+
gap: var(--space-4); border-top: 1px solid var(--border); padding: 0 var(--space-2) 0 var(--space-3); font-size: var(--type-xs);
|
|
463
|
+
color: var(--text-3); background: var(--bg-surface);
|
|
412
464
|
}
|
|
413
465
|
.status button {
|
|
414
|
-
border: 0; background: transparent; font-size: var(--type-xs); height:
|
|
415
|
-
border-radius: var(--row-radius); color: var(--text-
|
|
466
|
+
border: 0; background: transparent; font-size: var(--type-xs); height: 22px; min-height: 0; padding: 0 var(--space-2);
|
|
467
|
+
border-radius: var(--row-radius); color: var(--text-3);
|
|
416
468
|
}
|
|
417
469
|
.status button:hover:not(:disabled) { background: var(--bg-card); color: var(--text); }
|
|
418
470
|
.status.error { color: var(--err-text); }
|
|
@@ -447,7 +499,8 @@ body.prompt-fullscreen #inspector { z-index: 60; }
|
|
|
447
499
|
.rail-body.is-scrolling::-webkit-scrollbar-thumb, #graphs.is-scrolling::-webkit-scrollbar-thumb,
|
|
448
500
|
.rail-body:focus-visible::-webkit-scrollbar-thumb, #graphs:focus-visible::-webkit-scrollbar-thumb { background: var(--text-3); }
|
|
449
501
|
.rail-body::-webkit-scrollbar-button, #graphs::-webkit-scrollbar-button { display: none; }
|
|
450
|
-
|
|
502
|
+
/* Tall enough to browse: about ten rows, and never more than the node library can spare. */
|
|
503
|
+
#graphs { max-height: clamp(150px, 42vh, 420px); overflow-x: hidden; overflow-y: auto; }
|
|
451
504
|
@media (forced-colors: active) { .rail-body, #graphs { scrollbar-color: auto; } }
|
|
452
505
|
|
|
453
506
|
/* Narrow windows --------------------------------------------------------- */
|
package/dist/src/graphs.d.ts
CHANGED
|
@@ -177,7 +177,7 @@ export interface Graph {
|
|
|
177
177
|
[key: string]: unknown;
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
export declare const GRAPH_TOOLS: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "PowerShell", "NativeExec", "AsyncProcess", "PowerShellFast", "ShellMetrics", "read_file", "list_files", "search_files", "write_file", "edit_file", "read", "write", "edit", "find", "grep", "ls", "powershell", "bash", "shell", "git_read", "read_artifact", "write_artifact", "repo_explore", "memory_search", "set_timer", "pull_request", "qa.inspect_project", "qa.status", "qa.fast", "qa.deep", "qa.test", "qa.terminal", "qa.security", "qa.browser", "qa.browser_session", "read_skill_resource", "browser.panel"];
|
|
180
|
+
export declare const GRAPH_TOOLS: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "PowerShell", "NativeExec", "AsyncProcess", "PowerShellFast", "ShellMetrics", "read_file", "list_files", "search_files", "write_file", "edit_file", "read", "write", "edit", "find", "grep", "ls", "powershell", "bash", "shell", "git_read", "read_artifact", "write_artifact", "repo_explore", "memory_search", "set_timer", "pull_request", "graphs", "qa.inspect_project", "qa.status", "qa.fast", "qa.deep", "qa.test", "qa.terminal", "qa.security", "qa.browser", "qa.browser_session", "browser.solve_captcha", "web_search", "read_skill_resource", "browser.panel", "browser.incognito"];
|
|
181
181
|
/** QA tool names are an explicit allowlist; gating keys off membership, never a name prefix. */
|
|
182
182
|
export declare const QA_TOOL_NAMES: readonly string[];
|
|
183
183
|
export declare const isQaToolName: (name: string) => boolean;
|
|
@@ -207,7 +207,14 @@ export declare const DEFAULT_HARNESS_REVISION_2: Graph;
|
|
|
207
207
|
export declare const DEFAULT_HARNESS_REVISION_3: Graph;
|
|
208
208
|
/** Frozen revision 4 adds skill resources to the published revision-3 snapshot. */
|
|
209
209
|
export declare const DEFAULT_HARNESS_REVISION_4: Graph;
|
|
210
|
-
/**
|
|
210
|
+
/** Frozen revision 5 enables the integrated browser for all default agents. */
|
|
211
|
+
export declare const DEFAULT_HARNESS_REVISION_5: Graph;
|
|
212
|
+
/**
|
|
213
|
+
* Revision 6 renames the bundled execution agent to Andorra Agent and widens its role to general
|
|
214
|
+
* tasks alongside coding. The agent still receives the confirmed task instruction through the same
|
|
215
|
+
* intake handoff, and topology, capabilities and tooling are exactly revision 5's, so the change is
|
|
216
|
+
* presentation and instruction only.
|
|
217
|
+
*/
|
|
211
218
|
export declare const DEFAULT_HARNESS: Graph;
|
|
212
219
|
/** Upgrade only in-memory copies. Stored snapshots remain unchanged. */
|
|
213
220
|
/**
|
|
@@ -224,9 +231,22 @@ export declare function effectiveCapabilities(node: {
|
|
|
224
231
|
export declare function intakeCapabilities(node: {
|
|
225
232
|
capabilities?: CapabilityPolicy;
|
|
226
233
|
}): CapabilityPolicy;
|
|
227
|
-
|
|
234
|
+
/** The second completion outcome of a delegating Orchestrator: subagents did the work and it landed. */
|
|
235
|
+
export declare const DELIVERED_OUTCOME = "delivered";
|
|
236
|
+
/**
|
|
237
|
+
* Who a tool set is being built for: `false` the node's own agent, `true` an ordinary child, and
|
|
238
|
+
* `'delegated-worktree'` a writing child of a delegating Orchestrator running in its own worktree.
|
|
239
|
+
* Only the last may run commands; it does so inside its worktree, which is a working directory,
|
|
240
|
+
* not a sandbox, so commands go through the same approval rules as the parent's shell.
|
|
241
|
+
*/
|
|
242
|
+
export type CommandScope = boolean | 'delegated-worktree';
|
|
243
|
+
export declare function isWritingRole(role: SubagentRole): boolean;
|
|
244
|
+
/** An Orchestrator delegates implementation when spawning is on and at least one role may write. */
|
|
245
|
+
export declare function delegatesWriting(node: GraphNode): boolean;
|
|
246
|
+
export declare function permitsBuiltInTool(node: Pick<GraphNode, 'capabilities' | 'tools'>, name: string, child?: CommandScope): boolean;
|
|
228
247
|
export declare function capabilitySubset(child: CapabilityPolicy, parent: CapabilityPolicy): boolean;
|
|
229
248
|
export declare function nodeOutcomes(node: GraphNode): string[];
|
|
249
|
+
export declare function minimumGraphToolCalls(graph: Graph): number;
|
|
230
250
|
export interface GraphValidationOptions {
|
|
231
251
|
providers?: {
|
|
232
252
|
id: string;
|
|
@@ -263,8 +283,43 @@ export declare function graphLeavesNodesToSession(graph: {
|
|
|
263
283
|
export declare class GraphConflictError extends Error {
|
|
264
284
|
constructor(message?: string);
|
|
265
285
|
}
|
|
266
|
-
/**
|
|
267
|
-
|
|
286
|
+
/**
|
|
287
|
+
* A soft-deleted graph: its latest revision carries `metadata.deletedAt`.
|
|
288
|
+
*
|
|
289
|
+
* Deleting publishes that revision rather than removing files, because cloud sync restores every graph
|
|
290
|
+
* an account holds and would bring removed files back. Every earlier revision stays stored.
|
|
291
|
+
*/
|
|
292
|
+
export declare function isDeletedGraph(graph: Pick<Graph, 'metadata'>): boolean;
|
|
293
|
+
/** What a listing shows. Quota is computed from the full list, so deleted graphs still count there. */
|
|
294
|
+
export declare function withoutDeletedGraphs<T extends Pick<Graph, 'metadata'>>(graphs: T[]): T[];
|
|
295
|
+
/** A new run named a deleted graph. Resuming a session that already ran it is still allowed. */
|
|
296
|
+
export declare class GraphDeletedError extends Error {
|
|
297
|
+
readonly code = "GRAPH_DELETED";
|
|
298
|
+
constructor(name: string);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Publish an immutable cloud revision only when the local revision is absent or identical.
|
|
302
|
+
*
|
|
303
|
+
* `skip` and `floorOf` are consulted under the folder's save lock immediately before any write:
|
|
304
|
+
* a graph deleted on this machine must not be written back, and asking while holding the lock
|
|
305
|
+
* makes those verdicts final against a delete or revival that is still running.
|
|
306
|
+
*/
|
|
307
|
+
export declare function restoreGraphRevision(input: unknown, directory: string, skip?: (graph: Graph) => Promise<boolean>, floorOf?: (graph: Graph) => Promise<number | undefined>): Promise<{
|
|
308
|
+
graph: Graph;
|
|
309
|
+
restored: boolean;
|
|
310
|
+
}>;
|
|
268
311
|
export declare function loadGraph(id: string, revision?: number, directory?: string): Promise<Graph>;
|
|
269
312
|
export declare function listGraphs(directory?: string, onLoadError?: (id: string, error: unknown) => void): Promise<Graph[]>;
|
|
270
313
|
export declare function saveGraph(input: unknown, expectedRevision: number | null, directory?: string): Promise<Graph>;
|
|
314
|
+
/**
|
|
315
|
+
* Remove a saved graph and its whole revision history.
|
|
316
|
+
*
|
|
317
|
+
* The save lock serializes against a save or cloud restore of the same graph, so a delete cannot
|
|
318
|
+
* race one into leaving a half-written folder behind. The folder leaves the live path in one
|
|
319
|
+
* rename while the lock is held, so a save that lands during the removal writes into a fresh
|
|
320
|
+
* folder and survives it. Deleting the bundled `default` is refused: it has no storage to remove,
|
|
321
|
+
* and a hidden preset would only return on the next launch.
|
|
322
|
+
*/
|
|
323
|
+
export declare function deleteGraph(id: string, directory?: string, options?: {
|
|
324
|
+
onDetached?: () => Promise<void>;
|
|
325
|
+
}): Promise<void>;
|