@artooi/ag-ui-web-component 0.34.0 → 0.35.1

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +517 -1
  2. package/README.md +243 -13
  3. package/dist/ag-ui-web-component.bundle.js +614 -96
  4. package/dist/ag-ui-web-component.bundle.js.map +4 -4
  5. package/dist/constants.d.ts +76 -3
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/core/ag_ui_chat.d.ts +37 -2
  8. package/dist/core/ag_ui_chat.d.ts.map +1 -1
  9. package/dist/dom/animations.d.ts +14 -0
  10. package/dist/dom/animations.d.ts.map +1 -1
  11. package/dist/dom/highlight_overlay.d.ts +47 -0
  12. package/dist/dom/highlight_overlay.d.ts.map +1 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1886 -320
  16. package/dist/index.js.map +4 -4
  17. package/dist/tools/chat_surface_tools.d.ts +96 -0
  18. package/dist/tools/chat_surface_tools.d.ts.map +1 -0
  19. package/dist/tools/page_action_tools.d.ts +2 -0
  20. package/dist/tools/page_action_tools.d.ts.map +1 -1
  21. package/dist/ui/clamp_launcher.d.ts +10 -5
  22. package/dist/ui/clamp_launcher.d.ts.map +1 -1
  23. package/dist/ui/clamp_panel.d.ts +2 -2
  24. package/dist/ui/clamp_panel.d.ts.map +1 -1
  25. package/dist/ui/launcher_drag.d.ts +2 -2
  26. package/dist/ui/launcher_drag.d.ts.map +1 -1
  27. package/dist/ui/launcher_placement.d.ts +14 -1
  28. package/dist/ui/launcher_placement.d.ts.map +1 -1
  29. package/dist/ui/panel_drag.d.ts.map +1 -1
  30. package/dist/ui/place_widget.d.ts +9 -1
  31. package/dist/ui/place_widget.d.ts.map +1 -1
  32. package/dist/ui/run_notice.d.ts +14 -3
  33. package/dist/ui/run_notice.d.ts.map +1 -1
  34. package/dist/ui/styles.d.ts +1 -1
  35. package/dist/ui/styles.d.ts.map +1 -1
  36. package/dist/ui/thread_drawer.d.ts +21 -0
  37. package/dist/ui/thread_drawer.d.ts.map +1 -1
  38. package/dist/ui/ui_strings.d.ts +16 -0
  39. package/dist/ui/ui_strings.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/src/constants.ts +82 -3
  42. package/src/core/ag_ui_chat.ts +965 -55
  43. package/src/dom/animations.ts +30 -0
  44. package/src/dom/highlight_overlay.ts +256 -0
  45. package/src/index.ts +12 -0
  46. package/src/tools/chat_surface_tools.ts +207 -0
  47. package/src/tools/page_action_tools.ts +2 -0
  48. package/src/ui/clamp_launcher.ts +25 -7
  49. package/src/ui/clamp_panel.ts +10 -4
  50. package/src/ui/launcher_drag.ts +11 -2
  51. package/src/ui/launcher_placement.ts +34 -8
  52. package/src/ui/panel_drag.ts +4 -0
  53. package/src/ui/place_widget.ts +11 -3
  54. package/src/ui/run_notice.ts +32 -3
  55. package/src/ui/styles.ts +563 -45
  56. package/src/ui/thread_drawer.ts +138 -8
  57. package/src/ui/ui_strings.ts +24 -0
  58. package/src/version.ts +1 -1
