@picoflow/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +37 -0
  3. package/clients/http-client.d.ts +13 -0
  4. package/clients/http-client.js +1 -0
  5. package/clients/self-client.d.ts +4 -0
  6. package/clients/self-client.js +1 -0
  7. package/configs/core-config.d.ts +22 -0
  8. package/configs/core-config.js +1 -0
  9. package/decorators/stop-tool.d.ts +2 -0
  10. package/decorators/stop-tool.js +1 -0
  11. package/flow/content-type.d.ts +38 -0
  12. package/flow/content-type.js +1 -0
  13. package/flow/end-step.d.ts +14 -0
  14. package/flow/end-step.js +1 -0
  15. package/flow/flow-creator.d.ts +7 -0
  16. package/flow/flow-creator.js +1 -0
  17. package/flow/flow-types.d.ts +718 -0
  18. package/flow/flow-types.js +1 -0
  19. package/flow/flow.d.ts +55 -0
  20. package/flow/flow.js +1 -0
  21. package/flow/llm-runner.d.ts +11 -0
  22. package/flow/llm-runner.js +1 -0
  23. package/flow/logic-runner.d.ts +6 -0
  24. package/flow/logic-runner.js +1 -0
  25. package/flow/logic-step.d.ts +8 -0
  26. package/flow/logic-step.js +1 -0
  27. package/flow/memory.d.ts +10 -0
  28. package/flow/memory.js +1 -0
  29. package/flow/step.d.ts +63 -0
  30. package/flow/step.js +1 -0
  31. package/index.d.ts +34 -0
  32. package/index.js +47 -0
  33. package/package.json +34 -0
  34. package/prompt/endchat.md +6 -0
  35. package/prompt/flow-prompt.d.ts +3 -0
  36. package/prompt/flow-prompt.js +1 -0
  37. package/prompt/prompt-util.d.ts +7 -0
  38. package/prompt/prompt-util.js +1 -0
  39. package/services/flow-engine.d.ts +55 -0
  40. package/services/flow-engine.js +1 -0
  41. package/session/cosmo-session.d.ts +14 -0
  42. package/session/cosmo-session.js +1 -0
  43. package/session/file-session.d.ts +12 -0
  44. package/session/file-session.js +1 -0
  45. package/session/flow-session.d.ts +15 -0
  46. package/session/flow-session.js +1 -0
  47. package/session/mongo-session.d.ts +13 -0
  48. package/session/mongo-session.js +1 -0
  49. package/session/session-adaptor.d.ts +9 -0
  50. package/session/session-adaptor.js +1 -0
  51. package/session/session-logger.d.ts +12 -0
  52. package/session/session-logger.js +1 -0
  53. package/utils/constants.d.ts +7 -0
  54. package/utils/constants.js +1 -0
  55. package/utils/environ.d.ts +2 -0
  56. package/utils/environ.js +1 -0
  57. package/utils/errors.d.ts +28 -0
  58. package/utils/errors.js +1 -0
  59. package/utils/license-util.d.ts +17 -0
  60. package/utils/license-util.js +1 -0
  61. package/utils/llm-file.d.ts +22 -0
  62. package/utils/llm-file.js +1 -0
  63. package/utils/logic.d.ts +5 -0
  64. package/utils/logic.js +1 -0
  65. package/utils/message-util.d.ts +47 -0
  66. package/utils/message-util.js +1 -0
  67. package/utils/retry.d.ts +13 -0
  68. package/utils/retry.js +1 -0
  69. package/utils/string-util.d.ts +6 -0
  70. package/utils/string-util.js +1 -0
  71. package/utils/tool-util.d.ts +5 -0
  72. package/utils/tool-util.js +1 -0
  73. package/utils/verify-license.d.ts +1 -0
  74. package/utils/verify-license.js +1 -0
