plugin-agent-orchestrator 1.0.37 → 1.1.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 (43) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/client-v2/253.9f0537713cee9e6c.js +10 -0
  3. package/dist/client-v2/418.ce8f5b2b8a229d1d.js +10 -0
  4. package/dist/client-v2/53.7c29c28043e9112d.js +10 -0
  5. package/dist/client-v2/794.9bbb8d3a61b2bdf2.js +10 -0
  6. package/dist/client-v2/993.82778b6fd6db3cb1.js +10 -0
  7. package/dist/client-v2/index.js +1 -1
  8. package/dist/externalVersion.js +6 -6
  9. package/dist/locale/en-US.json +50 -2
  10. package/dist/locale/vi-VN.json +50 -2
  11. package/dist/locale/zh-CN.json +50 -2
  12. package/dist/server/migrations/20260621000000-native-policy-profile-defaults.js +0 -3
  13. package/dist/server/migrations/20260727000000-remove-unused-knowledge-scopes.js +51 -0
  14. package/dist/server/plugin.js +11 -1
  15. package/dist/server/resources/agent-knowledge-insights.js +273 -0
  16. package/dist/server/services/AgentMemoryContextService.js +57 -19
  17. package/dist/server/services/NativeSubAgentObserver.js +11 -3
  18. package/dist/server/tools/external-rag-search.js +152 -12
  19. package/package.json +1 -1
  20. package/src/client-v2/components/AgentBindingsTab.tsx +269 -0
  21. package/src/client-v2/components/HarnessProfilesTab.tsx +1 -2
  22. package/src/client-v2/components/KnowledgeAccessTab.tsx +116 -0
  23. package/src/client-v2/components/MemoryInspectorTab.tsx +125 -0
  24. package/src/client-v2/components/RetrievalTraceTab.tsx +162 -0
  25. package/src/client-v2/pages/AgentBindingsPage.tsx +13 -0
  26. package/src/client-v2/pages/KnowledgeAccessPage.tsx +10 -0
  27. package/src/client-v2/pages/MemoryInspectorPage.tsx +13 -0
  28. package/src/client-v2/pages/RetrievalTracePage.tsx +10 -0
  29. package/src/client-v2/plugin.tsx +28 -0
  30. package/src/locale/en-US.json +50 -2
  31. package/src/locale/vi-VN.json +50 -2
  32. package/src/locale/zh-CN.json +50 -2
  33. package/src/server/__tests__/agent-knowledge-insights.test.ts +123 -0
  34. package/src/server/__tests__/external-rag-search.test.ts +107 -0
  35. package/src/server/__tests__/native-sub-agent-observer.test.ts +89 -7
  36. package/src/server/migrations/20260621000000-native-policy-profile-defaults.ts +0 -3
  37. package/src/server/migrations/20260727000000-remove-unused-knowledge-scopes.ts +25 -0
  38. package/src/server/plugin.ts +3 -0
  39. package/src/server/resources/agent-knowledge-insights.ts +304 -0
  40. package/src/server/services/AgentMemoryContextService.ts +63 -19
  41. package/src/server/services/NativeSubAgentObserver.ts +538 -528
  42. package/src/server/tools/external-rag-search.ts +215 -14
  43. package/dist/client-v2/418.29e713f79131eece.js +0 -10
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).push([["253"],{740:function(e,t,r){r.r(t),r.d(t,{default:function(){return f}});var n=r(155),a=r.n(n),o=r(59),l=r(375),u=r(608),c=r(603);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}var s=function(){var e,t=(0,c.k)(),r=function(e){if(Array.isArray(e))return e}(e=(0,n.useState)(!1))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(t=n.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}}(e)||function(e){if(e){if("string"==typeof e)return i(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 i(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=r[0],f=r[1],d=(0,u.b)({url:"agentKnowledgeInsights:accessMatrix"}),y=(0,n.useMemo)(function(){var e;return Array.isArray(null==(e=d.data)?void 0:e.data)?e.data:[]},[d.data]),p=(0,n.useMemo)(function(){return s?y.filter(function(e){return"denied"===e.access}):y},[y,s]),m=[{title:t("AI Employee"),dataIndex:"employeeUsername",key:"employeeUsername"},{title:t("Knowledge Base"),dataIndex:"knowledgeBaseName",key:"knowledgeBaseName",render:function(e,t){return a().createElement(o.Space,{size:4,wrap:!0},a().createElement("span",null,e),a().createElement(o.Tag,null,t.knowledgeBaseType))}},{title:t("Assignment"),dataIndex:"assigned",key:"assigned",width:120,render:function(e){return a().createElement(o.Tag,{color:e?"blue":"default"},e?t("Assigned"):t("Not assigned"))}},{title:t("Agent access"),dataIndex:"access",key:"access",width:130,render:function(e){return a().createElement(o.Tag,{color:"allowed"===e?"success":"error"},"allowed"===e?t("Allowed"):t("Denied"))}},{title:t("Reason"),dataIndex:"reason",key:"reason",render:function(e){return a().createElement(o.Typography.Text,null,e)}},{title:t("Runtime user gate"),dataIndex:"userGate",key:"userGate",render:function(e){return a().createElement(o.Tooltip,{title:e},a().createElement(o.Typography.Text,{ellipsis:!0,style:{maxWidth:260}},e))}}];return a().createElement(o.Card,{bordered:!1},a().createElement(o.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement(o.Typography.Text,{type:"secondary"},t("This matrix checks employee assignment and static agent policy. BASIC and SHARED user access is still evaluated when a run starts.")),a().createElement(o.Space,{wrap:!0},a().createElement(o.Button,{type:s?"primary":"default",onClick:function(){return f(function(e){return!e})}},s?t("Show all"):t("Show denied only")),a().createElement(o.Button,{icon:a().createElement(l.ReloadOutlined,null),onClick:d.refresh},t("Refresh"))),a().createElement(o.Table,{rowKey:"key",loading:d.loading,dataSource:p,columns:m,scroll:{x:"max-content"},pagination:{pageSize:50,showSizeChanger:!0}})))},f=function(){return a().createElement("div",{style:{padding:"0 24px 24px"}},a().createElement(s,null))}},608:function(e,t,r){r.d(t,{R:function(){return i},b:function(){return s}});var n=r(485),a=r(155);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 l(e,t,r,n,a,o,l){try{var u=e[o](l),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,a)}function u(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 o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(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 c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function i(){return(0,n.useApp)().apiClient}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i(),n=t.manual,o=void 0!==n&&n,s=t.refreshDeps,f=t.onSuccess,d=t.onError,y=u((0,a.useState)(void 0),2),p=y[0],m=y[1],b=u((0,a.useState)(!o),2),h=b[0],v=b[1],g=u((0,a.useState)(void 0),2),w=g[0],S=g[1],k=(0,a.useRef)(e);k.current=e;var E=(0,a.useRef)(f);E.current=f;var O=(0,a.useRef)(d);O.current=d;var A=(0,a.useCallback)(function(e){var t;return(t=function(){var t,n,a,o,l,u,i;return function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:c(0)}),u(l,"throw",{value:c(1)}),u(l,"return",{value:c(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function c(u){return function(c){var i=[u,c];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,i[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:t=k.current,v(!0),S(void 0),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"function"!=typeof t)return[3,3];return[4,t()];case 2:return a=s.sent(),[3,5];case 3:return[4,r.request({url:t.url,method:t.method||"get",params: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}({},t.params||{},e||{}),data:t.data})];case 4:a=(l=null==(o=s.sent())?void 0:o.data)&&(void 0===l?"undefined":c(l))==="object"&&l.data&&"object"===c(l.data)&&"data"in l.data?l.data:l,s.label=5;case 5:return m(a),null==(n=E.current)||n.call(E,a),[2,a];case 6:return S(u=s.sent()),null==(i=O.current)||i.call(O,u),[2,void 0];case 7:return v(!1),[7];case 8:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function u(e){l(o,n,a,u,c,"next",e)}function c(e){l(o,n,a,u,c,"throw",e)}u(void 0)})})()},[r]),x=(0,a.useCallback)(function(){A()},[A]);return(0,a.useEffect)(function(){o||A()},void 0===s?[]:s),{data:p,loading:h,error:w,refresh:x,run:A}}},603:function(e,t,r){r.d(t,{k:function(){return o}});var n=r(485),a=r(155);function o(){var e=(0,n.useApp)();return(0,a.useCallback)(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-agent-orchestrator","client"]},r))},[e.i18n])}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).push([["418"],{393:function(e,t,r){r.r(t),r.d(t,{default:function(){return g}});var n=r(155),a=r.n(n),l=r(59),o=r(375),i=r(608),u=r(603);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,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 f(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){s(l,n,a,o,i,"next",e)}function i(e){s(l,n,a,o,i,"throw",e)}o(void 0)})}}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 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.")}()}function d(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 m=l.Typography.Text,y=function(e){var t=String(e||"").trim();return t?JSON.parse(t):{}},b=function(){var e=(0,i.R)(),t=(0,u.k)(),r=p(a().useState(!1),2),n=r[0],c=r[1],s=p(a().useState(null),2),b=s[0],g=s[1],v=p(l.Form.useForm(),1)[0],h=(0,i.b)({url:"agentHarnessProfiles:list",params:{sort:["tag"],pageSize:100}}),w=h.data,O=h.loading,S=h.refresh,E=a().useMemo(function(){var e=null==w?void 0:w.data;return Array.isArray(e)?e:[]},[w]),P=function(e){var t,r;g(e||null),v.resetFields(),v.setFieldsValue(e?(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}({},e),r=r={settingsText:JSON.stringify(e.settings||{},null,2)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t):{tag:"",title:"",description:"",enabled:!0,settingsText:JSON.stringify({nativeObserverEnabled:!0,memoryInjectionEnabled:!0,memoryScopes:["public","user","agent_user"],maxMemoryContextChars:6e3,tracingRetentionDays:30},null,2)}),c(!0)},j=function(){c(!1),g(null)},k=[{title:t("Tag"),dataIndex:"tag",key:"tag",width:140,render:function(e){return a().createElement(l.Tag,{color:"blue"},e)}},{title:t("Title"),dataIndex:"title",key:"title",render:function(e,t){return e||t.tag}},{title:t("Enabled"),dataIndex:"enabled",key:"enabled",width:90,render:function(t,r){return a().createElement(l.Switch,{size:"small",checked:!1!==t,onChange:function(t){return f(function(){return d(this,function(n){switch(n.label){case 0:return[4,e.request({url:"agentHarnessProfiles:update",method:"put",params:{filterByTk:r.id},data:{enabled:t}})];case 1:return n.sent(),S(),[2]}})})()}})}},{title:t("Settings"),key:"settings",render:function(e,t){return a().createElement(l.Space,{size:4,wrap:!0},Object.entries(t.settings||{}).slice(0,5).map(function(e){var t=p(e,2),r=t[0],n=t[1];return a().createElement(l.Tag,{key:r},r,": ",String(n))}))}},{title:t("Actions"),key:"actions",width:150,render:function(r,n){return a().createElement(l.Space,null,a().createElement(l.Button,{type:"link",size:"small",icon:a().createElement(o.EditOutlined,null),onClick:function(){return P(n)}},t("Edit")),a().createElement(l.Popconfirm,{title:t("Delete this profile?"),onConfirm:function(){var r;return r=n.id,f(function(){var n;return d(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e.request({url:"agentHarnessProfiles:destroy",method:"delete",params:{filterByTk:r}})];case 1:return a.sent(),l.message.success(t("Policy profile deleted")),S(),[3,3];case 2:return n=a.sent(),l.message.error(t("Delete failed: {{message}}",{message:(null==n?void 0:n.message)||t("unknown error")})),[3,3];case 3:return[2]}})})()}},a().createElement(l.Button,{type:"link",size:"small",danger:!0,icon:a().createElement(o.DeleteOutlined,null)},t("Delete"))))}}];return a().createElement("div",null,a().createElement(l.Card,{bordered:!1},a().createElement(l.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:16}},a().createElement(m,{type:"secondary"},t("Policy profiles control native observation, memory scopes, and tracing retention.")),a().createElement(l.Button,{type:"primary",icon:a().createElement(o.PlusOutlined,null),onClick:function(){return P()}},t("New Policy"))),a().createElement(l.Table,{rowKey:"id",loading:O,dataSource:E,columns:k,pagination:!1,scroll:{x:"max-content"}}))),a().createElement(l.Drawer,{title:b?t("Edit Policy Profile"):t("New Policy Profile"),width:560,open:n,onClose:j,extra:a().createElement(l.Space,null,a().createElement(l.Button,{onClick:j},t("Cancel")),a().createElement(l.Button,{type:"primary",onClick:function(){return v.submit()}},t("Save")))},a().createElement(l.Form,{form:v,layout:"vertical",onFinish:function(r){return f(function(){var n,a,o,i,u,c,s,f;return d(this,function(p){switch(p.label){case 0:try{n=y(r.settingsText)}catch(e){return l.message.error(t("Settings JSON is invalid: {{message}}",{message:(null==e?void 0:e.message)||e})),[2]}a={tag:String(r.tag||"").trim(),title:r.title,description:r.description,enabled:!1!==r.enabled,settings:n},p.label=1;case 1:if(p.trys.push([1,6,,7]),!b)return[3,3];return[4,e.request({url:"agentHarnessProfiles:update",method:"put",params:{filterByTk:b.id},data:a})];case 2:return p.sent(),l.message.success(t("Policy profile updated")),[3,5];case 3:return[4,e.request({url:"agentHarnessProfiles:create",method:"post",data:a})];case 4:p.sent(),l.message.success(t("Policy profile created")),p.label=5;case 5:return j(),S(),[3,7];case 6:return f=(null==(o=p.sent())||null==(s=o.response)||null==(c=s.data)||null==(u=c.errors)||null==(i=u[0])?void 0:i.message)||(null==o?void 0:o.message)||"unknown error",l.message.error(t("Save failed: {{message}}",{message:f})),[3,7];case 7:return[2]}})})()}},a().createElement(l.Form.Item,{name:"tag",label:t("Tag"),rules:[{required:!0,message:t("Tag is required")}]},a().createElement(l.Input,{placeholder:t("default"),disabled:(null==b?void 0:b.tag)==="default"})),a().createElement(l.Form.Item,{name:"title",label:t("Title")},a().createElement(l.Input,null)),a().createElement(l.Form.Item,{name:"description",label:t("Description")},a().createElement(l.Input.TextArea,{rows:3})),a().createElement(l.Form.Item,{name:"settingsText",label:t("Settings JSON"),rules:[{required:!0,message:t("Settings JSON is required")}]},a().createElement(l.Input.TextArea,{rows:12,spellCheck:!1})),a().createElement(l.Form.Item,{name:"enabled",label:t("Enabled"),valuePropName:"checked"},a().createElement(l.Switch,null)))))},g=function(){return a().createElement("div",{style:{padding:"0 24px 24px"}},a().createElement(b,null))}},608:function(e,t,r){r.d(t,{R:function(){return c},b:function(){return s}});var n=r(485),a=r(155);function l(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 o(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 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 l(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 l(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 u(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function c(){return(0,n.useApp)().apiClient}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=c(),n=t.manual,l=void 0!==n&&n,s=t.refreshDeps,f=t.onSuccess,p=t.onError,d=i((0,a.useState)(void 0),2),m=d[0],y=d[1],b=i((0,a.useState)(!l),2),g=b[0],v=b[1],h=i((0,a.useState)(void 0),2),w=h[0],O=h[1],S=(0,a.useRef)(e);S.current=e;var E=(0,a.useRef)(f);E.current=f;var P=(0,a.useRef)(p);P.current=p;var j=(0,a.useCallback)(function(e){var t;return(t=function(){var t,n,a,l,o,i,c;return function(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}}}}(this,function(s){switch(s.label){case 0:t=S.current,v(!0),O(void 0),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"function"!=typeof t)return[3,3];return[4,t()];case 2:return a=s.sent(),[3,5];case 3:return[4,r.request({url:t.url,method:t.method||"get",params: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}({},t.params||{},e||{}),data:t.data})];case 4:a=(o=null==(l=s.sent())?void 0:l.data)&&(void 0===o?"undefined":u(o))==="object"&&o.data&&"object"===u(o.data)&&"data"in o.data?o.data:o,s.label=5;case 5:return y(a),null==(n=E.current)||n.call(E,a),[2,a];case 6:return O(i=s.sent()),null==(c=P.current)||c.call(P,i),[2,void 0];case 7:return v(!1),[7];case 8:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,a){var l=t.apply(e,r);function i(e){o(l,n,a,i,u,"next",e)}function u(e){o(l,n,a,i,u,"throw",e)}i(void 0)})})()},[r]),k=(0,a.useCallback)(function(){j()},[j]);return(0,a.useEffect)(function(){l||j()},void 0===s?[]:s),{data:m,loading:g,error:w,refresh:k,run:j}}},603:function(e,t,r){r.d(t,{k:function(){return l}});var n=r(485),a=r(155);function l(){var e=(0,n.useApp)();return(0,a.useCallback)(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-agent-orchestrator","client"]},r))},[e.i18n])}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).push([["53"],{532:function(e,r,t){t.d(r,{j:function(){return f},l:function(){return s}});var n=t(155),a=t.n(n),o=t(608);function l(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function u(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)||function(e){if(e){if("string"==typeof e)return l(e,void 0);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 l(e,void 0)}}(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.")}()}var i=(0,n.createContext)({employees:[],employeeMap:new Map,toolNamesMap:new Map,loading:!1,refresh:function(){}}),c=new Set(["dispatch-sub-agent-task","external_rag_search","skill_hub_execute"]),s=function(e){var r=e.children,t=(0,o.b)({url:"aiEmployees:list",params:{pageSize:200}}),n=t.data,l=t.loading,s=t.refresh,f=a().useMemo(function(){var e=((null==n?void 0:n.data)||[]).map(function(e){var r,t,n,a,o=(t=Array.isArray(null==(r=e.skillSettings)?void 0:r.tools)?r.tools.map(function(e){return"string"==typeof e?e:null==e?void 0:e.name}).filter(function(e){return"string"==typeof e&&e.length>0}):[],n=Array.isArray(null==r?void 0:r.skills)?r.skills.map(function(e){if("string"==typeof e)return c.has(e)||e.startsWith("skill_hub_")||e.startsWith("browser_")||e.startsWith("drawio-")?e:null;return null==e?void 0:e.name}).filter(function(e){return"string"==typeof e&&e.length>0}):[],Array.from(new Set(u(t).concat(u(n)))));return{username:e.username,nickname:e.nickname||e.username,about:null==(a=e.about)?void 0:a.substring(0,80),tools:o}}),r=new Map,t=new Map,a=!0,o=!1,i=void 0;try{for(var f,p=e[Symbol.iterator]();!(a=(f=p.next()).done);a=!0){var m=f.value;r.set(m.username,m.nickname),t.set(m.username,new Set(m.tools))}}catch(e){o=!0,i=e}finally{try{a||null==p.return||p.return()}finally{if(o)throw i}}return{employees:e,employeeMap:r,toolNamesMap:t,loading:l,refresh:s}},[n,l,s]);return a().createElement(i.Provider,{value:f},r)},f=function(){return(0,n.useContext)(i)}},676:function(e,r,t){t.r(r),t.d(r,{default:function(){return m}});var n=t(155),a=t.n(n),o=t(532),l=t(59),u=t(608),i=t(603);function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function s(e,r,t,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){t(e);return}u.done?r(i):Promise.resolve(i).then(n,a)}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return c(e,r);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 c(e,r)}}(e,r)||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 p=function(){var e=(0,u.R)(),r=(0,i.k)(),t=(0,o.j)().employees,c=f(l.Form.useForm(),1)[0],p=f((0,n.useState)(null),2),m=p[0],y=p[1],d=f((0,n.useState)(!1),2),b=d[0],v=d[1],h=(0,u.b)({url:"agentHarnessProfiles:list",params:{pageSize:100,sort:["tag"]}}),g=(0,n.useMemo)(function(){var e;return Array.isArray(null==(e=h.data)?void 0:e.data)?e.data:[]},[h.data]);return a().createElement(l.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement(l.Card,{bordered:!1},a().createElement(l.Typography.Text,{type:"secondary"},r("Preview the exact memory context for a user and selected sub-agent before a run. Memory is marked as data, not executable instructions.")),a().createElement(l.Form,{form:c,layout:"vertical",onFinish:function(t){var n;return(n=function(){var n,a,o,u,i,c;return function(e,r){var t,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(t)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(t=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 o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],n=0}finally{t=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:v(!0),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,e.request({url:"agentKnowledgeInsights:memoryPreview",method:"post",data:t})];case 2:var f,p;if(!(n=(null==(f=s.sent().data)||null==(p=f.data)?void 0:p.data)||(null==f?void 0:f.data)))throw Error(r("Memory preview returned no data"));return y(n),[3,5];case 3:return c=s.sent(),l.message.error((null==(i=c.response)||null==(u=i.data)||null==(o=u.errors)||null==(a=o[0])?void 0:a.message)||c.message||r("Memory preview failed")),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(t,a){var o=n.apply(e,r);function l(e){s(o,t,a,l,u,"next",e)}function u(e){s(o,t,a,l,u,"throw",e)}l(void 0)})})()},style:{marginTop:16,maxWidth:680},initialValues:{harnessTag:"default"}},a().createElement(l.Form.Item,{label:r("User ID"),name:"userId",rules:[{required:!0,message:r("User ID is required")}]},a().createElement(l.Input,{inputMode:"numeric"})),a().createElement(l.Form.Item,{label:r("Sub-Agent"),name:"employeeUsername"},a().createElement(l.Select,{allowClear:!0,showSearch:!0,optionFilterProp:"label",options:t.map(function(e){return{label:e.nickname||e.username,value:e.username}})})),a().createElement(l.Form.Item,{label:r("Leader (Orchestrator)"),name:"leaderUsername"},a().createElement(l.Select,{allowClear:!0,showSearch:!0,optionFilterProp:"label",options:t.map(function(e){return{label:e.nickname||e.username,value:e.username}})})),a().createElement(l.Form.Item,{label:r("Policy Profile"),name:"harnessTag"},a().createElement(l.Select,{options:g.filter(function(e){return!1!==e.enabled}).map(function(e){return{label:e.title?"".concat(e.title," (").concat(e.tag,")"):e.tag,value:e.tag}})})),a().createElement(l.Button,{type:"primary",htmlType:"submit",loading:b},r("Build memory preview")))),m&&a().createElement(l.Card,{title:r("Final memory context")},a().createElement(l.Descriptions,{bordered:!0,size:"small",column:2,style:{marginBottom:16}},a().createElement(l.Descriptions.Item,{label:r("Policy Profile")},m.harnessTag),a().createElement(l.Descriptions.Item,{label:r("Character budget")},m.chars," / ",m.maxChars),a().createElement(l.Descriptions.Item,{label:r("Applied scopes"),span:2},m.appliedScopes.join(", ")||r("None"))),a().createElement(l.Typography.Paragraph,{style:{margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"}},m.context||r("No memory context matched this preview."))))},m=function(){return a().createElement(o.l,null,a().createElement("div",{style:{padding:"0 24px 24px"}},a().createElement(p,null)))}},608:function(e,r,t){t.d(r,{R:function(){return c},b:function(){return s}});var n=t(485),a=t(155);function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function l(e,r,t,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){t(e);return}u.done?r(i):Promise.resolve(i).then(n,a)}function u(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return o(e,r);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 o(e,r)}}(e,r)||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 i(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function c(){return(0,n.useApp)().apiClient}function s(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=c(),n=r.manual,o=void 0!==n&&n,s=r.refreshDeps,f=r.onSuccess,p=r.onError,m=u((0,a.useState)(void 0),2),y=m[0],d=m[1],b=u((0,a.useState)(!o),2),v=b[0],h=b[1],g=u((0,a.useState)(void 0),2),w=g[0],S=g[1],E=(0,a.useRef)(e);E.current=e;var k=(0,a.useRef)(f);k.current=f;var j=(0,a.useRef)(p);j.current=p;var A=(0,a.useCallback)(function(e){var r;return(r=function(){var r,n,a,o,l,u,c;return function(e,r){var t,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(t)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(t=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 o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=r.call(e,o)}catch(e){c=[6,e],n=0}finally{t=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:r=E.current,h(!0),S(void 0),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"function"!=typeof r)return[3,3];return[4,r()];case 2:return a=s.sent(),[3,5];case 3:return[4,t.request({url:r.url,method:r.method||"get",params:function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},r.params||{},e||{}),data:r.data})];case 4:a=(l=null==(o=s.sent())?void 0:o.data)&&(void 0===l?"undefined":i(l))==="object"&&l.data&&"object"===i(l.data)&&"data"in l.data?l.data:l,s.label=5;case 5:return d(a),null==(n=k.current)||n.call(k,a),[2,a];case 6:return S(u=s.sent()),null==(c=j.current)||c.call(j,u),[2,void 0];case 7:return h(!1),[7];case 8:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function u(e){l(o,n,a,u,i,"next",e)}function i(e){l(o,n,a,u,i,"throw",e)}u(void 0)})})()},[t]),O=(0,a.useCallback)(function(){A()},[A]);return(0,a.useEffect)(function(){o||A()},void 0===s?[]:s),{data:y,loading:v,error:w,refresh:O,run:A}}},603:function(e,r,t){t.d(r,{k:function(){return o}});var n=t(485),a=t(155);function o(){var e=(0,n.useApp)();return(0,a.useCallback)(function(r,t){return e.i18n.t(r,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({ns:["plugin-agent-orchestrator","client"]},t))},[e.i18n])}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).push([["794"],{532:function(e,t,r){r.d(t,{j:function(){return f},l:function(){return s}});var n=r(155),a=r.n(n),o=r(608);function l(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){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)||function(e){if(e){if("string"==typeof e)return l(e,void 0);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 l(e,void 0)}}(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.")}()}var i=(0,n.createContext)({employees:[],employeeMap:new Map,toolNamesMap:new Map,loading:!1,refresh:function(){}}),c=new Set(["dispatch-sub-agent-task","external_rag_search","skill_hub_execute"]),s=function(e){var t=e.children,r=(0,o.b)({url:"aiEmployees:list",params:{pageSize:200}}),n=r.data,l=r.loading,s=r.refresh,f=a().useMemo(function(){var e=((null==n?void 0:n.data)||[]).map(function(e){var t,r,n,a,o=(r=Array.isArray(null==(t=e.skillSettings)?void 0:t.tools)?t.tools.map(function(e){return"string"==typeof e?e:null==e?void 0:e.name}).filter(function(e){return"string"==typeof e&&e.length>0}):[],n=Array.isArray(null==t?void 0:t.skills)?t.skills.map(function(e){if("string"==typeof e)return c.has(e)||e.startsWith("skill_hub_")||e.startsWith("browser_")||e.startsWith("drawio-")?e:null;return null==e?void 0:e.name}).filter(function(e){return"string"==typeof e&&e.length>0}):[],Array.from(new Set(u(r).concat(u(n)))));return{username:e.username,nickname:e.nickname||e.username,about:null==(a=e.about)?void 0:a.substring(0,80),tools:o}}),t=new Map,r=new Map,a=!0,o=!1,i=void 0;try{for(var f,d=e[Symbol.iterator]();!(a=(f=d.next()).done);a=!0){var m=f.value;t.set(m.username,m.nickname),r.set(m.username,new Set(m.tools))}}catch(e){o=!0,i=e}finally{try{a||null==d.return||d.return()}finally{if(o)throw i}}return{employees:e,employeeMap:t,toolNamesMap:r,loading:l,refresh:s}},[n,l,s]);return a().createElement(i.Provider,{value:f},t)},f=function(){return(0,n.useContext)(i)}},913:function(e,t,r){r.r(t),r.d(t,{default:function(){return v}});var n=r(155),a=r.n(n),o=r(532),l=r(375),u=r(59),i=function(e){var t=e.value,r=e.onChange,n=e.exclude,l=e.placeholder,i=(0,o.j)(),c=i.employees,s=i.loading,f=a().useMemo(function(){return c.filter(function(e){return!n||e.username!==n}).map(function(e){return{label:e.nickname,value:e.username,description:e.about}})},[c,n]);return a().createElement(u.Select,{loading:s,options:f,value:t,onChange:r,placeholder:void 0===l?"Select AI Employee...":l,showSearch:!0,filterOption:function(e,t){var r,n;return(null!=(r=null==t?void 0:t.label)?r:"").toString().toLowerCase().includes(e.toLowerCase())||(null!=(n=null==t?void 0:t.value)?n:"").toString().toLowerCase().includes(e.toLowerCase())},optionRender:function(e){return a().createElement("div",null,a().createElement("div",{style:{fontWeight:500}},e.label),e.data.description&&a().createElement("div",{style:{fontSize:12,color:"#888"}},e.data.description))}})},c=r(608),s=r(603);function f(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 d(e,t,r,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function m(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function l(e){d(o,n,a,l,u,"next",e)}function u(e){d(o,n,a,l,u,"throw",e)}l(void 0)})}}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 o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(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 f(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 y(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)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 o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}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}}}}function b(e){return Array.isArray(null==e?void 0:e.data)?e.data:[]}function h(e){var t,r,n,a;return(null==(a=e.response)||null==(n=a.data)||null==(r=n.errors)||null==(t=r[0])?void 0:t.message)||e.message||"Unknown error"}var g=function(){var e=(0,c.R)(),t=(0,s.k)(),r=(0,o.j)().employeeMap,f=p(u.Form.useForm(),1)[0],d=p((0,n.useState)(!1),2),g=d[0],v=d[1],w=p((0,n.useState)(null),2),S=w[0],E=w[1],O=(0,c.b)({url:"orchestratorConfig:list",params:{sort:["leaderUsername","subAgentUsername"],pageSize:200}}),k=(0,c.b)({url:"agentHarnessProfiles:list",params:{sort:["tag"],pageSize:100}}),j=(0,n.useMemo)(function(){return b(O.data)},[O.data]),A=(0,n.useMemo)(function(){return b(k.data)},[k.data]),x=(0,n.useMemo)(function(){return A.filter(function(e){return!1!==e.enabled}).map(function(e){return{label:e.title?"".concat(e.title," (").concat(e.tag,")"):e.tag,value:e.tag}})},[A]),P=function(){v(!1),E(null),f.resetFields()},C=function(e){E(e||null),f.setFieldsValue(e||{enabled:!0,harnessTag:"default",maxDepth:1,timeout:12e4}),v(!0)},I=[{title:t("Leader (Orchestrator)"),dataIndex:"leaderUsername",key:"leaderUsername",render:function(e){return a().createElement(u.Tag,{color:"blue"},r.get(e)||e)}},{title:t("Sub-Agent"),dataIndex:"subAgentUsername",key:"subAgentUsername",render:function(e){return a().createElement(u.Tag,{color:"green"},r.get(e)||e)}},{title:t("Policy Profile"),dataIndex:"harnessTag",key:"harnessTag",render:function(e){return a().createElement(u.Tag,{color:"purple"},e||"default")}},{title:t("Max Delegation Depth"),dataIndex:"maxDepth",key:"maxDepth",width:140},{title:t("Enabled"),dataIndex:"enabled",key:"enabled",width:100,render:function(r,n){return a().createElement(u.Switch,{size:"small",checked:!1!==r,"aria-label":t("Enabled"),onChange:function(t){return m(function(){return y(this,function(r){switch(r.label){case 0:return[4,e.request({url:"orchestratorConfig:update",method:"put",params:{filterByTk:n.id},data:{enabled:t}})];case 1:return r.sent(),O.refresh(),[2]}})})()}})}},{title:t("Actions"),key:"actions",width:150,render:function(r,n){return a().createElement(u.Space,null,a().createElement(u.Button,{type:"link",size:"small",icon:a().createElement(l.EditOutlined,null),onClick:function(){return C(n)}},t("Edit")),a().createElement(u.Popconfirm,{title:t("Delete this binding?"),onConfirm:function(){var r;return r=n.id,m(function(){var n;return y(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e.request({url:"orchestratorConfig:destroy",method:"delete",params:{filterByTk:r}})];case 1:return a.sent(),u.message.success(t("Agent binding deleted")),O.refresh(),[3,3];case 2:return n=a.sent(),u.message.error(t("Delete failed: {{message}}",{message:h(n)})),[3,3];case 3:return[2]}})})()}},a().createElement(u.Button,{type:"link",size:"small",danger:!0,icon:a().createElement(l.DeleteOutlined,null)},t("Delete"))))}}];return a().createElement(u.Card,{bordered:!1},a().createElement(u.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a().createElement(u.Typography.Text,{type:"secondary"},t("Bind each leader/sub-agent pair to the profile that controls memory and tracing policy.")),a().createElement(u.Button,{type:"primary",icon:a().createElement(l.PlusOutlined,null),onClick:function(){return C()}},t("New Agent Binding"))),a().createElement(u.Table,{rowKey:"id",dataSource:j,loading:O.loading||k.loading,columns:I,pagination:!1,scroll:{x:"max-content"}})),a().createElement(u.Drawer,{open:g,onClose:P,width:560,title:S?t("Edit Agent Binding"):t("New Agent Binding"),extra:a().createElement(u.Space,null,a().createElement(u.Button,{onClick:P},t("Cancel")),a().createElement(u.Button,{type:"primary",onClick:function(){return f.submit()}},t("Save")))},a().createElement(u.Form,{form:f,layout:"vertical",onFinish:function(r){return m(function(){var n,a,o,l;return y(this,function(i){switch(i.label){case 0:var c,s;c=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}({},r),s=s={leaderUsername:null==(n=r.leaderUsername)?void 0:n.trim(),subAgentUsername:null==(a=r.subAgentUsername)?void 0:a.trim(),harnessTag:r.harnessTag||"default",enabled:!1!==r.enabled},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(s)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(s,e))}),o=c,i.label=1;case 1:if(i.trys.push([1,6,,7]),!S)return[3,3];return[4,e.request({url:"orchestratorConfig:update",method:"put",params:{filterByTk:S.id},data:o})];case 2:return i.sent(),u.message.success(t("Agent binding updated")),[3,5];case 3:return[4,e.request({url:"orchestratorConfig:create",method:"post",data:o})];case 4:i.sent(),u.message.success(t("Agent binding created")),i.label=5;case 5:return P(),O.refresh(),[3,7];case 6:return l=i.sent(),u.message.error(t("Save failed: {{message}}",{message:h(l)})),[3,7];case 7:return[2]}})})()}},a().createElement(u.Form.Item,{label:t("Leader (Orchestrator)"),name:"leaderUsername",rules:[{required:!0,message:t("Leader is required")}]},a().createElement(i,{placeholder:t("Select leader")})),a().createElement(u.Form.Item,{label:t("Sub-Agent"),name:"subAgentUsername",rules:[{required:!0,message:t("Sub-agent is required")}]},a().createElement(i,{placeholder:t("Select sub-agent")})),a().createElement(u.Form.Item,{label:t("Policy Profile"),name:"harnessTag",rules:[{required:!0,message:t("Policy profile is required")}]},a().createElement(u.Select,{options:x,placeholder:t("Select policy profile")})),a().createElement(u.Form.Item,{label:t("Max Delegation Depth"),name:"maxDepth"},a().createElement(u.InputNumber,{min:1,max:10,style:{width:"100%"}})),a().createElement(u.Form.Item,{label:t("Timeout (ms)"),name:"timeout"},a().createElement(u.InputNumber,{min:1e3,max:6e5,step:1e3,style:{width:"100%"}})),a().createElement(u.Form.Item,{label:t("Enabled"),name:"enabled",valuePropName:"checked"},a().createElement(u.Switch,null)))))},v=function(){return a().createElement(o.l,null,a().createElement("div",{style:{padding:"0 24px 24px"}},a().createElement(g,null)))}},608:function(e,t,r){r.d(t,{R:function(){return c},b:function(){return s}});var n=r(485),a=r(155);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 l(e,t,r,n,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function u(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 o=[],l=!0,u=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(u)throw n}}return o}}(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 i(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function c(){return(0,n.useApp)().apiClient}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=c(),n=t.manual,o=void 0!==n&&n,s=t.refreshDeps,f=t.onSuccess,d=t.onError,m=u((0,a.useState)(void 0),2),p=m[0],y=m[1],b=u((0,a.useState)(!o),2),h=b[0],g=b[1],v=u((0,a.useState)(void 0),2),w=v[0],S=v[1],E=(0,a.useRef)(e);E.current=e;var O=(0,a.useRef)(f);O.current=f;var k=(0,a.useRef)(d);k.current=d;var j=(0,a.useCallback)(function(e){var t;return(t=function(){var t,n,a,o,l,u,c;return function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)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 o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}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}}}}(this,function(s){switch(s.label){case 0:t=E.current,g(!0),S(void 0),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"function"!=typeof t)return[3,3];return[4,t()];case 2:return a=s.sent(),[3,5];case 3:return[4,r.request({url:t.url,method:t.method||"get",params: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}({},t.params||{},e||{}),data:t.data})];case 4:a=(l=null==(o=s.sent())?void 0:o.data)&&(void 0===l?"undefined":i(l))==="object"&&l.data&&"object"===i(l.data)&&"data"in l.data?l.data:l,s.label=5;case 5:return y(a),null==(n=O.current)||n.call(O,a),[2,a];case 6:return S(u=s.sent()),null==(c=k.current)||c.call(k,u),[2,void 0];case 7:return g(!1),[7];case 8:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function u(e){l(o,n,a,u,i,"next",e)}function i(e){l(o,n,a,u,i,"throw",e)}u(void 0)})})()},[r]),A=(0,a.useCallback)(function(){j()},[j]);return(0,a.useEffect)(function(){o||j()},void 0===s?[]:s),{data:p,loading:h,error:w,refresh:A,run:j}}},603:function(e,t,r){r.d(t,{k:function(){return o}});var n=r(485),a=r(155);function o(){var e=(0,n.useApp)();return(0,a.useCallback)(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-agent-orchestrator","client"]},r))},[e.i18n])}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).push([["993"],{928:function(e,t,r){r.r(t),r.d(t,{default:function(){return f}});var n=r(155),a=r.n(n),o=r(59),l=r(375),i=r(608),c=r(603);function u(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}var s=function(){var e,t=(0,c.k)(),r=function(e){if(Array.isArray(e))return e}(e=(0,n.useState)(null))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(t=n.next()).done)&&(a.push(t.value),2!==a.length);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}}(e)||function(e){if(e){if("string"==typeof e)return u(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 u(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=r[0],f=r[1],d=(0,i.b)({url:"agentKnowledgeInsights:retrievalTrace",params:{page:1,pageSize:100}}),y=(0,n.useMemo)(function(){var e;return Array.isArray(null==(e=d.data)?void 0:e.data)?e.data:[]},[d.data]),p=[{title:t("Time"),dataIndex:"createdAt",key:"createdAt",width:180,render:function(e){return e?new Date(e).toLocaleString():"-"}},{title:t("AI Employee"),dataIndex:"employeeUsername",key:"employeeUsername",width:160},{title:t("Query"),dataIndex:"query",key:"query",render:function(e){return a().createElement(o.Typography.Paragraph,{ellipsis:{rows:2},style:{margin:0,maxWidth:360}},e||"-")}},{title:t("Decision"),dataIndex:"decision",key:"decision",width:110,render:function(e){return a().createElement(o.Tag,{color:"allowed"===e?"success":"error"},"allowed"===e?t("Allowed"):t("Denied"))}},{title:t("Citations"),dataIndex:"citations",key:"citations",width:100,render:function(e){return(null==e?void 0:e.length)||0}},{title:t("Actions"),key:"actions",width:100,render:function(e,r){return a().createElement(o.Button,{type:"link",size:"small",icon:a().createElement(l.EyeOutlined,null),onClick:function(){return f(r)}},t("Detail"))}}];return a().createElement(o.Card,{bordered:!1},a().createElement(o.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement(o.Typography.Text,{type:"secondary"},t("Retrieval trace stores the decision, query, and safe source citations. It does not repeat raw RAG provider metadata.")),a().createElement(o.Button,{icon:a().createElement(l.ReloadOutlined,null),onClick:d.refresh,style:{alignSelf:"flex-start"}},t("Refresh")),a().createElement(o.Table,{rowKey:"id",loading:d.loading,dataSource:y,columns:p,scroll:{x:"max-content"},pagination:{pageSize:50,showSizeChanger:!0}})),a().createElement(o.Drawer,{title:t("Retrieval detail"),open:!!s,onClose:function(){return f(null)},width:760},s&&a().createElement(o.Space,{direction:"vertical",size:16,style:{width:"100%"}},a().createElement(o.Typography.Text,{strong:!0},t("Decision")),a().createElement(o.Tag,{color:"allowed"===s.decision?"success":"error"},s.decision),a().createElement(o.Typography.Paragraph,null,a().createElement(o.Typography.Text,{strong:!0},t("Reason"),": "),s.reason),a().createElement(o.Typography.Paragraph,null,a().createElement(o.Typography.Text,{strong:!0},t("Query"),": "),s.query||"-"),a().createElement(o.Card,{title:t("Citations"),size:"small"},s.citations.length?a().createElement(o.Space,{direction:"vertical",size:12,style:{width:"100%"}},s.citations.map(function(e,r){return a().createElement(o.Card,{key:"".concat(e.sourceId||e.filename||r),size:"small"},a().createElement(o.Space,{direction:"vertical",size:4,style:{width:"100%"}},a().createElement(o.Typography.Text,{strong:!0},e.filename||e.sourceId||t("Unknown source")),a().createElement(o.Typography.Text,{type:"secondary"},e.knowledgeBaseName||e.knowledgeBaseId||"-",null!=e.score?" \xb7 ".concat(e.score.toFixed(3)):""),e.url?a().createElement(o.Typography.Link,{href:e.url,target:"_blank",rel:"noreferrer"},e.url):null,e.excerpt?a().createElement(o.Typography.Paragraph,{style:{whiteSpace:"pre-wrap",margin:0}},e.excerpt):null))})):a().createElement(o.Empty,{description:t("No citations were returned")})))))},f=function(){return a().createElement("div",{style:{padding:"0 24px 24px"}},a().createElement(s,null))}},608:function(e,t,r){r.d(t,{R:function(){return u},b:function(){return s}});var n=r(485),a=r(155);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 l(e,t,r,n,a,o,l){try{var i=e[o](l),c=i.value}catch(e){r(e);return}i.done?t(c):Promise.resolve(c).then(n,a)}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 o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw n}}return o}}(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 c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function u(){return(0,n.useApp)().apiClient}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u(),n=t.manual,o=void 0!==n&&n,s=t.refreshDeps,f=t.onSuccess,d=t.onError,y=i((0,a.useState)(void 0),2),p=y[0],m=y[1],h=i((0,a.useState)(!o),2),b=h[0],g=h[1],v=i((0,a.useState)(void 0),2),w=v[0],E=v[1],S=(0,a.useRef)(e);S.current=e;var k=(0,a.useRef)(f);k.current=f;var x=(0,a.useRef)(d);x.current=d;var O=(0,a.useCallback)(function(e){var t;return(t=function(){var t,n,a,o,l,i,u;return function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(s){switch(s.label){case 0:t=S.current,g(!0),E(void 0),s.label=1;case 1:if(s.trys.push([1,6,7,8]),"function"!=typeof t)return[3,3];return[4,t()];case 2:return a=s.sent(),[3,5];case 3:return[4,r.request({url:t.url,method:t.method||"get",params: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}({},t.params||{},e||{}),data:t.data})];case 4:a=(l=null==(o=s.sent())?void 0:o.data)&&(void 0===l?"undefined":c(l))==="object"&&l.data&&"object"===c(l.data)&&"data"in l.data?l.data:l,s.label=5;case 5:return m(a),null==(n=k.current)||n.call(k,a),[2,a];case 6:return E(i=s.sent()),null==(u=x.current)||u.call(x,i),[2,void 0];case 7:return g(!1),[7];case 8:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(e){l(o,n,a,i,c,"next",e)}function c(e){l(o,n,a,i,c,"throw",e)}i(void 0)})})()},[r]),T=(0,a.useCallback)(function(){O()},[O]);return(0,a.useEffect)(function(){o||O()},void 0===s?[]:s),{data:p,loading:b,error:w,refresh:T,run:O}}},603:function(e,t,r){r.d(t,{k:function(){return o}});var n=r(485),a=r(155);function o(){var e=(0,n.useApp)();return(0,a.useCallback)(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-agent-orchestrator","client"]},r))},[e.i18n])}}}]);
@@ -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("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("plugin-agent-orchestrator/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons"],t):"object"==typeof exports?exports["plugin-agent-orchestrator/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):e["plugin-agent-orchestrator/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"])}(self,function(e,t,n,r){return function(){"use strict";var o,i,a,c={375:function(e){e.exports=r},485:function(t){t.exports=e},59:function(e){e.exports=n},155:function(e){e.exports=t}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,l),n.exports}l.m=c,l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=function(e){return Promise.all(Object.keys(l.f).reduce(function(t,n){return l.f[n](e,t),t},[]))},l.u=function(e){return""+e+"."+({214:"79650a549273f163",264:"718a107e43fc163c",373:"f5d5292e53c4e832",41:"ba6e080cc0488143",418:"29e713f79131eece",619:"bd3c5698b40705c3",677:"a991ce0250ff5c77",70:"bda9518881c05360",925:"f5370de8f6632d65"})[e]+".js"},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},l.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var u=a[c];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="plugin-agent-orchestrator/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,l.nc&&o.setAttribute("nonce",l.nc),o.setAttribute("data-rspack","plugin-agent-orchestrator/client-v2:"+n),o.src=e),s[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=s[e];if(delete s[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(f=l.g.location+"");var s,f,p=l.g.document;if(!f&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(f=p.currentScript.src),!f)){var d=p.getElementsByTagName("script");if(d.length)for(var h=d.length-1;h>-1&&(!f||!/^http(s?):/.test(f));)f=d[h--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");l.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o={889:0},l.f.j=function(e,t){var n=l.o(o,e)?o[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=o[e]=[t,r]});t.push(n[2]=r);var i=l.p+l.u(e),a=Error();l.l(i,function(t){if(l.o(o,e)&&(0!==(n=o[e])&&(o[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,n[1](a)}},"chunk-"+e,e)}},i=function(e,t){var n,r,i=t[0],a=t[1],c=t[2],u=0;if(i.some(function(e){return 0!==o[e]})){for(n in a)l.o(a,n)&&(l.m[n]=a[n]);c&&c(l)}for(e&&e(t);u<i.length;u++)r=i[u],l.o(o,r)&&o[r]&&o[r][0](),o[r]=0},(a=self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).forEach(i.bind(null,0)),a.push=i.bind(null,a.push.bind(a));var g={};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-agent-orchestrator/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-agent-orchestrator/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||"/",c=a.indexOf(i);e=c>=0?a.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-agent-orchestrator/dist/client-v2/"}l.p=e}(),!function(){l.r(g),l.d(g,{default:function(){return c}});var e=l(485);function t(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=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,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var c=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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,a()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){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),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"ai.orchestrator",title:this.t("Agent Orchestrator"),icon:"ApartmentOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"index",title:this.t("Native Monitor"),componentLoader:function(){return Promise.all([l.e("925"),l.e("373")]).then(l.bind(l,380))},sort:-1}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"tracing",title:this.t("Execution Tracing"),componentLoader:function(){return l.e("619").then(l.bind(l,230))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"agent-runs",title:this.t("Native Agent Runs"),componentLoader:function(){return Promise.all([l.e("925"),l.e("677")]).then(l.bind(l,812))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"harness-profiles",title:this.t("Policy Profiles"),componentLoader:function(){return l.e("418").then(l.bind(l,393))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-definitions",title:this.t("Skill Hub Definitions"),componentLoader:function(){return l.e("41").then(l.bind(l,224))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-executions",title:this.t("Execution History"),componentLoader:function(){return l.e("264").then(l.bind(l,715))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-loop-settings",title:this.t("Skill Review Settings"),componentLoader:function(){return l.e("70").then(l.bind(l,581))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-metrics",title:this.t("Metrics"),componentLoader:function(){return l.e("214").then(l.bind(l,349))}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function c(e){t(a,o,i,c,u,"next",e)}function u(e){t(a,o,i,c,u,"throw",e)}c(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)}}(i.prototype,n),i}(i(e.Plugin))}(),g}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("plugin-agent-orchestrator/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons"],t):"object"==typeof exports?exports["plugin-agent-orchestrator/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons")):e["plugin-agent-orchestrator/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"])}(self,function(e,t,n,r){return function(){"use strict";var o,i,a,c={375:function(e){e.exports=r},485:function(t){t.exports=e},59:function(e){e.exports=n},155:function(e){e.exports=t}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,l),n.exports}l.m=c,l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=function(e){return Promise.all(Object.keys(l.f).reduce(function(t,n){return l.f[n](e,t),t},[]))},l.u=function(e){return""+e+"."+({214:"79650a549273f163",253:"9f0537713cee9e6c",264:"718a107e43fc163c",373:"f5d5292e53c4e832",41:"ba6e080cc0488143",418:"ce8f5b2b8a229d1d",53:"7c29c28043e9112d",619:"bd3c5698b40705c3",677:"a991ce0250ff5c77",70:"bda9518881c05360",794:"9bbb8d3a61b2bdf2",925:"f5370de8f6632d65",993:"82778b6fd6db3cb1"})[e]+".js"},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},l.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var u=a[c];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="plugin-agent-orchestrator/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,l.nc&&o.setAttribute("nonce",l.nc),o.setAttribute("data-rspack","plugin-agent-orchestrator/client-v2:"+n),o.src=e),s[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=s[e];if(delete s[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),i&&document.head.appendChild(o)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(f=l.g.location+"");var s,f,p=l.g.document;if(!f&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(f=p.currentScript.src),!f)){var d=p.getElementsByTagName("script");if(d.length)for(var g=d.length-1;g>-1&&(!f||!/^http(s?):/.test(f));)f=d[g--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");l.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o={889:0},l.f.j=function(e,t){var n=l.o(o,e)?o[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=o[e]=[t,r]});t.push(n[2]=r);var i=l.p+l.u(e),a=Error();l.l(i,function(t){if(l.o(o,e)&&(0!==(n=o[e])&&(o[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",a.name="ChunkLoadError",a.type=r,a.request=i,n[1](a)}},"chunk-"+e,e)}},i=function(e,t){var n,r,i=t[0],a=t[1],c=t[2],u=0;if(i.some(function(e){return 0!==o[e]})){for(n in a)l.o(a,n)&&(l.m[n]=a[n]);c&&c(l)}for(e&&e(t);u<i.length;u++)r=i[u],l.o(o,r)&&o[r]&&o[r][0](),o[r]=0},(a=self.webpackChunkplugin_agent_orchestrator_client_v2=self.webpackChunkplugin_agent_orchestrator_client_v2||[]).forEach(i.bind(null,0)),a.push=i.bind(null,a.push.bind(a));var h={};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-agent-orchestrator/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-agent-orchestrator/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||"/",c=a.indexOf(i);e=c>=0?a.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-agent-orchestrator/dist/client-v2/"}l.p=e}(),!function(){l.r(h),l.d(h,{default:function(){return c}});var e=l(485);function t(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=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,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var c=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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,a()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){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),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"ai.orchestrator",title:this.t("Agent Orchestrator"),icon:"ApartmentOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"index",title:this.t("Native Monitor"),componentLoader:function(){return Promise.all([l.e("925"),l.e("373")]).then(l.bind(l,380))},sort:-1}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"tracing",title:this.t("Execution Tracing"),componentLoader:function(){return l.e("619").then(l.bind(l,230))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"agent-runs",title:this.t("Native Agent Runs"),componentLoader:function(){return Promise.all([l.e("925"),l.e("677")]).then(l.bind(l,812))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"harness-profiles",title:this.t("Policy Profiles"),componentLoader:function(){return l.e("418").then(l.bind(l,393))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"agent-bindings",title:this.t("Agent Bindings"),componentLoader:function(){return l.e("794").then(l.bind(l,913))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"knowledge-access",title:this.t("Knowledge Access"),componentLoader:function(){return l.e("253").then(l.bind(l,740))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"retrieval-trace",title:this.t("Retrieval Trace"),componentLoader:function(){return l.e("993").then(l.bind(l,928))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"memory-inspector",title:this.t("Memory Inspector"),componentLoader:function(){return l.e("53").then(l.bind(l,676))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-definitions",title:this.t("Skill Hub Definitions"),componentLoader:function(){return l.e("41").then(l.bind(l,224))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-executions",title:this.t("Execution History"),componentLoader:function(){return l.e("264").then(l.bind(l,715))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-loop-settings",title:this.t("Skill Review Settings"),componentLoader:function(){return l.e("70").then(l.bind(l,581))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"ai.orchestrator",key:"skill-metrics",title:this.t("Metrics"),componentLoader:function(){return l.e("214").then(l.bind(l,349))}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function c(e){t(a,o,i,c,u,"next",e)}function u(e){t(a,o,i,c,u,"throw",e)}c(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)}}(i.prototype,n),i}(i(e.Plugin))}(),h}()});
@@ -10,12 +10,12 @@
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
12
  "ahooks": "3.7.8",
