@mgamadeus/ddd-agents 0.11.13 → 0.12.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 (226) hide show
  1. package/README.md +138 -6
  2. package/boundary.json +5 -0
  3. package/dist/admin.js +13712 -0
  4. package/dist/admin.js.map +1 -0
  5. package/dist/chat.js +1627 -109
  6. package/dist/chat.js.map +1 -1
  7. package/dist/chunks/{AgentsConversationClientContext-C4T7g_Qk.js → AgentsConversationClientContext-B_UJSLXU.js} +2 -2
  8. package/dist/chunks/{AgentsConversationClientContext-C4T7g_Qk.js.map → AgentsConversationClientContext-B_UJSLXU.js.map} +1 -1
  9. package/dist/chunks/{ConversationMarkdown-D-aP3Ssl.js → ConversationMarkdown-DlvwT3Qk.js} +5 -4
  10. package/dist/chunks/{ConversationMarkdown-D-aP3Ssl.js.map → ConversationMarkdown-DlvwT3Qk.js.map} +1 -1
  11. package/dist/chunks/{ConversationMessageInputComposerWidgets-7HNAmZE1.js → ConversationMessageInputComposerWidgets-TchR1lPj.js} +6 -6
  12. package/dist/chunks/{ConversationMessageInputComposerWidgets-7HNAmZE1.js.map → ConversationMessageInputComposerWidgets-TchR1lPj.js.map} +1 -1
  13. package/dist/chunks/{VoiceBarsIcon-FhLAcgLG.js → VoiceBarsIcon-y3mgSqbn.js} +4 -4
  14. package/dist/chunks/{VoiceBarsIcon-FhLAcgLG.js.map → VoiceBarsIcon-y3mgSqbn.js.map} +1 -1
  15. package/dist/chunks/{WebSearchResultsConversationWidget-dEq19U7k.js → WebSearchResultsConversationWidget-l9Aek_lG.js} +3 -2
  16. package/dist/chunks/WebSearchResultsConversationWidget-l9Aek_lG.js.map +1 -0
  17. package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js +759 -0
  18. package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js.map +1 -0
  19. package/dist/chunks/{browser-request-interception-ydNOzeUL.js → browser-request-interception-D678IemW.js} +2 -2
  20. package/dist/chunks/{browser-request-interception-ydNOzeUL.js.map → browser-request-interception-D678IemW.js.map} +1 -1
  21. package/dist/chunks/{canvas-reducers-BInd3xNz.js → canvas-reducers-BYArW_Ji.js} +2 -2
  22. package/dist/chunks/{canvas-reducers-BInd3xNz.js.map → canvas-reducers-BYArW_Ji.js.map} +1 -1
  23. package/dist/chunks/{canvas-title-slot-context-BI1PLnPn.js → canvas-title-slot-context-BRGnFzYP.js} +3 -3
  24. package/dist/chunks/{canvas-title-slot-context-BI1PLnPn.js.map → canvas-title-slot-context-BRGnFzYP.js.map} +1 -1
  25. package/dist/chunks/{canvasBodies-CRVh8pCw.js → canvasBodies-BjXypuHf.js} +4 -4
  26. package/dist/chunks/{canvasBodies-CRVh8pCw.js.map → canvasBodies-BjXypuHf.js.map} +1 -1
  27. package/dist/chunks/{canvasStorage-Cr3omZeI.js → canvasStorage-DSspwRMg.js} +2 -2
  28. package/dist/chunks/{canvasStorage-Cr3omZeI.js.map → canvasStorage-DSspwRMg.js.map} +1 -1
  29. package/dist/chunks/content-from-unified-diff-CovnmG2Q.js +2927 -0
  30. package/dist/chunks/content-from-unified-diff-CovnmG2Q.js.map +1 -0
  31. package/dist/chunks/{contract-C18owGKs.js → contract-886XjdID.js} +2 -2
  32. package/dist/chunks/{contract-C18owGKs.js.map → contract-886XjdID.js.map} +1 -1
  33. package/dist/chunks/{conversation-CbWEHPbL.js → conversation-B7-evdj_.js} +4 -4
  34. package/dist/chunks/{conversation-CbWEHPbL.js.map → conversation-B7-evdj_.js.map} +1 -1
  35. package/dist/chunks/{icon-names-Di6c4zLo.js → icon-names-C5PeVvkJ.js} +32 -1
  36. package/dist/chunks/icon-names-C5PeVvkJ.js.map +1 -0
  37. package/dist/chunks/{link-navigation-DRHt6g7U.js → index-DZovGMpG.js} +65 -106
  38. package/dist/chunks/index-DZovGMpG.js.map +1 -0
  39. package/dist/chunks/link-navigation-a_sRfmsj.js +49 -0
  40. package/dist/chunks/link-navigation-a_sRfmsj.js.map +1 -0
  41. package/dist/chunks/{widget-name-resolver-Dq6Ejo7d.js → widget-name-resolver-DS3zH_5W.js} +5 -4
  42. package/dist/chunks/{widget-name-resolver-Dq6Ejo7d.js.map → widget-name-resolver-DS3zH_5W.js.map} +1 -1
  43. package/dist/chunks/{withPollingChangeSubscription-ClyOABgu.js → withPollingChangeSubscription-XvCpjGmd.js} +13 -2
  44. package/dist/chunks/{withPollingChangeSubscription-ClyOABgu.js.map → withPollingChangeSubscription-XvCpjGmd.js.map} +1 -1
  45. package/dist/client-testing.js +5 -5
  46. package/dist/client.js +50 -231
  47. package/dist/client.js.map +1 -1
  48. package/dist/contract.js +5 -5
  49. package/dist/files/i18n-keys.json +18091 -1287
  50. package/dist/files/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.md +3 -3
  51. package/dist/image-render.js +7 -7
  52. package/dist/index.js +62 -61
  53. package/dist/index.js.map +1 -1
  54. package/dist/kit.js +2 -2
  55. package/dist/preview.js +7 -7
  56. package/dist/provider.js +57 -56
  57. package/dist/provider.js.map +1 -1
  58. package/dist/renderer.js +15 -15
  59. package/dist/styles.css +2962 -15
  60. package/dist/types/admin/blocks/CodeBlock.d.ts +28 -0
  61. package/dist/types/admin/blocks/DetailModal.d.ts +34 -0
  62. package/dist/types/admin/blocks/Disclosure.d.ts +25 -0
  63. package/dist/types/admin/blocks/JsonTree.d.ts +18 -0
  64. package/dist/types/admin/blocks/LineDiffView.d.ts +18 -0
  65. package/dist/types/admin/blocks/ProportionBar.d.ts +43 -0
  66. package/dist/types/admin/blocks/TokenFigure.d.ts +14 -0
  67. package/dist/types/admin/blocks/json-tree.d.ts +40 -0
  68. package/dist/types/admin/blocks/line-diff.d.ts +46 -0
  69. package/dist/types/admin/blocks/proportion-bar.d.ts +34 -0
  70. package/dist/types/admin/blocks/series-fill-classes.d.ts +13 -0
  71. package/dist/types/admin/blocks/token-figure.d.ts +8 -0
  72. package/dist/types/admin/connections/AgentConnectionCard.d.ts +21 -0
  73. package/dist/types/admin/connections/AgentConnectionDriveRootSpaces.d.ts +25 -0
  74. package/dist/types/admin/connections/AgentConnectionDriveScopeDialog.d.ts +20 -0
  75. package/dist/types/admin/connections/AgentConnectionDriveSearchFilters.d.ts +34 -0
  76. package/dist/types/admin/connections/AgentConnectionDrivesDrawer.d.ts +39 -0
  77. package/dist/types/admin/connections/AgentConnectionLevelsDrawer.d.ts +27 -0
  78. package/dist/types/admin/connections/AgentConnectionSharingDialog.d.ts +12 -0
  79. package/dist/types/admin/connections/AgentConnectionsPanel.d.ts +97 -0
  80. package/dist/types/admin/connections/AgentConnectionsScreen.d.ts +18 -0
  81. package/dist/types/admin/connections/ConnectDialogs.d.ts +22 -0
  82. package/dist/types/admin/connections/agent-connection-drive-scope.d.ts +112 -0
  83. package/dist/types/admin/connections/agent-connection-drives.d.ts +107 -0
  84. package/dist/types/admin/connections/agent-connection-format.d.ts +82 -0
  85. package/dist/types/admin/connections/agent-connection-oauth.d.ts +122 -0
  86. package/dist/types/admin/connections/agent-connections-api.d.ts +420 -0
  87. package/dist/types/admin/connections/agent-connections-context.d.ts +60 -0
  88. package/dist/types/admin/connections/agent-connections-types.d.ts +447 -0
  89. package/dist/types/admin/connections/connection-logos.d.ts +53 -0
  90. package/dist/types/admin/connections/connection-parts.d.ts +84 -0
  91. package/dist/types/admin/connections/use-agent-connect.d.ts +25 -0
  92. package/dist/types/admin/context/CompactionThresholdBanner.d.ts +13 -0
  93. package/dist/types/admin/context/ContextCompositionPanel.d.ts +27 -0
  94. package/dist/types/admin/context/ContextSegmentList.d.ts +20 -0
  95. package/dist/types/admin/context/SentPayloadPanel.d.ts +37 -0
  96. package/dist/types/admin/context/agent-inspect-context-api.d.ts +53 -0
  97. package/dist/types/admin/context/agent-inspect-context-types.d.ts +98 -0
  98. package/dist/types/admin/context/context-composition-grouping.d.ts +78 -0
  99. package/dist/types/admin/context/context-segment-families.d.ts +18 -0
  100. package/dist/types/admin/context/context-segment-label-texts.d.ts +19 -0
  101. package/dist/types/admin/context/context-segment-labels.d.ts +18 -0
  102. package/dist/types/admin/control-panel/AgentControlPanelScreen.d.ts +71 -0
  103. package/dist/types/admin/control-panel/BudgetsTab.d.ts +13 -0
  104. package/dist/types/admin/control-panel/SettingsTab.d.ts +22 -0
  105. package/dist/types/admin/control-panel/SpacesTab.d.ts +24 -0
  106. package/dist/types/admin/control-panel/StatisticsTab.d.ts +26 -0
  107. package/dist/types/admin/control-panel/TimeSeriesChartCard.d.ts +37 -0
  108. package/dist/types/admin/control-panel/ToolResponseSamplesDrawer.d.ts +22 -0
  109. package/dist/types/admin/control-panel/agent-control-panel-api.d.ts +104 -0
  110. package/dist/types/admin/control-panel/agent-control-panel-types.d.ts +241 -0
  111. package/dist/types/admin/control-panel/budget-meters.d.ts +35 -0
  112. package/dist/types/admin/control-panel/control-panel-statistics.d.ts +49 -0
  113. package/dist/types/admin/control-panel/runtime-settings-form.d.ts +44 -0
  114. package/dist/types/admin/control-panel/time-series-chart.d.ts +54 -0
  115. package/dist/types/admin/conversations/AgentConversationDetailScreen.d.ts +128 -0
  116. package/dist/types/admin/conversations/AgentConversationsScreen.d.ts +60 -0
  117. package/dist/types/admin/conversations/ContextPanel.d.ts +9 -0
  118. package/dist/types/admin/conversations/ConversationActions.d.ts +32 -0
  119. package/dist/types/admin/conversations/ConversationTurns.d.ts +56 -0
  120. package/dist/types/admin/conversations/DebugSwitchBar.d.ts +23 -0
  121. package/dist/types/admin/conversations/DelegationPanel.d.ts +6 -0
  122. package/dist/types/admin/conversations/ModelContextDialog.d.ts +31 -0
  123. package/dist/types/admin/conversations/RequestCompositionRows.d.ts +14 -0
  124. package/dist/types/admin/conversations/RequestsPanel.d.ts +21 -0
  125. package/dist/types/admin/conversations/SandboxPanel.d.ts +42 -0
  126. package/dist/types/admin/conversations/StepDetailDialog.d.ts +19 -0
  127. package/dist/types/admin/conversations/agent-inspect-api.d.ts +259 -0
  128. package/dist/types/admin/conversations/agent-inspect-mappers.d.ts +23 -0
  129. package/dist/types/admin/conversations/agent-inspect-types.d.ts +517 -0
  130. package/dist/types/admin/conversations/conversation-list-export.d.ts +64 -0
  131. package/dist/types/admin/conversations/conversation-list-filters.d.ts +59 -0
  132. package/dist/types/admin/conversations/debug-switches.d.ts +27 -0
  133. package/dist/types/admin/conversations/delegation-swimlanes.d.ts +78 -0
  134. package/dist/types/admin/conversations/header-facts.d.ts +23 -0
  135. package/dist/types/admin/conversations/inspect-format.d.ts +44 -0
  136. package/dist/types/admin/conversations/inspect-parts.d.ts +42 -0
  137. package/dist/types/admin/conversations/inspect-scope.d.ts +92 -0
  138. package/dist/types/admin/conversations/model-call-rows.d.ts +78 -0
  139. package/dist/types/admin/conversations/step-descriptions.d.ts +43 -0
  140. package/dist/types/admin/conversations/touched-files-tree.d.ts +47 -0
  141. package/dist/types/admin/conversations/turn-paging.d.ts +56 -0
  142. package/dist/types/admin/conversations/turn-segments.d.ts +36 -0
  143. package/dist/types/admin/conversations/turn-timeline.d.ts +22 -0
  144. package/dist/types/admin/conversations/use-query-loader.d.ts +8 -0
  145. package/dist/types/admin/period/AdminPeriodControl.d.ts +15 -0
  146. package/dist/types/admin/period/admin-period.d.ts +51 -0
  147. package/dist/types/admin/quality/AgentQualityEvalRunScreen.d.ts +30 -0
  148. package/dist/types/admin/quality/AgentQualityScreen.d.ts +38 -0
  149. package/dist/types/admin/quality/SaveAsEvalCaseDialog.d.ts +27 -0
  150. package/dist/types/admin/quality/agent-quality-api.d.ts +86 -0
  151. package/dist/types/admin/quality/agent-quality-format.d.ts +52 -0
  152. package/dist/types/admin/quality/agent-quality-types.d.ts +161 -0
  153. package/dist/types/admin/schedules/AgentSchedulesPanel.d.ts +43 -0
  154. package/dist/types/admin/schedules/agent-schedules-api.d.ts +116 -0
  155. package/dist/types/admin/schedules/agent-schedules-format.d.ts +25 -0
  156. package/dist/types/admin/schedules/agent-schedules-types.d.ts +113 -0
  157. package/dist/types/admin/shared/AdminHrefLink.d.ts +13 -0
  158. package/dist/types/admin/skills/AgentSkillCatalogScreen.d.ts +51 -0
  159. package/dist/types/admin/skills/SharedBlocksPanel.d.ts +14 -0
  160. package/dist/types/admin/skills/SkillPurposesPanel.d.ts +16 -0
  161. package/dist/types/admin/skills/SkillTreeRowView.d.ts +31 -0
  162. package/dist/types/admin/skills/ToolSchemaDrawer.d.ts +21 -0
  163. package/dist/types/admin/skills/agent-skill-catalog-api.d.ts +89 -0
  164. package/dist/types/admin/skills/agent-skill-catalog-types.d.ts +223 -0
  165. package/dist/types/admin/skills/skill-catalog-colors.d.ts +10 -0
  166. package/dist/types/admin/skills/skill-catalog-tree.d.ts +159 -0
  167. package/dist/types/admin/skills/skill-purpose-texts.d.ts +11 -0
  168. package/dist/types/admin/wire/admin-wire.d.ts +21 -0
  169. package/dist/types/chat/controller/AgentChatController.d.ts +22 -0
  170. package/dist/types/chat/controller/turn-initiators.d.ts +21 -0
  171. package/dist/types/chat/trace/BackgroundTasksList.d.ts +35 -0
  172. package/dist/types/chat/trace/ChangeSetCard.d.ts +34 -0
  173. package/dist/types/chat/trace/ChangedFilesPane.d.ts +33 -0
  174. package/dist/types/chat/trace/ChangedRecordsList.d.ts +34 -0
  175. package/dist/types/chat/trace/ConsentRequestCard.d.ts +23 -0
  176. package/dist/types/chat/trace/ContextRing.d.ts +19 -0
  177. package/dist/types/chat/trace/ConversationChildTrace.d.ts +18 -0
  178. package/dist/types/chat/trace/ConversationTurnTrace.d.ts +48 -0
  179. package/dist/types/chat/trace/EntityChip.d.ts +23 -0
  180. package/dist/types/chat/trace/FileChangesSummary.d.ts +14 -0
  181. package/dist/types/chat/trace/FileEditBlock.d.ts +42 -0
  182. package/dist/types/chat/trace/LoadedSkillsDisclosure.d.ts +16 -0
  183. package/dist/types/chat/trace/QueuedMessageChip.d.ts +17 -0
  184. package/dist/types/chat/trace/RunStatusLine.d.ts +27 -0
  185. package/dist/types/chat/trace/StepKindDetails.d.ts +59 -0
  186. package/dist/types/chat/trace/SubAgentStepGroup.d.ts +53 -0
  187. package/dist/types/chat/trace/TaskPlanPane.d.ts +31 -0
  188. package/dist/types/chat/trace/TaskPlanRow.d.ts +28 -0
  189. package/dist/types/chat/trace/TerminalBlock.d.ts +16 -0
  190. package/dist/types/chat/trace/ThinkingBlock.d.ts +19 -0
  191. package/dist/types/chat/trace/ToolStepDetail.d.ts +49 -0
  192. package/dist/types/chat/trace/ToolStepGroup.d.ts +58 -0
  193. package/dist/types/chat/trace/ToolStepRow.d.ts +52 -0
  194. package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +14 -0
  195. package/dist/types/chat/trace/TurnMetaLine.d.ts +27 -0
  196. package/dist/types/chat/trace/content-from-unified-diff.d.ts +25 -0
  197. package/dist/types/chat/trace/conversation-trace-loader.d.ts +133 -0
  198. package/dist/types/chat/trace/index.d.ts +34 -0
  199. package/dist/types/chat/trace/parse-unified-diff.d.ts +51 -0
  200. package/dist/types/chat/trace/task-plan-counts.d.ts +41 -0
  201. package/dist/types/chat/trace/trace-collect.d.ts +91 -0
  202. package/dist/types/chat/trace/trace-counts.d.ts +21 -0
  203. package/dist/types/chat/trace/trace-format.d.ts +73 -0
  204. package/dist/types/chat/trace/trace-labels.d.ts +60 -0
  205. package/dist/types/chat/trace/trace-parts.d.ts +63 -0
  206. package/dist/types/chat/trace/trace-step-focus.d.ts +12 -0
  207. package/dist/types/chat/trace/trace-types.d.ts +370 -0
  208. package/dist/types/chat/trace/use-conversation-trace.d.ts +47 -0
  209. package/dist/types/client/AgentsConversationClient.d.ts +20 -0
  210. package/dist/types/client/http/agents-http-trace-mappers.d.ts +31 -0
  211. package/dist/types/client/http/agents-http-trace-wire.d.ts +433 -0
  212. package/dist/types/contract/conversation-trace.d.ts +594 -0
  213. package/dist/types/entries/admin.d.ts +85 -0
  214. package/dist/types/entries/chat.d.ts +3 -1
  215. package/dist/types/entries/client.d.ts +2 -0
  216. package/dist/types/entries/contract.d.ts +1 -0
  217. package/dist/types/provider/components/icon-names.d.ts +4 -2
  218. package/dist/types/provider/components/types.d.ts +3 -1
  219. package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-files.d.ts +1 -1
  220. package/dist/voice.js +3 -3
  221. package/dist/widgets.js +6 -6
  222. package/package.json +7 -3
  223. package/public-api.json +1036 -3
  224. package/dist/chunks/WebSearchResultsConversationWidget-dEq19U7k.js.map +0 -1
  225. package/dist/chunks/icon-names-Di6c4zLo.js.map +0 -1
  226. package/dist/chunks/link-navigation-DRHt6g7U.js.map +0 -1
