@vertesia/common 0.78.0 → 0.79.1

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 (120) hide show
  1. package/lib/cjs/access-control.js +3 -3
  2. package/lib/cjs/access-control.js.map +1 -1
  3. package/lib/cjs/apikey.js +2 -0
  4. package/lib/cjs/apikey.js.map +1 -1
  5. package/lib/cjs/index.js +3 -0
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/interaction.js +12 -2
  8. package/lib/cjs/interaction.js.map +1 -1
  9. package/lib/cjs/prompt.js +0 -1
  10. package/lib/cjs/prompt.js.map +1 -1
  11. package/lib/cjs/rate-limiter.js +6 -0
  12. package/lib/cjs/rate-limiter.js.map +1 -0
  13. package/lib/cjs/store/store.js +20 -1
  14. package/lib/cjs/store/store.js.map +1 -1
  15. package/lib/cjs/store/workflow.js.map +1 -1
  16. package/lib/cjs/sts-token-types.js +32 -0
  17. package/lib/cjs/sts-token-types.js.map +1 -0
  18. package/lib/cjs/utils/schemas.js +27 -5
  19. package/lib/cjs/utils/schemas.js.map +1 -1
  20. package/lib/cjs/versions.js +8 -0
  21. package/lib/cjs/versions.js.map +1 -0
  22. package/lib/esm/access-control.js +3 -3
  23. package/lib/esm/access-control.js.map +1 -1
  24. package/lib/esm/apikey.js +2 -0
  25. package/lib/esm/apikey.js.map +1 -1
  26. package/lib/esm/index.js +3 -0
  27. package/lib/esm/index.js.map +1 -1
  28. package/lib/esm/interaction.js +11 -1
  29. package/lib/esm/interaction.js.map +1 -1
  30. package/lib/esm/prompt.js +0 -1
  31. package/lib/esm/prompt.js.map +1 -1
  32. package/lib/esm/rate-limiter.js +5 -0
  33. package/lib/esm/rate-limiter.js.map +1 -0
  34. package/lib/esm/store/store.js +19 -0
  35. package/lib/esm/store/store.js.map +1 -1
  36. package/lib/esm/store/workflow.js.map +1 -1
  37. package/lib/esm/sts-token-types.js +24 -0
  38. package/lib/esm/sts-token-types.js.map +1 -0
  39. package/lib/esm/utils/schemas.js +26 -5
  40. package/lib/esm/utils/schemas.js.map +1 -1
  41. package/lib/esm/versions.js +5 -0
  42. package/lib/esm/versions.js.map +1 -0
  43. package/lib/tsconfig.tsbuildinfo +1 -1
  44. package/lib/types/Progress.d.ts +1 -0
  45. package/lib/types/access-control.d.ts +4 -3
  46. package/lib/types/access-control.d.ts.map +1 -1
  47. package/lib/types/analytics.d.ts +1 -0
  48. package/lib/types/apikey.d.ts +8 -2
  49. package/lib/types/apikey.d.ts.map +1 -1
  50. package/lib/types/apps.d.ts +38 -0
  51. package/lib/types/apps.d.ts.map +1 -1
  52. package/lib/types/common.d.ts +1 -0
  53. package/lib/types/environment.d.ts +1 -0
  54. package/lib/types/facets.d.ts +1 -0
  55. package/lib/types/group.d.ts +1 -0
  56. package/lib/types/index.d.ts +4 -0
  57. package/lib/types/index.d.ts.map +1 -1
  58. package/lib/types/integrations.d.ts +1 -0
  59. package/lib/types/interaction.d.ts +269 -21
  60. package/lib/types/interaction.d.ts.map +1 -1
  61. package/lib/types/json-schema.d.ts +1 -0
  62. package/lib/types/json.d.ts +1 -0
  63. package/lib/types/meters.d.ts +1 -0
  64. package/lib/types/model_utility.d.ts +1 -0
  65. package/lib/types/payload.d.ts +3 -4
  66. package/lib/types/payload.d.ts.map +1 -1
  67. package/lib/types/project.d.ts +6 -5
  68. package/lib/types/project.d.ts.map +1 -1
  69. package/lib/types/prompt.d.ts +16 -8
  70. package/lib/types/prompt.d.ts.map +1 -1
  71. package/lib/types/query.d.ts +5 -0
  72. package/lib/types/query.d.ts.map +1 -1
  73. package/lib/types/rate-limiter.d.ts +29 -0
  74. package/lib/types/rate-limiter.d.ts.map +1 -0
  75. package/lib/types/refs.d.ts +1 -0
  76. package/lib/types/runs.d.ts +1 -0
  77. package/lib/types/store/activity-catalog.d.ts +1 -0
  78. package/lib/types/store/agent.d.ts +1 -0
  79. package/lib/types/store/collections.d.ts +6 -2
  80. package/lib/types/store/collections.d.ts.map +1 -1
  81. package/lib/types/store/common.d.ts +1 -0
  82. package/lib/types/store/doc-analyzer.d.ts +1 -0
  83. package/lib/types/store/dsl-workflow.d.ts +1 -0
  84. package/lib/types/store/index.d.ts +1 -0
  85. package/lib/types/store/object-types.d.ts +1 -0
  86. package/lib/types/store/signals.d.ts +1 -0
  87. package/lib/types/store/store.d.ts +35 -5
  88. package/lib/types/store/store.d.ts.map +1 -1
  89. package/lib/types/store/temporalio.d.ts +1 -0
  90. package/lib/types/store/workflow.d.ts +81 -13
  91. package/lib/types/store/workflow.d.ts.map +1 -1
  92. package/lib/types/sts-token-types.d.ts +73 -0
  93. package/lib/types/sts-token-types.d.ts.map +1 -0
  94. package/lib/types/tenant.d.ts +1 -0
  95. package/lib/types/training.d.ts +1 -0
  96. package/lib/types/transient-tokens.d.ts +1 -0
  97. package/lib/types/user.d.ts +1 -0
  98. package/lib/types/utils/auth.d.ts +1 -0
  99. package/lib/types/utils/schemas.d.ts +5 -3
  100. package/lib/types/utils/schemas.d.ts.map +1 -1
  101. package/lib/types/utils/type-helpers.d.ts +1 -0
  102. package/lib/types/versions.d.ts +4 -0
  103. package/lib/types/versions.d.ts.map +1 -0
  104. package/lib/vertesia-common.js +1 -1
  105. package/lib/vertesia-common.js.map +1 -1
  106. package/package.json +38 -38
  107. package/src/access-control.ts +1 -0
  108. package/src/apikey.ts +1 -0
  109. package/src/apps.ts +32 -0
  110. package/src/index.ts +4 -1
  111. package/src/interaction.ts +22 -6
  112. package/src/payload.ts +2 -4
  113. package/src/project.ts +5 -5
  114. package/src/query.ts +4 -0
  115. package/src/rate-limiter.ts +34 -0
  116. package/src/store/collections.ts +5 -2
  117. package/src/store/store.ts +36 -11
  118. package/src/store/workflow.ts +47 -7
  119. package/src/versions.ts +3 -0
  120. package/LICENSE +0 -13
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
- "name": "@vertesia/common",
3
- "version": "0.78.0",
4
- "type": "module",
5
- "types": "./lib/types/index.d.ts",
6
- "files": [
7
- "lib",
8
- "src",
9
- "tsconfig.dist.json"
10
- ],
11
- "exports": {
2
+ "name": "@vertesia/common",
3
+ "version": "0.79.1",
4
+ "type": "module",
12
5
  "types": "./lib/types/index.d.ts",
13
- "import": "./lib/esm/index.js",
14
- "require": "./lib/cjs/index.js"
15
- },
16
- "devDependencies": {
17
- "@rollup/plugin-commonjs": "^28.0.3",
18
- "@rollup/plugin-node-resolve": "^16.0.1",
19
- "@rollup/plugin-typescript": "^12.1.2",
20
- "@types/json-schema": "^7.0.15",
21
- "rollup": "^4.40.2",
22
- "rollup-plugin-terser": "^7.0.2",
23
- "ts-dual-module": "^0.6.3",
24
- "typescript": "^5.0.2",
25
- "vitest": "^3.0.9"
26
- },
27
- "dependencies": {
28
- "ajv": "^8.16.0",
29
- "json-schema": "^0.4.0",
30
- "@llumiverse/common": "0.22.0"
31
- },
32
- "ts_dual_module": {
33
- "outDir": "lib"
34
- },
35
- "scripts": {
36
- "test": "vitest run",
37
- "build": "pnpm exec tsmod build && pnpm exec rollup -c",
38
- "clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo"
39
- }
40
- }
6
+ "files": [
7
+ "lib",
8
+ "src",
9
+ "tsconfig.dist.json"
10
+ ],
11
+ "scripts": {
12
+ "test": "vitest run",
13
+ "build": "pnpm exec tsmod build && pnpm exec rollup -c",
14
+ "clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo"
15
+ },
16
+ "exports": {
17
+ "types": "./lib/types/index.d.ts",
18
+ "import": "./lib/esm/index.js",
19
+ "require": "./lib/cjs/index.js"
20
+ },
21
+ "devDependencies": {
22
+ "@rollup/plugin-commonjs": "^28.0.3",
23
+ "@rollup/plugin-node-resolve": "^16.0.1",
24
+ "@rollup/plugin-typescript": "^12.1.2",
25
+ "@types/json-schema": "^7.0.15",
26
+ "rollup": "^4.40.2",
27
+ "rollup-plugin-terser": "^7.0.2",
28
+ "ts-dual-module": "^0.6.3",
29
+ "typescript": "^5.0.2",
30
+ "vitest": "^3.0.9"
31
+ },
32
+ "dependencies": {
33
+ "@llumiverse/common": "workspace:*",
34
+ "ajv": "^8.16.0",
35
+ "json-schema": "^0.4.0"
36
+ },
37
+ "ts_dual_module": {
38
+ "outDir": "lib"
39
+ }
40
+ }
@@ -42,6 +42,7 @@ export enum Permission {
42
42
 
43
43
  workflow_run = "workflow:run",
44
44
  workflow_admin = "workflow:admin",
45
+ workflow_superadmin = "workflow:superadmin",
45
46
 
46
47
  /**
47
48
  * whether the user has access to Sutdio App.
package/src/apikey.ts CHANGED
@@ -90,6 +90,7 @@ export interface AuthTokenPayload {
90
90
 
91
91
  export enum PrincipalType {
92
92
  User = "user",
93
+ Group = "group",
93
94
  ApiKey = "apikey",
94
95
  ServiceAccount = "service_account",
95
96
  }
package/src/apps.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { JSONSchema } from "@llumiverse/common";
1
2
 
2
3
  export interface AppUIConfig {
3
4
  /**
@@ -36,6 +37,12 @@ export interface AppManifestData {
36
37
  */
37
38
  icon?: string;
38
39
 
40
+ /**
41
+ * A color name to be used as the color of the app card (e.g. blue, red, green, etc.)
42
+ * If not specified a random color will be picked.
43
+ */
44
+ color?: string;
45
+
39
46
  status: "beta" | "stable" | "deprecated"
40
47
 
41
48
  ui?: AppUIConfig
@@ -46,6 +53,11 @@ export interface AppManifestData {
46
53
  * If the `?import` query string is used the tool will be imported as a javascript module and not executed through a POST on the collections endpoint.
47
54
  */
48
55
  tool_collections?: string[]
56
+
57
+ /**
58
+ * A JSON chema for the app installation settings.
59
+ */
60
+ settings_schema?: JSONSchema;
49
61
  }
50
62
  export interface AppManifest extends AppManifestData {
51
63
  id: string;
@@ -73,3 +85,23 @@ export interface AppInstallationPayload {
73
85
  }
74
86
 
75
87
  export type AppInstallationKind = 'ui' | 'tools' | 'all';
88
+
89
+ /**
90
+ * A descriptiojn of the tools provided by an app
91
+ */
92
+ export interface AppToolCollection {
93
+ /**
94
+ * The collection name
95
+ */
96
+ name: string;
97
+
98
+ /**
99
+ * Optional collection description
100
+ */
101
+ description?: string;
102
+
103
+ /**
104
+ * the tools provided by this collection
105
+ */
106
+ tools: { name: string, description?: string }[]
107
+ }
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from "./Progress.js";
17
17
  export * from './project.js';
18
18
  export * from './prompt.js';
19
19
  export * from './query.js';
20
+ export * from './rate-limiter.js';
20
21
  export * from './refs.js';
21
22
  export * from './runs.js';
22
23
  export * from "./store/index.js";
@@ -26,4 +27,6 @@ export * from './transient-tokens.js';
26
27
  export * from './user.js';
27
28
  export * from './utils/auth.js';
28
29
  export * from './utils/schemas.js';
29
- export type * from './utils/type-helpers.js'
30
+ export type * from './utils/type-helpers.js';
31
+ export * from './versions.js';
32
+
@@ -1,4 +1,5 @@
1
1
  import type {
2
+ CompletionResult,
2
3
  JSONObject,
3
4
  JSONSchema,
4
5
  Modalities,
@@ -284,7 +285,7 @@ export interface NamedInteractionExecutionPayload extends InteractionExecutionPa
284
285
  // ================= async execution payloads ====================
285
286
  export type ToolRef = string | { name: string; description: string };
286
287
 
287
- interface AsyncExecutionPayloadBase extends Omit<NamedInteractionExecutionPayload,"toolDefinitions" | "stream"> {
288
+ interface AsyncExecutionPayloadBase extends Omit<NamedInteractionExecutionPayload, "toolDefinitions" | "stream"> {
288
289
  type: "conversation" | "interaction";
289
290
 
290
291
  /**
@@ -381,6 +382,10 @@ export interface ToolResultContent {
381
382
  content: string;
382
383
  is_error: boolean;
383
384
  files?: string[];
385
+ /**
386
+ * Can contain metadata returned by the tool executor.
387
+ */
388
+ meta?: Record<string, any>;
384
389
  }
385
390
 
386
391
  export interface ToolResult extends ToolResultContent {
@@ -398,7 +403,7 @@ export interface UserMessagePayload extends ResumeConversationPayload {
398
403
  message: string;
399
404
  }
400
405
 
401
- export type CheckpointConversationPayload = Omit<ToolResultsPayload, "results">;
406
+ export type CheckpointConversationPayload = Omit<ToolResultsPayload, "results" | "tools">
402
407
 
403
408
  // ================= end async execution payloads ====================
404
409
 
@@ -419,7 +424,7 @@ export interface RunSource {
419
424
  client_ip: string;
420
425
  }
421
426
 
422
- export interface ExecutionRun<P = any, R = any> {
427
+ export interface ExecutionRun<P = any> {
423
428
  readonly id: string;
424
429
  /**
425
430
  * Only used by runs that were created by a virtual run to point toward the virtual run parent
@@ -430,7 +435,7 @@ export interface ExecutionRun<P = any, R = any> {
430
435
  selected?: boolean;
431
436
  scores?: Record<string, number>;
432
437
  };
433
- result: R;
438
+ result: CompletionResult[] // Any new result will actually be CompletionResult[], the old typing is R, and R used to default to any.
434
439
  /**
435
440
  * The parameters used to create the interaction.
436
441
  * If the parameters contains the special property "@memory" it will be used
@@ -450,7 +455,7 @@ export interface ExecutionRun<P = any, R = any> {
450
455
  prompt: any;
451
456
  token_use?: ExecutionTokenUsage;
452
457
  chunks?: number;
453
- execution_time?: number; //s
458
+ execution_time?: number; // ms
454
459
  created_at: Date;
455
460
  updated_at: Date;
456
461
  account: AccountRef;
@@ -498,7 +503,7 @@ export interface ExecutionRunWorkflow {
498
503
  activity_type?: string;
499
504
  }
500
505
 
501
- export interface InteractionExecutionResult<P = any, R = any> extends ExecutionRun<P, R> {
506
+ export interface InteractionExecutionResult<P = any> extends ExecutionRun<P> {
502
507
  tool_use?: ToolUse[];
503
508
  conversation?: unknown;
504
509
  options?: StatelessExecutionOptions;
@@ -551,3 +556,14 @@ export interface GenerateTestDataPayload {
551
556
  export interface ImprovePromptPayload {
552
557
  config: InteractionExecutionConfiguration;
553
558
  }
559
+
560
+ export interface RateLimitRequestPayload {
561
+ interaction: string,
562
+ environment_id?: string,
563
+ model_id?: string,
564
+ workflow_run_id?: string
565
+ }
566
+
567
+ export interface RateLimitRequestResponse {
568
+ delay_ms: number;
569
+ }
package/src/payload.ts CHANGED
@@ -13,10 +13,8 @@ import {
13
13
  export interface SearchPayload {
14
14
  facets?: FacetSpec[];
15
15
  /**
16
- * If the facets should respect "limit"
17
- * If true, the facet count be limited to the number of results in the query.
18
- * If false, the facet count will be calculated over all objects.
19
- * Default is true.
16
+ * If the facets should be limited to the current page of results.
17
+ * Defaults to false. When false, the facets are independent of the search results page.
20
18
  */
21
19
  limit_facets?: boolean;
22
20
  query?: SimpleSearchQuery;
package/src/project.ts CHANGED
@@ -140,11 +140,11 @@ export const ProjectRefPopulate = "id name account";
140
140
 
141
141
  export interface EmbeddingsStatusResponse {
142
142
  status: string;
143
- embeddingRunsInProgress: number;
144
- totalRunsInProgress: number;
145
- totalIndexableObjects: number;
146
- embeddingsModels: string[];
147
- objectsWithEmbeddings: number;
143
+ embeddingRunsInProgress?: number;
144
+ totalRunsInProgress?: number;
145
+ totalIndexableObjects?: number;
146
+ embeddingsModels?: string[];
147
+ objectsWithEmbeddings?: number;
148
148
  vectorIndex: {
149
149
  status: "READY" | "PENDING" | "DELETING" | "ABSENT",
150
150
  name?: string,
package/src/query.ts CHANGED
@@ -43,6 +43,7 @@ export interface SimpleSearchQuery {
43
43
  }
44
44
 
45
45
  export interface ObjectSearchQuery extends SimpleSearchQuery {
46
+ id?: string;
46
47
  createdFrom?: string;
47
48
  createdTo?: string;
48
49
  updatedFrom?: string;
@@ -68,6 +69,8 @@ export interface InteractionSearchQuery extends SimpleSearchQuery {
68
69
  prompt?: string;
69
70
  tags?: string[];
70
71
  version?: string;
72
+ model?: string;
73
+ environment?: string;
71
74
  }
72
75
 
73
76
  export interface RunSearchQuery extends SimpleSearchQuery {
@@ -86,6 +89,7 @@ export interface RunSearchQuery extends SimpleSearchQuery {
86
89
  finish_reason?: string;
87
90
  created_by?: string;
88
91
  workflow_run_ids?: string[];
92
+ run_ids?: string[];
89
93
  }
90
94
 
91
95
  export interface WorkflowExecutionSearchQuery extends SimpleSearchQuery {
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Rate Limiter Types
3
+ */
4
+
5
+ export interface RateLimiterCapacity {
6
+ current: number;
7
+ base: number;
8
+ max: number;
9
+ }
10
+
11
+ export interface RateLimiterBreakerState {
12
+ state: 'open' | 'closed';
13
+ is_open: boolean;
14
+ last_opened_at?: string;
15
+ consecutive_failures?: number;
16
+ }
17
+
18
+ export interface RateLimiterModelStatus {
19
+ model_id: string;
20
+ admitted: number;
21
+ delayed: number;
22
+ capacity: RateLimiterCapacity;
23
+ breaker: RateLimiterBreakerState;
24
+ last_updated: string;
25
+ }
26
+
27
+ export interface RateLimiterStatus {
28
+ environment_id: string;
29
+ model_id: string;
30
+ status: RateLimiterModelStatus;
31
+ }
32
+
33
+ // Always return an array for consistency
34
+ export type RateLimiterStatusResponse = RateLimiterStatus[];
@@ -31,9 +31,10 @@ export interface CollectionItem extends BaseObject {
31
31
  // A ref to the object type
32
32
  type?: ContentObjectTypeRef;
33
33
  /**
34
- * The parent collection if any
34
+ * The parent collections if any.
35
+ * A collection can have multiple parents.
35
36
  */
36
- parent?: string | null;
37
+ parents?: string[] | null;
37
38
  /**
38
39
  * The table layout to use for the collection.
39
40
  * The layout defined in the type could serve as a fallback if not defined here.
@@ -63,10 +64,12 @@ export interface DynamicCollection extends Collection {
63
64
  }
64
65
 
65
66
  export interface CollectionSearchPayload {
67
+ parent?: string | null;
66
68
  dynamic?: boolean;
67
69
  status?: CollectionStatus;
68
70
  limit?: number;
69
71
  offset?: number;
70
72
  name?: string;
71
73
  type?: string;
74
+ types?: string[];
72
75
  }
@@ -3,6 +3,13 @@ import { SupportedEmbeddingTypes } from "../project.js";
3
3
  import { ComplexSearchQuery } from "../query.js";
4
4
  import { BaseObject } from "./common.js";
5
5
 
6
+ export enum ContentObjectApiHeaders {
7
+ COLLECTION_ID = 'x-collection-id',
8
+ PROCESSING_PRIORITY = 'x-processing-priority',
9
+ CREATE_REVISION = 'x-create-revision',
10
+ REVISION_LABEL = 'x-revision-label',
11
+ }
12
+
6
13
  export enum ContentObjectStatus {
7
14
  created = "created",
8
15
  processing = "processing", // the was created and still processing
@@ -27,13 +34,14 @@ export interface ContentObject<T = any> extends ContentObjectItem<T> {
27
34
  security?: Record<string, string[]>; // Security field for granular permissions
28
35
  }
29
36
 
30
- export type ContentNature =
31
- | "video"
32
- | "image"
33
- | "audio"
34
- | "document"
35
- | "code"
36
- | "other";
37
+ export enum ContentNature {
38
+ Video = "video",
39
+ Image = "image",
40
+ Audio = "audio",
41
+ Document = "document",
42
+ Code = "code",
43
+ Other = "other"
44
+ }
37
45
 
38
46
  export interface Dimensions {
39
47
  width: number;
@@ -69,17 +77,29 @@ export interface TemporalMediaMetadata extends ContentMetadata {
69
77
  }
70
78
 
71
79
  export interface ImageMetadata extends ContentMetadata {
72
- type: "image";
80
+ type: ContentNature.Image;
73
81
  dimensions?: Dimensions;
74
82
  }
75
83
 
76
84
  export interface AudioMetadata extends TemporalMediaMetadata {
77
- type: "audio";
85
+ type: ContentNature.Audio;
86
+ }
87
+
88
+ export interface VideoRendition {
89
+ name: string;
90
+ dimensions: Dimensions;
91
+ content: ContentSource
78
92
  }
79
93
 
94
+ export const POSTER_RENDITION_NAME = "Poster";
95
+ export const AUDIO_RENDITION_NAME = "Audio";
96
+ export const WEB_VIDEO_RENDITION_NAME = "Web";
97
+
80
98
  export interface VideoMetadata extends TemporalMediaMetadata {
81
- type: "video";
99
+ type: ContentNature.Video;
82
100
  dimensions?: Dimensions;
101
+ renditions?: VideoRendition[];
102
+ hasAudio?: boolean;
83
103
  }
84
104
 
85
105
  export interface TextSection {
@@ -89,7 +109,7 @@ export interface TextSection {
89
109
  }
90
110
 
91
111
  export interface DocumentMetadata extends ContentMetadata {
92
- type: "document";
112
+ type: ContentNature.Document;
93
113
  page_count?: number;
94
114
  content_processor?: {
95
115
  type?: string;
@@ -331,6 +351,11 @@ export interface WorkflowRule extends WorkflowRuleItem {
331
351
  * When set to true the rule will not be updated by the system
332
352
  */
333
353
  customer_override?: boolean;
354
+
355
+ /**
356
+ * Optional task queue name to use when starting workflows for this rule
357
+ */
358
+ task_queue?: string;
334
359
  }
335
360
 
336
361
  export interface CreateWorkflowRulePayload extends UploadWorkflowRulePayload {
@@ -1,5 +1,5 @@
1
1
  import { JSONSchema4 } from "json-schema";
2
- import { InteractionRef } from "../interaction.js";
2
+ import { ConversationVisibility, InteractionRef } from "../interaction.js";
3
3
 
4
4
  export enum ContentEventName {
5
5
  create = "create",
@@ -12,6 +12,13 @@ export enum ContentEventName {
12
12
  api_request = "api_request",
13
13
  }
14
14
 
15
+ export interface Queue {
16
+ name: string;
17
+ // use either suffix or full name. fullname has precedence over suffix
18
+ queue_suffix?: string; // suffix to append to the base queue name
19
+ queue_full_name?: string; // full name
20
+ }
21
+
15
22
  export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
16
23
  /**
17
24
  * The ref of the user who initiated the workflow.
@@ -59,7 +66,7 @@ export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
59
66
  * The list of endpoints to notify when the workflow finishes.
60
67
  * It is handled by a sub-workflow execution, so the main workflow will not wait for the notification to be sent.
61
68
  */
62
- notify_endpoints?: string[];
69
+ notify_endpoints?: (string | WebHookSpec)[];
63
70
 
64
71
  /** If this is a child workflow, parent contains parent's ids */
65
72
  parent?: {
@@ -72,14 +79,21 @@ export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
72
79
  };
73
80
 
74
81
  /**
75
- * Whether to route resource intensive tasks to a heavy load queue. Managed by the application.
82
+ * List of enabled processing queues. Managed by the application.
76
83
  */
77
- _enable_heavy_task_routing?: boolean;
84
+ _enabled_queues?: Queue[];
78
85
 
86
+ }
87
+
88
+ export interface WebHookSpec {
89
+ /**
90
+ * The webhook URL to call using POST method
91
+ */
92
+ url: string;
79
93
  /**
80
- * The suffix to append to the task queue name for heavy load routing. Managed by the application.
94
+ * the API version to use if any
81
95
  */
82
- _heavy_task_queue_suffix?: string;
96
+ version?: number;
83
97
  }
84
98
 
85
99
  export interface WorkflowExecutionPayload<T = Record<string, any>> extends WorkflowExecutionBaseParams<T> {
@@ -188,6 +202,11 @@ export interface ListWorkflowRunsPayload {
188
202
  */
189
203
  initiated_by?: string;
190
204
 
205
+ /**
206
+ * The interaction name used to filter conversations.
207
+ */
208
+ interaction?: string;
209
+
191
210
  /**
192
211
  * Lucene query string to search for the workflow runs.
193
212
  * This is a full text search on the workflow run history.
@@ -287,6 +306,16 @@ export interface WorkflowRun {
287
306
  * An interaction is used to start the agent, the data is stored on temporal "vars"
288
307
  */
289
308
  interactions?: InteractionRef[];
309
+ /**
310
+ * The visibility of the workflow run.
311
+ * - 'private': Only visible to the user who initiated the workflow
312
+ * - 'project': Visible to all users in the project
313
+ */
314
+ visibility?: ConversationVisibility;
315
+ /**
316
+ * A brief summary of the conversation workflow.
317
+ */
318
+ topic?: string;
290
319
  }
291
320
 
292
321
  export interface WorkflowRunWithDetails extends WorkflowRun {
@@ -321,11 +350,12 @@ export interface WorkflowInteraction {
321
350
  tools: [],
322
351
  interaction: string,
323
352
  environment: string,
324
- prompt_data: JSONSchema4,
353
+ data: JSONSchema4,
325
354
  interactive: boolean,
326
355
  interactionParamsSchema?: JSONSchema4
327
356
  debug_mode?: boolean;
328
357
  collection_id?: string;
358
+ config: Record<string, any>;
329
359
  }
330
360
 
331
361
  export interface MultiDocumentsInteractionParams extends Omit<WorkflowExecutionPayload, "config"> {
@@ -407,3 +437,13 @@ export interface Plan {
407
437
  }
408
438
 
409
439
  export const LOW_PRIORITY_TASK_QUEUE = "low_priority";
440
+
441
+ /**
442
+ * Payload for applying actions to a workflow run (e.g., cancel, terminate).
443
+ */
444
+ export interface WorkflowActionPayload {
445
+ /**
446
+ * Optional reason for the action.
447
+ */
448
+ reason?: string;
449
+ }
@@ -0,0 +1,3 @@
1
+ export enum ApiVersions {
2
+ COMPLETION_RESULT_V1 = 20250925,
3
+ }
package/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright 2024 Composable
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.