driverkit 0.0.0-stage → 0.1.0

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 (159) hide show
  1. package/CONTROLS.md +578 -0
  2. package/README.md +104 -2
  3. package/dist/agent/backend.d.ts +69 -0
  4. package/dist/agent/backend.d.ts.map +1 -0
  5. package/dist/agent/backend.js +130 -0
  6. package/dist/agent/backend.js.map +1 -0
  7. package/dist/agent/control.d.ts +148 -0
  8. package/dist/agent/control.d.ts.map +1 -0
  9. package/dist/agent/control.js +342 -0
  10. package/dist/agent/control.js.map +1 -0
  11. package/dist/agent/index.d.ts +9 -0
  12. package/dist/agent/index.d.ts.map +1 -0
  13. package/dist/agent/index.js +6 -0
  14. package/dist/agent/index.js.map +1 -0
  15. package/dist/agent/loop.d.ts +136 -0
  16. package/dist/agent/loop.d.ts.map +1 -0
  17. package/dist/agent/loop.js +824 -0
  18. package/dist/agent/loop.js.map +1 -0
  19. package/dist/agent/render.d.ts +173 -0
  20. package/dist/agent/render.d.ts.map +1 -0
  21. package/dist/agent/render.js +425 -0
  22. package/dist/agent/render.js.map +1 -0
  23. package/dist/agent/tools.d.ts +138 -0
  24. package/dist/agent/tools.d.ts.map +1 -0
  25. package/dist/agent/tools.js +622 -0
  26. package/dist/agent/tools.js.map +1 -0
  27. package/dist/agent/types.d.ts +566 -0
  28. package/dist/agent/types.d.ts.map +1 -0
  29. package/dist/agent/types.js +32 -0
  30. package/dist/agent/types.js.map +1 -0
  31. package/dist/browser/budget.d.ts +92 -0
  32. package/dist/browser/budget.d.ts.map +1 -0
  33. package/dist/browser/budget.js +151 -0
  34. package/dist/browser/budget.js.map +1 -0
  35. package/dist/browser/connect.d.ts +368 -0
  36. package/dist/browser/connect.d.ts.map +1 -0
  37. package/dist/browser/connect.js +1038 -0
  38. package/dist/browser/connect.js.map +1 -0
  39. package/dist/browser/elsewhere.d.ts +89 -0
  40. package/dist/browser/elsewhere.d.ts.map +1 -0
  41. package/dist/browser/elsewhere.js +91 -0
  42. package/dist/browser/elsewhere.js.map +1 -0
  43. package/dist/browser/frames.d.ts +85 -0
  44. package/dist/browser/frames.d.ts.map +1 -0
  45. package/dist/browser/frames.js +11 -0
  46. package/dist/browser/frames.js.map +1 -0
  47. package/dist/browser/index.d.ts +8 -0
  48. package/dist/browser/index.d.ts.map +1 -0
  49. package/dist/browser/index.js +9 -0
  50. package/dist/browser/index.js.map +1 -0
  51. package/dist/check/check.d.ts +171 -0
  52. package/dist/check/check.d.ts.map +1 -0
  53. package/dist/check/check.js +666 -0
  54. package/dist/check/check.js.map +1 -0
  55. package/dist/check/index.d.ts +3 -0
  56. package/dist/check/index.d.ts.map +1 -0
  57. package/dist/check/index.js +2 -0
  58. package/dist/check/index.js.map +1 -0
  59. package/dist/check/types.d.ts +149 -0
  60. package/dist/check/types.d.ts.map +1 -0
  61. package/dist/check/types.js +29 -0
  62. package/dist/check/types.js.map +1 -0
  63. package/dist/controls/controls.d.ts +198 -0
  64. package/dist/controls/controls.d.ts.map +1 -0
  65. package/dist/controls/controls.js +742 -0
  66. package/dist/controls/controls.js.map +1 -0
  67. package/dist/controls/dom.d.ts +108 -0
  68. package/dist/controls/dom.d.ts.map +1 -0
  69. package/dist/controls/dom.js +56 -0
  70. package/dist/controls/dom.js.map +1 -0
  71. package/dist/controls/index.d.ts +26 -0
  72. package/dist/controls/index.d.ts.map +1 -0
  73. package/dist/controls/index.js +23 -0
  74. package/dist/controls/index.js.map +1 -0
  75. package/dist/controls/rows.d.ts +66 -0
  76. package/dist/controls/rows.d.ts.map +1 -0
  77. package/dist/controls/rows.js +127 -0
  78. package/dist/controls/rows.js.map +1 -0
  79. package/dist/core/index.d.ts +3 -0
  80. package/dist/core/index.d.ts.map +1 -0
  81. package/dist/core/index.js +15 -0
  82. package/dist/core/index.js.map +1 -0
  83. package/dist/core/registry.d.ts +192 -0
  84. package/dist/core/registry.d.ts.map +1 -0
  85. package/dist/core/registry.js +2799 -0
  86. package/dist/core/registry.js.map +1 -0
  87. package/dist/core/types.d.ts +2468 -0
  88. package/dist/core/types.d.ts.map +1 -0
  89. package/dist/core/types.js +19 -0
  90. package/dist/core/types.js.map +1 -0
  91. package/dist/otel/index.d.ts +122 -0
  92. package/dist/otel/index.d.ts.map +1 -0
  93. package/dist/otel/index.js +157 -0
  94. package/dist/otel/index.js.map +1 -0
  95. package/dist/react/index.d.ts +191 -0
  96. package/dist/react/index.d.ts.map +1 -0
  97. package/dist/react/index.js +547 -0
  98. package/dist/react/index.js.map +1 -0
  99. package/dist/react/runtime.d.ts +95 -0
  100. package/dist/react/runtime.d.ts.map +1 -0
  101. package/dist/react/runtime.js +54 -0
  102. package/dist/react/runtime.js.map +1 -0
  103. package/dist/react/store.d.ts +333 -0
  104. package/dist/react/store.d.ts.map +1 -0
  105. package/dist/react/store.js +695 -0
  106. package/dist/react/store.js.map +1 -0
  107. package/dist/relay/auth.d.ts +244 -0
  108. package/dist/relay/auth.d.ts.map +1 -0
  109. package/dist/relay/auth.js +391 -0
  110. package/dist/relay/auth.js.map +1 -0
  111. package/dist/relay/frames.d.ts +141 -0
  112. package/dist/relay/frames.d.ts.map +1 -0
  113. package/dist/relay/frames.js +20 -0
  114. package/dist/relay/frames.js.map +1 -0
  115. package/dist/relay/index.d.ts +8 -0
  116. package/dist/relay/index.d.ts.map +1 -0
  117. package/dist/relay/index.js +4 -0
  118. package/dist/relay/index.js.map +1 -0
  119. package/dist/relay/relay.d.ts +277 -0
  120. package/dist/relay/relay.d.ts.map +1 -0
  121. package/dist/relay/relay.js +1026 -0
  122. package/dist/relay/relay.js.map +1 -0
  123. package/dist/relay/serve.d.ts +33 -0
  124. package/dist/relay/serve.d.ts.map +1 -0
  125. package/dist/relay/serve.js +86 -0
  126. package/dist/relay/serve.js.map +1 -0
  127. package/dist/widget/chat.d.ts +290 -0
  128. package/dist/widget/chat.d.ts.map +1 -0
  129. package/dist/widget/chat.js +486 -0
  130. package/dist/widget/chat.js.map +1 -0
  131. package/dist/widget/css.d.ts +49 -0
  132. package/dist/widget/css.d.ts.map +1 -0
  133. package/dist/widget/css.js +532 -0
  134. package/dist/widget/css.js.map +1 -0
  135. package/dist/widget/dom.d.ts +143 -0
  136. package/dist/widget/dom.d.ts.map +1 -0
  137. package/dist/widget/dom.js +27 -0
  138. package/dist/widget/dom.js.map +1 -0
  139. package/dist/widget/highlight.d.ts +64 -0
  140. package/dist/widget/highlight.d.ts.map +1 -0
  141. package/dist/widget/highlight.js +136 -0
  142. package/dist/widget/highlight.js.map +1 -0
  143. package/dist/widget/index.d.ts +9 -0
  144. package/dist/widget/index.d.ts.map +1 -0
  145. package/dist/widget/index.js +20 -0
  146. package/dist/widget/index.js.map +1 -0
  147. package/dist/widget/position.d.ts +166 -0
  148. package/dist/widget/position.d.ts.map +1 -0
  149. package/dist/widget/position.js +497 -0
  150. package/dist/widget/position.js.map +1 -0
  151. package/dist/widget/settings.d.ts +116 -0
  152. package/dist/widget/settings.d.ts.map +1 -0
  153. package/dist/widget/settings.js +117 -0
  154. package/dist/widget/settings.js.map +1 -0
  155. package/dist/widget/widget.d.ts +442 -0
  156. package/dist/widget/widget.d.ts.map +1 -0
  157. package/dist/widget/widget.js +2005 -0
  158. package/dist/widget/widget.js.map +1 -0
  159. package/package.json +153 -4
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The panel's stylesheet, as one string in one `<style>` inside the shadow
3
+ * root.
4
+ *
5
+ * Shadow DOM is doing two jobs here and both are about trust. The host app's
6
+ * CSS cannot reach in, so a global `* { box-sizing: border-box }` or an
7
+ * aggressive `button { ... }` in someone's design system cannot deform the
8
+ * panel; and these rules cannot leak out, so dropping the widget into an app
9
+ * cannot move that app's own layout by a pixel. A library that silently
10
+ * restyles the page it was added to does not get a second chance.
11
+ *
12
+ * Everything is a custom property on `:host` so the host app can retheme the
13
+ * panel from outside — custom properties are the one thing that does cross the
14
+ * shadow boundary, which makes them the right and only hook.
15
+ *
16
+ * Position is custom properties for exactly the same reason, and the panel's
17
+ * placement is therefore something a host app can set from its own stylesheet
18
+ * without touching JavaScript. See the comment on `--dk-x` for why the unit is
19
+ * a fraction of the free space rather than pixels.
20
+ *
21
+ * `prefers-color-scheme` rather than a `theme` option: the panel sits in
22
+ * someone else's app, and the person reading it has already told their system
23
+ * which they want. `prefers-reduced-motion` because the panel appears over
24
+ * what someone was looking at, and an animation they asked not to see is worse
25
+ * than no animation.
26
+ */
27
+ export declare const CSS = "\n:host {\n --dk-bg: #ffffff;\n --dk-fg: #15171a;\n --dk-dim: #6b7280;\n --dk-line: #e4e6eb;\n --dk-accent: #1f6feb;\n --dk-you: #f2f4f7;\n --dk-commit: #b42318;\n --dk-refused: #9a3412;\n --dk-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);\n --dk-radius: 10px;\n --dk-font: 14px/1.45 system-ui, -apple-system, \"Segoe UI\", sans-serif;\n --dk-mono: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;\n\n /* The collapsed launcher's box, and it is fixed on purpose.\n\n Content-sized, it was a different size in every app -- \"Ask Northwind CRM\"\n is twice the button \"Ask Mail\" is -- and it changed shape as the label or\n the state changed, which looks like a bug even when it is not. It also\n moved itself: the remembered position is a fraction of the FREE space and\n the free space is the viewport less the element's own measured width, so a\n launcher that grew by thirty pixels slid by thirty pixels times x. A\n constant box makes the placement arithmetic stable as well as the look.\n\n Two properties rather than one, so a host that wants a bigger target can\n say so, and the radius is derived from the height so it is always a true\n pill and never a rounded rectangle at one size and a circle at another. */\n --dk-launcher-w: 96px;\n --dk-launcher-h: 40px;\n\n /* Position. Two numbers in [0, 1]: 0 is flush with the near edge, 1 with\n the far one, 0.5 centred. The far-edge case is what the translate is for\n -- the element is pushed to the far inset and then pulled back by its own\n full width, so the arithmetic below works out to\n `left: gap + x * (viewport - 2*gap - width)`, which is on screen for every\n x in [0, 1] and every viewport at least as wide as the panel. That is why\n the unit is a fraction and not a pixel: a remembered fraction cannot\n describe an off-screen panel, and a remembered pixel offset can -- and an\n off-screen panel has no header to grab and no way back.\n\n It also means a host app can place the panel from its own stylesheet, the\n same way it can retheme it, with no JavaScript: these are ordinary custom\n properties on the host element and the outer tree outranks :host. The\n widget writes them inline only once somebody has actually moved it. */\n --dk-gap: 16px;\n --dk-x: 1;\n --dk-y: 1;\n\n all: initial;\n position: fixed;\n left: calc(var(--dk-gap) + var(--dk-x) * (100vw - var(--dk-gap) * 2));\n top: calc(var(--dk-gap) + var(--dk-y) * (100vh - var(--dk-gap) * 2));\n translate: calc(var(--dk-x) * -100%) calc(var(--dk-y) * -100%);\n z-index: 2147483000;\n font: var(--dk-font);\n color: var(--dk-fg);\n}\n\n/* Only ever on for a move the person did not make with a pointer -- a snap, a\n keypress. A transition during a drag means the panel trails the finger. */\n:host(.dk-snap) {\n transition: left 160ms ease-out, top 160ms ease-out, translate 160ms ease-out;\n}\n/* Belt as well as braces: the widget also checks this with matchMedia before\n it ever adds the class, so that a host which overrides the stylesheet still\n does not animate at somebody who asked for no animation. */\n@media (prefers-reduced-motion: reduce) {\n :host(.dk-snap) { transition: none; }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --dk-bg: #16181c;\n --dk-fg: #e8eaed;\n --dk-dim: #9aa0a6;\n --dk-line: #2a2d33;\n --dk-accent: #5b9dff;\n --dk-you: #22252b;\n --dk-commit: #ff8b80;\n --dk-refused: #f0a868;\n --dk-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);\n }\n}\n\nbutton { font: inherit; color: inherit; cursor: pointer; }\n:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }\n\n/* ONE RULE, AND NOTHING ELSE IN THIS STYLESHEET MAY RESIZE IT. The busy and\n open states say what they are with colour and with what they show inside\n this box; none of them touches its width, height, padding or font, because a\n control that changes shape as the state changes reads as a glitch and,\n worse, walks across the screen as it does it. If a new state needs to be\n visible out here, it gets an indicator INSIDE the pill. */\n.dk-launcher {\n /* So a host app's `* { box-sizing: content-box }` cannot turn the fixed\n width into width-plus-padding. The shadow boundary already stops their\n rules reaching in; this stops the inherited-by-default ones. */\n box-sizing: border-box;\n /* The containing block for the \"a conversation is waiting\" dot, which is\n positioned INSIDE this box. A badge hanging off the corner would be an\n element of a different size, and this element's size is the one thing\n nothing here is allowed to change. */\n position: relative;\n width: var(--dk-launcher-w);\n height: var(--dk-launcher-h);\n /* Half the height, so it is a pill at any size the host picks. */\n border-radius: calc(var(--dk-launcher-h) / 2);\n padding: 0 14px;\n background: var(--dk-bg);\n border: 1px solid var(--dk-line);\n box-shadow: var(--dk-shadow);\n /* Centre the label in a box it cannot change, and clip it if the host\n overrode the label with something long. Ellipsised rather than wrapped:\n two lines would need a taller box, which is the thing being prevented. */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex: none;\n /* Draggable too: a collapsed widget sits on top of the app just as much as\n an open one, it is simply smaller. */\n touch-action: none;\n}\n.dk-open .dk-launcher { display: none; }\n\n/* \"There is a conversation behind this.\" Its own class, so no rule here\n mentions `.dk-launcher` and the one rule that sizes the pill stays the one\n rule that sizes the pill. Inside the pill, clear of the 14px label padding\n at the right end, and 8px across -- big enough to notice in the corner of an\n eye and small enough not to read as a second control. */\n.dk-dot {\n display: none;\n position: absolute;\n right: 7px;\n top: 50%;\n width: 8px;\n height: 8px;\n margin-top: -4px;\n border-radius: 50%;\n background: var(--dk-accent);\n}\n.dk-dot-on { display: block; }\n/* And it breathes while a run is in flight, because \"the agent is still\n working\" is the state somebody who minimised mid-run most needs to see.\n Opt-in to motion rather than opt-out: a person who asked for no animation\n gets a steady dot, which still says everything except the urgency. */\n@media (prefers-reduced-motion: no-preference) {\n .dk-busy .dk-dot { animation: dk-pulse 1.6s ease-in-out infinite; }\n}\n@keyframes dk-pulse { 50% { opacity: 0.3; } }\n\n.dk-panel {\n display: none;\n flex-direction: column;\n width: min(380px, calc(100vw - 32px));\n height: min(520px, calc(100vh - 32px));\n background: var(--dk-bg);\n border: 1px solid var(--dk-line);\n border-radius: var(--dk-radius);\n box-shadow: var(--dk-shadow);\n overflow: hidden;\n}\n.dk-open .dk-panel { display: flex; animation: dk-in 140ms ease-out; }\n\n@keyframes dk-in { from { opacity: 0; transform: translateY(6px); } }\n@media (prefers-reduced-motion: reduce) {\n .dk-open .dk-panel { animation: none; }\n}\n\n/* The header, which is chrome and nothing else: no `cursor: grab`, no\n `touch-action`, no drag. The grip beside the title is the handle, and a\n strip that is not a handle cannot start a drag under a press that was aimed\n at the gear and missed. `user-select: none` stays, so a double-click on the\n chrome does not leave the title highlighted. */\n.dk-head {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 10px 8px 10px 8px;\n border-bottom: 1px solid var(--dk-line);\n user-select: none;\n -webkit-user-select: none;\n}\n.dk-title { flex: 1; font-weight: 600; }\n:host(.dk-dragging) .dk-move { cursor: grabbing; }\n.dk-min, .dk-move, .dk-gear { background: none; border: 0; padding: 4px 8px; border-radius: 6px; color: var(--dk-dim); }\n.dk-min:hover, .dk-move:hover, .dk-gear:hover { background: var(--dk-you); }\n/* The grip, and the only drag surface on the panel. `touch-action: none` is\n what makes a finger drag the panel instead of scrolling the page behind it,\n and it is scoped to the handle so the transcript still scrolls by touch.\n First in the strip and therefore at the far end from the gear and the\n minimise button, which is half of why a mis-aimed press no longer drags. */\n.dk-move { cursor: grab; touch-action: none; font-size: 13px; line-height: 1; letter-spacing: 1px; }\n/* A minus, not a cross: this puts the panel away and keeps the conversation,\n and a cross is the glyph for throwing something away. The sizing matches the\n gear so the two read as one pair of controls. */\n.dk-min { font-size: 15px; line-height: 1; }\n/* A glyph and not the word \"Settings\", because the header is also the drag\n handle and three words plus a title is a strip nobody can grab. The button\n is a real button with a real label for anybody not reading the glyph. */\n.dk-gear { font-size: 15px; line-height: 1; }\n.dk-gear[aria-expanded=\"true\"] { background: var(--dk-you); color: var(--dk-fg); }\n\n/* Announcements only. Visually hidden rather than display:none, because a\n display:none live region is not announced at all -- and it lives outside the\n panel so that moving the COLLAPSED widget is announced too. */\n.dk-status {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n.dk-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }\n\n.dk-you, .dk-me { padding: 7px 10px; border-radius: 9px; max-width: 86%; white-space: pre-wrap; }\n.dk-you { background: var(--dk-you); align-self: flex-end; }\n.dk-me { align-self: flex-start; padding-left: 0; }\n.dk-note { color: var(--dk-dim); font-size: 12px; }\n\n/* The step list. A person watching an agent move their own screen needs to\n see what it did -- silent mutation is alarming even when it is correct --\n and, since the loop announces a call before it runs, what it is ABOUT to do.\n Each row is one call and moves pending -> running -> done, refused or\n skipped.\n\n The state is a class and a `::before` marker rather than text, which is\n deliberate: the row's text is the record of the call, it is what a person\n copies out of the panel, and it should read the same whether they looked at\n it while it was pending or a minute later. */\n.dk-step {\n font: var(--dk-mono);\n color: var(--dk-dim);\n border-left: 2px solid var(--dk-line);\n padding: 2px 0 2px 8px;\n /* One line each, always. Twenty steps that each wrap to three lines is not a\n list anybody can skim, and skimming is the only thing it is for. */\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n/* Consecutive steps close up into one block, so the transcript's 8px gap\n separates the CONVERSATION and not every line of a twenty-step run. */\n.dk-step + .dk-step { margin-top: -6px; }\n.dk-step::before {\n /* A fixed-width marker column, so the verb names line up down the list and\n a change of state does not shift the text sideways. */\n display: inline-block;\n width: 1.1em;\n content: \"\\00b7\";\n}\n.dk-step-pending { opacity: 0.75; }\n.dk-step-pending::before { content: \"\\25cb\"; }\n.dk-step-running { color: var(--dk-fg); border-left-color: var(--dk-accent); }\n.dk-step-running::before { content: \"\\25b8\"; color: var(--dk-accent); }\n.dk-step-done::before { content: \"\\2713\"; }\n/* Commit steps are marked three ways at once -- the word in the text, the\n colour, and a tinted band -- because this is the row somebody scrolls back\n to when they want to know what changed their data, and because the whole\n confirmation design rests on a person being able to tell a commit from a\n selection at a glance. */\n.dk-step-commit {\n color: var(--dk-commit);\n border-left: 3px solid var(--dk-commit);\n padding-left: 7px;\n font-weight: 600;\n background: color-mix(in srgb, var(--dk-commit) 8%, transparent);\n}\n.dk-step-refused { color: var(--dk-refused); border-left-color: var(--dk-refused); }\n.dk-step-refused::before { content: \"\\2715\"; }\n/* A call that was announced and then never ran, because the run was stopped\n during its pace wait or while it was held. Dimmed rather than coloured: it\n is not an outcome, it is the absence of one. */\n.dk-step-skipped { opacity: 0.6; text-decoration: line-through; }\n.dk-step-skipped::before { content: \"\\2013\"; text-decoration: none; }\n\n/* The run controls, beside the trace they control. Only while a run is in\n flight: four dead buttons in the corner of somebody's app the rest of the\n time is four buttons they learn to ignore. */\n.dk-run {\n display: none;\n align-items: center;\n gap: 6px;\n padding: 7px 10px;\n border-bottom: 1px solid var(--dk-line);\n}\n.dk-busy .dk-run { display: flex; }\n.dk-set-open .dk-run { display: none; }\n.dk-run button {\n border: 1px solid var(--dk-line);\n background: var(--dk-you);\n border-radius: 8px;\n padding: 4px 10px;\n font: var(--dk-mono);\n}\n/* Disabled rather than hidden when no controller supplied one, because the\n person should be able to see that pausing is a thing this panel does and\n that this build cannot do it -- a Pause button that silently does nothing\n while the agent keeps changing the screen is how somebody ends up closing\n the tab. */\n.dk-run button[disabled] { opacity: 0.45; cursor: default; }\n.dk-run-note { margin-left: auto; font-size: 12px; color: var(--dk-dim); }\n\n/* Settings. In the panel rather than a window of its own: it is four\n preferences, and the person is already looking here. */\n.dk-settings {\n display: none;\n flex: 1;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n padding: 14px 12px;\n}\n.dk-set-open .dk-settings { display: flex; }\n.dk-set-open .dk-log, .dk-set-open .dk-form { display: none; }\n.dk-set-row { display: flex; flex-direction: column; gap: 5px; }\n.dk-set-label { font-weight: 600; }\n.dk-set-why { font-size: 12px; color: var(--dk-dim); }\n/* The spend row's numbers. Full-strength text under a dimmed reason, which is\n the opposite weighting of every other row in this view -- on those the\n control is the thing and the words explain it, and on this one there is no\n control and the number IS the thing. */\n.dk-set-budget { font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 4px; }\n.dk-speeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }\n.dk-speed {\n border: 1px solid var(--dk-line);\n background: none;\n border-radius: 999px;\n padding: 5px 12px;\n}\n.dk-speed[aria-checked=\"true\"] {\n border-color: var(--dk-accent);\n color: var(--dk-accent);\n background: var(--dk-you);\n font-weight: 600;\n}\n.dk-toggle {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n text-align: left;\n border: 1px solid var(--dk-line);\n background: none;\n border-radius: 8px;\n padding: 8px 10px;\n}\n/* The state in the button, as well as in `aria-checked` for anybody who is\n being read it. A switch whose only difference between on and off is a shade\n of grey is a switch nobody is sure about. */\n.dk-toggle::after {\n margin-left: auto;\n content: \"Off\";\n font: var(--dk-mono);\n color: var(--dk-dim);\n}\n.dk-toggle[aria-checked=\"true\"] { border-color: var(--dk-accent); }\n.dk-toggle[aria-checked=\"true\"]::after { content: \"On\"; color: var(--dk-accent); }\n/* The destructive item, and the only red thing in the settings view. It is\n given the commit colour on purpose: that colour already means \"this changes\n something you cannot take back\" everywhere else in this panel, and a second\n vocabulary for danger would weaken the first. Not a filled button -- it is a\n thing to find when you want it, not a thing to notice while changing the\n speed. */\n.dk-clear {\n align-self: flex-start;\n border: 1px solid var(--dk-commit);\n background: none;\n color: var(--dk-commit);\n border-radius: 8px;\n padding: 7px 14px;\n font-weight: 600;\n margin-top: 2px;\n}\n.dk-clear:hover { background: color-mix(in srgb, var(--dk-commit) 10%, transparent); }\n.dk-done {\n align-self: flex-start;\n border: 1px solid var(--dk-line);\n background: var(--dk-you);\n border-radius: 8px;\n padding: 7px 14px;\n}\n\n/* The confirmation. The one place in this panel where a person is asked to\n decide something, so it is the one place that is allowed to be loud. */\n.dk-ask {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n border: 1px solid var(--dk-commit);\n border-radius: 9px;\n padding: 9px 10px;\n}\n.dk-ask-q { flex: 1 0 100%; font-weight: 600; color: var(--dk-commit); }\n.dk-ask-why { flex: 1 0 100%; font-size: 12px; color: var(--dk-dim); }\n.dk-ask-said { flex: 1 0 100%; font-size: 12px; color: var(--dk-dim); }\n\n/* A QUESTION, which is not a confirmation and must not look like one.\n .dk-ask is bordered and coloured in the commit colour because it is the one\n place somebody is asked to allow something irreversible. A question changes\n nothing, so it borrows the layout and gives back the alarm: the border and\n the heading go to the ordinary line colour. Two dialogs that look alike are\n one dialog as far as a person's attention is concerned, which is the argument\n the reversible-commit wording is already built on. */\n.dk-q { border-color: var(--dk-line); }\n.dk-q .dk-ask-q { color: inherit; }\n.dk-ask-box {\n flex: 1 1 100%;\n border: 1px solid var(--dk-line);\n border-radius: 8px;\n padding: 7px 9px;\n font: inherit;\n color: inherit;\n background: var(--dk-you);\n}\n.dk-yes, .dk-no { border-radius: 8px; padding: 6px 12px; border: 1px solid var(--dk-line); background: var(--dk-you); }\n.dk-yes { border-color: var(--dk-commit); color: var(--dk-commit); font-weight: 600; }\n\n.dk-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--dk-line); }\n.dk-input {\n flex: 1;\n min-width: 0;\n font: inherit;\n color: inherit;\n background: var(--dk-bg);\n border: 1px solid var(--dk-line);\n border-radius: 8px;\n padding: 8px 10px;\n}\n.dk-send, .dk-stop {\n border: 1px solid var(--dk-line);\n border-radius: 8px;\n background: var(--dk-you);\n padding: 8px 12px;\n}\n.dk-send[disabled] { opacity: 0.5; cursor: default; }\n.dk-stop { display: none; }\n.dk-busy .dk-stop { display: block; }\n.dk-busy .dk-send { display: none; }\n";
28
+ /**
29
+ * The outline over the element a verb is about to touch, as its own tiny
30
+ * stylesheet in its own shadow root.
31
+ *
32
+ * Separate from `CSS` because it has to be in a separate host element: the
33
+ * panel's `:host` carries a `translate`, a transformed ancestor is the
34
+ * containing block for `position: fixed` descendants, and an outline drawn
35
+ * inside the panel would therefore be offset by wherever the panel sits. See
36
+ * `highlight.ts`.
37
+ *
38
+ * The host is a zero-sized fixed point at the viewport's origin and the box
39
+ * inside it is positioned absolutely, so the numbers written in are exactly
40
+ * the ones `getBoundingClientRect` reported -- no coordinate conversion, which
41
+ * is the only kind of arithmetic that can be wrong here.
42
+ *
43
+ * `pointer-events: none` throughout, and nothing is ever written to the host
44
+ * app's own element: a border on somebody's button reflows their layout, and a
45
+ * panel that nudges the page sideways every time it names an element is not
46
+ * the passive observer it claims to be.
47
+ */
48
+ export declare const SPOT_CSS = "\n:host {\n all: initial;\n position: fixed;\n left: 0;\n top: 0;\n width: 0;\n height: 0;\n pointer-events: none;\n /* One below the panel. If the outline and the panel overlap, the panel is\n the thing that has words in it. */\n z-index: 2147482999;\n --dk-spot-color: #1f6feb;\n}\n@media (prefers-color-scheme: dark) {\n :host { --dk-spot-color: #5b9dff; }\n}\n.dk-spot {\n display: none;\n position: absolute;\n box-sizing: border-box;\n pointer-events: none;\n left: var(--dk-spot-x, 0);\n top: var(--dk-spot-y, 0);\n width: var(--dk-spot-w, 0);\n height: var(--dk-spot-h, 0);\n border: 2px solid var(--dk-spot-color);\n border-radius: 6px;\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-spot-color) 25%, transparent);\n}\n.dk-spot-on { display: block; }\n@media (prefers-reduced-motion: no-preference) {\n .dk-spot-on { animation: dk-spot-in 120ms ease-out; }\n}\n@keyframes dk-spot-in { from { opacity: 0; } }\n";
49
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/widget/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,GAAG,iykBAgcf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,QAAQ,27BAmCpB,CAAC"}
@@ -0,0 +1,532 @@
1
+ /**
2
+ * The panel's stylesheet, as one string in one `<style>` inside the shadow
3
+ * root.
4
+ *
5
+ * Shadow DOM is doing two jobs here and both are about trust. The host app's
6
+ * CSS cannot reach in, so a global `* { box-sizing: border-box }` or an
7
+ * aggressive `button { ... }` in someone's design system cannot deform the
8
+ * panel; and these rules cannot leak out, so dropping the widget into an app
9
+ * cannot move that app's own layout by a pixel. A library that silently
10
+ * restyles the page it was added to does not get a second chance.
11
+ *
12
+ * Everything is a custom property on `:host` so the host app can retheme the
13
+ * panel from outside — custom properties are the one thing that does cross the
14
+ * shadow boundary, which makes them the right and only hook.
15
+ *
16
+ * Position is custom properties for exactly the same reason, and the panel's
17
+ * placement is therefore something a host app can set from its own stylesheet
18
+ * without touching JavaScript. See the comment on `--dk-x` for why the unit is
19
+ * a fraction of the free space rather than pixels.
20
+ *
21
+ * `prefers-color-scheme` rather than a `theme` option: the panel sits in
22
+ * someone else's app, and the person reading it has already told their system
23
+ * which they want. `prefers-reduced-motion` because the panel appears over
24
+ * what someone was looking at, and an animation they asked not to see is worse
25
+ * than no animation.
26
+ */
27
+ export const CSS = `
28
+ :host {
29
+ --dk-bg: #ffffff;
30
+ --dk-fg: #15171a;
31
+ --dk-dim: #6b7280;
32
+ --dk-line: #e4e6eb;
33
+ --dk-accent: #1f6feb;
34
+ --dk-you: #f2f4f7;
35
+ --dk-commit: #b42318;
36
+ --dk-refused: #9a3412;
37
+ --dk-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
38
+ --dk-radius: 10px;
39
+ --dk-font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
40
+ --dk-mono: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
41
+
42
+ /* The collapsed launcher's box, and it is fixed on purpose.
43
+
44
+ Content-sized, it was a different size in every app -- "Ask Northwind CRM"
45
+ is twice the button "Ask Mail" is -- and it changed shape as the label or
46
+ the state changed, which looks like a bug even when it is not. It also
47
+ moved itself: the remembered position is a fraction of the FREE space and
48
+ the free space is the viewport less the element's own measured width, so a
49
+ launcher that grew by thirty pixels slid by thirty pixels times x. A
50
+ constant box makes the placement arithmetic stable as well as the look.
51
+
52
+ Two properties rather than one, so a host that wants a bigger target can
53
+ say so, and the radius is derived from the height so it is always a true
54
+ pill and never a rounded rectangle at one size and a circle at another. */
55
+ --dk-launcher-w: 96px;
56
+ --dk-launcher-h: 40px;
57
+
58
+ /* Position. Two numbers in [0, 1]: 0 is flush with the near edge, 1 with
59
+ the far one, 0.5 centred. The far-edge case is what the translate is for
60
+ -- the element is pushed to the far inset and then pulled back by its own
61
+ full width, so the arithmetic below works out to
62
+ \`left: gap + x * (viewport - 2*gap - width)\`, which is on screen for every
63
+ x in [0, 1] and every viewport at least as wide as the panel. That is why
64
+ the unit is a fraction and not a pixel: a remembered fraction cannot
65
+ describe an off-screen panel, and a remembered pixel offset can -- and an
66
+ off-screen panel has no header to grab and no way back.
67
+
68
+ It also means a host app can place the panel from its own stylesheet, the
69
+ same way it can retheme it, with no JavaScript: these are ordinary custom
70
+ properties on the host element and the outer tree outranks :host. The
71
+ widget writes them inline only once somebody has actually moved it. */
72
+ --dk-gap: 16px;
73
+ --dk-x: 1;
74
+ --dk-y: 1;
75
+
76
+ all: initial;
77
+ position: fixed;
78
+ left: calc(var(--dk-gap) + var(--dk-x) * (100vw - var(--dk-gap) * 2));
79
+ top: calc(var(--dk-gap) + var(--dk-y) * (100vh - var(--dk-gap) * 2));
80
+ translate: calc(var(--dk-x) * -100%) calc(var(--dk-y) * -100%);
81
+ z-index: 2147483000;
82
+ font: var(--dk-font);
83
+ color: var(--dk-fg);
84
+ }
85
+
86
+ /* Only ever on for a move the person did not make with a pointer -- a snap, a
87
+ keypress. A transition during a drag means the panel trails the finger. */
88
+ :host(.dk-snap) {
89
+ transition: left 160ms ease-out, top 160ms ease-out, translate 160ms ease-out;
90
+ }
91
+ /* Belt as well as braces: the widget also checks this with matchMedia before
92
+ it ever adds the class, so that a host which overrides the stylesheet still
93
+ does not animate at somebody who asked for no animation. */
94
+ @media (prefers-reduced-motion: reduce) {
95
+ :host(.dk-snap) { transition: none; }
96
+ }
97
+
98
+ @media (prefers-color-scheme: dark) {
99
+ :host {
100
+ --dk-bg: #16181c;
101
+ --dk-fg: #e8eaed;
102
+ --dk-dim: #9aa0a6;
103
+ --dk-line: #2a2d33;
104
+ --dk-accent: #5b9dff;
105
+ --dk-you: #22252b;
106
+ --dk-commit: #ff8b80;
107
+ --dk-refused: #f0a868;
108
+ --dk-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
109
+ }
110
+ }
111
+
112
+ button { font: inherit; color: inherit; cursor: pointer; }
113
+ :focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
114
+
115
+ /* ONE RULE, AND NOTHING ELSE IN THIS STYLESHEET MAY RESIZE IT. The busy and
116
+ open states say what they are with colour and with what they show inside
117
+ this box; none of them touches its width, height, padding or font, because a
118
+ control that changes shape as the state changes reads as a glitch and,
119
+ worse, walks across the screen as it does it. If a new state needs to be
120
+ visible out here, it gets an indicator INSIDE the pill. */
121
+ .dk-launcher {
122
+ /* So a host app's \`* { box-sizing: content-box }\` cannot turn the fixed
123
+ width into width-plus-padding. The shadow boundary already stops their
124
+ rules reaching in; this stops the inherited-by-default ones. */
125
+ box-sizing: border-box;
126
+ /* The containing block for the "a conversation is waiting" dot, which is
127
+ positioned INSIDE this box. A badge hanging off the corner would be an
128
+ element of a different size, and this element's size is the one thing
129
+ nothing here is allowed to change. */
130
+ position: relative;
131
+ width: var(--dk-launcher-w);
132
+ height: var(--dk-launcher-h);
133
+ /* Half the height, so it is a pill at any size the host picks. */
134
+ border-radius: calc(var(--dk-launcher-h) / 2);
135
+ padding: 0 14px;
136
+ background: var(--dk-bg);
137
+ border: 1px solid var(--dk-line);
138
+ box-shadow: var(--dk-shadow);
139
+ /* Centre the label in a box it cannot change, and clip it if the host
140
+ overrode the label with something long. Ellipsised rather than wrapped:
141
+ two lines would need a taller box, which is the thing being prevented. */
142
+ display: inline-flex;
143
+ align-items: center;
144
+ justify-content: center;
145
+ white-space: nowrap;
146
+ overflow: hidden;
147
+ text-overflow: ellipsis;
148
+ flex: none;
149
+ /* Draggable too: a collapsed widget sits on top of the app just as much as
150
+ an open one, it is simply smaller. */
151
+ touch-action: none;
152
+ }
153
+ .dk-open .dk-launcher { display: none; }
154
+
155
+ /* "There is a conversation behind this." Its own class, so no rule here
156
+ mentions \`.dk-launcher\` and the one rule that sizes the pill stays the one
157
+ rule that sizes the pill. Inside the pill, clear of the 14px label padding
158
+ at the right end, and 8px across -- big enough to notice in the corner of an
159
+ eye and small enough not to read as a second control. */
160
+ .dk-dot {
161
+ display: none;
162
+ position: absolute;
163
+ right: 7px;
164
+ top: 50%;
165
+ width: 8px;
166
+ height: 8px;
167
+ margin-top: -4px;
168
+ border-radius: 50%;
169
+ background: var(--dk-accent);
170
+ }
171
+ .dk-dot-on { display: block; }
172
+ /* And it breathes while a run is in flight, because "the agent is still
173
+ working" is the state somebody who minimised mid-run most needs to see.
174
+ Opt-in to motion rather than opt-out: a person who asked for no animation
175
+ gets a steady dot, which still says everything except the urgency. */
176
+ @media (prefers-reduced-motion: no-preference) {
177
+ .dk-busy .dk-dot { animation: dk-pulse 1.6s ease-in-out infinite; }
178
+ }
179
+ @keyframes dk-pulse { 50% { opacity: 0.3; } }
180
+
181
+ .dk-panel {
182
+ display: none;
183
+ flex-direction: column;
184
+ width: min(380px, calc(100vw - 32px));
185
+ height: min(520px, calc(100vh - 32px));
186
+ background: var(--dk-bg);
187
+ border: 1px solid var(--dk-line);
188
+ border-radius: var(--dk-radius);
189
+ box-shadow: var(--dk-shadow);
190
+ overflow: hidden;
191
+ }
192
+ .dk-open .dk-panel { display: flex; animation: dk-in 140ms ease-out; }
193
+
194
+ @keyframes dk-in { from { opacity: 0; transform: translateY(6px); } }
195
+ @media (prefers-reduced-motion: reduce) {
196
+ .dk-open .dk-panel { animation: none; }
197
+ }
198
+
199
+ /* The header, which is chrome and nothing else: no \`cursor: grab\`, no
200
+ \`touch-action\`, no drag. The grip beside the title is the handle, and a
201
+ strip that is not a handle cannot start a drag under a press that was aimed
202
+ at the gear and missed. \`user-select: none\` stays, so a double-click on the
203
+ chrome does not leave the title highlighted. */
204
+ .dk-head {
205
+ display: flex;
206
+ align-items: center;
207
+ gap: 4px;
208
+ padding: 10px 8px 10px 8px;
209
+ border-bottom: 1px solid var(--dk-line);
210
+ user-select: none;
211
+ -webkit-user-select: none;
212
+ }
213
+ .dk-title { flex: 1; font-weight: 600; }
214
+ :host(.dk-dragging) .dk-move { cursor: grabbing; }
215
+ .dk-min, .dk-move, .dk-gear { background: none; border: 0; padding: 4px 8px; border-radius: 6px; color: var(--dk-dim); }
216
+ .dk-min:hover, .dk-move:hover, .dk-gear:hover { background: var(--dk-you); }
217
+ /* The grip, and the only drag surface on the panel. \`touch-action: none\` is
218
+ what makes a finger drag the panel instead of scrolling the page behind it,
219
+ and it is scoped to the handle so the transcript still scrolls by touch.
220
+ First in the strip and therefore at the far end from the gear and the
221
+ minimise button, which is half of why a mis-aimed press no longer drags. */
222
+ .dk-move { cursor: grab; touch-action: none; font-size: 13px; line-height: 1; letter-spacing: 1px; }
223
+ /* A minus, not a cross: this puts the panel away and keeps the conversation,
224
+ and a cross is the glyph for throwing something away. The sizing matches the
225
+ gear so the two read as one pair of controls. */
226
+ .dk-min { font-size: 15px; line-height: 1; }
227
+ /* A glyph and not the word "Settings", because the header is also the drag
228
+ handle and three words plus a title is a strip nobody can grab. The button
229
+ is a real button with a real label for anybody not reading the glyph. */
230
+ .dk-gear { font-size: 15px; line-height: 1; }
231
+ .dk-gear[aria-expanded="true"] { background: var(--dk-you); color: var(--dk-fg); }
232
+
233
+ /* Announcements only. Visually hidden rather than display:none, because a
234
+ display:none live region is not announced at all -- and it lives outside the
235
+ panel so that moving the COLLAPSED widget is announced too. */
236
+ .dk-status {
237
+ position: absolute;
238
+ width: 1px;
239
+ height: 1px;
240
+ margin: -1px;
241
+ padding: 0;
242
+ overflow: hidden;
243
+ clip-path: inset(50%);
244
+ white-space: nowrap;
245
+ border: 0;
246
+ }
247
+
248
+ .dk-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
249
+
250
+ .dk-you, .dk-me { padding: 7px 10px; border-radius: 9px; max-width: 86%; white-space: pre-wrap; }
251
+ .dk-you { background: var(--dk-you); align-self: flex-end; }
252
+ .dk-me { align-self: flex-start; padding-left: 0; }
253
+ .dk-note { color: var(--dk-dim); font-size: 12px; }
254
+
255
+ /* The step list. A person watching an agent move their own screen needs to
256
+ see what it did -- silent mutation is alarming even when it is correct --
257
+ and, since the loop announces a call before it runs, what it is ABOUT to do.
258
+ Each row is one call and moves pending -> running -> done, refused or
259
+ skipped.
260
+
261
+ The state is a class and a \`::before\` marker rather than text, which is
262
+ deliberate: the row's text is the record of the call, it is what a person
263
+ copies out of the panel, and it should read the same whether they looked at
264
+ it while it was pending or a minute later. */
265
+ .dk-step {
266
+ font: var(--dk-mono);
267
+ color: var(--dk-dim);
268
+ border-left: 2px solid var(--dk-line);
269
+ padding: 2px 0 2px 8px;
270
+ /* One line each, always. Twenty steps that each wrap to three lines is not a
271
+ list anybody can skim, and skimming is the only thing it is for. */
272
+ white-space: nowrap;
273
+ overflow: hidden;
274
+ text-overflow: ellipsis;
275
+ }
276
+ /* Consecutive steps close up into one block, so the transcript's 8px gap
277
+ separates the CONVERSATION and not every line of a twenty-step run. */
278
+ .dk-step + .dk-step { margin-top: -6px; }
279
+ .dk-step::before {
280
+ /* A fixed-width marker column, so the verb names line up down the list and
281
+ a change of state does not shift the text sideways. */
282
+ display: inline-block;
283
+ width: 1.1em;
284
+ content: "\\00b7";
285
+ }
286
+ .dk-step-pending { opacity: 0.75; }
287
+ .dk-step-pending::before { content: "\\25cb"; }
288
+ .dk-step-running { color: var(--dk-fg); border-left-color: var(--dk-accent); }
289
+ .dk-step-running::before { content: "\\25b8"; color: var(--dk-accent); }
290
+ .dk-step-done::before { content: "\\2713"; }
291
+ /* Commit steps are marked three ways at once -- the word in the text, the
292
+ colour, and a tinted band -- because this is the row somebody scrolls back
293
+ to when they want to know what changed their data, and because the whole
294
+ confirmation design rests on a person being able to tell a commit from a
295
+ selection at a glance. */
296
+ .dk-step-commit {
297
+ color: var(--dk-commit);
298
+ border-left: 3px solid var(--dk-commit);
299
+ padding-left: 7px;
300
+ font-weight: 600;
301
+ background: color-mix(in srgb, var(--dk-commit) 8%, transparent);
302
+ }
303
+ .dk-step-refused { color: var(--dk-refused); border-left-color: var(--dk-refused); }
304
+ .dk-step-refused::before { content: "\\2715"; }
305
+ /* A call that was announced and then never ran, because the run was stopped
306
+ during its pace wait or while it was held. Dimmed rather than coloured: it
307
+ is not an outcome, it is the absence of one. */
308
+ .dk-step-skipped { opacity: 0.6; text-decoration: line-through; }
309
+ .dk-step-skipped::before { content: "\\2013"; text-decoration: none; }
310
+
311
+ /* The run controls, beside the trace they control. Only while a run is in
312
+ flight: four dead buttons in the corner of somebody's app the rest of the
313
+ time is four buttons they learn to ignore. */
314
+ .dk-run {
315
+ display: none;
316
+ align-items: center;
317
+ gap: 6px;
318
+ padding: 7px 10px;
319
+ border-bottom: 1px solid var(--dk-line);
320
+ }
321
+ .dk-busy .dk-run { display: flex; }
322
+ .dk-set-open .dk-run { display: none; }
323
+ .dk-run button {
324
+ border: 1px solid var(--dk-line);
325
+ background: var(--dk-you);
326
+ border-radius: 8px;
327
+ padding: 4px 10px;
328
+ font: var(--dk-mono);
329
+ }
330
+ /* Disabled rather than hidden when no controller supplied one, because the
331
+ person should be able to see that pausing is a thing this panel does and
332
+ that this build cannot do it -- a Pause button that silently does nothing
333
+ while the agent keeps changing the screen is how somebody ends up closing
334
+ the tab. */
335
+ .dk-run button[disabled] { opacity: 0.45; cursor: default; }
336
+ .dk-run-note { margin-left: auto; font-size: 12px; color: var(--dk-dim); }
337
+
338
+ /* Settings. In the panel rather than a window of its own: it is four
339
+ preferences, and the person is already looking here. */
340
+ .dk-settings {
341
+ display: none;
342
+ flex: 1;
343
+ flex-direction: column;
344
+ gap: 16px;
345
+ overflow-y: auto;
346
+ padding: 14px 12px;
347
+ }
348
+ .dk-set-open .dk-settings { display: flex; }
349
+ .dk-set-open .dk-log, .dk-set-open .dk-form { display: none; }
350
+ .dk-set-row { display: flex; flex-direction: column; gap: 5px; }
351
+ .dk-set-label { font-weight: 600; }
352
+ .dk-set-why { font-size: 12px; color: var(--dk-dim); }
353
+ /* The spend row's numbers. Full-strength text under a dimmed reason, which is
354
+ the opposite weighting of every other row in this view -- on those the
355
+ control is the thing and the words explain it, and on this one there is no
356
+ control and the number IS the thing. */
357
+ .dk-set-budget { font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 4px; }
358
+ .dk-speeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
359
+ .dk-speed {
360
+ border: 1px solid var(--dk-line);
361
+ background: none;
362
+ border-radius: 999px;
363
+ padding: 5px 12px;
364
+ }
365
+ .dk-speed[aria-checked="true"] {
366
+ border-color: var(--dk-accent);
367
+ color: var(--dk-accent);
368
+ background: var(--dk-you);
369
+ font-weight: 600;
370
+ }
371
+ .dk-toggle {
372
+ display: flex;
373
+ align-items: center;
374
+ gap: 8px;
375
+ width: 100%;
376
+ text-align: left;
377
+ border: 1px solid var(--dk-line);
378
+ background: none;
379
+ border-radius: 8px;
380
+ padding: 8px 10px;
381
+ }
382
+ /* The state in the button, as well as in \`aria-checked\` for anybody who is
383
+ being read it. A switch whose only difference between on and off is a shade
384
+ of grey is a switch nobody is sure about. */
385
+ .dk-toggle::after {
386
+ margin-left: auto;
387
+ content: "Off";
388
+ font: var(--dk-mono);
389
+ color: var(--dk-dim);
390
+ }
391
+ .dk-toggle[aria-checked="true"] { border-color: var(--dk-accent); }
392
+ .dk-toggle[aria-checked="true"]::after { content: "On"; color: var(--dk-accent); }
393
+ /* The destructive item, and the only red thing in the settings view. It is
394
+ given the commit colour on purpose: that colour already means "this changes
395
+ something you cannot take back" everywhere else in this panel, and a second
396
+ vocabulary for danger would weaken the first. Not a filled button -- it is a
397
+ thing to find when you want it, not a thing to notice while changing the
398
+ speed. */
399
+ .dk-clear {
400
+ align-self: flex-start;
401
+ border: 1px solid var(--dk-commit);
402
+ background: none;
403
+ color: var(--dk-commit);
404
+ border-radius: 8px;
405
+ padding: 7px 14px;
406
+ font-weight: 600;
407
+ margin-top: 2px;
408
+ }
409
+ .dk-clear:hover { background: color-mix(in srgb, var(--dk-commit) 10%, transparent); }
410
+ .dk-done {
411
+ align-self: flex-start;
412
+ border: 1px solid var(--dk-line);
413
+ background: var(--dk-you);
414
+ border-radius: 8px;
415
+ padding: 7px 14px;
416
+ }
417
+
418
+ /* The confirmation. The one place in this panel where a person is asked to
419
+ decide something, so it is the one place that is allowed to be loud. */
420
+ .dk-ask {
421
+ display: flex;
422
+ flex-wrap: wrap;
423
+ gap: 6px;
424
+ align-items: center;
425
+ border: 1px solid var(--dk-commit);
426
+ border-radius: 9px;
427
+ padding: 9px 10px;
428
+ }
429
+ .dk-ask-q { flex: 1 0 100%; font-weight: 600; color: var(--dk-commit); }
430
+ .dk-ask-why { flex: 1 0 100%; font-size: 12px; color: var(--dk-dim); }
431
+ .dk-ask-said { flex: 1 0 100%; font-size: 12px; color: var(--dk-dim); }
432
+
433
+ /* A QUESTION, which is not a confirmation and must not look like one.
434
+ .dk-ask is bordered and coloured in the commit colour because it is the one
435
+ place somebody is asked to allow something irreversible. A question changes
436
+ nothing, so it borrows the layout and gives back the alarm: the border and
437
+ the heading go to the ordinary line colour. Two dialogs that look alike are
438
+ one dialog as far as a person's attention is concerned, which is the argument
439
+ the reversible-commit wording is already built on. */
440
+ .dk-q { border-color: var(--dk-line); }
441
+ .dk-q .dk-ask-q { color: inherit; }
442
+ .dk-ask-box {
443
+ flex: 1 1 100%;
444
+ border: 1px solid var(--dk-line);
445
+ border-radius: 8px;
446
+ padding: 7px 9px;
447
+ font: inherit;
448
+ color: inherit;
449
+ background: var(--dk-you);
450
+ }
451
+ .dk-yes, .dk-no { border-radius: 8px; padding: 6px 12px; border: 1px solid var(--dk-line); background: var(--dk-you); }
452
+ .dk-yes { border-color: var(--dk-commit); color: var(--dk-commit); font-weight: 600; }
453
+
454
+ .dk-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--dk-line); }
455
+ .dk-input {
456
+ flex: 1;
457
+ min-width: 0;
458
+ font: inherit;
459
+ color: inherit;
460
+ background: var(--dk-bg);
461
+ border: 1px solid var(--dk-line);
462
+ border-radius: 8px;
463
+ padding: 8px 10px;
464
+ }
465
+ .dk-send, .dk-stop {
466
+ border: 1px solid var(--dk-line);
467
+ border-radius: 8px;
468
+ background: var(--dk-you);
469
+ padding: 8px 12px;
470
+ }
471
+ .dk-send[disabled] { opacity: 0.5; cursor: default; }
472
+ .dk-stop { display: none; }
473
+ .dk-busy .dk-stop { display: block; }
474
+ .dk-busy .dk-send { display: none; }
475
+ `;
476
+ /**
477
+ * The outline over the element a verb is about to touch, as its own tiny
478
+ * stylesheet in its own shadow root.
479
+ *
480
+ * Separate from `CSS` because it has to be in a separate host element: the
481
+ * panel's `:host` carries a `translate`, a transformed ancestor is the
482
+ * containing block for `position: fixed` descendants, and an outline drawn
483
+ * inside the panel would therefore be offset by wherever the panel sits. See
484
+ * `highlight.ts`.
485
+ *
486
+ * The host is a zero-sized fixed point at the viewport's origin and the box
487
+ * inside it is positioned absolutely, so the numbers written in are exactly
488
+ * the ones `getBoundingClientRect` reported -- no coordinate conversion, which
489
+ * is the only kind of arithmetic that can be wrong here.
490
+ *
491
+ * `pointer-events: none` throughout, and nothing is ever written to the host
492
+ * app's own element: a border on somebody's button reflows their layout, and a
493
+ * panel that nudges the page sideways every time it names an element is not
494
+ * the passive observer it claims to be.
495
+ */
496
+ export const SPOT_CSS = `
497
+ :host {
498
+ all: initial;
499
+ position: fixed;
500
+ left: 0;
501
+ top: 0;
502
+ width: 0;
503
+ height: 0;
504
+ pointer-events: none;
505
+ /* One below the panel. If the outline and the panel overlap, the panel is
506
+ the thing that has words in it. */
507
+ z-index: 2147482999;
508
+ --dk-spot-color: #1f6feb;
509
+ }
510
+ @media (prefers-color-scheme: dark) {
511
+ :host { --dk-spot-color: #5b9dff; }
512
+ }
513
+ .dk-spot {
514
+ display: none;
515
+ position: absolute;
516
+ box-sizing: border-box;
517
+ pointer-events: none;
518
+ left: var(--dk-spot-x, 0);
519
+ top: var(--dk-spot-y, 0);
520
+ width: var(--dk-spot-w, 0);
521
+ height: var(--dk-spot-h, 0);
522
+ border: 2px solid var(--dk-spot-color);
523
+ border-radius: 6px;
524
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-spot-color) 25%, transparent);
525
+ }
526
+ .dk-spot-on { display: block; }
527
+ @media (prefers-reduced-motion: no-preference) {
528
+ .dk-spot-on { animation: dk-spot-in 120ms ease-out; }
529
+ }
530
+ @keyframes dk-spot-in { from { opacity: 0; } }
531
+ `;
532
+ //# sourceMappingURL=css.js.map