@mgamadeus/ddd-agents 0.12.0 → 0.14.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 (65) hide show
  1. package/README.md +76 -0
  2. package/dist/admin.js +133 -6
  3. package/dist/admin.js.map +1 -1
  4. package/dist/chat.js +1303 -409
  5. package/dist/chat.js.map +1 -1
  6. package/dist/chunks/{agents-http-trace-mappers-LWNi-3a4.js → agents-http-trace-mappers-juBx_kw5.js} +64 -22
  7. package/dist/chunks/agents-http-trace-mappers-juBx_kw5.js.map +1 -0
  8. package/dist/chunks/{canvas-title-slot-context-BRGnFzYP.js → canvas-label-context-B54MYVLF.js} +16 -4
  9. package/dist/chunks/canvas-label-context-B54MYVLF.js.map +1 -0
  10. package/dist/chunks/{content-from-unified-diff-CovnmG2Q.js → content-from-unified-diff-lgH6CejC.js} +77 -46
  11. package/dist/chunks/content-from-unified-diff-lgH6CejC.js.map +1 -0
  12. package/dist/chunks/{contract-886XjdID.js → contract-CIXLnSqL.js} +2 -1
  13. package/dist/chunks/{contract-886XjdID.js.map → contract-CIXLnSqL.js.map} +1 -1
  14. package/dist/chunks/conversation-B7-evdj_.js.map +1 -1
  15. package/dist/chunks/conversation-trace-fVeh6Lg6.js +6 -0
  16. package/dist/chunks/conversation-trace-fVeh6Lg6.js.map +1 -0
  17. package/dist/chunks/index-DZovGMpG.js.map +1 -1
  18. package/dist/client.js +13 -8
  19. package/dist/client.js.map +1 -1
  20. package/dist/contract.js +3 -1
  21. package/dist/contract.js.map +1 -1
  22. package/dist/files/i18n-keys.json +671 -12
  23. package/dist/files/styles/_surfaces.scss +5 -0
  24. package/dist/renderer.js +10 -8
  25. package/dist/styles.css +920 -39
  26. package/dist/types/admin/connections/AgentConnectionsPanel.d.ts +9 -1
  27. package/dist/types/admin/connections/agent-connection-oauth.d.ts +17 -1
  28. package/dist/types/admin/skills/SkillLoadSourcesPanel.d.ts +20 -0
  29. package/dist/types/admin/skills/agent-skill-catalog-api.d.ts +14 -2
  30. package/dist/types/admin/skills/agent-skill-catalog-types.d.ts +36 -0
  31. package/dist/types/chat/CanvasResizeHandle/CanvasResizeHandle.d.ts +2 -0
  32. package/dist/types/chat/CanvasResizeHandle/use-canvas-resize.d.ts +4 -2
  33. package/dist/types/chat/ConversationMessage/ConversationCallMarkerChip/ConversationCallMarkerChip.d.ts +6 -1
  34. package/dist/types/chat/ConversationMessageList/ConversationMessageList.d.ts +8 -1
  35. package/dist/types/chat/ConversationMessageList/message-times.d.ts +55 -0
  36. package/dist/types/chat/ConversationView.d.ts +3 -0
  37. package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +3 -0
  38. package/dist/types/chat/canvas-layout.d.ts +13 -0
  39. package/dist/types/chat/controller/AgentChatController.d.ts +7 -0
  40. package/dist/types/chat/trace/TaskPlanDrawer.d.ts +45 -0
  41. package/dist/types/chat/trace/TaskPlanPane.d.ts +21 -12
  42. package/dist/types/chat/trace/ToolStepGroup.d.ts +2 -0
  43. package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +10 -2
  44. package/dist/types/chat/trace/index.d.ts +4 -1
  45. package/dist/types/chat/trace/task-plan-tree.d.ts +55 -0
  46. package/dist/types/chat/trace/trace-collect.d.ts +15 -0
  47. package/dist/types/chat/trace/trace-types.d.ts +20 -0
  48. package/dist/types/chat/trace/trace-view-policy.d.ts +17 -0
  49. package/dist/types/client/http/agents-http-trace-mappers.d.ts +8 -1
  50. package/dist/types/client/http/agents-http-trace-wire.d.ts +27 -0
  51. package/dist/types/client/http/agents-http-wire.d.ts +4 -0
  52. package/dist/types/contract/conversation-trace.d.ts +63 -1
  53. package/dist/types/contract/conversation.d.ts +11 -0
  54. package/dist/types/entries/admin.d.ts +3 -2
  55. package/dist/types/entries/chat.d.ts +1 -0
  56. package/dist/types/entries/renderer.d.ts +1 -0
  57. package/dist/types/provider/components/types.d.ts +5 -0
  58. package/dist/types/provider/environment.d.ts +26 -0
  59. package/dist/types/provider/index.d.ts +1 -1
  60. package/dist/types/renderer/canvas/canvas-label-context.d.ts +10 -0
  61. package/package.json +1 -1
  62. package/public-api.json +51 -0
  63. package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js.map +0 -1
  64. package/dist/chunks/canvas-title-slot-context-BRGnFzYP.js.map +0 -1
  65. package/dist/chunks/content-from-unified-diff-CovnmG2Q.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { type ListDisplayMode, type UrlStateAdapter } from "@mgamadeus/ddd-admin-ui/logic";
2
2
  import { type ReactNode } from "react";
3
3
  import { type AgentConnectionsScope } from "./agent-connection-format";
4
- import { type AgentConnectionDriveSelection, type AgentConnectionLevelsRequest, type AgentConnectionsOAuthAdapter } from "./agent-connection-oauth";
4
+ import { type AgentConnectionDriveSelection, type AgentConnectionLevelsRequest, type AgentConnectionReconnectRequest, type AgentConnectionsOAuthAdapter } from "./agent-connection-oauth";
5
5
  import type { AgentConnectionsApi } from "./agent-connections-api";
6
6
  import { type AgentConnectionsTexts } from "./agent-connections-context";
7
7
  import { type AgentConnectionLogos } from "./connection-logos";
