donobu 2.12.2 → 2.13.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/dist/assets/generated/version +1 -1
- package/dist/envVars.d.ts +26 -1
- package/dist/envVars.d.ts.map +1 -1
- package/dist/envVars.js +26 -1
- package/dist/envVars.js.map +1 -1
- package/dist/esm/assets/generated/version +1 -1
- package/dist/esm/envVars.d.ts +26 -1
- package/dist/esm/envVars.d.ts.map +1 -1
- package/dist/esm/envVars.js +26 -1
- package/dist/esm/envVars.js.map +1 -1
- package/dist/esm/managers/CodeGenerator.d.ts +0 -5
- package/dist/esm/managers/CodeGenerator.d.ts.map +1 -1
- package/dist/esm/managers/CodeGenerator.js +4 -48
- package/dist/esm/managers/CodeGenerator.js.map +1 -1
- package/dist/esm/managers/DonobuFlowsManager.d.ts +13 -0
- package/dist/esm/managers/DonobuFlowsManager.d.ts.map +1 -1
- package/dist/esm/managers/DonobuFlowsManager.js +85 -14
- package/dist/esm/managers/DonobuFlowsManager.js.map +1 -1
- package/dist/esm/managers/TemplateInterpolator.d.ts +19 -0
- package/dist/esm/managers/TemplateInterpolator.d.ts.map +1 -0
- package/dist/esm/managers/TemplateInterpolator.js +86 -0
- package/dist/esm/managers/TemplateInterpolator.js.map +1 -0
- package/dist/esm/managers/ToolManager.d.ts +17 -1
- package/dist/esm/managers/ToolManager.d.ts.map +1 -1
- package/dist/esm/managers/ToolManager.js +53 -43
- package/dist/esm/managers/ToolManager.js.map +1 -1
- package/dist/esm/models/GptConfig.d.ts +2 -2
- package/dist/esm/models/GptConfig.d.ts.map +1 -1
- package/dist/esm/models/ResolverContext.d.ts +7 -0
- package/dist/esm/models/ResolverContext.d.ts.map +1 -0
- package/dist/esm/models/ResolverContext.js +3 -0
- package/dist/esm/models/ResolverContext.js.map +1 -0
- package/dist/esm/models/ToolCall.d.ts +4 -3
- package/dist/esm/models/ToolCall.d.ts.map +1 -1
- package/dist/esm/models/ToolTemplateDataSource.d.ts +36 -0
- package/dist/esm/models/ToolTemplateDataSource.d.ts.map +1 -0
- package/dist/esm/models/ToolTemplateDataSource.js +3 -0
- package/dist/esm/models/ToolTemplateDataSource.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.d.ts.map +1 -1
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js +2 -2
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js.map +1 -1
- package/dist/esm/playwrightTestExtensions.d.ts +15 -8
- package/dist/esm/playwrightTestExtensions.d.ts.map +1 -1
- package/dist/esm/playwrightTestExtensions.js +81 -37
- package/dist/esm/playwrightTestExtensions.js.map +1 -1
- package/dist/esm/utils/TemplateInterpolator.d.ts +29 -0
- package/dist/esm/utils/TemplateInterpolator.d.ts.map +1 -0
- package/dist/esm/utils/TemplateInterpolator.js +206 -0
- package/dist/esm/utils/TemplateInterpolator.js.map +1 -0
- package/dist/managers/CodeGenerator.d.ts +0 -5
- package/dist/managers/CodeGenerator.d.ts.map +1 -1
- package/dist/managers/CodeGenerator.js +4 -48
- package/dist/managers/CodeGenerator.js.map +1 -1
- package/dist/managers/DonobuFlowsManager.d.ts +13 -0
- package/dist/managers/DonobuFlowsManager.d.ts.map +1 -1
- package/dist/managers/DonobuFlowsManager.js +85 -14
- package/dist/managers/DonobuFlowsManager.js.map +1 -1
- package/dist/managers/TemplateInterpolator.d.ts +19 -0
- package/dist/managers/TemplateInterpolator.d.ts.map +1 -0
- package/dist/managers/TemplateInterpolator.js +86 -0
- package/dist/managers/TemplateInterpolator.js.map +1 -0
- package/dist/managers/ToolManager.d.ts +17 -1
- package/dist/managers/ToolManager.d.ts.map +1 -1
- package/dist/managers/ToolManager.js +53 -43
- package/dist/managers/ToolManager.js.map +1 -1
- package/dist/models/GptConfig.d.ts +2 -2
- package/dist/models/GptConfig.d.ts.map +1 -1
- package/dist/models/ResolverContext.d.ts +7 -0
- package/dist/models/ResolverContext.d.ts.map +1 -0
- package/dist/models/ResolverContext.js +3 -0
- package/dist/models/ResolverContext.js.map +1 -0
- package/dist/models/ToolCall.d.ts +4 -3
- package/dist/models/ToolCall.d.ts.map +1 -1
- package/dist/models/ToolTemplateDataSource.d.ts +36 -0
- package/dist/models/ToolTemplateDataSource.d.ts.map +1 -0
- package/dist/models/ToolTemplateDataSource.js +3 -0
- package/dist/models/ToolTemplateDataSource.js.map +1 -0
- package/dist/persistence/FlowsPersistenceFactoryImpl.d.ts.map +1 -1
- package/dist/persistence/FlowsPersistenceFactoryImpl.js +2 -2
- package/dist/persistence/FlowsPersistenceFactoryImpl.js.map +1 -1
- package/dist/playwrightTestExtensions.d.ts +15 -8
- package/dist/playwrightTestExtensions.d.ts.map +1 -1
- package/dist/playwrightTestExtensions.js +81 -37
- package/dist/playwrightTestExtensions.js.map +1 -1
- package/dist/utils/TemplateInterpolator.d.ts +29 -0
- package/dist/utils/TemplateInterpolator.d.ts.map +1 -0
- package/dist/utils/TemplateInterpolator.js +211 -0
- package/dist/utils/TemplateInterpolator.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1076
|
package/dist/envVars.d.ts
CHANGED
|
@@ -27,18 +27,33 @@ export declare const ENV_VAR_NAMES: {
|
|
|
27
27
|
* underlying models they map to (ex: "claude-3-7-sonnet-latest", etc).
|
|
28
28
|
*/
|
|
29
29
|
readonly ANTHROPIC_API_KEY: "ANTHROPIC_API_KEY";
|
|
30
|
+
/**
|
|
31
|
+
* If specified, this will shade the default flow runner agent when running
|
|
32
|
+
* flows. If specified, ANTHROPIC_API_KEY must also be specified.
|
|
33
|
+
*/
|
|
34
|
+
readonly ANTHROPIC_MODEL_NAME: "ANTHROPIC_MODEL_NAME";
|
|
30
35
|
/**
|
|
31
36
|
* Automatically create GPT configurations for Google Gemini using this API key.
|
|
32
37
|
* For convenience, the created configuration names will reflect the
|
|
33
38
|
* underlying models they map to (ex: "gemini-2.0-flash", etc).
|
|
34
39
|
*/
|
|
35
40
|
readonly GOOGLE_GENERATIVE_AI_API_KEY: "GOOGLE_GENERATIVE_AI_API_KEY";
|
|
41
|
+
/**
|
|
42
|
+
* If specified, this will shade the default flow runner agent when running
|
|
43
|
+
* flows. If specified, GOOGLE_GENERATIVE_AI_API_KEY must also be specified.
|
|
44
|
+
*/
|
|
45
|
+
readonly GOOGLE_GENERATIVE_AI_MODEL_NAME: "GOOGLE_GENERATIVE_AI_MODEL_NAME";
|
|
36
46
|
/**
|
|
37
47
|
* Automatically create GPT configurations for OpenAI using this API key.
|
|
38
48
|
* For convenience, the created configuration names will reflect the
|
|
39
49
|
* underlying models they map to (ex: "gpt-4o", etc).
|
|
40
50
|
*/
|
|
41
51
|
readonly OPENAI_API_KEY: "OPENAI_API_KEY";
|
|
52
|
+
/**
|
|
53
|
+
* If specified, this will shade the default flow runner agent when running
|
|
54
|
+
* flows. If specified, OPENAI_API_KEY must also be specified.
|
|
55
|
+
*/
|
|
56
|
+
readonly OPENAI_API_MODEL_NAME: "OPENAI_API_MODEL_NAME";
|
|
42
57
|
/**
|
|
43
58
|
* Automatically set the 'flow-runner' agent to use this GPT configuration by name.
|
|
44
59
|
*/
|
|
@@ -49,9 +64,19 @@ export declare const ENV_VAR_NAMES: {
|
|
|
49
64
|
*/
|
|
50
65
|
readonly AWS_S3_BUCKET: "AWS_S3_BUCKET";
|
|
51
66
|
/**
|
|
52
|
-
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in.
|
|
67
|
+
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in. Fails over to
|
|
68
|
+
* the AWS_REGION environment variable if not specified.
|
|
53
69
|
*/
|
|
54
70
|
readonly AWS_S3_REGION: "AWS_S3_REGION";
|
|
71
|
+
/**
|
|
72
|
+
* If specified, this will shade the default flow runner agent when running
|
|
73
|
+
* flows. If specified, AWS credentials must also be present.
|
|
74
|
+
*/
|
|
75
|
+
readonly AWS_BEDROCK_MODEL_NAME: "AWS_BEDROCK_MODEL_NAME";
|
|
76
|
+
/**
|
|
77
|
+
* The AWS region to use for operations using the AWS SDK.
|
|
78
|
+
*/
|
|
79
|
+
readonly AWS_REGION: "AWS_REGION";
|
|
55
80
|
/**
|
|
56
81
|
* The AWS access key ID to use for operations using the AWS SDK.
|
|
57
82
|
*/
|
package/dist/envVars.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVars.d.ts","sourceRoot":"","sources":["../src/envVars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;CAEK,CAAC"}
|
|
1
|
+
{"version":3,"file":"envVars.d.ts","sourceRoot":"","sources":["../src/envVars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;CAEK,CAAC"}
|
package/dist/envVars.js
CHANGED
|
@@ -30,18 +30,33 @@ exports.ENV_VAR_NAMES = {
|
|
|
30
30
|
* underlying models they map to (ex: "claude-3-7-sonnet-latest", etc).
|
|
31
31
|
*/
|
|
32
32
|
ANTHROPIC_API_KEY: 'ANTHROPIC_API_KEY',
|
|
33
|
+
/**
|
|
34
|
+
* If specified, this will shade the default flow runner agent when running
|
|
35
|
+
* flows. If specified, ANTHROPIC_API_KEY must also be specified.
|
|
36
|
+
*/
|
|
37
|
+
ANTHROPIC_MODEL_NAME: 'ANTHROPIC_MODEL_NAME',
|
|
33
38
|
/**
|
|
34
39
|
* Automatically create GPT configurations for Google Gemini using this API key.
|
|
35
40
|
* For convenience, the created configuration names will reflect the
|
|
36
41
|
* underlying models they map to (ex: "gemini-2.0-flash", etc).
|
|
37
42
|
*/
|
|
38
43
|
GOOGLE_GENERATIVE_AI_API_KEY: 'GOOGLE_GENERATIVE_AI_API_KEY',
|
|
44
|
+
/**
|
|
45
|
+
* If specified, this will shade the default flow runner agent when running
|
|
46
|
+
* flows. If specified, GOOGLE_GENERATIVE_AI_API_KEY must also be specified.
|
|
47
|
+
*/
|
|
48
|
+
GOOGLE_GENERATIVE_AI_MODEL_NAME: 'GOOGLE_GENERATIVE_AI_MODEL_NAME',
|
|
39
49
|
/**
|
|
40
50
|
* Automatically create GPT configurations for OpenAI using this API key.
|
|
41
51
|
* For convenience, the created configuration names will reflect the
|
|
42
52
|
* underlying models they map to (ex: "gpt-4o", etc).
|
|
43
53
|
*/
|
|
44
54
|
OPENAI_API_KEY: 'OPENAI_API_KEY',
|
|
55
|
+
/**
|
|
56
|
+
* If specified, this will shade the default flow runner agent when running
|
|
57
|
+
* flows. If specified, OPENAI_API_KEY must also be specified.
|
|
58
|
+
*/
|
|
59
|
+
OPENAI_API_MODEL_NAME: 'OPENAI_API_MODEL_NAME',
|
|
45
60
|
/**
|
|
46
61
|
* Automatically set the 'flow-runner' agent to use this GPT configuration by name.
|
|
47
62
|
*/
|
|
@@ -52,9 +67,19 @@ exports.ENV_VAR_NAMES = {
|
|
|
52
67
|
*/
|
|
53
68
|
AWS_S3_BUCKET: 'AWS_S3_BUCKET',
|
|
54
69
|
/**
|
|
55
|
-
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in.
|
|
70
|
+
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in. Fails over to
|
|
71
|
+
* the AWS_REGION environment variable if not specified.
|
|
56
72
|
*/
|
|
57
73
|
AWS_S3_REGION: 'AWS_S3_REGION',
|
|
74
|
+
/**
|
|
75
|
+
* If specified, this will shade the default flow runner agent when running
|
|
76
|
+
* flows. If specified, AWS credentials must also be present.
|
|
77
|
+
*/
|
|
78
|
+
AWS_BEDROCK_MODEL_NAME: 'AWS_BEDROCK_MODEL_NAME',
|
|
79
|
+
/**
|
|
80
|
+
* The AWS region to use for operations using the AWS SDK.
|
|
81
|
+
*/
|
|
82
|
+
AWS_REGION: 'AWS_REGION',
|
|
58
83
|
/**
|
|
59
84
|
* The AWS access key ID to use for operations using the AWS SDK.
|
|
60
85
|
*/
|
package/dist/envVars.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVars.js","sourceRoot":"","sources":["../src/envVars.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAC1C;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;;;;OAKG;IACH,6BAA6B,EAAE,+BAA+B;IAC9D;;;;OAIG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;;;OAIG;IACH,4BAA4B,EAAE,8BAA8B;IAC5D;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,mCAAmC,EAAE,qCAAqC;IAC1E;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"envVars.js","sourceRoot":"","sources":["../src/envVars.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAC1C;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;;;;OAKG;IACH,6BAA6B,EAAE,+BAA+B;IAC9D;;;;OAIG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;;OAGG;IACH,oBAAoB,EAAE,sBAAsB;IAC5C;;;;OAIG;IACH,4BAA4B,EAAE,8BAA8B;IAC5D;;;OAGG;IACH,+BAA+B,EAAE,iCAAiC;IAClE;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAChC;;;OAGG;IACH,qBAAqB,EAAE,uBAAuB;IAC9C;;OAEG;IACH,mCAAmC,EAAE,qCAAqC;IAC1E;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B;;;OAGG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;IAC9C;;;OAGG;IACH,2BAA2B,EAAE,6BAA6B;IAC1D;;;;;;OAMG;IACH,uBAAuB,EAAE,yBAAyB;IAClD;;;OAGG;IACH,uBAAuB,EAAE,yBAAyB;CAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1076
|
package/dist/esm/envVars.d.ts
CHANGED
|
@@ -27,18 +27,33 @@ export declare const ENV_VAR_NAMES: {
|
|
|
27
27
|
* underlying models they map to (ex: "claude-3-7-sonnet-latest", etc).
|
|
28
28
|
*/
|
|
29
29
|
readonly ANTHROPIC_API_KEY: "ANTHROPIC_API_KEY";
|
|
30
|
+
/**
|
|
31
|
+
* If specified, this will shade the default flow runner agent when running
|
|
32
|
+
* flows. If specified, ANTHROPIC_API_KEY must also be specified.
|
|
33
|
+
*/
|
|
34
|
+
readonly ANTHROPIC_MODEL_NAME: "ANTHROPIC_MODEL_NAME";
|
|
30
35
|
/**
|
|
31
36
|
* Automatically create GPT configurations for Google Gemini using this API key.
|
|
32
37
|
* For convenience, the created configuration names will reflect the
|
|
33
38
|
* underlying models they map to (ex: "gemini-2.0-flash", etc).
|
|
34
39
|
*/
|
|
35
40
|
readonly GOOGLE_GENERATIVE_AI_API_KEY: "GOOGLE_GENERATIVE_AI_API_KEY";
|
|
41
|
+
/**
|
|
42
|
+
* If specified, this will shade the default flow runner agent when running
|
|
43
|
+
* flows. If specified, GOOGLE_GENERATIVE_AI_API_KEY must also be specified.
|
|
44
|
+
*/
|
|
45
|
+
readonly GOOGLE_GENERATIVE_AI_MODEL_NAME: "GOOGLE_GENERATIVE_AI_MODEL_NAME";
|
|
36
46
|
/**
|
|
37
47
|
* Automatically create GPT configurations for OpenAI using this API key.
|
|
38
48
|
* For convenience, the created configuration names will reflect the
|
|
39
49
|
* underlying models they map to (ex: "gpt-4o", etc).
|
|
40
50
|
*/
|
|
41
51
|
readonly OPENAI_API_KEY: "OPENAI_API_KEY";
|
|
52
|
+
/**
|
|
53
|
+
* If specified, this will shade the default flow runner agent when running
|
|
54
|
+
* flows. If specified, OPENAI_API_KEY must also be specified.
|
|
55
|
+
*/
|
|
56
|
+
readonly OPENAI_API_MODEL_NAME: "OPENAI_API_MODEL_NAME";
|
|
42
57
|
/**
|
|
43
58
|
* Automatically set the 'flow-runner' agent to use this GPT configuration by name.
|
|
44
59
|
*/
|
|
@@ -49,9 +64,19 @@ export declare const ENV_VAR_NAMES: {
|
|
|
49
64
|
*/
|
|
50
65
|
readonly AWS_S3_BUCKET: "AWS_S3_BUCKET";
|
|
51
66
|
/**
|
|
52
|
-
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in.
|
|
67
|
+
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in. Fails over to
|
|
68
|
+
* the AWS_REGION environment variable if not specified.
|
|
53
69
|
*/
|
|
54
70
|
readonly AWS_S3_REGION: "AWS_S3_REGION";
|
|
71
|
+
/**
|
|
72
|
+
* If specified, this will shade the default flow runner agent when running
|
|
73
|
+
* flows. If specified, AWS credentials must also be present.
|
|
74
|
+
*/
|
|
75
|
+
readonly AWS_BEDROCK_MODEL_NAME: "AWS_BEDROCK_MODEL_NAME";
|
|
76
|
+
/**
|
|
77
|
+
* The AWS region to use for operations using the AWS SDK.
|
|
78
|
+
*/
|
|
79
|
+
readonly AWS_REGION: "AWS_REGION";
|
|
55
80
|
/**
|
|
56
81
|
* The AWS access key ID to use for operations using the AWS SDK.
|
|
57
82
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVars.d.ts","sourceRoot":"","sources":["../../src/envVars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;CAEK,CAAC"}
|
|
1
|
+
{"version":3,"file":"envVars.d.ts","sourceRoot":"","sources":["../../src/envVars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;CAEK,CAAC"}
|
package/dist/esm/envVars.js
CHANGED
|
@@ -30,18 +30,33 @@ exports.ENV_VAR_NAMES = {
|
|
|
30
30
|
* underlying models they map to (ex: "claude-3-7-sonnet-latest", etc).
|
|
31
31
|
*/
|
|
32
32
|
ANTHROPIC_API_KEY: 'ANTHROPIC_API_KEY',
|
|
33
|
+
/**
|
|
34
|
+
* If specified, this will shade the default flow runner agent when running
|
|
35
|
+
* flows. If specified, ANTHROPIC_API_KEY must also be specified.
|
|
36
|
+
*/
|
|
37
|
+
ANTHROPIC_MODEL_NAME: 'ANTHROPIC_MODEL_NAME',
|
|
33
38
|
/**
|
|
34
39
|
* Automatically create GPT configurations for Google Gemini using this API key.
|
|
35
40
|
* For convenience, the created configuration names will reflect the
|
|
36
41
|
* underlying models they map to (ex: "gemini-2.0-flash", etc).
|
|
37
42
|
*/
|
|
38
43
|
GOOGLE_GENERATIVE_AI_API_KEY: 'GOOGLE_GENERATIVE_AI_API_KEY',
|
|
44
|
+
/**
|
|
45
|
+
* If specified, this will shade the default flow runner agent when running
|
|
46
|
+
* flows. If specified, GOOGLE_GENERATIVE_AI_API_KEY must also be specified.
|
|
47
|
+
*/
|
|
48
|
+
GOOGLE_GENERATIVE_AI_MODEL_NAME: 'GOOGLE_GENERATIVE_AI_MODEL_NAME',
|
|
39
49
|
/**
|
|
40
50
|
* Automatically create GPT configurations for OpenAI using this API key.
|
|
41
51
|
* For convenience, the created configuration names will reflect the
|
|
42
52
|
* underlying models they map to (ex: "gpt-4o", etc).
|
|
43
53
|
*/
|
|
44
54
|
OPENAI_API_KEY: 'OPENAI_API_KEY',
|
|
55
|
+
/**
|
|
56
|
+
* If specified, this will shade the default flow runner agent when running
|
|
57
|
+
* flows. If specified, OPENAI_API_KEY must also be specified.
|
|
58
|
+
*/
|
|
59
|
+
OPENAI_API_MODEL_NAME: 'OPENAI_API_MODEL_NAME',
|
|
45
60
|
/**
|
|
46
61
|
* Automatically set the 'flow-runner' agent to use this GPT configuration by name.
|
|
47
62
|
*/
|
|
@@ -52,9 +67,19 @@ exports.ENV_VAR_NAMES = {
|
|
|
52
67
|
*/
|
|
53
68
|
AWS_S3_BUCKET: 'AWS_S3_BUCKET',
|
|
54
69
|
/**
|
|
55
|
-
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in.
|
|
70
|
+
* The AWS S3 region the corresponding AWS_S3_BUCKET lives in. Fails over to
|
|
71
|
+
* the AWS_REGION environment variable if not specified.
|
|
56
72
|
*/
|
|
57
73
|
AWS_S3_REGION: 'AWS_S3_REGION',
|
|
74
|
+
/**
|
|
75
|
+
* If specified, this will shade the default flow runner agent when running
|
|
76
|
+
* flows. If specified, AWS credentials must also be present.
|
|
77
|
+
*/
|
|
78
|
+
AWS_BEDROCK_MODEL_NAME: 'AWS_BEDROCK_MODEL_NAME',
|
|
79
|
+
/**
|
|
80
|
+
* The AWS region to use for operations using the AWS SDK.
|
|
81
|
+
*/
|
|
82
|
+
AWS_REGION: 'AWS_REGION',
|
|
58
83
|
/**
|
|
59
84
|
* The AWS access key ID to use for operations using the AWS SDK.
|
|
60
85
|
*/
|
package/dist/esm/envVars.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envVars.js","sourceRoot":"","sources":["../../src/envVars.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAC1C;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;;;;OAKG;IACH,6BAA6B,EAAE,+BAA+B;IAC9D;;;;OAIG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;;;OAIG;IACH,4BAA4B,EAAE,8BAA8B;IAC5D;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,mCAAmC,EAAE,qCAAqC;IAC1E;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"envVars.js","sourceRoot":"","sources":["../../src/envVars.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IACpC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAC1C;;OAEG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;;;;OAKG;IACH,6BAA6B,EAAE,+BAA+B;IAC9D;;;;OAIG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;;OAGG;IACH,oBAAoB,EAAE,sBAAsB;IAC5C;;;;OAIG;IACH,4BAA4B,EAAE,8BAA8B;IAC5D;;;OAGG;IACH,+BAA+B,EAAE,iCAAiC;IAClE;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAChC;;;OAGG;IACH,qBAAqB,EAAE,uBAAuB;IAC9C;;OAEG;IACH,mCAAmC,EAAE,qCAAqC;IAC1E;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B;;;OAGG;IACH,aAAa,EAAE,eAAe;IAC9B;;;OAGG;IACH,sBAAsB,EAAE,wBAAwB;IAChD;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IACtC;;OAEG;IACH,qBAAqB,EAAE,uBAAuB;IAC9C;;;OAGG;IACH,2BAA2B,EAAE,6BAA6B;IAC1D;;;;;;OAMG;IACH,uBAAuB,EAAE,yBAAyB;IAClD;;;OAGG;IACH,uBAAuB,EAAE,yBAAyB;CAC1C,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { FlowMetadata } from '../models/FlowMetadata';
|
|
2
2
|
import { ProposedToolCall } from '../models/ProposedToolCall';
|
|
3
|
-
import { AgentsManager } from './AgentsManager';
|
|
4
|
-
import { GptConfigsManager } from './GptConfigsManager';
|
|
5
3
|
export declare class CodeGenerator {
|
|
6
|
-
private readonly gptConfigsManager;
|
|
7
|
-
private readonly agentsManager;
|
|
8
|
-
constructor(gptConfigsManager: GptConfigsManager, agentsManager: AgentsManager);
|
|
9
4
|
/** Creates a Node.js Microsoft Playwright script to replay the given flow. */
|
|
10
5
|
getFlowAsPlaywrightScript(flowMetadata: FlowMetadata, toolCalls: ProposedToolCall<any>[]): Promise<string>;
|
|
11
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeGenerator.d.ts","sourceRoot":"","sources":["../../../src/managers/CodeGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeGenerator.d.ts","sourceRoot":"","sources":["../../../src/managers/CodeGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAyB9D,qBAAa,aAAa;IACxB,8EAA8E;IACjE,yBAAyB,CACpC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,GACjC,OAAO,CAAC,MAAM,CAAC;IA0FlB;;;OAGG;WACW,uCAAuC,CACnD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GACtC,MAAM;YAmEK,YAAY;IAY1B;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;CASnC"}
|
|
@@ -25,10 +25,6 @@ const WaitTool_1 = require("../tools/WaitTool");
|
|
|
25
25
|
const JsonUtils_1 = require("../utils/JsonUtils");
|
|
26
26
|
const ToolManager_1 = require("./ToolManager");
|
|
27
27
|
class CodeGenerator {
|
|
28
|
-
constructor(gptConfigsManager, agentsManager) {
|
|
29
|
-
this.gptConfigsManager = gptConfigsManager;
|
|
30
|
-
this.agentsManager = agentsManager;
|
|
31
|
-
}
|
|
32
28
|
/** Creates a Node.js Microsoft Playwright script to replay the given flow. */
|
|
33
29
|
async getFlowAsPlaywrightScript(flowMetadata, toolCalls) {
|
|
34
30
|
// These tools are not supported in the generated script because they have
|
|
@@ -51,38 +47,11 @@ class CodeGenerator {
|
|
|
51
47
|
.filter((tool) => {
|
|
52
48
|
return tool?.requiresGpt;
|
|
53
49
|
}).length > 0;
|
|
54
|
-
let gptConfig = null;
|
|
55
|
-
// Check if the flow metadata has a specific GPT config name.
|
|
56
|
-
// If it does, try to get it from the GptConfigsManager.
|
|
57
|
-
// If it doesn't, try to get the default GPT config from the AgentsManager.
|
|
58
|
-
//
|
|
59
|
-
// This is done so that we can generate code using the preferred GPT client.
|
|
60
|
-
if (isGptClientRequired) {
|
|
61
|
-
try {
|
|
62
|
-
if (flowMetadata.gptConfigName) {
|
|
63
|
-
gptConfig = await this.gptConfigsManager.get(flowMetadata.gptConfigName);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (_error) {
|
|
67
|
-
// This is expected if the config does not exist.
|
|
68
|
-
}
|
|
69
|
-
if (!gptConfig) {
|
|
70
|
-
const gptConfigName = await this.agentsManager.get('flow-runner');
|
|
71
|
-
if (gptConfigName) {
|
|
72
|
-
try {
|
|
73
|
-
gptConfig = await this.gptConfigsManager.get(gptConfigName);
|
|
74
|
-
}
|
|
75
|
-
catch (_error) {
|
|
76
|
-
// This is expected if the config does not exist.
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
50
|
const gptSetupNote = isGptClientRequired
|
|
82
51
|
? ` *
|
|
83
52
|
* Also, since this test is using tools that require the usage of an LLM, be
|
|
84
53
|
* sure to have an appropriate LLM API key available as an environment variable
|
|
85
|
-
* (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY,
|
|
54
|
+
* (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_GENERATIVE_AI_API_KEY).
|
|
86
55
|
`
|
|
87
56
|
: ' ';
|
|
88
57
|
const hasObjective = (flowMetadata.overallObjective?.trim().length ?? 0) > 0;
|
|
@@ -108,22 +77,9 @@ class CodeGenerator {
|
|
|
108
77
|
const useStorageState = flowMetadata.browser && flowMetadata.browser.initialState
|
|
109
78
|
? `storageState: getBrowserStorageStateFixture(${JSON.stringify(flowMetadata.browser.initialState, null, 2)}),`
|
|
110
79
|
: undefined;
|
|
111
|
-
let useGptClientImport = undefined;
|
|
112
|
-
let useGptClient = undefined;
|
|
113
|
-
if (isGptClientRequired) {
|
|
114
|
-
if (gptConfig && gptConfig.type === 'ANTHROPIC_AWS_BEDROCK') {
|
|
115
|
-
useGptClientImport =
|
|
116
|
-
"import { anthropicAwsBedrockClientFixture } from 'donobu';";
|
|
117
|
-
useGptClient = `gptClient: anthropicAwsBedrockClientFixture('${gptConfig.modelName}', '${gptConfig.region}'),`;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
useGptClientImport = "import { gptClientFixture } from 'donobu';";
|
|
121
|
-
useGptClient = `gptClient: gptClientFixture(),`;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
80
|
let testExtension = '';
|
|
125
|
-
if (useStorageState
|
|
126
|
-
testExtension = `.extend({${useStorageState
|
|
81
|
+
if (useStorageState) {
|
|
82
|
+
testExtension = `.extend({${useStorageState}})`;
|
|
127
83
|
}
|
|
128
84
|
const scriptedToolCalls = toolCalls
|
|
129
85
|
.filter((toolCall) => !unsupportedToolsByName.has(toolCall.name))
|
|
@@ -143,7 +99,7 @@ testInfo.attach('extracted-object', { body: JSON.stringify(extractedObject), con
|
|
|
143
99
|
* Also, be sure that Playwright's browsers are installed...
|
|
144
100
|
* 'npx playwright install'
|
|
145
101
|
${gptSetupNote}*/
|
|
146
|
-
import { test } from 'donobu';${
|
|
102
|
+
import { test } from 'donobu';${useStorageState ? "\nimport { getBrowserStorageStateFixture } from 'donobu';" : ''}
|
|
147
103
|
|
|
148
104
|
const testTitle = '${testName}';
|
|
149
105
|
const testDetails = ${testDetails};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeGenerator.js","sourceRoot":"","sources":["../../../src/managers/CodeGenerator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CodeGenerator.js","sourceRoot":"","sources":["../../../src/managers/CodeGenerator.ts"],"names":[],"mappings":";;;AAEA,sEAAmE;AACnE,oEAAiE;AACjE,oDAA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B,yDAAyD;aACxD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAC3B,CAAC;IACJ,CAAC;CACF;AApMD,sCAoMC"}
|
|
@@ -106,8 +106,21 @@ export declare class DonobuFlowsManager {
|
|
|
106
106
|
private validateFlowParams;
|
|
107
107
|
private setupAllowedTools;
|
|
108
108
|
private prepareInitialToolCalls;
|
|
109
|
+
/**
|
|
110
|
+
* This method creates a temporary directory for the flow with the given ID,
|
|
111
|
+
* returning the path to the directory.
|
|
112
|
+
*/
|
|
109
113
|
private createTempDirectoryForFlow;
|
|
114
|
+
/**
|
|
115
|
+
* Searches the given directory for the largest video file and sets it as the
|
|
116
|
+
* flow's video. This should be called after the flow has completed.
|
|
117
|
+
*/
|
|
118
|
+
private setFlowVideo;
|
|
110
119
|
private runFlow;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the largest video file in the given directory, or null if no
|
|
122
|
+
* video files are found.
|
|
123
|
+
*/
|
|
111
124
|
private findLargestVideo;
|
|
112
125
|
private isLocallyRunning;
|
|
113
126
|
private checkIfAnyToolsRequireGpt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonobuFlowsManager.d.ts","sourceRoot":"","sources":["../../../src/managers/DonobuFlowsManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAuB,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAEL,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAUzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,q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= require("../models/DonobuDeploymentEnviron
|
|
|
63
63
|
const Logger_1 = require("../utils/Logger");
|
|
64
64
|
const CodeGenerator_1 = require("./CodeGenerator");
|
|
65
65
|
const uuid_1 = require("uuid");
|
|
66
|
+
const envVars_1 = require("../envVars");
|
|
66
67
|
class DonobuFlowsManager {
|
|
67
68
|
constructor(deploymentEnvironment, gptConfigsManager, agentsManager, flowsPersistenceFactory) {
|
|
68
69
|
this.deploymentEnvironment = deploymentEnvironment;
|
|
@@ -70,7 +71,7 @@ class DonobuFlowsManager {
|
|
|
70
71
|
this.agentsManager = agentsManager;
|
|
71
72
|
this.flowsPersistenceFactory = flowsPersistenceFactory;
|
|
72
73
|
this.activeFlows = new Map();
|
|
73
|
-
this.codeGenerator = new CodeGenerator_1.CodeGenerator(
|
|
74
|
+
this.codeGenerator = new CodeGenerator_1.CodeGenerator();
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
76
77
|
* Create a flow with the given parameters and invoke its `DonobuFlow#run`
|
|
@@ -132,18 +133,18 @@ class DonobuFlowsManager {
|
|
|
132
133
|
state: 'UNSTARTED',
|
|
133
134
|
nextState: null,
|
|
134
135
|
};
|
|
135
|
-
const
|
|
136
|
+
const flowTempDir = this.createTempDirectoryForFlow(flowMetadata.id);
|
|
136
137
|
const flowsPersistence = await this.flowsPersistenceFactory.createPersistenceLayer();
|
|
137
138
|
const browserStorageState = flowParams.browser?.initialState
|
|
138
139
|
? await this.getBrowserStorageState(flowParams.browser.initialState)
|
|
139
140
|
: undefined;
|
|
140
|
-
const browserFramework = await BrowserFramework_1.BrowserFramework.create(browserConfig,
|
|
141
|
+
const browserFramework = await BrowserFramework_1.BrowserFramework.create(browserConfig, flowTempDir, browserStorageState);
|
|
141
142
|
try {
|
|
142
143
|
const donobuFlow = new DonobuFlow_1.DonobuFlow(this, browserFramework, flowsPersistence, gptClientData.gptClient, toolManager, tooltipper, toolCallsOnStart, [], [], {
|
|
143
144
|
current: null,
|
|
144
145
|
}, flowMetadata);
|
|
145
146
|
await flowsPersistence.saveMetadata(flowMetadata);
|
|
146
|
-
const job = this.runFlow(donobuFlow,
|
|
147
|
+
const job = this.runFlow(donobuFlow, flowTempDir, flowsPersistence);
|
|
147
148
|
const flowHandle = { donobuFlow, job };
|
|
148
149
|
this.activeFlows.set(flowMetadata.id, flowHandle);
|
|
149
150
|
return flowHandle;
|
|
@@ -424,6 +425,51 @@ class DonobuFlowsManager {
|
|
|
424
425
|
Logger_1.appLogger.warn(`Failed to find GPT configuration: ${gptConfigName}, will default to the 'flow-runner' agent config (if it exists).`);
|
|
425
426
|
}
|
|
426
427
|
}
|
|
428
|
+
let gptConfigFromEnv = null;
|
|
429
|
+
if (process.env[envVars_1.ENV_VAR_NAMES.AWS_BEDROCK_MODEL_NAME]) {
|
|
430
|
+
gptConfigFromEnv = {
|
|
431
|
+
type: 'ANTHROPIC_AWS_BEDROCK',
|
|
432
|
+
modelName: process.env[envVars_1.ENV_VAR_NAMES.AWS_BEDROCK_MODEL_NAME],
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
else if (process.env[envVars_1.ENV_VAR_NAMES.ANTHROPIC_MODEL_NAME]) {
|
|
436
|
+
if (!process.env[envVars_1.ENV_VAR_NAMES.ANTHROPIC_API_KEY]) {
|
|
437
|
+
throw new InvalidParamValueException_1.InvalidParamValueException(envVars_1.ENV_VAR_NAMES.ANTHROPIC_API_KEY, undefined, `the ${envVars_1.ENV_VAR_NAMES.ANTHROPIC_MODEL_NAME} environment variable is set but the ${envVars_1.ENV_VAR_NAMES.ANTHROPIC_API_KEY} is not`);
|
|
438
|
+
}
|
|
439
|
+
gptConfigFromEnv = {
|
|
440
|
+
type: 'ANTHROPIC',
|
|
441
|
+
modelName: process.env[envVars_1.ENV_VAR_NAMES.ANTHROPIC_MODEL_NAME],
|
|
442
|
+
apiKey: process.env[envVars_1.ENV_VAR_NAMES.ANTHROPIC_API_KEY],
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
else if (process.env[envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_MODEL_NAME]) {
|
|
446
|
+
if (!process.env[envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_API_KEY]) {
|
|
447
|
+
throw new InvalidParamValueException_1.InvalidParamValueException(envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_API_KEY, undefined, `the ${envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_MODEL_NAME} environment variable is set but the ${envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_API_KEY} is not`);
|
|
448
|
+
}
|
|
449
|
+
gptConfigFromEnv = {
|
|
450
|
+
type: 'GOOGLE_GEMINI',
|
|
451
|
+
modelName: process.env[envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_MODEL_NAME],
|
|
452
|
+
apiKey: process.env[envVars_1.ENV_VAR_NAMES.GOOGLE_GENERATIVE_AI_API_KEY],
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
else if (process.env[envVars_1.ENV_VAR_NAMES.OPENAI_API_MODEL_NAME]) {
|
|
456
|
+
if (!process.env[envVars_1.ENV_VAR_NAMES.OPENAI_API_KEY]) {
|
|
457
|
+
throw new InvalidParamValueException_1.InvalidParamValueException(envVars_1.ENV_VAR_NAMES.OPENAI_API_KEY, undefined, `the ${envVars_1.ENV_VAR_NAMES.OPENAI_API_MODEL_NAME} environment variable is set but the ${envVars_1.ENV_VAR_NAMES.OPENAI_API_KEY} is not`);
|
|
458
|
+
}
|
|
459
|
+
gptConfigFromEnv = {
|
|
460
|
+
type: 'OPENAI',
|
|
461
|
+
modelName: process.env[envVars_1.ENV_VAR_NAMES.OPENAI_API_MODEL_NAME],
|
|
462
|
+
apiKey: process.env[envVars_1.ENV_VAR_NAMES.OPENAI_API_KEY],
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
if (gptConfigFromEnv) {
|
|
466
|
+
const gptClient = await GptClientFactory_1.GptClientFactory.createFromGptConfig(gptConfigFromEnv);
|
|
467
|
+
return {
|
|
468
|
+
gptConfigName: null,
|
|
469
|
+
agentName: null,
|
|
470
|
+
gptClient: gptClient,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
427
473
|
const defaultGptConfigName = await this.agentsManager.get('flow-runner');
|
|
428
474
|
if (!defaultGptConfigName) {
|
|
429
475
|
return {
|
|
@@ -432,8 +478,8 @@ class DonobuFlowsManager {
|
|
|
432
478
|
gptClient: null,
|
|
433
479
|
};
|
|
434
480
|
}
|
|
435
|
-
const
|
|
436
|
-
const gptClient = await GptClientFactory_1.GptClientFactory.createFromGptConfig(
|
|
481
|
+
const defaultGptConfig = await this.gptConfigsManager.get(defaultGptConfigName);
|
|
482
|
+
const gptClient = await GptClientFactory_1.GptClientFactory.createFromGptConfig(defaultGptConfig);
|
|
437
483
|
return {
|
|
438
484
|
gptConfigName: defaultGptConfigName,
|
|
439
485
|
agentName: 'flow-runner',
|
|
@@ -561,25 +607,50 @@ class DonobuFlowsManager {
|
|
|
561
607
|
return [];
|
|
562
608
|
}
|
|
563
609
|
}
|
|
610
|
+
/**
|
|
611
|
+
* This method creates a temporary directory for the flow with the given ID,
|
|
612
|
+
* returning the path to the directory.
|
|
613
|
+
*/
|
|
564
614
|
createTempDirectoryForFlow(flowId) {
|
|
565
615
|
const tempDir = path.join((0, os_1.tmpdir)(), flowId);
|
|
566
616
|
fs.mkdirSync(tempDir);
|
|
567
617
|
return tempDir;
|
|
568
618
|
}
|
|
569
|
-
|
|
619
|
+
/**
|
|
620
|
+
* Searches the given directory for the largest video file and sets it as the
|
|
621
|
+
* flow's video. This should be called after the flow has completed.
|
|
622
|
+
*/
|
|
623
|
+
async setFlowVideo(flowId, flowTempDir, flowsPersistence) {
|
|
624
|
+
const videoPath = this.findLargestVideo(flowTempDir);
|
|
625
|
+
if (videoPath) {
|
|
626
|
+
const videoBytes = fs.readFileSync(videoPath);
|
|
627
|
+
await flowsPersistence.setVideo(flowId, videoBytes);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
async runFlow(donobuFlow, flowTempDir, flowsPersistence) {
|
|
570
631
|
try {
|
|
571
632
|
await donobuFlow.run();
|
|
572
|
-
this.
|
|
573
|
-
const videoPath = this.findLargestVideo(tempDirectoryForVideos);
|
|
574
|
-
if (videoPath) {
|
|
575
|
-
const videoBytes = fs.readFileSync(videoPath);
|
|
576
|
-
await flowsPersistence.setVideo(donobuFlow.metadata.id, videoBytes);
|
|
577
|
-
}
|
|
633
|
+
await this.setFlowVideo(donobuFlow.metadata.id, flowTempDir, flowsPersistence);
|
|
578
634
|
}
|
|
579
635
|
finally {
|
|
580
|
-
|
|
636
|
+
try {
|
|
637
|
+
this.activeFlows.delete(donobuFlow.metadata.id);
|
|
638
|
+
}
|
|
639
|
+
catch (error) {
|
|
640
|
+
Logger_1.appLogger.error('Failed to delete active flow:', error);
|
|
641
|
+
}
|
|
642
|
+
try {
|
|
643
|
+
fs.rmSync(flowTempDir, { recursive: true, force: true });
|
|
644
|
+
}
|
|
645
|
+
catch (error) {
|
|
646
|
+
Logger_1.appLogger.error('Failed to remove temporary directory:', error);
|
|
647
|
+
}
|
|
581
648
|
}
|
|
582
649
|
}
|
|
650
|
+
/**
|
|
651
|
+
* Returns the largest video file in the given directory, or null if no
|
|
652
|
+
* video files are found.
|
|
653
|
+
*/
|
|
583
654
|
findLargestVideo(directory) {
|
|
584
655
|
const files = fs
|
|
585
656
|
.readdirSync(directory)
|