@mgamadeus/ddd-agents 0.11.13 → 0.13.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 (227) hide show
  1. package/README.md +138 -6
  2. package/boundary.json +5 -0
  3. package/dist/admin.js +13839 -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 +18277 -1298
  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 +105 -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 +138 -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/SkillLoadSourcesPanel.d.ts +20 -0
  161. package/dist/types/admin/skills/SkillPurposesPanel.d.ts +16 -0
  162. package/dist/types/admin/skills/SkillTreeRowView.d.ts +31 -0
  163. package/dist/types/admin/skills/ToolSchemaDrawer.d.ts +21 -0
  164. package/dist/types/admin/skills/agent-skill-catalog-api.d.ts +101 -0
  165. package/dist/types/admin/skills/agent-skill-catalog-types.d.ts +259 -0
  166. package/dist/types/admin/skills/skill-catalog-colors.d.ts +10 -0
  167. package/dist/types/admin/skills/skill-catalog-tree.d.ts +159 -0
  168. package/dist/types/admin/skills/skill-purpose-texts.d.ts +11 -0
  169. package/dist/types/admin/wire/admin-wire.d.ts +21 -0
  170. package/dist/types/chat/controller/AgentChatController.d.ts +22 -0
  171. package/dist/types/chat/controller/turn-initiators.d.ts +21 -0
  172. package/dist/types/chat/trace/BackgroundTasksList.d.ts +35 -0
  173. package/dist/types/chat/trace/ChangeSetCard.d.ts +34 -0
  174. package/dist/types/chat/trace/ChangedFilesPane.d.ts +33 -0
  175. package/dist/types/chat/trace/ChangedRecordsList.d.ts +34 -0
  176. package/dist/types/chat/trace/ConsentRequestCard.d.ts +23 -0
  177. package/dist/types/chat/trace/ContextRing.d.ts +19 -0
  178. package/dist/types/chat/trace/ConversationChildTrace.d.ts +18 -0
  179. package/dist/types/chat/trace/ConversationTurnTrace.d.ts +48 -0
  180. package/dist/types/chat/trace/EntityChip.d.ts +23 -0
  181. package/dist/types/chat/trace/FileChangesSummary.d.ts +14 -0
  182. package/dist/types/chat/trace/FileEditBlock.d.ts +42 -0
  183. package/dist/types/chat/trace/LoadedSkillsDisclosure.d.ts +16 -0
  184. package/dist/types/chat/trace/QueuedMessageChip.d.ts +17 -0
  185. package/dist/types/chat/trace/RunStatusLine.d.ts +27 -0
  186. package/dist/types/chat/trace/StepKindDetails.d.ts +59 -0
  187. package/dist/types/chat/trace/SubAgentStepGroup.d.ts +53 -0
  188. package/dist/types/chat/trace/TaskPlanPane.d.ts +31 -0
  189. package/dist/types/chat/trace/TaskPlanRow.d.ts +28 -0
  190. package/dist/types/chat/trace/TerminalBlock.d.ts +16 -0
  191. package/dist/types/chat/trace/ThinkingBlock.d.ts +19 -0
  192. package/dist/types/chat/trace/ToolStepDetail.d.ts +49 -0
  193. package/dist/types/chat/trace/ToolStepGroup.d.ts +58 -0
  194. package/dist/types/chat/trace/ToolStepRow.d.ts +52 -0
  195. package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +14 -0
  196. package/dist/types/chat/trace/TurnMetaLine.d.ts +27 -0
  197. package/dist/types/chat/trace/content-from-unified-diff.d.ts +25 -0
  198. package/dist/types/chat/trace/conversation-trace-loader.d.ts +133 -0
  199. package/dist/types/chat/trace/index.d.ts +34 -0
  200. package/dist/types/chat/trace/parse-unified-diff.d.ts +51 -0
  201. package/dist/types/chat/trace/task-plan-counts.d.ts +41 -0
  202. package/dist/types/chat/trace/trace-collect.d.ts +91 -0
  203. package/dist/types/chat/trace/trace-counts.d.ts +21 -0
  204. package/dist/types/chat/trace/trace-format.d.ts +73 -0
  205. package/dist/types/chat/trace/trace-labels.d.ts +60 -0
  206. package/dist/types/chat/trace/trace-parts.d.ts +63 -0
  207. package/dist/types/chat/trace/trace-step-focus.d.ts +12 -0
  208. package/dist/types/chat/trace/trace-types.d.ts +370 -0
  209. package/dist/types/chat/trace/use-conversation-trace.d.ts +47 -0
  210. package/dist/types/client/AgentsConversationClient.d.ts +20 -0
  211. package/dist/types/client/http/agents-http-trace-mappers.d.ts +31 -0
  212. package/dist/types/client/http/agents-http-trace-wire.d.ts +433 -0
  213. package/dist/types/contract/conversation-trace.d.ts +594 -0
  214. package/dist/types/entries/admin.d.ts +86 -0
  215. package/dist/types/entries/chat.d.ts +3 -1
  216. package/dist/types/entries/client.d.ts +2 -0
  217. package/dist/types/entries/contract.d.ts +1 -0
  218. package/dist/types/provider/components/icon-names.d.ts +4 -2
  219. package/dist/types/provider/components/types.d.ts +3 -1
  220. package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-files.d.ts +1 -1
  221. package/dist/voice.js +3 -3
  222. package/dist/widgets.js +6 -6
  223. package/package.json +7 -3
  224. package/public-api.json +1047 -3
  225. package/dist/chunks/WebSearchResultsConversationWidget-dEq19U7k.js.map +0 -1
  226. package/dist/chunks/icon-names-Di6c4zLo.js.map +0 -1
  227. package/dist/chunks/link-navigation-DRHt6g7U.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from "react";
