@mgamadeus/ddd-agents 0.16.0 → 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
@@ -19,8 +19,10 @@ blocked …) and the actions:
19
19
  - **Open** in a new tab — files a browser shows itself (PDF, images, video, text). An office file (pptx, docx, xlsx …)
20
20
  opens its PDF twin from the same block (same folder, same name, `.pdf`); without one it only downloads.
21
21
  - **Download** — the store's attachment URL.
22
- - **Show in the drive** — the card's `openLink` when it is a path of this app or a same-origin URL, else the source's
23
- `buildDriveScreenHref(card)`; hidden when neither gives a link. Opened through the host's `onNavigate`.
22
+ - **Show in the drive** — the card's `openLink` when it is a path of this app (one that resolves to this origin) or a
23
+ same-origin URL, else the source's `buildDriveScreenHref(card)`; hidden when neither gives a link. A link with a
24
+ control character (tab, line feed, carriage return) is refused: the browser drops it and could leave the app.
25
+ Opened through the host's `onNavigate`.
24
26
 
25
27
  Card URLs are short-lived: the widget asks the source for a URL at every click and reads the block's cards again when
26
28
  they had expired (`urlsExpireAt`), so thumbnails renew too.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: OwnerStepConfirmation
3
+ emitter: tool
4
+ summary: One stored step that waits for the owner's click — what it does, what follows, its state — with "Run" and "Discard".
5
+ description: Written by the consent step of a tool (never by the model) when `AI.ownerConsent.stepConfirmation.byButtonInChat` is on. The block names the stored step and the hash it was written for; the widget reads the step through the conversation client (`getStepConfirmation`) and shows its two lines (translated from their text keys), its state as a chip with a word, and once it ran the start of its result. "Run" runs exactly the step shown, with the hash of what was read; "Discard" says no. No chat message is sent: the server signals the conversation and the agent continues. A step that changed since is shown again with a notice and confirmed anew. Without the client functions the widget is one line that the step cannot be confirmed here.
6
+ ---
7
+
8
+ # OwnerStepConfirmationConversationWidget
9
+
10
+ ## Description
11
+ A compact surface: the step's target line (what it does) and its consequence line (what follows) beside a state chip,
12
+ the start of the result once it ran, and two buttons while it waits.
13
+
14
+ The lines come as text keys (`targetText`, `consequenceText`: an English template and its values); the widget
15
+ translates the template through the app's texts (`AgentsEnvironment.texts.translate(template, replacements)`) and shows
16
+ the English line the tool wrote (`targetLine`, `consequenceLine`) for a free line. The values and the result excerpt
17
+ are data, shown as written.
18
+
19
+ | State | Chip | Shown |
20
+ |---|---|---|
21
+ | `OPEN` | "Waiting for you" | "Run" and "Discard" while the message is interactive |
22
+ | `RUNNING` | "Running" | read again every 3 s until it ran |
23
+ | `EXECUTED` | "Done" | the start of the result |
24
+ | `FAILED` | "Failed" | the start of the failure |
25
+ | `DISCARDED` | "Discarded" | — |
26
+ | `EXPIRED` (or `OPEN` past `expiresAt`) | "Expired" | — |
27
+ | `SUPERSEDED` | "Replaced" | "A newer request replaced this step." |
28
+
29
+ "Run" sends the `contentHash` of the step as READ from the server (`executeStepConfirmation`); the block's own hash is
30
+ only compared. A stored hash that differs from the block's, or a run the server refuses with HTTP 400 (the step
31
+ changed), shows "This step changed meanwhile. Check it again before you run it." over the step as it stands now. A run
32
+ refused with 403 (no longer open) and every other failure reads the step again, so the chip tells why; a failed action
33
+ adds a line ("The step could not be run." / "The step could not be discarded."). A second click while an action runs
34
+ does nothing; after each action the step is read again. Not in an e-mail capture: there the buttons are left out.
35
+
36
+ The widget reports `failed` (`INVALID_PROP`) and shows "This step cannot be confirmed here." when the block names no
37
+ step or hash, the chat names no conversation (`conversationId` of the widget callbacks), or the conversation client
38
+ has no `getStepConfirmation`. With `getStepConfirmation` but without `executeStepConfirmation` and
39
+ `discardStepConfirmation` it shows the step and, while it waits, the same line instead of the buttons.
40
+
41
+ ## Data structure
42
+ ```ts
43
+ interface OwnerStepConfirmationPayload {
44
+ stepConfirmationId: number; // the stored step (`AgentStepConfirmation`), above 0
45
+ contentHash: string; // the hash of the stored call the tool wrote the block for
46
+ }
47
+ ```
48
+
49
+ ## App duty
50
+ Mount `AgentConversationStepConfirmationsTrait` in the controller of the chat (beside the reads and writes) when the
51
+ setting is on. `createAgentsHttpConversationClient` binds the three port functions to its routes
52
+ (`GET /{id}/stepConfirmations/{stepId}`, `POST …/execute` with `{ contentHash }`, `POST …/discard`); a binding of its
53
+ own implements `getStepConfirmation`, `executeStepConfirmation` and `discardStepConfirmation`
54
+ (`mapWireStepConfirmation` maps the answer). The server refuses a click of anyone but the conversation's owner.
@@ -0,0 +1,16 @@
1
+ {
2
+ "wireName": "OwnerStepConfirmation",
3
+ "fixtures": [
4
+ {
5
+ "name": "without-conversation-client",
6
+ "description": "The block outside a chat whose conversation client reads step confirmations (the preview has none): one line that the step cannot be confirmed here; the block reports itself failed.",
7
+ "payload": {
8
+ "stepConfirmationId": 41,
9
+ "contentHash": "preview-step"
10
+ },
11
+ "locale": "de",
12
+ "expectedState": "error",
13
+ "width": 390
14
+ }
15
+ ]
16
+ }
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React, { useRef, useEffect } from "react";
4
- import { G as resolveWidgetName, j as conversationWidgetRegistry } from "./chunks/widget-name-resolver-DXIE9JUr.js";
5
- import { H } from "./chunks/widget-name-resolver-DXIE9JUr.js";
6
- import { z as ConversationWidgetRenderContext, bi as WidgetImageReadinessContext, R as ReadOnlyConversationWidgetProvider, bj as WidgetImageRenderContext, bk as WidgetImageLiveHydrationContext, A as buildWidgetAgentSpaceKeyProps } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
7
- import { bl, bm, bn } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
8
- import { r as readWidgetImageReadiness, p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, a as interceptFetchRequests, c as createHeaderlessResponse, t as toSameRealmFetchInput } from "./chunks/browser-request-interception-D678IemW.js";
9
- import { W, b } from "./chunks/browser-request-interception-D678IemW.js";
10
- import { Q as getGoogleMapWidgetNames, V as getWidgetImageCaptureReadPathPrefix } from "./chunks/index-DZovGMpG.js";
4
+ import { H as resolveWidgetName, j as conversationWidgetRegistry } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
5
+ import { I } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
6
+ import { B as ConversationWidgetRenderContext, bi as WidgetImageReadinessContext, R as ReadOnlyConversationWidgetProvider, bj as WidgetImageRenderContext, bk as WidgetImageLiveHydrationContext, E as buildWidgetAgentSpaceKeyProps } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
7
+ import { bl, bm, bn } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
8
+ import { r as readWidgetImageReadiness, p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, a as interceptFetchRequests, c as createHeaderlessResponse, t as toSameRealmFetchInput } from "./chunks/browser-request-interception-BnOQWLaJ.js";
9
+ import { W, b } from "./chunks/browser-request-interception-BnOQWLaJ.js";
10
+ import { Q as getGoogleMapWidgetNames, V as getWidgetImageCaptureReadPathPrefix } from "./chunks/index-DAEGct6X.js";
11
11
  const root = "agents_root_prMo3u";
