@picoflow/core 1.0.10 → 1.0.12
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/clients/http-client.js +1 -1
- package/clients/self-client.js +1 -1
- package/configs/core-config.js +1 -1
- package/decorators/stop-tool.js +1 -1
- package/flow/content-type.js +1 -1
- package/flow/end-step.js +1 -1
- package/flow/flow-creator.js +1 -1
- package/flow/flow-types.d.ts +33 -26
- package/flow/flow-types.js +1 -1
- package/flow/flow.d.ts +10 -3
- package/flow/flow.js +1 -1
- package/flow/llm-runner.js +1 -1
- package/flow/logic-runner.js +1 -1
- package/flow/logic-step.js +1 -1
- package/flow/memory.js +1 -1
- package/flow/step.d.ts +9 -5
- package/flow/step.js +1 -1
- package/index.js +45 -26
- package/models/default-models.d.ts +2 -0
- package/models/default-models.js +1 -0
- package/models/model-registry.d.ts +66 -0
- package/models/model-registry.js +1 -0
- package/package.json +1 -1
- package/prompt/flow-prompt.js +1 -1
- package/prompt/prompt-util.js +1 -1
- package/services/flow-engine.d.ts +5 -23
- package/services/flow-engine.js +1 -1
- package/session/cosmo-session.js +1 -1
- package/session/file-session.js +1 -1
- package/session/flow-session.js +1 -1
- package/session/mongo-session.js +1 -1
- package/session/session-adaptor.js +1 -1
- package/session/session-logger.js +1 -1
- package/utils/constants.js +1 -1
- package/utils/environ.js +1 -1
- package/utils/errors.js +1 -1
- package/utils/license-util.js +1 -1
- package/utils/llm-file.d.ts +4 -0
- package/utils/llm-file.js +1 -1
- package/utils/logic.js +1 -1
- package/utils/message-util.d.ts +3 -0
- package/utils/message-util.js +1 -1
- package/utils/retry.js +1 -1
- package/utils/string-util.js +1 -1
- package/utils/tool-util.js +1 -1
- package/utils/verify-license.js +1 -1
package/index.js
CHANGED
|
@@ -1,47 +1,66 @@
|
|
|
1
1
|
// PicoFlow - Main exports
|
|
2
2
|
"use strict";
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
const load = (relativePath) => {
|
|
6
|
+
const candidates = [
|
|
7
|
+
path.join(__dirname, relativePath),
|
|
8
|
+
path.join(__dirname, "../dist/picoflow", relativePath),
|
|
9
|
+
];
|
|
10
|
+
for (const candidate of candidates) {
|
|
11
|
+
try {
|
|
12
|
+
// eslint-disable-next-line import/no-dynamic-require, global-require
|
|
13
|
+
return require(candidate);
|
|
14
|
+
} catch (err) {
|
|
15
|
+
if (err.code !== "MODULE_NOT_FOUND") {
|
|
16
|
+
throw err;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const tried = candidates.join(", ");
|
|
21
|
+
throw new Error(`picoflow.index could not load '${relativePath}'. Tried: ${tried}`);
|
|
22
|
+
};
|
|
3
23
|
|
|
4
24
|
// Flow
|
|
5
|
-
module.exports.Flow =
|
|
6
|
-
module.exports.Step =
|
|
7
|
-
module.exports.LogicStep =
|
|
8
|
-
module.exports.EndStep =
|
|
9
|
-
module.exports.Memory =
|
|
10
|
-
module.exports.FlowCreator =
|
|
11
|
-
module.exports.HttpContentType =
|
|
25
|
+
module.exports.Flow = load("flow/flow").Flow;
|
|
26
|
+
module.exports.Step = load("flow/step").Step;
|
|
27
|
+
module.exports.LogicStep = load("flow/logic-step").LogicStep;
|
|
28
|
+
module.exports.EndStep = load("flow/end-step").EndStep;
|
|
29
|
+
module.exports.Memory = load("flow/memory").Memory;
|
|
30
|
+
module.exports.FlowCreator = load("flow/flow-creator").FlowCreator;
|
|
31
|
+
module.exports.HttpContentType = load("flow/content-type").HttpContentType;
|
|
12
32
|
|
|
13
33
|
// Flow Types
|
|
14
|
-
const flowTypes =
|
|
34
|
+
const flowTypes = load("flow/flow-types");
|
|
15
35
|
module.exports.ToolResponseType = flowTypes.ToolResponseType;
|
|
16
36
|
|
|
17
37
|
// Services
|
|
18
|
-
module.exports.FlowEngine =
|
|
38
|
+
module.exports.FlowEngine = load("services/flow-engine").FlowEngine;
|
|
19
39
|
|
|
20
40
|
// Session
|
|
21
|
-
module.exports.FlowSession =
|
|
22
|
-
module.exports.SessionLogger =
|
|
23
|
-
module.exports.FileSession =
|
|
24
|
-
module.exports.MongoSession =
|
|
25
|
-
module.exports.CosmoSession =
|
|
41
|
+
module.exports.FlowSession = load("session/flow-session").FlowSession;
|
|
42
|
+
module.exports.SessionLogger = load("session/session-logger").SessionLogger;
|
|
43
|
+
module.exports.FileSession = load("session/file-session").FileSession;
|
|
44
|
+
module.exports.MongoSession = load("session/mongo-session").MongoSession;
|
|
45
|
+
module.exports.CosmoSession = load("session/cosmo-session").CosmoSession;
|
|
26
46
|
|
|
27
47
|
// Configs
|
|
28
|
-
module.exports.CoreConfig =
|
|
48
|
+
module.exports.CoreConfig = load("configs/core-config").CoreConfig;
|
|
29
49
|
|
|
30
50
|
// Utils
|
|
31
|
-
module.exports.MessageUtil =
|
|
32
|
-
module.exports.ToolUtil =
|
|
33
|
-
module.exports.StringUtil =
|
|
34
|
-
module.exports.Environ =
|
|
35
|
-
module.exports.LlmFile =
|
|
36
|
-
module.exports.K =
|
|
51
|
+
module.exports.MessageUtil = load("utils/message-util").MessageUtil;
|
|
52
|
+
module.exports.ToolUtil = load("utils/tool-util").ToolUtil;
|
|
53
|
+
module.exports.StringUtil = load("utils/string-util").StringUtil;
|
|
54
|
+
module.exports.Environ = load("utils/environ").Environ;
|
|
55
|
+
module.exports.LlmFile = load("utils/llm-file").LlmFile;
|
|
56
|
+
module.exports.K = load("utils/constants").K;
|
|
37
57
|
|
|
38
58
|
// Prompt
|
|
39
|
-
module.exports.Prompt =
|
|
40
|
-
module.exports.FlowPrompt =
|
|
59
|
+
module.exports.Prompt = load("prompt/prompt-util").Prompt;
|
|
60
|
+
module.exports.FlowPrompt = load("prompt/flow-prompt").FlowPrompt;
|
|
41
61
|
|
|
42
62
|
// Decorators
|
|
43
|
-
module.exports.StopTool =
|
|
63
|
+
module.exports.StopTool = load("decorators/stop-tool").StopTool;
|
|
44
64
|
|
|
45
65
|
// Clients
|
|
46
|
-
module.exports.HttpClient =
|
|
47
|
-
|
|
66
|
+
module.exports.HttpClient = load("clients/http-client").HttpClient;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Model } from './model-registry';
|
|
2
|
+
export declare function createPopularModels(): (Model<"gpt-5.4"> | Model<"gpt-5"> | Model<"gpt-5-mini"> | Model<"gpt-5-nano"> | Model<"gpt-4.1"> | Model<"gpt-4.1-mini"> | Model<"gpt-4o"> | Model<"gpt-4o-mini"> | Model<"claude-opus-4-6"> | Model<"claude-opus-4-6-thinking"> | Model<"claude-sonnet-4-6"> | Model<"claude-sonnet-4-6-thinking"> | Model<"claude-haiku-4-5-20251001"> | Model<"claude-opus-4-1-20250805"> | Model<"claude-opus-4-1-20250805-thinking"> | Model<"claude-3-7-sonnet-latest"> | Model<"claude-3-7-sonnet-thinking"> | Model<"claude-3-5-haiku-latest"> | Model<"gemini-3.1-pro-preview"> | Model<"gemini-3-flash-preview"> | Model<"gemini-3.1-flash-lite-preview"> | Model<"gemini-2.5-pro"> | Model<"gemini-2.5-flash"> | Model<"gemini-2.5-flash-lite"> | Model<"qwen2.5:1.5b">)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a14_0x186295=a14_0x443d;(function(_0x2ab1c7,_0x272e2a){const _0x46caf6=a14_0x443d,_0x8458ac=_0x2ab1c7();while(!![]){try{const _0x47ea23=-parseInt(_0x46caf6(0x11f))/0x1*(parseInt(_0x46caf6(0xf7))/0x2)+parseInt(_0x46caf6(0x134))/0x3+parseInt(_0x46caf6(0x131))/0x4*(parseInt(_0x46caf6(0x119))/0x5)+-parseInt(_0x46caf6(0x127))/0x6*(parseInt(_0x46caf6(0xf2))/0x7)+-parseInt(_0x46caf6(0x11d))/0x8*(-parseInt(_0x46caf6(0xfa))/0x9)+-parseInt(_0x46caf6(0x112))/0xa*(-parseInt(_0x46caf6(0x10e))/0xb)+-parseInt(_0x46caf6(0x115))/0xc*(parseInt(_0x46caf6(0x102))/0xd);if(_0x47ea23===_0x272e2a)break;else _0x8458ac['push'](_0x8458ac['shift']());}catch(_0x4343f9){_0x8458ac['push'](_0x8458ac['shift']());}}}(a14_0x2367,0xe956f));const a14_0x3e142c=(function(){const _0x5a8f40=a14_0x443d,_0x5f2a39={'nfAnf':function(_0x2659fb,_0x20bce0){return _0x2659fb!==_0x20bce0;},'oTQWt':_0x5a8f40(0x11b)};let _0x2e7874=!![];return function(_0x389e87,_0x5ee601){const _0x5b4dcf=_0x5a8f40,_0x43522b={'WVUOC':_0x5b4dcf(0x130)},_0x213355=_0x2e7874?function(){const _0x437da1=_0x5b4dcf;if(_0x5ee601){if(_0x5f2a39[_0x437da1(0x133)](_0x5f2a39[_0x437da1(0x116)],_0x5f2a39['oTQWt']))return _0x25ca3d[_0x437da1(0x10d)]()[_0x437da1(0xf1)](_0x43522b[_0x437da1(0x118)])[_0x437da1(0x10d)]()['constructor'](_0x454605)[_0x437da1(0xf1)](_0x43522b[_0x437da1(0x118)]);else{const _0x448970=_0x5ee601[_0x437da1(0x12e)](_0x389e87,arguments);return _0x5ee601=null,_0x448970;}}}:function(){};return _0x2e7874=![],_0x213355;};}()),a14_0x5f4f0f=a14_0x3e142c(this,function(){const _0x3b433b=a14_0x443d,_0xa4d5c5={'xSYbQ':'(((.+)+)+)+$'};return a14_0x5f4f0f[_0x3b433b(0x10d)]()[_0x3b433b(0xf1)](_0xa4d5c5[_0x3b433b(0x12a)])[_0x3b433b(0x10d)]()[_0x3b433b(0x12b)](a14_0x5f4f0f)['search'](_0xa4d5c5[_0x3b433b(0x12a)]);});a14_0x5f4f0f();'use strict';Object[a14_0x186295(0x10a)](exports,a14_0x186295(0x10c),{'value':!![]}),exports['createPopularModels']=createPopularModels;function a14_0x2367(){const _0x598d9f=['llmRetry','claude-sonnet-4-6','claude-opus-4-1-20250805','24OWIpkj','claude-opus-4-6','mGuka','xSYbQ','constructor','claude-3-7-sonnet-thinking','EuEfX','apply','bvfgB','(((.+)+)+)+$','56lRvDWY','gpt-5.4','nfAnf','5607573fPbbKT','iJHUW','gpt-4.1','search','457534TRlunj','PIFWi','BzTlc','gPdWK','gpt-4o','3312734zMsdJt','vCdGU','uvyvk','18miObYO','uBfDQ','gpt-4.1-mini','medium','GeminiKey','llmTemperature','claude-3-7-sonnet-latest','AnthropicKey','14580943vIJeHi','Model','gemini-2.5-flash','FIkrc','claude-haiku-4-5-20251001','enabled','UufXB','gemini-2.5-pro','defineProperty','gemini-2.5-flash-lite','__esModule','toString','682MmAyiT','tZcxl','rPrLA','gpt-5-nano','301010qqPyMc','CoreConfig','gemini-3-flash-preview','36UEwDVy','oTQWt','hHNED','WVUOC','305255umFGCU','OpenAIKey','eHWiT','../configs/core-config','6592960ELgboG','JmHtW','1kLsADu','gemini-3.1-pro-preview','Vlmkf','qwen2.5:1.5b','claude-sonnet-4-6-thinking'];a14_0x2367=function(){return _0x598d9f;};return a14_0x2367();}function a14_0x443d(_0x506885,_0x3792b6){const _0x45526f=a14_0x2367();return a14_0x443d=function(_0x5f4f0f,_0x3e142c){_0x5f4f0f=_0x5f4f0f-0xf0;let _0x236742=_0x45526f[_0x5f4f0f];return _0x236742;},a14_0x443d(_0x506885,_0x3792b6);}const core_config_1=require(a14_0x186295(0x11c)),model_registry_1=require('./model-registry');function createPopularModels(){const _0x1705ea=a14_0x186295,_0x32edc0={'uBfDQ':_0x1705ea(0x132),'gPdWK':'medium','iJHUW':'gpt-5','uuYKR':'gpt-5-mini','uvyvk':_0x1705ea(0x111),'Vlmkf':_0x1705ea(0xf0),'XLLrh':_0x1705ea(0xfc),'mGuka':'gpt-4o-mini','vCdGU':'claude-opus-4-6-thinking','FIkrc':_0x1705ea(0x107),'JmHtW':_0x1705ea(0x125),'cZWyN':_0x1705ea(0x123),'BzTlc':_0x1705ea(0x106),'tZcxl':_0x1705ea(0x126),'oTMsA':'claude-opus-4-1-20250805-thinking','sqgVz':'claude-3-7-sonnet-latest','rPrLA':_0x1705ea(0x12c),'UufXB':'claude-3-5-haiku-latest','suMAQ':_0x1705ea(0x120),'hHNED':_0x1705ea(0x114),'bvfgB':_0x1705ea(0x104),'XlNxN':_0x1705ea(0x10b),'EuEfX':_0x1705ea(0x122),'PIFWi':'ollama'};return[new model_registry_1['Model'](_0x32edc0[_0x1705ea(0xfb)],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)],'reasoning':{'effort':_0x32edc0[_0x1705ea(0xf5)]}}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x135)],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1[_0x1705ea(0x113)]['llmRetry'],'reasoning':{'effort':_0x1705ea(0xfd)}}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0['uuYKR'],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1['CoreConfig'][_0x1705ea(0x124)],'reasoning':{'effort':_0x32edc0[_0x1705ea(0xf5)]}}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0xf9)],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1['CoreConfig'][_0x1705ea(0x124)],'reasoning':{'effort':_0x32edc0[_0x1705ea(0xf5)]}}),new model_registry_1['Model'](_0x32edc0[_0x1705ea(0x121)],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0['XLLrh'],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)]['OpenAIKey'],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1[(_0x1705ea(0x103))](_0x1705ea(0xf6),{'temperature':core_config_1['CoreConfig']['llmTemperature'],'apiKey':core_config_1['CoreConfig']['OpenAIKey'],'maxRetries':core_config_1['CoreConfig']['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x129)],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x11a)],'maxRetries':core_config_1['CoreConfig']['llmRetry']}),new model_registry_1['Model']('claude-opus-4-6',{'temperature':0x0,'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0xf8)],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)],'thinking':{'type':_0x32edc0[_0x1705ea(0x105)],'budget_tokens':0x800}},_0x1705ea(0x128)),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x11e)],{'temperature':0x0,'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1['Model'](_0x32edc0['cZWyN'],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1['CoreConfig'][_0x1705ea(0x124)],'thinking':{'type':_0x32edc0[_0x1705ea(0x105)],'budget_tokens':0x800}},_0x1705ea(0x125)),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0xf4)],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1['Model'](_0x32edc0[_0x1705ea(0x10f)],{'temperature':0x0,'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1['Model'](_0x32edc0['oTMsA'],{'apiKey':core_config_1['CoreConfig'][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)],'thinking':{'type':_0x1705ea(0x107),'budget_tokens':0x800}},_0x32edc0[_0x1705ea(0x10f)]),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0['sqgVz'],{'temperature':0x0,'apiKey':core_config_1['CoreConfig'][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)]['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x110)],{'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1['CoreConfig'][_0x1705ea(0x124)],'thinking':{'type':_0x32edc0[_0x1705ea(0x105)],'budget_tokens':0x800}},_0x1705ea(0x100)),new model_registry_1['Model'](_0x32edc0[_0x1705ea(0x108)],{'temperature':core_config_1['CoreConfig']['llmTemperature'],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x101)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0['suMAQ'],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1[_0x1705ea(0x113)]['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x117)],{'temperature':core_config_1['CoreConfig'][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1['CoreConfig']['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))]('gemini-3.1-flash-lite-preview',{'temperature':core_config_1[_0x1705ea(0x113)]['llmTemperature'],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)]}),new model_registry_1[(_0x1705ea(0x103))](_0x1705ea(0x109),{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1[_0x1705ea(0x113)]['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x12f)],{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1['CoreConfig'][_0x1705ea(0x124)]}),new model_registry_1['Model'](_0x32edc0['XlNxN'],{'temperature':core_config_1[_0x1705ea(0x113)]['llmTemperature'],'apiKey':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xfe)],'maxRetries':core_config_1[_0x1705ea(0x113)]['llmRetry']}),new model_registry_1[(_0x1705ea(0x103))](_0x32edc0[_0x1705ea(0x12d)],{'provider':_0x32edc0[_0x1705ea(0xf3)],'think':![],'maxRetries':core_config_1[_0x1705ea(0x113)][_0x1705ea(0x124)],'options':{'temperature':core_config_1[_0x1705ea(0x113)][_0x1705ea(0xff)]}})];}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
3
|
+
import { ChatAnthropic, type AnthropicInput } from '@langchain/anthropic';
|
|
4
|
+
import { ChatGoogleGenerativeAI, type GoogleGenerativeAIChatInput } from '@langchain/google-genai';
|
|
5
|
+
import { ChatOllama, type ChatOllamaInput } from '@langchain/ollama';
|
|
6
|
+
import { AzureChatOpenAI, ChatOpenAI, type AzureChatOpenAIFields, type ChatOpenAIFields } from '@langchain/openai';
|
|
7
|
+
type OpenAIModelName = `gpt-${string}` | `o${number}${string}`;
|
|
8
|
+
type OpenAIReasoningModelName = `gpt-5${string}` | `o${number}${string}`;
|
|
9
|
+
type GeminiModelName = `gemini-${string}`;
|
|
10
|
+
type ClaudeModelName = `claude-${string}`;
|
|
11
|
+
type OpenAIModelConfig<Name extends OpenAIModelName> = Name extends OpenAIReasoningModelName ? Omit<ChatOpenAIFields, 'model' | 'temperature'> & {
|
|
12
|
+
provider?: 'openai';
|
|
13
|
+
temperature?: never;
|
|
14
|
+
} : Omit<ChatOpenAIFields, 'model'> & {
|
|
15
|
+
provider?: 'openai';
|
|
16
|
+
};
|
|
17
|
+
type AzureOpenAIModelConfig = Omit<AzureChatOpenAIFields, 'model'> & {
|
|
18
|
+
provider: 'azure-openai';
|
|
19
|
+
};
|
|
20
|
+
type GeminiModelConfig = Omit<GoogleGenerativeAIChatInput, 'model'> & {
|
|
21
|
+
provider?: 'google';
|
|
22
|
+
};
|
|
23
|
+
type AnthropicModelConfig = Omit<AnthropicInput & BaseChatModelParams, 'model' | 'modelName'> & {
|
|
24
|
+
provider?: 'anthropic';
|
|
25
|
+
};
|
|
26
|
+
type OllamaTopLevelConfig = Pick<ChatOllamaInput, 'baseUrl' | 'headers' | 'checkOrPullModel' | 'streaming' | 'format' | 'fetch' | 'think' | 'keepAlive' | 'maxRetries'>;
|
|
27
|
+
type OllamaOptionConfig = Pick<ChatOllamaInput, 'numa' | 'numCtx' | 'numBatch' | 'numGpu' | 'mainGpu' | 'lowVram' | 'f16Kv' | 'logitsAll' | 'vocabOnly' | 'useMmap' | 'useMlock' | 'embeddingOnly' | 'numThread' | 'numKeep' | 'seed' | 'numPredict' | 'topK' | 'topP' | 'tfsZ' | 'typicalP' | 'repeatLastN' | 'temperature' | 'repeatPenalty' | 'presencePenalty' | 'frequencyPenalty' | 'mirostat' | 'mirostatTau' | 'mirostatEta' | 'penalizeNewline' | 'stop'> & {
|
|
28
|
+
minP?: never;
|
|
29
|
+
};
|
|
30
|
+
type OllamaModelConfig = OllamaTopLevelConfig & {
|
|
31
|
+
provider: 'ollama';
|
|
32
|
+
options?: OllamaOptionConfig;
|
|
33
|
+
};
|
|
34
|
+
export type ModelConfig<Name extends string> = Name extends OpenAIModelName ? OpenAIModelConfig<Name> : Name extends GeminiModelName ? GeminiModelConfig : Name extends ClaudeModelName ? AnthropicModelConfig : AzureOpenAIModelConfig | OllamaModelConfig;
|
|
35
|
+
export type ModelProvider = 'openai' | 'azure-openai' | 'google' | 'anthropic' | 'ollama';
|
|
36
|
+
export type SupportedChatModel = ChatGoogleGenerativeAI | ChatOpenAI | AzureChatOpenAI | ChatAnthropic | ChatOllama;
|
|
37
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
38
|
+
export type DeepPartial<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : {
|
|
39
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
40
|
+
};
|
|
41
|
+
export type ModelOverride<Name extends string> = DeepPartial<Omit<ModelConfig<Name>, 'provider'>>;
|
|
42
|
+
export declare class Model<Name extends string = string> {
|
|
43
|
+
readonly name: Name;
|
|
44
|
+
readonly provider: ModelProvider;
|
|
45
|
+
readonly targetName: string;
|
|
46
|
+
private readonly config;
|
|
47
|
+
constructor(name: Name, config: ModelConfig<Name>, targetName?: string);
|
|
48
|
+
supportsTemperatureOverride(): boolean;
|
|
49
|
+
createInstance(overrides?: ModelOverride<Name> | Record<string, any>): SupportedChatModel;
|
|
50
|
+
temperatureOverride(temp: number): Record<string, any>;
|
|
51
|
+
useTools(llm: SupportedChatModel, tools?: DynamicStructuredTool[]): SupportedChatModel;
|
|
52
|
+
private buildParams;
|
|
53
|
+
private buildOllamaParams;
|
|
54
|
+
private getModelClass;
|
|
55
|
+
private static detectProvider;
|
|
56
|
+
private static isOpenAIModel;
|
|
57
|
+
private static isOpenAIReasoningModel;
|
|
58
|
+
}
|
|
59
|
+
export declare class ModelRegistry {
|
|
60
|
+
private readonly models;
|
|
61
|
+
register<Name extends string>(model: Model<Name>, replace?: boolean): Model<Name>;
|
|
62
|
+
registerMany(models: Model[], replace?: boolean): void;
|
|
63
|
+
get(modelName?: string): Model;
|
|
64
|
+
getName(modelName?: string): string;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a15_0x333936=a15_0x1aa7;(function(_0x3c05ed,_0x8dcda9){const _0x159107=a15_0x1aa7,_0x485059=_0x3c05ed();while(!![]){try{const _0x2e66a2=-parseInt(_0x159107(0x212))/0x1+parseInt(_0x159107(0x221))/0x2+parseInt(_0x159107(0x217))/0x3+-parseInt(_0x159107(0x226))/0x4+parseInt(_0x159107(0x21b))/0x5*(-parseInt(_0x159107(0x1fc))/0x6)+parseInt(_0x159107(0x20e))/0x7+parseInt(_0x159107(0x1f7))/0x8;if(_0x2e66a2===_0x8dcda9)break;else _0x485059['push'](_0x485059['shift']());}catch(_0x4e80d5){_0x485059['push'](_0x485059['shift']());}}}(a15_0x49a4,0xb685e));const a15_0x309ad8=(function(){const _0x5f37f2=a15_0x1aa7,_0x465f9d={'ayEDf':_0x5f37f2(0x20a)};let _0x5b0ef1=!![];return function(_0x2536e5,_0xa26c65){const _0x1fb031=_0x5b0ef1?function(){const _0x52ba4f=a15_0x1aa7,_0x52090c={'DobDb':_0x52ba4f(0x21a)};if(_0xa26c65){if(_0x52ba4f(0x1e8)===_0x465f9d[_0x52ba4f(0x225)])return _0x52090c[_0x52ba4f(0x22b)];else{const _0x595ad2=_0xa26c65[_0x52ba4f(0x1dd)](_0x2536e5,arguments);return _0xa26c65=null,_0x595ad2;}}}:function(){};return _0x5b0ef1=![],_0x1fb031;};}()),a15_0x2a37a8=a15_0x309ad8(this,function(){const _0x110130=a15_0x1aa7,_0x1aeafb={'RtYUB':_0x110130(0x214)};return a15_0x2a37a8[_0x110130(0x1d6)]()[_0x110130(0x21c)](_0x1aeafb[_0x110130(0x203)])[_0x110130(0x1d6)]()[_0x110130(0x215)](a15_0x2a37a8)[_0x110130(0x21c)](_0x1aeafb[_0x110130(0x203)]);});function a15_0x49a4(){const _0x216ac7=['IlRrG','temperature','gAcZc','bCLTt','DobDb','buildOllamaParams','yPaYG','BsuUt','\x27\x20not\x20registered.','ChatOpenAI','lttzr','bindTools','__esModule','QxifP','TBaqn','buildParams','azure-openai','getModelClass','toString','Model','EHCfk','Cannot\x20infer\x20provider\x20for\x20model\x20\x27','HOCSE','bzKpi','values','apply','anthropic','jpbLU','useTools','dqsPV','ksmhj','models','targetName','gemini-','next','tJbHY','xkMrY','value','getName','lodash','isOpenAIReasoningModel','ChatAnthropic','qsbkV','name','isOpenAIModel','detectProvider','URXxM','ollama','RyUTv','merge','temperatureOverride','3126304ZysOBV','orZIB','startsWith','qDGkc','get','282gTQxgb','@langchain/ollama','npixS','createInstance','registerMany','ZLIZd','mErBZ','RtYUB','provider','Daohq','XToRE','openai','supportsTemperatureOverride','BYiDI','FhpOW','set','ModelRegistry','VqCmT','3909031EmtJlX','ChatOllama','register','ICtNu','766182bARVuY','AzureChatOpenAI','(((.+)+)+)+$','constructor','config','2836797jzYHey','wXTab','OquuB','google','38210LfVZeB','search','Model\x20\x27','claude-','test','xsokP','2474630GtBThm','bind','@langchain/openai','defineProperty','ayEDf','5036660PvEobB'];a15_0x49a4=function(){return _0x216ac7;};return a15_0x49a4();}a15_0x2a37a8();'use strict';Object[a15_0x333936(0x224)](exports,a15_0x333936(0x233),{'value':!![]}),exports[a15_0x333936(0x20c)]=exports[a15_0x333936(0x1d7)]=void 0x0;const lodash_1=require(a15_0x333936(0x1eb)),anthropic_1=require('@langchain/anthropic'),google_genai_1=require('@langchain/google-genai'),ollama_1=require(a15_0x333936(0x1fd)),openai_1=require(a15_0x333936(0x223));class Model{constructor(_0x1f56a0,_0x1528f8,_0x5590ca){const _0x36fcff=a15_0x333936,_0x2397fe={'QxifP':function(_0x444120,_0x195afa){return _0x444120??_0x195afa;}};this[_0x36fcff(0x1ef)]=_0x1f56a0,this['config']=_0x1528f8,this[_0x36fcff(0x1e4)]=_0x2397fe[_0x36fcff(0x234)](_0x5590ca,_0x1f56a0),this[_0x36fcff(0x204)]=Model[_0x36fcff(0x1f1)](_0x1f56a0,_0x1528f8);}[a15_0x333936(0x208)](){const _0x1d2109=a15_0x333936;return!Model[_0x1d2109(0x1ec)](this[_0x1d2109(0x1ef)]);}[a15_0x333936(0x1ff)](_0x1b68dd){const _0x41a436=a15_0x333936,_0x47992d=this[_0x41a436(0x1d3)](_0x1b68dd),_0x1cfa8c=this[_0x41a436(0x1d5)]();return new _0x1cfa8c(_0x47992d);}[a15_0x333936(0x1f6)](_0x269978){const _0x25f3c3=a15_0x333936,_0x17ada7={'PAnOA':function(_0x21dfa1,_0x39e206){return _0x21dfa1===_0x39e206;},'SMmDC':_0x25f3c3(0x1f3)};if(_0x17ada7['PAnOA'](this[_0x25f3c3(0x204)],_0x17ada7['SMmDC']))return{'options':{'temperature':_0x269978}};return{'temperature':_0x269978};}[a15_0x333936(0x1e0)](_0x24cd53,_0x4e4e44){const _0x2936e6=a15_0x333936,_0x25b0a8={'dqsPV':function(_0xfc8e38,_0x41a5c4){return _0xfc8e38===_0x41a5c4;},'TBaqn':function(_0x26bdad,_0x3c3bda){return _0x26bdad!==_0x3c3bda;},'BsuUt':_0x2936e6(0x202),'gAcZc':function(_0x55f816,_0x21fddb){return _0x55f816===_0x21fddb;},'HOCSE':_0x2936e6(0x1f3)};if(!_0x4e4e44||_0x25b0a8[_0x2936e6(0x1e1)](_0x4e4e44['length'],0x0))return _0x25b0a8[_0x2936e6(0x235)](_0x2936e6(0x206),_0x25b0a8[_0x2936e6(0x22e)])?_0x24cd53:_0x4f6aef['bind']({'tools':_0x208f6d});if(_0x25b0a8[_0x2936e6(0x229)](this[_0x2936e6(0x204)],_0x25b0a8[_0x2936e6(0x1da)]))return _0x24cd53[_0x2936e6(0x222)]({'tools':_0x4e4e44});return _0x24cd53[_0x2936e6(0x232)](_0x4e4e44);}[a15_0x333936(0x1d3)](_0x312ae9){const _0x1e51e=a15_0x333936,_0x2ba248={'ZLIZd':function(_0x21be37,_0x15c965){return _0x21be37===_0x15c965;},'iagHF':'ollama','npixS':_0x1e51e(0x1f4)},_0x360e49=_0x2ba248[_0x1e51e(0x201)](this[_0x1e51e(0x204)],_0x2ba248['iagHF'])?this['buildOllamaParams']():{...this[_0x1e51e(0x216)],'model':this[_0x1e51e(0x1e4)]},_0x553dff=(0x0,lodash_1[_0x1e51e(0x1f5)])({},_0x360e49,_0x312ae9??{});delete _0x553dff[_0x1e51e(0x204)];if(!this[_0x1e51e(0x208)]()){if(_0x2ba248['npixS']===_0x2ba248[_0x1e51e(0x1fe)])delete _0x553dff['temperature'];else{const _0x5d9d90=this[_0x1e51e(0x216)],{options:_0xb6ef5f,..._0x104c67}=_0x5d9d90;return{..._0x104c67,..._0xb6ef5f,'model':this[_0x1e51e(0x1e4)]};}}return _0x553dff;}['buildOllamaParams'](){const _0x84abf6=a15_0x333936,_0x2269fb=this['config'],{options:_0x49a6bb,..._0x2d0f06}=_0x2269fb;return{..._0x2d0f06,..._0x49a6bb,'model':this[_0x84abf6(0x1e4)]};}[a15_0x333936(0x1d5)](){const _0x46a3c9=a15_0x333936,_0x2aca70={'URXxM':_0x46a3c9(0x207),'bzKpi':_0x46a3c9(0x1d4),'WjdyQ':_0x46a3c9(0x21a),'qBEeY':_0x46a3c9(0x1de)};switch(this['provider']){case _0x2aca70[_0x46a3c9(0x1f2)]:return openai_1[_0x46a3c9(0x230)];case _0x2aca70[_0x46a3c9(0x1db)]:return openai_1[_0x46a3c9(0x213)];case _0x2aca70['WjdyQ']:return google_genai_1['ChatGoogleGenerativeAI'];case _0x2aca70['qBEeY']:return anthropic_1[_0x46a3c9(0x1ed)];case _0x46a3c9(0x1f3):return ollama_1[_0x46a3c9(0x20f)];}}static[a15_0x333936(0x1f1)](_0x55bb8a,_0x5468b0){const _0x5ba910=a15_0x333936,_0x5398c1={'orZIB':function(_0x2822f0,_0x8fa2d5){return _0x2822f0===_0x8fa2d5;},'bCLTt':_0x5ba910(0x1f3),'ycKMd':function(_0x183d7b,_0x125b78){return _0x183d7b??_0x125b78;},'qDGkc':function(_0xe4b2f1,_0x3a53f6){return _0xe4b2f1 in _0x3a53f6;},'VqCmT':_0x5ba910(0x204),'BYiDI':_0x5ba910(0x207),'EHCfk':_0x5ba910(0x1e5),'shnqf':_0x5ba910(0x21a),'ekqro':_0x5ba910(0x1e7),'qsbkV':_0x5ba910(0x1de)};if(_0x5398c1[_0x5ba910(0x1fa)](_0x5398c1[_0x5ba910(0x20d)],_0x5468b0)&&_0x5468b0[_0x5ba910(0x204)])return _0x5468b0['provider'];if(Model['isOpenAIModel'](_0x55bb8a))return _0x5398c1[_0x5ba910(0x209)];if(_0x55bb8a[_0x5ba910(0x1f9)](_0x5398c1[_0x5ba910(0x1d8)])){if(_0x5ba910(0x1df)!==_0x5ba910(0x218))return _0x5398c1['shnqf'];else{const _0x598500=this['buildParams'](_0x636707),_0x56c633=this[_0x5ba910(0x1d5)]();return new _0x56c633(_0x598500);}}if(_0x55bb8a[_0x5ba910(0x1f9)](_0x5ba910(0x21e))){if(_0x5398c1['ekqro']==='SJkkO'){const _0x18a3cd=_0x5398c1[_0x5ba910(0x1f8)](this[_0x5ba910(0x204)],_0x5398c1[_0x5ba910(0x22a)])?this[_0x5ba910(0x22c)]():{...this[_0x5ba910(0x216)],'model':this['targetName']},_0x16ed2c=(0x0,_0x497257[_0x5ba910(0x1f5)])({},_0x18a3cd,_0x5398c1['ycKMd'](_0x2129c2,{}));return delete _0x16ed2c['provider'],!this[_0x5ba910(0x208)]()&&delete _0x16ed2c[_0x5ba910(0x228)],_0x16ed2c;}else return _0x5398c1[_0x5ba910(0x1ee)];}throw new Error(_0x5ba910(0x1d9)+_0x55bb8a+'\x27.\x20Set\x20config.provider\x20explicitly.');}static[a15_0x333936(0x1f0)](_0x519d5d){const _0x4c34a5=a15_0x333936;return/^gpt-|^o\d/[_0x4c34a5(0x21f)](_0x519d5d);}static[a15_0x333936(0x1ec)](_0x20dde5){const _0x256c16=a15_0x333936;return/^gpt-5(?:$|[-:])|^o\d/[_0x256c16(0x21f)](_0x20dde5);}}exports[a15_0x333936(0x1d7)]=Model;class ModelRegistry{constructor(){this['models']=new Map();}[a15_0x333936(0x210)](_0x1807d2,_0x3a876f=![]){const _0x55051e=a15_0x333936,_0x437013={'hnTOl':function(_0x1720a8,_0x39cba5){return _0x1720a8!==_0x39cba5;},'yPaYG':_0x55051e(0x220)};if(this['models']['has'](_0x1807d2[_0x55051e(0x1ef)])&&!_0x3a876f)return _0x437013['hnTOl'](_0x437013[_0x55051e(0x22d)],_0x437013[_0x55051e(0x22d)])?!_0x3e8d40[_0x55051e(0x1ec)](this[_0x55051e(0x1ef)]):this[_0x55051e(0x1e3)]['get'](_0x1807d2[_0x55051e(0x1ef)]);return this[_0x55051e(0x1e3)][_0x55051e(0x20b)](_0x1807d2[_0x55051e(0x1ef)],_0x1807d2),_0x1807d2;}[a15_0x333936(0x200)](_0x390a50,_0x2351f4=![]){const _0xbb9159=a15_0x333936,_0x18094d={'iYsFU':_0xbb9159(0x205)};for(const _0x596e96 of _0x390a50){if(_0x18094d['iYsFU']!==_0xbb9159(0x205))return this[_0xbb9159(0x1fb)](_0x51715e)[_0xbb9159(0x1ef)];else this['register'](_0x596e96,_0x2351f4);}}[a15_0x333936(0x1fb)](_0x18bfa5){const _0x580f1f=a15_0x333936,_0x285920={'ICtNu':_0x580f1f(0x214),'ksmhj':function(_0x226879,_0xd9912){return _0x226879!==_0xd9912;},'OquuB':_0x580f1f(0x231)};if(!_0x18bfa5){if(_0x580f1f(0x227)===_0x580f1f(0x227)){const _0x39ef6b=this[_0x580f1f(0x1e3)][_0x580f1f(0x1dc)]()[_0x580f1f(0x1e6)]()[_0x580f1f(0x1e9)];if(!_0x39ef6b)throw new Error('No\x20model\x20registered');return _0x39ef6b;}else return _0x42944b['toString']()[_0x580f1f(0x21c)]('(((.+)+)+)+$')[_0x580f1f(0x1d6)]()['constructor'](_0x690ff1)[_0x580f1f(0x21c)](AyUqVC[_0x580f1f(0x211)]);}const _0x244949=this[_0x580f1f(0x1e3)][_0x580f1f(0x1fb)](_0x18bfa5);if(!_0x244949){if(_0x285920[_0x580f1f(0x1e2)](_0x580f1f(0x231),_0x285920[_0x580f1f(0x219)]))delete _0x20abe7[_0x580f1f(0x228)];else throw new Error(_0x580f1f(0x21d)+_0x18bfa5+_0x580f1f(0x22f));}return _0x244949;}[a15_0x333936(0x1ea)](_0x57461c){const _0xa1e149=a15_0x333936;return this[_0xa1e149(0x1fb)](_0x57461c)[_0xa1e149(0x1ef)];}}function a15_0x1aa7(_0x4981bc,_0x4a745b){const _0x5d5edd=a15_0x49a4();return a15_0x1aa7=function(_0x2a37a8,_0x309ad8){_0x2a37a8=_0x2a37a8-0x1d3;let _0x49a4ca=_0x5d5edd[_0x2a37a8];return _0x49a4ca;},a15_0x1aa7(_0x4981bc,_0x4a745b);}exports[a15_0x333936(0x20c)]=ModelRegistry;
|
package/package.json
CHANGED
package/prompt/flow-prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a16_0x1be15f=a16_0x2dad;function a16_0x2dad(_0x511620,_0x4d5569){const _0x4729d7=a16_0x2e43();return a16_0x2dad=function(_0x35bb35,_0x21db00){_0x35bb35=_0x35bb35-0xb9;let _0x2e4334=_0x4729d7[_0x35bb35];return _0x2e4334;},a16_0x2dad(_0x511620,_0x4d5569);}(function(_0x1a2ed7,_0x2a1eac){const _0x3fe25c=a16_0x2dad,_0x427708=_0x1a2ed7();while(!![]){try{const _0x1d233b=-parseInt(_0x3fe25c(0xc7))/0x1*(-parseInt(_0x3fe25c(0xc1))/0x2)+-parseInt(_0x3fe25c(0xc2))/0x3*(parseInt(_0x3fe25c(0xc9))/0x4)+parseInt(_0x3fe25c(0xbc))/0x5*(-parseInt(_0x3fe25c(0xc3))/0x6)+-parseInt(_0x3fe25c(0xcc))/0x7+parseInt(_0x3fe25c(0xc5))/0x8*(-parseInt(_0x3fe25c(0xc6))/0x9)+parseInt(_0x3fe25c(0xbd))/0xa+parseInt(_0x3fe25c(0xbf))/0xb*(parseInt(_0x3fe25c(0xcd))/0xc);if(_0x1d233b===_0x2a1eac)break;else _0x427708['push'](_0x427708['shift']());}catch(_0x18064e){_0x427708['push'](_0x427708['shift']());}}}(a16_0x2e43,0x7460f));const a16_0x21db00=(function(){let _0x4d888a=!![];return function(_0x5c1270,_0x512156){const _0x5e3762=_0x4d888a?function(){const _0x59fa34=a16_0x2dad;if(_0x512156){const _0x5f5896=_0x512156[_0x59fa34(0xba)](_0x5c1270,arguments);return _0x512156=null,_0x5f5896;}}:function(){};return _0x4d888a=![],_0x5e3762;};}()),a16_0x35bb35=a16_0x21db00(this,function(){const _0x5a14ee=a16_0x2dad,_0x184c6c={'GgTyu':'(((.+)+)+)+$'};return a16_0x35bb35[_0x5a14ee(0xcb)]()[_0x5a14ee(0xc8)](_0x184c6c['GgTyu'])[_0x5a14ee(0xcb)]()[_0x5a14ee(0xc0)](a16_0x35bb35)[_0x5a14ee(0xc8)](_0x184c6c['GgTyu']);});a16_0x35bb35();'use strict';Object['defineProperty'](exports,a16_0x1be15f(0xbe),{'value':!![]}),exports['FlowPrompt']=void 0x0;const prompt_util_1=require(a16_0x1be15f(0xce));function a16_0x2e43(){const _0x48ca3d=['toString','3362359QdiiBq','48yLdpqI','./prompt-util','Prompt','apply','endchat.md','2010490cqtQaK','2276530stAtDG','__esModule','3552967aNSUHC','constructor','365448wsIuUt','78594jsXnEN','6jZCciU','EndChat','1624RxZXMf','40653zILgsx','5yyJzdq','search','24HYchst','file'];a16_0x2e43=function(){return _0x48ca3d;};return a16_0x2e43();}class FlowPrompt{}exports['FlowPrompt']=FlowPrompt,FlowPrompt[a16_0x1be15f(0xc4)]=prompt_util_1[a16_0x1be15f(0xb9)][a16_0x1be15f(0xca)](a16_0x1be15f(0xbb));
|
package/prompt/prompt-util.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a17_0x22a006=a17_0x4a11;(function(_0x5c5402,_0x488112){const _0x22af60=a17_0x4a11,_0x25c090=_0x5c5402();while(!![]){try{const _0x5c0f18=parseInt(_0x22af60(0x1d5))/0x1*(-parseInt(_0x22af60(0x1df))/0x2)+-parseInt(_0x22af60(0x1e6))/0x3+parseInt(_0x22af60(0x1ec))/0x4+parseInt(_0x22af60(0x1e3))/0x5*(-parseInt(_0x22af60(0x1dd))/0x6)+parseInt(_0x22af60(0x1f2))/0x7+parseInt(_0x22af60(0x1f5))/0x8*(parseInt(_0x22af60(0x1f6))/0x9)+-parseInt(_0x22af60(0x1e9))/0xa*(parseInt(_0x22af60(0x1f3))/0xb);if(_0x5c0f18===_0x488112)break;else _0x25c090['push'](_0x25c090['shift']());}catch(_0x42b90b){_0x25c090['push'](_0x25c090['shift']());}}}(a17_0x5d30,0xcc63a));const a17_0x7b4f4a=(function(){const _0x1f22a9=a17_0x4a11,_0x1fa0c2={'ROYND':_0x1f22a9(0x1d6),'eQOsl':function(_0x7883df,_0x394b77){return _0x7883df!==_0x394b77;},'RYeEw':_0x1f22a9(0x1ed)};let _0x350b8a=!![];return function(_0xca725c,_0x3a83bb){const _0x1c9441=_0x1f22a9;if(_0x1fa0c2['eQOsl'](_0x1fa0c2[_0x1c9441(0x1f1)],_0x1fa0c2[_0x1c9441(0x1f1)]))return _0x4b0df2[_0x1c9441(0x1e8)](/{{(.*?)}}/g,(_0x370e5a,_0x18dca3)=>{return _0x37066c[_0x18dca3]||_0x370e5a;});else{const _0x40e63d=_0x350b8a?function(){const _0x214b56=_0x1c9441;if('HfgiO'===_0x1fa0c2[_0x214b56(0x1ef)])return this['cache'][_0x214b56(0x1e2)](_0x493a26);else{if(_0x3a83bb){const _0x35fc42=_0x3a83bb[_0x214b56(0x1db)](_0xca725c,arguments);return _0x3a83bb=null,_0x35fc42;}}}:function(){};return _0x350b8a=![],_0x40e63d;}};}()),a17_0x4c8ec7=a17_0x7b4f4a(this,function(){const _0x495ce6=a17_0x4a11,_0x3c26a4={'qUzeI':_0x495ce6(0x1f0)};return a17_0x4c8ec7[_0x495ce6(0x1f7)]()['search'](_0x3c26a4['qUzeI'])[_0x495ce6(0x1f7)]()['constructor'](a17_0x4c8ec7)['search'](_0x3c26a4['qUzeI']);});function a17_0x4a11(_0x128c58,_0x3ea5f4){const _0x3444d4=a17_0x5d30();return a17_0x4a11=function(_0x4c8ec7,_0x7b4f4a){_0x4c8ec7=_0x4c8ec7-0x1d3;let _0x5d3051=_0x3444d4[_0x4c8ec7];return _0x5d3051;},a17_0x4a11(_0x128c58,_0x3ea5f4);}a17_0x4c8ec7();'use strict';var __importDefault=this&&this[a17_0x22a006(0x1d8)]||function(_0x5eef08){const _0x9f526=a17_0x22a006;return _0x5eef08&&_0x5eef08[_0x9f526(0x1f4)]?_0x5eef08:{'default':_0x5eef08};};Object[a17_0x22a006(0x1de)](exports,'__esModule',{'value':!![]}),exports[a17_0x22a006(0x1d7)]=void 0x0;const fs_1=require('fs'),path_1=__importDefault(require('path'));class Prompt{static[a17_0x22a006(0x1e7)](_0x8207c2){const _0x37b8e4=a17_0x22a006,_0x1a9513={'oiZrX':'utf-8'},_0xe3a3f4=this[_0x37b8e4(0x1ee)](),_0x21ccb6=path_1['default']['resolve'](_0xe3a3f4,_0x8207c2);if(this[_0x37b8e4(0x1e4)]['has'](_0x21ccb6))return this[_0x37b8e4(0x1e4)]['get'](_0x21ccb6);const _0x53174e=(0x0,fs_1['readFileSync'])(_0x21ccb6,_0x1a9513[_0x37b8e4(0x1e5)]);return this['cache'][_0x37b8e4(0x1da)](_0x21ccb6,_0x53174e),_0x53174e;}static['getCallerDir'](){const _0x233e9a=a17_0x22a006,_0x5e0323={'enysw':_0x233e9a(0x1eb),'nzSeE':_0x233e9a(0x1dc),'tDXRp':_0x233e9a(0x1e1)},_0x2cd0f9=Error[_0x233e9a(0x1d3)];Error[_0x233e9a(0x1d3)]=(_0x2ecf32,_0x145217)=>_0x145217;const _0x1b6566=new Error(),_0x1772d5=_0x1b6566[_0x233e9a(0x1d4)];Error['prepareStackTrace']=_0x2cd0f9;const _0x2aab65=_0x1772d5?.[0x2]?.[_0x233e9a(0x1e0)]();if(!_0x2aab65){if(_0x5e0323['enysw']===_0x5e0323['nzSeE'])return _0x571a9a&&_0x23ee95[_0x233e9a(0x1f4)]?_0x2ae14a:{'default':_0x14d634};else throw new Error(_0x5e0323['tDXRp']);}return path_1[_0x233e9a(0x1d9)][_0x233e9a(0x1ea)](_0x2aab65);}static[a17_0x22a006(0x1da)](_0x27a7d5,_0x253de5,_0xdac0e4){return _0x27a7d5['replace']('{{'+_0x253de5+'}}',_0xdac0e4);}static['replace'](_0x102131,_0x20b0f5){return _0x102131['replace'](/{{(.*?)}}/g,(_0x162fd2,_0x1d4a33)=>{return _0x20b0f5[_0x1d4a33]||_0x162fd2;});}}exports[a17_0x22a006(0x1d7)]=Prompt,Prompt['cache']=new Map();function a17_0x5d30(){const _0x4b54a5=['Unable\x20to\x20determine\x20caller\x20file\x20path','get','5TLUBWJ','cache','oiZrX','2524224zwCqIx','file','replace','6620TYMJAF','dirname','qoAMy','4863732HLiAfl','YdmnJ','getCallerDir','ROYND','(((.+)+)+)+$','RYeEw','8564976bJInWT','9262xnnWXV','__esModule','2948488IDKMGO','9RfivLG','toString','prepareStackTrace','stack','46603tSXjGa','qMyTF','Prompt','__importDefault','default','set','apply','toswH','356634oWHpxA','defineProperty','22nSElJj','getFileName'];a17_0x5d30=function(){return _0x4b54a5;};return a17_0x5d30();}
|
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
import { Flow } from '../flow/flow';
|
|
2
2
|
import { RunResponseType } from '../flow/flow-types';
|
|
3
3
|
import { FlowSession } from '../session/flow-session';
|
|
4
|
-
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
5
|
-
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
|
6
|
-
import { ChatOllama } from '@langchain/ollama';
|
|
7
|
-
import { AzureChatOpenAI, ChatOpenAI } from '@langchain/openai';
|
|
8
4
|
import { ConfigService } from '@nestjs/config';
|
|
9
|
-
import { ChatAnthropic } from '@langchain/anthropic';
|
|
10
5
|
import { FastifyReply } from 'fastify';
|
|
11
|
-
|
|
6
|
+
import { Model } from '../models/model-registry';
|
|
12
7
|
type FlowConstructorMap = {
|
|
13
8
|
[key: string]: new () => Flow;
|
|
14
9
|
};
|
|
15
|
-
type LLMParams = {
|
|
16
|
-
model: string;
|
|
17
|
-
temperature: number;
|
|
18
|
-
apiKey?: string;
|
|
19
|
-
maxRetries: number;
|
|
20
|
-
};
|
|
21
|
-
type LLMConstructorEntry = {
|
|
22
|
-
modelClass: LLMConstructor;
|
|
23
|
-
params: LLMParams;
|
|
24
|
-
useTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
|
|
25
|
-
};
|
|
26
10
|
export declare class FlowEngine {
|
|
27
11
|
private flowSession;
|
|
28
12
|
private flowRegistry;
|
|
29
|
-
private
|
|
13
|
+
private modelRegistry;
|
|
30
14
|
constructor(config: ConfigService);
|
|
31
15
|
getFlowSession(): FlowSession;
|
|
32
16
|
run(res: FastifyReply, flowName: string, userMessage: string, sessionId: string, config?: object): Promise<void>;
|
|
@@ -46,11 +30,9 @@ export declare class FlowEngine {
|
|
|
46
30
|
}>;
|
|
47
31
|
registerFlows(flowSpecs: FlowConstructorMap): Promise<void>;
|
|
48
32
|
getFlow(flowName: string): new () => Flow;
|
|
49
|
-
registerModels(
|
|
50
|
-
registerModel(
|
|
51
|
-
getModel(modelName
|
|
33
|
+
registerModels(models: Model[], replace?: boolean): void;
|
|
34
|
+
registerModel<Name extends string>(model: Model<Name>, replace?: boolean): void;
|
|
35
|
+
getModel(modelName?: string): Model;
|
|
52
36
|
getModelName(modelName?: string): string;
|
|
53
|
-
static DefaultUseTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
|
|
54
|
-
static OllamaUseTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
|
|
55
37
|
}
|
|
56
38
|
export {};
|
package/services/flow-engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a16_0x1e73(_0x2d44ac,_0x431929){const _0x3aa648=a16_0x2540();return a16_0x1e73=function(_0x56b480,_0x526cdc){_0x56b480=_0x56b480-0x188;let _0x25401=_0x3aa648[_0x56b480];return _0x25401;},a16_0x1e73(_0x2d44ac,_0x431929);}const a16_0x4d89ed=a16_0x1e73;(function(_0x2b659d,_0x24ad02){const _0x44b0a8=a16_0x1e73,_0x4c167d=_0x2b659d();while(!![]){try{const _0x372bf5=-parseInt(_0x44b0a8(0x195))/0x1*(-parseInt(_0x44b0a8(0x191))/0x2)+parseInt(_0x44b0a8(0x1d8))/0x3+parseInt(_0x44b0a8(0x202))/0x4*(parseInt(_0x44b0a8(0x1fa))/0x5)+parseInt(_0x44b0a8(0x19f))/0x6*(-parseInt(_0x44b0a8(0x1e7))/0x7)+parseInt(_0x44b0a8(0x19c))/0x8*(parseInt(_0x44b0a8(0x1f9))/0x9)+parseInt(_0x44b0a8(0x1fb))/0xa*(parseInt(_0x44b0a8(0x1d6))/0xb)+-parseInt(_0x44b0a8(0x207))/0xc*(parseInt(_0x44b0a8(0x18a))/0xd);if(_0x372bf5===_0x24ad02)break;else _0x4c167d['push'](_0x4c167d['shift']());}catch(_0x3b5090){_0x4c167d['push'](_0x4c167d['shift']());}}}(a16_0x2540,0x5e711));const a16_0x526cdc=(function(){const _0x5f4dd9=a16_0x1e73,_0x1c10ea={'ewQSH':function(_0x161180,_0x2043b2){return _0x161180!==_0x2043b2;},'zECTl':_0x5f4dd9(0x208),'HPbrk':_0x5f4dd9(0x1ac)};let _0x3d0a6c=!![];return function(_0x4df797,_0x3f2bb4){const _0x2eb4ba=_0x5f4dd9,_0x434c12={'BXJQP':function(_0x54ce07,_0x314e17){return _0x1c10ea['ewQSH'](_0x54ce07,_0x314e17);},'jLUEH':_0x1c10ea[_0x2eb4ba(0x197)]};if('AmxvJ'!==_0x1c10ea[_0x2eb4ba(0x199)]){const _0x2eb3fb=_0x3d0a6c?function(){const _0x477bb6=_0x2eb4ba;if(_0x3f2bb4){if(_0x434c12[_0x477bb6(0x1ff)]('YsVzP',_0x434c12[_0x477bb6(0x1c4)])){const _0x344ee8=_0x3f2bb4[_0x477bb6(0x1c3)](_0x4df797,arguments);return _0x3f2bb4=null,_0x344ee8;}else return this[_0x477bb6(0x1bc)][_0x5701b3[0x0]];}}:function(){};return _0x3d0a6c=![],_0x2eb3fb;}else this[_0x2eb4ba(0x1bc)]={...this['llmRegister'],..._0x1e1958};};}()),a16_0x56b480=a16_0x526cdc(this,function(){const _0x5d1f97=a16_0x1e73,_0x585a9a={'lJJlh':_0x5d1f97(0x188)};return a16_0x56b480[_0x5d1f97(0x209)]()['search'](_0x585a9a[_0x5d1f97(0x1ec)])[_0x5d1f97(0x209)]()['constructor'](a16_0x56b480)[_0x5d1f97(0x1f0)](_0x585a9a[_0x5d1f97(0x1ec)]);});function a16_0x2540(){const _0x187811=['ConfigService','object','Content-Type','pNCaX','LoWNC','error','Delete\x20session\x20','status','Mmomw','RbqKC','xiCSE','11hymzeP','saveSession','816726vectKQ','design:paramtypes','kYFpa','keys','ChatSessionID','cWrab','gIkyM','lWeRK','jJDLF','BGmQz','rLHFK','cFinZ','gAMsN','../session/flow-session','WPKnb','7uhpbJT','jMATa','runStatus','OlMCx','getModelName','lJJlh','YBcCB','@langchain/ollama','HttpContentType','search','hnCVO','getFlow','model','run','FmOvm','__esModule','defineProperty','QlzkZ','41562ukTfsZ','1318425mlpWfs','7431980UZsWOC','RqOcC','YzuRK','gnPzZ','BXJQP','send','length','8aYCSbF','registerModels','contentType','__decorate','flowSession','14232NWkiuH','wgDlq','toString','uNJeQ','getOwnPropertyDescriptor','Zfaem','SybmT','../configs/core-config','XABmq','message','(((.+)+)+)+$','flowRegistry','19838GALGCv','composeHttpResponse','ChatOllama','registerFlows','ErwFF','BAD_REQUEST','kJNPf','665748wlFoLp','session','setup','REVLv','2kzJAlk','metadata','zECTl','fetch','HPbrk','create','FlowEngine','1112zXFYDX','../flow/content-type','header','3922746jtBmus','ZXVTx','aborted','mlGQY','FlowCreator','EyEmr','bind','swXmV','function','save','../session/session-logger','@nestjs/config','endChat','FsOWx','xiBpS','@nestjs/common','JRMMp','getFlowSession','BWlQL','No\x20model\x20registered','getSessionId','OllamaUseTool','eQQHl','qedUr','pIfQg','AeIKC','MrTKF','Plain','JRPZU','llmRegister','handleException','HttpStatus','getModel','registerModel','LeXEG','../flow/flow-creator','apply','jLUEH','bindTools','runFlow','decorate','__metadata','wxGQM','FlowSession'];a16_0x2540=function(){return _0x187811;};return a16_0x2540();}a16_0x56b480();'use strict';var __decorate=this&&this[a16_0x4d89ed(0x205)]||function(_0x2c66cc,_0x320e6e,_0x14fc82,_0xac223a){const _0xdc4946=a16_0x4d89ed,_0x2b0da7={'Zfaem':function(_0x41f262,_0x123ec7){return _0x41f262===_0x123ec7;},'OQrdQ':function(_0x2f152b,_0x2949e2){return _0x2f152b===_0x2949e2;},'xiBpS':function(_0x5346e1,_0x241803){return _0x5346e1===_0x241803;},'ErwFF':function(_0x3966bc,_0x2059c0){return _0x3966bc-_0x2059c0;},'YBcCB':function(_0x5aaffd,_0x586ccb){return _0x5aaffd<_0x586ccb;},'jMATa':function(_0xaa3bf2,_0x113f92){return _0xaa3bf2(_0x113f92);},'TKqCP':function(_0x2dc81c,_0x4b0ea7){return _0x2dc81c>_0x4b0ea7;},'OlMCx':function(_0x2bad8b,_0x4f82ed,_0x2aea26){return _0x2bad8b(_0x4f82ed,_0x2aea26);}};var _0x5ca7dc=arguments[_0xdc4946(0x201)],_0x47762e=_0x5ca7dc<0x3?_0x320e6e:_0x2b0da7[_0xdc4946(0x20c)](_0xac223a,null)?_0xac223a=Object[_0xdc4946(0x20b)](_0x320e6e,_0x14fc82):_0xac223a,_0x5ee4a1;if(_0x2b0da7['OQrdQ'](typeof Reflect,_0xdc4946(0x1cc))&&_0x2b0da7[_0xdc4946(0x1ad)](typeof Reflect[_0xdc4946(0x1c7)],_0xdc4946(0x1a7)))_0x47762e=Reflect[_0xdc4946(0x1c7)](_0x2c66cc,_0x320e6e,_0x14fc82,_0xac223a);else{for(var _0x12b27e=_0x2b0da7[_0xdc4946(0x18e)](_0x2c66cc[_0xdc4946(0x201)],0x1);_0x12b27e>=0x0;_0x12b27e--)if(_0x5ee4a1=_0x2c66cc[_0x12b27e])_0x47762e=(_0x2b0da7[_0xdc4946(0x1ed)](_0x5ca7dc,0x3)?_0x2b0da7[_0xdc4946(0x1e8)](_0x5ee4a1,_0x47762e):_0x2b0da7['TKqCP'](_0x5ca7dc,0x3)?_0x5ee4a1(_0x320e6e,_0x14fc82,_0x47762e):_0x2b0da7[_0xdc4946(0x1ea)](_0x5ee4a1,_0x320e6e,_0x14fc82))||_0x47762e;}return _0x5ca7dc>0x3&&_0x47762e&&Object['defineProperty'](_0x320e6e,_0x14fc82,_0x47762e),_0x47762e;},__metadata=this&&this[a16_0x4d89ed(0x1c8)]||function(_0x15dd2e,_0x445707){const _0x33f181=a16_0x4d89ed,_0x22141b={'kYFpa':function(_0x4fcbaf,_0x233333){return _0x4fcbaf===_0x233333;},'gAMsN':'object','RqOcC':function(_0x187661,_0x443538){return _0x187661===_0x443538;},'rLHFK':_0x33f181(0x1a7)};if(_0x22141b[_0x33f181(0x1da)](typeof Reflect,_0x22141b[_0x33f181(0x1e4)])&&_0x22141b[_0x33f181(0x1fc)](typeof Reflect[_0x33f181(0x196)],_0x22141b[_0x33f181(0x1e2)]))return Reflect['metadata'](_0x15dd2e,_0x445707);},FlowEngine_1;Object[a16_0x4d89ed(0x1f7)](exports,a16_0x4d89ed(0x1f6),{'value':!![]}),exports[a16_0x4d89ed(0x19b)]=void 0x0;const common_1=require(a16_0x4d89ed(0x1ae)),flow_creator_1=require(a16_0x4d89ed(0x1c2)),flow_session_1=require(a16_0x4d89ed(0x1e5)),ollama_1=require(a16_0x4d89ed(0x1ee)),session_logger_1=require(a16_0x4d89ed(0x1a9)),core_config_1=require(a16_0x4d89ed(0x20e)),config_1=require(a16_0x4d89ed(0x1aa)),content_type_1=require(a16_0x4d89ed(0x19d)),constants_1=require('../utils/constants');let FlowEngine=FlowEngine_1=class FlowEngine{constructor(_0x2219cf){const _0x2a5a00=a16_0x4d89ed;this[_0x2a5a00(0x189)]={},this[_0x2a5a00(0x1bc)]={},core_config_1['CoreConfig'][_0x2a5a00(0x193)](_0x2219cf),this[_0x2a5a00(0x206)]=new flow_session_1[(_0x2a5a00(0x1ca))]();}[a16_0x4d89ed(0x1b0)](){return this['flowSession'];}async[a16_0x4d89ed(0x1f4)](_0x4557c1,_0x58a59f,_0x544ae4,_0x42bbef,_0x59435b){const _0x4a4734=a16_0x4d89ed,_0x73216e=await this[_0x4a4734(0x1c6)](_0x58a59f,_0x544ae4,_0x42bbef,{'config':_0x59435b});await this['composeHttpResponse'](_0x73216e,_0x4557c1);}async['runFlow'](_0x128e94,_0x3f7e5f,_0x8a75d8,_0x1a6c98){const _0x1d9b9a=a16_0x4d89ed,_0x5bc934={'qedUr':function(_0x361c56,_0x3afde7){return _0x361c56===_0x3afde7;},'pIfQg':_0x1d9b9a(0x1c1)};let _0x4aae6e;try{_0x4aae6e=await flow_creator_1[_0x1d9b9a(0x1a3)][_0x1d9b9a(0x19a)](_0x128e94,_0x8a75d8,this,_0x1a6c98),_0x8a75d8=_0x4aae6e[_0x1d9b9a(0x1b3)]();const _0x3ae4bb=await _0x4aae6e[_0x1d9b9a(0x1f4)](_0x3f7e5f);return await _0x4aae6e[_0x1d9b9a(0x1d7)](),_0x3ae4bb;}catch(_0x5e2c7a){if(_0x5bc934[_0x1d9b9a(0x1b6)](_0x5bc934[_0x1d9b9a(0x1b7)],_0x5bc934['pIfQg']))return await this[_0x1d9b9a(0x1bd)](_0x4aae6e,_0x8a75d8,_0x5e2c7a);else{if(_0x456ce1){const _0x41e0bc=_0x322268[_0x1d9b9a(0x1c3)](_0x30f4ab,arguments);return _0x4c01d2=null,_0x41e0bc;}}}}[a16_0x4d89ed(0x18b)](_0x253d1f,_0x16e2f1){const _0x42430b=a16_0x4d89ed,_0x1f9064={'XABmq':function(_0x597d4f,_0x29e19b){return _0x597d4f!=_0x29e19b;},'LoWNC':'Content-Type'};_0x16e2f1[_0x42430b(0x19e)](constants_1['K'][_0x42430b(0x1dc)],_0x253d1f[_0x42430b(0x192)]),!_0x253d1f['success']&&_0x16e2f1[_0x42430b(0x1d2)](common_1[_0x42430b(0x1be)][_0x42430b(0x18f)]),_0x253d1f[_0x42430b(0x204)]&&_0x1f9064[_0x42430b(0x20f)](_0x253d1f[_0x42430b(0x204)],content_type_1[_0x42430b(0x1ef)][_0x42430b(0x1ba)])?(_0x16e2f1[_0x42430b(0x19e)](_0x1f9064[_0x42430b(0x1cf)],_0x253d1f[_0x42430b(0x204)]),_0x16e2f1[_0x42430b(0x200)](_0x253d1f[_0x42430b(0x210)])):_0x16e2f1[_0x42430b(0x200)](_0x253d1f);}async[a16_0x4d89ed(0x1bd)](_0x59a5c3,_0x54809a,_0xbb9b64){const _0x1312c9=a16_0x4d89ed,_0x37b2ce={'FmOvm':'aborted','KtqLd':_0x1312c9(0x210)};if(_0x59a5c3)try{const _0x57963a=_0x59a5c3['getSessionDoc']();_0x57963a[_0x1312c9(0x1e9)]=_0x1312c9(0x1a1),new session_logger_1['SessionLogger'](_0x57963a)[_0x1312c9(0x1d0)](_0xbb9b64?.[_0x1312c9(0x210)]),await _0x59a5c3['saveSession']();}catch(_0x3248aa){}else{const [_0x2984bb,_0x27a27e]=await this['flowSession'][_0x1312c9(0x198)](_0x54809a);_0x27a27e[_0x1312c9(0x1e9)]=_0x37b2ce[_0x1312c9(0x1f5)],new session_logger_1['SessionLogger'](_0x27a27e)[_0x1312c9(0x1d0)](_0xbb9b64?.[_0x1312c9(0x210)]),await this[_0x1312c9(0x206)][_0x1312c9(0x1a8)](_0x27a27e);}return{'success':![],'message':_0xbb9b64[_0x37b2ce['KtqLd']],'completed':!![]};}async[a16_0x4d89ed(0x1ab)](_0x240083){const _0xcb40c5=a16_0x4d89ed,_0x47eea2={'uNJeQ':function(_0x4466f0,_0x2de3bd){return _0x4466f0!==_0x2de3bd;},'BGmQz':_0xcb40c5(0x1bb)};try{if(_0x240083){const _0x2d630a=await this['flowSession']['fetchAll'](_0x240083);_0x2d630a&&await this[_0xcb40c5(0x206)]['delete'](_0x2d630a['id']);}}catch(_0x12e3a9){if(_0x47eea2[_0xcb40c5(0x20a)](_0x47eea2[_0xcb40c5(0x1e1)],_0x47eea2[_0xcb40c5(0x1e1)])){let _0x43c85e=_0x47680f['DefaultUseTool'];_0x414a28===_0x281b09[_0xcb40c5(0x18c)]&&(_0x43c85e=_0x320f6f[_0xcb40c5(0x1b4)]),this[_0xcb40c5(0x1bc)]={...this[_0xcb40c5(0x1bc)],[_0xbdd192[_0xcb40c5(0x1f3)]]:{'modelClass':_0x1462a7,'params':_0x772c78,'useTool':_0x43c85e}};}else return{'false':!![],'message':_0xcb40c5(0x1d1)+_0x240083+'\x20failed'};}return{'success':!![],'session':_0x240083};}async[a16_0x4d89ed(0x18d)](_0x15a1f7){const _0x47ddd5=a16_0x4d89ed;this[_0x47ddd5(0x189)]={...this[_0x47ddd5(0x189)],..._0x15a1f7};}[a16_0x4d89ed(0x1f2)](_0x745d21){const _0x219b2a=a16_0x4d89ed;return this[_0x219b2a(0x189)][_0x745d21];}[a16_0x4d89ed(0x203)](_0x2c46b3){const _0x31c070=a16_0x4d89ed;this[_0x31c070(0x1bc)]={...this[_0x31c070(0x1bc)],..._0x2c46b3};}[a16_0x4d89ed(0x1c0)](_0x198116,_0x3e0035){const _0xaa3f7b=a16_0x4d89ed,_0x4d60d1={'wxGQM':_0xaa3f7b(0x1cd),'swXmV':function(_0x3879d7,_0x4097eb){return _0x3879d7===_0x4097eb;},'MrTKF':function(_0x4d8dcf,_0x12d234){return _0x4d8dcf===_0x12d234;},'JRMMp':_0xaa3f7b(0x1e0)};let _0x284cf8=FlowEngine_1['DefaultUseTool'];_0x4d60d1[_0xaa3f7b(0x1a6)](_0x198116,ollama_1[_0xaa3f7b(0x18c)])&&(_0x4d60d1[_0xaa3f7b(0x1b9)](_0x4d60d1['JRMMp'],_0x4d60d1[_0xaa3f7b(0x1af)])?_0x284cf8=FlowEngine_1[_0xaa3f7b(0x1b4)]:(_0x2e611a['header'](_0x4d60d1[_0xaa3f7b(0x1c9)],_0x1e400a[_0xaa3f7b(0x204)]),_0xb0335b[_0xaa3f7b(0x200)](_0x4588d2[_0xaa3f7b(0x210)]))),this[_0xaa3f7b(0x1bc)]={...this[_0xaa3f7b(0x1bc)],[_0x3e0035['model']]:{'modelClass':_0x198116,'params':_0x3e0035,'useTool':_0x284cf8}};}[a16_0x4d89ed(0x1bf)](_0x599871){const _0x1fbaf1=a16_0x4d89ed,_0x5a18b2={'Mmomw':_0x1fbaf1(0x1b2),'WPKnb':function(_0x43bc1e,_0x4a86b8){return _0x43bc1e===_0x4a86b8;},'eQQHl':_0x1fbaf1(0x1dd),'QlzkZ':function(_0x2f8c83,_0x399d2b){return _0x2f8c83===_0x399d2b;}};if(!_0x599871){if(_0x5a18b2[_0x1fbaf1(0x1e6)](_0x5a18b2[_0x1fbaf1(0x1b5)],_0x1fbaf1(0x190)))throw new _0x1b4e27(_0x5a18b2[_0x1fbaf1(0x1d3)]);else{const _0x32f6a2=Object[_0x1fbaf1(0x1db)](this[_0x1fbaf1(0x1bc)]);if(_0x5a18b2[_0x1fbaf1(0x1f8)](_0x32f6a2[_0x1fbaf1(0x201)],0x0))throw new Error(_0x5a18b2[_0x1fbaf1(0x1d3)]);else return this[_0x1fbaf1(0x1bc)][_0x32f6a2[0x0]];}}return this[_0x1fbaf1(0x1bc)][_0x599871];}[a16_0x4d89ed(0x1eb)](_0x2df918){const _0x1da36e=a16_0x4d89ed,_0x3f3413={'cFinZ':function(_0x5d6ceb,_0x32f4f4){return _0x5d6ceb<_0x32f4f4;},'lWeRK':function(_0x515cb0,_0x4091c1){return _0x515cb0===_0x4091c1;},'pNCaX':'object','BWlQL':function(_0x8d9c5f,_0x368f9e){return _0x8d9c5f-_0x368f9e;},'xiCSE':function(_0x254654,_0x5749f1){return _0x254654>_0x5749f1;},'SurFk':function(_0x375a52,_0x347c34,_0x48ce8d,_0x379e7a){return _0x375a52(_0x347c34,_0x48ce8d,_0x379e7a);},'SybmT':function(_0x527da0,_0x516491,_0x39fe5b){return _0x527da0(_0x516491,_0x39fe5b);},'Qqblf':function(_0x3a723b,_0x44237e){return _0x3a723b>_0x44237e;},'hnCVO':_0x1da36e(0x1b2)};if(!_0x2df918){const _0x5c9aa0=Object[_0x1da36e(0x1db)](this['llmRegister']);if(_0x3f3413[_0x1da36e(0x1df)](_0x5c9aa0['length'],0x0)){if(_0x3f3413[_0x1da36e(0x1df)](_0x1da36e(0x1a4),_0x1da36e(0x1a4)))throw new Error(_0x3f3413[_0x1da36e(0x1f1)]);else{var _0x33085a=arguments['length'],_0x503729=_0x3f3413[_0x1da36e(0x1e3)](_0x33085a,0x3)?_0x2f7259:_0x3f3413[_0x1da36e(0x1df)](_0x3eaaf6,null)?_0xf7b8b2=_0x885df7[_0x1da36e(0x20b)](_0x69f56b,_0x458870):_0x29b01c,_0x4c3202;if(_0x3f3413[_0x1da36e(0x1df)](typeof _0x5820e9,_0x3f3413[_0x1da36e(0x1ce)])&&typeof _0x5ad246[_0x1da36e(0x1c7)]===_0x1da36e(0x1a7))_0x503729=_0x3d6b56[_0x1da36e(0x1c7)](_0x3f280b,_0x36a649,_0x46ef77,_0x40f09d);else{for(var _0x464f3e=_0x3f3413[_0x1da36e(0x1b1)](_0x52f054[_0x1da36e(0x201)],0x1);_0x464f3e>=0x0;_0x464f3e--)if(_0x4c3202=_0x3553e5[_0x464f3e])_0x503729=(_0x3f3413[_0x1da36e(0x1e3)](_0x33085a,0x3)?_0x4c3202(_0x503729):_0x3f3413[_0x1da36e(0x1d5)](_0x33085a,0x3)?_0x3f3413['SurFk'](_0x4c3202,_0xc66e8c,_0x1f0675,_0x503729):_0x3f3413[_0x1da36e(0x20d)](_0x4c3202,_0x259886,_0x3a4853))||_0x503729;}return _0x3f3413['Qqblf'](_0x33085a,0x3)&&_0x503729&&_0x3c4247[_0x1da36e(0x1f7)](_0x445566,_0x2297a2,_0x503729),_0x503729;}}else return _0x5c9aa0[0x0];}else return _0x2df918;}};exports[a16_0x4d89ed(0x19b)]=FlowEngine,FlowEngine['DefaultUseTool']=(_0xd84194,_0x1667c9)=>{const _0x6eba71=a16_0x4d89ed,_0x4094a1={'RbqKC':function(_0x502e59,_0x3c5ad9){return _0x502e59>_0x3c5ad9;}};return _0x1667c9&&_0x4094a1[_0x6eba71(0x1d4)](_0x1667c9[_0x6eba71(0x201)],0x0)?_0xd84194[_0x6eba71(0x1c5)](_0x1667c9):_0xd84194;},FlowEngine[a16_0x4d89ed(0x1b4)]=(_0x23c5cc,_0x427414)=>{const _0x1b6713=a16_0x4d89ed,_0x377ba4={'gnPzZ':function(_0x57da54,_0x5f5893){return _0x57da54===_0x5f5893;},'AeIKC':'No\x20model\x20registered','gIkyM':function(_0x1ca204,_0x2587a2){return _0x1ca204>_0x2587a2;},'baCha':function(_0x314494,_0x52ce1d){return _0x314494!==_0x52ce1d;},'YzuRK':'HIntG','REVLv':'ppvgc','ZXVTx':_0x1b6713(0x1a2)};if(_0x427414&&_0x377ba4[_0x1b6713(0x1de)](_0x427414['length'],0x0)){if(_0x377ba4['baCha'](_0x377ba4[_0x1b6713(0x1fd)],_0x377ba4[_0x1b6713(0x194)]))return _0x23c5cc[_0x1b6713(0x1a5)]({'tools':_0x427414});else{if(!_0x426c0f){const _0x17c1f1=_0x20494f[_0x1b6713(0x1db)](this[_0x1b6713(0x1bc)]);if(_0x377ba4[_0x1b6713(0x1fe)](_0x17c1f1[_0x1b6713(0x201)],0x0))throw new _0x4ec34f(_0x377ba4[_0x1b6713(0x1b8)]);else return this[_0x1b6713(0x1bc)][_0x17c1f1[0x0]];}return this[_0x1b6713(0x1bc)][_0x3179b4];}}else return _0x377ba4[_0x1b6713(0x1fe)](_0x1b6713(0x1a2),_0x377ba4[_0x1b6713(0x1a0)])?_0x23c5cc:_0x285633&&_0x4e2d00[_0x1b6713(0x201)]>0x0?_0x21550b['bind']({'tools':_0x54592b}):_0x1d1e5e;},exports[a16_0x4d89ed(0x19b)]=FlowEngine=FlowEngine_1=__decorate([(0x0,common_1['Injectable'])(),__metadata(a16_0x4d89ed(0x1d9),[config_1[a16_0x4d89ed(0x1cb)]])],FlowEngine);
|
|
1
|
+
const a18_0x87eacd=a18_0x2ea2;(function(_0x1ae520,_0x3989c0){const _0x4982fe=a18_0x2ea2,_0x5781fe=_0x1ae520();while(!![]){try{const _0x516a4f=-parseInt(_0x4982fe(0x1c1))/0x1*(-parseInt(_0x4982fe(0x1db))/0x2)+-parseInt(_0x4982fe(0x20b))/0x3*(parseInt(_0x4982fe(0x1bb))/0x4)+-parseInt(_0x4982fe(0x1f3))/0x5*(parseInt(_0x4982fe(0x1b8))/0x6)+-parseInt(_0x4982fe(0x1c3))/0x7*(parseInt(_0x4982fe(0x1ae))/0x8)+-parseInt(_0x4982fe(0x1e7))/0x9+parseInt(_0x4982fe(0x20f))/0xa*(parseInt(_0x4982fe(0x1c0))/0xb)+parseInt(_0x4982fe(0x1ba))/0xc;if(_0x516a4f===_0x3989c0)break;else _0x5781fe['push'](_0x5781fe['shift']());}catch(_0xd97cfe){_0x5781fe['push'](_0x5781fe['shift']());}}}(a18_0x3172,0xa2e9f));const a18_0xdde002=(function(){let _0x489cd0=!![];return function(_0x39a589,_0x4c056a){const _0x225c2f=_0x489cd0?function(){const _0x3848f9=a18_0x2ea2;if(_0x4c056a){const _0x32f201=_0x4c056a[_0x3848f9(0x1ec)](_0x39a589,arguments);return _0x4c056a=null,_0x32f201;}}:function(){};return _0x489cd0=![],_0x225c2f;};}()),a18_0x2d37bd=a18_0xdde002(this,function(){const _0x2b0829=a18_0x2ea2,_0x1680ef={'nrGDP':'(((.+)+)+)+$'};return a18_0x2d37bd['toString']()['search'](_0x1680ef[_0x2b0829(0x1c2)])['toString']()['constructor'](a18_0x2d37bd)['search'](_0x1680ef['nrGDP']);});a18_0x2d37bd();'use strict';var __decorate=this&&this['__decorate']||function(_0x3e7a82,_0x505929,_0x5c6012,_0x54c9d3){const _0x42ecbc=a18_0x2ea2,_0x410a40={'IFaRc':function(_0x572068,_0x311720){return _0x572068===_0x311720;},'BlvgJ':_0x42ecbc(0x1dc),'Pymxr':function(_0x6028c1,_0x4a4bea){return _0x6028c1===_0x4a4bea;},'KDXCx':_0x42ecbc(0x1da),'ImPsO':function(_0x50f300,_0x11e789){return _0x50f300-_0x11e789;},'Kmjpn':function(_0x2ba3c4,_0xc5a9e3){return _0x2ba3c4>=_0xc5a9e3;},'ynIJw':function(_0x1e0c0c,_0x20d357){return _0x1e0c0c<_0x20d357;},'KReZv':function(_0x1d2998,_0x97ba10){return _0x1d2998(_0x97ba10);},'PvUdP':function(_0x19245,_0x488e33,_0x140753,_0x252956){return _0x19245(_0x488e33,_0x140753,_0x252956);},'IXOBu':function(_0x69fb0f,_0x40f4c9,_0x2dae55){return _0x69fb0f(_0x40f4c9,_0x2dae55);}};var _0x2e932c=arguments[_0x42ecbc(0x1e4)],_0x1d7b99=_0x2e932c<0x3?_0x505929:_0x410a40['IFaRc'](_0x54c9d3,null)?_0x54c9d3=Object[_0x42ecbc(0x210)](_0x505929,_0x5c6012):_0x54c9d3,_0x4bd00f;if(_0x410a40[_0x42ecbc(0x205)](typeof Reflect,_0x410a40['BlvgJ'])&&_0x410a40[_0x42ecbc(0x1fc)](typeof Reflect[_0x42ecbc(0x1bd)],_0x410a40[_0x42ecbc(0x208)]))_0x1d7b99=Reflect[_0x42ecbc(0x1bd)](_0x3e7a82,_0x505929,_0x5c6012,_0x54c9d3);else{for(var _0x553f08=_0x410a40[_0x42ecbc(0x200)](_0x3e7a82[_0x42ecbc(0x1e4)],0x1);_0x410a40['Kmjpn'](_0x553f08,0x0);_0x553f08--)if(_0x4bd00f=_0x3e7a82[_0x553f08])_0x1d7b99=(_0x410a40[_0x42ecbc(0x1f9)](_0x2e932c,0x3)?_0x410a40[_0x42ecbc(0x1ee)](_0x4bd00f,_0x1d7b99):_0x2e932c>0x3?_0x410a40[_0x42ecbc(0x1c4)](_0x4bd00f,_0x505929,_0x5c6012,_0x1d7b99):_0x410a40[_0x42ecbc(0x1d5)](_0x4bd00f,_0x505929,_0x5c6012))||_0x1d7b99;}return _0x2e932c>0x3&&_0x1d7b99&&Object['defineProperty'](_0x505929,_0x5c6012,_0x1d7b99),_0x1d7b99;},__metadata=this&&this['__metadata']||function(_0x56c75f,_0xfd158d){const _0x4cb542=a18_0x2ea2,_0x1cd90a={'hHqMt':function(_0x35b84e,_0xd36a6e){return _0x35b84e===_0xd36a6e;},'Mjcrk':'object','PhYPa':_0x4cb542(0x1da)};if(_0x1cd90a[_0x4cb542(0x1fb)](typeof Reflect,_0x1cd90a[_0x4cb542(0x1df)])&&typeof Reflect[_0x4cb542(0x1fa)]===_0x1cd90a['PhYPa'])return Reflect['metadata'](_0x56c75f,_0xfd158d);};function a18_0x2ea2(_0x2b0d27,_0x5df55e){const _0x20dc36=a18_0x3172();return a18_0x2ea2=function(_0x2d37bd,_0xdde002){_0x2d37bd=_0x2d37bd-0x1ae;let _0x3172f4=_0x20dc36[_0x2d37bd];return _0x3172f4;},a18_0x2ea2(_0x2b0d27,_0x5df55e);}Object[a18_0x87eacd(0x204)](exports,'__esModule',{'value':!![]}),exports['FlowEngine']=void 0x0;const common_1=require(a18_0x87eacd(0x1b1)),flow_creator_1=require('../flow/flow-creator'),flow_session_1=require(a18_0x87eacd(0x1b0)),session_logger_1=require('../session/session-logger'),core_config_1=require(a18_0x87eacd(0x1b3)),config_1=require(a18_0x87eacd(0x1d6)),content_type_1=require(a18_0x87eacd(0x1b2)),constants_1=require(a18_0x87eacd(0x1dd)),model_registry_1=require(a18_0x87eacd(0x1cc)),default_models_1=require('../models/default-models');let FlowEngine=class FlowEngine{constructor(_0x3d50b3){const _0x1310bb=a18_0x87eacd,_0xbdd9d1={'tDKWu':'1|2|3|4|0'},_0x319399=_0xbdd9d1[_0x1310bb(0x1eb)]['split']('|');let _0x1ca836=0x0;while(!![]){switch(_0x319399[_0x1ca836++]){case'0':this[_0x1310bb(0x1e1)]((0x0,default_models_1[_0x1310bb(0x1b7)])());continue;case'1':this[_0x1310bb(0x1e2)]={};continue;case'2':this['modelRegistry']=new model_registry_1['ModelRegistry']();continue;case'3':core_config_1[_0x1310bb(0x1d9)][_0x1310bb(0x20e)](_0x3d50b3);continue;case'4':this[_0x1310bb(0x20c)]=new flow_session_1[(_0x1310bb(0x20d))]();continue;}break;}}[a18_0x87eacd(0x1e9)](){return this['flowSession'];}async[a18_0x87eacd(0x1c7)](_0x5088d2,_0x3a32de,_0x3e04f5,_0x26b73b,_0x383596){const _0x29814=a18_0x87eacd,_0xb341e9=await this[_0x29814(0x1fd)](_0x3a32de,_0x3e04f5,_0x26b73b,{'config':_0x383596});await this[_0x29814(0x1cf)](_0xb341e9,_0x5088d2);}async[a18_0x87eacd(0x1fd)](_0x492471,_0x1db1b1,_0x21fc2a,_0x56f7dc){const _0x11d9e9=a18_0x87eacd;let _0x415261;try{_0x415261=await flow_creator_1['FlowCreator'][_0x11d9e9(0x1d8)](_0x492471,_0x21fc2a,this,_0x56f7dc),_0x21fc2a=_0x415261[_0x11d9e9(0x1d3)]();const _0x547ab9=await _0x415261['run'](_0x1db1b1);return await _0x415261[_0x11d9e9(0x1e3)](),_0x547ab9;}catch(_0x5969a8){return await this[_0x11d9e9(0x1af)](_0x415261,_0x21fc2a,_0x5969a8);}}[a18_0x87eacd(0x1cf)](_0x1659e0,_0xd9d9e9){const _0x1c348a=a18_0x87eacd,_0x57d0ba={'AREdp':function(_0x4a1e81,_0x2bf375){return _0x4a1e81!=_0x2bf375;},'dAxFl':_0x1c348a(0x1ea),'NMxvG':_0x1c348a(0x1f8),'mUkbY':_0x1c348a(0x1f0)};_0xd9d9e9[_0x1c348a(0x1b4)](constants_1['K'][_0x1c348a(0x1e5)],_0x1659e0[_0x1c348a(0x1e8)]),!_0x1659e0['success']&&_0xd9d9e9['status'](common_1[_0x1c348a(0x1f1)][_0x1c348a(0x1e6)]),_0x1659e0[_0x1c348a(0x1d0)]&&_0x57d0ba[_0x1c348a(0x1b9)](_0x1659e0['contentType'],content_type_1[_0x1c348a(0x203)][_0x1c348a(0x1cd)])?(_0xd9d9e9[_0x1c348a(0x1b4)](_0x57d0ba['dAxFl'],_0x1659e0[_0x1c348a(0x1d0)]),_0xd9d9e9[_0x1c348a(0x1de)](_0x1659e0[_0x1c348a(0x1ff)])):_0x57d0ba[_0x1c348a(0x1d7)]!==_0x57d0ba[_0x1c348a(0x1d1)]?_0xd9d9e9[_0x1c348a(0x1de)](_0x1659e0):this[_0x1c348a(0x1ef)][_0x1c348a(0x1b5)](_0x1550f8,_0x96b87b);}async['handleException'](_0xbcb25b,_0x5728fe,_0x9724f3){const _0xb84973=a18_0x87eacd,_0x52cccb={'FpFYk':function(_0x551300,_0x400d0e){return _0x551300===_0x400d0e;},'cmzuF':_0xb84973(0x1f6),'qeAtG':'aborted','XYKYk':function(_0x25d21a,_0x254262){return _0x25d21a===_0x254262;},'rrJxT':_0xb84973(0x211),'quYij':_0xb84973(0x201),'cPSXT':_0xb84973(0x1ff)};if(_0xbcb25b){if(_0x52cccb[_0xb84973(0x20a)](_0x52cccb[_0xb84973(0x1ca)],_0xb84973(0x1f6)))try{const _0x470ca6=_0xbcb25b[_0xb84973(0x1e0)]();_0x470ca6[_0xb84973(0x1f4)]=_0x52cccb[_0xb84973(0x202)],new session_logger_1[(_0xb84973(0x1c6))](_0x470ca6)[_0xb84973(0x207)](_0x9724f3?.[_0xb84973(0x1ff)]),await _0xbcb25b[_0xb84973(0x1e3)]();}catch(_0x343628){}else{const _0x14bed3=_0x3caa90?function(){const _0x3fe7c4=_0xb84973;if(_0x5820f2){const _0x596bbe=_0xfb9718[_0x3fe7c4(0x1ec)](_0x491703,arguments);return _0x129360=null,_0x596bbe;}}:function(){};return _0x53a2d4=![],_0x14bed3;}}else{if(_0x52cccb[_0xb84973(0x1c5)](_0x52cccb['rrJxT'],_0x52cccb[_0xb84973(0x1ce)])){const _0x840819=_0x221136[_0xb84973(0x1ec)](_0x11a444,arguments);return _0x41f242=null,_0x840819;}else{const [_0x48b7bc,_0x32f821]=await this[_0xb84973(0x20c)][_0xb84973(0x1be)](_0x5728fe);_0x32f821['runStatus']=_0x52cccb['qeAtG'],new session_logger_1[(_0xb84973(0x1c6))](_0x32f821)[_0xb84973(0x207)](_0x9724f3?.[_0xb84973(0x1ff)]),await this['flowSession'][_0xb84973(0x1d4)](_0x32f821);}}return{'success':![],'message':_0x9724f3[_0x52cccb[_0xb84973(0x1b6)]],'completed':!![]};}async[a18_0x87eacd(0x206)](_0x39302d){const _0x51718b=a18_0x87eacd;try{if(_0x39302d){const _0x18c215=await this[_0x51718b(0x20c)][_0x51718b(0x1fe)](_0x39302d);_0x18c215&&await this[_0x51718b(0x20c)][_0x51718b(0x1f2)](_0x18c215['id']);}}catch(_0x5e5192){return{'false':!![],'message':_0x51718b(0x1bf)+_0x39302d+_0x51718b(0x1d2)};}return{'success':!![],'session':_0x39302d};}async[a18_0x87eacd(0x1f7)](_0xb81c97){const _0x35daa4=a18_0x87eacd;this[_0x35daa4(0x1e2)]={...this[_0x35daa4(0x1e2)],..._0xb81c97};}[a18_0x87eacd(0x1bc)](_0x13ee6e){const _0x231ed2=a18_0x87eacd;return this[_0x231ed2(0x1e2)][_0x13ee6e];}[a18_0x87eacd(0x1e1)](_0x5064cc,_0x5693f1=![]){const _0x27eb1d=a18_0x87eacd;this['modelRegistry'][_0x27eb1d(0x1b5)](_0x5064cc,_0x5693f1);}[a18_0x87eacd(0x1f5)](_0x470269,_0xd75928=![]){const _0x350851=a18_0x87eacd;this[_0x350851(0x1ef)][_0x350851(0x1cb)](_0x470269,_0xd75928);}['getModel'](_0x8fed36){const _0x4628c3=a18_0x87eacd;return this[_0x4628c3(0x1ef)][_0x4628c3(0x209)](_0x8fed36);}[a18_0x87eacd(0x1ed)](_0x215112){const _0x317f74=a18_0x87eacd;return this[_0x317f74(0x1ef)][_0x317f74(0x1c8)](_0x215112);}};function a18_0x3172(){const _0x23c6f1=['CoreConfig','function','4aZLqBk','object','../utils/constants','send','Mjcrk','getSessionDoc','registerModels','flowRegistry','saveSession','length','ChatSessionID','BAD_REQUEST','10025244pHPdnU','session','getFlowSession','Content-Type','tDKWu','apply','getModelName','KReZv','modelRegistry','iYsPl','HttpStatus','delete','30kIroGx','runStatus','registerModel','yafCB','registerFlows','JDaFz','ynIJw','metadata','hHqMt','Pymxr','runFlow','fetchAll','message','ImPsO','uTtnD','qeAtG','HttpContentType','defineProperty','IFaRc','endChat','error','KDXCx','get','FpFYk','6mvyUmA','flowSession','FlowSession','setup','5355200TOQKwk','getOwnPropertyDescriptor','CKKua','24GDNEve','handleException','../session/flow-session','@nestjs/common','../flow/content-type','../configs/core-config','header','registerMany','cPSXT','createPopularModels','1021446MQQyFh','AREdp','34373700BfcQiY','107684fQpDGX','getFlow','decorate','fetch','Delete\x20session\x20','11QgDWab','249583EgWRHS','nrGDP','2432878BsaaNa','PvUdP','XYKYk','SessionLogger','run','getName','ConfigService','cmzuF','register','../models/model-registry','Plain','quYij','composeHttpResponse','contentType','mUkbY','\x20failed','getSessionId','save','IXOBu','@nestjs/config','NMxvG','create'];a18_0x3172=function(){return _0x23c6f1;};return a18_0x3172();}exports['FlowEngine']=FlowEngine,exports['FlowEngine']=FlowEngine=__decorate([(0x0,common_1['Injectable'])(),__metadata('design:paramtypes',[config_1[a18_0x87eacd(0x1c9)]])],FlowEngine);
|
package/session/cosmo-session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x1376a6=a19_0x5531;(function(_0x50de2b,_0x232800){const _0x5c51f2=a19_0x5531,_0x113265=_0x50de2b();while(!![]){try{const _0x5d6b8a=parseInt(_0x5c51f2(0x21c))/0x1+parseInt(_0x5c51f2(0x207))/0x2*(-parseInt(_0x5c51f2(0x206))/0x3)+parseInt(_0x5c51f2(0x229))/0x4+parseInt(_0x5c51f2(0x223))/0x5*(-parseInt(_0x5c51f2(0x238))/0x6)+parseInt(_0x5c51f2(0x22f))/0x7+-parseInt(_0x5c51f2(0x24a))/0x8*(-parseInt(_0x5c51f2(0x222))/0x9)+-parseInt(_0x5c51f2(0x21d))/0xa*(parseInt(_0x5c51f2(0x1f5))/0xb);if(_0x5d6b8a===_0x232800)break;else _0x113265['push'](_0x113265['shift']());}catch(_0x2f7afe){_0x113265['push'](_0x113265['shift']());}}}(a19_0x4777,0x29013));const a19_0x42af20=(function(){const _0x538cd2=a19_0x5531,_0x381e02={'vOgmJ':function(_0x48b5b6,_0x30d2d7){return _0x48b5b6!==_0x30d2d7;},'EoLSg':_0x538cd2(0x221),'NZgmL':_0x538cd2(0x22c),'UvfBS':function(_0x160efe,_0x37b53a){return _0x160efe===_0x37b53a;},'kpwhd':'eaEaG'};let _0x52e05f=!![];return function(_0x262ee3,_0x53107d){const _0x35a694=_0x538cd2,_0x53a47b={'fGZnu':function(_0x531352,_0x29cf0d){const _0xd2e26f=a19_0x5531;return _0x381e02[_0xd2e26f(0x21e)](_0x531352,_0x29cf0d);},'Vvnkf':_0x381e02['EoLSg'],'rJygf':_0x381e02[_0x35a694(0x210)],'QlJOf':function(_0x5bbf0c,_0x4f9013){const _0x5b61ec=_0x35a694;return _0x381e02[_0x5b61ec(0x243)](_0x5bbf0c,_0x4f9013);},'mSmWL':_0x381e02[_0x35a694(0x22a)]},_0x2ecec8=_0x52e05f?function(){const _0x367f90=_0x35a694;if(_0x53a47b[_0x367f90(0x200)](_0x53a47b['Vvnkf'],_0x53a47b[_0x367f90(0x24c)])){if(_0x53107d){if(_0x53a47b[_0x367f90(0x228)](_0x367f90(0x1fd),_0x53a47b[_0x367f90(0x1f9)])){const _0x1b6315=_0x53107d[_0x367f90(0x24d)](_0x262ee3,arguments);return _0x53107d=null,_0x1b6315;}else throw(0x0,_0x513b18[_0x367f90(0x1f6)])(_0x359d89,(0x0,_0x59533d['GET_SESSION_ERROR'])(_0x806d4));}}else{const _0x30c4c6=_0x345598[_0x367f90(0x24d)](_0x54c41d,arguments);return _0x3d6a08=null,_0x30c4c6;}}:function(){};return _0x52e05f=![],_0x2ecec8;};}()),a19_0x1d870e=a19_0x42af20(this,function(){const _0x9876f=a19_0x5531,_0x2aa351={'eeQyA':_0x9876f(0x245)};return a19_0x1d870e['toString']()[_0x9876f(0x234)](_0x2aa351[_0x9876f(0x214)])[_0x9876f(0x20d)]()['constructor'](a19_0x1d870e)['search'](_0x2aa351[_0x9876f(0x214)]);});a19_0x1d870e();function a19_0x5531(_0x1574fb,_0x1a2b5a){const _0x389bc5=a19_0x4777();return a19_0x5531=function(_0x1d870e,_0x42af20){_0x1d870e=_0x1d870e-0x1f2;let _0x477702=_0x389bc5[_0x1d870e];return _0x477702;},a19_0x5531(_0x1574fb,_0x1a2b5a);}'use strict';var __importDefault=this&&this[a19_0x1376a6(0x225)]||function(_0x21ea32){const _0x5a430d=a19_0x1376a6;return _0x21ea32&&_0x21ea32[_0x5a430d(0x208)]?_0x21ea32:{'default':_0x21ea32};};function a19_0x4777(){const _0x2c54ce=['FlowCreator','(((.+)+)+)+$','COWFM','BdnZG','query','CREATE_SESSION_ERROR','696ZVWLnO','ojKNn','rJygf','apply','uvCyf','defineProperty','length','aborted','qyLCr','saveOn','6743feYeYG','WrapError','getContainer','cSiwA','mSmWL','SessionAdaptor','completed','pEhCR','eaEaG','cosmoDbId','../configs/core-config','fGZnu','fetchAll','runStatus','items','dsvJH','../utils/errors','39AtlQkt','13078qsUOwO','__esModule','create','restore','default','CosmoSession','toString','fetch','EyeVH','NZgmL','Nnsfy','cosmoDbUrl','diff','eeQyA','BbsYR','OYCnm','KnYNq','cosmoDbSessionId','CoreConfig','item','GET_SESSION_ERROR','192187tNRCfF','10120kVPPGN','vOgmJ','DELETE_SESSION_ERROR','save','noBQt','32598HWMwej','100380IANgSm','utc','__importDefault','oUiUD','cosmoDbKey','QlJOf','565312iNlvsj','kpwhd','TVeSE','TZqUK','createDoc','sessionExpiration','1994419vWZgty','dqLTG','FWXcY','upsert','IRtJi','search','client','hCQUz','xrWjL','18lDTJAa','hWzlp','LzPMZ','WQvyj','createIfNotExists','moment','ajgiC','./session-adaptor','databases','error','seconds','UvfBS'];a19_0x4777=function(){return _0x2c54ce;};return a19_0x4777();}Object[a19_0x1376a6(0x24f)](exports,a19_0x1376a6(0x208),{'value':!![]}),exports['CosmoSession']=void 0x0;const flow_creator_1=require('../flow/flow-creator'),errors_1=require(a19_0x1376a6(0x205)),session_adaptor_1=require(a19_0x1376a6(0x23f)),cosmos_1=require('@azure/cosmos'),core_config_1=require(a19_0x1376a6(0x1ff)),moment_1=__importDefault(require(a19_0x1376a6(0x23d)));class CosmoSession extends session_adaptor_1[a19_0x1376a6(0x1fa)]{constructor(){const _0x508915=a19_0x1376a6;super();const _0x5c1a3c=core_config_1[_0x508915(0x219)][_0x508915(0x212)],_0x4427b6=core_config_1[_0x508915(0x219)][_0x508915(0x227)];this[_0x508915(0x235)]=new cosmos_1['CosmosClient']({'endpoint':_0x5c1a3c,'key':_0x4427b6});}async[a19_0x1376a6(0x20e)](_0x16d7b4){const _0x79c817=a19_0x1376a6,_0x2203cc={'hWzlp':_0x79c817(0x242),'OYCnm':function(_0x591bc5,_0x109e7d){return _0x591bc5<=_0x109e7d;},'WcQSv':function(_0x4524c5,_0x396e6f){return _0x4524c5!==_0x396e6f;},'hCQUz':'SyDpQ','KnYNq':function(_0x2591d2,_0x5a7885){return _0x2591d2===_0x5a7885;},'xrWjL':_0x79c817(0x1fb),'qyLCr':_0x79c817(0x1f2)};let _0x16d1b0;if(_0x16d7b4){if(_0x2203cc['WcQSv'](_0x79c817(0x211),_0x2203cc[_0x79c817(0x236)]))_0x16d1b0=await this['restore'](_0x16d7b4),_0x16d1b0&&((_0x2203cc['KnYNq'](_0x16d1b0[_0x79c817(0x202)],_0x2203cc[_0x79c817(0x237)])||_0x2203cc[_0x79c817(0x217)](_0x16d1b0[_0x79c817(0x202)],_0x2203cc[_0x79c817(0x1f3)]))&&(_0x79c817(0x226)!==_0x79c817(0x226)?_0x233838=null:_0x16d1b0=null));else{const _0x3374dc=(0x0,_0x5c3fa7[_0x79c817(0x20b)])()[_0x79c817(0x224)](),_0x4176a3=(0x0,_0x4dc108[_0x79c817(0x20b)])(_0x2981ba[_0x79c817(0x1f4)])[_0x79c817(0x224)](),_0x50195e=_0x3374dc[_0x79c817(0x213)](_0x4176a3,_0x2203cc[_0x79c817(0x239)]);if(_0x2203cc[_0x79c817(0x216)](_0x50195e,_0x3db7c8[_0x79c817(0x219)][_0x79c817(0x22e)]))return _0x344c7c;}}if(_0x16d1b0)return[![],_0x16d1b0];else{const _0x52ff29=await this[_0x79c817(0x209)]();return[!![],_0x52ff29];}}async[a19_0x1376a6(0x201)](_0x50c71b){const _0x3e6856=a19_0x1376a6,_0x5d1872={'uvCyf':function(_0x4cd436,_0x560c7b){return _0x4cd436===_0x560c7b;},'IRtJi':_0x3e6856(0x20f)};let _0x3a239a;if(_0x50c71b){if(_0x5d1872[_0x3e6856(0x24e)](_0x5d1872[_0x3e6856(0x233)],_0x5d1872['IRtJi']))_0x3a239a=await this[_0x3e6856(0x20a)](_0x50c71b);else{if(_0x157384){const _0x325246=_0x308a1d[_0x3e6856(0x24d)](_0x13c61f,arguments);return _0x1b5e84=null,_0x325246;}}}return _0x3a239a;}async[a19_0x1376a6(0x20a)](_0x1850f6){const _0x595f24=a19_0x1376a6,_0x2546d7={'HuTsz':function(_0x5b5420,_0x4789a9){return _0x5b5420===_0x4789a9;},'WQvyj':_0x595f24(0x215),'dsvJH':_0x595f24(0x242),'COWFM':function(_0x44f447,_0x17ae95){return _0x44f447<=_0x17ae95;},'LzPMZ':function(_0x572e4b,_0x3d4b93){return _0x572e4b!==_0x3d4b93;},'BdnZG':_0x595f24(0x231),'ajgiC':function(_0x1bfec4,_0x18a14c){return _0x1bfec4!==_0x18a14c;}};try{if(_0x2546d7['HuTsz'](_0x2546d7[_0x595f24(0x23b)],_0x595f24(0x215))){const _0x489916='SELECT\x20*\x20FROM\x20c\x20WHERE\x20c.id=\x27'+_0x1850f6+'\x27',_0x57ef89=await this[_0x595f24(0x1f7)](),{resources:_0x363558}=await _0x57ef89['items'][_0x595f24(0x248)](_0x489916)[_0x595f24(0x201)](),_0xdab3b6=_0x363558,_0x5d1db6=_0xdab3b6[_0x595f24(0x250)]===0x0?undefined:_0xdab3b6[0x0];if(_0x5d1db6&&_0x5d1db6[_0x595f24(0x1f4)]){const _0x455d02=(0x0,moment_1[_0x595f24(0x20b)])()[_0x595f24(0x224)](),_0x114ef5=(0x0,moment_1['default'])(_0x5d1db6[_0x595f24(0x1f4)])[_0x595f24(0x224)](),_0x53ad4b=_0x455d02[_0x595f24(0x213)](_0x114ef5,_0x2546d7[_0x595f24(0x204)]);if(_0x2546d7[_0x595f24(0x246)](_0x53ad4b,core_config_1[_0x595f24(0x219)][_0x595f24(0x22e)]))return _0x2546d7[_0x595f24(0x23a)](_0x2546d7[_0x595f24(0x247)],_0x2546d7[_0x595f24(0x247)])?[![],_0x2eeae7]:_0x5d1db6;}return null;}else throw(0x0,_0x4377c0[_0x595f24(0x1f6)])(_0x4145a8,(0x0,_0x573af3[_0x595f24(0x249)])());}catch(_0x673468){if(_0x2546d7[_0x595f24(0x23e)]('TuiSm',_0x595f24(0x230)))throw(0x0,errors_1[_0x595f24(0x1f6)])(_0x673468,(0x0,errors_1[_0x595f24(0x21b)])(_0x1850f6));else return _0x8ed311&&_0x2d375c['__esModule']?_0x1d2ebd:{'default':_0x126c55};}}async['create'](){const _0x2d9242=a19_0x1376a6;try{const _0x2b330f=await flow_creator_1[_0x2d9242(0x244)][_0x2d9242(0x22d)](),_0x27576f=await this['getContainer']();return await _0x27576f[_0x2d9242(0x203)][_0x2d9242(0x209)](_0x2b330f),_0x2b330f;}catch(_0x50515c){throw(0x0,errors_1[_0x2d9242(0x1f6)])(_0x50515c,(0x0,errors_1['CREATE_SESSION_ERROR'])());}}async[a19_0x1376a6(0x220)](_0x52cd7d){const _0x109cb0=a19_0x1376a6,_0x2aaf19={'ojKNn':function(_0x17bed3,_0x5f316e){return _0x17bed3!==_0x5f316e;},'BEcHv':'JVNnL','pEhCR':function(_0xb9f1c8,_0x132520){return _0xb9f1c8!==_0x132520;},'TVeSE':'MarlD'};try{if(_0x2aaf19[_0x109cb0(0x24b)](_0x109cb0(0x1f8),_0x2aaf19['BEcHv'])){const _0x134371=await this[_0x109cb0(0x1f7)]();await _0x134371[_0x109cb0(0x203)][_0x109cb0(0x232)](_0x52cd7d);}else _0x1a546c[_0x109cb0(0x241)]((0x0,_0x51554e[_0x109cb0(0x1f6)])(_0x173d85,(0x0,_0x451f08[_0x109cb0(0x21f)])(_0x3bc774)));}catch(_0x3128df){if(_0x2aaf19[_0x109cb0(0x1fc)](_0x2aaf19[_0x109cb0(0x22b)],_0x2aaf19[_0x109cb0(0x22b)]))return _0x3591e4;else throw(0x0,errors_1['WrapError'])(_0x3128df,(0x0,errors_1['UPDATE_SESSION_ERROR'])(_0x52cd7d['id']));}}async['delete'](_0x54aa26){const _0x3af559=a19_0x1376a6;try{const _0x567698=await this[_0x3af559(0x1f7)]();await _0x567698[_0x3af559(0x21a)](_0x54aa26,_0x54aa26)['delete']();}catch(_0x5015fd){console[_0x3af559(0x241)]((0x0,errors_1[_0x3af559(0x1f6)])(_0x5015fd,(0x0,errors_1[_0x3af559(0x21f)])(_0x54aa26)));}}async[a19_0x1376a6(0x1f7)](){const _0x47e16c=a19_0x1376a6,{database:_0x5cbabe}=await this[_0x47e16c(0x235)][_0x47e16c(0x240)][_0x47e16c(0x23c)]({'id':core_config_1[_0x47e16c(0x219)][_0x47e16c(0x1fe)]}),{container:_0xa0ac91}=await _0x5cbabe['containers']['createIfNotExists']({'id':core_config_1['CoreConfig'][_0x47e16c(0x218)]});return _0xa0ac91;}}exports[a19_0x1376a6(0x20c)]=CosmoSession;
|
package/session/file-session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x233eaf=a18_0x1c40;function a18_0x1c40(_0x234e91,_0x308d0f){const _0x1a45dd=a18_0x7355();return a18_0x1c40=function(_0x591f42,_0xa7292c){_0x591f42=_0x591f42-0xd6;let _0x735505=_0x1a45dd[_0x591f42];return _0x735505;},a18_0x1c40(_0x234e91,_0x308d0f);}(function(_0x414581,_0x51b8ba){const _0x414fec=a18_0x1c40,_0x34f5cc=_0x414581();while(!![]){try{const _0x4cb37a=-parseInt(_0x414fec(0xe9))/0x1+parseInt(_0x414fec(0xf9))/0x2*(-parseInt(_0x414fec(0x137))/0x3)+parseInt(_0x414fec(0x138))/0x4+-parseInt(_0x414fec(0xfa))/0x5*(-parseInt(_0x414fec(0x10e))/0x6)+-parseInt(_0x414fec(0xea))/0x7+parseInt(_0x414fec(0x11e))/0x8+parseInt(_0x414fec(0xf7))/0x9;if(_0x4cb37a===_0x51b8ba)break;else _0x34f5cc['push'](_0x34f5cc['shift']());}catch(_0x29487d){_0x34f5cc['push'](_0x34f5cc['shift']());}}}(a18_0x7355,0xea905));const a18_0xa7292c=(function(){const _0x1d3bb0=a18_0x1c40,_0xe6cae0={'AEuHN':_0x1d3bb0(0xf8)};let _0x37b8cc=!![];return function(_0x50f80f,_0x4006ca){const _0x3c4b55=_0x1d3bb0;if(_0xe6cae0[_0x3c4b55(0xef)]!==_0xe6cae0[_0x3c4b55(0xef)])_0x447aaf['mkdirSync'](_0x31ceb0,{'recursive':!![]});else{const _0x3466f8=_0x37b8cc?function(){const _0x3e4648=_0x3c4b55;if(_0x4006ca){const _0x103ba8=_0x4006ca[_0x3e4648(0x100)](_0x50f80f,arguments);return _0x4006ca=null,_0x103ba8;}}:function(){};return _0x37b8cc=![],_0x3466f8;}};}()),a18_0x591f42=a18_0xa7292c(this,function(){const _0x1fc027=a18_0x1c40,_0x522925={'TzNUT':_0x1fc027(0xe6)};return a18_0x591f42[_0x1fc027(0x106)]()[_0x1fc027(0x118)](_0x1fc027(0xe6))[_0x1fc027(0x106)]()[_0x1fc027(0x10b)](a18_0x591f42)[_0x1fc027(0x118)](_0x522925['TzNUT']);});a18_0x591f42();'use strict';var __createBinding=this&&this[a18_0x233eaf(0x117)]||(Object[a18_0x233eaf(0xf5)]?function(_0x4630aa,_0x475305,_0x2877a4,_0x5dd491){const _0xe99ed8=a18_0x233eaf,_0x109206={'LdZRq':function(_0x1f46ab,_0x5bceb3){return _0x1f46ab===_0x5bceb3;},'tLoXo':function(_0x34d2d8,_0x92a3ad){return _0x34d2d8 in _0x92a3ad;},'khUCh':'get','KxKJk':'nuQtG'};if(_0x109206[_0xe99ed8(0x108)](_0x5dd491,undefined))_0x5dd491=_0x2877a4;var _0x1267f6=Object[_0xe99ed8(0xf2)](_0x475305,_0x2877a4);if(!_0x1267f6||(_0x109206[_0xe99ed8(0x126)](_0x109206[_0xe99ed8(0x12e)],_0x1267f6)?!_0x475305['__esModule']:_0x1267f6[_0xe99ed8(0xff)]||_0x1267f6[_0xe99ed8(0xdb)])){if(_0x109206[_0xe99ed8(0x108)](_0x109206[_0xe99ed8(0x11c)],_0xe99ed8(0xdc))){if(_0x46a013===_0x34ea72)_0x2a9ecf=_0x23d792;_0x19cee1[_0xc14bd9]=_0xf156ee[_0x555464];}else _0x1267f6={'enumerable':!![],'get':function(){return _0x475305[_0x2877a4];}};}Object[_0xe99ed8(0x130)](_0x4630aa,_0x5dd491,_0x1267f6);}:function(_0x528e69,_0x2a28e2,_0x33706b,_0x487025){const _0xc15f92=a18_0x233eaf,_0x1959c0={'mWIkF':function(_0x12e839,_0x3e05e2){return _0x12e839===_0x3e05e2;}};if(_0x1959c0[_0xc15f92(0xfc)](_0x487025,undefined))_0x487025=_0x33706b;_0x528e69[_0x487025]=_0x2a28e2[_0x33706b];}),__setModuleDefault=this&&this[a18_0x233eaf(0x12a)]||(Object[a18_0x233eaf(0xf5)]?function(_0x3e4bff,_0xaed584){const _0x1ba5c2=a18_0x233eaf,_0x29d19c={'QEIVr':_0x1ba5c2(0xdf)};Object[_0x1ba5c2(0x130)](_0x3e4bff,_0x29d19c['QEIVr'],{'enumerable':!![],'value':_0xaed584});}:function(_0x5293b5,_0x11f004){const _0x408c70=a18_0x233eaf,_0x396590={'apfCZ':_0x408c70(0xdf)};_0x5293b5[_0x396590['apfCZ']]=_0x11f004;}),__importStar=this&&this[a18_0x233eaf(0x129)]||function(_0x117fca){const _0xe09c68=a18_0x233eaf,_0x1ce29f={'Fkgsc':_0xe09c68(0xd9),'yMYAi':function(_0xc1a690,_0x3d4b9e){return _0xc1a690!=_0x3d4b9e;},'EQbyQ':function(_0x53e753,_0x2c5614){return _0x53e753!==_0x2c5614;},'lathj':_0xe09c68(0xdf)},_0xa0a8e9=_0x1ce29f[_0xe09c68(0xeb)][_0xe09c68(0x10a)]('|');let _0x3c4817=0x0;while(!![]){switch(_0xa0a8e9[_0x3c4817++]){case'0':if(_0x117fca&&_0x117fca[_0xe09c68(0xe3)])return _0x117fca;continue;case'1':return _0x45970a;case'2':if(_0x1ce29f['yMYAi'](_0x117fca,null)){for(var _0xe1f201 in _0x117fca)if(_0x1ce29f['EQbyQ'](_0xe1f201,_0x1ce29f[_0xe09c68(0x121)])&&Object[_0xe09c68(0x12c)]['hasOwnProperty'][_0xe09c68(0x125)](_0x117fca,_0xe1f201))__createBinding(_0x45970a,_0x117fca,_0xe1f201);}continue;case'3':__setModuleDefault(_0x45970a,_0x117fca);continue;case'4':var _0x45970a={};continue;}break;}};Object[a18_0x233eaf(0x130)](exports,a18_0x233eaf(0xe3),{'value':!![]}),exports['FileSession']=void 0x0;function a18_0x7355(){const _0x594384=['ZTRbQ','gbSDk','RXXCe','__createBinding','search','DbKVY','readFileSync','parse','KxKJk','save','10986760AvNvhj','LrHVE','XDvbd','lathj','utf-8','YxKJI','join','call','tLoXo','path','fcgBy','__importStar','__setModuleDefault','wsImt','prototype','runStatus','khUCh','lwyuF','defineProperty','WrapError','QthfP','/session.json','qOiWb','fetch','error','4111527PdWMuK','2222364qgoBLD','Error\x20saving\x20messages:','createDoc','URgmV','mkdirSync','0|4|2|3|1','jdCpH','configurable','mMsQa','fetchAll','completed','default','xINOg','XqFMY','GPYYn','__esModule','HxOKp','LZYRo','(((.+)+)+)+$','YYhHi','uIZaD','1154986glKPLi','11888044ElLIXG','Fkgsc','yfwmq','session.json','aborted','AEuHN','existsSync','BIvof','getOwnPropertyDescriptor','WrVGV','FlowCreator','create','WSLAH','26600922QiCjJG','HfcfO','2LCtmZO','10eQePol','UhSay','mWIkF','oNLVL','../../ignore/','writable','apply','qddBQ','dirname','restore','UxbEC','btTsQ','toString','nWvGa','LdZRq','msGCU','split','constructor','./session-adaptor','filePath','899898DrILRN','AnWor','writeFileSync','delete','xNcbd','SessionAdaptor'];a18_0x7355=function(){return _0x594384;};return a18_0x7355();}const fs=__importStar(require('fs')),path=__importStar(require(a18_0x233eaf(0x127))),errors_1=require('../utils/errors'),flow_creator_1=require('../flow/flow-creator'),session_adaptor_1=require(a18_0x233eaf(0x10c));class FileSession extends session_adaptor_1[a18_0x233eaf(0x113)]{constructor(){const _0x5ab18d=a18_0x233eaf,_0xbfe967={'qXmmQ':_0x5ab18d(0xed)};super(),this[_0x5ab18d(0x10d)]=path[_0x5ab18d(0x124)](__dirname,_0xbfe967['qXmmQ']);}async[a18_0x233eaf(0x135)](_0x357da5){const _0x44d842=a18_0x233eaf,_0x1ee43c={'qOiWb':_0x44d842(0xdf),'XqFMY':function(_0x4a5bd2,_0x2c2759){return _0x4a5bd2===_0x2c2759;},'AnWor':_0x44d842(0xf6),'GPYYn':function(_0x5bc794,_0x38af59){return _0x5bc794===_0x38af59;},'ZTRbQ':_0x44d842(0xfd),'UhSay':function(_0xc4a840,_0x2a5b66){return _0xc4a840===_0x2a5b66;},'RXXCe':_0x44d842(0xee),'okRwf':function(_0x287020,_0x27041d){return _0x287020!==_0x27041d;},'nWvGa':_0x44d842(0x120),'DuYgN':_0x44d842(0x109)};let _0x28c794;if(_0x357da5){if(_0x1ee43c[_0x44d842(0xe1)](_0x44d842(0x115),_0x1ee43c[_0x44d842(0x10f)]))return null;else{_0x28c794=await this[_0x44d842(0x103)](_0x357da5);if(_0x28c794){if(_0x1ee43c[_0x44d842(0xe2)](_0x1ee43c[_0x44d842(0x114)],_0x1ee43c['ZTRbQ'])){if(_0x28c794[_0x44d842(0x12d)]===_0x44d842(0xde)||_0x1ee43c[_0x44d842(0xfb)](_0x28c794[_0x44d842(0x12d)],_0x1ee43c[_0x44d842(0x116)])){if(_0x1ee43c['okRwf'](_0x44d842(0x132),_0x1ee43c[_0x44d842(0x107)]))_0x28c794=null;else{if(_0x36d6ec){const _0x16a595=_0x334841[_0x44d842(0x100)](_0x12ef43,arguments);return _0xb194f7=null,_0x16a595;}}}}else _0x155c7b=null;}}}if(_0x28c794){if(_0x44d842(0xe8)===_0x1ee43c['DuYgN'])_0x5e7f5a[_0x1ee43c[_0x44d842(0x134)]]=_0x261d01;else return _0x28c794['id']=_0x357da5,[![],_0x28c794];}else{const _0x501e50=await this[_0x44d842(0xf5)]();return this[_0x44d842(0x10d)]=path['join'](__dirname,_0x44d842(0xfe)+_0x501e50['id']+_0x44d842(0x133)),[!![],_0x501e50];}}async[a18_0x233eaf(0xdd)](_0x41f203){const _0x35c022=a18_0x233eaf;let _0x5bea37;return _0x41f203&&(_0x5bea37=await this[_0x35c022(0x103)](_0x41f203)),_0x5bea37&&(_0x5bea37['id']=_0x41f203),_0x5bea37;}async[a18_0x233eaf(0xf5)](){const _0x3db55c=a18_0x233eaf,_0x5bd49b=await flow_creator_1[_0x3db55c(0xf4)][_0x3db55c(0xd6)]();return _0x5bd49b;}async['restore'](_0x253865){const _0x1e8b67=a18_0x233eaf,_0x2723b6={'BIvof':_0x1e8b67(0x122),'qddBQ':_0x1e8b67(0xe7),'DbKVY':_0x1e8b67(0xe4)};try{this[_0x1e8b67(0x10d)]=path[_0x1e8b67(0x124)](__dirname,_0x1e8b67(0xfe)+_0x253865+_0x1e8b67(0x133));const _0x1a3fe0=fs[_0x1e8b67(0x11a)](this[_0x1e8b67(0x10d)],_0x2723b6[_0x1e8b67(0xf1)]),_0x1a86bd=JSON[_0x1e8b67(0x11b)](_0x1a3fe0);return _0x1a86bd;}catch(_0x494ea9){return _0x2723b6[_0x1e8b67(0x101)]!==_0x2723b6[_0x1e8b67(0x119)]?null:(_0x4cafc4['id']=_0x404dfa,[![],_0x16c9c2]);}}async[a18_0x233eaf(0x11d)](_0x2432f9){const _0x12b201=a18_0x233eaf,_0x591035={'DtigV':_0x12b201(0x122),'jdCpH':_0x12b201(0x139),'fcgBy':function(_0x30f443,_0x4f5315){return _0x30f443===_0x4f5315;},'yfwmq':function(_0x4c4d95,_0x30b4bc){return _0x4c4d95 in _0x30b4bc;},'CDoQX':_0x12b201(0x11f),'wsImt':_0x12b201(0xd7)};try{if(_0x591035['CDoQX']===_0x12b201(0xf3))try{const _0x48c495=_0x3fb3a6['dirname'](this[_0x12b201(0x10d)]);!_0x15568a[_0x12b201(0xf0)](_0x48c495)&&_0x2a3841['mkdirSync'](_0x48c495,{'recursive':!![]}),_0x3fc3d9['writeFileSync'](this['filePath'],_0x3d2899['stringify'](_0x271221),_0x591035['DtigV']);}catch(_0x4e92ea){_0x3d1276['error'](_0x591035[_0x12b201(0xda)],_0x4e92ea);}else{const _0x29a6a4=path[_0x12b201(0x102)](this[_0x12b201(0x10d)]);if(!fs[_0x12b201(0xf0)](_0x29a6a4)){if(_0x591035[_0x12b201(0x12b)]!==_0x12b201(0x112))fs[_0x12b201(0xd8)](_0x29a6a4,{'recursive':!![]});else{if(_0x591035[_0x12b201(0x128)](_0x359552,_0xc81f6))_0x1deca8=_0x1d605e;var _0x26c2a3=_0x22cb93[_0x12b201(0xf2)](_0x48bbb1,_0x2524cb);(!_0x26c2a3||(_0x591035[_0x12b201(0xec)]('get',_0x26c2a3)?!_0x3465d2[_0x12b201(0xe3)]:_0x26c2a3[_0x12b201(0xff)]||_0x26c2a3[_0x12b201(0xdb)]))&&(_0x26c2a3={'enumerable':!![],'get':function(){return _0x3f83b8[_0x3729f6];}}),_0x3f68cb[_0x12b201(0x130)](_0x19de5d,_0x4db7de,_0x26c2a3);}}fs[_0x12b201(0x110)](this['filePath'],JSON['stringify'](_0x2432f9),_0x591035['DtigV']);}}catch(_0x12af01){console[_0x12b201(0x136)](_0x12b201(0x139),_0x12af01);}}async[a18_0x233eaf(0x111)](_0x311eac){const _0x292538=a18_0x233eaf,_0x4d8734={'UxbEC':function(_0x584081,_0x37d9df){return _0x584081!==_0x37d9df;},'YxKJI':_0x292538(0x12f),'LZYRo':'UBCwt','xINOg':_0x292538(0x105)};try{_0x4d8734[_0x292538(0x104)](_0x4d8734[_0x292538(0x123)],_0x4d8734['YxKJI'])?_0x33c30b['id']=_0x26593c:await fs['unlink'](this[_0x292538(0x10d)],_0x138076=>{});}catch(_0x37e47d){if(_0x4d8734[_0x292538(0xe5)]===_0x4d8734[_0x292538(0xe0)])return _0x1ef6e2[_0x1c184d];else console[_0x292538(0x136)]((0x0,errors_1[_0x292538(0x131)])(_0x37e47d,(0x0,errors_1['DELETE_SESSION_ERROR'])(_0x311eac)));}}}exports['FileSession']=FileSession;
|
|
1
|
+
const a20_0x592b49=a20_0x5213;(function(_0xe263e3,_0x3bced5){const _0xc8d5e7=a20_0x5213,_0xab5b73=_0xe263e3();while(!![]){try{const _0x162e65=-parseInt(_0xc8d5e7(0x1c9))/0x1*(parseInt(_0xc8d5e7(0x1c8))/0x2)+parseInt(_0xc8d5e7(0x1dc))/0x3*(-parseInt(_0xc8d5e7(0x20b))/0x4)+parseInt(_0xc8d5e7(0x1be))/0x5+-parseInt(_0xc8d5e7(0x1d6))/0x6+parseInt(_0xc8d5e7(0x1f7))/0x7+parseInt(_0xc8d5e7(0x1d3))/0x8+parseInt(_0xc8d5e7(0x1d0))/0x9;if(_0x162e65===_0x3bced5)break;else _0xab5b73['push'](_0xab5b73['shift']());}catch(_0x343ec1){_0xab5b73['push'](_0xab5b73['shift']());}}}(a20_0x3564,0xa4f89));const a20_0x2c9ea8=(function(){const _0x4d4fba=a20_0x5213,_0xb04d74={'neBfr':function(_0x596af2,_0x430b16){return _0x596af2===_0x430b16;},'rRfhD':_0x4d4fba(0x1ca),'VqXlz':_0x4d4fba(0x1c4),'PIJkN':_0x4d4fba(0x1f6)};let _0x182a3a=!![];return function(_0x7fd32a,_0x478c97){const _0x5b5b41=_0x4d4fba,_0x3087c3={'bQhAN':function(_0x59014d,_0x30b72d){const _0x4fbbf6=a20_0x5213;return _0xb04d74[_0x4fbbf6(0x1b9)](_0x59014d,_0x30b72d);},'UOlBK':_0xb04d74[_0x5b5b41(0x1ee)],'BGhRf':_0x5b5b41(0x204)};if(_0xb04d74['VqXlz']!==_0xb04d74[_0x5b5b41(0x1c6)]){const _0x25f80d=_0x182a3a?function(){const _0x13d0b6=_0x5b5b41,_0x538f53={'BUwIx':_0x13d0b6(0x1ef)};if(_0x478c97){if(_0x3087c3['bQhAN'](_0x3087c3['UOlBK'],_0x3087c3[_0x13d0b6(0x1d4)])){const _0x5b741e=_0x478c97[_0x13d0b6(0x1db)](_0x7fd32a,arguments);return _0x478c97=null,_0x5b741e;}else _0x2d2510[_0x538f53[_0x13d0b6(0x207)]]=_0x364842;}}:function(){};return _0x182a3a=![],_0x25f80d;}else{this[_0x5b5b41(0x1fa)]=_0x52e85e['join'](_0x26f50a,_0x5b5b41(0x1d5)+_0x354450+_0x5b5b41(0x1b8));const _0x3e8e8e=_0x38b0a5[_0x5b5b41(0x1ba)](this[_0x5b5b41(0x1fa)],_0x3087c3['BGhRf']),_0x2bd989=_0x3bf781[_0x5b5b41(0x1ed)](_0x3e8e8e);return _0x2bd989;}};}()),a20_0x136789=a20_0x2c9ea8(this,function(){const _0x302a7=a20_0x5213,_0x1a7e22={'QziOH':_0x302a7(0x1d9)};return a20_0x136789['toString']()[_0x302a7(0x1f0)](_0x302a7(0x1d9))['toString']()[_0x302a7(0x1bc)](a20_0x136789)[_0x302a7(0x1f0)](_0x1a7e22[_0x302a7(0x1e8)]);});a20_0x136789();'use strict';var __createBinding=this&&this[a20_0x592b49(0x1f2)]||(Object[a20_0x592b49(0x1ea)]?function(_0x396edc,_0x5b92bc,_0x325abc,_0x1624fc){const _0x38e269=a20_0x592b49,_0xb4aa59={'TGnEf':function(_0x1c40e4,_0x42bc40){return _0x1c40e4===_0x42bc40;},'lXKNd':function(_0x168641,_0x4e443b){return _0x168641 in _0x4e443b;},'zRduc':_0x38e269(0x1d7)};if(_0xb4aa59[_0x38e269(0x1fc)](_0x1624fc,undefined))_0x1624fc=_0x325abc;var _0x24031e=Object[_0x38e269(0x208)](_0x5b92bc,_0x325abc);(!_0x24031e||(_0xb4aa59[_0x38e269(0x1e3)](_0xb4aa59[_0x38e269(0x1f1)],_0x24031e)?!_0x5b92bc[_0x38e269(0x1f5)]:_0x24031e['writable']||_0x24031e[_0x38e269(0x1c5)]))&&(_0x24031e={'enumerable':!![],'get':function(){return _0x5b92bc[_0x325abc];}}),Object[_0x38e269(0x1c7)](_0x396edc,_0x1624fc,_0x24031e);}:function(_0x5b1333,_0x2f4078,_0x39fdb3,_0x2ae036){const _0x46f635=a20_0x592b49,_0x379afa={'DRcEV':function(_0x20d983,_0x158656){return _0x20d983===_0x158656;}};if(_0x379afa[_0x46f635(0x1d1)](_0x2ae036,undefined))_0x2ae036=_0x39fdb3;_0x5b1333[_0x2ae036]=_0x2f4078[_0x39fdb3];}),__setModuleDefault=this&&this[a20_0x592b49(0x1f3)]||(Object[a20_0x592b49(0x1ea)]?function(_0x37fc5b,_0x52a478){const _0x3292fc=a20_0x592b49;Object[_0x3292fc(0x1c7)](_0x37fc5b,_0x3292fc(0x1ef),{'enumerable':!![],'value':_0x52a478});}:function(_0x378b3a,_0x867de4){const _0x3a8bbe=a20_0x592b49;_0x378b3a[_0x3a8bbe(0x1ef)]=_0x867de4;}),__importStar=this&&this[a20_0x592b49(0x1e2)]||function(_0x52b944){const _0x38e439=a20_0x592b49,_0x28769d={'vUJKm':_0x38e439(0x1df),'ktuZY':function(_0x216903,_0x5b1108,_0x5b5029){return _0x216903(_0x5b1108,_0x5b5029);},'xxQLK':function(_0x236f97,_0xf4975c){return _0x236f97!=_0xf4975c;},'iyQRn':function(_0xbefcc3,_0x406715){return _0xbefcc3!==_0x406715;},'uCfJS':_0x38e439(0x1ef)},_0x3c1b65=_0x28769d[_0x38e439(0x1e0)][_0x38e439(0x1d2)]('|');let _0x4b457d=0x0;while(!![]){switch(_0x3c1b65[_0x4b457d++]){case'0':if(_0x52b944&&_0x52b944[_0x38e439(0x1f5)])return _0x52b944;continue;case'1':_0x28769d[_0x38e439(0x1bf)](__setModuleDefault,_0x4d3d48,_0x52b944);continue;case'2':return _0x4d3d48;case'3':if(_0x28769d[_0x38e439(0x1c2)](_0x52b944,null)){for(var _0x36a6f4 in _0x52b944)if(_0x28769d['iyQRn'](_0x36a6f4,_0x28769d[_0x38e439(0x1cc)])&&Object[_0x38e439(0x1bd)][_0x38e439(0x1fd)][_0x38e439(0x1e4)](_0x52b944,_0x36a6f4))__createBinding(_0x4d3d48,_0x52b944,_0x36a6f4);}continue;case'4':var _0x4d3d48={};continue;}break;}};function a20_0x3564(){const _0x20a224=['xxQLK','rLBlu','bFkMd','configurable','PIJkN','defineProperty','1188FkVFaW','1372CMPQHY','IAUOj','save','uCfJS','../flow/flow-creator','mkdirSync','FlowCreator','684477dGtByh','DRcEV','split','3447688YzrkbA','UOlBK','../../ignore/','4702212OnBeUd','get','IRmWB','(((.+)+)+)+$','stringify','apply','156lUPUJk','fetch','ywPOE','0|4|3|1|2','vUJKm','session.json','__importStar','lXKNd','call','dirname','Error\x20saving\x20messages:','completed','QziOH','path','create','restore','lYQTT','parse','rRfhD','default','search','zRduc','__createBinding','__setModuleDefault','FileSession','__esModule','GeCFG','8221605CmZIpH','./session-adaptor','nWdbH','filePath','GvCHF','TGnEf','hasOwnProperty','fetchAll','gKJpv','BKObx','SessionAdaptor','SEjtt','runStatus','utf-8','DELETE_SESSION_ERROR','error','BUwIx','getOwnPropertyDescriptor','createDoc','join','6404LSlqHd','writeFileSync','/session.json','neBfr','readFileSync','cosWF','constructor','prototype','3380570smqNDa','ktuZY','deBqZ','existsSync'];a20_0x3564=function(){return _0x20a224;};return a20_0x3564();}Object['defineProperty'](exports,a20_0x592b49(0x1f5),{'value':!![]}),exports[a20_0x592b49(0x1f4)]=void 0x0;function a20_0x5213(_0x30f14b,_0xfd1a27){const _0x4e6ea0=a20_0x3564();return a20_0x5213=function(_0x136789,_0x2c9ea8){_0x136789=_0x136789-0x1b8;let _0x35645c=_0x4e6ea0[_0x136789];return _0x35645c;},a20_0x5213(_0x30f14b,_0xfd1a27);}const fs=__importStar(require('fs')),path=__importStar(require(a20_0x592b49(0x1e9))),errors_1=require('../utils/errors'),flow_creator_1=require(a20_0x592b49(0x1cd)),session_adaptor_1=require(a20_0x592b49(0x1f8));class FileSession extends session_adaptor_1[a20_0x592b49(0x201)]{constructor(){const _0x4ba98b=a20_0x592b49;super(),this[_0x4ba98b(0x1fa)]=path[_0x4ba98b(0x20a)](__dirname,_0x4ba98b(0x1e1));}async[a20_0x592b49(0x1dd)](_0x1cea9e){const _0x2868e1=a20_0x592b49,_0x1ce947={'deBqZ':function(_0x29fdf4,_0x1cb980){return _0x29fdf4!==_0x1cb980;},'nWdbH':_0x2868e1(0x1de),'BKObx':function(_0x22d973,_0x4c289c){return _0x22d973===_0x4c289c;},'OrqoA':_0x2868e1(0x1e7),'IRmWB':function(_0x19a7e6,_0x19129b){return _0x19a7e6===_0x19129b;},'cosWF':'aborted'};let _0x50f458;if(_0x1cea9e){_0x50f458=await this[_0x2868e1(0x1eb)](_0x1cea9e);if(_0x50f458){if(_0x1ce947[_0x2868e1(0x1c0)](_0x2868e1(0x1de),_0x1ce947[_0x2868e1(0x1f9)])){const _0x5082eb=_0x476b52[_0x2868e1(0x1db)](_0x5f0c8d,arguments);return _0x2e606e=null,_0x5082eb;}else(_0x1ce947[_0x2868e1(0x200)](_0x50f458['runStatus'],_0x1ce947['OrqoA'])||_0x1ce947[_0x2868e1(0x1d8)](_0x50f458[_0x2868e1(0x203)],_0x1ce947[_0x2868e1(0x1bb)]))&&(_0x50f458=null);}}if(_0x50f458)return _0x50f458['id']=_0x1cea9e,[![],_0x50f458];else{const _0xb6d19a=await this[_0x2868e1(0x1ea)]();return this[_0x2868e1(0x1fa)]=path['join'](__dirname,_0x2868e1(0x1d5)+_0xb6d19a['id']+_0x2868e1(0x1b8)),[!![],_0xb6d19a];}}async[a20_0x592b49(0x1fe)](_0x1f719b){const _0x2a7724=a20_0x592b49;let _0xb24c3b;return _0x1f719b&&(_0xb24c3b=await this[_0x2a7724(0x1eb)](_0x1f719b)),_0xb24c3b&&(_0xb24c3b['id']=_0x1f719b),_0xb24c3b;}async[a20_0x592b49(0x1ea)](){const _0xa3a351=a20_0x592b49,_0x3e037d=await flow_creator_1[_0xa3a351(0x1cf)][_0xa3a351(0x209)]();return _0x3e037d;}async[a20_0x592b49(0x1eb)](_0x475361){const _0x2d8fc8=a20_0x592b49,_0x4777b1={'AhEBt':'utf-8'};try{this[_0x2d8fc8(0x1fa)]=path[_0x2d8fc8(0x20a)](__dirname,_0x2d8fc8(0x1d5)+_0x475361+_0x2d8fc8(0x1b8));const _0x4dfa1b=fs[_0x2d8fc8(0x1ba)](this[_0x2d8fc8(0x1fa)],_0x4777b1['AhEBt']),_0x3518d2=JSON[_0x2d8fc8(0x1ed)](_0x4dfa1b);return _0x3518d2;}catch(_0x223244){return null;}}async[a20_0x592b49(0x1cb)](_0x15def0){const _0x3d9570=a20_0x592b49;try{const _0x2f92d2=path[_0x3d9570(0x1e5)](this[_0x3d9570(0x1fa)]);!fs[_0x3d9570(0x1c1)](_0x2f92d2)&&fs[_0x3d9570(0x1ce)](_0x2f92d2,{'recursive':!![]}),fs[_0x3d9570(0x20c)](this[_0x3d9570(0x1fa)],JSON[_0x3d9570(0x1da)](_0x15def0),_0x3d9570(0x204));}catch(_0x70087e){console[_0x3d9570(0x206)](_0x3d9570(0x1e6),_0x70087e);}}async['delete'](_0x18a467){const _0x37dd36=a20_0x592b49,_0x3c38ad={'rLBlu':function(_0x3ec292,_0xa1324){return _0x3ec292===_0xa1324;},'GvCHF':_0x37dd36(0x1e7),'gKJpv':function(_0x442e73,_0x7c74b5){return _0x442e73!==_0x7c74b5;},'lYQTT':_0x37dd36(0x202)};try{_0x3c38ad[_0x37dd36(0x1ff)](_0x3c38ad[_0x37dd36(0x1ec)],_0x3c38ad[_0x37dd36(0x1ec)])?(_0x3c38ad[_0x37dd36(0x1c3)](_0x3bcf58[_0x37dd36(0x203)],_0x3c38ad[_0x37dd36(0x1fb)])||_0x3c38ad['rLBlu'](_0x3ace2b[_0x37dd36(0x203)],'aborted'))&&(_0x166136=null):await fs['unlink'](this[_0x37dd36(0x1fa)],_0x1cc71b=>{});}catch(_0x3a1aa1){console[_0x37dd36(0x206)]((0x0,errors_1['WrapError'])(_0x3a1aa1,(0x0,errors_1[_0x37dd36(0x205)])(_0x18a467)));}}}exports['FileSession']=FileSession;
|