@vertesia/common 0.73.0 → 0.75.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/access-control.js +1 -0
- package/lib/cjs/access-control.js.map +1 -1
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/project.js +11 -1
- package/lib/cjs/project.js.map +1 -1
- package/lib/cjs/store/store.js.map +1 -1
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/esm/access-control.js +1 -0
- package/lib/esm/access-control.js.map +1 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/project.js +10 -0
- package/lib/esm/project.js.map +1 -1
- package/lib/esm/store/store.js.map +1 -1
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/access-control.d.ts +1 -0
- package/lib/types/access-control.d.ts.map +1 -1
- package/lib/types/apikey.d.ts +1 -1
- package/lib/types/apikey.d.ts.map +1 -1
- package/lib/types/interaction.d.ts +4 -0
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/payload.d.ts +1 -0
- package/lib/types/payload.d.ts.map +1 -1
- package/lib/types/project.d.ts +13 -1
- package/lib/types/project.d.ts.map +1 -1
- package/lib/types/query.d.ts +30 -5
- package/lib/types/query.d.ts.map +1 -1
- package/lib/types/store/collections.d.ts +2 -0
- package/lib/types/store/collections.d.ts.map +1 -1
- package/lib/types/store/store.d.ts +1 -0
- package/lib/types/store/store.d.ts.map +1 -1
- package/lib/types/store/workflow.d.ts +4 -0
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/package.json +2 -2
- package/src/access-control.ts +2 -1
- package/src/apikey.ts +1 -1
- package/src/interaction.ts +5 -0
- package/src/payload.ts +1 -0
- package/src/project.ts +13 -0
- package/src/query.ts +37 -5
- package/src/store/collections.ts +2 -0
- package/src/store/store.ts +1 -0
- package/src/store/workflow.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./lib/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"ajv": "^8.16.0",
|
|
29
29
|
"json-schema": "^0.4.0",
|
|
30
|
-
"@llumiverse/common": "0.
|
|
30
|
+
"@llumiverse/common": "0.22.0"
|
|
31
31
|
},
|
|
32
32
|
"ts_dual_module": {
|
|
33
33
|
"outDir": "lib"
|
package/src/access-control.ts
CHANGED
|
@@ -36,8 +36,9 @@ export enum Permission {
|
|
|
36
36
|
content_read = "content:read",
|
|
37
37
|
content_write = "content:write",
|
|
38
38
|
content_delete = "content:delete",
|
|
39
|
-
|
|
40
39
|
content_admin = "content:admin", //manage schemas
|
|
40
|
+
content_superadmin = "content:superadmin", // list all objects and collections
|
|
41
|
+
|
|
41
42
|
|
|
42
43
|
workflow_run = "workflow:run",
|
|
43
44
|
workflow_admin = "workflow:admin",
|
package/src/apikey.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface ApiKey {
|
|
|
13
13
|
role: ProjectRoles;
|
|
14
14
|
maskedValue?: string; //masked value
|
|
15
15
|
account: string; // the account id
|
|
16
|
-
project:
|
|
16
|
+
project: ProjectRef; // the project id if any
|
|
17
17
|
enabled: boolean;
|
|
18
18
|
created_by: string,
|
|
19
19
|
updated_by: string,
|
package/src/interaction.ts
CHANGED
|
@@ -77,6 +77,7 @@ export interface InteractionEndpoint {
|
|
|
77
77
|
visibility?: InteractionVisibility;
|
|
78
78
|
version: number;
|
|
79
79
|
tags: string[];
|
|
80
|
+
output_modality?: Modalities;
|
|
80
81
|
result_schema?: JSONSchema;
|
|
81
82
|
params_schema?: JSONSchema;
|
|
82
83
|
}
|
|
@@ -348,6 +349,9 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
|
|
|
348
349
|
/** Whether to enable debug mode */
|
|
349
350
|
debug_mode?: boolean;
|
|
350
351
|
|
|
352
|
+
/** Maximum depth for nested conversations to prevent infinite recursion (default: 5) */
|
|
353
|
+
max_nested_conversation_depth?: number;
|
|
354
|
+
|
|
351
355
|
}
|
|
352
356
|
|
|
353
357
|
export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
|
|
@@ -373,6 +377,7 @@ interface ResumeConversationPayload {
|
|
|
373
377
|
|
|
374
378
|
export interface ToolResultContent {
|
|
375
379
|
content: string;
|
|
380
|
+
is_error: boolean;
|
|
376
381
|
files?: string[];
|
|
377
382
|
}
|
|
378
383
|
|
package/src/payload.ts
CHANGED
package/src/project.ts
CHANGED
|
@@ -13,11 +13,13 @@ export enum ProjectRoles {
|
|
|
13
13
|
project_admin = "project_admin", // all permissions but manage_account, manage_billing
|
|
14
14
|
developer = "developer", // all permissions but manage_account, manage_billing, manage_roles, delete
|
|
15
15
|
application = "application", // executor + request_pk
|
|
16
|
+
consumer = "consumer", // required permissions for users of micro apps
|
|
16
17
|
executor = "executor", // can only read and execute interactions
|
|
17
18
|
reader = "reader", // can only read (browse)
|
|
18
19
|
billing = "billing", // can only manage billings
|
|
19
20
|
member = "member", // can only access, but no specific permissions
|
|
20
21
|
app_member = "app_member", // used to mark an user have access to an application. does not provide any permission on its own
|
|
22
|
+
content_superadmin = "content_superadmin", // can see all content objects and collections
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export function isRoleIncludedIn(role: string, includingRole: string) {
|
|
@@ -91,6 +93,17 @@ export enum SupportedEmbeddingTypes {
|
|
|
91
93
|
properties = "properties"
|
|
92
94
|
}
|
|
93
95
|
|
|
96
|
+
export enum FullTextType {
|
|
97
|
+
full_text = "full_text"
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type SearchTypes = SupportedEmbeddingTypes | FullTextType;
|
|
101
|
+
|
|
102
|
+
export const SearchTypes = {
|
|
103
|
+
...SupportedEmbeddingTypes,
|
|
104
|
+
...FullTextType
|
|
105
|
+
} as const;
|
|
106
|
+
|
|
94
107
|
export interface ProjectConfigurationEmbeddings {
|
|
95
108
|
environment: string;
|
|
96
109
|
enabled: boolean;
|
package/src/query.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExecutionRunStatus } from './interaction.js';
|
|
2
|
-
import { SupportedEmbeddingTypes } from './project.js';
|
|
3
2
|
import { CollectionSearchPayload } from './store/collections.js';
|
|
3
|
+
import { SearchTypes, SupportedEmbeddingTypes } from "./project.js";
|
|
4
|
+
|
|
5
|
+
export type EmbeddingSearchConfig = Partial<Record<SupportedEmbeddingTypes, boolean>>;
|
|
4
6
|
|
|
5
7
|
export interface RunListingQueryOptions {
|
|
6
8
|
project?: string;
|
|
@@ -22,18 +24,22 @@ export interface RunListingFilters {
|
|
|
22
24
|
workflow_run_ids?: string[],
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
export type scoreAggregationTypes = 'rrf' | 'rsf' | 'smart';
|
|
28
|
+
export type dynamicScalingTypes = 'off' | 'on';
|
|
29
|
+
|
|
25
30
|
export interface VectorSearchQuery {
|
|
26
31
|
objectId?: string;
|
|
27
32
|
values?: number[];
|
|
28
33
|
text?: string;
|
|
29
34
|
image?: string;
|
|
30
|
-
|
|
31
|
-
type: SupportedEmbeddingTypes
|
|
35
|
+
config?: EmbeddingSearchConfig;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
export interface SimpleSearchQuery {
|
|
35
39
|
name?: string;
|
|
36
40
|
status?: string | string[];
|
|
41
|
+
limit?: number;
|
|
42
|
+
offset?: number;
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
export interface ObjectSearchQuery extends SimpleSearchQuery {
|
|
@@ -43,10 +49,10 @@ export interface ObjectSearchQuery extends SimpleSearchQuery {
|
|
|
43
49
|
updatedTo?: string;
|
|
44
50
|
location?: string;
|
|
45
51
|
parent?: string;
|
|
46
|
-
similarTo?: string;
|
|
47
|
-
embeddingType?: SupportedEmbeddingTypes;
|
|
48
52
|
type?: string;
|
|
49
53
|
types?: string[];
|
|
54
|
+
all_revisions?: boolean;
|
|
55
|
+
from_root?: string;
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
export interface ObjectTypeSearchQuery extends SimpleSearchQuery {
|
|
@@ -91,8 +97,34 @@ export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
|
|
|
91
97
|
status?: string;
|
|
92
98
|
}
|
|
93
99
|
|
|
100
|
+
/**
|
|
101
|
+
* ComplexSearchQuery is used for full-text search and vector embedding search.
|
|
102
|
+
*/
|
|
94
103
|
export interface ComplexSearchQuery extends ObjectSearchQuery {
|
|
95
104
|
vector?: VectorSearchQuery;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* If present, do a full text search.
|
|
108
|
+
*/
|
|
109
|
+
fullText?: string;
|
|
110
|
+
|
|
111
|
+
weights?: Record<SearchTypes, number>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* dynamicScaling rescales the weights when a particular search type is not present in the results, per object.
|
|
115
|
+
* e.g. Weights of 5,3,2 will be treated as 0,3,2 if the first search type is not present in the results.
|
|
116
|
+
* Ignored when scoreAggregation is 'smart'
|
|
117
|
+
* Default is 'on'
|
|
118
|
+
*/
|
|
119
|
+
dynamic_scaling?: dynamicScalingTypes; // Move to top level
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* rrf: Reciprocal Rank Fusion
|
|
123
|
+
* rsf: Reciprocal Score Fusion
|
|
124
|
+
* smart: Our own algorithm (default and recommended)
|
|
125
|
+
*/
|
|
126
|
+
score_aggregation?: scoreAggregationTypes;
|
|
127
|
+
|
|
96
128
|
match?: Record<string, any>;
|
|
97
129
|
}
|
|
98
130
|
|
package/src/store/collections.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface CreateCollectionPayload {
|
|
|
17
17
|
parent?: string | null;
|
|
18
18
|
table_layout?: ColumnLayout[] | null;
|
|
19
19
|
allowed_types?: string[];
|
|
20
|
+
updated_by?: string,
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface CollectionItem extends BaseObject {
|
|
@@ -48,6 +49,7 @@ export interface CollectionItem extends BaseObject {
|
|
|
48
49
|
export interface Collection extends CollectionItem {
|
|
49
50
|
properties: Record<string, any>;
|
|
50
51
|
query?: Record<string, any>;
|
|
52
|
+
security?: Record<string, string[]>; // ACL for collection access
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export interface StaticCollection extends Collection {
|
package/src/store/store.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface ContentObject<T = any> extends ContentObjectItem<T> {
|
|
|
24
24
|
parts?: string[]; // the list of objectId of the parts of the object
|
|
25
25
|
parts_etag?: string; // the etag of the text used for the parts list
|
|
26
26
|
transcript?: Transcript;
|
|
27
|
+
security?: Record<string, string[]>; // Security field for granular permissions
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export type ContentNature =
|
package/src/store/workflow.ts
CHANGED