@apia/ai 5.2.3 → 6.0.2

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 (86) hide show
  1. package/dist/assistant/index.d.d.ts +49 -0
  2. package/dist/assistant/index.d.d.ts.map +1 -0
  3. package/dist/assistant/index.js +154 -0
  4. package/dist/assistant/index.js.map +1 -0
  5. package/dist/assistant/runtime/conversationActivity.js +11 -0
  6. package/dist/assistant/runtime/conversationActivity.js.map +1 -0
  7. package/dist/assistant/runtime/conversationAnnotations.js +28 -0
  8. package/dist/assistant/runtime/conversationAnnotations.js.map +1 -0
  9. package/dist/assistant/runtime/conversationAttachmentPreview.js +33 -0
  10. package/dist/assistant/runtime/conversationAttachmentPreview.js.map +1 -0
  11. package/dist/assistant/runtime/conversationAttachments.js +24 -0
  12. package/dist/assistant/runtime/conversationAttachments.js.map +1 -0
  13. package/dist/assistant/runtime/conversationClient.d.d.ts +26 -0
  14. package/dist/assistant/runtime/conversationClient.d.d.ts.map +1 -0
  15. package/dist/assistant/runtime/conversationClient.js +599 -0
  16. package/dist/assistant/runtime/conversationClient.js.map +1 -0
  17. package/dist/assistant/runtime/conversationPlan.js +12 -0
  18. package/dist/assistant/runtime/conversationPlan.js.map +1 -0
  19. package/dist/assistant/runtime/conversationProjection.d.d.ts +8 -0
  20. package/dist/assistant/runtime/conversationProjection.d.d.ts.map +1 -0
  21. package/dist/assistant/runtime/conversationProjection.js +184 -0
  22. package/dist/assistant/runtime/conversationProjection.js.map +1 -0
  23. package/dist/assistant/runtime/coordinatorProxy.js +302 -0
  24. package/dist/assistant/runtime/coordinatorProxy.js.map +1 -0
  25. package/dist/chat/ChatController/ChatController.d.ts +13 -9
  26. package/dist/chat/ChatController/ChatController.js +103 -94
  27. package/dist/chat/ChatController/ChatController.js.map +1 -1
  28. package/dist/chat/ChatController/annotationStyles.js +1 -78
  29. package/dist/chat/ChatController/annotationStyles.js.map +1 -1
  30. package/dist/chat/ChatController/annotationTargets.d.ts +3 -1
  31. package/dist/chat/ChatController/annotationTargets.js +7 -1
  32. package/dist/chat/ChatController/annotationTargets.js.map +1 -1
  33. package/dist/chat/ChatController/components/AnnotationDraft.js +79 -0
  34. package/dist/chat/ChatController/components/AnnotationDraft.js.map +1 -0
  35. package/dist/chat/ChatController/components/AssistantMessageActions.d.ts +4 -0
  36. package/dist/chat/ChatController/components/AssistantMessageActions.d.ts.map +1 -0
  37. package/dist/chat/ChatController/components/AssistantMessageActions.js +102 -0
  38. package/dist/chat/ChatController/components/AssistantMessageActions.js.map +1 -0
  39. package/dist/chat/ChatController/components/AssistantTurnMessage.d.ts +24 -1
  40. package/dist/chat/ChatController/components/AssistantTurnMessage.js +155 -26
  41. package/dist/chat/ChatController/components/AssistantTurnMessage.js.map +1 -1
  42. package/dist/chat/ChatController/components/ChatMessage.d.ts +8 -5
  43. package/dist/chat/ChatController/components/ChatMessage.js +27 -22
  44. package/dist/chat/ChatController/components/ChatMessage.js.map +1 -1
  45. package/dist/chat/ChatController/components/History.d.ts +5 -1
  46. package/dist/chat/ChatController/components/History.js +17 -7
  47. package/dist/chat/ChatController/components/History.js.map +1 -1
  48. package/dist/chat/ChatController/components/Message.d.ts +7 -2
  49. package/dist/chat/ChatController/components/Message.js +22 -8
  50. package/dist/chat/ChatController/components/Message.js.map +1 -1
  51. package/dist/chat/ChatController/components/MessageBlocks.d.ts +2 -5
  52. package/dist/chat/ChatController/components/MessageBlocks.js +6 -48
  53. package/dist/chat/ChatController/components/MessageBlocks.js.map +1 -1
  54. package/dist/chat/ChatController/components/MessageBody.js +10 -3
  55. package/dist/chat/ChatController/components/MessageBody.js.map +1 -1
  56. package/dist/chat/ChatController/components/PendingMessagesPanel.js +2 -3
  57. package/dist/chat/ChatController/components/PendingMessagesPanel.js.map +1 -1
  58. package/dist/chat/ChatController/components/SentAnnotations.js +5 -3
  59. package/dist/chat/ChatController/components/SentAnnotations.js.map +1 -1
  60. package/dist/chat/ChatController/components/TextArea/QuestionComposer.js +1 -2
  61. package/dist/chat/ChatController/components/TextArea/QuestionComposer.js.map +1 -1
  62. package/dist/chat/ChatController/components/TextArea.d.ts +3 -5
  63. package/dist/chat/ChatController/components/TextArea.js +5 -69
  64. package/dist/chat/ChatController/components/TextArea.js.map +1 -1
  65. package/dist/chat/ChatController/types.d.ts +28 -1
  66. package/dist/index.d.ts +7 -8
  67. package/dist/index.js +5 -6
  68. package/dist/index.js.map +1 -1
  69. package/dist/stream/ResponseStream.d.ts +15 -10
  70. package/dist/stream/ResponseStream.js +58 -61
  71. package/dist/stream/ResponseStream.js.map +1 -1
  72. package/dist/stream/reasoningSummary.js +19 -0
  73. package/dist/stream/reasoningSummary.js.map +1 -0
  74. package/package.json +8 -8
  75. package/dist/assistant/AssistantController.d.ts +0 -53
  76. package/dist/assistant/AssistantController.d.ts.map +0 -1
  77. package/dist/assistant/AssistantController.js +0 -131
  78. package/dist/assistant/AssistantController.js.map +0 -1
  79. package/dist/assistant/HandoffCoordinator.d.ts +0 -18
  80. package/dist/assistant/HandoffCoordinator.d.ts.map +0 -1
  81. package/dist/assistant/HandoffCoordinator.js +0 -35
  82. package/dist/assistant/HandoffCoordinator.js.map +0 -1
  83. package/dist/assistant/PanelAssistantTransport.d.ts +0 -28
  84. package/dist/assistant/PanelAssistantTransport.d.ts.map +0 -1
  85. package/dist/assistant/PanelAssistantTransport.js +0 -48
  86. package/dist/assistant/PanelAssistantTransport.js.map +0 -1
