@vertesia/common 0.54.0 → 0.56.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 (227) hide show
  1. package/lib/cjs/Progress.js +61 -0
  2. package/lib/cjs/Progress.js.map +1 -0
  3. package/lib/cjs/access-control.js +39 -0
  4. package/lib/cjs/access-control.js.map +1 -0
  5. package/lib/cjs/analytics.js +3 -0
  6. package/lib/cjs/analytics.js.map +1 -0
  7. package/lib/cjs/apikey.js +15 -0
  8. package/lib/cjs/apikey.js.map +1 -0
  9. package/lib/cjs/common.js +3 -0
  10. package/lib/cjs/common.js.map +1 -0
  11. package/lib/cjs/environment.js +116 -0
  12. package/lib/cjs/environment.js.map +1 -0
  13. package/lib/cjs/facets.js +3 -0
  14. package/lib/cjs/facets.js.map +1 -0
  15. package/lib/cjs/index.js +40 -0
  16. package/lib/cjs/index.js.map +1 -0
  17. package/lib/cjs/integrations.js +12 -0
  18. package/lib/cjs/integrations.js.map +1 -0
  19. package/lib/cjs/interaction.js +63 -0
  20. package/lib/cjs/interaction.js.map +1 -0
  21. package/lib/cjs/meters.js +13 -0
  22. package/lib/cjs/meters.js.map +1 -0
  23. package/lib/cjs/package.json +3 -0
  24. package/lib/cjs/payload.js +3 -0
  25. package/lib/cjs/payload.js.map +1 -0
  26. package/lib/cjs/plugin.js +3 -0
  27. package/lib/cjs/plugin.js.map +1 -0
  28. package/lib/cjs/project.js +50 -0
  29. package/lib/cjs/project.js.map +1 -0
  30. package/lib/cjs/prompt.js +21 -0
  31. package/lib/cjs/prompt.js.map +1 -0
  32. package/lib/cjs/query.js +3 -0
  33. package/lib/cjs/query.js.map +1 -0
  34. package/lib/cjs/refs.js +12 -0
  35. package/lib/cjs/refs.js.map +1 -0
  36. package/lib/cjs/runs.js +3 -0
  37. package/lib/cjs/runs.js.map +1 -0
  38. package/lib/cjs/store/activity-catalog.js +3 -0
  39. package/lib/cjs/store/activity-catalog.js.map +1 -0
  40. package/lib/cjs/store/agent.js +3 -0
  41. package/lib/cjs/store/agent.js.map +1 -0
  42. package/lib/cjs/store/collections.js +9 -0
  43. package/lib/cjs/store/collections.js.map +1 -0
  44. package/lib/cjs/store/common.js +3 -0
  45. package/lib/cjs/store/common.js.map +1 -0
  46. package/lib/cjs/store/doc-analyzer.js +3 -0
  47. package/lib/cjs/store/doc-analyzer.js.map +1 -0
  48. package/lib/cjs/store/dsl-workflow.js +5 -0
  49. package/lib/cjs/store/dsl-workflow.js.map +1 -0
  50. package/lib/cjs/store/index.js +28 -0
  51. package/lib/cjs/store/index.js.map +1 -0
  52. package/lib/cjs/store/object-types.js +98 -0
  53. package/lib/cjs/store/object-types.js.map +1 -0
  54. package/lib/cjs/store/signals.js +3 -0
  55. package/lib/cjs/store/signals.js.map +1 -0
  56. package/lib/cjs/store/store.js +18 -0
  57. package/lib/cjs/store/store.js.map +1 -0
  58. package/lib/cjs/store/temporalio.js +44 -0
  59. package/lib/cjs/store/temporalio.js.map +1 -0
  60. package/lib/cjs/store/workflow.js +47 -0
  61. package/lib/cjs/store/workflow.js.map +1 -0
  62. package/lib/cjs/training.js +14 -0
  63. package/lib/cjs/training.js.map +1 -0
  64. package/lib/cjs/transient-tokens.js +9 -0
  65. package/lib/cjs/transient-tokens.js.map +1 -0
  66. package/lib/cjs/user.js +17 -0
  67. package/lib/cjs/user.js.map +1 -0
  68. package/lib/cjs/utils/auth.js +15 -0
  69. package/lib/cjs/utils/auth.js.map +1 -0
  70. package/lib/cjs/utils/schemas.js +66 -0
  71. package/lib/cjs/utils/schemas.js.map +1 -0
  72. package/lib/esm/Progress.js +57 -0
  73. package/lib/esm/Progress.js.map +1 -0
  74. package/lib/esm/access-control.js +36 -0
  75. package/lib/esm/access-control.js.map +1 -0
  76. package/lib/esm/analytics.js +2 -0
  77. package/lib/esm/analytics.js.map +1 -0
  78. package/lib/esm/apikey.js +12 -0
  79. package/lib/esm/apikey.js.map +1 -0
  80. package/lib/esm/common.js +2 -0
  81. package/lib/esm/common.js.map +1 -0
  82. package/lib/esm/environment.js +113 -0
  83. package/lib/esm/environment.js.map +1 -0
  84. package/lib/esm/facets.js +2 -0
  85. package/lib/esm/facets.js.map +1 -0
  86. package/lib/esm/index.js +24 -0
  87. package/lib/esm/index.js.map +1 -0
  88. package/lib/esm/integrations.js +9 -0
  89. package/lib/esm/integrations.js.map +1 -0
  90. package/lib/esm/interaction.js +60 -0
  91. package/lib/esm/interaction.js.map +1 -0
  92. package/lib/esm/meters.js +10 -0
  93. package/lib/esm/meters.js.map +1 -0
  94. package/lib/esm/payload.js +2 -0
  95. package/lib/esm/payload.js.map +1 -0
  96. package/lib/esm/plugin.js +2 -0
  97. package/lib/esm/plugin.js.map +1 -0
  98. package/lib/esm/project.js +46 -0
  99. package/lib/esm/project.js.map +1 -0
  100. package/lib/esm/prompt.js +18 -0
  101. package/lib/esm/prompt.js.map +1 -0
  102. package/lib/esm/query.js +2 -0
  103. package/lib/esm/query.js.map +1 -0
  104. package/lib/esm/refs.js +9 -0
  105. package/lib/esm/refs.js.map +1 -0
  106. package/lib/esm/runs.js +2 -0
  107. package/lib/esm/runs.js.map +1 -0
  108. package/lib/esm/store/activity-catalog.js +2 -0
  109. package/lib/esm/store/activity-catalog.js.map +1 -0
  110. package/lib/esm/store/agent.js +2 -0
  111. package/lib/esm/store/agent.js.map +1 -0
  112. package/lib/esm/store/collections.js +6 -0
  113. package/lib/esm/store/collections.js.map +1 -0
  114. package/lib/esm/store/common.js +2 -0
  115. package/lib/esm/store/common.js.map +1 -0
  116. package/lib/esm/store/doc-analyzer.js +2 -0
  117. package/lib/esm/store/doc-analyzer.js.map +1 -0
  118. package/lib/esm/store/dsl-workflow.js +2 -0
  119. package/lib/esm/store/dsl-workflow.js.map +1 -0
  120. package/lib/esm/store/index.js +12 -0
  121. package/lib/esm/store/index.js.map +1 -0
  122. package/lib/esm/store/object-types.js +95 -0
  123. package/lib/esm/store/object-types.js.map +1 -0
  124. package/lib/esm/store/signals.js +2 -0
  125. package/lib/esm/store/signals.js.map +1 -0
  126. package/lib/esm/store/store.js +15 -0
  127. package/lib/esm/store/store.js.map +1 -0
  128. package/lib/esm/store/temporalio.js +41 -0
  129. package/lib/esm/store/temporalio.js.map +1 -0
  130. package/lib/esm/store/workflow.js +43 -0
  131. package/lib/esm/store/workflow.js.map +1 -0
  132. package/lib/esm/training.js +11 -0
  133. package/lib/esm/training.js.map +1 -0
  134. package/lib/esm/transient-tokens.js +6 -0
  135. package/lib/esm/transient-tokens.js.map +1 -0
  136. package/lib/esm/user.js +14 -0
  137. package/lib/esm/user.js.map +1 -0
  138. package/lib/esm/utils/auth.js +11 -0
  139. package/lib/esm/utils/auth.js.map +1 -0
  140. package/lib/esm/utils/schemas.js +61 -0
  141. package/lib/esm/utils/schemas.js.map +1 -0
  142. package/lib/tsconfig.tsbuildinfo +1 -0
  143. package/lib/types/Progress.d.ts +21 -0
  144. package/lib/types/Progress.d.ts.map +1 -0
  145. package/lib/types/access-control.d.ts +56 -0
  146. package/lib/types/access-control.d.ts.map +1 -0
  147. package/lib/types/analytics.d.ts +36 -0
  148. package/lib/types/analytics.d.ts.map +1 -0
  149. package/lib/types/apikey.d.ts +54 -0
  150. package/lib/types/apikey.d.ts.map +1 -0
  151. package/lib/types/common.d.ts +31 -0
  152. package/lib/types/common.d.ts.map +1 -0
  153. package/lib/types/environment.d.ts +80 -0
  154. package/lib/types/environment.d.ts.map +1 -0
  155. package/lib/types/facets.d.ts +34 -0
  156. package/lib/types/facets.d.ts.map +1 -0
  157. package/lib/types/index.d.ts +23 -0
  158. package/lib/types/index.d.ts.map +1 -0
  159. package/lib/types/integrations.d.ts +28 -0
  160. package/lib/types/integrations.d.ts.map +1 -0
  161. package/lib/types/interaction.d.ts +399 -0
  162. package/lib/types/interaction.d.ts.map +1 -0
  163. package/lib/types/meters.d.ts +23 -0
  164. package/lib/types/meters.d.ts.map +1 -0
  165. package/lib/types/payload.d.ts +52 -0
  166. package/lib/types/payload.d.ts.map +1 -0
  167. package/lib/types/plugin.d.ts +26 -0
  168. package/lib/types/plugin.d.ts.map +1 -0
  169. package/lib/types/project.d.ts +103 -0
  170. package/lib/types/project.d.ts.map +1 -0
  171. package/lib/types/prompt.d.ts +70 -0
  172. package/lib/types/prompt.d.ts.map +1 -0
  173. package/lib/types/query.d.ts +78 -0
  174. package/lib/types/query.d.ts.map +1 -0
  175. package/lib/types/refs.d.ts +19 -0
  176. package/lib/types/refs.d.ts.map +1 -0
  177. package/lib/types/runs.d.ts +32 -0
  178. package/lib/types/runs.d.ts.map +1 -0
  179. package/lib/types/store/activity-catalog.d.ts +26 -0
  180. package/lib/types/store/activity-catalog.d.ts.map +1 -0
  181. package/lib/types/store/agent.d.ts +18 -0
  182. package/lib/types/store/agent.d.ts.map +1 -0
  183. package/lib/types/store/collections.d.ts +59 -0
  184. package/lib/types/store/collections.d.ts.map +1 -0
  185. package/lib/types/store/common.d.ts +22 -0
  186. package/lib/types/store/common.d.ts.map +1 -0
  187. package/lib/types/store/doc-analyzer.d.ts +132 -0
  188. package/lib/types/store/doc-analyzer.d.ts.map +1 -0
  189. package/lib/types/store/dsl-workflow.d.ts +238 -0
  190. package/lib/types/store/dsl-workflow.d.ts.map +1 -0
  191. package/lib/types/store/index.d.ts +11 -0
  192. package/lib/types/store/index.d.ts.map +1 -0
  193. package/lib/types/store/object-types.d.ts +23 -0
  194. package/lib/types/store/object-types.d.ts.map +1 -0
  195. package/lib/types/store/signals.d.ts +5 -0
  196. package/lib/types/store/signals.d.ts.map +1 -0
  197. package/lib/types/store/store.d.ts +269 -0
  198. package/lib/types/store/store.d.ts.map +1 -0
  199. package/lib/types/store/temporalio.d.ts +16 -0
  200. package/lib/types/store/temporalio.d.ts.map +1 -0
  201. package/lib/types/store/workflow.d.ts +249 -0
  202. package/lib/types/store/workflow.d.ts.map +1 -0
  203. package/lib/types/training.d.ts +38 -0
  204. package/lib/types/training.d.ts.map +1 -0
  205. package/lib/types/transient-tokens.d.ts +27 -0
  206. package/lib/types/transient-tokens.d.ts.map +1 -0
  207. package/lib/types/user.d.ts +113 -0
  208. package/lib/types/user.d.ts.map +1 -0
  209. package/lib/types/utils/auth.d.ts +3 -0
  210. package/lib/types/utils/auth.d.ts.map +1 -0
  211. package/lib/types/utils/schemas.d.ts +7 -0
  212. package/lib/types/utils/schemas.d.ts.map +1 -0
  213. package/lib/vertesia-common.js +2 -0
  214. package/lib/vertesia-common.js.map +1 -0
  215. package/package.json +8 -4
  216. package/src/environment.ts +1 -1
  217. package/src/index.ts +0 -1
  218. package/src/integrations.ts +6 -0
  219. package/src/interaction.ts +6 -3
  220. package/src/plugin.ts +14 -0
  221. package/src/prompt.ts +3 -3
  222. package/src/store/object-types.ts +3 -4
  223. package/src/store/store.ts +8 -3
  224. package/src/store/workflow.ts +22 -5
  225. package/src/training.ts +1 -1
  226. package/src/utils/schemas.ts +5 -3
  227. package/src/utils/advanced-content-processing.ts +0 -32
