@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
@@ -0,0 +1,104 @@
1
+ import { type ApiMutationHook, type ApiQueryHook, type InjectableBaseApi, type InjectedRequest, type StaticQueryFailure } from "@mgamadeus/ddd-admin-ui/logic/pure";
2
+ import type { AgentBudgetsResponse, AgentControlPanelSpacesArg, AgentControlPanelSpacesResponse, AgentControlPanelStatisticsArg, AgentControlPanelStatisticsResponse, AgentRuntimeSettingsResponse, AgentRuntimeSettingsValues, AgentToolResponseSamplesArg, AgentToolResponseSamplesResponse } from "./agent-control-panel-types";
3
+ /** The cache tag type of the control panel reads (ids `STATISTICS`, `TOOL_SAMPLES`, `SETTINGS`, `SPACES`, `BUDGETS`). */
4
+ export declare const AGENT_CONTROL_PANEL_TAG = "AdminUiAgentControlPanel";
5
+ /** The hooks `createAgentControlPanelApi` returns; `AgentControlPanelScreen` takes them as `api`. */
6
+ export interface AgentControlPanelApi {
7
+ /** `GET /statistics?from&to&granularity&excludeTestUsers&topConversationsOrderBy`. */
8
+ useControlPanelStatisticsQuery: ApiQueryHook<AgentControlPanelStatisticsArg, AgentControlPanelStatisticsResponse>;
9
+ /** `GET /statistics/toolResponseSamples?toolName&from&to&limit`: the largest responses of one tool. */
10
+ useToolResponseSamplesQuery: ApiQueryHook<AgentToolResponseSamplesArg, AgentToolResponseSamplesResponse>;
11
+ /** `GET /settings`: the stored runtime settings, the defaults, what may be chosen, the newest changes. */
12
+ useRuntimeSettingsQuery: ApiQueryHook<void, AgentRuntimeSettingsResponse>;
13
+ /** `POST /settings`: stores all six settings as sent (null = back to the default); answers like the read. */
14
+ useUpdateRuntimeSettingsMutation: ApiMutationHook<AgentRuntimeSettingsValues, AgentRuntimeSettingsResponse>;
15
+ /** `GET /spaces?from&to&limit`: the agent spaces conversations were started for. */
16
+ useControlPanelSpacesQuery: ApiQueryHook<AgentControlPanelSpacesArg, AgentControlPanelSpacesResponse>;
17
+ /** `GET /budgets`: the budget meters of the current period. */
18
+ useBudgetsQuery: ApiQueryHook<void, AgentBudgetsResponse>;
19
+ }
20
+ export interface CreateAgentControlPanelApiOptions {
21
+ /** The host's RTK Query api (`createApi` with the React hooks module). */
22
+ baseApi: InjectableBaseApi;
23
+ /** Where the host mounts `AdminAgentControlPanelTrait`, without a trailing slash (`/api/admin/ai/agentControlPanel`). */
24
+ apiPrefix: string;
25
+ }
26
+ /** The six settings as the store route takes them: every one named, an unset one as null. */
27
+ export declare const buildAgentRuntimeSettingsBody: (values: AgentRuntimeSettingsValues) => Required<AgentRuntimeSettingsValues>;
28
+ /** The request of every operation, on `apiPrefix`. Pure: no RTK runtime. */
29
+ export declare const buildAgentControlPanelRequests: (apiPrefix: string) => {
30
+ statistics: (arg?: AgentControlPanelStatisticsArg) => InjectedRequest;
31
+ toolResponseSamples: (arg: AgentToolResponseSamplesArg) => InjectedRequest;
32
+ settings: () => InjectedRequest;
33
+ updateSettings: (values: AgentRuntimeSettingsValues) => InjectedRequest;
34
+ spaces: (arg?: AgentControlPanelSpacesArg) => InjectedRequest;
35
+ budgets: () => InjectedRequest;
36
+ };
37
+ /** The operations as injected. */
38
+ export declare const agentControlPanelEndpointDefinitions: (apiPrefix: string) => {
39
+ readonly adminUiAgentControlPanelStatistics: {
40
+ readonly kind: "query";
41
+ readonly request: (arg?: AgentControlPanelStatisticsArg) => InjectedRequest;
42
+ readonly providesTags: readonly [{
43
+ readonly type: "AdminUiAgentControlPanel";
44
+ readonly id: "STATISTICS";
45
+ }];
46
+ };
47
+ readonly adminUiAgentControlPanelToolResponseSamples: {
48
+ readonly kind: "query";
49
+ readonly request: (arg: AgentToolResponseSamplesArg) => InjectedRequest;
50
+ readonly providesTags: readonly [{
51
+ readonly type: "AdminUiAgentControlPanel";
52
+ readonly id: "TOOL_SAMPLES";
53
+ }];
54
+ };
55
+ readonly adminUiAgentControlPanelSettings: {
56
+ readonly kind: "query";
57
+ readonly request: () => InjectedRequest;
58
+ readonly providesTags: readonly [{
59
+ readonly type: "AdminUiAgentControlPanel";
60
+ readonly id: "SETTINGS";
61
+ }];
62
+ };
63
+ readonly adminUiAgentControlPanelUpdateSettings: {
64
+ readonly kind: "mutation";
65
+ readonly request: (values: AgentRuntimeSettingsValues) => InjectedRequest;
66
+ readonly invalidatesTags: readonly [{
67
+ readonly type: "AdminUiAgentControlPanel";
68
+ readonly id: "SETTINGS";
69
+ }];
70
+ };
71
+ readonly adminUiAgentControlPanelSpaces: {
72
+ readonly kind: "query";
73
+ readonly request: (arg?: AgentControlPanelSpacesArg) => InjectedRequest;
74
+ readonly providesTags: readonly [{
75
+ readonly type: "AdminUiAgentControlPanel";
76
+ readonly id: "SPACES";
77
+ }];
78
+ };
79
+ readonly adminUiAgentControlPanelBudgets: {
80
+ readonly kind: "query";
81
+ readonly request: () => InjectedRequest;
82
+ readonly providesTags: readonly [{
83
+ readonly type: "AdminUiAgentControlPanel";
84
+ readonly id: "BUDGETS";
85
+ }];
86
+ };
87
+ };
88
+ /**
89
+ * Injects the control panel operations into the host's RTK Query api and returns their hooks. Call it once at module
90
+ * scope: `export const agentControlPanelApi = createAgentControlPanelApi({ baseApi, apiPrefix: "/api/admin/ai/agentControlPanel" });`
91
+ */
92
+ export declare const createAgentControlPanelApi: ({ baseApi, apiPrefix }: CreateAgentControlPanelApiOptions) => AgentControlPanelApi;
93
+ /** Fixed answers of a `createStaticAgentControlPanelApi`; a query without one stays loading. */
94
+ export interface StaticAgentControlPanelData {
95
+ statistics?: (arg: AgentControlPanelStatisticsArg) => AgentControlPanelStatisticsResponse | StaticQueryFailure | undefined;
96
+ toolResponseSamples?: (arg: AgentToolResponseSamplesArg) => AgentToolResponseSamplesResponse | StaticQueryFailure | undefined;
97
+ settings?: () => AgentRuntimeSettingsResponse | StaticQueryFailure | undefined;
98
+ /** The answer of a store; default: the read's answer with the sent values as `settings`. */
99
+ updateSettings?: (values: AgentRuntimeSettingsValues) => AgentRuntimeSettingsResponse | Promise<AgentRuntimeSettingsResponse>;
100
+ spaces?: (arg: AgentControlPanelSpacesArg) => AgentControlPanelSpacesResponse | StaticQueryFailure | undefined;
101
+ budgets?: () => AgentBudgetsResponse | StaticQueryFailure | undefined;
102
+ }
103
+ /** An `AgentControlPanelApi` answering fixed payloads, without a store or a request (previews, tests, reviews). */
104
+ export declare const createStaticAgentControlPanelApi: (data: StaticAgentControlPanelData) => AgentControlPanelApi;
@@ -0,0 +1,241 @@
1
+ import type { AdminPeriodGranularity } from "../period/admin-period";
2
+ import type { AdminWireChangeHistory, AdminWireSet } from "../wire/admin-wire";
3
+ /** One point of a time series (`DateValue`): the bucket's day and its value. */
4
+ export interface AgentControlPanelDateValue {
5
+ /** `YYYY-MM-DD`; with weekly buckets the week's Monday. */
6
+ x: string;
7
+ y?: number | null;
8
+ }
9
+ /** A time series (`DateValueSequence`): its metric name and its points, as an object set or a plain list. */
10
+ export type AgentControlPanelSequence = ({
11
+ name?: string;
12
+ } & {
13
+ elements?: readonly AgentControlPanelDateValue[] | null;
14
+ }) | readonly AgentControlPanelDateValue[];
15
+ /** Tokens and cost per bucket (`AgentAIUsagePerBucket`), from the application's usage log. */
16
+ export interface AgentControlPanelAIUsagePerBucket {
17
+ inputTokensPerBucket?: AgentControlPanelSequence | null;
18
+ outputTokensPerBucket?: AgentControlPanelSequence | null;
19
+ costInUSDPerBucket?: AgentControlPanelSequence | null;
20
+ /** Of the input tokens, the ones read from the prompt cache; empty when the source holds none. */
21
+ cachedInputTokensPerBucket?: AgentControlPanelSequence | null;
22
+ /** The tokens written to the prompt cache; empty when the source holds none. */
23
+ cacheWriteTokensPerBucket?: AgentControlPanelSequence | null;
24
+ /** The first day the usage log holds a booking; before it the figures are empty because nothing was booked. */
25
+ dataAvailableFrom?: string | null;
26
+ /** True: the figures come from the application's usage log. */
27
+ isFromUsageLog?: boolean;
28
+ }
29
+ /** The totals of one period behind the key figures (`AgentControlPanelPeriodTotals`); a figure that was not read is absent. */
30
+ export interface AgentControlPanelPeriodTotals {
31
+ fromDay?: string;
32
+ toDay?: string;
33
+ conversationCount?: number | null;
34
+ activeAccountCount?: number | null;
35
+ weeklyActiveAccounts?: number | null;
36
+ monthlyActiveAccounts?: number | null;
37
+ costInUSD?: number | null;
38
+ costPerConversationInUSD?: number | null;
39
+ /** `USAGE_LOG` or `MESSAGE_ROWS`. */
40
+ costSource?: string | null;
41
+ turnCount?: number | null;
42
+ erroredTurnCount?: number | null;
43
+ errorRate?: number | null;
44
+ scheduledRunCount?: number | null;
45
+ }
46
+ /** The cost per bucket by the way a conversation starts (`AgentCostPerBucketByOrigin`). */
47
+ export interface AgentControlPanelCostPerBucketByOrigin {
48
+ chatCostInUSDPerBucket?: AgentControlPanelSequence | null;
49
+ scheduledRunCostInUSDPerBucket?: AgentControlPanelSequence | null;
50
+ voiceCostInUSDPerBucket?: AgentControlPanelSequence | null;
51
+ /** True: the sums of the conversations' message rows (cost booked outside them is missing). */
52
+ isFromMessageRows?: boolean;
53
+ }
54
+ /** One tool's response sizes over the range (`AgentToolResponseStat`). */
55
+ export interface AgentToolResponseStat {
56
+ toolName: string;
57
+ callCount?: number;
58
+ sumResultChars?: number;
59
+ avgResultChars?: number;
60
+ maxResultChars?: number;
61
+ /** Calls whose stored status is failed; null when it was not read. */
62
+ failedCallCount?: number | null;
63
+ /** The 95th percentile of the result length (nearest rank); null when it was not read. */
64
+ p95ResultChars?: number | null;
65
+ }
66
+ /** One conversation of the top list (`AgentConversationStat`). */
67
+ export interface AgentConversationStat {
68
+ conversationId: number;
69
+ accountId?: number | null;
70
+ agentSpaceId?: number | null;
71
+ messageCount?: number;
72
+ totalTokens?: number;
73
+ totalCostInUSD?: number;
74
+ created?: string | null;
75
+ title?: string | null;
76
+ }
77
+ /** The statistics of one range (`AgentControlPanelStatistics`). */
78
+ export interface AgentControlPanelStatistics {
79
+ rangeFrom?: string;
80
+ rangeTo?: string;
81
+ granularity?: AdminPeriodGranularity;
82
+ aiUsagePerBucket?: AgentControlPanelAIUsagePerBucket | null;
83
+ conversationsPerBucket?: AgentControlPanelSequence | null;
84
+ activeAccountsPerBucket?: AgentControlPanelSequence | null;
85
+ /** Distinct active accounts over the 7 days up to the last day of the range. */
86
+ weeklyActiveAccounts?: number;
87
+ /** Distinct active accounts over the 30 days up to the last day of the range. */
88
+ monthlyActiveAccounts?: number;
89
+ toolResponseStats?: AdminWireSet<AgentToolResponseStat> | null;
90
+ topConversations?: AdminWireSet<AgentConversationStat> | null;
91
+ /** False: the tool-size columns are missing on this database. */
92
+ toolResponseDataAvailable?: boolean;
93
+ satisfactionCaptureAvailable?: boolean;
94
+ scheduledRunCount?: number | null;
95
+ turnCount?: number | null;
96
+ /** Failed message rows of the range (error rows, failed tool calls): a count of rows, not of turns. */
97
+ failedMessageCount?: number | null;
98
+ /** Turns of the range that ended in an error (failed, given up, expired), by the newest terminal record of each turn. */
99
+ erroredTurnCount?: number | null;
100
+ /** `erroredTurnCount` per `turnCount`, 0 to 1: the rate the quality view shows too; null without a turn. */
101
+ errorRate?: number | null;
102
+ costInUSDPerBucketByOrigin?: AgentControlPanelCostPerBucketByOrigin | null;
103
+ /** The totals of the range, and of the range of equal length right before it. */
104
+ totals?: AgentControlPanelPeriodTotals | null;
105
+ previousTotals?: AgentControlPanelPeriodTotals | null;
106
+ /** Where the cost figures come from: `USAGE_LOG` or `MESSAGE_ROWS`. */
107
+ costSource?: string | null;
108
+ /** The first day the cost source holds a cost. */
109
+ costDataAvailableFrom?: string | null;
110
+ /** Whose conversations every figure counts: the environment (null = every one) and whether evaluation runs count. */
111
+ environment?: string | null;
112
+ includesEvalRuns?: boolean;
113
+ }
114
+ /** What the top conversations are ordered by. */
115
+ export type AgentTopConversationsOrder = "totalCostInUSD" | "totalTokens" | "messageCount";
116
+ export interface AgentControlPanelStatisticsArg {
117
+ from?: string;
118
+ to?: string;
119
+ granularity?: AdminPeriodGranularity;
120
+ excludeTestUsers?: boolean;
121
+ topConversationsOrderBy?: AgentTopConversationsOrder;
122
+ }
123
+ /** `GET {prefix}/statistics`. */
124
+ export interface AgentControlPanelStatisticsResponse {
125
+ statistics?: AgentControlPanelStatistics | null;
126
+ }
127
+ /** One stored tool response (`AgentToolResponseSample`). */
128
+ export interface AgentToolResponseSample {
129
+ messageId: number;
130
+ conversationId: number;
131
+ created?: string | null;
132
+ resultChars?: number;
133
+ argumentsChars?: number;
134
+ }
135
+ export interface AgentToolResponseSamplesArg {
136
+ toolName: string;
137
+ from?: string;
138
+ to?: string;
139
+ limit?: number;
140
+ }
141
+ /** `GET {prefix}/statistics/toolResponseSamples`. */
142
+ export interface AgentToolResponseSamplesResponse {
143
+ toolName?: string;
144
+ samples?: AdminWireSet<AgentToolResponseSample> | null;
145
+ }
146
+ /** The names of the runtime settings, in display order (`AgentRuntimeSettingsValues::SETTING_PROPERTY_NAMES`). */
147
+ export declare const AGENT_RUNTIME_SETTING_NAMES: readonly ["defaultModelName", "defaultReasoningEffort", "reasoningEffortCeiling", "compactionTriggerTokens", "storeRequestSnapshot", "decisionModelEnabled"];
148
+ export type AgentRuntimeSettingName = (typeof AGENT_RUNTIME_SETTING_NAMES)[number];
149
+ /** The values of the runtime settings (`AgentRuntimeSettingsValues`); null = the default applies. */
150
+ export interface AgentRuntimeSettingsValues {
151
+ defaultModelName?: string | null;
152
+ defaultReasoningEffort?: string | null;
153
+ reasoningEffortCeiling?: string | null;
154
+ compactionTriggerTokens?: number | null;
155
+ storeRequestSnapshot?: boolean | null;
156
+ decisionModelEnabled?: boolean | null;
157
+ }
158
+ /** One recorded change of one setting (`AgentRuntimeSettingChange`). */
159
+ export interface AgentRuntimeSettingChange {
160
+ id?: number;
161
+ environment?: string | null;
162
+ settingName?: string | null;
163
+ /** The value before as text; empty = the setting was not set. */
164
+ oldValue?: string | null;
165
+ /** The value after as text; empty = put back to the default. */
166
+ newValue?: string | null;
167
+ changedByAccountId?: number | null;
168
+ changeHistory?: AdminWireChangeHistory | null;
169
+ created?: string | null;
170
+ }
171
+ /** `GET` and `POST {prefix}/settings`. */
172
+ export interface AgentRuntimeSettingsResponse {
173
+ /** The name conversations of this installation are stamped with. */
174
+ environment?: string;
175
+ /** The environment in the application's words (which installation and database); shown instead of the name where present. */
176
+ environmentLabel?: string | null;
177
+ settings?: AgentRuntimeSettingsValues | null;
178
+ effectiveDefaults?: AgentRuntimeSettingsValues | null;
179
+ selectableModelNames?: string[] | null;
180
+ selectableReasoningEfforts?: string[] | null;
181
+ minCompactionTriggerTokens?: number;
182
+ maxCompactionTriggerTokens?: number;
183
+ requestSnapshotRetentionDays?: number | null;
184
+ isSettingsTableAvailable?: boolean;
185
+ recentChanges?: AdminWireSet<AgentRuntimeSettingChange> | null;
186
+ }
187
+ /** One agent space of a period (`AgentControlPanelSpace`); without a space id: the conversations at account level. */
188
+ export interface AgentControlPanelSpace {
189
+ agentSpaceId?: number | null;
190
+ kind?: string | null;
191
+ label?: string;
192
+ /** True: the row of the conversations without a space. */
193
+ isAccountLevel?: boolean;
194
+ ownerAccountId?: number | null;
195
+ /** How the application names the owner; absent when it names none. */
196
+ ownerLabel?: string | null;
197
+ timezone?: string | null;
198
+ conversationCount?: number;
199
+ newestConversationAt?: string | null;
200
+ }
201
+ export interface AgentControlPanelSpacesArg {
202
+ from?: string;
203
+ to?: string;
204
+ limit?: number;
205
+ }
206
+ /** `GET {prefix}/spaces`. */
207
+ export interface AgentControlPanelSpacesResponse {
208
+ rangeFrom?: string;
209
+ rangeTo?: string;
210
+ /** The spaces (`AgentControlPanelSpaces`, an object set; read through `wireElementsOf`). */
211
+ spaces?: AdminWireSet<AgentControlPanelSpace> | null;
212
+ }
213
+ export type AgentBudgetMeterKind = "TOTAL" | "ACCOUNT" | "SCHEDULED_RUNS";
214
+ /** One budget meter (`AgentBudgetMeter`). */
215
+ export interface AgentBudgetMeter {
216
+ kind?: AgentBudgetMeterKind | string;
217
+ accountId?: number | null;
218
+ label?: string | null;
219
+ spentInUSD?: number | null;
220
+ capInUSD?: number | null;
221
+ /** The period the meter sums; `periodTo` absent = up to now. */
222
+ periodFrom?: string | null;
223
+ periodTo?: string | null;
224
+ }
225
+ /** The budget meters of the current period (`AgentBudgetMeters`, an object set: the meters are its `elements`). */
226
+ export interface AgentBudgetMeters {
227
+ periodFrom?: string | null;
228
+ periodTo?: string | null;
229
+ /** The meters: the total first, then the runs of schedules, then the accounts by spend. */
230
+ elements?: readonly AgentBudgetMeter[] | null;
231
+ hasCaps?: boolean;
232
+ /** True: the spend is the application's (its usage log), the same source as the cost of the statistics. */
233
+ isSpendOfTheApplication?: boolean;
234
+ /** `APPLICATION` or `MESSAGE_ROWS`. */
235
+ spendSource?: string;
236
+ spendDataAvailableFrom?: string | null;
237
+ }
238
+ /** `GET {prefix}/budgets`. */
239
+ export interface AgentBudgetsResponse {
240
+ budgets?: AgentBudgetMeters | null;
241
+ }
@@ -0,0 +1,35 @@
1
+ import type { AgentBudgetMeter, AgentBudgetMeters } from "./agent-control-panel-types";
2
+ /** How full a meter is: `normal`, `warning` from 80 % of its cap, `over` from 100 %; `none` without a cap. */
3
+ export type BudgetMeterLevel = "none" | "normal" | "warning" | "over";
4
+ /** The share of a cap from which a meter warns. */
5
+ export declare const BUDGET_METER_WARNING_SHARE = 0.8;
6
+ /** One meter as the screen draws it. */
7
+ export interface BudgetMeterView {
8
+ key: string;
9
+ kind: string;
10
+ accountId: number | null;
11
+ /** The application's label; null = the screen names the meter by its kind. */
12
+ label: string | null;
13
+ /** Null: the application named a cap only. */
14
+ spentInUSD: number | null;
15
+ capInUSD: number | null;
16
+ /** Spend per cap (may exceed 1); null without a cap or a spend. */
17
+ shareOfCap: number | null;
18
+ /** The spend per total spend, 0 to 1; null for the total meter itself, or without a total. */
19
+ shareOfTotal: number | null;
20
+ /** The filled part of the bar, 0 to 1: the share of the cap, else the share of the total. */
21
+ fillFraction: number;
22
+ level: BudgetMeterLevel;
23
+ }
24
+ /** The level of a spend against its cap. */
25
+ export declare const budgetMeterLevelOf: (spentInUSD: number | null, capInUSD: number | null) => BudgetMeterLevel;
26
+ /** The view of one meter; `totalSpentInUSD` is the spend of the total meter. */
27
+ export declare const buildBudgetMeterView: (meter: AgentBudgetMeter, totalSpentInUSD: number | null) => BudgetMeterView;
28
+ /** The meters split as the screen lists them: the total and the scheduled runs first, then the accounts by spend. */
29
+ export interface BudgetMeterViews {
30
+ general: BudgetMeterView[];
31
+ accounts: BudgetMeterView[];
32
+ hasCaps: boolean;
33
+ }
34
+ /** The meter views of a budgets answer. */
35
+ export declare const buildBudgetMeterViews: (budgets: AgentBudgetMeters | null | undefined) => BudgetMeterViews;
@@ -0,0 +1,49 @@
1
+ import { type AdminPeriodGranularity } from "../period/admin-period";
2
+ import type { AgentControlPanelDateValue, AgentControlPanelSequence, AgentControlPanelStatistics, AgentToolResponseStat } from "./agent-control-panel-types";
3
+ /** The points of a sequence in either wire form. */
4
+ export declare const controlPanelSequencePointsOf: (sequence: AgentControlPanelSequence | null | undefined) => AgentControlPanelDateValue[];
5
+ /** The sum of a sequence's values. */
6
+ export declare const sumControlPanelSequence: (sequence: AgentControlPanelSequence | null | undefined) => number;
7
+ /** Whether a sequence holds a point at all (an application that supplies no usage log sends empty sequences). */
8
+ export declare const hasControlPanelSequencePoints: (sequence: AgentControlPanelSequence | null | undefined) => boolean;
9
+ /**
10
+ * The buckets of a chart: every bucket of the period in order, joined with the buckets the sequences name outside it
11
+ * (a week's Monday before the first day).
12
+ */
13
+ export declare const controlPanelBucketsOf: (from: string, to: string, granularity: AdminPeriodGranularity, sequences: readonly (AgentControlPanelSequence | null | undefined)[]) => string[];
14
+ /** The values of a sequence along `buckets`: a bucket without a point is 0; points of one bucket add up. */
15
+ export declare const controlPanelSeriesValuesOf: (sequence: AgentControlPanelSequence | null | undefined, buckets: readonly string[], granularity: AdminPeriodGranularity) => number[];
16
+ /** The key figures of a range, each null when the statistics do not carry it. */
17
+ export interface ControlPanelKeyFigures {
18
+ conversationCount: number;
19
+ weeklyActiveAccounts: number | null;
20
+ monthlyActiveAccounts: number | null;
21
+ /** The cost of the usage log; without one, the summed cost by origin; null without both. */
22
+ costInUSD: number | null;
23
+ costPerConversationInUSD: number | null;
24
+ inputTokens: number | null;
25
+ outputTokens: number | null;
26
+ totalTokens: number | null;
27
+ scheduledRunCount: number | null;
28
+ errorRate: number | null;
29
+ failedMessageCount: number | null;
30
+ /** The turns that ended in an error: what `errorRate` counts. */
31
+ erroredTurnCount: number | null;
32
+ turnCount: number | null;
33
+ }
34
+ /** The key figures the tiles show, summed from the statistics of one range. */
35
+ export declare const buildControlPanelKeyFigures: (statistics: AgentControlPanelStatistics | null | undefined) => ControlPanelKeyFigures;
36
+ /** What the tool table is sorted by. */
37
+ export type ToolResponseStatSort = "sum" | "calls" | "avg" | "max" | "failed";
38
+ /** The tools ordered by a measure, largest first; equal values by name. */
39
+ export declare const sortToolResponseStats: (stats: readonly AgentToolResponseStat[], sort: ToolResponseStatSort) => AgentToolResponseStat[];
40
+ /** A character count in a short form (`940`, `2.1k`, `1.4M`), in `locale`. */
41
+ export declare const formatCharacterCount: (value: number | null | undefined, locale?: string) => string;
42
+ /** An amount in USD (`$1.92`); below one cent with four decimals (`$0.0042`), zero as `$0.00`. */
43
+ export declare const formatUsdAmount: (value: number | null | undefined, locale?: string) => string;
44
+ /** A share of 0 to 1 as a percentage with one decimal below 10 % (`1.4 %`, `91 %`). */
45
+ export declare const formatShare: (value: number | null | undefined, locale?: string) => string;
46
+ /** A bucket key as an axis label: day and month (`15 Nov`). */
47
+ export declare const formatBucketTick: (bucket: string, locale?: string) => string;
48
+ /** A bucket key in full (`Sat, 28 Nov 2026`). */
49
+ export declare const formatBucketTitle: (bucket: string, locale?: string) => string;
@@ -0,0 +1,44 @@
1
+ import { type AgentRuntimeSettingName, type AgentRuntimeSettingsValues } from "./agent-control-panel-types";
2
+ /** The six settings with every value named: a string, a number, a boolean, or null for "uses the default". */
3
+ export type RuntimeSettingsFormValues = Required<{
4
+ [Name in AgentRuntimeSettingName]: NonNullable<AgentRuntimeSettingsValues[Name]> | null;
5
+ }>;
6
+ /** One value of the form. */
7
+ export type RuntimeSettingValue = string | number | boolean | null;
8
+ /** The form values of stored settings: an absent value and an empty text are "uses the default" (null). */
9
+ export declare const runtimeSettingsFormValuesOf: (values: AgentRuntimeSettingsValues | null | undefined) => RuntimeSettingsFormValues;
10
+ /** Whether a setting has no value of its own, so the package's or the configuration's default applies. */
11
+ export declare const usesRuntimeSettingDefault: (values: RuntimeSettingsFormValues, name: AgentRuntimeSettingName) => boolean;
12
+ /** One setting that differs between the stored values and the form. */
13
+ export interface RuntimeSettingChangeEntry {
14
+ name: AgentRuntimeSettingName;
15
+ /** The stored value; null = the default applied. */
16
+ from: RuntimeSettingValue;
17
+ /** The value to store; null = back to the default. */
18
+ to: RuntimeSettingValue;
19
+ }
20
+ /** The settings whose form value differs from the stored one, in display order. */
21
+ export declare const diffRuntimeSettings: (stored: RuntimeSettingsFormValues, edited: RuntimeSettingsFormValues) => RuntimeSettingChangeEntry[];
22
+ /** What stops a save: a compaction trigger that is no whole number or lies outside the allowed range. */
23
+ export type RuntimeSettingsProblem = "compactionTriggerNotWhole" | "compactionTriggerTooSmall" | "compactionTriggerTooLarge" | "effortAboveCeiling";
24
+ export interface RuntimeSettingsLimits {
25
+ minCompactionTriggerTokens?: number;
26
+ maxCompactionTriggerTokens?: number;
27
+ /** The efforts in rising order (`low`, `medium`, `high`). */
28
+ selectableReasoningEfforts?: readonly string[] | null;
29
+ }
30
+ /** The problems of the form values, by setting; empty = the values can be stored. */
31
+ export declare const validateRuntimeSettings: (values: RuntimeSettingsFormValues, limits: RuntimeSettingsLimits) => Partial<Record<AgentRuntimeSettingName, RuntimeSettingsProblem>>;
32
+ /** The digits of a typed compaction trigger as a number; null for an empty field, `NaN` for anything else. */
33
+ export declare const parseCompactionTriggerText: (text: string) => number | null;
34
+ /**
35
+ * A value as the change log stores it (`AgentRuntimeSettingsValues::getValueAsText`): `true` / `false` for a switch,
36
+ * the text of everything else, null for "uses the default".
37
+ */
38
+ export declare const runtimeSettingValueAsText: (value: RuntimeSettingValue | undefined) => string | null;
39
+ /** Whether a setting is a switch (its change-log text is `true` or `false`). */
40
+ export declare const isRuntimeSettingSwitch: (name: string) => boolean;
41
+ /** Whether a name is one of the six settings. */
42
+ export declare const isRuntimeSettingName: (name: string | null | undefined) => name is AgentRuntimeSettingName;
43
+ /** Whether a setting holds a text (a model name, an effort). */
44
+ export declare const isRuntimeSettingText: (name: AgentRuntimeSettingName) => boolean;
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from "react";
2
+ import type { SeriesFillSlot } from "../blocks/series-fill-classes";
3
+ import type { AdminPeriodGranularity } from "../period/admin-period";
4
+ /**
5
+ * The colour of a series slot as a CSS value, for a chart library that takes colours as values: the host's categorical
6
+ * series property, with the colour role the fill classes fall back to.
7
+ */
8
+ export declare const AGENT_SERIES_COLOR_VALUES: Readonly<Record<SeriesFillSlot, string>>;
9
+ /** One series of a time-series chart: its values along the chart's buckets. */
10
+ export interface AgentTimeSeriesChartSeries {
11
+ key: string;
12
+ /** Already translated. */
13
+ label: string;
14
+ /** The slot of the categorical palette the series keeps on every chart. */
15
+ colorSlot: SeriesFillSlot;
16
+ /** The slot's colour as a CSS value (`AGENT_SERIES_COLOR_VALUES`). */
17
+ color: string;
18
+ /** One value per bucket, in the order of `buckets`. */
19
+ values: readonly number[];
20
+ total: number;
21
+ }
22
+ /** What a chart implementation of the host gets (`renderTimeSeriesChart`). */
23
+ export interface AgentTimeSeriesChartProps {
24
+ /** Which chart of the screen this is: `cost`, `tokens`, `conversations` or `activeAccounts`. */
25
+ chartId: string;
26
+ /** Accessible name of the chart, already translated. */
27
+ ariaLabel: string;
28
+ /** The bucket keys in order (`YYYY-MM-DD`; with weekly buckets each week's Monday). */
29
+ buckets: readonly string[];
30
+ granularity: AdminPeriodGranularity;
31
+ series: readonly AgentTimeSeriesChartSeries[];
32
+ /** `bar`: the series of a bucket stacked into one bar (parts of a sum). `line`: one line per series on one axis. */
33
+ kind: "bar" | "line";
34
+ /** A value in full, for a tooltip (`$1.92`, `12,400`). */
35
+ formatValue: (value: number) => string;
36
+ /** A value on the axis, short (`$2`, `12k`). */
37
+ formatAxisValue: (value: number) => string;
38
+ /** A bucket on the axis (`15 Nov`). */
39
+ formatBucket: (bucket: string) => string;
40
+ /** A bucket in a tooltip (`Sat, 15 Nov 2026`, or the week it starts). */
41
+ formatBucketTitle: (bucket: string) => string;
42
+ /** The label of the sum of a stacked bucket, already translated. */
43
+ totalLabel: string;
44
+ /** The height of the plot in px. */
45
+ height: number;
46
+ /** True: the values are counts, so an axis shows no fractions. */
47
+ isWholeNumbers?: boolean;
48
+ }
49
+ /** Draws a time-series chart with the host's chart library; the package's own bars are the fallback. */
50
+ export type AgentTimeSeriesChartRenderer = (props: AgentTimeSeriesChartProps) => ReactNode;
51
+ /** The largest stacked sum (bars) or single value (lines) of a chart; 0 for an empty chart. */
52
+ export declare const timeSeriesChartMaximumOf: (series: readonly Pick<AgentTimeSeriesChartSeries, "values">[], bucketCount: number, kind: "bar" | "line") => number;
53
+ /** The positions of the buckets an axis labels when there is room for about `maximumLabels`: the first, the last, and even steps between. */
54
+ export declare const timeSeriesAxisLabelPositions: (bucketCount: number, maximumLabels?: number) => number[];