@@ -83,83 +83,6 @@ const annotationPopoverStyles = {
83
83
  }
84
84
  }
85
85
  };
86
- const annotationComposerStyles = {
87
- display: "flex",
88
- alignItems: "flex-end",
89
- flexWrap: "wrap",
90
- gap: 2,
91
- width: "100%",
92
- minWidth: 0,
93
- pb: 2,
94
- ".chatAnnotationCard": {
95
- display: "flex",
96
- flexDirection: "column",
97
- gap: 1,
98
- boxSizing: "border-box",
99
- width: "min(240px, 100%)",
100
- maxWidth: "100%",
101
- minWidth: 0,
102
- p: 2,
103
- background: "palette.background.default",
104
- color: "palette.text.primary",
105
- border: "1px solid",
106
- borderColor: "palette.border.section",
107
- borderRadius: "8px"
108
- },
109
- ".chatAnnotationCard__header": {
110
- alignItems: "center",
111
- display: "flex",
112
- justifyContent: "space-between",
113
- gap: 1,
114
- fontSize: 12,
115
- fontWeight: 700
116
- },
117
- ".chatAnnotationCard__actions": {
118
- display: "flex",
119
- gap: 1,
120
- button: {
121
- background: "transparent",
122
- border: "none",
123
- color: "inherit",
124
- cursor: "pointer",
125
- font: "inherit",
126
- p: 1,
127
- opacity: 0.7,
128
- width: "24px",
129
- height: "24px",
130
- borderRadius: "6px",
131
- "&:hover, &:focus-visible": {
132
- opacity: 1,
133
- background: "palette.background.paper"
134
- }
135
- }
136
- },
137
- ".chatAnnotationCard__text": {
138
- opacity: 0.78,
139
- display: "-webkit-box",
140
- fontSize: 12,
141
- lineHeight: 1.4,
142
- maxHeight: "50px",
143
- overflow: "hidden",
144
- WebkitBoxOrient: "vertical",
145
- WebkitLineClamp: 3
146
- },
147
- ".chatAnnotationCard__comment": {
148
- fontSize: 12,
149
- lineHeight: 1.4,
150
- overflowWrap: "anywhere"
151
- },
152
- ".chatAnnotations__count": {
153
- color: "inherit",
154
- fontSize: 12,
155
- px: 2,
156
- py: 1,
157
- border: "1px solid",
158
- borderColor: "palette.border.field",
159
- borderRadius: "8px",
160
- background: "palette.background.default"
161
- }
162
- };
163
86
 
164
- export { annotationComposerStyles, annotationPopoverStyles };
87
+ export { annotationPopoverStyles };
165
88
  //# sourceMappingURL=annotationStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotationStyles.js","sources":["../../../src/chat/ChatController/annotationStyles.ts"],"sourcesContent":["import type { ThemeUICSSObject } from '@apia/theme';\nimport { focusOutline } from '@apia/theme';\n\n/** Kept with ChatController so the annotation UI does not depend on a separate theme rebuild. */\nexport const annotationPopoverStyles: ThemeUICSSObject = {\n position: 'fixed',\n zIndex: 1200,\n boxSizing: 'border-box',\n width: 'min(360px, calc(100vw - 16px))',\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n p: 3,\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.section',\n borderRadius: '12px',\n boxShadow: '0 12px 32px rgba(0, 0, 0, 0.22)',\n\n '&.chatAnnotationPopover--offer': {\n width: 'auto',\n p: 0,\n borderRadius: '8px',\n },\n\n '.chatAnnotationPopover__offer': {\n border: 'none',\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n fontSize: 12,\n cursor: 'pointer',\n px: 3,\n py: 2,\n borderRadius: '8px',\n '&:hover, &:focus-visible': {\n background: 'palette.background.default',\n },\n },\n\n '.chatAnnotationPopover__preview': {\n opacity: 0.72,\n fontSize: 12,\n lineHeight: 1.4,\n maxHeight: '44px',\n overflow: 'hidden',\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 2,\n },\n\n '.chatAnnotationPopover__comment': {\n boxSizing: 'border-box',\n width: '100%',\n minHeight: '56px',\n maxHeight: '160px',\n resize: 'vertical',\n p: 2,\n font: 'inherit',\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.field',\n borderRadius: '8px',\n '&:focus': focusOutline,\n },\n\n '.chatAnnotationPopover__actions': {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 2,\n button: {\n cursor: 'pointer',\n font: 'inherit',\n fontSize: 12,\n fontWeight: 600,\n px: 3,\n py: 2,\n borderRadius: '8px',\n border: '1px solid',\n borderColor: 'palette.border.field',\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n },\n 'button:last-child': {\n background: 'palette.primary.main',\n color: 'white',\n borderColor: 'palette.primary.main',\n },\n },\n};\n\nexport const annotationComposerStyles: ThemeUICSSObject = {\n display: 'flex',\n alignItems: 'flex-end',\n flexWrap: 'wrap',\n gap: 2,\n width: '100%',\n minWidth: 0,\n pb: 2,\n\n '.chatAnnotationCard': {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n boxSizing: 'border-box',\n width: 'min(240px, 100%)',\n maxWidth: '100%',\n minWidth: 0,\n p: 2,\n background: 'palette.background.default',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.section',\n borderRadius: '8px',\n },\n\n '.chatAnnotationCard__header': {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n fontSize: 12,\n fontWeight: 700,\n },\n\n '.chatAnnotationCard__actions': {\n display: 'flex',\n gap: 1,\n button: {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n p: 1,\n opacity: 0.7,\n width: '24px',\n height: '24px',\n borderRadius: '6px',\n '&:hover, &:focus-visible': {\n opacity: 1,\n background: 'palette.background.paper',\n },\n },\n },\n\n '.chatAnnotationCard__text': {\n opacity: 0.78,\n display: '-webkit-box',\n fontSize: 12,\n lineHeight: 1.4,\n maxHeight: '50px',\n overflow: 'hidden',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 3,\n },\n\n '.chatAnnotationCard__comment': {\n fontSize: 12,\n lineHeight: 1.4,\n overflowWrap: 'anywhere',\n },\n\n '.chatAnnotations__count': {\n color: 'inherit',\n fontSize: 12,\n px: 2,\n py: 1,\n border: '1px solid',\n borderColor: 'palette.border.field',\n borderRadius: '8px',\n background: 'palette.background.default',\n },\n};\n\nexport const annotationHistoryStyles: ThemeUICSSObject = {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n mt: 2,\n\n '.history_message__annotation': {\n borderLeft: '2px solid currentColor',\n fontSize: 12,\n opacity: 0.9,\n pl: 2,\n },\n\n '.history_message__annotationComment': {\n fontSize: 13,\n fontWeight: 600,\n mt: 1,\n },\n};\n"],"names":[],"mappings":";;AAIO,MAAM,uBAAA,GAA4C;AAAA,EACvD,QAAA,EAAU,OAAA;AAAA,EACV,MAAA,EAAQ,IAAA;AAAA,EACR,SAAA,EAAW,YAAA;AAAA,EACX,KAAA,EAAO,gCAAA;AAAA,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EAEA,8BAAA,EAAgC;AAAA,IAC9B,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY,GAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EAEA,yBAAA,EAA2B;AAAA,IACzB,KAAA,EAAO,SAAA;AAAA,IACP,QAAA,EAAU,EAAA;AAAA,IACV,EAAA,EAAI,CAAA;AAAA,IACJ,EAAA,EAAI,CAAA;AAAA,IACJ,MAAA,EAAQ,WAAA;AAAA,IACR,WAAA,EAAa,sBAAA;AAAA,IACb,YAAA,EAAc,KAAA;AAAA,IACd,UAAA,EAAY;AAAA;AAEhB;;;;"}
