@vertesia/ui 0.64.0 → 0.66.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 (241) hide show
  1. package/lib/esm/core/components/EmptyCollection.js +2 -2
  2. package/lib/esm/core/components/EmptyCollection.js.map +1 -1
  3. package/lib/esm/core/components/InputList.js +2 -2
  4. package/lib/esm/core/components/InputList.js.map +1 -1
  5. package/lib/esm/core/components/SidePanel.js +1 -1
  6. package/lib/esm/core/components/SidePanel.js.map +1 -1
  7. package/lib/esm/core/components/Switch.js +2 -2
  8. package/lib/esm/core/components/Switch.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/calendar.js +0 -1
  10. package/lib/esm/core/components/shadcn/calendar.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/checkbox.js +0 -1
  12. package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
  13. package/lib/esm/core/components/shadcn/command.js +0 -1
  14. package/lib/esm/core/components/shadcn/command.js.map +1 -1
  15. package/lib/esm/core/components/shadcn/dialog.js +0 -1
  16. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  17. package/lib/esm/core/components/shadcn/filters/comboBox.js +18 -0
  18. package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
  19. package/lib/esm/core/components/shadcn/filters/filterBar.js +38 -17
  20. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  21. package/lib/esm/core/components/shadcn/filters/filters.js +11 -5
  22. package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
  23. package/lib/esm/core/components/shadcn/filters/selectFilter.js +1 -1
  24. package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
  25. package/lib/esm/core/components/shadcn/filters/stringListFilter.js +24 -0
  26. package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +1 -0
  27. package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -1
  28. package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
  29. package/lib/esm/core/components/shadcn/label.js +0 -1
  30. package/lib/esm/core/components/shadcn/label.js.map +1 -1
  31. package/lib/esm/core/components/shadcn/selectBox.js +1 -1
  32. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  33. package/lib/esm/env/index.js +4 -1
  34. package/lib/esm/env/index.js.map +1 -1
  35. package/lib/esm/features/agent/PayloadBuilder.js +56 -16
  36. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  37. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -6
  38. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  39. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -2
  40. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  41. package/lib/esm/features/facets/VEnvironmentFacet.js +24 -0
  42. package/lib/esm/features/facets/VEnvironmentFacet.js.map +1 -0
  43. package/lib/esm/features/facets/VFacetsNav.js +69 -26
  44. package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
  45. package/lib/esm/features/facets/VInteractionFacet.js +45 -0
  46. package/lib/esm/features/facets/VInteractionFacet.js.map +1 -0
  47. package/lib/esm/features/facets/VStringFacet.js +6 -5
  48. package/lib/esm/features/facets/VStringFacet.js.map +1 -1
  49. package/lib/esm/features/facets/VUserFacet.js +6 -6
  50. package/lib/esm/features/facets/VUserFacet.js.map +1 -1
  51. package/lib/esm/features/layout/GenericPageNavHeader.js +1 -1
  52. package/lib/esm/features/magic-pdf/PdfPageProvider.js +3 -3
  53. package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -1
  54. package/lib/esm/features/magic-pdf/TextPageView.js +1 -2
  55. package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -1
  56. package/lib/esm/features/store/collections/CollectionsTable.js +9 -5
  57. package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
  58. package/lib/esm/features/store/collections/{CollectionsView.js → CreateCollection.js} +6 -14
  59. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -0
  60. package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
  61. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  62. package/lib/esm/features/store/collections/SelectCollection.js +24 -0
  63. package/lib/esm/features/store/collections/SelectCollection.js.map +1 -0
  64. package/lib/esm/features/store/collections/index.js +2 -2
  65. package/lib/esm/features/store/collections/index.js.map +1 -1
  66. package/lib/esm/features/store/objects/DocumentSearchResults.js +6 -3
  67. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  68. package/lib/esm/features/store/objects/components/ContentOverview.js +14 -14
  69. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  70. package/lib/esm/features/store/objects/components/DocumentIcon.js +7 -10
  71. package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
  72. package/lib/esm/features/store/objects/components/DocumentInput.js +1 -2
  73. package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -1
  74. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +4 -2
  75. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  76. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +1 -2
  77. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
  78. package/lib/esm/features/store/objects/components/SelectDocument.js +9 -3
  79. package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
  80. package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
  81. package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
  82. package/lib/esm/features/store/objects/layout/documentLayout.js +2 -2
  83. package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
  84. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +4 -2
  85. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  86. package/lib/esm/features/store/objects/selection/SelectionActions.js +1 -1
  87. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
  88. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +7 -10
  89. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  90. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +1 -1
  91. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
  92. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +2 -2
  93. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  94. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
  95. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
  96. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +1 -1
  97. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -1
  98. package/lib/esm/features/store/types/ContentObjectTypesSearch.js +2 -3
  99. package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -1
  100. package/lib/esm/features/store/types/ContentObjectTypesTable.js +1 -1
  101. package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -1
  102. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +2 -2
  103. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
  104. package/lib/esm/features/store/types/ObjectSchemaEditor.js +2 -3
  105. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  106. package/lib/esm/features/store/types/TableLayoutEditor.js +1 -1
  107. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
  108. package/lib/esm/features/store/types/index.js +0 -2
  109. package/lib/esm/features/store/types/index.js.map +1 -1
  110. package/lib/esm/features/user/UserInfo.js +1 -2
  111. package/lib/esm/features/user/UserInfo.js.map +1 -1
  112. package/lib/esm/features/utils/rendition.js +22 -2
  113. package/lib/esm/features/utils/rendition.js.map +1 -1
  114. package/lib/esm/session/UserSession.js +2 -2
  115. package/lib/esm/session/UserSession.js.map +1 -1
  116. package/lib/esm/session/auth/composable.js +1 -1
  117. package/lib/esm/session/auth/composable.js.map +1 -1
  118. package/lib/esm/session/constants.js +3 -0
  119. package/lib/esm/session/constants.js.map +1 -0
  120. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +2 -2
  121. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
  122. package/lib/esm/widgets/properties/PropertiesView.js +4 -2
  123. package/lib/esm/widgets/properties/PropertiesView.js.map +1 -1
  124. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +1 -1
  125. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  126. package/lib/tsconfig.tsbuildinfo +1 -1
  127. package/lib/types/core/components/InputList.d.ts +2 -1
  128. package/lib/types/core/components/Switch.d.ts +2 -1
  129. package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -0
  130. package/lib/types/core/components/shadcn/filters/stringListFilter.d.ts +10 -0
  131. package/lib/types/core/components/shadcn/filters/types.d.ts +3 -3
  132. package/lib/types/env/index.d.ts +1 -0
  133. package/lib/types/features/agent/PayloadBuilder.d.ts +12 -2
  134. package/lib/types/features/facets/VEnvironmentFacet.d.ts +11 -0
  135. package/lib/types/features/facets/VFacetsNav.d.ts +9 -1
  136. package/lib/types/features/facets/VInteractionFacet.d.ts +14 -0
  137. package/lib/types/features/facets/VStringFacet.d.ts +3 -2
  138. package/lib/types/features/facets/VUserFacet.d.ts +3 -2
  139. package/lib/types/features/store/collections/{CollectionsView.d.ts → CreateCollection.d.ts} +5 -3
  140. package/lib/types/features/store/collections/SelectCollection.d.ts +14 -0
  141. package/lib/types/features/store/collections/index.d.ts +2 -2
  142. package/lib/types/features/store/objects/components/ContentOverview.d.ts +2 -1
  143. package/lib/types/features/store/objects/components/DocumentIcon.d.ts +2 -1
  144. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +2 -1
  145. package/lib/types/features/store/objects/layout/documentLayout.d.ts +1 -1
  146. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +3 -2
  147. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -1
  148. package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -1
  149. package/lib/types/features/store/types/index.d.ts +0 -2
  150. package/lib/types/features/utils/rendition.d.ts +1 -1
  151. package/lib/types/session/UserSession.d.ts +2 -2
  152. package/lib/types/session/constants.d.ts +2 -0
  153. package/lib/vertesia-ui-core.js +1 -1
  154. package/lib/vertesia-ui-core.js.map +1 -1
  155. package/lib/vertesia-ui-env.js +1 -1
  156. package/lib/vertesia-ui-env.js.map +1 -1
  157. package/lib/vertesia-ui-features.js +1 -1
  158. package/lib/vertesia-ui-features.js.map +1 -1
  159. package/lib/vertesia-ui-session.js +1 -1
  160. package/lib/vertesia-ui-session.js.map +1 -1
  161. package/lib/vertesia-ui-widgets.js +1 -1
  162. package/lib/vertesia-ui-widgets.js.map +1 -1
  163. package/package.json +6 -4
  164. package/src/core/components/EmptyCollection.tsx +26 -24
  165. package/src/core/components/InputList.tsx +3 -1
  166. package/src/core/components/SidePanel.tsx +2 -2
  167. package/src/core/components/Switch.tsx +4 -3
  168. package/src/core/components/shadcn/calendar.tsx +0 -2
  169. package/src/core/components/shadcn/checkbox.tsx +0 -2
  170. package/src/core/components/shadcn/command.tsx +0 -2
  171. package/src/core/components/shadcn/dialog.tsx +0 -2
  172. package/src/core/components/shadcn/filters/comboBox.tsx +73 -0
  173. package/src/core/components/shadcn/filters/filterBar.tsx +41 -17
  174. package/src/core/components/shadcn/filters/filters.tsx +30 -14
  175. package/src/core/components/shadcn/filters/selectFilter.tsx +3 -3
  176. package/src/core/components/shadcn/filters/stringListFilter.tsx +58 -0
  177. package/src/core/components/shadcn/filters/textFilter.tsx +2 -1
  178. package/src/core/components/shadcn/filters/types.ts +3 -3
  179. package/src/core/components/shadcn/label.tsx +0 -2
  180. package/src/core/components/shadcn/selectBox.tsx +1 -1
  181. package/src/env/index.ts +5 -1
  182. package/src/features/agent/PayloadBuilder.tsx +66 -16
  183. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +0 -11
  184. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +11 -12
  185. package/src/features/facets/VEnvironmentFacet.tsx +42 -0
  186. package/src/features/facets/VFacetsNav.tsx +87 -29
  187. package/src/features/facets/VInteractionFacet.tsx +73 -0
  188. package/src/features/facets/VStringFacet.tsx +7 -6
  189. package/src/features/facets/VUserFacet.tsx +7 -6
  190. package/src/features/layout/GenericPageNavHeader.tsx +1 -1
  191. package/src/features/magic-pdf/PdfPageProvider.tsx +3 -3
  192. package/src/features/magic-pdf/TextPageView.tsx +1 -2
  193. package/src/features/store/collections/CollectionsTable.tsx +49 -40
  194. package/src/features/store/collections/{CollectionsView.tsx → CreateCollection.tsx} +15 -42
  195. package/src/features/store/collections/EditCollectionView.tsx +1 -1
  196. package/src/features/store/collections/SelectCollection.tsx +46 -0
  197. package/src/features/store/collections/index.ts +2 -2
  198. package/src/features/store/objects/DocumentSearchResults.tsx +6 -3
  199. package/src/features/store/objects/components/ContentOverview.tsx +33 -95
  200. package/src/features/store/objects/components/DocumentIcon.tsx +27 -14
  201. package/src/features/store/objects/components/DocumentInput.tsx +1 -2
  202. package/src/features/store/objects/components/PropertiesEditorModal.tsx +7 -3
  203. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +2 -2
  204. package/src/features/store/objects/components/SelectDocument.tsx +18 -3
  205. package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
  206. package/src/features/store/objects/layout/documentLayout.tsx +2 -2
  207. package/src/features/store/objects/search/DocumentSearchContext.ts +6 -3
  208. package/src/features/store/objects/selection/ObjectsActionContext.tsx +1 -1
  209. package/src/features/store/objects/selection/SelectionActions.tsx +0 -1
  210. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +10 -21
  211. package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +1 -1
  212. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +2 -2
  213. package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -1
  214. package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +1 -1
  215. package/src/features/store/types/ContentObjectTypesSearch.tsx +3 -4
  216. package/src/features/store/types/ContentObjectTypesTable.tsx +3 -1
  217. package/src/features/store/types/CreateOrUpdateTypeModal.tsx +2 -9
  218. package/src/features/store/types/ObjectSchemaEditor.tsx +4 -5
  219. package/src/features/store/types/TableLayoutEditor.tsx +4 -4
  220. package/src/features/store/types/index.ts +0 -2
  221. package/src/features/user/UserInfo.tsx +1 -2
  222. package/src/features/utils/rendition.ts +23 -1
  223. package/src/session/UserSession.ts +2 -2
  224. package/src/session/auth/composable.ts +1 -1
  225. package/src/session/constants.ts +2 -0
  226. package/src/widgets/codemirror/CodeMirrorEditor.tsx +2 -2
  227. package/src/widgets/properties/PropertiesView.tsx +10 -2
  228. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +1 -1
  229. package/lib/esm/features/store/collections/CollectionView.js +0 -53
  230. package/lib/esm/features/store/collections/CollectionView.js.map +0 -1
  231. package/lib/esm/features/store/collections/CollectionsView.js.map +0 -1
  232. package/lib/esm/features/store/types/ContentObjectTypeView.js +0 -158
  233. package/lib/esm/features/store/types/ContentObjectTypeView.js.map +0 -1
  234. package/lib/esm/features/store/types/ContentObjectTypesView.js +0 -55
  235. package/lib/esm/features/store/types/ContentObjectTypesView.js.map +0 -1
  236. package/lib/types/features/store/collections/CollectionView.d.ts +0 -5
  237. package/lib/types/features/store/types/ContentObjectTypeView.d.ts +0 -5
  238. package/lib/types/features/store/types/ContentObjectTypesView.d.ts +0 -8
  239. package/src/features/store/collections/CollectionView.tsx +0 -94
  240. package/src/features/store/types/ContentObjectTypeView.tsx +0 -244
  241. package/src/features/store/types/ContentObjectTypesView.tsx +0 -71