@@ -0,0 +1,96 @@
1
+ import type { ClientTool } from "./client_tool_registry.js";
2
+ /** Every corner the panel can be sent to, in the order the schema states them. */
3
+ export declare const CHAT_CORNERS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
4
+ /** A corner the panel can be sent to. */
5
+ export type ChatCorner = (typeof CHAT_CORNERS)[number];
6
+ /** What the agent is told about the surface it is speaking from. */
7
+ export interface ChatSurfaceReport {
8
+ /** The placement in force, or `null` when the host set none. */
9
+ readonly placement: string | null;
10
+ /** Whether the panel is currently at its launcher. */
11
+ readonly collapsed: boolean;
12
+ /** Whether this placement has a collapsed state at all. */
13
+ readonly collapsible: boolean;
14
+ /** Whether the panel can be moved, or the placement owns its position. */
15
+ readonly movable: boolean;
16
+ /**
17
+ * Whether this page allows the panel to be moved at all.
18
+ *
19
+ * Reported apart from {@link ChatSurfaceReport.movable} only because the two
20
+ * reasons a move is refused call for different sentences: a host that turned
21
+ * dragging off is not the placement owning the position, and telling the
22
+ * user the second when the first is true is a plain falsehood.
23
+ */
24
+ readonly draggable: boolean;
25
+ /** Whether the panel currently covers the whole viewport. */
26
+ readonly fullBleed: boolean;
27
+ /** The panel's box, in viewport coordinates. */
28
+ readonly box: {
29
+ readonly left: number;
30
+ readonly top: number;
31
+ readonly width: number;
32
+ readonly height: number;
33
+ };
34
+ /**
35
+ * The part of the viewport the panel may rest in.
36
+ *
37
+ * With an origin, because it is not always the screen's: a host can reserve
38
+ * the edges its own chrome occupies, and an agent reasoning about the room
39
+ * to the left of `box.left` would otherwise be mixing two coordinate frames
40
+ * without being told there were two.
41
+ */
42
+ readonly viewport: {
43
+ readonly left: number;
44
+ readonly top: number;
45
+ readonly width: number;
46
+ readonly height: number;
47
+ };
48
+ }
49
+ /** Whether a string names one of the four corners. */
50
+ export declare function isChatCorner(value: string): value is ChatCorner;
51
+ /**
52
+ * The part of the widget these tools drive.
53
+ *
54
+ * A narrow port rather than the element itself, because the element imports
55
+ * this module to build its own tools and importing it back would be a cycle.
56
+ * It also says exactly what the agent is allowed to reach, which is a shorter
57
+ * list than the element's public surface.
58
+ */
59
+ export interface ChatSurface {
60
+ describeSurface(): ChatSurfaceReport;
61
+ /**
62
+ * `announce` writes a notice into the transcript with an undo beside it.
63
+ * The tools always pass it: a panel that rearranges itself mid-conversation
64
+ * has to say so, and a host driving the same method is arranging its own
65
+ * page and needs no telling.
66
+ */
67
+ moveTo(corner: ChatCorner, options?: {
68
+ readonly announce?: boolean;
69
+ }): boolean;
70
+ setCollapsed(collapsed: boolean, options?: {
71
+ readonly announce?: boolean;
72
+ }): void;
73
+ }
74
+ /**
75
+ * Tools that let the agent move the panel it is speaking from.
76
+ *
77
+ * This is the affordance nobody else can offer: every other assistant's chat
78
+ * is a surface of its own, so there is nothing for it to be in the way *of*.
79
+ * Ours is mounted in the page the user is working in, which is what makes
80
+ * "let me move this aside so you can see the table" a sentence the agent can
81
+ * act on rather than apologise for.
82
+ *
83
+ * **They report what happened, not what was asked.** A full-bleed panel on a
84
+ * phone has nowhere to move to, and a placement that places itself owns its
85
+ * position -- so `move_chat` answers `moved: false` with the reason and what
86
+ * would work instead, rather than returning success on a panel that did not
87
+ * budge. The same rule the page actions already follow: a tool reports that it
88
+ * fired, not that it worked.
89
+ *
90
+ * `read_chat_surface` exists so the agent can ask before it acts rather than
91
+ * discovering the answer through a failure. It is deliberately a tool and not
92
+ * ambient context: a snapshot the agent chose to take is honest about being
93
+ * one, and it needs no channel that does not already exist.
94
+ */
95
+ export declare function createChatSurfaceTools(surface: ChatSurface): ClientTool[];
96
+ //# sourceMappingURL=chat_surface_tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat_surface_tools.d.ts","sourceRoot":"","sources":["../../src/tools/chat_surface_tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,kFAAkF;AAClF,eAAO,MAAM,YAAY,YAAI,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,CAAU,CAAC;AAE9F,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE;QACZ,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,eAAe,IAAI,iBAAiB,CAAC;IACrC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;IAC/E,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACnF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CA2GzE"}
@@ -9,6 +9,8 @@ export type ResolvePageTarget = (target: string) => HTMLElement | null;
9
9
  export declare const PAGE_ACTIONS: {
10
10
  readonly SCROLL: "scroll";
11
11
  readonly DRAG: "drag";
12
+ /** The widget's own position: see `createChatSurfaceTools`. */
13
+ readonly CHAT: "chat";
12
14
  };