1
+ {"version":3,"file":"annotationStyles.js","sources":["../../../src/chat/ChatController/annotationStyles.ts"],"sourcesContent":["import type { ThemeUICSSObject } from '@apia/theme';\nimport { focusOutline } from '@apia/theme';\n\n/** Kept with ChatController so the annotation UI does not depend on a separate theme rebuild. */\nexport const annotationPopoverStyles: ThemeUICSSObject = {\n position: 'fixed',\n zIndex: 1200,\n boxSizing: 'border-box',\n width: 'min(360px, calc(100vw - 16px))',\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n p: 3,\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.section',\n borderRadius: '12px',\n boxShadow: '0 12px 32px rgba(0, 0, 0, 0.22)',\n\n '&.chatAnnotationPopover--offer': {\n width: 'auto',\n p: 0,\n borderRadius: '8px',\n },\n\n '.chatAnnotationPopover__offer': {\n border: 'none',\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n fontSize: 12,\n cursor: 'pointer',\n px: 3,\n py: 2,\n borderRadius: '8px',\n '&:hover, &:focus-visible': {\n background: 'palette.background.default',\n },\n },\n\n '.chatAnnotationPopover__preview': {\n opacity: 0.72,\n fontSize: 12,\n lineHeight: 1.4,\n maxHeight: '44px',\n overflow: 'hidden',\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 2,\n },\n\n '.chatAnnotationPopover__comment': {\n boxSizing: 'border-box',\n width: '100%',\n minHeight: '56px',\n maxHeight: '160px',\n resize: 'vertical',\n p: 2,\n font: 'inherit',\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.field',\n borderRadius: '8px',\n '&:focus': focusOutline,\n },\n\n '.chatAnnotationPopover__actions': {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 2,\n button: {\n cursor: 'pointer',\n font: 'inherit',\n fontSize: 12,\n fontWeight: 600,\n px: 3,\n py: 2,\n borderRadius: '8px',\n border: '1px solid',\n borderColor: 'palette.border.field',\n background: 'palette.background.paper',\n color: 'palette.text.primary',\n },\n 'button:last-child': {\n background: 'palette.primary.main',\n color: 'white',\n borderColor: 'palette.primary.main',\n },\n },\n};\n\nexport const annotationComposerStyles: ThemeUICSSObject = {\n display: 'flex',\n alignItems: 'flex-end',\n flexWrap: 'wrap',\n gap: 2,\n width: '100%',\n minWidth: 0,\n pb: 2,\n\n '.chatAnnotationCard': {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n boxSizing: 'border-box',\n width: 'min(240px, 100%)',\n maxWidth: '100%',\n minWidth: 0,\n p: 2,\n background: 'palette.background.default',\n color: 'palette.text.primary',\n border: '1px solid',\n borderColor: 'palette.border.section',\n borderRadius: '8px',\n },\n\n '.chatAnnotationCard__header': {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n fontSize: 12,\n fontWeight: 700,\n },\n\n '.chatAnnotationCard__actions': {\n display: 'flex',\n gap: 1,\n button: {\n background: 'transparent',\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n p: 1,\n opacity: 0.7,\n width: '24px',\n height: '24px',\n borderRadius: '6px',\n '&:hover, &:focus-visible': {\n opacity: 1,\n background: 'palette.background.paper',\n },\n },\n },\n\n '.chatAnnotationCard__text': {\n opacity: 0.78,\n display: '-webkit-box',\n fontSize: 12,\n lineHeight: 1.4,\n maxHeight: '50px',\n overflow: 'hidden',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 3,\n },\n\n '.chatAnnotationCard__comment': {\n fontSize: 12,\n lineHeight: 1.4,\n overflowWrap: 'anywhere',\n },\n\n '.chatAnnotations__count': {\n color: 'inherit',\n fontSize: 12,\n px: 2,\n py: 1,\n border: '1px solid',\n borderColor: 'palette.border.field',\n borderRadius: '8px',\n background: 'palette.background.default',\n },\n};\n\nexport const annotationHistoryStyles: ThemeUICSSObject = {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n mt: 2,\n\n '.history_message__annotation': {\n borderLeft: '2px solid currentColor',\n fontSize: 12,\n opacity: 0.9,\n pl: 2,\n },\n\n '.history_message__annotationComment': {\n fontSize: 13,\n fontWeight: 600,\n mt: 1,\n },\n};\n"],"names":[],"mappings":";;AAIO,MAAM,uBAAA,GAA4C;AAAA,EACvD,QAAA,EAAU,OAAA;AAAA,EACV,MAAA,EAAQ,IAAA;AAAA,EACR,SAAA,EAAW,YAAA;AAAA,EACX,KAAA,EAAO,gCAAA;AAAA,EACP,OAAA,EAAS,MAAA;AAAA,EACT,aAAA,EAAe,QAAA;AAAA,EACf,GAAA,EAAK,CAAA;AAAA,EACL,CAAA,EAAG,CAAA;AAAA,EACH,UAAA,EAAY,0BAAA;AAAA,EACZ,KAAA,EAAO,sBAAA;AAAA,EACP,MAAA,EAAQ,WAAA;AAAA,EACR,WAAA,EAAa,wBAAA;AAAA,EACb,YAAA,EAAc,MAAA;AAAA,EACd,SAAA,EAAW,iCAAA;AAAA,EAEX,gCAAA,EAAkC;AAAA,IAChC,KAAA,EAAO,MAAA;AAAA,IACP,CAAA,EAAG,CAAA;AAAA,IACH,YAAA,EAAc;AAAA,GAChB;AAAA,EAEA,+BAAA,EAAiC;AAAA,IAC/B,MAAA,EAAQ,MAAA;AAAA,IACR,UAAA,EAAY,aAAA;AAAA,IACZ,KAAA,EAAO,SAAA;AAAA,IACP,IAAA,EAAM,SAAA;AAAA,IACN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AAA;AAAA,MACd,MAAA,EAAQ,WAAA;AAAA,MACR,WAAA,EAAa,sBAAA;AAAA,MACb,UAAA,EAAY,0BAAA;AAAA,MACZ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,UAAA,EAAY,sBAAA;AAAA,MACZ,KAAA,EAAO,OAAA;AAAA,MACP,WAAA,EAAa;AAAA;AACf;AAEJ;;;;"}
@@ -5,6 +5,8 @@ type AnnotationTargetResolver = (selection: TChatAnnotationSelection) => TChatAn
5
5
  declare function registerChatAnnotationTarget(element: Element, resolve: AnnotationTargetResolver): () => void;