13
- "@nocobase/client-v2": "2.1.23",
13
+ "@nocobase/client-v2": "2.1.30",
14
14
  "antd": "5.24.2",
15
15
  "@ant-design/icons": "5.6.1",
16
- "@nocobase/client": "2.1.23",
17
- "@nocobase/server": "2.1.23",
18
- "@nocobase/database": "2.1.23",
19
- "@nocobase/ai": "2.1.23",
20
- "@nocobase/actions": "2.1.23"
16
+ "@nocobase/client": "2.1.30",
17
+ "@nocobase/server": "2.1.30",
18
+ "@nocobase/database": "2.1.30",
19
+ "@nocobase/ai": "2.1.30",
20
+ "@nocobase/actions": "2.1.30"
21
21
  };
@@ -75,7 +75,7 @@
75
75
  "Edit": "Edit",
76
76
  "Delete this profile?": "Delete this profile?",
77
77
  "Delete": "Delete",
78
- "Policy profiles control native observer, tracing retention, and memory/knowledge scopes.": "Policy profiles control native observer, tracing retention, and memory/knowledge scopes.",
78
+ "Policy profiles control native observation, memory scopes, and tracing retention.": "Policy profiles control native observation, memory scopes, and tracing retention.",
79
79
  "New Policy": "New Policy",
