@nocobase/plugin-ai 2.1.0-beta.17 → 2.1.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/ai-employees/atlas/prompt.md +28 -22
- package/dist/ai/ai-employees/viz.js +14 -88
- package/dist/ai/skills/business-analysis-report/SKILLS.md +8 -3
- package/dist/ai/skills/business-analysis-report/tools/businessReportGenerator.js +49 -8
- package/dist/client/280.003b9e9788599244.js +10 -0
- package/dist/client/{646.51313bb0d85d6366.js → 646.cba98d80e9e6ea74.js} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/common/recommended-models.js +1 -25
- package/dist/externalVersion.js +14 -14
- package/dist/locale/en-US.json +9 -0
- package/dist/locale/zh-CN.json +9 -0
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/bin/cli.js +179 -0
- package/dist/node_modules/jsonrepair/lib/cjs/index.js +1 -0
- package/dist/node_modules/jsonrepair/lib/cjs/package.json +3 -0
- package/dist/node_modules/jsonrepair/lib/cjs/regular/jsonrepair.js +746 -0
- package/dist/node_modules/jsonrepair/lib/cjs/stream.js +13 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/buffer/InputBuffer.js +75 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/buffer/OutputBuffer.js +117 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/core.js +824 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/stack.js +51 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/stream.js +37 -0
- package/dist/node_modules/jsonrepair/lib/cjs/utils/JSONRepairError.js +14 -0
- package/dist/node_modules/jsonrepair/lib/cjs/utils/stringUtils.js +174 -0
- package/dist/node_modules/jsonrepair/lib/esm/index.js +4 -0
- package/dist/node_modules/jsonrepair/lib/esm/regular/jsonrepair.js +740 -0
- package/dist/node_modules/jsonrepair/lib/esm/stream.js +3 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/buffer/InputBuffer.js +69 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/buffer/OutputBuffer.js +111 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/core.js +818 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/stack.js +44 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/stream.js +31 -0
- package/dist/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js +7 -0
- package/dist/node_modules/jsonrepair/lib/esm/utils/stringUtils.js +147 -0
- package/dist/node_modules/jsonrepair/lib/types/index.d.ts +3 -0
- package/dist/node_modules/jsonrepair/lib/types/regular/jsonrepair.d.ts +18 -0
- package/dist/node_modules/jsonrepair/lib/types/stream.d.ts +2 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/buffer/InputBuffer.d.ts +14 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/buffer/OutputBuffer.d.ts +18 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/core.d.ts +11 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/stack.d.ts +20 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/stream.d.ts +7 -0
- package/dist/node_modules/jsonrepair/lib/types/utils/JSONRepairError.d.ts +5 -0
- package/dist/node_modules/jsonrepair/lib/types/utils/stringUtils.d.ts +65 -0
- package/dist/node_modules/jsonrepair/lib/umd/jsonrepair.js +903 -0
- package/dist/node_modules/jsonrepair/lib/umd/jsonrepair.min.js +3 -0
- package/dist/node_modules/jsonrepair/lib/umd/package.json +3 -0
- package/dist/node_modules/jsonrepair/package.json +1 -0
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/resource/aiEmployees.js +15 -1
- package/dist/server/resource/aiSkills.js +1 -1
- package/package.json +2 -2
- package/dist/client/280.029428b83d62155f.js +0 -10
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
((t,n)=>{"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).JSONRepair={})})(this,function(t){class x extends Error{constructor(t,n){super(t+" at position "+n),this.position=n}}let r=32,e=10,i=9,f=13,a=160,h=8192,y=8202,O=8239,N=8287,J=12288;function S(t){return"0"<=t&&t<="9"}function j(t){return",:[]/{}()\n+".includes(t)}function k(t){return"a"<=t&&t<="z"||"A"<=t&&t<="Z"||"_"===t||"$"===t}function C(t){return"a"<=t&&t<="z"||"A"<=t&&t<="Z"||"_"===t||"$"===t||"0"<=t&&t<="9"}let m=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,z=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function E(t){return",[]/{}\n+".includes(t)}function I(t){return _(t)||n.test(t)}let n=/^[[{\w-]$/;function T(t,n){t=t.charCodeAt(n);return t===r||t===e||t===i||t===f}function Z(t,n){t=t.charCodeAt(n);return t===r||t===i||t===f}function _(t){return F(t)||U(t)}function F(t){return'"'===t||"“"===t||"”"===t}function R(t){return'"'===t}function U(t){return"'"===t||"‘"===t||"’"===t||"`"===t||"´"===t}function q(t){return"'"===t}function B(t,n,r){r=2<arguments.length&&void 0!==r&&r,n=t.lastIndexOf(n);return-1!==n?t.substring(0,n)+(r?"":t.substring(n+1)):t}function D(t,n){let r=t.length;if(!T(t,r-1))return t+n;for(;T(t,r-1);)r--;return t.substring(0,r)+n+t.substring(r)}let G={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},H={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};t.JSONRepairError=x,t.jsonrepair=function(g){let d=0,v="";if(n(["```","[```","{```"]),!f())throw new x("Unexpected end of json string",g.length);n(["```","```]","```}"]);var t=u(",");if(t&&b(),I(g[d])&&/[,\n][ \t\r]*$/.test(v)){t||(v=D(v,","));{let t=!0,n=!0;for(;n;)t?t=!1:u(",")||(v=D(v,",")),n=f();v=`[
|
|
2
|
+
${v=n?v:B(v,",")}
|
|
3
|
+
]`}}else t&&(v=B(v,","));for(;"}"===g[d]||"]"===g[d];)d++,b();if(d>=g.length)return v;throw new x("Unexpected character "+JSON.stringify(g[d]),d);function f(){b();var t=(()=>{if("{"!==g[d])return!1;{v+="{",d++,b(),p(",")&&b();let n=!0;for(;d<g.length&&"}"!==g[d];){let t;if(n?(t=!0,n=!1):((t=u(","))||(v=D(v,",")),b()),o(),!(w()||l(!0))){"}"===g[d]||"{"===g[d]||"]"===g[d]||"["===g[d]||void 0===g[d]?v=B(v,","):(()=>{throw new x("Object key expected",d)})();break}b();var r=u(":"),e=d>=g.length,i=(r||(I(g[d])||e?v=D(v,":"):c()),f());i||(r||e?v+="null":c())}return"}"===g[d]?(v+="}",d++):v=D(v,"}"),!0}})()||(()=>{if("["!==g[d])return!1;{v+="[",d++,b(),p(",")&&b();let t=!0;for(;d<g.length&&"]"!==g[d];){t?t=!1:u(",")||(v=D(v,",")),o();var n=f();if(!n){v=B(v,",");break}}return"]"===g[d]?(v+="]",d++):v=D(v,"]"),!0}})()||w()||(()=>{var t,n,r=d;if("-"===g[d]){if(d++,i())return s(r),!0;if(!S(g[d]))return d=r,!1}for(;S(g[d]);)d++;if("."===g[d]){if(d++,i())return s(r),!0;if(!S(g[d]))return d=r,!1;for(;S(g[d]);)d++}if("e"===g[d]||"E"===g[d]){if(d++,"-"!==g[d]&&"+"!==g[d]||d++,i())return s(r),!0;if(!S(g[d]))return d=r,!1;for(;S(g[d]);)d++}if(i()){if(d>r)return t=g.slice(r,d),n=/^0\d/.test(t),v+=n?`"${t}"`:t,!0}else d=r;return!1})()||r("true","true")||r("false","false")||r("null","null")||r("True","true")||r("False","false")||r("None","null")||l(!1)||(()=>{if("/"===g[d]){var t=d;for(d++;d<g.length&&("/"!==g[d]||"\\"===g[d-1]);)d++;return d++,v+=`"${g.substring(t,d)}"`,!0}})();return b(),t}function b(t){var n=!(0<arguments.length&&void 0!==t)||t;d;let r=e(n);for(;r=(r=(()=>{if("/"===g[d]&&"*"===g[d+1]){for(;d<g.length&&!((t,n)=>"*"===t[n]&&"/"===t[n+1])(g,d);)d++;d+=2}else{if("/"!==g[d]||"/"!==g[d+1])return!1;for(;d<g.length&&"\n"!==g[d];)d++}return!0})())&&e(n););d}function e(t){var n,r,e=t?T:Z;let i="";for(;;){if(e(g,d))i+=g[d];else{if(n=g,r=d,!((n=n.charCodeAt(r))===a||n>=h&&n<=y||n===O||n===N||n===J))break;i+=" "}d++}return 0<i.length&&(v+=i,!0)}function n(t){if((t=>{e(!0);for(var n of t){var r=d+n.length;if(g.slice(d,r)===n)return d=r,1}})(t)){if(k(g[d]))for(;d<g.length&&C(g[d]);)d++;b()}}function u(t){return g[d]===t&&(v+=g[d],d++,!0)}function p(t){return g[d]===t&&(d++,!0)}function o(){b(),"."===g[d]&&"."===g[d+1]&&"."===g[d+2]&&(d+=3,b(),p(","))}function w(t,n){var r=0<arguments.length&&void 0!==t&&t,e=1<arguments.length&&void 0!==n?n:-1;let i="\\"===g[d];if(i&&(d++,i=!0),_(g[d])){var f=R(g[d])?R:q(g[d])?q:U(g[d])?U:F,u=d,o=v.length;let n='"';for(d++;;){if(d>=g.length)return l=A(d-1),!r&&j(g.charAt(l))?(d=u,v=v.substring(0,o),w(!0)):(n=D(n,'"'),v+=n,!0);if(d===e)return n=D(n,'"'),v+=n,!0;if(f(g[d])){var l=d,s=n.length;if(n+='"',d++,v+=n,b(!1),r||d>=g.length||j(g[d])||_(g[d])||S(g[d]))return $(),!0;var c=A(l-1),a=g.charAt(c);if(","===a)return d=u,v=v.substring(0,o),w(!1,c);if(j(a))return d=u,v=v.substring(0,o),w(!0);v=v.substring(0,o),d=l+1,n=n.substring(0,s)+"\\"+n.substring(s)}else{if(r&&E(g[d])){if(":"===g[d-1]&&m.test(g.substring(u+1,d+2)))for(;d<g.length&&z.test(g[d]);)n+=g[d],d++;return n=D(n,'"'),v+=n,$(),!0}if("\\"===g[d]){c=g.charAt(d+1);if(void 0!==H[c])n+=g.slice(d,d+2),d+=2;else if("u"===c){let t=2;for(;t<6&&/^[0-9A-Fa-f]$/.test(g[d+t]);)t++;if(6===t)n+=g.slice(d,d+6),d+=6;else{if(!(d+t>=g.length))throw a=void 0,a=g.slice(d,d+6),new x(`Invalid unicode character "${a}"`,d);d=g.length}}else n+=c,d+=2}else{var h,s=g.charAt(d);if('"'===s&&"\\"!==g[d-1])n+="\\"+s;else if("\n"===(h=s)||"\r"===h||"\t"===h||"\b"===h||"\f"===h)n+=G[s];else{if(!(" "<=s))throw h=void 0,h=s,new x("Invalid character "+JSON.stringify(h),d);n+=s}d++}}i&&p("\\")}}return!1}function $(){let t=!1;for(b();"+"===g[d];){t=!0,d++,b();var n=(v=B(v,'"',!0)).length,r=w();v=r?(r=v,n=n,e=1,r.substring(0,n)+r.substring(n+e)):D(v,'"')}var e;t}function r(t,n){return g.slice(d,d+t.length)===t&&(v+=n,d+=t.length,!0)}function l(t){var n=d;if(k(g[d])){for(;d<g.length&&C(g[d]);)d++;let t=d;for(;T(g,t);)t++;if("("===g[t])return d=t+1,f(),")"===g[d]&&(d++,";"===g[d])&&d++,!0}for(;d<g.length&&!E(g[d])&&!_(g[d])&&(!t||":"!==g[d]);)d++;if(":"===g[d-1]&&m.test(g.substring(n,d+2)))for(;d<g.length&&z.test(g[d]);)d++;if(d>n){for(;T(g,d-1)&&0<d;)d--;n=g.slice(n,d);return v+="undefined"===n?"null":JSON.stringify(n),'"'===g[d]&&d++,!0}}function A(t){let n=t;for(;0<n&&T(g,n);)n--;return n}function i(){return d>=g.length||j(g[d])||T(g,d)}function s(t){v+=g.slice(t,d)+"0"}function c(){throw new x("Colon expected",d)}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"jsonrepair","version":"3.13.1","description":"Repair broken JSON documents","repository":{"type":"git","url":"https://github.com/josdejong/jsonrepair.git"},"type":"module","main":"lib/cjs/index.js","module":"lib/esm/index.js","browser":"lib/umd/jsonrepair.min.js","types":"lib/types/index.d.ts","sideEffects":false,"exports":{".":{"import":"./lib/esm/index.js","require":"./lib/cjs/index.js","types":"./lib/types/index.d.ts"},"./stream":{"import":"./lib/esm/stream.js","require":"./lib/cjs/stream.js","types":"./lib/types/stream.d.ts"}},"keywords":["simple","json","repair","fix","invalid","stream","streaming"],"bin":{"jsonrepair":"./bin/cli.js"},"scripts":{"test":"vitest watch src","test:it":"vitest run src","build":"npm-run-all build:**","build:clean":"del-cli lib","build:esm":"babel src --out-dir lib/esm --extensions \".ts\" --source-maps --config-file ./babel.config.json","build:cjs":"babel src --out-dir lib/cjs --extensions \".ts\" --source-maps --config-file ./babel-cjs.config.json && cpy tools/cjs lib/cjs --flat","build:umd":"rollup lib/esm/index.js --format umd --name JSONRepair --sourcemap --output.file lib/umd/jsonrepair.js && cpy tools/cjs/package.json lib/umd --flat","build:umd:min":"uglifyjs --compress --mangle --source-map --comments --output lib/umd/jsonrepair.min.js -- lib/umd/jsonrepair.js","build:types":"tsc --project tsconfig-types.json","build:validate":"vitest run test-lib","lint":"biome check","format":"biome check --write","benchmark":"npm run build:esm && node tools/benchmark/run.mjs","build-and-test":"npm run lint && npm run test:it && npm run build","release":"npm-run-all release:**","release:build-and-test":"npm run build-and-test","release:version":"standard-version","release:push":"git push && git push --tag","release:publish":"npm publish","release-dry-run":"npm run build-and-test && standard-version --dry-run","prepare":"husky"},"files":["README.md","LICENSE.md","lib"],"author":"Jos de Jong","license":"ISC","devDependencies":{"@babel/cli":"7.28.3","@babel/core":"7.28.4","@babel/plugin-transform-typescript":"7.28.0","@babel/preset-env":"7.28.3","@babel/preset-typescript":"7.27.1","@biomejs/biome":"2.2.4","@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@types/node":"24.5.2","cpy-cli":"6.0.0","del-cli":"7.0.0","husky":"9.1.7","npm-run-all":"4.1.5","rollup":"4.51.0","standard-version":"9.5.0","tinybench":"5.0.1","ts-node":"10.9.2","typescript":"5.9.2","uglify-js":"3.19.3","vitest":"3.2.4"},"_lastModified":"2026-04-26T10:50:10.179Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-
|
|
1
|
+
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-26T10:50:06.542Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"openai","version":"6.22.0","description":"The official TypeScript library for the OpenAI API","author":"OpenAI <support@openai.com>","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:openai/openai-node","license":"Apache-2.0","packageManager":"yarn@1.22.22","files":["**/*"],"private":false,"publishConfig":{"access":"public"},"scripts":{"test":"./scripts/test","build":"./scripts/build","format":"./scripts/format","tsn":"ts-node -r tsconfig-paths/register","lint":"./scripts/lint","fix":"./scripts/format"},"dependencies":{},"bin":{"openai":"bin/cli"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./_vendor/*.mjs":{"default":"./_vendor/*.mjs"},"./_vendor/*.js":{"default":"./_vendor/*.js"},"./_vendor/*":{"import":"./_vendor/*.mjs","require":"./_vendor/*.js"},"./api-promise":{"import":"./api-promise.mjs","require":"./api-promise.js"},"./api-promise.js":{"default":"./api-promise.js"},"./api-promise.mjs":{"default":"./api-promise.mjs"},"./azure":{"import":"./azure.mjs","require":"./azure.js"},"./azure.js":{"default":"./azure.js"},"./azure.mjs":{"default":"./azure.mjs"},"./beta/*.mjs":{"default":"./beta/*.mjs"},"./beta/*.js":{"default":"./beta/*.js"},"./beta/*":{"import":"./beta/*.mjs","require":"./beta/*.js"},"./client":{"import":"./client.mjs","require":"./client.js"},"./client.js":{"default":"./client.js"},"./client.mjs":{"default":"./client.mjs"},"./core/*.mjs":{"default":"./core/*.mjs"},"./core/*.js":{"default":"./core/*.js"},"./core/*":{"import":"./core/*.mjs","require":"./core/*.js"},"./error":{"import":"./error.mjs","require":"./error.js"},"./error.js":{"default":"./error.js"},"./error.mjs":{"default":"./error.mjs"},"./helpers/*.mjs":{"default":"./helpers/*.mjs"},"./helpers/*.js":{"default":"./helpers/*.js"},"./helpers/*":{"import":"./helpers/*.mjs","require":"./helpers/*.js"},"./index":{"import":"./index.mjs","require":"./index.js"},"./index.js":{"default":"./index.js"},"./index.mjs":{"default":"./index.mjs"},"./lib/*.mjs":{"default":"./lib/*.mjs"},"./lib/*.js":{"default":"./lib/*.js"},"./lib/*":{"import":"./lib/*.mjs","require":"./lib/*.js"},"./pagination":{"import":"./pagination.mjs","require":"./pagination.js"},"./pagination.js":{"default":"./pagination.js"},"./pagination.mjs":{"default":"./pagination.mjs"},"./realtime/*.mjs":{"default":"./realtime/*.mjs"},"./realtime/*.js":{"default":"./realtime/*.js"},"./realtime/*":{"import":"./realtime/*.mjs","require":"./realtime/*.js"},"./resource":{"import":"./resource.mjs","require":"./resource.js"},"./resource.js":{"default":"./resource.js"},"./resource.mjs":{"default":"./resource.mjs"},"./resources/*.mjs":{"default":"./resources/*.mjs"},"./resources/*.js":{"default":"./resources/*.js"},"./resources/*":{"import":"./resources/*.mjs","require":"./resources/*.js"},"./resources":{"import":"./resources.mjs","require":"./resources.js"},"./resources.js":{"default":"./resources.js"},"./resources.mjs":{"default":"./resources.mjs"},"./streaming":{"import":"./streaming.mjs","require":"./streaming.js"},"./streaming.js":{"default":"./streaming.js"},"./streaming.mjs":{"default":"./streaming.mjs"},"./uploads":{"import":"./uploads.mjs","require":"./uploads.js"},"./uploads.js":{"default":"./uploads.js"},"./uploads.mjs":{"default":"./uploads.mjs"},"./version":{"import":"./version.mjs","require":"./version.js"},"./version.js":{"default":"./version.js"},"./version.mjs":{"default":"./version.mjs"}},"peerDependencies":{"ws":"^8.18.0","zod":"^3.25 || ^4.0"},"peerDependenciesMeta":{"ws":{"optional":true},"zod":{"optional":true}},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"openai","version":"6.22.0","description":"The official TypeScript library for the OpenAI API","author":"OpenAI <support@openai.com>","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:openai/openai-node","license":"Apache-2.0","packageManager":"yarn@1.22.22","files":["**/*"],"private":false,"publishConfig":{"access":"public"},"scripts":{"test":"./scripts/test","build":"./scripts/build","format":"./scripts/format","tsn":"ts-node -r tsconfig-paths/register","lint":"./scripts/lint","fix":"./scripts/format"},"dependencies":{},"bin":{"openai":"bin/cli"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./_vendor/*.mjs":{"default":"./_vendor/*.mjs"},"./_vendor/*.js":{"default":"./_vendor/*.js"},"./_vendor/*":{"import":"./_vendor/*.mjs","require":"./_vendor/*.js"},"./api-promise":{"import":"./api-promise.mjs","require":"./api-promise.js"},"./api-promise.js":{"default":"./api-promise.js"},"./api-promise.mjs":{"default":"./api-promise.mjs"},"./azure":{"import":"./azure.mjs","require":"./azure.js"},"./azure.js":{"default":"./azure.js"},"./azure.mjs":{"default":"./azure.mjs"},"./beta/*.mjs":{"default":"./beta/*.mjs"},"./beta/*.js":{"default":"./beta/*.js"},"./beta/*":{"import":"./beta/*.mjs","require":"./beta/*.js"},"./client":{"import":"./client.mjs","require":"./client.js"},"./client.js":{"default":"./client.js"},"./client.mjs":{"default":"./client.mjs"},"./core/*.mjs":{"default":"./core/*.mjs"},"./core/*.js":{"default":"./core/*.js"},"./core/*":{"import":"./core/*.mjs","require":"./core/*.js"},"./error":{"import":"./error.mjs","require":"./error.js"},"./error.js":{"default":"./error.js"},"./error.mjs":{"default":"./error.mjs"},"./helpers/*.mjs":{"default":"./helpers/*.mjs"},"./helpers/*.js":{"default":"./helpers/*.js"},"./helpers/*":{"import":"./helpers/*.mjs","require":"./helpers/*.js"},"./index":{"import":"./index.mjs","require":"./index.js"},"./index.js":{"default":"./index.js"},"./index.mjs":{"default":"./index.mjs"},"./lib/*.mjs":{"default":"./lib/*.mjs"},"./lib/*.js":{"default":"./lib/*.js"},"./lib/*":{"import":"./lib/*.mjs","require":"./lib/*.js"},"./pagination":{"import":"./pagination.mjs","require":"./pagination.js"},"./pagination.js":{"default":"./pagination.js"},"./pagination.mjs":{"default":"./pagination.mjs"},"./realtime/*.mjs":{"default":"./realtime/*.mjs"},"./realtime/*.js":{"default":"./realtime/*.js"},"./realtime/*":{"import":"./realtime/*.mjs","require":"./realtime/*.js"},"./resource":{"import":"./resource.mjs","require":"./resource.js"},"./resource.js":{"default":"./resource.js"},"./resource.mjs":{"default":"./resource.mjs"},"./resources/*.mjs":{"default":"./resources/*.mjs"},"./resources/*.js":{"default":"./resources/*.js"},"./resources/*":{"import":"./resources/*.mjs","require":"./resources/*.js"},"./resources":{"import":"./resources.mjs","require":"./resources.js"},"./resources.js":{"default":"./resources.js"},"./resources.mjs":{"default":"./resources.mjs"},"./streaming":{"import":"./streaming.mjs","require":"./streaming.js"},"./streaming.js":{"default":"./streaming.js"},"./streaming.mjs":{"default":"./streaming.mjs"},"./uploads":{"import":"./uploads.mjs","require":"./uploads.js"},"./uploads.js":{"default":"./uploads.js"},"./uploads.mjs":{"default":"./uploads.mjs"},"./version":{"import":"./version.mjs","require":"./version.js"},"./version.js":{"default":"./version.js"},"./version.mjs":{"default":"./version.mjs"}},"peerDependencies":{"ws":"^8.18.0","zod":"^3.25 || ^4.0"},"peerDependenciesMeta":{"ws":{"optional":true},"zod":{"optional":true}},"_lastModified":"2026-04-26T10:50:08.966Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-26T10:50:07.480Z"}
|
|
@@ -44,6 +44,7 @@ __export(aiEmployees_exports, {
|
|
|
44
44
|
module.exports = __toCommonJS(aiEmployees_exports);
|
|
45
45
|
var import_actions = __toESM(require("@nocobase/actions"));
|
|
46
46
|
var templates = __toESM(require("../ai-employees/templates"));
|
|
47
|
+
var import_lodash = __toESM(require("lodash"));
|
|
47
48
|
const list = async (ctx, next) => {
|
|
48
49
|
const { paginate } = ctx.action.params || {};
|
|
49
50
|
const plugin = ctx.app.pm.get("ai");
|
|
@@ -63,6 +64,7 @@ const list = async (ctx, next) => {
|
|
|
63
64
|
};
|
|
64
65
|
const listByUser = async (ctx, next) => {
|
|
65
66
|
const plugin = ctx.app.pm.get("ai");
|
|
67
|
+
const skills = await plugin.ai.skillsManager.listSkills({ scope: "GENERAL" });
|
|
66
68
|
const tools = await plugin.ai.toolsManager.listTools({ scope: "GENERAL" });
|
|
67
69
|
const user = ctx.auth.user;
|
|
68
70
|
const model = ctx.db.getModel("aiEmployees");
|
|
@@ -114,13 +116,25 @@ const listByUser = async (ctx, next) => {
|
|
|
114
116
|
});
|
|
115
117
|
ctx.body = rows.map((row) => {
|
|
116
118
|
var _a, _b;
|
|
117
|
-
const skillSettings = row.skillSettings ?? {
|
|
119
|
+
const skillSettings = row.skillSettings ?? {
|
|
120
|
+
skills: [],
|
|
121
|
+
tools: []
|
|
122
|
+
};
|
|
123
|
+
if (!import_lodash.default.isArray(skillSettings.skills)) {
|
|
124
|
+
skillSettings.skills = [];
|
|
125
|
+
}
|
|
126
|
+
if (!import_lodash.default.isArray(skillSettings.tools)) {
|
|
127
|
+
skillSettings.tools = [];
|
|
128
|
+
}
|
|
118
129
|
for (const tool of tools) {
|
|
119
130
|
skillSettings.tools.push({
|
|
120
131
|
name: tool.definition.name,
|
|
121
132
|
autoCall: tool.defaultPermission === "ALLOW"
|
|
122
133
|
});
|
|
123
134
|
}
|
|
135
|
+
for (const { name } of skills) {
|
|
136
|
+
skillSettings.skills.push(name);
|
|
137
|
+
}
|
|
124
138
|
return {
|
|
125
139
|
username: row.username,
|
|
126
140
|
nickname: row.nickname,
|
|
@@ -51,7 +51,7 @@ const aiSkills = {
|
|
|
51
51
|
if (!aiEmployee) {
|
|
52
52
|
return [];
|
|
53
53
|
}
|
|
54
|
-
const bindingSkillNames = ((_b = (_a = aiEmployee.skillSettings) == null ? void 0 : _a.skills) == null ? void 0 : _b.map((
|
|
54
|
+
const bindingSkillNames = ((_b = (_a = aiEmployee.skillSettings) == null ? void 0 : _a.skills) == null ? void 0 : _b.map((name) => name)) ?? [];
|
|
55
55
|
const plugin = ctx.app.pm.get("ai");
|
|
56
56
|
const skills = await plugin.ai.skillsManager.listSkills();
|
|
57
57
|
const result = skills.filter((tool) => tool.scope === "GENERAL" || bindingSkillNames.includes(tool.name));
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Create AI employees with diverse skills to collaborate with humans, build systems, and handle business operations.",
|
|
7
7
|
"description.ru-RU": "Поддержка интеграции с AI-сервисами: предоставляются AI-узлы для рабочих процессов, расширяя возможности бизнес-обработки.",
|
|
8
8
|
"description.zh-CN": "创建各种技能的 AI 员工,与人类协同,搭建系统,处理业务。",
|
|
9
|
-
"version": "2.1.0-beta.
|
|
9
|
+
"version": "2.1.0-beta.19",
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"homepage": "https://docs.nocobase.com/handbook/action-ai",
|
|
12
12
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/action-ai",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"keywords": [
|
|
62
62
|
"AI"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "d89ab08dbcb25877de69827d5bad6823c27b2cbb"
|
|
65
65
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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.webpackChunk_nocobase_plugin_ai=self.webpackChunk_nocobase_plugin_ai||[]).push([["280"],{779:function(e,t,r){r.d(t,{MT:function(){return N},UV:function(){return j},Y_:function(){return A},cZ:function(){return S},e4:function(){return k},wP:function(){return O}});var n=r(9155),o=r.n(n),a=r(3342),i=r(9557),c=r(9597),s=r(7916),l=r(1210),u=r(9256),d=r(1465),p=r(5897),f=r(3079);function h(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 m(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){r(e);return}c.done?t(s):Promise.resolve(s).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){m(a,n,o,i,c,"next",e)}function c(e){m(a,n,o,i,c,"throw",e)}i(void 0)})}}function y(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}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function v(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function w(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:s(0)}),c(i,"throw",{value:s(1)}),c(i,"return",{value:s(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function s(c){return function(s){var l=[c,s];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function x(e){return!!e&&(void 0===e?"undefined":v(e))==="object"&&"object"===v(e.options)}function S(e){return e?g(y({},e),{markdown:e.markdown,charts:function(e){if(Array.isArray(e))return e.filter(x);if("string"!=typeof e)return[];var t=e.trim();if(!t)return[];try{var r=JSON.parse(t);return Array.isArray(r)?r.filter(x):[]}catch(e){return[]}}(e.charts)}):{}}function k(e){var t=S(e);return(t.fileName||t.title||"business-analysis-report").replace(/[\\/:*?"<>|]+/g,"-").trim()}function O(e,t){var r,n,o,i=S(e),c=["# ".concat(i.title)],s=function(e,t){var r=function(e){if(null==e||""===e)return null;if(null!=(t=Date)&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t)return Number.isNaN(e.getTime())?null:e;if("number"==typeof e)return U(e);var t,r=e.trim();if(!r)return null;if(/^\d+$/.test(r))return U(Number(r));var n=new Date(r);return Number.isNaN(n.getTime())?null:n}(e);if(!r)return null;var n=M(t)||"en-US";try{return new Intl.DateTimeFormat(n,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(r)}catch(e){return console.error("Failed to format business report generatedAt:",e),r.toLocaleString()}}(i.generatedAt,null==t?void 0:t.locale);return s&&c.push("_".concat(a.i18n.t("Generated at",{ns:[f.MF,"client"],nsMode:"fallback"}),": ").concat(s,"_")),i.summary&&c.push("> ".concat(i.summary)),(null==(o=i.markdown)?void 0:o.trim())&&c.push((r=i.markdown.trim(),n=i.charts||[],r&&n.length?r.replace(/\{\{\s*chart\s*:\s*(\d+)\s*\}\}/gi,function(e,t){var r,o,a,i=Number(t)-1,c=n[i];return c?(r=c,o=i,a=["## ".concat(r.title||"Chart ".concat(o+1))],r.summary&&a.push(r.summary),a.push("<echarts>".concat(JSON.stringify(r.options,null,2),"</echarts>")),a.join("\n\n")):e}):r)),(function(e,t){if(!t.length)return[];for(var r,n=new Set,o=/\{\{\s*chart\s*:\s*(\d+)\s*\}\}/gi,a=e||"";r=o.exec(a);){var i=Number(r[1])-1;i>=0&&i<t.length&&n.add(i)}return t.filter(function(e,t){return!n.has(t)})})(i.markdown,i.charts||[]).forEach(function(e,t){c.push("## ".concat(e.title||"Chart ".concat(t+1))),e.summary&&c.push(e.summary),c.push("<echarts>".concat(JSON.stringify(e.options,null,2),"</echarts>"))}),c.filter(Boolean).join("\n\n")}function j(e,t){return b(function(){var r,n,a,f,m,x,S,k,j,N,A,U;return w(this,function(C){var I,L,R,E,T,D,H,_,z,J;switch(C.label){case 0:return I=O(e,{locale:null==t?void 0:t.locale}),L=[],R=0,n=(r={body:(0,p.renderToStaticMarkup)(o().createElement(c.oz,{components:{echarts:function(e){var t=e.children,r=Array.isArray(t)?t.join(""):String(null!=t?t:""),n="report-chart-".concat(R++),a=function(e){try{var t=JSON.parse(e);if(t&&(void 0===t?"undefined":v(t))==="object")return t}catch(e){console.error("Failed to parse business report chart options:",e)}return null}(r);return a&&L.push({id:n,options:a}),o().createElement("div",{id:n,className:"report-chart"})}},rehypePlugins:[l.A,[u.A,g(y({},d.j),{tagNames:((function(e){if(Array.isArray(e))return h(e)})(E=d.j.tagNames)||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 h(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 h(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.")}()).concat(["echarts"])})]],remarkPlugins:[s.A]},I)),charts:L}).body,a=r.charts,f=(null==t?void 0:t.printMode)===!0,x=(D=m=(T=M(null==t?void 0:t.locale))||"en-US").startsWith("zh")?'"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':D.startsWith("ja")?'"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Source Han Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':D.startsWith("ko")?'"Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Source Han Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':'"Inter", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", -apple-system, BlinkMacSystemFont, sans-serif',S=f?"#ffffff":"#f5f7fb",k=f?"max-width: 190mm; margin: 0 auto; padding: 0;":"max-width: 960px; margin: 0 auto; padding: 32px 24px 64px;",j=f?"background: #fff; border: 0; border-radius: 0; padding: 0; box-shadow: none; width: 100%;":"background: #fff; border: 1px solid #d0d5dd; border-radius: 20px; padding: 40px 48px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);",[4,(H=a,_={chartHeight:N=f?320:360,fontFamily:x,printMode:f},b(function(){var e,t,r,n,o,a,c,s,l,u,d,p;return w(this,function(f){var h,m,b;switch(f.label){case 0:if("u"<typeof document||!H.length)return[2,new Map];e=new Map,(t=document.createElement("div")).style.position="fixed",t.style.left="-100000px",t.style.top="0",t.style.width="".concat(_.printMode?718:960,"px"),t.style.pointerEvents="none",t.style.opacity="0",t.style.zIndex="-1",document.body.appendChild(t),f.label=1;case 1:f.trys.push([1,,15,16]),r=!0,n=!1,o=void 0,f.label=2;case 2:f.trys.push([2,12,13,14]),a=H[Symbol.iterator](),f.label=3;case 3:if(r=(c=a.next()).done)return[3,11];s=c.value,(l=document.createElement("div")).style.width=t.style.width,l.style.height="".concat(_.chartHeight,"px"),t.appendChild(l),f.label=4;case 4:return f.trys.push([4,8,9,10]),(d=i.init(l,"default",{renderer:"canvas"})).setOption(g(y({},(m=g(y({},h=s.options),{animation:!1,toolbox:{show:!1}}),h.grid&&(m.grid=Array.isArray(h.grid)?h.grid.map(function(e){return y({containLabel:!0},e)}):y({containLabel:!0},h.grid)),m)),{textStyle:g(y({},(null==(u=s.options)?void 0:u.textStyle)||{}),{fontFamily:_.fontFamily})}),!0),d.resize({width:l.clientWidth||parseInt(t.style.width,10),height:_.chartHeight,silent:!0}),[4,P()];case 5:return f.sent(),[4,P()];case 6:return f.sent(),[4,(b=d,new Promise(function(e){var t=!1,r=function(){t||(t=!0,b.off("finished",r),e())};b.on("finished",r),window.setTimeout(r,400)}))];case 7:return f.sent(),e.set(s.id,d.getDataURL({type:"png",pixelRatio:3,backgroundColor:"#ffffff",excludeComponents:["toolbox"]})),d.dispose(),[3,10];case 8:return console.error("Failed to render business report chart image:",f.sent()),[3,10];case 9:return l.remove(),[7];case 10:return r=!0,[3,3];case 11:return[3,14];case 12:return p=f.sent(),n=!0,o=p,[3,14];case 13:try{r||null==a.return||a.return()}finally{if(n)throw o}return[7];case 14:return[3,16];case 15:return t.remove(),[7];case 16:return[2,e]}})})())];case 1:return A=C.sent(),z=n,J=A,U=z.replace(/<div id="([^"]+)" class="report-chart"><\/div>/g,function(e,t){var r=J.get(t);return r?'<img class="report-chart-image" src="'.concat(r,'" alt="" />'):e}),[2,'<!DOCTYPE html>\n<html lang="'.concat(F(m),'">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>').concat(F(e.title),"</title>\n <style>\n * { box-sizing: border-box; }\n html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }\n html, body { font-family: ").concat(x,"; }\n body { margin: 0; color: #1f2937; background: ").concat(S,"; }\n .report-shell { ").concat(k," }\n .report-paper { ").concat(j," }\n h1, h2, h3 { color: #101828; }\n h1 { margin-top: 0; font-size: 32px; }\n h2, h3 { break-after: avoid-page; }\n p, li { line-height: 1.7; }\n blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid #0f766e; background: #f0fdfa; color: #667085; }\n pre, blockquote, table, .report-chart { break-inside: avoid; page-break-inside: avoid; }\n table { width: 100%; border-collapse: collapse; }\n th, td { border: 1px solid #d0d5dd; padding: 10px 12px; text-align: left; }\n .report-chart { width: 100%; min-height: ").concat(N,"px; height: ").concat(N,"px; margin: 24px 0 32px; border: 1px solid #d0d5dd; border-radius: ").concat(16*!f,"px; overflow: hidden; background: #fff; }\n .report-chart-image { display: block; width: 100%; height: auto; border: 1px solid #d0d5dd; background: #fff; margin: 24px 0 32px; break-inside: avoid; page-break-inside: avoid; }\n .report-paper > *:first-child { margin-top: 0; }\n .report-paper > *:last-child { margin-bottom: 0; }\n img, svg, canvas { max-width: 100%; }\n svg, svg text, svg tspan, canvas { font-family: ").concat(x,'; }\n @page { size: A4; margin: 12mm; }\n @media print {\n body { background: #fff; }\n .report-shell { max-width: 100%; padding: 0; margin: 0; }\n .report-paper { border: 0; border-radius: 0; box-shadow: none; padding: 0; width: 100%; }\n .report-chart { margin: 16px 0 24px; height: 320px; min-height: 320px; }\n .report-chart-image { margin: 16px 0 24px; }\n }\n </style>\n </head>\n <body>\n <div class="report-shell">\n <article class="report-paper">').concat(U,"</article>\n </div>\n ").concat((null==t?void 0:t.autoPrint)?"<script>\n window.addEventListener('load', async () => {\n if (document.fonts?.ready) {\n try {\n await document.fonts.ready;\n } catch (error) {\n console.error('Failed to wait for fonts before printing:', error);\n }\n }\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n window.print();\n });\n });\n });\n <\/script>":"","\n </body>\n</html>")]}})})()}function N(e,t,r){var n=new Blob([t],{type:r}),o=URL.createObjectURL(n),a=document.createElement("a");a.href=o,a.download=e,a.click(),URL.revokeObjectURL(o)}function A(e,t){return b(function(){var r,n;return w(this,function(o){switch(o.label){case 0:if("u"<typeof window)return[2,!1];return[4,j(e,{autoPrint:!0,printMode:!0,locale:null==t?void 0:t.locale})];case 1:if(r=new Blob([o.sent()],{type:"text/html;charset=utf-8"}),n=URL.createObjectURL(r),!window.open(n,"_blank","noopener,noreferrer"))return URL.revokeObjectURL(n),[2,!1];return window.setTimeout(function(){URL.revokeObjectURL(n)},6e4),[2,!0]}})})()}function P(){return new Promise(function(e){return requestAnimationFrame(function(){return e()})})}function F(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e){if(!Number.isFinite(e))return null;var t=new Date(e<1e12?1e3*e:e);return Number.isNaN(t.getTime())?null:t}function M(e){if(!e)return null;var t=e.trim().replace(/_/g,"-");if(!t||!/^[a-z]{2,3}(-[a-z0-9]{2,8})*$/i.test(t))return null;try{return Intl.DateTimeFormat.supportedLocalesOf([t])[0]||t}catch(e){return t}}}}]);
|