6
6
  /** Returns null when no registered target handled this selection. */
7
7
  declare function resolveChatAnnotationTargets(root: Element, context: TChatAnnotationSelection): TChatAnnotation[] | null;
8
+ /** Stable revision marker for a frozen public quote; this is not an authorization signature. */
9
+ declare function chatQuoteVersion(text: string): string;
8
10
 
9
- export { registerChatAnnotationTarget, resolveChatAnnotationTargets };
11
+ export { chatQuoteVersion, registerChatAnnotationTarget, resolveChatAnnotationTargets };
10
12
  //# sourceMappingURL=annotationTargets.d.ts.map
@@ -30,6 +30,12 @@ function resolveChatAnnotationTargets(root, context) {
30
30
  }
31
31
  return handled ? result : null;
32
32
  }
33
+ function chatQuoteVersion(text) {
34
+ let hash = 2166136261;
35
+ for (let i = 0; i < text.length; i++)
36
+ hash = Math.imul(hash ^ text.charCodeAt(i), 16777619);
37
+ return `quote:${(hash >>> 0).toString(16)}`;
38
+ }
33
39
 
34
- export { registerChatAnnotationTarget, resolveChatAnnotationTargets };
40
+ export { chatQuoteVersion, registerChatAnnotationTarget, resolveChatAnnotationTargets };
35
41
  //# sourceMappingURL=annotationTargets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotationTargets.js","sources":["../../../src/chat/ChatController/annotationTargets.ts"],"sourcesContent":["import type {\n TChatAnnotation,\n TChatAnnotationSelection,\n} from './types';\n\ntype AnnotationTargetResolver = (\n selection: TChatAnnotationSelection,\n) => TChatAnnotation[] | null;\n\nconst targetResolvers = new WeakMap<Element, AnnotationTargetResolver>();\nconst TARGET_ATTRIBUTE = 'data-chat-annotation-target';\n\n/** Register a rendered element (for example, a task row) as an annotation source. */\nexport function registerChatAnnotationTarget(\n element: Element,\n resolve: AnnotationTargetResolver,\n): () => void {\n targetResolvers.set(element, resolve);\n element.setAttribute(TARGET_ATTRIBUTE, '');\n return () => {\n if (targetResolvers.get(element) === resolve) {\n targetResolvers.delete(element);\n element.removeAttribute(TARGET_ATTRIBUTE);\n }\n };\n}\n\n/** Returns null when no registered target handled this selection. */\nexport function resolveChatAnnotationTargets(\n root: Element,\n context: TChatAnnotationSelection,\n): TChatAnnotation[] | null {\n if (context.selection.rangeCount === 0) return null;\n const range = context.selection.getRangeAt(0);\n const selectedTargets = Array.from(\n root.querySelectorAll(`[${TARGET_ATTRIBUTE}]`),\n ).filter((element) => range.intersectsNode(element));\n if (!selectedTargets.length) return null;\n\n const result: TChatAnnotation[] = [];\n let handled = false;\n for (const element of selectedTargets) {\n const resolved = targetResolvers.get(element)?.(context);\n if (resolved) {\n handled = true;\n result.push(...resolved);\n }\n }\n return handled ? result : null;\n}\n"],"names":[],"mappings":"AASA,MAAM,eAAA,uBAAsB,OAAA,EAA2C;AACvE,MAAM,gBAAA,GAAmB,6BAAA;AAGlB,SAAS,4BAAA,CACd,SACA,OAAA,EACY;AACZ,EAAA,eAAA,CAAgB,GAAA,CAAI,SAAS,OAAO,CAAA;AACpC,EAAA,OAAA,CAAQ,YAAA,CAAa,kBAAkB,EAAE,CAAA;AACzC,EAAA,OAAO,MAAM;AACX,IAAA,IAAI,eAAA,CAAgB,GAAA,CAAI,OAAO,CAAA,KAAM,OAAA,EAAS;AAC5C,MAAA,eAAA,CAAgB,OAAO,OAAO,CAAA;AAC9B,MAAA,OAAA,CAAQ,gBAAgB,gBAAgB,CAAA;AAAA;AAC1C,GACF;AACF;AAGO,SAAS,4BAAA,CACd,MACA,OAAA,EAC0B;AAC1B,EAAA,IAAI,OAAA,CAAQ,UAAU,UAAA,KAAe,CAAA;AAAG,IAAA,OAAO,IAAA;AAC/C,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,SAAA,CAAU,UAAA,CAAW,CAAC,CAAA;AAC5C,EAAA,MAAM,kBAAkB,KAAA,CAAM,IAAA;AAAA,IAC5B,IAAA,CAAK,gBAAA,CAAiB,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAA,CAAG;AAAA,IAC7C,MAAA,CAAO,CAAC,YAAY,KAAA,CAAM,cAAA,CAAe,OAAO,CAAC,CAAA;AACnD,EAAA,IAAI,CAAC,eAAA,CAAgB,MAAA;AAAQ,IAAA,OAAO,IAAA;AAEpC,EAAA,MAAM,SAA4B,EAAC;AACnC,EAAA,IAAI,OAAA,GAAU,KAAA;AACd,EAAA,KAAA,MAAW,WAAW,eAAA,EAAiB;AACrC,IAAA,MAAM,QAAA,GAAW,eAAA,CAAgB,GAAA,CAAI,OAAO,IAAI,OAAO,CAAA;AACvD,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAA,GAAU,IAAA;AACV,MAAA,MAAA,CAAO,IAAA,CAAK,GAAG,QAAQ,CAAA;AAAA;AACzB;AAEF,EAAA,OAAO,UAAU,MAAA,GAAS,IAAA;AAC5B;;;;"}