12
12
  const styles = {
13
13
  root
@@ -366,7 +366,7 @@ export {
366
366
  installLiveWidgetRequests,
367
367
  isGoogleMapCapture,
368
368
  publishWidgetImageReadiness,
369
- H as readComposedViewDataTimes,
369
+ I as readComposedViewDataTimes,
370
370
  bl as readFrozenHydration,
371
371
  readWidgetImageReadiness,
372
372
  b as readWidgetImageReadinessGlobalNames,
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { h, i } from "./chunks/widget-name-resolver-DXIE9JUr.js";
3
- import { r as registerCanvasBodies, c as canvasBodies } from "./chunks/canvasBodies-BpLPp-S8.js";
4
- import { g, a, b } from "./chunks/canvasBodies-BpLPp-S8.js";
5
- import { a as isPackageCanvasId, d as declareCanvasKind, f as forgetCanvasKind } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
6
- import { r, b as b2, c, e, g as g2, h as h2 } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
2
+ import { i, h } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
3
+ import { r as registerCanvasBodies, c as canvasBodies } from "./chunks/canvasBodies-CMqo5eHg.js";
4
+ import { g, a, b } from "./chunks/canvasBodies-CMqo5eHg.js";
5
+ import { b as isPackageCanvasId, d as declareCanvasKind, f as forgetCanvasKind } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
6
+ import { r, c, e, g as g2, h as h2, j } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
7
7
  import { r as registerCanvasFeatureFlags, c as canvasFeatureFlags } from "./chunks/canvas-feature-flags-Cn8xBliA.js";
8
8
  import { A, i as i2 } from "./chunks/icon-names-C5PeVvkJ.js";
9
9
  import { A as A2, f } from "./chunks/host-color-scheme-Jhb7JZR7.js";
10
- import { A as A3, u } from "./chunks/link-navigation-a_sRfmsj.js";
11
- import { A as A4, B, C, a as a2, D, b as b3, c as c2, d, e as e2, G, H, f as f2, I, g as g3, L, M, h as h3, i as i3, j, P, R, k, S, l, m, n, o, p, q, T, r as r2, s, t, u as u2, v, W, w, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2 as a22, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/index-DZovGMpG.js";
10
+ import { A as A3, u } from "./chunks/link-navigation-DQWyeNkx.js";
11
+ import { A as A4, B, C, a as a2, D, b as b2, c as c2, d, e as e2, G, H, f as f2, I, g as g3, L, M, h as h3, i as i3, j as j2, P, R, k, S, l, m, n, o, p, q, T, r as r2, s, t, u as u2, v, W, w, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2 as a22, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/index-DAEGct6X.js";
12
12
  import { u as u3, a as a10 } from "./chunks/AgentsConversationClientContext-B_UJSLXU.js";
13
13
  const registerCanvasKind = (kind) => {
14
14
  if (isPackageCanvasId(kind.canvasId)) {
@@ -36,7 +36,7 @@ export {
36
36
  C as Checkbox,
37
37
  a2 as ConversationSearchResultsList,
38
38
  D as DEFAULT_AGENTS_COMPONENTS,
39
- b3 as DEFAULT_AGENTS_TEXTS,
39
+ b2 as DEFAULT_AGENTS_TEXTS,
40
40
  c2 as DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX,
41
41
  d as DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME,
42
42
  e2 as DateInput,
@@ -49,7 +49,7 @@ export {
49
49
  M as Map,
50
50
  h3 as MapMarker,
51
51
  i3 as Markdown,
52
- j as ModalLayer,
52
+ j2 as ModalLayer,
53
53
  P as ProgressBar,
54
54
  R as RadioGroup,
55
55
  k as RangeSlider,
@@ -90,14 +90,14 @@ export {
90
90
  registerCanvasBodies,
91
91
  registerCanvasFeatureFlags,
92
92
  registerCanvasKind,
93
- h as registerComposedViewDataSourceFetcher,
94
- b2 as registerConceptExplainerTypes,
95
- i as registerConversationWidgets,
96
- c as registerDriveFileCanvasOpener,
97
- e as registerDriveFileCardsSource,
93
+ i as registerComposedViewDataSourceFetcher,
94
+ c as registerConceptExplainerTypes,
95
+ h as registerConversationWidgets,
96
+ e as registerDriveFileCanvasOpener,
97
+ g2 as registerDriveFileCardsSource,
98
98
  b as registerEntityDetailBodies,
99
- g2 as registerFilePreviewSource,
100
- h2 as registerWidgetHydrator,
99
+ h2 as registerFilePreviewSource,
100
+ j as registerWidgetHydrator,
101
101
  Z as reportRunningTurn,
102
102
  _ as reportWidgetCrash,
103
103
  $ as setAgentsEnvironment,
package/dist/kit.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/widget-name-resolver-DXIE9JUr.js";
3
- import { M } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
2
+ import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
3
+ import { M } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
4
4
  import { E as E2, u as u2 } from "./chunks/entity-detail-name-3A82gDAp.js";
5
5
  export {
6
6
  A as ApexChart,