@mgamadeus/ddd-agents 0.11.12 → 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,594 @@
1
+ /**
2
+ * The turn trace of a conversation as the conversation client port returns it: what the agent did in each turn, step by
3
+ * step, for the step rows of the chat and of an analysis view. The shape follows the server's trace read
4
+ * (`GET …/{id}/trace`): a field keeps the server's name where it is neutral, and a server name that carries its entity
5
+ * vocabulary is renamed (`initiatorMessageId` → `turnMessageId`, `wasHeldForOwnerConsent` → `isHeldForConsent`,
6
+ * `fileChangeId` → `id`). The server decides how much a read carries (`level`): the fields marked "debug level" are
7
+ * null or absent in a read at the level of steps.
8
+ */
9
+ /** How much a trace read carries: the steps as the owner may read them, or the debug facts beside them. */
10
+ export type ConversationTraceLevel = "STEPS" | "DEBUG";
11
+ export type ConversationTraceStepKind = "THINKING" | "MODEL_CALL" | "TOOL_CALL" | "SKILL_LOAD" | "SUB_AGENT" | "WIDGET" | "COMPACTION" | "SIGNAL" | "DECISION" | "TASK_PLAN" | "ERROR";
12
+ /** What a tool does to the data it works on, as the tool declared it. */
13
+ export type ConversationTraceToolEffect = "READ" | "WORKSPACE" | "WRITE" | "DELETE";
14
+ /** The status of a step: the stored status of its call, or `ERROR` for an error row. */
15
+ export type ConversationTraceStepStatus = "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCEL_REQUESTED" | "CANCELLED" | "ERROR"
16
+ /** A control tool of the loop refused the call by design (`wait_for_sub_agents` on a turn that owes an answer): no failure. */
17
+ | "REFUSED";
18
+ /** Why a control call was refused (`step.refusalReason`); `other` for a refusal text the server does not know. */
19
+ export type ConversationTraceRefusalReason = "turnAnswersOwner" | "ownerWroteDuringTurn" | "noSubAgentRunning" | "other";
20
+ /** What a sub-agent's task is (`subAgent.taskKind`): a task in words, a background job (one tool or operation, no model call), a run that exists already. */
21
+ export type ConversationTraceSubAgentTaskKind = "agent" | "toolRun" | "awaitedRun";
22
+ export type ConversationFileChangeType = "ADDED" | "MODIFIED" | "DELETED" | "RENAMED" | "DIRECTORY_CREATED";
23
+ /**
24
+ * What a file change carries as its diff: none (not a content change), the whole diff inline (`diffPreview`), a
25
+ * preview with the whole diff stored (`getFileChangeDiff`), a binary file, a file over the size cap, or a diff that
26
+ * could not be computed.
27
+ */
28
+ export type ConversationFileChangeDiffState = "NONE" | "INLINE" | "STORED" | "BINARY" | "TOO_LARGE" | "UNAVAILABLE";
29
+ /** A record a call's arguments name by id; the host maps the argument name to a label and a route. */
30
+ export interface ConversationTraceEntityReference {
31
+ argumentName: string;
32
+ id: number;
33
+ }
34
+ /** One field a call changed on one record: the stored column name and its value before and after the call, as text. */
35
+ export interface ConversationTraceFieldChange {
36
+ fieldName: string;
37
+ /** Null when the record did not exist yet or the field was empty. */
38
+ before: string | null;
39
+ /** Null when the record was deleted or the field was emptied. */
40
+ after: string | null;
41
+ /** A value was cut (a long text, a credential shortened to its first characters). */
42
+ isCut: boolean;
43
+ }
44
+ /** What a call did to one record. */
45
+ export type ConversationTraceRecordChangeOperation = "CREATED" | "CHANGED" | "DELETED";
46
+ /** One record a call created, changed or deleted, captured at the call's own write statements. */
47
+ export interface ConversationTraceRecordChange {
48
+ operation: ConversationTraceRecordChangeOperation;
49
+ /** The table of the record (`SupportDirectives`). */
50
+ tableName: string;
51
+ /** Null for a created record whose id the database assigned. */
52
+ recordId: number | null;
53
+ fieldChanges: ConversationTraceFieldChange[];
54
+ /** Changed fields left out beyond the server's cap. */
55
+ omittedFieldCount: number;
56
+ }
57
+ /** The facts of one model call (debug level). */
58
+ export interface ConversationTraceModelCall {
59
+ modelName: string | null;
60
+ effort: string | null;
61
+ inputTokens: number | null;
62
+ outputTokens: number | null;
63
+ cachedInputTokens: number | null;
64
+ /** The share of the input tokens read from the cache, 0–100. */
65
+ cachePercent: number | null;
66
+ costInUsd: number | null;
67
+ reasoningTokens: number | null;
68
+ /** Input tokens the call wrote to the cache. */
69
+ cacheWriteTokens: number | null;
70
+ /** The provider API the call went through, as the server names it. */
71
+ wireApi: string | null;
72
+ /** The tool the call was forced to choose, when one was forced. */
73
+ forcedToolChoice: string | null;
74
+ /** Milliseconds the provider took, and milliseconds the loop spent around the call. */
75
+ providerCallMs: number | null;
76
+ loopOverheadMs: number | null;
77
+ /** The request of the call is stored (the sent payload can be read). */
78
+ hasStoredPayload: boolean;
79
+ /** The message whose context composition is the context of this call; null when the server names none. */
80
+ contextMessageId: number | null;
81
+ /** 1 for the first model call of the turn, 2 for the next. */
82
+ callNumberInTurn: number | null;
83
+ /** The tools the model called in this call, in order; empty when it answered with text. */
84
+ toolNames: string[];
85
+ /** How the call ended (`toolCalls`, `answer`, `empty`), as the server derives it. */
86
+ stopReason: string | null;
87
+ /** How tools were delivered on the call (`callTool`, `direct`), when stored. */
88
+ toolDelivery: string | null;
89
+ retryCount: number | null;
90
+ }
91
+ /** One probability a decision stored beside its answer. */
92
+ export interface ConversationTraceDecisionProbability {
93
+ name: string;
94
+ /** 0–1. */
95
+ probability: number;
96
+ }
97
+ /** A decision the agent's loop took beside the model (a `DECISION` step; debug level). */
98
+ export interface ConversationTraceDecision {
99
+ /** Which decision it is, as the server keys it (`replyLanguage`, `skillPreload`, `reasoningEffort`, …). */
100
+ site: string | null;
101
+ /** The decision's name in words, as the server words it ("Reply language"). */
102
+ siteLabel: string | null;
103
+ /** What keeps two decisions of one site apart (a pass, the tool of a consent, the evicted skill). */
104
+ subject: string | null;
105
+ /** Who decided (`decisionModel`, `rule`, `default`), and the same in words ("Decision model", "Rule · platform"). */
106
+ engine: string | null;
107
+ engineLabel: string | null;
108
+ /** The site's mode when it decided (`on`, `shadow`). */
109
+ mode: string | null;
110
+ /**
111
+ * Where the decision stands: `APPLIED` (the loop acted on it), `DECIDED` (answered, nothing to apply), `SHADOW`
112
+ * (answered, recorded only), `FALLBACK` (no answer), `SKIPPED` (nobody was asked).
113
+ */
114
+ status: string | null;
115
+ /** What came of it, in one line ("effort medium → high"). */
116
+ resultSummary: string | null;
117
+ modelName: string | null;
118
+ modelVersion: string | null;
119
+ /** The call's time; the decisions of one request share it. */
120
+ durationMs: number | null;
121
+ /**
122
+ * How many decisions of the turn one request answered together (all with its duration): the step of the first of
123
+ * them alone carries the duration on its row. Null or absent for a decision with a request of its own.
124
+ */
125
+ sharedRequestDecisionCount?: number | null;
126
+ /** The leading probability of the answer, 0–1. */
127
+ confidence: number | null;
128
+ /** The probabilities the decision stored, highest first. */
129
+ probabilities: ConversationTraceDecisionProbability[];
130
+ /** Why the loop went on without the decision's answer (`FALLBACK`). */
131
+ fallbackReason: string | null;
132
+ /** Why the answer led to no action. */
133
+ skipReason: string | null;
134
+ /** The state the decision was sent, the questions it was asked, the model's raw answers and what the loop resolved from them, each as JSON text. */
135
+ inputJson: string | null;
136
+ isInputCut: boolean;
137
+ questionsJson: string | null;
138
+ isQuestionsCut: boolean;
139
+ outputJson: string | null;
140
+ isOutputCut: boolean;
141
+ outcomeJson: string | null;
142
+ isOutcomeCut: boolean;
143
+ }
144
+ /** One skill (or single tool) of a skill load. */
145
+ export interface ConversationTraceSkillLoadEntry {
146
+ name: string;
147
+ /** `SKILL` or `TOOL`. */
148
+ type: string | null;
149
+ /** `LOADED`, `ALREADY_LOADED`, `NOT_LOADED`. */
150
+ outcome: string | null;
151
+ /** `MODEL`, `DECISION_MODEL`, `PLAN_ITEM`, `STRUCTURAL`, `ALWAYS_LOADED`, `TOOL_CALL`. */
152
+ cause: string | null;
153
+ residentTokens: number | null;
154
+ /** Tokens of the skill with the schemas of its tools. */
155
+ residentTokensWithTools: number | null;
156
+ tools: ConversationTraceLoadedSkillTool[];
157
+ }
158
+ /** What a step loaded: a `SKILL_LOAD` step, or a tool call that loaded skills (the entries at debug level only). */
159
+ export interface ConversationTraceSkillLoad {
160
+ /** `MODEL` (the model asked for it), `PRELOAD` (loaded without a call of the model), `TOOL_CALL` (another tool's call loaded it). */
161
+ cause: string | null;
162
+ loadedCount: number | null;
163
+ notLoadedCount: number | null;
164
+ /** The names the model asked for. */
165
+ requestedNames: string[];
166
+ skills: ConversationTraceSkillLoadEntry[];
167
+ /** What was not loaded and why, as the server stored it. */
168
+ notLoadedText: string | null;
169
+ }
170
+ /** One item of a task plan. */
171
+ export interface ConversationTraceTaskPlanItem {
172
+ key: string;
173
+ /** The item's number in the plan ("1", "1.2"). */
174
+ numberPath: string | null;
175
+ depth: number;
176
+ title: string;
177
+ /** `open`, `done`, `blocked`, … as the server stores it. */
178
+ status: string | null;
179
+ }
180
+ /** The compaction of a `COMPACTION` step (the summary text at debug level only). */
181
+ export interface ConversationTraceCompaction {
182
+ /** The level of the summary (a summary of summaries has a higher one). */
183
+ level: number | null;
184
+ /** Messages the summary stands for, and the positions of the first and the last of them. */
185
+ foldedMessageCount: number | null;
186
+ foldedFromMessageIndex: number | null;
187
+ foldedToMessageIndex: number | null;
188
+ /** Tokens of those messages, and tokens of the summary in their place. */
189
+ tokensBefore: number | null;
190
+ tokensAfter: number | null;
191
+ /** The share of the folded tokens the summary saved, 0–100. */
192
+ compressionPercent: number | null;
193
+ modelName: string | null;
194
+ summaryText: string | null;
195
+ isSummaryCut: boolean;
196
+ /** The facts the compaction keeps beside its summary, as JSON text. */
197
+ preservedFactsJson: string | null;
198
+ }
199
+ /** The signal of a `SIGNAL` step: a note the platform wrote into the conversation. */
200
+ export interface ConversationTraceSignal {
201
+ source: string | null;
202
+ /** The tag of a text that starts with `[SIGNAL:<kind>]` (`plan`, `ui`), else the source in words. */
203
+ kind: string | null;
204
+ /** The tag of a text that starts with `[SIGNAL:<tag>]`, as written; null when the text carries none (the source stays in `source`). */
205
+ tag?: string | null;
206
+ text: string | null;
207
+ isTextCut: boolean;
208
+ }
209
+ /** The widget of a `WIDGET` step (the payload at debug level only). */
210
+ export interface ConversationTraceWidget {
211
+ type: string | null;
212
+ /** Who emitted it (`model`, a tool), as the server names it. */
213
+ emittedBy: string | null;
214
+ /** The payload passed the widget's validation. */
215
+ isValid: boolean;
216
+ /** The widget's own title and summary, where its payload names them. */
217
+ title: string | null;
218
+ summary: string | null;
219
+ payloadJson: string | null;
220
+ isPayloadCut: boolean;
221
+ /** The message that holds the widget. */
222
+ messageId?: number | null;
223
+ /** The id of the `WIDGET` step of the widget (`m<messageId>.widget<ordinal>`). */
224
+ stepId?: string | null;
225
+ }
226
+ export interface ConversationTraceLoadedSkillTool {
227
+ name: string;
228
+ /** Tokens the tool's schema holds in the context. */
229
+ residentTokens: number | null;
230
+ /** Calls of the tool in the conversation so far. */
231
+ usageCount: number | null;
232
+ }
233
+ /** A skill loaded at a model call, with its tools (debug level). */
234
+ export interface ConversationTraceLoadedSkill {
235
+ name: string;
236
+ residentTokens: number | null;
237
+ /** Loaded since the model call before. */
238
+ isNew: boolean;
239
+ /** Loaded by the conversation itself, never by a `load` call. */
240
+ isAlwaysLoaded: boolean;
241
+ /** What loaded the skill (`MODEL`, `DECISION_MODEL`, `PLAN_ITEM`, `STRUCTURAL`, `ALWAYS_LOADED`, …), as the server names it. */
242
+ cause: string | null;
243
+ tools: ConversationTraceLoadedSkillTool[];
244
+ }
245
+ /** The shell command of a call (the output at debug level only). */
246
+ export interface ConversationTraceTerminal {
247
+ command: string | null;
248
+ cwd: string | null;
249
+ exitCode: number | null;
250
+ durationMs: number | null;
251
+ output: string | null;
252
+ errorOutput: string | null;
253
+ /** The output was shortened by the runner. */
254
+ isTruncated: boolean;
255
+ isBackground: boolean;
256
+ timedOut: boolean;
257
+ }
258
+ /** One file a call changed (the diff preview at debug level only). */
259
+ export interface ConversationFileChange {
260
+ id: number | null;
261
+ /** Where the change happened (`SANDBOX`, `CLOUDDRIVE`, `EXTERNAL_DRIVE`). */
262
+ source: string | null;
263
+ /** The kind of the mount (`OWN_DRIVE`, `SHARED_DRIVE`, `EXTERNAL_DRIVE`, `SCRATCH`); the host labels it. */
264
+ mountKind: string | null;
265
+ mountName: string | null;
266
+ driveSpaceId: number | null;
267
+ path: string;
268
+ /** The path before a rename. */
269
+ previousPath: string | null;
270
+ changeType: ConversationFileChangeType | null;
271
+ sizeBefore: number | null;
272
+ sizeAfter: number | null;
273
+ sha256Before: string | null;
274
+ sha256After: string | null;
275
+ contentType: string | null;
276
+ isBinary: boolean;
277
+ linesAdded: number | null;
278
+ linesRemoved: number | null;
279
+ diffState: ConversationFileChangeDiffState | null;
280
+ /** The diff as unified diff text: all of it (`INLINE`) or its start (`STORED`). */
281
+ diffPreview: string | null;
282
+ driveNodeId: number | null;
283
+ driveFileVersionId: number | null;
284
+ externalRevisionId: string | null;
285
+ }
286
+ export interface ConversationTraceSubAgentRun {
287
+ runNumber: number | null;
288
+ /** `QUEUED`, `RUNNING`, `COMPLETED`, `FAILED`, `CANCELLED`, … as the server stores it. */
289
+ status: string | null;
290
+ startedAt: string | null;
291
+ finishedAt: string | null;
292
+ /** What the sub-agent answered its parent. */
293
+ verdict: string | null;
294
+ failureReason: string | null;
295
+ costInUsd: number | null;
296
+ inputTokens: number | null;
297
+ outputTokens: number | null;
298
+ /** What the run reported, readable: the text of a tool response, never its JSON (both levels). */
299
+ resultText?: string | null;
300
+ isResultTextCut?: boolean;
301
+ /** The run stored the serialized response of a tool; `verdict` (the raw JSON) is then debug level only. */
302
+ isToolResponse?: boolean;
303
+ /** A tool response only: it reported an error; null otherwise. */
304
+ isError?: boolean | null;
305
+ }
306
+ /** The sub-agent of a `SUB_AGENT` step. */
307
+ export interface ConversationTraceSubAgent {
308
+ /** The number of the sub-agent in its parent conversation. */
309
+ number: number | null;
310
+ label: string;
311
+ taskText: string | null;
312
+ skillNames: string[];
313
+ childConversationId: number | null;
314
+ /** The status of the newest run. */
315
+ status: string | null;
316
+ runs: ConversationTraceSubAgentRun[];
317
+ /** The model the sub-agent's conversation ran on (debug level). */
318
+ modelName: string | null;
319
+ /** That model as the model catalog names it ("GPT-6 Luna"); null when the server names none (debug level). */
320
+ modelLabel?: string | null;
321
+ /** The totals of the sub-agent's conversation over all its runs (debug level). */
322
+ costInUsd: number | null;
323
+ inputTokens: number | null;
324
+ outputTokens: number | null;
325
+ cachedInputTokens: number | null;
326
+ messageCount: number | null;
327
+ /** What the task is; null when the server names none. */
328
+ taskKind?: ConversationTraceSubAgentTaskKind | null;
329
+ /** A `toolRun` task: the tool it runs; null for an operation the application names. */
330
+ toolName?: string | null;
331
+ /** A `toolRun` task: the operation (`executeTool` for a tool, else the application's operation name). */
332
+ operationName?: string | null;
333
+ /** A `toolRun` task: the stable id of the background job, `<operation>:<tool name>` (`executeTool:countRows`) or the operation. */
334
+ backgroundJobKey?: string | null;
335
+ /** The readable verdict of the current run (the text of a tool response for a background job). */
336
+ verdictText?: string | null;
337
+ /** What the current run reported, readable (both levels). */
338
+ resultText?: string | null;
339
+ isResultTextCut?: boolean;
340
+ }
341
+ /**
342
+ * A message of a turn as the trace carries it: the message that started the turn, or a text the assistant wrote in
343
+ * it. The text is the stored one (widget blocks and line breaks kept) with credentials shortened; a long text is cut
344
+ * (`isTextCut`) and its whole text is read by the per-message read of the audience.
345
+ */
346
+ export interface ConversationTraceMessage {
347
+ messageId: number | null;
348
+ /** The position of the message in the conversation (`indexInConversation`). */
349
+ messageIndex: number | null;
350
+ /** Who wrote it: `OWNER`, `SIGNAL`, `ORCHESTRATOR` or `PLATFORM` for the message that started a turn, `ASSISTANT` for a text of the assistant. */
351
+ authorKind: string | null;
352
+ text: string;
353
+ /** Characters of the whole text. */
354
+ textChars: number;
355
+ isTextCut: boolean;
356
+ createdAt: string | null;
357
+ /** The source of a signal that started the turn, or the marker of a text the platform wrote in the agent's name; null for a plain message. */
358
+ signalSource: string | null;
359
+ /** A text of the assistant: the model call that wrote it also called tools (a text between two steps, not the turn's answer). */
360
+ isInterim: boolean;
361
+ /** A text of the assistant: the model that wrote it, as the model catalog names it ("GPT-6 Luna"), else in words. */
362
+ modelLabel: string | null;
363
+ /** Debug level: the name of that model as the server stores it. */
364
+ modelName: string | null;
365
+ /** The types of the widget blocks the text holds, in order. */
366
+ widgetTypes: string[];
367
+ /** An answer: the widgets it shows, in order (type, title, message; the payload at debug level only). */
368
+ widgets?: ConversationTraceWidget[];
369
+ /** An owner message that arrived while a turn ran, so it started no turn of its own at that moment. */
370
+ isQueuedDuringRun?: boolean;
371
+ /** Such a message: the number of the turn that was running when it arrived. */
372
+ arrivedDuringTurnNumber?: number | null;
373
+ /** Such a message: the number of the turn that took it up (the same turn or the next one); null while none has. */
374
+ handledInTurnNumber?: number | null;
375
+ /** Such a message: the platform note that handed it to the model. */
376
+ foldSignalMessageId?: number | null;
377
+ }
378
+ /** One step of a turn. */
379
+ export interface ConversationTraceStep {
380
+ /** A key that is stable within the turn: the server's step id, else the row's message id, its kind and its position. */
381
+ key: string;
382
+ /** The id the server gives the step, unique within the conversation (never parsed, only compared); null when it sends none. */
383
+ stepId: string | null;
384
+ /** The number of the turn the step belongs to; null when the server names none. */
385
+ turnNumber: number | null;
386
+ kind: ConversationTraceStepKind;
387
+ /** The stored message the step comes from; null for a step from an event. */
388
+ messageId: number | null;
389
+ /** The tool that was called: the real tool, also when the model called it through `call_tool`. */
390
+ toolName: string | null;
391
+ deliveredThroughCallTool: boolean;
392
+ effect: ConversationTraceToolEffect | null;
393
+ status: ConversationTraceStepStatus | null;
394
+ /** The stored status of the call when `status` tells something else (`FAILED` behind `REFUSED`). */
395
+ storedStatus?: string | null;
396
+ /** A `REFUSED` step: why the call was refused. */
397
+ refusalReason?: ConversationTraceRefusalReason | null;
398
+ /** The step of a background job in the trace of its own conversation: the operation it ran (`executeTool` or the application's). */
399
+ backgroundOperationName?: string | null;
400
+ /** That step: the stable id of the job, `<operation>:<tool name>` or the operation. */
401
+ backgroundJobKey?: string | null;
402
+ startedAt: string | null;
403
+ durationMs: number | null;
404
+ /** The narrated activity line, as the owner read it; null when none was narrated. */
405
+ line: string | null;
406
+ /** The tool name in words (`searchServiceAreas` reads "search service areas"). */
407
+ toolNameInWords: string | null;
408
+ /** The loaded skills that brought the tool at the time of the call; empty when unknown. */
409
+ toolSkillNames: string[];
410
+ /** The model of a `MODEL_CALL` or `THINKING` step in words ("GPT6 LUNA"). */
411
+ modelLabel: string | null;
412
+ /** What the model wrote about its thinking at a `THINKING` or `MODEL_CALL` step, where the provider returned it readable. */
413
+ thinkingSummary?: string | null;
414
+ entityReferences: ConversationTraceEntityReference[];
415
+ /** The records a writing call created, changed or deleted, each field before and after; empty for a read. */
416
+ recordChanges?: ConversationTraceRecordChange[];
417
+ /** Changed records left out beyond the server's cap. */
418
+ omittedRecordChangeCount?: number;
419
+ /** The owner-consent check held a write of the call back. */
420
+ isHeldForConsent: boolean;
421
+ /** A gate refused the call before it ran, or it was dropped as a repeat. */
422
+ isRefused: boolean;
423
+ /** The start of the text of an `ERROR` step. */
424
+ errorText: string | null;
425
+ /** The code of an `ERROR` step, as the server names it, and whether the turn went on with another model call after it. */
426
+ errorCode: string | null;
427
+ wasRetried: boolean;
428
+ /** The widget type of a `WIDGET` step. */
429
+ widgetType: string | null;
430
+ /** The widget of a `WIDGET` step. */
431
+ widget: ConversationTraceWidget | null;
432
+ /** The decision of a `DECISION` step. */
433
+ decision: ConversationTraceDecision | null;
434
+ /** The compaction of a `COMPACTION` step. */
435
+ compaction: ConversationTraceCompaction | null;
436
+ /** The signal of a `SIGNAL` step. */
437
+ signal: ConversationTraceSignal | null;
438
+ /** What the step loaded: a `SKILL_LOAD` step, or a tool call that loaded skills. */
439
+ skillLoad: ConversationTraceSkillLoad | null;
440
+ /** The items of the task plan after a `TASK_PLAN` step; empty when the server sends none. */
441
+ taskPlanItems: ConversationTraceTaskPlanItem[];
442
+ /** The task plan after a `TASK_PLAN` step. */
443
+ taskPlanTitle: string | null;
444
+ /** Top-level items of the plan, and how many of them are open (neither done nor blocked). */
445
+ taskPlanItemCount: number | null;
446
+ taskPlanOpenItemCount: number | null;
447
+ /** Top-level items that are done (or do not apply) and that are blocked; absent from a server that does not send them. */
448
+ taskPlanDoneItemCount?: number | null;
449
+ taskPlanBlockedItemCount?: number | null;
450
+ terminal: ConversationTraceTerminal | null;
451
+ fileChanges: ConversationFileChange[];
452
+ subAgent: ConversationTraceSubAgent | null;
453
+ /** Debug level: the arguments of the call as JSON. */
454
+ argumentsJson: string | null;
455
+ isArgumentsCut: boolean;
456
+ /** Debug level: the stored result of the call (its start when `isResultCut`). */
457
+ result: string | null;
458
+ /** Debug level: characters of the whole stored result. */
459
+ resultChars: number | null;
460
+ isResultCut: boolean;
461
+ /** Debug level: the facts of a `MODEL_CALL` or `THINKING` step. */
462
+ modelCall: ConversationTraceModelCall | null;
463
+ /** Debug level: the skills loaded at a model call; null when they are those of the model call before. */
464
+ loadedSkills: ConversationTraceLoadedSkill[] | null;
465
+ /** Debug level: the skills the call loaded. */
466
+ loadedSkillNames: string[];
467
+ /** The text the assistant wrote in the model call of this step, before the call's tools ran; null without one. */
468
+ assistantText: string | null;
469
+ /** Characters of that whole text. */
470
+ assistantTextChars: number | null;
471
+ isAssistantTextCut: boolean;
472
+ }
473
+ /** The figures of one turn (tokens, cost, model and effort at debug level only). */
474
+ export interface ConversationTurnTraceTotals {
475
+ durationMs: number | null;
476
+ inputTokens: number | null;
477
+ outputTokens: number | null;
478
+ cachedInputTokens: number | null;
479
+ /** The share of the input tokens read from the cache, 0–100. */
480
+ cachePercent: number | null;
481
+ costInUsd: number | null;
482
+ stepCount: number;
483
+ commandCount: number;
484
+ fileCount: number;
485
+ linesAdded: number;
486
+ linesRemoved: number;
487
+ modelName: string | null;
488
+ effort: string | null;
489
+ /** How the turn ended (`answered`, `gaveUp`, `failed`, `cancelled`, `expired`, `waitingForSubAgents`); null while it runs. */
490
+ outcome: string | null;
491
+ }
492
+ /** The trace of one turn: the message that started it and what the agent did until its answer. */
493
+ export interface ConversationTurnTrace {
494
+ /** The number of the turn in its conversation, from 1, oldest first. */
495
+ turnNumber: number;
496
+ /** The message that started the turn (the owner's message, a signal); null for rows before the first one. */
497
+ turnMessageId: number | null;
498
+ /** The position of that message in the conversation (`indexInConversation`); null when the server names none. */
499
+ turnMessageIndex: number | null;
500
+ startedAt: string | null;
501
+ isRunning: boolean;
502
+ /** The owner stopped the turn. */
503
+ isStoppedByOwner: boolean;
504
+ /** The message that started the turn, with its text; null when the server sends none. */
505
+ initiatorMessage: ConversationTraceMessage | null;
506
+ /** The texts the assistant wrote in the turn, in order: interim texts (`isInterim`) and the answer. */
507
+ answerMessages: ConversationTraceMessage[];
508
+ /** Owner messages that arrived while this turn ran (`isQueuedDuringRun`), in order; place them by `messageIndex`. */
509
+ queuedMessages?: ConversationTraceMessage[];
510
+ /** The loop started this turn for a queued owner message after the turn before had ended. */
511
+ isStartedForQueuedOwnerMessage?: boolean;
512
+ /** Such a turn: the platform note that is its first row. */
513
+ startedBySignalMessageId?: number | null;
514
+ steps: ConversationTraceStep[];
515
+ totals: ConversationTurnTraceTotals;
516
+ }
517
+ /**
518
+ * How a trace read was asked for: the page of the newest turns, a page from a turn number, or the follow-up read of a
519
+ * running conversation ("the turns that hold a row after this position"), which is no page.
520
+ */
521
+ export type ConversationTraceWindowMode = "NEWEST" | "FROM_TURN" | "FOLLOW_UP";
522
+ /** The answer of a trace read. */
523
+ export interface ConversationTurnTraces {
524
+ conversationId: number | null;
525
+ level: ConversationTraceLevel;
526
+ /** Oldest first. */
527
+ turns: ConversationTurnTrace[];
528
+ /** How the window was asked for; null when the server does not say. */
529
+ windowMode: ConversationTraceWindowMode | null;
530
+ /** Turns of the whole conversation; null when the server names no count. */
531
+ totalTurnCount: number | null;
532
+ /** The numbers of the first and the last turn of `turns`; null for an answer without turns. */
533
+ firstTurnNumber: number | null;
534
+ lastTurnNumber: number | null;
535
+ /**
536
+ * A page read (`NEWEST`, `FROM_TURN`): turns exist before the first, and after the last, turn of the page. Both are
537
+ * false on a follow-up read, which is no page: a reader keeps the paging facts of its page reads.
538
+ */
539
+ hasOlderTurns: boolean;
540
+ hasNewerTurns: boolean;
541
+ /** The position (`indexInConversation`) of the newest row the read saw: the `afterMessageIndex` of the next read. */
542
+ newestMessageIndex: number | null;
543
+ /** A turn runs right now. */
544
+ isRunLive: boolean;
545
+ }
546
+ /** Which turns a trace read returns. Without options: the newest turns, as many as the server's default window holds. */
547
+ export interface ConversationTurnTracesOptions {
548
+ /** The level asked for; the server answers at most the level the reader is allowed. */
549
+ level?: ConversationTraceLevel;
550
+ /** The first turn of the window (turns are numbered from 1, oldest first). */
551
+ fromTurnNumber?: number;
552
+ /** Turns of the window. */
553
+ limit?: number;
554
+ /** Only the turns that hold a row after this position, each of them whole: the read that follows a running turn. */
555
+ afterMessageIndex?: number;
556
+ }
557
+ /** The answer of a stop of the running turn. */
558
+ export interface ConversationTurnStop {
559
+ /** A running turn was stopped; false when none ran. */
560
+ isStopped: boolean;
561
+ /** The run state of the conversation after the stop, as the server stores it; null when it names none. */
562
+ runState: string | null;
563
+ }
564
+ /** One part of what a model call was sent (the system prompt, a skill, the tool schemas, the history, …). */
565
+ export interface ConversationContextSegment {
566
+ key: string;
567
+ /** The segment's name as the server words it. */
568
+ label: string;
569
+ tokens: number;
570
+ /** The share of the context, 0–100. */
571
+ percent: number | null;
572
+ }
573
+ /** What one model call was sent, by segment (debug level; the context ring's and the composition bar's data). */
574
+ export interface ConversationContextComposition {
575
+ messageId: number | null;
576
+ /** Tokens in the context at this call: the provider's count of the newest call when the server names it, else the segments' sum. */
577
+ totalTokens: number | null;
578
+ /**
579
+ * The size the context may reach before the conversation is compacted (the compaction threshold in effect, at most
580
+ * the model's context window); null when the server names none.
581
+ */
582
+ contextWindowTokens: number | null;
583
+ /** The share of that size in use, 0–100 (above 100 while a compaction is due). */
584
+ fillPercent: number | null;
585
+ segments: ConversationContextSegment[];
586
+ }
587
+ /** The whole diff of one file change (`diffState` `STORED`). */
588
+ export interface ConversationFileChangeDiff {
589
+ fileChangeId: number;
590
+ /** Unified diff text. */
591
+ diff: string;
592
+ /** The stored diff itself was cut at the server's cap. */
593
+ isCut: boolean;
594
+ }