@e-llm-studio/requirement-ai 0.0.69 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/features/RequirementAI/hooks/useStreamContentHandler.js +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/hooks/useStreamContentHandler.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),e=require("react"),t=require("../utils/proccess-stream.utils.js");exports.useStreamContentHandler=function(n){var i=n.setUserStory,s=n.setAiReasoning,a=n.setUserStoryCitations,o=n.onStreamingCompleted,u=n.isGraphQLCallInProgress,c=n.knowledgeBase,l=n.projectAnalyserSummary,_=n.dataSourceFiles,d=n.aiReasoning,p=n.setRedisValue,m=n.fetchCitationByBlock,v=e.useRef(new Set),f=e.useRef(new Set),y=e.useRef(null),g=e.useRef(null),b=e.useRef({gap_items_prompt:"",risk_items_prompt:""});function A(e,t,n){var i,c;return r.__awaiter(this,void 0,void 0,function(){var l,_,d,p,A,N,R;return r.__generator(this,function(S){switch(S.label){case 0:l="",_="",S.label=1;case 1:return S.trys.push([1,3,4,7]),[4,m(e,n,t)];case 2:return d=S.sent(),s(function(e){var t,n=r.__spreadArray([],e,!0);return null===(t=d.response.ai_reasonings)||void 0===t||t.forEach(function(e){var t=n.findIndex(function(r){return r.id===e.id});-1!==t&&(n[t]=r.__assign({},e))}),n}),l=(null===(i=d.response)||void 0===i?void 0:i.gap_items_prompt)||"",_=(null===(c=d.response)||void 0===c?void 0:c.risk_items_prompt)||"",(l||_)&&(b.current={gap_items_prompt:l,risk_items_prompt:_}),a(function(e){var t,n,i,s,a,o,u,c,l,_,p,m,v,f;return r.__assign(r.__assign({},e),{appmod_citations:r.__spreadArray(r.__spreadArray([],null!==(t=e.appmod_citations)&&void 0!==t?t:[],!0),null!==(n=d.response.appmod_citations)&&void 0!==n?n:[],!0),audio_citations:r.__spreadArray(r.__spreadArray([],null!==(i=e.audio_citations)&&void 0!==i?i:[],!0),null!==(s=d.response.audio_citations)&&void 0!==s?s:[],!0),file_citations:r.__spreadArray(r.__spreadArray([],null!==(a=e.file_citations)&&void 0!==a?a:[],!0),null!==(o=d.response.file_citations)&&void 0!==o?o:[],!0),image_citations:r.__spreadArray(r.__spreadArray([],null!==(u=e.image_citations)&&void 0!==u?u:[],!0),null!==(c=d.response.image_citations)&&void 0!==c?c:[],!0),rca_citations:r.__spreadArray(r.__spreadArray([],null!==(l=e.rca_citations)&&void 0!==l?l:[],!0),null!==(_=d.response.rca_citations)&&void 0!==_?_:[],!0),web_citations:r.__spreadArray(r.__spreadArray([],null!==(p=e.web_citations)&&void 0!==p?p:[],!0),null!==(m=d.response.web_citations)&&void 0!==m?m:[],!0),readfile_citations:r.__spreadArray(r.__spreadArray([],null!==(v=e.readfile_citations)&&void 0!==v?v:[],!0),null!==(f=d.response.readfile_citations)&&void 0!==f?f:[],!0)})}),[3,7];case 3:return p=S.sent(),console.error("Error in fetching Citations",p),[3,7];case 4:return console.log("Citations fetching completed",e.storyNumber,e.blockNumber),A="<STORY_NUMBER>".concat(e.storyNumber,"<BLOCK_NUMBER>").concat(e.blockNumber),f.current.add(A),console.log("Citations fetching completed",f.current.size,v.current.size,u.current),f.current.size!==v.current.size||u.current?[3,6]:(N=l||b.current.gap_items_prompt,R=_||b.current.risk_items_prompt,[4,o(N,R)]);case 5:S.sent(),v.current.clear(),f.current.clear(),y.current=null,g.current=null,b.current={gap_items_prompt:"",risk_items_prompt:""},S.label=6;case 6:return[7];case 7:return[2]}})})}return{processStreamContent:function(e,n,a){try{var o=JSON.stringify(e);if(g.current===o)return;g.current=o;var u=[],m=[];e=e.map(function(e){var i=t.processAIReasoningFromBlocks(e.value,e.blockNumber,e.storyNumber),s=i.outputText,a=i.reasonings;u.push.apply(u,a),m.push(r.__spreadArray([],a,!0));var o="<STORY_NUMBER>".concat(e.storyNumber,"<BLOCK_NUMBER>").concat(e.blockNumber);return v.current.has(o)||(A(r.__assign(r.__assign({},e),{value:s}),a,n),v.current.add(o)),r.__assign(r.__assign({},e),{value:s})}),u.forEach(function(e){s(function(t){return t.find(function(r){return r.id===e.id})?t:r.__spreadArray(r.__spreadArray([],t,!0),[e],!1)})}),e.length>0&&e.map(function(e,t){var n=e.title,s=e.section,o=e.value,u=e.storyNumber,v=e.description,f=e.blockNumber;i(function(e){var i,g,b,A,N="STORY-".concat(u,"-").concat(f),R=e.findIndex(function(r){return r.storyNumber===u});"intro"===s?-1===R&&e.push({artifactId:"STORY-".concat(u,"-").concat(f),title:n,value:o,description:v,storyNumber:u,sub_features:[],section:s,blockNumber:f,aiReasoning:m[t]}):-1===(null===(g=null===(i=e[R])||void 0===i?void 0:i.sub_features)||void 0===g?void 0:g.findIndex(function(r){return r.artifactId===N}))&&(null===(A=null===(b=e[R])||void 0===b?void 0:b.sub_features)||void 0===A||A.push({artifactId:"STORY-".concat(u,"-").concat(f),title:n,value:o,storyNumber:u,blockNumber:f,section:s,aiReasoning:m[t]}));var S=JSON.stringify(e);return y.current!==S&&(p({key:"streaming-redis-key-".concat(a),value:{mmvf_list:e,knowledgeBase:c,projectAnalyserSummary:l,dataSources_files:_,ai_reasonings:d}}),y.current=S),r.__spreadArray([],e,!0)})})}catch(r){console.error("Error in processing Stream Content",r)}}}};
|
|
2
2
|
//# sourceMappingURL=useStreamContentHandler.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as
|
|
1
|
+
import{__spreadArray as t,__assign as e,__awaiter as r,__generator as n}from"tslib";import{useRef as i}from"react";import{processAIReasoningFromBlocks as o}from"../utils/proccess-stream.utils.js";function s(s){var a=s.setUserStory,c=s.setAiReasoning,u=s.setUserStoryCitations,l=s.onStreamingCompleted,d=s.isGraphQLCallInProgress,p=s.knowledgeBase,m=s.projectAnalyserSummary,_=s.dataSourceFiles,v=s.aiReasoning,f=s.setRedisValue,b=s.fetchCitationByBlock,g=i(new Set),y=i(new Set),N=i(null),h=i(null),S=i({gap_items_prompt:"",risk_items_prompt:""});function k(i,o,s){var a,p;return r(this,void 0,void 0,function(){var r,m,_,v,f,k,R;return n(this,function(n){switch(n.label){case 0:r="",m="",n.label=1;case 1:return n.trys.push([1,3,4,7]),[4,b(i,s,o)];case 2:return _=n.sent(),c(function(r){var n,i=t([],r,!0);return null===(n=_.response.ai_reasonings)||void 0===n||n.forEach(function(t){var r=i.findIndex(function(e){return e.id===t.id});-1!==r&&(i[r]=e({},t))}),i}),r=(null===(a=_.response)||void 0===a?void 0:a.gap_items_prompt)||"",m=(null===(p=_.response)||void 0===p?void 0:p.risk_items_prompt)||"",(r||m)&&(S.current={gap_items_prompt:r,risk_items_prompt:m}),u(function(r){var n,i,o,s,a,c,u,l,d,p,m,v,f,b;return e(e({},r),{appmod_citations:t(t([],null!==(n=r.appmod_citations)&&void 0!==n?n:[],!0),null!==(i=_.response.appmod_citations)&&void 0!==i?i:[],!0),audio_citations:t(t([],null!==(o=r.audio_citations)&&void 0!==o?o:[],!0),null!==(s=_.response.audio_citations)&&void 0!==s?s:[],!0),file_citations:t(t([],null!==(a=r.file_citations)&&void 0!==a?a:[],!0),null!==(c=_.response.file_citations)&&void 0!==c?c:[],!0),image_citations:t(t([],null!==(u=r.image_citations)&&void 0!==u?u:[],!0),null!==(l=_.response.image_citations)&&void 0!==l?l:[],!0),rca_citations:t(t([],null!==(d=r.rca_citations)&&void 0!==d?d:[],!0),null!==(p=_.response.rca_citations)&&void 0!==p?p:[],!0),web_citations:t(t([],null!==(m=r.web_citations)&&void 0!==m?m:[],!0),null!==(v=_.response.web_citations)&&void 0!==v?v:[],!0),readfile_citations:t(t([],null!==(f=r.readfile_citations)&&void 0!==f?f:[],!0),null!==(b=_.response.readfile_citations)&&void 0!==b?b:[],!0)})}),[3,7];case 3:return v=n.sent(),console.error("Error in fetching Citations",v),[3,7];case 4:return console.log("Citations fetching completed",i.storyNumber,i.blockNumber),f="<STORY_NUMBER>".concat(i.storyNumber,"<BLOCK_NUMBER>").concat(i.blockNumber),y.current.add(f),console.log("Citations fetching completed",y.current.size,g.current.size,d.current),y.current.size!==g.current.size||d.current?[3,6]:(k=r||S.current.gap_items_prompt,R=m||S.current.risk_items_prompt,[4,l(k,R)]);case 5:n.sent(),g.current.clear(),y.current.clear(),N.current=null,h.current=null,S.current={gap_items_prompt:"",risk_items_prompt:""},n.label=6;case 6:return[7];case 7:return[2]}})})}return{processStreamContent:function(r,n,i){try{var s=JSON.stringify(r);if(h.current===s)return;h.current=s;var u=[],l=[];r=r.map(function(r){var i=o(r.value,r.blockNumber,r.storyNumber),s=i.outputText,a=i.reasonings;u.push.apply(u,a),l.push(t([],a,!0));var c="<STORY_NUMBER>".concat(r.storyNumber,"<BLOCK_NUMBER>").concat(r.blockNumber);return g.current.has(c)||(k(e(e({},r),{value:s}),a,n),g.current.add(c)),e(e({},r),{value:s})}),u.forEach(function(e){c(function(r){return r.find(function(t){return t.id===e.id})?r:t(t([],r,!0),[e],!1)})}),r.length>0&&r.map(function(e,r){var n=e.title,o=e.section,s=e.value,c=e.storyNumber,u=e.description,d=e.blockNumber;a(function(e){var a,b,g,y,h="STORY-".concat(c,"-").concat(d),S=e.findIndex(function(t){return t.storyNumber===c});"intro"===o?-1===S&&e.push({artifactId:"STORY-".concat(c,"-").concat(d),title:n,value:s,description:u,storyNumber:c,sub_features:[],section:o,blockNumber:d,aiReasoning:l[r]}):-1===(null===(b=null===(a=e[S])||void 0===a?void 0:a.sub_features)||void 0===b?void 0:b.findIndex(function(t){return t.artifactId===h}))&&(null===(y=null===(g=e[S])||void 0===g?void 0:g.sub_features)||void 0===y||y.push({artifactId:"STORY-".concat(c,"-").concat(d),title:n,value:s,storyNumber:c,blockNumber:d,section:o,aiReasoning:l[r]}));var k=JSON.stringify(e);return N.current!==k&&(f({key:"streaming-redis-key-".concat(i),value:{mmvf_list:e,knowledgeBase:p,projectAnalyserSummary:m,dataSources_files:_,ai_reasonings:v}}),N.current=k),t([],e,!0)})})}catch(t){console.error("Error in processing Stream Content",t)}}}}export{s as useStreamContentHandler};
|
|
2
2
|
//# sourceMappingURL=useStreamContentHandler.js.map
|
|
@@ -17,7 +17,7 @@ interface IProps {
|
|
|
17
17
|
setAiReasoning: React.Dispatch<React.SetStateAction<TAIReasoning[]>>;
|
|
18
18
|
setUserStoryCitations: React.Dispatch<React.SetStateAction<UserStoryCitations>>;
|
|
19
19
|
onStreamingCompleted: (gap_items_prompt?: string, risk_items_prompt?: string) => Promise<void>;
|
|
20
|
-
isGraphQLCallInProgress: boolean
|
|
20
|
+
isGraphQLCallInProgress: React.MutableRefObject<boolean>;
|
|
21
21
|
knowledgeBase: any;
|
|
22
22
|
projectAnalyserSummary: any;
|
|
23
23
|
dataSourceFiles: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStreamContentHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/hooks/useStreamContentHandler.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"useStreamContentHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/hooks/useStreamContentHandler.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAErF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OA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