1
+ {"version":3,"file":"annotationTargets.js","sources":["../../../src/chat/ChatController/annotationTargets.ts"],"sourcesContent":["import type {\n TChatAnnotation,\n TChatAnnotationSelection,\n} from './types';\n\ntype AnnotationTargetResolver = (\n selection: TChatAnnotationSelection,\n) => TChatAnnotation[] | null;\n\nconst targetResolvers = new WeakMap<Element, AnnotationTargetResolver>();\nconst TARGET_ATTRIBUTE = 'data-chat-annotation-target';\n\n/** Register a rendered element (for example, a task row) as an annotation source. */\nexport function registerChatAnnotationTarget(\n element: Element,\n resolve: AnnotationTargetResolver,\n): () => void {\n targetResolvers.set(element, resolve);\n element.setAttribute(TARGET_ATTRIBUTE, '');\n return () => {\n if (targetResolvers.get(element) === resolve) {\n targetResolvers.delete(element);\n element.removeAttribute(TARGET_ATTRIBUTE);\n }\n };\n}\n\n/** Returns null when no registered target handled this selection. */\nexport function resolveChatAnnotationTargets(\n root: Element,\n context: TChatAnnotationSelection,\n): TChatAnnotation[] | null {\n if (context.selection.rangeCount === 0) return null;\n const range = context.selection.getRangeAt(0);\n const selectedTargets = Array.from(\n root.querySelectorAll(`[${TARGET_ATTRIBUTE}]`),\n ).filter((element) => range.intersectsNode(element));\n if (!selectedTargets.length) return null;\n\n const result: TChatAnnotation[] = [];\n let handled = false;\n for (const element of selectedTargets) {\n const resolved = targetResolvers.get(element)?.(context);\n if (resolved) {\n handled = true;\n result.push(...resolved);\n }\n }\n return handled ? result : null;\n}\n\n/** Stable revision marker for a frozen public quote; this is not an authorization signature. */\nexport function chatQuoteVersion(text: string) {\n let hash = 2166136261; for (let i = 0; i < text.length; i++) hash = Math.imul(hash ^ text.charCodeAt(i), 16777619);\n return `quote:${(hash >>> 0).toString(16)}`;\n}\n"],"names":[],"mappings":"AASA,MAAM,eAAA,uBAAsB,OAAA,EAA2C;AACvE,MAAM,gBAAA,GAAmB,6BAAA;AAGlB,SAAS,4BAAA,CACd,SACA,OAAA,EACY;AACZ,EAAA,eAAA,CAAgB,GAAA,CAAI,SAAS,OAAO,CAAA;AACpC,EAAA,OAAA,CAAQ,YAAA,CAAa,kBAAkB,EAAE,CAAA;AACzC,EAAA,OAAO,MAAM;AACX,IAAA,IAAI,eAAA,CAAgB,GAAA,CAAI,OAAO,CAAA,KAAM,OAAA,EAAS;AAC5C,MAAA,eAAA,CAAgB,OAAO,OAAO,CAAA;AAC9B,MAAA,OAAA,CAAQ,gBAAgB,gBAAgB,CAAA;AAAA;AAC1C,GACF;AACF;AAGO,SAAS,4BAAA,CACd,MACA,OAAA,EAC0B;AAC1B,EAAA,IAAI,OAAA,CAAQ,UAAU,UAAA,KAAe,CAAA;AAAG,IAAA,OAAO,IAAA;AAC/C,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,SAAA,CAAU,UAAA,CAAW,CAAC,CAAA;AAC5C,EAAA,MAAM,kBAAkB,KAAA,CAAM,IAAA;AAAA,IAC5B,IAAA,CAAK,gBAAA,CAAiB,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAA,CAAG;AAAA,IAC7C,MAAA,CAAO,CAAC,YAAY,KAAA,CAAM,cAAA,CAAe,OAAO,CAAC,CAAA;AACnD,EAAA,IAAI,CAAC,eAAA,CAAgB,MAAA;AAAQ,IAAA,OAAO,IAAA;AAEpC,EAAA,MAAM,SAA4B,EAAC;AACnC,EAAA,IAAI,OAAA,GAAU,KAAA;AACd,EAAA,KAAA,MAAW,WAAW,eAAA,EAAiB;AACrC,IAAA,MAAM,QAAA,GAAW,eAAA,CAAgB,GAAA,CAAI,OAAO,IAAI,OAAO,CAAA;AACvD,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAA,GAAU,IAAA;AACV,MAAA,MAAA,CAAO,IAAA,CAAK,GAAG,QAAQ,CAAA;AAAA;AACzB;AAEF,EAAA,OAAO,UAAU,MAAA,GAAS,IAAA;AAC5B;AAGO,SAAS,iBAAiB,IAAA,EAAc;AAC7C,EAAA,IAAI,IAAA,GAAO,UAAA;AAAY,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,MAAA,EAAQ,CAAA,EAAA;AAAK,IAAA,IAAA,GAAO,KAAK,IAAA,CAAK,IAAA,GAAO,KAAK,UAAA,CAAW,CAAC,GAAG,QAAQ,CAAA;AACjH,EAAA,OAAO,CAAA,MAAA,EAAA,CAAU,IAAA,KAAS,CAAA,EAAG,QAAA,CAAS,EAAE,CAAC,CAAA,CAAA;AAC3C;;;;"}
@@ -0,0 +1,79 @@
1
+ import { jsxs, jsx } from '@apia/theme/jsx-runtime';
2
+ import { observer } from 'mobx-react-lite';
3
+ import { Box, getVariant } from '@apia/theme';
4
+ import { useRef, useEffect } from 'react';
5
+
6
+ const AnnotationDraft = observer(({ annotations, editingId, onRemove, onComment, onDismissEdit }) => {
7
+ const details = useRef(null);
8
+ const comments = useRef(/* @__PURE__ */ new Map());
9
+ useEffect(() => {
10
+ if (!editingId || !details.current)
11
+ return;
12
+ details.current.open = true;
13
+ comments.current.get(editingId)?.focus();
14
+ }, [editingId]);
15
+ if (!annotations.length)
16
+ return null;
17
+ return /* @__PURE__ */ jsxs(
18
+ Box,
19
+ {
20
+ as: "details",
21
+ ref: details,
22
+ className: "chatAnnotations",
23
+ ...getVariant("layout.common.chat.annotationHistory"),
24
+ onToggle: () => {
25
+ if (!details.current?.open)
26
+ onDismissEdit();
27
+ },
28
+ children: [
29
+ /* @__PURE__ */ jsxs(Box, { as: "summary", className: "sentAnnotations__summary", children: [
30
+ /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: [
31
+ /* @__PURE__ */ jsx("path", { d: "M5 4h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-7l-5 3v-3H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z" }),
32
+ /* @__PURE__ */ jsx("path", { d: "M7 9h10M7 13h7" })
33
+ ] }),
34
+ annotations.length,
35
+ " ",
36
+ annotations.length === 1 ? "anotaci\xF3n" : "anotaciones"
37
+ ] }),
38
+ /* @__PURE__ */ jsx(Box, { className: "sentAnnotations__list", children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs(Box, { className: "sentAnnotations__item", children: [
39
+ /* @__PURE__ */ jsxs(Box, { className: "chatAnnotations__header", children: [
40
+ /* @__PURE__ */ jsx("span", { className: "chatAnnotations__number", children: index + 1 }),
41
+ /* @__PURE__ */ jsx("span", { children: annotation.label }),
42
+ /* @__PURE__ */ jsx(
43
+ "button",
44
+ {
45
+ type: "button",
46
+ className: "chatAnnotations__remove",
47
+ "aria-label": `Quitar anotaci\xF3n ${index + 1}`,
48
+ title: "Quitar anotaci\xF3n",
49
+ onClick: () => onRemove(annotation.id),
50
+ children: "\xD7"
51
+ }
52
+ )
53
+ ] }),
54
+ /* @__PURE__ */ jsx(Box, { as: "blockquote", className: "sentAnnotations__text", children: annotation.text }),
55
+ /* @__PURE__ */ jsx(
56
+ "textarea",
57
+ {
58
+ className: "chatAnnotations__comment",
59
+ rows: 2,
60
+ ref: (element) => {
61
+ if (element)
62
+ comments.current.set(annotation.id, element);
63
+ else
64
+ comments.current.delete(annotation.id);
65
+ },
66
+ "aria-label": `Comentario de la anotaci\xF3n ${index + 1}`,
67
+ placeholder: "Agreg\xE1 un comentario",
68
+ value: annotation.comment ?? "",
69
+ onChange: (event) => onComment(annotation.id, event.target.value)
70
+ }
71
+ )
72
+ ] }, annotation.id)) })
73
+ ]
74
+ }
75
+ );
76
+ });
77
+
78
+ export { AnnotationDraft };
79
+ //# sourceMappingURL=AnnotationDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationDraft.js","sources":["../../../../src/chat/ChatController/components/AnnotationDraft.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite';\nimport { Box, getVariant } from '@apia/theme';\nimport { useEffect, useRef } from 'react';\nimport type { TChatAnnotation } from '../types';\n\n/** Edits only the current draft. Sent/queued snapshots do not share its annotation objects. */\nexport const AnnotationDraft = observer(({ annotations, editingId, onRemove, onComment, onDismissEdit }: {\n annotations: TChatAnnotation[]; onRemove: (id: string) => void; onComment: (id: string, comment: string) => void;\n editingId?: string | null;\n onDismissEdit: () => void;\n}) => {\n const details = useRef<HTMLDetailsElement>(null);\n const comments = useRef(new Map<string, HTMLTextAreaElement>());\n\n useEffect(() => {\n if (!editingId || !details.current) return;\n details.current.open = true;\n comments.current.get(editingId)?.focus();\n }, [editingId]);\n\n if (!annotations.length) return null;\n\n return <Box as=\"details\" ref={details} className=\"chatAnnotations\" {...getVariant('layout.common.chat.annotationHistory')}\n onToggle={() => { if (!details.current?.open) onDismissEdit(); }}>\n <Box as=\"summary\" className=\"sentAnnotations__summary\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" aria-hidden=\"true\">\n <path d=\"M5 4h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-7l-5 3v-3H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z\" />\n <path d=\"M7 9h10M7 13h7\" />\n </svg>\n {annotations.length} {annotations.length === 1 ? 'anotación' : 'anotaciones'}\n </Box>\n <Box className=\"sentAnnotations__list\">\n {annotations.map((annotation, index) => <Box key={annotation.id} className=\"sentAnnotations__item\">\n <Box className=\"chatAnnotations__header\">\n <span className=\"chatAnnotations__number\">{index + 1}</span>\n <span>{annotation.label}</span>\n <button type=\"button\" className=\"chatAnnotations__remove\"\n aria-label={`Quitar anotación ${index + 1}`} title=\"Quitar anotación\"\n onClick={() => onRemove(annotation.id)}>×</button>\n </Box>\n <Box as=\"blockquote\" className=\"sentAnnotations__text\">{annotation.text}</Box>\n <textarea className=\"chatAnnotations__comment\" rows={2}\n ref={element => { if (element) comments.current.set(annotation.id, element); else comments.current.delete(annotation.id); }}\n aria-label={`Comentario de la anotación ${index + 1}`} placeholder=\"Agregá un comentario\"\n value={annotation.comment ?? ''} onChange={event => onComment(annotation.id, event.target.value)} />\n </Box>)}\n </Box>\n </Box>;\n});\n"],"names":[],"mappings":";;;;;AAMO,MAAM,eAAA,GAAkB,SAAS,CAAC,EAAE,aAAa,SAAA,EAAW,QAAA,EAAU,SAAA,EAAW,aAAA,EAAc,KAIhG;AACJ,EAAA,MAAM,OAAA,GAAU,OAA2B,IAAI,CAAA;AAC/C,EAAA,MAAM,QAAA,GAAW,MAAA,iBAAO,IAAI,GAAA,EAAkC,CAAA;AAE9D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,SAAA,IAAa,CAAC,OAAA,CAAQ,OAAA;AAAS,MAAA;AACpC,IAAA,OAAA,CAAQ,QAAQ,IAAA,GAAO,IAAA;AACvB,I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AAC,CAAA,CAAA;AAAA,cAAI,WAAA,EAAY,yBAAA;AAAA,cACnE,KAAA,EAAO,WAAW,OAAA,IAAW,EAAA;AAAA,cAAI,UAAU,CAAA,KAAA,KAAS,SAAA,CAAU,WAAW,EAAA,EAAI,KAAA,CAAM,OAAO,KAAK;AAAA;AAAA;AAAG,SAAA,EAAA,EAZpD,UAAA,CAAW,EAa7D,CAAM,CAAA,EACR;AAAA;AAAA;AAAA,GACF;AACF,CAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ type ReplyWithAssistantMessage = (markdown: string) => Promise<void>;
2
+
3
+ export type { ReplyWithAssistantMessage };
4
+ //# sourceMappingURL=AssistantMessageActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantMessageActions.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,102 @@
1
+ import { jsxs, jsx } from '@apia/theme/jsx-runtime';
2
+ import { IconButton, ApiaUtil } from '@apia/components';
3
+ import { Box } from '@apia/theme';
4
+ import { getLabel } from '@apia/util';
5
+ import { createContext, useContext, useRef, useState, useEffect } from 'react';
6
+
7
+ const AssistantReplyContext = createContext(void 0);
8
+ async function copyMarkdown(markdown) {
9
+ if (navigator.clipboard?.writeText) {
10
+ try {
11
+ await navigator.clipboard.writeText(markdown);
12
+ return;
13
+ } catch {
14
+ }
15
+ }
16
+ const focused = document.activeElement;
17
+ const input = document.createElement("textarea");
18
+ input.value = markdown;
19
+ input.readOnly = true;
20
+ input.style.cssText = "position:fixed;top:0;left:0;opacity:0;pointer-events:none";
21
+ document.body.appendChild(input);
22
+ try {
23
+ input.focus({ preventScroll: true });
24
+ input.select();
25
+ if (!document.execCommand("copy"))
26
+ throw new Error("Clipboard copy failed");
27
+ } finally {
28
+ input.remove();
29
+ if (focused instanceof HTMLElement)
30
+ focused.focus({ preventScroll: true });
31
+ }
32
+ }
33
+ function AssistantMessageActions({ markdown }) {
34
+ const onReply = useContext(AssistantReplyContext);
35
+ const trigger = useRef(null);
36
+ const sending = useRef(false);
37
+ const [status, setStatus] = useState("idle");
38
+ useEffect(() => {
39
+ if (status === "idle")
40
+ return;
41
+ const timeout = window.setTimeout(() => setStatus("idle"), 2500);
42
+ return () => window.clearTimeout(timeout);
43
+ }, [status]);
44
+ if (!markdown.trim())
45
+ return null;
46
+ return /* @__PURE__ */ jsxs(Box, { className: "history_message__actions", sx: { display: "flex", alignItems: "center", gap: 2, mt: 2 }, children: [
47
+ /* @__PURE__ */ jsx(
48
+ IconButton,
49
+ {
50
+ variant: "icon-only",
51
+ ref: trigger,
52
+ icon: "Ellipsis",
53
+ size: "Sm",
54
+ title: "M\xE1s opciones del mensaje",
55
+ "aria-haspopup": "menu",
56
+ onClick: () => {
57
+ const items = [{
58
+ key: "copy",
59
+ icon: "Copy",
60
+ children: getLabel("btnCopy").text,
61
+ onClick: async () => {
62
+ try {
63
+ await copyMarkdown(markdown);
64
+ setStatus("copied");
65
+ } catch {
66
+ setStatus("copy-error");
67
+ }
68
+ }
69
+ }];
70
+ if (onReply) {
71
+ items.push({
72
+ key: "reply",
73
+ icon: "Reply",
74
+ children: "Responder con este mensaje",
75
+ onClick: async () => {
76
+ if (sending.current)
77
+ return;
78
+ sending.current = true;
79
+ try {
80
+ await onReply(markdown);
81
+ } catch {
82
+ setStatus("reply-error");
83
+ } finally {
84
+ sending.current = false;
85
+ }
86
+ }
87
+ });
88
+ }
89
+ ApiaUtil.instance.menu.open({ menuProps: { anchorRef: trigger }, items });
90
+ }
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsxs(Box, { as: "span", role: "status", sx: { fontSize: 1 }, children: [
94
+ status === "copied" && "Copiado",
95
+ status === "copy-error" && "No se pudo copiar la respuesta",
96
+ status === "reply-error" && "No se pudo enviar la respuesta"
97
+ ] })
98
+ ] });
99
+ }
100
+
101
+ export { AssistantMessageActions, AssistantReplyContext };
102
+ //# sourceMappingURL=AssistantMessageActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantMessageActions.js","sources":["../../../../src/chat/ChatController/components/AssistantMessageActions.tsx"],"sourcesContent":["import { ApiaUtil, IconButton, type TMenuItem } from '@apia/components';\nimport { Box } from '@apia/theme';\nimport { getLabel } from '@apia/util';\nimport { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nexport type ReplyWithAssistantMessage = (markdown: string) => Promise<void>;\nexport const AssistantReplyContext = createContext<ReplyWithAssistantMessage | undefined>(undefined);\n\nasync function copyMarkdown(markdown: string) {\n if (navigator.clipboard?.writeText) {\n try {\n await navigator.clipboard.writeText(markdown);\n return;\n } catch {\n // Some Apia hosts restrict the clipboard API inside embedded views.\n }\n }\n\n const focused = document.activeElement;\n const input = document.createElement('textarea');\n input.value = markdown;\n input.readOnly = true;\n input.style.cssText = 'position:fixed;top:0;left:0;opacity:0;pointer-events:none';\n document.body.appendChild(input);\n try {\n input.focus({ preventScroll: true });\n input.select();\n if (!document.execCommand('copy')) throw new Error('Clipboard copy failed');\n } finally {\n input.remove();\n if (focused instanceof HTMLElement) focused.focus({ preventScroll: true });\n }\n}\n\nexport function AssistantMessageActions({ markdown }: { markdown: string }) {\n const onReply = useContext(AssistantReplyContext);\n const trigger = useRef<HTMLButtonElement>(null);\n const sending = useRef(false);\n const [status, setStatus] = useState<'idle' | 'copied' | 'copy-error' | 'reply-error'>('idle');\n\n useEffect(() => {\n if (status === 'idle') return;\n const timeout = window.setTimeout(() => setStatus('idle'), 2500);\n return () => window.clearTimeout(timeout);\n }, [status]);\n\n if (!markdown.trim()) return null;\n\n return (\n <Box className=\"history_message__actions\" sx={{ display: 'flex', alignItems: 'center', gap: 2, mt: 2 }}>\n <IconButton\n variant=\"icon-only\"\n ref={trigger}\n icon=\"Ellipsis\"\n size=\"Sm\"\n title=\"Más opciones del mensaje\"\n aria-haspopup=\"menu\"\n onClick={() => {\n const items: TMenuItem[] = [{\n key: 'copy',\n icon: 'Copy',\n children: getLabel('btnCopy').text,\n onClick: async () => {\n try {\n await copyMarkdown(markdown);\n setStatus('copied');\n } catch {\n setStatus('copy-error');\n }\n },\n }];\n if (onReply) {\n items.push({\n key: 'reply',\n icon: 'Reply',\n children: 'Responder con este mensaje',\n onClick: async () => {\n if (sending.current) return;\n sending.current = true;\n try {\n await onReply(markdown);\n } catch {\n setStatus('reply-error');\n } finally {\n sending.current = false;\n }\n },\n });\n }\n ApiaUtil.instance.menu.open({ menuProps: { anchorRef: trigger }, items });\n }}\n />\n <Box as=\"span\" role=\"status\" sx={{ fontSize: 1 }}>\n {status === 'copied' && 'Copiado'}\n {status === 'copy-error' && 'No se pudo copiar la respuesta'}\n {status === 'reply-error' && 'No se pudo enviar la respuesta'}\n </Box>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;AAMO,MAAM,qBAAA,GAAwB,cAAqD,MAAS;AAEnG,eAAe,aAAa,QAAA,EAAkB;AAC5C,EAAA,IAAI,SAAA,CAAU,WAAW,SAAA,EAAW;AAClC,IAAA,IAAI;AACF,MAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,QAAQ,CAAA;AAC5C,MAAA;AAAA,KACF,CAAA,MAAQ;AAAA;AAER;AAGF,EAAA,MAAM,UAAU,QAAA,CAAS,aAAA;AACzB,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,aAAA,CAAc,UAAU,CAAA;AAC/C,EAAA,KAAA,CAAM,KAAA,GAAQ,QAAA;AACd,EAAA,KAAA,CAAM,QAAA,GAAW,IAAA;AACjB,EAAA,KAAA,CAAM,MAAM,OAAA,GAAU,2DAAA;AACtB,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,KAAK,CAAA;AAC/B,EAAA,IAAI;AACF,IAAA,KAAA,CAAM,KAAA,CAAM,EAAE,aAAA,EAAe,IAAA,EAAM,CAAA;AACnC,IAAA,KAAA,CAAM,MAAA,EAAO;AACb,IAAA,IAAI,CAAC,QAAA,CAAS,WAAA,CAAY,MAAM,CAAA;AAAG,MAAA,MAAM,IAAI,MAAM,uBAAuB,CAA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,gCAAA;AAAA,MAC3B,WAAW,aAAA,IAAiB;AAAA,KAAA,EAC/B;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { TChatAssistantPanelConfig, TChatAssistantTurnSnapshot, TChatAssistantTurnStatus } from '../types.js';
2
+ import { TChatAssistantPanelConfig, TChatAssistantTurnSnapshot, TChatPublicSource, TChatAssistantBlockSegment, TChatAssistantTurnStatus } from '../types.js';
3
3
  import { ChatMessage } from './ChatMessage.js';
4
4
  import { TChatFeedbackForm } from '../TChatFeedbackForm.js';
5
5
 
@@ -8,6 +8,8 @@ type TAppendAssistantBlockProps = {
8
8
  content: string;
9
9
  id?: string;
10
10
  type: string;
11
+ publicSource?: TChatPublicSource;
12
+ plan?: TChatAssistantBlockSegment['plan'];
11
13
  };
12
14
  type TAppendAssistantBlockResponseProps = {
13
15
  id: string;
@@ -15,6 +17,7 @@ type TAppendAssistantBlockResponseProps = {
15
17
  };
16
18
  type TFinishAssistantTurnOptions = {
17
19
  includeFinalMessage?: boolean;
20
+ completedAt?: number;
18
21
  };
19
22
  type TAssistantTurnController = {
20
23
  addMessage(message: ChatMessage): void;
@@ -31,6 +34,7 @@ type TChatAssistantTurnProps = {
31
34
  snapshot?: TChatAssistantTurnSnapshot;
32
35
  };
33
36
  declare class ChatAssistantTurn {
37
+ private reasoningSummaries;
34
38
  private controller?;
35
39
  private finalMessage?;
36
40
  private nextSegment;
@@ -44,14 +48,33 @@ declare class ChatAssistantTurn {
44
48
  private transientMessagesBySegmentId;
45
49
  private feedbackForm;
46
50
  panels: TChatAssistantPanelConfig[];
51
+ activityPausedAt: number | undefined;
52
+ activityResumedAt: number | undefined;
47
53
  state: TChatAssistantTurnSnapshot;
48
54
  constructor({ controller, feedbackForm, finalMessage, panels, snapshot, }?: TChatAssistantTurnProps);
55
+ setActivityPaused(paused: boolean): void;
49
56
  appendText(content: string): void;
50
57
  beginIntermediateText(id?: string): void;
51
58
  appendIntermediateText(content: string, id?: string): void;
52
59
  appendBlock(block: TAppendAssistantBlockProps): void;
60
+ /** Updates one owned segment without appending a second plan or final on replay. */
61
+ upsertBlock(block: TAppendAssistantBlockProps): void;
62
+ setSegmentPublicSource(id: string, source: TChatPublicSource): void;
53
63
  appendBlockResponse(response: TAppendAssistantBlockResponseProps): void;
64
+ appendReasoningSummary(summary: {
65
+ id: string;
66
+ text: string;
67
+ done: boolean;
68
+ }): void;
69
+ appendReasoningSummaryEvent(event: {
70
+ id: string;
71
+ kind: string;
72
+ seq: number;
73
+ text?: string;
74
+ }): void;
54
75
  appendFinalText(content: string): void;
76
+ clearFinalText(): void;
77
+ setPublicSource(source: TChatPublicSource): void;
55
78
  createPanelMessage(): ChatMessage;
56
79
  finish(status?: TChatAssistantTurnStatus, finalText?: string, options?: TFinishAssistantTurnOptions): void;
57
80
  getFinalText(): string;