package/README.md CHANGED
@@ -13,12 +13,12 @@ npm install @mgamadeus/ddd-agents@~0.1.1 @types/google.maps@^3.55.0 apexcharts@^
13
13
  ```
14
14
 
15
15
  The second part is the peer set (React 19 assumed present). `@mgamadeus/ddd-admin-ui`, `@mgamadeus/ddd-web` and
16
- `lucide-react` are optional peers: only `/voice/admin` loads them.
16
+ `lucide-react` are optional peers: only `/voice/admin` and `/admin` load them.
17
17
  `react-apexcharts` stays below 1.6.0: from 1.6.0 it needs apexcharts 4, the package draws with apexcharts 3.
18
18
  The agent skills come with the Composer package (`vendor/mgamadeus/ddd-agents/.claude/skills`), not with this one.
19
19
 
20
20
  Entries: `@mgamadeus/ddd-agents` (provider and setup), `/provider` (the provider alone), `/chat`, `/renderer`, `/widgets`, `/kit`, `/contract`,
21
- `/client`, `/client/testing`, `/preview`, `/image-render`, `/ui`, `/voice`, `/voice/admin`, and the stylesheet `@mgamadeus/ddd-agents/styles.css`
21
+ `/client`, `/client/testing`, `/preview`, `/image-render`, `/ui`, `/voice`, `/voice/admin`, `/admin`, and the stylesheet `@mgamadeus/ddd-agents/styles.css`
22
22
  (import it once). Non-code files (widget documentation, preview fixtures, contracts, the node schema, the
23
23
  sandbox frame, SCSS tokens) are exported one subpath per file at their path below `src`. React 19 and the libraries listed under `peerDependencies` come from the application.
24
24
 
@@ -184,7 +184,8 @@ const uiClient = useAgentUIClient({
184
184
  Every interface text of the package goes through `AgentsEnvironment.texts.translate(key, replacements, context)`; the key
185
185
  is the English text with `%placeholders%`, `context` the plural category (`one` / `other`) where a count decides.
186
186
  `@mgamadeus/ddd-agents/i18n-keys.json` lists every key: `key`, `defaultText`, `placeholders`, `contexts`, `usedIn` (the
187
- source files). Set `texts` app-wide (`setAgentsEnvironment`) or per subtree (`<AgentsProvider environment={{ texts }}>`).
187
+ source files). A counted text of the trace blocks has one key per form, each asked with its category
188
+ (`%count% step` with `one`, `%count% steps` with `other`), so the English default reads right as it is. Set `texts` app-wide (`setAgentsEnvironment`) or per subtree (`<AgentsProvider environment={{ texts }}>`).
188
189
 
189
190
  ```ts
