@design.estate/dees-catalog 21.47.0 → 21.49.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.
- package/dist_bundle/bundle.js +83 -25
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.d.ts +13 -4
- package/dist_ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.demo.js +17 -2
- package/dist_ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.js +10 -2
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.d.ts +11 -4
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.demo.js +1 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.js +61 -25
- package/dist_ts_web/elements/00group-harness/harness.markdown.d.ts +7 -0
- package/dist_ts_web/elements/00group-harness/harness.markdown.js +11 -2
- package/dist_ts_web/elements/00group-harness/index.d.ts +1 -1
- package/dist_ts_web/elements/00group-harness/index.js +2 -2
- package/package.json +1 -1
- package/readme.md +14 -7
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.demo.ts +16 -1
- package/ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.ts +20 -5
- package/ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.demo.ts +1 -1
- package/ts_web/elements/00group-harness/dees-harness-composer/dees-harness-composer.ts +61 -24
- package/ts_web/elements/00group-harness/harness.markdown.ts +12 -1
- package/ts_web/elements/00group-harness/index.ts +1 -1
package/readme.md
CHANGED
|
@@ -1227,7 +1227,7 @@ const statuses: IStatusbuttonItem[] = [
|
|
|
1227
1227
|
and unique within the button), `severity` (`TStatusbuttonSeverity`: `'success'`,
|
|
1228
1228
|
`'info'`, `'warning'` or `'error'`, `dees-hint`'s types), `severe?` (a warning that
|
|
1229
1229
|
must be seen), `text` (one short sentence), `detail?` (a second line) and
|
|
1230
|
-
`action?` (`IStatusbuttonAction`: `label`, `iconName?`, `disabled?`, `action`) and
|
|
1230
|
+
`action?` (`IStatusbuttonAction`: `label`, `iconName?`, `disabled?`, `closesPanel?`, `action`) and
|
|
1231
1231
|
`group?` (the key of the group whose section lists it).
|
|
1232
1232
|
- The button is an outline `dees-button` like the page's secondary actions. Its glyph
|
|
1233
1233
|
and colour are the worst severity's (the all-good check while there are only
|
|
@@ -1294,14 +1294,21 @@ const statuses: IStatusbuttonItem[] = [
|
|
|
1294
1294
|
- Each `action` is awaited with its button pending meanwhile and refuses a second
|
|
1295
1295
|
press; a rejection is reported as `dees-action-error` (`source:
|
|
1296
1296
|
'statusbutton-action'`). A status the action resolves usually leaves the list: the
|
|
1297
|
-
focus then stays in the panel, on its heading.
|
|
1297
|
+
focus then stays in the panel, on its heading. An action that takes the reader on
|
|
1298
|
+
instead, into a flow it opens in the page, sets `closesPanel`: its press closes the
|
|
1299
|
+
panel and gives the focus to the status button before the action runs.
|
|
1300
|
+
|
|
1301
|
+
```typescript
|
|
1302
|
+
{ key: 'unmatched', severity: 'warning', text: '1 payment is not matched to an invoice.',
|
|
1303
|
+
action: { label: 'Match payment', iconName: 'lucide:Link', closesPanel: true, action: () => openMatching() } }
|
|
1304
|
+
```
|
|
1298
1305
|
- Without statuses the button shows the all-good state, so the header's actions keep
|
|
1299
1306
|
their places; `hide-empty` (reflected, `hideEmpty`) removes it from the layout
|
|
1300
1307
|
instead.
|
|
1301
1308
|
- `open` (reflected) is the panel's state; set from code, it opens without moving the
|
|
1302
1309
|
focus, and while the button is off screen it stays closed. Every opening and closing is reported as the bubbling, composed
|
|
1303
1310
|
`panel-toggle` (`IStatusbuttonToggleDetail`: `{ open, reason }`, reason `'button'`,
|
|
1304
|
-
`'auto'`, `'host'`, `'escape'`, `'outside'`, `'tab'` or `'anchor-hidden'`). An open panel
|
|
1311
|
+
`'auto'`, `'host'`, `'action'` (a `closesPanel` action), `'escape'`, `'outside'`, `'tab'` or `'anchor-hidden'`). An open panel
|
|
1305
1312
|
closes when the element leaves the page; that closing (`'host'`) reaches only listeners on the
|
|
1306
1313
|
element itself, which is no longer in the page.
|
|
1307
1314
|
- The panel eases in from the button, and appears at once under
|
|
@@ -5827,7 +5834,7 @@ For a queued or held user prompt the host can still withdraw, set `pendingAction
|
|
|
5827
5834
|
|
|
5828
5835
|
Image attachments with inline `dataBase64` open in a `DeesModal` on click. When an image has metadata only, pass `.resolveAttachment` to `dees-harness-chat`, `dees-harness-message-list`, or the message itself. The `THarnessAttachmentResolver` receives `{ messageId, attachmentId }` and returns a complete `IHarnessAttachment` with the image's `dataBase64` after the host authorizes and reads it. The modal shows loading and read failure; closing it, unmounting the message, or replacing the message ignores a late result. The component accepts image bytes only, never a URL or filesystem path.
|
|
5829
5836
|
|
|
5830
|
-
One message: role accent, markdown (assistant default, `message.markdown` overrides), attachments grid, reasoning parts, streaming cursor, usage/error footer. Markdown renders through `domtools.plugins.smartmarkdown` (GFM, sanitized). `markdownWhileStreaming` defaults to `true`, with throttled ≥150 ms re-parses while streaming; set it to `false` to retain plain text during the stream and parse once when the message ends. Fenced code is highlighted lazily after the final parse. Streaming methods: `appendTextDelta()`, `appendReasoningDelta()`, `endReasoning()`, `endStream(usage?, error?)`. A message that carries nothing but a tool call renders the bare row instead of the message frame, forwards `showTimestamp` to it, and reserves one line while virtualized when the transcript marks it with `data-tool-row`. A `role: 'user'` message carries `pending` (`THarnessPendingState`) while the session has not taken it in yet. The transcript list shows such a message in its queue (see `DeesHarnessMessageList`), and the element renders it like any other user message with one caption line under its content: "Steering · read at the next step" (`'steering'`), "Queued for the next turn" (`'queued'`), "Delivery unconfirmed" (`'uncertain'`), or "Held · not sent" with **Resend** and **Discard** buttons (`'held'`), which emit `harness-held-resend` and `harness-held-discard` with `{ messageId }`, bubbling and composed. A button pressed after the message stopped being held emits nothing. The line is gone once `pending` is cleared, and another role never shows it. `playAcceptanceSweep()` sweeps a scan across a user bubble once to mark that the session took it up: the former tool-card outcome scan in `--dees-color-accent-primary`, a band moving on `transform` alone, clipped to the bubble's rounded box, with nothing laid out anew and nothing clipped at rest. The transcript list calls it once a message it moved out of the queue has landed; a host that shows a message on its own calls it when the session takes the prompt up. It does nothing for another role or under `prefers-reduced-motion: reduce`, a sweep already playing plays on, and a new `id` ends it. A sweep that starts where nobody can see it — a row `content-visibility` skips, a hidden list, a background tab — still ends on schedule and never plays late. A block that appears in a message already shown — the thinking block as reasoning starts, the reply's text after it, attachments, a tool call beside text, the error and the usage footer as the stream ends — opens its space and then blends in, exactly like a transcript row, and takes no space on its first frame; later reasoning parts and streamed text grow the block they belong to instead. Nothing arrives on a first render, while `entering` is set (the list sets it while the message's row opens its space, so a block comes with the row), under reduced motion, or where the message is not rendered, and an engine without `Element.checkVisibility` shows the blocks without motion. Subtask activation emits the bubbling, composed, cancelable `harness-subtask-open` event with `{ sessionId, call }` before any inspector opens.
|
|
5837
|
+
One message: role accent, markdown (assistant default, `message.markdown` overrides), attachments grid, reasoning parts, streaming cursor, usage/error footer. Markdown renders through `domtools.plugins.smartmarkdown` (GFM, sanitized) with `harnessMarkdownRenderOptions`: a line break the model wrote is a line break (`breaks: true`), so a finished reply keeps the lines it streamed with, and `---` blocks at a reply's start are its text, never frontmatter (`frontmatter: false`). `markdownWhileStreaming` defaults to `true`, with throttled ≥150 ms re-parses while streaming; set it to `false` to retain plain text during the stream and parse once when the message ends. Fenced code is highlighted lazily after the final parse. Streaming methods: `appendTextDelta()`, `appendReasoningDelta()`, `endReasoning()`, `endStream(usage?, error?)`. A message that carries nothing but a tool call renders the bare row instead of the message frame, forwards `showTimestamp` to it, and reserves one line while virtualized when the transcript marks it with `data-tool-row`. A `role: 'user'` message carries `pending` (`THarnessPendingState`) while the session has not taken it in yet. The transcript list shows such a message in its queue (see `DeesHarnessMessageList`), and the element renders it like any other user message with one caption line under its content: "Steering · read at the next step" (`'steering'`), "Queued for the next turn" (`'queued'`), "Delivery unconfirmed" (`'uncertain'`), or "Held · not sent" with **Resend** and **Discard** buttons (`'held'`), which emit `harness-held-resend` and `harness-held-discard` with `{ messageId }`, bubbling and composed. A button pressed after the message stopped being held emits nothing. The line is gone once `pending` is cleared, and another role never shows it. `playAcceptanceSweep()` sweeps a scan across a user bubble once to mark that the session took it up: the former tool-card outcome scan in `--dees-color-accent-primary`, a band moving on `transform` alone, clipped to the bubble's rounded box, with nothing laid out anew and nothing clipped at rest. The transcript list calls it once a message it moved out of the queue has landed; a host that shows a message on its own calls it when the session takes the prompt up. It does nothing for another role or under `prefers-reduced-motion: reduce`, a sweep already playing plays on, and a new `id` ends it. A sweep that starts where nobody can see it — a row `content-visibility` skips, a hidden list, a background tab — still ends on schedule and never plays late. A block that appears in a message already shown — the thinking block as reasoning starts, the reply's text after it, attachments, a tool call beside text, the error and the usage footer as the stream ends — opens its space and then blends in, exactly like a transcript row, and takes no space on its first frame; later reasoning parts and streamed text grow the block they belong to instead. Nothing arrives on a first render, while `entering` is set (the list sets it while the message's row opens its space, so a block comes with the row), under reduced motion, or where the message is not rendered, and an engine without `Element.checkVisibility` shows the blocks without motion. Subtask activation emits the bubbling, composed, cancelable `harness-subtask-open` event with `{ sessionId, call }` before any inspector opens.
|
|
5831
5838
|
|
|
5832
5839
|
`refreshMessage()` reconciles direct same-object host mutations across text, reasoning, and tool content.
|
|
5833
5840
|
|
|
@@ -6018,7 +6025,7 @@ Pass `.history` as `IHarnessComposerHistoryEntry[]` in oldest-to-newest send ord
|
|
|
6018
6025
|
|
|
6019
6026
|
Place optional reply or task context in `slot="context"` to integrate it above the textarea inside one input surface. Set `contextDescription` to the same context as plain text for the textarea's accessible description. An empty slot reserves no space. Clicking informational context focuses the prompt; links and controls retain their own behavior. `DeesHarnessChat` supplies its reply heading here and keeps the composer within the conversation column, alongside the full-height desktop sidebar.
|
|
6020
6027
|
|
|
6021
|
-
Prompt input: autogrow textarea, attachment picker/paste/drag-drop with configurable `maxAttachmentCount`, `maxAttachmentBytes` (10 MB default), and `maxTotalAttachmentBytes` (30 MB default), image/text/binary classification, optional account, model, and reasoning-effort dropdowns, Cmd/Ctrl+Enter to
|
|
6028
|
+
Prompt input: autogrow textarea, attachment picker/paste/drag-drop with configurable `maxAttachmentCount`, `maxAttachmentBytes` (10 MB default), and `maxTotalAttachmentBytes` (30 MB default), image/text/binary classification, optional account, model, and reasoning-effort dropdowns, Enter to send (also Cmd/Ctrl+Enter), Shift+Enter for a new line. The controls stay one row while they fit: the account and model pickers shrink to their minimum widths (120 and 150 px; they size from those widths, never from their labels), then the trailing actions (queued count, delivery hint, More options, Stop, Queue, the main action) wrap together onto their own line at the trailing edge; below a 760 px content box — measured inside a docked bar's inset, not on the full-bleed host — the pickers take a row of their own. Nothing widens the composer past its column; an Enter that commits an IME composition (`isComposing`, or key 229 right after `compositionend`) stays the composition's, and an open slash-command menu takes Enter to complete its highlighted entry first. Attachment count is unlimited unless the host sets it. `attachmentAccept` names the files the host takes, as an `<input type="file">` `accept` list (`.pdf`, `application/pdf`, `image/*`): the picker offers those, and a picked, pasted or dropped file of another type is refused with `harness-attachment-error`; empty takes every file. `dees-harness-chat` forwards all three limits, `attachmentAccept` and `commands` to its composer. Controlled component — the host owns `value`, `attachments`, `commands`, `account`, and the other selections. Set `accountOptions` to `{ label, value }[]` so the dropdown displays readable labels while events retain opaque stable account values. Account changes emit `harness-account-change` with `{ account }`; `harness-send` includes optional `account` alongside `model` and `reasoningEffort`. While `account` names no usable option the account select says "Choose an account", and an empty `model` or `reasoningEffort` reads "Choose a model" or "Choose an effort".
|
|
6022
6029
|
|
|
6023
6030
|
An account that cannot be used right now stays listed: give its option `disabled: true` and a `description` with the reason or the fix ("Sign in again in Accounts to use it."). It cannot be chosen, and it is never the current account: an `account` that names a disabled option shows as no selection, and the host's `account` property is left as the host set it. When the host's `account` is a disabled option, `harness-send` carries no `account`, whatever its delivery. Treat a missing `account` as "no usable account": refuse the send or prompt for an account, and never fall back to a default account. `accountNote` is a note on the account choice, shown under the controls with or without options — for accounts that need attention, or for an account service that is unavailable and lists none. Its polite live region (`role="status"`) is in the DOM whenever the model controls show (`showModelControls`), visually hidden and taking no space while the note is empty, so both the note's first appearance and every later change are announced. It hides with the model controls, and `dees-harness-chat` forwards it.
|
|
6024
6031
|
|
|
@@ -6034,7 +6041,7 @@ and `addFiles()` ingestion; cancels queued/in-flight additions; and sends an emp
|
|
|
6034
6041
|
and file drops cannot navigate away from the page. The host-owned attachments array
|
|
6035
6042
|
is retained, so re-enabling the capability restores its chips without data loss.
|
|
6036
6043
|
|
|
6037
|
-
Set `commands` to the `IHarnessComposerCommand[]` the host understands, each `{ name, description?, available?, unavailableReason?, argument? }`, where `argument` is `{ hint?, options? }`: `hint` shows after the name (`<model>`, `[prompt]`) and `options` are `IHarnessComposerOption[]` values for it. The composer filters the list itself, and the menu belongs to slash commands only: it opens while the prompt is a slash and part of a name (`/mo` lists the commands whose name starts with `mo`, case-insensitively), and once a name with argument options is complete (`/model `), it lists the options whose label or value contains the typed argument. Any other prompt opens nothing — ordinary text, a path such as `/tmp/build.log`, a name nothing matches, or a second line. While the textarea owns focus, the listbox stays anchored above the composer; moving focus to another control closes it. Arrow keys wrap through rows; Enter or Tab completes the highlighted row
|
|
6044
|
+
Set `commands` to the `IHarnessComposerCommand[]` the host understands, each `{ name, description?, available?, unavailableReason?, argument? }`, where `argument` is `{ hint?, options? }`: `hint` shows after the name (`<model>`, `[prompt]`) and `options` are `IHarnessComposerOption[]` values for it. The composer filters the list itself, and the menu belongs to slash commands only: it opens while the prompt is a slash and part of a name (`/mo` lists the commands whose name starts with `mo`, case-insensitively), and once a name with argument options is complete (`/model `), it lists the options whose label or value contains the typed argument. Any other prompt opens nothing — ordinary text, a path such as `/tmp/build.log`, a name nothing matches, or a second line. While the textarea owns focus, the listbox stays anchored above the composer; moving focus to another control closes it. Arrow keys wrap through rows; Enter or Tab completes the highlighted row, and Escape closes the menu until the next keystroke. A prompt that already is a row's completion (`/model gpt-5` while `gpt-5.5` is listed too, or `/new`) highlights that row, and Enter sends it instead of completing another. Completing a command puts `/name ` into the prompt (`/name` for a command without an argument) and leads on to its options; completing an option puts `/name value`. Each completion emits the bubbling/composed `harness-input`. A new `commands` array highlights the first row again, so keep its reference stable while the list is unchanged. A command with `available: false`, and an option with `disabled: true`, stays listed with its reason (`unavailableReason`, or the option's `description`) and cannot be completed.
|
|
6038
6045
|
|
|
6039
6046
|
Sending a prompt whose first word names a listed command exactly emits `harness-command` instead of `harness-send`, with `IHarnessComposerCommandDetail` `{ name, argument, text, attachments, account?, model?, reasoningEffort? }`: `argument` is the trimmed text after the name, `text` the prompt as typed. A command runs whenever the composer is unlocked, busy or not — `busyDeliveryModes` applies to messages only — and while the prompt names one, the main action reads **Run**; an unavailable command cannot run, and the disabled button shows its reason. Every other prompt is a message and emits `harness-send`, including one that starts with an unlisted `/word`. Neither event clears the prompt: the host does, once it took the message or ran the command (`clearComposer()` on the chat).
|
|
6040
6047
|
|
|
@@ -6046,7 +6053,7 @@ While `busy` (a turn runs), Stop renders as an additional button and the main ac
|
|
|
6046
6053
|
| `next-turn` | For a harness that reads messages only between turns: read after this turn. | **Send**, "Read after this turn" |
|
|
6047
6054
|
| `queue` | Held by the host and sent as its own turn after this turn. | **Queue**, "Sent after this turn" |
|
|
6048
6055
|
|
|
6049
|
-
The main action is `steer` when listed, else `next-turn`, else `queue`; its hint shows as a caption beside the actions and as its tooltip. With `queue` listed beside `steer` or `next-turn`, a secondary **Queue** button ("Queue for after this turn") stands between Stop and the main action. Every send emits `harness-send` with `IHarnessComposerSendDetail.delivery`: `'turn'` while nothing runs, otherwise the chosen `THarnessBusyDelivery`. While busy a delivery needs a nonempty draft, and an empty `busyDeliveryModes` sends nothing. Keyboard: **Cmd/Ctrl+Enter** is the main action, and **Alt+Enter** (also with Cmd/Ctrl) queues for after this turn whenever the host lists `queue` (a prompt naming a listed command runs it on either key instead); while nothing runs, or without `queue`, Alt+Enter stays the textarea's own. Stop only halts the running turn: it emits `harness-abort`, sends nothing and keeps the draft. What the session had not taken in yet is the host's to mark `held` (see `DeesHarnessMessageList`); the host owns delivery, acknowledgment and clearing the draft. A positive `queuedCount` shows as "N queued" beside the actions while busy.
|
|
6056
|
+
The main action is `steer` when listed, else `next-turn`, else `queue`; its hint shows as a caption beside the actions and as its tooltip. With `queue` listed beside `steer` or `next-turn`, a secondary **Queue** button ("Queue for after this turn") stands between Stop and the main action. Every send emits `harness-send` with `IHarnessComposerSendDetail.delivery`: `'turn'` while nothing runs, otherwise the chosen `THarnessBusyDelivery`. While busy a delivery needs a nonempty draft, and an empty `busyDeliveryModes` sends nothing. Keyboard: **Enter** (also **Cmd/Ctrl+Enter**) is the main action, and **Alt+Enter** (also with Cmd/Ctrl) queues for after this turn whenever the host lists `queue` (a prompt naming a listed command runs it on either key instead); while nothing runs, or without `queue`, Alt+Enter stays the textarea's own. Stop only halts the running turn: it emits `harness-abort`, sends nothing and keeps the draft. What the session had not taken in yet is the host's to mark `held` (see `DeesHarnessMessageList`); the host owns delivery, acknowledgment and clearing the draft. A positive `queuedCount` shows as "N queued" beside the actions while busy.
|
|
6050
6057
|
|
|
6051
6058
|
Set `menuActions` to `IHarnessComposerMenuAction[]` (`{ key, label, iconName?, disabled?, disabledReason? }`) for host commands that belong to the conversation but not to the prompt, such as restarting the harness it runs in. While the list is not empty, a ghost `sm` button with a vertical ellipsis stands directly before Stop and the send actions. It is named "More options", announces a menu and whether it is open, takes Enter and Space, and opens a `dees-contextmenu` against itself — below it, or above it when the composer sits at the bottom of the window. Choosing a command emits `harness-menu-action` with `{ key }` (`IHarnessComposerMenuActionDetail`), bubbling and composed; the host runs the command. A command that cannot run right now stays listed with `disabled: true` and a `disabledReason` under its label, which the arrow keys reach, so the reason is heard too. The commands belong to the host, not to the prompt: `disabled` and `inputLocked` lock composing and sending only, so the button stays enabled and an open menu stays open while the composer is locked — a restart is often wanted exactly while the host holds the composer read-only. Each command's own `disabled` decides whether it runs, and a command the host disables or withdraws while the menu is open is refused. Emptying `menuActions` closes an open menu. `dees-harness-chat` forwards `menuActions`.
|
|
6052
6059
|
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-catalog',
|
|
6
|
-
version: '21.
|
|
6
|
+
version: '21.49.0',
|
|
7
7
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
|
8
8
|
}
|
|
@@ -127,6 +127,18 @@ export const demoFunc = () => {
|
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
},
|
|
130
|
+
{
|
|
131
|
+
key: 'unmatched',
|
|
132
|
+
severity: 'warning',
|
|
133
|
+
text: '1 payment is not matched to an invoice.',
|
|
134
|
+
action: {
|
|
135
|
+
label: 'Match payment',
|
|
136
|
+
iconName: 'lucide:Link',
|
|
137
|
+
// Matching opens in the page, under the panel: the panel closes before it does.
|
|
138
|
+
closesPanel: true,
|
|
139
|
+
action: () => showDemoResult(actionStatus, 'Match payment: the panel closed first (panel-toggle: action), the focus is on the status button, and the matching would open in the page now.'),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
130
142
|
];
|
|
131
143
|
return demoPage('Status button', 'A page\'s status in its header: one button beside the page\'s actions that shows the worst status and a count of the warnings and errors, and opens a speech-bubble panel that lists them. An error or a severe warning opens the panel by itself.', html`
|
|
132
144
|
${demoSection('In a page header', 'The statuses that a page would stack above its table as hints sit in the header; the table starts right under it, frameless. Press the button to open the panel, Escape to close it.', html`
|
|
@@ -204,10 +216,13 @@ const statuses: IStatusbuttonItem[] = [
|
|
|
204
216
|
</div>
|
|
205
217
|
${demoOutput('Add an error.')}
|
|
206
218
|
`)}
|
|
207
|
-
${demoSection('Actions on statuses', 'A status can offer the way to resolve it. Remove duplicates runs for a moment and resolves its warning; Retry sync fails, and the failure is reported as dees-action-error, here shown as a toast.', html`
|
|
219
|
+
${demoSection('Actions on statuses', 'A status can offer the way to resolve it. Remove duplicates runs for a moment and resolves its warning; Retry sync fails, and the failure is reported as dees-action-error, here shown as a toast. Match payment takes the reader on to a flow in the page (closesPanel): the panel closes before it runs.', html`
|
|
208
220
|
<div class="dees-demo-row">
|
|
209
221
|
${actionStatus}
|
|
210
222
|
</div>
|
|
223
|
+
${demoOutput('Press Match payment.')}
|
|
224
|
+
${demoCode(`{ key: 'unmatched', severity: 'warning', text: '1 payment is not matched to an invoice.',
|
|
225
|
+
action: { label: 'Match payment', iconName: 'lucide:Link', closesPanel: true, action: () => openMatching() } }`)}
|
|
211
226
|
`)}
|
|
212
227
|
`);
|
|
213
228
|
};
|
|
@@ -38,6 +38,13 @@ export interface IStatusbuttonAction {
|
|
|
38
38
|
label: string;
|
|
39
39
|
iconName?: string;
|
|
40
40
|
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The action takes the reader on from the panel, into a flow it opens in the page, say, rather
|
|
43
|
+
* than resolving the status in it: a press closes the panel and gives the focus to the status
|
|
44
|
+
* button before the action runs, and `panel-toggle` says `'action'`. Without it the panel stays
|
|
45
|
+
* open, so the reader sees the status resolve.
|
|
46
|
+
*/
|
|
47
|
+
closesPanel?: boolean;
|
|
41
48
|
/** Awaited; the button shows its pending state meanwhile, and a rejection is reported as `dees-action-error`. */
|
|
42
49
|
action: () => void | Promise<void>;
|
|
43
50
|
}
|
|
@@ -90,11 +97,11 @@ export interface IStatusbuttonGroup {
|
|
|
90
97
|
|
|
91
98
|
/**
|
|
92
99
|
* Why the panel opened or closed: `'button'` (a press of the status button), `'auto'` (a new error
|
|
93
|
-
* or severe warning), `'host'` (the `open` property),
|
|
94
|
-
* `
|
|
95
|
-
* `'anchor-hidden'` (the button left the screen).
|
|
100
|
+
* or severe warning), `'host'` (the `open` property), `'action'` (a status's action that closes it,
|
|
101
|
+
* `closesPanel`), or the dismissal that closed it: `'escape'`, `'outside'` (a press outside, or the
|
|
102
|
+
* window losing focus), `'tab'` (the focus left it) or `'anchor-hidden'` (the button left the screen).
|
|
96
103
|
*/
|
|
97
|
-
export type TStatusbuttonToggleReason = 'button' | 'auto' | 'host' | Exclude<TDeesPopoverCloseReason, 'explicit'>;
|
|
104
|
+
export type TStatusbuttonToggleReason = 'button' | 'auto' | 'host' | 'action' | Exclude<TDeesPopoverCloseReason, 'explicit'>;
|
|
98
105
|
|
|
99
106
|
/** The detail of the `panel-toggle` event. */
|
|
100
107
|
export interface IStatusbuttonToggleDetail {
|
|
@@ -217,6 +224,8 @@ export class DeesStatusbutton extends DeesElement {
|
|
|
217
224
|
private autoOpening = false;
|
|
218
225
|
/** Why the panel is about to open, set by whoever opens it; unset, the host set `open`. */
|
|
219
226
|
private openReason: TStatusbuttonToggleReason | undefined;
|
|
227
|
+
/** Why the panel is closing through the popover's `close()`, set around the call; unset, a press of the button. */
|
|
228
|
+
private closeReason: TStatusbuttonToggleReason | undefined;
|
|
220
229
|
/** The popover accepted the last opening: the panel is on screen. */
|
|
221
230
|
private panelShown = false;
|
|
222
231
|
/** Tells when the button comes on screen, for an automatic opening that had to wait. */
|
|
@@ -655,7 +664,7 @@ export class DeesStatusbutton extends DeesElement {
|
|
|
655
664
|
if (!shown) return;
|
|
656
665
|
this.clearAnnouncements();
|
|
657
666
|
const reason = event.detail.reason;
|
|
658
|
-
this.dispatchToggle(false, reason === 'explicit' ? 'button' : reason);
|
|
667
|
+
this.dispatchToggle(false, reason === 'explicit' ? this.closeReason ?? 'button' : reason);
|
|
659
668
|
};
|
|
660
669
|
|
|
661
670
|
private dispatchToggle(open: boolean, reason: TStatusbuttonToggleReason): void {
|
|
@@ -691,6 +700,12 @@ export class DeesStatusbutton extends DeesElement {
|
|
|
691
700
|
private async runItemAction(item: IStatusbuttonItem, button: DeesButton): Promise<void> {
|
|
692
701
|
const action = item.action;
|
|
693
702
|
if (!action || action.disabled || this.pendingActions.has(item.key)) return;
|
|
703
|
+
if (action.closesPanel && this.open) {
|
|
704
|
+
// Closes the panel and gives the focus back to the button, as its press does, before the action takes the reader on.
|
|
705
|
+
this.closeReason = 'action';
|
|
706
|
+
this.popoverElement?.close();
|
|
707
|
+
this.closeReason = undefined;
|
|
708
|
+
}
|
|
694
709
|
this.pendingActions = new Set([...this.pendingActions, item.key]);
|
|
695
710
|
try {
|
|
696
711
|
await runAction(this, { action, source: 'statusbutton-action' }, () => action.action());
|
|
@@ -60,7 +60,7 @@ export const demoFunc = () => demoPage('Composer', 'Write, attach files, choose
|
|
|
60
60
|
accountNote="Accounts could not be loaded. Chat resumes once the account service answers."
|
|
61
61
|
.modelOptions=${['gpt-5.5', 'gpt-5']}
|
|
62
62
|
></dees-harness-composer>
|
|
63
|
-
<div class="dees-demo-label">Slash commands: type / to list them, Enter or Tab completes,
|
|
63
|
+
<div class="dees-demo-label">Slash commands: type / to list them, Enter or Tab completes, Enter again runs</div>
|
|
64
64
|
<dees-harness-composer
|
|
65
65
|
.showModelControls=${false}
|
|
66
66
|
.commands=${[
|
|
@@ -156,7 +156,8 @@ const deliveryHintKeys = {
|
|
|
156
156
|
/**
|
|
157
157
|
* Prompt composer: autogrow textarea, attachments (picker / paste /
|
|
158
158
|
* drag-drop with accepted types and per-file and total size limits), optional account, model,
|
|
159
|
-
* and reasoning-effort dropdowns. Cmd/Ctrl+Enter sends
|
|
159
|
+
* and reasoning-effort dropdowns. Enter (also Cmd/Ctrl+Enter) sends, Shift+Enter starts a new line,
|
|
160
|
+
* and an Enter that commits an IME composition stays the composition's. While busy, Stop is an
|
|
160
161
|
* additional button and the main action delivers the draft the way the host supports
|
|
161
162
|
* (`busyDeliveryModes`): Steer (read at the next step) when it can, else Send (read after this
|
|
162
163
|
* turn); "Queue for after this turn" is the secondary action, also on Alt+Enter.
|
|
@@ -165,7 +166,8 @@ const deliveryHintKeys = {
|
|
|
165
166
|
* Slash commands: `commands` lists the commands the host understands. A prompt that starts with
|
|
166
167
|
* `/` and part of a name opens a menu of the matching commands, and once a name is complete, of
|
|
167
168
|
* its argument options; any other prompt opens nothing. Enter or Tab completes the highlighted
|
|
168
|
-
* entry
|
|
169
|
+
* entry, Enter on the entry the prompt already is sends it, and Escape closes the menu until the
|
|
170
|
+
* next keystroke. Sending a prompt that
|
|
169
171
|
* names a listed command emits `harness-command` instead of `harness-send`, busy or not, and the
|
|
170
172
|
* main button reads Run; every other prompt, such as `/tmp/build.log`, is a message.
|
|
171
173
|
*
|
|
@@ -255,7 +257,7 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
255
257
|
|
|
256
258
|
/**
|
|
257
259
|
* How the host can deliver a message sent while a turn runs (`THarnessBusyDelivery`). The main
|
|
258
|
-
* action (Cmd/Ctrl+Enter) is `steer` when listed ("Steer", read at the next step), else
|
|
260
|
+
* action (Enter, Cmd/Ctrl+Enter) is `steer` when listed ("Steer", read at the next step), else
|
|
259
261
|
* `next-turn` ("Send", read after this turn), else `queue` ("Queue"); with `queue` listed beside
|
|
260
262
|
* one of the others, "Queue" is a secondary action for after this turn (Alt+Enter). Empty, a
|
|
261
263
|
* busy composer sends nothing. `harness-send` carries the chosen `delivery`.
|
|
@@ -479,6 +481,11 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
479
481
|
|
|
480
482
|
.composer {
|
|
481
483
|
display: grid;
|
|
484
|
+
/* No control may widen the composer past its column: a row that does not fit wraps. */
|
|
485
|
+
grid-template-columns: minmax(0, 1fr);
|
|
486
|
+
/* The controls' breakpoints measure the content box, which a docked bar insets to the
|
|
487
|
+
transcript's measure, not the full-bleed host. */
|
|
488
|
+
container: harness-composer / inline-size;
|
|
482
489
|
gap: var(--dees-spacing-sm);
|
|
483
490
|
padding: 12px;
|
|
484
491
|
border: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
@@ -629,8 +636,13 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
629
636
|
color: var(--dees-color-text-primary);
|
|
630
637
|
}
|
|
631
638
|
|
|
639
|
+
/*
|
|
640
|
+
* One row while everything fits: the pickers shrink to their minimum widths first, then the
|
|
641
|
+
* trailing actions wrap together onto a line of their own, still at the trailing edge.
|
|
642
|
+
*/
|
|
632
643
|
.controlsRow {
|
|
633
644
|
display: flex;
|
|
645
|
+
flex-wrap: wrap;
|
|
634
646
|
align-items: center;
|
|
635
647
|
gap: var(--dees-spacing-sm);
|
|
636
648
|
}
|
|
@@ -640,10 +652,18 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
640
652
|
.modelControls {
|
|
641
653
|
display: flex;
|
|
642
654
|
gap: var(--dees-spacing-xs);
|
|
643
|
-
/*
|
|
644
|
-
|
|
655
|
+
/* takes the row's free space; its pickers stop at their own widths */
|
|
656
|
+
flex: 1 1 auto;
|
|
657
|
+
min-width: 0;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.actions {
|
|
661
|
+
display: flex;
|
|
662
|
+
align-items: center;
|
|
663
|
+
gap: var(--dees-spacing-sm);
|
|
645
664
|
flex: 0 1 auto;
|
|
646
665
|
min-width: 0;
|
|
666
|
+
margin-inline-start: auto;
|
|
647
667
|
}
|
|
648
668
|
|
|
649
669
|
.modelControls dees-input-dropdown {
|
|
@@ -653,19 +673,26 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
653
673
|
--dees-input-control-border: transparent;
|
|
654
674
|
}
|
|
655
675
|
|
|
676
|
+
/*
|
|
677
|
+
* The pickers size from these widths, never from their labels (inline-size containment): a
|
|
678
|
+
* long label truncates instead of asking the row for room, so the row wraps only when the
|
|
679
|
+
* pickers at their minimum widths and the actions do not fit.
|
|
680
|
+
*/
|
|
656
681
|
.accountSelect {
|
|
657
|
-
flex:
|
|
658
|
-
width: 180px;
|
|
682
|
+
flex: 1 1 120px;
|
|
659
683
|
min-width: 120px;
|
|
684
|
+
max-width: 180px;
|
|
685
|
+
contain: inline-size;
|
|
660
686
|
}
|
|
661
687
|
|
|
662
688
|
/* Model identifiers are provider-qualified ("anthropic/claude-opus-5"),
|
|
663
689
|
so the control grows into the free space instead of truncating,
|
|
664
690
|
while still shrinking on narrow hosts. */
|
|
665
691
|
.modelSelect {
|
|
666
|
-
flex:
|
|
667
|
-
width: 280px;
|
|
692
|
+
flex: 1 1 150px;
|
|
668
693
|
min-width: 150px;
|
|
694
|
+
max-width: 280px;
|
|
695
|
+
contain: inline-size;
|
|
669
696
|
}
|
|
670
697
|
|
|
671
698
|
.effortSelect {
|
|
@@ -673,10 +700,6 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
673
700
|
width: 110px;
|
|
674
701
|
}
|
|
675
702
|
|
|
676
|
-
.spacer {
|
|
677
|
-
flex: 1;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
703
|
.accountNote {
|
|
681
704
|
display: flex;
|
|
682
705
|
align-items: flex-start;
|
|
@@ -713,11 +736,7 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
713
736
|
font-variant-numeric: tabular-nums;
|
|
714
737
|
}
|
|
715
738
|
|
|
716
|
-
@container (max-width: 760px) {
|
|
717
|
-
.controlsRow {
|
|
718
|
-
flex-wrap: wrap;
|
|
719
|
-
}
|
|
720
|
-
|
|
739
|
+
@container harness-composer (max-width: 760px) {
|
|
721
740
|
.modelControls {
|
|
722
741
|
order: -1;
|
|
723
742
|
flex: 1 0 100%;
|
|
@@ -927,7 +946,7 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
927
946
|
</div>
|
|
928
947
|
`
|
|
929
948
|
: ''}
|
|
930
|
-
<
|
|
949
|
+
<div class="actions">
|
|
931
950
|
${this.busy && this.queuedCount > 0
|
|
932
951
|
? html`<span class="queuedStatus" aria-live="polite">${this.t('composer.queued', { count: this.queuedCount })}</span>`
|
|
933
952
|
: ''}
|
|
@@ -997,6 +1016,7 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
997
1016
|
${typedCommand ? this.t('composer.run') : this.t(deliveryLabelKeys[this.primaryDelivery ?? 'turn'])}
|
|
998
1017
|
</dees-button>
|
|
999
1018
|
</div>
|
|
1019
|
+
</div>
|
|
1000
1020
|
${this.showModelControls
|
|
1001
1021
|
? html`<p class="accountNote ${this.accountNote ? '' : 'empty'}" role="status">${this.accountNote
|
|
1002
1022
|
? html`<dees-icon icon="lucide:Info" iconSize="12" aria-hidden="true"></dees-icon>
|
|
@@ -1097,7 +1117,8 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
1097
1117
|
|
|
1098
1118
|
private handleKeydown = (event: KeyboardEvent): void => {
|
|
1099
1119
|
if (this.interactionLocked) return;
|
|
1100
|
-
|
|
1120
|
+
// Some browsers deliver the Enter that commits an IME composition after compositionend, as key 229.
|
|
1121
|
+
if (event.isComposing || this.composing || event.keyCode === 229) return;
|
|
1101
1122
|
// Alt+Enter queues for after this turn wherever the host queues; alone or with Cmd/Ctrl.
|
|
1102
1123
|
if (event.key === 'Enter' && event.altKey && this.busy && this.busyDeliveryModes.includes('queue')) {
|
|
1103
1124
|
event.preventDefault();
|
|
@@ -1123,10 +1144,11 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
1123
1144
|
return;
|
|
1124
1145
|
}
|
|
1125
1146
|
// Enter and Tab complete the highlighted entry. On a highlighted entry that cannot be
|
|
1126
|
-
// completed they do nothing; with no entry highlighted they keep their own meaning
|
|
1147
|
+
// completed they do nothing; with no entry highlighted they keep their own meaning, and
|
|
1148
|
+
// Enter on the entry the prompt already is sends the prompt.
|
|
1127
1149
|
if (event.key === 'Enter' || event.key === 'Tab') {
|
|
1128
1150
|
const entry = menu.entries[this.activeMenuEntryIndex(menu)];
|
|
1129
|
-
if (entry) {
|
|
1151
|
+
if (entry && !(event.key === 'Enter' && this.promptIsEntry(entry))) {
|
|
1130
1152
|
event.preventDefault();
|
|
1131
1153
|
void this.chooseMenuEntry(entry);
|
|
1132
1154
|
return;
|
|
@@ -1134,6 +1156,12 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
1134
1156
|
}
|
|
1135
1157
|
}
|
|
1136
1158
|
}
|
|
1159
|
+
// Enter sends the prompt (the main action while busy); Shift+Enter is the textarea's new line.
|
|
1160
|
+
if (event.key === 'Enter' && !event.shiftKey && !event.altKey) {
|
|
1161
|
+
event.preventDefault();
|
|
1162
|
+
this.send(this.primaryDelivery);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1137
1165
|
if (this.handlePromptHistoryKey(event)) return;
|
|
1138
1166
|
// Shift+Tab cycles the agent mode without leaving the prompt
|
|
1139
1167
|
if (event.key === 'Tab' && event.shiftKey && this.modeOptions.length) {
|
|
@@ -1295,10 +1323,19 @@ export class DeesHarnessComposer extends DeesElement {
|
|
|
1295
1323
|
return commandMenuFor(this.value, this.commands);
|
|
1296
1324
|
}
|
|
1297
1325
|
|
|
1298
|
-
/**
|
|
1326
|
+
/**
|
|
1327
|
+
* The highlighted entry: the one moved to, else the one the prompt already is (`/model gpt-5`
|
|
1328
|
+
* among `gpt-5.5` and `gpt-5`), else the first that can be completed.
|
|
1329
|
+
*/
|
|
1299
1330
|
private activeMenuEntryIndex(menuArg: ICommandMenu): number {
|
|
1300
1331
|
if (this.activeMenuIndex >= 0 && this.activeMenuIndex < menuArg.entries.length) return this.activeMenuIndex;
|
|
1301
|
-
|
|
1332
|
+
const typed = menuArg.entries.findIndex((entry) => this.promptIsEntry(entry));
|
|
1333
|
+
return typed >= 0 ? typed : menuArg.entries.findIndex((entry) => !entry.unavailable);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/** The prompt is the entry's completion already, and the entry leads nowhere further. */
|
|
1337
|
+
private promptIsEntry(entryArg: ICommandMenuEntry): boolean {
|
|
1338
|
+
return !entryArg.unavailable && !entryArg.opensOptions && entryArg.completion === this.value.trim();
|
|
1302
1339
|
}
|
|
1303
1340
|
|
|
1304
1341
|
private commandMenuOptionId(indexArg: number): string {
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { css, type CSSResult } from '@design.estate/dees-element';
|
|
2
2
|
import * as domtools from '@design.estate/dees-domtools';
|
|
3
|
+
import type { IMarkdownHtmlOptions } from '@push.rocks/smartmarkdown';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A reply renders as it streamed: each line break the model wrote is a line break (`breaks`), as
|
|
7
|
+
* the plain streaming text shows it, and a reply is never a document with frontmatter, so `---`
|
|
8
|
+
* blocks at its start stay its own text (`frontmatter: false`).
|
|
9
|
+
*/
|
|
10
|
+
export const harnessMarkdownRenderOptions: Readonly<IMarkdownHtmlOptions> = Object.freeze({
|
|
11
|
+
frontmatter: false,
|
|
12
|
+
breaks: true,
|
|
13
|
+
});
|
|
3
14
|
|
|
4
15
|
/**
|
|
5
16
|
* Markdown service for harness messages. Uses smartmarkdown (already in the
|
|
@@ -27,7 +38,7 @@ export class HarnessMarkdown {
|
|
|
27
38
|
this.cache.set(markdownText, cached);
|
|
28
39
|
return cached;
|
|
29
40
|
}
|
|
30
|
-
const html = await domtools.plugins.smartmarkdown.SmartMarkdown.
|
|
41
|
+
const html = await domtools.plugins.smartmarkdown.SmartMarkdown.markdownToHtml(markdownText, harnessMarkdownRenderOptions);
|
|
31
42
|
const processed = this.postProcess(html);
|
|
32
43
|
this.cache.set(markdownText, processed);
|
|
33
44
|
if (this.cache.size > HarnessMarkdown.maxCacheEntries) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export * from './interfaces.js';
|
|
5
5
|
export * from './toolregistry.js';
|
|
6
6
|
export * from './harness.helpers.js';
|
|
7
|
-
export { HarnessMarkdown, markdownStyles } from './harness.markdown.js';
|
|
7
|
+
export { HarnessMarkdown, harnessMarkdownRenderOptions, markdownStyles } from './harness.markdown.js';
|
|
8
8
|
export { harnessCardStyles, harnessPillStyles, harnessMonoStyles } from './harness.styles.js';
|
|
9
9
|
export * from './harness.demodata.js';
|
|
10
10
|
export * from './dees-harness-overflow-text.js';
|