@redocly/replay 0.28.0-next.8 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/{replay-AiChatProvider--1WugvKf.js → replay-AiChatProvider-BRqjyy2W.js} +2 -2
  2. package/dist/{replay-AiChatProvider-BJdxRVOc.js → replay-AiChatProvider-DUVoLgY2.js} +128 -130
  3. package/dist/{replay-AiChatSqliteDBStorage-D9fgt_9s.js → replay-AiChatSqliteDBStorage-0evx56pl.js} +6 -6
  4. package/dist/{replay-AiChatSqliteDBStorage-DbGtw6xx.js → replay-AiChatSqliteDBStorage-C5AnRloD.js} +1 -1
  5. package/dist/{replay-AiPanel-BU8oG0pD.js → replay-AiPanel-CMjVD12K.js} +77 -77
  6. package/dist/{replay-AiPanel-BYOLZjQX.js → replay-AiPanel-PVgJioX3.js} +2 -2
  7. package/dist/replay-FileWatcher-CFYprlWN.js +364 -0
  8. package/dist/replay-FileWatcher-DGLwO5Kd.js +1 -0
  9. package/dist/{replay-HistorySqliteDBStorage-CtF6-vY8.js → replay-HistorySqliteDBStorage-Bi5vBQ2T.js} +2 -2
  10. package/dist/{replay-SemanticSearchService-DRDdGJkI.js → replay-SemanticSearchService-Bh5xYa91.js} +22 -26
  11. package/dist/replay-SemanticSearchService-CulKCCNl.js +1 -0
  12. package/dist/{replay-SqliteDBStorage-D9Oeu_XC.js → replay-SqliteDBStorage-Bz0muHEk.js} +49 -49
  13. package/dist/{replay-SqliteDBStorage-B3zO7RGD.js → replay-SqliteDBStorage-CVHRAsPD.js} +1 -1
  14. package/dist/{replay-StepContextSqliteDBStorage-BfAAKDwA.js → replay-StepContextSqliteDBStorage-BkB2NM27.js} +2 -2
  15. package/dist/replay-TauriFileSystemAdapter-B163-f2D.js +108 -0
  16. package/dist/replay-TauriFileSystemAdapter-D4bOmvzP.js +1 -0
  17. package/dist/{replay-TauriRootStorage-XIJpsp6_.js → replay-TauriRootStorage-2MPQE-3f.js} +159 -155
  18. package/dist/replay-TauriRootStorage-CjWUrnWz.js +1 -0
  19. package/dist/{replay-agent-loop-DxK1tiVw.js → replay-agent-loop-BgYyBo9e.js} +9 -9
  20. package/dist/{replay-agent-loop-IDavXm8f.js → replay-agent-loop-DYDFXAZj.js} +1 -1
  21. package/dist/{replay-ai-chat-mappers-B-_eSMi4.js → replay-ai-chat-mappers-BEwNRQPV.js} +3 -3
  22. package/dist/{replay-ai-chat-mappers-BmvAc4xt.js → replay-ai-chat-mappers-CMtNqQHX.js} +1 -1
  23. package/dist/{replay-ai-message-parts.schema-E9u9-nqr.js → replay-ai-message-parts.schema-DKLf0SiG.js} +1 -1
  24. package/dist/{replay-create-model-CscK0cT1.js → replay-create-model-B2ZsGTjs.js} +3 -3
  25. package/dist/{replay-create-model-CIY7WZ1P.js → replay-create-model-DPxfOEfv.js} +4 -4
  26. package/dist/{replay-db-e_3o5e3f.js → replay-db-C9iqyMet.js} +1 -1
  27. package/dist/{replay-db-C_cdHXEt.js → replay-db-D4-LmLRk.js} +5 -5
  28. package/dist/{replay-external-resolver-nuL3ajF5.js → replay-external-resolver-BXgVrfzk.js} +7 -7
  29. package/dist/{replay-external-resolver-BmOmF-DG.js → replay-external-resolver-CTUbNZGW.js} +1 -1
  30. package/dist/{replay-history.schema-5ce6X0R1.js → replay-history.schema-B0lLwmdG.js} +3 -3
  31. package/dist/{replay-index-DDt4LOBo.js → replay-index-4TEahAPK.js} +21968 -21367
  32. package/dist/{replay-index-DjdDUkfV.js → replay-index-B4U7iZuq.js} +46 -46
  33. package/dist/replay-index-B8O3wYqo.js +1 -0
  34. package/dist/{replay-index-etIeWhnn.js → replay-index-Bdg7noSD.js} +1 -1
  35. package/dist/replay-index-CG9VN2JQ.js +4 -0
  36. package/dist/{replay-index-E3Eu6_jY.js → replay-index-DcC173cC.js} +1 -1
  37. package/dist/{replay-index-B8Zfn7JD.js → replay-index-Nz5obVS5.js} +1139 -1141
  38. package/dist/{replay-index-DcbwI4wD.js → replay-index-q63USe25.js} +1 -1
  39. package/dist/{replay-indexes-CfsvVMi_.js → replay-indexes-B3PJtgeh.js} +43 -43
  40. package/dist/{replay-lint-DVAifLdU.js → replay-lint-4XFKTmSY.js} +97 -97
  41. package/dist/{replay-lint-graphql-U_VxwRr1.js → replay-lint-graphql-BsBWkZ6L.js} +1 -1
  42. package/dist/{replay-lint-graphql-D1qaeEmu.js → replay-lint-graphql-De2eDZnT.js} +1 -1
  43. package/dist/{replay-lint-BjrmIhuZ.js → replay-lint-s7ylMBWz.js} +6111 -6074
  44. package/dist/replay-periodic-revalidation-BMFP7f-u.js +1 -0
  45. package/dist/{replay-periodic-revalidation-BtEKdEKa.js → replay-periodic-revalidation-DJbblUef.js} +4 -5
  46. package/dist/{replay-resolve-C97SfUAB.js → replay-resolve-BtNxNrKo.js} +123 -123
  47. package/dist/{replay-resolve-BYJosLqD.js → replay-resolve-BueEsOnR.js} +1 -1
  48. package/dist/{replay-respect-run-CW5xFLKz.js → replay-respect-run-B_dJjlti.js} +1 -1
  49. package/dist/{replay-respect-run-3FHTVHvs.js → replay-respect-run-Dfpbcsns.js} +3 -3
  50. package/dist/replay-step-context.schema-BOprzd6Z.js +21 -0
  51. package/dist/{replay-tauri-path-CMpWmGvW.js → replay-tauri-path-Bht3XIt7.js} +1 -1
  52. package/dist/replay-tauri-path-CiuYXh_j.js +22 -0
  53. package/dist/replay-useAiChatQueries-02CRdEPJ.js +215 -0
  54. package/dist/{replay-useAiChatQueries-DhTcllVx.js → replay-useAiChatQueries-D2hh5omV.js} +1039 -996
  55. package/dist/{replay-validate-key-Dj_UT2WG.js → replay-validate-key-ALwOF1Ux.js} +1 -1
  56. package/dist/{replay-validate-key-DJ_1khxq.js → replay-validate-key-B7fbWbfv.js} +2 -2
  57. package/dist/replay.cjs +1 -1
  58. package/dist/replay.d.ts +5 -0
  59. package/dist/replay.js +15 -15
  60. package/package.json +6 -6
  61. package/dist/replay-FileWatcher-BrhE0AP6.js +0 -1
  62. package/dist/replay-FileWatcher-JoqPJECh.js +0 -360
  63. package/dist/replay-SemanticSearchService-BgQ1HMcT.js +0 -1
  64. package/dist/replay-TauriFileSystemAdapter-CxHFFCmk.js +0 -1
  65. package/dist/replay-TauriFileSystemAdapter-DJETGEY7.js +0 -99
  66. package/dist/replay-TauriRootStorage-BSQQcFgG.js +0 -1
  67. package/dist/replay-index-C_DfEx-H.js +0 -1
  68. package/dist/replay-index-Da2H-hpA.js +0 -25
  69. package/dist/replay-periodic-revalidation-C3eLm7Mw.js +0 -1
  70. package/dist/replay-step-context.schema-DBk4jufr.js +0 -21
  71. package/dist/replay-tauri-path-C-vLbl1V.js +0 -22
  72. package/dist/replay-useAiChatQueries-CEYDGx9f.js +0 -215