@@ -58,6 +58,14 @@ export interface AgentConnectionsPanelProps {
58
58
  /** A request to open the levels drawer of a connection (a deep link); handled once the list is loaded. */
59
59
  levelsRequest?: AgentConnectionLevelsRequest | null;
60
60
  onLevelsRequestHandled?: () => void;
61
+ /**
62
+ * A request to reconnect a connection (the deep link `?connection=<id>&reconnect=1`, e.g. "Reconnect" of a screen that
63
+ * found the connection expired): once the list is loaded the panel scrolls to the connection and starts its
64
+ * reconnect once; `onReconnectRequestHandled` then lets the host drop the parameters, so a reload does not start it
65
+ * again.
66
+ */
67
+ reconnectRequest?: AgentConnectionReconnectRequest | null;
68
+ onReconnectRequestHandled?: () => void;
61
69
  /** False: no "Drives and folders" (a host that does not mount the drive routes). Default true. */
62
70
  driveRoots?: boolean;
63
71
  /** The connection whose drives and folders are open, when the host keeps it (the URL); with it pass the callback. */
@@ -116,7 +116,23 @@ export interface AgentConnectionDriveSelection {
116
116
  }
117
117
  /** The query string (without `?`) of a drive selection: `connection=<id>[&driveRoot=<id>]`. */
118
118
  export declare const buildAgentConnectionDriveSearch: ({ connectionId, driveRootId }: AgentConnectionDriveSelection) => string;
119
- /** The drive selection of an address, `null` without a valid `connection` id. */
119
+ /**
120
+ * The drive selection of an address, `null` without a valid `connection` id. An address that asks to reconnect
121
+ * (`reconnect=1`, {@link readAgentConnectionReconnectRequest}) names the connection for that and opens no drives.
122
+ */
120
123
  export declare const readAgentConnectionDriveSelection: (parameters: Pick<URLSearchParams, "get">) => AgentConnectionDriveSelection | null;
124
+ /**
125
+ * The search parameters of the deep link that renews a connection: `connection=<id>&reconnect=1`. A screen that finds
126
+ * the connection expired links here ("Reconnect"); the panel scrolls to the connection and starts its reconnect once.
127
+ */
128
+ export declare const AGENT_CONNECTION_RECONNECT_LINK_PARAMETERS: readonly ["connection", "reconnect"];
129
+ /** A request to reconnect one connection (the deep link `connection=<id>&reconnect=1`). */
130
+ export interface AgentConnectionReconnectRequest {
131
+ connectionId: number;
132
+ }
133
+ /** The query string (without `?`) of a reconnect request: `connection=<id>&reconnect=1`. */
134
+ export declare const buildAgentConnectionReconnectSearch: ({ connectionId }: AgentConnectionReconnectRequest) => string;
135
+ /** The reconnect request of an address, `null` unless `reconnect=1` names a valid `connection` id. */
136
+ export declare const readAgentConnectionReconnectRequest: (parameters: Pick<URLSearchParams, "get">) => AgentConnectionReconnectRequest | null;
121
137
  /** The DOM id of a root's row in the drive roots of a connection (the target of the deep link). */
122
138
  export declare const agentConnectionDriveRootDomId: (connectionId: number, driveRootId: number | string) => string;
@@ -0,0 +1,20 @@
1
+ import type { AdminPeriod } from "../period/admin-period";
2
+ import type { AgentSkillCatalogApi } from "./agent-skill-catalog-api";
3
+ import type { AgentSkillLoadSource } from "./agent-skill-catalog-types";
4
+ export interface SkillLoadSourcesPanelProps {
5
+ api: Pick<AgentSkillCatalogApi, "useSkillLoadSourcesQuery">;
6
+ /** The period the loads are counted over. */
7
+ period: Pick<AdminPeriod, "from" | "to">;
8
+ className?: string;
9
+ }
10
+ /** The rows the card shows before "show all". */
11
+ export declare const SKILL_LOAD_SOURCES_COLLAPSED_ROW_COUNT = 12;
12
+ /** A skill the chat model loaded itself while no preload brought it in the period: a preload candidate. */
13
+ export declare const isSkillPreloadCandidate: (loadSource: AgentSkillLoadSource) => boolean;
14
+ /**
15
+ * How the skills came into conversations in a period, by source: the decision model's preloads (first pass and the
16
+ * follow-up pass under a preloaded root) and the chat model's own calls of the skill-loading tool, with the share of
17
+ * the preloading turns that used what was preloaded. A skill the model loads itself that no preload brought is
18
+ * marked as a preload candidate.
19
+ */
20
+ export declare const SkillLoadSourcesPanel: ({ api, period, className }: SkillLoadSourcesPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { type ApiQueryHook, type InjectableBaseApi, type InjectedRequest, type StaticQueryFailure } from "@mgamadeus/ddd-admin-ui/logic/pure";
2
- import type { AgentSkillCatalogResponse, AgentSkillLoadCountsResponse, AgentSkillPurposesResponse, AgentSkillSharedBlocksResponse, AgentSkillToolArg, AgentSkillToolDocumentationResponse, AgentSkillUsageArg } from "./agent-skill-catalog-types";
3
- /** The cache tag type of the skill catalog reads (ids `CATALOG`, `TOOL`, `SHARED_BLOCKS`, `PURPOSES`, `LOAD_COUNTS`). */
2
+ import type { AgentSkillCatalogResponse, AgentSkillLoadCountsResponse, AgentSkillLoadSourcesResponse, AgentSkillPurposesResponse, AgentSkillSharedBlocksResponse, AgentSkillToolArg, AgentSkillToolDocumentationResponse, AgentSkillUsageArg } from "./agent-skill-catalog-types";
3
+ /** The cache tag type of the skill catalog reads (ids `CATALOG`, `TOOL`, `SHARED_BLOCKS`, `PURPOSES`, `LOAD_COUNTS`, `LOAD_SOURCES`). */
4
4
  export declare const AGENT_SKILL_CATALOG_TAG = "AdminUiAgentSkillCatalog";
5
5
  /** The hooks `createAgentSkillCatalogApi` returns; `AgentSkillCatalogScreen` takes them as `api`. */
6
6
  export interface AgentSkillCatalogApi {
@@ -14,6 +14,8 @@ export interface AgentSkillCatalogApi {
14
14
  useSkillPurposesQuery: ApiQueryHook<AgentSkillUsageArg, AgentSkillPurposesResponse>;
15
15
  /** `GET /skillLoadCounts?from&to`: how often the model asked for each skill in a period. */
16
16
  useSkillLoadCountsQuery: ApiQueryHook<AgentSkillUsageArg, AgentSkillLoadCountsResponse>;
17
+ /** `GET /skillLoadSources?from&to`: the loads of each skill by source (preload, follow-up pass, the model) and the preload outcomes. */
18
+ useSkillLoadSourcesQuery: ApiQueryHook<AgentSkillUsageArg, AgentSkillLoadSourcesResponse>;
17
19
  }
18
20
  export interface CreateAgentSkillCatalogApiOptions {
19
21
  /** The host's RTK Query api (`createApi` with the React hooks module). */
@@ -28,6 +30,7 @@ export declare const buildAgentSkillCatalogRequests: (apiPrefix: string) => {
28
30
  sharedBlocks: () => InjectedRequest;
29
31
  purposes: (arg?: AgentSkillUsageArg) => InjectedRequest;
30
32
  skillLoadCounts: (arg?: AgentSkillUsageArg) => InjectedRequest;
33
+ skillLoadSources: (arg?: AgentSkillUsageArg) => InjectedRequest;
31
34
  };
32
35
  /** The operations as injected. */
33
36
  export declare const agentSkillCatalogEndpointDefinitions: (apiPrefix: string) => {
@@ -71,6 +74,14 @@ export declare const agentSkillCatalogEndpointDefinitions: (apiPrefix: string) =
71
74
  readonly id: "LOAD_COUNTS";
72
75
  }];
73
76
  };
77
+ readonly adminUiAgentSkillLoadSources: {
78
+ readonly kind: "query";
79
+ readonly request: (arg?: AgentSkillUsageArg) => InjectedRequest;
80
+ readonly providesTags: readonly [{
81
+ readonly type: "AdminUiAgentSkillCatalog";
82
+ readonly id: "LOAD_SOURCES";
83
+ }];
84
+ };
74
85
  };
75
86
  /**
76
87
  * Injects the skill catalog reads into the host's RTK Query api and returns their hooks. Call it once at module scope:
@@ -84,6 +95,7 @@ export interface StaticAgentSkillCatalogData {
84
95
  sharedBlocks?: () => AgentSkillSharedBlocksResponse | StaticQueryFailure | undefined;
85
96
  purposes?: (arg: AgentSkillUsageArg) => AgentSkillPurposesResponse | StaticQueryFailure | undefined;
86
97
  skillLoadCounts?: (arg: AgentSkillUsageArg) => AgentSkillLoadCountsResponse | StaticQueryFailure | undefined;
98
+ skillLoadSources?: (arg: AgentSkillUsageArg) => AgentSkillLoadSourcesResponse | StaticQueryFailure | undefined;
87
99
  }
88
100
  /** An `AgentSkillCatalogApi` answering fixed payloads, without a store or a request (previews, tests, reviews). */
89
101
  export declare const createStaticAgentSkillCatalogApi: (data: StaticAgentSkillCatalogData) => AgentSkillCatalogApi;
@@ -221,3 +221,39 @@ export interface AgentSkillLoadCountsResponse {
221
221
  isLoadCountDataAvailable?: boolean;
222
222
  loadCounts?: AgentSkillLoadCounts | null;
223
223
  }
224
+ /** How one skill came into conversations in a period, by source (`AISkillCatalogSkillLoadSource`). */
225
+ export interface AgentSkillLoadSource {
226
+ skillName: string;
227
+ /** Applied preloads of the decision model's first pass. */
228
+ preloadCount?: number;
229
+ /** Applied preloads of a follow-up pass (a sub-skill under a preloaded root). */
230
+ subPassPreloadCount?: number;
231
+ /** Calls of the skill-loading tool that named the skill: loads the chat model asked for itself. */
232
+ modelLoadCount?: number;
233
+ /** Turns that preloaded the skill and used a tool of a preloaded skill. */
234
+ preloadUsedCount?: number;
235
+ /** Turns that preloaded the skill and used none. */
236
+ preloadUnusedCount?: number;
237
+ }
238
+ /** The loads of a period by source (`AISkillCatalogSkillLoadSources`, an object set), with the preload outcomes. */
239
+ export interface AgentSkillLoadSources {
240
+ /** The skills, the most loaded by the chat model first. */
241
+ elements?: readonly AgentSkillLoadSource[] | null;
242
+ countedEventCount?: number;
243
+ /** True: the period holds more rows than one read counts; the newest were counted. */
244
+ isTruncated?: boolean;
245
+ preloadUsedTurnCount?: number;
246
+ preloadUnusedTurnCount?: number;
247
+ /** The share of the preloading turns that used the preload (0…1); null without one. */
248
+ preloadUsedShare?: number | null;
249
+ /** False: the chat model's own loads could not be counted on this database. */
250
+ isModelLoadCountAvailable?: boolean;
251
+ }
252
+ /** `GET {prefix}/skillLoadSources`. */
253
+ export interface AgentSkillLoadSourcesResponse {
254
+ rangeFrom?: string;
255
+ rangeTo?: string;
256
+ /** False: the turn events could not be read on this database. */
257
+ isLoadSourceDataAvailable?: boolean;
258
+ loadSources?: AgentSkillLoadSources | null;
259
+ }
@@ -2,6 +2,8 @@ import { RefObject } from "react";
2
2
  export interface CanvasResizeHandleProps {
3
3
  rootRef: RefObject<HTMLElement | null>;
4
4
  inset: number;
5
+ /** The narrowest the chat column gets (`AgentsCanvasLayout.chatColumnMinWidthPx`); default `CHAT_COLUMN_MIN_WIDTH_PX`. */
6
+ chatColumnMinWidthPx?: number;
5
7
  width: number | null;
6
8
  onWidthChange: (width: number | null) => void;
7
9
  onClose: () => void;
@@ -2,16 +2,18 @@ import { KeyboardEvent, PointerEvent as ReactPointerEvent, RefObject } from "rea
2
2
  /** `idle` (hidden until the pointer comes near), `hover`, `drag`, `armed` (pulled past the narrowest and held: release closes). */
3
3
  export type CanvasResizeTab = "idle" | "hover" | "drag" | "armed";
4
4
  export declare const rubberBand: (distance: number) => number;
5
- export declare const canvasWidthLimits: (rootWidth: number, inset: number) => {
5
+ export declare const canvasWidthLimits: (rootWidth: number, inset: number, chatColumnMinWidthPx?: number) => {
6
6
  min: number;
7
7
  max: number;
8
8
  };
9
- export declare const clampCanvasWidth: (width: number, rootWidth: number, inset: number) => number;
9
+ export declare const clampCanvasWidth: (width: number, rootWidth: number, inset: number, chatColumnMinWidthPx?: number) => number;
10
10
  interface UseCanvasResizeOptions {
11
11
  /** The split's root: the canvas pane's right edge is its right edge, and `--agents-canvas-width-drag` is written onto it while dragging. */
12
12
  rootRef: RefObject<HTMLElement | null>;
13
13
  /** The canvas card's inset from its pane edge — the handle sits on the card's edge. */
14
14
  inset: number;
15
+ /** The narrowest the chat column gets beside the canvas; default `CHAT_COLUMN_MIN_WIDTH_PX`. */
16
+ chatColumnMinWidthPx?: number;
15
17
  /** The pane width the customer set (px), or `null` for the canvas's default split. */
16
18
  width: number | null;
17
19
  onWidthChange: (width: number | null) => void;
@@ -4,6 +4,11 @@ export interface ConversationCallMarkerChipProps {
4
4
  signalSource: string;
5
5
  /** The signal's model-visible text — carries the duration as `NNNs` and the end reason as `reason <value>`. */
6
6
  signalText: string;
7
+ /**
8
+ * When the signal was written (ms). Given, every marker but "ended" names its clock time ("Voice chat started · 21:05"):
9
+ * the marker is the time head of what follows. Omitted: no time, as before.
10
+ */
11
+ moment?: number | null;
7
12
  }
8
13
  /**
9
14
  * Centered marker for a call's lifecycle inside the chat timeline: started, ended (with its duration), declined, missed
@@ -11,4 +16,4 @@ export interface ConversationCallMarkerChipProps {
11
16
  * from the otherwise user-invisible PHONE_CALL_* SIGNAL messages — the label derives from the signal source + the small text contract of AgentVoiceCall::buildLifecycleSignalText (`In-app call …` vs
12
17
  * `Phone call …`, duration `NNNs`, reason `reason <value>`); an unparsable text degrades to the plain label.
13
18
  */
14
- export declare const ConversationCallMarkerChip: React.MemoExoticComponent<({ signalSource, signalText }: ConversationCallMarkerChipProps) => import("react/jsx-runtime").JSX.Element>;
19
+ export declare const ConversationCallMarkerChip: React.MemoExoticComponent<({ signalSource, signalText, moment }: ConversationCallMarkerChipProps) => import("react/jsx-runtime").JSX.Element>;
@@ -3,6 +3,7 @@ import React from "react";
3
3
  import { ConversationMessageUserTheme } from "../ConversationMessage/ConversationMessageUser/ConversationMessageUser";
4
4
  import { ConversationErrorType } from "../store/conversation-error-type";
5
5
  import type { ChatMessage } from "../chat-message";
6
+ import { type MessageTimesMode } from "./message-times";
6
7
  import { Ref, RefObject } from "react";
7
8
  interface ConversationMessageListProps {
8
9
  className?: string;
@@ -64,6 +65,12 @@ interface ConversationMessageListProps {
64
65
  renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
65
66
  /** The backend refuses every widget signal of a closed conversation, so no widget renders its controls. */
66
67
  isConversationClosed?: boolean;
68
+ /**
69
+ * When what was written (`message-times.ts`): `turns` = day separators, a time head after a pause of 20 minutes,
70
+ * "finished HH:MM" under a long turn's answer, the exact time of each message on hover / focus / tap; `everyMessage`
71
+ * adds a quiet time under every message (a verbose view). Undefined / null: no times, as before.
72
+ */
73
+ messageTimes?: MessageTimesMode | null;
67
74
  }
68
75
  /**
69
76
  * The id of the newest widget-carrying assistant-role message the owner has not answered yet — null when the newest
@@ -76,5 +83,5 @@ export declare const findUnansweredWidgetMessageId: (messages: ChatMessage[]) =>
76
83
  * widget of the same name. Pure, order-based: the newest widget of a type is the live one.
77
84
  */
78
85
  export declare const findSupersededWidgetMessageIds: (messages: ChatMessage[]) => Set<string | number>;
79
- export declare const ConversationMessageList: ({ className, messages, currentCategory, aiPromptExtension, isDebugMode, aiThinking, thinkingIndicator, hideAssistantMeta, userMessageTheme, error, rateLimitRetryAfterSeconds, onRetryFailedRun, messagesBottomRef, messagesListRef, enableFreshMessageBlockReveal, taskInstructionMessageId, renderAfterMessage, renderAssistantAvatar, isConversationClosed, }: ConversationMessageListProps) => import("react/jsx-runtime").JSX.Element;
86
+ export declare const ConversationMessageList: ({ className, messages, currentCategory, aiPromptExtension, isDebugMode, aiThinking, thinkingIndicator, hideAssistantMeta, userMessageTheme, error, rateLimitRetryAfterSeconds, onRetryFailedRun, messagesBottomRef, messagesListRef, enableFreshMessageBlockReveal, taskInstructionMessageId, renderAfterMessage, renderAssistantAvatar, isConversationClosed, messageTimes, }: ConversationMessageListProps) => import("react/jsx-runtime").JSX.Element;
80
87
  export {};
@@ -0,0 +1,55 @@
1
+ import type { ChatMessage } from "../chat-message";
2
+ /**
3
+ * When what was written in the chat: the day separators, the time heads after a pause, the "finished HH:MM" under a
4
+ * long turn's answer and the exact time of each message.
5
+ *
6
+ * - `turns` (B): a separator before the first message of each day ("Today · 09:58"; without the time when a voice chat
7
+ * marker opens the day, it shows its own), a time head ("10:31") before a message that starts a turn more than
8
+ * {@link MESSAGE_TIME_PAUSE_MS} after the message before it. The agent's own steps and run time never cause one: the
9
+ * answer stays with its question, and a turn that took longer than the pause ends with "finished 10:24" under its
10
+ * answer. The exact time of each message on hover / keyboard focus, on touch by a tap.
11
+ * - `everyMessage` (C): `turns` plus a quiet time under every message.
12
+ */
13
+ export type MessageTimesMode = "turns" | "everyMessage";
14
+ /** The pause between two messages after which the next turn gets a time head, and the turn length that earns "finished". */
15
+ export declare const MESSAGE_TIME_PAUSE_MS: number;
16
+ /** What stands at one message of the list (by its index); every field is absent when nothing does. */
17
+ export interface MessageTimeMarks {
18
+ /** The message's moment (ms); null for a message without one (the owner's message before the server stored it). */
19
+ moment: number | null;
20
+ /** A day separator stands before the message; `withTime` names the time in it ("Today · 09:58"). */
21
+ daySeparator?: {
22
+ withTime: boolean;
23
+ };
24
+ /** A time head stands before the message (a turn after a pause). */
25
+ timeHead?: boolean;
26
+ /** "finished HH:MM" stands under the message: the last answer of a turn that ran longer than the pause. */
27
+ finishedAt?: number;
28
+ }
29
+ /** A voice chat (phone call) lifecycle marker: the list shows it as a centred chip that carries its own time. */
30
+ export declare const isCallMarkerMessage: (message: ChatMessage) => boolean;
31
+ /**
32
+ * The time marks of a message list (pure). `isShown` says which messages the list renders as a row; `dayKeyOf` maps a
33
+ * moment to its calendar day in the owner's time zone; `isTurnRunning` keeps the newest turn open (no "finished" before
34
+ * it ended).
35
+ */
36
+ export declare const buildMessageTimeMarks: (messages: readonly ChatMessage[], isShown: (message: ChatMessage) => boolean, dayKeyOf: (moment: number) => string, isTurnRunning: boolean) => MessageTimeMarks[];
37
+ /** The words and figures of the message times in the owner's locale and time zone. */
38
+ export interface MessageTimeFormat {
39
+ /** The clock time of a moment: `09:58`. */
40
+ time: (moment: number) => string;
41
+ /** The exact moment with the zone: `Mo., 30. Nov. 2026, 09:58:14 MEZ`. */
42
+ exact: (moment: number) => string;
43
+ /** The day of a moment for a separator: `Today`, `Yesterday`, `Mo., 24. Nov.`, `24. Nov. 2025` (another year). */
44
+ day: (moment: number) => string;
45
+ /** The calendar day of a moment in the owner's time zone, as a key (`2026-11-30`). */
46
+ dayKey: (moment: number) => string;
47
+ /** "finished 10:24". */
48
+ finished: (moment: number) => string;
49
+ }
50
+ /** Builds the formatters (undefined locale / zone: the runtime's). `now` is injected for tests. */
51
+ export declare const createMessageTimeFormat: (locale?: string | null, timeZone?: string | null, now?: () => number) => MessageTimeFormat;
52
+ /** The formatters of the owner's locale and time zone (`AgentsEnvironment.useOwnerSettings`), else the runtime's. */
53
+ export declare const useMessageTimeFormat: () => MessageTimeFormat;
54
+ /** `252` → `4:12 min`: the length of a voice chat, compact as the chat's marker shows it. */
55
+ export declare const formatCallLength: (durationSeconds: number) => string;
@@ -1,5 +1,6 @@
1
1
  import type { ChatAssistantCategory, ChatAssistantIdentity, ChatAssistantOpening } from "./chat-assistant-identity";
2
2
  import React from "react";
3
+ import type { MessageTimesMode } from "./ConversationMessageList/message-times";
3
4
  import { ConversationErrorType } from "./store/conversation-error-type";
4
5
  import type { ChatMessage } from "./chat-message";
5
6
  import { ConversationMessageUserTheme } from "./ConversationMessage/ConversationMessageUser/ConversationMessageUser";
@@ -221,6 +222,8 @@ export interface ConversationViewProps {
221
222
  renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
222
223
  /** Forwarded through ConversationViewBody to ConversationMessageList: a closed conversation renders no widget controls. */
223
224
  isConversationClosed?: boolean;
225
+ /** Forwarded through ConversationViewBody to ConversationMessageList: when what was written (`MessageTimesMode`). */
226
+ messageTimes?: MessageTimesMode | null;
224
227
  onSuggestionClick: (text: string) => void;
225
228
  onSendMessage: SendMessageHandler;
226
229
  }
@@ -6,6 +6,7 @@ import type { ConversationComposerWidget } from "../../renderer/conversation-com
6
6
  import { SendMessageHandler } from "../conversation-send-message";
7
7
  import { ConversationErrorType } from "../store/conversation-error-type";
8
8
  import type { ChatMessage } from "../chat-message";
9
+ import type { MessageTimesMode } from "../ConversationMessageList/message-times";
9
10
  import { ConversationMessageUserTheme } from "../ConversationMessage/ConversationMessageUser/ConversationMessageUser";
10
11
  export interface ConversationViewProps {
11
12
  currentCategory?: ChatAssistantCategory;
@@ -222,6 +223,8 @@ export interface ConversationViewProps {
222
223
  renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
223
224
  /** Forwarded to ConversationMessageList: a closed conversation renders no widget controls. */
224
225
  isConversationClosed?: boolean;
226
+ /** Forwarded to ConversationMessageList: when what was written (`MessageTimesMode`). */
227
+ messageTimes?: MessageTimesMode | null;
225
228
  onSuggestionClick: (text: string) => void;
226
229
  onSendMessage: SendMessageHandler;
227
230
  }
@@ -0,0 +1,13 @@
1
+ import type { AgentsCanvasLayout } from "../provider/environment";
2
+ /** `AgentsCanvasLayout` with every member set: the host's value, else the package's own chrome. */
3
+ export interface ResolvedCanvasLayout {
4
+ readonly showsCloseButton: boolean;
5
+ readonly showsDividerToggle: boolean;
6
+ readonly showsNarrowReopenControl: boolean;
7
+ readonly chatColumnMinWidthPx: number;
8
+ readonly boxedInsetPx: number;
9
+ readonly paneSurface: "card" | "none";
10
+ }
11
+ export declare const resolveCanvasLayout: (layout: AgentsCanvasLayout | undefined) => ResolvedCanvasLayout;
12
+ /** The canvas layout of this subtree's environment (`AgentsEnvironment.canvasLayout`). */
13
+ export declare const useCanvasLayout: () => ResolvedCanvasLayout;
@@ -4,6 +4,7 @@ import { type ConversationAttachmentReference } from "../../contract/conversatio
4
4
  import type { ChatMessage } from "../chat-message";
5
5
  import type { ConversationComposerWidget } from "../../renderer/conversation-composer-widget";
6
6
  import type { ComposerLibraryFile } from "../../renderer/composer-library-file";
7
+ import type { MessageTimesMode } from "../ConversationMessageList/message-times";
7
8
  import type { AgentsChatStore } from "../store/create-agents-chat-store";
8
9
  import { type AgentChatActivityTiming, type ResolvedAgentChatActivityTiming } from "./chat-activity-timing";
9
10
  import type { ChatScrollTarget } from "./chat-scroll-target";
@@ -169,6 +170,12 @@ export interface AgentChatControllerProps {
169
170
  * ends: the agent reads them after its current step. Default false.
170
171
  */
171
172
  showsQueuedMessages?: boolean;
173
+ /**
174
+ * When what was written in the thread (`MessageTimesMode`): `turns` = day separators, a time head after a pause,
175
+ * "finished HH:MM" under a long turn's answer, the exact time on hover / focus / tap; `everyMessage` adds a quiet time
176
+ * under every message (e.g. the host's verbose view). Default: none.
177
+ */
178
+ messageTimes?: MessageTimesMode | null;
172
179
  /** Rendered inside the chat's widget provider (the host's canvas syncs). */
173
180
  children?: ReactNode;
174
181
  /**
@@ -0,0 +1,45 @@
1
+ import type { TaskPlanTree, TaskPlanTreeNode } from "./task-plan-tree";
2
+ import type { TraceTaskPlanItemSource, TraceTaskPlanRejection } from "./trace-collect";
3
+ /** What the detail view shows: the plan, or one item by its key. */
4
+ export type TaskPlanDetailTarget = {
5
+ kind: "plan";
6
+ } | {
7
+ kind: "item";
8
+ key: string;
9
+ };
10
+ export interface TaskPlanDrawerProps {
11
+ target: TaskPlanDetailTarget;
12
+ tree: TaskPlanTree;
13
+ /** The plan's title: the request it was made for. */
14
+ title?: string | null;
15
+ /** Per item key, the plan update that last changed it and the one it first appeared in. */
16
+ itemSources?: Readonly<Record<string, TraceTaskPlanItemSource>>;
17
+ itemFirstSources?: Readonly<Record<string, TraceTaskPlanItemSource>>;
18
+ /** Debug level: what refused plan calls told the agent. */
19
+ rejections?: readonly TraceTaskPlanRejection[];
20
+ /** When the plan was last updated (a server date-time). */
21
+ updatedAt?: string | null;
22
+ onNavigate: (target: TaskPlanDetailTarget) => void;
23
+ onClose: () => void;
24
+ /** Leads to the plan update in the trace; without it the times are plain text. */
25
+ onShowSource?: (node: TaskPlanTreeNode, source: TraceTaskPlanItemSource) => void;
26
+ }
27
+ /** The state mark of an item: a ring, filled to the closed share for an open container. */
28
+ export declare const TaskPlanMark: ({ node }: {
29
+ node: TaskPlanTreeNode;
30
+ }) => import("react/jsx-runtime").JSX.Element;
31
+ /** The leaves of nodes as small segments, one per leaf, coloured by its state. */
32
+ export declare const TaskPlanSegments: ({ nodes, isSmall }: {
33
+ nodes: readonly TaskPlanTreeNode[];
34
+ isSmall?: boolean;
35
+ }) => import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * The detail view of the work plan, for the plan or for one item. The plan: its goal (the request it was made for),
38
+ * its progress with the counts, its result once finished (every step with its note), when it was made and changed and
39
+ * where its items came from. An item: its state with the note (what was produced, why it is blocked, why it does not
40
+ * apply) and whether it waits for the owner, its subtasks with their part progress, when it is done (by its subtasks,
41
+ * by the record, by the agent's tick), its origin and times; at the debug level the agent's instruction, the seeded
42
+ * declarations and the rejected plan changes that name it. The head leads back to the plan, up to the parent and to the
43
+ * item before and after it in the plan.
44
+ */
45
+ export declare const TaskPlanDrawer: (props: TaskPlanDrawerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,40 @@
1
- import type { ReactNode } from "react";
2
- import type { TraceTaskPlanItemSource } from "./trace-collect";
1
+ import { type ReactNode } from "react";
2
+ import { type TaskPlanDetailTarget } from "./TaskPlanDrawer";
3
+ import type { TraceTaskPlanItemSource, TraceTaskPlanRejection } from "./trace-collect";
3
4
  import type { TraceTaskPlanStepItem } from "./trace-types";
4
5
  export interface TaskPlanPaneProps {
5
- /** The plan's own title ("Support.Ticket"); it follows the word "Plan". */
6
+ /** The plan's own title (the request it was made for); it heads the pane. */
6
7
  title?: string | null;
7
- /** The items in the plan's order; without them the pane shows the counts alone. */
8
+ /** The items in the plan's order, each with its `depth`; without them the pane shows the counts alone. */
8
9
  items: TraceTaskPlanStepItem[];
9
10
  /**
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`.
11
+ * Top-level items of the plan, how many of them are done or do not apply, and how many are blocked: the counts of a
12
+ * plan whose items the reader does not have. With items the pane counts their leaves.
12
13
  */
13
14
  itemCount?: number | null;
14
15
  doneCount?: number | null;
15
16
  blockedCount?: number | null;
16
- /** A quiet line under the head (the turn that last updated the plan). */
17
+ /** A quiet line under the title (the turn that last updated the plan). */
17
18
  note?: ReactNode;
18
19
  /**
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`).
20
+ * Per item key, the plan update that last changed the item (`TraceTaskPlanSnapshot.itemSources`) and the one it first
21
+ * appeared in: the times of the detail view. With `onSelectItem` the detail view leads to that step in the trace.
21
22
  */
22
23
  itemSources?: Readonly<Record<string, TraceTaskPlanItemSource>>;
24
+ itemFirstSources?: Readonly<Record<string, TraceTaskPlanItemSource>>;
23
25
  onSelectItem?: (item: TraceTaskPlanStepItem, source: TraceTaskPlanItemSource) => void;
26
+ /** Debug level: what refused plan calls told the agent (`TraceTaskPlanSnapshot.rejections`). */
27
+ rejections?: readonly TraceTaskPlanRejection[];
28
+ /** The detail view a host opens the pane on (a deep link); default none. */
29
+ defaultDetail?: TaskPlanDetailTarget | null;
24
30
  className?: string;
25
31
  }
26
32
  /**
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.
33
+ * The task plan of a conversation as it stands, for a pane beside the chat. Its head names the plan and its progress
34
+ * over all steps ("6 of 9 done · step 2 of 3", a segment per step), then the plan as a tree: every container shows its
35
+ * part progress ("4/5") and folds; the path of the running step and of a blocked one is open, closed branches are
36
+ * folded. Every item shows its state (done, does not apply, blocked — "waits for you" when only the owner can lift it —,
37
+ * in progress or not started) and the note of a running or blocked step. A click on an item opens its detail view,
38
+ * "Plan details" the plan's ({@link TaskPlanDrawer}): beside the tree in a wide pane, in its place in a narrow one.
30
39
  */
31
40
  export declare const TaskPlanPane: (props: TaskPlanPaneProps) => import("react/jsx-runtime").JSX.Element;
@@ -50,6 +50,8 @@ export interface ToolStepGroupProps {
50
50
  isCompact?: boolean;
51
51
  className?: string;
52
52
  }
53
+ /** A turn shorter than this shows no length on its steps head (outside the verbose view): the steps are what counts. */
54
+ export declare const MIN_SHOWN_TURN_DURATION_MS = 30000;
53
55
  /**
54
56
  * 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
57
  * view mode — nothing but the result (`summary`), the narrated steps folded closed (`normal`), or every step with
@@ -2,7 +2,15 @@ import type { TraceViewMode } from "./trace-types";
2
2
  export interface TraceViewModeSwitchProps {
3
3
  viewMode: TraceViewMode;
4
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. */
5
+ /**
6
+ * The modes on offer, Short first (`traceViewModesOfPolicy` of the conversation's `traceViewPolicy`). With one mode
7
+ * or none the switch is not rendered. Absent: the former rule of `isVerboseAllowed`.
8
+ */
9
+ allowedViewModes?: readonly TraceViewMode[];
10
+ /**
11
+ * @deprecated Pass `allowedViewModes` (from the conversation's `traceViewPolicy`). Kept as the fallback while
12
+ * `allowedViewModes` is absent: the reader may see the verbose view, without it the option is not offered.
13
+ */
6
14
  isVerboseAllowed?: boolean;
7
15
  isCompact?: boolean;
8
16
  className?: string;
@@ -11,4 +19,4 @@ export interface TraceViewModeSwitchProps {
11
19
  * The switch of how much of a turn's trace the chat shows: Short (the result only), Normal (the steps, folded) and,
12
20
  * for a reader who may, Verbose (every step open to its details). Arrow keys move between the options.
13
21
  */
14
- export declare const TraceViewModeSwitch: (props: TraceViewModeSwitchProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const TraceViewModeSwitch: (props: TraceViewModeSwitchProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -17,6 +17,8 @@ export { RunStatusLine, type RunStatusLineProps } from "./RunStatusLine";
17
17
  export { buildTaskPlanItems, CompactionDetail, DecisionDetail, describeTraceCompaction, describeTraceDecision, describeTraceDecisionStatus, SignalDetail, SkillLoadDetail, StepFactsLine, TaskPlanStepDetail, WidgetDetail, type CompactionDetailProps, type DecisionDetailProps, type SignalDetailProps, type SkillLoadDetailProps, type StepFactsLineProps, type TaskPlanStepDetailProps, type WidgetDetailProps, } from "./StepKindDetails";
18
18
  export { describeSubAgentCounts, SubAgentStepGroup, SubAgentStepRow, type SubAgentStepGroupProps, type SubAgentStepRowProps, type SubAgentWaiting, } from "./SubAgentStepGroup";
19
19
  export { TaskPlanPane, type TaskPlanPaneProps } from "./TaskPlanPane";
20
+ export { TaskPlanDrawer, TaskPlanMark, TaskPlanSegments, type TaskPlanDetailTarget, type TaskPlanDrawerProps } from "./TaskPlanDrawer";
21
+ export { buildTaskPlanTree, readDefaultExpandedKeys, readNeighbours, readShownStatus, readVisibleNodes, type TaskPlanNodeState, type TaskPlanTree, type TaskPlanTreeNode, } from "./task-plan-tree";
20
22
  export { focusTraceStep, TRACE_HIGHLIGHT_ATTRIBUTE, TRACE_STEP_ANCHOR_ATTRIBUTE, TRACE_TURN_ANCHOR_ATTRIBUTE } from "./trace-step-focus";
21
23
  export { TaskPlanRow, type TaskPlanItem, type TaskPlanItemState, type TaskPlanRowProps } from "./TaskPlanRow";
22
24
  export { TerminalBlock, type TerminalBlockProps } from "./TerminalBlock";
@@ -28,7 +30,8 @@ export { createTraceFormat, describeTraceModelName, readTraceRunResultText, desc
28
30
  export { describeTraceBackgroundJob, describeTraceContextSegment, describeTraceDecisionSite, describeTraceSignal, describeTraceWakeCondition, isTraceBackgroundJobLabel, TRACE_CONTEXT_SEGMENT_LABELS, TRACE_DECISION_SITE_LABELS, TRACE_SIGNAL_SOURCE_LABELS, TRACE_SIGNAL_TAG_LABELS, TRACE_WAKE_CONDITION_LABELS, type TraceLabelTranslate, } from "./trace-labels";
29
31
  export { readTraceStateLabel, TraceCopyButton, TraceMountChip, TracePath, TraceStateIcon, type TraceCopyButtonProps, type TraceMountChipProps, type TracePathProps, type TraceStateIconProps, } from "./trace-parts";
30
32
  export type { TraceCompaction, TraceDecision, TraceDescribeMount, TraceEntityDescription, TraceEntityReference, TraceFileChange, TraceFileChangeType, TraceFileDiffState, TraceHostBindings, TraceLinkComponent, TraceLoadedSkill, TraceLoadedSkillTool, TraceModelCall, TraceMountDescription, TraceSignal, TraceSkillLoad, TraceSkillLoadEntry, TraceStep, TraceStepKind, TraceStepState, TraceSubAgent, TraceSubAgentRun, TraceTaskPlanStepItem, TraceTerminal, TraceToolEffect, TraceTurnTotals, TraceViewMode, TraceWidget, } from "./trace-types";
31
- export { collectTraceBackgroundTasks, collectTraceChangedRecords, collectTraceFileChangesByTurn, collectTraceTaskPlan, type TraceChangedRecord, type TraceTaskPlanItemSource, type TraceTaskPlanSnapshot, type TraceTurnFileChanges, } from "./trace-collect";
33
+ export { collectTraceBackgroundTasks, collectTraceChangedRecords, collectTraceFileChangesByTurn, collectTraceTaskPlan, type TraceChangedRecord, type TraceTaskPlanItemSource, type TraceTaskPlanRejection, type TraceTaskPlanSnapshot, type TraceTurnFileChanges, } from "./trace-collect";
32
34
  export { useConversationTraceRevision, useConversationTraces, useConversationTurnTrace, type ConversationTurnTraceRead, type UseConversationTracesOptions, type UseConversationTurnTraceOptions, } from "./use-conversation-trace";
33
35
  export { TraceViewModeSwitch, type TraceViewModeSwitchProps } from "./TraceViewModeSwitch";
36
+ export { clampTraceViewMode, defaultTraceViewModeOfPolicy, resolveAllowedTraceViewModes, TRACE_VIEW_MODE_OF_LEVEL, traceLevelOfViewMode, traceViewModesOfPolicy, } from "./trace-view-policy";
34
37
  export { TurnMetaLine, type TurnMetaLineProps } from "./TurnMetaLine";
@@ -0,0 +1,55 @@
1
+ import type { TraceTaskPlanStepItem } from "./trace-types";
2
+ /**
3
+ * Where an item of the task plan stands, as the work plan draws it: done, does not apply (skipped), blocked, running
4
+ * (the first open leaf: the step the agent works on now) or open.
5
+ */
6
+ export type TaskPlanNodeState = "done" | "skipped" | "blocked" | "running" | "open";
7
+ /** One item of the plan in its tree: its children, its state and the part of its leaves that is closed. */
8
+ export interface TaskPlanTreeNode {
9
+ item: TraceTaskPlanStepItem;
10
+ key: string;
11
+ depth: number;
12
+ parent: TaskPlanTreeNode | null;
13
+ children: TaskPlanTreeNode[];
14
+ state: TaskPlanNodeState;
15
+ /** Leaves below the node (the node itself for a leaf) that are done or do not apply, and all of them. */
16
+ closedLeafCount: number;
17
+ leafCount: number;
18
+ }
19
+ /** The plan as a tree, with the counts the work plan shows. */
20
+ export interface TaskPlanTree {
21
+ roots: TaskPlanTreeNode[];
22
+ /** Every node in plan order (depth first). */
23
+ nodes: TaskPlanTreeNode[];
24
+ byKey: ReadonlyMap<string, TaskPlanTreeNode>;
25
+ /** The running leaf (the first open leaf), null when none is open. */
26
+ running: TaskPlanTreeNode | null;
27
+ /** All leaves, the closed ones (done or does not apply), the blocked and the skipped ones. */
28
+ leafCount: number;
29
+ closedLeafCount: number;
30
+ blockedLeafCount: number;
31
+ skippedLeafCount: number;
32
+ /** The position of the top-level item the plan works on (1-based; the count of top-level items when all are closed). */
33
+ currentTopLevelPosition: number;
34
+ }
35
+ /** The status the plan shows for an item: the server's derived status, else the item's own. */
36
+ export declare const readShownStatus: (item: Pick<TraceTaskPlanStepItem, "status" | "shownStatus">) => string;
37
+ /**
38
+ * Builds the tree of a plan's items (in plan order, each with its `depth`): a node's parent is the nearest item before
39
+ * it with a smaller depth. A container whose server sends no derived status derives its state from its children
40
+ * (blocked when a child is blocked and none open, done when all are closed). The first open leaf outside a closed
41
+ * container is the running step.
42
+ */
43
+ export declare const buildTaskPlanTree: (items: readonly TraceTaskPlanStepItem[]) => TaskPlanTree;
44
+ /**
45
+ * The containers the work plan opens at first: every container that is not closed (the path of the running and of a
46
+ * blocked step among them); a done or skipped branch stays folded.
47
+ */
48
+ export declare const readDefaultExpandedKeys: (tree: TaskPlanTree) => Set<string>;
49
+ /** The nodes a reader sees with the given containers open, in plan order. */
50
+ export declare const readVisibleNodes: (tree: TaskPlanTree, expandedKeys: ReadonlySet<string>) => TaskPlanTreeNode[];
51
+ /** The item before and after a node in plan order (any depth), for the arrows of the detail view. */
52
+ export declare const readNeighbours: (tree: TaskPlanTree, key: string) => {
53
+ previous: TaskPlanTreeNode | null;
54
+ next: TaskPlanTreeNode | null;
55
+ };
@@ -42,6 +42,10 @@ export interface TraceTaskPlanSnapshot {
42
42
  * whose change lies before the loaded turns has none.
43
43
  */
44
44
  itemSources: Readonly<Record<string, TraceTaskPlanItemSource>>;
45
+ /** Per item key: the plan update the item first appeared in (as it stands now: same key and title). */
46
+ itemFirstSources: Readonly<Record<string, TraceTaskPlanItemSource>>;
47
+ /** Debug level: what refused plan calls told the agent, oldest first (empty at the steps level). */
48
+ rejections: readonly TraceTaskPlanRejection[];
45
49
  }
46
50
  /** The plan update (a `TASK_PLAN` step) that last changed an item of the plan: where the trace shows it. */
47
51
  export interface TraceTaskPlanItemSource {
@@ -51,6 +55,17 @@ export interface TraceTaskPlanItemSource {
51
55
  stepKey: string;
52
56
  /** The id the server gives the step (the anchor of its row); null when it sends none. */
53
57
  stepId: string | null;
58
+ /** When the plan update ran (a server date-time); null when the trace names none. */
59
+ startedAt?: string | null;
60
+ }
61
+ /** One line a refused plan call returned to the agent, with the plan update it belongs to. */
62
+ export interface TraceTaskPlanRejection {
63
+ line: string;
64
+ /** The first item key the line names; null when it names none. */
65
+ itemKey: string | null;
66
+ /** The plan tool of the call (`update_task_plan`, `set_task_status`). */
67
+ toolName: string | null;
68
+ source: TraceTaskPlanItemSource;
54
69
  }
55
70
  /**
56
71
  * The conversation's task plan after its newest plan update (the last `TASK_PLAN` step of the turns that names a plan);