190
191
  setAgentsEnvironment({
@@ -194,7 +195,7 @@ setAgentsEnvironment({
194
195
 
195
196
  Icon-only buttons carry their accessible name through the same function (the composer's send button: `Send message`;
196
197
  the scroll-to-latest button beside it: `Scroll to the latest message`). In the package, `pnpm i18n-keys` rewrites the manifest from the sources; the build and the specs fail when it is stale. A
197
- key the generator cannot see as a literal is wrapped in `textKey("…")`. The admin screens of `/voice/admin` are the one
198
+ key the generator cannot see as a literal is wrapped in `textKey("…")`. The admin screens of `/voice/admin` and `/admin` are the
198
199
  exception to the first sentence: they ask the text function of `@mgamadeus/ddd-admin-ui` (see there); the manifest lists
199
200
  their keys with their contexts.
200
201
 
@@ -214,7 +215,7 @@ their keys with their contexts.
214
215
 
215
216
  ## Drive file cards (`DriveFiles`)
216
217
 
217
- The widget `DriveFiles` (written by the tool `showDriveFiles`) shows files of a drive store as cards: name, type, size,
218
+ The widget `DriveFiles` (written by the tool `showFiles`) shows files of a drive store as cards: name, type, size,
218
219
  date, a thumbnail, open (an office file opens its PDF twin of the same name, else it only downloads), download and a
219
220
  link to the file's place in the host's drive screen. The block names a store and references only; the cards are read
220
221
  through the source the host registers once, before the first chat:
@@ -288,6 +289,57 @@ overflowing horizontally (`box-sizing: border-box`, the split clipped with `over
288
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
289
290
  the thread sets that variable on `[data-agents-chat-scroll]` or through its own `chatAreaClassName`.
290
291
 
292
+ ## The trace of a turn in the chat (`TurnTrace`)
293
+
294
+ What the agent did between a message and its answer, as calm rows under the message that started the turn. `AgentChat`
295
+ mounts the host's `TurnTrace` component after every turn-starting message (`AgentChatTurnTraceProps`: `conversationId`,
296
+ `turnMessageId`, `phase` `"live"` | `"done"`, `isCompact`); `showsQueuedMessages` marks a message that waits behind the
297
+ running turn. `ConversationTurnTrace` is the ready-made trace for that slot:
298
+
299
+ ```tsx
300
+ const TurnTrace = (props: AgentChatTurnTraceProps) => (
301
+ <ConversationTurnTrace {...props} client={client} viewMode={viewMode} host={traceHost} isDebugAllowed={mayDebug}
302
+ onOpenContext={mayDebug ? openContextDialog : undefined} buildAnalysisHref={buildAnalysisHref} />
303
+ );
304
+ <AgentChat TurnTrace={TurnTrace} showsQueuedMessages … />
305
+ ```
306
+
307
+ Pass one stable component (what changes comes through a context of the host), or every render mounts the traces anew.
308
+
309
+ - **View modes** (`TraceViewMode`, switched with `TraceViewModeSwitch`; the host stores the choice). `summary`: one
310
+ line "12 steps · 48 s" that opens the steps. `normal`: the steps folded, each with its narrated line; a row opens to
311
+ its terminal, its file edits and its plain facts (tool, effect, state, time). `verbose` (only with `isDebugAllowed`,
312
+ else shown as `normal`; reads the trace at the `DEBUG` level): every step open to its details — tool names,
313
+ arguments and result (those of the real tool for a call through `call_tool`), a model call with its figures and
314
+ "Context of this call", a decision with its kind, status, result and what was sent and answered, a compaction, a
315
+ signal, a widget's payload, the loaded skills with their cause — and the turn's figures (`TurnMetaLine`). Decisions,
316
+ model calls, compactions and signals are verbose-only.
317
+ - **While the turn runs** (`phase="live"`): the group stands open, steps arrive one line each, `RunStatusLine` shows
318
+ the clock and Stop, the task plan stands above (its items when the trace names them). A host that also shows an
319
+ activity ticker keeps one source of live step rows: the trace in `normal` and `verbose`, the ticker in `summary`.
320
+ - **Reads.** All traces of a conversation share one `ConversationTraceLoader` (`getConversationTraceLoader`): the
321
+ turns on screen are read in windows, a live turn is followed with `afterMessageIndex`, a new message reads again.
322
+ A failed read renders nothing; the chat is never broken by its trace. `useConversationTraces` gives a pane beside
323
+ the chat the same turns (`collectTraceFileChangesByTurn`, `collectTraceBackgroundTasks`); `ConversationChildTrace`
324
+ reads the steps of a sub-agent when its row opens.
325
+ - **Port functions** (optional members of `AgentsConversationClient`; the HTTP client has them, an adapter maps its
326
+ answers with `mapWireTurnTraces`, `mapWireFileChangeDiff`, `mapWireContextComposition`, `mapWireTurnStop` of `/client`):
327
+ `getTurnTraces(conversationId, { level, fromTurnNumber, limit, afterMessageIndex })`, `getFileChangeDiff(fileChangeId)`
328
+ (the whole diff of a change whose row carries none or only its start), `stopTurn(conversationId)` (Stop of the
329
+ status line; without it no button), `getMessageContextComposition(conversationId, messageId)` (the context ring).
330
+ - **What a host supplies** (`TraceHostBindings`, all optional): `linkComponent`; `describeEntity` /
331
+ `buildEntityHref(argumentName, id)` for the chips of the records a step names; `describeMount(mountKind, mountName,
332
+ driveSpaceId)`; `formatCost`; `openFileInViewer` with `canOpenFileInViewer`; `buildChildConversationHref` or
333
+ `openChildConversation`; `buildSandboxHref(conversationId, { path?, fileChangeId? })` — the screen of the
334
+ conversation's sandbox: linked from the head of a turn that ran a command or changed a file and from every changed
335
+ file (`FileEditBlock`, `ChangedFilesPane`); `openModelCallContext(messageId)` (default: `onOpenContext`) for
336
+ "Context of this call", called with `modelCall.contextMessageId`; `renderStepExtras`. Beside them on
337
+ `ConversationTurnTrace`: the debug gate `isDebugAllowed`, `viewMode`, `onOpenContext(messageId)` ("What the model
338
+ saw" on the turn's figures) and `buildAnalysisHref(conversationId, turnMessageId)` ("Open in analysis").
339
+
340
+ The step fields follow the server's trace (`contract/conversation-trace.ts`); every field is optional on the wire, so a
341
+ server that sends less shows less: a decision known only by its stored event still names its site and status.
342
+
291
343
  ## Voice (`/voice`, `/voice/admin`)
292
344
 
293
345
  The voice chat with the agent in the browser window (WebRTC straight to the voice provider) and the agent ringing the
@@ -395,7 +447,7 @@ not.
395
447
  ### The admin screens of the calls (`/voice/admin`)
396
448
 
397
449
  The calls an administrator may read, on the blocks of `@mgamadeus/ddd-admin-ui`: the RTK Query client of the admin
398
- call routes (`AdminAgentVoiceCallsTrait`) and two screens. This is the one entry that loads the optional peers
450
+ call routes (`AdminAgentVoiceCallsTrait`) and two screens. This entry and `/admin` are the two that load the optional peers
399
451
  `@mgamadeus/ddd-admin-ui` (≥ 0.7.0), `@mgamadeus/ddd-web` (≥ 0.13.0) and `lucide-react`; an application that uses the
400
452
  other entries installs none of them (`boundary.json` names the three for this entry, `scripts/check-package.mjs` fails
401
453
  the build when another entry loads one).
@@ -450,6 +502,86 @@ export const agentVoiceAdminApi = createAgentVoiceAdminApi({ baseApi: adminApi,
450
502
  `node_modules/@mgamadeus/ddd-agents/dist/voice-admin.js`. They use neither the package stylesheet nor
451
503
  `AgentVoiceCallProvider`.
452
504
 
505
+ ## The agent's admin views (`/admin`)
506
+
507
+ What an administrator reads about the agent, on the blocks of `@mgamadeus/ddd-admin-ui`: the context of one model call
508
+ (what the request was made of, in tokens), the request body as it was sent, and the skill catalog (what every skill,
509
+ tool package and tool adds to a turn). Like `/voice/admin` the entry loads the optional peers `@mgamadeus/ddd-admin-ui`,
510
+ `@mgamadeus/ddd-web` and `lucide-react`, needs `AdminUiProvider` above it and translates through the admin UI's text
511
+ function (`useTranslate().t`, the marker `m`); its keys are in `i18n-keys.json` with `usedIn` below `src/admin/` and the
512
+ contexts `agent-context`, `detail-view`, `payload-view`, `skill-catalog`, `tool-schema`, `tool-schema-part`. Tailwind
513
+ has to scan `node_modules/@mgamadeus/ddd-agents/dist/admin.js`.
514
+
515
+ ```tsx
516
+ import {
517
+ AgentSkillCatalogScreen,
518
+ ContextCompositionPanel,
519
+ SentPayloadPanel,
520
+ createAgentInspectContextApi,
521
+ createAgentSkillCatalogApi,
522
+ } from "@mgamadeus/ddd-agents/admin";
523
+
524
+ export const agentInspectContextApi = createAgentInspectContextApi({ baseApi: adminApi, apiPrefix: "/api/admin/ai/conversations" });
525
+ export const agentSkillCatalogApi = createAgentSkillCatalogApi({ baseApi: adminApi, apiPrefix: "/api/admin/ai/skillCatalog" });
526
+
527
+ <ContextCompositionPanel api={agentInspectContextApi} conversationId={conversationId} messageId={messageId} showCompactionThreshold />;
528
+ <SentPayloadPanel api={agentInspectContextApi} conversationId={conversationId} messageId={messageId} comparableMessages={otherModelCalls} />;
529
+ <AgentSkillCatalogScreen api={agentSkillCatalogApi} selectedToolName={toolName} onSelectTool={setToolName} />;
530
+ ```
531
+
532
+ **Context of a model call**
533
+
534
+ - `createAgentInspectContextApi({ baseApi, apiPrefix })` injects two queries (once per base api and prefix):
535
+ `useContextCompositionQuery({ conversationId, messageId })` on
536
+ `GET <prefix>/{conversationId}/messages/{messageId}/contextComposition` → `{ contextComposition, compactionThreshold? }`
537
+ and `useSentPayloadQuery({ conversationId, messageId })` on `…/sentPayload` → `{ payload, isStoredPayload }` (the
538
+ routes of `AdminAgentConversationsInspectTrait`). `createStaticAgentInspectContextApi({ contextComposition?,
539
+ sentPayload? })` answers fixed data for reviews and tests.
540
+ - `ContextCompositionPanel` (`api`, `conversationId`, `messageId`, `showCompactionThreshold?`, `renderMarkdown?`): a
541
+ segmented bar with one part per structural segment (system parts, tool schema blocks) and one part per role of the
542
+ message tail (user messages, assistant replies, tool calls, tool results, signals; `×N` in the legend), a legend with
543
+ tokens and shares, the line "N segments (M raw messages) · ≈T tokens", the mark "Reconstructed" or "As sent", and
544
+ "View whole context". A click on a part or a legend entry opens its segments in a dialog: formatted (Markdown through
545
+ `renderMarkdown`, else the admin UI's `MarkdownPreview` in its untrusted pipeline; a text that parses as a JSON object
546
+ or array as a tree), raw, and copy. `showCompactionThreshold` adds the conversation's compaction threshold above the
547
+ bar (threshold, where it comes from, how full the context is, whether compaction is due).
548
+ - A segment is labelled by the `label` the backend sends; without one the panel builds the label from the segment's
549
+ type and provenance (`AGENT_CONTEXT_SEGMENT_TYPE_LABELS`, one entry per case of the backend's segment type enum). A
550
+ type the package does not know yet shows under its own name in the family of the signals.
551
+ - Colours: every segment type belongs to one of ten families (`AGENT_CONTEXT_SEGMENT_TYPE_FAMILIES`); a family has one
552
+ fill slot of `SERIES_FILL_CLASS_NAMES`, neighbours of one family step through its three strengths. The slots read the
553
+ host's categorical chart colours `--series-1` … `--series-8` and fall back to the admin UI's colour roles where a host
554
+ defines none; text never wears a series colour.
555
+ - `SentPayloadPanel` (`api`, `conversationId`, `messageId`, `comparableMessages?: { messageId, label }[]`,
556
+ `defaultMode?`, `defaultComparedMessageId?`): the request body as a JSON tree or as text, with copy, and the mark
557
+ "Stored payload" or "Rebuilt payload". With `comparableMessages` it offers a line diff against the payload of another
558
+ model call (lines only in this call are removed lines, lines only in the other one added lines; unchanged runs fold).
559
+ A payload may arrive as an object or as JSON text.
560
+
561
+ **Skill catalog**
562
+
563
+ - `createAgentSkillCatalogApi({ baseApi, apiPrefix })` injects three queries: `useSkillCatalogQuery()` on
564
+ `GET <prefix>/skills` → `{ catalog }`, `useSkillToolDocumentationQuery({ toolName })` on
565
+ `GET <prefix>/tools/{toolName}` → `{ documentation }` and `useSkillSharedBlocksQuery()` on `GET <prefix>/sharedBlocks`
566
+ → `{ sharedBlocks }` (the routes of `AdminAgentSkillCatalogTrait`). `createStaticAgentSkillCatalogApi({ skills?,
567
+ tool?, sharedBlocks? })` answers fixed data.
568
+ - `AgentSkillCatalogScreen` (`api`, `title?`, `description?`, `headerActions?`, `selectedToolName?`, `onSelectTool?`,
569
+ `renderMarkdown?`): the totals (general, purpose-bound, all), the general skills by namespace group (collapsible, the
570
+ ungrouped ones last), the purpose-bound skills by purpose (with what the purpose preloads and may load), per skill its
571
+ catalog line, total and a two-colour bar (instructions, tool definitions), its packages and tools, sub-skills nested
572
+ under their root, a search over skills, packages and tools, the shared blocks, and a side sheet per tool: token
573
+ breakdown (description, each parameter, envelope, `$defs`), the parameter table and the wire schema as the model
574
+ receives it. With `selectedToolName` and `onSelectTool` the host keeps the open tool (in the URL, for example).
575
+ - The keyed maps of the answer (`parameters`, `defs`, `variants`) may arrive as an object or, when empty, as `[]`;
576
+ `parameterTokens: [{ name, tokens }]` is read when present. The pure helpers (`buildSkillNamespaceSections`,
577
+ `buildSkillPurposeSections`, `filterSkillTreeRows`, `buildSkillToolTokenParts`, `buildSkillToolParameterRows`, …) are
578
+ exported for hosts that draw their own view.
579
+
580
+ **Generic blocks** (no agent in them; candidates for `@mgamadeus/ddd-admin-ui`): `ProportionBar` with
581
+ `computeProportionShares`, `JsonTree`, `CodeBlock`, `DetailModal`, `Disclosure`, `TokenFigure`, `LineDiffView` with
582
+ `diffLines` (a line diff by longest common subsequence; above `maximumCells` it lists removed then added lines and says
583
+ so) and `foldEqualLines`.
584
+
453
585
  ## Stylesheet and theme
454
586
 
455
587
  - The package's root rules (`:root` variables, the image render's `html, body` reset) sit in the cascade layer
package/boundary.json CHANGED
@@ -8,6 +8,11 @@
8
8
  "@mgamadeus/ddd-admin-ui",
9
9
  "@mgamadeus/ddd-web",
10
10
  "lucide-react"
11
+ ],
12
+ "./admin": [
13
+ "@mgamadeus/ddd-admin-ui",
14
+ "@mgamadeus/ddd-web",
15
+ "lucide-react"
11
16
  ]
12
17
  }
13
18
  }