@@ -1,8 +1,9 @@
1
1
  import { AsyncExecutionResult, VertesiaClient } from "@vertesia/client";
2
- import { ExecutionEnvironmentRef, Interaction, JSONSchema, mergePromptsSchema, PopulatedInteraction } from "@vertesia/common";
2
+ import { ExecutionEnvironmentRef, Interaction, mergePromptsSchema, PopulatedInteraction, supportsToolUse } from "@vertesia/common";
3
3
  import { JSONObject } from "@vertesia/json";
4
4
  import { useUserSession } from "@vertesia/ui/session";
5
5
  import Ajv, { ValidateFunction } from "ajv";
6
+ import type { JSONSchema4 } from "json-schema";
6
7
  import React, { createContext, useContext, useEffect, useState } from "react";
7
8
 
8
9
  export interface ConversationWorkflowPayload {
@@ -15,13 +16,15 @@ export interface ConversationWorkflowPayload {
15
16
 
16
17
  export class PayloadBuilder implements ConversationWorkflowPayload {
17
18
  _interactive: boolean = true;
19
+ _debug_mode: boolean = false;
20
+ _collection: string | undefined;
18
21
  _start: boolean = false;
19
22
 
20
23
  payload: ConversationWorkflowPayload;
21
- interactionParamsSchema?: JSONSchema | null;
24
+ private _interactionParamsSchema?: JSONSchema4 | null;
22
25
  private _inputValidator?: {
23
26
  validate: ValidateFunction;
24
- schema: JSONSchema;
27
+ schema: JSONSchema4;
25
28
  };
26
29
 
27
30
  constructor(public vertesia: VertesiaClient, public updateState: (data: PayloadBuilder) => void) {
@@ -32,22 +35,26 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
32
35
  }
33
36
 
34
37
  onStateChanged() {
35
- this.updateState(this.clone());
38
+ const newInstance = this.clone();
39
+ this.updateState(newInstance);
36
40
  }
37
41
 
38
42
  clone() {
39
43
  const builder = new PayloadBuilder(this.vertesia, this.updateState);
40
- builder.interactionParamsSchema = this.interactionParamsSchema;
44
+ builder._interactionParamsSchema = this._interactionParamsSchema;
41
45
  builder.payload = this.payload;
42
46
  builder._interactive = this._interactive;
47
+ builder._debug_mode = this._debug_mode;
43
48
  builder._inputValidator = this._inputValidator;
44
49
  builder._start = this._start;
50
+ builder._collection = this._collection;
45
51
  return builder;
46
52
  }
47
53
 
48
54
  get interactive() {
49
55
  return this._interactive;
50
56
  }
57
+
51
58
  set interactive(interactive: boolean) {
52
59
  if (interactive !== this._interactive) {
53
60
  this._interactive = interactive;
@@ -55,21 +62,42 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
55
62
  }
56
63
  }
57
64
 
65
+ get debug_mode() {
66
+ return this._debug_mode;
67
+ }
68
+
69
+ set debug_mode(debug_mode: boolean) {
70
+ if (debug_mode !== this._debug_mode) {
71
+ this._debug_mode = debug_mode;
72
+ this.onStateChanged();
73
+ }
74
+ }
75
+
76
+ get collection() {
77
+ return this._collection;
78
+ }
79
+
80
+ set collection(collection: string | undefined) {
81
+ if (collection !== this._collection) {
82
+ this._collection = collection;
83
+ this.onStateChanged();
84
+ }
85
+ }
86
+
87
+ get search_scope() {
88
+ return this._collection ? "collection" : undefined;
89
+ }
90
+
58
91
  get interaction() {
59
92
  return this.payload.interaction;
60
93
  }
61
94
  set interaction(interaction: Interaction | undefined) {
62
95
  if (interaction?.id !== this.payload.interaction?.id) {
63
96
  this.payload.interaction = interaction;
64
- this.interactionParamsSchema = mergePromptsSchema(this.interaction as PopulatedInteraction) as JSONSchema;
97
+ this._interactionParamsSchema = mergePromptsSchema(this.interaction as PopulatedInteraction) as JSONSchema4;
65
98
  // Reset the validator when schema changes
66
99
  this._inputValidator = undefined;
67
100
  if (interaction) {
68
- if (interaction.model) {
69
- this.payload.model = interaction.model;
70
- } else {
71
- this.payload.model = undefined;
72
- }
73
101
  if (interaction.environment) {
74
102
  if (typeof interaction.environment === 'string') {
75
103
  this.vertesia.environments.retrieve(interaction.environment).then((environment) => this.environment = environment);
@@ -77,6 +105,12 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
77
105
  this.payload.environment = interaction.environment;
78
106
  }
79
107
  }
108
+ if (interaction.model) {
109
+ this.payload.model = interaction.model;
110
+ } else {
111
+ this.payload.model = this.environment?.default_model && supportsToolUse(this.environment.default_model, this.environment.provider)
112
+ ? this.environment.default_model : undefined;
113
+ }
80
114
  }
81
115
  this.onStateChanged();
82
116
  }
@@ -88,6 +122,9 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
88
122
  set environment(environment: ExecutionEnvironmentRef | undefined) {
89
123
  if (environment?.id !== this.payload.environment?.id) {
90
124
  this.payload.environment = environment;
125
+ this.payload.model = environment?.default_model && supportsToolUse(environment.default_model, environment.provider)
126
+ ? environment.default_model : undefined;
127
+
91
128
  this.onStateChanged();
92
129
  }
93
130
  }
@@ -134,9 +171,22 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
134
171
  return this._start;
135
172
  }
136
173
 
174
+ get interactionParamsSchema(): JSONSchema4 | null | undefined {
175
+ return this._interactionParamsSchema;
176
+ }
177
+
178
+ set interactionParamsSchema(schema: JSONSchema4 | null | undefined) {
179
+ if (this._interactionParamsSchema !== schema) {
180
+ this._interactionParamsSchema = schema;
181
+ this.onStateChanged();
182
+ }
183
+ }
184
+
137
185
  reset() {
138
186
  this._start = false;
139
187
  this._interactive = true;
188
+ this._debug_mode = false;
189
+ this._collection = undefined;
140
190
  this.payload = {
141
191
  model: '',
142
192
  tools: [],
@@ -144,7 +194,7 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
144
194
  environment: undefined,
145
195
  prompt_data: undefined
146
196
  };
147
- this.interactionParamsSchema = null;
197
+ this._interactionParamsSchema = null;
148
198
  this._inputValidator = undefined;
149
199
 
150
200
  this.onStateChanged();
@@ -156,16 +206,16 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
156
206
  }
157
207
 
158
208
  validateInput(): { isValid: boolean; errorMessage?: string } {
159
- if (!this.interactionParamsSchema) {
209
+ if (!this._interactionParamsSchema) {
160
210
  return { isValid: true };
161
211
  }
162
212
 
163
213
  // If schema has changed or validator not initialized, recompile
164
- if (!this._inputValidator || this._inputValidator.schema !== this.interactionParamsSchema) {
214
+ if (!this._inputValidator || this._inputValidator.schema !== this._interactionParamsSchema) {
165
215
  const ajv = new Ajv({ strict: false });
166
216
  this._inputValidator = {
167
- validate: ajv.compile(this.interactionParamsSchema),
168
- schema: this.interactionParamsSchema
217
+ validate: ajv.compile(this._interactionParamsSchema),
218
+ schema: this._interactionParamsSchema
169
219
  };
170
220
  }
171
221
 
@@ -8,7 +8,6 @@ import {
8
8
  DownloadCloudIcon,
9
9
  ExternalLink,
10
10
  MoreVertical,
11
- Plus,
12
11
  XIcon,
13
12
  } from "lucide-react";
14
13
  import { PayloadBuilderProvider, usePayloadBuilder } from "../../PayloadBuilder";
@@ -148,11 +147,6 @@ function MoreDropdown({
148
147
  }
149
148
  };
150
149
 
151
- const startNewAgent = () => {
152
- builder.reset();
153
- resetWorkflow?.();
154
- }
155
-
156
150
  const openUrl = (url: string) => {
157
151
  window.open(url, "_blank");
158
152
  return url;
@@ -215,11 +209,6 @@ function MoreDropdown({
215
209
  }}>
216
210
  <XIcon className="size-3.5 mr-2 text-destructive" /> Cancel Workflow
217
211
  </CommandItem>
218
- {!isModal && (
219
- <CommandItem className="text-xs" onSelect={startNewAgent}>
220
- <Plus className="size-3.5 mr-2 text-muted" /> Start a new Agent
221
- </CommandItem>
222
- )}
223
212
  </CommandGroup>
224
213
  </CommandList>
225
214
  </Command>
@@ -1,5 +1,5 @@
1
1
  import { AgentMessage, AgentMessageType } from "@vertesia/common";
2
- import { Button, useToast } from "@vertesia/ui/core";
2
+ import { Badge, Button, useToast } from "@vertesia/ui/core";
3
3
  import { NavLink } from "@vertesia/ui/router";
4
4
  import { useUserSession } from "@vertesia/ui/session";
5
5
  import dayjs from "dayjs";
@@ -483,28 +483,27 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
483
483
  <div className={showPulsatingCircle ? "animate-fadeIn" : ""}>
484
484
  {getMessageIcon()}
485
485
  </div>
486
- <span className="text-xs font-medium text-gray-700 ">{messageStyles.sender}</span>
486
+ <span className="text-xs font-medium text-muted ">{messageStyles.sender}</span>
487
487
 
488
488
  {/* Show workstream badge next to sender for better organization */}
489
489
  {workstreamId !== "main" && workstreamId !== "all" && (
490
- <span className="bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded-full text-[10px] font-mono text-muted dark:text-gray-400 border border-gray-200 dark:border-gray-700">
490
+ <Badge variant="default" className="text-xs text-muted">
491
491
  {workstreamId}
492
- </span>
492
+ </Badge>
493
493
  )}
494
494
  </div>
495
495
 
496
496
  <div className="flex items-center gap-2">
497
- <span className="text-xs text-gray-400 dark:text-muted">
497
+ <span className="text-xs text-muted">
498
498
  {dayjs(message.timestamp).format("HH:mm:ss")}
499
499
  </span>
500
500
  <Button
501
- variant="ghost"
502
- size="xs"
501
+ variant="ghost" size="xs"
503
502
  onClick={copyToClipboard}
504
- className="text-gray-400 hover:text-muted dark:text-muted dark:hover:text-muted/30"
503
+ className="text-muted"
505
504
  title="Copy message"
506
505
  >
507
- <CopyIcon className="h-3 w-3" />
506
+ <CopyIcon className="size-3" />
508
507
  </Button>
509
508
  </div>
510
509
  </div>
@@ -529,7 +528,7 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
529
528
  <div className="mt-2">
530
529
  <button
531
530
  onClick={() => setShowDetails(!showDetails)}
532
- className="text-xs text-muted hover:text-gray-700 dark:text-gray-400 dark:hover:text-muted/30 flex items-center"
531
+ className="text-xs text-muted flex items-center"
533
532
  >
534
533
  {showDetails ? "Hide" : "Show"} details
535
534
  <svg
@@ -544,11 +543,11 @@ export default function MessageItem({ message, showPulsatingCircle = false }: Me
544
543
  </button>
545
544
 
546
545
  {showDetails && (
547
- <div className="mt-2 p-2 bg-gray-50 dark:bg-gray-800 border border-gray-100 dark:border-gray-700 rounded text-sm">
546
+ <div className="mt-2 p-2 bg-muted border border-mixer-muted/40 rounded text-sm">
548
547
  {typeof message.details === "string" ? (
549
548
  renderContent(message.details)
550
549
  ) : (
551
- <pre className="text-xs font-mono whitespace-pre-wrap overflow-x-auto bg-gray-100 dark:bg-gray-800 p-2 rounded text-gray-700 ">
550
+ <pre className="text-xs font-mono whitespace-pre-wrap overflow-x-auto bg-muted p-2 rounded text-muted ">
552
551
  {JSON.stringify(message.details, null, 2)}
553
552
  </pre>
554
553
  )}
@@ -0,0 +1,42 @@
1
+ import { FacetBucket } from '@vertesia/common';
2
+ import { FilterGroup } from '@vertesia/ui/core';
3
+
4
+ interface EnrichedFacetBucket extends FacetBucket {
5
+ name?: string;
6
+ }
7
+
8
+ interface EnvironmentFacetProps {
9
+ buckets: EnrichedFacetBucket[];
10
+ name: string;
11
+ }
12
+
13
+ export function VEnvironmentFacet({ buckets, name }: EnvironmentFacetProps): FilterGroup {
14
+ const options = buckets.map((bucket) => ({
15
+ label: `(${bucket.count})`,
16
+ value: bucket._id
17
+ }));
18
+
19
+ const filterGroup: FilterGroup = {
20
+ name: name.charAt(0).toUpperCase() + name.slice(1),
21
+ options: options,
22
+ type: "select",
23
+ labelRenderer: (environmentId: string) => {
24
+ const bucket = buckets.find(b => b._id === environmentId);
25
+ const displayName = bucket?.name || environmentId;
26
+
27
+ return (
28
+ <div className="w-full flex items-center">
29
+ <span className="text-sm truncate">{displayName}</span>
30
+ <span className="ml-2 text-xs">({bucket?.count || 0})</span>
31
+ </div>
32
+ );
33
+ },
34
+ filterBy: (optionValue: string, searchText: string) => {
35
+ const bucket = buckets.find(b => b._id === optionValue);
36
+ const searchName = bucket?.name || optionValue;
37
+ return searchName.toLowerCase().includes(searchText.toLowerCase());
38
+ }
39
+ };
40
+
41
+ return filterGroup;
42
+ }
@@ -1,13 +1,24 @@
1
1
  import { Filter as BaseFilter, FilterBar, FilterGroup } from '@vertesia/ui/core';
2
2
  import { useUserSession } from '@vertesia/ui/session';
3
3
  import { useState } from 'react';
4
+ import { VEnvironmentFacet } from './VEnvironmentFacet';
5
+ import { VInteractionFacet } from './VInteractionFacet';
4
6
  import { VStringFacet } from './VStringFacet';
5
7
  import { VTypeFacet } from './VTypeFacet';
6
8
  import { VUserFacet } from './VUserFacet';
7
9
 
10
+ export interface SearchInterface {
11
+ getFilterValue(name: string): any;
12
+ setFilterValue(name: string, value: any): void;
13
+ clearFilters(autoSearch?: boolean): void;
14
+ search(): Promise<boolean | undefined>;
15
+ readonly isRunning: boolean;
16
+ query: Record<string, any>;
17
+ }
18
+
8
19
  interface FacetsNavProps {
9
20
  facets: any;
10
- search: any;
21
+ search: SearchInterface;
11
22
  textSearch?: string;
12
23
  }
13
24
  export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps) {
@@ -67,34 +78,77 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
67
78
  customFilterGroups.push(initiatedByFilterGroup);
68
79
  }
69
80
 
70
- if (facets.start) {
71
- customFilterGroups.push({
72
- name: 'start',
73
- placeholder: 'Date after',
74
- type: 'date' as const,
75
- options: []
81
+ /** Run table */
82
+ if (facets.interactions) {
83
+ const interactionFilterGroup = VInteractionFacet({
84
+ buckets: facets.interactions || [],
85
+ name: 'interaction',
86
+ placeholder: 'Interactions',
76
87
  });
88
+ customFilterGroups.push(interactionFilterGroup);
77
89
  }
78
90
 
79
- if (facets.end) {
80
- customFilterGroups.push({
81
- name: 'end',
82
- placeholder: 'Date before',
83
- type: 'date' as const,
84
- options: []
91
+ if (facets.environments) {
92
+ const environmentFilterGroup = VEnvironmentFacet({
93
+ buckets: facets.environments || [],
94
+ name: 'Environments'
95
+ });
96
+ customFilterGroups.push(environmentFilterGroup);
97
+ }
98
+
99
+ if (facets.models) {
100
+ const modelFilterGroup = VStringFacet({
101
+ search,
102
+ buckets: facets.models || [],
103
+ name: 'Model'
85
104
  });
105
+ customFilterGroups.push(modelFilterGroup);
86
106
  }
87
107
 
88
- // if (facets.tags) {
89
- // customFilterGroups.push({
90
- // name: 'Tags',
91
- // type: 'text',
92
- // options: facets.tags.map((tag: string) => ({
93
- // label: tag,
94
- // value: tag
95
- // }))
96
- // });
97
- // }
108
+ if (facets.statuses) {
109
+ const statusFilterGroup = VStringFacet({
110
+ search,
111
+ buckets: facets.statuses || [],
112
+ name: 'Status'
113
+ });
114
+ customFilterGroups.push(statusFilterGroup);
115
+ }
116
+
117
+ if (facets.finish_reason) {
118
+ const processedFinishReason = facets.finish_reason.map((bucket: any) => ({
119
+ ...bucket,
120
+ _id: bucket._id === null ? 'none' : bucket._id
121
+ }));
122
+
123
+ const finishReasonFilterGroup = VStringFacet({
124
+ search,
125
+ buckets: processedFinishReason,
126
+ name: 'finish_reason',
127
+ placeholder: 'Finish Reason'
128
+ });
129
+ customFilterGroups.push(finishReasonFilterGroup);
130
+ }
131
+
132
+ if (facets.created_by) {
133
+ const createdByFilterGroup = VUserFacet({
134
+ buckets: facets.created_by || [],
135
+ name: 'created_by',
136
+ placeholder: 'Created By'
137
+ });
138
+ customFilterGroups.push(createdByFilterGroup);
139
+ }
140
+
141
+ if (facets.tags) {
142
+ customFilterGroups.push({
143
+ name: 'Tags',
144
+ type: 'stringList',
145
+ options: facets.tags.map((tag: string) => ({
146
+ label: tag,
147
+ value: tag
148
+ }))
149
+ });
150
+ }
151
+ /** Run table */
98
152
 
99
153
  const handleFilterChange: React.Dispatch<React.SetStateAction<BaseFilter[]>> = (value) => {
100
154
 
@@ -106,21 +160,25 @@ export function VFacetsNav({ facets, search, textSearch = '' }: FacetsNavProps)
106
160
  }
107
161
  setFilters(newFilters);
108
162
 
163
+ // Reset the actual query before reapplying filters. Otherwise the removed filters remain.
164
+ search.clearFilters(false);
165
+
109
166
  newFilters.forEach(filter => {
110
167
  if (filter.value && filter.value.length > 0) {
111
168
  const filterName = filter.name.toLowerCase();
112
- const filterValue = filter.value[0].value;
169
+ const filterValue = filter.type === 'stringList'
170
+ ? filter.value.map(v => typeof v === 'string' ? v : v.value)
171
+ : Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object'
172
+ ? filter.value[0].value
173
+ : filter.value;
113
174
 
114
- // Map filter names to the expected field names
115
175
  switch (filterName) {
116
176
  case 'name':
117
177
  search.query.search_term = filterValue;
118
- break;
119
- case 'user':
120
- search.query.initiated_by = filterValue === 'Unknown User' ? 'unknown' : filterValue;
178
+ search.query.name = filterValue;
121
179
  break;
122
180
  default:
123
- (search.query as any)[filterName] = filterValue;
181
+ search.query[filterName] = filterValue;
124
182
  break;
125
183
  }
126
184
  }
@@ -0,0 +1,73 @@
1
+ import { FacetBucket, InteractionStatus } from '@vertesia/common';
2
+ import { Badge, FilterGroup } from '@vertesia/ui/core';
3
+
4
+ interface EnrichedFacetBucket extends FacetBucket {
5
+ name?: string;
6
+ status?: string;
7
+ version?: number;
8
+ }
9
+
10
+ interface InteractionFacetProps {
11
+ buckets: EnrichedFacetBucket[];
12
+ name: string;
13
+ placeholder?: string;
14
+ }
15
+
16
+ export function VInteractionFacet({ buckets, name, placeholder }: InteractionFacetProps): FilterGroup {
17
+ const options = buckets.map((bucket) => ({
18
+ label: `(${bucket.count})`,
19
+ value: bucket._id
20
+ }));
21
+
22
+ const filterGroup: FilterGroup = {
23
+ name: name,
24
+ placeholder: placeholder || `${name.charAt(0).toUpperCase() + name.slice(1)}`,
25
+ options: options,
26
+ type: "select",
27
+ labelRenderer: (interactionId: string) => {
28
+ const bucket = buckets.find(b => b._id === interactionId);
29
+ const displayName = bucket?.name || interactionId;
30
+
31
+ // Determine badge variant based on status
32
+ let badgeVariant: "success" | "attention" | "destructive" = "success";
33
+ if (bucket?.status) {
34
+ switch (bucket.status) {
35
+ case InteractionStatus.published:
36
+ badgeVariant = "success";
37
+ break;
38
+ case InteractionStatus.archived:
39
+ badgeVariant = "destructive";
40
+ break;
41
+ default:
42
+ badgeVariant = "attention";
43
+ break;
44
+ }
45
+ }
46
+
47
+ const badgeText = bucket?.version && bucket?.status ?
48
+ `v${bucket.version} ${bucket.status}` :
49
+ bucket?.status || (bucket?.version ? `v${bucket.version}` : '');
50
+
51
+ return (
52
+ <div className="w-full flex items-center justify-between">
53
+ <div className="flex flex-row flex-wrap items-center gap-2 min-w-0 flex-1">
54
+ <span className="text-sm truncate">{displayName}</span>
55
+ {badgeText && (
56
+ <Badge variant={badgeVariant} className="text-xs w-fit">
57
+ {badgeText}
58
+ </Badge>
59
+ )}
60
+ </div>
61
+ <span className="ml-2 text-xs shrink-0">({bucket?.count || 0})</span>
62
+ </div>
63
+ );
64
+ },
65
+ filterBy: (optionValue: string, searchText: string) => {
66
+ const bucket = buckets.find(b => b._id === optionValue);
67
+ const searchName = bucket?.name || optionValue;
68
+ return searchName.toLowerCase().includes(searchText.toLowerCase());
69
+ }
70
+ };
71
+
72
+ return filterGroup;
73
+ }
@@ -5,30 +5,31 @@ import { FilterGroup } from '@vertesia/ui/core';
5
5
  interface StringFacetProps {
6
6
  buckets: FacetBucket[];
7
7
  name: string;
8
+ placeholder?: string;
8
9
  }
9
10
 
10
- export function createStringFilterGroup({ buckets, name }: StringFacetProps): FilterGroup {
11
+ export function createStringFilterGroup({ buckets, name, placeholder }: StringFacetProps): FilterGroup {
11
12
  const options = buckets.map((bucket) => ({
12
13
  label: facetOptionLabel(bucket),
13
14
  value: bucket._id
14
15
  }));
15
16
 
16
17
  const filterGroup: FilterGroup = {
17
- name: name.charAt(0).toUpperCase() + name.slice(1),
18
+ name: name,
18
19
  options: options,
19
- type: "select"
20
-
20
+ type: "select",
21
+ placeholder: `${placeholder ?? `${name.charAt(0).toUpperCase() + name.slice(1)}`}`,
21
22
  };
22
23
 
23
24
  return filterGroup;
24
25
  }
25
26
 
26
- export function VStringFacet({ buckets, name, }: {
27
+ export function VStringFacet({ buckets, name, placeholder}: {
27
28
  search: any;
28
29
  buckets: FacetBucket[];
29
30
  name: string;
30
31
  placeholder?: string;
31
32
  className?: string;
32
33
  }) {
33
- return createStringFilterGroup({ buckets, name });
34
+ return createStringFilterGroup({ buckets, name, placeholder });
34
35
  }
@@ -5,19 +5,20 @@ import { UserInfo } from '../user/UserInfo';
5
5
  interface UserFacetProps {
6
6
  buckets: FacetBucket[];
7
7
  name: string;
8
+ placeholder?: string;
8
9
  }
9
10
 
10
- export function createUserFilterGroup({ buckets, name }: UserFacetProps): FilterGroup {
11
+ export function createUserFilterGroup({ buckets, name, placeholder }: UserFacetProps): FilterGroup {
11
12
  const options = buckets.map((bucket) => {
12
13
  return {
13
14
  value: bucket._id,
14
- // Store the count for use in labelRenderer
15
15
  label: `(${bucket.count})`
16
16
  };
17
17
  });
18
18
 
19
19
  const filterGroup: FilterGroup = {
20
- name: name.charAt(0).toUpperCase() + name.slice(1), // Capitalize first letter
20
+ name: name,
21
+ placeholder: placeholder || `${name.charAt(0).toUpperCase() + name.slice(1)}`,
21
22
  options: options,
22
23
  labelRenderer: (userRef: string) => {
23
24
  const isUnknownUser = userRef === 'Unknown User' || !userRef;
@@ -36,12 +37,12 @@ export function createUserFilterGroup({ buckets, name }: UserFacetProps): Filter
36
37
  <span className="text-muted-foreground ml-2">({bucket?.count || 0})</span>
37
38
  </div>
38
39
  );
39
- }
40
+ },
40
41
  };
41
42
 
42
43
  return filterGroup;
43
44
  }
44
45
 
45
- export function VUserFacet({ buckets, name }: UserFacetProps) {
46
- return createUserFilterGroup({ buckets, name });
46
+ export function VUserFacet({ buckets, name, placeholder }: UserFacetProps) {
47
+ return createUserFilterGroup({ buckets, name, placeholder });
47
48
  }
@@ -40,7 +40,7 @@ export function GenericPageNavHeader({ className, children, title, description,
40
40
  }
41
41
  </div>
42
42
  </div>
43
- <div className="flex gap-x-4 shrink-0">{actions}</div>
43
+ <div className="flex gap-x-2 shrink-0">{actions}</div>
44
44
  </div>
45
45
  {children && <div className="w-full flex items-center">{children}</div>}
46
46
  </div>
@@ -83,14 +83,14 @@ function getBasePath(objectId: string) {
83
83
  return `${ADVANCED_PROCESSING_PREFIX}/${objectId}`;
84
84
  }
85
85
 
86
- function getPageImagePath(objectId: string, pageNumber: number, ext = ".jpeg") {
86
+ function getPageImagePath(objectId: string, pageNumber: number, ext = ".jpg") {
87
87
  return `${getBasePath(objectId)}/pages/page-${pageNumber}${ext}`;
88
88
  }
89
89
 
90
90
  function getPageAnnotatedImagePath(
91
91
  objectId: string,
92
92
  pageNumber: number,
93
- ext = ".jpeg",
93
+ ext = ".jpg",
94
94
  ) {
95
95
  return `${getBasePath(objectId)}/pages/page-${pageNumber}-annotated${ext}`;
96
96
  }
@@ -98,7 +98,7 @@ function getPageAnnotatedImagePath(
98
98
  function getPageInstrumentedImagePath(
99
99
  objectId: string,
100
100
  pageNumber: number,
101
- ext = ".jpeg",
101
+ ext = ".jpg",
102
102
  ) {
103
103
  return `${getBasePath(objectId)}/pages/page-${pageNumber}.instrumented${ext}`;
104
104
  }