plugin-git-manager 1.3.3 → 1.4.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 (44) hide show
  1. package/dist/client/{156.c27c2392746e7866.js → 156.8e36af3e2cee173e.js} +1 -1
  2. package/dist/client/{317.17ed0018e3e7db00.js → 317.2d0d33871e24ee24.js} +1 -1
  3. package/dist/client/{434.b2eeaaef33aae6e0.js → 434.2401f7257495b66e.js} +1 -1
  4. package/dist/client/{453.fc3042c9740d8fab.js → 453.58657b9ba0904477.js} +1 -1
  5. package/dist/client/index.js +1 -1
  6. package/dist/client-v2/{434.19c7579c06b9077c.js → 434.32b0a07b821b9329.js} +1 -1
  7. package/dist/client-v2/{453.5e507c94c59277b1.js → 453.f9a0ec6d8e1bd1cc.js} +1 -1
  8. package/dist/client-v2/index.js +1 -1
  9. package/dist/externalVersion.js +10 -9
  10. package/dist/locale/en-US.json +27 -1
  11. package/dist/locale/vi-VN.json +27 -1
  12. package/dist/locale/zh-CN.json +30 -1
  13. package/dist/node_modules/simple-git/package.json +1 -1
  14. package/dist/node_modules/zod/package.json +1 -1
  15. package/dist/server/actions/chat-context.js +282 -0
  16. package/dist/server/actions/git-actions.js +99 -4
  17. package/dist/server/actions/gitlab-api.js +86 -7
  18. package/dist/server/chat-context-admission.js +187 -0
  19. package/dist/server/plugin.js +8 -0
  20. package/dist/server/request-method-policy.js +2 -0
  21. package/package.json +2 -2
  22. package/src/client/__tests__/GitContextPicker.test.tsx +120 -0
  23. package/src/client/__tests__/ai-context.test.tsx +119 -0
  24. package/src/client/ai-context.tsx +3 -113
  25. package/src/client/context/GitManagerContext.tsx +18 -2
  26. package/src/client/index.tsx +3 -5
  27. package/src/client-v2/ai-context.tsx +135 -72
  28. package/src/client-v2/components/GitContextPicker.tsx +418 -0
  29. package/src/client-v2/git-context-api.ts +59 -0
  30. package/src/client-v2/plugin.tsx +2 -4
  31. package/src/locale/en-US.json +27 -1
  32. package/src/locale/vi-VN.json +27 -1
  33. package/src/locale/zh-CN.json +30 -1
  34. package/src/server/__tests__/chat-context-admission.test.ts +276 -0
  35. package/src/server/__tests__/chat-context-options.test.ts +144 -0
  36. package/src/server/__tests__/git-chat-context.test.ts +138 -0
  37. package/src/server/__tests__/git-security.test.ts +52 -0
  38. package/src/server/__tests__/smoke.test.ts +200 -0
  39. package/src/server/actions/chat-context.ts +302 -0
  40. package/src/server/actions/git-actions.ts +119 -6
  41. package/src/server/actions/gitlab-api.ts +97 -4
  42. package/src/server/chat-context-admission.ts +182 -0
  43. package/src/server/plugin.ts +11 -0
  44. package/src/server/request-method-policy.ts +2 -0
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- "use strict";(self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).push([["453"],{100:function(e,t,r){r.d(t,{g:function(){return F},ReviewFlowsSettings:function(){return O}});var n=r(155),a=r.n(n),l=r(59),o=r(375),i=r(485),u=r(602);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var f=function(e){var t=e.value,r=e.onChange,o=e.allowClear,u=e.size,c=e.style,f=e.placeholder,d=(0,i.useApp)().apiClient,p=s((0,n.useState)([]),2),m=p[0],v=p[1],y=s((0,n.useState)(!1),2),h=y[0],b=y[1];return(0,n.useEffect)(function(){var e=!1;return b(!0),d.request({url:"aiEmployees:listByUser"}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){}).finally(function(){e||b(!1)}),function(){e=!0}},[d]),a().createElement(l.Select,{value:t,onChange:r,allowClear:void 0===o||o,loading:h,size:u,style:c,placeholder:f||"Select AI employee",options:m.map(function(e){return{value:e.username,label:"".concat(e.nickname||e.username," (@").concat(e.username,")")}}),showSearch:!0,optionFilterProp:"label"})};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=function(e){var t=e.value,r=e.onChange,o=e.allowClear,u=e.size,c=e.style,s=e.placeholder,f=(0,i.useApp)().apiClient,d=p((0,n.useState)([]),2),m=d[0],v=d[1],y=p((0,n.useState)(!1),2),h=y[0],b=y[1];return(0,n.useEffect)(function(){var e=!1;return b(!0),f.request({url:"ai:listAllEnabledModels"}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){}).finally(function(){e||b(!1)}),function(){e=!0}},[f]),a().createElement(l.Select,{value:t,onChange:r,allowClear:void 0===o||o,loading:h,size:u,style:c,placeholder:s||"Select LLM Service",options:m.map(function(e){return{value:e.llmService,label:e.llmServiceTitle||e.llmService}}),showSearch:!0,optionFilterProp:"label"})};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(e){var t=e.llmService,r=e.value,o=e.onChange,u=e.allowClear,c=e.size,s=e.style,f=e.placeholder,d=(0,i.useApp)().apiClient,p=y((0,n.useState)([]),2),m=p[0],v=p[1],h=y((0,n.useState)(!1),2),b=h[0],g=h[1];return(0,n.useEffect)(function(){var e=!1;return t?(g(!0),d.request({url:"ai:listModels",params:{llmService:t}}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){e||v([])}).finally(function(){e||g(!1)}),function(){e=!0}):void v([])},[d,t]),a().createElement(l.Select,{value:r,onChange:o,allowClear:void 0===u||u,loading:b,size:c,style:s,placeholder:f||"Select LLM Model",options:m.map(function(e){return{value:e.id,label:e.id}}),showSearch:!0,optionFilterProp:"label",disabled:!t})},b=r(171),g=r(578),w=r(279);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function E(e,t,r,n,a,l,o){try{var i=e[l](o),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,a)}function A(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){E(l,n,a,o,i,"next",e)}function i(e){E(l,n,a,o,i,"throw",e)}o(void 0)})}}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var C={manual:"Manual",onMergeRequestCreated:"On MR Created",both:"Both"},M={auto:"Auto",manual:"Manual",disabled:"Disabled"},F=function(){var e=(0,g.k)(),t=(0,i.useApp)(),r=t.apiClient,c=(0,u.B)().repos,s=(0,i.useACLContext)(),d=(0,i.useACLRoleContext)(),p=d.parseAction,v=d.snippets,y=d.allowAll,S=d.resources,E=(0,i.createAclSnippetAllow)(v,y),F=function(e){if(!s)return!0;var t=!!p("gitManager:triggerReview");if((null==S?void 0:S.includes("gitManager"))&&!t)return!1;var r=!!p("gitReviewFlows:".concat(e));return(null==S?void 0:S.includes("gitReviewFlows"))?r:r||t||E("pm.plugin-git-manager.write")||E("pm.plugin-git-manager.manage")},x=F("create"),O=F("update"),R=F("destroy"),P=I((0,n.useState)([]),2),j=P[0],L=P[1],T=I((0,n.useState)(!1),2),B=T[0],q=T[1],_=I((0,n.useState)(null),2),z=_[0],N=_[1],U=I((0,n.useState)(!1),2),V=U[0],D=U[1],X=I((0,n.useState)(),2),$=X[0],J=X[1],W=I(l.Form.useForm(),1)[0],G=(0,n.useCallback)(function(){return A(function(){var e;return k(this,function(t){switch(t.label){case 0:q(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,r.request({url:"gitReviewFlows:list",params:{pageSize:100}})];case 2:return L((null==(e=t.sent().data)?void 0:e.data)||[]),[3,4];case 3:return q(!1),[7];case 4:return[2]}})})()},[r]);(0,n.useEffect)(function(){G()},[G]);var K=function(e){N(e),J(void 0),W.setFieldsValue(e),D(!0)},H=[{title:e("Name"),dataIndex:"name",render:function(t,r){return a().createElement(l.Space,null,a().createElement("span",{style:{fontWeight:500}},t),!r.enabled&&a().createElement(l.Tag,{color:"default"},e("Disabled")))}},{title:e("Repository"),dataIndex:"repositoryId",render:function(t){if(null==t)return a().createElement(l.Tag,{color:"purple"},e("Global"));var r=c.find(function(e){return e.id===t});return r?a().createElement(l.Space,{size:4},a().createElement(o.BranchesOutlined,null),r.name):"#".concat(t)}},{title:e("AI Employee"),dataIndex:"aiEmployeeUsername",render:function(e){return e?a().createElement(l.Tag,{color:"blue"},"@",e):a().createElement("span",{style:{color:"#999"}},"—")}},{title:e("Trigger"),dataIndex:"triggerMode",render:function(t){return a().createElement(l.Tag,null,e(C[t]||t))}},{title:e("Post"),dataIndex:"postMode",render:function(t){return a().createElement(l.Tag,{color:"auto"===t?"green":"manual"===t?"orange":"default"},e(M[t]||t))}},{title:"",key:"actions",width:100,render:function(t,n){return a().createElement(l.Space,null,O&&a().createElement(l.Tooltip,{title:e("Edit")},a().createElement(l.Button,{size:"small",icon:a().createElement(o.EditOutlined,null),onClick:function(){return K(n)}})),R&&a().createElement(l.Popconfirm,{title:e("Delete this flow?"),onConfirm:function(){var t;return t=n.id,A(function(){var n;return k(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,r.request({url:"gitReviewFlows:destroy",method:"post",params:{filterByTk:t}})];case 1:return a.sent(),l.message.success(e("Flow deleted")),G(),[3,3];case 2:return n=a.sent(),l.message.error((null==n?void 0:n.message)||e("Failed to delete")),[3,3];case 3:return[2]}})})()}},a().createElement(l.Button,{size:"small",danger:!0,icon:a().createElement(o.DeleteOutlined,null)})))}}];return a().createElement("div",null,a().createElement("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between"}},x&&a().createElement(l.Button,{type:"primary",icon:a().createElement(o.PlusOutlined,null),onClick:function(){var e;N(null),W.resetFields(),J("application"),W.setFieldsValue({enabled:!0,triggerMode:"manual",postMode:"manual",instructions:null==(e=b.K.find(function(e){return"application"===e.key}))?void 0:e.text}),D(!0)}},e("Add Review Flow")),a().createElement(l.Button,{onClick:G,loading:B},e("Refresh"))),a().createElement(l.Table,{size:"small",rowKey:"id",loading:B,dataSource:j,columns:H,locale:{emptyText:a().createElement(l.Empty,{description:e("No review flows yet")})},pagination:{pageSize:20}}),a().createElement(l.Modal,{title:(null==z?void 0:z.id)?e("Edit Review Flow"):e("Add Review Flow"),open:V,onCancel:function(){D(!1),N(null),J(void 0),W.resetFields()},onOk:function(){return A(function(){var t,n,a,o,i,u;return k(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,W.validateFields()];case 1:if((void 0===(t=c.sent()).repositoryId||""===t.repositoryId)&&(t.repositoryId=null),!(null==z?void 0:z.id))return[3,3];return[4,r.request({url:"gitReviewFlows:update",method:"post",params:{filterByTk:z.id},data:t})];case 2:return c.sent(),l.message.success(e("Flow updated")),[3,5];case 3:return[4,r.request({url:"gitReviewFlows:create",method:"post",data:t})];case 4:c.sent(),l.message.success(e("Flow created")),c.label=5;case 5:return D(!1),N(null),J(void 0),W.resetFields(),G(),[3,7];case 6:if(null==(n=c.sent())?void 0:n.errorFields)return[2];return l.message.error((null==n||null==(u=n.response)||null==(i=u.data)||null==(o=i.errors)||null==(a=o[0])?void 0:a.message)||(null==n?void 0:n.message)||e("Failed to save")),[3,7];case 7:return[2]}})})()},width:640,destroyOnClose:!0},a().createElement(l.Form,{form:W,layout:"vertical"},(null==z?void 0:z.workflowId)&&a().createElement(l.Alert,{type:"info",showIcon:!0,message:e("Edit the AI employee, model and prompt in the bound workflow"),action:a().createElement(l.Button,{href:(0,w.X)(t,"workflow",z.workflowId),target:"_blank",rel:"noreferrer"},e("Open workflow")),style:{marginBottom:16}}),a().createElement(l.Form.Item,{name:"name",label:e("Name"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:e("e.g. Default review flow")})),a().createElement(l.Form.Item,{name:"repositoryId",label:e("Repository"),extra:e("Leave empty to apply to all repositories")},a().createElement(l.Select,{allowClear:!0,placeholder:e("All repositories (global)"),options:c.map(function(e){return{value:e.id,label:e.name}})})),a().createElement(l.Form.Item,{name:"aiEmployeeUsername",label:e("AI Employee"),rules:[{required:!0}],hidden:!!(null==z?void 0:z.workflowId)},a().createElement(f,{placeholder:e("Select an AI employee")})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Space.Compact,{style:{width:"100%"}},a().createElement(l.Form.Item,{name:"llmService",label:e("LLM Service (optional)"),style:{flex:1,marginRight:8}},a().createElement(m,{placeholder:e("Override flow LLM service")})),a().createElement(l.Form.Item,{noStyle:!0,shouldUpdate:function(e,t){return e.llmService!==t.llmService}},function(t){var r=(0,t.getFieldValue)("llmService");return a().createElement(l.Form.Item,{name:"model",label:e("Model (optional)"),style:{flex:1}},r?a().createElement(h,{llmService:r,placeholder:e("Override LLM model")}):a().createElement(l.Input,{placeholder:e("Select an LLM service first"),disabled:!0}))})),a().createElement(l.Form.Item,{name:"triggerMode",label:e("Trigger Mode"),rules:[{required:!0}],extra:e("Auto modes require enabling Auto Review on the repository")},a().createElement(l.Select,{options:[{value:"manual",label:e("Manual")},{value:"onMergeRequestCreated",label:e("On Merge Request Created")},{value:"both",label:e("Both")}]})),a().createElement(l.Form.Item,{name:"reviewOnNewCommits",label:e("Review new commits automatically"),valuePropName:"checked",extra:e("Only applies to automatic merge request reviews")},a().createElement(l.Switch,null)),a().createElement(l.Form.Item,{name:"postMode",label:e("Post Mode"),rules:[{required:!0}],extra:(null==z?void 0:z.workflowId)?e("Reconfigure the workflow after changing post mode"):void 0},a().createElement(l.Select,{options:[{value:"auto",label:e("Auto post to MR")},{value:"manual",label:e("Manual approval before posting")},{value:"disabled",label:e("Do not post")}]})),a().createElement(l.Form.Item,{name:"branchFilter",label:e("Branch Filter (regex, optional)")},a().createElement(l.Input,{placeholder:"^(feature|hotfix)/.*$"})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Form.Item,{label:e("Prompt template"),extra:e("Selecting a template replaces the instructions text")},a().createElement(l.Select,{allowClear:!0,value:$,placeholder:e("Load a default prompt by code type"),options:b.K.map(function(t){return{value:t.key,label:e(t.label)}}),onChange:function(e){J(e);var t=b.K.find(function(t){return t.key===e});t&&W.setFieldsValue({instructions:t.text})}})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Form.Item,{name:"instructions",label:e("Additional Instructions (optional)")},a().createElement(l.Input.TextArea,{rows:8,placeholder:e("Extra guidance appended to every review prompt")})),a().createElement(l.Form.Item,{name:"enabled",label:e("Enabled"),valuePropName:"checked"},a().createElement(l.Switch,null)))))};function x(){var e=(0,u.B)().refreshRepos;return(0,n.useEffect)(function(){e()},[e]),a().createElement(F,null)}function O(){return a().createElement(u.N,null,a().createElement(x,null))}},602:function(e,t,r){r.d(t,{B:function(){return d},N:function(){return p}});var n=r(155),a=r.n(n),l=r(485);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,a,l,o){try{var i=e[l](o),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,a)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){i(l,n,a,o,u,"next",e)}function u(e){i(l,n,a,o,u,"throw",e)}o(void 0)})}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var f=(0,n.createContext)(null);function d(){var e=(0,n.useContext)(f);if(!e)throw Error("useGitManager must be used within GitManagerProvider");return e}var p=function(e){var t=e.children,r=(0,l.useApp)().apiClient,o=c((0,n.useState)([]),2),i=o[0],d=o[1],p=c((0,n.useState)(null),2),m=p[0],v=p[1],y=c((0,n.useState)(!1),2),h=y[0],b=y[1],g=c((0,n.useState)([]),2),w=g[0],S=g[1],E=c((0,n.useState)(""),2),A=E[0],I=E[1],k=(0,n.useRef)(m);k.current=m;var C=(0,n.useCallback)(function(){return u(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:if(!(e=k.current)||"connected"!==e.status)return S([]),I(""),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r.request({url:"gitManager:branches",params:{repositoryId:e.id}})];case 2:return(a=(null==(n=l.sent().data)||null==(t=n.data)?void 0:t.data)||(null==n?void 0:n.data))&&(S(a.all||[]),I(a.current||"")),[3,4];case 3:return l.sent(),S([]),I(""),[3,4];case 4:return[2]}})})()},[r]),M=(0,n.useCallback)(function(){return u(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:b(!0),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,r.request({url:"gitRepositories:list",params:{pageSize:100}})];case 2:return d(t=(null==(e=l.sent().data)?void 0:e.data)||[]),(n=k.current)&&(a=t.find(function(e){return e.id===n.id}))&&v(a),[3,4];case 3:return b(!1),[7];case 4:return[2]}})})()},[r]);return a().createElement(f.Provider,{value:{repos:i,selectedRepo:m,loading:h,branches:w,currentBranch:A,setSelectedRepo:v,refreshRepos:M,refreshBranches:C}},t)}},578:function(e,t,r){r.d(t,{k:function(){return a}});var n=r(485);function a(){var e=(0,n.useApp)();return function(t,r){return e.i18n.t(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["plugin-git-manager","client"]},r))}}},171:function(e,t,r){r.d(t,{K:function(){return n}});var n=[{key:"application",label:"Application code (C#, .NET, Java, JS/TS…)",text:"Please review the code changes with a focus on:\n1. Best Practices & Style:\n - C#/VB.NET: Follow standard naming conventions (PascalCase for methods/properties, camelCase for fields). Ensure proper use of async/await (avoid .Result/.Wait()). Use LINQ efficiently.\n - Java: Follow standard naming conventions. Check null-safety (Optional, null checks). Prefer try-with-resources for closeable resources and use streams/collections idiomatically.\n - JS/TS: Use strict equality (===), prefer const/let. Ensure TypeScript types are explicit and avoid 'any'.\n2. Performance: Watch out for N+1 queries, unnecessary loops, and memory leaks.\n3. Security: Identify potential SQL injections, XSS vulnerabilities, and improper data validation.\n4. Maintainability: Check for readability, SOLID principles, and DRY. Ensure meaningful naming.\n5. Error Handling: Verify that exceptions are properly caught, handled, and logged."},{key:"workflow-config",label:"Workflow / Config (XML, XAML, YAML, JSON…)",text:"Please review the workflow/configuration files (XML, XAML, YAML, JSON, ...) with a focus on:\n1. Structure & Validity: Well-formed syntax, correct schema/namespace usage, no duplicate or conflicting keys, consistent indentation and encoding.\n2. Workflow Logic: Unreachable or dead steps, missing error handling / retry / timeout settings, incorrect transitions or dependencies between steps, infinite loops.\n3. Security: Hardcoded credentials, secrets, tokens or connection strings; insecure endpoints (http instead of https); overly broad permissions.\n4. Environment & Portability: Hardcoded environment-specific values (paths, hosts, ports) that should be parameterized; missing default values.\n5. Maintainability: Meaningful naming for steps/variables, duplicated blocks that should be shared, obsolete or unused entries."}]},279:function(e,t,r){r.d(t,{P:function(){return i},X:function(){return o}});var n=r(485);function a(e,t){return"".concat(e.replace(/\/+$/,""),"/").concat(t.replace(/^\/+/,""))}function l(e){var t="u"<typeof window?void 0:window.__nocobase_public_path__;return(0,n.stripModernClientPrefix)(t||e.getPublicPath())}function o(e,t,r){var o="modern"===(0,n.getRouteRuntimeVersion)(),i=o?"/admin/workflow/".concat("workflow"===t?"workflows":"executions","/").concat(encodeURIComponent(String(r))):"/admin/settings/workflow/".concat("workflow"===t?"workflows":"executions","/").concat(encodeURIComponent(String(r)));return a(o?(0,n.getV2EffectiveBasePath)(e):l(e),i)}function i(e){return a("modern"===(0,n.getRouteRuntimeVersion)()?(0,n.getV2EffectiveBasePath)(e):l(e),"/admin/workflow/tasks/git-review-approval/pending")}}}]);
10
+ "use strict";(self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).push([["453"],{100:function(e,t,r){r.d(t,{g:function(){return F},ReviewFlowsSettings:function(){return O}});var n=r(155),a=r.n(n),l=r(59),o=r(375),i=r(485),u=r(602);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var f=function(e){var t=e.value,r=e.onChange,o=e.allowClear,u=e.size,c=e.style,f=e.placeholder,d=(0,i.useApp)().apiClient,p=s((0,n.useState)([]),2),m=p[0],v=p[1],y=s((0,n.useState)(!1),2),h=y[0],b=y[1];return(0,n.useEffect)(function(){var e=!1;return b(!0),d.request({url:"aiEmployees:listByUser"}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){}).finally(function(){e||b(!1)}),function(){e=!0}},[d]),a().createElement(l.Select,{value:t,onChange:r,allowClear:void 0===o||o,loading:h,size:u,style:c,placeholder:f||"Select AI employee",options:m.map(function(e){return{value:e.username,label:"".concat(e.nickname||e.username," (@").concat(e.username,")")}}),showSearch:!0,optionFilterProp:"label"})};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=function(e){var t=e.value,r=e.onChange,o=e.allowClear,u=e.size,c=e.style,s=e.placeholder,f=(0,i.useApp)().apiClient,d=p((0,n.useState)([]),2),m=d[0],v=d[1],y=p((0,n.useState)(!1),2),h=y[0],b=y[1];return(0,n.useEffect)(function(){var e=!1;return b(!0),f.request({url:"ai:listAllEnabledModels"}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){}).finally(function(){e||b(!1)}),function(){e=!0}},[f]),a().createElement(l.Select,{value:t,onChange:r,allowClear:void 0===o||o,loading:h,size:u,style:c,placeholder:s||"Select LLM Service",options:m.map(function(e){return{value:e.llmService,label:e.llmServiceTitle||e.llmService}}),showSearch:!0,optionFilterProp:"label"})};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(e){var t=e.llmService,r=e.value,o=e.onChange,u=e.allowClear,c=e.size,s=e.style,f=e.placeholder,d=(0,i.useApp)().apiClient,p=y((0,n.useState)([]),2),m=p[0],v=p[1],h=y((0,n.useState)(!1),2),b=h[0],g=h[1];return(0,n.useEffect)(function(){var e=!1;return t?(g(!0),d.request({url:"ai:listModels",params:{llmService:t}}).then(function(t){if(!e){var r,n=(null==t||null==(r=t.data)?void 0:r.data)||[];v(Array.isArray(n)?n:[])}}).catch(function(){e||v([])}).finally(function(){e||g(!1)}),function(){e=!0}):void v([])},[d,t]),a().createElement(l.Select,{value:r,onChange:o,allowClear:void 0===u||u,loading:b,size:c,style:s,placeholder:f||"Select LLM Model",options:m.map(function(e){return{value:e.id,label:e.id}}),showSearch:!0,optionFilterProp:"label",disabled:!t})},b=r(171),g=r(578),w=r(279);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function E(e,t,r,n,a,l,o){try{var i=e[l](o),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,a)}function A(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){E(l,n,a,o,i,"next",e)}function i(e){E(l,n,a,o,i,"throw",e)}o(void 0)})}}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var C={manual:"Manual",onMergeRequestCreated:"On MR Created",both:"Both"},M={auto:"Auto",manual:"Manual",disabled:"Disabled"},F=function(){var e=(0,g.k)(),t=(0,i.useApp)(),r=t.apiClient,c=(0,u.B)().repos,s=(0,i.useACLContext)(),d=(0,i.useACLRoleContext)(),p=d.parseAction,v=d.snippets,y=d.allowAll,S=d.resources,E=(0,i.createAclSnippetAllow)(v,y),F=function(e){if(!s)return!0;var t=!!p("gitManager:triggerReview");if((null==S?void 0:S.includes("gitManager"))&&!t)return!1;var r=!!p("gitReviewFlows:".concat(e));return(null==S?void 0:S.includes("gitReviewFlows"))?r:r||t||E("pm.plugin-git-manager.write")||E("pm.plugin-git-manager.manage")},x=F("create"),O=F("update"),R=F("destroy"),P=I((0,n.useState)([]),2),j=P[0],L=P[1],T=I((0,n.useState)(!1),2),B=T[0],q=T[1],_=I((0,n.useState)(null),2),z=_[0],N=_[1],U=I((0,n.useState)(!1),2),V=U[0],D=U[1],X=I((0,n.useState)(),2),$=X[0],J=X[1],W=I(l.Form.useForm(),1)[0],G=(0,n.useCallback)(function(){return A(function(){var e;return k(this,function(t){switch(t.label){case 0:q(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,r.request({url:"gitReviewFlows:list",params:{pageSize:100}})];case 2:return L((null==(e=t.sent().data)?void 0:e.data)||[]),[3,4];case 3:return q(!1),[7];case 4:return[2]}})})()},[r]);(0,n.useEffect)(function(){G()},[G]);var K=function(e){N(e),J(void 0),W.setFieldsValue(e),D(!0)},Y=[{title:e("Name"),dataIndex:"name",render:function(t,r){return a().createElement(l.Space,null,a().createElement("span",{style:{fontWeight:500}},t),!r.enabled&&a().createElement(l.Tag,{color:"default"},e("Disabled")))}},{title:e("Repository"),dataIndex:"repositoryId",render:function(t){if(null==t)return a().createElement(l.Tag,{color:"purple"},e("Global"));var r=c.find(function(e){return e.id===t});return r?a().createElement(l.Space,{size:4},a().createElement(o.BranchesOutlined,null),r.name):"#".concat(t)}},{title:e("AI Employee"),dataIndex:"aiEmployeeUsername",render:function(e){return e?a().createElement(l.Tag,{color:"blue"},"@",e):a().createElement("span",{style:{color:"#999"}},"—")}},{title:e("Trigger"),dataIndex:"triggerMode",render:function(t){return a().createElement(l.Tag,null,e(C[t]||t))}},{title:e("Post"),dataIndex:"postMode",render:function(t){return a().createElement(l.Tag,{color:"auto"===t?"green":"manual"===t?"orange":"default"},e(M[t]||t))}},{title:"",key:"actions",width:100,render:function(t,n){return a().createElement(l.Space,null,O&&a().createElement(l.Tooltip,{title:e("Edit")},a().createElement(l.Button,{size:"small",icon:a().createElement(o.EditOutlined,null),onClick:function(){return K(n)}})),R&&a().createElement(l.Popconfirm,{title:e("Delete this flow?"),onConfirm:function(){var t;return t=n.id,A(function(){var n;return k(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,r.request({url:"gitReviewFlows:destroy",method:"post",params:{filterByTk:t}})];case 1:return a.sent(),l.message.success(e("Flow deleted")),G(),[3,3];case 2:return n=a.sent(),l.message.error((null==n?void 0:n.message)||e("Failed to delete")),[3,3];case 3:return[2]}})})()}},a().createElement(l.Button,{size:"small",danger:!0,icon:a().createElement(o.DeleteOutlined,null)})))}}];return a().createElement("div",null,a().createElement("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between"}},x&&a().createElement(l.Button,{type:"primary",icon:a().createElement(o.PlusOutlined,null),onClick:function(){var e;N(null),W.resetFields(),J("application"),W.setFieldsValue({enabled:!0,triggerMode:"manual",postMode:"manual",instructions:null==(e=b.K.find(function(e){return"application"===e.key}))?void 0:e.text}),D(!0)}},e("Add Review Flow")),a().createElement(l.Button,{onClick:G,loading:B},e("Refresh"))),a().createElement(l.Table,{size:"small",rowKey:"id",loading:B,dataSource:j,columns:Y,locale:{emptyText:a().createElement(l.Empty,{description:e("No review flows yet")})},pagination:{pageSize:20}}),a().createElement(l.Modal,{title:(null==z?void 0:z.id)?e("Edit Review Flow"):e("Add Review Flow"),open:V,onCancel:function(){D(!1),N(null),J(void 0),W.resetFields()},onOk:function(){return A(function(){var t,n,a,o,i,u;return k(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,W.validateFields()];case 1:if((void 0===(t=c.sent()).repositoryId||""===t.repositoryId)&&(t.repositoryId=null),!(null==z?void 0:z.id))return[3,3];return[4,r.request({url:"gitReviewFlows:update",method:"post",params:{filterByTk:z.id},data:t})];case 2:return c.sent(),l.message.success(e("Flow updated")),[3,5];case 3:return[4,r.request({url:"gitReviewFlows:create",method:"post",data:t})];case 4:c.sent(),l.message.success(e("Flow created")),c.label=5;case 5:return D(!1),N(null),J(void 0),W.resetFields(),G(),[3,7];case 6:if(null==(n=c.sent())?void 0:n.errorFields)return[2];return l.message.error((null==n||null==(u=n.response)||null==(i=u.data)||null==(o=i.errors)||null==(a=o[0])?void 0:a.message)||(null==n?void 0:n.message)||e("Failed to save")),[3,7];case 7:return[2]}})})()},width:640,destroyOnClose:!0},a().createElement(l.Form,{form:W,layout:"vertical"},(null==z?void 0:z.workflowId)&&a().createElement(l.Alert,{type:"info",showIcon:!0,message:e("Edit the AI employee, model and prompt in the bound workflow"),action:a().createElement(l.Button,{href:(0,w.X)(t,"workflow",z.workflowId),target:"_blank",rel:"noreferrer"},e("Open workflow")),style:{marginBottom:16}}),a().createElement(l.Form.Item,{name:"name",label:e("Name"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:e("e.g. Default review flow")})),a().createElement(l.Form.Item,{name:"repositoryId",label:e("Repository"),extra:e("Leave empty to apply to all repositories")},a().createElement(l.Select,{allowClear:!0,placeholder:e("All repositories (global)"),options:c.map(function(e){return{value:e.id,label:e.name}})})),a().createElement(l.Form.Item,{name:"aiEmployeeUsername",label:e("AI Employee"),rules:[{required:!0}],hidden:!!(null==z?void 0:z.workflowId)},a().createElement(f,{placeholder:e("Select an AI employee")})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Space.Compact,{style:{width:"100%"}},a().createElement(l.Form.Item,{name:"llmService",label:e("LLM Service (optional)"),style:{flex:1,marginRight:8}},a().createElement(m,{placeholder:e("Override flow LLM service")})),a().createElement(l.Form.Item,{noStyle:!0,shouldUpdate:function(e,t){return e.llmService!==t.llmService}},function(t){var r=(0,t.getFieldValue)("llmService");return a().createElement(l.Form.Item,{name:"model",label:e("Model (optional)"),style:{flex:1}},r?a().createElement(h,{llmService:r,placeholder:e("Override LLM model")}):a().createElement(l.Input,{placeholder:e("Select an LLM service first"),disabled:!0}))})),a().createElement(l.Form.Item,{name:"triggerMode",label:e("Trigger Mode"),rules:[{required:!0}],extra:e("Auto modes require enabling Auto Review on the repository")},a().createElement(l.Select,{options:[{value:"manual",label:e("Manual")},{value:"onMergeRequestCreated",label:e("On Merge Request Created")},{value:"both",label:e("Both")}]})),a().createElement(l.Form.Item,{name:"reviewOnNewCommits",label:e("Review new commits automatically"),valuePropName:"checked",extra:e("Only applies to automatic merge request reviews")},a().createElement(l.Switch,null)),a().createElement(l.Form.Item,{name:"postMode",label:e("Post Mode"),rules:[{required:!0}],extra:(null==z?void 0:z.workflowId)?e("Reconfigure the workflow after changing post mode"):void 0},a().createElement(l.Select,{options:[{value:"auto",label:e("Auto post to MR")},{value:"manual",label:e("Manual approval before posting")},{value:"disabled",label:e("Do not post")}]})),a().createElement(l.Form.Item,{name:"branchFilter",label:e("Branch Filter (regex, optional)")},a().createElement(l.Input,{placeholder:"^(feature|hotfix)/.*$"})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Form.Item,{label:e("Prompt template"),extra:e("Selecting a template replaces the instructions text")},a().createElement(l.Select,{allowClear:!0,value:$,placeholder:e("Load a default prompt by code type"),options:b.K.map(function(t){return{value:t.key,label:e(t.label)}}),onChange:function(e){J(e);var t=b.K.find(function(t){return t.key===e});t&&W.setFieldsValue({instructions:t.text})}})),!(null==z?void 0:z.workflowId)&&a().createElement(l.Form.Item,{name:"instructions",label:e("Additional Instructions (optional)")},a().createElement(l.Input.TextArea,{rows:8,placeholder:e("Extra guidance appended to every review prompt")})),a().createElement(l.Form.Item,{name:"enabled",label:e("Enabled"),valuePropName:"checked"},a().createElement(l.Switch,null)))))};function x(){var e=(0,u.B)().refreshRepos;return(0,n.useEffect)(function(){e()},[e]),a().createElement(F,null)}function O(){return a().createElement(u.N,null,a().createElement(x,null))}},602:function(e,t,r){r.d(t,{B:function(){return p},N:function(){return m}});var n=r(155),a=r.n(n),l=r(485),o=r(122);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t,r,n,a,l,o){try{var i=e[l](o),u=i.value}catch(e){r(e);return}i.done?t(u):Promise.resolve(u).then(n,a)}function c(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){u(l,n,a,o,i,"next",e)}function i(e){u(l,n,a,o,i,"throw",e)}o(void 0)})}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){i=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var d=(0,n.createContext)(null);function p(){var e=(0,n.useContext)(d);if(!e)throw Error("useGitManager must be used within GitManagerProvider");return e}var m=function(e){var t=e.children,r=(0,l.useApp)(),i=r.apiClient,u=s((0,n.useState)([]),2),p=u[0],m=u[1],v=s((0,n.useState)(null),2),y=v[0],h=v[1],b=s((0,n.useState)(!1),2),g=b[0],w=b[1],S=s((0,n.useState)([]),2),E=S[0],A=S[1],I=s((0,n.useState)(""),2),k=I[0],C=I[1],M=(0,n.useRef)(y);M.current=y,(0,n.useEffect)(function(){return(0,o.SY)(r,null==y?void 0:y.id),function(){return(0,o.SY)(r)}},[r,null==y?void 0:y.id]);var F=(0,n.useCallback)(function(){return c(function(){var e,t,r,n;return f(this,function(a){switch(a.label){case 0:if(!(e=M.current)||"connected"!==e.status)return A([]),C(""),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.request({url:"gitManager:branches",params:{repositoryId:e.id}})];case 2:return(n=(null==(r=a.sent().data)||null==(t=r.data)?void 0:t.data)||(null==r?void 0:r.data))&&(A(n.all||[]),C(n.current||"")),[3,4];case 3:return a.sent(),A([]),C(""),[3,4];case 4:return[2]}})})()},[i]),x=(0,n.useCallback)(function(){return c(function(){var e,t,r,n;return f(this,function(a){switch(a.label){case 0:w(!0),a.label=1;case 1:return a.trys.push([1,,3,4]),[4,i.request({url:"gitRepositories:list",params:{pageSize:100}})];case 2:return m(t=(null==(e=a.sent().data)?void 0:e.data)||[]),(r=M.current)&&(n=t.find(function(e){return e.id===r.id}))&&h(n),[3,4];case 3:return w(!1),[7];case 4:return[2]}})})()},[i]);return a().createElement(d.Provider,{value:{repos:p,selectedRepo:y,loading:g,branches:E,currentBranch:k,setSelectedRepo:h,refreshRepos:x,refreshBranches:F}},t)}},578:function(e,t,r){r.d(t,{k:function(){return a}});var n=r(485);function a(){var e=(0,n.useApp)();return function(t,r){return e.i18n.t(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["plugin-git-manager","client"]},r))}}},171:function(e,t,r){r.d(t,{K:function(){return n}});var n=[{key:"application",label:"Application code (C#, .NET, Java, JS/TS…)",text:"Please review the code changes with a focus on:\n1. Best Practices & Style:\n - C#/VB.NET: Follow standard naming conventions (PascalCase for methods/properties, camelCase for fields). Ensure proper use of async/await (avoid .Result/.Wait()). Use LINQ efficiently.\n - Java: Follow standard naming conventions. Check null-safety (Optional, null checks). Prefer try-with-resources for closeable resources and use streams/collections idiomatically.\n - JS/TS: Use strict equality (===), prefer const/let. Ensure TypeScript types are explicit and avoid 'any'.\n2. Performance: Watch out for N+1 queries, unnecessary loops, and memory leaks.\n3. Security: Identify potential SQL injections, XSS vulnerabilities, and improper data validation.\n4. Maintainability: Check for readability, SOLID principles, and DRY. Ensure meaningful naming.\n5. Error Handling: Verify that exceptions are properly caught, handled, and logged."},{key:"workflow-config",label:"Workflow / Config (XML, XAML, YAML, JSON…)",text:"Please review the workflow/configuration files (XML, XAML, YAML, JSON, ...) with a focus on:\n1. Structure & Validity: Well-formed syntax, correct schema/namespace usage, no duplicate or conflicting keys, consistent indentation and encoding.\n2. Workflow Logic: Unreachable or dead steps, missing error handling / retry / timeout settings, incorrect transitions or dependencies between steps, infinite loops.\n3. Security: Hardcoded credentials, secrets, tokens or connection strings; insecure endpoints (http instead of https); overly broad permissions.\n4. Environment & Portability: Hardcoded environment-specific values (paths, hosts, ports) that should be parameterized; missing default values.\n5. Maintainability: Meaningful naming for steps/variables, duplicated blocks that should be shared, obsolete or unused entries."}]},279:function(e,t,r){r.d(t,{P:function(){return i},X:function(){return o}});var n=r(485);function a(e,t){return"".concat(e.replace(/\/+$/,""),"/").concat(t.replace(/^\/+/,""))}function l(e){var t="u"<typeof window?void 0:window.__nocobase_public_path__;return(0,n.stripModernClientPrefix)(t||e.getPublicPath())}function o(e,t,r){var o="modern"===(0,n.getRouteRuntimeVersion)(),i=o?"/admin/workflow/".concat("workflow"===t?"workflows":"executions","/").concat(encodeURIComponent(String(r))):"/admin/settings/workflow/".concat("workflow"===t?"workflows":"executions","/").concat(encodeURIComponent(String(r)));return a(o?(0,n.getV2EffectiveBasePath)(e):l(e),i)}function i(e){return a("modern"===(0,n.getRouteRuntimeVersion)()?(0,n.getV2EffectiveBasePath)(e):l(e),"/admin/workflow/tasks/git-review-approval/pending")}}}]);
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["react-i18next","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["plugin-git-manager/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,i,o){return function(){"use strict";var a,u,c,l={375:function(e){e.exports=i},485:function(e){e.exports=t},694:function(e){e.exports=o},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},s={};function p(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return l[e].call(n.exports,n,n.exports,p),n.exports}p.m=l,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({156:"445366026c1cc9a8",313:"3c867179c3a1e817",317:"d2466574d00f94d0",356:"3d40a34bad08f8ff",434:"19c7579c06b9077c",453:"5e507c94c59277b1",928:"bba701b5a1ece58e"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},p.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var i,o,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){i=c;break}}i||(o=!0,(i=document.createElement("script")).timeout=120,p.nc&&i.setAttribute("nonce",p.nc),i.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),i.src=e),f[e]=[t];var l=function(t,n){i.onerror=i.onload=null,clearTimeout(s);var r=f[e];if(delete f[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),o&&document.head.appendChild(i)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(g=p.g.location+"");var f,g,d=p.g.document;if(!g&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(g=d.currentScript.src),!g)){var m=d.getElementsByTagName("script");if(m.length)for(var b=m.length-1;b>-1&&(!g||!/^http(s?):/.test(g));)g=m[b--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");p.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a={889:0},p.f.j=function(e,t){var n=p.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var i=p.p+p.u(e),o=Error();p.l(i,function(t){if(p.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",o.name="ChunkLoadError",o.type=r,o.request=i,n[1](o)}},"chunk-"+e,e)}},u=function(e,t){var n,r,i=t[0],o=t[1],u=t[2],c=0;if(i.some(function(e){return 0!==a[e]})){for(n in o)p.o(o,n)&&(p.m[n]=o[n]);u&&u(p)}for(e&&e(t);c<i.length;c++)r=i[c],p.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(c=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));var y={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-git-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client-v2/")}if(!e){var i=window.__nocobase_modern_client_prefix__||"v",o="/"+(i=String(i).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(o);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+i+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client-v2/"}p.p=e}(),!function(){p.r(y),p.d(y,{default:function(){return k}});var e=p(485),t=p(155),n=p.n(t),r=p(375),i=p(59),o=p(953);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,i,o,a){try{var u=e[o](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,c,"next",e)}function c(e){u(o,r,i,a,c,"throw",e)}a(void 0)})}}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function f(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function g(e){var t=e.kind,a=e.title,u=(0,o.useTranslation)("plugin-git-manager").t,c={repository:n().createElement(r.BranchesOutlined,null),"merge-request":n().createElement(r.MergeOutlined,null),commit:n().createElement(r.NodeIndexOutlined,null)};return n().createElement(i.Space,{size:4},c[t],n().createElement("span",null,a||u({repository:"Git Repository","merge-request":"Git Merge Request",commit:"Git Commit"}[t])))}function d(e){var t,n=null==e||null==(t=e.data)?void 0:t.data;return n&&(void 0===n?"undefined":n&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)=="object"?n:null}function m(e){return{menu:{Component:function(){return n().createElement(g,{kind:e})}},tag:{Component:function(t){var r=t.item;return n().createElement(g,{kind:e,title:r.title||r.uid})}}}}var b=s(l({name:"git-repository"},m("repository")),{getContent:function(e,t){var n=t.uid;return c(function(){var t;return f(this,function(r){switch(r.label){case 0:return[4,e.apiClient.request({url:"gitRepositories:get",params:{filterByTk:n}})];case 1:if(!(t=d.apply(void 0,[r.sent()])))return[2,null];return[2,{type:"git-repository",repositoryId:t.id,name:t.name,repoUrl:t.repoUrl,defaultBranch:t.defaultBranch,status:t.status}]}})})()}}),h=s(l({name:"git-merge-request"},m("merge-request")),{getContent:function(e,t){var n=t.uid;return c(function(){var t,r,i,o;return f(this,function(u){switch(u.label){case 0:var c;if(r=(t=function(e){if(Array.isArray(e))return e}(c=n.split(":"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(c)||function(e){if(e){if("string"==typeof e)return a(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,2)}}(c)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],i=Number(t[1]),!r||!Number.isSafeInteger(i)||i<=0)return[2,null];return[4,e.apiClient.request({url:"gitManager:mergeRequestDetail",params:{repositoryId:r,mrIid:i}})];case 1:if(!(o=d.apply(void 0,[u.sent()])))return[2,null];return[2,{type:"git-merge-request",repositoryId:r,mrIid:i,title:o.title,sourceBranch:o.sourceBranch,targetBranch:o.targetBranch,author:o.author,changes:o.changes,description:o.description,webUrl:o.webUrl}]}})})()}}),v=s(l({name:"git-commit"},m("commit")),{getContent:function(e,t){var n=t.uid;return c(function(){var t,r,i,o;return f(this,function(a){switch(a.label){case 0:if(t=n.indexOf(":"),r=n.slice(0,t),i=n.slice(t+1),t<=0||!i)return[2,null];return[4,e.apiClient.request({url:"gitManager:commitDetail",params:{repositoryId:r,commitHash:i}})];case 1:return[2,(o=d.apply(void 0,[a.sent()]))?s(l({},o),{type:"git-commit",repositoryId:r,commitSha:i}):null]}})})()}});function w(e,t,n,r,i,o,a){try{var u=e[o](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,i)}function O(e,t,n){return(O=_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&j(i,n.prototype),i}).apply(null,arguments)}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return O(e,arguments,S(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),j(n,e)})(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}var k=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=S(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,_()?Reflect.construct(e,t||[],S(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&j(r,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t,r;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(i){return null==(r=null==(e=this.app.pm.get("ai"))?void 0:e.aiManager)||r.registerWorkContext("git-repository",b),null==r||r.registerWorkContext("git-merge-request",h),null==r||r.registerWorkContext("git-commit",v),null==(t=this.app.pm.get("acl"))||t.settingsUI.addPermissionsTab({key:"git-manager",label:this.t("Git Manager"),sort:25,componentLoader:function(){return p.e("928").then(p.bind(p,43)).then(function(e){var t=e.RepositoryPermissions;return{default:function(e){var r=e.activeRole;return r?n().createElement(t,{key:r.name,activeRole:r}):null}}})}}),this.pluginSettingsManager.addMenuItem({key:"git-manager",title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"accounts",title:this.t("Git Accounts"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("156").then(p.bind(p,367)).then(function(e){return{default:e.GitAccountsSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"subtree-splits",title:this.t("Subtree Splits"),aclSnippet:"pm.plugin-git-manager.write",componentLoader:function(){return p.e("356").then(p.bind(p,935))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"repositories",title:this.t("Repositories"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("434").then(p.bind(p,33)).then(function(e){return{default:e.RepositoryConfigSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"review-flows",title:this.t("Review Flows"),aclSnippet:"pm.plugin-git-manager.read",componentLoader:function(){return p.e("453").then(p.bind(p,100)).then(function(e){return{default:e.ReviewFlowsSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"manage",title:this.t("Manage"),aclSnippet:"pm.plugin-git-manager.manage",componentLoader:function(){return Promise.all([p.e("313"),p.e("453"),p.e("317")]).then(p.bind(p,716)).then(function(e){return{default:e.GitManagerSettings}})}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){w(o,r,i,a,u,"next",e)}function u(e){w(o,r,i,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(x(e.Plugin))}(),y}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["react-i18next","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):e["plugin-git-manager/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a){return function(){"use strict";var u,l,c,s={122:function(e,t,n){function r(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}n.d(t,{JB:function(){return c},SY:function(){return a},Z7:function(){return l},oP:function(){return u},sP:function(){return s}});var i=new WeakMap;function a(e,t){null==t?i.delete(e):i.set(e,t)}function u(e){return i.get(e)}function l(e){var t;return null==e||null==(t=e.data)?void 0:t.data}function c(e){var t=l(e);return t&&(void 0===t?"undefined":o(t))==="object"&&"success"in t&&"data"in t?t.data:t}function s(e,t,n){var i;return(i=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,e.apiClient.request({url:"gitManager:chatContextContent",params:function(e,t){if("repository"===e)return{kind:e,repositoryId:t};var n=t.indexOf(":"),r=t.slice(0,n),o=t.slice(n+1);if(n<=0||!o)throw Error("Invalid Git context");return"merge-request"===e?{kind:e,repositoryId:r,mrIid:o}:{kind:e,repositoryId:r,commitHash:o}}(t,n),skipNotify:!0})];case 1:if(!(r=c(i.sent()))||(void 0===r?"undefined":o(r))!=="object")throw Error("Git context is unavailable");return[2,r]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var a=i.apply(e,t);function u(e){r(a,n,o,u,l,"next",e)}function l(e){r(a,n,o,u,l,"throw",e)}u(void 0)})})()}},375:function(e){e.exports=o},485:function(e){e.exports=t},694:function(e){e.exports=i},768:function(e){e.exports=a},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return s[e].call(n.exports,n,n.exports,p),n.exports}p.m=s,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({156:"445366026c1cc9a8",313:"3c867179c3a1e817",317:"d2466574d00f94d0",356:"3d40a34bad08f8ff",434:"32b0a07b821b9329",453:"f9a0ec6d8e1bd1cc",928:"bba701b5a1ece58e"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d={},p.l=function(e,t,n,r){if(d[e])return void d[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),o.src=e),d[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(m=p.g.location+"");var d,m,g=p.g.document;if(!m&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(m=g.currentScript.src),!m)){var y=g.getElementsByTagName("script");if(y.length)for(var b=y.length-1;b>-1&&(!m||!/^http(s?):/.test(m));)m=y[b--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");p.p=m.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},p.f.j=function(e,t){var n=p.o(u,e)?u[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),i=Error();p.l(o,function(t){if(p.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==u[e]})){for(n in i)p.o(i,n)&&(p.m[n]=i[n]);a&&a(p)}for(e&&e(t);l<o.length;l++)r=o[l],p.o(u,r)&&u[r]&&u[r][0](),u[r]=0},(c=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(l.bind(null,0)),c.push=l.bind(null,c.push.bind(c));var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-git-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client-v2/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return _}});var e=p(485),t=p(155),n=p.n(t),r=p(375),o=p(768),i=p(59),a=p(953),u=p(122);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||d(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}function m(e){if(!e)return"";var t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function g(e){var r=e.app,o=e.kind,l=e.onAdd,p=e.isActive,d=e.onClose,g=(0,a.useTranslation)("plugin-git-manager").t,y=s((0,t.useState)(""),2),b=y[0],v=y[1],h=s((0,t.useState)(1),2),w=h[0],S=h[1],k=s((0,t.useState)([]),2),x=k[0],E=k[1],O=s((0,t.useState)(!1),2),C=O[0],j=O[1],P=s((0,t.useState)(),2),I=P[0],q=P[1],_=s((0,t.useState)(!1),2),A=_[0],M=_[1],T=s((0,t.useState)(!1),2),B=T[0],R=T[1],G=s((0,t.useState)([]),2),N=G[0],L=G[1],F=s((0,t.useState)(),2),$=F[0],J=F[1],K=s((0,t.useState)("opened"),2),U=K[0],z=K[1],D=s((0,t.useState)(""),2),W=D[0],Z=D[1],H=s((0,t.useState)(1),2),Y=H[0],Q=H[1],V=s((0,t.useState)([]),2),X=V[0],ee=V[1],et=s((0,t.useState)([]),2),en=et[0],er=et[1],eo=s((0,t.useState)(!1),2),ei=eo[0],ea=eo[1],eu=s((0,t.useState)(!1),2),el=eu[0],ec=eu[1],es=s((0,t.useState)(),2),ef=es[0],ep=es[1],ed=s((0,t.useState)(""),2),em=ed[0],eg=ed[1],ey=s((0,t.useState)(""),2),eb=ey[0],ev=ey[1],eh=s((0,t.useState)(""),2),ew=eh[0],eS=eh[1],ek=s((0,t.useState)(""),2),ex=ek[0],eE=ek[1],eO=s((0,t.useState)(!1),2),eC=eO[0],ej=eO[1],eP=(0,t.useRef)(!1),eI=(0,t.useRef)(!0),eq=(0,t.useRef)(!1);(0,t.useEffect)(function(){return eI.current=!0,function(){eI.current=!1}},[]),(0,t.useEffect)(function(){var e=(0,u.oP)(r);if(null!=e){var t=!1;return r.apiClient.request({url:"gitManager:chatContextOptions",params:{kind:o,repositoryId:e,page:1,pageSize:1},skipNotify:!0}).then(function(e){var n,r=(0,u.JB)(e);!t&&!eP.current&&(null==r||null==(n=r.items)?void 0:n[0])&&q(r.items[0])}).catch(function(){}),function(){t=!0}}},[r,o]),(0,t.useEffect)(function(){var e=!1;return M(!0),r.apiClient.request({url:"gitManager:chatContextOptions",params:{kind:o,search:b,page:w,pageSize:30},skipNotify:!0}).then(function(t){if(!e){var n=(0,u.JB)(t),r=Array.isArray(null==n?void 0:n.items)?n.items:[];E(function(e){return 1===w?r:f(e).concat(f(r))}),j((null==n?void 0:n.hasMore)===!0),eg("")}}).finally(function(){e||M(!1)}).catch(function(){e||eg(g("Unable to load Git context. Check your access and try again."))}),function(){e=!0}},[r,o,w,b,g]),(0,t.useEffect)(function(){if(L([]),J(void 0),ev(""),R(!1),"commit"===o&&I){var e=!1;return R(!0),r.apiClient.request({url:"gitManager:branches",params:{repositoryId:I.id},skipNotify:!0}).then(function(t){if(!e){var n=(0,u.JB)(t),r=Array.isArray(null==n?void 0:n.all)?n.all:[];L(r);var o=!(null==n?void 0:n.detached)&&(null==n?void 0:n.current)?n.current:void 0,i=o&&r.includes(o)?o:I.defaultBranch;J(i&&r.includes(i)?i:r[0]),ev("")}}).finally(function(){e||R(!1)}).catch(function(){e||ev(g("Unable to load Git context. Check your access and try again."))}),function(){e=!0}}},[r,o,I,g]),(0,t.useEffect)(function(){if(!I||"repository"===o||"commit"===o&&!$)return void ec(!1);var e=!1;ec(!0);var t="merge-request"===o?{repositoryId:I.id,state:U,page:Y,perPage:30}:{repositoryId:I.id,branch:$,skip:(Y-1)*30,maxCount:30};return r.apiClient.request({url:"merge-request"===o?"gitManager:mergeRequests":"gitManager:log",params:t,skipNotify:!0}).then(function(t){if(!e){if("merge-request"===o){var n,r,i,a=(0,u.JB)(t),l=Array.isArray(a)?a:[],c=(0,u.Z7)(t);ee(function(e){return 1===Y?l:f(e).concat(f(l))}),ea(null!=(n=null==c||null==(r=c.pagination)?void 0:r.hasMore)?n:(null==c||null==(i=c.pagination)?void 0:i.totalPages)!=null?Y<c.pagination.totalPages:30===l.length)}else{var s=(0,u.JB)(t),p=Array.isArray(null==s?void 0:s.all)?s.all:[];er(function(e){return 1===Y?p:f(e).concat(f(p))}),ea(30===p.length)}eS("")}}).finally(function(){e||ec(!1)}).catch(function(){e||eS(g("Unable to load Git context. Check your access and try again."))}),function(){e=!0}},[r,$,Y,o,I,U,g]);var e_=(0,t.useMemo)(function(){var e=W.trim().toLowerCase().replace(/^!/,"");return X.filter(function(t){return"".concat(t.iid," ").concat(t.title).toLowerCase().includes(e)})},[W,X]),eA=(0,t.useMemo)(function(){var e=W.trim().toLowerCase();return en.filter(function(t){return"".concat(t.hash," ").concat(t.subject||t.message||"").toLowerCase().includes(e)})},[W,en]);return n().createElement(i.Form,{layout:"vertical",onFinish:function(){var e;return(e=function(){var e,t,n,i,a;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:if(eq.current||!I||"repository"!==o&&!ef)return[2];e="repository"===o?String(I.id):"".concat(I.id,":").concat(ef),t=X.find(function(e){return String(e.iid)===ef}),n=en.find(function(e){return e.hash===ef}),i=I.name||String(I.id),a="repository"===o?i:"merge-request"===o?"".concat(i," \xb7 !").concat(ef," \xb7 ").concat((null==t?void 0:t.title)||""):"".concat(i," \xb7 ").concat(null==ef?void 0:ef.slice(0,7)," \xb7 ").concat((null==n?void 0:n.subject)||(null==n?void 0:n.message)||""),eq.current=!0,ej(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,(0,u.sP)(r,o,e)];case 2:if(c.sent(),!eI.current||p&&!p())return[2];return l({uid:e,title:a}),d(),[3,5];case 3:return c.sent(),eI.current&&eE(g("Git context is unavailable. Check your access and select it again.")),[3,5];case 4:return eq.current=!1,eI.current&&ej(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)})})()},disabled:eC},n().createElement(i.Form.Item,{label:g("Search repositories")},n().createElement(i.Input.Search,{allowClear:!0,onSearch:function(e,t){null==t||t.preventDefault(),eP.current=!0,S(1),v(e)},"aria-label":g("Search repositories")})),n().createElement(i.Form.Item,{label:g("Repository"),required:!0},n().createElement(i.Select,{"aria-label":g("Repository"),loading:A,value:null==I?void 0:I.id,onChange:function(e){eP.current=!0,q(x.find(function(t){return t.id===e})),J(void 0),L([]),ep(void 0),Q(1),ee([]),er([]),ea(!1),Z(""),eS(""),eE("")},placeholder:g("Select a repository"),options:(I&&!x.some(function(e){return e.id===I.id})?[I].concat(f(x)):x).map(function(e){return{value:e.id,label:[e.name||String(e.id),e.defaultBranch,e.status].filter(Boolean).join(" \xb7 ")}}),notFoundContent:A?n().createElement(i.Spin,{size:"small"}):g("No repositories available")}),C&&n().createElement(i.Button,{type:"link",loading:A,onClick:function(){return S(function(e){return e+1})}},g("Load more repositories"))),"commit"===o&&I&&n().createElement(i.Form.Item,{label:g("Branch"),required:!0},n().createElement(i.Select,{"aria-label":g("Branch"),loading:B,value:$,placeholder:g("Select a branch"),options:N.map(function(e){return{value:e,label:e}}),onChange:function(e){J(e),Q(1),er([]),ea(!1),ep(void 0),eS(""),eE("")}})),"merge-request"===o&&I&&n().createElement(i.Form.Item,{label:g("State")},n().createElement(i.Select,{"aria-label":g("State"),value:U,options:["opened","merged","closed","all"].map(function(e){return{value:e,label:g(e)}}),onChange:function(e){z(e),Q(1),ee([]),ea(!1),ep(void 0),eS(""),eE("")}})),"repository"!==o&&I&&("commit"!==o||$)&&n().createElement(n().Fragment,null,n().createElement(i.Form.Item,{label:g("Search loaded results")},n().createElement(i.Input,{"aria-label":g("Search loaded results"),value:W,onChange:function(e){Z(e.target.value),ep(void 0),eE("")},onPressEnter:function(e){return e.preventDefault()},allowClear:!0})),n().createElement(i.Form.Item,{label:g("commit"===o?"Commit":"Merge Request"),required:!0},n().createElement(i.Select,{"aria-label":g("commit"===o?"Commit":"Merge Request"),loading:el,value:ef,onChange:ep,placeholder:g("commit"===o?"Select a commit":"Select a merge request"),options:"merge-request"===o?e_.map(function(e){var t,n;return{value:String(e.iid),label:["!".concat(e.iid," \xb7 ").concat(e.title),e.sourceBranch&&e.targetBranch?"".concat(e.sourceBranch," → ").concat(e.targetBranch):"",(null==(t=e.author)?void 0:t.name)||(null==(n=e.author)?void 0:n.username),m(e.updatedAt)].filter(Boolean).join(" \xb7 ")}}):eA.map(function(e){return{value:e.hash,label:[e.hash.slice(0,7),e.subject||e.message,e.author_name,m(e.date)].filter(Boolean).join(" \xb7 ")}}),notFoundContent:el?n().createElement(i.Spin,{size:"small"}):g("No results")}),ei&&n().createElement(i.Button,{type:"link",loading:el,onClick:function(){return Q(function(e){return e+1})}},g("Load more results")))),(ex||ew||eb||em)&&n().createElement(i.Alert,{type:"error",showIcon:!0,message:ex||ew||eb||em,style:{marginBottom:16}}),n().createElement(i.Space,{style:{display:"flex",justifyContent:"flex-end"}},n().createElement(i.Button,{onClick:d},g("Cancel")),n().createElement(i.Button,{type:"primary",htmlType:"submit",loading:eC,disabled:!I||"repository"!==o&&!ef},g("Attach to chat"))),n().createElement(i.Typography.Text,{type:"secondary","aria-live":"polite"},el||A||B?g("Loading"):""))}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){b(i,r,o,a,u,"next",e)}function u(e){b(i,r,o,a,u,"throw",e)}a(void 0)})}}function w(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var S=["repository","merge-request","commit"],k=function(){return{repository:!1,"merge-request":!1,commit:!1}},x=new WeakMap;function E(e){var t=e.kind,o=e.title,u=(0,a.useTranslation)("plugin-git-manager").t,l={repository:n().createElement(r.BranchesOutlined,null),"merge-request":n().createElement(r.MergeOutlined,null),commit:n().createElement(r.NodeIndexOutlined,null)};return n().createElement(i.Space,{size:4},l[t],n().createElement("span",null,o||u({repository:"Git Repository","merge-request":"Git Merge Request",commit:"Git Commit"}[t])))}function O(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function C(e,t,n){return(C=q()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&P(o,n.prototype),o}).apply(null,arguments)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return C(e,arguments,j(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)})(e)}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(q=function(){return!!e})()}var _=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=j(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,q()?Reflect.construct(e,t||[],j(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&P(r,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t,r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:var l,c,s,f;if(!(r=null==(e=this.app.pm.get("ai"))?void 0:e.aiManager))return[3,2];return[4,(l=this.app,(c=x.get(r))||(s=l,f=r,c=h(function(){var e,t,r,a,l,c,p,d,m,b,v,x,O,C;return w(this,function(j){switch(j.label){case 0:a=k(),l=0,c=!0,p=!1,d=void 0;try{for(m=S[Symbol.iterator]();!(c=(b=m.next()).done);c=!0)v=b.value,x="git-".concat(v),f.getWorkContext(x)||f.registerWorkContext(x,function(e,t){return{name:"git-".concat(t),tag:{Component:function(e){var r=e.item;return n().createElement(E,{kind:t,title:r.title||r.uid})}},getContent:function(n,r){var o=r.uid;return h(function(){var r;return w(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,(0,u.sP)(e,t,o)];case 1:return[2,a.sent()];case 2:throw r=a.sent(),i.message.error(n.i18n.t("Git context is unavailable. Check your access and select it again.",{ns:"plugin-git-manager"})),r;case 3:return[2]}})})()}}}(s,v))}catch(e){p=!0,d=e}finally{try{c||null==m.return||m.return()}finally{if(p)throw d}}return O=function(){var e=new o.Registry,t=!0,r=!1,i=void 0;try{for(var u,l=f.workContext.getEntities()[Symbol.iterator]();!(t=(u=l.next()).done);t=!0)!function(){var t,r,o=(t=u.value,function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return y(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],l=o[1],c=S.find(function(e){return i==="git-".concat(e)});if(!c)return e.register(i,l);l.menu;var f=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(l,["menu"]);e.register(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},f,a[c]?{menu:(r=function(){return a[c]},{Component:function(){return n().createElement(E,{kind:c})},onClick:function(e){var t=e.ctx,o=e.onAdd;if(r())var i=!0,a=t.viewer.dialog({title:n().createElement(E,{kind:c}),width:720,zIndex:2200,onClose:function(){i=!1},content:function(){return n().createElement(g,{app:s,kind:c,onAdd:o,isActive:function(){return i&&r()},onClose:function(){a.close()}})}})}})}:{}))}()}catch(e){r=!0,i=e}finally{try{t||null==l.return||l.return()}finally{if(r)throw i}}f.workContext=e},C=function(){return h(function(){var e,t,n,r,o;return w(this,function(i){switch(i.label){case 0:if(e=++l,a=k(),O(),s.apiClient.auth&&!s.apiClient.auth.token)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s.apiClient.request({url:"gitManager:chatContextOptions",skipNotify:!0,timeout:5e3})];case 2:if(o=u.JB.apply(void 0,[i.sent()]),e!==l)return[2];return a={repository:(null==o||null==(t=o.capabilities)?void 0:t.repository)===!0,"merge-request":(null==o||null==(n=o.capabilities)?void 0:n["merge-request"])===!0,commit:(null==o||null==(r=o.capabilities)?void 0:r.commit)===!0},O(),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}})})()},s.eventBus.addEventListener("auth:tokenChanged",function(){C()}),null==(r=s.apiClient.axios)||null==(t=r.interceptors)||null==(e=t.response)||e.use(function(e){var t;return/(^|\/)roles:check(?:\?|$)/.test((null==(t=e.config)?void 0:t.url)||"")&&setTimeout(function(){return C()},0),e}),[4,C()];case 1:return j.sent(),[2]}})})(),x.set(r,c)),c)];case 1:a.sent(),a.label=2;case 2:return null==(t=this.app.pm.get("acl"))||t.settingsUI.addPermissionsTab({key:"git-manager",label:this.t("Git Manager"),sort:25,componentLoader:function(){return p.e("928").then(p.bind(p,43)).then(function(e){var t=e.RepositoryPermissions;return{default:function(e){var r=e.activeRole;return r?n().createElement(t,{key:r.name,activeRole:r}):null}}})}}),this.pluginSettingsManager.addMenuItem({key:"git-manager",title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"accounts",title:this.t("Git Accounts"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("156").then(p.bind(p,367)).then(function(e){return{default:e.GitAccountsSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"subtree-splits",title:this.t("Subtree Splits"),aclSnippet:"pm.plugin-git-manager.write",componentLoader:function(){return p.e("356").then(p.bind(p,935))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"repositories",title:this.t("Repositories"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("434").then(p.bind(p,33)).then(function(e){return{default:e.RepositoryConfigSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"review-flows",title:this.t("Review Flows"),aclSnippet:"pm.plugin-git-manager.read",componentLoader:function(){return p.e("453").then(p.bind(p,100)).then(function(e){return{default:e.ReviewFlowsSettings}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"manage",title:this.t("Manage"),aclSnippet:"pm.plugin-git-manager.manage",componentLoader:function(){return Promise.all([p.e("313"),p.e("453"),p.e("317")]).then(p.bind(p,716)).then(function(e){return{default:e.GitManagerSettings}})}}),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){O(i,r,o,a,u,"next",e)}function u(e){O(i,r,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(I(e.Plugin))}(),v}()});
@@ -8,18 +8,19 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
+ "@nocobase/client": "2.2.52",
12
+ "@nocobase/plugin-ai": "2.2.52",
11
13
  "react": "18.2.0",
12
- "antd": "5.24.2",
14
+ "@nocobase/plugin-acl": "2.2.52",
15
+ "@nocobase/client-v2": "2.2.52",
13
16
  "@ant-design/icons": "5.6.1",
14
- "@nocobase/client": "2.2.40",
15
- "@nocobase/plugin-ai": "2.2.40",
16
- "@nocobase/plugin-acl": "2.2.40",
17
- "@nocobase/client-v2": "2.2.40",
17
+ "@nocobase/utils": "2.2.52",
18
+ "antd": "5.24.2",
18
19
  "react-i18next": "11.18.6",
19
- "@nocobase/flow-engine": "2.2.40",
20
- "@nocobase/server": "2.2.40",
21
- "@nocobase/actions": "2.2.40",
22
- "@nocobase/database": "2.2.40",
20
+ "@nocobase/flow-engine": "2.2.52",
21
+ "@nocobase/server": "2.2.52",
22
+ "@nocobase/actions": "2.2.52",
23
+ "@nocobase/database": "2.2.52",
23
24
  "sequelize": "6.35.2",
24
25
  "dayjs": "1.11.13"
25
26
  };
@@ -392,5 +392,31 @@
392
392
  "Refresh publication status before recovery": "Refresh publication status before recovery",
393
393
  "Matching comment found; another publication attempt still owns the review": "Matching comment found; another publication attempt still owns the review",
394
394
  "Review publication claim changed": "Review publication claim changed; refresh and check the current attempt",
395
- "Review project reservation changed": "Review project reservation changed"
395
+ "Review project reservation changed": "Review project reservation changed",
396
+ "Git context is unavailable. Check your access and select it again.": "Git context is unavailable. Check your access and select it again.",
397
+ "Unable to load Git context. Check your access and try again.": "Unable to load Git context. Check your access and try again.",
398
+ "Search repositories": "Search repositories",
399
+ "No repositories available": "No repositories available",
400
+ "Load more repositories": "Load more repositories",
401
+ "Select a branch": "Select a branch",
402
+ "State": "State",
403
+ "opened": "Open",
404
+ "merged": "Merged",
405
+ "closed": "Closed",
406
+ "all": "All",
407
+ "Search loaded results": "Search loaded results",
408
+ "Select a commit": "Select a commit",
409
+ "Select a merge request": "Select a merge request",
410
+ "No results": "No results",
411
+ "Load more results": "Load more results",
412
+ "Cancel": "Cancel",
413
+ "Attach to chat": "Attach to chat",
414
+ "Loading": "Loading",
415
+ "Additional changed files were omitted.": "Additional changed files were omitted.",
416
+ "The diff was truncated to the configured limit.": "The diff was truncated to the configured limit.",
417
+ "Binary file contents are not included in the diff.": "Binary file contents are not included in the diff.",
418
+ "Additional changed files were omitted by the provider.": "Additional changed files were omitted by the provider.",
419
+ "The provider omitted patches for one or more files, including binary or large files.": "The provider omitted patches for one or more files, including binary or large files.",
420
+ "The provider omitted additional changed files or patches.": "The provider omitted additional changed files or patches.",
421
+ "Additional changed files or diff content were omitted.": "Additional changed files or diff content were omitted."
396
422
  }
@@ -380,5 +380,31 @@
380
380
  "Refresh publication status before recovery": "Hãy làm mới trạng thái đăng trước khi khôi phục",
381
381
  "Matching comment found; another publication attempt still owns the review": "Đã tìm thấy bình luận khớp; một lần đăng khác vẫn đang giữ lượt đánh giá",
382
382
  "Review publication claim changed": "Lượt đăng đang giữ đã thay đổi; hãy làm mới và kiểm tra lượt hiện tại",
383
- "Review project reservation changed": "Quyền giữ dự án cho lượt đánh giá đã thay đổi"
383
+ "Review project reservation changed": "Quyền giữ dự án cho lượt đánh giá đã thay đổi",
384
+ "Git context is unavailable. Check your access and select it again.": "Không thể đọc ngữ cảnh Git. Hãy kiểm tra quyền truy cập và chọn lại.",
385
+ "Unable to load Git context. Check your access and try again.": "Không thể tải dữ liệu Git. Hãy kiểm tra quyền truy cập và thử lại.",
386
+ "Search repositories": "Tìm repository",
387
+ "No repositories available": "Không có repository nào khả dụng",
388
+ "Load more repositories": "Tải thêm repository",
389
+ "Select a branch": "Chọn nhánh",
390
+ "State": "Trạng thái",
391
+ "opened": "Đang mở",
392
+ "merged": "Đã hợp nhất",
393
+ "closed": "Đã đóng",
394
+ "all": "Tất cả",
395
+ "Search loaded results": "Tìm trong các kết quả đã tải",
396
+ "Select a commit": "Chọn commit",
397
+ "Select a merge request": "Chọn merge request",
398
+ "No results": "Không có kết quả",
399
+ "Load more results": "Tải thêm kết quả",
400
+ "Cancel": "Hủy",
401
+ "Attach to chat": "Gắn vào chat",
402
+ "Loading": "Đang tải",
403
+ "Additional changed files were omitted.": "Một số tệp thay đổi khác đã được lược bỏ.",
404
+ "The diff was truncated to the configured limit.": "Nội dung diff đã được cắt theo giới hạn cấu hình.",
405
+ "Binary file contents are not included in the diff.": "Nội dung tệp nhị phân không có trong diff.",
406
+ "Additional changed files were omitted by the provider.": "Nhà cung cấp đã lược bỏ một số tệp thay đổi khác.",
407
+ "The provider omitted patches for one or more files, including binary or large files.": "Nhà cung cấp không trả patch cho một hoặc nhiều tệp, bao gồm tệp nhị phân hoặc tệp lớn.",
408
+ "The provider omitted additional changed files or patches.": "Nhà cung cấp đã lược bỏ một số tệp thay đổi hoặc patch khác.",
409
+ "Additional changed files or diff content were omitted.": "Một số tệp thay đổi hoặc nội dung diff khác đã được lược bỏ."
384
410
  }
@@ -146,5 +146,34 @@
146
146
  "Refresh publication status before recovery": "恢复前请刷新发布状态",
147
147
  "Matching comment found; another publication attempt still owns the review": "已找到匹配评论;另一个发布操作仍占用该审查",
148
148
  "Review publication claim changed": "审查发布占用已更改;请刷新并检查当前操作",
149
- "Review project reservation changed": "审查项目占用已更改"
149
+ "Review project reservation changed": "审查项目占用已更改",
150
+ "Git context is unavailable. Check your access and select it again.": "无法读取 Git 上下文。请检查访问权限并重新选择。",
151
+ "Unable to load Git context. Check your access and try again.": "无法加载 Git 数据。请检查访问权限后重试。",
152
+ "Search repositories": "搜索仓库",
153
+ "Select a repository": "选择仓库",
154
+ "Commit": "提交",
155
+ "Merge Request": "合并请求",
156
+ "No repositories available": "没有可用的仓库",
157
+ "Load more repositories": "加载更多仓库",
158
+ "Select a branch": "选择分支",
159
+ "State": "状态",
160
+ "opened": "开放",
161
+ "merged": "已合并",
162
+ "closed": "已关闭",
163
+ "all": "全部",
164
+ "Search loaded results": "搜索已加载的结果",
165
+ "Select a commit": "选择提交",
166
+ "Select a merge request": "选择合并请求",
167
+ "No results": "没有结果",
168
+ "Load more results": "加载更多结果",
169
+ "Cancel": "取消",
170
+ "Attach to chat": "附加到聊天",
171
+ "Loading": "正在加载",
172
+ "Additional changed files were omitted.": "已省略其他更改的文件。",
173
+ "The diff was truncated to the configured limit.": "差异内容已按配置的上限截断。",
174
+ "Binary file contents are not included in the diff.": "差异内容不包含二进制文件内容。",
175
+ "Additional changed files were omitted by the provider.": "提供商省略了其他更改的文件。",
176
+ "The provider omitted patches for one or more files, including binary or large files.": "提供商省略了一个或多个文件的补丁,包括二进制文件或大文件。",
177
+ "The provider omitted additional changed files or patches.": "提供商省略了其他更改的文件或补丁。",
178
+ "Additional changed files or diff content were omitted.": "已省略其他更改的文件或差异内容。"
150
179
  }
@@ -1 +1 @@
1
- {"name":"simple-git","description":"Simple GIT interface for node.js","version":"3.36.0","author":"Steve King <steve@mydev.co>","contributors":[{"name":"Steve King","email":"steve@mydev.co"}],"funding":{"type":"github","url":"https://github.com/steveukx/git-js?sponsor=1"},"keywords":["git","source control","vcs"],"license":"MIT","repository":{"type":"git","url":"https://github.com/steveukx/git-js.git","directory":"simple-git"},"main":"dist/cjs/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/typings/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./promise":{"require":"./promise.js"}},"types":"./dist/typings/index.d.ts","files":["promise.*","dist"],"dependencies":{"@kwsites/file-exists":"^1.1.1","@kwsites/promise-deferred":"^1.1.1","@simple-git/args-pathspec":"^1.0.3","@simple-git/argv-parser":"^1.1.0","debug":"^4.4.0"},"_lastModified":"2026-11-20T05:35:31.217Z"}
1
+ {"name":"simple-git","description":"Simple GIT interface for node.js","version":"3.36.0","author":"Steve King <steve@mydev.co>","contributors":[{"name":"Steve King","email":"steve@mydev.co"}],"funding":{"type":"github","url":"https://github.com/steveukx/git-js?sponsor=1"},"keywords":["git","source control","vcs"],"license":"MIT","repository":{"type":"git","url":"https://github.com/steveukx/git-js.git","directory":"simple-git"},"main":"dist/cjs/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/typings/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./promise":{"require":"./promise.js"}},"types":"./dist/typings/index.d.ts","files":["promise.*","dist"],"dependencies":{"@kwsites/file-exists":"^1.1.1","@kwsites/promise-deferred":"^1.1.1","@simple-git/args-pathspec":"^1.0.3","@simple-git/argv-parser":"^1.1.0","debug":"^4.4.0"},"_lastModified":"2026-11-25T03:50:17.128Z"}
@@ -1 +1 @@
1
- {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-11-20T05:35:30.590Z"}
1
+ {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-11-25T03:50:16.432Z"}