@vertesia/common 0.65.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 (55) hide show
  1. package/lib/cjs/access-control.js +16 -8
  2. package/lib/cjs/access-control.js.map +1 -1
  3. package/lib/cjs/apikey.js.map +1 -1
  4. package/lib/cjs/group.js +5 -0
  5. package/lib/cjs/group.js.map +1 -0
  6. package/lib/cjs/index.js +4 -3
  7. package/lib/cjs/index.js.map +1 -1
  8. package/lib/cjs/interaction.js.map +1 -1
  9. package/lib/cjs/refs.js +1 -0
  10. package/lib/cjs/refs.js.map +1 -1
  11. package/lib/cjs/store/workflow.js.map +1 -1
  12. package/lib/cjs/user.js.map +1 -1
  13. package/lib/esm/access-control.js +15 -7
  14. package/lib/esm/access-control.js.map +1 -1
  15. package/lib/esm/apikey.js.map +1 -1
  16. package/lib/esm/group.js +2 -0
  17. package/lib/esm/group.js.map +1 -0
  18. package/lib/esm/index.js +4 -3
  19. package/lib/esm/index.js.map +1 -1
  20. package/lib/esm/interaction.js.map +1 -1
  21. package/lib/esm/refs.js +1 -0
  22. package/lib/esm/refs.js.map +1 -1
  23. package/lib/esm/store/workflow.js.map +1 -1
  24. package/lib/esm/user.js.map +1 -1
  25. package/lib/tsconfig.tsbuildinfo +1 -1
  26. package/lib/types/access-control.d.ts +12 -4
  27. package/lib/types/access-control.d.ts.map +1 -1
  28. package/lib/types/apikey.d.ts +3 -0
  29. package/lib/types/apikey.d.ts.map +1 -1
  30. package/lib/types/group.d.ts +21 -0
  31. package/lib/types/group.d.ts.map +1 -0
  32. package/lib/types/index.d.ts +4 -3
  33. package/lib/types/index.d.ts.map +1 -1
  34. package/lib/types/interaction.d.ts +10 -9
  35. package/lib/types/interaction.d.ts.map +1 -1
  36. package/lib/types/query.d.ts +6 -1
  37. package/lib/types/query.d.ts.map +1 -1
  38. package/lib/types/refs.d.ts +2 -1
  39. package/lib/types/refs.d.ts.map +1 -1
  40. package/lib/types/store/workflow.d.ts +13 -0
  41. package/lib/types/store/workflow.d.ts.map +1 -1
  42. package/lib/types/user.d.ts +1 -0
  43. package/lib/types/user.d.ts.map +1 -1
  44. package/lib/vertesia-common.js +1 -1
  45. package/lib/vertesia-common.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/access-control.ts +13 -3
  48. package/src/apikey.ts +6 -0
  49. package/src/group.ts +26 -0
  50. package/src/index.ts +5 -3
  51. package/src/interaction.ts +13 -9
  52. package/src/query.ts +6 -1
  53. package/src/refs.ts +2 -1
  54. package/src/store/workflow.ts +15 -0
  55. package/src/user.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/common",
3
- "version": "0.65.0",
3
+ "version": "0.66.0",
4
4
  "type": "module",
5
5
  "types": "./lib/types/index.d.ts",
6
6
  "files": [
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "ajv": "^8.16.0",
28
28
  "json-schema": "^0.4.0",
29
- "@llumiverse/common": "0.18.0"
29
+ "@llumiverse/common": "0.20.0"
30
30
  },