80
80
  "Edit Policy Profile": "Edit Policy Profile",
81
81
  "New Policy Profile": "New Policy Profile",
@@ -92,5 +92,53 @@
92
92
  "Save failed: {{message}}": "Save failed: {{message}}",
93
93
  "Policy profile deleted": "Policy profile deleted",
94
94
  "Delete failed: {{message}}": "Delete failed: {{message}}",
95
- "unknown error": "unknown error"
95
+ "unknown error": "unknown error",
96
+ "Agent Bindings": "Agent Bindings",
97
+ "Knowledge Access": "Knowledge Access",
98
+ "Retrieval Trace": "Retrieval Trace",
99
+ "Memory Inspector": "Memory Inspector",
100
+ "Policy Profile": "Policy Profile",
101
+ "Agent binding updated": "Agent binding updated",
102
+ "Agent binding created": "Agent binding created",
103
+ "Agent binding deleted": "Agent binding deleted",
104
+ "Delete this binding?": "Delete this binding?",
105
+ "Bind each leader/sub-agent pair to the profile that controls memory and tracing policy.": "Bind each leader/sub-agent pair to the profile that controls memory and tracing policy.",
106
+ "New Agent Binding": "New Agent Binding",
107
+ "Edit Agent Binding": "Edit Agent Binding",
108
+ "Leader is required": "Leader is required",
109
+ "Sub-agent is required": "Sub-agent is required",
110
+ "Policy profile is required": "Policy profile is required",
111
+ "Select leader": "Select leader",
112
+ "Select sub-agent": "Select sub-agent",
113
+ "Select policy profile": "Select policy profile",
114
+ "AI Employee": "AI Employee",
115
+ "Knowledge Base": "Knowledge Base",
116
+ "Assignment": "Assignment",
117
+ "Assigned": "Assigned",
118
+ "Not assigned": "Not assigned",
119
+ "Agent access": "Agent access",
120
+ "Allowed": "Allowed",
121
+ "Denied": "Denied",
122
+ "Reason": "Reason",
123
+ "Runtime user gate": "Runtime user gate",
124
+ "This matrix checks employee assignment and static agent policy. BASIC and SHARED user access is still evaluated when a run starts.": "This matrix checks employee assignment and static agent policy. BASIC and SHARED user access is still evaluated when a run starts.",
125
+ "Show all": "Show all",
126
+ "Show denied only": "Show denied only",
127
+ "Decision": "Decision",
128
+ "Citations": "Citations",
129
+ "Retrieval trace stores the decision, query, and safe source citations. It does not repeat raw RAG provider metadata.": "Retrieval trace stores the decision, query, and safe source citations. It does not repeat raw RAG provider metadata.",
130
+ "Retrieval detail": "Retrieval detail",
131
+ "Unknown source": "Unknown source",
132
+ "No citations were returned": "No citations were returned",
133
+ "Memory preview returned no data": "Memory preview returned no data",
134
+ "Memory preview failed": "Memory preview failed",
135
+ "Preview the exact memory context for a user and selected sub-agent before a run. Memory is marked as data, not executable instructions.": "Preview the exact memory context for a user and selected sub-agent before a run. Memory is marked as data, not executable instructions.",
136
+ "User ID": "User ID",
137
+ "User ID is required": "User ID is required",
138
+ "Build memory preview": "Build memory preview",
139
+ "Final memory context": "Final memory context",
140
+ "Character budget": "Character budget",
141
+ "Applied scopes": "Applied scopes",
142
+ "None": "None",
143
+ "No memory context matched this preview.": "No memory context matched this preview."
96
144
  }