2
+ import type { DetailModalView } from "../blocks/DetailModal";
3
+ import type { AgentContextSegmentView } from "./context-composition-grouping";
4
+ /** How many segments the list draws before "Show more" (a whole context can hold hundreds of messages). */
5
+ export declare const CONTEXT_SEGMENT_LIST_WINDOW_SIZE = 25;
6
+ export interface ContextSegmentListProps {
7
+ segments: readonly AgentContextSegmentView[];
8
+ /** `formatted`: markdown, or a tree for a text that is a JSON object or array. `raw`: the text as it is. */
9
+ view: DetailModalView;
10
+ /** Draws a markdown text; default the admin UI's markdown preview in its mode for texts of unknown origin. */
11
+ renderMarkdown?: (source: string) => ReactNode;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Segments of a model call's context one below the other, each under its colour mark, label and token count (and the
16
+ * variants a loaded-skills segment was selected by). The text is prose (markdown) or JSON (a tree); `raw` shows it
17
+ * unchanged. Texts come from prompts, tools and users: markdown is drawn by the renderer for texts of unknown origin,
18
+ * JSON as text nodes.
19
+ */
20
+ export declare const ContextSegmentList: ({ segments, view, renderMarkdown, className }: ContextSegmentListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import type { AgentInspectContextApi } from "./agent-inspect-context-api";
2
+ /** Another model call the payload can be compared with. */
3
+ export interface SentPayloadComparableMessage {
4
+ messageId: number | string;
5
+ /** How the picker names it ("Turn 4, call 2"), already translated. */
6
+ label: string;
7
+ }
8
+ export type SentPayloadPanelMode = "tree" | "raw" | "diff";
9
+ export interface SentPayloadPanelProps {
10
+ /** `createAgentInspectContextApi(…)` of the host. */
11
+ api: AgentInspectContextApi;
12
+ conversationId: number | string;
13
+ messageId: number | string;
14
+ /** The other model calls of the conversation; with at least one the panel offers the diff mode. */
15
+ comparableMessages?: readonly SentPayloadComparableMessage[];
16
+ /** The mode shown first (default `tree`). */
17
+ defaultMode?: SentPayloadPanelMode;
18
+ /** The message compared with at first, one of `comparableMessages`. */
19
+ defaultComparedMessageId?: number | string;
20
+ /**
21
+ * For a host that draws the mode switch, the origin and the copy action itself (the request drawer of the
22
+ * conversation detail): the panel shows only the content of `defaultMode` and, in the diff, the call it compares with.
23
+ */
24
+ isEmbedded?: boolean;
25
+ className?: string;
26
+ }
27
+ /** The payload as a value: an object as it is, a JSON text parsed, anything else unchanged. */
28
+ export declare const readSentPayloadValue: (payload: unknown) => unknown;
29
+ /** The payload as indented JSON text (a text that is not JSON stays as it is): what Raw shows, Copy writes and the diff compares. */
30
+ export declare const formatSentPayloadText: (payload: unknown) => string;
31
+ /**
32
+ * The request body of one model call: as a tree, as raw JSON, or as a line diff against another model call of the
33
+ * conversation. A badge says whether this is the payload stored when the call was made or one rebuilt from the stored
34
+ * rows and the current state. The diff compares the two indented JSON texts line by line: `−` marks a line only this
35
+ * call sent, `+` a line only the other call sent.
36
+ */
37
+ export declare const SentPayloadPanel: ({ api, conversationId, messageId, comparableMessages, defaultMode, defaultComparedMessageId, isEmbedded, className, }: SentPayloadPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { type ApiQueryHook, type InjectableBaseApi, type InjectedRequest, type StaticQueryFailure } from "@mgamadeus/ddd-admin-ui/logic/pure";
2
+ import type { AgentContextCompositionResponse, AgentInspectMessageArg, AgentSentPayloadResponse } from "./agent-inspect-context-types";
3
+ /** The cache tag type of the context reads (ids `COMPOSITION`, `PAYLOAD`). */
4
+ export declare const AGENT_INSPECT_CONTEXT_TAG = "AdminUiAgentInspectContext";
5
+ /** The hooks `createAgentInspectContextApi` returns; `ContextCompositionPanel` and `SentPayloadPanel` take them as `api`. */
6
+ export interface AgentInspectContextApi {
7
+ /** `GET /{conversationId}/messages/{messageId}/contextComposition`: the segments of that message's model call. */
8
+ useContextCompositionQuery: ApiQueryHook<AgentInspectMessageArg, AgentContextCompositionResponse>;
9
+ /** `GET /{conversationId}/messages/{messageId}/sentPayload`: the request body of that message's model call. */
10
+ useSentPayloadQuery: ApiQueryHook<AgentInspectMessageArg, AgentSentPayloadResponse>;
11
+ }
12
+ export interface CreateAgentInspectContextApiOptions {
13
+ /** The host's RTK Query api (`createApi` with the React hooks module). */
14
+ baseApi: InjectableBaseApi;
15
+ /** Where the host mounts the conversation inspection routes, without a trailing slash (`/api/admin/ai/conversations`). */
16
+ apiPrefix: string;
17
+ }
18
+ /** The request of every operation, on `apiPrefix`. Pure: no RTK runtime. */
19
+ export declare const buildAgentInspectContextRequests: (apiPrefix: string) => {
20
+ contextComposition: (arg: AgentInspectMessageArg) => InjectedRequest;
21
+ sentPayload: (arg: AgentInspectMessageArg) => InjectedRequest;
22
+ };
23
+ /** The operations as injected. */
24
+ export declare const agentInspectContextEndpointDefinitions: (apiPrefix: string) => {
25
+ readonly adminUiAgentContextComposition: {
26
+ readonly kind: "query";
27
+ readonly request: (arg: AgentInspectMessageArg) => InjectedRequest;
28
+ readonly providesTags: readonly [{
29
+ readonly type: "AdminUiAgentInspectContext";
30
+ readonly id: "COMPOSITION";
31
+ }];
32
+ };
33
+ readonly adminUiAgentSentPayload: {
34
+ readonly kind: "query";
35
+ readonly request: (arg: AgentInspectMessageArg) => InjectedRequest;
36
+ readonly providesTags: readonly [{
37
+ readonly type: "AdminUiAgentInspectContext";
38
+ readonly id: "PAYLOAD";
39
+ }];
40
+ };
41
+ };
42
+ /**
43
+ * Injects the context reads into the host's RTK Query api and returns their hooks. Call it once at module scope:
44
+ * `export const agentInspectContextApi = createAgentInspectContextApi({ baseApi: adminApi, apiPrefix: "/api/admin/ai/conversations" });`
45
+ */
46
+ export declare const createAgentInspectContextApi: ({ baseApi, apiPrefix }: CreateAgentInspectContextApiOptions) => AgentInspectContextApi;
47
+ /** Fixed answers of a `createStaticAgentInspectContextApi`; a query without one stays loading. */
48
+ export interface StaticAgentInspectContextData {
49
+ contextComposition?: (arg: AgentInspectMessageArg) => AgentContextCompositionResponse | StaticQueryFailure | undefined;
50
+ sentPayload?: (arg: AgentInspectMessageArg) => AgentSentPayloadResponse | StaticQueryFailure | undefined;
51
+ }
52
+ /** An `AgentInspectContextApi` answering fixed payloads, without a store or a request (previews, tests, reviews). */
53
+ export declare const createStaticAgentInspectContextApi: (data: StaticAgentInspectContextData) => AgentInspectContextApi;
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Every kind of segment a model call's context is made of, as the backend names them
3
+ * (`AgentContextSegmentType`): the parts of the composed system message in compose order, the two tool-schema blocks,
4
+ * then the kinds of the wire message array.
5
+ */
6
+ export declare const AGENT_CONTEXT_SEGMENT_TYPES: readonly ["BASE_PROMPT", "SUB_AGENT_DIRECTIVE", "PURPOSE_DIRECTIVE", "CONVERSATION_SUBJECT", "SCHEDULED_RUN_DIRECTIVE", "TIME_RULE", "OWNER_PRESENCE", "MEMORY_DIRECTIVES", "EPISODIC_HISTORY", "DAY_CONTEXT", "LOCAL_SITUATION", "PRODUCT_CAPABILITIES", "RESTRICTED_CAPABILITIES", "AI_BUDGET_AWARENESS", "SKILL_CATALOG", "LOADED_SKILLS", "QUERY_OPTIONS_SYNTAX", "SHARED_PARAMS", "ALREADY_FETCHED_READS", "TASK_PLAN", "ANSWER_CONTRACT", "COMPACTION_SUMMARY", "META_TOOL_SCHEMAS", "TOOL_SCHEMAS", "USER_MESSAGE", "ASSISTANT_MESSAGE", "TOOL_CALL", "TOOL_RESULT", "SIGNAL", "REPLY_LANGUAGE_CUE"];
7
+ export type AgentContextSegmentType = (typeof AGENT_CONTEXT_SEGMENT_TYPES)[number];
8
+ /** A compaction cover node as far as a segment's label reads it; the node carries more. */
9
+ export interface AgentContextCompactionNode {
10
+ level?: number | null;
11
+ coveredFromMessageIndex?: number | null;
12
+ coveredToMessageIndex?: number | null;
13
+ [property: string]: unknown;
14
+ }
15
+ /**
16
+ * One labelled piece of a model call's context (`AgentContextSegment`). `type` is one of
17
+ * `AGENT_CONTEXT_SEGMENT_TYPES`; a newer backend may send a type this version does not know, which is shown with a
18
+ * neutral colour and its own label.
19
+ */
20
+ export interface AgentContextSegment {
21
+ type: AgentContextSegmentType | (string & {});
22
+ /** The backend's label of the segment (type plus provenance); older backends do not send it. */
23
+ label?: string | null;
24
+ /** The segment's content: a slice of the system text, or the wire JSON of a tool block or a message. */
25
+ text?: string | null;
26
+ tokenCount?: number | null;
27
+ /** True: `tokenCount` is a characters / 4 estimate, shown with `≈`. */
28
+ tokenCountIsEstimate?: boolean | null;
29
+ /** Loaded skills: the conditional skill sections rendered (`Skill.Name[dimension=value]`). */
30
+ skillSectionIds?: string[] | null;
31
+ /** Loaded skills: the variants the sections were selected by (`dimension → value(provenance)`); `[]` when empty. */
32
+ variants?: Record<string, string> | unknown[] | null;
33
+ /** The skills (or tools) the segment carries: loaded skills, offered skills, the tools of a schema block. */
34
+ skillNames?: string[] | null;
35
+ /** Compaction summary: the cover nodes it was rendered from, as a set (`elements`) or a plain list. */
36
+ compactionNodes?: {
37
+ elements?: AgentContextCompactionNode[] | null;
38
+ } | AgentContextCompactionNode[] | null;
39
+ /** A wire message or an already fetched read: the index of the conversation message it comes from. */
40
+ sourceMessageIndex?: number | null;
41
+ /** Purpose directive: the purpose name. */
42
+ purposeName?: string | null;
43
+ /** Purpose directive: the purpose this one inherits its plan from. */
44
+ purposeInheritsFromName?: string | null;
45
+ }
46
+ /** The whole breakdown of one model call (`ModelCallComposition`). */
47
+ export interface AgentModelCallComposition {
48
+ systemSegments?: AgentContextSegment[] | null;
49
+ toolSchemaSegments?: AgentContextSegment[] | null;
50
+ messageSegments?: AgentContextSegment[] | null;
51
+ /** True: the message made no model call (no request snapshot), so there is nothing to show. */
52
+ isUnavailable?: boolean | null;
53
+ /**
54
+ * True: rebuilt from the stored rows and the current prompt, skills and memory, so it may differ from what was sent.
55
+ * False: as sent. Null when unavailable.
56
+ */
57
+ isReconstructed?: boolean | null;
58
+ }
59
+ /** Where a conversation's compaction threshold comes from (`CompactionThresholdBreakdown::SOURCE_*`). */
60
+ export type AgentCompactionThresholdSource = "conversationOverride" | "purposeContextBudget" | "modelEffective" | "defaultFallback";
61
+ /** The compaction threshold in effect for a conversation and how full the context is (`CompactionThresholdBreakdown`). */
62
+ export interface AgentCompactionThreshold {
63
+ thresholdTokens?: number | null;
64
+ source?: AgentCompactionThresholdSource | (string & {}) | null;
65
+ latestContextInputTokens?: number | null;
66
+ isDue?: boolean | null;
67
+ modelName?: string | null;
68
+ modelEffectiveContextTokens?: number | null;
69
+ conversationTriggerTokens?: number | null;
70
+ defaultFallbackTokens?: number | null;
71
+ purposeName?: string | null;
72
+ purposeContextBudgetTokens?: number | null;
73
+ compactionNodeCount?: number | null;
74
+ }
75
+ /** The arguments of both reads: one message of one conversation. */
76
+ export interface AgentInspectMessageArg {
77
+ conversationId: number | string;
78
+ messageId: number | string;
79
+ }
80
+ /**
81
+ * `GET {prefix}/{conversationId}/messages/{messageId}/contextComposition`. The module's routes answer the breakdown as
82
+ * `composition` with the reconstruction mark beside it; an answer that names it `contextComposition` (the mark inside)
83
+ * is read alike. Read the breakdown with `agentContextCompositionOf`, never by field name.
84
+ */
85
+ export interface AgentContextCompositionResponse {
86
+ contextComposition?: AgentModelCallComposition | null;
87
+ composition?: AgentModelCallComposition | null;
88
+ /** The reconstruction mark of an answer that carries it beside `composition`. */
89
+ isReconstructed?: boolean | null;
90
+ compactionThreshold?: AgentCompactionThreshold | null;
91
+ }
92
+ /** `GET {prefix}/{conversationId}/messages/{messageId}/sentPayload`. */
93
+ export interface AgentSentPayloadResponse {
94
+ /** The request body of the model call: an object, or its JSON text. */
95
+ payload?: unknown;
96
+ /** True: the payload stored when the call was made. False: rebuilt from the stored rows and the current state. */
97
+ isStoredPayload?: boolean | null;
98
+ }
@@ -0,0 +1,78 @@
1
+ import type { AgentContextCompositionResponse, AgentContextSegment, AgentModelCallComposition } from "./agent-inspect-context-types";
2
+ import { type AgentContextSegmentFamily } from "./context-segment-families";
3
+ /** The translation context of the role group names. */
4
+ export declare const AGENT_CONTEXT_TEXT_CONTEXT = "agent-context";
5
+ /**
6
+ * The plural name of a role group of the message tail, as an English text key (the panel translates it with the
7
+ * context `AGENT_CONTEXT_TEXT_CONTEXT`). A tail type without an entry (a cue, a task plan) keeps its segment label.
8
+ */
9
+ export declare const AGENT_CONTEXT_TAIL_GROUP_LABELS: Readonly<Record<string, string>>;
10
+ /** The fixed order of the role groups; other tail types follow in the order they first appear. */
11
+ export declare const AGENT_CONTEXT_TAIL_GROUP_ORDER: readonly string[];
12
+ /** One part of the composition bar and its legend entry: a structural segment, or the messages of one role. */
13
+ export interface AgentContextCompositionEntry {
14
+ key: string;
15
+ /** The entry's name: a segment label (shown as it is), or the text key of a role group (`isTextKey`). */
16
+ label: string;
17
+ /** True: `label` is an English text key the view translates (a role group name). */
18
+ isTextKey: boolean;
19
+ /** The segment type the entry stands for. */
20
+ type: string;
21
+ family: AgentContextSegmentFamily;
22
+ /** The fill class of the entry (family hue, stepped within the family). */
23
+ colorClassName: string;
24
+ /** Σ of the tokens of the entry's segments. */
25
+ tokenCount: number;
26
+ /** True when a segment of the entry carries an estimate. */
27
+ isEstimate: boolean;
28
+ /** How many segments the entry holds (above 1 only for a role group of the message tail). */
29
+ segmentCount: number;
30
+ /** True for a part of the message tail (grouped by type). */
31
+ isTailGroup: boolean;
32
+ segments: AgentContextSegment[];
33
+ }
34
+ /**
35
+ * The breakdown an answer of the composition read carries, under either of its two names (`contextComposition`, or
36
+ * `composition` with the reconstruction mark beside it); null for an answer without one. The one place that reads the
37
+ * answer: every panel and summary goes through it.
38
+ */
39
+ export declare const agentContextCompositionOf: (response: AgentContextCompositionResponse | null | undefined) => AgentModelCallComposition | null;
40
+ /** Every segment of the composition in the order the model reads it: system parts, tool schemas, wire messages. */
41
+ export declare const orderedAgentContextSegmentsOf: (composition: AgentModelCallComposition | null | undefined) => AgentContextSegment[];
42
+ /**
43
+ * The parts of the composition bar: one entry per structural segment (system parts, tool-schema blocks) in order, then
44
+ * the message tail grouped by type: the five message roles in their fixed order, then every other type the tail
45
+ * carries. A long conversation therefore stays a handful of entries; a role group names how many messages it holds.
46
+ * Entries of one family take the family's colour steps in turn.
47
+ */
48
+ export declare const buildAgentContextCompositionEntries: (composition: AgentModelCallComposition | null | undefined) => AgentContextCompositionEntry[];
49
+ /** The figures of the line under the bar. */
50
+ export interface AgentContextCompositionSummary {
51
+ /** Every segment: structural ones plus each wire message. */
52
+ segmentCount: number;
53
+ /** The wire messages among them. */
54
+ messageSegmentCount: number;
55
+ totalTokens: number;
56
+ /** True when any segment's count is an estimate (the total is then one too). */
57
+ isEstimate: boolean;
58
+ }
59
+ export declare const summarizeAgentContextComposition: (composition: AgentModelCallComposition | null | undefined) => AgentContextCompositionSummary;
60
+ /** A segment as the detail modal lists it: label, colour, tokens, the text. */
61
+ export interface AgentContextSegmentView {
62
+ key: string;
63
+ label: string;
64
+ colorClassName: string;
65
+ tokenCount: number | null;
66
+ isEstimate: boolean;
67
+ text: string;
68
+ segment: AgentContextSegment;
69
+ }
70
+ /**
71
+ * The segments of the whole composition in reading order, each with the colour of the bar entry it belongs to (a wire
72
+ * message takes its role group's colour), for "View whole context".
73
+ */
74
+ export declare const buildAgentContextSegmentViews: (composition: AgentModelCallComposition | null | undefined, entries?: readonly AgentContextCompositionEntry[]) => AgentContextSegmentView[];
75
+ /** The segments of one bar entry as the detail modal lists them, in order. */
76
+ export declare const buildAgentContextEntrySegmentViews: (entry: AgentContextCompositionEntry) => AgentContextSegmentView[];
77
+ /** The text Copy writes for a list of segments: one segment as it is, several under a heading line each. */
78
+ export declare const agentContextSegmentViewsToText: (views: readonly AgentContextSegmentView[]) => string;
@@ -0,0 +1,18 @@
1
+ import { type SeriesFillSlot } from "../blocks/series-fill-classes";
2
+ import type { AgentContextSegmentType } from "./agent-inspect-context-types";
3
+ /** The colour families of a model call's context: one hue per family, shared by the bar, the legend and the modal. */
4
+ export type AgentContextSegmentFamily = "system" | "skills" | "toolSchemas" | "compaction" | "fetchedReads" | "user" | "assistant" | "toolCalls" | "toolResults" | "signals";
5
+ /**
6
+ * The fill slot of every family, defined once. Eight families take the host's categorical series colours; the tool
7
+ * schemas (a large, constant block) and the platform's own signals and cues take the two neutral slots.
8
+ */
9
+ export declare const AGENT_CONTEXT_FAMILY_FILL_SLOTS: Readonly<Record<AgentContextSegmentFamily, SeriesFillSlot>>;
10
+ /** The family of every segment type. */
11
+ export declare const AGENT_CONTEXT_SEGMENT_TYPE_FAMILIES: Readonly<Record<AgentContextSegmentType, AgentContextSegmentFamily>>;
12
+ /** The family of a segment type; a type this version does not know reads as a signal (neutral). */
13
+ export declare const agentContextSegmentFamilyOf: (type: string) => AgentContextSegmentFamily;
14
+ /**
15
+ * The fill class of a family for its n-th part (0-based): parts of one family that sit side by side take the family's
16
+ * three steps in turn.
17
+ */
18
+ export declare const agentContextFamilyFillClassNameOf: (family: AgentContextSegmentFamily, positionInFamily?: number) => string;
@@ -0,0 +1,19 @@
1
+ import { type TranslateFn } from "@mgamadeus/ddd-admin-ui/i18n";
2
+ import type { AgentContextSegment, AgentContextSegmentType } from "./agent-inspect-context-types";
3
+ import { type AgentContextCompositionEntry } from "./context-composition-grouping";
4
+ /** The translation context of the segment names. */
5
+ export declare const AGENT_CONTEXT_SEGMENT_TEXT_CONTEXT = "agent-context-segment";
6
+ /**
7
+ * The name of every segment type as an English text key (translated with `AGENT_CONTEXT_SEGMENT_TEXT_CONTEXT`). The
8
+ * types that name a count (offered skills, tool schemas) are ICU plural messages filled with `count`; provenance
9
+ * (purpose, loaded skills, compaction nodes) is added in `translateAgentContextSegmentLabel`. The wire carries the
10
+ * type and its provenance only; the backend's own `label` stays the technical name for an unknown type.
11
+ */
12
+ export declare const AGENT_CONTEXT_SEGMENT_TYPE_TEXTS: Readonly<Record<AgentContextSegmentType, string>>;
13
+ /**
14
+ * The name of a segment in the viewer's language: the type's text, its count and its provenance (names stay as they
15
+ * are). A type the admin does not know keeps the backend's label.
16
+ */
17
+ export declare const translateAgentContextSegmentLabel: (segment: AgentContextSegment, t: TranslateFn) => string;
18
+ /** The name of a bar entry in the viewer's language: a role group's text key, else the name of its first segment. */
19
+ export declare const translateAgentContextEntryLabel: (entry: AgentContextCompositionEntry, t: TranslateFn) => string;
@@ -0,0 +1,18 @@
1
+ import { type AgentContextCompactionNode, type AgentContextSegment, type AgentContextSegmentType } from "./agent-inspect-context-types";
2
+ /**
3
+ * The label of every segment type for a backend that does not send `label` yet: the fixed part of what the backend's
4
+ * `AgentContextSegment::getLabel()` writes. The types whose label carries provenance (purpose, skills, compaction
5
+ * nodes) get it added in `agentContextSegmentLabelOf`. Technical names, like the backend's own label (the copied text
6
+ * carries them); the screens show the translated names of `translateAgentContextSegmentLabel`.
7
+ */
8
+ export declare const AGENT_CONTEXT_SEGMENT_TYPE_LABELS: Readonly<Record<AgentContextSegmentType, string>>;
9
+ /** True for a type of `AGENT_CONTEXT_SEGMENT_TYPES`. */
10
+ export declare const isKnownAgentContextSegmentType: (type: string) => type is AgentContextSegmentType;
11
+ /** The cover nodes of a compaction segment, whether they arrive as a set (`elements`) or as a list. */
12
+ export declare const agentContextCompactionNodesOf: (segment: AgentContextSegment) => AgentContextCompactionNode[];
13
+ /** The variants of a segment as `dimension → value`; an empty list (how an empty map arrives) gives none. */
14
+ export declare const agentContextSegmentVariantsOf: (segment: AgentContextSegment) => Record<string, string>;
15
+ /** The label built from the type and the provenance, as the backend builds it; an unknown type is its own label. */
16
+ export declare const buildAgentContextSegmentFallbackLabel: (segment: AgentContextSegment) => string;
17
+ /** The label of a segment: the backend's `label` when it sends one, else the label built from type and provenance. */
18
+ export declare const agentContextSegmentLabelOf: (segment: AgentContextSegment) => string;
@@ -0,0 +1,71 @@
1
+ import { type UrlStateAdapter } from "@mgamadeus/ddd-admin-ui/logic";
2
+ import { type EntityTab } from "@mgamadeus/ddd-admin-ui/page";
3
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
4
+ import { type ReactNode } from "react";
5
+ import type { AgentSchedulesApi } from "../schedules/agent-schedules-api";
6
+ import type { AgentSchedulePlace, AgentSchedulesScope } from "../schedules/agent-schedules-types";
7
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
8
+ import type { AgentControlPanelSpace } from "./agent-control-panel-types";
9
+ import type { AgentTimeSeriesChartRenderer } from "./time-series-chart";
10
+ /** The tabs of the control panel, in order. */
11
+ export declare const AGENT_CONTROL_PANEL_TABS: readonly ["statistics", "settings", "spaces", "schedules", "budgets"];
12
+ export type AgentControlPanelTab = (typeof AGENT_CONTROL_PANEL_TABS)[number];
13
+ /**
14
+ * The URL keys of the screen: the tab, the period (`period`, `from`, `to`), the bucket of the charts, the switch that
15
+ * leaves test users out, the order of the top conversations, the tool whose responses are open and the schedule whose
16
+ * runs are open.
17
+ */
18
+ export declare const AGENT_CONTROL_PANEL_URL_KEYS: readonly ["tab", "period", "from", "to", "bucket", "noTest", "topBy", "tool", "schedule"];
19
+ export interface AgentControlPanelScreenProps {
20
+ /** `createAgentControlPanelApi(…)` of the host. */
21
+ api: AgentControlPanelApi;
22
+ /** `createAgentSchedulesApi(…)` of the host; without it the Schedules tab is left out. */
23
+ schedulesApi?: AgentSchedulesApi;
24
+ /** Whose schedules the Schedules tab lists: `own` (default) or `all` (every account's, with the owner; the server decides who may). */
25
+ schedulesScope?: AgentSchedulesScope;
26
+ /** Where the tab, the period and the other choices live: the host's URL adapter. Without one they live in component state. */
27
+ urlStateAdapter?: UrlStateAdapter;
28
+ /** The page title; default "Control centre". Already translated. */
29
+ title?: ReactNode;
30
+ description?: ReactNode;
31
+ headerActions?: ReactNode;
32
+ /** False: the settings cannot be saved and the schedule actions are off. Default true. */
33
+ writesAllowed?: boolean;
34
+ /** Why writes are off; already translated. */
35
+ writesBlockedReason?: ReactNode;
36
+ /** The host's router link; default the provider's, else a plain `<a>`. */
37
+ linkComponent?: PageLinkComponent;
38
+ /** The link of a conversation in the host's agent screens; `null` = no link. */
39
+ buildConversationHref?: (conversationId: number) => string | null;
40
+ /** The link of an account in the host; `null` = no link. */
41
+ buildAccountHref?: (accountId: number) => string | null;
42
+ /** The link of an agent space (the record behind it) in the host; `null` = no link. */
43
+ buildSpaceHref?: (space: AgentControlPanelSpace) => string | null;
44
+ /** The host's name of a kind of space. Already translated. */
45
+ describeSpaceKind?: (kind: string) => string;
46
+ /** The host's name of a space when the server's label is its own English words; null = the label. Already translated. */
47
+ describeSpaceLabel?: (space: AgentControlPanelSpace) => string | null;
48
+ /** The host's name of the place a schedule lives in. Already translated. */
49
+ describeSchedulePlace?: (place: AgentSchedulePlace) => ReactNode;
50
+ /** The host's words for the cron expression of a recurring schedule; null = the expression. Already translated. */
51
+ describeCronSchedule?: (expression: string) => string | null;
52
+ /** The host's display name of a model by its catalog name ("GPT-6 Luna"); null = the catalog name. */
53
+ describeModelName?: (modelName: string) => string | null;
54
+ /**
55
+ * The host's words for the environment the settings apply to, from the server's name and its English label; null =
56
+ * the label as sent. Already translated.
57
+ */
58
+ describeEnvironment?: (environment: string, environmentLabel: string | null) => string | null;
59
+ /** Draws the charts of the statistics with the host's chart library; default the package's own bars. */
60
+ renderTimeSeriesChart?: AgentTimeSeriesChartRenderer;
61
+ /** Tabs of the host after the package's (route tabs with an `href`: its skills page, its connections). */
62
+ extraTabs?: readonly EntityTab[];
63
+ /** Tabs of the package the host leaves out. */
64
+ hiddenTabs?: readonly AgentControlPanelTab[];
65
+ }
66
+ /**
67
+ * The control centre of the agent: the statistics of a period (key figures, cost, conversations, tokens, tools, top
68
+ * conversations), the runtime settings with their change log, the agent spaces of the period, the schedules and the
69
+ * budget meters. The tab and every choice are kept in the URL through the host's adapter.
70
+ */
71
+ export declare const AgentControlPanelScreen: ({ api, schedulesApi, schedulesScope, urlStateAdapter, title, description, headerActions, writesAllowed, writesBlockedReason, linkComponent, buildConversationHref, buildAccountHref, buildSpaceHref, describeSpaceKind, describeSpaceLabel, describeSchedulePlace, describeCronSchedule, describeModelName, describeEnvironment, renderTimeSeriesChart, extraTabs, hiddenTabs, }: AgentControlPanelScreenProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
2
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
3
+ export interface BudgetsTabProps {
4
+ api: Pick<AgentControlPanelApi, "useBudgetsQuery">;
5
+ linkComponent?: PageLinkComponent;
6
+ buildAccountHref?: (accountId: number) => string | null;
7
+ }
8
+ /**
9
+ * The budget meters of the current period (read-only): the agent's total spend and the runs of schedules, then the
10
+ * accounts that spent most. A meter with a cap fills against the cap and warns from 80 %; one without fills by its
11
+ * share of the total spend.
12
+ */
13
+ export declare const BudgetsTab: ({ api, linkComponent, buildAccountHref }: BudgetsTabProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
2
+ import { type ReactNode } from "react";
3
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
4
+ export interface SettingsTabProps {
5
+ api: Pick<AgentControlPanelApi, "useRuntimeSettingsQuery" | "useUpdateRuntimeSettingsMutation">;
6
+ /** False: the form is shown, the save is off. Default true. */
7
+ writesAllowed?: boolean;
8
+ /** Why writes are off, shown beside the save button; already translated. */
9
+ writesBlockedReason?: ReactNode;
10
+ linkComponent?: PageLinkComponent;
11
+ buildAccountHref?: (accountId: number) => string | null;
12
+ /** The host's display name of a model by its catalog name; null = the catalog name. */
13
+ describeModelName?: (modelName: string) => string | null;
14
+ /** The host's words for the environment (its name and the server's English label); null = the label as sent. */
15
+ describeEnvironment?: (environment: string, environmentLabel: string | null) => string | null;
16
+ }
17
+ /**
18
+ * The runtime settings of the current environment: a form of the six settings (each shows what applies while it has
19
+ * no value of its own, and goes back to that with "Use the default"), a save that names what changes and that only
20
+ * new conversations take it, and the newest recorded changes.
21
+ */
22
+ export declare const SettingsTab: ({ api, writesAllowed, writesBlockedReason, linkComponent, buildAccountHref, describeModelName, describeEnvironment }: SettingsTabProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
2
+ import type { AdminPeriod } from "../period/admin-period";
3
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
4
+ import type { AgentControlPanelSpace } from "./agent-control-panel-types";
5
+ export interface SpacesTabProps {
6
+ api: Pick<AgentControlPanelApi, "useControlPanelSpacesQuery">;
7
+ period: AdminPeriod;
8
+ /** How many spaces are listed, the busiest first (default 100, at most 200). */
9
+ limit?: number;
10
+ linkComponent?: PageLinkComponent;
11
+ /** The host's screen of a space (the record behind it); `null` = no link. */
12
+ buildSpaceHref?: (space: AgentControlPanelSpace) => string | null;
13
+ buildAccountHref?: (accountId: number) => string | null;
14
+ /** The host's name of a kind of space; default the kind as sent. Already translated. */
15
+ describeSpaceKind?: (kind: string) => string;
16
+ /** The host's name of a space when the label the server sends is its own English words; null = the label. Already translated. */
17
+ describeSpaceLabel?: (space: AgentControlPanelSpace) => string | null;
18
+ }
19
+ /**
20
+ * The agent spaces conversations were started for in a period, the busiest first: the label and kind the application
21
+ * gives a space, its owner, its time zone, the conversations of the period (with a bar against the busiest space) and
22
+ * when the newest one started. The line without a space counts the conversations at account level.
23
+ */
24
+ export declare const SpacesTab: ({ api, period, limit, linkComponent, buildSpaceHref, buildAccountHref, describeSpaceKind, describeSpaceLabel }: SpacesTabProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
2
+ import type { AdminPeriod, AdminPeriodGranularity } from "../period/admin-period";
3
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
4
+ import type { AgentTopConversationsOrder } from "./agent-control-panel-types";
5
+ import { type AgentTimeSeriesChartRenderer } from "./time-series-chart";
6
+ export interface StatisticsTabProps {
7
+ api: AgentControlPanelApi;
8
+ period: AdminPeriod;
9
+ granularity: AdminPeriodGranularity;
10
+ excludeTestUsers: boolean;
11
+ topConversationsOrder: AgentTopConversationsOrder;
12
+ onTopConversationsOrderChange: (order: AgentTopConversationsOrder) => void;
13
+ /** The tool whose responses are open in the drawer; `null` = closed. */
14
+ selectedToolName: string | null;
15
+ onSelectTool: (toolName: string | null) => void;
16
+ linkComponent?: PageLinkComponent;
17
+ buildConversationHref?: (conversationId: number) => string | null;
18
+ buildAccountHref?: (accountId: number) => string | null;
19
+ renderTimeSeriesChart?: AgentTimeSeriesChartRenderer;
20
+ }
21
+ /**
22
+ * The statistics of a range: the key figures, the cost per bucket (by origin when the statistics carry it), three small
23
+ * charts (tokens, conversations, active accounts per bucket: one axis each), the tools by response size (a row opens
24
+ * its largest responses) and the top conversations.
25
+ */
26
+ export declare const StatisticsTab: ({ api, period, granularity, excludeTestUsers, topConversationsOrder, onTopConversationsOrderChange, selectedToolName, onSelectTool, linkComponent, buildConversationHref, buildAccountHref, renderTimeSeriesChart, }: StatisticsTabProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import type { ReactNode } from "react";
2
+ import { type AgentTimeSeriesChartProps, type AgentTimeSeriesChartRenderer } from "./time-series-chart";
3
+ /**
4
+ * The package's own drawing of a time-series chart, without a chart library: one column per bucket, the series of a
5
+ * bucket stacked (`bar`) or side by side (`line`), scaled to the largest value; every column names its values in its
6
+ * hover text. A host passes its chart library through `renderTimeSeriesChart` instead.
7
+ */
8
+ export declare const TimeSeriesFallbackChart: ({ ariaLabel, buckets, series, kind, formatValue, formatBucket, formatBucketTitle, height }: AgentTimeSeriesChartProps) => import("react/jsx-runtime").JSX.Element;
9
+ export interface TimeSeriesChartCardProps {
10
+ title: ReactNode;
11
+ /** One muted line under the title (what is counted, where the figures come from). */
12
+ description?: ReactNode;
13
+ chart: AgentTimeSeriesChartProps;
14
+ /** The host's chart implementation; default the package's own bars. */
15
+ renderChart?: AgentTimeSeriesChartRenderer;
16
+ isLoading?: boolean;
17
+ /** The text of the empty state, already translated. */
18
+ emptyText: string;
19
+ /** Under the chart (a footnote on the source of the figures). */
20
+ footer?: ReactNode;
21
+ /**
22
+ * `false`: the legend names no total per series (a sum over the buckets that means nothing, like the accounts active
23
+ * per day). A single series then shows no legend at all: the title names it. Default `true`.
24
+ */
25
+ showTotals?: boolean;
26
+ /**
27
+ * Where the legend stands: `beside` the title (a wide chart), or `below` it on a row of its own that keeps its
28
+ * height when it is empty, so the plots of small charts beside each other start on one line. Default `beside`.
29
+ */
30
+ legendPlacement?: "beside" | "below";
31
+ className?: string;
32
+ }
33
+ /**
34
+ * One chart of the statistics in a card: the title, the legend with every series' total in the period (so a series is
35
+ * never told by colour alone), the plot, and the same figures as a table that opens below.
36
+ */
37
+ export declare const TimeSeriesChartCard: ({ title, description, chart, renderChart, isLoading, emptyText, footer, showTotals, legendPlacement, className }: TimeSeriesChartCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
2
+ import type { AdminPeriod } from "../period/admin-period";
3
+ import type { AgentControlPanelApi } from "./agent-control-panel-api";
4
+ import type { AgentToolResponseStat } from "./agent-control-panel-types";
5
+ export interface ToolResponseSamplesDrawerProps {
6
+ api: Pick<AgentControlPanelApi, "useToolResponseSamplesQuery">;
7
+ /** The tool shown; `null` closes the drawer. */
8
+ toolName: string | null;
9
+ onClose: () => void;
10
+ period: Pick<AdminPeriod, "from" | "to">;
11
+ /** The tool's row of the statistics, for the figures above the list. */
12
+ stat?: AgentToolResponseStat | null;
13
+ /** How many responses are listed (default 20, at most 100). */
14
+ limit?: number;
15
+ linkComponent?: PageLinkComponent;
16
+ buildConversationHref?: (conversationId: number) => string | null;
17
+ }
18
+ /**
19
+ * The largest responses of one tool in a period, in a side sheet: the tool's figures of the range and one line per
20
+ * stored response (when, the size of the result and of the arguments in characters, the conversation it happened in).
21
+ */
22
+ export declare const ToolResponseSamplesDrawer: ({ api, toolName, onClose, period, stat, limit, linkComponent, buildConversationHref }: ToolResponseSamplesDrawerProps) => import("react/jsx-runtime").JSX.Element;