31
31
  "ts_dual_module": {
32
32
  "outDir": "lib"
@@ -21,6 +21,8 @@ export enum Permission {
21
21
 
22
22
  api_key_create = "api_key:create",
23
23
  api_key_read = "api_key:read",
24
+ api_key_update = "api_key:update",
25
+ api_key_delete = "api_key:delete",
24
26
 
25
27
  account_read = "account:read",
26
28
  account_manage = "account:manage",
@@ -38,19 +40,27 @@ export enum Permission {
38
40
  workflow_run = "workflow:run",
39
41
  }
40
42
 
41
- export enum AccessControlledResource {
43
+ export enum AccessControlResourceType {
42
44
  project = "project",
43
45
  environment = "environment",
44
46
  account = "account",
45
47
  interaction = "interaction",
48
+ app = "application",
46
49
  }
47
50
 
51
+ export enum AccessControlPrincipalType {
52
+ user = "user",
53
+ group = "group",
54
+ }
55
+
56
+
48
57
 
49
58
  export interface AccessControlEntry {
50
59
  role: ProjectRoles;
60
+ resource_type: AccessControlResourceType;
51
61
  resource: string; //objectId
62
+ principal_type: AccessControlPrincipalType;
52
63
  principal: string; //objectId
53
- type: AccessControlledResource;
54
64
  tags?: string[];
55
65
  expires_at?: string;
56
66
  created_at?: string;
@@ -72,6 +82,6 @@ export interface AcesQueryOptions {
72
82
  resource?: string
73
83
  principal?: string
74
84
  role?: string
75
- type?: AccessControlledResource
85
+ type?: AccessControlResourceType
76
86
 
77
87
  }
package/src/apikey.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { UserGroupRef } from "./group.js";
1
2
  import { ProjectRef, ProjectRoles } from "./project.js";
2
3
  import { AccountRef } from "./user.js";
3
4
 
@@ -50,11 +51,16 @@ export interface AuthTokenPayload {
50
51
 
51
52
  type: PrincipalType
52
53
  account: AccountRef;
54
+
53
55
  account_roles: ProjectRoles[];
54
56
  accounts: AccountRef[];
57
+
55
58
  project?: ProjectRef;
56
59
  project_roles?: ProjectRoles[];
57
60
 
61
+ /** groups */
62
+ groups?: UserGroupRef[]; //group ids
63
+
58
64
  iss: string; //issuer
59
65
  aud: string; //audience
60
66
  exp: number; //expires in (EPOC seconds)
package/src/group.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { UserRef } from "./user.js";
2
+
3
+
4
+ export interface UserGroup {
5
+ id: string;
6
+ account: string;
7
+ name: string;
8
+ description?: string;
9
+ tags: string[];
10
+ created_at: Date;
11
+ updated_at: Date;
12
+ created_by?: string;
13
+ updated_by?: string;
14
+ }
15
+
16
+ export interface PopulatesUserGroup extends UserGroup {
17
+ members: UserRef[];
18
+ }
19
+
20
+ export interface UserGroupRef {
21
+ id: string;
22
+ name: string;
23
+ tags?: string[];
24
+ }
25
+
26
+ export const UserGroupRefPopulate = 'id name tags';
package/src/index.ts CHANGED
@@ -4,9 +4,13 @@ export * from './apikey.js';
4
4
  export * from './common.js';
5
5
  export * from './environment.js';
6
6
  export * from "./facets.js";
7
+ export * from './group.js';
7
8
  export * from './integrations.js';
8
9
  export * from './interaction.js';
10
+ export * from './json-schema.js';
11
+ export * from './json.js';
9
12
  export * from './meters.js';
13
+ export * from './model_utility.js';
10
14
  export * from './payload.js';
11
15
  export * from "./plugin.js";
12
16
  export * from "./Progress.js";
@@ -22,6 +26,4 @@ export * from './transient-tokens.js';
22
26
  export * from './user.js';
23
27
  export * from './utils/auth.js';
24
28
  export * from './utils/schemas.js';
25
- export * from './json-schema.js';
26
- export * from './json.js';
27
- export * from './model_utility.js';
29
+
@@ -367,10 +367,8 @@ export interface AsyncConversationExecutionPayload extends AsyncExecutionPayload
367
367
  /** In child execution workflow, this is the curent task_id */
368
368
  task_id?: string;
369
369
 
370
- /**
371
- * Schema for validating interaction parameters
372
- */
373
- interactionParamsSchema?: JSONSchema4;
370
+ /** Whether to enable debug mode */
371
+ debug_mode?: boolean;
374
372
  }
375
373
 
376
374
  export interface AsyncInteractionExecutionPayload extends AsyncExecutionPayloadBase {
@@ -398,15 +396,21 @@ interface ResumeConversationPayload {
398
396
  tools: ToolDefinition[]; // the tools to be used
399
397
  }
400
398
 
399
+
400
+ export interface ToolResultContent {
401
+ content: string;
402
+ files?: string[];
403
+ }
404
+
405
+ export interface ToolResult extends ToolResultContent {
406
+ tool_use_id: string;
407
+ }
408
+
401
409
  /**
402
410
  * The payload to sent the tool responses back to the target LLM
403
411
  */
404
412
  export interface ToolResultsPayload extends ResumeConversationPayload {
405
- results: {
406
- tool_use_id: string;
407
- content: string;
408
- files?: string[];
409
- }[];
413
+ results: ToolResult[];
410
414
  }
411
415
 
412
416
  export interface UserMessagePayload extends ResumeConversationPayload {
package/src/query.ts CHANGED
@@ -31,15 +31,20 @@ export interface VectorSearchQuery {
31
31
 
32
32
  export interface SimpleSearchQuery {
33
33
  name?: string;
34
- status?: string;
34
+ status?: string | string[];
35
35
  }
36
36
 
37
37
  export interface ObjectSearchQuery extends SimpleSearchQuery {
38
+ createdFrom?: string;
39
+ createdTo?: string;
40
+ updatedFrom?: string;
41
+ updatedTo?: string;
38
42
  location?: string;
39
43
  parent?: string;
40
44
  similarTo?: string;
41
45
  embeddingType?: SupportedEmbeddingTypes;
42
46
  type?: string;
47
+ types?: string[];
43
48
  }
44
49
 
45
50
  export interface ObjectTypeSearchQuery extends SimpleSearchQuery {
package/src/refs.ts CHANGED
@@ -5,7 +5,8 @@ export enum ResolvableRefType {
5
5
  environment = "Environment",
6
6
  user = "User",
7
7
  account = "Account",
8
- interaction = "Interaction"
8
+ interaction = "Interaction",
9
+ userGroup = "UserGroup"
9
10
  }
10
11
 
11
12
  export interface ResolvableRef {
@@ -181,6 +181,16 @@ export interface ListWorkflowRunsPayload {
181
181
  query?: string;
182
182
 
183
183
  type?: string;
184
+
185
+ /**
186
+ * The maximum number of results to return per page.
187
+ */
188
+ page_size?: number;
189
+
190
+ /**
191
+ * The page token for Temporal pagination.
192
+ */
193
+ next_page_token?: string;
184
194
  }
185
195
 
186
196
  interface WorkflowRunEvent {
@@ -247,6 +257,7 @@ export interface WorkflowRun {
247
257
  run_id?: string;
248
258
  workflow_id?: string;
249
259
  initiated_by?: string;
260
+ interaction_name?: string;
250
261
  input?: any;
251
262
  result?: any;
252
263
  error?:any,
@@ -280,6 +291,8 @@ export interface WorkflowRunWithDetails extends WorkflowRun {
280
291
  }
281
292
  export interface ListWorkflowRunsResponse {
282
293
  runs: WorkflowRun[];
294
+ next_page_token?: string;
295
+ has_more?: boolean;
283
296
  }
284
297
 
285
298
  export interface ListWorkflowInteractionsResponse {
@@ -297,6 +310,8 @@ export interface WorkflowInteraction {
297
310
  prompt_data: JSONSchema4,
298
311
  interactive: boolean,
299
312
  interactionParamsSchema?: JSONSchema4
313
+ debug_mode?: boolean;
314
+ collection_id?: string;
300
315
  }
301
316
 
302
317
  export interface MultiDocumentsInteractionParams extends Omit<WorkflowExecutionPayload, "config"> {
package/src/user.ts CHANGED
@@ -4,6 +4,7 @@ import { ProjectRoles } from "./project.js";
4
4
  export interface UserWithAccounts extends User {
5
5
  accounts: AccountRef[];
6
6
  }
7
+
7
8
  export interface User {
8
9
  id: string;
9
10
  externalId: string;
@@ -15,6 +16,7 @@ export interface User {
15
16
  phone?: string;
16
17
  sign_in_provider?: string;
17
18
  last_selected_account?: string;
19
+ source?: 'firebase' | 'scim';
18
20
  }
19
21
 
20
22
  export interface UserRef {
@@ -33,7 +35,7 @@ export enum Datacenters {
33
35
 
34
36
  export enum BillingMethod {
35
37
  stripe = 'stripe',
36
- invoice ='invoice'
38
+ invoice = 'invoice'
37
39
  }
38
40
 
39
41