@@ -75,7 +75,7 @@
75
75
  "Edit": "Sửa",
76
76
  "Delete this profile?": "Xóa hồ sơ này?",
77
77
  "Delete": "Xóa",
78
- "Policy profiles control native observer, tracing retention, and memory/knowledge scopes.": "Hồ sơ chính sách kiểm soát observer native, thời gian lưu trace và phạm vi memory/knowledge.",
78
+ "Policy profiles control native observation, memory scopes, and tracing retention.": "Hồ sơ chính sách kiểm soát quan sát native, phạm vi bộ nhớ và thời gian lưu trace.",
79
79
  "New Policy": "Chính sách mới",
80
80
  "Edit Policy Profile": "Sửa hồ sơ chính sách",
81
81
  "New Policy Profile": "Hồ sơ chính sách mới",
@@ -92,5 +92,53 @@
92
92
  "Save failed: {{message}}": "Lưu thất bại: {{message}}",
93
93
  "Policy profile deleted": "Đã xóa hồ sơ chính sách",
94
94
  "Delete failed: {{message}}": "Xóa thất bại: {{message}}",
95
- "unknown error": "lỗi không xác định"
95
+ "unknown error": "lỗi không xác định",
96
+ "Agent Bindings": "Liên kết Agent",
97
+ "Knowledge Access": "Quyền truy cập Knowledge Base",
98
+ "Retrieval Trace": "Dấu vết truy xuất",
99
+ "Memory Inspector": "Kiểm tra bộ nhớ",
100
+ "Policy Profile": "Hồ sơ chính sách",
101
+ "Agent binding updated": "Đã cập nhật liên kết agent",
102
+ "Agent binding created": "Đã tạo liên kết agent",
103
+ "Agent binding deleted": "Đã xóa liên kết agent",
104
+ "Delete this binding?": "Xóa liên kết này?",
105
+ "Bind each leader/sub-agent pair to the profile that controls memory and tracing policy.": "Liên kết từng cặp leader/agent con với hồ sơ kiểm soát bộ nhớ và truy vết.",
106
+ "New Agent Binding": "Liên kết agent mới",
107
+ "Edit Agent Binding": "Sửa liên kết agent",
108
+ "Leader is required": "Bắt buộc chọn leader",
109
+ "Sub-agent is required": "Bắt buộc chọn agent con",
110
+ "Policy profile is required": "Bắt buộc chọn hồ sơ chính sách",
111
+ "Select leader": "Chọn leader",
112
+ "Select sub-agent": "Chọn agent con",
113
+ "Select policy profile": "Chọn hồ sơ chính sách",
114
+ "AI Employee": "AI Employee",
115
+ "Knowledge Base": "Knowledge Base",
116
+ "Assignment": "Gán KB",
117
+ "Assigned": "Đã gán",
118
+ "Not assigned": "Chưa gán",
119
+ "Agent access": "Quyền của agent",
120
+ "Allowed": "Được phép",
121
+ "Denied": "Bị từ chối",
122
+ "Reason": "Lý do",
123
+ "Runtime user gate": "Điều kiện người dùng khi chạy",
124
+ "This matrix checks employee assignment and static agent policy. BASIC and SHARED user access is still evaluated when a run starts.": "Ma trận kiểm tra KB được gán cho nhân viên và chính sách agent tĩnh. Quyền BASIC và SHARED của người dùng vẫn được kiểm tra khi lượt chạy bắt đầu.",
125
+ "Show all": "Hiện tất cả",
126
+ "Show denied only": "Chỉ hiện bị từ chối",
127
+ "Decision": "Quyết định",
128
+ "Citations": "Nguồn trích dẫn",
129
+ "Retrieval trace stores the decision, query, and safe source citations. It does not repeat raw RAG provider metadata.": "Dấu vết truy xuất lưu quyết định, truy vấn và nguồn trích dẫn an toàn; không lặp lại metadata thô của nhà cung cấp RAG.",
130
+ "Retrieval detail": "Chi tiết truy xuất",
131
+ "Unknown source": "Nguồn không xác định",
132
+ "No citations were returned": "Không có nguồn trích dẫn được trả về",
133
+ "Memory preview returned no data": "Bản xem trước bộ nhớ không trả dữ liệu",
134
+ "Memory preview failed": "Tạo bản xem trước bộ nhớ thất bại",
135
+ "Preview the exact memory context for a user and selected sub-agent before a run. Memory is marked as data, not executable instructions.": "Xem trước đúng context bộ nhớ cho người dùng và agent con trước khi chạy. Bộ nhớ được đánh dấu là dữ liệu, không phải chỉ dẫn có thể thực thi.",
136
+ "User ID": "ID người dùng",
137
+ "User ID is required": "Bắt buộc nhập ID người dùng",
138
+ "Build memory preview": "Tạo xem trước bộ nhớ",
139
+ "Final memory context": "Context bộ nhớ cuối cùng",
140
+ "Character budget": "Ngân sách ký tự",
141
+ "Applied scopes": "Phạm vi đã áp dụng",
142
+ "None": "Không có",
143
+ "No memory context matched this preview.": "Không có context bộ nhớ phù hợp với bản xem trước này."
96
144
  }