@@ -24,9 +24,15 @@ export interface MagicPdfConfiguration extends IntegrationConfigurationBase {
24
24
  default_zones?: string[];
25
25
  }
26
26
 
27
+ export interface SerperConfiguration extends IntegrationConfigurationBase {
28
+ api_key: string;
29
+ url?: string;
30
+ }
31
+
27
32
  export enum SupportedIntegrations {
28
33
  gladia = "gladia",
29
34
  github = "github",
30
35
  aws = "aws",
31
36
  magic_pdf = "magic_pdf",
37
+ serper = "serper",
32
38
  }
@@ -6,10 +6,10 @@ import type {
6
6
  StatelessExecutionOptions,
7
7
  ToolDefinition,
8
8
  ToolUse,
9
- } from "@llumiverse/core";
10
- import { JSONSchema4 } from "json-schema";
9
+ } from "@llumiverse/common";
10
+ import type { JSONSchema4 } from "json-schema";
11
11
 
12
- import { ExecutionTokenUsage } from "@llumiverse/core";
12
+ import { ExecutionTokenUsage } from "@llumiverse/common";
13
13
 
14
14
  import { ExecutionEnvironmentRef } from "./environment.js";
15
15
  import { ProjectRef } from "./project.js";
@@ -354,6 +354,9 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
354
354
  * If not specified, default value of 150K tokens will be used.
