@mgamadeus/ddd-agents 0.13.0 → 0.14.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/README.md +76 -0
- package/dist/admin.js +2 -2
- package/dist/chat.js +1303 -409
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{agents-http-trace-mappers-LWNi-3a4.js → agents-http-trace-mappers-juBx_kw5.js} +64 -22
- package/dist/chunks/agents-http-trace-mappers-juBx_kw5.js.map +1 -0
- package/dist/chunks/{canvas-title-slot-context-BRGnFzYP.js → canvas-label-context-B54MYVLF.js} +16 -4
- package/dist/chunks/canvas-label-context-B54MYVLF.js.map +1 -0
- package/dist/chunks/{content-from-unified-diff-CovnmG2Q.js → content-from-unified-diff-lgH6CejC.js} +77 -46
- package/dist/chunks/content-from-unified-diff-lgH6CejC.js.map +1 -0
- package/dist/chunks/{contract-886XjdID.js → contract-CIXLnSqL.js} +2 -1
- package/dist/chunks/{contract-886XjdID.js.map → contract-CIXLnSqL.js.map} +1 -1
- package/dist/chunks/conversation-B7-evdj_.js.map +1 -1
- package/dist/chunks/conversation-trace-fVeh6Lg6.js +6 -0
- package/dist/chunks/conversation-trace-fVeh6Lg6.js.map +1 -0
- package/dist/chunks/index-DZovGMpG.js.map +1 -1
- package/dist/client.js +13 -8
- package/dist/client.js.map +1 -1
- package/dist/contract.js +3 -1
- package/dist/contract.js.map +1 -1
- package/dist/files/i18n-keys.json +496 -12
- package/dist/files/styles/_surfaces.scss +5 -0
- package/dist/renderer.js +10 -8
- package/dist/styles.css +920 -39
- package/dist/types/chat/CanvasResizeHandle/CanvasResizeHandle.d.ts +2 -0
- package/dist/types/chat/CanvasResizeHandle/use-canvas-resize.d.ts +4 -2
- package/dist/types/chat/ConversationMessage/ConversationCallMarkerChip/ConversationCallMarkerChip.d.ts +6 -1
- package/dist/types/chat/ConversationMessageList/ConversationMessageList.d.ts +8 -1
- package/dist/types/chat/ConversationMessageList/message-times.d.ts +55 -0
- package/dist/types/chat/ConversationView.d.ts +3 -0
- package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +3 -0
- package/dist/types/chat/canvas-layout.d.ts +13 -0
- package/dist/types/chat/controller/AgentChatController.d.ts +7 -0
- package/dist/types/chat/trace/TaskPlanDrawer.d.ts +45 -0
- package/dist/types/chat/trace/TaskPlanPane.d.ts +21 -12
- package/dist/types/chat/trace/ToolStepGroup.d.ts +2 -0
- package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +10 -2
- package/dist/types/chat/trace/index.d.ts +4 -1
- package/dist/types/chat/trace/task-plan-tree.d.ts +55 -0
- package/dist/types/chat/trace/trace-collect.d.ts +15 -0
- package/dist/types/chat/trace/trace-types.d.ts +20 -0
- package/dist/types/chat/trace/trace-view-policy.d.ts +17 -0
- package/dist/types/client/http/agents-http-trace-mappers.d.ts +8 -1
- package/dist/types/client/http/agents-http-trace-wire.d.ts +27 -0
- package/dist/types/client/http/agents-http-wire.d.ts +4 -0
- package/dist/types/contract/conversation-trace.d.ts +63 -1
- package/dist/types/contract/conversation.d.ts +11 -0
- package/dist/types/entries/chat.d.ts +1 -0
- package/dist/types/entries/renderer.d.ts +1 -0
- package/dist/types/provider/components/types.d.ts +5 -0
- package/dist/types/provider/environment.d.ts +26 -0
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/types/renderer/canvas/canvas-label-context.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.json +40 -0
- package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js.map +0 -1
- package/dist/chunks/canvas-title-slot-context-BRGnFzYP.js.map +0 -1
- package/dist/chunks/content-from-unified-diff-CovnmG2Q.js.map +0 -1
package/README.md
CHANGED
|
@@ -289,6 +289,48 @@ overflowing horizontally (`box-sizing: border-box`, the split clipped with `over
|
|
|
289
289
|
thread at the top of the pane (`--agents-chat-top-padding: 24px` on its chat area); a host with a top bar floating over
|
|
290
290
|
the thread sets that variable on `[data-agents-chat-scroll]` or through its own `chatAreaClassName`.
|
|
291
291
|
|
|
292
|
+
**A host that frames the canvas itself** (its own card, tabs and close control around the `SplitView` side pane) turns
|
|
293
|
+
the package's canvas chrome off with `AgentsEnvironment.canvasLayout` (`AgentsCanvasLayout`; every member optional, the
|
|
294
|
+
defaults are the package's chrome, so a host without the setting sees no change):
|
|
295
|
+
|
|
296
|
+
| Member | Default | Effect |
|
|
297
|
+
|---|---|---|
|
|
298
|
+
| `showsCloseButton` | `true` | the canvas pane's own "Close canvas" button; `false` leaves closing to the host (a tab's ×). A canvas with `titleBesideCloseButton` keeps its title row; without a title the row is gone |
|
|
299
|
+
| `showsDividerToggle` | `true` | the round canvas toggle on the divider (where the chat enables it) |
|
|
300
|
+
| `showsNarrowReopenControl` | `true` | the "Re-open canvas" control over a narrow chat |
|
|
301
|
+
| `chatColumnMinWidthPx` | `CHAT_COLUMN_MIN_WIDTH_PX` (360) | the narrowest chat beside the canvas: caps the default split (`min(<percent>%, calc(100% - <px>))`) and every pull of the resize handle |
|
|
302
|
+
| `boxedInsetPx` | `CANVAS_BOXED_INSET_PX` (8) | the inset of the boxed side-split canvas (`--agents-canvas-inset`, the handle sits on that edge) |
|
|
303
|
+
| `paneSurface` | `"card"` | `"none"`: the pane paints no surface, radius or padding of its own (the host's card does); its title row keeps a 12 px inset |
|
|
304
|
+
|
|
305
|
+
**The canvas's name for a host frame.** A canvas body reports a short name with `useCanvasLabel(label)` (from
|
|
306
|
+
`/renderer`; `null` while it loads; taken back on unmount); the chat hands it to the `SplitView` as `sideLabel` (only
|
|
307
|
+
while the canvas is open; the hook reports through `CanvasLabelContext`, which a host that mounts a canvas body outside
|
|
308
|
+
the chat may provide itself). A host tab shows the file's name instead of a generic label; the package's default
|
|
309
|
+
`SplitView` ignores it. ddd-clouddrive's file and folder canvases report the node's name.
|
|
310
|
+
|
|
311
|
+
Trap: the package's class names carry a build hash. Never hide or restyle package chrome through `[class*='agents_…']`
|
|
312
|
+
selectors; use `canvasLayout` (a renamed class silently brings the button back).
|
|
313
|
+
|
|
314
|
+
**Date and time in the message list (`messageTimes`).** `AgentChat` (through the controller props), `ConversationView`
|
|
315
|
+
and `ConversationMessageList` take `messageTimes` (`MessageTimesMode`): `null` (default, unchanged), `"turns"` or
|
|
316
|
+
`"everyMessage"`. Rules (pure `buildMessageTimeMarks()` in `message-times.ts`, one `MessageTimeMarks` per message:
|
|
317
|
+
`moment`, `daySeparator`, `timeHead`, `finishedAt`):
|
|
318
|
+
- a day separator (`role="separator"`) before the first row of each calendar day in the owner's zone, with the time
|
|
319
|
+
("Today · 09:58") unless a voice call marker opens the day;
|
|
320
|
+
- a time head before a message that starts a turn (`isTurnInitiatorMessage`) more than 20 min
|
|
321
|
+
(`MESSAGE_TIME_PAUSE_MS`) after the message before it; the agent's steps and run time never cause one, the answer
|
|
322
|
+
stays with its question; a call marker after a pause is its own head;
|
|
323
|
+
- "finished HH:MM" under the last answer of a turn whose answer came more than 20 min after its start, never while the
|
|
324
|
+
newest turn runs; `everyMessage` adds a quiet `HH:MM` under each message;
|
|
325
|
+
- every timed row carries `<time dateTime>` with the exact moment (tooltip after 300 ms on hover devices, a tap line on
|
|
326
|
+
touch, always read by screen readers);
|
|
327
|
+
- a message without `createdAt` (optimistic, or a client that does not send it) gets no marks.
|
|
328
|
+
The moment is `AgentsConversationMessage.createdAt` (server date-time, UTC, from `ChangeHistory.createdTime`;
|
|
329
|
+
`createdDate` is the calendar date only). The package's HTTP client maps `changeHistory.createdTime`; a host client of
|
|
330
|
+
its own maps it too. Formats follow the owner settings (`dateLocale ?? locale`, `timeZone`): `createMessageTimeFormat()`
|
|
331
|
+
/ `useMessageTimeFormat()` answer a `MessageTimeFormat` (`time`, `exact`, `day`, `dayKey`, `finished`). The day separator's text sits in one `span` (`daySeparatorLabel`, design role
|
|
332
|
+
`--agents-day-pill`). Text keys: `Yesterday` (`chat-day`), `finished %time%` (`chat-turn-end`), `Today`.
|
|
333
|
+
|
|
292
334
|
## The trace of a turn in the chat (`TurnTrace`)
|
|
293
335
|
|
|
294
336
|
What the agent did between a message and its answer, as calm rows under the message that started the turn. `AgentChat`
|
|
@@ -306,6 +348,19 @@ const TurnTrace = (props: AgentChatTurnTraceProps) => (
|
|
|
306
348
|
|
|
307
349
|
Pass one stable component (what changes comes through a context of the host), or every render mounts the traces anew.
|
|
308
350
|
|
|
351
|
+
- **Who may see which mode** comes from the server: the conversation read (`AgentsConversation.traceViewPolicy`) and
|
|
352
|
+
every trace read (`ConversationTurnTraces.traceViewPolicy`) carry the `ConversationTraceViewPolicy` of the app's
|
|
353
|
+
`AgentTraceViewPolicyService` (`maxDetailLevel`, `defaultDetailLevel`, `isSwitchShown`; levels RESULT < STEPS <
|
|
354
|
+
DEBUG ↔ `summary` / `normal` / `verbose`). Pass `TraceViewModeSwitch` `allowedViewModes =
|
|
355
|
+
resolveAllowedTraceViewModes(policy, isVerboseAllowed)`: one mode or none renders no switch; show
|
|
356
|
+
`clampTraceViewMode(choice, allowed)`. `isVerboseAllowed` is deprecated and only the fallback while a read carries no
|
|
357
|
+
policy. The server holds the lock (a read above the maximum is lowered, RESULT answers no steps); a host binding of
|
|
358
|
+
its own reads the field with `mapWireTraceViewPolicy` (`/client`). The pieces behind the two helpers, for a host that
|
|
359
|
+
builds its own switch: `traceViewModesOfPolicy(policy)` (the modes up to the maximum, Short first),
|
|
360
|
+
`defaultTraceViewModeOfPolicy(policy)` (the mode a reader starts in when they chose none: the policy's default level),
|
|
361
|
+
`TRACE_VIEW_MODE_OF_LEVEL` and `traceLevelOfViewMode(mode)` (the two directions of RESULT ↔ `summary`, STEPS ↔
|
|
362
|
+
`normal`, DEBUG ↔ `verbose`; `/chat`), and `CONVERSATION_TRACE_LEVELS` (`/contract`, the levels from the least to the
|
|
363
|
+
most).
|
|
309
364
|
- **View modes** (`TraceViewMode`, switched with `TraceViewModeSwitch`; the host stores the choice). `summary`: one
|
|
310
365
|
line "12 steps · 48 s" that opens the steps. `normal`: the steps folded, each with its narrated line; a row opens to
|
|
311
366
|
its terminal, its file edits and its plain facts (tool, effect, state, time). `verbose` (only with `isDebugAllowed`,
|
|
@@ -596,3 +651,24 @@ so) and `foldEqualLines`.
|
|
|
596
651
|
a host whose CTA colour is light in dark mode sets it dark there.
|
|
597
652
|
- `--agents-fg-on-accent` is the text on an accent fill (white in light, dark in dark mode); `--agents-fg-on-dark` stays
|
|
598
653
|
white for text over a dark scrim.
|
|
654
|
+
- `--agents-view-modes-track` is the rail of the view mode switch (`TraceViewModeSwitch`); unset it is a 6 % tint of
|
|
655
|
+
`--agents-fg`. A host whose neutral controls share one surface colour sets it to that colour.
|
|
656
|
+
- **Design roles** (all optional; unset, each keeps the look the package has without it, so a host sets only the ones
|
|
657
|
+
its design language needs):
|
|
658
|
+
|
|
659
|
+
| Role | What it colours | Unset |
|
|
660
|
+
|---|---|---|
|
|
661
|
+
| `--agents-steps-surface`, `--agents-steps-radius`, `--agents-steps-padding` | the steps of a turn in the thread (`TurnTrace`) as a card of their own | flat on the chat |
|
|
662
|
+
| `--agents-pill-active-bg`, `-fg`, `-shadow`, `-hover-bg` | the strong pill: the shown view mode (Kurz / Normal / Ausführlich) and the Stop button of a running turn | white raised pill; outlined Stop |
|
|
663
|
+
| `--agents-primary-action-bg`, `-fg`, `-hover-bg` | the primary action (`Button` variant `shimmer`: send, retry, submit) | the shimmer gradient |
|
|
664
|
+
| `--agents-composer-edge`, `--agents-composer-focus` | the composer's edge (`--ai-border-size` wide) and its edge while typing | `--ai-stroke-color` |
|
|
665
|
+
| `--agents-card-shadow` | the shadow of a card on the chat (widgets, markers, notices); popovers and tooltips keep theirs | the card shadow |
|
|
666
|
+
| `--agents-plan-done`, `-done-fg`, `--agents-plan-running`, `--agents-plan-you`, `-you-fg`, `-you-edge` | the task plan's marks, progress segments and the "waits for you" chip | `--agents-fg-cta`, the warning tint |
|
|
667
|
+
| `--agents-plan-section-running`, `--agents-plan-section-criterion`, `--agents-plan-detail-shadow` | the step drawer of the task plan: the "Running" and "Done when" sections, the drawer's shadow over the tree | the CTA tint, the neutral fill, the drawer shadow |
|
|
668
|
+
| `--agents-highlight`, `--agents-highlight-edge` | the row a plan item or a search hit jumps to (`data-trace-highlighted`) | an accent tint |
|
|
669
|
+
| `--agents-font-display`, `--agents-font-display-weight` | titles and big figures: the plan's title, a step's title, the widget text variants `hero`, `headline`, `title`, `gaugeValue` | the chat's face |
|
|
670
|
+
| `--agents-day-pill`, `-edge`, `-padding`, `-height`, `-gap`, `-mark`, `-mark-display` | the day separator's label as a pill with a small mark | bare text |
|
|
671
|
+
| `--agents-call-marker`, `-fg`, `-shadow`, `-height`, `-padding`, `-weight`, `-icon-bg`, `-icon-fg`, `-started-bg`, `-started-fg`, `-meta`, `-meta-weight` | the call marker in the thread ("voice call started · 10:12") | the raised surface pill with a state badge |
|
|
672
|
+
|
|
673
|
+
A host whose chat sits in a shadowed window sets `--agents-card-shadow` to a hairline (`0 0 0 1px …`): one shadowed
|
|
674
|
+
layer, the cards inside lift by their edge.
|
package/dist/admin.js
CHANGED
|
@@ -12,8 +12,8 @@ import { normalizeDddError, parseDddDateTime } from "@mgamadeus/ddd-web/contract
|
|
|
12
12
|
import { StatusCallout, PageHeader, EntityTabs, DefinitionList, EntityDetailShell, MoreActionsMenu, EntityListPage, StatusCalloutAction, PageToolbar } from "@mgamadeus/ddd-admin-ui/page";
|
|
13
13
|
import { MarkdownPreview } from "@mgamadeus/ddd-admin-ui/markdown";
|
|
14
14
|
import { NoteList, MetricGrid, MetricTile, DeltaText } from "@mgamadeus/ddd-admin-ui/data";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { p as mapWireTraceFileChange, s as mapWireTraceStep, v as mapWireTurnTrace, q as mapWireTraceMessage, t as mapWireTraceTaskPlanItems } from "./chunks/agents-http-trace-mappers-juBx_kw5.js";
|
|
16
|
+
import { ab as describeTraceModelName, o as readTaskPlanCountsOfStep, w as readTaskPlanCounts, r as readTraceMoment, a9 as describeTraceDecisionSite, ad as describeTraceSignal, B as readTraceStepState, a3 as createTraceFormat, as as describeTraceEffort, v as ToolStepGroup, t as TurnMetaLine, F as FileChangesSummary, L as LoadedSkillsDisclosure, an as readTraceStateOfStatus, f as formatTraceClock, am as readTraceRunResultText, V as TerminalBlock, ag as formatShortSha256, k as FileEditBlock, ac as describeTraceMount, e as readTraceFileChangeLetter, aj as readContentFromUnifiedDiff, at as readTraceFileName, X as ToolStepDetail, $ as TraceViewModeSwitch } from "./chunks/content-from-unified-diff-lgH6CejC.js";
|
|
17
17
|
import { FormDialog, FormErrors, FormFieldFrame, FormDrawer, FormActions } from "@mgamadeus/ddd-admin-ui/form";
|
|
18
18
|
import { QuickFilterPills } from "@mgamadeus/ddd-admin-ui/glass";
|
|
19
19
|
const CodeBlock = ({
|