@@ -1,99 +0,0 @@
1
- import { a3 as c, a4 as o, a5 as n, P as l, a6 as u, a7 as h, a8 as d, a9 as w, aa as m, ab as y } from "./replay-index-DDt4LOBo.js";
2
- import { O as f } from "./replay-Observable-D6wKbFwB.js";
3
- const E = /* @__PURE__ */ new Set(["node_modules"]);
4
- class p extends f {
5
- constructor(t) {
6
- super(), this.baseDir = t, this.initializeDirectory(t);
7
- }
8
- baseDir;
9
- writeExcludedKeys = /* @__PURE__ */ new Set();
10
- writeEndTimers = /* @__PURE__ */ new Map();
11
- async initializeDirectory(t) {
12
- await c(t, {
13
- recursive: !0
14
- });
15
- }
16
- setWriteExcludedKeys(t) {
17
- this.writeExcludedKeys = t;
18
- }
19
- async ls(t) {
20
- const e = await this.getFullPath(t);
21
- return this.getDirEntryFilesRecursively(e);
22
- }
23
- async getDirEntryFilesRecursively(t) {
24
- try {
25
- const e = [], i = await o(t);
26
- for (const s of i)
27
- if (s.isDirectory) {
28
- if (E.has(s.name))
29
- continue;
30
- const r = await n(t, s.name), a = await this.getDirEntryFilesRecursively(r);
31
- e.push(...a);
32
- } else {
33
- const r = await n(t, s.name), a = await l.relative(this.baseDir, r);
34
- e.push(a);
35
- }
36
- return e;
37
- } catch (e) {
38
- return e.includes("forbidden path") || console.error(e), [];
39
- }
40
- }
41
- async get(t) {
42
- const e = await this.getFullPath(t);
43
- try {
44
- return await u(e);
45
- } catch (i) {
46
- return !i.includes("No such file or directory") && !i.includes("forbidden path") && console.error(i), null;
47
- }
48
- }
49
- async has(t) {
50
- const e = await this.getFullPath(t);
51
- return await h(e);
52
- }
53
- async set(t, e) {
54
- if (!this.writeExcludedKeys.has(t)) {
55
- this.emit("write-start", t);
56
- try {
57
- const i = await this.getFullPath(t), s = d(), r = i.split(s).slice(0, -1).join(s);
58
- await c(r, {
59
- recursive: !0
60
- }), await w(i, e);
61
- } finally {
62
- const i = this.writeEndTimers.get(t);
63
- i && clearTimeout(i);
64
- const s = setTimeout(() => {
65
- this.emit("write-end", t), this.writeEndTimers.delete(t);
66
- }, 1e3);
67
- this.writeEndTimers.set(t, s);
68
- }
69
- }
70
- }
71
- async remove(t) {
72
- if (!this.writeExcludedKeys.has(t)) {
73
- this.emit("write-start", t);
74
- try {
75
- const e = await this.getFullPath(t);
76
- await m(e);
77
- } catch (e) {
78
- !e.includes("No such file or directory") && !e.includes("forbidden path") && console.error(e);
79
- } finally {
80
- const e = this.writeEndTimers.get(t);
81
- e && clearTimeout(e);
82
- const i = setTimeout(() => {
83
- this.emit("write-end", t), this.writeEndTimers.delete(t);
84
- }, 1e3);
85
- this.writeEndTimers.set(t, i);
86
- }
87
- }
88
- }
89
- async rename(t, e) {
90
- const i = await this.getFullPath(t), s = await this.getFullPath(e);
91
- await y(i, s);
92
- }
93
- async getFullPath(t) {
94
- return await n(this.baseDir, t ?? "");
95
- }
96
- }
97
- export {
98
- p as TauriFileSystemAdapter
99
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./replay-index-B8Zfn7JD.js"),Y=require("./replay-promise-map-limit-DRDkHc-b.js"),G=require("./replay-TauriFileSystemAdapter-CxHFFCmk.js");var U={exports:{}},V;function oe(){return V||(V=1,(function(s){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function n(a,u,h){this.fn=a,this.context=u,this.once=h||!1}function o(a,u,h,f,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var y=new n(h,f||a,g),v=t?t+u:u;return a._events[v]?a._events[v].fn?a._events[v]=[a._events[v],y]:a._events[v].push(y):(a._events[v]=y,a._eventsCount++),a}function d(a,u){--a._eventsCount===0?a._events=new r:delete a._events[u]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],h,f;if(this._eventsCount===0)return u;for(f in h=this._events)e.call(h,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},c.prototype.listeners=function(u){var h=t?t+u:u,f=this._events[h];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,y=f.length,v=new Array(y);g<y;g++)v[g]=f[g].fn;return v},c.prototype.listenerCount=function(u){var h=t?t+u:u,f=this._events[h];return f?f.fn?1:f.length:0},c.prototype.emit=function(u,h,f,g,y,v){var b=t?t+u:u;if(!this._events[b])return!1;var l=this._events[b],T=arguments.length,Q,w;if(l.fn){switch(l.once&&this.removeListener(u,l.fn,void 0,!0),T){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,h),!0;case 3:return l.fn.call(l.context,h,f),!0;case 4:return l.fn.call(l.context,h,f,g),!0;case 5:return l.fn.call(l.context,h,f,g,y),!0;case 6:return l.fn.call(l.context,h,f,g,y,v),!0}for(w=1,Q=new Array(T-1);w<T;w++)Q[w-1]=arguments[w];l.fn.apply(l.context,Q)}else{var ae=l.length,x;for(w=0;w<ae;w++)switch(l[w].once&&this.removeListener(u,l[w].fn,void 0,!0),T){case 1:l[w].fn.call(l[w].context);break;case 2:l[w].fn.call(l[w].context,h);break;case 3:l[w].fn.call(l[w].context,h,f);break;case 4:l[w].fn.call(l[w].context,h,f,g);break;default:if(!Q)for(x=1,Q=new Array(T-1);x<T;x++)Q[x-1]=arguments[x];l[w].fn.apply(l[w].context,Q)}}return!0},c.prototype.on=function(u,h,f){return o(this,u,h,f,!1)},c.prototype.once=function(u,h,f){return o(this,u,h,f,!0)},c.prototype.removeListener=function(u,h,f,g){var y=t?t+u:u;if(!this._events[y])return this;if(!h)return d(this,y),this;var v=this._events[y];if(v.fn)v.fn===h&&(!g||v.once)&&(!f||v.context===f)&&d(this,y);else{for(var b=0,l=[],T=v.length;b<T;b++)(v[b].fn!==h||g&&!v[b].once||f&&v[b].context!==f)&&l.push(v[b]);l.length?this._events[y]=l.length===1?l[0]:l:d(this,y)}return this},c.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&d(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=t,c.EventEmitter=c,s.exports=c})(U)),U.exports}var ue=oe();const le=p.getDefaultExportFromCjs(ue);class re extends Error{constructor(e){super(e),this.name="TimeoutError"}}let ce=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const J=s=>globalThis.DOMException===void 0?new ce(s):new DOMException(s),H=s=>{const e=s.reason===void 0?J("This operation was aborted."):s.reason;return e instanceof Error?e:J(e)};function he(s,e,t,r){let n;const o=new Promise((d,c)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){d(s);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){const{signal:a}=r;a.aborted&&c(H(a)),a.addEventListener("abort",()=>{c(H(a))})}n=r.customTimers.setTimeout.call(void 0,()=>{const a=`Promise timed out after ${e} milliseconds`,u=t instanceof Error?t:new re(a);typeof s.cancel=="function"&&s.cancel(),c(u)},e),(async()=>{try{d(await s)}catch(a){c(a)}finally{r.customTimers.clearTimeout.call(void 0,n)}})()});return o.clear=()=>{clearTimeout(n),n=void 0},o}function fe(s,e,t){let r=0,n=s.length;for(;n>0;){const o=Math.trunc(n/2);let d=r+o;t(s[d],e)<=0?(r=++d,n-=o+1):n=o}return r}var F=function(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)},A;class de{constructor(){A.set(this,[])}enqueue(e,t){t={priority:0,...t};const r={priority:t.priority,run:e};if(this.size&&F(this,A,"f")[this.size-1].priority>=t.priority){F(this,A,"f").push(r);return}const n=fe(F(this,A,"f"),r,(o,d)=>d.priority-o.priority);F(this,A,"f").splice(n,0,r)}dequeue(){const e=F(this,A,"f").shift();return e?.run}filter(e){return F(this,A,"f").filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return F(this,A,"f").length}}A=new WeakMap;var m=function(s,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t},i=function(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)},_,L,M,I,R,N,z,E,O,P,k,S,W,C,q,X,Z,ie,ee,te,D,B,K,$,se,j;class ne extends Error{}class pe extends le{constructor(e){var t,r,n,o;if(super(),_.add(this),L.set(this,void 0),M.set(this,void 0),I.set(this,0),R.set(this,void 0),N.set(this,void 0),z.set(this,0),E.set(this,void 0),O.set(this,void 0),P.set(this,void 0),k.set(this,void 0),S.set(this,0),W.set(this,void 0),C.set(this,void 0),q.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:de,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(o=(n=e.interval)===null||n===void 0?void 0:n.toString())!==null&&o!==void 0?o:""}\` (${typeof e.interval})`);m(this,L,e.carryoverConcurrencyCount,"f"),m(this,M,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),m(this,R,e.intervalCap,"f"),m(this,N,e.interval,"f"),m(this,P,new e.queueClass,"f"),m(this,k,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,m(this,q,e.throwOnTimeout===!0,"f"),m(this,C,e.autoStart===!1,"f")}get concurrency(){return i(this,W,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);m(this,W,e,"f"),i(this,_,"m",$).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:i(this,q,"f"),...t},new Promise((r,n)=>{i(this,P,"f").enqueue(async()=>{var o,d,c;m(this,S,(d=i(this,S,"f"),d++,d),"f"),m(this,I,(c=i(this,I,"f"),c++,c),"f");try{if(!((o=t.signal)===null||o===void 0)&&o.aborted)throw new ne("The task was aborted.");let a=e({signal:t.signal});t.timeout&&(a=he(Promise.resolve(a),t.timeout)),t.signal&&(a=Promise.race([a,i(this,_,"m",se).call(this,t.signal)]));const u=await a;r(u),this.emit("completed",u)}catch(a){if(a instanceof re&&!t.throwOnTimeout){r();return}n(a),this.emit("error",a)}finally{i(this,_,"m",ie).call(this)}},t),this.emit("add"),i(this,_,"m",D).call(this)})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return i(this,C,"f")?(m(this,C,!1,"f"),i(this,_,"m",$).call(this),this):this}pause(){m(this,C,!0,"f")}clear(){m(this,P,new(i(this,k,"f")),"f")}async onEmpty(){i(this,P,"f").size!==0&&await i(this,_,"m",j).call(this,"empty")}async onSizeLessThan(e){i(this,P,"f").size<e||await i(this,_,"m",j).call(this,"next",()=>i(this,P,"f").size<e)}async onIdle(){i(this,S,"f")===0&&i(this,P,"f").size===0||await i(this,_,"m",j).call(this,"idle")}get size(){return i(this,P,"f").size}sizeBy(e){return i(this,P,"f").filter(e).length}get pending(){return i(this,S,"f")}get isPaused(){return i(this,C,"f")}}L=new WeakMap,M=new WeakMap,I=new WeakMap,R=new WeakMap,N=new WeakMap,z=new WeakMap,E=new WeakMap,O=new WeakMap,P=new WeakMap,k=new WeakMap,S=new WeakMap,W=new WeakMap,C=new WeakMap,q=new WeakMap,_=new WeakSet,X=function(){return i(this,M,"f")||i(this,I,"f")<i(this,R,"f")},Z=function(){return i(this,S,"f")<i(this,W,"f")},ie=function(){var e;m(this,S,(e=i(this,S,"f"),e--,e),"f"),i(this,_,"m",D).call(this),this.emit("next")},ee=function(){i(this,_,"m",K).call(this),i(this,_,"m",B).call(this),m(this,O,void 0,"f")},te=function(){const e=Date.now();if(i(this,E,"f")===void 0){const t=i(this,z,"f")-e;if(t<0)m(this,I,i(this,L,"f")?i(this,S,"f"):0,"f");else return i(this,O,"f")===void 0&&m(this,O,setTimeout(()=>{i(this,_,"m",ee).call(this)},t),"f"),!0}return!1},D=function(){if(i(this,P,"f").size===0)return i(this,E,"f")&&clearInterval(i(this,E,"f")),m(this,E,void 0,"f"),this.emit("empty"),i(this,S,"f")===0&&this.emit("idle"),!1;if(!i(this,C,"f")){const e=!i(this,_,"a",te);if(i(this,_,"a",X)&&i(this,_,"a",Z)){const t=i(this,P,"f").dequeue();return t?(this.emit("active"),t(),e&&i(this,_,"m",B).call(this),!0):!1}}return!1},B=function(){i(this,M,"f")||i(this,E,"f")!==void 0||(m(this,E,setInterval(()=>{i(this,_,"m",K).call(this)},i(this,N,"f")),"f"),m(this,z,Date.now()+i(this,N,"f"),"f"))},K=function(){i(this,I,"f")===0&&i(this,S,"f")===0&&i(this,E,"f")&&(clearInterval(i(this,E,"f")),m(this,E,void 0,"f")),m(this,I,i(this,L,"f")?i(this,S,"f"):0,"f"),i(this,_,"m",$).call(this)},$=function(){for(;i(this,_,"m",D).call(this););},se=async function(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(new ne("The task was aborted."))},{once:!0})})},j=async function(e,t){return new Promise(r=>{const n=()=>{t&&!t()||(this.off(e,n),r())};this.on(e,n)})};class ve{constructor(e){this.apisStorage=e}apisStorage;data=new Map;loading=new Set;pQueue=new pe({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e)??null:(await this.loadAndParse(e),this.data.get(e)??null)}async load(e,t=!1){this.data.has(e)&&!t||await this.loadAndParse(e,t)}async loadAndParse(e,t=!1){if(this.loading.has(e)){await this.pQueue.add(()=>this.get(e));return}t&&this.data.delete(e),this.loading.add(e),await this.pQueue.add(async()=>{const r=p.isWebUrl(e)?p.SourceType.WEB:p.SourceType.FS,n=r===p.SourceType.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const{definition:o,fileDependencies:d}=await p.loadAndBundleDefinition(n);if(!o){this.data.set(e,null),await p.clearNotificationsForSource(e);return}const c=this.apisStorage.parse({uri:e,type:r,content:o});this.data.set(e,{...c,fileDependencies:d}),await p.clearNotificationsForSource(e)}catch(o){if(this.data.set(e,null),o instanceof Error&&(o.message.includes("Unsupported specification")||o.message.includes("File not found"))){await p.clearNotificationsForSource(e);return}console.info("Error loading api "+e,o),await p.reportParseError(e,o);return}}),this.loading.delete(e)}get size(){return this.data.size}delete(e){this.data.delete(e)}getAll(){return Array.from(this.data.values()).filter(e=>e!==null)}clear(){this.data.clear(),this.loading.clear()}}class me extends p.RootStorage{apiLoader;constructor(e,t,r){const n=new G.TauriFileSystemAdapter(e.systemFilesDir),o=new G.TauriFileSystemAdapter(e.userFilesDir);super(n,o,e,!0,!1,t,r),this.apiLoader=new ve(this.apisStorage),this.setupWriteListeners(o)}setupWriteListeners(e){e.on("write-start",t=>{this.addWatchExcludedId(t)}),e.on("write-end",t=>{this.removeWatchExcludedId(t)})}async read(){const e=this.telemetry?.startSpan("com.redocly.storage.read",[p.createResource("storageOperation","read","storage")],void 0),t=this.telemetry?.startSpan("com.redocly.storage.loadUserState",[p.createResource("storageOperation","loadUserState","storage")],e?.parentCtx),[r,n,o]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);t?.setAttribute("status","completed"),t?.setAttribute("environmentCount",o.length),t?.setStatus(p.SpanStatusCode.OK),t?.end();const{apiFiles:d,collectionFiles:c}=await this.detectProjectFiles(e);await this.loadAndParseApis(d,e);const u=(await this.loadAndParseCollections(c,e)).filter(f=>f!==null),h=this.apiLoader.getAll();return e?.setAttribute("status","completed"),e?.setStatus(p.SpanStatusCode.OK),e?.end(),{project:this.project,activeEnvironmentId:r,tabsState:n,environments:o,apis:h,collections:u}}async detectProjectFiles(e){const t=this.telemetry?.startSpan("com.redocly.storage.detectFiles",[p.createResource("storageOperation","detectFiles","storage")],e?.parentCtx),{api_files:r,collection_files:n}=await p.invoke("fs_scan",{dir:this.project.userFilesDir});return t?.setAttribute("status","completed"),t?.setAttribute("filesCount",r.length+n.length),t?.setAttribute("apiFilesCount",r.length),t?.setAttribute("collectionFilesCount",n.length),t?.setStatus(p.SpanStatusCode.OK),t?.end(),{apiFiles:r,collectionFiles:n}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(e){this.apiLoader.delete(e)}async loadAndParseApis(e,t,r=!1){const n=this.telemetry?.startSpan("com.redocly.storage.parseApis",[{...p.createResource("storageOperation","parseApis","storage"),apisCount:e.length}],t?.parentCtx),o=await Y.promiseMapLimit(e,20,async d=>{try{return await this.apiLoader.load(d.relative_path,r),this.apiLoader.get(d.relative_path)}catch(c){return console.info(`Error parsing YAML/JSON file ${d.absolute_path}:`,c),await p.reportParseError(d.relative_path,c),null}});return n?.setAttribute("status","completed"),n?.setAttribute("parsedApisCount",this.apiLoader.size),n?.setStatus(p.SpanStatusCode.OK),n?.end(),o}async loadAndParseCollections(e,t){const r=this.telemetry?.startSpan("com.redocly.storage.parseCollections",[{...p.createResource("storageOperation","parseCollections","storage"),collectionsCount:e.length}],t?.parentCtx),n=await Y.promiseMapLimit(e,20,async o=>{try{const d=await this.userFilesStorage.get(o.relative_path);if(!d)return null;const c=p.yaml.load(d);if(typeof c!="object"||c===null||typeof c.arazzo!="string")return await p.clearNotificationsForSource(o.relative_path),null;const a=[];await Promise.all(c.sourceDescriptions?.map(async f=>{const g=f.type,y=f.url,v=!g||g==="openapi",b=await p.apiUrlToApiId({projectPath:this.project.userFilesDir,apiUrl:y,collectionId:o.relative_path});if(v){const l=await this.apiLoader.get(b);l&&a.push(l)}}));const u=await p.PathUtils.join(this.project.userFilesDir,o.relative_path),h=await this.collectionsStorage.parse({uri:o.relative_path,type:p.SourceType.FS,content:c,fileDependencies:new Set([u])},a);return await p.clearNotificationsForSource(o.relative_path),h}catch(d){return console.info(`Error parsing Arazzo file ${o.relative_path}:`,d),await p.reportParseError(o.relative_path,d),null}});return r?.setAttribute("status","completed"),r?.setAttribute("parsedCollectionsCount",n.length),r?.setStatus(p.SpanStatusCode.OK),r?.end(),n}}exports.TauriRootStorage=me;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-SemanticSearchService-BgQ1HMcT.js"),r=require("react");function u(){const[n,c]=r.useState(!1),[s,a]=r.useState(null);return{search:r.useCallback(async(i,S=10)=>{c(!0),a(null);try{return await e.getSemanticSearchService().search(i,S)}catch(t){const o=t instanceof Error?t:new Error(String(t));return a(o),[]}finally{c(!1)}},[]),isSearching:n,error:s}}exports.SemanticSearchService=e.SemanticSearchService;exports.extractAllDocuments=e.extractAllDocuments;exports.extractApiDocuments=e.extractApiDocuments;exports.extractCollectionDocuments=e.extractCollectionDocuments;exports.getSemanticSearchService=e.getSemanticSearchService;exports.useSemanticSearch=u;
@@ -1,25 +0,0 @@
1
- import { g as l } from "./replay-SemanticSearchService-DRDdGJkI.js";
2
- import { S as x, e as y, a as D, b as E } from "./replay-SemanticSearchService-DRDdGJkI.js";
3
- import { useState as a, useCallback as u } from "react";
4
- function f() {
5
- const [c, r] = a(!1), [s, t] = a(null);
6
- return { search: u(async (n, o = 10) => {
7
- r(!0), t(null);
8
- try {
9
- return await l().search(n, o);
10
- } catch (e) {
11
- const i = e instanceof Error ? e : new Error(String(e));
12
- return t(i), [];
13
- } finally {
14
- r(!1);
15
- }
16
- }, []), isSearching: c, error: s };
17
- }
18
- export {
19
- x as SemanticSearchService,
20
- y as extractAllDocuments,
21
- D as extractApiDocuments,
22
- E as extractCollectionDocuments,
23
- l as getSemanticSearchService,
24
- f as useSemanticSearch
25
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./replay-index-B8Zfn7JD.js"),i=300*1e3;function r(e){return()=>({apis:e.get(n.apisAtom),collections:e.get(n.collectionsAtom)})}function I(e,a,o=i){let t=!1;const c=r(a),l=setInterval(()=>{t||e.getIndexingActivityState().inProgress||(t=!0,e.reindex(c).catch(s=>console.error("Semantic index revalidation:",s)).finally(()=>{t=!1}))},o);return()=>clearInterval(l)}exports.INDEX_REVALIDATION_INTERVAL_MS=i;exports.createIndexSnapshotGetter=r;exports.startPeriodicIndexRevalidation=I;
@@ -1,21 +0,0 @@
1
- import { R as o, U as s, X as e, Z as n, Y as d } from "./replay-indexes-CfsvVMi_.js";
2
- const i = o(
3
- "step_context",
4
- {
5
- id: e("id").primaryKey().notNull(),
6
- collectionId: e("collection_id").notNull(),
7
- workflowId: e("workflow_id").notNull(),
8
- stepId: e("step_id").notNull(),
9
- request: e("request", { mode: "json" }).$type(),
10
- response: e("response", { mode: "json" }).$type(),
11
- outputs: e("outputs", { mode: "json" }).$type(),
12
- date: s("date").notNull()
13
- },
14
- (t) => [
15
- n("step_context_unique_idx").on(t.collectionId, t.workflowId, t.stepId),
16
- d("step_context_date_idx").on(t.date)
17
- ]
18
- );
19
- export {
20
- i as s
21
- };
@@ -1,22 +0,0 @@
1
- import { bc as h, a8 as x, bd as i } from "./replay-index-DDt4LOBo.js";
2
- import { be as $, bf as d, a5 as j } from "./replay-index-DDt4LOBo.js";
3
- async function P(n, e) {
4
- const t = x(), c = await i(n), l = await i(e), o = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), r = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, r.length);
5
- let s = 0;
6
- for (let a = 0; a < m && o[a] === r[a]; a++)
7
- s++;
8
- const p = o.slice(s).map(() => ".."), f = r.slice(s);
9
- return [...p, ...f].join(t);
10
- }
11
- async function u(n) {
12
- const e = await h(n);
13
- return e ? `.${e}` : "";
14
- }
15
- export {
16
- $ as dirname,
17
- u as extname,
18
- d as isAbsolute,
19
- j as join,
20
- P as relative,
21
- i as resolve
22
- };