355
355
  */
356
356
  checkpoint_tokens?: number;
357
+
358
+ /** In child execution workflow, this is the curent task_id */
359
+ task_id?: string;
357
360
  }
358
361
 
359
362
  export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
package/src/plugin.ts CHANGED
@@ -7,6 +7,20 @@ export interface PluginManifest {
7
7
  name: string;
8
8
  version: string;
9
9
  publisher: string;
10
+ title?: string;
10
11
  description?: string;
11
12
  icon?: string;
13
+ /**
14
+ * Whether the plugin should be loaded as part of the host layout
15
+ * or in a new tab.
16
+ * If external is true, the plugin must manage itself the global layout of the page.
17
+ * It will be loaded in a new tab.
18
+ * If external is false the plugin will be loaded as a page of the host application and it will share the same layout.
19
+ * Default is false.
20
+ */
21
+ external?: boolean;
22
+ /**
23
+ * The default is "beta".
24
+ */
25
+ status?: "beta" | "stable" | "deprecated" | "hidden";
12
26
  }
package/src/prompt.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { JSONSchema4 } from "json-schema";
2
- import type { JSONObject } from "@llumiverse/core";
1
+ import type { JSONSchema4 } from "json-schema";
2
+ import type { JSONObject } from "@llumiverse/common";
3
3
  import { ProjectRef } from "./project.js";
