@moss-js/moss 1.12.0 → 1.15.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 CHANGED
@@ -98,6 +98,70 @@ const mossClient = new MossClient("project", "key", {
98
98
  includes Moss's file-backed UUID as `mossDeviceId`; without a host id, both
99
99
  device fields contain that Moss UUID.
100
100
 
101
+ ## Telemetry
102
+
103
+ The SDK reports usage to the Moss cloud at `$MOSS_INDEX_URL/telemetry`
104
+ (`https://service.usemoss.dev/index/telemetry` by default). Telemetry is always
105
+ on, because the device id and the query count drive usage billing. Requests are
106
+ sent in the background. A failed send is dropped and never fails the call that
107
+ caused it.
108
+
109
+ Queries do not send a request each. The SDK buffers their events, with the same
110
+ fields as below, and sends them every 3 seconds while queries run, plus once
111
+ more when the client or session is closed. A send puts up to 500 query events in
112
+ one JSON array per request. The buffer holds up to 10,000 events between sends,
113
+ and events past that are dropped. Other events are sent one per request, when
114
+ the operation happens.
115
+
116
+ `close()` on a client or session resolves after that last send finishes, so
117
+ await it before the process exits. A process that exits without closing can
118
+ lose up to 3 seconds of query events. Each flush waits at most 5 seconds for
119
+ authentication and 3 seconds per request, and drops its events when either fails.
120
+
121
+ ### Fields on every event
122
+
123
+ | Field | Value |
124
+ |---|---|
125
+ | `action` | Always `"telemetry"`. |
126
+ | `eventType` | The event type, from the table below. |
127
+ | `projectId` | Your project id. |
128
+ | `clientId`, `sessionId` | The same random id, one per client or session object. |
129
+ | `sdkVersion`, `sdkPackageVersion` | Version of the native binding package. |
130
+ | `nativeCoreVersion` | Version of the Rust core. |
131
+ | `modelCacheSchemaVersion` | Layout version of the on-disk model cache. |
132
+ | `deviceId` | Billable device id: your `identity.deviceId`, or else the Moss device UUID. |
133
+ | `mossDeviceId` | The Moss device UUID stored in `.moss-device-id`. |
134
+ | `userId` | Only when you set one. Never billable. |
135
+ | `indexName` | The index, when the event concerns one index. |
136
+ | `modelId`, `modelArtifactVersion`, `modelManifestSha256` | The embedding model and its exact artifact, when known. |
137
+
138
+ ### Event types and their extra fields
139
+
140
+ | Event | Sent when | Extra fields |
141
+ |---|---|---|
142
+ | `index.load` | An index loads | `docCount`, `autoRefresh`, `refreshIntervalSecs` (with auto refresh), `cached` (a cache path was given), `servedStale` (served from the cache while the cloud is unreachable), `modelCacheGeneration` |
143
+ | `index.auto_refresh` | An auto refresh poll finishes | `changed`, `modelCacheGeneration` |
144
+ | `index.unload` | An index unloads or the client closes | `modelCacheGeneration` |
145
+ | `index.query` | A single-index query runs, sent in a batch | `latencyMs`, `modelCacheGeneration` |
146
+ | `index.query_multi` | A multi-index query runs, sent in a batch | The `index.query` fields, plus `indexCount` and `indexNames`. `modelCacheGeneration` when every index shares one, else `modelCacheGenerationsByIndex`. |
147
+ | `index.usage.periodic_flush`, `index.usage.final_flush` | Every 3 seconds while there is usage, and at close | `queryCount`, `docsEmbedded`, `tokensEstimated` |
148
+ | `session.load` | A session loads an index from the cloud | `docCount` |
149
+ | `session.load_from_disk` | A session loads a local snapshot | `docCount`, plus `rebuilt` and `persisted` when a legacy snapshot is rebuilt |
150
+ | `session.add_docs`, `session.delete_docs` | Documents are added or deleted | `docCount` |
151
+ | `session.push_index` | A session pushes its index | `docCount` |
152
+ | `session.auto_refresh_staged` | A newer cloud version is downloaded | `updatedAt` |
153
+ | `session.auto_refresh` | A downloaded version is installed | `changed`, `docCount`, `updatedAt` |
154
+ | `session.unload` | A session is closed | None |
155
+ | `session.query` | A session query runs, sent in a batch | `latencyMs` |
156
+ | `session.usage.periodic_flush`, `session.usage.final_flush` | Every 3 seconds while there is usage, at close, and before a push | `queryCount`, `docsEmbedded`, `tokensEstimated` |
157
+
158
+ `latencyMs` on a query event is the time that query took, in milliseconds.
159
+ `index.query` and `index.query_multi` time the whole call, including the query
160
+ embedding. `session.query` times the search lookup only, without embedding, so
161
+ the two are not directly comparable.
162
+
163
+ No document text, query text, metadata or embedding is ever sent.
164
+
101
165
  ## Resource cleanup
102
166
 
103
167
  `MossClient` and sessions returned by `client.session(...)` hold native resources that must be released explicitly. Call `close()` on each one when you are done with it, in a `finally` block or equivalent. `close()` is idempotent, so it is safe to call more than once.
@@ -193,6 +257,23 @@ If the vector is omitted, the query fails closed with an error stating that an
193
257
  explicit query embedding is required. Moss does not silently fall back to an
194
258
  unverified local model or send the query to the cloud.
195
259
 
260
+ ## Offline-tolerant load
261
+
262
+ With a `cachePath` set and a snapshot already on disk, a `loadIndex` whose cloud
263
+ metadata check fails on a transport error (unreachable network, timeout) serves
264
+ the cached snapshot instead of failing, and starts a refresh poller so the index
265
+ catches up when the cloud returns. A real "index not found" (404) still fails,
266
+ so a deleted index does not come back from cache.
267
+
268
+ A load served this way opens the index, but a built-in embedding model cannot be
269
+ opened until the Moss cloud is reachable, so text queries with `alpha` above 0
270
+ fail until then. Keyword-only queries (`alpha: 0`) and queries that pass their
271
+ own embedding keep working.
272
+
273
+ ```typescript
274
+ await mossClient.loadIndex("my-docs", { cachePath: "/var/cache/moss" });
275
+ ```
276
+
196
277
  ## Multi-index search
197
278
 
198
279
  Search several loaded indexes in one call and get the global top-k back, with
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
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};
1
+ function _0x5865(){const _0xd31e47=['moss-core\x20runtime\x20SessionIndex\x20is\x20missing\x20the\x20withAuthenticator\x20factory.\x20Upgrade\x20@moss-js/moss-core\x20to\x20a\x20build\x20that\x20supports\x20custom\x20authenticators\x20for\x20sessions.','embedding','HTTP\x20error!\x20status:\x20','manifestSha256','listWebSources','json','configuredIdentity','Unsupported\x20job\x20status\x20\x27','path','cachePath','5889oECLKR','applySessionIdentity','toByteArray','authUrl','56MlwvPJ','delete','maxPages','respectRobots','moss-minilm','queryText','createIndexFromFiles\x20requires\x20at\x20least\x20one\x20file','test','resolveAuthRequest','normalizeJobStatus','PendingUpload','createIndexFromFiles','withAuthenticator','\x20could\x20not\x20be\x20settled:\x20','fetchAndCache','refreshCadence','\x20must\x20not\x20have\x20leading\x20or\x20trailing\x20whitespace','createIndex','excludePaths','applyIdentity','body','alpha','all','projectKey','deviceIdentity','call','currentPhase','MOSS_CLOUD_API_BASE_URL','_fromInner','getAuthHeader','expiresAt','no\x20exact\x20artifact\x20identity','pendingupload','https://service.usemoss.dev','addDocs\x20requires\x20at\x20least\x20one\x20document','application/json','then','modelId','byteLength','unloadIndex','authNotifyFn','authenticator','status','MossClient\x20is\x20closed','env','Unsupported\x20data\x20type\x20for\x20file\x20upload','progress','asyncDispose','Web\x20source\x20methods\x20require\x20a\x20project\x20key.\x20Construct\x20MossClient\x20with\x20(projectId,\x20projectKey).','sources','unloadIndexes','error','\x20UTF-8\x20bytes','requireMultiIndexCore','inflight','default','MOSS_AUTH_URL','@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20MossClient.close()','queryMultiIndexText','utf8','data','function','length','deleteDocs','resync','Failed','The\x20installed\x20@moss-js/moss-core\x20runtime\x20does\x20not\x20support\x20exact\x20model\x20artifact\x20identities.\x20Upgrade\x20moss-core\x20before\x20creating\x20this\x20session.','timeout','stringify','map','parse','minScore','mossDeviceId','getWebSource','\x20must\x20be\x20at\x20most\x20','bind','IndexManager','inner','[moss]\x20Dropping\x20a\x20malformed\x20job\x20progress\x20event;\x20progress\x20reporting\x20may\x20be\x20incomplete\x20for\x20this\x20operation.\x20Cause:\x20','ManageApiError','getDocs','Uploading','startsWith','deviceId','86PZaosg','now','arrayBuffer','cache','expiresIn','text','pending_upload','indexManager','393750gHCouw','moss-core\x20runtime\x20ManageClient/IndexManager\x20is\x20missing\x20withAuthenticator\x20factory.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.','addDocs','1577240cghewG','\x22)\x20or\x20loadIndexes([...])\x20before\x20querying;\x20queries\x20run\x20locally\x20and\x20there\x20is\x20no\x20cloud\x20query\x20fallback.','from','loadModel','identity','token','MossClient\x20options.identity.','pushIndex','replace','updateWebSource','query','ManageClient','maxDocuments','Authentication\x20failed\x20(HTTP\x20401):\x20','queryMultiIndex','SessionIndex','Bearer\x20','createIndex\x20requires\x20at\x20least\x20one\x20document','[moss]\x20Ignoring\x20an\x20auth\x20request\x20with\x20no\x20usable\x20request\x20id;\x20custom\x20authentication\x20may\x20be\x20unavailable\x20for\x20this\x20client.\x20Cause:\x20','HTTP\x20','maxDepth','isArray','manageClient','POST','received\x20','\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.','createAuthenticatedSessionInner','loadIndex','_warmModel','loadFromDisk','loadIndexes','CLOUD_API_INDEX_URL','SDK_VERSION_NUMBER','contentType','hasCustomAuthenticator','modelArtifactContractVersion','Index\x20\x22','failed','MossClient\x20options.identity\x20must\x20be\x20an\x20object','toLowerCase','projectId','object','_create','trim','version','deleteDocuments','parseOptions','SessionIndex\x20\x27','moss-core\x20runtime\x20is\x20missing\x20ManageClient/IndexManager\x20exports','indexName','added','includePaths','1684746QCAjQK','This\x20session\x20uses\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20embedding\x20via\x20QueryOptions.embedding.','message','topK','building','createAuthenticatedSessionInner\x20requires\x20a\x20custom\x20IAuthenticator\x20client','getAuthToken','queryMultiIndex\x20requires\x20at\x20least\x20one\x20index\x20name','[moss]\x20Auth\x20request\x20','name','custom','listIndexes','warn','addDocumentsText','jobId','includes','The\x20installed\x20@moss-js/moss-core\x20does\x20not\x20support\x20multi-index\x20operations\x20(queryMultiIndex,\x20loadIndexes,\x20unloadIndexes).\x20Upgrade\x20@moss-js/moss-core.','requires\x20explicit\x20query\x20embeddings','inspectSnapshot','moss-core\x20runtime\x20is\x20missing\x20resolveAuthRequest/rejectAuthRequest\x20exports.\x20Ensure\x20you\x20are\x20using\x20a\x20moss-core\x20build\x20that\x20supports\x20custom\x20authenticators.','updated','ensureCachePathDeviceId','deleteDocs\x20requires\x20at\x20least\x20one\x20document\x20ID','wrapProgress','Building','join','setIdentity','Documents\x20missing\x20.embedding\x20for\x20custom\x20model:\x20','uploading','2395638GCaZNE','onProgress','candidateDepth','deref','cachePathDeviceId','close','getIndex','fromEntries','One\x20or\x20more\x20indexes\x20use\x20custom\x20embeddings.\x20Provide\x20a\x20query\x20vector\x20via\x20options.embedding,\x20or\x20use\x20alpha\x200\x20for\x20keyword-only\x20search.','deleteIndex','getJobStatus','string','slice','number','docCount','filter','998187zeMKQN','completed','\x22\x20is\x20not\x20loaded.\x20Call\x20loadIndex(\x22','1615108mirvvS','Completed','isSafeInteger','createWebSource','.\x20All\x20documents\x20must\x20have\x20.embedding\x20set\x20when\x20using\x20modelId=\x27custom\x27.','isFinite','\x27\x20returned\x20by\x20moss-core','\x20must\x20be\x20a\x20non-empty\x20string','saveToDisk','/v1/manage','addDocuments','rejectAuthRequest'];_0x5865=function(){return _0xd31e47;};return _0x5865();}const _0x46a83d=_0xddff;(function(_0x5860ff,_0x3cceb5){const _0x3ef3b4=_0xddff,_0x51f83d=_0x5860ff();while(!![]){try{const _0x22f410=-parseInt(_0x3ef3b4(0x16f))/0x1+-parseInt(_0x3ef3b4(0x1e0))/0x2*(-parseInt(_0x3ef3b4(0x188))/0x3)+-parseInt(_0x3ef3b4(0x172))/0x4+-parseInt(_0x3ef3b4(0x1eb))/0x5+parseInt(_0x3ef3b4(0x1e8))/0x6+parseInt(_0x3ef3b4(0x142))/0x7+parseInt(_0x3ef3b4(0x18c))/0x8*(parseInt(_0x3ef3b4(0x15f))/0x9);if(_0x22f410===_0x3cceb5)break;else _0x51f83d['push'](_0x51f83d['shift']());}catch(_0x2c4ccb){_0x51f83d['push'](_0x51f83d['shift']());}}}(_0x5865,0x82ffe));import{JobStatus as _0x5a2181}from'@moss-js/moss-core';import*as _0x1f1a6f from'@moss-js/moss-core';import*as _0x171d58 from'@moss-js/moss-core';var g=_0x171d58,ae=g['MODEL_DOWNLOAD_URL'],ue=g[_0x46a83d(0x20b)],de=g['CLOUD_API_IDENTITY_URL'],T=g['CLOUD_API_AUTH_URL'],ce=typeof process<'u'&&process[_0x46a83d(0x1b8)]['MOSS_INDEX_URL']||g[_0x46a83d(0x20a)],E=typeof process<'u'?process['env']:{},f=class{constructor(_0x3efcc4,_0x3f0494){const _0x1434a1=_0x46a83d;this['projectId']=_0x3efcc4,this[_0x1434a1(0x1a3)]=_0x3f0494,this[_0x1434a1(0x18b)]=E[_0x1434a1(0x1c4)]??T;}[_0x46a83d(0x213)];[_0x46a83d(0x1a3)];['authUrl'];async[_0x46a83d(0x148)](){const _0x44b57b=_0x46a83d;let _0x18e3e7=await fetch(this[_0x44b57b(0x18b)],{'method':_0x44b57b(0x202),'headers':{'Content-Type':_0x44b57b(0x1af)},'body':JSON[_0x44b57b(0x1d0)]({'projectId':this[_0x44b57b(0x213)],'projectKey':this[_0x44b57b(0x1a3)]}),'signal':AbortSignal['timeout'](0x7530)});if(_0x18e3e7[_0x44b57b(0x1b6)]===0x191){let _0x3a8a36=await _0x18e3e7[_0x44b57b(0x1e5)]();throw new Error(_0x44b57b(0x1f8)+_0x3a8a36);}if(!_0x18e3e7['ok']){let _0x39097c=await _0x18e3e7[_0x44b57b(0x1e5)]();throw new Error(_0x44b57b(0x1fe)+_0x18e3e7[_0x44b57b(0x1b6)]+':\x20'+_0x39097c);}let _0x50dbc1=await _0x18e3e7[_0x44b57b(0x183)]();return{'token':_0x50dbc1[_0x44b57b(0x1f0)],'expiresIn':_0x50dbc1[_0x44b57b(0x1e4)]};}async[_0x46a83d(0x1a9)](){const _0x576801=_0x46a83d;let {token:_0x1b3176}=await this[_0x576801(0x148)]();return'Bearer\x20'+_0x1b3176;}},I=class{constructor(_0x5b376f){const _0x140337=_0x46a83d;this[_0x140337(0x1d9)]=_0x5b376f;}[_0x46a83d(0x1d9)];[_0x46a83d(0x1e3)]=null;[_0x46a83d(0x1c2)]=null;async[_0x46a83d(0x148)](){const _0x36ba65=_0x46a83d;if(this[_0x36ba65(0x1e3)]&&this[_0x36ba65(0x1e3)][_0x36ba65(0x1aa)]>Date[_0x36ba65(0x1e1)]())return{'token':this[_0x36ba65(0x1e3)][_0x36ba65(0x1f0)],'expiresIn':this[_0x36ba65(0x1e3)][_0x36ba65(0x1e4)]};if(this[_0x36ba65(0x1c2)])return this[_0x36ba65(0x1c2)];this['inflight']=this[_0x36ba65(0x19a)]();try{return await this[_0x36ba65(0x1c2)];}finally{this['inflight']=null;}}async[_0x46a83d(0x1a9)](){let {token:_0x388eb3}=await this['getAuthToken']();return'Bearer\x20'+_0x388eb3;}async[_0x46a83d(0x19a)](){const _0x21fc57=_0x46a83d;let {token:_0x3d4fbf,expiresIn:_0x3e2379}=await this['inner']['getAuthToken'](),_0xb882e1=Date[_0x21fc57(0x1e1)]()+(_0x3e2379-0x3c)*0x3e8;return this[_0x21fc57(0x1e3)]={'token':_0x3d4fbf,'expiresIn':_0x3e2379,'expiresAt':_0xb882e1},{'token':_0x3d4fbf,'expiresIn':_0x3e2379};}};import{randomUUID as _0x3b74d0}from'node:crypto';import{existsSync as _0x4d2da1,mkdirSync as _0x466ae4,readFileSync as _0x431bad,writeFileSync as _0x21360b}from'node:fs';import{join as _0x13aeed}from'node:path';var z='.moss-device-id',S=0x100,k=/[\p{Cc}\p{Cf}\p{Cs}\uFFFD]/u;function Y(_0x23d30a){const _0x121e7f=_0x46a83d;return _0x23d30a['length']>0x0&&_0x23d30a[_0x121e7f(0x216)]()===_0x23d30a&&!k[_0x121e7f(0x193)](_0x23d30a)&&new TextEncoder()['encode'](_0x23d30a)[_0x121e7f(0x1b2)]<=S;}function _(_0x30ba72,_0x2e8f88){const _0x43a7e8=_0x46a83d;if(_0x30ba72!==void 0x0){if(typeof _0x30ba72!=_0x43a7e8(0x16a)||_0x30ba72['length']===0x0)throw new TypeError(_0x43a7e8(0x1f1)+_0x2e8f88+_0x43a7e8(0x179));if(_0x30ba72['trim']()!==_0x30ba72)throw new TypeError(_0x43a7e8(0x1f1)+_0x2e8f88+_0x43a7e8(0x19c));if(k[_0x43a7e8(0x193)](_0x30ba72))throw new TypeError(_0x43a7e8(0x1f1)+_0x2e8f88+'\x20contains\x20an\x20unsupported\x20character');if(new TextEncoder()['encode'](_0x30ba72)[_0x43a7e8(0x1b2)]>S)throw new TypeError(_0x43a7e8(0x1f1)+_0x2e8f88+_0x43a7e8(0x1d6)+S+_0x43a7e8(0x1c0));return _0x30ba72;}}function U(_0x41a35f){const _0x79ef9b=_0x46a83d;if(_0x41a35f!==void 0x0){if(_0x41a35f===null||typeof _0x41a35f!=_0x79ef9b(0x214)||Array[_0x79ef9b(0x200)](_0x41a35f))throw new TypeError(_0x79ef9b(0x211));return Object['freeze']({'deviceId':_(_0x41a35f['deviceId'],_0x79ef9b(0x1df)),'userId':_(_0x41a35f['userId'],'userId')});}}function q(_0x16b90e){const _0x45f15b=_0x46a83d;return _0x16b90e?.[_0x45f15b(0x1df)]!==void 0x0||_0x16b90e?.['userId']!==void 0x0;}function M(_0x158771){const _0x4a81d7=_0x46a83d;if(!_0x158771?.['trim']())return;let _0xd037a6=_0x13aeed(_0x158771,z);try{if(_0x4d2da1(_0xd037a6)){let _0x58fe3b=_0x431bad(_0xd037a6,_0x4a81d7(0x1c7))[_0x4a81d7(0x216)]();return Y(_0x58fe3b)?_0x58fe3b:void 0x0;}_0x466ae4(_0x158771,{'recursive':!0x0});let _0x11b932=_0x3b74d0();return _0x21360b(_0xd037a6,_0x11b932,_0x4a81d7(0x1c7)),_0x11b932;}catch{return;}}var Z=0x1;function y(_0x2572bd){const _0x4762fb=_0x46a83d;let _0x41402d=_0x2572bd[_0x4762fb(0x20e)];if(typeof _0x41402d!=_0x4762fb(0x1c9))throw L();let _0x2aa4a9=_0x41402d[_0x4762fb(0x1a5)](_0x2572bd);if(!Number[_0x4762fb(0x174)](_0x2aa4a9)||_0x2aa4a9<Z)throw L();}function L(){const _0xa2981=_0x46a83d;return new Error(_0xa2981(0x1ce));}var xe=0x708*0x3e8;function x(_0x38b551){const _0x34afb3=_0x46a83d;if(!(_0x38b551?.['minScore']===void 0x0&&_0x38b551?.[_0x34afb3(0x161)]===void 0x0))return{'minScore':_0x38b551[_0x34afb3(0x1d3)],'candidateDepth':_0x38b551[_0x34afb3(0x161)]};}function A(_0x28596b){const _0x2e69b7=_0x46a83d;return _0x28596b instanceof Error?_0x28596b[_0x2e69b7(0x144)]:String(_0x28596b);}function _0xddff(_0x3b6774,_0x309031){_0x3b6774=_0x3b6774-0x141;const _0x586501=_0x5865();let _0xddff50=_0x586501[_0x3b6774];return _0xddff50;}function ee(_0x1f0cfd){const _0x2b2511=_0x46a83d;if(_0x1f0cfd===null||typeof _0x1f0cfd!=_0x2b2511(0x214))return _0x2b2511(0x203)+String(_0x1f0cfd);if(Array[_0x2b2511(0x200)](_0x1f0cfd))return'received\x20an\x20array\x20where\x20a\x20JobProgress\x20object\x20was\x20expected';let _0x11ff41=_0x1f0cfd;return typeof _0x11ff41['jobId']!=_0x2b2511(0x16a)||_0x11ff41['jobId'][_0x2b2511(0x1ca)]===0x0?'received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20jobId\x20('+String(_0x11ff41[_0x2b2511(0x150)])+')':typeof _0x11ff41[_0x2b2511(0x1b6)]!=_0x2b2511(0x16a)||_0x11ff41['status'][_0x2b2511(0x1ca)]===0x0?'received\x20a\x20progress\x20event\x20with\x20a\x20missing\x20or\x20empty\x20status\x20('+String(_0x11ff41[_0x2b2511(0x1b6)])+')':typeof _0x11ff41[_0x2b2511(0x1ba)]!=_0x2b2511(0x16c)||!Number[_0x2b2511(0x177)](_0x11ff41['progress'])?'received\x20a\x20progress\x20event\x20with\x20a\x20non-finite\x20progress\x20value\x20('+String(_0x11ff41[_0x2b2511(0x1ba)])+')':_0x11ff41['currentPhase']!==void 0x0&&_0x11ff41[_0x2b2511(0x1a6)]!==null&&typeof _0x11ff41[_0x2b2511(0x1a6)]!='string'?'received\x20a\x20progress\x20event\x20with\x20a\x20non-string\x20currentPhase\x20('+String(_0x11ff41[_0x2b2511(0x1a6)])+')':null;}var b=class{['authenticator'];[_0x46a83d(0x201)];[_0x46a83d(0x1e7)];[_0x46a83d(0x163)];[_0x46a83d(0x184)];['projectId'];[_0x46a83d(0x1b4)];constructor(_0xc4f53d,_0x146818,_0x7c846f){const _0x2ded6e=_0x46a83d;this['configuredIdentity']=U(_0x7c846f?.[_0x2ded6e(0x1ef)]),this[_0x2ded6e(0x163)]=M(_0x7c846f?.[_0x2ded6e(0x187)]),this[_0x2ded6e(0x213)]=_0xc4f53d;let _0x4b6942=typeof _0x146818==_0x2ded6e(0x16a)?new f(_0xc4f53d,_0x146818):_0x146818;this['authenticator']=new I(_0x4b6942);let _0x211416=_0x1f1a6f,_0x4900e3=_0x211416[_0x2ded6e(0x1f6)]??_0x211416['default']?.[_0x2ded6e(0x1f6)],_0x3946dd=_0x211416[_0x2ded6e(0x1d8)]??_0x211416[_0x2ded6e(0x1c3)]?.[_0x2ded6e(0x1d8)];if(!_0x4900e3||!_0x3946dd)throw new Error(_0x2ded6e(0x21b));if(typeof _0x146818=='string')this[_0x2ded6e(0x201)]=new _0x4900e3(_0xc4f53d,_0x146818),this[_0x2ded6e(0x1e7)]=new _0x3946dd(_0xc4f53d,_0x146818);else{let _0x3105de=_0x211416[_0x2ded6e(0x194)]??_0x211416[_0x2ded6e(0x1c3)]?.['resolveAuthRequest'],_0x5c8737=_0x211416[_0x2ded6e(0x17d)]??_0x211416['default']?.[_0x2ded6e(0x17d)];if(!_0x3105de||!_0x5c8737)throw new Error(_0x2ded6e(0x155));let _0x1e7dcc=this[_0x2ded6e(0x1b5)],_0x513eba=(_0x15652b,_0x245096)=>{const _0x40e859=_0x2ded6e;try{_0x5c8737(_0x15652b,_0x245096);}catch(_0x2661a0){console[_0x40e859(0x14e)](_0x40e859(0x14a)+_0x15652b+_0x40e859(0x199)+A(_0x2661a0));}},_0x59c2e3=(_0x324b04,_0x383566)=>{try{_0x3105de(_0x324b04,_0x383566);}catch(_0x4e1680){_0x513eba(_0x324b04,'moss-core\x20rejected\x20the\x20auth\x20token:\x20'+A(_0x4e1680));}},_0x157fc4=!0x1,_0x4f0511=(_0x4e79b1,_0x209bca)=>{const _0x4c4e05=_0x2ded6e;if(_0x4e79b1||!Number[_0x4c4e05(0x174)](_0x209bca)||_0x209bca<0x0){_0x157fc4||(_0x157fc4=!0x0,console[_0x4c4e05(0x14e)](_0x4c4e05(0x1fd)+(_0x4e79b1?_0x4e79b1[_0x4c4e05(0x144)]:_0x4c4e05(0x203)+String(_0x209bca))));return;}_0x1e7dcc[_0x4c4e05(0x1a9)]()[_0x4c4e05(0x1b0)](_0x4144fc=>{const _0x48e550=_0x4c4e05;let _0x5b4233=_0x4144fc[_0x48e550(0x1de)](_0x48e550(0x1fb))?_0x4144fc[_0x48e550(0x16b)](0x7):_0x4144fc;_0x59c2e3(_0x209bca,_0x5b4233);},_0x59f7b7=>_0x513eba(_0x209bca,A(_0x59f7b7)));};this[_0x2ded6e(0x1b4)]=_0x4f0511;let _0xa8ceab=_0x4900e3,_0x284f4f=_0x3946dd;if(!_0xa8ceab['withAuthenticator']||!_0x284f4f[_0x2ded6e(0x198)])throw new Error(_0x2ded6e(0x1e9));this[_0x2ded6e(0x201)]=_0xa8ceab[_0x2ded6e(0x198)](_0xc4f53d,_0x4f0511),this['indexManager']=_0x284f4f[_0x2ded6e(0x198)](_0xc4f53d,_0x4f0511);}this[_0x2ded6e(0x19f)](this[_0x2ded6e(0x1e7)]);}async[_0x46a83d(0x164)](){const _0x26a3d4=_0x46a83d;let _0x4a3bca=this[_0x26a3d4(0x1e7)]['close'];if(typeof _0x4a3bca!=_0x26a3d4(0x1c9))throw new Error(_0x26a3d4(0x1c5));await _0x4a3bca[_0x26a3d4(0x1a5)](this['indexManager']);}async[_0x46a83d(0x148)](){const _0x666c9a=_0x46a83d;return this[_0x666c9a(0x1b5)][_0x666c9a(0x148)]();}[_0x46a83d(0x159)](_0x4c6cdc){if(!_0x4c6cdc)return;let _0x1c2c34=!0x1;return(_0x5ea448,_0x403fc7)=>{const _0x33cf13=_0xddff;let _0x54841d=_0x5ea448?_0x5ea448[_0x33cf13(0x144)]:ee(_0x403fc7);if(_0x54841d!==null){_0x1c2c34||(_0x1c2c34=!0x0,console[_0x33cf13(0x14e)](_0x33cf13(0x1da)+_0x54841d));return;}_0x4c6cdc(_0x403fc7);};}[_0x46a83d(0x195)](_0x334470){const _0x155355=_0x46a83d;let _0x250f41=_0x334470[_0x155355(0x216)]()[_0x155355(0x212)]()['replace'](/\s+/g,'_'),_0x1a4222=_0x250f41[_0x155355(0x1f3)](/_/g,'');if(_0x250f41===_0x155355(0x1e6)||_0x1a4222===_0x155355(0x1ac))return _0x5a2181[_0x155355(0x196)];if(_0x250f41===_0x155355(0x15e))return _0x5a2181[_0x155355(0x1dd)];if(_0x250f41===_0x155355(0x146))return _0x5a2181[_0x155355(0x15a)];if(_0x250f41===_0x155355(0x170))return _0x5a2181[_0x155355(0x173)];if(_0x250f41===_0x155355(0x210))return _0x5a2181[_0x155355(0x1cd)];throw new Error(_0x155355(0x185)+_0x334470+_0x155355(0x178));}async['createIndex'](_0x5525a4,_0x2d4e21,_0x2c8344,_0x2aa729){const _0x312735=_0x46a83d;if(!_0x2d4e21[_0x312735(0x1ca)])throw new Error(_0x312735(0x1fc));return await this[_0x312735(0x201)][_0x312735(0x19d)](_0x5525a4,_0x2d4e21,_0x2c8344,this[_0x312735(0x159)](_0x2aa729?.[_0x312735(0x160)]));}async[_0x46a83d(0x18a)](_0x809009){const _0x20ede=_0x46a83d;if(_0x809009 instanceof Uint8Array)return Array['from'](_0x809009);if(_0x809009 instanceof ArrayBuffer)return Array[_0x20ede(0x1ed)](new Uint8Array(_0x809009));if(typeof _0x809009['arrayBuffer']==_0x20ede(0x1c9)){let _0x2f8424=await _0x809009[_0x20ede(0x1e2)]();return Array[_0x20ede(0x1ed)](new Uint8Array(_0x2f8424));}throw new Error(_0x20ede(0x1b9));}async[_0x46a83d(0x197)](_0x28bf73,_0x39acca,_0x429092){const _0x150454=_0x46a83d;if(_0x39acca[_0x150454(0x1ca)]===0x0)throw new Error(_0x150454(0x192));let _0x21e199=_0x429092?.[_0x150454(0x1b1)]??_0x150454(0x190),_0xd9adbe=await Promise[_0x150454(0x1a2)](_0x39acca[_0x150454(0x1d1)](async _0x50a7ec=>({'name':_0x50a7ec[_0x150454(0x14b)],'contentType':_0x50a7ec[_0x150454(0x20c)],'path':_0x50a7ec[_0x150454(0x186)]??void 0x0,'data':_0x50a7ec[_0x150454(0x1c8)]!=null?await this[_0x150454(0x18a)](_0x50a7ec[_0x150454(0x1c8)]):void 0x0})));return await this[_0x150454(0x201)][_0x150454(0x197)](_0x28bf73,_0xd9adbe,_0x21e199,this[_0x150454(0x159)](_0x429092?.[_0x150454(0x160)]),_0x429092?.[_0x150454(0x219)]??null);}async[_0x46a83d(0x1ea)](_0x447b2b,_0x362285,_0x4c3681){const _0xd8bc4f=_0x46a83d;if(Array[_0xd8bc4f(0x200)](_0x362285)&&_0x362285['length']===0x0)throw new Error(_0xd8bc4f(0x1ae));return await this['manageClient'][_0xd8bc4f(0x1ea)](_0x447b2b,_0x362285,_0x4c3681??null,this['wrapProgress'](_0x4c3681?.[_0xd8bc4f(0x160)]));}async[_0x46a83d(0x1cb)](_0x2c4133,_0x24cddb,_0x52bf73){const _0x4c8223=_0x46a83d;if(Array['isArray'](_0x24cddb)&&_0x24cddb[_0x4c8223(0x1ca)]===0x0)throw new Error(_0x4c8223(0x158));return await this[_0x4c8223(0x201)][_0x4c8223(0x1cb)](_0x2c4133,_0x24cddb,this[_0x4c8223(0x159)](_0x52bf73?.[_0x4c8223(0x160)]));}async[_0x46a83d(0x169)](_0x54147f){const _0x1bed93=_0x46a83d;let _0xe6b5fa=await this[_0x1bed93(0x201)][_0x1bed93(0x169)](_0x54147f);return{..._0xe6b5fa,'status':this['normalizeJobStatus'](_0xe6b5fa[_0x1bed93(0x1b6)]),'currentPhase':_0xe6b5fa[_0x1bed93(0x1a6)]??null,'error':_0xe6b5fa[_0x1bed93(0x1bf)]??null};}async['getIndex'](_0x23ba4c){const _0x3bf8fe=_0x46a83d;return this[_0x3bf8fe(0x201)][_0x3bf8fe(0x165)](_0x23ba4c);}async['listIndexes'](){const _0x1fbd1e=_0x46a83d;return this[_0x1fbd1e(0x201)][_0x1fbd1e(0x14d)]();}async[_0x46a83d(0x168)](_0x45f973){const _0x235f98=_0x46a83d;return this[_0x235f98(0x201)][_0x235f98(0x168)](_0x45f973);}async[_0x46a83d(0x1dc)](_0x30c64a,_0x200233){const _0x1ef1a4=_0x46a83d;return this[_0x1ef1a4(0x201)]['getDocs'](_0x30c64a,_0x200233??null);}async['loadIndex'](_0x2904f3,_0x1c232a){const _0x30642f=_0x46a83d;return this[_0x30642f(0x157)](_0x1c232a?.[_0x30642f(0x187)]),(await this[_0x30642f(0x1e7)][_0x30642f(0x206)](_0x2904f3,_0x1c232a??null))[_0x30642f(0x14b)];}async['loadIndexes'](_0x5862b1,_0x363f59){const _0x4fc802=_0x46a83d;let _0xc88f04=this[_0x4fc802(0x1c1)]();return this[_0x4fc802(0x157)](_0x363f59?.[_0x4fc802(0x187)]),_0xc88f04[_0x4fc802(0x209)](_0x5862b1,_0x363f59??null);}async[_0x46a83d(0x1b3)](_0x2bd1e6){const _0x50af75=_0x46a83d;return this['indexManager'][_0x50af75(0x1b3)](_0x2bd1e6);}async['unloadIndexes'](_0x9f1cfe){const _0xd6c23=_0x46a83d;return this[_0xd6c23(0x1c1)]()[_0xd6c23(0x1be)](_0x9f1cfe);}[_0x46a83d(0x1c1)](){const _0x48e9fe=_0x46a83d;let _0x2d3692=this['indexManager'];if(typeof _0x2d3692['queryMultiIndex']!='function'||typeof _0x2d3692['queryMultiIndexText']!=_0x48e9fe(0x1c9)||typeof _0x2d3692[_0x48e9fe(0x209)]!=_0x48e9fe(0x1c9)||typeof _0x2d3692['unloadIndexes']!=_0x48e9fe(0x1c9))throw new Error(_0x48e9fe(0x152));return{'queryMultiIndex':_0x2d3692[_0x48e9fe(0x1f9)][_0x48e9fe(0x1d7)](_0x2d3692),'queryMultiIndexText':_0x2d3692['queryMultiIndexText'][_0x48e9fe(0x1d7)](_0x2d3692),'loadIndexes':_0x2d3692['loadIndexes'][_0x48e9fe(0x1d7)](_0x2d3692),'unloadIndexes':_0x2d3692['unloadIndexes']['bind'](_0x2d3692)};}['ensureCachePathDeviceId'](_0x27ac17){const _0x5e1bb0=_0x46a83d;_0x27ac17&&this[_0x5e1bb0(0x163)]===void 0x0&&M(_0x27ac17);}[_0x46a83d(0x19f)]=_0x565d4f=>{const _0x2ba277=_0x46a83d;!q(this['configuredIdentity'])&&this[_0x2ba277(0x163)]===void 0x0||_0x565d4f[_0x2ba277(0x15c)](this[_0x2ba277(0x184)]?.[_0x2ba277(0x1df)]??null,this['configuredIdentity']?.['userId']??null,this[_0x2ba277(0x163)]??null);};[_0x46a83d(0x189)]=_0x31bbba=>{const _0x74fa4a=_0x46a83d;let _0x264ac3=this['indexManager'][_0x74fa4a(0x1a4)]?.();if(!_0x264ac3){this['applyIdentity'](_0x31bbba);return;}_0x31bbba[_0x74fa4a(0x15c)](_0x264ac3[_0x74fa4a(0x1df)]??null,this[_0x74fa4a(0x184)]?.['userId']??null,_0x264ac3[_0x74fa4a(0x1d4)]??null);};[_0x46a83d(0x20d)](){return this['authNotifyFn']!==void 0x0;}async[_0x46a83d(0x205)](_0x57e657,_0x2ca807,_0xe56b50){const _0xa432b4=_0x46a83d;if(!this[_0xa432b4(0x1b4)])throw new Error(_0xa432b4(0x147));let _0x5dc09b=_0x1f1a6f,_0x15a459=_0x5dc09b[_0xa432b4(0x1fa)]??_0x5dc09b[_0xa432b4(0x1c3)]?.[_0xa432b4(0x1fa)];if(!_0x15a459||typeof _0x15a459[_0xa432b4(0x198)]!=_0xa432b4(0x1c9))throw new Error(_0xa432b4(0x17e));return _0xe56b50&&y(_0x15a459),_0x15a459[_0xa432b4(0x198)](_0x57e657,_0x2ca807,this[_0xa432b4(0x213)],this['authNotifyFn'],null,null,_0xe56b50?.[_0xa432b4(0x217)]??null,_0xe56b50?.[_0xa432b4(0x181)]??null);}async[_0x46a83d(0x1f5)](_0x34c29e,_0x30e043,_0x11b5a8){const _0x599233=_0x46a83d;if(!await this[_0x599233(0x1e7)]['hasIndex'](_0x34c29e))throw new Error(_0x599233(0x20f)+_0x34c29e+_0x599233(0x171)+_0x34c29e+_0x599233(0x1ec));let _0x12406f=_0x11b5a8?.[_0x599233(0x145)]??0x5,_0x3d6ca7=_0x11b5a8?.[_0x599233(0x1a1)]??0.8;return _0x11b5a8?.[_0x599233(0x17f)]?this[_0x599233(0x1e7)][_0x599233(0x1f5)](_0x34c29e,_0x30e043,_0x11b5a8['embedding'],_0x12406f,_0x3d6ca7,_0x11b5a8?.[_0x599233(0x16e)],x(_0x11b5a8)):this['indexManager']['queryText'](_0x34c29e,_0x30e043,_0x12406f,_0x3d6ca7,_0x11b5a8?.[_0x599233(0x16e)],x(_0x11b5a8));}async[_0x46a83d(0x1f9)](_0x59e202,_0x356645,_0x5cd60b){const _0xf5a7be=_0x46a83d;if(_0x59e202[_0xf5a7be(0x1ca)]===0x0)throw new Error(_0xf5a7be(0x149));let _0x3f1e23=this[_0xf5a7be(0x1c1)](),_0x56a85d=_0x5cd60b?.['topK']??0xa,_0x2c17ec=_0x5cd60b?.[_0xf5a7be(0x1a1)]??0.8;if(_0x5cd60b?.['embedding'])return _0x3f1e23[_0xf5a7be(0x1f9)](_0x59e202,_0x356645,_0x5cd60b[_0xf5a7be(0x17f)],_0x56a85d,_0x2c17ec,_0x5cd60b?.[_0xf5a7be(0x16e)],x(_0x5cd60b));try{return await _0x3f1e23[_0xf5a7be(0x1c6)](_0x59e202,_0x356645,_0x56a85d,_0x2c17ec,_0x5cd60b?.['filter'],x(_0x5cd60b));}catch(_0x314c60){throw _0x314c60 instanceof Error&&_0x314c60['message'][_0xf5a7be(0x151)](_0xf5a7be(0x1ab))?new Error(_0x314c60[_0xf5a7be(0x144)]+_0xf5a7be(0x204),{'cause':_0x314c60}):_0x314c60 instanceof Error&&_0x314c60[_0xf5a7be(0x144)][_0xf5a7be(0x151)](_0xf5a7be(0x153))?new Error(_0xf5a7be(0x167),{'cause':_0x314c60}):_0x314c60;}}};import{SessionIndex as _0x299e9a}from'@moss-js/moss-core';var h=class r{#e;#r;#s;#i=!0x1;#a;constructor(_0xfd2256,_0x2af824,_0x27bbc3){this.#s=_0xfd2256,this.#r=_0x2af824,this.#e=_0x27bbc3;}static async['_create'](_0x2139f2,_0x4aaf78,_0x15ccd3,_0x4150bf,_0x235906,_0x8e8fc,_0x22af73){const _0x254cc8=_0x46a83d;let _0x313c28=_0x299e9a;_0x22af73&&y(_0x313c28);let _0x10a7bb=await _0x313c28['create'](_0x2139f2,_0x4aaf78,_0x15ccd3,_0x4150bf,_0x235906??null,_0x22af73?.[_0x254cc8(0x217)]??null,_0x22af73?.[_0x254cc8(0x181)]??null);return r[_0x254cc8(0x1a8)](_0x2139f2,_0x4aaf78,_0x10a7bb,_0x8e8fc);}static[_0x46a83d(0x1a8)](_0x3be776,_0x44a783,_0x291790,_0x148c3e){return _0x148c3e?.(_0x291790),new r(_0x3be776,_0x44a783,_0x291790);}get['name'](){return this.#s;}get[_0x46a83d(0x16d)](){const _0x1c39b0=_0x46a83d;return this.#n(),this.#e[_0x1c39b0(0x16d)];}get[_0x46a83d(0x1b1)](){return this.#r;}async['addDocs'](_0x326fe4,_0x3c15c9){const _0x21cb4a=_0x46a83d;this.#n();let _0x1fb7e5=_0x3c15c9?{'upsert':_0x3c15c9['upsert']??!0x0}:void 0x0;if(this.#r==='custom'){let _0x13c36e=r.#t(_0x326fe4),_0x573f91=_0x326fe4['map'](_0x10c08f=>{const _0x2776fd=_0xddff;let _0x25ae62={..._0x10c08f};return delete _0x25ae62[_0x2776fd(0x17f)],_0x25ae62;}),_0x5462bf=await this.#e[_0x21cb4a(0x17c)](_0x573f91,_0x13c36e,_0x1fb7e5);return{'added':_0x5462bf[_0x21cb4a(0x21d)],'updated':_0x5462bf[_0x21cb4a(0x156)]};}let _0x36a41d=await this.#e[_0x21cb4a(0x14f)](_0x326fe4,_0x1fb7e5);return{'added':_0x36a41d[_0x21cb4a(0x21d)],'updated':_0x36a41d['updated']};}async['deleteDocs'](_0x5d72a6){const _0x2d5539=_0x46a83d;return this.#n(),await this.#e[_0x2d5539(0x218)](_0x5d72a6);}async[_0x46a83d(0x1dc)](_0x7a303c){return this.#n(),await this.#e['getDocuments'](_0x7a303c??null);}async['query'](_0x45989c,_0x420ea1){const _0x5f2fc9=_0x46a83d;this.#n();let _0x34ed1f=_0x420ea1?.[_0x5f2fc9(0x145)]??0x5,_0x55f937=_0x420ea1?.[_0x5f2fc9(0x1a1)]??0.8,_0x67bbb7=_0x420ea1?.[_0x5f2fc9(0x16e)]??null,_0x4a3e3a=_0x420ea1?.[_0x5f2fc9(0x17f)];if(_0x4a3e3a==null){if(this.#r===_0x5f2fc9(0x14c))throw new Error(_0x5f2fc9(0x143));return await this.#e[_0x5f2fc9(0x191)](_0x45989c,_0x34ed1f,_0x55f937,_0x67bbb7);}return await this.#e[_0x5f2fc9(0x1f5)](_0x45989c,_0x34ed1f,Array[_0x5f2fc9(0x1ed)](_0x4a3e3a),_0x55f937,_0x67bbb7);}async[_0x46a83d(0x206)](_0x41b2c2,_0x3258a7){const _0x4d16a9=_0x46a83d;return this.#n(),this.#e[_0x4d16a9(0x206)](_0x41b2c2,_0x3258a7??null);}async[_0x46a83d(0x1f2)](){const _0x745f16=_0x46a83d;return this.#n(),this.#e[_0x745f16(0x1f2)]();}async[_0x46a83d(0x17a)](_0x2c5ddf){const _0x2666a9=_0x46a83d;this.#n(),await this.#e[_0x2666a9(0x17a)](_0x2c5ddf);}async[_0x46a83d(0x208)](_0x3e2c76,_0x2fbbcf){const _0xa54195=_0x46a83d;this.#n();let _0x2ad015=_0x2fbbcf?.['rebuildLegacy']??!0x0;return await this.#e[_0xa54195(0x208)](_0x3e2c76,{'rebuildLegacy':_0x2ad015});}async[_0x46a83d(0x154)](_0x424a8f){const _0x255492=_0x46a83d;return this.#n(),await this.#e[_0x255492(0x154)](_0x424a8f);}#n(){const _0x39f651=_0x46a83d;if(this.#i)throw new Error(_0x39f651(0x21a)+this.#s+'\x27\x20is\x20closed');}[_0x46a83d(0x164)](){return this.#a??=this.#o(),this.#a;}async #o(){const _0x4822ad=_0x46a83d;this.#i=!0x0;let _0x3f1d05=this.#e[_0x4822ad(0x164)];if(typeof _0x3f1d05!=_0x4822ad(0x1c9))throw new Error('@moss-js/moss-core\x20>=\x200.20.0\x20is\x20required\x20for\x20SessionIndex.close()');await _0x3f1d05['call'](this.#e);}async[Symbol[_0x46a83d(0x1bb)]](){const _0x34f63d=_0x46a83d;return this[_0x34f63d(0x164)]();}async[_0x46a83d(0x207)](){const _0x40364e=_0x46a83d;this.#n(),this.#r!==_0x40364e(0x14c)&&await this.#e[_0x40364e(0x1ee)]();}static#t(_0x562664){const _0x4dc0c2=_0x46a83d;let _0x55c213=_0x562664[_0x4dc0c2(0x16e)](_0xc35080=>!_0xc35080['embedding']||_0xc35080[_0x4dc0c2(0x17f)][_0x4dc0c2(0x1ca)]===0x0)[_0x4dc0c2(0x1d1)](_0x582d4b=>_0x582d4b['id']);if(_0x55c213[_0x4dc0c2(0x1ca)]>0x0)throw new Error(_0x4dc0c2(0x15d)+_0x55c213[_0x4dc0c2(0x15b)](',\x20')+_0x4dc0c2(0x176));return _0x562664[_0x4dc0c2(0x1d1)](_0x587fee=>Array['from'](_0x587fee[_0x4dc0c2(0x17f)]??[]));}};import{validateIndexName as _0x13890c}from'@moss-js/moss-core';var ne=_0x46a83d(0x1ad),re=_0x46a83d(0x17b),w=class extends Error{[_0x46a83d(0x1b6)];[_0x46a83d(0x1a0)];constructor(_0x324ea7,_0x502cba){const _0x516f7f=_0x46a83d;let _0x260b5=_0x502cba?':\x20'+_0x502cba:'';super(_0x516f7f(0x180)+_0x324ea7+_0x260b5),this['name']=_0x516f7f(0x1db),this[_0x516f7f(0x1b6)]=_0x324ea7,this[_0x516f7f(0x1a0)]=_0x502cba;}};function se(){const _0x19e1a2=_0x46a83d;return''+(typeof process<'u'&&process['env'][_0x19e1a2(0x1a7)]||ne)[_0x19e1a2(0x1f3)](/\/+$/,'')+re;}function oe(_0x3617a1){const _0x4115c2=_0x46a83d;return _0x3617a1?Object[_0x4115c2(0x166)](Object['entries'](_0x3617a1)[_0x4115c2(0x16e)](([,_0x5baf99])=>_0x5baf99!==void 0x0)):{};}async function F(_0x2a06cd,_0x344c19,_0x282889,_0x56e674){const _0x2eb82c=_0x46a83d;let _0x3a0c4a={...oe(_0x56e674),'action':_0x282889,'projectId':_0x2a06cd},_0x519d2f=await fetch(se(),{'method':_0x2eb82c(0x202),'headers':{'Content-Type':'application/json','X-Project-Key':_0x344c19},'body':JSON[_0x2eb82c(0x1d0)](_0x3a0c4a),'signal':AbortSignal[_0x2eb82c(0x1cf)](0x927c0)}),_0x4b4cf5=await _0x519d2f[_0x2eb82c(0x1e5)]();if(!_0x519d2f['ok'])throw new w(_0x519d2f[_0x2eb82c(0x1b6)],_0x4b4cf5);return _0x4b4cf5?JSON[_0x2eb82c(0x1d2)](_0x4b4cf5):{};}var W=_0x46a83d(0x190),D=class{#e;#r;#s;#i=!0x1;#a;#n=new Set();constructor(_0x2a3c28,_0xd00f39,_0x3a710){const _0x4fd41d=_0x46a83d;this.#e=new b(_0x2a3c28,_0xd00f39,_0x3a710),this.#r=_0x2a3c28,this.#s=typeof _0xd00f39==_0x4fd41d(0x16a)?_0xd00f39:null;}async['getAuthToken'](){const _0x18d89a=_0x46a83d;return this.#t(),this.#e[_0x18d89a(0x148)]();}async[_0x46a83d(0x19d)](_0x19aae9,_0x5bd27f,_0x350e87){const _0x42f074=_0x46a83d;this.#t();let _0x587134;return _0x350e87?.[_0x42f074(0x1b1)]!==void 0x0?_0x587134=_0x350e87[_0x42f074(0x1b1)]:_0x587134=_0x5bd27f['some'](_0x3f8aa7=>Array['isArray'](_0x3f8aa7[_0x42f074(0x17f)])&&_0x3f8aa7[_0x42f074(0x17f)][_0x42f074(0x1ca)]>0x0)?_0x42f074(0x14c):W,this.#e['createIndex'](_0x19aae9,_0x5bd27f,_0x587134,_0x350e87);}async[_0x46a83d(0x197)](_0x4079d9,_0x1f689c,_0x4bd39f){const _0x4ea5f4=_0x46a83d;return this.#t(),this.#e[_0x4ea5f4(0x197)](_0x4079d9,_0x1f689c,_0x4bd39f);}async[_0x46a83d(0x165)](_0x1d4f18){const _0x132bed=_0x46a83d;return this.#t(),this.#e[_0x132bed(0x165)](_0x1d4f18);}async['listIndexes'](){const _0x221b9d=_0x46a83d;return this.#t(),this.#e[_0x221b9d(0x14d)]();}async['deleteIndex'](_0x275d56){const _0x4c121e=_0x46a83d;return this.#t(),this.#e[_0x4c121e(0x168)](_0x275d56);}async[_0x46a83d(0x1ea)](_0x1e06b9,_0x1d0ef7,_0x1c2ac4){const _0x16ac2d=_0x46a83d;return this.#t(),this.#e[_0x16ac2d(0x1ea)](_0x1e06b9,_0x1d0ef7,_0x1c2ac4);}async[_0x46a83d(0x1cb)](_0xa24c13,_0x40bf7b,_0x4bdc26){return this.#t(),this.#e['deleteDocs'](_0xa24c13,_0x40bf7b,_0x4bdc26);}async['getJobStatus'](_0x4074bb){const _0x175c02=_0x46a83d;return this.#t(),this.#e[_0x175c02(0x169)](_0x4074bb);}async['createWebSource'](_0x5bddc9,_0x1af71f,_0x18a2db){const _0x3b32d1=_0x46a83d;return this.#t(),_0x13890c(_0x1af71f),this.#o(_0x3b32d1(0x175),{'rootUrl':_0x5bddc9,'indexName':_0x1af71f,'maxPages':_0x18a2db?.[_0x3b32d1(0x18e)],'maxDocuments':_0x18a2db?.[_0x3b32d1(0x1f7)],'maxDepth':_0x18a2db?.[_0x3b32d1(0x1ff)],'includePaths':_0x18a2db?.[_0x3b32d1(0x141)],'excludePaths':_0x18a2db?.[_0x3b32d1(0x19e)],'respectRobots':_0x18a2db?.[_0x3b32d1(0x18f)],'parseDocuments':_0x18a2db?.['parseDocuments'],'refreshCadence':_0x18a2db?.[_0x3b32d1(0x19b)],'modelId':_0x18a2db?.[_0x3b32d1(0x1b1)]});}async['listWebSources'](_0x3d12a8){const _0xd5d590=_0x46a83d;this.#t();let _0x24e645=(await this.#o(_0xd5d590(0x182),_0x3d12a8!==void 0x0?{'indexName':_0x3d12a8}:void 0x0))[_0xd5d590(0x1bd)]??[];return _0x3d12a8===void 0x0?_0x24e645:_0x24e645[_0xd5d590(0x16e)](_0x231aa5=>_0x231aa5[_0xd5d590(0x21c)]===_0x3d12a8);}async[_0x46a83d(0x1d5)](_0x8f33ef){const _0x3bd6b3=_0x46a83d;return this.#t(),this.#o(_0x3bd6b3(0x1d5),{'sourceId':_0x8f33ef});}async[_0x46a83d(0x1f4)](_0x224463,_0x56d1b3){const _0x527b47=_0x46a83d;return this.#t(),this.#o(_0x527b47(0x1f4),{'sourceId':_0x224463,'refreshCadence':_0x56d1b3[_0x527b47(0x19b)],'rootUrl':_0x56d1b3['rootUrl'],'includePaths':_0x56d1b3['includePaths'],'excludePaths':_0x56d1b3[_0x527b47(0x19e)],'maxDepth':_0x56d1b3['maxDepth'],'maxPages':_0x56d1b3[_0x527b47(0x18e)],'resync':_0x56d1b3[_0x527b47(0x1cc)]});}async['resyncWebSource'](_0x55704){return this.#t(),this.#o('resyncWebSource',{'sourceId':_0x55704});}async['deleteWebSource'](_0x5d0322){return this.#t(),this.#o('deleteWebSource',{'sourceId':_0x5d0322});}async #o(_0x726aa7,_0x470e77){const _0x5dfa0c=_0x46a83d;if(this.#s===null)throw new Error(_0x5dfa0c(0x1bc));return F(this.#r,this.#s,_0x726aa7,_0x470e77);}async[_0x46a83d(0x1dc)](_0x1b80a2,_0x463868){const _0x7f31f7=_0x46a83d;return this.#t(),this.#e[_0x7f31f7(0x1dc)](_0x1b80a2,_0x463868);}async['loadIndex'](_0x31ca1c,_0x2b0d87){const _0x37298d=_0x46a83d;return this.#t(),this.#e[_0x37298d(0x206)](_0x31ca1c,_0x2b0d87);}async[_0x46a83d(0x209)](_0x3c174e,_0x1d7fbb){return this.#t(),this.#e['loadIndexes'](_0x3c174e,_0x1d7fbb);}async[_0x46a83d(0x1b3)](_0x3d6a17){const _0xcfd40=_0x46a83d;return this.#t(),this.#e[_0xcfd40(0x1b3)](_0x3d6a17);}async[_0x46a83d(0x1be)](_0x5d7b0d){return this.#t(),this.#e['unloadIndexes'](_0x5d7b0d);}async[_0x46a83d(0x1f5)](_0x496673,_0x33787a,_0x75a08f){return this.#t(),this.#e['query'](_0x496673,_0x33787a,_0x75a08f);}async[_0x46a83d(0x1f9)](_0x2d9d88,_0x29be49,_0x150e42){const _0x4cc838=_0x46a83d;return this.#t(),this.#e[_0x4cc838(0x1f9)](_0x2d9d88,_0x29be49,_0x150e42);}async['session'](_0x39dff9,_0x64c489=W,_0x8f92c7){const _0x21828c=_0x46a83d;this.#t();let _0x37c616=this.#e[_0x21828c(0x189)],_0xe6f658;if(this.#s!==null)_0xe6f658=await h[_0x21828c(0x215)](_0x39dff9,_0x64c489,this.#r,this.#s,void 0x0,_0x37c616,_0x8f92c7);else{let _0x5180c2=await this.#e[_0x21828c(0x205)](_0x39dff9,_0x64c489,_0x8f92c7);_0xe6f658=h[_0x21828c(0x1a8)](_0x39dff9,_0x64c489,_0x5180c2,_0x37c616);}await _0xe6f658['_warmModel']();for(let _0x467fe5 of this.#n)_0x467fe5['deref']()||this.#n[_0x21828c(0x18d)](_0x467fe5);return this.#n['add'](new WeakRef(_0xe6f658)),_0xe6f658;}#t(){const _0x57f93b=_0x46a83d;if(this.#i)throw new Error(_0x57f93b(0x1b7));}[_0x46a83d(0x164)](){return this.#a??=this.#u(),this.#a;}async #u(){const _0x348359=_0x46a83d;this.#i=!0x0;let _0x5f3da7=[...this.#n][_0x348359(0x1d1)](_0x51bad0=>_0x51bad0[_0x348359(0x162)]())['filter'](_0x44f62a=>_0x44f62a!==void 0x0);this.#n['clear'](),await Promise['all'](_0x5f3da7['map'](_0x57272b=>_0x57272b['close']())),await this.#e[_0x348359(0x164)]();}async[Symbol[_0x46a83d(0x1bb)]](){const _0x30010d=_0x46a83d;return this[_0x30010d(0x164)]();}};export{w as ManageApiError,D as MossClient,h as SessionIndex};
package/dist/moss.d.ts CHANGED
@@ -6,6 +6,7 @@ import type { IndexInfo } from '@moss-js/moss-core';
6
6
  import { JobPhase } from '@moss-js/moss-core';
7
7
  import { JobStatus } from '@moss-js/moss-core';
8
8
  import { JobStatusResponse } from '@moss-js/moss-core';
9
+ import { LoadFromDiskOptions } from '@moss-js/moss-core';
9
10
  import { LoadSessionOptions } from '@moss-js/moss-core';
10
11
  import { MutationResult } from '@moss-js/moss-core';
11
12
  import { PushIndexResult } from '@moss-js/moss-core';
@@ -14,6 +15,7 @@ import { QueryResultDocumentInfo } from '@moss-js/moss-core';
14
15
  import { RefreshResult } from '@moss-js/moss-core';
15
16
  import { SearchResult } from '@moss-js/moss-core';
16
17
  import { SessionIndex as SessionIndex_2 } from '@moss-js/moss-core';
18
+ import { SnapshotInfo } from '@moss-js/moss-core';
17
19
 
18
20
  export declare interface AuthToken {
19
21
  token: string;
@@ -115,6 +117,8 @@ export { JobStatus }
115
117
 
116
118
  export { JobStatusResponse }
117
119
 
120
+ export { LoadFromDiskOptions }
121
+
118
122
  /**
119
123
  * Outcome of a best-effort bulk `loadIndexes` call.
120
124
  */
@@ -142,6 +146,7 @@ export declare interface LoadIndexOptions {
142
146
  autoRefresh?: boolean;
143
147
  /**
144
148
  * Polling interval in seconds. Only used when autoRefresh is true.
149
+ * 0 uses the default, and the minimum is 1 second.
145
150
  * @default 600 (10 minutes)
146
151
  */
147
152
  pollingIntervalInSeconds?: number;
@@ -520,9 +525,15 @@ export declare class MossClient {
520
525
  * Moss can generate query embeddings locally. For an older identity-less
521
526
  * index, provide a caller-generated vector through `options.embedding`.
522
527
  *
528
+ * A blank `query` (empty or only whitespace) with no `options.embedding`
529
+ * returns no results at every `alpha`, without running the embedding model.
530
+ * With an embedding, a blank `query` ranks by the embedding alone. An
531
+ * embedding holding NaN or infinity, or one whose length differs from the
532
+ * index dimension, rejects at every `alpha`.
533
+ *
523
534
  * @param indexName - Name of the target index to search.
524
535
  * @param query - The search query text.
525
- * @param options - Optional query configuration including topK (default: 5) and embedding overrides.
536
+ * @param options - Optional query configuration including topK (default: 5; 0 returns no results), embedding overrides, minScore, and candidateDepth.
526
537
  * @returns Promise that resolves to SearchResult with matching documents.
527
538
  * @throws {Error} If the index is not loaded.
528
539
  *
@@ -542,16 +553,18 @@ export declare class MossClient {
542
553
  *
543
554
  * All names must already be loaded (`loadIndex` / `loadIndexes`) and share
544
555
  * the same embedding model; there is no cloud fallback. `options.alpha`
545
- * works exactly as in `query` (default 0.8): `1.0` is embedding-only and
546
- * returns raw cosine scores, `0.0` is keyword-only, and values in between
547
- * fuse both signals with Reciprocal Rank Fusion. Keyword scoring runs each
548
- * index's own BM25 and merges hits by score before fusion. `options.topK`
549
- * (default 10) caps the merged result, not each index. `options.filter`
550
- * applies uniformly to every index.
556
+ * works exactly as in `query` (default 0.8): `1.0` is embedding-only, `0.0`
557
+ * is keyword-only, and values in between fuse both signals. Every mix returns
558
+ * results in hybrid order with the same relevance `score` as single-index
559
+ * `query`, and `options.minScore` filters on that score. Keyword scoring
560
+ * runs each index's own BM25 and merges hits before fusion. `options.topK`
561
+ * (default 10) caps the merged result, not each index, and 0 returns no
562
+ * results. `options.filter` applies uniformly to every index. A blank
563
+ * `query` with no `options.embedding` returns no results and embeds nothing.
551
564
  *
552
565
  * @param indexNames - Names of the loaded indexes to search.
553
566
  * @param query - The search query text.
554
- * @param options - Optional topK, alpha, embedding, and filter.
567
+ * @param options - Optional topK, alpha, embedding, filter, minScore, and candidateDepth.
555
568
  * @returns SearchResult whose docs carry `indexName`.
556
569
  * @throws {Error} If no names are given, a name is not loaded, or models differ.
557
570
  *
@@ -655,9 +668,9 @@ export declare type MossModel = "moss-minilm" | "moss-mediumlm" | "custom";
655
668
  */
656
669
  export declare interface MutationOptions {
657
670
  /**
658
- * Whether to update existing documents with the same ID.
659
- * Only applies to addDocs.
660
- * @default true
671
+ * Whether a document replaces a stored one with the same ID.
672
+ * `SessionIndex.addDocs` applies it locally and treats an omitted value as `true`.
673
+ * `MossClient.addDocs` sends it only when set, and the cloud service decides how to apply it.
661
674
  */
662
675
  upsert?: boolean;
663
676
  /**
@@ -745,8 +758,9 @@ export { SearchResult }
745
758
  * A local in-session index for real-time indexing and querying.
746
759
  *
747
760
  * All operations (`addDocs`, `deleteDocs`, `query`) run entirely in
748
- * process memory with no cloud round-trip. Call `pushIndex()` at the
749
- * end of a session to persist the result to the cloud.
761
+ * process memory with no cloud round-trip, on a native worker thread so
762
+ * the Node event loop stays responsive. Call `pushIndex()` at the end of
763
+ * a session to persist the result to the cloud.
750
764
  *
751
765
  * @example
752
766
  * ```typescript
@@ -781,7 +795,12 @@ export declare class SessionIndex {
781
795
  static _fromInner(name: string, modelId: MossModel, inner: SessionIndex_2, applyIdentity?: (target: IdentityTarget) => void): SessionIndex;
782
796
  /** The session index name. Identifies the cloud index on `pushIndex` / `loadIndex`. */
783
797
  get name(): string;
784
- /** Number of documents currently in the local session. */
798
+ /**
799
+ * Number of documents currently in the local session. Synchronous and
800
+ * never waits: it reports the count as of the last completed operation.
801
+ * A staged auto-refresh version is applied on a worker thread and shows
802
+ * up on a later read.
803
+ */
785
804
  get docCount(): number;
786
805
  /** The embedding model this session is configured for. */
787
806
  get modelId(): MossModel;
@@ -789,8 +808,9 @@ export declare class SessionIndex {
789
808
  * Add or update documents in the local session index.
790
809
  *
791
810
  * For models other than `"custom"`, embeddings are generated locally
792
- * via the Rust core — no cloud round-trip. For `modelId="custom"`,
793
- * each document **must** carry an `.embedding` field.
811
+ * via the Rust core on a native worker thread, with no cloud round-trip
812
+ * and no main-thread stall while a large batch is embedded. For
813
+ * `modelId="custom"`, each document **must** carry an `.embedding` field.
794
814
  *
795
815
  * @returns `{ added, updated }` counts.
796
816
  */
@@ -808,7 +828,13 @@ export declare class SessionIndex {
808
828
  *
809
829
  * For `modelId="custom"`, an explicit `options.embedding` is required.
810
830
  * For built-in models the query is embedded locally by the Rust core
811
- * if `options.embedding` is omitted.
831
+ * on a native worker thread if `options.embedding` is omitted.
832
+ *
833
+ * A blank `query` (empty or only whitespace) with no `options.embedding`
834
+ * returns no results at every `alpha`, without running the embedding model.
835
+ * With an embedding, a blank `query` ranks by the embedding alone.
836
+ * A custom-model session still needs `options.embedding`.
837
+ * `options.topK` defaults to 5, and 0 returns no results.
812
838
  */
813
839
  query(query: string, options?: QueryOptions): Promise<SearchResult>;
814
840
  /**
@@ -833,9 +859,32 @@ export declare class SessionIndex {
833
859
  saveToDisk(cachePath: string): Promise<void>;
834
860
  /**
835
861
  * Restore a session previously written by `saveToDisk`.
862
+ *
863
+ * A snapshot saved by an SDK older than 1.8 for a built-in model carries
864
+ * no model artifact provenance, so the core can only restore it as a
865
+ * custom-model session. This method asks the core to rebuild such a
866
+ * snapshot instead, which it does only for a session opened with the same
867
+ * built-in model: the stored documents are re-embedded with the current
868
+ * model (one-time cost, needs the cloud for the model) and the upgraded
869
+ * snapshot is saved back, all in one operation, so it happens once per
870
+ * device. Custom-model sessions and a snapshot of a different model load
871
+ * as before. Pass `{ rebuildLegacy: false }` to opt out.
872
+ *
873
+ * When the rebuild cannot load the model (offline, delivery down) the
874
+ * call rejects with a message starting "Legacy snapshot rebuild needs the
875
+ * embedding model" and changes nothing: the snapshot is intact and the
876
+ * session is as it was. Retry later; do not treat it as a corrupt cache.
836
877
  * @returns Number of documents loaded.
837
878
  */
838
- loadFromDisk(cachePath: string): Promise<number>;
879
+ loadFromDisk(cachePath: string, options?: LoadFromDiskOptions): Promise<number>;
880
+ /**
881
+ * Describe the snapshot under `<cachePath>/<name>/` without loading it:
882
+ * the model it was saved with, whether it carries model artifact
883
+ * provenance, and its size. `modelId` is a built-in model with
884
+ * `hasModelArtifact: false` for snapshots saved before 1.8, which
885
+ * `loadFromDisk` rebuilds by default.
886
+ */
887
+ inspectSnapshot(cachePath: string): Promise<SnapshotInfo>;
839
888
  /**
840
889
  * Release the session's native resources deterministically: the
841
890
  * auto-refresh poller, the in-memory index, and this session's
@@ -850,11 +899,14 @@ export declare class SessionIndex {
850
899
  /**
851
900
  * @internal Pre-loads the bundled embedding model for built-in
852
901
  * `modelId`s; no-op for `"custom"`. Called by `MossClient.session()`
853
- * so the first `addDocs` / `query` doesn't pay cold-start latency.
902
+ * so the first `addDocs` / `query` doesn't pay cold-start latency. The
903
+ * download and runtime initialization run on a native worker thread.
854
904
  */
855
905
  _warmModel(): Promise<void>;
856
906
  }
857
907
 
908
+ export { SnapshotInfo }
909
+
858
910
  export declare interface UpdateWebSourceOptions {
859
911
  refreshCadence?: WebSourceRefreshCadence;
860
912
  rootUrl?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moss-js/moss",
3
- "version": "1.12.0",
3
+ "version": "1.15.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.27.0"
48
+ "@moss-js/moss-core": "0.30.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@eslint/js": "^9.39.4",