@@ -0,0 +1 @@
1
+ 'use strict';const a7_0x302199=a7_0x1a2c;function a7_0x1a2c(_0x5515eb,_0x4fd29c){const _0x2fccb2=a7_0x3879();return a7_0x1a2c=function(_0x221560,_0x1f33ff){_0x221560=_0x221560-0x7f;let _0x387952=_0x2fccb2[_0x221560];return _0x387952;},a7_0x1a2c(_0x5515eb,_0x4fd29c);}(function(_0x2df072,_0x3780d2){const _0x1a426a=a7_0x1a2c,_0x1395ee=_0x2df072();while(!![]){try{const _0x2bf253=parseInt(_0x1a426a(0xa0))/0x1*(-parseInt(_0x1a426a(0x87))/0x2)+-parseInt(_0x1a426a(0x83))/0x3+-parseInt(_0x1a426a(0x9d))/0x4+parseInt(_0x1a426a(0x8e))/0x5+-parseInt(_0x1a426a(0x99))/0x6+parseInt(_0x1a426a(0x8f))/0x7+parseInt(_0x1a426a(0x84))/0x8*(parseInt(_0x1a426a(0x95))/0x9);if(_0x2bf253===_0x3780d2)break;else _0x1395ee['push'](_0x1395ee['shift']());}catch(_0x21cb56){_0x1395ee['push'](_0x1395ee['shift']());}}}(a7_0x3879,0x1c7fc));function a7_0x3879(){const _0x12f25f=['optional','search','string','(((.+)+)+)+$','record','2619774iPxknQ','nonempty','kBMWi','completed','552198MGZEMi','createZodDto','system','RunResponseDto','503116lKxYJR','tool','array','2fbCTtU','date','HttpContentType','number','zod','BnbHX','./content-type','object','constructor','toString','success','any','error','275526PSjWth','8QkYVcz','ToolStatus','aborted','198662BasnMA','boolean','__esModule','running','zVtRm','enum','apply','979410VuGDur','966560GHPqlz'];a7_0x3879=function(){return _0x12f25f;};return a7_0x3879();}Object['defineProperty'](exports,a7_0x302199(0x89),{'value':!![]}),exports['RunResponseDto']=exports[a7_0x302199(0x85)]=void 0x0;const zod_1=require(a7_0x302199(0xa4)),zod_nestjs_1=require('@anatine/zod-nestjs'),content_type_1=require(a7_0x302199(0xa6)),RoleEnum=zod_1['z'][a7_0x302199(0x8c)]([a7_0x302199(0x9b),'human','ai',a7_0x302199(0x9e)]),ToolStatusEnum=zod_1['z'][a7_0x302199(0x8c)]([a7_0x302199(0x80),a7_0x302199(0x82)]),AIToolMessageSchema=zod_1['z']['object']({'name':zod_1['z'][a7_0x302199(0x92)](),'args':zod_1['z'][a7_0x302199(0xa7)]({}),'id':zod_1['z']['string']()}),ChatMessageSchema=zod_1['z']['object']({'id':zod_1['z'][a7_0x302199(0x92)](),'type':RoleEnum,'content':zod_1['z'][a7_0x302199(0x92)](),'timestamp':zod_1['z']['date'](),'tool_call_id':zod_1['z'][a7_0x302199(0x92)]()['optional'](),'name':zod_1['z'][a7_0x302199(0x92)](),'status':ToolStatusEnum[a7_0x302199(0x90)](),'tool_calls':zod_1['z'][a7_0x302199(0x9f)](AIToolMessageSchema)['optional'](),'additional_kwargs':zod_1['z'][a7_0x302199(0x94)](zod_1['z'][a7_0x302199(0x81)]())[a7_0x302199(0x90)]()}),StepSchema=zod_1['z'][a7_0x302199(0xa7)]({'name':zod_1['z'][a7_0x302199(0x92)](),'isActive':zod_1['z'][a7_0x302199(0x88)](),'state':zod_1['z'][a7_0x302199(0xa7)]({}),'modelName':zod_1['z'][a7_0x302199(0x92)](),'temperature':zod_1['z']['number']()}),MemorySchema=zod_1['z'][a7_0x302199(0xa7)]({'nameSpace':zod_1['z'][a7_0x302199(0x92)](),'history':zod_1['z'][a7_0x302199(0x9f)](ChatMessageSchema)}),FlowSchema=zod_1['z'][a7_0x302199(0xa7)]({'name':zod_1['z'][a7_0x302199(0x92)](),'memory':zod_1['z']['array'](MemorySchema),'steps':zod_1['z'][a7_0x302199(0x9f)](StepSchema),'context':zod_1['z'][a7_0x302199(0xa7)]({}),'temperature':zod_1['z'][a7_0x302199(0xa3)](),'sequence':zod_1['z'][a7_0x302199(0x9f)](zod_1['z'][a7_0x302199(0x92)]())}),RunStatusSchema=zod_1['z'][a7_0x302199(0x8c)]([a7_0x302199(0x98),a7_0x302199(0x86),a7_0x302199(0x8a)]),_SessionSchema=zod_1['z'][a7_0x302199(0xa7)]({'id':zod_1['z'][a7_0x302199(0x92)]()[a7_0x302199(0x96)](),'createdOn':zod_1['z'][a7_0x302199(0xa1)](),'saveOn':zod_1['z'][a7_0x302199(0xa1)](),'runStatus':RunStatusSchema,'version':zod_1['z'][a7_0x302199(0xa3)](),'expireAfter':zod_1['z'][a7_0x302199(0xa3)](),'flows':zod_1['z'][a7_0x302199(0x9f)](FlowSchema),'log':zod_1['z'][a7_0x302199(0x9f)](zod_1['z'][a7_0x302199(0xa7)]({})),'error':zod_1['z']['array'](zod_1['z'][a7_0x302199(0xa7)]({})),'warn':zod_1['z'][a7_0x302199(0x9f)](zod_1['z'][a7_0x302199(0xa7)]({})),'debug':zod_1['z'][a7_0x302199(0x9f)](zod_1['z'][a7_0x302199(0xa7)]({})),'verbose':zod_1['z']['array'](zod_1['z'][a7_0x302199(0xa7)]({})),'tokens':zod_1['z'][a7_0x302199(0xa7)]({'inputTokens':zod_1['z'][a7_0x302199(0xa3)](),'outputTokens':zod_1['z'][a7_0x302199(0xa3)](),'totalTokens':zod_1['z']['number']()})});var ToolStatus;(function(_0x10036f){const _0x2ced6d=a7_0x302199,_0x53a1d3={'kBMWi':_0x2ced6d(0x93),'GzNZR':function(_0x665719,_0x34d719,_0x4cf2e8){return _0x665719(_0x34d719,_0x4cf2e8);},'zVtRm':function(_0x402422){return _0x402422();},'BnbHX':'success','DHMuo':_0x2ced6d(0x82)},_0x3b88e6=(function(){let _0x2bccde=!![];return function(_0x19cae2,_0x240a6d){const _0x74b28a=_0x2bccde?function(){const _0x39637d=a7_0x1a2c;if(_0x240a6d){const _0x158ff9=_0x240a6d[_0x39637d(0x8d)](_0x19cae2,arguments);return _0x240a6d=null,_0x158ff9;}}:function(){};return _0x2bccde=![],_0x74b28a;};}()),_0x4e4564=_0x53a1d3['GzNZR'](_0x3b88e6,this,function(){const _0x103da0=_0x2ced6d;return _0x4e4564[_0x103da0(0x7f)]()['search'](_0x53a1d3[_0x103da0(0x97)])[_0x103da0(0x7f)]()[_0x103da0(0xa8)](_0x4e4564)[_0x103da0(0x91)](_0x53a1d3['kBMWi']);});_0x53a1d3[_0x2ced6d(0x8b)](_0x4e4564),_0x10036f[_0x53a1d3[_0x2ced6d(0xa5)]]=_0x53a1d3[_0x2ced6d(0xa5)],_0x10036f[_0x2ced6d(0x82)]=_0x53a1d3['DHMuo'];}(ToolStatus||(exports[a7_0x302199(0x85)]=ToolStatus={})));const _ToolSchema=zod_1['z'][a7_0x302199(0xa7)]({'name':zod_1['z']['string'](),'description':zod_1['z'][a7_0x302199(0x92)](),'schema':zod_1['z'][a7_0x302199(0xa7)]({})}),RunResponseSchema=zod_1['z'][a7_0x302199(0xa7)]({'success':zod_1['z'][a7_0x302199(0x88)](),'completed':zod_1['z'][a7_0x302199(0x88)](),'message':zod_1['z'][a7_0x302199(0x92)](),'session':zod_1['z'][a7_0x302199(0x92)](),'contentType':zod_1['z']['nativeEnum'](content_type_1[a7_0x302199(0xa2)])});class RunResponseDto extends(0x0,zod_nestjs_1[a7_0x302199(0x9a)])(RunResponseSchema){}exports[a7_0x302199(0x9c)]=RunResponseDto;
package/flow/flow.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ import { DynamicStructuredTool } from '@langchain/core/tools';
2
+ import { Memory } from '../flow/memory';
3
+ import { MessageTypes } from '../utils/message-util';
4
+ import { FlowEngine } from '../services/flow-engine';
5
+ import { ClassType, RunResponseType, SessionType, ToolType } from './flow-types';
6
+ import { Step } from './step';
7
+ export declare abstract class Flow {
8
+ protected stepMap: Map<string, Step>;
9
+ protected tools: Map<string, DynamicStructuredTool>;
10
+ protected name: string;
11
+ protected sessionDoc: SessionType;
12
+ private flowDoc;
13
+ private memory;
14
+ private flowEngine;
15
+ private context;
16
+ protected temp: number;
17
+ protected constructor(flowClass: ClassType);
18
+ init(): Promise<void>;
19
+ getFlowEngine(): FlowEngine;
20
+ bootstrap(sessionId: string, flowEngine: FlowEngine): Promise<void>;
21
+ private assignFlowDoc;
22
+ tallyToken(usageMetadata: any): void;
23
+ collectSteps(): void;
24
+ protected defineSteps(): Step[];
25
+ private createDoc;
26
+ private readDoc;
27
+ getSessionId(): string;
28
+ saveSession(): Promise<void>;
29
+ getActiveStep(): Step | null;
30
+ getStep(stepName: string): Step;
31
+ defineTool(): ToolType[];
32
+ run(message: string): Promise<RunResponseType>;
33
+ protected spawnSteps(): Promise<string>;
34
+ concurrentSteps<T>({ items, batchSize, onConfig, onBotResponse, }: {
35
+ items: T[];
36
+ batchSize: number;
37
+ onConfig: (item: T) => object;
38
+ onBotResponse: (item: T, response: any) => void;
39
+ }): Promise<void>;
40
+ setMemory(memory: Memory): void;
41
+ getMemory(nameSpace: string): MessageTypes[];
42
+ setContext(context: object): void;
43
+ addContext(json: object): void;
44
+ getContext<T>(key: string): T;
45
+ activate(stepClass: ClassType): Promise<Step>;
46
+ activateByName(stepName: string): Promise<Step>;
47
+ getTool(name: string): DynamicStructuredTool;
48
+ private composeTool;
49
+ getSessionDoc(): SessionType;
50
+ getStepState(stepClass: ClassType, key?: string): object;
51
+ getStepStateAs<T>(stepClass: ClassType, key?: string): T;
52
+ saveStepState(stepClass: ClassType, json: object): void;
53
+ get temperature(): number;
54
+ set temperature(temperature: number);
55
+ }
package/flow/flow.js ADDED
@@ -0,0 +1 @@
1
+ const a8_0x46ef60=a8_0x1dbb;(function(_0x1decb7,_0x1d9097){const _0x1e7666=a8_0x1dbb,_0x308bf6=_0x1decb7();while(!![]){try{const _0x511eed=parseInt(_0x1e7666(0x22e))/0x1+parseInt(_0x1e7666(0x1f4))/0x2+-parseInt(_0x1e7666(0x1fe))/0x3*(parseInt(_0x1e7666(0x1e5))/0x4)+parseInt(_0x1e7666(0x229))/0x5+-parseInt(_0x1e7666(0x26c))/0x6+parseInt(_0x1e7666(0x1e9))/0x7+-parseInt(_0x1e7666(0x25c))/0x8;if(_0x511eed===_0x1d9097)break;else _0x308bf6['push'](_0x308bf6['shift']());}catch(_0x528cdd){_0x308bf6['push'](_0x308bf6['shift']());}}}(a8_0x1d88,0x727c2));const a8_0x1415b4=(function(){const _0x1a09e4=a8_0x1dbb,_0x448b92={'VervE':function(_0x3774c9,_0x117f3c){return _0x3774c9!==_0x117f3c;},'TWXPT':'trhda','ctpqv':_0x1a09e4(0x25d)};let _0x3d8fd7=!![];return function(_0xb19be7,_0x539b74){const _0x4d17e5=_0x3d8fd7?function(){const _0x3a9593=a8_0x1dbb;if(_0x539b74){if(_0x448b92[_0x3a9593(0x21c)](_0x448b92['TWXPT'],_0x448b92['ctpqv'])){const _0x4fb9df=_0x539b74[_0x3a9593(0x224)](_0xb19be7,arguments);return _0x539b74=null,_0x4fb9df;}else return'';}}:function(){};return _0x3d8fd7=![],_0x4d17e5;};}()),a8_0x38796d=a8_0x1415b4(this,function(){const _0x2edd00=a8_0x1dbb,_0x4b0d9f={'ZkpvB':_0x2edd00(0x24e)};return a8_0x38796d[_0x2edd00(0x200)]()[_0x2edd00(0x1df)](_0x4b0d9f[_0x2edd00(0x239)])['toString']()[_0x2edd00(0x225)](a8_0x38796d)[_0x2edd00(0x1df)](_0x4b0d9f[_0x2edd00(0x239)]);});a8_0x38796d();function a8_0x1d88(){const _0x14c733=['active','log','ceil',',\x20error:','flowEngine','591eoEzGn','jyVOY','toString','oDBMs','post','tallyToken','tokens','bTxQI','name','SaiQY','saveSession','sessionDoc','ThYDj','CaDRb','NYDne','./end-step','KxQVk','YvQrY','RYvkl','setMemory','getSessionDoc','dlLlG','memory','Batch\x20','run','stepMap','OELNM','sequence','YJvlF','bootstrap','VervE','writeDoc','FqHMN','temperature','output_tokens','Geprb','total_tokens','AZYjr','apply','constructor','message','DynamicStructuredTool','steps','3777905EsaRTK','split','saveStepState','../clients/self-client','activate','657218qCYrbW','uyygW','ayAvb','QmPqN','sPFwc','iHyzY','SessionLogger','get','useMemory','slice','Nicgy','ZkpvB','4|0|2|3|1','\x20completed.','getFlowEngine','Tvzym','all','uRsFV','oDsQA','GUbMf','AgHVd','concurrentSteps','PAXQm','getFlowSession','totalTokens','length','getModelName','xjfJE','getName','contentType','getMessages','temp','(((.+)+)+)+$','isEnd','tools','assignFlowDoc','__esModule','readDoc','getStateAs','Flow','setContext','spawnSteps','@langchain/core/tools','filter','activateByName','GyWiV','5923776QXdcQs','yelqW','getModel','input_tokens','defineSteps','getContext','getActiveStep','merge','aIYXs','error','getMemory','fetch','context','BBaGx','inputTokens','push','1897146tAZFVy','BJlTD','getStep','flowDoc','bYgKi','XsYLE','djTfG','search','floor','ZhcJq','composeTool','useModel','save','18628kgDczU','tPmDV','gzhJA','../session/session-logger','2724036ppDhmL','set','defineTool','saveState','grqVb','createDoc','Processing\x20batch\x20','flows','gvNjV','getStepStateAs','outputTokens','1282150dVRYoq','EndStep','jdUhZ','deEtI','SelfClient'];a8_0x1d88=function(){return _0x14c733;};return a8_0x1d88();}'use strict';Object['defineProperty'](exports,a8_0x46ef60(0x252),{'value':!![]}),exports[a8_0x46ef60(0x255)]=void 0x0;function a8_0x1dbb(_0x139151,_0x34e07a){const _0x43420d=a8_0x1d88();return a8_0x1dbb=function(_0x38796d,_0x1415b4){_0x38796d=_0x38796d-0x1dd;let _0x1d88c5=_0x43420d[_0x38796d];return _0x1d88c5;},a8_0x1dbb(_0x139151,_0x34e07a);}const tools_1=require(a8_0x46ef60(0x258)),lodash_1=require('lodash'),end_step_1=require(a8_0x46ef60(0x20d)),self_client_1=require(a8_0x46ef60(0x22c)),session_logger_1=require(a8_0x46ef60(0x1e8));class Flow{constructor(_0x6b9d40){const _0xac140c=a8_0x46ef60,_0x82b2a6={'GyWiV':_0xac140c(0x23a)},_0x5bb0bf=_0x82b2a6[_0xac140c(0x25b)][_0xac140c(0x22a)]('|');let _0x62a835=0x0;while(!![]){switch(_0x5bb0bf[_0x62a835++]){case'0':this[_0xac140c(0x250)]=new Map();continue;case'1':this[_0xac140c(0x268)]={};continue;case'2':this[_0xac140c(0x24d)]=-0x1;continue;case'3':this[_0xac140c(0x206)]=_0x6b9d40[_0xac140c(0x206)];continue;case'4':this[_0xac140c(0x217)]=new Map();continue;}break;}}async['init'](){}[a8_0x46ef60(0x23c)](){const _0x1b8a4f=a8_0x46ef60;return this[_0x1b8a4f(0x1fd)];}async[a8_0x46ef60(0x21b)](_0x34f706,_0x1d7e61){const _0x11e8d9=a8_0x46ef60,_0x3ef0ba={'KxQVk':_0x11e8d9(0x264),'tPmDV':_0x11e8d9(0x1e7),'Tvzym':function(_0x370858,_0x504d74){return _0x370858===_0x504d74;},'ijMft':function(_0x2601f3,_0xa60f6b){return _0x2601f3===_0xa60f6b;},'ayAvb':_0x11e8d9(0x1de),'sPFwc':_0x11e8d9(0x249),'UMjaR':'harnj'};this[_0x11e8d9(0x1fd)]=_0x1d7e61;for(const [,_0xda547f]of this[_0x11e8d9(0x217)]){const _0x596f1a=_0xda547f[_0x11e8d9(0x25e)]();if(!_0x596f1a){const _0x26676c=this[_0x11e8d9(0x23c)]()[_0x11e8d9(0x248)]();_0xda547f[_0x11e8d9(0x1e3)](_0x26676c);}}const _0x21670d=_0x1d7e61['getFlowSession'](),[_0x3d404c,_0xc14888]=await _0x21670d[_0x11e8d9(0x267)](_0x34f706);if(_0x3d404c){if(_0x3ef0ba[_0x11e8d9(0x20e)]===_0x3ef0ba[_0x11e8d9(0x1e6)]){if(_0x1777e3){const _0x52c2bd=_0x42bf43[_0x11e8d9(0x224)](_0x5145ea,arguments);return _0x3049ab=null,_0x52c2bd;}}else this[_0x11e8d9(0x209)]=this[_0x11e8d9(0x1ee)](_0xc14888),this[_0x11e8d9(0x251)](),this['saveSession']();}else this[_0x11e8d9(0x209)]=_0xc14888,this[_0x11e8d9(0x251)](),this[_0x11e8d9(0x253)]();if(_0x3ef0ba[_0x11e8d9(0x23d)](this[_0x11e8d9(0x26f)][_0x11e8d9(0x219)]['length'],0x0)){if(_0x3ef0ba['ijMft'](_0x3ef0ba[_0x11e8d9(0x230)],_0x3ef0ba[_0x11e8d9(0x230)])){const _0x304020=this['getActiveStep']();if(_0x304020){if(_0x3ef0ba[_0x11e8d9(0x232)]!==_0x3ef0ba['UMjaR'])this[_0x11e8d9(0x26f)]['sequence'][_0x11e8d9(0x26b)](_0x304020[_0x11e8d9(0x24a)]());else return this[_0x11e8d9(0x209)];}}else{const _0x185d19=[];for(const [,_0x566ce1]of this['stepMap']){_0x185d19[_0x11e8d9(0x26b)](_0x566ce1[_0x11e8d9(0x1ee)]());}const _0x2e30e5={'name':this[_0x11e8d9(0x206)],'memory':this['memory']['createOoc'](),'steps':_0x185d19,'context':this[_0x11e8d9(0x268)]};return _0x557064['flows'][_0x11e8d9(0x26b)](_0x2e30e5),_0x5daace;}}this[_0x11e8d9(0x1e2)]();}[a8_0x46ef60(0x251)](){const _0x3e69ce=a8_0x46ef60,_0x207008={'bYgKi':function(_0xfc01a5,_0x5e3678){return _0xfc01a5===_0x5e3678;},'ThYDj':_0x3e69ce(0x1f7)},_0x4cb5c2=this['sessionDoc'][_0x3e69ce(0x1f0)][_0x3e69ce(0x259)](_0xec082e=>{const _0x2f1f81=_0x3e69ce;if(_0x207008['bYgKi'](_0x207008[_0x2f1f81(0x20a)],_0x207008[_0x2f1f81(0x20a)])){if(_0x207008[_0x2f1f81(0x270)](_0xec082e['name'],this['name']))return!![];return![];}else return null;});this['flowDoc']=_0x4cb5c2[0x0],this[_0x3e69ce(0x26f)][_0x3e69ce(0x219)]=this['flowDoc']['sequence']||[];}[a8_0x46ef60(0x203)](_0x3ce8fe){const _0xcca576=a8_0x46ef60,_0x18ad30={'laBmQ':function(_0x16b19b,_0x8ca6c1){return _0x16b19b===_0x8ca6c1;},'BBaGx':'Tiqom','DYnQO':'cZyYt','jyVOY':_0xcca576(0x25f),'Geprb':_0xcca576(0x220),'Nicgy':_0xcca576(0x222),'dlLlG':'ryWRY'};if(_0x3ce8fe){if(_0x18ad30['laBmQ'](_0x18ad30[_0xcca576(0x269)],_0x18ad30['DYnQO']))return this['tools'][_0xcca576(0x235)](_0x12176e);else{const _0xb3d351=_0x3ce8fe[_0x18ad30[_0xcca576(0x1ff)]],_0xc41acd=_0x3ce8fe[_0x18ad30[_0xcca576(0x221)]],_0x3b4ee9=_0x3ce8fe[_0x18ad30[_0xcca576(0x238)]];_0xb3d351&&(this['sessionDoc'][_0xcca576(0x204)][_0xcca576(0x26a)]+=_0xb3d351),_0xc41acd&&(this['sessionDoc'][_0xcca576(0x204)][_0xcca576(0x1f3)]+=_0xc41acd),_0x3b4ee9&&(_0x18ad30[_0xcca576(0x213)]!==_0xcca576(0x210)?this[_0xcca576(0x209)][_0xcca576(0x204)][_0xcca576(0x246)]+=_0x3b4ee9:this['stepMap'][_0xcca576(0x1ea)](_0x5e6502['getName'](),_0x3a792e));}}}['collectSteps'](){const _0x163222=a8_0x46ef60,_0x3b9226=this[_0x163222(0x260)]();for(const _0x4a9be8 of _0x3b9226){this['stepMap'][_0x163222(0x1ea)](_0x4a9be8[_0x163222(0x24a)](),_0x4a9be8);}}[a8_0x46ef60(0x260)](){const _0x538a09=a8_0x46ef60;return[new end_step_1['EndStep'](this)['useMemory'](_0x538a09(0x24d))];}[a8_0x46ef60(0x1ee)](_0x365541){const _0x5c556b=a8_0x46ef60,_0x24d194={'DGaNd':function(_0x2a9c98,_0xf8885b){return _0x2a9c98!==_0xf8885b;},'bTxQI':_0x5c556b(0x241),'jdUhZ':'RDNgA'},_0x406c39=[];for(const [,_0x29f7b4]of this[_0x5c556b(0x217)]){if(_0x24d194['DGaNd'](_0x24d194[_0x5c556b(0x205)],_0x24d194[_0x5c556b(0x1f6)]))_0x406c39[_0x5c556b(0x26b)](_0x29f7b4[_0x5c556b(0x1ee)]());else{const _0x296d14=(0x0,_0x3da2de['merge'])({},_0x29abbd,{'func':null});this[_0x5c556b(0x250)][_0x5c556b(0x1ea)](_0xfac955[_0x5c556b(0x206)],new _0x37d246['DynamicStructuredTool'](_0x296d14));}}const _0x51d60e={'name':this[_0x5c556b(0x206)],'memory':this[_0x5c556b(0x214)]['createOoc'](),'steps':_0x406c39,'context':this[_0x5c556b(0x268)]};return _0x365541[_0x5c556b(0x1f0)]['push'](_0x51d60e),_0x365541;}[a8_0x46ef60(0x253)](){const _0x125acb=a8_0x46ef60;this[_0x125acb(0x214)][_0x125acb(0x253)](this[_0x125acb(0x26f)]['memory']);for(const [,_0x3a525e]of this['stepMap']){_0x3a525e['readDoc'](this[_0x125acb(0x26f)][_0x125acb(0x228)]);}this['context']=this[_0x125acb(0x26f)][_0x125acb(0x268)];}['getSessionId'](){const _0x2c363b=a8_0x46ef60;return this[_0x2c363b(0x209)]['id'];}async[a8_0x46ef60(0x208)](){const _0x2ac55a=a8_0x46ef60;this['memory'][_0x2ac55a(0x21d)](this[_0x2ac55a(0x26f)][_0x2ac55a(0x214)]);for(const [,_0x46de10]of this['stepMap']){_0x46de10['writeDoc'](this['flowDoc'][_0x2ac55a(0x228)]);}this['flowDoc'][_0x2ac55a(0x268)]=this[_0x2ac55a(0x268)],this[_0x2ac55a(0x26f)][_0x2ac55a(0x21f)]=this[_0x2ac55a(0x24d)],await this[_0x2ac55a(0x1fd)][_0x2ac55a(0x245)]()[_0x2ac55a(0x1e4)](this[_0x2ac55a(0x209)]);}[a8_0x46ef60(0x262)](){const _0x1f7b1f=a8_0x46ef60,_0x176a3b={'OELNM':function(_0x5413c5,_0x22e0ab){return _0x5413c5===_0x22e0ab;},'grqVb':_0x1f7b1f(0x21e)};for(const [_0x13e8c5,_0xe4ad0e]of this[_0x1f7b1f(0x217)]){if(_0xe4ad0e[_0x1f7b1f(0x1f9)]){if(_0x176a3b[_0x1f7b1f(0x218)](_0x176a3b[_0x1f7b1f(0x1ed)],'aXZfA'))this['sessionDoc']['tokens'][_0x1f7b1f(0x26a)]+=_0x8f3ddd;else return _0xe4ad0e;}}return null;}[a8_0x46ef60(0x26e)](_0x4719c7){const _0x461c98=a8_0x46ef60;return this['stepMap'][_0x461c98(0x235)](_0x4719c7);}[a8_0x46ef60(0x1eb)](){return null;}async[a8_0x46ef60(0x216)](_0x1517d6){const _0x3bd00b=a8_0x46ef60,_0x10e7a0={'SaiQY':'config._concurrent','YvQrY':function(_0x2d199e,_0x754eb5){return _0x2d199e!==_0x754eb5;},'uyygW':_0x3bd00b(0x240)},_0x4dd9a9=this['getContext'](_0x10e7a0[_0x3bd00b(0x207)]);let _0x543d07,_0x5f182f;if(_0x4dd9a9){if(_0x10e7a0[_0x3bd00b(0x20f)](_0x10e7a0[_0x3bd00b(0x22f)],_0x10e7a0[_0x3bd00b(0x22f)])){const _0x3d34bc=_0x4df4af?function(){const _0x505754=_0x3bd00b;if(_0x1cc44f){const _0xe30e65=_0x2cdf14[_0x505754(0x224)](_0x44e97e,arguments);return _0x44bb96=null,_0xe30e65;}}:function(){};return _0x3bbbdc=![],_0x3d34bc;}else _0x543d07=await this[_0x3bd00b(0x257)]();}else _0x5f182f=this['getActiveStep'](),_0x543d07=await _0x5f182f[_0x3bd00b(0x216)](_0x1517d6);return _0x5f182f=this[_0x3bd00b(0x262)](),{'success':!![],'completed':_0x5f182f[_0x3bd00b(0x24f)](),'message':_0x543d07,'session':this[_0x3bd00b(0x209)]['id'],'contentType':_0x5f182f[_0x3bd00b(0x24b)]};}async[a8_0x46ef60(0x257)](){return'';}async[a8_0x46ef60(0x243)]({items:_0x267952,batchSize:_0x665054,onConfig:_0x49dac8,onBotResponse:_0x3e30cd}){const _0x1a72a4=a8_0x46ef60,_0x2e6f04={'PAXQm':function(_0xed8c6c,_0x2c7c9d){return _0xed8c6c(_0x2c7c9d);},'XsYLE':function(_0x4a500f,_0x26b734){return _0x4a500f===_0x26b734;},'SqYqI':_0x1a72a4(0x233),'oDBMs':function(_0x4ff90e,_0x4aeecf,_0x474996){return _0x4ff90e(_0x4aeecf,_0x474996);},'hAbnL':_0x1a72a4(0x226),'AgHVd':function(_0x3a87b1,_0x229511){return _0x3a87b1<_0x229511;},'BJlTD':function(_0x44e82b,_0x21d5fa){return _0x44e82b+_0x21d5fa;},'RxhjX':function(_0x59319a,_0x3c8e1a){return _0x59319a/_0x3c8e1a;},'aucYd':function(_0x419022,_0x5228d2){return _0x419022/_0x5228d2;}},_0x506a51=new self_client_1[(_0x1a72a4(0x1f8))]();for(let _0xfbb360=0x0;_0x2e6f04[_0x1a72a4(0x242)](_0xfbb360,_0x267952[_0x1a72a4(0x247)]);_0xfbb360+=_0x665054){const _0x4287e3=_0x267952[_0x1a72a4(0x237)](_0xfbb360,_0x2e6f04[_0x1a72a4(0x26d)](_0xfbb360,_0x665054)),_0xe77b96=_0x1a72a4(0x1ef)+(Math[_0x1a72a4(0x1e0)](_0xfbb360/_0x665054)+0x1)+'/'+Math[_0x1a72a4(0x1fb)](_0x2e6f04['RxhjX'](_0x267952[_0x1a72a4(0x247)],_0x665054))+'\x20(batch\x20size:'+_0x4287e3['length']+')';new session_logger_1[(_0x1a72a4(0x234))](this['getSessionDoc']())[_0x1a72a4(0x1fa)](_0xe77b96),console['log'](_0xe77b96);const _0x4c43a8=_0x4287e3['map'](async _0x3a30b8=>{const _0x212d1f=_0x1a72a4,_0x4e471f={'flowName':this['name'],'config':{..._0x2e6f04[_0x212d1f(0x244)](_0x49dac8,_0x3a30b8)}};try{if(_0x2e6f04[_0x212d1f(0x1dd)](_0x2e6f04['SqYqI'],_0x2e6f04['SqYqI'])){const _0x57f57a=await _0x506a51[_0x212d1f(0x202)]('',_0x4e471f);_0x2e6f04[_0x212d1f(0x201)](_0x3e30cd,_0x3a30b8,_0x57f57a);}else return[new _0x4b4336[(_0x212d1f(0x1f5))](this)[_0x212d1f(0x236)](_0x212d1f(0x24d))];}catch(_0x59ee8b){const _0x39182e='Error\x20batch\x20process\x20flow:\x20'+this[_0x212d1f(0x206)]+_0x212d1f(0x1fc)+_0x59ee8b[_0x2e6f04['hAbnL']];new session_logger_1[(_0x212d1f(0x234))](this['getSessionDoc']())[_0x212d1f(0x265)](_0x39182e),console[_0x212d1f(0x265)](_0x39182e);}});await Promise[_0x1a72a4(0x23e)](_0x4c43a8);const _0x49ee95=_0x1a72a4(0x215)+_0x2e6f04[_0x1a72a4(0x26d)](Math[_0x1a72a4(0x1e0)](_0x2e6f04['aucYd'](_0xfbb360,_0x665054)),0x1)+_0x1a72a4(0x23b);new session_logger_1[(_0x1a72a4(0x234))](this[_0x1a72a4(0x212)]())[_0x1a72a4(0x1fa)](_0x49ee95),console[_0x1a72a4(0x1fa)](_0x49ee95);}}[a8_0x46ef60(0x211)](_0x3eb0fd){const _0x446468=a8_0x46ef60;this[_0x446468(0x214)]=_0x3eb0fd;}[a8_0x46ef60(0x266)](_0x26013d){const _0x125ad4=a8_0x46ef60;return this[_0x125ad4(0x214)][_0x125ad4(0x24c)](_0x26013d);}[a8_0x46ef60(0x256)](_0x6faf30){const _0x329844=a8_0x46ef60;this[_0x329844(0x268)]=_0x6faf30;}['addContext'](_0x59c5c4){const _0x143afe=a8_0x46ef60;(0x0,lodash_1[_0x143afe(0x263)])(this[_0x143afe(0x268)],_0x59c5c4);}[a8_0x46ef60(0x261)](_0x865704){const _0x507a79=a8_0x46ef60;return(0x0,lodash_1[_0x507a79(0x235)])(this['context'],_0x865704);}async[a8_0x46ef60(0x22d)](_0x15abaa){const _0x2ef42e=a8_0x46ef60;return await this[_0x2ef42e(0x25a)](_0x15abaa[_0x2ef42e(0x206)]);}async[a8_0x46ef60(0x25a)](_0x35bfc1){const _0x3da903=a8_0x46ef60,_0x4f3700={'QmPqN':function(_0x23cef3,_0x11080b){return _0x23cef3===_0x11080b;},'nVOem':function(_0xa8417,_0x37a62f){return _0xa8417!==_0x37a62f;},'jFAoR':_0x3da903(0x21a),'gvNjV':_0x3da903(0x20c)},_0x345513=this['stepMap'][_0x3da903(0x235)](_0x35bfc1);if(_0x4f3700[_0x3da903(0x231)](_0x345513['getName'](),_0x35bfc1)&&_0x345513[_0x3da903(0x1f9)])return _0x345513;else{for(const [_0x4d8a89,_0x298039]of this[_0x3da903(0x217)]){if(_0x4f3700['nVOem'](_0x4f3700['jFAoR'],_0x4f3700[_0x3da903(0x1f1)])){if(_0x298039[_0x3da903(0x1f9)]){_0x298039[_0x3da903(0x1f9)]=![];break;}}else _0x7b0b6d[_0x3da903(0x21d)](this[_0x3da903(0x26f)][_0x3da903(0x228)]);}return this[_0x3da903(0x26f)][_0x3da903(0x219)][_0x3da903(0x26b)](_0x35bfc1),_0x345513[_0x3da903(0x1f9)]=!![],_0x345513;}}['getTool'](_0x27c6c9){const _0x3aca77=a8_0x46ef60;return this['tools'][_0x3aca77(0x235)](_0x27c6c9);}[a8_0x46ef60(0x1e2)](){const _0x1b1f5b=a8_0x46ef60,_0x2dc410={'uRsFV':_0x1b1f5b(0x223),'FGgIQ':_0x1b1f5b(0x20b),'ZhcJq':'Ojdzx'},_0x1abb30=[];for(const [_0x4b8488,_0x2140bd]of this[_0x1b1f5b(0x217)]){if(_0x2dc410[_0x1b1f5b(0x23f)]!==_0x1b1f5b(0x223)){const _0x13909e=this['stepMap'][_0x1b1f5b(0x235)](_0x4de642[_0x1b1f5b(0x206)]);return _0x13909e['saveState'](_0x4d70c0);}else{const _0x15827b=_0x2140bd['defineTool']();_0x15827b&&_0x1abb30[_0x1b1f5b(0x26b)](..._0x15827b);}}const _0x1790a4=this[_0x1b1f5b(0x1eb)]();_0x1790a4&&_0x1abb30['push'](..._0x1790a4);for(const _0x5f6d93 of _0x1abb30){if(_0x2dc410['FGgIQ']!==_0x2dc410[_0x1b1f5b(0x1e1)]){const _0x4d397c=(0x0,lodash_1[_0x1b1f5b(0x263)])({},_0x5f6d93,{'func':null});this['tools'][_0x1b1f5b(0x1ea)](_0x5f6d93[_0x1b1f5b(0x206)],new tools_1[(_0x1b1f5b(0x227))](_0x4d397c));}else{const _0x10467a=_0x4b9d21[_0x1b1f5b(0x224)](_0x3b44ce,arguments);return _0x2a9526=null,_0x10467a;}}}['getSessionDoc'](){const _0x55b366=a8_0x46ef60;return this[_0x55b366(0x209)];}['getStepState'](_0x16da67,_0x1b12ff){const _0x5b8137=a8_0x46ef60,_0x475fd8=this[_0x5b8137(0x217)][_0x5b8137(0x235)](_0x16da67['name']);return _0x475fd8['getState'](_0x1b12ff);}[a8_0x46ef60(0x1f2)](_0x5c00a2,_0x5ac35d){const _0x552664=a8_0x46ef60,_0x34b330=this['stepMap']['get'](_0x5c00a2['name']);return _0x34b330[_0x552664(0x254)](_0x5ac35d);}[a8_0x46ef60(0x22b)](_0x543100,_0x5a4801){const _0x5911e2=a8_0x46ef60,_0x13b06e=this[_0x5911e2(0x217)][_0x5911e2(0x235)](_0x543100[_0x5911e2(0x206)]);return _0x13b06e[_0x5911e2(0x1ec)](_0x5a4801);}get[a8_0x46ef60(0x21f)](){return this['temp'];}set[a8_0x46ef60(0x21f)](_0x183c7c){const _0x1a2f19=a8_0x46ef60;this[_0x1a2f19(0x24d)]=_0x183c7c;}}exports[a8_0x46ef60(0x255)]=Flow;
@@ -0,0 +1,11 @@
1
+ import { MessageContent } from '@langchain/core/messages';
2
+ import { Flow } from './flow';
3
+ import { MessageTypes } from '../utils/message-util';
4
+ export declare class LlmRunner {
5
+ static send(flow: Flow, langMessage?: MessageTypes, prior?: MessageContent): Promise<MessageContent>;
6
+ private static onResponse;
7
+ private static onToolResponseMessages;
8
+ private static callTool;
9
+ private static isBotMessageEmpty;
10
+ private static getReason;
11
+ }
@@ -0,0 +1 @@
1
+ function a9_0x2eb3(){const _0x1b9b31=['FylIw','EICDo','isArray','szZik','temperature','qiyRk','CEela','GhDqm','dhLfw','ToolMessageInfo','toString','isSame','wIeeY','MECJD','unknown','MessageUtil','../utils/verify-license','EsVgg','SDkPo','kGDhH','AIMessage','783ZEpanM','saveState','ToolUtil','obtainTools','onResponse','getFlowEngine','AbtCB','prompt','LTVKv','Ivcgz','mWrmU','FJpqt','QYFkq','rklHl','type','RpOyQ','OcHwF','getSessionDoc','gkFtk','text','additional_kwargs','getReason','JOPyG','message','rQJiJ','cFzud','clone','uMlmO','2777712bWHMlu','CJuuM','11368mRkOuB','FFXEd','Dkxnc','YzAMW','@langchain/core/messages','../utils/message-util','RaTmu','LLM\x20call\x20failed.\x20Reason:','180nymjXb','SessionLogger','LlmRunner','nlXON','QYfSD','AXHXK','push','goTry','state','activate','FacOw','ToolCallMessage','8801590QKHUXS','rdADo','teqtt','tHjRh','structOutputSchema','getModel','QvHnV','yKMBw','tirgH','tool_calls','pop','UbMGS','messageStep','SOJHw','HxaoT','UpdfI','400817FDSUYf','isLogic','contentType','genMessageId','ueDXD','ToolMessageOK','AFhuz','gasRc','apply','response_metadata','mRhHZ','../session/session-logger','ixRCG','JCbOr','Glchy','getMemory','qbivO','gaZJM','name','withStructuredOutput','JSubb','LLvtD','ZKvsX','warn','xhhQD','KiVKV','length','activateByName','getActiveStep','SIRXU','WUBUT','Sgbhi','finishReason','oDSHV','getName','LogicRunner','\x20of\x20','./logic-runner','BGbaF','sUcTX','829876zAYpBF','2805103vGLXut','invoke','sXzrZ','YiDdn','direct','getTemperature','content','gVTDG','tool','vptVy','MxAAU','tool_call_id','.\x20Error:','ohseS','IJFkP','JubTi','onCrossing','HumanMessage','idsOP','MTutC','(((.+)+)+)+$','etYht','ISAbK','isBotMessageEmpty','cRjZs','hasNoTool','zCfxQ','ydSBI','nOpsG','gZuLS','saveSession','CvtWT','5qJfLtE','verifyLicense','jGeUB','DURvV','callTool','finish_reason','sWHax','pjWJb','send','step','hasTool','picoKey','ZlMxc','xKbjh','FUcXB','onToolResponseMessages','RIjUl','Follow\x20system\x20prompt\x20and\x20respond\x20properly.','xoAfK','Retry','CoreConfig','missing\x20tool\x20','dqHiy','llmRetry','VuUYK','hmwJs','string','../utils/tool-util','yElPf','search','XgwRf','UPyKe','gHvNx','defineProperty','VuVev','28604BwitqI','function','constructor'];a9_0x2eb3=function(){return _0x1b9b31;};return a9_0x2eb3();}const a9_0x43f009=a9_0x5e3f;(function(_0x16f113,_0x5edcad){const _0x3d378e=a9_0x5e3f,_0x103730=_0x16f113();while(!![]){try{const _0x194f79=-parseInt(_0x3d378e(0x172))/0x1+parseInt(_0x3d378e(0x19a))/0x2+parseInt(_0x3d378e(0x21c))/0x3*(parseInt(_0x3d378e(0x1de))/0x4)+-parseInt(_0x3d378e(0x1bb))/0x5*(-parseInt(_0x3d378e(0x212))/0x6)+parseInt(_0x3d378e(0x19b))/0x7+-parseInt(_0x3d378e(0x214))/0x8*(parseInt(_0x3d378e(0x1f6))/0x9)+-parseInt(_0x3d378e(0x228))/0xa;if(_0x194f79===_0x5edcad)break;else _0x103730['push'](_0x103730['shift']());}catch(_0x28f4ba){_0x103730['push'](_0x103730['shift']());}}}(a9_0x2eb3,0x49fe4));const a9_0x38848d=(function(){const _0x541c05={'JSubb':function(_0xd2fbfc,_0x170fbf){return _0xd2fbfc===_0x170fbf;},'gkFtk':'GkqmG'};let _0x4a8db8=!![];return function(_0x500953,_0x26dc8e){const _0x5a4ee2=_0x4a8db8?function(){const _0x30318c=a9_0x5e3f,_0x265be5={'MxAAU':function(_0x13a3af,_0x1cebca){const _0x97b8df=a9_0x5e3f;return _0x541c05[_0x97b8df(0x186)](_0x13a3af,_0x1cebca);}};if(_0x26dc8e){if(_0x541c05[_0x30318c(0x186)](_0x541c05['gkFtk'],_0x541c05[_0x30318c(0x208)])){const _0xff02aa=_0x26dc8e['apply'](_0x500953,arguments);return _0x26dc8e=null,_0xff02aa;}else{if(_0x265be5[_0x30318c(0x1a5)](_0x131b5c[_0x30318c(0x204)],'ai')){const _0x21a3fe=_0x552c04[_0x30318c(0x20a)][_0x30318c(0x19f)];if(_0x21a3fe)return _0x28d648[_0x30318c(0x222)](_0x48e5eb),_0x3da19c[_0x30318c(0x1a1)];}}}}:function(){};return _0x4a8db8=![],_0x5a4ee2;};}()),a9_0x374d0f=a9_0x38848d(this,function(){const _0x8eb39c=a9_0x5e3f,_0x3da139={'xhhQD':_0x8eb39c(0x1af)};return a9_0x374d0f[_0x8eb39c(0x1eb)]()[_0x8eb39c(0x1d8)](_0x3da139[_0x8eb39c(0x18a)])['toString']()[_0x8eb39c(0x1e0)](a9_0x374d0f)[_0x8eb39c(0x1d8)](_0x8eb39c(0x1af));});a9_0x374d0f();'use strict';Object[a9_0x43f009(0x1dc)](exports,'__esModule',{'value':!![]}),exports['LlmRunner']=void 0x0;function a9_0x5e3f(_0x2c7f2c,_0x531522){const _0x308ab2=a9_0x2eb3();return a9_0x5e3f=function(_0x374d0f,_0x38848d){_0x374d0f=_0x374d0f-0x16d;let _0x2eb359=_0x308ab2[_0x374d0f];return _0x2eb359;},a9_0x5e3f(_0x2c7f2c,_0x531522);}const messages_1=require(a9_0x43f009(0x218)),message_util_1=require('../utils/message-util'),tool_util_1=require(a9_0x43f009(0x1d6)),session_logger_1=require(a9_0x43f009(0x17d)),core_config_1=require('../configs/core-config'),message_util_2=require(a9_0x43f009(0x219)),lodash_1=require('lodash'),logic_runner_1=require(a9_0x43f009(0x197)),retry_1=require('../utils/retry'),verify_license_1=require(a9_0x43f009(0x1f1));class LlmRunner{static async[a9_0x43f009(0x1c3)](_0x4c550a,_0x49d0cd,_0x2d426d){const _0x1f4e9d=a9_0x43f009,_0x1b318d={'IJFkP':_0x1f4e9d(0x1a3),'ohseS':_0x1f4e9d(0x192),'FylIw':_0x1f4e9d(0x1c0),'JOPyG':function(_0x564242,_0x30a2df){return _0x564242!==_0x30a2df;},'QYfSD':_0x1f4e9d(0x205),'szZik':_0x1f4e9d(0x1ef),'sXzrZ':function(_0xc3de58,_0x3ebac1){return _0xc3de58>=_0x3ebac1;},'Dkxnc':function(_0x5038b1,_0x25e52d){return _0x5038b1===_0x25e52d;},'yElPf':_0x1f4e9d(0x22a),'HxaoT':_0x1f4e9d(0x1cc),'ZlMxc':_0x1f4e9d(0x1e2),'FUcXB':_0x1f4e9d(0x1d9),'MECJD':function(_0x1aec37,_0x18873b){return _0x1aec37>=_0x18873b;},'cFzud':_0x1f4e9d(0x20e),'wIeeY':_0x1f4e9d(0x1b8),'oDSHV':function(_0x500d26,_0x169655){return _0x500d26!=_0x169655;},'KiVKV':function(_0x3c2a5f,_0x437f64){return _0x3c2a5f===_0x437f64;},'QKHao':_0x1f4e9d(0x1e9),'BVClc':_0x1f4e9d(0x1a4),'UbMGS':function(_0xab42db,_0x54803c){return _0xab42db!==_0x54803c;},'sbnGN':_0x1f4e9d(0x1b6),'qbivO':function(_0x270a5f,_0x55fbc8){return _0x270a5f!==_0x55fbc8;},'LLvtD':function(_0x4e05ad,_0x88dcb){return _0x4e05ad!=_0x88dcb;},'RIjUl':function(_0x5618c0,_0x41cf71){return _0x5618c0-_0x41cf71;},'MJCBf':_0x1f4e9d(0x217),'nlXON':'stopTool','tHjRh':function(_0x481177,_0x551135,_0x1e9633){return _0x481177(_0x551135,_0x1e9633);},'zCfxQ':_0x1f4e9d(0x1e7)};(0x0,verify_license_1[_0x1f4e9d(0x1bc)])(core_config_1[_0x1f4e9d(0x1cf)]['picoKey']);let _0x4fae5c;const _0x63d2c1=_0x4c550a[_0x1f4e9d(0x18e)](),{modelClass:_0x11a8b9,params:_0x275249,useTool:_0x34c490}=_0x4c550a[_0x1f4e9d(0x1fb)]()[_0x1f4e9d(0x22d)](_0x63d2c1[_0x1f4e9d(0x22d)]()),_0x28738f=(0x0,lodash_1[_0x1f4e9d(0x210)])(_0x275249),_0x204dda=_0x63d2c1[_0x1f4e9d(0x1a0)]();if(_0x204dda>=0x0){if(_0x1b318d[_0x1f4e9d(0x20c)](_0x1b318d[_0x1f4e9d(0x1c7)],_0x1b318d[_0x1f4e9d(0x1c9)]))_0x28738f[_0x1f4e9d(0x1e5)]=_0x204dda;else{const _0x391233=_0x3fd478?function(){const _0x3c7e68=_0x1f4e9d;if(_0x4b464c){const _0x3a656d=_0x11f840[_0x3c7e68(0x17a)](_0x436e72,arguments);return _0x4565f3=null,_0x3a656d;}}:function(){};return _0x57cf98=![],_0x391233;}}else _0x1b318d[_0x1f4e9d(0x1ee)](_0x4c550a[_0x1f4e9d(0x1e5)],0x0)&&(_0x1b318d['Dkxnc'](_0x1f4e9d(0x213),_0x1f4e9d(0x213))?_0x28738f[_0x1f4e9d(0x1e5)]=_0x4c550a[_0x1f4e9d(0x1e5)]:_0x5ccc9e=new _0x23e3bf['ToolMessageInfo'](_0x25d4c0,_0x48faa6,_0x3e2f03[_0x1b318d[_0x1f4e9d(0x1a9)]]));const _0x13472e=_0x63d2c1[_0x1f4e9d(0x181)]();if(_0x49d0cd){if(_0x1b318d['Dkxnc'](_0x1b318d[_0x1f4e9d(0x20f)],_0x1b318d[_0x1f4e9d(0x1ed)]))return _0x3b68d4[_0x1f4e9d(0x195)][_0x1f4e9d(0x1c3)](_0xe3e980);else{const _0xa8cfb=message_util_1[_0x1f4e9d(0x1f0)][_0x1f4e9d(0x16e)](_0x49d0cd['id']);if(_0x1b318d[_0x1f4e9d(0x193)](_0xa8cfb,_0x63d2c1['getName']())){if(_0x1b318d[_0x1f4e9d(0x18b)](_0x1b318d['QKHao'],_0x1b318d['BVClc'])){let _0x3c8f40=_0x5c135d['response_metadata'][_0x1b318d[_0x1f4e9d(0x1a8)]];if(!_0x3c8f40)_0x3c8f40=_0x12484b['response_metadata']['stop_reason'];else!_0x3c8f40&&(_0x3c8f40=_0x54639b[_0x1f4e9d(0x17b)][_0x1b318d[_0x1f4e9d(0x1e1)]]);return _0x3c8f40;}else await _0x4c550a[_0x1f4e9d(0x1b9)](),message_util_1['MessageUtil']['replaceStep'](_0x49d0cd,_0x63d2c1),_0x49d0cd=_0x63d2c1[_0x1f4e9d(0x1ab)](_0x49d0cd,_0xa8cfb);}}}else{if(_0x1b318d[_0x1f4e9d(0x16d)](_0x1b318d['sbnGN'],_0x1f4e9d(0x1d3))){const _0x1bf4a4=message_util_1[_0x1f4e9d(0x1f0)]['peek'](_0x13472e);if(_0x1bf4a4&&_0x1b318d[_0x1f4e9d(0x182)](_0x1bf4a4[_0x1f4e9d(0x204)],'system')){const _0x245e9e=message_util_1['MessageUtil'][_0x1f4e9d(0x16e)](_0x1bf4a4['id']);_0x1b318d[_0x1f4e9d(0x187)](_0x245e9e,_0x63d2c1[_0x1f4e9d(0x194)]())&&(await _0x4c550a[_0x1f4e9d(0x1b9)](),_0x49d0cd=_0x63d2c1[_0x1f4e9d(0x1ab)](_0x49d0cd,_0x245e9e));}else await _0x4c550a['saveSession'](),_0x49d0cd=_0x63d2c1[_0x1f4e9d(0x1ab)](_0x49d0cd);}else{const _0xab493=new _0x13d4fa[(_0x1f4e9d(0x177))](_0x810d1d,_0x8e3610);_0x1ce639['push'](_0xab493);}}if(_0x63d2c1[_0x1f4e9d(0x173)]())return logic_runner_1[_0x1f4e9d(0x195)][_0x1f4e9d(0x1c3)](_0x4c550a);let _0x644512=new _0x11a8b9(_0x28738f),_0x50ea16=_0x63d2c1[_0x1f4e9d(0x1f9)]()??[];const _0x713280=await _0x63d2c1['getPrompt']();_0x13472e[0x0]=new messages_1['SystemMessage']({'content':_0x713280,'id':_0x63d2c1[_0x1f4e9d(0x175)]()});if(_0x49d0cd){const _0x1603d3=_0x13472e[_0x1b318d[_0x1f4e9d(0x1cb)](_0x13472e[_0x1f4e9d(0x18c)],0x1)];!message_util_1[_0x1f4e9d(0x1f0)][_0x1f4e9d(0x1ec)](_0x1603d3,_0x49d0cd)&&(_0x1b318d[_0x1f4e9d(0x182)]('ZBNeN',_0x1b318d['MJCBf'])?_0x13472e[_0x1f4e9d(0x222)](_0x49d0cd):_0x492e0f=_0x2e091e+'\x0a'+(_0x153596?.[_0x1f4e9d(0x1a1)]??_0x37e750));}const _0x20825d=_0x49d0cd?.[_0x1f4e9d(0x20a)][_0x1b318d[_0x1f4e9d(0x21f)]];_0x20825d&&(_0x50ea16=[]);_0x644512=_0x1b318d[_0x1f4e9d(0x22b)](_0x34c490,_0x644512,_0x50ea16);const _0x1ee507=_0x63d2c1[_0x1f4e9d(0x22c)]();return _0x1ee507&&('CEela'!==_0x1b318d[_0x1f4e9d(0x1b5)]?(new _0x358e59[(_0x1f4e9d(0x21d))](_0x332e7c[_0x1f4e9d(0x207)]())[_0x1f4e9d(0x189)](_0x1f4e9d(0x1d0)+_0x4977a4['name']),_0x34863d=new _0xeaba90[(_0x1f4e9d(0x177))](_0x29e465,_0x1c1cc2),_0x36fffd['push'](_0x3ddfdb)):_0x644512=_0x644512[_0x1f4e9d(0x185)](_0x1ee507)),_0x4fae5c=await retry_1[_0x1f4e9d(0x1ce)][_0x1f4e9d(0x223)]({'maxRetries':core_config_1['CoreConfig'][_0x1f4e9d(0x1d2)],'delayMs':0x1f4,'onMain':async()=>{const _0x34b28e=_0x1f4e9d;if(_0x1b318d['JOPyG'](_0x1b318d[_0x34b28e(0x220)],_0x34b28e(0x1e8))){_0x4fae5c=await _0x644512[_0x34b28e(0x19c)](_0x13472e);const _0x3d35c4=_0x4fae5c['usage_metadata'];return _0x4c550a['tallyToken'](_0x3d35c4),_0x4fae5c;}else _0x4c69a6['saveState']({'_prompt':_0x42d0ee[_0x34b28e(0x1fd)]});},'onWarn':(_0x2fdc00,_0x53b582,_0xc10bef)=>{const _0x1a8daf=_0x1f4e9d;new session_logger_1[(_0x1a8daf(0x21d))](_0x4c550a['getSessionDoc']())[_0x1a8daf(0x189)]('Attempt\x20'+_0x2fdc00+_0x1a8daf(0x196)+_0x53b582+_0x1a8daf(0x1a7)+(_0xc10bef?_0xc10bef['message']:_0x1b318d[_0x1a8daf(0x1e4)]));},'shouldRetry':(_0x235171,_0x554515)=>{const _0x38028a=_0x1f4e9d;if(LlmRunner[_0x38028a(0x1b2)](_0x235171)){_0x13472e[_0x38028a(0x232)]();if(_0x1b318d[_0x38028a(0x19d)](_0x554515,0x2)){if(_0x1b318d[_0x38028a(0x216)](_0x1b318d['yElPf'],_0x1b318d[_0x38028a(0x1d7)]))_0x13472e['pop']();else return _0x30d421[_0x38028a(0x195)]['send'](_0x437fab);}return _0x13472e[_0x38028a(0x222)](new messages_1[(_0x38028a(0x1ac))]({'content':_0x1b318d[_0x38028a(0x170)],'id':_0x63d2c1['genMessageId']()})),!![];}else return![];},'onFinalError':_0x42e6fa=>{const _0x40a1a2=_0x1f4e9d;throw new Error(_0x40a1a2(0x21b)+LlmRunner[_0x40a1a2(0x20b)](_0x4fae5c)+_0x40a1a2(0x1a7)+(_0x42e6fa?_0x42e6fa[_0x40a1a2(0x20d)]:_0x1b318d[_0x40a1a2(0x1e4)]));}}),await LlmRunner[_0x1f4e9d(0x1fa)](_0x4c550a,_0x4fae5c,_0x2d426d);}static async[a9_0x43f009(0x1fa)](_0x47a135,_0x560eac,_0xade52e){const _0x808048=a9_0x43f009,_0x2f5bec={'gsFHy':'Follow\x20system\x20prompt\x20and\x20respond\x20properly.','sWHax':function(_0x5c02d9,_0x48544b){return _0x5c02d9!==_0x48544b;},'UPyKe':'AOpuk','mRhHZ':function(_0x1319b0,_0x259398){return _0x1319b0===_0x259398;},'gaZJM':_0x808048(0x16f),'AFhuz':_0x808048(0x1df)};(0x0,verify_license_1[_0x808048(0x1bc)])(core_config_1[_0x808048(0x1cf)][_0x808048(0x1c6)]);const _0x162d70=_0x47a135[_0x808048(0x18e)]();if(_0x162d70[_0x808048(0x173)]())return logic_runner_1[_0x808048(0x195)]['send'](_0x47a135);const _0x4b93a2=_0x162d70[_0x808048(0x181)]();if(tool_util_1[_0x808048(0x1f8)][_0x808048(0x1c5)](_0x560eac)){let _0x2d6e76='';if(Array[_0x808048(0x1e3)](_0x560eac?.[_0x808048(0x1a1)])&&_0x560eac?.[_0x808048(0x1a1)]?.[_0x808048(0x18c)]>0x1){if(_0x2f5bec[_0x808048(0x1c1)](_0x2f5bec[_0x808048(0x1da)],_0x2f5bec[_0x808048(0x1da)]))return _0x37f0ed[_0x808048(0x1b2)](_0x53d07d)?(_0x20df69[_0x808048(0x232)](),_0xb37a95>=0x2&&_0x35683d[_0x808048(0x232)](),_0x44b4c2[_0x808048(0x222)](new _0x2539f3[(_0x808048(0x1ac))]({'content':_0x2f5bec['gsFHy'],'id':_0x58a177[_0x808048(0x175)]()})),!![]):![];else{const _0x3d0749=_0x560eac[_0x808048(0x1a1)][_0x808048(0x232)](),_0x4bb560=_0x560eac[_0x808048(0x1a1)][_0x808048(0x232)]();_0x2d6e76=_0x4bb560[_0x808048(0x209)],_0x560eac[_0x808048(0x1a1)][_0x808048(0x222)](_0x3d0749);}}const _0x1ac207=await LlmRunner[_0x808048(0x1bf)](_0x162d70,_0x47a135,_0x560eac?.[_0x808048(0x231)]),_0x17dcf2=new message_util_2[(_0x808048(0x227))](_0x162d70,_0x560eac[_0x808048(0x231)]);return _0x4b93a2[_0x808048(0x222)](_0x17dcf2),LlmRunner[_0x808048(0x1ca)](_0x47a135,_0x162d70,_0x2d6e76,_0x560eac['tool_calls'],_0x1ac207);}else{let _0x34f69;_0xade52e?_0x34f69=_0xade52e+'\x0a'+(_0x560eac?.['content']??_0x560eac):_0x2f5bec[_0x808048(0x17c)](_0x808048(0x215),_0x2f5bec[_0x808048(0x183)])?_0x40afcd[_0x808048(0x222)](_0xee3e19[_0x808048(0x20d)]):_0x34f69=_0x560eac?.['content']??_0x560eac;const _0x175fd2=_0x162d70[_0x808048(0x1fa)](_0x34f69);if(_0x2f5bec['mRhHZ'](typeof _0x175fd2,_0x2f5bec[_0x808048(0x178)])){const _0x26b887=_0x175fd2;return await _0x47a135['activate'](_0x26b887),await LlmRunner[_0x808048(0x1c3)](_0x47a135,null,null);}else return _0x34f69=_0x175fd2,_0x4b93a2[_0x808048(0x222)](new messages_1[(_0x808048(0x1f5))]({'content':_0x34f69,'id':_0x162d70[_0x808048(0x175)]()})),_0x34f69;}}static async[a9_0x43f009(0x1ca)](_0x70ab86,_0x4e4686,_0xfa3cb7,_0x1a3af1,_0x2b0202){const _0x2cbd3e=a9_0x43f009,_0x282958={'WUBUT':function(_0x8c64b9,_0x2f0a8b){return _0x8c64b9===_0x2f0a8b;},'rklHl':_0x2cbd3e(0x1ef),'xoAfK':function(_0x53e3f3){return _0x53e3f3();},'SIRXU':function(_0x149ab4,_0xdb5c77){return _0x149ab4!==_0xdb5c77;},'xKbjh':_0x2cbd3e(0x17e),'ijCus':'DwsjO','SNhMt':_0x2cbd3e(0x1ba),'LTVKv':function(_0x290fa6,_0x325517){return _0x290fa6===_0x325517;},'FdXFF':_0x2cbd3e(0x1a3),'AXHXK':function(_0x86bbe1,_0x19851b){return _0x86bbe1===_0x19851b;},'MTutC':_0x2cbd3e(0x188),'EgkaK':_0x2cbd3e(0x22e),'EsVgg':'iRXCh','QYFkq':'human'},_0x3b7111=_0x282958[_0x2cbd3e(0x1cd)](Array);for(const _0x1f8ace of _0x1a3af1){if(_0x282958[_0x2cbd3e(0x18f)](_0x282958[_0x2cbd3e(0x1c8)],_0x282958['ijCus'])){let _0x576391=![];for(const _0x1ed893 of _0x2b0202){_0x282958[_0x2cbd3e(0x190)](_0x282958['SNhMt'],_0x2cbd3e(0x1ba))?_0x282958[_0x2cbd3e(0x1fe)](_0x1ed893[_0x2cbd3e(0x204)],_0x282958['FdXFF'])&&_0x282958[_0x2cbd3e(0x221)](_0x1f8ace['id'],_0x1ed893['tool_call_id'])&&(_0x576391=!![],_0x3b7111[_0x2cbd3e(0x222)](_0x1ed893)):_0x365984[_0x2cbd3e(0x1e5)]>=0x0&&(_0x263769['temperature']=_0x216151[_0x2cbd3e(0x1e5)]);}if(!_0x576391){const _0x92e410=new message_util_2[(_0x2cbd3e(0x177))](_0x4e4686,_0x1f8ace);_0x3b7111[_0x2cbd3e(0x222)](_0x92e410);}}else{if(_0x5b1655[_0x2cbd3e(0x1f8)][_0x2cbd3e(0x1b4)](_0x4b6f10)){if(!_0x300440?.[_0x2cbd3e(0x1a1)]||_0x5dba8f[_0x2cbd3e(0x1a1)][0x0]&&_0x282958[_0x2cbd3e(0x190)](_0x2635ef[_0x2cbd3e(0x1a1)][0x0][_0x2cbd3e(0x209)],''))return!![];}return![];}}const _0x2a4e8b=_0x4e4686[_0x2cbd3e(0x181)]();_0x2a4e8b['push'](..._0x3b7111);for(const _0xa00e12 of _0x2b0202){if(_0x282958[_0x2cbd3e(0x190)]('KrNyE',_0x282958[_0x2cbd3e(0x1ae)]))_0x4832b5[_0x2cbd3e(0x232)]();else{if(_0x282958['WUBUT'](_0xa00e12[_0x2cbd3e(0x204)],'ai')){const _0x49ee33=_0xa00e12[_0x2cbd3e(0x20a)]['direct'];if(_0x49ee33)return _0x282958[_0x2cbd3e(0x18f)](_0x282958['EgkaK'],_0x282958[_0x2cbd3e(0x1f2)])?(_0x2a4e8b[_0x2cbd3e(0x222)](_0xa00e12),_0xa00e12[_0x2cbd3e(0x1a1)]):_0x282958[_0x2cbd3e(0x203)];}}}for(const _0x34a5c9 of _0x2b0202){if(_0x2cbd3e(0x1ad)===_0x2cbd3e(0x1ad)){if(_0x34a5c9[_0x2cbd3e(0x204)]===_0x282958[_0x2cbd3e(0x202)])return await LlmRunner[_0x2cbd3e(0x1c3)](_0x70ab86,_0x34a5c9,_0xfa3cb7);}else _0x1d9b85=_0x1a4a3d[_0x2cbd3e(0x185)](_0x31f195);}return await LlmRunner[_0x2cbd3e(0x1c3)](_0x70ab86,null,_0xfa3cb7);}static async[a9_0x43f009(0x1bf)](_0x134a4c,_0x4f2a51,_0x264bb7){const _0x331ccf=a9_0x43f009,_0x45ce18={'OcHwF':function(_0x5ec4f8,_0x4cb2f4){return _0x5ec4f8===_0x4cb2f4;},'LZfde':_0x331ccf(0x1a3),'dyKci':function(_0x3933cc,_0x445741){return _0x3933cc===_0x445741;},'etYht':'(((.+)+)+)+$','uMlmO':function(_0x277c8c,_0xee28d7){return _0x277c8c===_0xee28d7;},'DURvV':_0x331ccf(0x1db),'akFom':_0x331ccf(0x191),'zbSBV':function(_0x24cb95,_0x5b1289){return _0x24cb95===_0x5b1289;},'gasRc':_0x331ccf(0x1d5),'AbtCB':function(_0x2d3aff,_0x3bdbc8){return _0x2d3aff===_0x3bdbc8;},'jGeUB':_0x331ccf(0x201),'pjWJb':function(_0x531eda,_0x389318){return _0x531eda===_0x389318;},'sUcTX':_0x331ccf(0x1df),'QoMWz':function(_0x2023b2,_0x3aa4fe){return _0x2023b2 in _0x3aa4fe;},'BGbaF':_0x331ccf(0x1c4),'SDkPo':_0x331ccf(0x21a),'JubTi':_0x331ccf(0x1b7),'rdADo':function(_0x32a53c,_0x4193c3){return _0x32a53c===_0x4193c3;},'ISAbK':function(_0x9f4b0b,_0x4a3a63){return _0x9f4b0b===_0x4a3a63;},'qiyRk':_0x331ccf(0x180),'UpdfI':'NDuMF','tirgH':function(_0x4e4c07,_0x5dcd68){return _0x4e4c07!==_0x5dcd68;},'gVTDG':_0x331ccf(0x17f),'YiDdn':_0x331ccf(0x1ff),'yKMBw':_0x331ccf(0x20d)},_0x116148=new Array();for(const _0x535b57 of _0x264bb7){let _0x2daf8f;if(_0x45ce18[_0x331ccf(0x211)](typeof _0x134a4c[_0x535b57['name']],'function')){if(_0x45ce18[_0x331ccf(0x1be)]!==_0x45ce18['akFom']){const _0x70a403=await _0x134a4c[_0x535b57[_0x331ccf(0x184)]](_0x535b57);if(_0x45ce18['zbSBV'](typeof _0x70a403,_0x45ce18[_0x331ccf(0x179)]))_0x45ce18[_0x331ccf(0x1fc)](_0x331ccf(0x1f4),_0x45ce18[_0x331ccf(0x1bd)])?_0x5e38fc[_0x331ccf(0x1e5)]=_0x4bc7be[_0x331ccf(0x1e5)]:(await _0x4f2a51[_0x331ccf(0x18d)](_0x70a403),_0x116148[_0x331ccf(0x222)](new message_util_2[(_0x331ccf(0x177))](_0x134a4c,_0x535b57)));else{if(_0x45ce18[_0x331ccf(0x1c2)](typeof _0x70a403,_0x45ce18[_0x331ccf(0x199)]))await _0x4f2a51[_0x331ccf(0x225)](_0x70a403),_0x116148[_0x331ccf(0x222)](new message_util_2[(_0x331ccf(0x177))](_0x134a4c,_0x535b57));else{if(_0x70a403&&_0x45ce18['QoMWz'](_0x45ce18[_0x331ccf(0x198)],_0x70a403)){if(_0x45ce18[_0x331ccf(0x1f3)]!==_0x45ce18[_0x331ccf(0x1aa)]){let _0x184775;_0x45ce18[_0x331ccf(0x229)](typeof _0x70a403[_0x331ccf(0x1c4)],_0x45ce18[_0x331ccf(0x179)])?_0x45ce18['ISAbK'](_0x45ce18[_0x331ccf(0x1e6)],_0x45ce18[_0x331ccf(0x171)])?(_0x284c77=!![],_0x1cdfc1['push'](_0x45cfc0)):_0x184775=await _0x4f2a51[_0x331ccf(0x18d)](_0x70a403['step']):_0x184775=await _0x4f2a51[_0x331ccf(0x225)](_0x70a403['step']);_0x70a403[_0x331ccf(0x1fd)]&&_0x184775[_0x331ccf(0x1f7)]({'_prompt':_0x70a403[_0x331ccf(0x1fd)]});if(_0x70a403['state']){if(_0x45ce18[_0x331ccf(0x230)](_0x45ce18[_0x331ccf(0x1a2)],'NDwdo'))_0x184775[_0x331ccf(0x1f7)](_0x70a403[_0x331ccf(0x224)]);else{let _0xaf1b2e=![];for(const _0x323379 of _0x5acb93){_0x45ce18[_0x331ccf(0x206)](_0x323379[_0x331ccf(0x204)],_0x45ce18['LZfde'])&&_0x45ce18['dyKci'](_0x2cd8c2['id'],_0x323379[_0x331ccf(0x1a6)])&&(_0xaf1b2e=!![],_0x365abf[_0x331ccf(0x222)](_0x323379));}if(!_0xaf1b2e){const _0x480159=new _0x2189c5[(_0x331ccf(0x177))](_0x3ca060,_0x554b76);_0x7a1069[_0x331ccf(0x222)](_0x480159);}}}if(_0x70a403[_0x331ccf(0x174)]){if(_0x45ce18[_0x331ccf(0x1b1)](_0x45ce18[_0x331ccf(0x19e)],_0x45ce18[_0x331ccf(0x19e)]))_0x184775[_0x331ccf(0x174)]=_0x70a403[_0x331ccf(0x174)];else return _0x5a4c44[_0x331ccf(0x1eb)]()[_0x331ccf(0x1d8)](azKueB[_0x331ccf(0x1b0)])[_0x331ccf(0x1eb)]()[_0x331ccf(0x1e0)](_0x1ef373)[_0x331ccf(0x1d8)](_0x331ccf(0x1af));}_0x70a403[_0x331ccf(0x1a3)]?_0x2daf8f=new message_util_1[(_0x331ccf(0x1ea))](_0x184775,_0x535b57,_0x70a403[_0x45ce18['LZfde']]):_0x2daf8f=new message_util_2[(_0x331ccf(0x177))](_0x134a4c,_0x535b57),_0x116148['push'](_0x2daf8f),_0x70a403[_0x45ce18[_0x331ccf(0x22f)]]&&_0x116148[_0x331ccf(0x222)](_0x70a403[_0x45ce18[_0x331ccf(0x22f)]]);}else{if(_0xed492e){const _0x145c94=_0x21c5da['apply'](_0x5411aa,arguments);return _0x53945a=null,_0x145c94;}}}}}}else _0x2099c2=[];}else new session_logger_1[(_0x331ccf(0x21d))](_0x4f2a51[_0x331ccf(0x207)]())[_0x331ccf(0x189)](_0x331ccf(0x1d0)+_0x535b57['name']),_0x2daf8f=new message_util_2[(_0x331ccf(0x177))](_0x134a4c,_0x535b57),_0x116148[_0x331ccf(0x222)](_0x2daf8f);}return _0x116148;}static[a9_0x43f009(0x1b2)](_0x1c77e0){const _0x31c47b=a9_0x43f009,_0x3de721={'cRjZs':function(_0x1dd480,_0x518313){return _0x1dd480===_0x518313;},'PBvMl':_0x31c47b(0x209)};if(tool_util_1['ToolUtil'][_0x31c47b(0x1b4)](_0x1c77e0)){if(!_0x1c77e0?.[_0x31c47b(0x1a1)]||_0x1c77e0[_0x31c47b(0x1a1)][0x0]&&_0x3de721[_0x31c47b(0x1b3)](_0x1c77e0[_0x31c47b(0x1a1)][0x0][_0x3de721['PBvMl']],''))return!![];}return![];}static[a9_0x43f009(0x20b)](_0x29d55a){const _0x15de86=a9_0x43f009,_0x2ab60f={'DrKkt':function(_0x3962de,_0x198366){return _0x3962de!==_0x198366;},'ueDXD':'NjDnv','VuVev':_0x15de86(0x226),'mWrmU':_0x15de86(0x1d1),'VqiiS':'oIVhZ','hmwJs':_0x15de86(0x1ef)};if(_0x29d55a?.[_0x15de86(0x17b)]){if(_0x2ab60f['DrKkt'](_0x2ab60f[_0x15de86(0x176)],_0x2ab60f[_0x15de86(0x1dd)])){let _0x250418=_0x29d55a[_0x15de86(0x17b)]['finishReason'];if(!_0x250418)_0x250418=_0x29d55a[_0x15de86(0x17b)]['stop_reason'];else!_0x250418&&(_0x250418=_0x29d55a[_0x15de86(0x17b)][_0x15de86(0x1c0)]);return _0x250418;}else{const _0x4d5fe4=_0x2c9c8e[_0x40c93b['length']-0x1];!_0x2bcde3[_0x15de86(0x1f0)]['isSame'](_0x4d5fe4,_0x1fe0f8)&&_0x1a5839[_0x15de86(0x222)](_0x276383);}}else{if(_0x2ab60f[_0x15de86(0x200)]!==_0x2ab60f['VqiiS'])return _0x2ab60f[_0x15de86(0x1d4)];else _0x14ca8e[_0x15de86(0x1f7)](_0x393717[_0x15de86(0x224)]);}}}exports[a9_0x43f009(0x21e)]=LlmRunner;
@@ -0,0 +1,6 @@
1
+ import { MessageContent } from '@langchain/core/messages';
2
+ import { MessageTypes } from '../utils/message-util';
3
+ import { Flow } from './flow';
4
+ export declare class LogicRunner {
5
+ static send(flow: Flow, langMessage?: MessageTypes): Promise<MessageContent>;
6
+ }
@@ -0,0 +1 @@
1
+ function a10_0x4ec5(){const _0x113286=['toString','@langchain/core/messages','VyMSH','messageStep','onCrossing','xoQTc','MGINa','apply','RrSWm','KeZcB','getMemory','778zpRCrc','3530dGjTNX','../utils/message-util','PsjRf','RexdP','fASsV','LogicRunner','qXouH','1783136BKJdtA','prompt','lARxm','send','eHNWe','jLXny','constructor','getActiveStep','wSEmy','string','BpATm','AiMessageEx','MessageUtil','(((.+)+)+)+$','state','lMgzK','2033955iKeGXz','lhQsj','function','Bjqkr','cCndA','SystemMessage','__esModule','saveState','runLogic','getName','XZmBt','push','2386KDhNhj','search','aDdeq','40MOrhtV','length','contentType','activate','ngCPP','wYTKQ','activateByName','182rkvBRE','zNPZM','iBrby','3746394gDCelW','190602cHJrQQ','QRDzY','saveSession','step','Transition\x20to\x20step:','KrPxI','peek','./llm-runner','2224tjXgox','HgaUG','twBYn','pvadv','ktzxo','IJfWn','2433486sWyXKB','Qfatd','NrgZO','message'];a10_0x4ec5=function(){return _0x113286;};return a10_0x4ec5();}const a10_0x34a90d=a10_0x4cb1;(function(_0x207a3b,_0x220ece){const _0x486735=a10_0x4cb1,_0x4021da=_0x207a3b();while(!![]){try{const _0x381b00=parseInt(_0x486735(0x161))/0x1*(parseInt(_0x486735(0x185))/0x2)+parseInt(_0x486735(0x179))/0x3+parseInt(_0x486735(0x19b))/0x4*(-parseInt(_0x486735(0x162))/0x5)+-parseInt(_0x486735(0x193))/0x6*(-parseInt(_0x486735(0x18f))/0x7)+-parseInt(_0x486735(0x169))/0x8+-parseInt(_0x486735(0x192))/0x9+parseInt(_0x486735(0x188))/0xa*(-parseInt(_0x486735(0x1a1))/0xb);if(_0x381b00===_0x220ece)break;else _0x4021da['push'](_0x4021da['shift']());}catch(_0x58de76){_0x4021da['push'](_0x4021da['shift']());}}}(a10_0x4ec5,0x7dd9b));const a10_0x1dada5=(function(){const _0x3da423={'qXouH':'(((.+)+)+)+$','wSEmy':'hdyvo'};let _0x841d6e=!![];return function(_0x139ed8,_0x34c1c5){const _0x5476cf=a10_0x4cb1,_0x133cb5={'KrPxI':_0x3da423[_0x5476cf(0x168)]};if(_0x3da423[_0x5476cf(0x171)]!==_0x3da423[_0x5476cf(0x171)])return _0x510ba1[_0x5476cf(0x156)]()[_0x5476cf(0x186)](_0x133cb5[_0x5476cf(0x198)])['toString']()[_0x5476cf(0x16f)](_0x1262bb)['search'](_0x133cb5[_0x5476cf(0x198)]);else{const _0x1c1313=_0x841d6e?function(){const _0x2342e5=_0x5476cf;if(_0x34c1c5){const _0x264205=_0x34c1c5[_0x2342e5(0x15d)](_0x139ed8,arguments);return _0x34c1c5=null,_0x264205;}}:function(){};return _0x841d6e=![],_0x1c1313;}};}()),a10_0x18e34b=a10_0x1dada5(this,function(){const _0x11f853=a10_0x4cb1,_0x3ff8ae={'aDdeq':'(((.+)+)+)+$'};return a10_0x18e34b[_0x11f853(0x156)]()[_0x11f853(0x186)](_0x11f853(0x176))[_0x11f853(0x156)]()[_0x11f853(0x16f)](a10_0x18e34b)[_0x11f853(0x186)](_0x3ff8ae[_0x11f853(0x187)]);});a10_0x18e34b();function a10_0x4cb1(_0x3bf15c,_0x5dcfce){const _0x38e372=a10_0x4ec5();return a10_0x4cb1=function(_0x18e34b,_0x1dada5){_0x18e34b=_0x18e34b-0x156;let _0x4ec540=_0x38e372[_0x18e34b];return _0x4ec540;},a10_0x4cb1(_0x3bf15c,_0x5dcfce);}'use strict';Object['defineProperty'](exports,a10_0x34a90d(0x17f),{'value':!![]}),exports['LogicRunner']=void 0x0;const messages_1=require(a10_0x34a90d(0x157)),message_util_1=require(a10_0x34a90d(0x163)),llm_runner_1=require(a10_0x34a90d(0x19a));class LogicRunner{static async[a10_0x34a90d(0x16c)](_0x2054d3,_0x440701){const _0x438c9c=a10_0x34a90d,_0x4997e7={'jLXny':_0x438c9c(0x1a4),'QRDzY':function(_0x233d39,_0x36ad6c){return _0x233d39!==_0x36ad6c;},'cCndA':_0x438c9c(0x173),'KeZcB':function(_0xe44a2,_0x964bfb){return _0xe44a2!=_0x964bfb;},'pvadv':'TJAyV','zNPZM':_0x438c9c(0x17a),'twBYn':function(_0x5b9b8b,_0x5d64ba){return _0x5b9b8b===_0x5d64ba;},'MILNZ':_0x438c9c(0x172),'MGINa':'HgaUG','lARxm':_0x438c9c(0x17b),'RexdP':function(_0x1582f5,_0x2e44ff){return _0x1582f5===_0x2e44ff;},'XZmBt':_0x438c9c(0x158),'xoQTc':_0x438c9c(0x178),'fASsV':function(_0x2416e6,_0x4f7538){return _0x2416e6 in _0x4f7538;},'IJfWn':'step','Bjqkr':function(_0x79c579,_0x203c40){return _0x79c579!==_0x203c40;},'ngCPP':_0x438c9c(0x18d),'PsjRf':_0x438c9c(0x15e),'NrgZO':function(_0x5b3120,_0x2c5cd1){return _0x5b3120!==_0x2c5cd1;},'Ytuki':_0x438c9c(0x16d),'Qfatd':_0x438c9c(0x191),'muITR':function(_0x450c1c,_0x48ee4f){return _0x450c1c>_0x48ee4f;}},_0x45fc38=_0x2054d3[_0x438c9c(0x170)]();let _0x2e6eeb=_0x45fc38[_0x438c9c(0x160)]();if(_0x440701){if(_0x4997e7[_0x438c9c(0x194)](_0x4997e7[_0x438c9c(0x17d)],_0x4997e7[_0x438c9c(0x17d)])){const _0x4d0935=_0x5f5d99?function(){if(_0x4d0896){const _0xefd008=_0x566b47['apply'](_0x3a068e,arguments);return _0x4c8768=null,_0xefd008;}}:function(){};return _0x360b88=![],_0x4d0935;}else{const _0x12b1ab=message_util_1[_0x438c9c(0x175)][_0x438c9c(0x159)](_0x440701['id']);_0x4997e7[_0x438c9c(0x15f)](_0x12b1ab,_0x45fc38[_0x438c9c(0x182)]())&&(await _0x2054d3[_0x438c9c(0x195)](),_0x440701=_0x45fc38['onCrossing'](_0x440701,_0x12b1ab));}}else{if(_0x4997e7[_0x438c9c(0x194)](_0x438c9c(0x19f),_0x4997e7[_0x438c9c(0x19e)])){const _0x2f02d9=message_util_1[_0x438c9c(0x175)][_0x438c9c(0x199)](_0x2e6eeb);if(_0x2f02d9){if(_0x4997e7[_0x438c9c(0x190)]!==_0x4997e7[_0x438c9c(0x190)]){const _0x24d043=_0x51dd0d[_0x438c9c(0x15d)](_0x185a4e,arguments);return _0x72f9e=null,_0x24d043;}else{const _0x486e1d=message_util_1[_0x438c9c(0x175)][_0x438c9c(0x159)](_0x2f02d9['id']);_0x486e1d!=_0x45fc38['getName']()&&(await _0x2054d3['saveSession'](),_0x440701=_0x45fc38[_0x438c9c(0x15a)](_0x440701,_0x486e1d));}}else await _0x2054d3[_0x438c9c(0x195)](),_0x440701=_0x45fc38['onCrossing'](_0x440701);}else _0x195b76[_0x438c9c(0x184)](new _0x2b8fc9[(_0x438c9c(0x17e))]({'content':''}));}_0x2e6eeb[_0x438c9c(0x189)]===0x0&&_0x2e6eeb[_0x438c9c(0x184)](new messages_1[(_0x438c9c(0x17e))]({'content':''}));const _0x3065e8=_0x440701??new message_util_1[(_0x438c9c(0x174))](_0x45fc38,_0x438c9c(0x197)+_0x45fc38[_0x438c9c(0x182)]());_0x2e6eeb[_0x438c9c(0x184)](_0x3065e8);const _0xc9c615=await _0x45fc38[_0x438c9c(0x181)](),_0x558b73=new Array();if(_0x4997e7[_0x438c9c(0x19d)](typeof _0xc9c615,_0x4997e7['MILNZ']))_0x4997e7[_0x438c9c(0x19d)](_0x438c9c(0x19c),_0x4997e7[_0x438c9c(0x15c)])?await _0x2054d3[_0x438c9c(0x18e)](_0xc9c615):_0x51a0ae[_0x438c9c(0x184)](_0x184138[_0x4997e7[_0x438c9c(0x16e)]]);else{if(_0x4997e7['twBYn'](typeof _0xc9c615,_0x4997e7[_0x438c9c(0x16b)])){if(_0x4997e7[_0x438c9c(0x165)](_0x4997e7[_0x438c9c(0x183)],_0x4997e7[_0x438c9c(0x15b)]))return _0xb0ca28[_0x438c9c(0x16c)](_0x1b9e7a);else await _0x2054d3[_0x438c9c(0x18b)](_0xc9c615);}else{if(_0x4997e7[_0x438c9c(0x166)](_0x4997e7[_0x438c9c(0x1a0)],_0xc9c615)){let _0xfa4e8f;if(typeof _0xc9c615['step']===_0x438c9c(0x172)){if(_0x4997e7[_0x438c9c(0x17c)](_0x4997e7[_0x438c9c(0x18c)],_0x4997e7[_0x438c9c(0x164)]))_0xfa4e8f=await _0x2054d3[_0x438c9c(0x18e)](_0xc9c615['step']);else{if(_0x5eebe3){const _0x343380=_0x2f3820[_0x438c9c(0x15d)](_0x3d8618,arguments);return _0x37dd0a=null,_0x343380;}}}else _0xfa4e8f=await _0x2054d3[_0x438c9c(0x18b)](_0xc9c615[_0x438c9c(0x196)]);_0xc9c615[_0x438c9c(0x16a)]&&_0xfa4e8f[_0x438c9c(0x180)]({'_prompt':_0xc9c615['prompt']}),_0xc9c615[_0x438c9c(0x177)]&&_0xfa4e8f[_0x438c9c(0x180)](_0xc9c615[_0x438c9c(0x177)]),_0xc9c615[_0x438c9c(0x18a)]&&(_0x4997e7[_0x438c9c(0x1a3)](_0x4997e7['Ytuki'],_0x4997e7[_0x438c9c(0x1a2)])?_0xfa4e8f['contentType']=_0xc9c615[_0x438c9c(0x18a)]:_0x4b308b[_0x438c9c(0x180)](_0x227078[_0x438c9c(0x177)])),_0xc9c615['message']&&_0x558b73[_0x438c9c(0x184)](_0xc9c615[_0x4997e7[_0x438c9c(0x16e)]]);}}}const _0x496d5e=_0x2054d3[_0x438c9c(0x170)]();return _0x2e6eeb=_0x496d5e[_0x438c9c(0x160)](),_0x4997e7['muITR'](_0x558b73[_0x438c9c(0x189)],0x0)&&_0x2e6eeb[_0x438c9c(0x184)](..._0x558b73),_0x496d5e['isLogic']()?LogicRunner['send'](_0x2054d3):await llm_runner_1['LlmRunner'][_0x438c9c(0x16c)](_0x2054d3);}}exports[a10_0x34a90d(0x167)]=LogicRunner;
@@ -0,0 +1,8 @@
1
+ import { Flow } from './flow';
2
+ import { ClassType, LogicResponseType } from './flow-types';
3
+ import { Step } from './step';
4
+ export declare abstract class LogicStep extends Step {
5
+ constructor(step: ClassType, flow: Flow, isActive?: boolean);
6
+ isLogic(): boolean;
7
+ abstract runLogic(): Promise<LogicResponseType>;
8
+ }
@@ -0,0 +1 @@
1
+ const a11_0x2113a0=a11_0xcb8a;(function(_0x63c1c0,_0x41bf45){const _0x2445d4=a11_0xcb8a,_0x1cf929=_0x63c1c0();while(!![]){try{const _0x379b5a=parseInt(_0x2445d4(0x180))/0x1+-parseInt(_0x2445d4(0x17d))/0x2+-parseInt(_0x2445d4(0x183))/0x3+-parseInt(_0x2445d4(0x17a))/0x4+-parseInt(_0x2445d4(0x182))/0x5*(parseInt(_0x2445d4(0x17e))/0x6)+-parseInt(_0x2445d4(0x18c))/0x7+parseInt(_0x2445d4(0x187))/0x8;if(_0x379b5a===_0x41bf45)break;else _0x1cf929['push'](_0x1cf929['shift']());}catch(_0x5ddd5b){_0x1cf929['push'](_0x1cf929['shift']());}}}(a11_0x43b0,0xe6059));function a11_0x43b0(){const _0x3aa166=['(((.+)+)+)+$','search','LGaNl','69075720kApTEi','__esModule','apply','isLogic','toString','11533928RbPkPi','4436660LCfVmS','wqZCm','./step','3573662zpKQCR','945702iJPlLX','defineProperty','175769xRwhVq','LogicStep','50FXENfd','5244585BCCvZs'];a11_0x43b0=function(){return _0x3aa166;};return a11_0x43b0();}const a11_0x2a2bea=(function(){const _0x2b6b07=a11_0xcb8a,_0x38fa66={'ifNnv':function(_0x2d3af1,_0x2cfc9a){return _0x2d3af1!==_0x2cfc9a;},'pGQaz':_0x2b6b07(0x17b)};let _0x3c875c=!![];return function(_0x12f830,_0x5e4199){const _0xc4bd55=_0x3c875c?function(){const _0x182488=a11_0xcb8a;if(_0x38fa66['ifNnv']('wqZCm',_0x38fa66['pGQaz'])){if(_0x2b39bc){const _0x49cec0=_0x3e7619[_0x182488(0x189)](_0x368db3,arguments);return _0x3a67b4=null,_0x49cec0;}}else{if(_0x5e4199){const _0x170790=_0x5e4199['apply'](_0x12f830,arguments);return _0x5e4199=null,_0x170790;}}}:function(){};return _0x3c875c=![],_0xc4bd55;};}()),a11_0x4ae2ad=a11_0x2a2bea(this,function(){const _0x9fed60=a11_0xcb8a,_0x1a71f7={'LGaNl':_0x9fed60(0x184)};return a11_0x4ae2ad[_0x9fed60(0x18b)]()[_0x9fed60(0x185)](_0x1a71f7['LGaNl'])[_0x9fed60(0x18b)]()['constructor'](a11_0x4ae2ad)[_0x9fed60(0x185)](_0x1a71f7[_0x9fed60(0x186)]);});function a11_0xcb8a(_0x5e14f3,_0x160808){const _0x2ca580=a11_0x43b0();return a11_0xcb8a=function(_0x4ae2ad,_0x2a2bea){_0x4ae2ad=_0x4ae2ad-0x17a;let _0x43b037=_0x2ca580[_0x4ae2ad];return _0x43b037;},a11_0xcb8a(_0x5e14f3,_0x160808);}a11_0x4ae2ad();'use strict';Object[a11_0x2113a0(0x17f)](exports,a11_0x2113a0(0x188),{'value':!![]}),exports[a11_0x2113a0(0x181)]=void 0x0;const step_1=require(a11_0x2113a0(0x17c));class LogicStep extends step_1['Step']{constructor(_0x173be9,_0x4e00ca,_0xb59418=![]){super(_0x173be9,_0x4e00ca,_0xb59418);}[a11_0x2113a0(0x18a)](){return!![];}}exports[a11_0x2113a0(0x181)]=LogicStep;
@@ -0,0 +1,10 @@
1
+ import { MemoryType } from '../flow/flow-types';
2
+ import { MessageTypes } from '../utils/message-util';
3
+ export declare class Memory {
4
+ private nameSpaceMap;
5
+ constructor(nameSpaces?: string[]);
6
+ getMessages(nameSpace: string): MessageTypes[];
7
+ createOoc(): MemoryType[];
8
+ readDoc(memDocs: MemoryType[]): Memory;
9
+ writeDoc(memDocs: MemoryType[]): void;
10
+ }
package/flow/memory.js ADDED
@@ -0,0 +1 @@
1
+ const a12_0x33d32c=a12_0x2749;(function(_0x231e08,_0x3baf71){const _0xa57b1e=a12_0x2749,_0x28e0a8=_0x231e08();while(!![]){try{const _0x3baa66=parseInt(_0xa57b1e(0x120))/0x1+-parseInt(_0xa57b1e(0x15c))/0x2+parseInt(_0xa57b1e(0x147))/0x3*(-parseInt(_0xa57b1e(0x129))/0x4)+parseInt(_0xa57b1e(0x160))/0x5+parseInt(_0xa57b1e(0x140))/0x6*(parseInt(_0xa57b1e(0x133))/0x7)+-parseInt(_0xa57b1e(0x159))/0x8+parseInt(_0xa57b1e(0x14f))/0x9;if(_0x3baa66===_0x3baf71)break;else _0x28e0a8['push'](_0x28e0a8['shift']());}catch(_0x212352){_0x28e0a8['push'](_0x28e0a8['shift']());}}}(a12_0x45d6,0x18909));const a12_0x551d6e=(function(){const _0x3db827=a12_0x2749,_0x528361={'KTyiu':_0x3db827(0x126),'sjonR':function(_0x74cbc9,_0x4cf8cb){return _0x74cbc9===_0x4cf8cb;},'yeEQV':_0x3db827(0x15e),'Svmug':_0x3db827(0x163),'gCayA':_0x3db827(0x165),'fJFHk':_0x3db827(0x13a),'qnOBx':_0x3db827(0x12d),'uzweg':'name','VCkXr':function(_0x480420,_0x2f985a){return _0x480420===_0x2f985a;},'wabIn':_0x3db827(0x11f),'FpaFX':_0x3db827(0x132)};let _0x48247a=!![];return function(_0x4d396d,_0x5095a6){const _0x463dcf=_0x3db827,_0x48db93={'zuAgM':_0x528361['gCayA'],'yXjro':_0x528361[_0x463dcf(0x154)],'DSWUr':_0x528361[_0x463dcf(0x167)],'QbRPg':_0x528361[_0x463dcf(0x122)],'gbsyq':function(_0x19573b,_0x134ddd){return _0x19573b>_0x134ddd;},'xMqYo':_0x463dcf(0x124)};if(_0x528361[_0x463dcf(0x121)](_0x528361[_0x463dcf(0x145)],_0x528361['FpaFX']))_0x1fa7e6[_0x528361['KTyiu']]=_0x2d487a[_0x463dcf(0x126)];else{const _0x44d174=_0x48247a?function(){const _0x2b5fd8=_0x463dcf;if(_0x528361[_0x2b5fd8(0x14d)](_0x528361[_0x2b5fd8(0x13c)],_0x528361['Svmug'])){const _0x33bd32={'type':_0x45ee23[_0x2b5fd8(0x149)],'content':_0x296278[_0x2b5fd8(0x15d)],'id':_0x3931e0['id']};!_0x5ac874[_0x2b5fd8(0x143)][_0x2b5fd8(0x153)](_0x1a0094[_0x2b5fd8(0x126)])&&(_0x33bd32[_0x2b5fd8(0x126)]=_0x18094c['additional_kwargs']);switch(_0x189045['type']){case _0x48db93[_0x2b5fd8(0x162)]:const _0x2fa74a=_0x2cffde;_0x33bd32[_0x48db93['yXjro']]=_0x2fa74a[_0x2b5fd8(0x13a)],_0x33bd32[_0x48db93[_0x2b5fd8(0x161)]]=_0x2fa74a[_0x2b5fd8(0x12d)],_0x33bd32[_0x48db93['QbRPg']]=_0x2fa74a[_0x2b5fd8(0x13d)];return _0x33bd32;case'ai':const _0x13114c=_0x4b43a3;if(_0x48db93['gbsyq'](_0x13114c[_0x2b5fd8(0x124)][_0x2b5fd8(0x14e)],0x0))return _0x33bd32[_0x48db93[_0x2b5fd8(0x12f)]]=_0x5ef75a['MessageUtil'][_0x2b5fd8(0x127)](_0x13114c[_0x2b5fd8(0x124)]),_0x33bd32;default:return _0x33bd32;}}else{if(_0x5095a6){const _0x17d8f8=_0x5095a6[_0x2b5fd8(0x13f)](_0x4d396d,arguments);return _0x5095a6=null,_0x17d8f8;}}}:function(){};return _0x48247a=![],_0x44d174;}};}()),a12_0x208e7b=a12_0x551d6e(this,function(){const _0x2b345d=a12_0x2749,_0x25b814={'KsGIS':_0x2b345d(0x144)};return a12_0x208e7b[_0x2b345d(0x151)]()[_0x2b345d(0x156)](_0x25b814[_0x2b345d(0x136)])['toString']()[_0x2b345d(0x15b)](a12_0x208e7b)[_0x2b345d(0x156)]('(((.+)+)+)+$');});a12_0x208e7b();function a12_0x2749(_0x4e74ac,_0xf17561){const _0x95fca5=a12_0x45d6();return a12_0x2749=function(_0x208e7b,_0x551d6e){_0x208e7b=_0x208e7b-0x11e;let _0x45d654=_0x95fca5[_0x208e7b];return _0x45d654;},a12_0x2749(_0x4e74ac,_0xf17561);}'use strict';Object[a12_0x33d32c(0x11e)](exports,'__esModule',{'value':!![]}),exports['Memory']=void 0x0;function a12_0x45d6(){const _0x3154f7=['makeToolStruct','human','137352bixfId','get','foDGI','GNluo','status','nameSpace','xMqYo','nameSpaceMap','eFVTa','dqxaK','1293467jjAWZO','history','HumanMessage','KsGIS','HwtjB','AIMessage','readDoc','tool_call_id','getMessages','yeEQV','name','RCpuB','apply','6yUSwhr','nXjzz','map','MessageUtil','(((.+)+)+)+$','wabIn','system','9KjiSPW','aDWgB','type','writeDoc','vDtmQ','../utils/message-util','sjonR','length','490131wbcGgE','PyPch','toString','SystemMessage','isEmptyObject','fJFHk','XTjwx','search','aKueQ','ToolMessage','955560cvElqD','eIcMh','constructor','282838tpEsKt','content','mYZub','set','453880VZpbdY','DSWUr','zuAgM','qxKLI','XJaej','tool','EwckP','qnOBx','riIVe','defineProperty','ezCKD','134479tGFOnO','VCkXr','uzweg','nRNAX','tool_calls','TLFgk','additional_kwargs'];a12_0x45d6=function(){return _0x3154f7;};return a12_0x45d6();}const messages_1=require('@langchain/core/messages'),message_util_1=require(a12_0x33d32c(0x14c));class Memory{constructor(_0x1ec646){const _0x25d8bd=a12_0x33d32c,_0xc64e16={'XTjwx':function(_0x2bedbf,_0x417e72){return _0x2bedbf!==_0x417e72;},'mbvsD':_0x25d8bd(0x141)};this[_0x25d8bd(0x130)]=new Map();if(_0x1ec646){if(_0xc64e16[_0x25d8bd(0x155)](_0xc64e16['mbvsD'],_0x25d8bd(0x141)))for(const _0x1a683a of _0x45d51d){this[_0x25d8bd(0x13b)](_0x1a683a);}else for(const _0x26b40a of _0x1ec646){this['getMessages'](_0x26b40a);}}else{}}[a12_0x33d32c(0x13b)](_0x47f100){const _0x45942b=a12_0x33d32c;let _0x1e49ad=this['nameSpaceMap'][_0x45942b(0x12a)](_0x47f100);return!_0x1e49ad&&(_0x1e49ad=[],this[_0x45942b(0x130)][_0x45942b(0x15f)](_0x47f100,_0x1e49ad)),_0x1e49ad;}['createOoc'](){const _0x20f782=a12_0x33d32c,_0x4453c4=[];for(const [_0x59fd55]of this[_0x20f782(0x130)]){_0x4453c4['push']({'nameSpace':_0x59fd55,'history':[]});}return _0x4453c4;}[a12_0x33d32c(0x139)](_0x57ab2d){const _0x1f1c10=a12_0x33d32c,_0x3607c7={'ROcJN':function(_0xdc160a,_0x50987c){return _0xdc160a!==_0x50987c;},'eFVTa':_0x1f1c10(0x146),'riIVe':_0x1f1c10(0x128),'Jdpdz':function(_0xbaee6c,_0x202285){return _0xbaee6c>_0x202285;},'tjfNQ':'tool'};for(const _0x248027 of _0x57ab2d){const _0x4f2cd7=_0x248027['history'],_0x43b37b=_0x4f2cd7[_0x1f1c10(0x142)](_0x75f249=>{const _0x45a3e3=_0x1f1c10;if(_0x3607c7['ROcJN']('sVgQb','sVgQb')){const _0x9e4341=[];for(const [_0x1789b0]of this[_0x45a3e3(0x130)]){_0x9e4341['push']({'nameSpace':_0x1789b0,'history':[]});}return _0x9e4341;}else switch(_0x75f249['type']){case _0x3607c7[_0x45a3e3(0x131)]:return new messages_1[(_0x45a3e3(0x152))]({'content':_0x75f249[_0x45a3e3(0x15d)],'id':_0x75f249['id']});case _0x3607c7[_0x45a3e3(0x168)]:return new messages_1[(_0x45a3e3(0x135))]({'content':_0x75f249[_0x45a3e3(0x15d)],'id':_0x75f249['id'],'additional_kwargs':_0x75f249[_0x45a3e3(0x126)]});case'ai':return _0x3607c7['Jdpdz'](_0x75f249[_0x45a3e3(0x124)]?.[_0x45a3e3(0x14e)],0x0)?new messages_1[(_0x45a3e3(0x138))]({'content':_0x75f249[_0x45a3e3(0x15d)],'id':_0x75f249['id'],'additional_kwargs':_0x75f249[_0x45a3e3(0x126)],'tool_calls':message_util_1[_0x45a3e3(0x143)][_0x45a3e3(0x127)](_0x75f249['tool_calls'])}):new messages_1[(_0x45a3e3(0x138))]({'content':_0x75f249['content'],'id':_0x75f249['id'],'additional_kwargs':_0x75f249[_0x45a3e3(0x126)]});case _0x3607c7['tjfNQ']:return new messages_1[(_0x45a3e3(0x158))]({'content':_0x75f249[_0x45a3e3(0x15d)],'id':_0x75f249['id'],'tool_call_id':_0x75f249[_0x45a3e3(0x13a)],'status':_0x75f249[_0x45a3e3(0x12d)],'name':_0x75f249[_0x45a3e3(0x13d)],'additional_kwargs':_0x75f249[_0x45a3e3(0x126)]});}});this[_0x1f1c10(0x130)][_0x1f1c10(0x15f)](_0x248027[_0x1f1c10(0x12e)],_0x43b37b);}return this;}[a12_0x33d32c(0x14a)](_0x46ff47){const _0x53df12=a12_0x33d32c,_0x1466f5={'rHuTI':_0x53df12(0x144),'eIcMh':function(_0x5cae58,_0x285172){return _0x5cae58===_0x285172;},'GNluo':'CNXzb','gxvhl':_0x53df12(0x14b),'TFIlb':_0x53df12(0x126),'TLFgk':'tool','EwckP':_0x53df12(0x12d),'XJaej':_0x53df12(0x13d),'PyPch':function(_0x28b900,_0xb6fe3d){return _0x28b900>_0xb6fe3d;},'HwtjB':function(_0x3f9420,_0x3411c4){return _0x3f9420!==_0x3411c4;},'wIVQt':_0x53df12(0x157),'nRNAX':_0x53df12(0x13e),'foDGI':_0x53df12(0x124),'aDWgB':function(_0x57e551,_0x2a12de){return _0x57e551===_0x2a12de;}};for(const [_0x3d422f,_0x3be826]of this[_0x53df12(0x130)]){const _0x4861ed=_0x3be826[_0x53df12(0x142)](_0x37d887=>{const _0x1dea98=_0x53df12,_0x5ea077={'type':_0x37d887[_0x1dea98(0x149)],'content':_0x37d887[_0x1dea98(0x15d)],'id':_0x37d887['id']};if(!message_util_1['MessageUtil'][_0x1dea98(0x153)](_0x37d887[_0x1dea98(0x126)])){if(_0x1466f5[_0x1dea98(0x15a)](_0x1466f5[_0x1dea98(0x12c)],_0x1466f5['gxvhl'])){const _0x2a579d=_0x2572d4?function(){if(_0x49b294){const _0x20c2d2=_0x59b651['apply'](_0x2a7a89,arguments);return _0x412b40=null,_0x20c2d2;}}:function(){};return _0x8e8bb8=![],_0x2a579d;}else _0x5ea077[_0x1466f5['TFIlb']]=_0x37d887[_0x1dea98(0x126)];}switch(_0x37d887['type']){case _0x1466f5[_0x1dea98(0x125)]:const _0x212816=_0x37d887;_0x5ea077[_0x1dea98(0x13a)]=_0x212816[_0x1dea98(0x13a)],_0x5ea077[_0x1466f5[_0x1dea98(0x166)]]=_0x212816['status'],_0x5ea077[_0x1466f5[_0x1dea98(0x164)]]=_0x212816['name'];return _0x5ea077;case'ai':const _0x3bd7d2=_0x37d887;if(_0x1466f5[_0x1dea98(0x150)](_0x3bd7d2[_0x1dea98(0x124)][_0x1dea98(0x14e)],0x0))return _0x1466f5[_0x1dea98(0x137)](_0x1466f5['wIVQt'],_0x1466f5[_0x1dea98(0x123)])?(_0x5ea077[_0x1466f5[_0x1dea98(0x12b)]]=message_util_1['MessageUtil'][_0x1dea98(0x127)](_0x3bd7d2['tool_calls']),_0x5ea077):_0x8dec21[_0x1dea98(0x151)]()[_0x1dea98(0x156)](_0x1dea98(0x144))[_0x1dea98(0x151)]()[_0x1dea98(0x15b)](_0xda46a9)[_0x1dea98(0x156)](DlTrbi['rHuTI']);default:return _0x5ea077;}});let _0x4b108a=![];for(const _0x1de238 of _0x46ff47){if(_0x1466f5[_0x53df12(0x148)](_0x1de238['nameSpace'],_0x3d422f)){_0x1de238[_0x53df12(0x134)]=_0x4861ed,_0x4b108a=!![];break;}}!_0x4b108a&&_0x46ff47['push']({'nameSpace':_0x3d422f,'history':_0x4861ed});}}}exports['Memory']=Memory;
package/flow/step.d.ts ADDED
@@ -0,0 +1,63 @@
1
+ import { Flow } from './flow';
2
+ import { ClassType, StepClassType, StepType, ToolResponseType, ToolType } from './flow-types';
3
+ import { MessageContent } from '@langchain/core/messages';
4
+ import { MessageTypes } from '../utils/message-util';
5
+ import { ToolCall } from '@langchain/core/messages/tool';
6
+ import { DynamicStructuredTool } from '@langchain/core/tools';
7
+ import { HttpContentType } from './content-type';
8
+ import { LLMType } from '../utils/llm-file.js';
9
+ export declare abstract class Step {
10
+ protected flow: Flow;
11
+ protected isActive: boolean;
12
+ protected name: string;
13
+ protected memorySpace: string;
14
+ protected state: {};
15
+ protected modelName: any;
16
+ protected ctType: HttpContentType;
17
+ protected temperature: number;
18
+ protected constructor(stepClass: ClassType, flow: Flow, isActive?: boolean);
19
+ getName(): string;
20
+ protected onEnter(): void;
21
+ protected onExit(): void;
22
+ onResponse(llmText: string): string | StepClassType;
23
+ get active(): boolean;
24
+ isLogic(): boolean;
25
+ set active(flag: boolean);
26
+ getTemperature(): number;
27
+ setTemperature(temp: number): this;
28
+ get contentType(): HttpContentType;
29
+ set contentType(ctType: HttpContentType);
30
+ getState(key?: string): object;
31
+ getStateAs<T>(key?: string): T;
32
+ saveState(json: object): void;
33
+ mergeState(json: object): void;
34
+ sessionCompleted(): void;
35
+ getContext<T>(key: string): T;
36
+ removeState(key: string): void;
37
+ getPrompt(): string;
38
+ onCrossing(langMessage: MessageTypes, _priorStep?: string): MessageTypes;
39
+ getMemory(): MessageTypes[];
40
+ getLastMessage(): MessageTypes;
41
+ useMemory(nameSpace: string): Step;
42
+ useModel(modelName: string): Step;
43
+ getModel(): string;
44
+ defineTool(): ToolType[];
45
+ getTool(): string[];
46
+ getStopTool(): string[];
47
+ obtainTools(): DynamicStructuredTool[];
48
+ protected amendTool(prompt: string): string;
49
+ invokeTool(_tools: ToolCall[]): Promise<[string, boolean]>;
50
+ run(userMessage: string): Promise<MessageContent | null>;
51
+ runStep(stepClass: StepClassType, userMessage?: string): Promise<MessageContent | null>;
52
+ isEnd(): boolean;
53
+ writeDoc(stepDoc: StepType[]): void;
54
+ readDoc(stepDoc: StepType[]): void;
55
+ createDoc(): StepType;
56
+ protected eraseMemory(): MessageTypes[];
57
+ callStepTool(stepClass: ClassType, tool: ToolCall): Promise<ToolResponseType>;
58
+ protected setStopTool(langMessage: MessageTypes): MessageTypes;
59
+ genMessageId(): string;
60
+ private random10Digits;
61
+ getLLMType(): LLMType;
62
+ structOutputSchema(): object;
63
+ }
package/flow/step.js ADDED
@@ -0,0 +1 @@
1
+ const a13_0x41aebf=a13_0x26db;(function(_0x3e90f,_0x759c8c){const _0x56098=a13_0x26db,_0x16d023=_0x3e90f();while(!![]){try{const _0x45f5db=parseInt(_0x56098(0xb1))/0x1*(parseInt(_0x56098(0xa1))/0x2)+-parseInt(_0x56098(0x81))/0x3+parseInt(_0x56098(0xe0))/0x4+parseInt(_0x56098(0x91))/0x5*(-parseInt(_0x56098(0xcd))/0x6)+parseInt(_0x56098(0xaa))/0x7+parseInt(_0x56098(0x100))/0x8+-parseInt(_0x56098(0xd2))/0x9;if(_0x45f5db===_0x759c8c)break;else _0x16d023['push'](_0x16d023['shift']());}catch(_0x235ede){_0x16d023['push'](_0x16d023['shift']());}}}(a13_0x2b21,0xa8cec));function a13_0x26db(_0x27b7f7,_0x57ba01){const _0x6d2e3c=a13_0x2b21();return a13_0x26db=function(_0x1d7bd4,_0x824505){_0x1d7bd4=_0x1d7bd4-0x73;let _0x2b2113=_0x6d2e3c[_0x1d7bd4];return _0x2b2113;},a13_0x26db(_0x27b7f7,_0x57ba01);}const a13_0x824505=(function(){const _0x3dcb8c=a13_0x26db,_0x4d50e5={'ofBgy':_0x3dcb8c(0xdf)};let _0x1f7786=!![];return function(_0x47c382,_0x4b3990){const _0x5b33c4=_0x3dcb8c,_0x1acbe0={'bVVSe':function(_0x57dfef,_0x3e68f0){return _0x57dfef===_0x3e68f0;},'VeSnA':_0x4d50e5[_0x5b33c4(0xa5)],'IaPqE':_0x5b33c4(0xd8)},_0x1d8f5e=_0x1f7786?function(){const _0x361704=_0x5b33c4;if(_0x4b3990){if(_0x1acbe0[_0x361704(0xdb)](_0x1acbe0[_0x361704(0xc8)],_0x1acbe0[_0x361704(0xc6)]))return[];else{const _0xdf3b01=_0x4b3990[_0x361704(0xab)](_0x47c382,arguments);return _0x4b3990=null,_0xdf3b01;}}}:function(){};return _0x1f7786=![],_0x1d8f5e;};}()),a13_0x1d7bd4=a13_0x824505(this,function(){const _0x5b83b5=a13_0x26db,_0xdf14cb={'AGXXk':'(((.+)+)+)+$'};return a13_0x1d7bd4['toString']()[_0x5b83b5(0x76)](_0xdf14cb[_0x5b83b5(0x85)])[_0x5b83b5(0x7b)]()[_0x5b83b5(0xfe)](a13_0x1d7bd4)[_0x5b83b5(0x76)](_0xdf14cb[_0x5b83b5(0x85)]);});a13_0x1d7bd4();'use strict';var __importDefault=this&&this[a13_0x41aebf(0xee)]||function(_0x35188d){const _0x347b62=a13_0x41aebf;return _0x35188d&&_0x35188d[_0x347b62(0xe2)]?_0x35188d:{'default':_0x35188d};};Object[a13_0x41aebf(0x8c)](exports,a13_0x41aebf(0xe2),{'value':!![]}),exports[a13_0x41aebf(0xa6)]=void 0x0;const lodash_1=require(a13_0x41aebf(0xf7)),moment_1=__importDefault(require(a13_0x41aebf(0xdd))),messages_1=require(a13_0x41aebf(0xc0)),llm_runner_1=require('./llm-runner'),message_util_1=require('../utils/message-util'),content_type_1=require('./content-type'),llm_file_js_1=require(a13_0x41aebf(0x10c));class Step{constructor(_0x4d10ee,_0x54c9d8,_0x158900=![]){const _0x542b15=a13_0x41aebf,_0xb79d24=_0x542b15(0xca)[_0x542b15(0xe4)]('|');let _0x34639d=0x0;while(!![]){switch(_0xb79d24[_0x34639d++]){case'0':this[_0x542b15(0xea)]=_0x54c9d8;continue;case'1':this[_0x542b15(0xb4)]=_0x4d10ee[_0x542b15(0xb4)];continue;case'2':this[_0x542b15(0xd1)]=undefined;continue;case'3':this[_0x542b15(0xf6)]=content_type_1['HttpContentType'][_0x542b15(0x104)];continue;case'4':this[_0x542b15(0xe6)]=_0x4d10ee[_0x542b15(0xb4)];continue;case'5':this[_0x542b15(0x82)]={};continue;case'6':this[_0x542b15(0xa8)]=-0x1;continue;case'7':this[_0x542b15(0x88)]=![];continue;case'8':this['isActive']=_0x158900;continue;}break;}}[a13_0x41aebf(0xd4)](){const _0xc9e70=a13_0x41aebf;return this[_0xc9e70(0xb4)];}['onEnter'](){}[a13_0x41aebf(0xb8)](){}[a13_0x41aebf(0xed)](_0x758c85){return _0x758c85;}get[a13_0x41aebf(0xa3)](){const _0x7c1752=a13_0x41aebf;return this[_0x7c1752(0x88)];}['isLogic'](){return![];}set[a13_0x41aebf(0xa3)](_0x26be0f){const _0x4531ef=a13_0x41aebf,_0x524cbc={'ZRXBj':_0x4531ef(0x106),'Iriol':function(_0x43e44b,_0x427ba6){return _0x43e44b===_0x427ba6;},'HGnqI':_0x4531ef(0xc4)};if(!this['isActive']&&_0x26be0f){if(_0x524cbc['Iriol'](_0x524cbc['HGnqI'],_0x524cbc[_0x4531ef(0xa7)]))this['onEnter']();else return _0x2d3430[_0x4531ef(0x7b)]()[_0x4531ef(0x76)](wAaVol['ZRXBj'])[_0x4531ef(0x7b)]()[_0x4531ef(0xfe)](_0x2fb607)[_0x4531ef(0x76)]('(((.+)+)+)+$');}this[_0x4531ef(0x88)]&&!_0x26be0f&&this['onExit'](),this[_0x4531ef(0x88)]=_0x26be0f;}[a13_0x41aebf(0x9f)](){const _0xf8218b=a13_0x41aebf;return this[_0xf8218b(0xa8)];}[a13_0x41aebf(0x7f)](_0x40be0a){const _0x1d5e58=a13_0x41aebf;return this[_0x1d5e58(0xa8)]=_0x40be0a,this;}get['contentType'](){return this['ctType'];}set['contentType'](_0x2d94cf){const _0xe0235a=a13_0x41aebf;this[_0xe0235a(0xf6)]=_0x2d94cf;}[a13_0x41aebf(0xff)](_0x1122a1){const _0x11009c=a13_0x41aebf,_0x1c5e4f={'ubTrj':function(_0x4e9a80,_0x561ac6){return _0x4e9a80!==_0x561ac6;}};if(_0x1122a1)return _0x1c5e4f[_0x11009c(0x10b)](_0x11009c(0xb7),_0x11009c(0xbb))?(0x0,lodash_1[_0x11009c(0x7c)])(this['state'],_0x1122a1):{'name':this[_0x11009c(0xb4)],'isActive':this[_0x11009c(0x88)],'state':this['state']};return this['state'];}[a13_0x41aebf(0x9e)](_0x18f313){const _0x47dca8=a13_0x41aebf;if(_0x18f313)return(0x0,lodash_1['get'])(this[_0x47dca8(0x82)],_0x18f313);return this[_0x47dca8(0x82)];}[a13_0x41aebf(0x10a)](_0x59df03){const _0xaf2d25=a13_0x41aebf;_0x59df03&&(_0xaf2d25(0xba)==='qGrOf'?(this[_0xaf2d25(0x82)]=(0x0,lodash_1[_0xaf2d25(0xf2)])(this[_0xaf2d25(0x82)],Object[_0xaf2d25(0x87)](_0x59df03)[0x0]),this['state']=(0x0,lodash_1[_0xaf2d25(0xc9)])({},this[_0xaf2d25(0x82)],_0x59df03),this[_0xaf2d25(0x82)]=(0x0,lodash_1['merge'])(this[_0xaf2d25(0x82)],{'_saveOn':(0x0,moment_1[_0xaf2d25(0x9b)])()[_0xaf2d25(0x92)]()})):(!this[_0xaf2d25(0x88)]&&_0x28e2ab&&this['onEnter'](),this[_0xaf2d25(0x88)]&&!_0x37f479&&this[_0xaf2d25(0xb8)](),this[_0xaf2d25(0x88)]=_0x3496d7));}[a13_0x41aebf(0xac)](_0x5b314c){const _0x4d7f84=a13_0x41aebf;_0x5b314c&&(this[_0x4d7f84(0x82)]=(0x0,lodash_1[_0x4d7f84(0xc9)])({},this[_0x4d7f84(0x82)],_0x5b314c),this[_0x4d7f84(0x82)]=(0x0,lodash_1[_0x4d7f84(0xc9)])(this[_0x4d7f84(0x82)],{'_saveOn':(0x0,moment_1[_0x4d7f84(0x9b)])()['toDate']()}));}[a13_0x41aebf(0x83)](){const _0x563f6d=a13_0x41aebf,_0x1d949d={'fibsQ':_0x563f6d(0x7a)},_0x1c484b=this[_0x563f6d(0xea)]['getSessionDoc']();_0x1c484b['runStatus']=_0x1d949d[_0x563f6d(0x110)];}[a13_0x41aebf(0xa2)](_0x2ed993){const _0x29d164=a13_0x41aebf;return this['flow'][_0x29d164(0xa2)](_0x2ed993);}['removeState'](_0xe4b117){const _0x24d73e=a13_0x41aebf;this[_0x24d73e(0x82)]=(0x0,lodash_1['omit'])(this[_0x24d73e(0x82)],_0xe4b117);}[a13_0x41aebf(0xf8)](){const _0xa032c6=a13_0x41aebf,_0x1fe14f={'qpIZg':_0xa032c6(0xb9)},_0x41d6fc=this[_0xa032c6(0xff)](_0x1fe14f[_0xa032c6(0xda)]);return _0x41d6fc?_0x41d6fc[_0xa032c6(0x7b)]():null;}[a13_0x41aebf(0x9c)](_0x5dc31b,_0x5b892d){return _0x5dc31b;}[a13_0x41aebf(0xd6)](){const _0x40d6f3=a13_0x41aebf,_0x124f29={'KpCom':function(_0x41bcd1,_0x5c5061){return _0x41bcd1===_0x5c5061;}},_0x2e252a=this[_0x40d6f3(0xea)][_0x40d6f3(0xd6)](this[_0x40d6f3(0xe6)]);return _0x124f29[_0x40d6f3(0x9a)](_0x2e252a[_0x40d6f3(0x8a)],0x0)&&_0x2e252a['push'](new messages_1[(_0x40d6f3(0xbd))]({'content':'','id':this[_0x40d6f3(0xf0)]()})),_0x2e252a;}['getLastMessage'](){const _0x47fa1c=a13_0x41aebf,_0xac7a40={'wZQiS':function(_0x455413,_0x41e3a0){return _0x455413>_0x41e3a0;},'yndsK':function(_0x24ec91,_0x386cac){return _0x24ec91-_0x386cac;},'fEsYt':function(_0x11a4f6,_0x50e8c6){return _0x11a4f6>_0x50e8c6;},'rKMQN':function(_0x339518,_0x5e87b1){return _0x339518!==_0x5e87b1;},'VklxL':_0x47fa1c(0x102),'RygWW':function(_0x12da5c,_0x11908b){return _0x12da5c-_0x11908b;}},_0xce7804=this[_0x47fa1c(0xea)]['getMemory'](this[_0x47fa1c(0xe6)]);if(_0xac7a40[_0x47fa1c(0xe9)](_0xce7804['length'],0x0)){if(_0xac7a40[_0x47fa1c(0x8d)](_0xac7a40[_0x47fa1c(0xd3)],_0xac7a40[_0x47fa1c(0xd3)])){const _0x1c374b=this[_0x47fa1c(0xea)][_0x47fa1c(0xd6)](this[_0x47fa1c(0xe6)]);if(_0xac7a40['wZQiS'](_0x1c374b[_0x47fa1c(0x8a)],0x0))return _0x1c374b[_0xac7a40[_0x47fa1c(0xb5)](_0x1c374b[_0x47fa1c(0x8a)],0x1)];return null;}else return _0xce7804[_0xac7a40[_0x47fa1c(0xdc)](_0xce7804[_0x47fa1c(0x8a)],0x1)];}return null;}['useMemory'](_0x2a62c5){const _0x41c1b0=a13_0x41aebf;return this[_0x41c1b0(0xe6)]=_0x2a62c5,this;}[a13_0x41aebf(0xe7)](_0x35caae){const _0x360018=a13_0x41aebf;return this[_0x360018(0xd1)]=_0x35caae,this;}[a13_0x41aebf(0xcc)](){const _0x5700b8=a13_0x41aebf;return this[_0x5700b8(0xd1)];}[a13_0x41aebf(0x7e)](){return null;}[a13_0x41aebf(0xcf)](){return[];}[a13_0x41aebf(0x99)](){return[];}[a13_0x41aebf(0x101)](){const _0x265969=a13_0x41aebf,_0x35aa84={'IfoFm':function(_0x5283eb,_0x1568e7){return _0x5283eb!==_0x1568e7;},'AlaPg':_0x265969(0xd0)},_0x460a51=this[_0x265969(0xcf)]();return _0x460a51[_0x265969(0xbc)](_0x4a4108=>{const _0x1eba56=_0x265969;if(_0x35aa84['IfoFm'](_0x35aa84[_0x1eba56(0xae)],_0x1eba56(0x96)))return this[_0x1eba56(0xea)]['getTool'](_0x4a4108);else this[_0x1eba56(0xa0)]();});}[a13_0x41aebf(0x90)](_0x33ec4a){const _0xdd79d8=a13_0x41aebf,_0x5cd670={'sheRZ':'_stopTool'},_0xce1e05=this[_0xdd79d8(0x99)]();for(const _0x4d5c6b of _0xce1e05){const _0x33ba51=this['getState'](_0x5cd670[_0xdd79d8(0x79)])[_0x4d5c6b],_0x3c2a88='**Important:**\x20After\x20collecting\x20data,\x20call\x20tool\x20'+_0x4d5c6b+_0xdd79d8(0xa9),_0x20abcb=_0x33ba51?_0x3c2a88:'';_0x33ec4a=_0x33ec4a[_0xdd79d8(0xb0)]('{{'+_0x4d5c6b+'}}',_0x20abcb);}return _0x33ec4a;}async[a13_0x41aebf(0x78)](_0x127ad7){return null;}async[a13_0x41aebf(0xb2)](_0x34c8b8){const _0x27925f=a13_0x41aebf,_0x33707d={'iKowh':_0x27925f(0xc3)};let _0x5922fd;if(!_0x34c8b8)_0x5922fd=this[_0x27925f(0x9c)](null);else{if(_0x33707d[_0x27925f(0x93)]===_0x33707d['iKowh'])_0x5922fd=new message_util_1[(_0x27925f(0x77))](this,_0x34c8b8);else{const _0x5bfb28=_0x54e2d5[_0x27925f(0xab)](_0x1f88ff,arguments);return _0x45a00e=null,_0x5bfb28;}}const _0x292d3b=this[_0x27925f(0x99)]();for(const _0x3429f6 of _0x292d3b){this['saveState']({'_stopTool':{[_0x3429f6]:!![]}});}const _0x10aa70=await llm_runner_1[_0x27925f(0x9d)][_0x27925f(0xbe)](this['flow'],_0x5922fd);return _0x10aa70;}async[a13_0x41aebf(0xfa)](_0x4d5ac5,_0x38c07f){const _0x54bf22=a13_0x41aebf,_0x5e0d56=await this[_0x54bf22(0xea)][_0x54bf22(0xce)](_0x4d5ac5),_0x5dba51=await _0x5e0d56[_0x54bf22(0xb2)](_0x38c07f);return await this[_0x54bf22(0xea)][_0x54bf22(0x103)](this[_0x54bf22(0xb4)]),_0x5dba51;}[a13_0x41aebf(0xc7)](){const _0x440e31=a13_0x41aebf,_0x2ba63c={'CLQBE':function(_0x5536ed,_0x4d8b16){return _0x5536ed===_0x4d8b16;}};return _0x2ba63c[_0x440e31(0xa4)](this['flow'][_0x440e31(0xec)]()[_0x440e31(0xf1)],_0x440e31(0x7a));}[a13_0x41aebf(0xf4)](_0x1b08a8){const _0x577005=a13_0x41aebf,_0x4bea37={'WayTn':function(_0x3f337b,_0x4a3d78){return _0x3f337b===_0x4a3d78;},'dsTCt':_0x577005(0x8f),'LGCgk':function(_0x1edbfa,_0x5263a8){return _0x1edbfa===_0x5263a8;},'AbueT':function(_0x292b6f,_0x39b9c0){return _0x292b6f===_0x39b9c0;},'QxbfU':_0x577005(0x107)};for(const _0xd17237 of _0x1b08a8){if(_0x4bea37[_0x577005(0x10f)]===_0x4bea37[_0x577005(0x10f)]){if(_0x4bea37[_0x577005(0xe3)](_0xd17237[_0x577005(0xb4)],this['name'])){_0xd17237['isActive']=this[_0x577005(0x88)],_0xd17237['state']=this[_0x577005(0x82)];if(!this[_0x577005(0x8b)]()){if(_0x4bea37['AbueT'](_0x4bea37[_0x577005(0x97)],_0x577005(0x107)))_0xd17237[_0x577005(0xd1)]=this[_0x577005(0xd1)],_0xd17237['temperature']=this['temperature'];else{const _0x5c6cdc=this[_0x577005(0xea)][_0x577005(0xd6)](this[_0x577005(0xe6)]);return _0x5c6cdc[_0x577005(0x8a)]=0x0,_0x5c6cdc;}}}}else _0x4bea37[_0x577005(0xc5)](_0x36043e['name'],this[_0x577005(0xb4)])&&(_0x16b917['isActive']=this[_0x577005(0x88)],_0x439cf1[_0x577005(0x82)]=this[_0x577005(0x82)],!this[_0x577005(0x8b)]()&&(_0x34cc7d['modelName']=this[_0x577005(0xd1)],_0x23c788[_0x577005(0xa8)]=this[_0x577005(0xa8)]));}}[a13_0x41aebf(0x109)](_0x4d7fad){const _0x55840f=a13_0x41aebf,_0x164b25={'AzrEY':function(_0x395762,_0xfab0e7){return _0x395762!==_0xfab0e7;},'HKraC':_0x55840f(0xd9),'sNkxu':_0x55840f(0x95),'AiXTW':function(_0x1aada4,_0x41f854){return _0x1aada4===_0x41f854;}};for(const _0x1b52b0 of _0x4d7fad){_0x164b25['AzrEY'](_0x164b25['HKraC'],_0x164b25[_0x55840f(0xc1)])?_0x164b25[_0x55840f(0xde)](_0x1b52b0[_0x55840f(0xb4)],this[_0x55840f(0xb4)])&&(this[_0x55840f(0x88)]=_0x1b52b0['isActive'],this['state']=_0x1b52b0[_0x55840f(0x82)]):this[_0x55840f(0x10a)]({'_stopTool':{[_0x27445b]:!![]}});}}[a13_0x41aebf(0x8e)](){const _0x2b3657=a13_0x41aebf;return{'name':this[_0x2b3657(0xb4)],'isActive':this[_0x2b3657(0x88)],'state':this[_0x2b3657(0x82)]};}[a13_0x41aebf(0xd5)](){const _0x2e84c2=a13_0x41aebf,_0x4066cf=this[_0x2e84c2(0xea)][_0x2e84c2(0xd6)](this[_0x2e84c2(0xe6)]);return _0x4066cf[_0x2e84c2(0x8a)]=0x0,_0x4066cf;}async[a13_0x41aebf(0xaf)](_0x4a10c5,_0x1dd9f5){const _0x28b622=a13_0x41aebf,_0x33aca8={'zkCzY':function(_0x24fe87,_0x466e86){return _0x24fe87===_0x466e86;},'DLxMQ':_0x28b622(0xcb),'Kspjy':_0x28b622(0xe1),'RtvQL':_0x28b622(0xfc)},_0x1854d7=this[_0x28b622(0xea)]['getStep'](_0x4a10c5[_0x28b622(0xb4)]);return _0x33aca8[_0x28b622(0xfd)](typeof this[_0x1dd9f5[_0x28b622(0xb4)]],_0x33aca8['DLxMQ'])?await _0x1854d7[_0x1dd9f5[_0x28b622(0xb4)]](_0x1dd9f5):_0x33aca8[_0x28b622(0xb6)]!==_0x33aca8[_0x28b622(0xe5)]?_0x4a10c5:(this[_0x28b622(0xe6)]=_0x476b85,this);}[a13_0x41aebf(0xc2)](_0x19b193){const _0x17aaaa=a13_0x41aebf,_0x566a01={'PxyyT':'gNIrS'},_0x4b3a32=this[_0x17aaaa(0x99)]();for(const _0x3d5d62 of _0x4b3a32){if(_0x566a01[_0x17aaaa(0x105)]!==_0x566a01['PxyyT'])return this[_0x17aaaa(0xa8)];else this[_0x17aaaa(0x10a)]({'_stopTool':{[_0x3d5d62]:![]}});}return _0x19b193[_0x17aaaa(0xf5)]['stopTool']=!![],_0x19b193;}[a13_0x41aebf(0xf0)](){const _0x4269ee=a13_0x41aebf,_0x54ba48={'CjXfG':_0x4269ee(0xf9)};return this[_0x4269ee(0xb4)]+'|'+moment_1[_0x4269ee(0x9b)][_0x4269ee(0xb3)]()[_0x4269ee(0xfb)](_0x54ba48[_0x4269ee(0xe8)])+'|'+this[_0x4269ee(0x86)]();}['random10Digits'](){const _0x4ef89b=a13_0x41aebf,_0x632bcf={'jxXFA':function(_0x533f51,_0x1e5772){return _0x533f51+_0x1e5772;},'iycOM':function(_0x439c8c,_0x53a472){return _0x439c8c*_0x53a472;},'xZbFr':function(_0x24be6f,_0x26d0a4){return _0x24be6f-_0x26d0a4;}},_0x43e356=0x3b9aca00,_0x50a10e=0x2540be3ff;return _0x632bcf[_0x4ef89b(0x75)](Math['floor'](_0x632bcf[_0x4ef89b(0xeb)](Math[_0x4ef89b(0x89)](),_0x632bcf[_0x4ef89b(0x73)](_0x50a10e,_0x43e356)+0x1)),_0x43e356);}[a13_0x41aebf(0xef)](){const _0x22cc2f=a13_0x41aebf,_0x4a4234={'cLbgp':'gemini','wRHMo':function(_0x156b5a,_0x21c6ba){return _0x156b5a===_0x21c6ba;},'hkFwy':_0x22cc2f(0xbf),'wOJjU':_0x22cc2f(0x7d),'juDNb':function(_0x5a5d70,_0x578c74){return _0x5a5d70!==_0x578c74;},'kCcqA':_0x22cc2f(0x10e)},_0x290852=this[_0x22cc2f(0xd1)]['trim']()[_0x22cc2f(0x98)]();if(_0x290852[_0x22cc2f(0x108)](_0x4a4234[_0x22cc2f(0xd7)]))return _0x4a4234[_0x22cc2f(0x94)](_0x4a4234[_0x22cc2f(0x80)],_0x4a4234[_0x22cc2f(0x80)])?llm_file_js_1[_0x22cc2f(0x84)]['GEMINI']:_0x308169[_0x4fef39[_0x22cc2f(0x8a)]-0x1];if(_0x290852[_0x22cc2f(0x108)](_0x4a4234[_0x22cc2f(0x74)])){if(_0x4a4234[_0x22cc2f(0x10d)](_0x4a4234['kCcqA'],_0x4a4234['kCcqA'])){const _0x34b437=this[_0x22cc2f(0xcf)]();return _0x34b437[_0x22cc2f(0xbc)](_0x38cbdb=>{const _0xdd3d78=_0x22cc2f;return this[_0xdd3d78(0xea)][_0xdd3d78(0xcf)](_0x38cbdb);});}else return llm_file_js_1[_0x22cc2f(0x84)][_0x22cc2f(0xad)];}return llm_file_js_1[_0x22cc2f(0x84)][_0x22cc2f(0xf3)];}['structOutputSchema'](){return null;}}function a13_0x2b21(){const _0x59ae42=['iKowh','wRHMo','VZUyZ','wGEfI','QxbfU','toLowerCase','getStopTool','KpCom','default','onCrossing','LlmRunner','getStateAs','getTemperature','onEnter','28yIfBph','getContext','active','CLQBE','ofBgy','Step','HGnqI','temperature','\x20to\x20ensure\x20the\x20tool\x20is\x20triggered.','928081YvXDXf','apply','mergeState','OPENAI','AlaPg','callStepTool','replace','34528ZllVsU','run','utc','name','yndsK','Kspjy','nJFex','onExit','_prompt','qGrOf','oGDPb','map','SystemMessage','send','JZsLa','@langchain/core/messages','sNkxu','setStopTool','qpCYo','VKPtn','WayTn','IaPqE','isEnd','VeSnA','merge','7|5|2|3|6|1|0|8|4','function','getModel','6wrHTMU','activate','getTool','UnoKq','modelName','3133197BAVgie','VklxL','getName','eraseMemory','getMemory','cLbgp','pYxXg','oGLXJ','qpIZg','bVVSe','RygWW','moment','AiXTW','dDZMK','5440016cYqHbU','cJENm','__esModule','LGCgk','split','RtvQL','memorySpace','useModel','CjXfG','fEsYt','flow','iycOM','getSessionDoc','onResponse','__importDefault','getLLMType','genMessageId','runStatus','omit','UNSUPPORTED','writeDoc','additional_kwargs','ctType','lodash','getPrompt','YYYY-MM-DDTHH:mm:ss.SSS[Z]','runStep','format','HXQIM','zkCzY','constructor','getState','3832616ltXMiy','obtainTools','csxzo','activateByName','Plain','PxyyT','(((.+)+)+)+$','fYIlV','startsWith','readDoc','saveState','ubTrj','../utils/llm-file.js','juDNb','xGFIZ','dsTCt','fibsQ','xZbFr','wOJjU','jxXFA','search','HumanMessageEx','invokeTool','sheRZ','completed','toString','get','gpt','defineTool','setTemperature','hkFwy','1087125xkyGUF','state','sessionCompleted','LLMType','AGXXk','random10Digits','keys','isActive','random','length','isLogic','defineProperty','rKMQN','createDoc','RKPXg','amendTool','5265560YVJANh','toDate'];a13_0x2b21=function(){return _0x59ae42;};return a13_0x2b21();}exports[a13_0x41aebf(0xa6)]=Step;
package/index.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ // PicoFlow - Type definitions
2
+ export { Flow } from "./flow/flow";
3
+ export { Step } from "./flow/step";
4
+ export { LogicStep } from "./flow/logic-step";
5
+ export { EndStep } from "./flow/end-step";
6
+ export { Memory } from "./flow/memory";
7
+ export { FlowCreator } from "./flow/flow-creator";
8
+ export { HttpContentType } from "./flow/content-type";
9
+ export * from "./flow/flow-types";
10
+
11
+ export { FlowEngine } from "./services/flow-engine";
12
+
13
+ export { FlowSession } from "./session/flow-session";
14
+ export { SessionLogger } from "./session/session-logger";
15
+ export { FileSession } from "./session/file-session";
16
+ export { MongoSession } from "./session/mongo-session";
17
+ export { CosmoSession } from "./session/cosmo-session";
18
+
19
+ export { CoreConfig } from "./configs/core-config";
20
+
21
+ export { MessageUtil, MessageTypes, ToolCallMessage, ToolMessageOK, ToolMessageInfo } from "./utils/message-util";
22
+ export { ToolUtil } from "./utils/tool-util";
23
+ export { StringUtil } from "./utils/string-util";
24
+ export { Environ } from "./utils/environ";
25
+ export { LlmFile } from "./utils/llm-file";
26
+ export { K } from "./utils/constants";
27
+
28
+ export { Prompt } from "./prompt/prompt-util";
29
+ export { FlowPrompt } from "./prompt/flow-prompt";
30
+
31
+ export { StopTool } from "./decorators/stop-tool";
32
+
33
+ export { HttpClient } from "./clients/http-client";
34
+
package/index.js ADDED
@@ -0,0 +1,47 @@
1
+ // PicoFlow - Main exports
2
+ "use strict";
3
+
4
+ // Flow
5
+ module.exports.Flow = require("./flow/flow").Flow;
6
+ module.exports.Step = require("./flow/step").Step;
7
+ module.exports.LogicStep = require("./flow/logic-step").LogicStep;
8
+ module.exports.EndStep = require("./flow/end-step").EndStep;
9
+ module.exports.Memory = require("./flow/memory").Memory;
10
+ module.exports.FlowCreator = require("./flow/flow-creator").FlowCreator;
11
+ module.exports.HttpContentType = require("./flow/content-type").HttpContentType;
12
+
13
+ // Flow Types
14
+ const flowTypes = require("./flow/flow-types");
15
+ module.exports.ToolResponseType = flowTypes.ToolResponseType;
16
+
17
+ // Services
18
+ module.exports.FlowEngine = require("./services/flow-engine").FlowEngine;
19
+
20
+ // Session
21
+ module.exports.FlowSession = require("./session/flow-session").FlowSession;
22
+ module.exports.SessionLogger = require("./session/session-logger").SessionLogger;
23
+ module.exports.FileSession = require("./session/file-session").FileSession;
24
+ module.exports.MongoSession = require("./session/mongo-session").MongoSession;
25
+ module.exports.CosmoSession = require("./session/cosmo-session").CosmoSession;
26
+
27
+ // Configs
28
+ module.exports.CoreConfig = require("./configs/core-config").CoreConfig;
29
+
30
+ // Utils
31
+ module.exports.MessageUtil = require("./utils/message-util").MessageUtil;
32
+ module.exports.ToolUtil = require("./utils/tool-util").ToolUtil;
33
+ module.exports.StringUtil = require("./utils/string-util").StringUtil;
34
+ module.exports.Environ = require("./utils/environ").Environ;
35
+ module.exports.LlmFile = require("./utils/llm-file").LlmFile;
36
+ module.exports.K = require("./utils/constants").K;
37
+
38
+ // Prompt
39
+ module.exports.Prompt = require("./prompt/prompt-util").Prompt;
40
+ module.exports.FlowPrompt = require("./prompt/flow-prompt").FlowPrompt;
41
+
42
+ // Decorators
43
+ module.exports.StopTool = require("./decorators/stop-tool").StopTool;
44
+
45
+ // Clients
46
+ module.exports.HttpClient = require("./clients/http-client").HttpClient;
47
+
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@picoflow/core",
3
+ "version": "1.0.0",
4
+ "description": "PicoFlow - Agentic Flow Framework",
5
+ "author": "picoflow.io LLC",
6
+ "license": "Proprietarily Licensed",
7
+ "main": "index.js",
8
+ "types": "index.d.ts",
9
+ "files": ["**/*.js", "**/*.d.ts", "**/*.md", "!**/*.js.map"],
10
+ "keywords": ["llm", "langchain", "flow", "ai", "chatbot"],
11
+ "engines": {
12
+ "node": ">=20.0.0"
13
+ },
14
+ "peerDependencies": {
15
+ "@nestjs/common": "^10.4.7",
16
+ "@nestjs/config": "^4.0.1"
17
+ },
18
+ "dependencies": {
19
+ "openai": "^6.7.0",
20
+ "@google/genai": "^1.28.0",
21
+ "@langchain/anthropic": "1.0.0",
22
+ "@langchain/core": "1.0.6",
23
+ "@langchain/google-genai": "1.0.0",
24
+ "@langchain/ollama": "1.0.0",
25
+ "@langchain/openai": "1.0.0",
26
+ "@azure/cosmos": "^4.2.0",
27
+ "@azure/identity": "^4.5.0",
28
+ "mongodb": "^6.14.1",
29
+ "axios": "^1.7.7",
30
+ "lodash": "^4.17.21",
31
+ "zod": "^3.24.2",
32
+ "tweetnacl": "^1.0.3"
33
+ }
34
+ }
@@ -0,0 +1,6 @@
1
+ ## End Chat ##
2
+ - **Intend** Only if a user express intend to terminate conversation, call tool `end_chat`
3
+ - **Examples**
4
+ - Bye
5
+ - end conversation
6
+ - I do not want to continue
@@ -0,0 +1,3 @@
1
+ export declare class FlowPrompt {
2
+ static EndChat: string;
3
+ }
@@ -0,0 +1 @@
1
+ const a14_0x5995a5=a14_0x310f;(function(_0x41fe2d,_0x526d2b){const _0x972431=a14_0x310f,_0x263a5c=_0x41fe2d();while(!![]){try{const _0x1f8cf4=parseInt(_0x972431(0x16a))/0x1+parseInt(_0x972431(0x176))/0x2*(-parseInt(_0x972431(0x16c))/0x3)+parseInt(_0x972431(0x172))/0x4+-parseInt(_0x972431(0x165))/0x5+parseInt(_0x972431(0x169))/0x6+-parseInt(_0x972431(0x175))/0x7*(-parseInt(_0x972431(0x164))/0x8)+-parseInt(_0x972431(0x166))/0x9;if(_0x1f8cf4===_0x526d2b)break;else _0x263a5c['push'](_0x263a5c['shift']());}catch(_0x517eeb){_0x263a5c['push'](_0x263a5c['shift']());}}}(a14_0x346c,0xbc6a4));const a14_0x88d657=(function(){let _0xdf3244=!![];return function(_0x19db31,_0x4da8f1){const _0x5f5329=_0xdf3244?function(){const _0x1a5daf=a14_0x310f;if(_0x4da8f1){const _0x3daa02=_0x4da8f1[_0x1a5daf(0x171)](_0x19db31,arguments);return _0x4da8f1=null,_0x3daa02;}}:function(){};return _0xdf3244=![],_0x5f5329;};}()),a14_0x51e11e=a14_0x88d657(this,function(){const _0xfcccd8=a14_0x310f,_0x113a7b={'jtwqc':_0xfcccd8(0x16f)};return a14_0x51e11e['toString']()[_0xfcccd8(0x16e)](_0x113a7b[_0xfcccd8(0x16b)])['toString']()[_0xfcccd8(0x170)](a14_0x51e11e)[_0xfcccd8(0x16e)](_0x113a7b[_0xfcccd8(0x16b)]);});a14_0x51e11e();'use strict';function a14_0x346c(){const _0xff7ce6=['(((.+)+)+)+$','constructor','apply','5811676ydiJHa','file','EndChat','6316289FDWQNT','348302hOHSfT','Prompt','FlowPrompt','./prompt-util','8WyNKGA','4284925JwxPOJ','7658838RqVCFj','defineProperty','endchat.md','2088990CLRYgF','1169512syTfAF','jtwqc','24pSRLjr','__esModule','search'];a14_0x346c=function(){return _0xff7ce6;};return a14_0x346c();}function a14_0x310f(_0x577002,_0x4eb424){const _0x4f6965=a14_0x346c();return a14_0x310f=function(_0x51e11e,_0x88d657){_0x51e11e=_0x51e11e-0x164;let _0x346c45=_0x4f6965[_0x51e11e];return _0x346c45;},a14_0x310f(_0x577002,_0x4eb424);}Object[a14_0x5995a5(0x167)](exports,a14_0x5995a5(0x16d),{'value':!![]}),exports[a14_0x5995a5(0x178)]=void 0x0;const prompt_util_1=require(a14_0x5995a5(0x179));class FlowPrompt{}exports[a14_0x5995a5(0x178)]=FlowPrompt,FlowPrompt[a14_0x5995a5(0x174)]=prompt_util_1[a14_0x5995a5(0x177)][a14_0x5995a5(0x173)](a14_0x5995a5(0x168));
@@ -0,0 +1,7 @@
1
+ export declare class Prompt {
2
+ private static cache;
3
+ static file(filePath: string): string;
4
+ private static getCallerDir;
5
+ static set(prompt: string, key: string, value: string): string;
6
+ static replace(template: string, values: Record<string, string>): string;
7
+ }
@@ -0,0 +1 @@
1
+ const a15_0x597976=a15_0x1fb7;(function(_0x4560f7,_0x104883){const _0x3e9fec=a15_0x1fb7,_0xa15690=_0x4560f7();while(!![]){try{const _0x515418=parseInt(_0x3e9fec(0x17e))/0x1*(-parseInt(_0x3e9fec(0x192))/0x2)+parseInt(_0x3e9fec(0x173))/0x3*(parseInt(_0x3e9fec(0x175))/0x4)+-parseInt(_0x3e9fec(0x180))/0x5*(parseInt(_0x3e9fec(0x165))/0x6)+parseInt(_0x3e9fec(0x191))/0x7*(parseInt(_0x3e9fec(0x16b))/0x8)+-parseInt(_0x3e9fec(0x17a))/0x9+parseInt(_0x3e9fec(0x184))/0xa+parseInt(_0x3e9fec(0x170))/0xb;if(_0x515418===_0x104883)break;else _0xa15690['push'](_0xa15690['shift']());}catch(_0x1e545e){_0xa15690['push'](_0xa15690['shift']());}}}(a15_0x16aa,0xcf99c));const a15_0x28900e=(function(){const _0x45e913=a15_0x1fb7,_0x5ddaef={'bOUAs':_0x45e913(0x188),'vLnva':_0x45e913(0x18d),'akhPW':function(_0x116f41,_0x33923f){return _0x116f41===_0x33923f;},'zLCyP':_0x45e913(0x169)};let _0x300fca=!![];return function(_0x36132b,_0x1e2ce4){const _0x3602b4=_0x45e913,_0x1614ec={'nYeCd':_0x3602b4(0x18a),'PRBmM':_0x5ddaef['bOUAs'],'yZQSK':_0x5ddaef[_0x3602b4(0x176)]};if(_0x5ddaef[_0x3602b4(0x181)](_0x5ddaef[_0x3602b4(0x179)],_0x3602b4(0x167))){const _0x5c1a99=_0xd34a07[_0x3602b4(0x17d)](_0x3b3dae,arguments);return _0x20ed8d=null,_0x5c1a99;}else{const _0x78ce6d=_0x300fca?function(){const _0x4bef1c=_0x3602b4;if(_0x1614ec[_0x4bef1c(0x168)]===_0x4bef1c(0x182)){if(_0x193bfe){const _0x35dac2=_0x3f3d43[_0x4bef1c(0x17d)](_0xa37d68,arguments);return _0x3f9f29=null,_0x35dac2;}}else{if(_0x1e2ce4){if(_0x1614ec[_0x4bef1c(0x163)]===_0x1614ec[_0x4bef1c(0x16e)]){const _0x446b25=_0x5615f0?function(){const _0x5a0643=_0x4bef1c;if(_0x38236b){const _0x444ddb=_0x54f094[_0x5a0643(0x17d)](_0x55095b,arguments);return _0x4a0864=null,_0x444ddb;}}:function(){};return _0x201fe7=![],_0x446b25;}else{const _0x420935=_0x1e2ce4[_0x4bef1c(0x17d)](_0x36132b,arguments);return _0x1e2ce4=null,_0x420935;}}}}:function(){};return _0x300fca=![],_0x78ce6d;}};}()),a15_0x5b380d=a15_0x28900e(this,function(){const _0x11028b=a15_0x1fb7,_0x954f7e={'rbNjJ':_0x11028b(0x194)};return a15_0x5b380d[_0x11028b(0x190)]()[_0x11028b(0x186)](_0x954f7e[_0x11028b(0x171)])['toString']()[_0x11028b(0x16c)](a15_0x5b380d)['search'](_0x954f7e['rbNjJ']);});a15_0x5b380d();'use strict';function a15_0x16aa(){const _0x332975=['Inqro','has','8040230nLRBqc','default','search','path','AlUIA','replace','HBbGS','readFileSync','defineProperty','PqrRl','get','file','toString','80787BOgmoc','2ajZQOg','getFileName','(((.+)+)+)+$','PRBmM','getCallerDir','66xhJkMk','BIEsF','YQQdb','nYeCd','NRolP','utf-8','376kaNbAZ','constructor','UYaje','yZQSK','prepareStackTrace','6980281mriRlk','rbNjJ','Prompt','580302TPTqOw','mxfom','32gQfVqa','vLnva','__esModule','cache','zLCyP','9611442QlfgZc','veNOV','set','apply','941621zfqEZr','__importDefault','303910UIkIOm','akhPW'];a15_0x16aa=function(){return _0x332975;};return a15_0x16aa();}var __importDefault=this&&this[a15_0x597976(0x17f)]||function(_0x1f72fd){const _0x280c5a=a15_0x597976;return _0x1f72fd&&_0x1f72fd[_0x280c5a(0x177)]?_0x1f72fd:{'default':_0x1f72fd};};function a15_0x1fb7(_0x4546c5,_0x331710){const _0x184718=a15_0x16aa();return a15_0x1fb7=function(_0x5b380d,_0x28900e){_0x5b380d=_0x5b380d-0x163;let _0x16aa3e=_0x184718[_0x5b380d];return _0x16aa3e;},a15_0x1fb7(_0x4546c5,_0x331710);}Object[a15_0x597976(0x18c)](exports,a15_0x597976(0x177),{'value':!![]}),exports[a15_0x597976(0x172)]=void 0x0;const fs_1=require('fs'),path_1=__importDefault(require(a15_0x597976(0x187)));class Prompt{static[a15_0x597976(0x18f)](_0x3fee04){const _0x17e9c2=a15_0x597976,_0xe48fd1={'BIEsF':_0x17e9c2(0x16a)},_0x4a184a=this[_0x17e9c2(0x164)](),_0x5f0e6a=path_1['default']['resolve'](_0x4a184a,_0x3fee04);if(this[_0x17e9c2(0x178)][_0x17e9c2(0x183)](_0x5f0e6a))return this[_0x17e9c2(0x178)][_0x17e9c2(0x18e)](_0x5f0e6a);const _0x162ff0=(0x0,fs_1[_0x17e9c2(0x18b)])(_0x5f0e6a,_0xe48fd1[_0x17e9c2(0x166)]);return this['cache'][_0x17e9c2(0x17c)](_0x5f0e6a,_0x162ff0),_0x162ff0;}static['getCallerDir'](){const _0x4c06a3=a15_0x597976,_0x1a30e2={'UYaje':'Unable\x20to\x20determine\x20caller\x20file\x20path'},_0x368668=Error[_0x4c06a3(0x16f)];Error[_0x4c06a3(0x16f)]=(_0x1f1e87,_0x100f01)=>_0x100f01;const _0x27b508=new Error(),_0x23e408=_0x27b508['stack'];Error[_0x4c06a3(0x16f)]=_0x368668;const _0xc80962=_0x23e408?.[0x2]?.[_0x4c06a3(0x193)]();if(!_0xc80962)throw new Error(_0x1a30e2[_0x4c06a3(0x16d)]);return path_1[_0x4c06a3(0x185)]['dirname'](_0xc80962);}static[a15_0x597976(0x17c)](_0x16a019,_0x32aef2,_0x490b36){const _0x32e573=a15_0x597976;return _0x16a019[_0x32e573(0x189)]('{{'+_0x32aef2+'}}',_0x490b36);}static[a15_0x597976(0x189)](_0x537ada,_0x54b11c){const _0x108aec=a15_0x597976,_0x52e657={'mxfom':function(_0x4f2110,_0x53b447){return _0x4f2110===_0x53b447;},'SuNLz':'EKSzc','iOoAS':_0x108aec(0x17b)};return _0x537ada[_0x108aec(0x189)](/{{(.*?)}}/g,(_0x1234d0,_0x4dab11)=>{const _0xc44b41=_0x108aec;return _0x52e657[_0xc44b41(0x174)](_0x52e657['SuNLz'],_0x52e657['iOoAS'])?_0x49025b&&_0x2e8565[_0xc44b41(0x177)]?_0x386c77:{'default':_0x13f266}:_0x54b11c[_0x4dab11]||_0x1234d0;});}}exports[a15_0x597976(0x172)]=Prompt,Prompt[a15_0x597976(0x178)]=new Map();
@@ -0,0 +1,55 @@
1
+ import { Flow } from '../flow/flow';
2
+ import { FlowSession } from '../session/flow-session';
3
+ import { DynamicStructuredTool } from '@langchain/core/tools';
4
+ import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
5
+ import { ChatOllama } from '@langchain/ollama';
6
+ import { AzureChatOpenAI, ChatOpenAI } from '@langchain/openai';
7
+ import { ConfigService } from '@nestjs/config';
8
+ import { ChatAnthropic } from '@langchain/anthropic';
9
+ import { FastifyReply } from 'fastify';
10
+ export type LLMConstructor = new (params: LLMParams) => ChatGoogleGenerativeAI | ChatOpenAI | AzureChatOpenAI | ChatAnthropic | ChatOllama;
11
+ type FlowConstructorMap = {
12
+ [key: string]: new () => Flow;
13
+ };
14
+ type LLMParams = {
15
+ model: string;
16
+ temperature: number;
17
+ apiKey?: string;
18
+ maxRetries: number;
19
+ };
20
+ type LLMConstructorEntry = {
21
+ modelClass: LLMConstructor;
22
+ params: LLMParams;
23
+ useTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
24
+ };
25
+ export declare class FlowEngine {
26
+ private flowSession;
27
+ private flowRegistry;
28
+ private llmRegister;
29
+ constructor(config: ConfigService);
30
+ getFlowSession(): FlowSession;
31
+ run(res: FastifyReply, flowName: string, userMessage: string, sessionId: string, config?: object): Promise<void>;
32
+ private run2;
33
+ private composeHttpResponse;
34
+ private handleException;
35
+ endChat(sessionId: string): Promise<{
36
+ false: boolean;
37
+ message: string;
38
+ success?: undefined;
39
+ session?: undefined;
40
+ } | {
41
+ success: boolean;
42
+ session: string;
43
+ false?: undefined;
44
+ message?: undefined;
45
+ }>;
46
+ registerFlows(flowSpecs: FlowConstructorMap): Promise<void>;
47
+ getFlow(flowName: string): new () => Flow;
48
+ registerModels(modelSpecs: Record<string, LLMConstructorEntry>): void;
49
+ registerModel(llmClass: LLMConstructor, params: LLMParams): void;
50
+ getModel(modelName: string): LLMConstructorEntry;
51
+ getModelName(modelName?: string): string;
52
+ static DefaultUseTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
53
+ static OllamaUseTool: (llm: any, tools?: DynamicStructuredTool[]) => any;
54
+ }
55
+ export {};