@mgamadeus/ddd-agents 0.16.1 → 0.17.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 (94) hide show
  1. package/README.md +111 -8
  2. package/boundary.json +15 -1
  3. package/dist/admin-chat-widgets.js +158 -0
  4. package/dist/admin-chat-widgets.js.map +1 -0
  5. package/dist/admin.js +90 -63
  6. package/dist/admin.js.map +1 -1
  7. package/dist/chat.js +16 -16
  8. package/dist/chat.js.map +1 -1
  9. package/dist/chunks/AgentScheduleOrderDraftPanel-DM6pz_hc.js +304 -0
  10. package/dist/chunks/AgentScheduleOrderDraftPanel-DM6pz_hc.js.map +1 -0
  11. package/dist/chunks/{ConversationMarkdown-DNQcVuz-.js → ConversationMarkdown-W8NzeAT1.js} +5 -5
  12. package/dist/chunks/{ConversationMarkdown-DNQcVuz-.js.map → ConversationMarkdown-W8NzeAT1.js.map} +1 -1
  13. package/dist/chunks/{ConversationMessageInputComposerWidgets-BlpIule7.js → ConversationMessageInputComposerWidgets-BH7axorv.js} +6 -6
  14. package/dist/chunks/{ConversationMessageInputComposerWidgets-BlpIule7.js.map → ConversationMessageInputComposerWidgets-BH7axorv.js.map} +1 -1
  15. package/dist/chunks/{VoiceBarsIcon-eODB_UTI.js → VoiceBarsIcon-CT2HQSBH.js} +4 -4
  16. package/dist/chunks/{VoiceBarsIcon-eODB_UTI.js.map → VoiceBarsIcon-CT2HQSBH.js.map} +1 -1
  17. package/dist/chunks/{WebSearchResultsConversationWidget-l9Aek_lG.js → WebSearchResultsConversationWidget-BM624Fcx.js} +71 -62
  18. package/dist/chunks/WebSearchResultsConversationWidget-BM624Fcx.js.map +1 -0
  19. package/dist/chunks/{agents-http-trace-mappers-rsbGAf2_.js → agents-http-trace-mappers-CuGZOFu-.js} +53 -14
  20. package/dist/chunks/agents-http-trace-mappers-CuGZOFu-.js.map +1 -0
  21. package/dist/chunks/{browser-request-interception-D678IemW.js → browser-request-interception-BnOQWLaJ.js} +2 -2
  22. package/dist/chunks/{browser-request-interception-D678IemW.js.map → browser-request-interception-BnOQWLaJ.js.map} +1 -1
  23. package/dist/chunks/{canvas-label-context-C1Pc_Ldo.js → canvas-label-context-BKRsrpye.js} +3 -3
  24. package/dist/chunks/{canvas-label-context-C1Pc_Ldo.js.map → canvas-label-context-BKRsrpye.js.map} +1 -1
  25. package/dist/chunks/{canvas-reducers-BYArW_Ji.js → canvas-reducers-CZaOPvdt.js} +2 -2
  26. package/dist/chunks/{canvas-reducers-BYArW_Ji.js.map → canvas-reducers-CZaOPvdt.js.map} +1 -1
  27. package/dist/chunks/{canvasBodies-BpLPp-S8.js → canvasBodies-CMqo5eHg.js} +4 -4
  28. package/dist/chunks/{canvasBodies-BpLPp-S8.js.map → canvasBodies-CMqo5eHg.js.map} +1 -1
  29. package/dist/chunks/{canvasStorage-DSspwRMg.js → canvasStorage-ceJ7yaBd.js} +2 -2
  30. package/dist/chunks/{canvasStorage-DSspwRMg.js.map → canvasStorage-ceJ7yaBd.js.map} +1 -1
  31. package/dist/chunks/{content-from-unified-diff-DWyBHRSy.js → content-from-unified-diff-BKdgop63.js} +39 -5
  32. package/dist/chunks/content-from-unified-diff-BKdgop63.js.map +1 -0
  33. package/dist/chunks/{contract-DtFmOk91.js → contract-CQ6PO_e8.js} +2 -2
  34. package/dist/chunks/{contract-DtFmOk91.js.map → contract-CQ6PO_e8.js.map} +1 -1
  35. package/dist/chunks/{conversation-Cbrqtx-_.js → conversation-VosmRbsr.js} +4 -2
  36. package/dist/chunks/{conversation-Cbrqtx-_.js.map → conversation-VosmRbsr.js.map} +1 -1
  37. package/dist/chunks/conversation-trace-fVeh6Lg6.js.map +1 -1
  38. package/dist/chunks/{widget-name-resolver-DXIE9JUr.js → conversationWidgetRegistry-BW-U_RvC.js} +810 -530
  39. package/dist/chunks/conversationWidgetRegistry-BW-U_RvC.js.map +1 -0
  40. package/dist/chunks/{index-DZovGMpG.js → index-DAEGct6X.js} +61 -61
  41. package/dist/chunks/index-DAEGct6X.js.map +1 -0
  42. package/dist/chunks/{link-navigation-a_sRfmsj.js → link-navigation-DQWyeNkx.js} +2 -2
  43. package/dist/chunks/{link-navigation-a_sRfmsj.js.map → link-navigation-DQWyeNkx.js.map} +1 -1
  44. package/dist/chunks/{withPollingChangeSubscription-Cz3Diolr.js → withPollingChangeSubscription-Ct8kjmlL.js} +19 -2
  45. package/dist/chunks/withPollingChangeSubscription-Ct8kjmlL.js.map +1 -0
  46. package/dist/client-testing.js +39 -5
  47. package/dist/client-testing.js.map +1 -1
  48. package/dist/client.js +43 -14
  49. package/dist/client.js.map +1 -1
  50. package/dist/contract.js +4 -3
  51. package/dist/files/i18n-keys.json +619 -15
  52. package/dist/files/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.md +4 -2
  53. package/dist/files/widgets/OwnerStepConfirmationConversationWidget/OwnerStepConfirmationConversationWidget.md +54 -0
  54. package/dist/files/widgets/OwnerStepConfirmationConversationWidget/owner-step-confirmation.preview-fixtures.json +16 -0
  55. package/dist/image-render.js +8 -8
  56. package/dist/index.js +16 -16
  57. package/dist/kit.js +2 -2
  58. package/dist/preview.js +124 -117
  59. package/dist/preview.js.map +1 -1
  60. package/dist/provider.js +2 -2
  61. package/dist/renderer.js +53 -52
  62. package/dist/styles.css +46 -0
  63. package/dist/types/admin/schedules/AgentScheduleOrderDraftPanel.d.ts +45 -0
  64. package/dist/types/admin/schedules/AgentSchedulesPanel.d.ts +11 -3
  65. package/dist/types/admin/schedules/agent-schedules-api.d.ts +38 -2
  66. package/dist/types/admin/schedules/agent-schedules-format.d.ts +22 -1
  67. package/dist/types/admin/schedules/agent-schedules-types.d.ts +91 -1
  68. package/dist/types/admin-chat-widgets/ScheduleOrderApprovalConversationWidget.d.ts +37 -0
  69. package/dist/types/admin-chat-widgets/registerScheduleOrderApprovalWidget.d.ts +11 -0
  70. package/dist/types/chat/trace/TurnMetaLine.d.ts +5 -3
  71. package/dist/types/chat/trace/trace-counts.d.ts +2 -0
  72. package/dist/types/chat/trace/trace-types.d.ts +4 -0
  73. package/dist/types/client/AgentsConversationClient.d.ts +17 -1
  74. package/dist/types/client/http/agents-http-mappers.d.ts +4 -2
  75. package/dist/types/client/http/agents-http-trace-wire.d.ts +2 -0
  76. package/dist/types/client/http/agents-http-wire.d.ts +24 -0
  77. package/dist/types/client/testing/createInMemoryAgentsConversationClient.d.ts +13 -1
  78. package/dist/types/contract/conversation-trace.d.ts +4 -0
  79. package/dist/types/contract/conversation.d.ts +43 -0
  80. package/dist/types/entries/admin-chat-widgets.d.ts +2 -0
  81. package/dist/types/entries/admin.d.ts +4 -2
  82. package/dist/types/entries/renderer.d.ts +1 -1
  83. package/dist/types/renderer/widget-tree/composed-node-schema.d.ts +20 -3
  84. package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-files.d.ts +3 -1
  85. package/dist/voice.js +2 -2
  86. package/dist/widgets.js +4 -4
  87. package/package.json +7 -1
  88. package/public-api.json +39 -0
  89. package/dist/chunks/WebSearchResultsConversationWidget-l9Aek_lG.js.map +0 -1
  90. package/dist/chunks/agents-http-trace-mappers-rsbGAf2_.js.map +0 -1
  91. package/dist/chunks/content-from-unified-diff-DWyBHRSy.js.map +0 -1
  92. package/dist/chunks/index-DZovGMpG.js.map +0 -1
  93. package/dist/chunks/widget-name-resolver-DXIE9JUr.js.map +0 -1
  94. package/dist/chunks/withPollingChangeSubscription-Cz3Diolr.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { type ApiMutationHook, type ApiQueryHook, type InjectableBaseApi, type InjectedRequest, type StaticQueryFailure } from "@mgamadeus/ddd-admin-ui/logic/pure";
