vome-core 0.0.82 → 0.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/config/plugin-dev.js +1 -1
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/index.js +1 -1
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/mitt.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +100 -0
- package/dist/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/dist/src/agent/constants.d.ts +7 -0
- package/dist/src/agent/guards.d.ts +3 -0
- package/dist/src/agent/index.d.ts +4 -0
- package/dist/src/agent/protocol.d.ts +33 -0
- package/dist/src/agent/types.d.ts +60 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +10 -2
package/dist/shared/excel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x12471c=_0x928d;(function(_0x7c519b,_0x3f19cf){const _0x2aa807=_0x928d,_0x18b499=_0x7c519b();while(!![]){try{const _0x2c27b0=parseInt(_0x2aa807(0x1bf))/0x1+parseInt(_0x2aa807(0x1cf))/0x2*(-parseInt(_0x2aa807(0x1c3))/0x3)+parseInt(_0x2aa807(0x1cc))/0x4+-parseInt(_0x2aa807(0x1c8))/0x5+parseInt(_0x2aa807(0x1c4))/0x6+parseInt(_0x2aa807(0x1c2))/0x7*(-parseInt(_0x2aa807(0x1c9))/0x8)+parseInt(_0x2aa807(0x1c6))/0x9;if(_0x2c27b0===_0x3f19cf)break;else _0x18b499['push'](_0x18b499['shift']());}catch(_0x3a0bdf){_0x18b499['push'](_0x18b499['shift']());}}}(_0x496f,0x7735e));import*as _0x1b9797 from'xlsx';export const IMPORT_SKIP_FIELDS=['id',_0x12471c(0x1cd),_0x12471c(0x1be),'deletedAt','tenantId'];function _0x928d(_0x39c088,_0x5671c9){_0x39c088=_0x39c088-0x1ba;const _0x496fc5=_0x496f();let _0x928de6=_0x496fc5[_0x39c088];if(_0x928d['zLwdSl']===undefined){var _0x3f52b2=function(_0x52ea69){const _0x530a12='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b9797='',_0x4d3b8d='';for(let _0x30c65b=0x0,_0x3bbbee,_0x2cf6f1,_0x22d36f=0x0;_0x2cf6f1=_0x52ea69['charAt'](_0x22d36f++);~_0x2cf6f1&&(_0x3bbbee=_0x30c65b%0x4?_0x3bbbee*0x40+_0x2cf6f1:_0x2cf6f1,_0x30c65b++%0x4)?_0x1b9797+=String['fromCharCode'](0xff&_0x3bbbee>>(-0x2*_0x30c65b&0x6)):0x0){_0x2cf6f1=_0x530a12['indexOf'](_0x2cf6f1);}for(let _0x5e512c=0x0,_0x532e42=_0x1b9797['length'];_0x5e512c<_0x532e42;_0x5e512c++){_0x4d3b8d+='%'+('00'+_0x1b9797['charCodeAt'](_0x5e512c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d3b8d);};_0x928d['CdVfce']=_0x3f52b2,_0x928d['IwuzDd']={},_0x928d['zLwdSl']=!![];}const _0x36058d=_0x496fc5[0x0],_0x30da4f=_0x39c088+_0x36058d,_0x1625e9=_0x928d['IwuzDd'][_0x30da4f];return!_0x1625e9?(_0x928de6=_0x928d['CdVfce'](_0x928de6),_0x928d['IwuzDd'][_0x30da4f]=_0x928de6):_0x928de6=_0x1625e9,_0x928de6;}export function isImportSkipField(_0x4d3b8d){const _0x5c0695=_0x12471c;return IMPORT_SKIP_FIELDS[_0x5c0695(0x1d3)](_0x4d3b8d);}export function buildExcelBuffer(_0x30c65b,_0x3bbbee,_0x2cf6f1){const _0x1ff6aa=_0x12471c,_0x22d36f=_0x30c65b[_0x1ff6aa(0x1c0)](_0x11dabe=>_0x11dabe['label']||_0x11dabe['prop']),_0x5e512c=_0x3bbbee[_0x1ff6aa(0x1c0)](_0x3a5878=>_0x30c65b[_0x1ff6aa(0x1c0)](_0x52a7ec=>{const _0x4c006b=_0x1ff6aa;if(_0x2cf6f1)return _0x2cf6f1(_0x52a7ec[_0x4c006b(0x1cb)],_0x3a5878);const _0x33c5ed=_0x3a5878[_0x52a7ec[_0x4c006b(0x1cb)]];if(_0x33c5ed==null)return'';return String(_0x33c5ed);})),_0x532e42=_0x1b9797[_0x1ff6aa(0x1bb)]['aoa_to_sheet']([_0x22d36f,..._0x5e512c]),_0x3d7a16=_0x1b9797[_0x1ff6aa(0x1bb)][_0x1ff6aa(0x1d5)]();return _0x1b9797[_0x1ff6aa(0x1bb)][_0x1ff6aa(0x1bd)](_0x3d7a16,_0x532e42,'Sheet1'),_0x1b9797[_0x1ff6aa(0x1d1)](_0x3d7a16,{'bookType':_0x1ff6aa(0x1d2),'type':_0x1ff6aa(0x1bc)});}export function buildImportTemplateBuffer(_0x1a8017){return buildExcelBuffer(_0x1a8017,[]);}export function parseExcelBuffer(_0x330073,_0x279cc7){const _0x597560=_0x12471c,_0xa3d6e4=_0x1b9797['read'](_0x330073,{'type':_0x597560(0x1bc),'cellDates':!![]}),_0x3f967f=_0xa3d6e4['SheetNames'][0x0];if(!_0x3f967f)return[];const _0x59d2a3=_0xa3d6e4[_0x597560(0x1d0)][_0x3f967f];if(!_0x59d2a3)return[];const _0x308fe8=_0x1b9797[_0x597560(0x1bb)]['sheet_to_json'](_0x59d2a3,{'header':0x1,'defval':'','raw':![]});if(!_0x308fe8[_0x597560(0x1ce)])return[];const _0x1be52a=(_0x308fe8[0x0]||[])[_0x597560(0x1c0)](_0x32990b=>String(_0x32990b??'')[_0x597560(0x1d4)]()),_0x4fb085=new Map();if(_0x279cc7?.[_0x597560(0x1ce)])for(const _0x2a02eb of _0x279cc7){_0x4fb085[_0x597560(0x1c7)](_0x2a02eb['label'][_0x597560(0x1d4)](),_0x2a02eb[_0x597560(0x1cb)]),_0x4fb085[_0x597560(0x1c7)](_0x2a02eb[_0x597560(0x1cb)],_0x2a02eb[_0x597560(0x1cb)]);}const _0x6ccf2a=_0x1be52a[_0x597560(0x1c0)](_0x7bbcc5=>{const _0x540292=_0x597560;if(!_0x7bbcc5)return'';return _0x4fb085[_0x540292(0x1c5)](_0x7bbcc5)||_0x7bbcc5;}),_0x30f77d=[];for(let _0x48abdc=0x1;_0x48abdc<_0x308fe8['length'];_0x48abdc++){const _0x114196=_0x308fe8[_0x48abdc]||[],_0x3415b2={};let _0x14579e=!![];for(let _0x56cbfe=0x0;_0x56cbfe<_0x6ccf2a[_0x597560(0x1ce)];_0x56cbfe++){const _0x16fb4f=_0x6ccf2a[_0x56cbfe];if(!_0x16fb4f)continue;let _0x3b2510=_0x114196[_0x56cbfe];if(_0x3b2510==null||_0x3b2510===''){_0x3415b2[_0x16fb4f]=_0x3b2510==null?null:'';continue;}_0x14579e=![],typeof _0x3b2510==='string'?_0x3415b2[_0x16fb4f]=_0x3b2510[_0x597560(0x1d4)]():_0x3415b2[_0x16fb4f]=_0x3b2510;}if(!_0x14579e)_0x30f77d[_0x597560(0x1ba)](_0x3415b2);}return _0x30f77d;}export function excelFilename(_0x34cbf6){const _0x2a1747=_0x12471c;return _0x34cbf6['endsWith'](_0x2a1747(0x1ca))?_0x34cbf6:_0x34cbf6+_0x2a1747(0x1ca);}function _0x496f(){const _0x59c2cb=['D3jPDgu','EgXZEa','Aw5JBhvKzxm','DhjPBq','yM9VA19UzxC','ChvZAa','DxrPBhm','yxjYyxK','yM9VA19HChbLBMrFC2HLzxq','DxbKyxrLvgLTzq','mte0ntC2wNvLDvjW','BwfW','yxbWBgLJyxrPB24VDM5KlM9Wzw54BwXMB3jTyxrZlw9MzMLJzwrVy3vTzw50lNnWCMvHzhnOzwv0BwWUC2HLzxq','mJG4nJaYm0j6DNHoDa','nduWnZC3zKj6wNPT','mJCZode2tLjIEhn3','z2v0','mtqZnty5ntniqurKr04','C2v0','mJe4mdCZmfv1sMjdrq','ohj1rgDozW','lNHSC3G','ChjVCa','nZi5mZeYvePOv3DI','y3jLyxrLvgLTzq','BgvUz3rO','ognnAKf3vW','u2HLzxrZ'];_0x496f=function(){return _0x59c2cb;};return _0x496f();}export function excelResponseHeaders(_0x283adb){const _0x5b5f91=_0x12471c,_0x58071e=excelFilename(_0x283adb);return{'Content-Type':_0x5b5f91(0x1c1),'Content-Disposition':'attachment;\x20filename*=UTF-8\x27\x27'+encodeURIComponent(_0x58071e)};}
|
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x10dd64,_0x365b84){var _0x5dae4e=_0x1377,_0xde86e0=_0x10dd64();while(!![]){try{var _0x20cfb9=-parseInt(_0x5dae4e(0x146))/0x1*(parseInt(_0x5dae4e(0x140))/0x2)+parseInt(_0x5dae4e(0x147))/0x3+-parseInt(_0x5dae4e(0x14a))/0x4*(-parseInt(_0x5dae4e(0x13f))/0x5)+-parseInt(_0x5dae4e(0x145))/0x6*(-parseInt(_0x5dae4e(0x14b))/0x7)+parseInt(_0x5dae4e(0x148))/0x8*(parseInt(_0x5dae4e(0x142))/0x9)+-parseInt(_0x5dae4e(0x144))/0xa*(-parseInt(_0x5dae4e(0x149))/0xb)+parseInt(_0x5dae4e(0x143))/0xc*(-parseInt(_0x5dae4e(0x141))/0xd);if(_0x20cfb9===_0x365b84)break;else _0xde86e0['push'](_0xde86e0['shift']());}catch(_0x3ea58f){_0xde86e0['push'](_0xde86e0['shift']());}}}(_0xc29b,0xe7fb1));export{merge}from'../comm/merge';export{deepTree,flattenTree}from'./tree';export{RES_CODE}from'../routing/base';function _0xc29b(){var _0x54c24a=['mtu4mdu3ntDLruLRzLe','mJq3nZC0mg5QvM9nuW','mJa5mJK0neDTCuXirG','nvDkvwLVDa','nJa4BhnRuuDs','ntjmqKL0qxO','ndKYmJu1mfjrEMLZsa','ndu1nJaYofzIuLLYAG','mtbNrLvrDgu','mtjiEfnyq2S','ndK2m2zSEgPWAa','nJG4mJq1Ag9XyMzS','mtzJvffjDNy'];_0xc29b=function(){return _0x54c24a;};return _0xc29b();}export{buildExcelBuffer,buildImportTemplateBuffer,parseExcelBuffer,excelFilename,excelResponseHeaders,IMPORT_SKIP_FIELDS,isImportSkipField}from'./excel';function _0x1377(_0x4b3bea,_0x4802ea){_0x4b3bea=_0x4b3bea-0x13f;var _0xc29b4a=_0xc29b();var _0x1377ce=_0xc29b4a[_0x4b3bea];if(_0x1377['cBfOcp']===undefined){var _0x18bc98=function(_0x3fe11e){var _0x37e46f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5a1716='',_0x9d5d51='';for(var _0x3571bd=0x0,_0x3f3ac2,_0x3eb0fd,_0x4b2228=0x0;_0x3eb0fd=_0x3fe11e['charAt'](_0x4b2228++);~_0x3eb0fd&&(_0x3f3ac2=_0x3571bd%0x4?_0x3f3ac2*0x40+_0x3eb0fd:_0x3eb0fd,_0x3571bd++%0x4)?_0x5a1716+=String['fromCharCode'](0xff&_0x3f3ac2>>(-0x2*_0x3571bd&0x6)):0x0){_0x3eb0fd=_0x37e46f['indexOf'](_0x3eb0fd);}for(var _0x53bd18=0x0,_0x3c2d5d=_0x5a1716['length'];_0x53bd18<_0x3c2d5d;_0x53bd18++){_0x9d5d51+='%'+('00'+_0x5a1716['charCodeAt'](_0x53bd18)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x9d5d51);};_0x1377['gpXChM']=_0x18bc98,_0x1377['DIGScO']={},_0x1377['cBfOcp']=!![];}var _0xc0533b=_0xc29b4a[0x0],_0x4243e2=_0x4b3bea+_0xc0533b,_0x4e03c4=_0x1377['DIGScO'][_0x4243e2];return!_0x4e03c4?(_0x1377ce=_0x1377['gpXChM'](_0x1377ce),_0x1377['DIGScO'][_0x4243e2]=_0x1377ce):_0x1377ce=_0x4e03c4,_0x1377ce;}export{flattenLocale,unflattenLocale,hashLocaleJson,extractJsonObject}from'./locale-json';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3da17c,_0x158a09){const _0x561b5f=_0x5ad8,_0x4eceb5=_0x3da17c();while(!![]){try{const _0x1be0b3=-parseInt(_0x561b5f(0x125))/0x1*(-parseInt(_0x561b5f(0x11b))/0x2)+-parseInt(_0x561b5f(0x127))/0x3+parseInt(_0x561b5f(0x119))/0x4*(parseInt(_0x561b5f(0x123))/0x5)+parseInt(_0x561b5f(0x12e))/0x6+-parseInt(_0x561b5f(0x12d))/0x7+-parseInt(_0x561b5f(0x11e))/0x8*(parseInt(_0x561b5f(0x11a))/0x9)+parseInt(_0x561b5f(0x116))/0xa*(parseInt(_0x561b5f(0x10d))/0xb);if(_0x1be0b3===_0x158a09)break;else _0x4eceb5['push'](_0x4eceb5['shift']());}catch(_0x45c32e){_0x4eceb5['push'](_0x4eceb5['shift']());}}}(_0x96ab,0x80a8c));import{createHash}from'node:crypto';export function flattenLocale(_0x4e2d96,_0x4d7307=''){const _0x48ce73=_0x5ad8,_0x58a633={};for(const [_0x2e5583,_0x2e1890]of Object[_0x48ce73(0x11c)](_0x4e2d96)){const _0x32e415=_0x4d7307?_0x4d7307+'.'+_0x2e5583:_0x2e5583;if(_0x2e1890!=null&&typeof _0x2e1890==='object'&&!Array[_0x48ce73(0x121)](_0x2e1890))Object[_0x48ce73(0x12c)](_0x58a633,flattenLocale(_0x2e1890,_0x32e415));else{if(typeof _0x2e1890===_0x48ce73(0x118))_0x58a633[_0x32e415]=_0x2e1890;else _0x2e1890!=null&&(_0x58a633[_0x32e415]=String(_0x2e1890));}}return _0x58a633;}export function unflattenLocale(_0x55ad2d){const _0x3d275d=_0x5ad8,_0x2a5f88={};for(const [_0x1e60d1,_0x117ed1]of Object[_0x3d275d(0x11c)](_0x55ad2d)){const _0x214f1d=_0x1e60d1[_0x3d275d(0x115)]('.')[_0x3d275d(0x114)](Boolean);if(!_0x214f1d[_0x3d275d(0x111)])continue;let _0x26dbb7=_0x2a5f88;for(let _0x300c65=0x0;_0x300c65<_0x214f1d['length']-0x1;_0x300c65++){const _0x194b4d=_0x214f1d[_0x300c65],_0x5719d3=_0x26dbb7[_0x194b4d];(!_0x5719d3||typeof _0x5719d3!==_0x3d275d(0x124)||Array[_0x3d275d(0x121)](_0x5719d3))&&(_0x26dbb7[_0x194b4d]={}),_0x26dbb7=_0x26dbb7[_0x194b4d];}_0x26dbb7[_0x214f1d[_0x214f1d['length']-0x1]]=_0x117ed1;}return _0x2a5f88;}export function hashLocaleJson(_0x3a5763){const _0x59f296=_0x5ad8,_0x4cb64b=flattenLocale(_0x3a5763),_0x3f8c48=Object[_0x59f296(0x110)](_0x4cb64b)[_0x59f296(0x12a)](),_0x224bf9=_0x3f8c48[_0x59f296(0x10c)](_0x364ce4=>_0x364ce4+'='+_0x4cb64b[_0x364ce4])[_0x59f296(0x12b)]('\x0a');return createHash(_0x59f296(0x113))[_0x59f296(0x128)](_0x224bf9)[_0x59f296(0x122)](_0x59f296(0x117))[_0x59f296(0x129)](0x0,0x20);}export function extractJsonObject(_0xd85aa0){const _0x16c910=_0x5ad8,_0x399431=String(_0xd85aa0||'')[_0x16c910(0x11d)]();if(!_0x399431)throw new Error(_0x16c910(0x126));try{const _0x15d1c7=JSON[_0x16c910(0x112)](_0x399431);if(_0x15d1c7&&typeof _0x15d1c7===_0x16c910(0x124)&&!Array['isArray'](_0x15d1c7))return _0x15d1c7;}catch{}const _0x3faec1=_0x399431[_0x16c910(0x10e)](/```(?:json)?\s*([\s\S]*?)```/i);if(_0x3faec1?.[0x1]){const _0x1a65f3=JSON['parse'](_0x3faec1[0x1][_0x16c910(0x11d)]());if(_0x1a65f3&&typeof _0x1a65f3===_0x16c910(0x124)&&!Array[_0x16c910(0x121)](_0x1a65f3))return _0x1a65f3;}const _0x1509d7=_0x399431[_0x16c910(0x10f)]('{'),_0x19a086=_0x399431[_0x16c910(0x11f)]('}');if(_0x1509d7>=0x0&&_0x19a086>_0x1509d7){const _0x260d91=JSON[_0x16c910(0x112)](_0x399431['slice'](_0x1509d7,_0x19a086+0x1));if(_0x260d91&&typeof _0x260d91===_0x16c910(0x124)&&!Array[_0x16c910(0x121)](_0x260d91))return _0x260d91;}throw new Error(_0x16c910(0x120));}function _0x5ad8(_0x225f50,_0x182255){_0x225f50=_0x225f50-0x10c;const _0x96abc1=_0x96ab();let _0x5ad84c=_0x96abc1[_0x225f50];if(_0x5ad8['VscEDU']===undefined){var _0x4049d2=function(_0xbcf0be){const _0x25236a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4e2d96='',_0x4d7307='';for(let _0x58a633=0x0,_0x2e5583,_0x2e1890,_0x32e415=0x0;_0x2e1890=_0xbcf0be['charAt'](_0x32e415++);~_0x2e1890&&(_0x2e5583=_0x58a633%0x4?_0x2e5583*0x40+_0x2e1890:_0x2e1890,_0x58a633++%0x4)?_0x4e2d96+=String['fromCharCode'](0xff&_0x2e5583>>(-0x2*_0x58a633&0x6)):0x0){_0x2e1890=_0x25236a['indexOf'](_0x2e1890);}for(let _0x55ad2d=0x0,_0x2a5f88=_0x4e2d96['length'];_0x55ad2d<_0x2a5f88;_0x55ad2d++){_0x4d7307+='%'+('00'+_0x4e2d96['charCodeAt'](_0x55ad2d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d7307);};_0x5ad8['dnmxZi']=_0x4049d2,_0x5ad8['zUGaiY']={},_0x5ad8['VscEDU']=!![];}const _0x1cf4aa=_0x96abc1[0x0],_0x3e322c=_0x225f50+_0x1cf4aa,_0x56eb08=_0x5ad8['zUGaiY'][_0x3e322c];return!_0x56eb08?(_0x5ad84c=_0x5ad8['dnmxZi'](_0x5ad84c),_0x5ad8['zUGaiY'][_0x3e322c]=_0x5ad84c):_0x5ad84c=_0x56eb08,_0x5ad84c;}function _0x96ab(){const _0x4456b4=['C3rYAw5N','mJHUvxz4BuO','mtuWmdnvzgDeC2W','mZm0EwrgyMvd','zw50CMLLCW','DhjPBq','ndCYogffuMj6rG','BgfZDeLUzgv4t2y','quKG6l+u5zUE5PEG5Rov6kEJ5P6q5lI6iePtt04G5A+56lgH','AxnbCNjHEq','zgLNzxn0','nJaZmZGWswTkzuTY','B2jQzwn0','mJa0ouXty2zLCq','quKG6l+u5zUE56M65yAf5A65','odG2mZK1u2nYuKzi','DxbKyxrL','C2XPy2u','C29YDa','AM9PBG','yxnZAwDU','mteXmdq1mLzite5mua','mtG0nZaXmg1bz093yW','BwfW','mZi0mtGXq3byz21A','Bwf0y2G','Aw5KzxHpzG','A2v5CW','BgvUz3rO','CgfYC2u','C2HHmJu2','zMLSDgvY','C3bSAxq','mtyWBxHwrvvR','Agv4'];_0x96ab=function(){return _0x4456b4;};return _0x96ab();}
|
package/dist/shared/tree.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0xee048c=_0x145e;function _0x3e30(){const _0x572a7e=['mtbrwNrUDfO','y2HPBgrYzw4','ndmZodm4m25vvMrwuW','mti1nZKXmJHqrwPjr0i','mty1mdq4mhP5t2rVEa','nLjRsxvuwq','ChvZAa','C29YDa','zgvZyW','B3jKzxjoDw0','ndaWmdC3nKHiyNnIva','mvHdy3rmwq','BgvUz3rO','z2v0','yxnJ','nJi0nZuXmKHdzxLLAG','mZyZntmXmLnxrNPltq','AgfZ','mZi3mJK3mefmCe9ctq'];_0x3e30=function(){return _0x572a7e;};return _0x3e30();}(function(_0x3e07ff,_0xe7d801){const _0x9a0882=_0x145e,_0xaa6eb4=_0x3e07ff();while(!![]){try{const _0xb400cd=-parseInt(_0x9a0882(0x14f))/0x1*(parseInt(_0x9a0882(0x156))/0x2)+-parseInt(_0x9a0882(0x149))/0x3*(parseInt(_0x9a0882(0x154))/0x4)+-parseInt(_0x9a0882(0x157))/0x5*(-parseInt(_0x9a0882(0x14e))/0x6)+parseInt(_0x9a0882(0x159))/0x7+parseInt(_0x9a0882(0x15a))/0x8+parseInt(_0x9a0882(0x153))/0x9+parseInt(_0x9a0882(0x15b))/0xa;if(_0xb400cd===_0xe7d801)break;else _0xaa6eb4['push'](_0xaa6eb4['shift']());}catch(_0x43dc32){_0xaa6eb4['push'](_0xaa6eb4['shift']());}}}(_0x3e30,0xe340b));function _0x145e(_0x39f3b0,_0x322161){_0x39f3b0=_0x39f3b0-0x149;const _0x3e3099=_0x3e30();let _0x145e03=_0x3e3099[_0x39f3b0];if(_0x145e['tYuJkq']===undefined){var _0x14cc98=function(_0x46c2c3){const _0x5b8b3d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x147c68='',_0x53f28c='';for(let _0x1673af=0x0,_0x978608,_0x1c6b0d,_0x27ee92=0x0;_0x1c6b0d=_0x46c2c3['charAt'](_0x27ee92++);~_0x1c6b0d&&(_0x978608=_0x1673af%0x4?_0x978608*0x40+_0x1c6b0d:_0x1c6b0d,_0x1673af++%0x4)?_0x147c68+=String['fromCharCode'](0xff&_0x978608>>(-0x2*_0x1673af&0x6)):0x0){_0x1c6b0d=_0x5b8b3d['indexOf'](_0x1c6b0d);}for(let _0x5301df=0x0,_0x30cc08=_0x147c68['length'];_0x5301df<_0x30cc08;_0x5301df++){_0x53f28c+='%'+('00'+_0x147c68['charCodeAt'](_0x5301df)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x53f28c);};_0x145e['HcSzCf']=_0x14cc98,_0x145e['ddQFox']={},_0x145e['tYuJkq']=!![];}const _0x385c55=_0x3e3099[0x0],_0x190b97=_0x39f3b0+_0x385c55,_0x52f686=_0x145e['ddQFox'][_0x190b97];return!_0x52f686?(_0x145e03=_0x145e['HcSzCf'](_0x145e03),_0x145e['ddQFox'][_0x190b97]=_0x145e03):_0x145e03=_0x52f686,_0x145e03;}export function deepTree(_0x147c68,_0x53f28c=_0xee048c(0x152)){const _0xb2bdb9=_0xee048c,_0x1673af=new Map();for(const _0x27ee92 of _0x147c68){if(_0x27ee92['id']==null)continue;_0x1673af['set'](_0x27ee92['id'],{..._0x27ee92,'children':[]});}const _0x978608=[];for(const _0x5301df of _0x1673af['values']()){const _0x30cc08=_0x5301df['parentId'];_0x30cc08!=null&&_0x30cc08!==''&&_0x1673af['has'](_0x30cc08)?_0x1673af[_0xb2bdb9(0x151)](_0x30cc08)[_0xb2bdb9(0x158)][_0xb2bdb9(0x14a)](_0x5301df):_0x978608[_0xb2bdb9(0x14a)](_0x5301df);}const _0x1c6b0d=_0x17fabe=>{const _0x117c21=_0xb2bdb9;_0x17fabe[_0x117c21(0x14b)]((_0x4ed29b,_0x5bba99)=>{const _0x184f0a=_0x117c21,_0x49a5d=_0x4ed29b[_0x184f0a(0x14d)]??0x0,_0x495733=_0x5bba99[_0x184f0a(0x14d)]??0x0,_0x305321=_0x53f28c===_0x184f0a(0x14c)?_0x495733-_0x49a5d:_0x49a5d-_0x495733;return _0x305321||Number(_0x4ed29b['id'])-Number(_0x5bba99['id']);});for(const _0x579a12 of _0x17fabe)if(_0x579a12[_0x117c21(0x158)]?.[_0x117c21(0x150)])_0x1c6b0d(_0x579a12[_0x117c21(0x158)]);};return _0x1c6b0d(_0x978608),_0x978608;}export function flattenTree(_0x4f3e8,_0x51c9ad,_0x262372=0x0,_0x372307=[]){const _0x2179a5=_0xee048c;for(const _0x381b3e of _0x4f3e8){const _0x2b2618=_0x381b3e['children']||[];_0x372307[_0x2179a5(0x14a)]({..._0x381b3e,'depth':_0x262372,'hasChildren':_0x2b2618[_0x2179a5(0x150)]>0x0});if(_0x2b2618[_0x2179a5(0x150)]&&_0x51c9ad[_0x2179a5(0x155)](_0x381b3e['id']))flattenTree(_0x2b2618,_0x51c9ad,_0x262372+0x1,_0x372307);}return _0x372307;}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AGENT_DEFAULT_TOP_K = 5;
|
|
2
|
+
export declare const AGENT_DEFAULT_HOST = "http://127.0.0.1:3000";
|
|
3
|
+
export declare const AGENT_MANIFEST_FILE = ".vome-agent.json";
|
|
4
|
+
/** 与平台 BaseController 成功码一致 */
|
|
5
|
+
export declare const AGENT_API_SUCCESS = 1000;
|
|
6
|
+
export declare const AGENT_KB_KINDS: readonly ["rule", "context", "adoption", "design"];
|
|
7
|
+
export declare const AGENT_BILLING_MODES: readonly ["token", "request", "image", "embed", "mixed"];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentAuthIssuePayload, AgentKbItem, AgentPromptPart, AgentTaskCreatePayload, AgentTaskRunResult } from './types';
|
|
2
|
+
export type AgentApi = {
|
|
3
|
+
auth: {
|
|
4
|
+
issue: (payload: AgentAuthIssuePayload) => Promise<{
|
|
5
|
+
token: string;
|
|
6
|
+
record?: Record<string, unknown>;
|
|
7
|
+
session?: Record<string, unknown>;
|
|
8
|
+
}>;
|
|
9
|
+
heartbeat: (sessionId: number) => Promise<boolean>;
|
|
10
|
+
closeSession: (sessionId: number) => Promise<boolean>;
|
|
11
|
+
me: () => Promise<{
|
|
12
|
+
userId: number | string | null;
|
|
13
|
+
projectId: number | string | null;
|
|
14
|
+
agentTokenId?: number | string | null;
|
|
15
|
+
agentSessionId?: number | string | null;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
kb: {
|
|
19
|
+
search: (payload: {
|
|
20
|
+
projectId?: number;
|
|
21
|
+
query?: string;
|
|
22
|
+
topK?: number;
|
|
23
|
+
kinds?: string[];
|
|
24
|
+
}) => Promise<AgentKbItem[]>;
|
|
25
|
+
adoptionWriteback: (payload: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
26
|
+
};
|
|
27
|
+
gen: {
|
|
28
|
+
taskCreate: (payload: AgentTaskCreatePayload) => Promise<Record<string, unknown>>;
|
|
29
|
+
taskInfo: (id: number) => Promise<Record<string, unknown> | null>;
|
|
30
|
+
taskRun: (payload: AgentTaskCreatePayload) => Promise<AgentTaskRunResult>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare function buildPromptSections(parts: AgentPromptPart[]): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type AgentTargetSide = 'admin' | 'web' | 'uniapp' | 'service' | 'common';
|
|
2
|
+
export type AgentSceneType = 'page' | 'crud' | 'schema' | 'style' | 'component' | 'backend';
|
|
3
|
+
export type AgentTaskStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
4
|
+
export type AgentPromptPart = {
|
|
5
|
+
title: string;
|
|
6
|
+
content: string;
|
|
7
|
+
};
|
|
8
|
+
export type AgentContextPayload = {
|
|
9
|
+
projectId?: number;
|
|
10
|
+
targetSide?: AgentTargetSide;
|
|
11
|
+
sceneType?: AgentSceneType;
|
|
12
|
+
cwd?: string;
|
|
13
|
+
files?: string[];
|
|
14
|
+
extra?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
export type AgentKbItem = {
|
|
17
|
+
id?: number;
|
|
18
|
+
title?: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
content?: string;
|
|
21
|
+
kind?: string;
|
|
22
|
+
targetSide?: AgentTargetSide | string;
|
|
23
|
+
sceneType?: AgentSceneType | string;
|
|
24
|
+
};
|
|
25
|
+
export type AgentTaskCreatePayload = {
|
|
26
|
+
projectId: number;
|
|
27
|
+
userId: number;
|
|
28
|
+
modelCode: string;
|
|
29
|
+
capability?: string;
|
|
30
|
+
sceneType?: AgentSceneType;
|
|
31
|
+
targetSide?: AgentTargetSide;
|
|
32
|
+
title?: string;
|
|
33
|
+
userPrompt: string;
|
|
34
|
+
normalizedPrompt?: string;
|
|
35
|
+
contextPayload?: Record<string, unknown>;
|
|
36
|
+
kbPayload?: Record<string, unknown>;
|
|
37
|
+
input?: Record<string, unknown>;
|
|
38
|
+
options?: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
export type AgentTaskRunResult = {
|
|
41
|
+
taskId: number;
|
|
42
|
+
resultId?: number;
|
|
43
|
+
ok: boolean;
|
|
44
|
+
fee?: number;
|
|
45
|
+
usage?: Record<string, unknown> | null;
|
|
46
|
+
data?: Record<string, unknown> | null;
|
|
47
|
+
error?: {
|
|
48
|
+
code?: string;
|
|
49
|
+
message?: string;
|
|
50
|
+
} | null;
|
|
51
|
+
};
|
|
52
|
+
export type AgentAuthIssuePayload = {
|
|
53
|
+
projectId: number;
|
|
54
|
+
deviceId: string;
|
|
55
|
+
deviceName?: string;
|
|
56
|
+
deviceType?: string;
|
|
57
|
+
os?: string;
|
|
58
|
+
cwd?: string;
|
|
59
|
+
agentVersion?: string;
|
|
60
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
export { merge, deepTree, flattenTree, RES_CODE } from './shared';
|
|
8
8
|
export { flattenLocale, unflattenLocale, hashLocaleJson, extractJsonObject, } from './shared';
|
|
9
9
|
export type { Loose, PageQuery, PagePagination, PageResult, ResCode, ApiSuccess, ApiFail, ApiResult, } from './shared';
|
|
10
|
+
export * from './agent';
|
|
10
11
|
/** 与 package.json version 同步 */
|
|
11
12
|
export declare const version: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vome-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"description": "Vome framework — shared + Bun/Elysia server + Vue admin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
"import": "./dist/ai/index.js",
|
|
28
28
|
"default": "./dist/ai/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./agent": {
|
|
31
|
+
"types": "./dist/agent/index.d.ts",
|
|
32
|
+
"import": "./dist/agent/index.js",
|
|
33
|
+
"default": "./dist/agent/index.js"
|
|
34
|
+
},
|
|
30
35
|
"./admin": {
|
|
31
36
|
"types": "./dist/admin/index.d.ts",
|
|
32
37
|
"import": "./dist/admin/index.js",
|
|
@@ -70,6 +75,9 @@
|
|
|
70
75
|
"admin": [
|
|
71
76
|
"./dist/admin/index.d.ts"
|
|
72
77
|
],
|
|
78
|
+
"agent": [
|
|
79
|
+
"./dist/agent/index.d.ts"
|
|
80
|
+
],
|
|
73
81
|
"admin/service": [
|
|
74
82
|
"./dist/admin/service/index.d.ts"
|
|
75
83
|
],
|
|
@@ -92,7 +100,7 @@
|
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
"scripts": {
|
|
95
|
-
"build:server": "bun build ./src/index.ts ./src/server/index.ts ./src/ai/index.ts --outdir ./dist --target bun --format esm --external elysia --external reflect-metadata --external drizzle-orm --external drizzle-zod --external @elysiajs/openapi --external @bogeychan/elysia-logger --external pino --external pino-pretty && tsc -p tsconfig.build.json && printf \"%s\\n\" \"export * from './src/index'\" > dist/index.d.ts && mkdir -p dist/server && printf \"%s\\n\" \"export * from '../src/server/index'\" > dist/server/index.d.ts && printf \"%s\\n\" \"export * from './src/ai/index'\" > dist/ai.d.ts",
|
|
103
|
+
"build:server": "bun build ./src/index.ts ./src/server/index.ts ./src/ai/index.ts ./src/agent/index.ts --outdir ./dist --target bun --format esm --external elysia --external reflect-metadata --external drizzle-orm --external drizzle-zod --external @elysiajs/openapi --external @bogeychan/elysia-logger --external pino --external pino-pretty && tsc -p tsconfig.build.json && printf \"%s\\n\" \"export * from './src/index'\" > dist/index.d.ts && mkdir -p dist/server && printf \"%s\\n\" \"export * from '../src/server/index'\" > dist/server/index.d.ts && mkdir -p dist/agent && printf \"%s\\n\" \"export * from '../../src/agent/index'\" > dist/agent/index.d.ts && printf \"%s\\n\" \"export * from './src/ai/index'\" > dist/ai.d.ts",
|
|
96
104
|
"build:client": "bun scripts/build-client.ts",
|
|
97
105
|
"build:admin": "bun scripts/build-admin.ts",
|
|
98
106
|
"build": "rm -rf dist && bun run build:server && bun run build:client && bun run build:admin",
|