Consolidate Odysseus agent harness and tool contracts

This commit is contained in:
pewdiepie-archdaemon
2026-09-17 10:07:40 +00:00
parent 84aa9a91de
commit 218d762427
229 changed files with 28899 additions and 1551 deletions
+2 -3
View File
@@ -18,6 +18,7 @@
* }} deps
*/
import { state } from '../state.js';
import { selectionModeForEvent } from '../selection-modifiers.js';
import { canvasCoords } from '../canvas-coords.js';
export function createWandTool({ activeLayer, saveState, composite, wandHits, runMagicWand, deselectSelection }) {
@@ -28,9 +29,7 @@ export function createWandTool({ activeLayer, saveState, composite, wandHits, ru
const coords = canvasCoords(e, state.mainCanvas);
// Persistent toggle sets the default mode; Shift forces add, Alt
// forces subtract regardless of the toggle (modifiers always win).
let mode = state.wandMode || 'replace';
if (e.shiftKey) mode = 'add';
else if (e.altKey) mode = 'subtract';
const mode = selectionModeForEvent(e, state.wandMode || 'replace');
// Click INSIDE the existing selection with no modifier → deselect.
if (mode === 'replace' && wandHits(coords.x, coords.y)) {
if (deselectSelection) {