2
- import type { AgentScheduleActionResponse, AgentScheduleIdArg, AgentScheduleRunsArg, AgentScheduleRunsResponse, AgentSchedulesArg, AgentSchedulesResponse, AgentScheduleUpdateArg } from "./agent-schedules-types";
3
- /** The cache tag type of the schedule operations (ids `LIST`, `RUNS`). */
2
+ import type { AgentScheduleActionResponse, AgentScheduleApproveArg, AgentScheduleApproveResponse, AgentScheduleIdArg, AgentScheduleOrderDraftResponse, AgentScheduleRunsArg, AgentScheduleRunsResponse, AgentSchedulesArg, AgentSchedulesResponse, AgentScheduleUpdateArg } from "./agent-schedules-types";
3
+ /** The cache tag type of the schedule operations (ids `LIST`, `RUNS`, `DRAFT`). */
4
4
  export declare const AGENT_SCHEDULES_TAG = "AdminUiAgentSchedules";
5
5
  /** The hooks `createAgentSchedulesApi` returns; `AgentSchedulesPanel` takes them as `api`. */
6
6
  export interface AgentSchedulesApi {
@@ -18,6 +18,13 @@ export interface AgentSchedulesApi {
18
18
  useUpdateAgentScheduleMutation: ApiMutationHook<AgentScheduleUpdateArg, AgentScheduleActionResponse>;
19
19
  /** `DELETE /{scheduleId}`: removes, archives or keeps the schedule as history (`actionTaken`). */
20
20
  useDeleteAgentScheduleMutation: ApiMutationHook<AgentScheduleIdArg, AgentScheduleActionResponse>;
21
+ /** `GET /{scheduleId}/draft`: what the approval shows — the hashed fields, the waiting draft and its hash, the order in force. */
22
+ useAgentScheduleOrderDraftQuery: ApiQueryHook<AgentScheduleIdArg, AgentScheduleOrderDraftResponse>;
23
+ /**
24
+ * `POST /{scheduleId}/approve { draftHash }`: the owner approves exactly the draft shown. A draft that changed since
25
+ * is refused (`refusalReason` `DRAFT_CHANGED`, the answer carries the draft as it stands now); never approve a newer one.
26
+ */
27
+ useApproveAgentScheduleMutation: ApiMutationHook<AgentScheduleApproveArg, AgentScheduleApproveResponse>;
21
28
  }
22
29
  export interface CreateAgentSchedulesApiOptions {
23
30
  /** The host's RTK Query api (`createApi` with the React hooks module). */
@@ -34,6 +41,8 @@ export declare const buildAgentSchedulesRequests: (apiPrefix: string) => {
34
41
  runNow: ({ scheduleId }: AgentScheduleIdArg) => InjectedRequest;
35
42
  update: ({ scheduleId, ...changes }: AgentScheduleUpdateArg) => InjectedRequest;
36
43
  remove: ({ scheduleId }: AgentScheduleIdArg) => InjectedRequest;
44
+ draft: ({ scheduleId }: AgentScheduleIdArg) => InjectedRequest;
45
+ approve: ({ scheduleId, draftHash }: AgentScheduleApproveArg) => InjectedRequest;
37
46
  };
38
47
  /** The operations as injected. */
39
48
  export declare const agentSchedulesEndpointDefinitions: (apiPrefix: string) => {
@@ -86,6 +95,9 @@ export declare const agentSchedulesEndpointDefinitions: (apiPrefix: string) => {
86
95
  readonly invalidatesTags: readonly [{
87
96
  readonly type: "AdminUiAgentSchedules";
88
97
  readonly id: "LIST";
98
+ }, {
99
+ readonly type: "AdminUiAgentSchedules";
100
+ readonly id: "DRAFT";
89
101
  }];
90
102
  };
91
103
  readonly adminUiAgentScheduleDelete: {
@@ -94,6 +106,28 @@ export declare const agentSchedulesEndpointDefinitions: (apiPrefix: string) => {
94
106
  readonly invalidatesTags: readonly [{
95
107
  readonly type: "AdminUiAgentSchedules";
96
108
  readonly id: "LIST";
109
+ }, {
110
+ readonly type: "AdminUiAgentSchedules";
111
+ readonly id: "DRAFT";
112
+ }];
113
+ };
114
+ readonly adminUiAgentScheduleOrderDraft: {
115
+ readonly kind: "query";
116
+ readonly request: ({ scheduleId }: AgentScheduleIdArg) => InjectedRequest;
117
+ readonly providesTags: readonly [{
118
+ readonly type: "AdminUiAgentSchedules";
119
+ readonly id: "DRAFT";
120
+ }];
121
+ };
122
+ readonly adminUiAgentScheduleApprove: {
123
+ readonly kind: "mutation";
124
+ readonly request: ({ scheduleId, draftHash }: AgentScheduleApproveArg) => InjectedRequest;
125
+ readonly invalidatesTags: readonly [{
126
+ readonly type: "AdminUiAgentSchedules";
127
+ readonly id: "LIST";
128
+ }, {
129
+ readonly type: "AdminUiAgentSchedules";
130
+ readonly id: "DRAFT";
97
131
  }];
98
132
  };
99
133
  };
@@ -111,6 +145,8 @@ export interface StaticAgentSchedulesData {
111
145
  runNow?: (arg: AgentScheduleIdArg) => AgentScheduleActionResponse | Promise<AgentScheduleActionResponse>;
112
146
  update?: (arg: AgentScheduleUpdateArg) => AgentScheduleActionResponse | Promise<AgentScheduleActionResponse>;
113
147
  remove?: (arg: AgentScheduleIdArg) => AgentScheduleActionResponse | Promise<AgentScheduleActionResponse>;
148
+ draft?: (arg: AgentScheduleIdArg) => AgentScheduleOrderDraftResponse | StaticQueryFailure | undefined;
149
+ approve?: (arg: AgentScheduleApproveArg) => AgentScheduleApproveResponse | Promise<AgentScheduleApproveResponse>;
114
150
  }
115
151
  /** An `AgentSchedulesApi` answering fixed payloads, without a store or a request (previews, tests, reviews). */
116
152
  export declare const createStaticAgentSchedulesApi: (data: StaticAgentSchedulesData) => AgentSchedulesApi;
@@ -1,4 +1,4 @@
1
- import type { AgentScheduleListItem, AgentScheduleStatus, AgentScheduleUpdateArg } from "./agent-schedules-types";
1
+ import type { AgentScheduleApproveResponse, AgentScheduleListItem, AgentScheduleStatus, AgentScheduleUpdateArg } from "./agent-schedules-types";
2
2
  /** Where a schedule stands (`AIConversationScheduleStatus`). */
3
3
  export declare const AGENT_SCHEDULE_STATUS: Readonly<Record<AgentScheduleStatus, import("@mgamadeus/ddd-admin-ui/logic").StatusDefinition>>;
4
4
  /** The run state of a run's conversation (`AIConversationRunState`). */
@@ -23,3 +23,24 @@ export declare const agentScheduleEditValuesOf: (item: AgentScheduleListItem) =>
23
23
  export declare const buildAgentScheduleUpdate: (scheduleId: number, initial: AgentScheduleEditValues, edited: AgentScheduleEditValues, isOneTime: boolean) => AgentScheduleUpdateArg | null;
24
24
  /** The longest title the update route takes. */
25
25
  export declare const AGENT_SCHEDULE_TITLE_MAX_LENGTH = 60;
26
+ /** A UTC moment of the backend (`Y-m-d H:i:s`) as date and time in `timeZone` for `locale`; `""` when unreadable. */
27
+ export declare const formatScheduleMoment: (utcDateTime: string | null | undefined, timeZone: string, locale: string) => string;
28
+ /**
29
+ * What an approval answered: in force, refused because the draft changed since it was shown, or refused otherwise
30
+ * (`refusalReason` the server's code, `NO_DRAFT` or `STATUS`; `refusalText` its English words, data for a log).
31
+ */
32
+ export type AgentScheduleApprovalOutcome = {
33
+ kind: "approved";
34
+ } | {
35
+ kind: "draftChanged";
36
+ } | {
37
+ kind: "refused";
38
+ refusalReason: string | null;
39
+ refusalText: string | null;
40
+ };
41
+ export declare const readAgentScheduleApprovalOutcome: (answer: AgentScheduleApproveResponse) => AgentScheduleApprovalOutcome;
42
+ /**
43
+ * Whether the draft the screen shows (its pinned hash) is no longer the stored one: only while a NEWER draft waits.
44
+ * After the approval no draft waits (the order is in force), which is no change to show.
45
+ */
46
+ export declare const isShownScheduleDraftStale: (shownDraftHash: string | null | undefined, storedDraftHash: string | null | undefined) => boolean;
@@ -1,6 +1,6 @@
1
1
  import type { AdminWireChangeHistory, AdminWireSet } from "../wire/admin-wire";
2
2
  /** `AIConversationScheduleStatus`. */
3
- export type AgentScheduleStatus = "ACTIVE" | "PAUSED" | "EXPIRED" | "DONE" | "CANCELLED" | "ARCHIVED";
3
+ export type AgentScheduleStatus = "PENDING_APPROVAL" | "ACTIVE" | "PAUSED" | "EXPIRED" | "DONE" | "CANCELLED" | "ARCHIVED";
4
4
  /** A schedule as stored (`AIConversationSchedule`), the fields the panel reads. */
5
5
  export interface AgentSchedule {
6
6
  id: number;
@@ -111,3 +111,93 @@ export interface AgentScheduleActionResponse {
111
111
  /** The conversation of the run a "run now" started. */
112
112
  runConversationId?: number | null;
113
113
  }
114
+ /** One permission of a draft: what the runs may do without asking (`ScheduleOrderDraftPermission`). */
115
+ /**
116
+ * One permission of an order as the server delivers it (`ScheduleOrderDraftPermission`, rendered from the stored row,
117
+ * never from model text). The server sends its bounds (recipients, folder, channels) only inside `description`.
118
+ */
119
+ export interface AgentScheduleOrderPermission {
120
+ /** The stored row. */
121
+ mandateId?: number | null;
122
+ /**
123
+ * Its action class: one of the package's schedule-only classes (`CONNECTION_MAIL_SEND`, `CONNECTION_FILE_WRITE`,
124
+ * `CONNECTION_CHAT_POST`, `SCHEDULED_ORDER`) or one the application names.
125
+ */
126
+ actionClass?: string | null;
127
+ /** What it allows with its bounds, the server's English words (plain text, no template; data, never markup). */
128
+ description?: string | null;
129
+ /** The connection it is bound to. */
130
+ agentConnectionId?: number | null;
131
+ /** It reaches recipients outside the team: shown as a warning. */
132
+ containsExternalRecipients?: boolean;
133
+ }
134
+ /** The package's action classes of an order's rows (`AgentMandate::SCHEDULE_ONLY_ACTION_CLASSES`). */
135
+ export declare const AGENT_SCHEDULE_ORDER_ACTION_CLASSES: readonly ["SCHEDULED_ORDER", "CONNECTION_FILE_WRITE", "CONNECTION_MAIL_SEND", "CONNECTION_CHAT_POST"];
136
+ /** What a host shows for one permission (already translated); each absent or empty part keeps the package's. */
137
+ export interface AgentScheduleOrderPermissionWords {
138
+ /** The permission's name in place of the package's name of its action class. */
139
+ label: string;
140
+ /** The line of its limits in place of the server's `description`. */
141
+ detail?: string;
142
+ /** The line of its connection in place of the package's "Connection #N". */
143
+ connection?: string;
144
+ }
145
+ /**
146
+ * What the owner approves (`ScheduleOrderDraft`, read from the stored rows): the schedule's hashed fields, the waiting
147
+ * draft with its hash and permissions, and the order in force. The approval sends `draftHash` back.
148
+ */
149
+ export interface AgentScheduleOrderDraft {
150
+ scheduleId?: number | null;
151
+ /** `PENDING_APPROVAL`, `ACTIVE`, `PAUSED`, … */
152
+ scheduleStatus?: AgentScheduleStatus | string | null;
153
+ title?: string | null;
154
+ task?: string | null;
155
+ doneCriteria?: string | null;
156
+ /** The cron expression of a recurring task. */
157
+ cron?: string | null;
158
+ /** The moment of a one-time task (UTC). */
159
+ oneTimeAt?: string | null;
160
+ /** A one-time task that starts as soon as it is approved. */
161
+ startsOnApproval?: boolean;
162
+ /** The IANA time zone the task fires in. */
163
+ timezone?: string | null;
164
+ /** How its runs work (a run purpose; none = the package's `Schedule.Run`). */
165
+ runPurpose?: string | null;
166
+ /** Where a run reports: `CHAT` or `EMAIL`. */
167
+ reportChannel?: string | null;
168
+ /** The account that owns the schedule, the only one who approves. */
169
+ ownerAccountId?: number | null;
170
+ /** The proposed order row; null = no draft waits. */
171
+ draftOrderMandateId?: number | null;
172
+ /** The hash an approval sends back; null = no draft waits. */
173
+ draftHash?: string | null;
174
+ permissions?: AgentScheduleOrderPermission[] | null;
175
+ /** The order in force; null = none. */
176
+ activeOrderMandateId?: number | null;
177
+ /** When the order in force was approved (UTC). */
178
+ activeOrderApprovedAt?: string | null;
179
+ /** A draft waits and the schedule may be approved now. */
180
+ isApprovable?: boolean;
181
+ }
182
+ /** `GET {prefix}/{scheduleId}/draft`. */
183
+ export interface AgentScheduleOrderDraftResponse {
184
+ draft?: AgentScheduleOrderDraft | null;
185
+ }
186
+ /** `POST {prefix}/{scheduleId}/approve`: the hash of exactly the draft the screen showed. */
187
+ export interface AgentScheduleApproveArg {
188
+ scheduleId: number;
189
+ draftHash: string;
190
+ }
191
+ /** Why an approval was refused: the draft changed since it was shown, no draft waits, or the schedule's state. */
192
+ export type AgentScheduleApprovalRefusalReason = "DRAFT_CHANGED" | "NO_DRAFT" | "STATUS";
193
+ /** `POST {prefix}/{scheduleId}/approve`: approved, or refused with the draft as it stands now. */
194
+ export interface AgentScheduleApproveResponse {
195
+ approved?: boolean;
196
+ refusalReason?: AgentScheduleApprovalRefusalReason | string | null;
197
+ /** The refusal in plain words (the server's English). */
198
+ refusalText?: string | null;
199
+ /** The order in force after the approval. */
200
+ orderMandateId?: number | null;
201
+ /** The draft as it stands now. */
202
+ draft?: AgentScheduleOrderDraft | null;
203
+ }
@@ -0,0 +1,37 @@
1
+ import { type ComponentType } from "react";
2
+ import type { PayloadConversationWidgetProps } from "../renderer/conversation-widget-props";
3
+ import type { AgentSchedulesApi } from "../admin/schedules/agent-schedules-api";
4
+ import { type AgentScheduleOrderDraftPanelProps, type AgentScheduleOrderTexts } from "../admin/schedules/AgentScheduleOrderDraftPanel";
5
+ /** The wire name the backend writes (`ScheduleOrderApprovalConversationWidget::WIDGET_TYPE`). */
6
+ export declare const SCHEDULE_ORDER_APPROVAL_WIDGET_TYPE = "ScheduleOrderApproval";
7
+ /** The fields of a `ScheduleOrderApproval` block: the task and the hash of the draft the tool stored. */
8
+ export interface ScheduleOrderApprovalPayload {
9
+ scheduleId: number;
10
+ draftHash: string;
11
+ }
12
+ /** The payload of a block, or null when it does not decode or names no schedule id above 0 or no hash. */
13
+ export declare const parseScheduleOrderApprovalPayload: (payload: string | undefined) => ScheduleOrderApprovalPayload | null;
14
+ /** What the chat widget of an approval needs from the host. */
15
+ export interface ScheduleOrderApprovalWidgetOptions extends AgentScheduleOrderTexts {
16
+ /** `createAgentSchedulesApi(…)` of the host (where it mounts `AdminAgentSchedulesTrait`). */
17
+ api: AgentSchedulesApi;
18
+ /**
19
+ * A hook answering the signed-in account's id (the host's session): a viewer who is not the task's owner reads who
20
+ * approves instead of the button. Absent: the button shows for everyone and the server refuses anyone but the owner.
21
+ */
22
+ useViewerAccountId?: () => number | null;
23
+ /**
24
+ * A hook answering the words of the permissions for the block's task (`scheduleId`), for a host that reads them in a
25
+ * component (its own list of mandates): called on every render of the widget; its answer wins over
26
+ * `describePermission`. Absent: no hook is called.
27
+ */
28
+ useDescribePermission?: (scheduleId: number) => AgentScheduleOrderDraftPanelProps["describePermission"];
29
+ }
30
+ /**
31
+ * Builds the chat widget of `ScheduleOrderApproval` (written by the task tools after they stored a draft, never by the
32
+ * model) on the host's api and words: the order from the stored rows (`AgentScheduleOrderDraftPanel`), approved with the
33
+ * hash the block carries — a draft that changed since is announced and shown only on request. While the task waits:
34
+ * "Change" puts a request into the composer (the owner says what to change; it is not sent), "Discard" deletes the task
35
+ * after a confirmation. Writes follow an `@mgamadeus/ddd-admin-ui` `WriteAccessProvider` above the chat.
36
+ */
37
+ export declare const createScheduleOrderApprovalConversationWidget: (readOptions: () => ScheduleOrderApprovalWidgetOptions) => ComponentType<PayloadConversationWidgetProps>;
@@ -0,0 +1,11 @@
1
+ import { type ScheduleOrderApprovalWidgetOptions } from "./ScheduleOrderApprovalConversationWidget";
2
+ export type RegisterScheduleOrderApprovalWidgetOptions = ScheduleOrderApprovalWidgetOptions;
3
+ /**
4
+ * Registers the chat widget of `ScheduleOrderApproval` — the approval of a scheduled task's order, which the task tools
5
+ * write after they stored a draft. Without it the block renders nothing and every new task waits in
6
+ * `PENDING_APPROVAL` with no way to approve it from the chat. Call it once, outside React, before the first chat, with
7
+ * the host's `createAgentSchedulesApi(…)` and its words for the rhythm, the run purpose, the permissions and the
8
+ * agent's name. A later call replaces the options; the widget itself is registered once. A host that registered its own
9
+ * component under the name before removes that registration (two registrations of one name throw).
10
+ */
11
+ export declare const registerScheduleOrderApprovalWidget: (options: RegisterScheduleOrderApprovalWidgetOptions) => void;
@@ -20,8 +20,10 @@ export interface TurnMetaLineProps extends TraceTurnTotals {
20
20
  className?: string;
21
21
  }
22
22
  /**
23
- * The figures of a turn in one line, as the verbose view shows them under the steps: model and effort, tokens with
24
- * the share read from the cache, cost, duration, a chip for the turn's state, and the links "What the model saw" and
25
- * "Open in analysis". A figure that is not given is left out.
23
+ * The figures of a turn in one line, as the verbose view shows them under the steps: model and effort, the context of
24
+ * the last model call, the model calls with their tokens added up, the share read from the cache, cost, duration, a
25
+ * chip for the turn's state, and the links "What the model saw" and "Open in analysis". One model call: one pill of
26
+ * its context and cache. Without the model call count or the last call's context: one pill of the summed tokens and
27
+ * the cache, as before. A figure that is not given is left out.
26
28
  */
27
29
  export declare const TurnMetaLine: (props: TurnMetaLineProps) => import("react/jsx-runtime").JSX.Element;
@@ -18,6 +18,8 @@ export declare const describeMessageCount: (count: number, format: CountFormat)
18
18
  export declare const describeHiddenLineCount: (count: number, format: CountFormat) => string;
19
19
  /** "Show 1 more line" / "Show 8 more lines" (under a shortened output). */
20
20
  export declare const describeShowMoreLines: (count: number, format: CountFormat) => string;
21
+ /** "1 model call" / "10 model calls": the model calls of a turn. */
22
+ export declare const describeModelCallCount: (count: number, format: CountFormat) => string;
21
23
  /** "1 check" / "4 checks": the checks of a background job. */
22
24
  export declare const describeCheckCount: (count: number) => string;
23
25
  export {};
@@ -345,6 +345,10 @@ export interface TraceTurnTotals {
345
345
  cachedInputTokens?: number | null;
346
346
  cachePercent?: number | null;
347
347
  costInUsd?: number | null;
348
+ /** The model calls of the turn; the tokens above add up the input and output of all of them. */
349
+ modelCallCount?: number | null;
350
+ /** The input tokens of the turn's last model call: what the model read on that call (its context). */
351
+ newestModelCallInputTokens?: number | null;
348
352
  stepCount?: number | null;
349
353
  commandCount?: number | null;
350
354
  fileCount?: number | null;
@@ -1,6 +1,6 @@
1
1
  import type { AccountRealtimeRead } from "../ui/account-realtime";
2
2
  import type { ClientToolAnswer } from "../ui/client-tools";
3
- import type { AgentsConversation, ChangedConversationMessages, ChangedMessagesRequest, ConversationActivity, ConversationAttachmentReference, ConversationBackgroundJobStop, ConversationChangeSignal, ConversationListQueryOptions, ConversationMessageSearchHit, ConversationMessageSentPayload, ConversationMessagesPage, ConversationRunStateRead, ConversationSearchGroup, ConversationSearchOptions, ConversationSignal, ConversationSubscriptionEndReason, PostedMessage, BoundConversationSubject, ConversationsOfSubject, ConversationSubject, PurposeStartRequest, SelectableModel, StartedConversation, StartedPurposeConversation } from "../contract/conversation";
3
+ import type { AgentsConversation, ChangedConversationMessages, ChangedMessagesRequest, ConversationActivity, ConversationAttachmentReference, ConversationBackgroundJobStop, ConversationChangeSignal, ConversationListQueryOptions, ConversationMessageSearchHit, ConversationMessageSentPayload, ConversationMessagesPage, ConversationRunStateRead, ConversationSearchGroup, ConversationSearchOptions, ConversationSignal, ConversationStepConfirmation, ConversationSubscriptionEndReason, PostedMessage, BoundConversationSubject, ConversationsOfSubject, ConversationSubject, PurposeStartRequest, SelectableModel, StartedConversation, StartedPurposeConversation } from "../contract/conversation";
4
4
  import type { ConversationContextComposition, ConversationFileChangeDiff, ConversationTurnStop, ConversationTurnTraces, ConversationTurnTracesOptions } from "../contract/conversation-trace";
5
5
  /**
6
6
  * The conversation client port (one function per row of the table, derived from the chat
@@ -124,6 +124,22 @@ export interface AgentsConversationClient {
124
124
  * turn's Stop stays the stop of everything.
125
125
  */
126
126
  stopBackgroundJob?: (conversationId: number, backgroundJobId: number) => Promise<ConversationBackgroundJobStop>;
127
+ /**
128
+ * One stored step that waits for the owner's click (`GET …/{id}/stepConfirmations/{stepConfirmationId}`,
129
+ * `AgentConversationStepConfirmationsTrait`): what the `OwnerStepConfirmation` widget shows. Optional, like the two
130
+ * below: a binding without it (the host does not mount the trait) shows the widget as a line that the step cannot be
131
+ * confirmed here.
132
+ */
133
+ getStepConfirmation?: (conversationId: number, stepConfirmationId: number) => Promise<ConversationStepConfirmation>;
134
+ /**
135
+ * Runs the stored step once (`POST …/stepConfirmations/{stepConfirmationId}/execute` with the hash of the
136
+ * step as read and shown). The server refuses a changed step (HTTP 400) and one that is no longer open (403); the outcome reaches
137
+ * the conversation as a signal by itself — the widget sends no chat message. Answers the step as stored after the
138
+ * call. Without it (or without `discardStepConfirmation`) the widget shows the step and offers no buttons.
139
+ */
140
+ executeStepConfirmation?: (conversationId: number, stepConfirmationId: number, contentHash: string) => Promise<ConversationStepConfirmation>;
141
+ /** Discards the stored step: it never runs (`POST …/stepConfirmations/{stepConfirmationId}/discard`). */
142
+ discardStepConfirmation?: (conversationId: number, stepConfirmationId: number) => Promise<ConversationStepConfirmation>;
127
143
  /**
128
144
  * What the agent did, turn by turn (`GET …/{id}/trace`): the newest turns without options, a window of turns, or the
129
145
  * turns that changed after a message position (the read that follows a running turn). The server decides the level
@@ -1,5 +1,5 @@
1
- import { AgentsClientError, type AgentsClientContext, type AgentsConversation, type AgentsConversationMessage, type BoundConversationSubject, type ConversationActivity, type ConversationBackgroundJob, type ConversationBackgroundJobStop, type ConversationMessageSearchHit, type ConversationRunStateRead, type ConversationSearchGroup, type SelectableModel } from "../../contract/conversation";
2
- import type { WireBackgroundJob, WireBackgroundJobStopResponse, WireBoundConversationSubject, WireClientContext, WireConversation, WireConversationActivityResponse, WireConversationMessage, WireConversationRunStateResponse, WireConversationSearchGroup, WireErrorBody, WireSelectableModel, WireSemanticSearchHit, WireSet } from "./agents-http-wire";
1
+ import { AgentsClientError, type AgentsClientContext, type AgentsConversation, type AgentsConversationMessage, type BoundConversationSubject, type ConversationActivity, type ConversationBackgroundJob, type ConversationBackgroundJobStop, type ConversationStepConfirmation, type ConversationMessageSearchHit, type ConversationRunStateRead, type ConversationSearchGroup, type SelectableModel } from "../../contract/conversation";
2
+ import type { WireBackgroundJob, WireBackgroundJobStopResponse, WireStepConfirmationResponse, WireBoundConversationSubject, WireClientContext, WireConversation, WireConversationActivityResponse, WireConversationMessage, WireConversationRunStateResponse, WireConversationSearchGroup, WireErrorBody, WireSelectableModel, WireSemanticSearchHit, WireSet } from "./agents-http-wire";
3
3
  /** The elements of a serialized set (`{ elements: [...] }`), a plain array, or the values of a keyed object. */
4
4
  export declare const readWireSetElements: <Element>(wireSet: WireSet<Element> | Record<string, Element> | null | undefined) => Element[];
5
5
  /** An `AIConversation` as the contract's conversation. */
@@ -16,6 +16,8 @@ export declare const mapWireRunningBackgroundJobs: (wireJobs: WireSet<WireBackgr
16
16
  export declare const mapWireConversationActivity: (wireActivity: WireConversationActivityResponse) => ConversationActivity;
17
17
  /** The answer of the owner's stop of one background job (`AIConversationBackgroundJobStopPostResponseDto`). */
18
18
  export declare const mapWireBackgroundJobStop: (response: WireBackgroundJobStopResponse | null | undefined) => ConversationBackgroundJobStop;
19
+ /** A stored step that waits for the owner's click (`AIConversationStepConfirmationGetResponseDto`); null without a step id. */
20
+ export declare const mapWireStepConfirmation: (response: WireStepConfirmationResponse | null | undefined) => ConversationStepConfirmation | null;
19
21
  /** A `SemanticSearchHit`. */
20
22
  export declare const mapWireSearchHit: (wireHit: WireSemanticSearchHit) => ConversationMessageSearchHit;
21
23
  /** An `AIConversationSearchGroup`. */
@@ -376,6 +376,8 @@ export interface WireTurnTraceTotals {
376
376
  cachePercent?: number | null;
377
377
  costInUSD?: number | null;
378
378
  costInUsd?: number | null;
379
+ /** `AgentTurnTrace::$modelCallCount`: the model calls of the turn. */
380
+ modelCallCount?: number | null;
379
381
  stepCount?: number | null;
380
382
  commandCount?: number | null;
381
383
  fileCount?: number | null;
@@ -253,6 +253,30 @@ export interface WireBackgroundJobStopResponse {
253
253
  isStopped?: boolean | null;
254
254
  state?: string | null;
255
255
  }
256
+ /** `OwnerConsentLine`: a line of a step as a text key. */
257
+ export interface WireOwnerConsentLine {
258
+ template?: string | null;
259
+ /** An object of the values; an empty one may arrive as `[]`. */
260
+ replacements?: Record<string, unknown> | unknown[] | null;
261
+ }
262
+ /** `AgentStepConfirmation`, as the step confirmation routes answer it. */
263
+ export interface WireStepConfirmation {
264
+ id?: number | null;
265
+ toolName?: string | null;
266
+ contentHash?: string | null;
267
+ targetLine?: string | null;
268
+ consequenceLine?: string | null;
269
+ targetText?: WireOwnerConsentLine | null;
270
+ consequenceText?: WireOwnerConsentLine | null;
271
+ status?: string | null;
272
+ expiresAt?: string | null;
273
+ answeredAt?: string | null;
274
+ resultExcerpt?: string | null;
275
+ }
276
+ /** `AIConversationStepConfirmationGetResponseDto` (the read, the run and the discard of a step answer it). */
277
+ export interface WireStepConfirmationResponse {
278
+ agentStepConfirmation?: WireStepConfirmation | null;
279
+ }
256
280
  /** `AIConversationSearchGetResponseDto`. */
257
281
  export interface WireConversationSearchResponse {
258
282
  conversations?: WireSet<WireConversationSearchGroup> | null;
@@ -1,11 +1,13 @@
1
1
  import type { AgentsConversationClient, AgentsConversationOperation } from "../AgentsConversationClient";
2
- import { type AgentsConversation, type AgentsConversationMessage, type ChangedConversationMessages, type ChangedMessagesRequest, type ConversationActivity, type ConversationAttachmentReference, type ConversationBackgroundJobStop, type ConversationChangeSignal, type ConversationListQueryOptions, type ConversationMessageSearchHit, type ConversationMessageSentPayload, type ConversationMessagesPage, type ConversationRunStatus, type ConversationSearchGroup, type ConversationSearchOptions, type ConversationSignal, type ConversationSubscriptionEndReason, type PostedMessage, type SelectableModel, type StartedConversation } from "../../contract/conversation";
2
+ import { type AgentsConversation, type AgentsConversationMessage, type ChangedConversationMessages, type ChangedMessagesRequest, type ConversationActivity, type ConversationAttachmentReference, type ConversationBackgroundJobStop, type ConversationStepConfirmation, type ConversationChangeSignal, type ConversationListQueryOptions, type ConversationMessageSearchHit, type ConversationMessageSentPayload, type ConversationMessagesPage, type ConversationRunStatus, type ConversationSearchGroup, type ConversationSearchOptions, type ConversationSignal, type ConversationSubscriptionEndReason, type PostedMessage, type SelectableModel, type StartedConversation } from "../../contract/conversation";
3
3
  /** One recorded conversation handed to the in-memory client: plain data, as a fixture file holds it. */
4
4
  export interface RecordedConversation {
5
5
  conversation: AgentsConversation;
6
6
  messages: AgentsConversationMessage[];
7
7
  /** What `getConversationActivity` answers for this conversation; an empty, finished turn when omitted. */
8
8
  activity?: ConversationActivity;
9
+ /** The stored steps that wait for the owner's click (`getStepConfirmation`, `executeStepConfirmation`, `discardStepConfirmation`). */
10
+ stepConfirmations?: ConversationStepConfirmation[];
9
11
  }
10
12
  export interface InMemoryAgentsConversationClientData {
11
13
  conversations: RecordedConversation[];
@@ -85,6 +87,16 @@ export declare class InMemoryAgentsConversationClient implements AgentsConversat
85
87
  * end is reported). A job that is not RUNNING answers `isStopped` false with its state; an unknown one is `notFound`.
86
88
  */
87
89
  stopBackgroundJob: (conversationId: number, backgroundJobId: number) => Promise<ConversationBackgroundJobStop>;
90
+ /** A recorded step of the conversation, or `notFound` like the server. */
91
+ protected readStepConfirmation(conversationId: number, stepConfirmationId: number): ConversationStepConfirmation;
92
+ getStepConfirmation: (conversationId: number, stepConfirmationId: number) => Promise<ConversationStepConfirmation>;
93
+ /**
94
+ * Runs a recorded step like the server: refused with HTTP 400 when the hash differs, with 403 when the step is no
95
+ * longer open; else it ends EXECUTED with the excerpt "Done.".
96
+ */
97
+ executeStepConfirmation: (conversationId: number, stepConfirmationId: number, contentHash: string) => Promise<ConversationStepConfirmation>;
98
+ /** Discards a recorded open step like the server (403 when it is no longer open). */
99
+ discardStepConfirmation: (conversationId: number, stepConfirmationId: number) => Promise<ConversationStepConfirmation>;
88
100
  startConversation: (request: {
89
101
  agentSpaceKey: number;
90
102
  text: string;
@@ -571,6 +571,10 @@ export interface ConversationTurnTraceTotals {
571
571
  /** The share of the input tokens read from the cache, 0–100. */
572
572
  cachePercent: number | null;
573
573
  costInUsd: number | null;
574
+ /** The model calls of the turn; the input and output tokens above add up all of them. Absent or null when not known. */
575
+ modelCallCount?: number | null;
576
+ /** The input tokens of the turn's last model call (its context); null without a model call step that names them. */
577
+ newestModelCallInputTokens?: number | null;
574
578
  stepCount: number;
575
579
  commandCount: number;
576
580
  fileCount: number;
@@ -429,6 +429,49 @@ export interface ConversationBackgroundJobStop {
429
429
  /** generic — the state of the job after the call, as the server stores it; null when it names none */
430
430
  state: ConversationBackgroundJobState | null;
431
431
  }
432
+ /** The states of a stored step that waits for the owner's click (`AgentStepConfirmation::STATUSES`). */
433
+ export declare const CONVERSATION_STEP_CONFIRMATION_STATUSES: readonly ["OPEN", "RUNNING", "EXECUTED", "FAILED", "DISCARDED", "EXPIRED", "SUPERSEDED"];
434
+ /**
435
+ * generic — OPEN waits for the click, RUNNING runs after it, EXECUTED / FAILED ran, DISCARDED the owner said no,
436
+ * EXPIRED not clicked in time, SUPERSEDED a later call of the same tool asked again
437
+ */
438
+ export type ConversationStepConfirmationStatus = (typeof CONVERSATION_STEP_CONFIRMATION_STATUSES)[number];
439
+ /** One line of a step as a text key (`OwnerConsentLine`): the English template and the values of its `%placeholders%`. */
440
+ export interface ConversationStepConfirmationLine {
441
+ /** generic — the English template, a server message key a host's text export lists */
442
+ template: string;
443
+ /** generic — the values of the placeholders; data, shown as they are */
444
+ replacements: Record<string, string>;
445
+ }
446
+ /**
447
+ * A stored step that waits for the owner's click (`AgentStepConfirmation`, as `GET …/{id}/stepConfirmations/{stepId}`
448
+ * answers it): what it does, what follows, its state and, once run, the start of its result. The `OwnerStepConfirmation`
449
+ * widget reads it and runs exactly this step.
450
+ */
451
+ export interface ConversationStepConfirmation {
452
+ /** generic — the stored step's id (the widget's `stepConfirmationId`) */
453
+ id: number;
454
+ /** generic — the tool that asked */
455
+ toolName: string | null;
456
+ /** generic — the hash of the stored call; the click sends the hash of the step as read and shown, a changed step is refused */
457
+ contentHash: string | null;
458
+ /** generic — what the step does, as the English line the tool wrote */
459
+ targetLine: string;
460
+ /** generic — what follows from it, as the English line the tool wrote; empty when the tool wrote none */
461
+ consequenceLine: string;
462
+ /** generic — the target line as a text key; null = a free line, shown as `targetLine` */
463
+ targetText: ConversationStepConfirmationLine | null;
464
+ /** generic — the consequence line as a text key; null = a free line, shown as `consequenceLine` */
465
+ consequenceText: ConversationStepConfirmationLine | null;
466
+ /** generic — the stored state; an unknown state the server names reads as null */
467
+ status: ConversationStepConfirmationStatus | null;
468
+ /** generic — a server date-time; after it an open step expires */
469
+ expiresAt: string | null;
470
+ /** generic — a server date-time; when the owner answered */
471
+ answeredAt: string | null;
472
+ /** generic — the first lines of the result or of the failure; data, never translated */
473
+ resultExcerpt: string | null;
474
+ }
432
475
  /** The activity of one turn (`GET …/activity`). */
433
476
  export interface ConversationActivity {
434
477
  /** generic — the message that started the narrated turn */
@@ -0,0 +1,2 @@
1
+ export { createScheduleOrderApprovalConversationWidget, parseScheduleOrderApprovalPayload, SCHEDULE_ORDER_APPROVAL_WIDGET_TYPE, type ScheduleOrderApprovalPayload, type ScheduleOrderApprovalWidgetOptions, } from "../admin-chat-widgets/ScheduleOrderApprovalConversationWidget";
2
+ export { registerScheduleOrderApprovalWidget, type RegisterScheduleOrderApprovalWidgetOptions, } from "../admin-chat-widgets/registerScheduleOrderApprovalWidget";
@@ -47,9 +47,11 @@ export { AGENT_SERIES_COLOR_VALUES, type AgentTimeSeriesChartProps, type AgentTi
47
47
  export { TimeSeriesChartCard, type TimeSeriesChartCardProps, TimeSeriesFallbackChart } from "../admin/control-panel/TimeSeriesChartCard";
48
48
  export { ToolResponseSamplesDrawer, type ToolResponseSamplesDrawerProps } from "../admin/control-panel/ToolResponseSamplesDrawer";
49
49
  export { AGENT_SCHEDULES_TAG, type AgentSchedulesApi, agentSchedulesEndpointDefinitions, buildAgentSchedulesRequests, createAgentSchedulesApi, type CreateAgentSchedulesApiOptions, createStaticAgentSchedulesApi, type StaticAgentSchedulesData, } from "../admin/schedules/agent-schedules-api";
50
- export { AGENT_RUN_STATE, AGENT_SCHEDULE_STATUS, AGENT_SCHEDULE_TITLE_MAX_LENGTH, type AgentScheduleEditValues, agentScheduleEditValuesOf, buildAgentScheduleUpdate, scheduleLocalDateTimeOf, } from "../admin/schedules/agent-schedules-format";
51
- export type { AgentSchedule, AgentScheduleActionResponse, AgentScheduleIdArg, AgentScheduleListItem, AgentScheduleNewestRun, AgentSchedulePlace, AgentScheduleRun, AgentScheduleRunsArg, AgentScheduleRunsResponse, AgentSchedulesArg, AgentSchedulesResponse, AgentSchedulesScope, AgentScheduleStatus, AgentScheduleUpdateArg, } from "../admin/schedules/agent-schedules-types";
50
+ export { AGENT_RUN_STATE, AGENT_SCHEDULE_STATUS, AGENT_SCHEDULE_TITLE_MAX_LENGTH, type AgentScheduleApprovalOutcome, type AgentScheduleEditValues, agentScheduleEditValuesOf, buildAgentScheduleUpdate, formatScheduleMoment, isShownScheduleDraftStale, readAgentScheduleApprovalOutcome, scheduleLocalDateTimeOf, } from "../admin/schedules/agent-schedules-format";
51
+ export type { AgentSchedule, AgentScheduleActionResponse, AgentScheduleApprovalRefusalReason, AgentScheduleApproveArg, AgentScheduleApproveResponse, AgentScheduleIdArg, AgentScheduleListItem, AgentScheduleNewestRun, AgentScheduleOrderDraft, AgentScheduleOrderDraftResponse, AgentScheduleOrderPermission, AgentScheduleOrderPermissionWords, AgentSchedulePlace, AgentScheduleRun, AgentScheduleRunsArg, AgentScheduleRunsResponse, AgentSchedulesArg, AgentSchedulesResponse, AgentSchedulesScope, AgentScheduleStatus, AgentScheduleUpdateArg, } from "../admin/schedules/agent-schedules-types";
52
+ export { AGENT_SCHEDULE_ORDER_ACTION_CLASSES } from "../admin/schedules/agent-schedules-types";
52
53
  export { AgentSchedulesPanel, type AgentSchedulesPanelProps } from "../admin/schedules/AgentSchedulesPanel";
54
+ export { AgentScheduleOrderDraftPanel, type AgentScheduleOrderDraftPanelProps, type AgentScheduleOrderTexts, DEFAULT_SCHEDULE_RUN_PURPOSE, } from "../admin/schedules/AgentScheduleOrderDraftPanel";
53
55
  export { AGENT_QUALITY_TAG, type AgentQualityApi, agentQualityEndpointDefinitions, buildAgentQualityRequests, createAgentQualityApi, type CreateAgentQualityApiOptions, createStaticAgentQualityApi, type StaticAgentQualityData, } from "../admin/quality/agent-quality-api";
54
56
  export { abortedAndExpiredTurnCountOf, AGENT_QUALITY_EVAL_VERDICT, AGENT_QUALITY_EVAL_VERDICT_FILTERS, AGENT_QUALITY_FAILURE_KIND_DEFINITIONS, type AgentQualityEvalVerdictFilter, type AgentQualityFailureKindDefinition, type AgentQualityFailureKindSection, agentQualityFailureSubjectOf, evalCaseFileNameOf, evalRunModelNamesOf, formatQualityDuration, groupAgentQualityFailuresByKind, isKnownAgentQualityFailureKind, qualityFigureChangeOf, } from "../admin/quality/agent-quality-format";
55
57
  export { AGENT_QUALITY_FAILURE_KINDS, type AgentQualityEvalCase, type AgentQualityEvalCaseDraft, type AgentQualityEvalCaseDraftArg, type AgentQualityEvalCaseDraftResponse, type AgentQualityEvalRunArg, type AgentQualityEvalRunResponse, type AgentQualityEvalRunsArg, type AgentQualityEvalRunsResponse, type AgentQualityEvalRunSummary, type AgentQualityEvalVerdict, type AgentQualityFailureGroup, type AgentQualityFailureKind, type AgentQualityFailuresResponse, type AgentQualityPeriodFigures, type AgentQualityRangeArg, type AgentQualitySummary, type AgentQualitySummaryResponse, } from "../admin/quality/agent-quality-types";
@@ -20,7 +20,7 @@ export * from "../renderer/canvas/canvas-state";
20
20
  export { canvasBodies, canvasFeatureFlagOf, type CanvasBodyProps } from "../renderer/canvas/canvasBodies";
21
21
  export { readOpenEntityActionTarget, type OpenEntityActionTarget, } from "../renderer/canvas/entity-detail-instance";
22
22
  export { composedViewTreeToWire, readComposedViewTree } from "../renderer/widget-tree/composed-view-tree";
23
- export { addComposedNodeSchemaApplicationPart, composedNodeSchema, getComposedNodeSchema, type ComposedNodeSchema, type ComposedNodeSchemaApplicationPart, } from "../renderer/widget-tree/composed-node-schema";
23
+ export { addComposedNodeSchemaApplicationPart, composedNodeSchema, getComposedNodeSchema, registerComposedNodeSchemaPart, type ComposedNodeSchema, type ComposedNodeSchemaApplicationPart, type ComposedNodeSchemaPackagePart, } from "../renderer/widget-tree/composed-node-schema";
24
24
  export { ConversationWidgetRenderContext, useIsEmailWidgetRender } from "../renderer/ConversationWidgetRenderContext";
25
25
  export { ConversationWidgetActions } from "../renderer/ConversationWidgetActions/ConversationWidgetActions";
26
26
  export { ConversationWidgetGateSkeleton } from "../renderer/_access/ConversationWidgetGateSkeleton";
@@ -135,9 +135,26 @@ export declare const composedNodeSchema: ComposedNodeSchema;
135
135
  /** A schema with an app's part added: every section holds both sides' types, sorted by type name. */
136
136
  export declare const addComposedNodeSchemaApplicationPart: (schema: ComposedNodeSchema, applicationPart: ComposedNodeSchemaApplicationPart) => ComposedNodeSchema;
137
137
  /**
138
- * The schema the readers apply: the package's schema with the part the app declares
139
- * (`AgentsEnvironment.composedNodeSchemaApplicationPart`); the package's schema alone when the app declares none.
140
- * Read at call time — an app installs its environment after this module is loaded. The same object while the part is.
138
+ * The schema part of a sister package of the module (its `web/src/composed-node-schema-part.json`, generated by the
139
+ * backend in the form of the application's part): the types its own classes declare. A package part replaces no
140
+ * package widget.
141
+ */
142
+ export type ComposedNodeSchemaPackagePart = Omit<ComposedNodeSchemaApplicationPart, "replacedPackageWidgets"> & {
143
+ version?: number;
144
+ generatedBy?: string;
145
+ };
146
+ /**
147
+ * Adds a sister package's schema part (`ComposedNodeSchemaPackagePart`): its node types, widgets, data sources and entity
148
+ * types join the schema the readers apply, beside the module's and the application's. Runs outside React, before the
149
+ * first render (a package calls it from its own register function). Registering the same part again (the same object
150
+ * or the same content: a hot reload) changes nothing.
151
+ */
152
+ export declare const registerComposedNodeSchemaPart: (part: ComposedNodeSchemaPackagePart) => void;
153
+ /**
154
+ * The schema the readers apply: the package's schema with the parts sister packages registered
155
+ * (`registerComposedNodeSchemaPart`) and the part the app declares (`AgentsEnvironment.composedNodeSchemaApplicationPart`,
156
+ * added last: it alone may replace a package widget); the package's schema alone when there is neither. Read at call
157
+ * time — an app installs its environment after this module is loaded. The same object while the parts are.
141
158
  */
142
159
  export declare const getComposedNodeSchema: () => ComposedNodeSchema;
143
160
  /**
@@ -64,7 +64,9 @@ export declare const buildDriveFilesHydrationKey: (type: string, request: DriveF
64
64
  export declare const nodeIdOfReference: (reference: string) => string | null;
65
65
  /**
66
66
  * The card's own link into the host's drive screen, when it is safe to follow inside the app: a path of this origin
67
- * (`/admin/drive?…`, never protocol-relative `//…`) or an absolute http(s) URL of `origin`. `null` otherwise.
67
+ * (`/admin/drive?…`, never protocol-relative `//…`, and with a known `origin` one that resolves to it) or an absolute
68
+ * http(s) URL of `origin`. A link with a control character is refused: `"/\t/evil.example"` reads as a path, but the
69
+ * browser drops the tab and opens `//evil.example`. `null` otherwise.
68
70
  */
69
71
  export declare const safeDriveFileOpenLink: (link: string | null | undefined, origin: string | null) => string | null;
70
72
  /** Milliseconds of an offsetless UTC `Y-m-d H:i:s` (or ISO) date-time, `null` for anything else. */
package/dist/voice.js CHANGED
@@ -3,9 +3,9 @@ import { useSyncExternalStore, useState, useEffect, useMemo, useRef, useCallback
3
3
  import { t as textKey } from "./chunks/text-key-DnoZ4lAk.js";
4
4
  import { f as formatAgentVoiceCallDuration } from "./chunks/format-agent-voice-call-duration-C-3hRc9p.js";
5
5
  import { a as useOptionalAgentsConversationClient } from "./chunks/AgentsConversationClientContext-B_UJSLXU.js";
6
- import { b as DEFAULT_AGENTS_TEXTS, a9 as useAgentsTexts, J as getAgentDisplayName, a3 as useAgentsComponents, D as DEFAULT_AGENTS_COMPONENTS } from "./chunks/index-DZovGMpG.js";
6
+ import { b as DEFAULT_AGENTS_TEXTS, a9 as useAgentsTexts, J as getAgentDisplayName, a3 as useAgentsComponents, D as DEFAULT_AGENTS_COMPONENTS } from "./chunks/index-DAEGct6X.js";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { V as VoiceBarsIcon, C as ConversationMessageWidgets, a as ConversationMessageUser } from "./chunks/VoiceBarsIcon-eODB_UTI.js";
8
+ import { V as VoiceBarsIcon, C as ConversationMessageWidgets, a as ConversationMessageUser } from "./chunks/VoiceBarsIcon-CT2HQSBH.js";
9
9
  import { a as useOptionalAgentsChatStore, u as useAgentsChatSelector } from "./chunks/use-agents-chat-store-CuIkCz9v.js";
10
10
  class AgentVoiceApiError extends Error {
11
11
  constructor(code, httpStatus) {
package/dist/widgets.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { a2 as useIsEmailWidgetRender } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
3
- import { a7, a8, a9, aa, ab, ac, ad, ae, ad as ad2, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
2
+ import { a3 as useIsEmailWidgetRender } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
3
+ import { a7, a8, a9, aa, ab, ac, ad, ae, ad as ad2, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import { r as Text, E as classNames } from "./chunks/index-DZovGMpG.js";
6
- import { f, w } from "./chunks/index-DZovGMpG.js";
5
+ import { r as Text, E as classNames } from "./chunks/index-DAEGct6X.js";
6
+ import { f, w } from "./chunks/index-DAEGct6X.js";
7
7
  import { useSyncExternalStore, useState, useEffect } from "react";
8
8
  const widgetLabel = "agents_widgetLabel_WecWAw";
9
9
  const styles$1 = {