@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,27 @@
1
+ import { type ReactNode } from "react";
2
+ import type { TraceViewMode } from "./trace-types";
3
+ export interface RunStatusLineProps {
4
+ /** When the turn started: a server date-time, an ISO date-time or a moment in ms. The clock ticks from it. */
5
+ startedAt?: string | number | null;
6
+ /** What the agent does right now, in words ("reads the rides"). Default: "Working". */
7
+ statusText?: string | null;
8
+ /** `verbose` adds the tokens and the cost. Default `normal`. */
9
+ viewMode?: TraceViewMode;
10
+ /** Tokens of the turn so far (verbose). */
11
+ tokens?: number | null;
12
+ /** Cost of the turn so far (verbose). */
13
+ costInUsd?: number | null;
14
+ formatCost?: (costInUsd: number) => string;
15
+ /** Stops the turn; without it no Stop button. A promise keeps the button disabled until it settles. */
16
+ onStop?: () => void | Promise<void>;
17
+ /** The stop was asked for and the turn winds down: the line says so, the button is off. */
18
+ isStopping?: boolean;
19
+ /** Further content on the right of the line. */
20
+ children?: ReactNode;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * The status line of a running turn: a spinner, "Working · 0:42" ticking from the turn's start, in the verbose view
25
+ * the tokens and the cost so far, and a Stop button.
26
+ */
27
+ export declare const RunStatusLine: (props: RunStatusLineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { type TaskPlanItem } from "./TaskPlanRow";
2
+ import { useTraceFormat } from "./trace-format";
3
+ import type { TraceCompaction, TraceDecision, TraceSignal, TraceSkillLoad, TraceStep, TraceTaskPlanStepItem, TraceWidget } from "./trace-types";
4
+ /** The name of a decision in the reader's language: the text of its site, else the server's words for it, else the site's id in words. */
5
+ export declare const describeTraceDecision: (decision: TraceDecision) => string | null;
6
+ /** The status of a decision in words ("applied", "fallback"); a status the block does not know reads as the server wrote it. */
7
+ export declare const describeTraceDecisionStatus: (status: string | null | undefined) => string | null;
8
+ /** The badge class of a decision's status: applied reads as success, a fallback as a warning. */
9
+ export declare const readTraceDecisionStatusClassName: (status: string | null | undefined) => string;
10
+ export interface DecisionDetailProps {
11
+ decision: TraceDecision;
12
+ }
13
+ /**
14
+ * A decision of the agent's loop, opened: what came of it in one line, who decided and how sure, why the loop went on
15
+ * without an answer, and what was sent and answered — the state, the questions, the answers and the outcome as JSON.
16
+ */
17
+ export declare const DecisionDetail: (props: DecisionDetailProps) => import("react/jsx-runtime").JSX.Element;
18
+ /** The compaction of a step in one line: "42 messages · 18.2K → 1.2K tokens". */
19
+ export declare const describeTraceCompaction: (compaction: TraceCompaction, format: ReturnType<typeof useTraceFormat>) => string | null;
20
+ export interface CompactionDetailProps {
21
+ compaction: TraceCompaction;
22
+ }
23
+ /** A compaction, opened: how many messages it folded into a summary, the tokens before and after, and the summary. */
24
+ export declare const CompactionDetail: (props: CompactionDetailProps) => import("react/jsx-runtime").JSX.Element;
25
+ export interface SignalDetailProps {
26
+ signal: TraceSignal;
27
+ }
28
+ /** A signal, opened: where it came from and the note the platform wrote into the conversation. */
29
+ export declare const SignalDetail: (props: SignalDetailProps) => import("react/jsx-runtime").JSX.Element;
30
+ export interface WidgetDetailProps {
31
+ widget: TraceWidget;
32
+ }
33
+ /** A widget, opened: its type, who emitted it, its title and summary, and its payload as JSON. */
34
+ export declare const WidgetDetail: (props: WidgetDetailProps) => import("react/jsx-runtime").JSX.Element;
35
+ export interface SkillLoadDetailProps {
36
+ skillLoad: TraceSkillLoad;
37
+ }
38
+ /**
39
+ * What a step loaded, opened: why (the model asked, a preload without a call, another tool's call), the names the
40
+ * model asked for, each skill with its tokens, its tools and what loaded it, and what was not loaded and why.
41
+ */
42
+ export declare const SkillLoadDetail: (props: SkillLoadDetailProps) => import("react/jsx-runtime").JSX.Element;
43
+ /** The items of a task plan step as the checklist's items: done, or open. */
44
+ export declare const buildTaskPlanItems: (items: TraceTaskPlanStepItem[]) => TaskPlanItem[];
45
+ export interface TaskPlanStepDetailProps {
46
+ title?: string | null;
47
+ items: TraceTaskPlanStepItem[];
48
+ }
49
+ /** The task plan after a step, opened: its items as a checklist. */
50
+ export declare const TaskPlanStepDetail: (props: TaskPlanStepDetailProps) => import("react/jsx-runtime").JSX.Element;
51
+ export interface StepFactsLineProps {
52
+ step: TraceStep;
53
+ }
54
+ /**
55
+ * The plain facts of a step for a reader who is no debugger: what it used, what that does to data, where it stands,
56
+ * when it started and how long it took. Shown in the open row of a step in the normal view, below its terminal and
57
+ * its file edits.
58
+ */
59
+ export declare const StepFactsLine: (props: StepFactsLineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import type { ReactNode } from "react";
2
+ import { type TraceFormat } from "./trace-format";
3
+ import type { TraceLinkComponent, TraceSubAgent, TraceViewMode } from "./trace-types";
4
+ /** The parent waits for its sub-agents. */
5
+ export interface SubAgentWaiting {
6
+ /** When the parent stops waiting (a server date-time); the row names the clock time. */
7
+ deadlineAt?: string | null;
8
+ /** What ends the wait, in words ("wakes when all are done"); the block has no words of its own for it. */
9
+ wakeConditionText?: string | null;
10
+ }
11
+ export interface SubAgentStepGroupProps {
12
+ subAgents: TraceSubAgent[];
13
+ /** `verbose` opens the group and adds model, cost and tokens; `summary` renders nothing. Default `normal`. */
14
+ viewMode?: TraceViewMode;
15
+ /** Controls the group; without it the group keeps its own state (open in `verbose`). */
16
+ isOpen?: boolean;
17
+ defaultOpen?: boolean;
18
+ onOpenChange?: (isOpen: boolean) => void;
19
+ /** The sub-agent (its position) whose row starts open. Default: none. */
20
+ defaultOpenSubAgentIndex?: number;
21
+ /** What stands on the right of the group's head ("parallel"). */
22
+ meta?: ReactNode;
23
+ /** The parent waits for the sub-agents: a waiting row under the group. */
24
+ waiting?: SubAgentWaiting | null;
25
+ /** The route of a sub-agent's conversation. */
26
+ buildChildConversationHref?: (childConversationId: number) => string | null;
27
+ /** Opens a sub-agent's conversation, for a host without a route. */
28
+ openChildConversation?: (childConversationId: number) => void;
29
+ /** The trace of a sub-agent's conversation, shown inside its open row (the host loads it when the row opens). */
30
+ renderChildTrace?: (childConversationId: number) => ReactNode;
31
+ linkComponent?: TraceLinkComponent;
32
+ formatCost?: (costInUsd: number) => string;
33
+ isCompact?: boolean;
34
+ }
35
+ /** The counts of a group's head: "3 sub-agents · 2 done · 1 running". */
36
+ export declare const describeSubAgentCounts: (subAgents: TraceSubAgent[], format: Pick<TraceFormat, "number">) => string;
37
+ export interface SubAgentStepRowProps extends Pick<SubAgentStepGroupProps, "buildChildConversationHref" | "openChildConversation" | "renderChildTrace" | "linkComponent" | "formatCost" | "isCompact"> {
38
+ subAgent: TraceSubAgent;
39
+ /** `verbose` adds model, cost and tokens. Default `normal`. */
40
+ viewMode?: TraceViewMode;
41
+ defaultOpen?: boolean;
42
+ }
43
+ /**
44
+ * One sub-agent as a row: its state, number and label, with its duration (and in the verbose view its model and
45
+ * cost) on the right. Open, it shows the task, the result, the skills, the tokens, a link to its conversation and the
46
+ * trace of that conversation when the host renders one.
47
+ */
48
+ export declare const SubAgentStepRow: (props: SubAgentStepRowProps) => import("react/jsx-runtime").JSX.Element;
49
+ /**
50
+ * The sub-agents of a delegation as a step group: a head "3 sub-agents · 2 done · 1 running" that folds one row per
51
+ * sub-agent, and a waiting row while the parent waits for them. One sub-agent alone is its row without a head.
52
+ */
53
+ export declare const SubAgentStepGroup: (props: SubAgentStepGroupProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ import type { TraceTaskPlanItemSource } from "./trace-collect";
3
+ import type { TraceTaskPlanStepItem } from "./trace-types";
4
+ export interface TaskPlanPaneProps {
5
+ /** The plan's own title ("Support.Ticket"); it follows the word "Plan". */
6
+ title?: string | null;
7
+ /** The items in the plan's order; without them the pane shows the counts alone. */
8
+ items: TraceTaskPlanStepItem[];
9
+ /**
10
+ * Top-level items of the plan, how many of them are done or do not apply, and how many are blocked (never counted
11
+ * done). Default: counted from the top-level `items`.
12
+ */
13
+ itemCount?: number | null;
14
+ doneCount?: number | null;
15
+ blockedCount?: number | null;
16
+ /** A quiet line under the head (the turn that last updated the plan). */
17
+ note?: ReactNode;
18
+ /**
19
+ * Per item key, the plan update that last changed the item (`TraceTaskPlanSnapshot.itemSources`). With
20
+ * `onSelectItem` an item that has one is a button: it leads to that step in the trace (`focusTraceStep`).
21
+ */
22
+ itemSources?: Readonly<Record<string, TraceTaskPlanItemSource>>;
23
+ onSelectItem?: (item: TraceTaskPlanStepItem, source: TraceTaskPlanItemSource) => void;
24
+ className?: string;
25
+ }
26
+ /**
27
+ * The task plan of a conversation as it stands, for a pane beside the chat: "Plan · title", how many items are done
28
+ * and blocked ("4 of 5 done · 1 blocked") with a meter of the done ones, and every item with its number, its text and its state (done, does not apply, blocked, up next —
29
+ * the first open item — or not started). Nested items are indented by their depth.
30
+ */
31
+ export declare const TaskPlanPane: (props: TaskPlanPaneProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ export type TaskPlanItemState = "done" | "current" | "open";
2
+ export interface TaskPlanItem {
3
+ /** A stable key; default: the item's position. */
4
+ key?: string;
5
+ text: string;
6
+ state: TaskPlanItemState;
7
+ }
8
+ export interface TaskPlanRowProps {
9
+ /** The plan's title. Default: "Plan". */
10
+ title?: string | null;
11
+ items: TaskPlanItem[];
12
+ /**
13
+ * The counts of a plan whose items the reader does not have (the trace names how many items a plan holds and how
14
+ * many are done, not their texts): with no items the row is the head alone, "Plan · 3 of 5".
15
+ */
16
+ doneCount?: number | null;
17
+ totalCount?: number | null;
18
+ /** Controls the list; without it the row keeps its own state, starting at `defaultOpen` (open). */
19
+ isOpen?: boolean;
20
+ defaultOpen?: boolean;
21
+ onOpenChange?: (isOpen: boolean) => void;
22
+ className?: string;
23
+ }
24
+ /**
25
+ * The agent's task plan as a checklist: a head "Plan · 2 of 5" that folds the items, each done (checked, quiet),
26
+ * current (ringed, strong) or open.
27
+ */
28
+ export declare const TaskPlanRow: (props: TaskPlanRowProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import type { TraceTerminal } from "./trace-types";
2
+ export interface TerminalBlockProps extends TraceTerminal {
3
+ /** The command still runs: the exit chip says so. */
4
+ isRunning?: boolean;
5
+ /** Lines of each output shown before "Show n more lines". Default 12, 8 in the narrow variant. */
6
+ maxLines?: number;
7
+ /** The narrow variant (a floating panel): no working directory in the head. */
8
+ isNarrow?: boolean;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * A shell command of the agent as a terminal: the command after a `$` with its working directory, duration and exit
13
+ * chip (green for 0, red otherwise), the output in monospaced text, the error output coloured, and "Show n more
14
+ * lines" for an output longer than `maxLines`.
15
+ */
16
+ export declare const TerminalBlock: (props: TerminalBlockProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ export interface ThinkingBlockProps {
2
+ /** How long the model thought. */
3
+ durationMs?: number | null;
4
+ /** Reasoning tokens of the call. */
5
+ reasoningTokens?: number | null;
6
+ /** A summary of the reasoning, where the provider returned one; with it the row opens. */
7
+ summary?: string | null;
8
+ /** The model is thinking right now. */
9
+ isRunning?: boolean;
10
+ isOpen?: boolean;
11
+ defaultOpen?: boolean;
12
+ onOpenChange?: (isOpen: boolean) => void;
13
+ isCompact?: boolean;
14
+ }
15
+ /**
16
+ * The thinking of the model as one quiet row: "Thought · 4.0 s · 1.2K tokens", collapsed. It opens a summary when
17
+ * the provider returned one; the reasoning itself is never shown.
18
+ */
19
+ export declare const ThinkingBlock: (props: ThinkingBlockProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ import { type ReactNode } from "react";
2
+ import type { TraceLoadedSkill, TraceModelCall } from "./trace-types";
3
+ export interface ToolStepDetailProps {
4
+ /** The arguments of the call as JSON text. */
5
+ argumentsJson?: string | null;
6
+ isArgumentsCut?: boolean;
7
+ /** The stored result of the call (its start when `isResultCut`). */
8
+ result?: string | null;
9
+ /** Characters of the whole stored result. */
10
+ resultChars?: number | null;
11
+ isResultCut?: boolean;
12
+ /** The text of a failed step. */
13
+ errorText?: string | null;
14
+ /** The skills the call loaded, by name. */
15
+ loadedSkillNames?: string[];
16
+ /** The skills loaded at the model call, with their tools. */
17
+ loadedSkills?: TraceLoadedSkill[] | null;
18
+ /** The facts of the model call. */
19
+ modelCall?: TraceModelCall | null;
20
+ /** The model of the call in words, as the server words it; default: derived from the call's model name. */
21
+ modelLabel?: string | null;
22
+ durationMs?: number | null;
23
+ /** A cost in the host's currency and format. Default: US dollars. */
24
+ formatCost?: (costInUsd: number) => string;
25
+ /** The loaded skills that brought the tool. */
26
+ toolSkillNames?: string[];
27
+ /** Opens what the model call was sent (its context, its payload) in a view of the host. */
28
+ onOpenContext?: () => void;
29
+ /** Further content of the host below the panels. */
30
+ children?: ReactNode;
31
+ }
32
+ export interface TraceCodePanelProps {
33
+ title: string;
34
+ copyLabel?: string;
35
+ text: string;
36
+ /** Characters of the whole text (the shown text may be its start). Default: the text's length. */
37
+ totalChars?: number;
38
+ isCut?: boolean;
39
+ testId?: string;
40
+ }
41
+ /** A text of a step in monospaced type (arguments, a result, a payload): its title, its size, a mark when it was shortened, a copy button. */
42
+ export declare const TraceCodePanel: (props: TraceCodePanelProps) => import("react/jsx-runtime").JSX.Element;
43
+ /**
44
+ * The detail of an open step in the verbose view: the arguments (JSON, indented) and the result (as the tool wrote it)
45
+ * side by side, stacked when the block is narrow, each with its size, a mark when it was shortened and a copy button;
46
+ * below them the skills the call loaded, the facts of the model call and the duration. That a tool was reached
47
+ * through `call_tool` is said once, in the step's row.
48
+ */
49
+ export declare const ToolStepDetail: (props: ToolStepDetailProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import type { ReactNode } from "react";
2
+ import type { TraceHostBindings, TraceStep, TraceViewMode } from "./trace-types";
3
+ /** The steps a view mode shows: all of them in `verbose`, the ones an owner reads in `normal`, none in `summary`. */
4
+ export declare const selectVisibleTraceSteps: (steps: TraceStep[], viewMode: TraceViewMode) => TraceStep[];
5
+ export interface TraceStepRowProps {
6
+ step: TraceStep;
7
+ /** `verbose` leads with the tool's name and opens to arguments, result and the model call's facts. Default `normal`. */
8
+ viewMode?: TraceViewMode;
9
+ host?: TraceHostBindings;
10
+ /** The conversation of the step, for the host's routes that need it (the sandbox of a changed file). */
11
+ conversationId?: number | null;
12
+ isCompact?: boolean;
13
+ defaultOpen?: boolean;
14
+ }
15
+ /**
16
+ * One step of a turn as its row: the narrated line in the normal view, the tool's name with its object in the verbose
17
+ * view; the chips of the records it names; its duration and the lines it changed on the right. Every row opens: to
18
+ * the terminal and the file edits, to the plain facts of the step in the normal view, and in the verbose view to the
19
+ * arguments and the result of a call, the facts of a model call with the link to its context, what a decision was
20
+ * sent and answered, what a compaction folded, the text of a signal, the payload of a widget and the loaded skills.
21
+ */
22
+ export declare const TraceStepRow: (props: TraceStepRowProps) => import("react/jsx-runtime").JSX.Element;
23
+ export interface ToolStepGroupProps {
24
+ /** The steps of the turn, oldest first. */
25
+ steps: TraceStep[];
26
+ /**
27
+ * `summary` renders nothing but `result`; `normal` folds the steps closed, each with its narrated line; `verbose`
28
+ * opens the group and shows tool names, thinking, model calls and `metaLine`. Default `normal`.
29
+ */
30
+ viewMode?: TraceViewMode;
31
+ /** How long the turn took (the head's figure). */
32
+ durationMs?: number | null;
33
+ /** The turn still runs: the head spins and the group stays open. */
34
+ isRunning?: boolean;
35
+ /** Controls the fold; without it the group keeps its own state (open in `verbose` and while running). */
36
+ isOpen?: boolean;
37
+ defaultOpen?: boolean;
38
+ onOpenChange?: (isOpen: boolean) => void;
39
+ /** What stands on the right of the head beside the duration (`FileChangesSummary`). */
40
+ summary?: ReactNode;
41
+ /** The turn's figures under the steps, in `verbose` only (`TurnMetaLine`). */
42
+ metaLine?: ReactNode;
43
+ /** What the turn produced, shown in every view mode under the steps (a `ChangeSetCard`). */
44
+ result?: ReactNode;
45
+ /** The host's records, links, mounts, money and file callbacks. */
46
+ host?: TraceHostBindings;
47
+ /** The conversation of the turn, for the host's routes that need it (its sandbox). */
48
+ conversationId?: number | null;
49
+ /** The group stands in a narrow thread (a floating panel). */
50
+ isCompact?: boolean;
51
+ className?: string;
52
+ }
53
+ /**
54
+ * The steps of one turn as a fold: a head "7 steps · 16.8 s" over one row per step. How much it shows follows the
55
+ * view mode — nothing but the result (`summary`), the narrated steps folded closed (`normal`), or every step with
56
+ * tool names, thinking and the turn's figures, opened (`verbose`).
57
+ */
58
+ export declare const ToolStepGroup: (props: ToolStepGroupProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,52 @@
1
+ import { type ReactNode } from "react";
2
+ import { type AgentsIconName } from "../../provider/components";
3
+ import type { TraceStepState } from "./trace-types";
4
+ export interface ToolStepRowProps {
5
+ /** The lead icon of the row. */
6
+ icon?: AgentsIconName;
7
+ /** A lead element of the host's own in place of the icon. */
8
+ iconSlot?: ReactNode;
9
+ /**
10
+ * Where the step stands. `running` and `waiting` always show in the lead (a spinner, a clock); `done` and `failed`
11
+ * stand in place of the icon only with `showsStateInLead`, else a failed step marks its meta.
12
+ */
13
+ state?: TraceStepState;
14
+ /** The state's icon stands in place of the lead icon, whatever the state (a sub-agent's row). */
15
+ showsStateInLead?: boolean;
16
+ /** The verb or the narrated line; already in the reader's language. */
17
+ label: string;
18
+ /** `regular` for a narrated sentence, `strong` for a verb or a tool name. Default `strong`. */
19
+ labelWeight?: "strong" | "regular";
20
+ /** The object of the step (a command, a path, a query); it gives way first when the row is too narrow. */
21
+ target?: ReactNode;
22
+ /** `code` sets the object in monospaced text, `text` as a quiet sentence (a narrated line, an error). Default `code`. */
23
+ targetKind?: "code" | "text";
24
+ /** The chips of the records the step names (`EntityChip`). */
25
+ chips?: ReactNode;
26
+ /** The model called the tool through `call_tool`: a quiet mark right of the label says so (the one place it is said). */
27
+ deliveredThroughCallTool?: boolean;
28
+ /** What stands on the right: a duration, a count, a badge. */
29
+ meta?: ReactNode;
30
+ /** `fold` for the head of a group, `thinking` for the thinking row, `waiting` for a row that waits. Default `step`. */
31
+ variant?: "step" | "fold" | "thinking" | "waiting";
32
+ /** The detail of the step. With it the row is a disclosure: a button that opens and closes it. */
33
+ children?: ReactNode;
34
+ /** The detail without the indented body around it (a nested list of rows brings its own). */
35
+ hasPlainBody?: boolean;
36
+ /** Controls the disclosure; without it the row keeps its own state, starting at `defaultOpen`. */
37
+ isOpen?: boolean;
38
+ defaultOpen?: boolean;
39
+ onOpenChange?: (isOpen: boolean) => void;
40
+ /** The row is narrow (a floating panel): tighter paddings. */
41
+ isCompact?: boolean;
42
+ className?: string;
43
+ testId?: string;
44
+ /** The server's id of the row's step: the anchor a plan item scrolls to (`focusTraceStep`). */
45
+ anchorId?: string | null;
46
+ }
47
+ /**
48
+ * One calm line of a turn's trace: an icon, a verb or a narrated line, the object in monospaced text, the chips of the
49
+ * records it names and its figures on the right. With children it is a disclosure (a button with `aria-expanded` over
50
+ * the whole row, opened by click, Enter or Space) that shows them below; the chips stay links of their own.
51
+ */
52
+ export declare const ToolStepRow: (props: ToolStepRowProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { TraceViewMode } from "./trace-types";
2
+ export interface TraceViewModeSwitchProps {
3
+ viewMode: TraceViewMode;
4
+ onViewModeChange: (viewMode: TraceViewMode) => void;
5
+ /** The reader may see the verbose view (tool names, arguments, results, costs); without it the option is not offered. */
6
+ isVerboseAllowed?: boolean;
7
+ isCompact?: boolean;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * The switch of how much of a turn's trace the chat shows: Short (the result only), Normal (the steps, folded) and,
12
+ * for a reader who may, Verbose (every step open to its details). Arrow keys move between the options.
13
+ */
14
+ export declare const TraceViewModeSwitch: (props: TraceViewModeSwitchProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from "react";
2
+ import type { TraceLinkComponent, TraceTurnTotals } from "./trace-types";
3
+ export interface TurnMetaLineProps extends TraceTurnTotals {
4
+ /** The turn's model in words, when the host has the server's wording; default: derived from `modelName`. */
5
+ modelLabel?: string | null;
6
+ /** A chip for where the turn stands ("waits for approval"), already in the reader's language. */
7
+ stateLabel?: string | null;
8
+ stateTone?: "neutral" | "warning" | "danger";
9
+ /** Opens what the model was sent at this turn's call (the context composition). */
10
+ onOpenContext?: () => void;
11
+ contextHref?: string | null;
12
+ /** Opens the turn in the analysis view. */
13
+ onOpenAnalysis?: () => void;
14
+ analysisHref?: string | null;
15
+ linkComponent?: TraceLinkComponent;
16
+ formatCost?: (costInUsd: number) => string;
17
+ isCompact?: boolean;
18
+ /** Further chips of the host before the links. */
19
+ children?: ReactNode;
20
+ className?: string;
21
+ }
22
+ /**
23
+ * The figures of a turn in one line, as the verbose view shows them under the steps: model and effort, tokens with
24
+ * the share read from the cache, cost, duration, a chip for the turn's state, and the links "What the model saw" and
25
+ * "Open in analysis". A figure that is not given is left out.
26
+ */
27
+ export declare const TurnMetaLine: (props: TurnMetaLineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ export interface ContentFromUnifiedDiffOptions {
2
+ /** The operation of the change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`, `DIRECTORY_CREATED`), when known. */
3
+ changeType?: string | null;
4
+ /**
5
+ * The size of the new file in bytes, when known: for a file that is not new it is the proof that the hunks reach
6
+ * the file's end (a hunk that starts at line 1 says nothing about where the file ends).
7
+ */
8
+ sizeAfter?: number | null;
9
+ }
10
+ /**
11
+ * The whole content of the new file, rebuilt from the unified diff of one change — or null when the diff does not
12
+ * hold the whole file. A diff is complete when all of this holds:
13
+ *
14
+ * - it is text with at least one hunk (not binary, not empty) and the change is no deletion and no new folder;
15
+ * - every hunk holds as many lines as its header promises (a diff that was cut holds fewer);
16
+ * - the hunks start at the first line of the new file and follow each other without a gap, on both sides;
17
+ * - the file's end is proven: the file is new (its one hunk `@@ -0,0 +1,n @@` consists of added lines only), or the
18
+ * last line carries ``, or the rebuilt content is exactly `sizeAfter` bytes long.
19
+ *
20
+ * Without such a proof a modified file answers null even when its one hunk starts at line 1: the lines after the
21
+ * hunk's trailing context are not in the diff. Line ends: a diff whose lines end with CRLF is rebuilt with CRLF, else
22
+ * with LF (when `sizeAfter` is known, the variant of that size wins); the last line gets a line end unless the diff
23
+ * marks it as having none.
24
+ */
25
+ export declare const readContentFromUnifiedDiff: (diffText: string | null | undefined, options?: ContentFromUnifiedDiffOptions) => string | null;
@@ -0,0 +1,133 @@
1
+ import type { AgentsConversationClient } from "../../client/AgentsConversationClient";
2
+ import type { ConversationTraceLevel, ConversationTurnTrace, ConversationTurnTraces } from "../../contract/conversation-trace";
3
+ /**
4
+ * The loader of one conversation's turn trace: every turn trace a screen shows reads through it, so the turns on screen
5
+ * share their requests. It holds the turns it read (by turn number), reads the newest window first, walks back one
6
+ * window at a time while a wanted turn is older than what it holds, follows a running turn with reads of the changed
7
+ * turns only, and reads again when the conversation changed. One request runs at a time; a failed read is tried again
8
+ * at the next change, never in a loop, and never throws into the component that asked.
9
+ */
10
+ /** The part of the conversation client the loader reads through. */
11
+ export type ConversationTraceClient = Pick<AgentsConversationClient, "getTurnTraces">;
12
+ export interface ConversationTraceLoaderOptions {
13
+ /** The level asked for; the server answers at most the level the reader is allowed. Default `STEPS`. */
14
+ level?: ConversationTraceLevel;
15
+ /** Turns of one read. Default 20 (the server's default window). */
16
+ pageSize?: number;
17
+ }
18
+ /** What the loader holds of a conversation at one moment; a new object after every change. */
19
+ export interface ConversationTraceState {
20
+ /** The turns read so far, oldest first; without gaps from the oldest one read to the newest. */
21
+ turns: ConversationTurnTrace[];
22
+ /** `idle` before the first read, `loading` while that read runs, `ready` after it, `failed` when it failed. */
23
+ status: "idle" | "loading" | "ready" | "failed";
24
+ /** The level the server answered; null before the first answer. */
25
+ level: ConversationTraceLevel | null;
26
+ /** A turn runs in the conversation, as the newest read saw it. */
27
+ isRunLive: boolean;
28
+ /** Turns older than the oldest one read exist, as the page read that holds the oldest turn said. */
29
+ hasOlderTurns: boolean;
30
+ /** Turns of the whole conversation, as the newest read counted them; null before the first answer. */
31
+ totalTurnCount: number | null;
32
+ }
33
+ type TraceRead = {
34
+ kind: "newest";
35
+ } | {
36
+ kind: "follow";
37
+ afterMessageIndex: number;
38
+ } | {
39
+ kind: "older";
40
+ fromTurnNumber: number;
41
+ limit: number;
42
+ };
43
+ export declare class ConversationTraceLoader {
44
+ protected readonly client: ConversationTraceClient;
45
+ protected readonly conversationId: number;
46
+ protected readonly level: ConversationTraceLevel;
47
+ protected readonly pageSize: number;
48
+ protected readonly turnsByNumber: Map<number, ConversationTurnTrace>;
49
+ protected readonly listeners: Set<() => void>;
50
+ /** The turns a component waits for, by the id of the message that started them, with how many wait. */
51
+ protected readonly wantedTurnMessageIds: Map<number, number>;
52
+ /** The turns that run right now, with how many components follow each. */
53
+ protected readonly liveTurnMessageIds: Map<number, number>;
54
+ /** Turns that ended since the last follow read: that read returns them whole once more. */
55
+ protected readonly endedTurnMessageIds: Set<number>;
56
+ /** The revision at which a wanted turn newer than everything held was last looked for. */
57
+ protected readonly lookedForAtRevision: Map<number, number>;
58
+ protected state: ConversationTraceState;
59
+ protected newestMessageIndex: number | null;
60
+ protected hasReadNewest: boolean;
61
+ protected wantsNewest: boolean;
62
+ protected needsFollowRead: boolean;
63
+ protected isReading: boolean;
64
+ protected isPumpScheduled: boolean;
65
+ /** Counts what could have changed the trace: a changed conversation, a poll tick. A failed read waits for the next. */
66
+ protected revision: number;
67
+ protected failedAtRevision: number | null;
68
+ protected conversationRevision: string | number | null;
69
+ protected followerCount: number;
70
+ protected pollTimer: ReturnType<typeof setInterval> | null;
71
+ protected pollIntervalMs: number;
72
+ constructor(client: ConversationTraceClient, conversationId: number, options?: ConversationTraceLoaderOptions);
73
+ subscribe: (listener: () => void) => (() => void);
74
+ getState: () => ConversationTraceState;
75
+ /** The turn a message started, when it was read. */
76
+ findTurn(turnMessageId: number): ConversationTurnTrace | null;
77
+ /**
78
+ * A component shows the turn of this message: the loader reads until it holds the turn or knows the message started
79
+ * none. Returns the release (the component is gone).
80
+ */
81
+ requestTurn(turnMessageId: number): () => void;
82
+ /** A component shows the conversation's newest turns (a pane, a sub-agent's trace): the newest window is read. */
83
+ requestNewestTurns(): void;
84
+ /**
85
+ * The turn of this message runs: the loader follows it with a read of the changed turns every `pollIntervalMs` until
86
+ * the returned function is called (the turn ended), then reads it once more for its final figures.
87
+ */
88
+ followLiveTurn(turnMessageId: number, pollIntervalMs?: number): () => void;
89
+ /**
90
+ * Reads the changed turns every `pollIntervalMs` until the returned function is called, then once more: for a
91
+ * component that shows a conversation while it runs without naming a turn (a sub-agent's trace).
92
+ */
93
+ followChanges(pollIntervalMs?: number): () => void;
94
+ /**
95
+ * Tells the loader where the conversation stands (a value that changes with every new message, e.g. its message
96
+ * count and newest id). A changed value makes the loader read the changed turns.
97
+ */
98
+ noteConversationRevision(conversationRevision: string | number): void;
99
+ /** Reads the changed turns now (the stop of a turn was accepted, a diff was stored). */
100
+ refresh(): void;
101
+ /** Stops the loader's timer; the turns it holds stay readable. */
102
+ dispose(): void;
103
+ protected noteChange(): void;
104
+ protected startPolling(): void;
105
+ protected stopPolling(): void;
106
+ /** Every request of one tick becomes one decision: the components of a thread mount together. */
107
+ protected schedulePump(): void;
108
+ protected pump(): void;
109
+ protected runRead(read: TraceRead): Promise<ConversationTurnTraces>;
110
+ /** The one read to run next, or null when the loader holds everything that is wanted. */
111
+ protected chooseNextRead(): TraceRead | null;
112
+ /**
113
+ * The position a follow read asks after: the newest row read, moved back before the first row of every turn that
114
+ * runs or just ended, so those turns come back whole (a step's status changes without a new row).
115
+ */
116
+ protected readFollowPosition(): number | null;
117
+ /**
118
+ * Whether turns older than the held ones exist after `traces` was read. Only a page read knows (the newest page, a
119
+ * page of older turns), and only the page that reaches back at least as far as the oldest held turn decides; a
120
+ * follow-up read is no page and leaves the fact as it is.
121
+ */
122
+ protected readHasOlderTurns(read: TraceRead, traces: ConversationTurnTraces): boolean;
123
+ protected acceptRead(read: TraceRead, traces: ConversationTurnTraces): void;
124
+ protected publish(change: Partial<ConversationTraceState>): void;
125
+ }
126
+ /**
127
+ * The loader of a conversation's trace at one level: one per client, conversation and level, so every component that
128
+ * shows a turn of that conversation shares its reads and what it holds.
129
+ */
130
+ export declare const getConversationTraceLoader: (client: ConversationTraceClient, conversationId: number, options?: ConversationTraceLoaderOptions) => ConversationTraceLoader;
131
+ /** Drops the loaders of a client (a test, a sign-out): their timers stop and the next read starts over. */
132
+ export declare const releaseConversationTraceLoaders: (client: ConversationTraceClient) => void;
133
+ export {};