@moss-js/moss 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/moss.d.ts +11 -20
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -276,8 +276,8 @@ For a complete runnable example, see `javascript/user-facing-sdk/samples/metadat
|
|
|
276
276
|
|
|
277
277
|
This package is licensed under the [PolyForm Shield License 1.0.0](./LICENSE.txt).
|
|
278
278
|
|
|
279
|
-
- ✅ Free for
|
|
280
|
-
- ❌ Not permitted
|
|
279
|
+
- ✅ Free for any use, including production and commercial use.
|
|
280
|
+
- ❌ Not permitted: providing a product that competes with Moss.
|
|
281
281
|
- 📩 For commercial licenses, contact: <contact@inferedge.dev>
|
|
282
282
|
|
|
283
283
|
## 📬 Contact
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1d9c9a=_0xb15c;(function(_0x4e98a7,_0x492d2d){const _0x2a6859=_0xb15c,_0x5ba88b=_0x4e98a7();while(!![]){try{const _0x17a5ed=-parseInt(_0x2a6859(0x1b9))/0x1+-parseInt(_0x2a6859(0x1d0))/0x2*(-parseInt(_0x2a6859(0x207))/0x3)+-parseInt(_0x2a6859(0x22b))/0x4*(-parseInt(_0x2a6859(0x1e3))/0x5)+parseInt(_0x2a6859(0x149))/0x6*(parseInt(_0x2a6859(0x1f7))/0x7)+parseInt(_0x2a6859(0x20d))/0x8*(parseInt(_0x2a6859(0x21f))/0x9)+-parseInt(_0x2a6859(0x160))/0xa*(parseInt(_0x2a6859(0x18b))/0xb)+parseInt(_0x2a6859(0x1d6))/0xc*(-parseInt(_0x2a6859(0x199))/0xd);if(_0x17a5ed===_0x492d2d)break;else _0x5ba88b['push'](_0x5ba88b['shift']());}catch(_0x243a1b){_0x5ba88b['push'](_0x5ba88b['shift']());}}}(_0x3424,0xb1644));import{JobStatus as _0x2b3a90}from'@moss-js/moss-core';import*as _0x138886 from'@moss-js/moss-core';import*as _0x531af6 from'@moss-js/moss-core';var p=_0x531af6,Ie=p[_0x1d9c9a(0x14f)],fe=p['SDK_VERSION_NUMBER'],ye=p[_0x1d9c9a(0x174)],E=p[_0x1d9c9a(0x1f1)],xe=typeof process<'u'&&process[_0x1d9c9a(0x1f3)][_0x1d9c9a(0x1ba)]||p[_0x1d9c9a(0x173)],_=typeof process<'u'?process['env']:{},I=class{constructor(_0x5ec9de,_0x314b81){const _0x49c46b=_0x1d9c9a;this[_0x49c46b(0x1ae)]=_0x5ec9de,this['projectKey']=_0x314b81,this[_0x49c46b(0x15c)]=_[_0x49c46b(0x16e)]??E;}[_0x1d9c9a(0x1ae)];[_0x1d9c9a(0x1ea)];[_0x1d9c9a(0x15c)];async['getAuthToken'](){const _0x20d68e=_0x1d9c9a;let _0x136d8b=await fetch(this[_0x20d68e(0x15c)],{'method':'POST','headers':{'Content-Type':_0x20d68e(0x18c)},'body':JSON[_0x20d68e(0x165)]({'projectId':this[_0x20d68e(0x1ae)],'projectKey':this[_0x20d68e(0x1ea)]}),'signal':AbortSignal[_0x20d68e(0x18a)](0x7530)});if(_0x136d8b[_0x20d68e(0x1f4)]===0x191){let _0x1f6aaa=await _0x136d8b[_0x20d68e(0x1e9)]();throw new Error(_0x20d68e(0x14a)+_0x1f6aaa);}if(!_0x136d8b['ok']){let _0x451e30=await _0x136d8b[_0x20d68e(0x1e9)]();throw new Error(_0x20d68e(0x22a)+_0x136d8b[_0x20d68e(0x1f4)]+':\x20'+_0x451e30);}let _0x4ea64c=await _0x136d8b[_0x20d68e(0x15f)]();return{'token':_0x4ea64c[_0x20d68e(0x1d2)],'expiresIn':_0x4ea64c['expiresIn']};}async[_0x1d9c9a(0x1b0)](){const _0x4dd088=_0x1d9c9a;let {token:_0x469c1f}=await this[_0x4dd088(0x15b)]();return _0x4dd088(0x15e)+_0x469c1f;}},f=class{constructor(_0x59ed3b){const _0x1ecc64=_0x1d9c9a;this[_0x1ecc64(0x192)]=_0x59ed3b;}['inner'];[_0x1d9c9a(0x1b8)]=null;[_0x1d9c9a(0x1fe)]=null;async[_0x1d9c9a(0x15b)](){const _0x5c471f=_0x1d9c9a;if(this[_0x5c471f(0x1b8)]&&this[_0x5c471f(0x1b8)][_0x5c471f(0x21e)]>Date[_0x5c471f(0x190)]())return{'token':this[_0x5c471f(0x1b8)][_0x5c471f(0x1d2)],'expiresIn':this[_0x5c471f(0x1b8)]['expiresIn']};if(this[_0x5c471f(0x1fe)])return this[_0x5c471f(0x1fe)];this[_0x5c471f(0x1fe)]=this[_0x5c471f(0x1a1)]();try{return await this[_0x5c471f(0x1fe)];}finally{this[_0x5c471f(0x1fe)]=null;}}async[_0x1d9c9a(0x1b0)](){const _0x204c9a=_0x1d9c9a;let {token:_0x579914}=await this[_0x204c9a(0x15b)]();return _0x204c9a(0x15e)+_0x579914;}async[_0x1d9c9a(0x1a1)](){const _0x38fb28=_0x1d9c9a;let {token:_0x517dc8,expiresIn:_0x21de41}=await this[_0x38fb28(0x192)][_0x38fb28(0x15b)](),_0x37a77d=Date[_0x38fb28(0x190)]()+(_0x21de41-0x3c)*0x3e8;return this['cache']={'token':_0x517dc8,'expiresIn':_0x21de41,'expiresAt':_0x37a77d},{'token':_0x517dc8,'expiresIn':_0x21de41};}};import{randomUUID as _0x20e6fa}from'node:crypto';import{existsSync as _0x40895e,mkdirSync as _0x56d12c,readFileSync as _0x489f9c,writeFileSync as _0x476dff}from'node:fs';import{homedir as _0x1e747f}from'node:os';import{join as _0x461421,resolve as _0x1713a1}from'node:path';function _0xb15c(_0x10f699,_0x5bdf5e){_0x10f699=_0x10f699-0x149;const _0x342462=_0x3424();let _0xb15cee=_0x342462[_0x10f699];return _0xb15cee;}var ne=_0x1d9c9a(0x22c),re=_0x1d9c9a(0x16a),S=0x100,L=/[\p{Cc}\p{Cf}\p{Cs}\uFFFD]/u,j=_0x1d9c9a(0x1cd);function se(_0x152c40){const _0x5253a0=_0x1d9c9a;return _0x152c40[_0x5253a0(0x1a8)]>0x0&&_0x152c40[_0x5253a0(0x203)]()===_0x152c40&&!L[_0x5253a0(0x1be)](_0x152c40)&&new TextEncoder()[_0x5253a0(0x1b5)](_0x152c40)[_0x5253a0(0x1bc)]<=S;}function oe(_0x2b3b29){const _0x38375e=_0x1d9c9a;try{let _0x1887e8=_0x1713a1(_0x2b3b29),_0xc7e461=_0x461421(_0x1887e8,ne);if(_0x40895e(_0xc7e461)){let _0x1b999b=_0x489f9c(_0xc7e461,_0x38375e(0x202))[_0x38375e(0x203)]();if(se(_0x1b999b))return _0x1b999b;}_0x56d12c(_0x1887e8,{'recursive':!0x0});let _0x5d8b49=_0x20e6fa();return _0x476dff(_0xc7e461,_0x5d8b49,_0x38375e(0x202)),_0x5d8b49;}catch{return _0x20e6fa();}}function _0x3424(){const _0x14b21b=['test','_create','\x22\x20is\x20not\x20loaded.\x20Call\x20loadIndex(\x22','HOME','parseDocuments','error','_warmModel','resyncWebSource','hostDeviceId','query','createIndexFromFiles\x20requires\x20at\x20least\x20one\x20file','Web\x20source\x20methods\x20require\x20a\x20project\x20key.\x20Construct\x20MossClient\x20with\x20(projectId,\x20projectKey).','fromEntries','jobId','SessionIndex','The\x20installed\x20@moss-js/moss-core\x20does\x20not\x20support\x20MossClient\x20identity.\x20Install\x20the\x20exact\x20@moss-js/moss-core\x20version\x20required\x20by\x20@moss-js/moss.','docCount','deviceId','2qsOiow','unloadIndexes','token','Unsupported\x20data\x20type\x20for\x20file\x20upload','userId','createIndexFromFiles','12bFNEpu','deviceIdState','wrapProgress','\x20must\x20not\x20have\x20leading\x20or\x20trailing\x20whitespace','map','name','uploading','replace','/v1/manage','rejectAuthRequest','some','from','ManageClient','10gINEzS','progress','MossClient\x20is\x20closed','listWebSources','contentType','\x20contains\x20an\x20unsupported\x20character','text','projectKey','_fromInner','\x20must\x20be\x20at\x20most\x20','received\x20an\x20array\x20where\x20a\x20JobProgress\x20object\x20was\x20expected','moss-core\x20rejected\x20the\x20auth\x20token:\x20','SessionIndex\x20\x27','includePaths','CLOUD_API_AUTH_URL','configuredIdentity','env','status','string','resync','609nToUsf','toByteArray','setIdentity','startsWith','sources','.\x20All\x20documents\x20must\x20have\x20.embedding\x20set\x20when\x20using\x20modelId=\x27custom\x27.','added','inflight','The\x20installed\x20@moss-js/moss-core\x20runtime\x20does\x20not\x20support\x20exact\x20model\x20artifact\x20identities.\x20Upgrade\x20moss-core\x20before\x20creating\x20this\x20session.','queryText','object','utf8','trim','getDocuments','isArray','MossClient\x20options.identity\x20must\x20be\x20an\x20object','924864RvFXsF','\x20UTF-8\x20bytes','toLowerCase','path','filter','moss-core\x20runtime\x20is\x20missing\x20ManageClient/IndexManager\x20exports','1880wHaLEi','authNotifyFn','\x20could\x20not\x20be\x20settled:\x20','isFinite','\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.','Building','parse','rootUrl','data','loadIndex','slice','loadQueryModel','entries','upsert','hasIndex','body','delete','expiresAt','16092SkURme','loadModel','default','\x20must\x20be\x20a\x20non-empty\x20string','custom','call','indexName','getWebSource','loadIndexes','refreshCadence','all','HTTP\x20','1776212CdKgBh','.moss-device-id','64920uDDQIA','Authentication\x20failed\x20(HTTP\x20401):\x20','includes','version','[moss]\x20Ignoring\x20an\x20auth\x20request\x20with\x20no\x20usable\x20request\x20id;\x20custom\x20authentication\x20may\x20be\x20unavailable\x20for\x20this\x20client.\x20Cause:\x20','queryMultiIndexText','MODEL_DOWNLOAD_URL','modelId','onProgress','alpha','deleteDocs','deleteDocs\x20requires\x20at\x20least\x20one\x20document\x20ID','getIndex','pending_upload','\x22)\x20or\x20loadIndexes([...])\x20before\x20querying;\x20queries\x20run\x20locally\x20and\x20there\x20is\x20no\x20cloud\x20query\x20fallback.','deref','MossClient\x20options.identity.','isSafeInteger','getAuthToken','authUrl','getJobStatus','Bearer\x20','json','2140nODIIE','moss-core\x20runtime\x20SessionIndex\x20is\x20missing\x20the\x20withAuthenticator\x20factory.\x20Upgrade\x20@moss-js/moss-core\x20to\x20a\x20build\x20that\x20supports\x20custom\x20authenticators\x20for\x20sessions.','topK','function','The\x20installed\x20@moss-js/moss-core\x20does\x20not\x20support\x20multi-index\x20operations\x20(queryMultiIndex,\x20loadIndexes,\x20unloadIndexes).\x20Upgrade\x20@moss-js/moss-core.','stringify','createWebSource','deviceIdCachePath','deleteDocuments','USERPROFILE','.moss','getDocs','updated','completed','MOSS_AUTH_URL','maxDocuments','requireMultiIndexCore','[moss]\x20Auth\x20request\x20','embedding','CLOUD_API_INDEX_URL','CLOUD_API_IDENTITY_URL','building','addDocs','excludePaths','createIndex','normalizeJobStatus','applyIdentityToManager','warn','callerSupplied','One\x20or\x20more\x20indexes\x20use\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.','This\x20session\x20uses\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20embedding\x20via\x20QueryOptions.embedding.','no\x20exact\x20artifact\x20identity','setDeviceId','pushIndex','resolveAuthRequest','asyncDispose','Unsupported\x20job\x20status\x20\x27','PendingUpload','addDocuments','requires\x20explicit\x20query\x20embeddings','applied','saveToDisk','timeout','32593GVEaHB','application/json','Uploading','POST','clear','now','create','inner','HTTP\x20error!\x20status:\x20','updateWebSource','unloadIndex','@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20SessionIndex.close()','received\x20a\x20progress\x20event\x20with\x20a\x20non-string\x20currentPhase\x20(','received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20status\x20(','437086CDyfHt','respectRobots','deleteWebSource','parseOptions','indexManager','manifestSha256','deleteIndex','createAuthenticatedSessionInner','fetchAndCache','identity','mossDeviceId','createIndex\x20requires\x20at\x20least\x20one\x20document','withAuthenticator','bind','close','length','listIndexes','manageClient','currentPhase','queryMultiIndex','authenticator','projectId','message','getAuthHeader','hasCustomAuthenticator','maxDepth','failed','queryMultiIndex\x20requires\x20at\x20least\x20one\x20index\x20name','encode','moss-core\x20runtime\x20is\x20missing\x20resolveAuthRequest/rejectAuthRequest\x20exports.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.','IndexManager','cache','1163614yGiNxv','MOSS_INDEX_URL','join','byteLength','Documents\x20missing\x20.embedding\x20for\x20custom\x20model:\x20'];_0x3424=function(){return _0x14b21b;};return _0x3424();}function ie(_0x3018d5=process['env']){const _0x345701=_0x1d9c9a;let _0x31cfbc=_0x3018d5[_0x345701(0x1c1)]?.[_0x345701(0x203)]()||_0x3018d5[_0x345701(0x169)]?.['trim']()||_0x1e747f();return _0x461421(_0x31cfbc,re);}function k(_0x173c33,_0x26db39){const _0x21bebd=_0x1d9c9a;if(_0x173c33!==void 0x0){if(typeof _0x173c33!=_0x21bebd(0x1f5)||_0x173c33['length']===0x0)throw new TypeError(_0x21bebd(0x159)+_0x26db39+_0x21bebd(0x222));if(_0x173c33[_0x21bebd(0x203)]()!==_0x173c33)throw new TypeError(_0x21bebd(0x159)+_0x26db39+_0x21bebd(0x1d9));if(L[_0x21bebd(0x1be)](_0x173c33))throw new TypeError(_0x21bebd(0x159)+_0x26db39+_0x21bebd(0x1e8));if(new TextEncoder()[_0x21bebd(0x1b5)](_0x173c33)[_0x21bebd(0x1bc)]>S)throw new TypeError('MossClient\x20options.identity.'+_0x26db39+_0x21bebd(0x1ec)+S+_0x21bebd(0x208));return _0x173c33;}}function F(_0x1b99d7){const _0xec9af2=_0x1d9c9a;if(_0x1b99d7!==void 0x0){if(_0x1b99d7===null||typeof _0x1b99d7!=_0xec9af2(0x201)||Array[_0xec9af2(0x205)](_0x1b99d7))throw new TypeError(_0xec9af2(0x206));return Object['freeze']({'deviceId':k(_0x1b99d7[_0xec9af2(0x1cf)],_0xec9af2(0x1cf)),'userId':k(_0x1b99d7[_0xec9af2(0x1d4)],_0xec9af2(0x1d4))});}}function P(_0x237ef7){const _0x38bc0e=_0x1d9c9a;return _0x237ef7?.[_0x38bc0e(0x1cf)]!==void 0x0||_0x237ef7?.['userId']!==void 0x0;}function W(_0x5eb3d1){const _0x5e7b93=_0x1d9c9a;if(typeof _0x5eb3d1[_0x5e7b93(0x1f9)]!='function')throw new Error(j);}function ae(_0x5c60ae,_0x2cc583,_0x209a31=process[_0x1d9c9a(0x1f3)]){const _0x25c4da=_0x1d9c9a;if(_0x5c60ae['id'])return _0x5c60ae['id'];let _0x2b59b5=_0x2cc583?.[_0x25c4da(0x203)]()?_0x2cc583:ie(_0x209a31);return _0x5c60ae['id']=oe(_0x2b59b5),_0x5c60ae['id'];}function ue(_0x4cc1f7,_0x235b8e){const _0x1f0d87=_0x1d9c9a;if(typeof _0x4cc1f7[_0x1f0d87(0x180)]!=_0x1f0d87(0x163))return!0x0;try{return _0x4cc1f7[_0x1f0d87(0x180)](_0x235b8e),!0x0;}catch{return!0x1;}}function M(_0x13b7eb,_0x150049,_0x337acb,_0x219d8f=process[_0x1d9c9a(0x1f3)]){const _0x227123=_0x1d9c9a;let _0x20f89e=ae(_0x13b7eb,_0x337acb,_0x219d8f);return{'deviceId':_0x150049?.[_0x227123(0x1cf)]??_0x20f89e,'hostDeviceId':_0x150049?.[_0x227123(0x1cf)],'mossDeviceId':_0x20f89e,'userId':_0x150049?.[_0x227123(0x1d4)],'callerSupplied':P(_0x150049)};}function v(_0x49d839,_0x2e9a0e){const _0x5e5917=_0x1d9c9a;if(typeof _0x49d839['setIdentity']!=_0x5e5917(0x163)){if(_0x2e9a0e['callerSupplied'])throw new Error(j);return ue(_0x49d839,_0x2e9a0e[_0x5e5917(0x1cf)]);}if(!_0x2e9a0e[_0x5e5917(0x17c)])try{return _0x49d839['setIdentity'](null,null,_0x2e9a0e[_0x5e5917(0x1a3)]),!0x0;}catch{return!0x1;}return _0x49d839[_0x5e5917(0x1f9)](_0x2e9a0e[_0x5e5917(0x1c6)]??null,_0x2e9a0e[_0x5e5917(0x1d4)]??null,_0x2e9a0e['mossDeviceId']),!0x0;}function N(_0x27de3f,_0x468c78,_0x226590,_0x469167,_0x2b10ba=process['env']){const _0x2941a0=_0x1d9c9a;_0x468c78[_0x2941a0(0x188)]||(_0x468c78['applied']=v(_0x27de3f,M(_0x468c78,_0x226590,_0x469167,_0x2b10ba)));}var de=0x1;function y(_0x48e8d6){const _0x4208cc=_0x1d9c9a;let _0x53dbd3=_0x48e8d6['modelArtifactContractVersion'];if(typeof _0x53dbd3!=_0x4208cc(0x163))throw $();let _0x31131b=_0x53dbd3[_0x4208cc(0x224)](_0x48e8d6);if(!Number[_0x4208cc(0x15a)](_0x31131b)||_0x31131b<de)throw $();}function $(){const _0x3875e2=_0x1d9c9a;return new Error(_0x3875e2(0x1ff));}var Ce=0x708*0x3e8;function A(_0x381cc2){const _0x487000=_0x1d9c9a;return _0x381cc2 instanceof Error?_0x381cc2[_0x487000(0x1af)]:String(_0x381cc2);}function ce(_0x5750ff){const _0x5294b6=_0x1d9c9a;if(_0x5750ff===null||typeof _0x5750ff!='object')return'received\x20'+String(_0x5750ff);if(Array[_0x5294b6(0x205)](_0x5750ff))return _0x5294b6(0x1ed);let _0x495810=_0x5750ff;return typeof _0x495810[_0x5294b6(0x1cb)]!=_0x5294b6(0x1f5)||_0x495810[_0x5294b6(0x1cb)][_0x5294b6(0x1a8)]===0x0?'received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20jobId\x20('+String(_0x495810[_0x5294b6(0x1cb)])+')':typeof _0x495810['status']!=_0x5294b6(0x1f5)||_0x495810['status'][_0x5294b6(0x1a8)]===0x0?_0x5294b6(0x198)+String(_0x495810[_0x5294b6(0x1f4)])+')':typeof _0x495810[_0x5294b6(0x1e4)]!='number'||!Number[_0x5294b6(0x210)](_0x495810['progress'])?'received\x20a\x20progress\x20event\x20with\x20a\x20non-finite\x20progress\x20value\x20('+String(_0x495810['progress'])+')':_0x495810[_0x5294b6(0x1ab)]!==void 0x0&&_0x495810[_0x5294b6(0x1ab)]!==null&&typeof _0x495810['currentPhase']!=_0x5294b6(0x1f5)?_0x5294b6(0x197)+String(_0x495810['currentPhase'])+')':null;}var x=class{[_0x1d9c9a(0x1ad)];[_0x1d9c9a(0x1aa)];['indexManager'];[_0x1d9c9a(0x1d7)]={'applied':!0x1};[_0x1d9c9a(0x167)];[_0x1d9c9a(0x1f2)];[_0x1d9c9a(0x1ae)];[_0x1d9c9a(0x20e)];constructor(_0x1350f6,_0x2a22ae,_0x111c53){const _0x4ca37a=_0x1d9c9a;this[_0x4ca37a(0x1f2)]=F(_0x111c53?.[_0x4ca37a(0x1a2)]),this['deviceIdCachePath']=_0x111c53?.['cachePath'],this[_0x4ca37a(0x1ae)]=_0x1350f6;let _0x18a5da=typeof _0x2a22ae=='string'?new I(_0x1350f6,_0x2a22ae):_0x2a22ae;this['authenticator']=new f(_0x18a5da);let _0x301767=_0x138886,_0x3b65ee=_0x301767[_0x4ca37a(0x1e2)]??_0x301767[_0x4ca37a(0x221)]?.[_0x4ca37a(0x1e2)],_0x38e8eb=_0x301767[_0x4ca37a(0x1b7)]??_0x301767[_0x4ca37a(0x221)]?.[_0x4ca37a(0x1b7)];if(!_0x3b65ee||!_0x38e8eb)throw new Error(_0x4ca37a(0x20c));if(typeof _0x2a22ae==_0x4ca37a(0x1f5))this[_0x4ca37a(0x1aa)]=new _0x3b65ee(_0x1350f6,_0x2a22ae),this['indexManager']=new _0x38e8eb(_0x1350f6,_0x2a22ae);else{let _0x402189=_0x301767[_0x4ca37a(0x182)]??_0x301767[_0x4ca37a(0x221)]?.['resolveAuthRequest'],_0x366764=_0x301767[_0x4ca37a(0x1df)]??_0x301767[_0x4ca37a(0x221)]?.['rejectAuthRequest'];if(!_0x402189||!_0x366764)throw new Error(_0x4ca37a(0x1b6));let _0x4384ff=this[_0x4ca37a(0x1ad)],_0xb74df0=(_0x21ed52,_0x23500b)=>{const _0x39a95a=_0x4ca37a;try{_0x366764(_0x21ed52,_0x23500b);}catch(_0x4d118d){console[_0x39a95a(0x17b)](_0x39a95a(0x171)+_0x21ed52+_0x39a95a(0x20f)+A(_0x4d118d));}},_0x1ff085=(_0x5f332e,_0xe77228)=>{const _0x3aebb7=_0x4ca37a;try{_0x402189(_0x5f332e,_0xe77228);}catch(_0x5d0ec3){_0xb74df0(_0x5f332e,_0x3aebb7(0x1ee)+A(_0x5d0ec3));}},_0x3c4ae6=!0x1,_0x547521=(_0x12940d,_0x160682)=>{const _0x2cbbe0=_0x4ca37a;if(_0x12940d||!Number['isSafeInteger'](_0x160682)||_0x160682<0x0){_0x3c4ae6||(_0x3c4ae6=!0x0,console[_0x2cbbe0(0x17b)](_0x2cbbe0(0x14d)+(_0x12940d?_0x12940d[_0x2cbbe0(0x1af)]:'received\x20'+String(_0x160682))));return;}_0x4384ff['getAuthHeader']()['then'](_0x4cdb12=>{const _0x1cafea=_0x2cbbe0;let _0x51863b=_0x4cdb12[_0x1cafea(0x1fa)]('Bearer\x20')?_0x4cdb12[_0x1cafea(0x217)](0x7):_0x4cdb12;_0x1ff085(_0x160682,_0x51863b);},_0x3604dc=>_0xb74df0(_0x160682,A(_0x3604dc)));};this[_0x4ca37a(0x20e)]=_0x547521;let _0x54b7d1=_0x3b65ee,_0x1f4ba8=_0x38e8eb;if(!_0x54b7d1[_0x4ca37a(0x1a5)]||!_0x1f4ba8[_0x4ca37a(0x1a5)])throw new Error('moss-core\x20runtime\x20ManageClient/IndexManager\x20is\x20missing\x20withAuthenticator\x20factory.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.');this[_0x4ca37a(0x1aa)]=_0x54b7d1['withAuthenticator'](_0x1350f6,_0x547521),this[_0x4ca37a(0x19d)]=_0x1f4ba8[_0x4ca37a(0x1a5)](_0x1350f6,_0x547521);}P(this[_0x4ca37a(0x1f2)])&&W(this[_0x4ca37a(0x19d)]);}async[_0x1d9c9a(0x1a7)](){const _0x37df2d=_0x1d9c9a;let _0x53c87b=this['indexManager'][_0x37df2d(0x1a7)];if(typeof _0x53c87b!='function')throw new Error('@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20MossClient.close()');await _0x53c87b[_0x37df2d(0x224)](this['indexManager']);}async[_0x1d9c9a(0x15b)](){const _0xa236c0=_0x1d9c9a;return this[_0xa236c0(0x1ad)][_0xa236c0(0x15b)]();}['wrapProgress'](_0x29a189){if(!_0x29a189)return;let _0x32c5d9=!0x1;return(_0x37dad8,_0x333e7b)=>{const _0x4938a6=_0xb15c;let _0x384a63=_0x37dad8?_0x37dad8[_0x4938a6(0x1af)]:ce(_0x333e7b);if(_0x384a63!==null){_0x32c5d9||(_0x32c5d9=!0x0,console['warn']('[moss]\x20Dropping\x20a\x20malformed\x20job\x20progress\x20event;\x20progress\x20reporting\x20may\x20be\x20incomplete\x20for\x20this\x20operation.\x20Cause:\x20'+_0x384a63));return;}_0x29a189(_0x333e7b);};}['normalizeJobStatus'](_0x476d07){const _0x10e06c=_0x1d9c9a;let _0x234d49=_0x476d07['trim']()[_0x10e06c(0x209)]()['replace'](/\s+/g,'_'),_0x23f6bc=_0x234d49['replace'](/_/g,'');if(_0x234d49===_0x10e06c(0x156)||_0x23f6bc==='pendingupload')return _0x2b3a90[_0x10e06c(0x185)];if(_0x234d49===_0x10e06c(0x1dc))return _0x2b3a90[_0x10e06c(0x18d)];if(_0x234d49===_0x10e06c(0x175))return _0x2b3a90[_0x10e06c(0x212)];if(_0x234d49===_0x10e06c(0x16d))return _0x2b3a90['Completed'];if(_0x234d49===_0x10e06c(0x1b3))return _0x2b3a90['Failed'];throw new Error(_0x10e06c(0x184)+_0x476d07+'\x27\x20returned\x20by\x20moss-core');}async['createIndex'](_0x4e911d,_0x25f6a4,_0x29ce83,_0x1b99d3){const _0xd150f5=_0x1d9c9a;if(!_0x25f6a4[_0xd150f5(0x1a8)])throw new Error(_0xd150f5(0x1a4));return await this[_0xd150f5(0x1aa)]['createIndex'](_0x4e911d,_0x25f6a4,_0x29ce83,this[_0xd150f5(0x1d8)](_0x1b99d3?.[_0xd150f5(0x151)]));}async[_0x1d9c9a(0x1f8)](_0x17b6cb){const _0x10cd0f=_0x1d9c9a;if(_0x17b6cb instanceof Uint8Array)return Array[_0x10cd0f(0x1e1)](_0x17b6cb);if(_0x17b6cb instanceof ArrayBuffer)return Array[_0x10cd0f(0x1e1)](new Uint8Array(_0x17b6cb));if(typeof _0x17b6cb['arrayBuffer']=='function'){let _0x2bb70d=await _0x17b6cb['arrayBuffer']();return Array[_0x10cd0f(0x1e1)](new Uint8Array(_0x2bb70d));}throw new Error(_0x10cd0f(0x1d3));}async[_0x1d9c9a(0x1d5)](_0x43ea98,_0x142eb4,_0xb942e){const _0x398443=_0x1d9c9a;if(_0x142eb4['length']===0x0)throw new Error(_0x398443(0x1c8));let _0x2db9e9=_0xb942e?.[_0x398443(0x150)]??'moss-minilm',_0x54f188=await Promise['all'](_0x142eb4[_0x398443(0x1da)](async _0x4c7fea=>({'name':_0x4c7fea[_0x398443(0x1db)],'contentType':_0x4c7fea[_0x398443(0x1e7)],'path':_0x4c7fea[_0x398443(0x20a)]??void 0x0,'data':_0x4c7fea['data']!=null?await this[_0x398443(0x1f8)](_0x4c7fea[_0x398443(0x215)]):void 0x0})));return await this[_0x398443(0x1aa)][_0x398443(0x1d5)](_0x43ea98,_0x54f188,_0x2db9e9,this['wrapProgress'](_0xb942e?.['onProgress']),_0xb942e?.[_0x398443(0x19c)]??null);}async['addDocs'](_0x41a2f1,_0x26a8dc,_0x49a117){const _0x26f789=_0x1d9c9a;if(Array[_0x26f789(0x205)](_0x26a8dc)&&_0x26a8dc[_0x26f789(0x1a8)]===0x0)throw new Error('addDocs\x20requires\x20at\x20least\x20one\x20document');return await this[_0x26f789(0x1aa)]['addDocs'](_0x41a2f1,_0x26a8dc,_0x49a117??null,this[_0x26f789(0x1d8)](_0x49a117?.[_0x26f789(0x151)]));}async[_0x1d9c9a(0x153)](_0x51a910,_0x1c2e66,_0x4b6cbf){const _0x5e0163=_0x1d9c9a;if(Array['isArray'](_0x1c2e66)&&_0x1c2e66['length']===0x0)throw new Error(_0x5e0163(0x154));return await this[_0x5e0163(0x1aa)][_0x5e0163(0x153)](_0x51a910,_0x1c2e66,this[_0x5e0163(0x1d8)](_0x4b6cbf?.[_0x5e0163(0x151)]));}async['getJobStatus'](_0x37d06c){const _0x32d421=_0x1d9c9a;let _0x2155b7=await this[_0x32d421(0x1aa)][_0x32d421(0x15d)](_0x37d06c);return{..._0x2155b7,'status':this[_0x32d421(0x179)](_0x2155b7['status']),'currentPhase':_0x2155b7[_0x32d421(0x1ab)]??null,'error':_0x2155b7[_0x32d421(0x1c3)]??null};}async[_0x1d9c9a(0x155)](_0x2ad83a){const _0x1c5afd=_0x1d9c9a;return this[_0x1c5afd(0x1aa)][_0x1c5afd(0x155)](_0x2ad83a);}async[_0x1d9c9a(0x1a9)](){const _0x328d2c=_0x1d9c9a;return this[_0x328d2c(0x1aa)]['listIndexes']();}async[_0x1d9c9a(0x19f)](_0x108113){const _0x4aa0fa=_0x1d9c9a;return this[_0x4aa0fa(0x1aa)][_0x4aa0fa(0x19f)](_0x108113);}async[_0x1d9c9a(0x16b)](_0x10b19c,_0x575d0c){return this['manageClient']['getDocs'](_0x10b19c,_0x575d0c??null);}async[_0x1d9c9a(0x216)](_0x299089,_0x21e326){const _0x388c82=_0x1d9c9a;this[_0x388c82(0x17a)](_0x21e326?.['cachePath']);let _0x19c64b=await this[_0x388c82(0x19d)][_0x388c82(0x216)](_0x299089,_0x21e326??null);return _0x19c64b['model']['id']!=='custom'&&await this[_0x388c82(0x19d)][_0x388c82(0x218)](_0x299089),_0x19c64b[_0x388c82(0x1db)];}async['loadIndexes'](_0x50faaa,_0x2a4d14){const _0x58e45a=_0x1d9c9a;let _0x5efe8a=this[_0x58e45a(0x170)]();return this['applyIdentityToManager'](_0x2a4d14?.['cachePath']),_0x5efe8a[_0x58e45a(0x227)](_0x50faaa,_0x2a4d14??null);}async['unloadIndex'](_0xe1e75a){const _0x302cc1=_0x1d9c9a;return this[_0x302cc1(0x19d)][_0x302cc1(0x195)](_0xe1e75a);}async[_0x1d9c9a(0x1d1)](_0x1cb298){const _0x5d4103=_0x1d9c9a;return this[_0x5d4103(0x170)]()[_0x5d4103(0x1d1)](_0x1cb298);}['requireMultiIndexCore'](){const _0x44353a=_0x1d9c9a;let _0x1ebced=this[_0x44353a(0x19d)];if(typeof _0x1ebced[_0x44353a(0x1ac)]!=_0x44353a(0x163)||typeof _0x1ebced[_0x44353a(0x14e)]!=_0x44353a(0x163)||typeof _0x1ebced[_0x44353a(0x227)]!='function'||typeof _0x1ebced[_0x44353a(0x1d1)]!=_0x44353a(0x163))throw new Error(_0x44353a(0x164));return{'queryMultiIndex':_0x1ebced['queryMultiIndex'][_0x44353a(0x1a6)](_0x1ebced),'queryMultiIndexText':_0x1ebced['queryMultiIndexText'][_0x44353a(0x1a6)](_0x1ebced),'loadIndexes':_0x1ebced['loadIndexes']['bind'](_0x1ebced),'unloadIndexes':_0x1ebced['unloadIndexes'][_0x44353a(0x1a6)](_0x1ebced)};}[_0x1d9c9a(0x17a)](_0x59b650){const _0x368e43=_0x1d9c9a;N(this[_0x368e43(0x19d)],this['deviceIdState'],this[_0x368e43(0x1f2)],this[_0x368e43(0x167)]??_0x59b650);}['resolveIdentityForSession'](){const _0x20d545=_0x1d9c9a;return M(this['deviceIdState'],this[_0x20d545(0x1f2)],this[_0x20d545(0x167)]);}[_0x1d9c9a(0x1b1)](){return this['authNotifyFn']!==void 0x0;}async[_0x1d9c9a(0x1a0)](_0x4904de,_0xfa3f79,_0x5025c8){const _0x32d003=_0x1d9c9a;if(!this[_0x32d003(0x20e)])throw new Error('createAuthenticatedSessionInner\x20requires\x20a\x20custom\x20IAuthenticator\x20client');let _0x52d08a=_0x138886,_0x57be9b=_0x52d08a[_0x32d003(0x1cc)]??_0x52d08a['default']?.['SessionIndex'];if(!_0x57be9b||typeof _0x57be9b[_0x32d003(0x1a5)]!='function')throw new Error(_0x32d003(0x161));return _0x5025c8&&y(_0x57be9b),_0x57be9b[_0x32d003(0x1a5)](_0x4904de,_0xfa3f79,this[_0x32d003(0x1ae)],this[_0x32d003(0x20e)],null,null,_0x5025c8?.[_0x32d003(0x14c)]??null,_0x5025c8?.[_0x32d003(0x19e)]??null);}async[_0x1d9c9a(0x1c7)](_0x5a4fb4,_0x43da45,_0x204669){const _0x28f208=_0x1d9c9a;if(!await this[_0x28f208(0x19d)][_0x28f208(0x21b)](_0x5a4fb4))throw new Error('Index\x20\x22'+_0x5a4fb4+_0x28f208(0x1c0)+_0x5a4fb4+_0x28f208(0x157));let _0x484f61=_0x204669?.[_0x28f208(0x162)]??0x5,_0x3596be=_0x204669?.[_0x28f208(0x152)]??0.8;return _0x204669?.[_0x28f208(0x172)]?this[_0x28f208(0x19d)]['query'](_0x5a4fb4,_0x43da45,_0x204669[_0x28f208(0x172)],_0x484f61,_0x3596be,_0x204669?.[_0x28f208(0x20b)]):this[_0x28f208(0x19d)][_0x28f208(0x200)](_0x5a4fb4,_0x43da45,_0x484f61,_0x3596be,_0x204669?.[_0x28f208(0x20b)]);}async[_0x1d9c9a(0x1ac)](_0x1e9e53,_0x36e53e,_0x4e74cd){const _0x5935bf=_0x1d9c9a;if(_0x1e9e53[_0x5935bf(0x1a8)]===0x0)throw new Error(_0x5935bf(0x1b4));let _0x3d7d9f=this[_0x5935bf(0x170)](),_0x217fb2=_0x4e74cd?.[_0x5935bf(0x162)]??0xa,_0x3e2fa5=_0x4e74cd?.[_0x5935bf(0x152)]??0.8;if(_0x4e74cd?.[_0x5935bf(0x172)])return _0x3d7d9f['queryMultiIndex'](_0x1e9e53,_0x36e53e,_0x4e74cd[_0x5935bf(0x172)],_0x217fb2,_0x3e2fa5,_0x4e74cd?.[_0x5935bf(0x20b)]);try{return await _0x3d7d9f[_0x5935bf(0x14e)](_0x1e9e53,_0x36e53e,_0x217fb2,_0x3e2fa5,_0x4e74cd?.['filter']);}catch(_0xf48d27){throw _0xf48d27 instanceof Error&&_0xf48d27['message']['includes'](_0x5935bf(0x17f))?new Error(_0xf48d27[_0x5935bf(0x1af)]+_0x5935bf(0x211),{'cause':_0xf48d27}):_0xf48d27 instanceof Error&&_0xf48d27[_0x5935bf(0x1af)][_0x5935bf(0x14b)](_0x5935bf(0x187))?new Error(_0x5935bf(0x17d),{'cause':_0xf48d27}):_0xf48d27;}}};import{SessionIndex as _0x919d31}from'@moss-js/moss-core';var h=class r{#e;#r;#s;#i=!0x1;#a;constructor(_0x3fec0a,_0x25a3e5,_0x1e1dc){this.#s=_0x3fec0a,this.#r=_0x25a3e5,this.#e=_0x1e1dc;}static async['_create'](_0x2b3b1a,_0x5dbe58,_0x26bcec,_0x219bba,_0x43d9a8,_0x86870,_0x14317f){const _0x579af3=_0x1d9c9a;let _0x5f21c0=_0x919d31;_0x14317f&&y(_0x5f21c0);let _0x180a76=await _0x5f21c0[_0x579af3(0x191)](_0x2b3b1a,_0x5dbe58,_0x26bcec,_0x219bba,_0x43d9a8??null,_0x14317f?.[_0x579af3(0x14c)]??null,_0x14317f?.['manifestSha256']??null);return r[_0x579af3(0x1eb)](_0x2b3b1a,_0x5dbe58,_0x180a76,_0x86870);}static[_0x1d9c9a(0x1eb)](_0x4919c3,_0x1db4ca,_0x3b5f02,_0x4edf16){return _0x4edf16&&v(_0x3b5f02,_0x4edf16),new r(_0x4919c3,_0x1db4ca,_0x3b5f02);}get[_0x1d9c9a(0x1db)](){return this.#s;}get[_0x1d9c9a(0x1ce)](){return this.#n(),this.#e['docCount'];}get['modelId'](){return this.#r;}async['addDocs'](_0x9ecbce,_0xaa3342){const _0x55aa70=_0x1d9c9a;this.#n();let _0x391e0b=_0xaa3342?{'upsert':_0xaa3342[_0x55aa70(0x21a)]??!0x0}:void 0x0;if(this.#r===_0x55aa70(0x223)){let _0x2a2da9=r.#t(_0x9ecbce),_0x3f1234=_0x9ecbce[_0x55aa70(0x1da)](_0x2dc523=>{const _0x302d53=_0x55aa70;let _0x39b810={..._0x2dc523};return delete _0x39b810[_0x302d53(0x172)],_0x39b810;}),_0x119716=this.#e[_0x55aa70(0x186)](_0x3f1234,_0x2a2da9,_0x391e0b);return{'added':_0x119716[_0x55aa70(0x1fd)],'updated':_0x119716[_0x55aa70(0x16c)]};}let _0xb8dc6e=this.#e['addDocumentsText'](_0x9ecbce,_0x391e0b);return{'added':_0xb8dc6e['added'],'updated':_0xb8dc6e[_0x55aa70(0x16c)]};}async[_0x1d9c9a(0x153)](_0x409d6e){const _0x1a19dc=_0x1d9c9a;return this.#n(),this.#e[_0x1a19dc(0x168)](_0x409d6e);}async[_0x1d9c9a(0x16b)](_0x4b9429){const _0x5dbf01=_0x1d9c9a;return this.#n(),this.#e[_0x5dbf01(0x204)](_0x4b9429??null);}async[_0x1d9c9a(0x1c7)](_0x1d3b4c,_0x50010a){const _0x95f767=_0x1d9c9a;this.#n();let _0x9a4230=_0x50010a?.[_0x95f767(0x162)]??0x5,_0x4b69c8=_0x50010a?.[_0x95f767(0x152)]??0.8,_0x57ce77=_0x50010a?.[_0x95f767(0x20b)]??null,_0x1f013d=_0x50010a?.['embedding'];if(_0x1f013d==null){if(this.#r==='custom')throw new Error(_0x95f767(0x17e));return this.#e['queryText'](_0x1d3b4c,_0x9a4230,_0x4b69c8,_0x57ce77);}return this.#e[_0x95f767(0x1c7)](_0x1d3b4c,_0x9a4230,Array['from'](_0x1f013d),_0x4b69c8,_0x57ce77);}async['loadIndex'](_0x383f9e,_0x3467ea){const _0x5c2310=_0x1d9c9a;return this.#n(),this.#e[_0x5c2310(0x216)](_0x383f9e,_0x3467ea??null);}async[_0x1d9c9a(0x181)](){const _0x150c1d=_0x1d9c9a;return this.#n(),this.#e[_0x150c1d(0x181)]();}async[_0x1d9c9a(0x189)](_0x216d0c){const _0x5cf998=_0x1d9c9a;this.#n(),this.#e[_0x5cf998(0x189)](_0x216d0c);}async['loadFromDisk'](_0x46a5ad){return this.#n(),this.#e['loadFromDisk'](_0x46a5ad);}#n(){const _0xd43b=_0x1d9c9a;if(this.#i)throw new Error(_0xd43b(0x1ef)+this.#s+'\x27\x20is\x20closed');}[_0x1d9c9a(0x1a7)](){return this.#a??=this.#o(),this.#a;}async #o(){const _0x42711a=_0x1d9c9a;this.#i=!0x0;let _0xc57023=this.#e[_0x42711a(0x1a7)];if(typeof _0xc57023!='function')throw new Error(_0x42711a(0x196));await _0xc57023[_0x42711a(0x224)](this.#e);}async[Symbol[_0x1d9c9a(0x183)]](){const _0x31e077=_0x1d9c9a;return this[_0x31e077(0x1a7)]();}async[_0x1d9c9a(0x1c4)](){const _0x18c32d=_0x1d9c9a;this.#n(),this.#r!==_0x18c32d(0x223)&&this.#e[_0x18c32d(0x220)]();}static#t(_0x153670){const _0x52cb26=_0x1d9c9a;let _0x365403=_0x153670[_0x52cb26(0x20b)](_0x2fe7cd=>!_0x2fe7cd['embedding']||_0x2fe7cd[_0x52cb26(0x172)][_0x52cb26(0x1a8)]===0x0)[_0x52cb26(0x1da)](_0x540eb7=>_0x540eb7['id']);if(_0x365403[_0x52cb26(0x1a8)]>0x0)throw new Error(_0x52cb26(0x1bd)+_0x365403[_0x52cb26(0x1bb)](',\x20')+_0x52cb26(0x1fc));return _0x153670[_0x52cb26(0x1da)](_0x154f0c=>Array[_0x52cb26(0x1e1)](_0x154f0c[_0x52cb26(0x172)]??[]));}},me='https://service.usemoss.dev',he=_0x1d9c9a(0x1de),b=class extends Error{['status'];[_0x1d9c9a(0x21c)];constructor(_0x58475b,_0x147d32){const _0x491708=_0x1d9c9a;let _0x38b03a=_0x147d32?':\x20'+_0x147d32:'';super(_0x491708(0x193)+_0x58475b+_0x38b03a),this[_0x491708(0x1db)]='ManageApiError',this['status']=_0x58475b,this['body']=_0x147d32;}};function pe(){const _0x3a9fbb=_0x1d9c9a;return''+(typeof process<'u'&&process['env']['MOSS_CLOUD_API_BASE_URL']||me)[_0x3a9fbb(0x1dd)](/\/+$/,'')+he;}function ge(_0x36c362){const _0x426470=_0x1d9c9a;return _0x36c362?Object[_0x426470(0x1ca)](Object[_0x426470(0x219)](_0x36c362)[_0x426470(0x20b)](([,_0x51ddf0])=>_0x51ddf0!==void 0x0)):{};}async function B(_0xf17a30,_0x2bcaa4,_0x1cea1e,_0x44be28){const _0x1820bf=_0x1d9c9a;let _0x572020={...ge(_0x44be28),'action':_0x1cea1e,'projectId':_0xf17a30},_0x359ea6=await fetch(pe(),{'method':_0x1820bf(0x18e),'headers':{'Content-Type':_0x1820bf(0x18c),'X-Project-Key':_0x2bcaa4},'body':JSON[_0x1820bf(0x165)](_0x572020),'signal':AbortSignal[_0x1820bf(0x18a)](0x927c0)}),_0x4a5a1c=await _0x359ea6[_0x1820bf(0x1e9)]();if(!_0x359ea6['ok'])throw new b(_0x359ea6['status'],_0x4a5a1c);return _0x4a5a1c?JSON[_0x1820bf(0x213)](_0x4a5a1c):{};}var K='moss-minilm',D=class{#e;#r;#s;#i=!0x1;#a;#n=new Set();constructor(_0x2d5e37,_0x221b2e,_0x365466){const _0x2f81e9=_0x1d9c9a;this.#e=new x(_0x2d5e37,_0x221b2e,_0x365466),this.#r=_0x2d5e37,this.#s=typeof _0x221b2e==_0x2f81e9(0x1f5)?_0x221b2e:null;}async[_0x1d9c9a(0x15b)](){const _0x1d4889=_0x1d9c9a;return this.#t(),this.#e[_0x1d4889(0x15b)]();}async[_0x1d9c9a(0x178)](_0x406a4f,_0x6ef077,_0x538ff0){const _0x767f21=_0x1d9c9a;this.#t();let _0x235b7e;return _0x538ff0?.[_0x767f21(0x150)]!==void 0x0?_0x235b7e=_0x538ff0['modelId']:_0x235b7e=_0x6ef077[_0x767f21(0x1e0)](_0x40a4be=>Array[_0x767f21(0x205)](_0x40a4be['embedding'])&&_0x40a4be[_0x767f21(0x172)]['length']>0x0)?_0x767f21(0x223):K,this.#e[_0x767f21(0x178)](_0x406a4f,_0x6ef077,_0x235b7e,_0x538ff0);}async[_0x1d9c9a(0x1d5)](_0x2674dd,_0x401f88,_0x2daf98){const _0xf66106=_0x1d9c9a;return this.#t(),this.#e[_0xf66106(0x1d5)](_0x2674dd,_0x401f88,_0x2daf98);}async[_0x1d9c9a(0x155)](_0x17c9a4){return this.#t(),this.#e['getIndex'](_0x17c9a4);}async[_0x1d9c9a(0x1a9)](){const _0x5940f0=_0x1d9c9a;return this.#t(),this.#e[_0x5940f0(0x1a9)]();}async[_0x1d9c9a(0x19f)](_0x370e1c){return this.#t(),this.#e['deleteIndex'](_0x370e1c);}async[_0x1d9c9a(0x176)](_0x1ff7bc,_0x3c5fb8,_0x549a6f){const _0x51d043=_0x1d9c9a;return this.#t(),this.#e[_0x51d043(0x176)](_0x1ff7bc,_0x3c5fb8,_0x549a6f);}async[_0x1d9c9a(0x153)](_0x46018d,_0x5d8e0b,_0x468d65){return this.#t(),this.#e['deleteDocs'](_0x46018d,_0x5d8e0b,_0x468d65);}async[_0x1d9c9a(0x15d)](_0x3a2da6){const _0x335820=_0x1d9c9a;return this.#t(),this.#e[_0x335820(0x15d)](_0x3a2da6);}async[_0x1d9c9a(0x166)](_0x2d6b7d,_0x29d38e,_0x3a960e){const _0x4ffeca=_0x1d9c9a;return this.#t(),this.#o('createWebSource',{'rootUrl':_0x2d6b7d,'indexName':_0x29d38e,'maxPages':_0x3a960e?.['maxPages'],'maxDocuments':_0x3a960e?.[_0x4ffeca(0x16f)],'maxDepth':_0x3a960e?.['maxDepth'],'includePaths':_0x3a960e?.[_0x4ffeca(0x1f0)],'excludePaths':_0x3a960e?.[_0x4ffeca(0x177)],'respectRobots':_0x3a960e?.[_0x4ffeca(0x19a)],'parseDocuments':_0x3a960e?.[_0x4ffeca(0x1c2)],'refreshCadence':_0x3a960e?.[_0x4ffeca(0x228)],'modelId':_0x3a960e?.[_0x4ffeca(0x150)]});}async['listWebSources'](_0x36fea0){const _0x3ac6ca=_0x1d9c9a;this.#t();let _0x477a5f=(await this.#o(_0x3ac6ca(0x1e6),_0x36fea0!==void 0x0?{'indexName':_0x36fea0}:void 0x0))[_0x3ac6ca(0x1fb)]??[];return _0x36fea0===void 0x0?_0x477a5f:_0x477a5f['filter'](_0x23d6b6=>_0x23d6b6[_0x3ac6ca(0x225)]===_0x36fea0);}async['getWebSource'](_0x34af9c){const _0x3eeef3=_0x1d9c9a;return this.#t(),this.#o(_0x3eeef3(0x226),{'sourceId':_0x34af9c});}async[_0x1d9c9a(0x194)](_0x3f87ce,_0x2e3232){const _0xd57f46=_0x1d9c9a;return this.#t(),this.#o(_0xd57f46(0x194),{'sourceId':_0x3f87ce,'refreshCadence':_0x2e3232['refreshCadence'],'rootUrl':_0x2e3232[_0xd57f46(0x214)],'includePaths':_0x2e3232['includePaths'],'excludePaths':_0x2e3232['excludePaths'],'maxDepth':_0x2e3232[_0xd57f46(0x1b2)],'maxPages':_0x2e3232['maxPages'],'resync':_0x2e3232[_0xd57f46(0x1f6)]});}async[_0x1d9c9a(0x1c5)](_0x41789d){const _0x3e0b10=_0x1d9c9a;return this.#t(),this.#o(_0x3e0b10(0x1c5),{'sourceId':_0x41789d});}async['deleteWebSource'](_0x3f1f28){const _0x3aa086=_0x1d9c9a;return this.#t(),this.#o(_0x3aa086(0x19b),{'sourceId':_0x3f1f28});}async #o(_0x503e15,_0x340ed5){const _0x4168ad=_0x1d9c9a;if(this.#s===null)throw new Error(_0x4168ad(0x1c9));return B(this.#r,this.#s,_0x503e15,_0x340ed5);}async[_0x1d9c9a(0x16b)](_0x4235f6,_0x3ee12a){return this.#t(),this.#e['getDocs'](_0x4235f6,_0x3ee12a);}async['loadIndex'](_0x14dbc2,_0xd33ff){const _0x445519=_0x1d9c9a;return this.#t(),this.#e[_0x445519(0x216)](_0x14dbc2,_0xd33ff);}async[_0x1d9c9a(0x227)](_0x230bf7,_0x544516){const _0x28d59d=_0x1d9c9a;return this.#t(),this.#e[_0x28d59d(0x227)](_0x230bf7,_0x544516);}async[_0x1d9c9a(0x195)](_0xbe608f){const _0x1da43f=_0x1d9c9a;return this.#t(),this.#e[_0x1da43f(0x195)](_0xbe608f);}async['unloadIndexes'](_0x3e99e9){const _0x46f5e1=_0x1d9c9a;return this.#t(),this.#e[_0x46f5e1(0x1d1)](_0x3e99e9);}async[_0x1d9c9a(0x1c7)](_0x35950c,_0x1087c6,_0x2962d9){const _0x235018=_0x1d9c9a;return this.#t(),this.#e[_0x235018(0x1c7)](_0x35950c,_0x1087c6,_0x2962d9);}async[_0x1d9c9a(0x1ac)](_0x213717,_0x16ed36,_0x4a5497){const _0x34b358=_0x1d9c9a;return this.#t(),this.#e[_0x34b358(0x1ac)](_0x213717,_0x16ed36,_0x4a5497);}async['session'](_0x1809af,_0x29944c=K,_0x111c56){const _0x40dd94=_0x1d9c9a;this.#t();let _0x290250=this.#e['resolveIdentityForSession'](),_0x9c63c9;if(this.#s!==null)_0x9c63c9=await h[_0x40dd94(0x1bf)](_0x1809af,_0x29944c,this.#r,this.#s,void 0x0,_0x290250,_0x111c56);else{let _0x447156=await this.#e[_0x40dd94(0x1a0)](_0x1809af,_0x29944c,_0x111c56);_0x9c63c9=h[_0x40dd94(0x1eb)](_0x1809af,_0x29944c,_0x447156,_0x290250);}await _0x9c63c9[_0x40dd94(0x1c4)]();for(let _0x11b5ef of this.#n)_0x11b5ef[_0x40dd94(0x158)]()||this.#n[_0x40dd94(0x21d)](_0x11b5ef);return this.#n['add'](new WeakRef(_0x9c63c9)),_0x9c63c9;}#t(){const _0x35ac06=_0x1d9c9a;if(this.#i)throw new Error(_0x35ac06(0x1e5));}[_0x1d9c9a(0x1a7)](){return this.#a??=this.#u(),this.#a;}async #u(){const _0xac0440=_0x1d9c9a;this.#i=!0x0;let _0x47dd3f=[...this.#n]['map'](_0x30f4dc=>_0x30f4dc[_0xac0440(0x158)]())[_0xac0440(0x20b)](_0x3c53e6=>_0x3c53e6!==void 0x0);this.#n[_0xac0440(0x18f)](),await Promise[_0xac0440(0x229)](_0x47dd3f[_0xac0440(0x1da)](_0x1afa31=>_0x1afa31['close']())),await this.#e[_0xac0440(0x1a7)]();}async[Symbol[_0x1d9c9a(0x183)]](){return this['close']();}};export{b as ManageApiError,D as MossClient,h as SessionIndex};
|
|
1
|
+
const _0x5639b1=_0x186b;(function(_0x4b04d8,_0x5cc889){const _0x1c7650=_0x186b,_0x4e7f2a=_0x4b04d8();while(!![]){try{const _0x3ada7a=-parseInt(_0x1c7650(0x24f))/0x1*(-parseInt(_0x1c7650(0x239))/0x2)+parseInt(_0x1c7650(0x228))/0x3+parseInt(_0x1c7650(0x226))/0x4+-parseInt(_0x1c7650(0x27c))/0x5+parseInt(_0x1c7650(0x221))/0x6*(-parseInt(_0x1c7650(0x21a))/0x7)+-parseInt(_0x1c7650(0x263))/0x8*(parseInt(_0x1c7650(0x254))/0x9)+parseInt(_0x1c7650(0x271))/0xa*(parseInt(_0x1c7650(0x252))/0xb);if(_0x3ada7a===_0x5cc889)break;else _0x4e7f2a['push'](_0x4e7f2a['shift']());}catch(_0x1c8c40){_0x4e7f2a['push'](_0x4e7f2a['shift']());}}}(_0x1d51,0x8af3f));import{JobStatus as _0x4017a7}from'@moss-js/moss-core';import*as _0x554d84 from'@moss-js/moss-core';import*as _0x45341e from'@moss-js/moss-core';var g=_0x45341e,oe=g[_0x5639b1(0x269)],ie=g[_0x5639b1(0x1cf)],ae=g[_0x5639b1(0x217)],O=g['CLOUD_API_AUTH_URL'],ue=typeof process<'u'&&process[_0x5639b1(0x1d0)][_0x5639b1(0x1d4)]||g[_0x5639b1(0x1ee)],T=typeof process<'u'?process[_0x5639b1(0x1d0)]:{},f=class{constructor(_0x5cace1,_0x27f76f){const _0x5f5bff=_0x5639b1;this[_0x5f5bff(0x206)]=_0x5cace1,this[_0x5f5bff(0x1b1)]=_0x27f76f,this[_0x5f5bff(0x26f)]=T[_0x5f5bff(0x1aa)]??O;}['projectId'];['projectKey'];[_0x5639b1(0x26f)];async['getAuthToken'](){const _0x3c2515=_0x5639b1;let _0x420383=await fetch(this[_0x3c2515(0x26f)],{'method':'POST','headers':{'Content-Type':_0x3c2515(0x1bf)},'body':JSON['stringify']({'projectId':this['projectId'],'projectKey':this[_0x3c2515(0x1b1)]}),'signal':AbortSignal[_0x3c2515(0x21e)](0x7530)});if(_0x420383[_0x3c2515(0x1fc)]===0x191){let _0x2015e2=await _0x420383[_0x3c2515(0x27d)]();throw new Error(_0x3c2515(0x203)+_0x2015e2);}if(!_0x420383['ok']){let _0x5f3cad=await _0x420383[_0x3c2515(0x27d)]();throw new Error(_0x3c2515(0x1b3)+_0x420383[_0x3c2515(0x1fc)]+':\x20'+_0x5f3cad);}let _0x94c877=await _0x420383[_0x3c2515(0x209)]();return{'token':_0x94c877['token'],'expiresIn':_0x94c877[_0x3c2515(0x243)]};}async[_0x5639b1(0x20b)](){const _0x37d397=_0x5639b1;let {token:_0x9e4d6f}=await this[_0x37d397(0x26c)]();return'Bearer\x20'+_0x9e4d6f;}},I=class{constructor(_0x2aa086){const _0x4a308f=_0x5639b1;this[_0x4a308f(0x259)]=_0x2aa086;}[_0x5639b1(0x259)];[_0x5639b1(0x212)]=null;[_0x5639b1(0x1fa)]=null;async[_0x5639b1(0x26c)](){const _0x1d1a30=_0x5639b1;if(this[_0x1d1a30(0x212)]&&this['cache'][_0x1d1a30(0x1c2)]>Date[_0x1d1a30(0x1eb)]())return{'token':this['cache']['token'],'expiresIn':this[_0x1d1a30(0x212)][_0x1d1a30(0x243)]};if(this[_0x1d1a30(0x1fa)])return this['inflight'];this[_0x1d1a30(0x1fa)]=this[_0x1d1a30(0x1f2)]();try{return await this['inflight'];}finally{this['inflight']=null;}}async[_0x5639b1(0x20b)](){const _0x5c550f=_0x5639b1;let {token:_0x6b6927}=await this[_0x5c550f(0x26c)]();return _0x5c550f(0x282)+_0x6b6927;}async['fetchAndCache'](){const _0x6c4029=_0x5639b1;let {token:_0x4ce427,expiresIn:_0x2054f2}=await this['inner'][_0x6c4029(0x26c)](),_0x393a78=Date[_0x6c4029(0x1eb)]()+(_0x2054f2-0x3c)*0x3e8;return this[_0x6c4029(0x212)]={'token':_0x4ce427,'expiresIn':_0x2054f2,'expiresAt':_0x393a78},{'token':_0x4ce427,'expiresIn':_0x2054f2};}};import{randomUUID as _0x51f2be}from'node:crypto';import{existsSync as _0x4e6441,mkdirSync as _0x2d0f54,readFileSync as _0x4ce428,writeFileSync as _0x339baa}from'node:fs';import{join as _0x306590}from'node:path';var X=_0x5639b1(0x265),P=0x100,_=/[\p{Cc}\p{Cf}\p{Cs}\uFFFD]/u;function z(_0x441a1c){const _0xaa6e17=_0x5639b1;return _0x441a1c[_0xaa6e17(0x1b9)]>0x0&&_0x441a1c[_0xaa6e17(0x257)]()===_0x441a1c&&!_[_0xaa6e17(0x1d7)](_0x441a1c)&&new TextEncoder()[_0xaa6e17(0x256)](_0x441a1c)[_0xaa6e17(0x20d)]<=P;}function _0x1d51(){const _0x5f2db4=['freeze','pendingupload','default','\x27\x20returned\x20by\x20moss-core','SessionIndex\x20\x27','currentPhase','resync','deleteWebSource','deleteDocs','cachePath','unloadIndexes','_create','SDK_VERSION_NUMBER','env','MossClient\x20is\x20closed','from','_fromInner','MOSS_INDEX_URL','session','[moss]\x20Ignoring\x20an\x20auth\x20request\x20with\x20no\x20usable\x20request\x20id;\x20custom\x20authentication\x20may\x20be\x20unavailable\x20for\x20this\x20client.\x20Cause:\x20','test','parseDocuments','POST','@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20SessionIndex.close()','docCount','applySessionIdentity','no\x20exact\x20artifact\x20identity','loadFromDisk','createAuthenticatedSessionInner','received\x20','deviceId','loadIndex','received\x20an\x20array\x20where\x20a\x20JobProgress\x20object\x20was\x20expected','createWebSource','loadQueryModel','MossClient\x20options.identity.','entries','deleteIndex','listWebSources','indexManager','now','withAuthenticator','addDocs','CLOUD_API_INDEX_URL','add','maxDepth','wrapProgress','fetchAndCache','map','filter','onProgress','startsWith','moss-core\x20runtime\x20ManageClient/IndexManager\x20is\x20missing\x20withAuthenticator\x20factory.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.','deref','deviceIdentity','inflight','ensureCachePathDeviceId','status','\x27\x20is\x20closed','Index\x20\x22','string','Unsupported\x20job\x20status\x20\x27','configuredIdentity','alpha','Authentication\x20failed\x20(HTTP\x20401):\x20','name','deleteDocs\x20requires\x20at\x20least\x20one\x20document\x20ID','projectId','received\x20a\x20progress\x20event\x20with\x20a\x20non-finite\x20progress\x20value\x20(','contentType','json','modelArtifactContractVersion','getAuthHeader','createIndexFromFiles\x20requires\x20at\x20least\x20one\x20file','byteLength','model','createAuthenticatedSessionInner\x20requires\x20a\x20custom\x20IAuthenticator\x20client','resyncWebSource','added','cache','delete','IndexManager','listIndexes','embedding','CLOUD_API_IDENTITY_URL','mossDeviceId','parseOptions','5873lwIqqQ','function','clear','object','timeout','moss-core\x20rejected\x20the\x20auth\x20token:\x20','\x20contains\x20an\x20unsupported\x20character','126SXpIue','The\x20installed\x20@moss-js/moss-core\x20does\x20not\x20support\x20multi-index\x20operations\x20(queryMultiIndex,\x20loadIndexes,\x20unloadIndexes).\x20Upgrade\x20@moss-js/moss-core.','userId','requires\x20explicit\x20query\x20embeddings','SessionIndex','561776ncfGqZ','/v1/manage','2762760vlDgqT','moss-minilm','message','received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20jobId\x20(','https://service.usemoss.dev','queryText','rejectAuthRequest','join','stringify','Unsupported\x20data\x20type\x20for\x20file\x20upload','maxDocuments','saveToDisk','queryMultiIndexText','data','moss-core\x20runtime\x20SessionIndex\x20is\x20missing\x20the\x20withAuthenticator\x20factory.\x20Upgrade\x20@moss-js/moss-core\x20to\x20a\x20build\x20that\x20supports\x20custom\x20authenticators\x20for\x20sessions.','addDocumentsText','updateWebSource','6sHTmAI','arrayBuffer','resolveAuthRequest','slice','isFinite','uploading','getJobStatus','authenticator','unloadIndex','loadIndexes','expiresIn','deleteDocuments','hasCustomAuthenticator','\x20must\x20be\x20at\x20most\x20','queryMultiIndex','cachePathDeviceId','authNotifyFn','isArray','body','queryMultiIndex\x20requires\x20at\x20least\x20one\x20index\x20name','[moss]\x20Auth\x20request\x20','maxPages','290963lSrrGB','toLowerCase','version','50017JXPhuP','applyIdentity','9200340mxPQhZ','query','encode','trim','Failed','inner','getWebSource','sources','includes','One\x20or\x20more\x20indexes\x20use\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.','normalizeJobStatus','completed','PendingUpload','Documents\x20missing\x20.embedding\x20for\x20custom\x20model:\x20','warn','8rGTPHm','received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20status\x20(','.moss-device-id','building','requireMultiIndexCore','modelId','MODEL_DOWNLOAD_URL','HTTP\x20error!\x20status:\x20','topK','getAuthToken','utf8','manageClient','authUrl','createIndexFromFiles','1390keTUUm','Web\x20source\x20methods\x20require\x20a\x20project\x20key.\x20Construct\x20MossClient\x20with\x20(projectId,\x20projectKey).','jobId','loadModel','close','respectRobots','includePaths','isSafeInteger','some','pushIndex','asyncDispose','4786280YSBqGC','text','then','[moss]\x20Dropping\x20a\x20malformed\x20job\x20progress\x20event;\x20progress\x20reporting\x20may\x20be\x20incomplete\x20for\x20this\x20operation.\x20Cause:\x20','custom','call','Bearer\x20','createIndex','excludePaths','path','rootUrl','MOSS_AUTH_URL','@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20MossClient.close()','.\x20All\x20documents\x20must\x20have\x20.embedding\x20set\x20when\x20using\x20modelId=\x27custom\x27.','getIndex','MOSS_CLOUD_API_BASE_URL','bind','progress','projectKey','received\x20a\x20progress\x20event\x20with\x20a\x20non-string\x20currentPhase\x20(','HTTP\x20','\x22\x20is\x20not\x20loaded.\x20Call\x20loadIndex(\x22','setIdentity','getDocs','manifestSha256','\x20UTF-8\x20bytes','length','toByteArray','MossClient\x20options.identity\x20must\x20be\x20an\x20object','pending_upload','create','replace','application/json','This\x20session\x20uses\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20embedding\x20via\x20QueryOptions.embedding.','indexName','expiresAt'];_0x1d51=function(){return _0x5f2db4;};return _0x1d51();}function E(_0x1c5996,_0x19d310){const _0x279c02=_0x5639b1;if(_0x1c5996!==void 0x0){if(typeof _0x1c5996!=_0x279c02(0x1ff)||_0x1c5996[_0x279c02(0x1b9)]===0x0)throw new TypeError(_0x279c02(0x1e6)+_0x19d310+'\x20must\x20be\x20a\x20non-empty\x20string');if(_0x1c5996[_0x279c02(0x257)]()!==_0x1c5996)throw new TypeError('MossClient\x20options.identity.'+_0x19d310+'\x20must\x20not\x20have\x20leading\x20or\x20trailing\x20whitespace');if(_[_0x279c02(0x1d7)](_0x1c5996))throw new TypeError('MossClient\x20options.identity.'+_0x19d310+_0x279c02(0x220));if(new TextEncoder()[_0x279c02(0x256)](_0x1c5996)['byteLength']>P)throw new TypeError(_0x279c02(0x1e6)+_0x19d310+_0x279c02(0x246)+P+_0x279c02(0x1b8));return _0x1c5996;}}function k(_0x3ba4b4){const _0x2cbbaf=_0x5639b1;if(_0x3ba4b4!==void 0x0){if(_0x3ba4b4===null||typeof _0x3ba4b4!=_0x2cbbaf(0x21d)||Array['isArray'](_0x3ba4b4))throw new TypeError(_0x2cbbaf(0x1bb));return Object[_0x2cbbaf(0x1c3)]({'deviceId':E(_0x3ba4b4[_0x2cbbaf(0x1e1)],_0x2cbbaf(0x1e1)),'userId':E(_0x3ba4b4[_0x2cbbaf(0x223)],'userId')});}}function U(_0x57cdf4){const _0x18970d=_0x5639b1;return _0x57cdf4?.[_0x18970d(0x1e1)]!==void 0x0||_0x57cdf4?.[_0x18970d(0x223)]!==void 0x0;}function M(_0x456e1d){const _0x5a3f6b=_0x5639b1;if(!_0x456e1d?.[_0x5a3f6b(0x257)]())return;let _0x3ef403=_0x306590(_0x456e1d,X);try{if(_0x4e6441(_0x3ef403)){let _0x4c2568=_0x4ce428(_0x3ef403,'utf8')['trim']();return z(_0x4c2568)?_0x4c2568:void 0x0;}_0x2d0f54(_0x456e1d,{'recursive':!0x0});let _0xb4999c=_0x51f2be();return _0x339baa(_0x3ef403,_0xb4999c,_0x5a3f6b(0x26d)),_0xb4999c;}catch{return;}}var Y=0x1;function y(_0x4cd0c5){const _0x5cf61f=_0x5639b1;let _0x3e9304=_0x4cd0c5[_0x5cf61f(0x20a)];if(typeof _0x3e9304!=_0x5cf61f(0x21b))throw q();let _0x42ffa3=_0x3e9304['call'](_0x4cd0c5);if(!Number[_0x5cf61f(0x278)](_0x42ffa3)||_0x42ffa3<Y)throw q();}function q(){return new Error('The\x20installed\x20@moss-js/moss-core\x20runtime\x20does\x20not\x20support\x20exact\x20model\x20artifact\x20identities.\x20Upgrade\x20moss-core\x20before\x20creating\x20this\x20session.');}var Ie=0x708*0x3e8;function S(_0x8a4388){return _0x8a4388 instanceof Error?_0x8a4388['message']:String(_0x8a4388);}function Z(_0xfe7385){const _0x4dad6f=_0x5639b1;if(_0xfe7385===null||typeof _0xfe7385!=_0x4dad6f(0x21d))return _0x4dad6f(0x1e0)+String(_0xfe7385);if(Array['isArray'](_0xfe7385))return _0x4dad6f(0x1e3);let _0x6ac39d=_0xfe7385;return typeof _0x6ac39d[_0x4dad6f(0x273)]!='string'||_0x6ac39d['jobId'][_0x4dad6f(0x1b9)]===0x0?_0x4dad6f(0x22b)+String(_0x6ac39d['jobId'])+')':typeof _0x6ac39d[_0x4dad6f(0x1fc)]!=_0x4dad6f(0x1ff)||_0x6ac39d['status']['length']===0x0?_0x4dad6f(0x264)+String(_0x6ac39d[_0x4dad6f(0x1fc)])+')':typeof _0x6ac39d[_0x4dad6f(0x1b0)]!='number'||!Number[_0x4dad6f(0x23d)](_0x6ac39d[_0x4dad6f(0x1b0)])?_0x4dad6f(0x207)+String(_0x6ac39d[_0x4dad6f(0x1b0)])+')':_0x6ac39d[_0x4dad6f(0x1c8)]!==void 0x0&&_0x6ac39d[_0x4dad6f(0x1c8)]!==null&&typeof _0x6ac39d[_0x4dad6f(0x1c8)]!=_0x4dad6f(0x1ff)?_0x4dad6f(0x1b2)+String(_0x6ac39d['currentPhase'])+')':null;}var x=class{[_0x5639b1(0x240)];[_0x5639b1(0x26e)];[_0x5639b1(0x1ea)];[_0x5639b1(0x248)];[_0x5639b1(0x201)];[_0x5639b1(0x206)];[_0x5639b1(0x249)];constructor(_0x4f4b26,_0x5cf317,_0x159501){const _0x4c0475=_0x5639b1;this['configuredIdentity']=k(_0x159501?.['identity']),this[_0x4c0475(0x248)]=M(_0x159501?.['cachePath']),this['projectId']=_0x4f4b26;let _0x5d18fc=typeof _0x5cf317==_0x4c0475(0x1ff)?new f(_0x4f4b26,_0x5cf317):_0x5cf317;this[_0x4c0475(0x240)]=new I(_0x5d18fc);let _0x58da2d=_0x554d84,_0x4167d8=_0x58da2d['ManageClient']??_0x58da2d['default']?.['ManageClient'],_0x312fa6=_0x58da2d[_0x4c0475(0x214)]??_0x58da2d[_0x4c0475(0x1c5)]?.[_0x4c0475(0x214)];if(!_0x4167d8||!_0x312fa6)throw new Error('moss-core\x20runtime\x20is\x20missing\x20ManageClient/IndexManager\x20exports');if(typeof _0x5cf317==_0x4c0475(0x1ff))this[_0x4c0475(0x26e)]=new _0x4167d8(_0x4f4b26,_0x5cf317),this[_0x4c0475(0x1ea)]=new _0x312fa6(_0x4f4b26,_0x5cf317);else{let _0x4018e7=_0x58da2d[_0x4c0475(0x23b)]??_0x58da2d[_0x4c0475(0x1c5)]?.['resolveAuthRequest'],_0x1425a2=_0x58da2d[_0x4c0475(0x22e)]??_0x58da2d['default']?.['rejectAuthRequest'];if(!_0x4018e7||!_0x1425a2)throw new Error('moss-core\x20runtime\x20is\x20missing\x20resolveAuthRequest/rejectAuthRequest\x20exports.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.');let _0x2a75e2=this[_0x4c0475(0x240)],_0x2b3d7a=(_0x58ab8d,_0x4e63b0)=>{const _0x23b8e4=_0x4c0475;try{_0x1425a2(_0x58ab8d,_0x4e63b0);}catch(_0x32a351){console[_0x23b8e4(0x262)](_0x23b8e4(0x24d)+_0x58ab8d+'\x20could\x20not\x20be\x20settled:\x20'+S(_0x32a351));}},_0x269207=(_0x4591b4,_0xb47031)=>{const _0x4dfed7=_0x4c0475;try{_0x4018e7(_0x4591b4,_0xb47031);}catch(_0x47228a){_0x2b3d7a(_0x4591b4,_0x4dfed7(0x21f)+S(_0x47228a));}},_0x113109=!0x1,_0x5a40dc=(_0x334f33,_0x4a9c57)=>{const _0x24805e=_0x4c0475;if(_0x334f33||!Number[_0x24805e(0x278)](_0x4a9c57)||_0x4a9c57<0x0){_0x113109||(_0x113109=!0x0,console[_0x24805e(0x262)](_0x24805e(0x1d6)+(_0x334f33?_0x334f33['message']:_0x24805e(0x1e0)+String(_0x4a9c57))));return;}_0x2a75e2[_0x24805e(0x20b)]()[_0x24805e(0x27e)](_0x46fcd9=>{const _0x5728ea=_0x24805e;let _0x3e5ac1=_0x46fcd9[_0x5728ea(0x1f6)]('Bearer\x20')?_0x46fcd9[_0x5728ea(0x23c)](0x7):_0x46fcd9;_0x269207(_0x4a9c57,_0x3e5ac1);},_0x3fbec6=>_0x2b3d7a(_0x4a9c57,S(_0x3fbec6)));};this[_0x4c0475(0x249)]=_0x5a40dc;let _0x371b9e=_0x4167d8,_0x1ae96d=_0x312fa6;if(!_0x371b9e['withAuthenticator']||!_0x1ae96d[_0x4c0475(0x1ec)])throw new Error(_0x4c0475(0x1f7));this[_0x4c0475(0x26e)]=_0x371b9e[_0x4c0475(0x1ec)](_0x4f4b26,_0x5a40dc),this[_0x4c0475(0x1ea)]=_0x1ae96d[_0x4c0475(0x1ec)](_0x4f4b26,_0x5a40dc);}this[_0x4c0475(0x253)](this[_0x4c0475(0x1ea)]);}async[_0x5639b1(0x275)](){const _0x31396a=_0x5639b1;let _0x5cc5a1=this[_0x31396a(0x1ea)][_0x31396a(0x275)];if(typeof _0x5cc5a1!=_0x31396a(0x21b))throw new Error(_0x31396a(0x1ab));await _0x5cc5a1['call'](this['indexManager']);}async['getAuthToken'](){const _0x4ff5e8=_0x5639b1;return this[_0x4ff5e8(0x240)][_0x4ff5e8(0x26c)]();}[_0x5639b1(0x1f1)](_0x1f9964){if(!_0x1f9964)return;let _0x4f832f=!0x1;return(_0x8167b,_0x1cc3bf)=>{const _0x57aef1=_0x186b;let _0x1c57b8=_0x8167b?_0x8167b['message']:Z(_0x1cc3bf);if(_0x1c57b8!==null){_0x4f832f||(_0x4f832f=!0x0,console[_0x57aef1(0x262)](_0x57aef1(0x27f)+_0x1c57b8));return;}_0x1f9964(_0x1cc3bf);};}['normalizeJobStatus'](_0x551bcb){const _0x348132=_0x5639b1;let _0x57dc63=_0x551bcb[_0x348132(0x257)]()[_0x348132(0x250)]()[_0x348132(0x1be)](/\s+/g,'_'),_0x8e3859=_0x57dc63[_0x348132(0x1be)](/_/g,'');if(_0x57dc63===_0x348132(0x1bc)||_0x8e3859===_0x348132(0x1c4))return _0x4017a7[_0x348132(0x260)];if(_0x57dc63===_0x348132(0x23e))return _0x4017a7['Uploading'];if(_0x57dc63===_0x348132(0x266))return _0x4017a7['Building'];if(_0x57dc63===_0x348132(0x25f))return _0x4017a7['Completed'];if(_0x57dc63==='failed')return _0x4017a7[_0x348132(0x258)];throw new Error(_0x348132(0x200)+_0x551bcb+_0x348132(0x1c6));}async[_0x5639b1(0x1a6)](_0x8494d0,_0x4c308c,_0x139f9c,_0x87e72a){const _0x5287c5=_0x5639b1;if(!_0x4c308c[_0x5287c5(0x1b9)])throw new Error('createIndex\x20requires\x20at\x20least\x20one\x20document');return await this[_0x5287c5(0x26e)][_0x5287c5(0x1a6)](_0x8494d0,_0x4c308c,_0x139f9c,this[_0x5287c5(0x1f1)](_0x87e72a?.[_0x5287c5(0x1f5)]));}async[_0x5639b1(0x1ba)](_0x5e0575){const _0x4d7a5c=_0x5639b1;if(_0x5e0575 instanceof Uint8Array)return Array[_0x4d7a5c(0x1d2)](_0x5e0575);if(_0x5e0575 instanceof ArrayBuffer)return Array['from'](new Uint8Array(_0x5e0575));if(typeof _0x5e0575[_0x4d7a5c(0x23a)]=='function'){let _0x455d44=await _0x5e0575[_0x4d7a5c(0x23a)]();return Array[_0x4d7a5c(0x1d2)](new Uint8Array(_0x455d44));}throw new Error(_0x4d7a5c(0x231));}async[_0x5639b1(0x270)](_0x136078,_0x7464c0,_0x427661){const _0x5a5525=_0x5639b1;if(_0x7464c0[_0x5a5525(0x1b9)]===0x0)throw new Error(_0x5a5525(0x20c));let _0x578a78=_0x427661?.[_0x5a5525(0x268)]??_0x5a5525(0x229),_0x55fdb1=await Promise['all'](_0x7464c0['map'](async _0x43a0c8=>({'name':_0x43a0c8['name'],'contentType':_0x43a0c8[_0x5a5525(0x208)],'path':_0x43a0c8[_0x5a5525(0x1a8)]??void 0x0,'data':_0x43a0c8[_0x5a5525(0x235)]!=null?await this['toByteArray'](_0x43a0c8[_0x5a5525(0x235)]):void 0x0})));return await this[_0x5a5525(0x26e)][_0x5a5525(0x270)](_0x136078,_0x55fdb1,_0x578a78,this['wrapProgress'](_0x427661?.[_0x5a5525(0x1f5)]),_0x427661?.[_0x5a5525(0x219)]??null);}async['addDocs'](_0x5eaf93,_0x3a0a08,_0x167c0d){const _0x8e5436=_0x5639b1;if(Array[_0x8e5436(0x24a)](_0x3a0a08)&&_0x3a0a08['length']===0x0)throw new Error('addDocs\x20requires\x20at\x20least\x20one\x20document');return await this[_0x8e5436(0x26e)]['addDocs'](_0x5eaf93,_0x3a0a08,_0x167c0d??null,this['wrapProgress'](_0x167c0d?.['onProgress']));}async['deleteDocs'](_0x333398,_0x52d548,_0x403b29){const _0x114698=_0x5639b1;if(Array['isArray'](_0x52d548)&&_0x52d548[_0x114698(0x1b9)]===0x0)throw new Error(_0x114698(0x205));return await this['manageClient'][_0x114698(0x1cb)](_0x333398,_0x52d548,this[_0x114698(0x1f1)](_0x403b29?.[_0x114698(0x1f5)]));}async['getJobStatus'](_0xc06a4b){const _0x2a0dab=_0x5639b1;let _0x42e21b=await this['manageClient'][_0x2a0dab(0x23f)](_0xc06a4b);return{..._0x42e21b,'status':this[_0x2a0dab(0x25e)](_0x42e21b[_0x2a0dab(0x1fc)]),'currentPhase':_0x42e21b[_0x2a0dab(0x1c8)]??null,'error':_0x42e21b['error']??null};}async[_0x5639b1(0x1ad)](_0x4c0d92){const _0x15c0f2=_0x5639b1;return this[_0x15c0f2(0x26e)][_0x15c0f2(0x1ad)](_0x4c0d92);}async['listIndexes'](){const _0x19497c=_0x5639b1;return this['manageClient'][_0x19497c(0x215)]();}async['deleteIndex'](_0x10b234){const _0x4d0a4c=_0x5639b1;return this[_0x4d0a4c(0x26e)]['deleteIndex'](_0x10b234);}async['getDocs'](_0x4c48ae,_0x874ab6){const _0x275e0d=_0x5639b1;return this[_0x275e0d(0x26e)][_0x275e0d(0x1b6)](_0x4c48ae,_0x874ab6??null);}async[_0x5639b1(0x1e2)](_0x2c297b,_0x5ab87e){const _0x2b5e07=_0x5639b1;this[_0x2b5e07(0x1fb)](_0x5ab87e?.[_0x2b5e07(0x1cc)]);let _0x28301a=await this['indexManager'][_0x2b5e07(0x1e2)](_0x2c297b,_0x5ab87e??null);return _0x28301a[_0x2b5e07(0x20e)]['id']!==_0x2b5e07(0x280)&&await this[_0x2b5e07(0x1ea)][_0x2b5e07(0x1e5)](_0x2c297b),_0x28301a[_0x2b5e07(0x204)];}async[_0x5639b1(0x242)](_0x1258a5,_0x19a328){const _0x5db152=_0x5639b1;let _0x4ebb75=this[_0x5db152(0x267)]();return this['ensureCachePathDeviceId'](_0x19a328?.['cachePath']),_0x4ebb75[_0x5db152(0x242)](_0x1258a5,_0x19a328??null);}async[_0x5639b1(0x241)](_0x127a08){const _0x58535f=_0x5639b1;return this[_0x58535f(0x1ea)]['unloadIndex'](_0x127a08);}async[_0x5639b1(0x1cd)](_0x3a4535){const _0x1aaf23=_0x5639b1;return this[_0x1aaf23(0x267)]()['unloadIndexes'](_0x3a4535);}[_0x5639b1(0x267)](){const _0xa6ea03=_0x5639b1;let _0xd2501a=this[_0xa6ea03(0x1ea)];if(typeof _0xd2501a['queryMultiIndex']!=_0xa6ea03(0x21b)||typeof _0xd2501a[_0xa6ea03(0x234)]!='function'||typeof _0xd2501a[_0xa6ea03(0x242)]!=_0xa6ea03(0x21b)||typeof _0xd2501a[_0xa6ea03(0x1cd)]!='function')throw new Error(_0xa6ea03(0x222));return{'queryMultiIndex':_0xd2501a[_0xa6ea03(0x247)][_0xa6ea03(0x1af)](_0xd2501a),'queryMultiIndexText':_0xd2501a[_0xa6ea03(0x234)][_0xa6ea03(0x1af)](_0xd2501a),'loadIndexes':_0xd2501a[_0xa6ea03(0x242)][_0xa6ea03(0x1af)](_0xd2501a),'unloadIndexes':_0xd2501a[_0xa6ea03(0x1cd)][_0xa6ea03(0x1af)](_0xd2501a)};}[_0x5639b1(0x1fb)](_0x53a82a){const _0x4950ae=_0x5639b1;_0x53a82a&&this[_0x4950ae(0x248)]===void 0x0&&M(_0x53a82a);}[_0x5639b1(0x253)]=_0x351ed2=>{const _0x1fb6db=_0x5639b1;!U(this[_0x1fb6db(0x201)])&&this['cachePathDeviceId']===void 0x0||_0x351ed2[_0x1fb6db(0x1b5)](this[_0x1fb6db(0x201)]?.[_0x1fb6db(0x1e1)]??null,this[_0x1fb6db(0x201)]?.[_0x1fb6db(0x223)]??null,this[_0x1fb6db(0x248)]??null);};[_0x5639b1(0x1dc)]=_0x12c83c=>{const _0x18655e=_0x5639b1;let _0x3b21f1=this[_0x18655e(0x1ea)][_0x18655e(0x1f9)]?.();if(!_0x3b21f1){this['applyIdentity'](_0x12c83c);return;}_0x12c83c[_0x18655e(0x1b5)](_0x3b21f1[_0x18655e(0x1e1)]??null,this[_0x18655e(0x201)]?.[_0x18655e(0x223)]??null,_0x3b21f1[_0x18655e(0x218)]??null);};[_0x5639b1(0x245)](){const _0x4bf0f9=_0x5639b1;return this[_0x4bf0f9(0x249)]!==void 0x0;}async[_0x5639b1(0x1df)](_0x24c8c1,_0x1313c0,_0x5158d2){const _0x5e8d21=_0x5639b1;if(!this['authNotifyFn'])throw new Error(_0x5e8d21(0x20f));let _0x384b8a=_0x554d84,_0x2148c9=_0x384b8a[_0x5e8d21(0x225)]??_0x384b8a[_0x5e8d21(0x1c5)]?.['SessionIndex'];if(!_0x2148c9||typeof _0x2148c9[_0x5e8d21(0x1ec)]!=_0x5e8d21(0x21b))throw new Error(_0x5e8d21(0x236));return _0x5158d2&&y(_0x2148c9),_0x2148c9[_0x5e8d21(0x1ec)](_0x24c8c1,_0x1313c0,this[_0x5e8d21(0x206)],this[_0x5e8d21(0x249)],null,null,_0x5158d2?.[_0x5e8d21(0x251)]??null,_0x5158d2?.['manifestSha256']??null);}async[_0x5639b1(0x255)](_0x2b2fae,_0x1868e0,_0x1b9056){const _0x2cfce5=_0x5639b1;if(!await this[_0x2cfce5(0x1ea)]['hasIndex'](_0x2b2fae))throw new Error(_0x2cfce5(0x1fe)+_0x2b2fae+_0x2cfce5(0x1b4)+_0x2b2fae+'\x22)\x20or\x20loadIndexes([...])\x20before\x20querying;\x20queries\x20run\x20locally\x20and\x20there\x20is\x20no\x20cloud\x20query\x20fallback.');let _0x2a3985=_0x1b9056?.[_0x2cfce5(0x26b)]??0x5,_0x520670=_0x1b9056?.[_0x2cfce5(0x202)]??0.8;return _0x1b9056?.[_0x2cfce5(0x216)]?this[_0x2cfce5(0x1ea)][_0x2cfce5(0x255)](_0x2b2fae,_0x1868e0,_0x1b9056[_0x2cfce5(0x216)],_0x2a3985,_0x520670,_0x1b9056?.[_0x2cfce5(0x1f4)]):this[_0x2cfce5(0x1ea)]['queryText'](_0x2b2fae,_0x1868e0,_0x2a3985,_0x520670,_0x1b9056?.[_0x2cfce5(0x1f4)]);}async[_0x5639b1(0x247)](_0xc1d19c,_0x42cc10,_0x2c43c9){const _0x56b46a=_0x5639b1;if(_0xc1d19c[_0x56b46a(0x1b9)]===0x0)throw new Error(_0x56b46a(0x24c));let _0x2f6334=this[_0x56b46a(0x267)](),_0x5d32cd=_0x2c43c9?.[_0x56b46a(0x26b)]??0xa,_0x574a6b=_0x2c43c9?.[_0x56b46a(0x202)]??0.8;if(_0x2c43c9?.[_0x56b46a(0x216)])return _0x2f6334['queryMultiIndex'](_0xc1d19c,_0x42cc10,_0x2c43c9[_0x56b46a(0x216)],_0x5d32cd,_0x574a6b,_0x2c43c9?.[_0x56b46a(0x1f4)]);try{return await _0x2f6334[_0x56b46a(0x234)](_0xc1d19c,_0x42cc10,_0x5d32cd,_0x574a6b,_0x2c43c9?.[_0x56b46a(0x1f4)]);}catch(_0x403246){throw _0x403246 instanceof Error&&_0x403246['message'][_0x56b46a(0x25c)](_0x56b46a(0x1dd))?new Error(_0x403246[_0x56b46a(0x22a)]+'\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.',{'cause':_0x403246}):_0x403246 instanceof Error&&_0x403246['message'][_0x56b46a(0x25c)](_0x56b46a(0x224))?new Error(_0x56b46a(0x25d),{'cause':_0x403246}):_0x403246;}}};import{SessionIndex as _0x38addb}from'@moss-js/moss-core';var h=class r{#e;#r;#s;#i=!0x1;#a;constructor(_0x71a272,_0xbe56ee,_0x2246e9){this.#s=_0x71a272,this.#r=_0xbe56ee,this.#e=_0x2246e9;}static async[_0x5639b1(0x1ce)](_0x326731,_0x3b7da4,_0x15c98d,_0x3b38a6,_0x18c2b1,_0x57ce6c,_0x39a2c2){const _0x42c75f=_0x5639b1;let _0x40ec2d=_0x38addb;_0x39a2c2&&y(_0x40ec2d);let _0x30cf42=await _0x40ec2d[_0x42c75f(0x1bd)](_0x326731,_0x3b7da4,_0x15c98d,_0x3b38a6,_0x18c2b1??null,_0x39a2c2?.[_0x42c75f(0x251)]??null,_0x39a2c2?.[_0x42c75f(0x1b7)]??null);return r[_0x42c75f(0x1d3)](_0x326731,_0x3b7da4,_0x30cf42,_0x57ce6c);}static[_0x5639b1(0x1d3)](_0x43f8d7,_0x3f8369,_0x11f981,_0x3a61a5){return _0x3a61a5?.(_0x11f981),new r(_0x43f8d7,_0x3f8369,_0x11f981);}get['name'](){return this.#s;}get[_0x5639b1(0x1db)](){const _0x55c54f=_0x5639b1;return this.#n(),this.#e[_0x55c54f(0x1db)];}get[_0x5639b1(0x268)](){return this.#r;}async[_0x5639b1(0x1ed)](_0x33c705,_0x5a789f){const _0x226eb0=_0x5639b1;this.#n();let _0x505c30=_0x5a789f?{'upsert':_0x5a789f['upsert']??!0x0}:void 0x0;if(this.#r===_0x226eb0(0x280)){let _0x4395cc=r.#t(_0x33c705),_0x4aacc5=_0x33c705[_0x226eb0(0x1f3)](_0x624179=>{const _0x5334ac=_0x226eb0;let _0x37d270={..._0x624179};return delete _0x37d270[_0x5334ac(0x216)],_0x37d270;}),_0x5dedd8=this.#e['addDocuments'](_0x4aacc5,_0x4395cc,_0x505c30);return{'added':_0x5dedd8[_0x226eb0(0x211)],'updated':_0x5dedd8['updated']};}let _0x32cc68=this.#e[_0x226eb0(0x237)](_0x33c705,_0x505c30);return{'added':_0x32cc68[_0x226eb0(0x211)],'updated':_0x32cc68['updated']};}async[_0x5639b1(0x1cb)](_0x4eac45){const _0x10d2d6=_0x5639b1;return this.#n(),this.#e[_0x10d2d6(0x244)](_0x4eac45);}async['getDocs'](_0x28650e){return this.#n(),this.#e['getDocuments'](_0x28650e??null);}async[_0x5639b1(0x255)](_0x4521df,_0x5cb6dc){const _0x1618b1=_0x5639b1;this.#n();let _0xe4565f=_0x5cb6dc?.[_0x1618b1(0x26b)]??0x5,_0x1e3c6d=_0x5cb6dc?.[_0x1618b1(0x202)]??0.8,_0x452b06=_0x5cb6dc?.[_0x1618b1(0x1f4)]??null,_0x57014d=_0x5cb6dc?.[_0x1618b1(0x216)];if(_0x57014d==null){if(this.#r===_0x1618b1(0x280))throw new Error(_0x1618b1(0x1c0));return this.#e[_0x1618b1(0x22d)](_0x4521df,_0xe4565f,_0x1e3c6d,_0x452b06);}return this.#e[_0x1618b1(0x255)](_0x4521df,_0xe4565f,Array[_0x1618b1(0x1d2)](_0x57014d),_0x1e3c6d,_0x452b06);}async[_0x5639b1(0x1e2)](_0x2a0905,_0x4e66d8){const _0x3bb4bf=_0x5639b1;return this.#n(),this.#e[_0x3bb4bf(0x1e2)](_0x2a0905,_0x4e66d8??null);}async[_0x5639b1(0x27a)](){const _0x4f81cb=_0x5639b1;return this.#n(),this.#e[_0x4f81cb(0x27a)]();}async[_0x5639b1(0x233)](_0x100705){const _0x6eb56f=_0x5639b1;this.#n(),this.#e[_0x6eb56f(0x233)](_0x100705);}async['loadFromDisk'](_0x493d51){const _0x12886e=_0x5639b1;return this.#n(),this.#e[_0x12886e(0x1de)](_0x493d51);}#n(){const _0x7ab2e0=_0x5639b1;if(this.#i)throw new Error(_0x7ab2e0(0x1c7)+this.#s+_0x7ab2e0(0x1fd));}[_0x5639b1(0x275)](){return this.#a??=this.#o(),this.#a;}async #o(){const _0x386f82=_0x5639b1;this.#i=!0x0;let _0x3d8d2a=this.#e['close'];if(typeof _0x3d8d2a!='function')throw new Error(_0x386f82(0x1da));await _0x3d8d2a[_0x386f82(0x281)](this.#e);}async[Symbol[_0x5639b1(0x27b)]](){const _0xb31233=_0x5639b1;return this[_0xb31233(0x275)]();}async['_warmModel'](){const _0xc4e97=_0x5639b1;this.#n(),this.#r!=='custom'&&this.#e[_0xc4e97(0x274)]();}static#t(_0x3811c5){const _0x4d5fea=_0x5639b1;let _0x204ffe=_0x3811c5[_0x4d5fea(0x1f4)](_0x52a22c=>!_0x52a22c[_0x4d5fea(0x216)]||_0x52a22c[_0x4d5fea(0x216)][_0x4d5fea(0x1b9)]===0x0)[_0x4d5fea(0x1f3)](_0x1d1c0e=>_0x1d1c0e['id']);if(_0x204ffe[_0x4d5fea(0x1b9)]>0x0)throw new Error(_0x4d5fea(0x261)+_0x204ffe[_0x4d5fea(0x22f)](',\x20')+_0x4d5fea(0x1ac));return _0x3811c5[_0x4d5fea(0x1f3)](_0xff30b6=>Array[_0x4d5fea(0x1d2)](_0xff30b6[_0x4d5fea(0x216)]??[]));}},te=_0x5639b1(0x22c),ne=_0x5639b1(0x227),b=class extends Error{[_0x5639b1(0x1fc)];[_0x5639b1(0x24b)];constructor(_0x57a84a,_0x1b7daf){const _0x5974aa=_0x5639b1;let _0x21ae89=_0x1b7daf?':\x20'+_0x1b7daf:'';super(_0x5974aa(0x26a)+_0x57a84a+_0x21ae89),this[_0x5974aa(0x204)]='ManageApiError',this[_0x5974aa(0x1fc)]=_0x57a84a,this[_0x5974aa(0x24b)]=_0x1b7daf;}};function _0x186b(_0x4cbc9c,_0xf63222){_0x4cbc9c=_0x4cbc9c-0x1a6;const _0x1d5187=_0x1d51();let _0x186bb7=_0x1d5187[_0x4cbc9c];return _0x186bb7;}function re(){const _0x45b071=_0x5639b1;return''+(typeof process<'u'&&process[_0x45b071(0x1d0)][_0x45b071(0x1ae)]||te)[_0x45b071(0x1be)](/\/+$/,'')+ne;}function se(_0xb2e151){const _0x2c8075=_0x5639b1;return _0xb2e151?Object['fromEntries'](Object[_0x2c8075(0x1e7)](_0xb2e151)[_0x2c8075(0x1f4)](([,_0x584d97])=>_0x584d97!==void 0x0)):{};}async function j(_0x5c3b3e,_0x2bae92,_0x27a7a9,_0x41be97){const _0x1ff40b=_0x5639b1;let _0x53377f={...se(_0x41be97),'action':_0x27a7a9,'projectId':_0x5c3b3e},_0x3c01f9=await fetch(re(),{'method':_0x1ff40b(0x1d9),'headers':{'Content-Type':'application/json','X-Project-Key':_0x2bae92},'body':JSON[_0x1ff40b(0x230)](_0x53377f),'signal':AbortSignal['timeout'](0x927c0)}),_0x39e03a=await _0x3c01f9[_0x1ff40b(0x27d)]();if(!_0x3c01f9['ok'])throw new b(_0x3c01f9[_0x1ff40b(0x1fc)],_0x39e03a);return _0x39e03a?JSON['parse'](_0x39e03a):{};}var F=_0x5639b1(0x229),A=class{#e;#r;#s;#i=!0x1;#a;#n=new Set();constructor(_0x1348f7,_0x54caac,_0x5a2a10){const _0x39e708=_0x5639b1;this.#e=new x(_0x1348f7,_0x54caac,_0x5a2a10),this.#r=_0x1348f7,this.#s=typeof _0x54caac==_0x39e708(0x1ff)?_0x54caac:null;}async[_0x5639b1(0x26c)](){const _0x9e0a8b=_0x5639b1;return this.#t(),this.#e[_0x9e0a8b(0x26c)]();}async[_0x5639b1(0x1a6)](_0x7ce404,_0x2e2292,_0x192ad8){const _0x4145e9=_0x5639b1;this.#t();let _0x34bdd0;return _0x192ad8?.[_0x4145e9(0x268)]!==void 0x0?_0x34bdd0=_0x192ad8['modelId']:_0x34bdd0=_0x2e2292[_0x4145e9(0x279)](_0x1ddd58=>Array[_0x4145e9(0x24a)](_0x1ddd58[_0x4145e9(0x216)])&&_0x1ddd58[_0x4145e9(0x216)][_0x4145e9(0x1b9)]>0x0)?_0x4145e9(0x280):F,this.#e['createIndex'](_0x7ce404,_0x2e2292,_0x34bdd0,_0x192ad8);}async[_0x5639b1(0x270)](_0x1f4e83,_0xd0e61b,_0x4c16ad){const _0x268254=_0x5639b1;return this.#t(),this.#e[_0x268254(0x270)](_0x1f4e83,_0xd0e61b,_0x4c16ad);}async['getIndex'](_0x1c7e8e){const _0x4eacbb=_0x5639b1;return this.#t(),this.#e[_0x4eacbb(0x1ad)](_0x1c7e8e);}async[_0x5639b1(0x215)](){const _0x268363=_0x5639b1;return this.#t(),this.#e[_0x268363(0x215)]();}async[_0x5639b1(0x1e8)](_0x4cc794){return this.#t(),this.#e['deleteIndex'](_0x4cc794);}async[_0x5639b1(0x1ed)](_0x35a58f,_0x25d7ee,_0x46737f){return this.#t(),this.#e['addDocs'](_0x35a58f,_0x25d7ee,_0x46737f);}async[_0x5639b1(0x1cb)](_0x42104e,_0x463b00,_0x54defe){const _0x595d2d=_0x5639b1;return this.#t(),this.#e[_0x595d2d(0x1cb)](_0x42104e,_0x463b00,_0x54defe);}async[_0x5639b1(0x23f)](_0x5e0d24){const _0x3bae03=_0x5639b1;return this.#t(),this.#e[_0x3bae03(0x23f)](_0x5e0d24);}async['createWebSource'](_0x5727e3,_0x19f388,_0x6a1497){const _0x341f55=_0x5639b1;return this.#t(),this.#o(_0x341f55(0x1e4),{'rootUrl':_0x5727e3,'indexName':_0x19f388,'maxPages':_0x6a1497?.[_0x341f55(0x24e)],'maxDocuments':_0x6a1497?.[_0x341f55(0x232)],'maxDepth':_0x6a1497?.[_0x341f55(0x1f0)],'includePaths':_0x6a1497?.[_0x341f55(0x277)],'excludePaths':_0x6a1497?.[_0x341f55(0x1a7)],'respectRobots':_0x6a1497?.[_0x341f55(0x276)],'parseDocuments':_0x6a1497?.[_0x341f55(0x1d8)],'refreshCadence':_0x6a1497?.['refreshCadence'],'modelId':_0x6a1497?.[_0x341f55(0x268)]});}async[_0x5639b1(0x1e9)](_0x4ede8a){const _0x870232=_0x5639b1;this.#t();let _0x19b1b5=(await this.#o('listWebSources',_0x4ede8a!==void 0x0?{'indexName':_0x4ede8a}:void 0x0))[_0x870232(0x25b)]??[];return _0x4ede8a===void 0x0?_0x19b1b5:_0x19b1b5['filter'](_0x127615=>_0x127615[_0x870232(0x1c1)]===_0x4ede8a);}async[_0x5639b1(0x25a)](_0x46cd0f){const _0x1c0b05=_0x5639b1;return this.#t(),this.#o(_0x1c0b05(0x25a),{'sourceId':_0x46cd0f});}async[_0x5639b1(0x238)](_0x4d9090,_0x139fcf){const _0x3731ae=_0x5639b1;return this.#t(),this.#o(_0x3731ae(0x238),{'sourceId':_0x4d9090,'refreshCadence':_0x139fcf['refreshCadence'],'rootUrl':_0x139fcf[_0x3731ae(0x1a9)],'includePaths':_0x139fcf[_0x3731ae(0x277)],'excludePaths':_0x139fcf[_0x3731ae(0x1a7)],'maxDepth':_0x139fcf['maxDepth'],'maxPages':_0x139fcf[_0x3731ae(0x24e)],'resync':_0x139fcf[_0x3731ae(0x1c9)]});}async[_0x5639b1(0x210)](_0x3b6e9a){const _0x2b4b48=_0x5639b1;return this.#t(),this.#o(_0x2b4b48(0x210),{'sourceId':_0x3b6e9a});}async['deleteWebSource'](_0x30aac2){const _0x153eb5=_0x5639b1;return this.#t(),this.#o(_0x153eb5(0x1ca),{'sourceId':_0x30aac2});}async #o(_0x4ac04d,_0x4005ee){const _0xef437a=_0x5639b1;if(this.#s===null)throw new Error(_0xef437a(0x272));return j(this.#r,this.#s,_0x4ac04d,_0x4005ee);}async['getDocs'](_0x1bc3a7,_0x13f690){const _0x42f7a1=_0x5639b1;return this.#t(),this.#e[_0x42f7a1(0x1b6)](_0x1bc3a7,_0x13f690);}async[_0x5639b1(0x1e2)](_0x44ea85,_0x47d1a9){return this.#t(),this.#e['loadIndex'](_0x44ea85,_0x47d1a9);}async[_0x5639b1(0x242)](_0x2d9e41,_0x5ecfbd){const _0x5eacb2=_0x5639b1;return this.#t(),this.#e[_0x5eacb2(0x242)](_0x2d9e41,_0x5ecfbd);}async[_0x5639b1(0x241)](_0x56d354){const _0xda0847=_0x5639b1;return this.#t(),this.#e[_0xda0847(0x241)](_0x56d354);}async['unloadIndexes'](_0x3709aa){const _0x101bf0=_0x5639b1;return this.#t(),this.#e[_0x101bf0(0x1cd)](_0x3709aa);}async['query'](_0x5a95ca,_0x512da0,_0x395cc4){const _0x127725=_0x5639b1;return this.#t(),this.#e[_0x127725(0x255)](_0x5a95ca,_0x512da0,_0x395cc4);}async['queryMultiIndex'](_0x2899fd,_0x4c445f,_0x2be5c0){const _0x43c395=_0x5639b1;return this.#t(),this.#e[_0x43c395(0x247)](_0x2899fd,_0x4c445f,_0x2be5c0);}async[_0x5639b1(0x1d5)](_0x3a9262,_0x80bfd4=F,_0x2ed862){const _0x300913=_0x5639b1;this.#t();let _0x165952=this.#e['applySessionIdentity'],_0x57cf9b;if(this.#s!==null)_0x57cf9b=await h['_create'](_0x3a9262,_0x80bfd4,this.#r,this.#s,void 0x0,_0x165952,_0x2ed862);else{let _0x31f62b=await this.#e[_0x300913(0x1df)](_0x3a9262,_0x80bfd4,_0x2ed862);_0x57cf9b=h[_0x300913(0x1d3)](_0x3a9262,_0x80bfd4,_0x31f62b,_0x165952);}await _0x57cf9b['_warmModel']();for(let _0x285703 of this.#n)_0x285703[_0x300913(0x1f8)]()||this.#n[_0x300913(0x213)](_0x285703);return this.#n[_0x300913(0x1ef)](new WeakRef(_0x57cf9b)),_0x57cf9b;}#t(){const _0x5346e4=_0x5639b1;if(this.#i)throw new Error(_0x5346e4(0x1d1));}[_0x5639b1(0x275)](){return this.#a??=this.#u(),this.#a;}async #u(){const _0x57b428=_0x5639b1;this.#i=!0x0;let _0x497ee5=[...this.#n]['map'](_0x3e0f28=>_0x3e0f28[_0x57b428(0x1f8)]())[_0x57b428(0x1f4)](_0x20f445=>_0x20f445!==void 0x0);this.#n[_0x57b428(0x21c)](),await Promise['all'](_0x497ee5[_0x57b428(0x1f3)](_0x24efe3=>_0x24efe3[_0x57b428(0x275)]())),await this.#e[_0x57b428(0x275)]();}async[Symbol[_0x5639b1(0x27b)]](){const _0x51822e=_0x5639b1;return this[_0x51822e(0x275)]();}};export{b as ManageApiError,A as MossClient,h as SessionIndex};
|
package/dist/moss.d.ts
CHANGED
|
@@ -89,6 +89,10 @@ export declare interface IAuthenticator {
|
|
|
89
89
|
getAuthHeader(): Promise<string>;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
declare interface IdentityTarget {
|
|
93
|
+
setIdentity(deviceId?: string | null, userId?: string | null, mossDeviceId?: string | null): void;
|
|
94
|
+
}
|
|
95
|
+
|
|
92
96
|
/**
|
|
93
97
|
* ISO 8601 date string format.
|
|
94
98
|
* @example "2025-09-26T15:04:05Z"
|
|
@@ -601,13 +605,11 @@ export declare class MossClient {
|
|
|
601
605
|
|
|
602
606
|
export declare interface MossClientOptions {
|
|
603
607
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
* as the billable `deviceId` when no host device id is configured.
|
|
607
|
-
*
|
|
608
|
-
* device
|
|
609
|
-
* this option to use one path consistently across client and session
|
|
610
|
-
* telemetry.
|
|
608
|
+
* Directory whose `.moss-device-id` file is adopted as Moss's stable device
|
|
609
|
+
* UUID for this client and its sessions. It is emitted as `mossDeviceId`,
|
|
610
|
+
* and also as the billable `deviceId` when no host device id is configured.
|
|
611
|
+
* The file is created on first use. When omitted, the native core uses
|
|
612
|
+
* `~/.moss/.moss-device-id`.
|
|
611
613
|
*/
|
|
612
614
|
cachePath?: string;
|
|
613
615
|
/**
|
|
@@ -730,17 +732,6 @@ export { QueryResultDocumentInfo }
|
|
|
730
732
|
|
|
731
733
|
export { RefreshResult }
|
|
732
734
|
|
|
733
|
-
declare interface ResolvedTelemetryIdentity {
|
|
734
|
-
/** Billable MAD key: the caller's id when supplied, otherwise Moss's UUID. */
|
|
735
|
-
deviceId: string;
|
|
736
|
-
/** Caller-owned device id. Omitted when Moss's UUID remains billable. */
|
|
737
|
-
hostDeviceId?: string;
|
|
738
|
-
/** Moss's file-backed stable UUID, always retained for correlation. */
|
|
739
|
-
mossDeviceId: string;
|
|
740
|
-
userId?: string;
|
|
741
|
-
callerSupplied: boolean;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
735
|
export declare interface ResyncWebSourceResult {
|
|
745
736
|
id: string;
|
|
746
737
|
jobId: string;
|
|
@@ -781,13 +772,13 @@ export declare class SessionIndex {
|
|
|
781
772
|
* worker thread — `await`ing here keeps the Node main thread
|
|
782
773
|
* responsive while auth is in flight.
|
|
783
774
|
*/
|
|
784
|
-
static _create(name: string, modelId: MossModel, projectId: string, projectKey: string, clientId?: string,
|
|
775
|
+
static _create(name: string, modelId: MossModel, projectId: string, projectKey: string, clientId?: string, applyIdentity?: (target: IdentityTarget) => void, modelArtifact?: ModelArtifactIdentity): Promise<SessionIndex>;
|
|
785
776
|
/**
|
|
786
777
|
* @internal Wrap an already-constructed core `SessionIndex` — used for the
|
|
787
778
|
* custom-authenticator path, where `InternalMossClient` builds the core
|
|
788
779
|
* handle via the auth bridge (`SessionIndex.withAuthenticator`).
|
|
789
780
|
*/
|
|
790
|
-
static _fromInner(name: string, modelId: MossModel, inner: SessionIndex_2,
|
|
781
|
+
static _fromInner(name: string, modelId: MossModel, inner: SessionIndex_2, applyIdentity?: (target: IdentityTarget) => void): SessionIndex;
|
|
791
782
|
/** The session index name. Identifies the cloud index on `pushIndex` / `loadIndex`. */
|
|
792
783
|
get name(): string;
|
|
793
784
|
/** Number of documents currently in the local session. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moss-js/moss",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/moss.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"author": "InferEdge Inc.",
|
|
46
46
|
"license": "SEE LICENSE IN LICENSE",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@moss-js/moss-core": "0.
|
|
48
|
+
"@moss-js/moss-core": "0.27.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@eslint/js": "^9.39.4",
|