13
15
  /**
14
16
  * The opt-in page-action tools selected by `enabled` (a set of
@@ -1 +1 @@
1
- {"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
1
+ {"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;IACZ,+DAA+D;aAC/D,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
@@ -1,14 +1,19 @@
1
- import type { Extent, LauncherBox } from "./launcher_placement.js";
1
+ import type { LauncherBox, ViewportBox } from "./launcher_placement.js";
2
2
  /**
3
- * Keep a launcher fully on screen.
3
+ * Keep a launcher fully on screen, and a little clear of the edge.
4
4
  *
5
5
  * Applied to a dragged position and again to a restored one, because the
6
6
  * viewport that stored it may since have shrunk. A launcher parked past the
7
7
  * edge is unreachable, and it is the only way back to a collapsed
8
- * conversation -- so this clamps to the viewport itself rather than to the
9
- * panel's margin, which would refuse the corners users actually want.
8
+ * conversation.
9
+ *
10
+ * Not the panel's 24px gutter, which was rejected here on purpose: a launcher
11
+ * held that far in refuses the corners people actually drag it to. But not
12
+ * zero either -- the bubble is a circle with a drop shadow, and one flush
13
+ * against the boundary has its shadow cut and its curve running into the edge,
14
+ * which reads as clipped whether or not a pixel is actually missing.
10
15
  */
