@vertesia/common 0.55.0 → 0.57.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.
- package/lib/cjs/index.js +2 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/integrations.js +1 -0
- package/lib/cjs/integrations.js.map +1 -1
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/json-schema.js +3 -0
- package/lib/cjs/json-schema.js.map +1 -0
- package/lib/cjs/store/store.js.map +1 -1
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/cjs/tenant.js +3 -0
- package/lib/cjs/tenant.js.map +1 -0
- package/lib/cjs/utils/schemas.js +4 -3
- package/lib/cjs/utils/schemas.js.map +1 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/integrations.js +1 -0
- package/lib/esm/integrations.js.map +1 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/json-schema.js +2 -0
- package/lib/esm/json-schema.js.map +1 -0
- package/lib/esm/store/store.js.map +1 -1
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/esm/tenant.js +2 -0
- package/lib/esm/tenant.js.map +1 -0
- package/lib/esm/utils/schemas.js +3 -2
- package/lib/esm/utils/schemas.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/common.d.ts +1 -1
- package/lib/types/common.d.ts.map +1 -1
- package/lib/types/environment.d.ts +1 -1
- package/lib/types/environment.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/integrations.d.ts +6 -1
- package/lib/types/integrations.d.ts.map +1 -1
- package/lib/types/interaction.d.ts +8 -5
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/json-schema.d.ts +1 -0
- package/lib/types/json-schema.d.ts.map +1 -0
- package/lib/types/payload.d.ts +1 -1
- package/lib/types/payload.d.ts.map +1 -1
- package/lib/types/plugin.d.ts +14 -0
- package/lib/types/plugin.d.ts.map +1 -1
- package/lib/types/prompt.d.ts +3 -3
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/store/object-types.d.ts +1 -1
- package/lib/types/store/object-types.d.ts.map +1 -1
- package/lib/types/store/store.d.ts +4 -0
- package/lib/types/store/store.d.ts.map +1 -1
- package/lib/types/store/workflow.d.ts +21 -3
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/types/tenant.d.ts +10 -0
- package/lib/types/tenant.d.ts.map +1 -0
- package/lib/types/training.d.ts +1 -1
- package/lib/types/training.d.ts.map +1 -1
- package/lib/types/utils/schemas.d.ts +2 -2
- package/lib/types/utils/schemas.d.ts.map +1 -1
- package/lib/vertesia-common.js +2 -0
- package/lib/vertesia-common.js.map +1 -0
- package/package.json +8 -4
- package/src/common.ts +1 -1
- package/src/environment.ts +1 -1
- package/src/index.ts +2 -1
- package/src/integrations.ts +6 -0
- package/src/interaction.ts +9 -5
- package/src/json-schema.ts +7 -0
- package/src/payload.ts +1 -1
- package/src/plugin.ts +14 -0
- package/src/prompt.ts +3 -3
- package/src/store/object-types.ts +3 -4
- package/src/store/store.ts +8 -3
- package/src/store/workflow.ts +24 -5
- package/src/tenant.ts +10 -0
- package/src/training.ts +1 -1
- package/src/utils/schemas.ts +5 -3
- package/lib/cjs/utils/advanced-content-processing.js +0 -25
- package/lib/cjs/utils/advanced-content-processing.js.map +0 -1
- package/lib/esm/utils/advanced-content-processing.js +0 -19
- package/lib/esm/utils/advanced-content-processing.js.map +0 -1
- package/lib/types/utils/advanced-content-processing.d.ts +0 -15
- package/lib/types/utils/advanced-content-processing.d.ts.map +0 -1
- package/src/utils/advanced-content-processing.ts +0 -32
package/src/store/store.ts
CHANGED
@@ -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";
|
package/src/store/workflow.ts
CHANGED
@@ -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
|
-
|
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
|
*/
|
@@ -173,6 +176,8 @@ export interface ListWorkflowRunsPayload {
|
|
173
176
|
* This is a full text search on the workflow run history.
|
174
177
|
*/
|
175
178
|
query?: string;
|
179
|
+
|
180
|
+
type?: string;
|
176
181
|
}
|
177
182
|
|
178
183
|
interface WorkflowRunEvent {
|
@@ -266,8 +271,9 @@ export interface AgentMessage {
|
|
266
271
|
timestamp: number;
|
267
272
|
workflow_run_id: string;
|
268
273
|
type: AgentMessageType;
|
269
|
-
message
|
274
|
+
message: string;
|
270
275
|
details?: any;
|
276
|
+
workstream_id?: string;
|
271
277
|
}
|
272
278
|
|
273
279
|
export enum AgentMessageType {
|
@@ -283,3 +289,16 @@ export enum AgentMessageType {
|
|
283
289
|
REQUEST_INPUT = "request_input",
|
284
290
|
IDLE = "idle",
|
285
291
|
}
|
292
|
+
|
293
|
+
export interface PlanTask {
|
294
|
+
id: number;
|
295
|
+
goal: string;
|
296
|
+
instructions: string[];
|
297
|
+
comment?: string;
|
298
|
+
status?: "pending" | "in_progress" | "completed" | "skipped";
|
299
|
+
}
|
300
|
+
|
301
|
+
export interface Plan {
|
302
|
+
plan: PlanTask[];
|
303
|
+
comment?: string;
|
304
|
+
}
|
package/src/tenant.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* This interface is used only on the client side and is shared between @vertesia/ui/session and the main app.
|
3
|
+
*/
|
4
|
+
export interface UIResolvedTenant {
|
5
|
+
firebaseTenantId: string;
|
6
|
+
label?: string;
|
7
|
+
logo?: string;
|
8
|
+
provider?: string;
|
9
|
+
name?: string;
|
10
|
+
}
|
package/src/training.ts
CHANGED
package/src/utils/schemas.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
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
|
-
|
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,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getPathForAdvancedProcessingFile = getPathForAdvancedProcessingFile;
|
7
|
-
const mime_1 = __importDefault(require("mime"));
|
8
|
-
const ADVANCED_PROCESSING_PREFIX = 'magic-pdf';
|
9
|
-
/**
|
10
|
-
*
|
11
|
-
* Advanced content processing only
|
12
|
-
* generate a file path based on object ID and file role
|
13
|
-
*
|
14
|
-
* @returns
|
15
|
-
*/
|
16
|
-
function getPathForAdvancedProcessingFile({ objectId, prefix, fileId, contentType }) {
|
17
|
-
const extension = contentType ? `.${mime_1.default.getExtension(contentType)}` : '';
|
18
|
-
const p = prefix ? `${prefix}/` : '';
|
19
|
-
let path = `${ADVANCED_PROCESSING_PREFIX}/${objectId}/${p}${fileId}`;
|
20
|
-
if (!path.endsWith(extension)) {
|
21
|
-
path += extension;
|
22
|
-
}
|
23
|
-
return path;
|
24
|
-
}
|
25
|
-
//# sourceMappingURL=advanced-content-processing.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"advanced-content-processing.js","sourceRoot":"","sources":["../../../src/utils/advanced-content-processing.ts"],"names":[],"mappings":";;;;;AAoBA,4EAWC;AA/BD,gDAAwB;AAGxB,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAU/C;;;;;;GAMG;AACH,SAAgB,gCAAgC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAsC;IAE1H,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,cAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAErC,IAAI,IAAI,GAAG,GAAG,0BAA0B,IAAI,QAAQ,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;IACrE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,IAAI,IAAI,SAAS,CAAC;IACtB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import mime from 'mime';
|
2
|
-
const ADVANCED_PROCESSING_PREFIX = 'magic-pdf';
|
3
|
-
/**
|
4
|
-
*
|
5
|
-
* Advanced content processing only
|
6
|
-
* generate a file path based on object ID and file role
|
7
|
-
*
|
8
|
-
* @returns
|
9
|
-
*/
|
10
|
-
export function getPathForAdvancedProcessingFile({ objectId, prefix, fileId, contentType }) {
|
11
|
-
const extension = contentType ? `.${mime.getExtension(contentType)}` : '';
|
12
|
-
const p = prefix ? `${prefix}/` : '';
|
13
|
-
let path = `${ADVANCED_PROCESSING_PREFIX}/${objectId}/${p}${fileId}`;
|
14
|
-
if (!path.endsWith(extension)) {
|
15
|
-
path += extension;
|
16
|
-
}
|
17
|
-
return path;
|
18
|
-
}
|
19
|
-
//# sourceMappingURL=advanced-content-processing.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"advanced-content-processing.js","sourceRoot":"","sources":["../../../src/utils/advanced-content-processing.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAU/C;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAsC;IAE1H,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAErC,IAAI,IAAI,GAAG,GAAG,0BAA0B,IAAI,QAAQ,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;IACrE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,IAAI,IAAI,SAAS,CAAC;IACtB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
export interface AdvancedProcessingObjectFileParams {
|
2
|
-
objectId: string;
|
3
|
-
fileId: string;
|
4
|
-
prefix?: string;
|
5
|
-
contentType?: string;
|
6
|
-
path?: any;
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
* Advanced content processing only
|
11
|
-
* generate a file path based on object ID and file role
|
12
|
-
*
|
13
|
-
* @returns
|
14
|
-
*/
|
15
|
-
export declare function getPathForAdvancedProcessingFile({ objectId, prefix, fileId, contentType }: AdvancedProcessingObjectFileParams): string;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"advanced-content-processing.d.ts","sourceRoot":"","sources":["../../../src/utils/advanced-content-processing.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kCAAkC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,kCAAkC,UAW7H"}
|
@@ -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
|
-
}
|