4
- import { PromptRole } from "@llumiverse/core";
4
+ import { PromptRole } from "@llumiverse/common";
5
5
 
6
6
  export interface ChatPromptSchema {
7
7
  role: PromptRole.user | PromptRole.assistant;
@@ -1,4 +1,4 @@
1
- import { JSONSchemaType } from "ajv"
1
+ import type { JSONSchemaType } from "ajv"
2
2
 
3
3
  /*Default JSON Schema type for rendition*/
4
4
 
@@ -12,7 +12,7 @@ export interface RenditionProperties {
12
12
  }
13
13
 
14
14
  export const RenditionSchema: JSONSchemaType<RenditionProperties> = {
15
-
15
+
16
16
  type: "object",
17
17
  description: "Represent a rendition of a file stored in an object. It will be stored as a separate object in the database.",
18
18
  properties: {
@@ -64,7 +64,7 @@ export interface DocumentPartProperties {
64
64
  description?: string,
65
65
  height?: number,
66
66
  width?: number,
67
-
67
+
68
68
  }
69
69
 
70
70
 
@@ -125,4 +125,3 @@ export const DocumentPartSchema: JSONSchemaType<DocumentPartProperties> = {
125
125
  },
126
126
  required: ["part_number"],
127
127
  }
128
-
@@ -246,7 +246,7 @@ export interface ColumnLayout {
246
246
  */
247
247
  default?: any;
248
248
  }
249
- export interface ContentObjectType extends ContentObjectTypeItem {}
249
+ export interface ContentObjectType extends ContentObjectTypeItem { }
250
250
  export interface ContentObjectTypeItem extends BaseObject {
251
251
  is_chunkable?: boolean;
252
252
  /**
@@ -259,10 +259,15 @@ export interface ContentObjectTypeItem extends BaseObject {
259
259
  * It is always included in ContentObjectType
260
260
  */
261
261
  object_schema?: Record<string, any>; // an optional JSON schema for the object properties.
262
+
263
+ /**
264
+ * Determines if the content will be validated against the object schema a generation time and save/update time.
265
+ */
266
+ strict_mode?: boolean;
262
267
  }
263
268
 
264
269
  export interface CreateContentObjectTypePayload
265
- extends Omit<ContentObjectType, "id" | "created_at" | "updated_at" | "created_by" | "updated_by"> {}
270
+ extends Omit<ContentObjectType, "id" | "created_at" | "updated_at" | "created_by" | "updated_by"> { }
266
271
 
267
272
  export enum WorkflowRuleInputType {
268
273
  single = "single",
@@ -302,7 +307,7 @@ export interface CreateWorkflowRulePayload extends UploadWorkflowRulePayload {
302
307
  endpoint: string; // required
303
308
  }
304
309
  export interface UploadWorkflowRulePayload
305
- extends Partial<Omit<WorkflowRule, "id" | "created_at" | "updated_at" | "owner">> {}
310
+ extends Partial<Omit<WorkflowRule, "id" | "created_at" | "updated_at" | "owner">> { }
306
311
 
307
312
  export interface GetRenditionResponse {
308
313
  status: "found" | "generating" | "failed";
@@ -58,6 +58,11 @@ export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
58
58
  */
59
59
  notify_endpoints?: string[];
60
60
 
61
+ /** If this is a child workflow, parent contains parent's ids */
62
+ parent?: {
63
+ run_id: string;
64
+ workflow_id: string;
65
+ };
61
66
  }
62
67
 
63
68
  export interface WorkflowExecutionPayload<T = Record<string, any>> extends WorkflowExecutionBaseParams<T> {
@@ -91,7 +96,6 @@ export function getDocumentIds(payload: WorkflowExecutionPayload): string[] {
91
96
  }
92
97
 
93
98
  export interface ExecuteWorkflowPayload {
94
-
95
99
  /**
96
100
  * The task queue to assign the workflow to. Deprecated, queues are choosend server side
97
101
  */
@@ -115,8 +119,8 @@ export interface ExecuteWorkflowPayload {
115
119
  unique?: boolean;
116
120
 
117
121
  /**
118
- * A custom ID to use for the workflow execution id instead of the generated one.
119
- */
122
+ * A custom ID to use for the workflow execution id instead of the generated one.
123
+ */
120
124
  custom_id?: string;
121
125
 
122
126
  /**
@@ -126,7 +130,6 @@ export interface ExecuteWorkflowPayload {
126
130
  }
127
131
 
128
132
  export interface ListWorkflowRunsPayload {
129
-
130
133
  /**
131
134
  * The document ID passed to a workflow run.
132
135
  */
@@ -266,8 +269,9 @@ export interface AgentMessage {
266
269
  timestamp: number;
267
270
  workflow_run_id: string;
268
271
  type: AgentMessageType;
269
- message?: string;
272
+ message: string;
270
273
  details?: any;
274
+ workstream_id?: string;
271
275
  }
272
276
 
273
277
  export enum AgentMessageType {
@@ -283,3 +287,16 @@ export enum AgentMessageType {
283
287
  REQUEST_INPUT = "request_input",
284
288
  IDLE = "idle",
285
289
  }
290
+
291
+ export interface PlanTask {
292
+ id: number;
293
+ goal: string;
294
+ instructions: string[];
295
+ comment?: string;
296
+ status?: "pending" | "in_progress" | "completed" | "skipped";
297
+ }
298
+
299
+ export interface Plan {
300
+ plan: PlanTask[];
301
+ comment?: string;
302
+ }
package/src/training.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TrainingJob } from "@llumiverse/core";
1
+ import type { TrainingJob } from "@llumiverse/common";
2
2
  import { ExecutionEnvironmentRef } from "./environment.js";
3
3
 
4
4
  export enum TrainingSessionStatus {
@@ -1,5 +1,6 @@
1
- import { JSONSchema, PromptRole } from "@llumiverse/core";
2
- import { JSONSchema4 } from "json-schema";
1
+ import { PromptRole } from "@llumiverse/common";
2
+ import type { JSONSchema } from "@llumiverse/common";
3
+ import type { JSONSchema4 } from "json-schema";
3
4
  import { InteractionRefWithSchema, PopulatedInteraction } from "../interaction.js";
4
5
  import { PopulatedPromptSegmentDef, PromptSegmentDef, PromptSegmentDefType, PromptTemplateRefWithSchema } from "../prompt.js";
5
6
 
@@ -17,7 +18,8 @@ export function mergeJSONSchemas(schemas: JSONSchema[]) {
17
18
  Object.assign(props, schema.properties);
18
19
  }
19
20
  }
20
- return Object.keys(props).length > 0 ? { properties: props, required } as JSONSchema : null;
21
+ const schema = Object.keys(props).length > 0 ? { properties: props, required, type: 'object' } as JSONSchema : null;
22
+ return schema;
21
23
  }
22
24
 
23
25
  export function _mergePromptsSchema(prompts: PromptSegmentDef<PromptTemplateRefWithSchema>[] | PopulatedPromptSegmentDef[]) {
@@ -1,32 +0,0 @@
1
- import mime from 'mime';
2
-
3
-
4
- const ADVANCED_PROCESSING_PREFIX = 'magic-pdf';
5
-
6
- export interface AdvancedProcessingObjectFileParams {
7
- objectId: string;
8
- fileId: string;
9
- prefix?: string;
10
- contentType?: string;
11
- path?: any;
12
- }
13
-
14
- /**
15
- *
16
- * Advanced content processing only
17
- * generate a file path based on object ID and file role
18
- *
19
- * @returns
20
- */
21
- export function getPathForAdvancedProcessingFile({ objectId, prefix, fileId, contentType }: AdvancedProcessingObjectFileParams) {
22
-
23
- const extension = contentType ? `.${mime.getExtension(contentType)}` : '';
24
- const p = prefix ? `${prefix}/` : '';
25
-
26
- let path = `${ADVANCED_PROCESSING_PREFIX}/${objectId}/${p}${fileId}`;
27
- if (!path.endsWith(extension)) {
28
- path += extension;
29
- }
30
-
31
- return path;
32
- }