@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.
- package/lib/cjs/access-control.js +3 -3
- package/lib/cjs/access-control.js.map +1 -1
- package/lib/cjs/apikey.js +2 -0
- package/lib/cjs/apikey.js.map +1 -1
- package/lib/cjs/index.js +3 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interaction.js +12 -2
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/prompt.js +0 -1
- package/lib/cjs/prompt.js.map +1 -1
- package/lib/cjs/rate-limiter.js +6 -0
- package/lib/cjs/rate-limiter.js.map +1 -0
- package/lib/cjs/store/store.js +20 -1
- package/lib/cjs/store/store.js.map +1 -1
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/cjs/sts-token-types.js +32 -0
- package/lib/cjs/sts-token-types.js.map +1 -0
- package/lib/cjs/utils/schemas.js +27 -5
- package/lib/cjs/utils/schemas.js.map +1 -1
- package/lib/cjs/versions.js +8 -0
- package/lib/cjs/versions.js.map +1 -0
- package/lib/esm/access-control.js +3 -3
- package/lib/esm/access-control.js.map +1 -1
- package/lib/esm/apikey.js +2 -0
- package/lib/esm/apikey.js.map +1 -1
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interaction.js +11 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/prompt.js +0 -1
- package/lib/esm/prompt.js.map +1 -1
- package/lib/esm/rate-limiter.js +5 -0
- package/lib/esm/rate-limiter.js.map +1 -0
- package/lib/esm/store/store.js +19 -0
- package/lib/esm/store/store.js.map +1 -1
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/esm/sts-token-types.js +24 -0
- package/lib/esm/sts-token-types.js.map +1 -0
- package/lib/esm/utils/schemas.js +26 -5
- package/lib/esm/utils/schemas.js.map +1 -1
- package/lib/esm/versions.js +5 -0
- package/lib/esm/versions.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/Progress.d.ts +1 -0
- package/lib/types/access-control.d.ts +4 -3
- package/lib/types/access-control.d.ts.map +1 -1
- package/lib/types/analytics.d.ts +1 -0
- package/lib/types/apikey.d.ts +8 -2
- package/lib/types/apikey.d.ts.map +1 -1
- package/lib/types/apps.d.ts +38 -0
- package/lib/types/apps.d.ts.map +1 -1
- package/lib/types/common.d.ts +1 -0
- package/lib/types/environment.d.ts +1 -0
- package/lib/types/facets.d.ts +1 -0
- package/lib/types/group.d.ts +1 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/integrations.d.ts +1 -0
- package/lib/types/interaction.d.ts +269 -21
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/json-schema.d.ts +1 -0
- package/lib/types/json.d.ts +1 -0
- package/lib/types/meters.d.ts +1 -0
- package/lib/types/model_utility.d.ts +1 -0
- package/lib/types/payload.d.ts +3 -4
- package/lib/types/payload.d.ts.map +1 -1
- package/lib/types/project.d.ts +6 -5
- package/lib/types/project.d.ts.map +1 -1
- package/lib/types/prompt.d.ts +16 -8
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/query.d.ts +5 -0
- package/lib/types/query.d.ts.map +1 -1
- package/lib/types/rate-limiter.d.ts +29 -0
- package/lib/types/rate-limiter.d.ts.map +1 -0
- package/lib/types/refs.d.ts +1 -0
- package/lib/types/runs.d.ts +1 -0
- package/lib/types/store/activity-catalog.d.ts +1 -0
- package/lib/types/store/agent.d.ts +1 -0
- package/lib/types/store/collections.d.ts +6 -2
- package/lib/types/store/collections.d.ts.map +1 -1
- package/lib/types/store/common.d.ts +1 -0
- package/lib/types/store/doc-analyzer.d.ts +1 -0
- package/lib/types/store/dsl-workflow.d.ts +1 -0
- package/lib/types/store/index.d.ts +1 -0
- package/lib/types/store/object-types.d.ts +1 -0
- package/lib/types/store/signals.d.ts +1 -0
- package/lib/types/store/store.d.ts +35 -5
- package/lib/types/store/store.d.ts.map +1 -1
- package/lib/types/store/temporalio.d.ts +1 -0
- package/lib/types/store/workflow.d.ts +81 -13
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/types/sts-token-types.d.ts +73 -0
- package/lib/types/sts-token-types.d.ts.map +1 -0
- package/lib/types/tenant.d.ts +1 -0
- package/lib/types/training.d.ts +1 -0
- package/lib/types/transient-tokens.d.ts +1 -0
- package/lib/types/user.d.ts +1 -0
- package/lib/types/utils/auth.d.ts +1 -0
- package/lib/types/utils/schemas.d.ts +5 -3
- package/lib/types/utils/schemas.d.ts.map +1 -1
- package/lib/types/utils/type-helpers.d.ts +1 -0
- package/lib/types/versions.d.ts +4 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/package.json +38 -38
- package/src/access-control.ts +1 -0
- package/src/apikey.ts +1 -0
- package/src/apps.ts +32 -0
- package/src/index.ts +4 -1
- package/src/interaction.ts +22 -6
- package/src/payload.ts +2 -4
- package/src/project.ts +5 -5
- package/src/query.ts +4 -0
- package/src/rate-limiter.ts +34 -0
- package/src/store/collections.ts +5 -2
- package/src/store/store.ts +36 -11
- package/src/store/workflow.ts +47 -7
- package/src/versions.ts +3 -0
- package/LICENSE +0 -13
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
}
|
package/src/access-control.ts
CHANGED
package/src/apikey.ts
CHANGED
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
|
+
|
package/src/interaction.ts
CHANGED
|
@@ -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
|
|
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; //
|
|
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
|
|
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
|
|
17
|
-
*
|
|
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
|
|
144
|
-
totalRunsInProgress
|
|
145
|
-
totalIndexableObjects
|
|
146
|
-
embeddingsModels
|
|
147
|
-
objectsWithEmbeddings
|
|
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[];
|
package/src/store/collections.ts
CHANGED
|
@@ -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
|
|
34
|
+
* The parent collections if any.
|
|
35
|
+
* A collection can have multiple parents.
|
|
35
36
|
*/
|
|
36
|
-
|
|
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
|
}
|
package/src/store/store.ts
CHANGED
|
@@ -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
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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:
|
|
80
|
+
type: ContentNature.Image;
|
|
73
81
|
dimensions?: Dimensions;
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
export interface AudioMetadata extends TemporalMediaMetadata {
|
|
77
|
-
type:
|
|
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:
|
|
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:
|
|
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 {
|
package/src/store/workflow.ts
CHANGED
|
@@ -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
|
-
*
|
|
82
|
+
* List of enabled processing queues. Managed by the application.
|
|
76
83
|
*/
|
|
77
|
-
|
|
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
|
-
*
|
|
94
|
+
* the API version to use if any
|
|
81
95
|
*/
|
|
82
|
-
|
|
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
|
-
|
|
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
|
+
}
|
package/src/versions.ts
ADDED
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.
|