11
- export declare function clampLauncher(launcher: LauncherBox, viewport: Extent): {
16
+ export declare function clampLauncher(launcher: LauncherBox, viewport: ViewportBox, margin?: number): {
12
17
  readonly left: number;
13
18
  readonly top: number;
14
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"clamp_launcher.d.ts","sourceRoot":"","sources":["../../src/ui/clamp_launcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,MAAM,GACf;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAKjD"}
1
+ {"version":3,"file":"clamp_launcher.d.ts","sourceRoot":"","sources":["../../src/ui/clamp_launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,EACrB,MAAM,GAAE,MAA2B,GAClC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAgBjD"}
@@ -1,4 +1,4 @@
1
- import type { Extent } from "./launcher_placement.js";
1
+ import type { ViewportBox } from "./launcher_placement.js";
2
2
  import type { PanelRect } from "./resize_handle.js";
3
3
  /**
4
4
  * Hold a panel inside the viewport, keeping its size.
@@ -9,5 +9,5 @@ import type { PanelRect } from "./resize_handle.js";
9
9
  * contradiction for the same reason: `Math.min` first would put an oversized
10
10
  * panel off the left edge instead of against the margin it can still honour.
11
11
  */
12
- export declare function clampPanel(host: PanelRect, viewport: Extent, margin?: number): PanelRect;
12
+ export declare function clampPanel(host: PanelRect, viewport: ViewportBox, margin?: number): PanelRect;
13
13
  //# sourceMappingURL=clamp_panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clamp_panel.d.ts","sourceRoot":"","sources":["../../src/ui/clamp_panel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAoB,GAC3B,SAAS,CAMX"}
1
+ {"version":3,"file":"clamp_panel.d.ts","sourceRoot":"","sources":["../../src/ui/clamp_panel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,WAAW,EACrB,MAAM,GAAE,MAAoB,GAC3B,SAAS,CAYX"}
@@ -1,4 +1,4 @@
1
- import type { Extent, LauncherBox } from "./launcher_placement.js";
1
+ import type { LauncherBox, ViewportBox } from "./launcher_placement.js";
2
2
  /** What the drag needs from its host to do its job. */
3
3
  export interface LauncherDragOptions {
4
4
  /**
@@ -10,7 +10,7 @@ export interface LauncherDragOptions {
10
10
  /** The launcher's current box, in viewport coordinates. */
11
11
  readonly rect: () => LauncherBox;
12
12
  /** The viewport the launcher has to stay inside. */
13
- readonly viewport: () => Extent;
13
+ readonly viewport: () => ViewportBox;
14
14
  /** Put the launcher's top-left at this point. Called per pointer move. */
15
15
  readonly apply: (left: number, top: number) => void;
16
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"launcher_drag.d.ts","sourceRoot":"","sources":["../../src/ui/launcher_drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;IAChC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,WAAW,CAAC;IACjC,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAaD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CA8H5F"}
1
+ {"version":3,"file":"launcher_drag.d.ts","sourceRoot":"","sources":["../../src/ui/launcher_drag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAExE,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;IAChC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,WAAW,CAAC;IACjC,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAaD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAuI5F"}
@@ -5,6 +5,19 @@ export interface LauncherBox {
5
5
  readonly width: number;
6
6
  readonly height: number;
7
7
  }
8
+ /**
9
+ * The part of the screen a widget may rest in: a width and height, and the
10
+ * corner they start from.
11
+ *
12
+ * The origin is not always zero. A host can reserve the edges its own chrome
13
+ * occupies, and a panel clamped against a viewport that starts at the top-left
14
+ * of the screen will happily park itself underneath a sticky header -- where it
15
+ * cannot be reached, and where collapsing it only hides it further.
16
+ */
17
+ export interface ViewportBox extends Extent {
18
+ readonly left: number;
19
+ readonly top: number;
20
+ }
8
21
  /** A width/height pair, in CSS pixels. */
9
22
  export interface Extent {
10
23
  readonly width: number;
@@ -60,5 +73,5 @@ export interface LauncherPlacement {
60
73
  * later panel resize from dragging the launcher: the pinned corner is the one
61
74
  * edge a resize cannot move.
62
75
  */
63
- export declare function launcherPlacement(launcher: LauncherBox, panel: Extent, viewport: Extent, margin?: number): LauncherPlacement;
76
+ export declare function launcherPlacement(launcher: LauncherBox, panel: Extent, viewport: ViewportBox, screen: Extent, margin?: number): LauncherPlacement;
64
77
  //# sourceMappingURL=launcher_placement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"launcher_placement.d.ts","sourceRoot":"","sources":["../../src/ui/launcher_placement.ts"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAoB,GAC3B,iBAAiB,CA+BnB"}
1
+ {"version":3,"file":"launcher_placement.d.ts","sourceRoot":"","sources":["../../src/ui/launcher_placement.ts"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,0CAA0C;AAC1C,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAA2B,GAClC,iBAAiB,CA0CnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"panel_drag.d.ts","sourceRoot":"","sources":["../../src/ui/panel_drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1D,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC5D;AAgBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CA8DpF"}
1
+ {"version":3,"file":"panel_drag.d.ts","sourceRoot":"","sources":["../../src/ui/panel_drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1D,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC5D;AAgBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAkEpF"}
@@ -18,6 +18,14 @@ export interface WidgetInsets {
18
18
  * moves nothing, and the launcher may sit outside its own host box. Nothing
19
19
  * clips it there, and that is what lets a launcher be flush to a screen corner
20
20
  * while the panel it opens keeps its margin.
21
+ *
22
+ * `screen` is the **whole** viewport, not the part a host has left free. These
23
+ * are CSS `inset` values on a fixed element, and the browser measures those
24
+ * from the real edges -- so a `bottom` expressed against a box inset from the
25
+ * top comes out short by exactly that inset. It only shows when the corner
26
+ * flips mid-drag, because that is when the same point stops being expressed
27
+ * from `top` and starts being expressed from `bottom`: the widget then leaps by
28
+ * the reserved edge, which is a jump the gesture cannot explain.
21
29
  */
22
- export declare function placeWidget(host: PanelRect, launcher: LauncherBox, corner: ExpandCorner, viewport: Extent): WidgetInsets;
30
+ export declare function placeWidget(host: PanelRect, launcher: LauncherBox, corner: ExpandCorner, screen: Extent): WidgetInsets;
23
31
  //# sourceMappingURL=place_widget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"place_widget.d.ts","sourceRoot":"","sources":["../../src/ui/place_widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,GACf,YAAY,CAed"}
1
+ {"version":3,"file":"place_widget.d.ts","sourceRoot":"","sources":["../../src/ui/place_widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,YAAY,CAed"}
@@ -3,8 +3,19 @@
3
3
  * skill loaded), rendered inline between turns.
4
4
  *
5
5
  * Distinct from a tool card, which reports work the agent asked for and
6
- * settles, and from an error, which is a failure. A notice never settles, takes
7
- * no action, and carries no controls.
6
+ * settles, and from an error, which is a failure. A notice never settles and
7
+ * takes no action of its own.
8
+ *
9
+ * It may carry exactly one control, and only ever an undo. That is a narrower
10
+ * rule than "no controls", which is what this said until the agent could move
11
+ * the panel it speaks from: something that rearranges the user's window without
12
+ * being asked has to be both visible and reversible, and a notice is already
13
+ * the surface that says what the run did. Anything the user has to *decide* is
14
+ * a confirmation card instead -- the difference is that this reports something
15
+ * already done.
8
16
  */
9
- export declare function renderRunNotice(icon: string, text: string, kind: string): HTMLDivElement;
17
+ export declare function renderRunNotice(icon: string, text: string, kind: string, undo?: {
18
+ readonly label: string;
19
+ readonly onActivate: () => void;
20
+ }): HTMLDivElement;
10
21
  //# sourceMappingURL=run_notice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run_notice.d.ts","sourceRoot":"","sources":["../../src/ui/run_notice.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAuBxF"}
1
+ {"version":3,"file":"run_notice.d.ts","sourceRoot":"","sources":["../../src/ui/run_notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,GACjE,cAAc,CAuChB"}