@@ -75,7 +75,7 @@
75
75
  "Edit": "编辑",
76
76
  "Delete this profile?": "删除此配置?",
77
77
  "Delete": "删除",
78
- "Policy profiles control native observer, tracing retention, and memory/knowledge scopes.": "策略配置控制原生 observer、追踪保留时间以及记忆/知识范围。",
78
+ "Policy profiles control native observation, memory scopes, and tracing retention.": "策略配置控制原生观测、记忆范围和追踪保留时间。",
79
79
  "New Policy": "新建策略",
80
80
  "Edit Policy Profile": "编辑策略配置",
81
81
  "New Policy Profile": "新建策略配置",
@@ -92,5 +92,53 @@
92
92
  "Save failed: {{message}}": "保存失败:{{message}}",
93
93
  "Policy profile deleted": "策略配置已删除",
94
94
  "Delete failed: {{message}}": "删除失败:{{message}}",
95
- "unknown error": "未知错误"
95
+ "unknown error": "未知错误",
96
+ "Agent Bindings": "智能体绑定",
97
+ "Knowledge Access": "知识库访问",
98
+ "Retrieval Trace": "检索追踪",
99
+ "Memory Inspector": "记忆检查器",
100
+ "Policy Profile": "策略配置",
101
+ "Agent binding updated": "智能体绑定已更新",
102
+ "Agent binding created": "智能体绑定已创建",
103
+ "Agent binding deleted": "智能体绑定已删除",
104
+ "Delete this binding?": "删除此绑定?",
105
+ "Bind each leader/sub-agent pair to the profile that controls memory and tracing policy.": "将每个主控/子智能体组合绑定到控制记忆和追踪策略的配置。",
106
+ "New Agent Binding": "新建智能体绑定",
107
+ "Edit Agent Binding": "编辑智能体绑定",
108
+ "Leader is required": "必须选择主控",
109
+ "Sub-agent is required": "必须选择子智能体",
110
+ "Policy profile is required": "必须选择策略配置",
111
+ "Select leader": "选择主控",
112
+ "Select sub-agent": "选择子智能体",
113
+ "Select policy profile": "选择策略配置",
114
+ "AI Employee": "AI 员工",
115
+ "Knowledge Base": "知识库",
116
+ "Assignment": "分配",
117
+ "Assigned": "已分配",
118
+ "Not assigned": "未分配",
119
+ "Agent access": "智能体访问",
120
+ "Allowed": "允许",
121
+ "Denied": "拒绝",
122
+ "Reason": "原因",
123
+ "Runtime user gate": "运行时用户条件",
124
+ "This matrix checks employee assignment and static agent policy. BASIC and SHARED user access is still evaluated when a run starts.": "此矩阵检查员工分配和静态智能体策略。BASIC 和 SHARED 用户访问权限仍会在运行开始时检查。",
125
+ "Show all": "显示全部",
126
+ "Show denied only": "仅显示拒绝项",
127
+ "Decision": "决定",
128
+ "Citations": "引用来源",
129
+ "Retrieval trace stores the decision, query, and safe source citations. It does not repeat raw RAG provider metadata.": "检索追踪保存决定、查询和安全的来源引用,不重复保存原始 RAG 提供方元数据。",
130
+ "Retrieval detail": "检索详情",
131
+ "Unknown source": "未知来源",
132
+ "No citations were returned": "未返回引用来源",
133
+ "Memory preview returned no data": "记忆预览没有返回数据",
134
+ "Memory preview failed": "记忆预览失败",
135
+ "Preview the exact memory context for a user and selected sub-agent before a run. Memory is marked as data, not executable instructions.": "在运行前预览用户和所选子智能体的准确记忆上下文。记忆被标记为数据,而非可执行指令。",
136
+ "User ID": "用户 ID",
137
+ "User ID is required": "必须填写用户 ID",
138
+ "Build memory preview": "生成记忆预览",
139
+ "Final memory context": "最终记忆上下文",
140
+ "Character budget": "字符预算",
141
+ "Applied scopes": "已应用范围",
142
+ "None": "无",
143
+ "No memory context matched this preview.": "没有匹配此预览的记忆上下文。"
96
144
  }
