@picoflow/core 1.0.11 → 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.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
|
-
const
|
|
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
|
-
const a16_0x38d92c=a16_0x2922;(function(_0x544421,_0x1cb8f7){const _0x279d89=a16_0x2922,_0xce13d7=_0x544421();while(!![]){try{const _0x2ecef3=-parseInt(_0x279d89(0x1ff))/0x1+parseInt(_0x279d89(0x252))/0x2+-parseInt(_0x279d89(0x251))/0x3*(parseInt(_0x279d89(0x239))/0x4)+-parseInt(_0x279d89(0x1e0))/0x5+-parseInt(_0x279d89(0x238))/0x6*(-parseInt(_0x279d89(0x1f4))/0x7)+-parseInt(_0x279d89(0x22d))/0x8+parseInt(_0x279d89(0x25b))/0x9;if(_0x2ecef3===_0x1cb8f7)break;else _0xce13d7['push'](_0xce13d7['shift']());}catch(_0x379559){_0xce13d7['push'](_0xce13d7['shift']());}}}(a16_0x1cd9,0x61859));const a16_0x33bb1f=(function(){const _0x66adff=a16_0x2922,_0x54f02c={'fpafK':_0x66adff(0x257),'gBzux':function(_0x5773c8,_0x5380a4){return _0x5773c8===_0x5380a4;},'CnLsV':_0x66adff(0x1f0),'cSCKJ':function(_0x439e20,_0x1791ce){return _0x439e20!==_0x1791ce;},'PHjnN':_0x66adff(0x220)};let _0x31993e=!![];return function(_0x4de6cc,_0x38ec80){const _0x25801f=_0x66adff,_0x5e2d49={'BOvIa':function(_0x26dc04,_0x5af5c1){const _0x3d9456=a16_0x2922;return _0x54f02c[_0x3d9456(0x250)](_0x26dc04,_0x5af5c1);},'qvQLY':_0x54f02c[_0x25801f(0x1f1)]};if(_0x54f02c[_0x25801f(0x258)](_0x54f02c['PHjnN'],'obrls'))return _0x2f6607[_0x25801f(0x200)](_0xd39c48);else{const _0x217dd0=_0x31993e?function(){const _0x5d39b8=_0x25801f;if(_0x38ec80){if(_0x5d39b8(0x257)!==_0x54f02c[_0x5d39b8(0x1e1)]){if(!_0x2e4459){const _0x235f8d=_0x355683[_0x5d39b8(0x206)](this[_0x5d39b8(0x216)]);if(_0x5e2d49[_0x5d39b8(0x214)](_0x235f8d[_0x5d39b8(0x248)],0x0))throw new _0x59760c(_0x5e2d49[_0x5d39b8(0x20c)]);else return this['llmRegister'][_0x235f8d[0x0]];}return this[_0x5d39b8(0x216)][_0x7b08e7];}else{const _0x54d41c=_0x38ec80[_0x5d39b8(0x20b)](_0x4de6cc,arguments);return _0x38ec80=null,_0x54d41c;}}}:function(){};return _0x31993e=![],_0x217dd0;}};}()),a16_0x35a10c=a16_0x33bb1f(this,function(){const _0x4d4229=a16_0x2922,_0x14d259={'pRPpR':'(((.+)+)+)+$'};return a16_0x35a10c[_0x4d4229(0x240)]()[_0x4d4229(0x25a)](_0x14d259[_0x4d4229(0x212)])[_0x4d4229(0x240)]()['constructor'](a16_0x35a10c)['search'](_0x14d259['pRPpR']);});a16_0x35a10c();'use strict';var __decorate=this&&this[a16_0x38d92c(0x25c)]||function(_0x199e99,_0x333268,_0x560594,_0x5f2258){const _0xa8bd73=a16_0x38d92c,_0x3e59cb={'IsFwV':function(_0x40b094,_0x19623b){return _0x40b094<_0x19623b;},'nnWAE':function(_0x3de60c,_0xca97a5){return _0x3de60c===_0xca97a5;},'InjON':function(_0x2f6845,_0x3ac551){return _0x2f6845===_0x3ac551;},'QSWih':_0xa8bd73(0x1fe),'UswCA':function(_0x106369,_0x3f94c3){return _0x106369-_0x3f94c3;},'jshJH':function(_0x4b99c6,_0x1c328c){return _0x4b99c6>=_0x1c328c;},'IVNTP':function(_0x16d337,_0x2c1aeb){return _0x16d337(_0x2c1aeb);},'Maunm':function(_0x4aa37a,_0x32a3d9,_0x2c1548){return _0x4aa37a(_0x32a3d9,_0x2c1548);},'flMDI':function(_0x48795b,_0x3d5e7f){return _0x48795b>_0x3d5e7f;}};var _0x18d16c=arguments[_0xa8bd73(0x248)],_0x484a3c=_0x3e59cb[_0xa8bd73(0x21f)](_0x18d16c,0x3)?_0x333268:_0x5f2258===null?_0x5f2258=Object['getOwnPropertyDescriptor'](_0x333268,_0x560594):_0x5f2258,_0x3cd92c;if(_0x3e59cb[_0xa8bd73(0x20f)](typeof Reflect,_0xa8bd73(0x203))&&_0x3e59cb[_0xa8bd73(0x202)](typeof Reflect[_0xa8bd73(0x25f)],_0x3e59cb[_0xa8bd73(0x249)]))_0x484a3c=Reflect[_0xa8bd73(0x25f)](_0x199e99,_0x333268,_0x560594,_0x5f2258);else{for(var _0x5206f4=_0x3e59cb['UswCA'](_0x199e99[_0xa8bd73(0x248)],0x1);_0x3e59cb['jshJH'](_0x5206f4,0x0);_0x5206f4--)if(_0x3cd92c=_0x199e99[_0x5206f4])_0x484a3c=(_0x3e59cb[_0xa8bd73(0x21f)](_0x18d16c,0x3)?_0x3e59cb[_0xa8bd73(0x23a)](_0x3cd92c,_0x484a3c):_0x18d16c>0x3?_0x3cd92c(_0x333268,_0x560594,_0x484a3c):_0x3e59cb[_0xa8bd73(0x215)](_0x3cd92c,_0x333268,_0x560594))||_0x484a3c;}return _0x3e59cb[_0xa8bd73(0x1ee)](_0x18d16c,0x3)&&_0x484a3c&&Object[_0xa8bd73(0x1f9)](_0x333268,_0x560594,_0x484a3c),_0x484a3c;},__metadata=this&&this[a16_0x38d92c(0x226)]||function(_0x3a8f11,_0x47bd84){const _0x2e6d76=a16_0x38d92c,_0x4b52a2={'zjXzp':function(_0x531a88,_0x1020f9){return _0x531a88===_0x1020f9;},'FNLUC':'object','KtEvB':_0x2e6d76(0x1fe)};if(_0x4b52a2[_0x2e6d76(0x254)](typeof Reflect,_0x4b52a2['FNLUC'])&&_0x4b52a2[_0x2e6d76(0x254)](typeof Reflect['metadata'],_0x4b52a2[_0x2e6d76(0x223)]))return Reflect['metadata'](_0x3a8f11,_0x47bd84);},FlowEngine_1;function a16_0x1cd9(){const _0x4abd57=['getFlowSession','SessionLogger','Injectable','DefaultUseTool','IelYc','Jnfgg','VGzhr','flMDI','lLwhB','No\x20model\x20registered','CnLsV','run','lRldu','140rhVykV','@nestjs/common','HttpContentType','fetch','runFlow','defineProperty','contentType','metadata','dbauV','fetchAll','function','408826bNUDTA','bindTools','getModelName','InjON','object','pMzpR','ChatSessionID','keys','FlowEngine','lUUBZ','vYxYt','vWMFH','apply','qvQLY','flowSession','CoreConfig','nnWAE','PBcMf','AOzHF','pRPpR','sxvkz','BOvIa','Maunm','llmRegister','ffqJF','Content-Type','LRWyk','OllamaUseTool','PLfRX','status','aborted','saveSession','IsFwV','obrls','BAD_REQUEST','SuFjJ','KtEvB','UUoXq','composeHttpResponse','__metadata','ROFgL','zPPoZ','error','CASCr','message','WgflY','3247808apGSIV','FlowSession','__esModule','FlowCreator','../flow/flow-creator','drtsa','../session/session-logger','eUxlg','uWHOP','registerFlows','create','199902PGPseX','304396rbQQMD','IVNTP','../session/flow-session','Plain','getSessionDoc','save','yqiXR','toString','HttpStatus','handleException','kTLjJ','send','RmNwj','registerModels','GNMhl','length','QSWih','setup','ChatOllama','session','header','../utils/constants','ConfigService','gBzux','3FsHTNS','736882GfkwLh','flowRegistry','zjXzp','AZLYs','success','HAUrd','cSCKJ','runStatus','search','9346509oFULto','__decorate','Xvriu','XwTsM','decorate','bMWQw','jiVJm','3914660fsRsvZ','fpafK','RMWYL','vGvmR','getSessionId','delete','jmggv'];a16_0x1cd9=function(){return _0x4abd57;};return a16_0x1cd9();}Object[a16_0x38d92c(0x1f9)](exports,a16_0x38d92c(0x22f),{'value':!![]}),exports[a16_0x38d92c(0x207)]=void 0x0;const common_1=require(a16_0x38d92c(0x1f5)),flow_creator_1=require(a16_0x38d92c(0x231)),flow_session_1=require(a16_0x38d92c(0x23b)),ollama_1=require('@langchain/ollama'),session_logger_1=require(a16_0x38d92c(0x233)),core_config_1=require('../configs/core-config'),config_1=require('@nestjs/config'),content_type_1=require('../flow/content-type'),constants_1=require(a16_0x38d92c(0x24e));function a16_0x2922(_0xff9ed7,_0x5259ff){const _0x28d25c=a16_0x1cd9();return a16_0x2922=function(_0x35a10c,_0x33bb1f){_0x35a10c=_0x35a10c-0x1e0;let _0x1cd901=_0x28d25c[_0x35a10c];return _0x1cd901;},a16_0x2922(_0xff9ed7,_0x5259ff);}let FlowEngine=FlowEngine_1=class FlowEngine{constructor(_0x2a5b06){const _0x5f352a=a16_0x38d92c;this[_0x5f352a(0x253)]={},this[_0x5f352a(0x216)]={},core_config_1[_0x5f352a(0x20e)][_0x5f352a(0x24a)](_0x2a5b06),this[_0x5f352a(0x20d)]=new flow_session_1[(_0x5f352a(0x22e))]();}[a16_0x38d92c(0x1e7)](){const _0x40620b=a16_0x38d92c;return this[_0x40620b(0x20d)];}async[a16_0x38d92c(0x1f2)](_0x483ff2,_0x52d04b,_0x310635,_0x1c3479,_0x210451){const _0xf0c209=a16_0x38d92c,_0x1c76fa=await this[_0xf0c209(0x1f8)](_0x52d04b,_0x310635,_0x1c3479,{'config':_0x210451});await this[_0xf0c209(0x225)](_0x1c76fa,_0x483ff2);}async[a16_0x38d92c(0x1f8)](_0xe95527,_0x4f7eed,_0x260869,_0x1b01c2){const _0x209ee3=a16_0x38d92c,_0x1f579a={'AOzHF':'object','Xvriu':_0x209ee3(0x1fe),'drtsa':_0x209ee3(0x210)};let _0x59c862;try{_0x59c862=await flow_creator_1[_0x209ee3(0x230)][_0x209ee3(0x237)](_0xe95527,_0x260869,this,_0x1b01c2),_0x260869=_0x59c862[_0x209ee3(0x1e4)]();const _0x310bab=await _0x59c862[_0x209ee3(0x1f2)](_0x4f7eed);return await _0x59c862[_0x209ee3(0x21e)](),_0x310bab;}catch(_0x50916d){if(_0x1f579a[_0x209ee3(0x232)]!==_0x1f579a['drtsa']){if(typeof _0x1c4425===_0x1f579a[_0x209ee3(0x211)]&&typeof _0x598b2f[_0x209ee3(0x1fb)]===_0x1f579a[_0x209ee3(0x25d)])return _0x4a8684[_0x209ee3(0x1fb)](_0x2c9d86,_0x271b9a);}else return await this[_0x209ee3(0x242)](_0x59c862,_0x260869,_0x50916d);}}['composeHttpResponse'](_0x1947d8,_0x3bf2ba){const _0x1754f0=a16_0x38d92c,_0x327d6a={'xpNyT':function(_0x478305,_0x244ef0){return _0x478305!=_0x244ef0;},'RmNwj':'Content-Type'};_0x3bf2ba[_0x1754f0(0x24d)](constants_1['K'][_0x1754f0(0x205)],_0x1947d8[_0x1754f0(0x24c)]),!_0x1947d8['success']&&_0x3bf2ba[_0x1754f0(0x21c)](common_1[_0x1754f0(0x241)]['BAD_REQUEST']),_0x1947d8[_0x1754f0(0x1fa)]&&_0x327d6a['xpNyT'](_0x1947d8[_0x1754f0(0x1fa)],content_type_1[_0x1754f0(0x1f6)][_0x1754f0(0x23c)])?(_0x3bf2ba[_0x1754f0(0x24d)](_0x327d6a[_0x1754f0(0x245)],_0x1947d8[_0x1754f0(0x1fa)]),_0x3bf2ba['send'](_0x1947d8['message'])):_0x3bf2ba['send'](_0x1947d8);}async['handleException'](_0x231b92,_0x426b06,_0x1e7a37){const _0x16c63e=a16_0x38d92c,_0x38c0d7={'bMWQw':_0x16c63e(0x218),'UMyBy':function(_0x46fc9b,_0x3c5ec1){return _0x46fc9b!==_0x3c5ec1;},'UUoXq':'IelYc','lUUBZ':_0x16c63e(0x21d),'XwTsM':'message'};if(_0x231b92){if(_0x38c0d7['UMyBy'](_0x38c0d7[_0x16c63e(0x224)],_0x16c63e(0x1eb)))_0x313d32['header'](_0x114af1['K'][_0x16c63e(0x205)],_0x2f6fef[_0x16c63e(0x24c)]),!_0x4b2bdb[_0x16c63e(0x256)]&&_0x32cf1f[_0x16c63e(0x21c)](_0x30dd29[_0x16c63e(0x241)][_0x16c63e(0x221)]),_0x26ca52[_0x16c63e(0x1fa)]&&_0x4a0425[_0x16c63e(0x1fa)]!=_0x15c7c4['HttpContentType'][_0x16c63e(0x23c)]?(_0x5d13b9[_0x16c63e(0x24d)](_0x38c0d7[_0x16c63e(0x260)],_0x4961e2['contentType']),_0xec572f[_0x16c63e(0x244)](_0x3223b1['message'])):_0x4765df[_0x16c63e(0x244)](_0x529805);else try{const _0x34fe41=_0x231b92[_0x16c63e(0x23d)]();_0x34fe41[_0x16c63e(0x259)]=_0x38c0d7[_0x16c63e(0x208)],new session_logger_1['SessionLogger'](_0x34fe41)[_0x16c63e(0x229)](_0x1e7a37?.['message']),await _0x231b92['saveSession']();}catch(_0x3bc9bf){}}else{const [_0x3b9a7d,_0x3c90ff]=await this[_0x16c63e(0x20d)][_0x16c63e(0x1f7)](_0x426b06);_0x3c90ff[_0x16c63e(0x259)]=_0x38c0d7['lUUBZ'],new session_logger_1[(_0x16c63e(0x1e8))](_0x3c90ff)['error'](_0x1e7a37?.[_0x16c63e(0x22b)]),await this['flowSession'][_0x16c63e(0x23e)](_0x3c90ff);}return{'success':![],'message':_0x1e7a37[_0x38c0d7[_0x16c63e(0x25e)]],'completed':!![]};}async['endChat'](_0x495663){const _0x25e931=a16_0x38d92c,_0x270e38={'ROFgL':function(_0x3b3b9f,_0x2d3a4c){return _0x3b3b9f===_0x2d3a4c;},'RMWYL':_0x25e931(0x1f0),'AZLYs':_0x25e931(0x20a),'lRldu':function(_0xb0499d,_0xa27f72){return _0xb0499d!==_0xa27f72;},'zPPoZ':_0x25e931(0x23f)};try{if(_0x270e38[_0x25e931(0x227)](_0x270e38[_0x25e931(0x255)],_0x270e38[_0x25e931(0x255)])){if(_0x495663){const _0x234733=await this['flowSession'][_0x25e931(0x1fd)](_0x495663);if(_0x234733){if(_0x270e38[_0x25e931(0x1f3)](_0x270e38[_0x25e931(0x228)],_0x270e38[_0x25e931(0x228)]))return _0x18b30b&&_0x50bacc['length']>0x0?_0x2d5eca[_0x25e931(0x200)](_0x513941):_0x3529aa;else await this['flowSession'][_0x25e931(0x1e5)](_0x234733['id']);}}}else{const _0x3573ea=_0x3dc5ef[_0x25e931(0x206)](this['llmRegister']);if(_0x270e38['ROFgL'](_0x3573ea[_0x25e931(0x248)],0x0))throw new _0x349999(_0x270e38[_0x25e931(0x1e2)]);else return _0x3573ea[0x0];}}catch(_0x4ac4b0){return{'false':!![],'message':'Delete\x20session\x20'+_0x495663+'\x20failed'};}return{'success':!![],'session':_0x495663};}async[a16_0x38d92c(0x236)](_0x57bbf1){const _0x280b57=a16_0x38d92c;this[_0x280b57(0x253)]={...this[_0x280b57(0x253)],..._0x57bbf1};}['getFlow'](_0x4caddb){const _0x4d1690=a16_0x38d92c;return this[_0x4d1690(0x253)][_0x4caddb];}[a16_0x38d92c(0x246)](_0x116516){const _0x34ee04=a16_0x38d92c;this['llmRegister']={...this[_0x34ee04(0x216)],..._0x116516};}['registerModel'](_0x2cc7f3,_0x5f5c1f){const _0x23e991=a16_0x38d92c,_0x24116d={'knUch':'No\x20model\x20registered','jmggv':function(_0x2d1e10,_0x37be9b){return _0x2d1e10===_0x37be9b;},'PLfRX':function(_0x46796a,_0x34fb51){return _0x46796a!==_0x34fb51;},'ffqJF':'fLvRt'};let _0x2ceff9=FlowEngine_1[_0x23e991(0x1ea)];if(_0x24116d[_0x23e991(0x1e6)](_0x2cc7f3,ollama_1[_0x23e991(0x24b)])){if(_0x24116d[_0x23e991(0x21b)](_0x24116d[_0x23e991(0x217)],_0x23e991(0x1fc)))_0x2ceff9=FlowEngine_1['OllamaUseTool'];else throw new _0x4e272e(_0x24116d['knUch']);}this[_0x23e991(0x216)]={...this[_0x23e991(0x216)],[_0x5f5c1f['model']]:{'modelClass':_0x2cc7f3,'params':_0x5f5c1f,'useTool':_0x2ceff9}};}['getModel'](_0x3cc3c6){const _0x3ba422=a16_0x38d92c,_0x491095={'uLfDU':function(_0x531b8b,_0x874059){return _0x531b8b===_0x874059;},'SuFjJ':_0x3ba422(0x1f0)};if(!_0x3cc3c6){const _0x34e71c=Object['keys'](this[_0x3ba422(0x216)]);if(_0x491095['uLfDU'](_0x34e71c[_0x3ba422(0x248)],0x0))throw new Error(_0x491095[_0x3ba422(0x222)]);else return this[_0x3ba422(0x216)][_0x34e71c[0x0]];}return this[_0x3ba422(0x216)][_0x3cc3c6];}[a16_0x38d92c(0x201)](_0x2bc57e){const _0x22148f=a16_0x38d92c,_0x117f3b={'VGzhr':function(_0x2ffea2,_0x4013dd){return _0x2ffea2===_0x4013dd;},'GNMhl':_0x22148f(0x1ec),'ZPgLS':_0x22148f(0x1f0),'OOgii':function(_0x409f19,_0x1358d1){return _0x409f19!==_0x1358d1;},'lLwhB':_0x22148f(0x243),'OGPiX':_0x22148f(0x235),'WgflY':'iIXHB'};if(!_0x2bc57e){if(_0x117f3b[_0x22148f(0x1ed)](_0x22148f(0x1ec),_0x117f3b[_0x22148f(0x247)])){const _0x564918=Object[_0x22148f(0x206)](this[_0x22148f(0x216)]);if(_0x117f3b[_0x22148f(0x1ed)](_0x564918[_0x22148f(0x248)],0x0))throw new Error(_0x117f3b['ZPgLS']);else return _0x117f3b['OOgii'](_0x117f3b[_0x22148f(0x1ef)],_0x117f3b['OGPiX'])?_0x564918[0x0]:this[_0x22148f(0x20d)];}else return _0x5c4581;}else return _0x117f3b[_0x22148f(0x22c)]!==_0x117f3b[_0x22148f(0x22c)]?_0x4e547f:_0x2bc57e;}};exports[a16_0x38d92c(0x207)]=FlowEngine,FlowEngine[a16_0x38d92c(0x1ea)]=(_0x22f2a0,_0x5af5c9)=>{const _0x222617=a16_0x38d92c,_0x2b81e0={'jiVJm':function(_0x1c6c29,_0x2e5ef8){return _0x1c6c29!==_0x2e5ef8;},'vGvmR':_0x222617(0x209),'pMzpR':_0x222617(0x213),'CASCr':function(_0x3fffd9,_0x28abb0){return _0x3fffd9!==_0x28abb0;},'vtKqE':_0x222617(0x234)};if(_0x5af5c9&&_0x5af5c9[_0x222617(0x248)]>0x0)return _0x2b81e0[_0x222617(0x261)](_0x2b81e0[_0x222617(0x1e3)],_0x2b81e0[_0x222617(0x204)])?_0x22f2a0['bindTools'](_0x5af5c9):_0x4e787d['bind']({'tools':_0x5631b1});else{if(_0x2b81e0[_0x222617(0x22a)](_0x222617(0x234),_0x2b81e0['vtKqE']))this['flowRegistry']={...this[_0x222617(0x253)],..._0xa77d02};else return _0x22f2a0;}},FlowEngine[a16_0x38d92c(0x21a)]=(_0x59a181,_0x188dee)=>{const _0x1dedd4=a16_0x38d92c,_0x2e25e0={'LRWyk':function(_0xd5819f,_0x244496){return _0xd5819f>_0x244496;}};return _0x188dee&&_0x2e25e0[_0x1dedd4(0x219)](_0x188dee['length'],0x0)?_0x59a181['bind']({'tools':_0x188dee}):_0x59a181;},exports['FlowEngine']=FlowEngine=FlowEngine_1=__decorate([(0x0,common_1[a16_0x38d92c(0x1e9)])(),__metadata('design:paramtypes',[config_1[a16_0x38d92c(0x24f)]])],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_0x211115=a18_0x280d;(function(_0x5969da,_0x366896){const _0x2e37c0=a18_0x280d,_0x5f1947=_0x5969da();while(!![]){try{const _0x32ca09=parseInt(_0x2e37c0(0x198))/0x1+parseInt(_0x2e37c0(0x18c))/0x2*(-parseInt(_0x2e37c0(0x177))/0x3)+-parseInt(_0x2e37c0(0x18b))/0x4+-parseInt(_0x2e37c0(0x195))/0x5+-parseInt(_0x2e37c0(0x161))/0x6+parseInt(_0x2e37c0(0x149))/0x7+-parseInt(_0x2e37c0(0x174))/0x8*(-parseInt(_0x2e37c0(0x191))/0x9);if(_0x32ca09===_0x366896)break;else _0x5f1947['push'](_0x5f1947['shift']());}catch(_0x420f9a){_0x5f1947['push'](_0x5f1947['shift']());}}}(a18_0x1045,0x1afb3));const a18_0x3916c6=(function(){const _0x51fe70=a18_0x280d,_0x4b296={'AjDMn':_0x51fe70(0x179)};let _0x508cf4=!![];return function(_0x14a5d8,_0x523b65){const _0x4df0da={'jIYmZ':_0x4b296['AjDMn'],'sNJEq':'RGjUT'},_0x330723=_0x508cf4?function(){const _0x621f31=a18_0x280d;if(_0x523b65){if(_0x4df0da[_0x621f31(0x190)]===_0x4df0da[_0x621f31(0x175)])_0x2d1085=null;else{const _0x3dbfed=_0x523b65[_0x621f31(0x167)](_0x14a5d8,arguments);return _0x523b65=null,_0x3dbfed;}}}:function(){};return _0x508cf4=![],_0x330723;};}()),a18_0x556d3c=a18_0x3916c6(this,function(){const _0x436426=a18_0x280d,_0x3d20f5={'DMbDI':_0x436426(0x152)};return a18_0x556d3c[_0x436426(0x183)]()['search'](_0x3d20f5[_0x436426(0x187)])[_0x436426(0x183)]()[_0x436426(0x189)](a18_0x556d3c)[_0x436426(0x16c)](_0x3d20f5[_0x436426(0x187)]);});a18_0x556d3c();'use strict';var __createBinding=this&&this[a18_0x211115(0x144)]||(Object[a18_0x211115(0x170)]?function(_0x1476fb,_0x3e2c8a,_0x2bba4a,_0x2fabdd){const _0x295a19=a18_0x211115,_0x5a6d83={'VIMWV':function(_0x1af4f1,_0x2e40e7){return _0x1af4f1 in _0x2e40e7;},'vPuzr':_0x295a19(0x181),'MoRdA':_0x295a19(0x165),'TSvMn':_0x295a19(0x13c),'wUENx':function(_0x5e2ed2,_0x30180c){return _0x5e2ed2===_0x30180c;},'BcTxJ':function(_0x35db2b,_0x587806){return _0x35db2b!==_0x587806;},'gcMqZ':'DcyUP'};if(_0x5a6d83[_0x295a19(0x15c)](_0x2fabdd,undefined))_0x2fabdd=_0x2bba4a;var _0x2b0323=Object[_0x295a19(0x162)](_0x3e2c8a,_0x2bba4a);(!_0x2b0323||(_0x5a6d83[_0x295a19(0x159)](_0x5a6d83[_0x295a19(0x155)],_0x2b0323)?!_0x3e2c8a['__esModule']:_0x2b0323['writable']||_0x2b0323['configurable']))&&(_0x5a6d83[_0x295a19(0x17f)](_0x5a6d83[_0x295a19(0x194)],_0x5a6d83[_0x295a19(0x194)])?_0x12501['id']=_0x457376:_0x2b0323={'enumerable':!![],'get':function(){const _0x3a82e0=_0x295a19,_0x50d665={'dfZqh':function(_0xfa9095,_0xbf0ed4){return _0x5a6d83['VIMWV'](_0xfa9095,_0xbf0ed4);},'BBvHt':_0x5a6d83[_0x3a82e0(0x155)]};if(_0x5a6d83[_0x3a82e0(0x14d)]===_0x5a6d83[_0x3a82e0(0x18a)]){if(_0x373c6b===_0x4f823a)_0xe2f0ce=_0x802c64;var _0x24a2cb=_0x18fa3e[_0x3a82e0(0x162)](_0x3a7200,_0x37381f);(!_0x24a2cb||(_0x50d665[_0x3a82e0(0x156)](_0x50d665['BBvHt'],_0x24a2cb)?!_0x390177[_0x3a82e0(0x164)]:_0x24a2cb[_0x3a82e0(0x16f)]||_0x24a2cb[_0x3a82e0(0x18f)]))&&(_0x24a2cb={'enumerable':!![],'get':function(){return _0x3ddb68[_0x304517];}}),_0x411332[_0x3a82e0(0x199)](_0x4f02f7,_0xe4b10d,_0x24a2cb);}else return _0x3e2c8a[_0x2bba4a];}}),Object[_0x295a19(0x199)](_0x1476fb,_0x2fabdd,_0x2b0323);}:function(_0x4bc160,_0x5a98c2,_0x9f8435,_0x15ea4e){if(_0x15ea4e===undefined)_0x15ea4e=_0x9f8435;_0x4bc160[_0x15ea4e]=_0x5a98c2[_0x9f8435];}),__setModuleDefault=this&&this[a18_0x211115(0x142)]||(Object[a18_0x211115(0x170)]?function(_0x258337,_0x2adbbe){const _0x308487=a18_0x211115,_0x2cd0bc={'ULxml':_0x308487(0x153)};Object['defineProperty'](_0x258337,_0x2cd0bc[_0x308487(0x166)],{'enumerable':!![],'value':_0x2adbbe});}:function(_0x5f02c3,_0x121dd7){const _0x2342ae=a18_0x211115;_0x5f02c3[_0x2342ae(0x153)]=_0x121dd7;}),__importStar=this&&this[a18_0x211115(0x16a)]||function(_0x3ec71a){const _0x37274d=a18_0x211115,_0x38e109={'CmmJz':'4|1|0|3|2','KnsUW':function(_0x281abf,_0xb07043){return _0x281abf!==_0xb07043;},'PdlwB':function(_0x20de07,_0x52cd1f,_0x36fc9a,_0x467bc8){return _0x20de07(_0x52cd1f,_0x36fc9a,_0x467bc8);},'KxAJr':function(_0x122bf7,_0x3be2f6,_0x5f0a8b){return _0x122bf7(_0x3be2f6,_0x5f0a8b);}},_0x553879=_0x38e109[_0x37274d(0x140)]['split']('|');let _0x2dae8c=0x0;while(!![]){switch(_0x553879[_0x2dae8c++]){case'0':if(_0x3ec71a!=null){for(var _0x5920de in _0x3ec71a)if(_0x38e109[_0x37274d(0x182)](_0x5920de,'default')&&Object[_0x37274d(0x171)][_0x37274d(0x15e)][_0x37274d(0x150)](_0x3ec71a,_0x5920de))_0x38e109[_0x37274d(0x13f)](__createBinding,_0x2a7321,_0x3ec71a,_0x5920de);}continue;case'1':var _0x2a7321={};continue;case'2':return _0x2a7321;case'3':_0x38e109[_0x37274d(0x14c)](__setModuleDefault,_0x2a7321,_0x3ec71a);continue;case'4':if(_0x3ec71a&&_0x3ec71a['__esModule'])return _0x3ec71a;continue;}break;}};function a18_0x280d(_0xd36815,_0x1546aa){const _0x4a2930=a18_0x1045();return a18_0x280d=function(_0x556d3c,_0x3916c6){_0x556d3c=_0x556d3c-0x13c;let _0x10459d=_0x4a2930[_0x556d3c];return _0x10459d;},a18_0x280d(_0xd36815,_0x1546aa);}Object[a18_0x211115(0x199)](exports,'__esModule',{'value':!![]}),exports[a18_0x211115(0x17b)]=void 0x0;const fs=__importStar(require('fs')),path=__importStar(require(a18_0x211115(0x173))),errors_1=require('../utils/errors'),flow_creator_1=require(a18_0x211115(0x196)),session_adaptor_1=require('./session-adaptor');class FileSession extends session_adaptor_1[a18_0x211115(0x158)]{constructor(){const _0x19ea3c=a18_0x211115;super(),this[_0x19ea3c(0x141)]=path[_0x19ea3c(0x151)](__dirname,_0x19ea3c(0x17e));}async['fetch'](_0x20078c){const _0x5d04f2=a18_0x211115,_0x3eb5a0={'kJETR':'ClYGK','mxSTZ':_0x5d04f2(0x169),'CXxys':function(_0x5a6684,_0x585eca){return _0x5a6684===_0x585eca;},'Uqdlj':_0x5d04f2(0x157)};let _0x9932f1;if(_0x20078c){if(_0x3eb5a0[_0x5d04f2(0x168)]!==_0x3eb5a0[_0x5d04f2(0x16d)])_0x9932f1=await this[_0x5d04f2(0x197)](_0x20078c),_0x9932f1&&((_0x3eb5a0[_0x5d04f2(0x146)](_0x9932f1[_0x5d04f2(0x192)],_0x3eb5a0[_0x5d04f2(0x15b)])||_0x3eb5a0[_0x5d04f2(0x146)](_0x9932f1[_0x5d04f2(0x192)],_0x5d04f2(0x185)))&&(_0x9932f1=null));else return null;}if(_0x9932f1)return _0x9932f1['id']=_0x20078c,[![],_0x9932f1];else{const _0x580725=await this[_0x5d04f2(0x170)]();return this[_0x5d04f2(0x141)]=path[_0x5d04f2(0x151)](__dirname,_0x5d04f2(0x13e)+_0x580725['id']+_0x5d04f2(0x184)),[!![],_0x580725];}}async['fetchAll'](_0x2df7eb){const _0x589290=a18_0x211115,_0x3dc000={'fRpCN':_0x589290(0x17d),'kgfru':function(_0xadd505,_0x544a2c){return _0xadd505!==_0x544a2c;},'ExRjG':'mYwuX','ciIQD':_0x589290(0x16b)};let _0x48294a;_0x2df7eb&&(_0x3dc000[_0x589290(0x16e)](_0x3dc000[_0x589290(0x18e)],_0x3dc000['ExRjG'])?_0x3a5b0a[_0x589290(0x18d)](_0x3dc000['fRpCN'],_0x399c31):_0x48294a=await this[_0x589290(0x197)](_0x2df7eb));if(_0x48294a){if(_0x3dc000[_0x589290(0x147)]!==_0x3dc000[_0x589290(0x147)]){this[_0x589290(0x141)]=_0x15a237['join'](_0x4d4349,_0x589290(0x13e)+_0x441bdd+_0x589290(0x184));const _0x2a101a=_0xf078e3[_0x589290(0x15f)](this[_0x589290(0x141)],_0x589290(0x143)),_0x26524f=_0x2eff24['parse'](_0x2a101a);return _0x26524f;}else _0x48294a['id']=_0x2df7eb;}return _0x48294a;}async[a18_0x211115(0x170)](){const _0xb3be1c=await flow_creator_1['FlowCreator']['createDoc']();return _0xb3be1c;}async[a18_0x211115(0x197)](_0x33c551){const _0x28e789=a18_0x211115,_0x1d245d={'Yjtrf':'ugFhk','YSAfp':'utf-8'};try{if(_0x1d245d[_0x28e789(0x172)]!==_0x1d245d[_0x28e789(0x172)]){if(_0x326d82){const _0x1cecd8=_0x369892[_0x28e789(0x167)](_0x672d21,arguments);return _0x4e9e1f=null,_0x1cecd8;}}else{this[_0x28e789(0x141)]=path['join'](__dirname,_0x28e789(0x13e)+_0x33c551+_0x28e789(0x184));const _0x4794f7=fs[_0x28e789(0x15f)](this[_0x28e789(0x141)],_0x1d245d[_0x28e789(0x145)]),_0x4179ae=JSON[_0x28e789(0x148)](_0x4794f7);return _0x4179ae;}}catch(_0x388f75){return null;}}async[a18_0x211115(0x14f)](_0x2a50e9){const _0x3ce78c=a18_0x211115,_0x5d1a3c={'Nhocq':'2|0|3|1|4','onGQy':function(_0x54f2ee,_0x2fd3a5,_0x404570){return _0x54f2ee(_0x2fd3a5,_0x404570);},'qCYie':function(_0x4932e2,_0x522b76){return _0x4932e2!=_0x522b76;},'WVumt':function(_0x36fe1d,_0x346ae9){return _0x36fe1d!==_0x346ae9;},'JwdnY':_0x3ce78c(0x153),'OctMh':_0x3ce78c(0x13d)};try{if(_0x3ce78c(0x13d)===_0x5d1a3c['OctMh']){const _0x1bf4a9=path[_0x3ce78c(0x154)](this[_0x3ce78c(0x141)]);!fs[_0x3ce78c(0x180)](_0x1bf4a9)&&fs['mkdirSync'](_0x1bf4a9,{'recursive':!![]}),fs[_0x3ce78c(0x15a)](this[_0x3ce78c(0x141)],JSON[_0x3ce78c(0x14a)](_0x2a50e9),_0x3ce78c(0x143));}else{const _0xcad6b0=_0x5d1a3c[_0x3ce78c(0x160)][_0x3ce78c(0x14b)]('|');let _0x8a5a2a=0x0;while(!![]){switch(_0xcad6b0[_0x8a5a2a++]){case'0':var _0x123a12={};continue;case'1':_0x5d1a3c[_0x3ce78c(0x176)](_0xd05ca9,_0x123a12,_0x3ada36);continue;case'2':if(_0x1340a8&&_0x46f6cc[_0x3ce78c(0x164)])return _0x320fc2;continue;case'3':if(_0x5d1a3c[_0x3ce78c(0x15d)](_0x2e4965,null)){for(var _0x5748c5 in _0x4e08e0)if(_0x5d1a3c[_0x3ce78c(0x193)](_0x5748c5,_0x5d1a3c[_0x3ce78c(0x163)])&&_0x316624[_0x3ce78c(0x171)][_0x3ce78c(0x15e)]['call'](_0x2f8ea2,_0x5748c5))_0x4f5201(_0x123a12,_0x4824af,_0x5748c5);}continue;case'4':return _0x123a12;}break;}}}catch(_0x587a10){console[_0x3ce78c(0x18d)](_0x3ce78c(0x17d),_0x587a10);}}async['delete'](_0x5e73cf){const _0x46c9fe=a18_0x211115,_0x320b78={'uapnm':function(_0x17dffb,_0x8f4a7b){return _0x17dffb===_0x8f4a7b;},'JtlWL':_0x46c9fe(0x17c),'loMQv':_0x46c9fe(0x188)};try{if(_0x320b78[_0x46c9fe(0x17a)](_0x320b78[_0x46c9fe(0x178)],_0x320b78[_0x46c9fe(0x186)]))return _0x46f21f['id']=_0x1be25b,[![],_0x3906b4];else await fs['unlink'](this[_0x46c9fe(0x141)],_0x41115e=>{});}catch(_0x55fc5c){console[_0x46c9fe(0x18d)]((0x0,errors_1['WrapError'])(_0x55fc5c,(0x0,errors_1[_0x46c9fe(0x14e)])(_0x5e73cf)));}}}exports[a18_0x211115(0x17b)]=FileSession;function a18_0x1045(){const _0x821ed=['default','dirname','vPuzr','dfZqh','completed','SessionAdaptor','VIMWV','writeFileSync','Uqdlj','wUENx','qCYie','hasOwnProperty','readFileSync','Nhocq','365316plCCpJ','getOwnPropertyDescriptor','JwdnY','__esModule','vNwRl','ULxml','apply','kJETR','lksEY','__importStar','hLDco','search','mxSTZ','kgfru','writable','create','prototype','Yjtrf','path','5296JXXPKh','sNJEq','onGQy','168pZgWpw','JtlWL','CmDpu','uapnm','FileSession','BoLkV','Error\x20saving\x20messages:','session.json','BcTxJ','existsSync','get','KnsUW','toString','/session.json','aborted','loMQv','DMbDI','oelUh','constructor','TSvMn','348168uuRToH','62eZLEdN','error','ExRjG','configurable','jIYmZ','252WkyodZ','runStatus','WVumt','gcMqZ','244830hWDmyn','../flow/flow-creator','restore','215618gFlnpT','defineProperty','DCZNq','HUBlz','../../ignore/','PdlwB','CmmJz','filePath','__setModuleDefault','utf-8','__createBinding','YSAfp','CXxys','ciIQD','parse','524937LCXitA','stringify','split','KxAJr','MoRdA','DELETE_SESSION_ERROR','save','call','join','(((.+)+)+)+$'];a18_0x1045=function(){return _0x821ed;};return a18_0x1045();}
|
|
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;
|