@andorra-labs/code 0.1.5 → 0.1.6
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 +126 -20
- package/dist/src/agent-mcp.d.ts +18 -1
- package/dist/src/agent-mcp.js +103 -8
- package/dist/src/app-server/protocol.d.ts +33 -3
- package/dist/src/app-server/protocol.js +14 -1
- package/dist/src/app-server/workspace.d.ts +1 -0
- package/dist/src/app-server/workspace.js +7 -1
- package/dist/src/app-server.d.ts +115 -41
- package/dist/src/app-server.js +1229 -219
- package/dist/src/automation-runner.d.ts +9 -0
- package/dist/src/automation-runner.js +22 -1
- package/dist/src/automation-tool.js +8 -1
- package/dist/src/automations.js +1 -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.js +13 -2
- 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 +53 -22
- package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +1 -1
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +5 -5
- package/dist/src/coding-tools.js +44 -5
- 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 +10 -1
- package/dist/src/commands.js +7 -7
- package/dist/src/completion.d.ts +23 -5
- package/dist/src/completion.js +334 -17
- package/dist/src/config.d.ts +13 -0
- package/dist/src/config.js +28 -2
- package/dist/src/deadline.js +6 -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 +7 -0
- package/dist/src/graph-server.js +61 -3
- package/dist/src/graph-sync.d.ts +50 -0
- package/dist/src/graph-sync.js +383 -12
- package/dist/src/graph-ui/app.js +61 -8
- package/dist/src/graph-ui/icons.js +1 -0
- package/dist/src/graph-ui/index.html +1 -1
- package/dist/src/graph-ui/skill-picker.js +242 -0
- package/dist/src/graph-ui/style.css +19 -0
- package/dist/src/graphs.d.ts +46 -4
- package/dist/src/graphs.js +152 -27
- 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/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 +2 -2
- package/dist/src/powershell-pool.js +18 -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-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 +111 -17
- package/dist/src/pull-requests.js +308 -76
- package/dist/src/qa/qa-authorize.js +9 -1
- package/dist/src/react-runtime.js +76 -5
- 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/sessions.js +4 -1
- 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 +97 -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 +29 -0
- package/dist/src/terminal-ui.js +112 -28
- package/dist/src/timers.d.ts +21 -2
- package/dist/src/timers.js +12 -4
- package/dist/src/tool-names.d.ts +18 -0
- package/dist/src/tool-names.js +26 -0
- package/dist/src/tools.js +45 -11
- package/dist/src/trajectory.js +32 -12
- package/dist/src/types.d.ts +23 -0
- package/docs/agents/mcp-server.md +13 -1
- package/docs/agents/subagent-mode.md +7 -4
- package/docs/concepts/security.md +2 -0
- package/docs/getting-started/configure-providers.md +29 -2
- package/docs/guides/browser.md +12 -0
- package/docs/guides/desktop-app.md +10 -3
- package/docs/guides/graph-builder.md +8 -0
- package/docs/reference/config.md +2 -2
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +125 -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/package.json +1 -1
- package/tests/permissions-test-plan.md +2 -1
|
@@ -2,7 +2,10 @@ import { randomUUID } from 'node:crypto';
|
|
|
2
2
|
import { browserViewUrl } from './browser-view.js';
|
|
3
3
|
import { authorize } from './tools.js';
|
|
4
4
|
import { browserEventArguments, IMAGE_LIMIT, PENDING_IMAGE_LIMIT, reserveBrowserImage } from './browser-session.js';
|
|
5
|
-
const
|
|
5
|
+
const PAGE_OPERATIONS = ['open', 'navigate', 'back', 'forward', 'refresh', 'tabs', 'activate', 'close_tab', 'snapshot', 'click', 'fill', 'press', 'scroll', 'wait', 'screenshot'];
|
|
6
|
+
/** Whole-browser switches: exposed to the agent as `browser.incognito`, relayed like any panel operation. */
|
|
7
|
+
const INCOGNITO_OPERATIONS = ['incognito_start', 'incognito_end'];
|
|
8
|
+
const OPERATIONS = [...PAGE_OPERATIONS, ...INCOGNITO_OPERATIONS];
|
|
6
9
|
const ARGUMENTS = ['operation', 'url', 'tabId', 'selector', 'value', 'key', 'button', 'deltaY'];
|
|
7
10
|
function text(args, name, max = 2048) {
|
|
8
11
|
const value = args[name];
|
|
@@ -33,6 +36,31 @@ function bound(signal, pending, timeoutMs, timeoutMessage) {
|
|
|
33
36
|
} }, fail);
|
|
34
37
|
});
|
|
35
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Run a whole-browser switch under a deadline that is also its cancellation, as an open does: the
|
|
41
|
+
* switch gets a signal that follows the run's and is aborted when the deadline passes, so a switch
|
|
42
|
+
* that outlasts its call cannot replace or close the panel browser after the agent was told it failed.
|
|
43
|
+
*/
|
|
44
|
+
async function cancellable(signal, run, timeoutMs, timeoutMessage) {
|
|
45
|
+
const owned = new AbortController();
|
|
46
|
+
const follow = () => owned.abort(signal.reason);
|
|
47
|
+
signal.addEventListener('abort', follow, { once: true });
|
|
48
|
+
if (signal.aborted)
|
|
49
|
+
follow();
|
|
50
|
+
const pending = run(owned.signal);
|
|
51
|
+
// The deadline may settle this call first; the work it gave up on reports through the controller.
|
|
52
|
+
pending.catch(() => { });
|
|
53
|
+
try {
|
|
54
|
+
return await bound(owned.signal, pending, timeoutMs, timeoutMessage);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
owned.abort(error);
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
signal.removeEventListener('abort', follow);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
36
64
|
/** Validate one panel operation the same way wherever it enters: the tool, or the owning engine's relay RPC. */
|
|
37
65
|
export function validatePanelArguments(args) {
|
|
38
66
|
const operation = text(args, 'operation', 20);
|
|
@@ -70,6 +98,16 @@ export async function runPanelOperation(views, sessionId, args, signal) {
|
|
|
70
98
|
const { operation, url, tabId, selector } = args;
|
|
71
99
|
if (operation === 'tabs')
|
|
72
100
|
return { result: panelTabsResult(views, sessionId) };
|
|
101
|
+
if (operation === 'incognito_start') {
|
|
102
|
+
const opened = await cancellable(signal, owned => views.startIncognito(sessionId, owned), 35_000, 'Starting the incognito browser exceeded the 35-second timeout.');
|
|
103
|
+
return { result: JSON.stringify({ sessionId, profile: 'incognito', tabId: opened.tabId,
|
|
104
|
+
note: 'The panel now shows a fresh incognito browser with one blank tab: no logins, cookies, storage, history or cache. Drive it with browser.panel (navigate this tab, or open). Nothing from it is saved. It lasts until browser.incognito end, or until the panel browser closes.' }) };
|
|
105
|
+
}
|
|
106
|
+
if (operation === 'incognito_end') {
|
|
107
|
+
const ended = await cancellable(signal, owned => views.endIncognito(sessionId, owned), 10_000, 'Ending the incognito browser exceeded the 10-second timeout.');
|
|
108
|
+
return { result: JSON.stringify({ sessionId, profile: 'project', ended,
|
|
109
|
+
note: ended ? 'The incognito browser is closed. The next browser.panel open uses the project profile again.' : 'The panel was not incognito; the project profile is already in use.' }) };
|
|
110
|
+
}
|
|
73
111
|
if (operation === 'screenshot') {
|
|
74
112
|
const shot = await views.agentScreenshot(sessionId, tabId, signal);
|
|
75
113
|
signal.throwIfAborted();
|
|
@@ -154,9 +192,9 @@ export function createBrowserPanelTool(views, sessionId, relay) {
|
|
|
154
192
|
const pending = new Map();
|
|
155
193
|
return {
|
|
156
194
|
name: 'browser.panel', family: 'browser', capability: 'browser', executionMode: 'sequential',
|
|
157
|
-
description: 'Drive the browser this session shows in its Browser panel: the visible browser the user shares, not an isolated one.
|
|
195
|
+
description: 'Drive the browser this session shows in its Browser panel: the visible browser the user shares, not an isolated one. It runs on the project\'s persistent browser profile, so logins, cookies, history and cache are shared with the user and with the project\'s other sessions and survive restarts; to test signed out or as a first-time visitor, switch it with browser.incognito first. Every action appears live in the panel, so prefer it whenever the user asks to use "the browser" or wants to watch, demonstrate or verify browsing (site logins, visual checks). open/navigate take an HTTP(S) url; every operation except tabs/screenshot answers with a snapshot whose observed CSS selectors drive click/fill/wait. tabId, from a snapshot or tabs, optionally targets one tab, otherwise the active tab. Operations: open, navigate, back, forward, refresh, tabs, activate, close_tab, snapshot, click, fill, press, scroll, wait, screenshot. screenshot returns a native image; at most 10 images and 2 MiB per agent tool batch. There is deliberately no whole-browser close: close individual tabs instead. Browser capability and normal approvals are required.',
|
|
158
196
|
parameters: { type: 'object', properties: {
|
|
159
|
-
operation: { type: 'string', enum:
|
|
197
|
+
operation: { type: 'string', enum: PAGE_OPERATIONS },
|
|
160
198
|
url: { type: 'string', description: 'HTTP(S) target for open/navigate' },
|
|
161
199
|
tabId: { type: 'string', description: 'Observed tab id; required for activate, optional target for the rest (default the active tab)' },
|
|
162
200
|
selector: { type: 'string', description: 'Observed CSS selector for click/fill/wait; optional focus target for press' },
|
|
@@ -185,6 +223,8 @@ export function createBrowserPanelTool(views, sessionId, relay) {
|
|
|
185
223
|
execute: async (args, context) => {
|
|
186
224
|
// Validate before launching, relaying or asking for approval.
|
|
187
225
|
const validated = validatePanelArguments(args);
|
|
226
|
+
if (INCOGNITO_OPERATIONS.includes(validated.operation))
|
|
227
|
+
throw new Error('Use browser.incognito to switch the panel browser to or from incognito');
|
|
188
228
|
await authorize('browser.panel', browserEventArguments(args), context);
|
|
189
229
|
context.signal.throwIfAborted();
|
|
190
230
|
// One operation, whichever engine's browser executes it: the owning
|
|
@@ -225,3 +265,34 @@ export function createBrowserPanelTool(views, sessionId, relay) {
|
|
|
225
265
|
},
|
|
226
266
|
};
|
|
227
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* The agent's switch between the project profile and a throwaway incognito
|
|
270
|
+
* browser in the session's Browser panel. A tool of its own rather than another
|
|
271
|
+
* `browser.panel` operation, so the agent sees plainly that a signed-out, fresh
|
|
272
|
+
* browser is available to it. It shares the panel tool's local and relayed paths.
|
|
273
|
+
*/
|
|
274
|
+
export function createBrowserIncognitoTool(views, sessionId, relay) {
|
|
275
|
+
return {
|
|
276
|
+
name: 'browser.incognito', family: 'browser', capability: 'browser', executionMode: 'sequential',
|
|
277
|
+
description: 'Switch this session\'s Browser panel between the project profile and a fresh incognito browser. The panel normally runs on the project\'s persistent profile: logins, cookies, history and cache shared with the user and every session of this project. start closes the panel browser (its tabs close; the saved project profile is untouched) and opens an incognito browser with one blank tab and no logins, cookies, storage, history or cache — use it to test as a signed-out or first-time visitor, then drive it with browser.panel. Nothing from incognito is saved. end closes the incognito browser so the next browser.panel open uses the project profile again; incognito also ends on its own when the panel browser closes (last tab closed, idle, or app restart). Browser capability and normal approvals are required.',
|
|
278
|
+
parameters: { type: 'object', properties: {
|
|
279
|
+
action: { type: 'string', enum: ['start', 'end'], description: 'start: replace the panel browser with a fresh incognito one. end: close incognito and return to the project profile.' },
|
|
280
|
+
}, required: ['action'], additionalProperties: false },
|
|
281
|
+
execute: async (args, context) => {
|
|
282
|
+
if (args.action !== 'start' && args.action !== 'end' || Object.keys(args).some(key => key !== 'action'))
|
|
283
|
+
throw new Error('action must be start or end');
|
|
284
|
+
const operation = args.action === 'start' ? 'incognito_start' : 'incognito_end';
|
|
285
|
+
await authorize('browser.incognito', { action: args.action }, context);
|
|
286
|
+
context.signal.throwIfAborted();
|
|
287
|
+
if (relay) {
|
|
288
|
+
const answer = await relay(operation, { operation }, context.signal);
|
|
289
|
+
if (answer.error)
|
|
290
|
+
throw new Error(answer.error);
|
|
291
|
+
if (answer.result === undefined)
|
|
292
|
+
throw new Error('The panel browser relay returned no result');
|
|
293
|
+
return answer.result;
|
|
294
|
+
}
|
|
295
|
+
return (await runPanelOperation(views, sessionId, { operation }, context.signal)).result;
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
}
|
|
@@ -142,6 +142,21 @@ export async function runBrowserTask(session, task, control, options = {}) {
|
|
|
142
142
|
throw new Error('Invalid clarification selection');
|
|
143
143
|
return choices[Number(index)].replace(/\s*\(recommended\)/gi, '').trim();
|
|
144
144
|
},
|
|
145
|
+
approvePlan: async () => {
|
|
146
|
+
// The flip is run-scoped, exactly like the app server's: the saved workspace default keeps
|
|
147
|
+
// planning the next task, and this transcript learns of the change through the same event
|
|
148
|
+
// the engine journals for it. The index resumes with the mode, as a live switch would.
|
|
149
|
+
const saved = config.workspacePermissions?.[workspacePermissionKey(workspace)];
|
|
150
|
+
const next = saved === 'ask-for-approval' || saved === 'approve-for-me' || saved === 'full-access' ? saved : 'ask-for-approval';
|
|
151
|
+
const previous = runControl.permissions ?? 'ask-for-approval';
|
|
152
|
+
if (next !== previous) {
|
|
153
|
+
runControl.permissions = next;
|
|
154
|
+
runControl.yolo = next === 'full-access';
|
|
155
|
+
await onEvent({ type: 'run.permissions.changed', time: new Date().toISOString(), data: { runId, permissions: next, previous, settled: [] } });
|
|
156
|
+
await codeIntel?.setPermissions(next);
|
|
157
|
+
}
|
|
158
|
+
return next;
|
|
159
|
+
},
|
|
145
160
|
};
|
|
146
161
|
let mcp;
|
|
147
162
|
let codeIntel;
|
|
@@ -175,9 +190,9 @@ export async function runBrowserTask(session, task, control, options = {}) {
|
|
|
175
190
|
if (!(providerGone || error instanceof PaidMembershipRequiredError))
|
|
176
191
|
throw error;
|
|
177
192
|
await notice(providerGone
|
|
178
|
-
? 'The selected graph cannot run on this machine as configured, so its tasks cannot start here. Using the local
|
|
179
|
-
: error instanceof FreeTierLimitError ? `${error.message} Using the local
|
|
180
|
-
: 'The selected graph needs paid account access. Using the local
|
|
193
|
+
? 'The selected graph cannot run on this machine as configured, so its tasks cannot start here. Using the local Andorra Agent graph.'
|
|
194
|
+
: error instanceof FreeTierLimitError ? `${error.message} Using the local Andorra Agent graph.`
|
|
195
|
+
: 'The selected graph needs paid account access. Using the local Andorra Agent graph.');
|
|
181
196
|
loadedGraph = await loadAccessibleGraph('default', signal);
|
|
182
197
|
}
|
|
183
198
|
const health = await checkGraphModelHealth(loadedGraph, config, signal, {
|
|
@@ -200,7 +215,7 @@ export async function runBrowserTask(session, task, control, options = {}) {
|
|
|
200
215
|
}
|
|
201
216
|
const graph = validateGraph(loadedGraph, { providers: config.providers, defaultProvider: config.provider, spawnAvailable: true });
|
|
202
217
|
// The id comes from the graph that survived the fallback, not the saved selection: a run that
|
|
203
|
-
// fell back to
|
|
218
|
+
// fell back to the Andorra Agent default must not be reported as the custom graph it replaced.
|
|
204
219
|
Object.assign(telemetryHandle.dimensions, { graphId: graph.id, ...graphShape(graph) });
|
|
205
220
|
await beginTelemetry();
|
|
206
221
|
// Browser-owned runs can only supply { task } and no run state. Fail fast
|
|
@@ -854,7 +854,27 @@ export async function startBrowserServer(options = {}) {
|
|
|
854
854
|
merged.set(endpoint.state.id, endpoint.state);
|
|
855
855
|
const cutoff = Date.now() - settings.maxAgeDays * 86400000;
|
|
856
856
|
const sessions = [...merged.values()].filter(state => state.live || !settings.maxAgeDays || Date.parse(state.updatedAt) >= cutoff).sort((a, b) => Date.parse(b.updatedAt) - Date.parse(a.updatedAt));
|
|
857
|
-
|
|
857
|
+
// The membership the sidebar prunes its saved arrangement against: every project identity
|
|
858
|
+
// the server holds, with no history window applied. The session list above is cut down by
|
|
859
|
+
// maxAgeDays, so it is not the truth about which projects exist — a project whose every
|
|
860
|
+
// session is older than the window is gone from it while its project is still here, and
|
|
861
|
+
// pruning against it would erase that project's place in the arrangement. The identity is
|
|
862
|
+
// sanitized exactly like the projections it reconciles against: a legacy record without a
|
|
863
|
+
// project id falls back to its workspace path, which may name a configured secret, and the
|
|
864
|
+
// sidebar derives its own identity from the redacted projections — an unsanitized member
|
|
865
|
+
// would leak the secret and read as a project the sessions do not describe.
|
|
866
|
+
const projectIds = [];
|
|
867
|
+
{
|
|
868
|
+
const seen = new Set();
|
|
869
|
+
for (const state of merged.values()) {
|
|
870
|
+
const project = sanitizer.sanitize(state.projectId || state.workspace);
|
|
871
|
+
if (!seen.has(project)) {
|
|
872
|
+
seen.add(project);
|
|
873
|
+
projectIds.push(project);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
browserReply(res, 200, { sessions: sessions.map(publicState), settings, projectIds });
|
|
858
878
|
return;
|
|
859
879
|
}
|
|
860
880
|
const trajectoryRoute = /^\/api\/sessions\/([a-f0-9-]{36})\/trajectory(\/download)?$/.exec(path);
|
|
@@ -16,4 +16,20 @@ export declare function reserveBrowserImage(context: ToolContext): {
|
|
|
16
16
|
commit: (bytes: number) => void;
|
|
17
17
|
refund: () => void;
|
|
18
18
|
};
|
|
19
|
+
export interface BorrowedBrowserSession {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Run `work` against the session's page (the named tab, else the selected one), queued behind the
|
|
23
|
+
* session's other operations so nothing else drives the page meanwhile. `bounded` applies the
|
|
24
|
+
* session's 10-second transport deadline, closing the session when the page stops answering.
|
|
25
|
+
*/
|
|
26
|
+
use<T>(work: (page: any, tabId: string, bounded: <R>(pending: Promise<R>, message: string) => Promise<R>) => Promise<T>): Promise<T>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Lend an open `qa.browser_session` page to another browser tool.
|
|
30
|
+
*
|
|
31
|
+
* Ownership and the tab are checked here, before the caller asks for approval, exactly as the
|
|
32
|
+
* session tool checks them: a session belongs to the agent that opened it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function borrowBrowserSession(args: Record<string, unknown>, context: ToolContext): BorrowedBrowserSession;
|
|
19
35
|
export declare function createBrowserSessionTool(authorize: (name: string, args: Record<string, unknown>, context: ToolContext) => Promise<void>): Tool;
|
|
@@ -268,6 +268,41 @@ export function reserveBrowserImage(context) {
|
|
|
268
268
|
},
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Lend an open `qa.browser_session` page to another browser tool.
|
|
273
|
+
*
|
|
274
|
+
* Ownership and the tab are checked here, before the caller asks for approval, exactly as the
|
|
275
|
+
* session tool checks them: a session belongs to the agent that opened it.
|
|
276
|
+
*/
|
|
277
|
+
export function borrowBrowserSession(args, context) {
|
|
278
|
+
const sessionId = text(args, 'sessionId', 64);
|
|
279
|
+
const tabId = args.tabId === undefined ? undefined : text(args, 'tabId', 64);
|
|
280
|
+
const session = sessions.get(sessionId);
|
|
281
|
+
if (!session || session.closing || session.owner !== owner(context))
|
|
282
|
+
throw new Error('Unknown browser session for this agent; open a page with qa.browser_session first');
|
|
283
|
+
if (tabId !== undefined && !session.tabs.has(tabId))
|
|
284
|
+
throw new Error('Unknown tab for this browser session');
|
|
285
|
+
return {
|
|
286
|
+
sessionId,
|
|
287
|
+
use: work => {
|
|
288
|
+
const run = session.pending.then(async () => {
|
|
289
|
+
context.signal.throwIfAborted();
|
|
290
|
+
if (session.closing || sessions.get(session.id) !== session)
|
|
291
|
+
throw new Error('Browser session closed. Open a new session before retrying.');
|
|
292
|
+
if (tabId !== undefined) {
|
|
293
|
+
const target = session.tabs.get(tabId);
|
|
294
|
+
if (!target)
|
|
295
|
+
throw new Error('Unknown tab for this browser session');
|
|
296
|
+
session.tabId = tabId;
|
|
297
|
+
session.page = target;
|
|
298
|
+
}
|
|
299
|
+
return await work(session.page, session.tabId, (pending, message) => boundedTransport(session, context.signal, pending, message));
|
|
300
|
+
});
|
|
301
|
+
session.pending = run.catch(() => { });
|
|
302
|
+
return run;
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
271
306
|
export function createBrowserSessionTool(authorize) {
|
|
272
307
|
return {
|
|
273
308
|
name: 'qa.browser_session', family: 'browser', capability: 'browser', executionMode: 'sequential',
|
|
@@ -75,15 +75,49 @@
|
|
|
75
75
|
$('prompt').value = drafts.get(id) || ''; conversationKey = ''; pendingKey = ''; projectKey = ''; render();
|
|
76
76
|
}
|
|
77
77
|
function renderProjects() {
|
|
78
|
+
// A drag is holding the list: replacing the rows now would drop the carried group out from under
|
|
79
|
+
// the pointer mid-move, so the pass is queued and taken when the drag ends, wherever it ends.
|
|
80
|
+
if (projectDragId !== null) { projectRenderQueued = true; return; }
|
|
78
81
|
const needle = $('search').value.trim().toLowerCase();
|
|
79
82
|
const maxAge = Number(state.settings?.maxAgeDays || 0);
|
|
80
83
|
const sessions = [...state.sessions].filter(s => (running(s) || !maxAge || Date.now() - new Date(s.updatedAt).getTime() <= maxAge * 86400000) && `${s.name} ${s.workspace}`.toLowerCase().includes(needle)).sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt));
|
|
81
84
|
const key = JSON.stringify(sessions.map(s => [s.id, s.name, s.workspace, s.projectId, s.updatedAt, s.status, !!s.pending, !!s.archived])) + selectedId + [...archivedOpen];
|
|
85
|
+
// Presentation order: the arrangement the user saved, then the projects they have not arranged
|
|
86
|
+
// yet in the order the server reports them. Reconciling against every identity the server holds —
|
|
87
|
+
// not just the visible ones — is what keeps a group a search or history filter is hiding in its
|
|
88
|
+
// saved place, and lets a project the server dropped stop claiming a slot without erasing the rest.
|
|
89
|
+
const allIds = [];
|
|
90
|
+
{ const seen = new Set(); for (const s of state.sessions) { const project = s.projectId || s.workspace; if (!seen.has(project)) { seen.add(project); allIds.push(project); } } }
|
|
91
|
+
const saved = loadProjectOrder();
|
|
92
|
+
// The prune the reconciliation computes is persisted, the way the desktop rail's registry read
|
|
93
|
+
// prunes its own: a project the server stopped reporting must not take its old place back the
|
|
94
|
+
// moment it returns — it has to read as one the user has not arranged yet. Only identities the
|
|
95
|
+
// server holds are compared, and nothing held prunes nothing: an empty read is no evidence a
|
|
96
|
+
// project left. Newly seen projects are not recorded either — the arrangement stays what the
|
|
97
|
+
// user moved.
|
|
98
|
+
// What the prune compares against is the membership /api/state reports beside the sessions:
|
|
99
|
+
// the session list is already cut down by the history setting, so a project whose every session
|
|
100
|
+
// is older than the window is gone from it while its project still exists — pruning against the
|
|
101
|
+
// filtered list would erase that project's place. A state from before the field existed
|
|
102
|
+
// reconciles against the session list, as it always did.
|
|
103
|
+
// The prune runs before the render cache's short-circuit: the key covers only the sessions the
|
|
104
|
+
// list renders, so a project the history window or a search hides has no say in it — when the
|
|
105
|
+
// server drops such a project while every visible session keeps its stamp, the cache would
|
|
106
|
+
// return here forever and its saved slot would outlive it. What the prune removes was never
|
|
107
|
+
// rendered, so no rebuild is owed; the diff guard keeps an unchanged membership from writing.
|
|
108
|
+
const membership = state.projectIds ?? allIds;
|
|
109
|
+
if (membership.length > 0) {
|
|
110
|
+
const present = new Set(membership);
|
|
111
|
+
const pruned = saved.filter(id => present.has(id));
|
|
112
|
+
if (pruned.length !== saved.length) saveProjectOrder(pruned);
|
|
113
|
+
}
|
|
82
114
|
if (projectKey === key) return; projectKey = key;
|
|
83
115
|
const groups = new Map();
|
|
84
116
|
// Group by the server's opaque project identity: redacted display paths
|
|
85
117
|
// can collide across distinct workspaces and must not merge projects.
|
|
86
118
|
for (const s of sessions) { const project = s.projectId || s.workspace; const list = groups.get(project) || []; list.push(s); groups.set(project, list); }
|
|
119
|
+
const order = reconcileProjectOrder(saved, allIds);
|
|
120
|
+
const rank = new Map(order.map((project, index) => [project, index]));
|
|
87
121
|
$('projects').replaceChildren(); $('session-count').textContent = String(sessions.filter(s => !archived(s)).length);
|
|
88
122
|
const sessionRow = s => {
|
|
89
123
|
const row = element('button', `session-row${s.id === selectedId ? ' active' : ''}`); row.setAttribute('aria-current', s.id === selectedId ? 'page' : 'false'); row.title = `${s.name || 'Untitled session'} · ${s.status || 'idle'} · Right-click for actions`;
|
|
@@ -96,12 +130,62 @@
|
|
|
96
130
|
row.onkeydown = e => { if (e.key === 'ContextMenu' || (e.shiftKey && e.key === 'F10')) { e.preventDefault(); atRow(); } };
|
|
97
131
|
return row;
|
|
98
132
|
};
|
|
99
|
-
for (const [project, list] of groups) {
|
|
133
|
+
for (const [project, list] of [...groups].sort((left, right) => (rank.get(left[0]) ?? order.length) - (rank.get(right[0]) ?? order.length))) {
|
|
100
134
|
const workspace = list[0].workspace;
|
|
101
|
-
const group = element('section', 'project'); const heading = element('div', 'project-header');
|
|
135
|
+
const group = element('section', 'project'); group.setAttribute('data-project', project); const heading = element('div', 'project-header');
|
|
136
|
+
// The grip reorders the whole group — its rows, its archive, its selected state travel with it.
|
|
137
|
+
// Like the desktop rail's, it is a control of its own: drag it, or hold it and use the arrows.
|
|
138
|
+
const grip = element('button', 'project-grip', '⠿'); grip.type = 'button'; grip.draggable = groups.size > 1;
|
|
139
|
+
grip.setAttribute('aria-label', `Reorder ${folder(workspace)}, position ${(rank.get(project) ?? 0) + 1} of ${order.length}`);
|
|
140
|
+
grip.title = 'Drag to reorder · Up and Down arrows move it · Home and End move it to first or last';
|
|
141
|
+
grip.ondragstart = event => {
|
|
142
|
+
projectDragId = project;
|
|
143
|
+
const groupEl = grip.parentNode && grip.parentNode.parentNode;
|
|
144
|
+
if (groupEl) groupEl.setAttribute('data-dragging', '');
|
|
145
|
+
if (event.dataTransfer) {
|
|
146
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
147
|
+
// Firefox starts no drag without data; the payload itself is never read.
|
|
148
|
+
event.dataTransfer.setData('text/plain', project);
|
|
149
|
+
if (event.dataTransfer.setDragImage && grip.parentNode && grip.parentNode.parentNode) event.dataTransfer.setDragImage(grip.parentNode.parentNode, 16, 16);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
grip.ondragend = () => endProjectDrag();
|
|
153
|
+
grip.onkeydown = event => {
|
|
154
|
+
const move = event.key === 'ArrowUp' ? { kind: 'up' } : event.key === 'ArrowDown' ? { kind: 'down' }
|
|
155
|
+
: event.key === 'Home' ? { kind: 'first' } : event.key === 'End' ? { kind: 'last' } : null;
|
|
156
|
+
if (!move) return;
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
if (commitProjectMove(project, move)) focusProjectGrip(project);
|
|
159
|
+
};
|
|
102
160
|
const name = element('span', 'project-name', `▱ ${folder(workspace)}`); name.title = workspace;
|
|
103
161
|
const add = element('button', '', '+'); add.title = `New session in ${workspace}`; add.setAttribute('aria-label', add.title); add.onclick = () => createSession(undefined, list[0].id);
|
|
104
|
-
heading.append(name, add); group.append(heading);
|
|
162
|
+
heading.append(grip, name, add); group.append(heading);
|
|
163
|
+
// Where the carried group would land: the edge of the group under the pointer, marked while the
|
|
164
|
+
// pointer is over it and cleared the moment it moves on, so the line always reads as the next
|
|
165
|
+
// position — the one the drop below takes.
|
|
166
|
+
group.ondragover = event => {
|
|
167
|
+
if (projectDragId === null || projectDragId === project) return;
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
const box = group.getBoundingClientRect();
|
|
170
|
+
const edge = event.clientY > box.top + box.height / 2 ? 'after' : 'before';
|
|
171
|
+
if (projectDropTarget === project && projectDropEdge === edge) return;
|
|
172
|
+
clearProjectDropMark();
|
|
173
|
+
projectDropTarget = project; projectDropEdge = edge; markProjectDrop(group, edge);
|
|
174
|
+
};
|
|
175
|
+
group.ondragleave = event => {
|
|
176
|
+
if (projectDropTarget !== project) return;
|
|
177
|
+
// Leaving for one of the group's own children is not leaving the group; only a real exit
|
|
178
|
+
// clears the line, so moving across the rows inside does not flicker it.
|
|
179
|
+
if (event.relatedTarget && group.contains(event.relatedTarget)) return;
|
|
180
|
+
clearProjectDropMark();
|
|
181
|
+
};
|
|
182
|
+
group.ondrop = event => {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
const dragged = projectDragId; const edge = projectDropEdge;
|
|
185
|
+
endProjectDrag();
|
|
186
|
+
if (dragged === null || dragged === project || edge === null) return;
|
|
187
|
+
commitProjectMove(dragged, edge === 'before' ? { kind: 'before', target: project } : { kind: 'after', target: project });
|
|
188
|
+
};
|
|
105
189
|
// Archived sessions leave the working list for a collapsed group under their project, as on the desktop rail.
|
|
106
190
|
const filed = list.filter(s => archived(s) && !running(s));
|
|
107
191
|
for (const s of list) if (!filed.includes(s)) group.append(sessionRow(s));
|
|
@@ -115,6 +199,109 @@
|
|
|
115
199
|
}
|
|
116
200
|
if (!sessions.length) $('projects').append(element('p', 'empty-projects', state.sessions.length ? 'No sessions match your search or history setting.' : 'Your CLI sessions will appear here. Open a project to start a new one.'));
|
|
117
201
|
}
|
|
202
|
+
// Project arrangement: the order the groups are listed in, saved in localStorage and keyed by the
|
|
203
|
+
// server's opaque project identity, so redacted display paths that collide stay separate projects.
|
|
204
|
+
// Presentation only: it changes no session, no selection, nothing on the server.
|
|
205
|
+
const PROJECT_ORDER_KEY = 'andorra.browser-project-order';
|
|
206
|
+
let projectOrderMemory = null; // The arrangement this tab trusts when storage refuses writes.
|
|
207
|
+
let projectDragId = null; // The project the user is carrying, or null between drags.
|
|
208
|
+
let projectDropTarget = null; // The project whose edge the carry would land on.
|
|
209
|
+
let projectDropEdge = null; // Which edge of that group: before or after.
|
|
210
|
+
let projectDropMark = null; // The group element currently showing the landing line.
|
|
211
|
+
let projectRenderQueued = false; // A refresh landed mid-drag; its pass waits for the drag to end.
|
|
212
|
+
function loadProjectOrder() {
|
|
213
|
+
if (projectOrderMemory) return projectOrderMemory.slice();
|
|
214
|
+
try {
|
|
215
|
+
if (typeof localStorage === 'undefined') return [];
|
|
216
|
+
const stored = localStorage.getItem(PROJECT_ORDER_KEY);
|
|
217
|
+
const parsed = stored ? JSON.parse(stored) : null;
|
|
218
|
+
return Array.isArray(parsed) ? parsed.filter(id => typeof id === 'string') : [];
|
|
219
|
+
} catch { return []; }
|
|
220
|
+
}
|
|
221
|
+
function saveProjectOrder(order) {
|
|
222
|
+
projectOrderMemory = order.slice();
|
|
223
|
+
try { if (typeof localStorage !== 'undefined') localStorage.setItem(PROJECT_ORDER_KEY, JSON.stringify(order)); } catch { /* Storage can refuse — quota, private mode. The tab keeps the arrangement in memory, so reordering still works this session; persistence retries on the next move. */ }
|
|
224
|
+
}
|
|
225
|
+
// Saved ids first, in the saved order; the ones never arranged appended after, in the order the
|
|
226
|
+
// server reported them. An id the server stopped reporting is skipped — it claims no slot while it
|
|
227
|
+
// is gone, and if it returns it reads as a project the user has not arranged yet.
|
|
228
|
+
function reconcileProjectOrder(saved, present) {
|
|
229
|
+
const known = new Set(present);
|
|
230
|
+
const kept = []; const seen = new Set();
|
|
231
|
+
for (const id of saved) if (!seen.has(id) && known.has(id)) { kept.push(id); seen.add(id); }
|
|
232
|
+
for (const id of present) if (!seen.has(id)) { kept.push(id); seen.add(id); }
|
|
233
|
+
return kept;
|
|
234
|
+
}
|
|
235
|
+
// One move over an id list — by neighbour, by edge, or to the ends. Returns the list itself when
|
|
236
|
+
// the move changes nothing (a boundary bump, a missing target), so callers skip the write and the
|
|
237
|
+
// redraw instead of persisting a no-op as if it were an arrangement.
|
|
238
|
+
function moveProjectInOrder(ids, id, move) {
|
|
239
|
+
const from = ids.indexOf(id);
|
|
240
|
+
if (from < 0) return ids;
|
|
241
|
+
const rest = ids.filter((_, index) => index !== from);
|
|
242
|
+
let to;
|
|
243
|
+
if (move.kind === 'up') to = from - 1;
|
|
244
|
+
else if (move.kind === 'down') to = from + 1;
|
|
245
|
+
else if (move.kind === 'first') to = 0;
|
|
246
|
+
else if (move.kind === 'last') to = rest.length;
|
|
247
|
+
else { const at = rest.indexOf(move.target); if (at < 0) return ids; to = move.kind === 'after' ? at + 1 : at; }
|
|
248
|
+
if (to < 0 || to > rest.length || to === from) return ids;
|
|
249
|
+
const next = rest.slice(); next.splice(to, 0, id);
|
|
250
|
+
return next;
|
|
251
|
+
}
|
|
252
|
+
function markProjectDrop(group, edge) {
|
|
253
|
+
if (projectDropMark && projectDropMark !== group) projectDropMark.removeAttribute('data-drop');
|
|
254
|
+
projectDropMark = group;
|
|
255
|
+
group.setAttribute('data-drop', edge);
|
|
256
|
+
}
|
|
257
|
+
function clearProjectDropMark() {
|
|
258
|
+
// The cached landing goes with the line: a hover that re-enters the same half must re-promise
|
|
259
|
+
// it, and a cancelled drag must not leave the next one blind on the same group and edge.
|
|
260
|
+
projectDropTarget = null;
|
|
261
|
+
projectDropEdge = null;
|
|
262
|
+
if (!projectDropMark) return;
|
|
263
|
+
projectDropMark.removeAttribute('data-drop');
|
|
264
|
+
projectDropMark = null;
|
|
265
|
+
}
|
|
266
|
+
// The drag is over — dropped, cancelled, or Escape. The markers go, and any refresh that queued
|
|
267
|
+
// itself mid-drag is taken now, against the state as it stands.
|
|
268
|
+
function endProjectDrag() {
|
|
269
|
+
projectDragId = null;
|
|
270
|
+
clearProjectDropMark();
|
|
271
|
+
for (const group of $('projects').children) group.removeAttribute('data-dragging');
|
|
272
|
+
if (projectRenderQueued) { projectRenderQueued = false; projectKey = ''; renderProjects(); }
|
|
273
|
+
}
|
|
274
|
+
// Commit one move: reconcile the saved arrangement against every project the server holds, apply
|
|
275
|
+
// the move, and persist it. Rebuilding from `state` rather than from the screen is what keeps the
|
|
276
|
+
// groups a filter is hiding in their places while the visible ones move.
|
|
277
|
+
function commitProjectMove(id, move) {
|
|
278
|
+
const present = [];
|
|
279
|
+
{ const seen = new Set(); for (const s of state.sessions) { const project = s.projectId || s.workspace; if (!seen.has(project)) { seen.add(project); present.push(project); } } }
|
|
280
|
+
const saved = loadProjectOrder();
|
|
281
|
+
// The move applies to the order the list renders, with the identities the history window hides
|
|
282
|
+
// spliced back into their saved places: the never-arranged rows must keep the activity order
|
|
283
|
+
// the render derives from the sessions — the membership's own order is the server's map order,
|
|
284
|
+
// which is neither — and a membership id with no session and no saved place names no row at
|
|
285
|
+
// all. Reconciling the move against anything else lands presses where the user cannot see.
|
|
286
|
+
const membership = state.projectIds ?? present;
|
|
287
|
+
const hidden = membership.filter(candidate => !present.includes(candidate) && saved.includes(candidate));
|
|
288
|
+
const baseline = reconcileProjectOrder(saved, [...present, ...hidden]);
|
|
289
|
+
const order = moveProjectInOrder(baseline, id, move);
|
|
290
|
+
if (order === baseline) return false;
|
|
291
|
+
saveProjectOrder(order);
|
|
292
|
+
projectKey = ''; renderProjects();
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
// A keyboard move re-renders the list, which rebuilds every row; the grip the user is holding the
|
|
296
|
+
// keys on would lose focus to the rebuild. The rebuilt grip for the same project takes it back.
|
|
297
|
+
function focusProjectGrip(id) {
|
|
298
|
+
for (const group of $('projects').children) {
|
|
299
|
+
if (group.getAttribute('data-project') !== id) continue;
|
|
300
|
+
const heading = group.children[0];
|
|
301
|
+
if (heading && heading.children[0]) heading.children[0].focus();
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
118
305
|
function message(role, value, target = $('conversation')) {
|
|
119
306
|
if (!value) return;
|
|
120
307
|
const item = element('article', `message ${role}`); item.append(element('div', 'message-label', role === 'user' ? 'You' : 'Andorra'), element('div', 'body', value)); target.append(item);
|
|
@@ -321,6 +508,9 @@
|
|
|
321
508
|
el.querySelector('.menu-item:not(:disabled)')?.focus();
|
|
322
509
|
}
|
|
323
510
|
document.addEventListener('pointerdown', e => { if (menu && !menu.el.contains(e.target)) closeMenu(false); }, true);
|
|
511
|
+
// Escape is the way out of a drag as of everything else here: the carried group goes back, the
|
|
512
|
+
// landing line and any refresh that queued itself mid-drag go with it.
|
|
513
|
+
document.addEventListener('keydown', e => { if (e.key === 'Escape' && projectDragId !== null) endProjectDrag(); });
|
|
324
514
|
addEventListener('blur', () => closeMenu(false)); addEventListener('resize', () => closeMenu(false));
|
|
325
515
|
$('projects').addEventListener('scroll', () => closeMenu(false));
|
|
326
516
|
let renaming = null, deleting = null;
|
|
@@ -56,11 +56,25 @@ textarea{resize:none;line-height:1.6}
|
|
|
56
56
|
.search input{min-height:var(--control-height);padding:2px 10px;font-size:12px;border-color:var(--border);background:var(--bg-input)}
|
|
57
57
|
.section-label{padding:0 20px 4px;color:var(--text-3);font-size:12px;line-height:16px;display:flex;justify-content:space-between}
|
|
58
58
|
#projects{overflow:auto;flex:1;padding:4px 8px 16px}
|
|
59
|
-
.project{margin-bottom:12px}
|
|
59
|
+
.project{margin-bottom:12px;position:relative}
|
|
60
60
|
.project-header{min-height:var(--row-height);padding:0 4px 0 12px;color:var(--text-2);font-size:12px;display:flex;justify-content:space-between;gap:8px;align-items:center}
|
|
61
61
|
.project-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
62
62
|
.project-header button{height:22px;width:22px;padding:0;background:transparent;color:var(--text-3);font-size:16px;font-weight:400;border-radius:var(--row-radius)}
|
|
63
63
|
.project-header button:hover{background:var(--rail-wash);color:var(--text)}
|
|
64
|
+
/* Reordering: the grip is the group's own control — drag it, or hold it and use the arrow keys. It
|
|
65
|
+
keeps the header's quietness until the header is pointed at or the grip itself takes the focus. */
|
|
66
|
+
.project-header button.project-grip{width:16px;cursor:grab;opacity:.45;font-size:12px}
|
|
67
|
+
.project-header button.project-grip:active{cursor:grabbing}
|
|
68
|
+
.project-header:hover button.project-grip,.project-header button.project-grip:focus-visible{opacity:1}
|
|
69
|
+
/* The carried group steps aside while it travels, and the line on a hovered edge is where it will
|
|
70
|
+
land: the edge itself — above or below the group under the pointer — is the exact position the
|
|
71
|
+
drop takes, so the marker never promises a place the drop does not deliver. */
|
|
72
|
+
.project[data-dragging] .project-header{opacity:.55}
|
|
73
|
+
.project::before,.project::after{content:'';position:absolute;left:4px;right:4px;height:2px;border-radius:1px;background:var(--accent);opacity:0;pointer-events:none;z-index:1}
|
|
74
|
+
.project::before{top:-7px}
|
|
75
|
+
.project::after{bottom:-7px}
|
|
76
|
+
.project[data-drop="before"]::before{opacity:1}
|
|
77
|
+
.project[data-drop="after"]::after{opacity:1}
|
|
64
78
|
.session-row{width:100%;min-height:var(--row-height);height:auto;padding:0 8px;margin:1px 0;border-radius:var(--row-radius);background:transparent;justify-content:flex-start;gap:8px;text-align:left;font-weight:400}
|
|
65
79
|
.session-row:hover{background:var(--rail-wash)}
|
|
66
80
|
.session-row.active{background:var(--rail-wash);box-shadow:inset 2px 0 0 var(--accent)}
|