@@ -41,7 +41,6 @@ const nativePolicyProfiles = [
41
41
  nativeObserverEnabled: true,
42
42
  memoryInjectionEnabled: true,
43
43
  memoryScopes: ["public", "user", "agent_user"],
44
- knowledgeScopes: ["public", "private"],
45
44
  maxMemoryContextChars: 6e3,
46
45
  tracingRetentionDays: 30
47
46
  }
@@ -54,7 +53,6 @@ const nativePolicyProfiles = [
54
53
  nativeObserverEnabled: true,
55
54
  memoryInjectionEnabled: true,
56
55
  memoryScopes: ["public", "user", "agent_user"],
57
- knowledgeScopes: ["public", "private"],
58
56
  maxMemoryContextChars: 4e3,
59
57
  tracingRetentionDays: 14
60
58
  }
@@ -67,7 +65,6 @@ const nativePolicyProfiles = [
67
65
  nativeObserverEnabled: true,
68
66
  memoryInjectionEnabled: true,
69
67
  memoryScopes: ["public", "user", "agent_user"],
70
- knowledgeScopes: ["public", "private"],
71
68
  maxMemoryContextChars: 8e3,
72
69
  tracingRetentionDays: 30,
73
70
  preferFileTools: true
@@ -0,0 +1,51 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var remove_unused_knowledge_scopes_exports = {};
28
+ __export(remove_unused_knowledge_scopes_exports, {
29
+ default: () => RemoveUnusedKnowledgeScopes
30
+ });
31
+ module.exports = __toCommonJS(remove_unused_knowledge_scopes_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class RemoveUnusedKnowledgeScopes extends import_server.Migration {
34
+ on = "afterLoad";
35
+ appVersion = ">=0.1.0";
36
+ async up() {
37
+ var _a;
38
+ const repo = this.db.getRepository("agentHarnessProfiles");
39
+ const profiles = await repo.find({});
40
+ for (const profile of profiles) {
41
+ const settings = ((_a = profile.get) == null ? void 0 : _a.call(profile, "settings")) ?? profile.settings;
42
+ if (!settings || typeof settings !== "object" || Array.isArray(settings) || !("knowledgeScopes" in settings)) {
43
+ continue;
44
+ }
45
+ const { knowledgeScopes: _unused, ...nextSettings } = settings;
46
+ await profile.update({ settings: nextSettings, updatedAt: /* @__PURE__ */ new Date() });
47
+ }
48
+ }
49
+ async down() {
50
+ }
51
+ }
@@ -46,6 +46,7 @@ var import_external_rag_search = require("./tools/external-rag-search");
46
46
  var import_tracing = require("./resources/tracing");
47
47
  var import_agent_monitor = require("./resources/agent-monitor");
48
48
  var import_agent_loop = require("./resources/agent-loop");
49
+ var import_agent_knowledge_insights = require("./resources/agent-knowledge-insights");
49
50
  var import_plugin = __toESM(require("./skill-hub/plugin"));
50
51
  var import_NativeSubAgentObserver = require("./services/NativeSubAgentObserver");
51
52
  var import_AgentLoopService = require("./services/AgentLoopService");
@@ -185,6 +186,7 @@ class PluginAgentOrchestratorServer extends import_server.Plugin {
185
186
  "orchestratorConfig:*",
186
187
  "orchestratorTracing:*",
187
188
  "agentMonitor:*",
189
+ "agentKnowledgeInsights:*",
188
190
  "agentMemoryContexts:*",
189
191
  "agentLoopRuns:*",
190
192
  "agentLoopSteps:*",
@@ -263,13 +265,20 @@ class PluginAgentOrchestratorServer extends import_server.Plugin {
263
265
  const runtimeContext = (_b2 = ctx.state) == null ? void 0 : _b2.agentRuntimeContext;
264
266
  try {
265
267
  await next();
266
- } finally {
267
268
  if (runtimeContext) {
268
269
  await this.agentRuntimeLifecycle.runAfterHooks(runtimeContext, {
269
270
  succeeded: ctx.status < 400,
270
271
  value: ctx.body
271
272
  });
272
273
  }
274
+ } catch (error) {
275
+ if (runtimeContext) {
276
+ await this.agentRuntimeLifecycle.runAfterHooks(runtimeContext, {
277
+ succeeded: false,
278
+ error: error instanceof Error ? error : new Error(String(error))
279
+ });
280
+ }
281
+ throw error;
273
282
  }
274
283
  },
275
284
  { tag: "orchestrator-planning-prompt", after: "acl" }
@@ -280,6 +289,7 @@ class PluginAgentOrchestratorServer extends import_server.Plugin {
280
289
  toolsManager.registerTools((0, import_agent_loop2.createAgentLoopTools)(this, agentLoopService));
281
290
  (0, import_agent_loop.registerAgentLoopResource)(this, agentLoopService);
282
291
  (0, import_agent_monitor.registerAgentMonitorResource)(this);
292
+ (0, import_agent_knowledge_insights.registerAgentKnowledgeInsightsResource)(this);
283
293
  this.installNativeObserver();
284
294
  (_b = (_a = this.app).on) == null ? void 0 : _b.call(_a, "afterStart", this.installNativeObserver);
285
295
  (_d = (_c = this.app).on) == null ? void 0 : _d.call(_c, "afterStart", this.recoverAfterCrash);