@nocobase/plugin-ai 2.1.0-alpha.16 → 2.1.0-alpha.18
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/skills/business-analysis-report/SKILLS.md +13 -22
- package/dist/ai/{tools → skills/business-analysis-report/tools}/businessReportGenerator.js +2 -2
- package/dist/client/280.029428b83d62155f.js +10 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +2 -0
- package/dist/client/index.js +2 -2
- package/dist/externalVersion.js +15 -15
- 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/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/ai-employees/ai-conversations.js +2 -0
- package/dist/server/ai-employees/ai-employee.js +21 -13
- package/dist/server/ai-employees/middleware/skill-tools.js +16 -2
- package/dist/server/ai-employees/prompts.js +1 -0
- package/dist/server/llm-providers/anthropic.d.ts +2 -2
- package/dist/server/llm-providers/anthropic.js +1 -1
- package/dist/server/llm-providers/dashscope.d.ts +2 -3
- package/dist/server/llm-providers/dashscope.js +3 -28
- package/dist/server/llm-providers/deepseek.d.ts +2 -3
- package/dist/server/llm-providers/deepseek.js +2 -31
- package/dist/server/llm-providers/google-genai.d.ts +3 -18
- package/dist/server/llm-providers/google-genai.js +9 -7
- package/dist/server/llm-providers/kimi/provider.d.ts +4 -4
- package/dist/server/llm-providers/kimi/provider.js +3 -28
- package/dist/server/llm-providers/provider.d.ts +11 -2
- package/dist/server/llm-providers/provider.js +60 -0
- package/dist/server/manager/ai-chat-conversation.js +6 -2
- package/dist/server/utils.js +3 -2
- package/package.json +2 -2
- package/dist/client/8c8f0213e3b46621.js +0 -10
- /package/dist/ai/{tools → skills/business-analysis-report/tools}/businessReportGenerator.d.ts +0 -0
- /package/dist/client/{44a97eeb67ff35d9.js → 170.d98eacdc00d9d527.js} +0 -0
- /package/dist/client/{62bf6ed27c8de0df.js → 228.b18148eb1009d2fb.js} +0 -0
- /package/dist/client/{1c3ef55a6d63c9a3.js → 290.0888139e33c9b7cb.js} +0 -0
- /package/dist/client/{f87cff5213f94856.js → 30.4f30511a3059c422.js} +0 -0
- /package/dist/client/{2db4faf814179140.js → 331.d547c95410476a69.js} +0 -0
- /package/dist/client/{87bc4d3cb55e4006.js → 343.83f7d96664e4e038.js} +0 -0
- /package/dist/client/{0e94d90f0134df30.js → 406.15c09d98faa2ccf1.js} +0 -0
- /package/dist/client/{f944d487b7ff1f00.js → 428.e9f38da3b0d8b498.js} +0 -0
- /package/dist/client/{8e82080c5e8ccfb7.js → 502.2b4a51e0a8122e52.js} +0 -0
- /package/dist/client/{85af3d6d85eb5b2b.js → 525.33a9c8ec28be4ec4.js} +0 -0
- /package/dist/client/{a4948d5b70172a69.js → 559.133d286a0a0a1d93.js} +0 -0
- /package/dist/client/{9ac11803370a9625.js → 561.776886c5308e3c26.js} +0 -0
- /package/dist/client/{c83c2cae956ba914.js → 580.e75f97fb883ad042.js} +0 -0
- /package/dist/client/{f8c075896e8b9c0b.js → 597.aa363881a325b5c0.js} +0 -0
- /package/dist/client/{200ac94fc7f6e97b.js → 604.de96f3ec4d471afd.js} +0 -0
- /package/dist/client/{81f6436fd9322dc1.js → 614.aa766080f6b99aab.js} +0 -0
- /package/dist/client/{b8005a3f79084610.js → 687.224e569a99cae4bb.js} +0 -0
- /package/dist/client/{6a8fa308c9f51507.js → 699.57c0a1acb723202a.js} +0 -0
- /package/dist/client/{c065565ccbb41f99.js → 711.266b8f1c520d467a.js} +0 -0
- /package/dist/client/{5af11e24bcb39ac4.js → 758.a9741e81911e53c3.js} +0 -0
- /package/dist/client/{f8a32cc1ac47cf6b.js → 768.973ce32e15099a48.js} +0 -0
- /package/dist/client/{5d5c118d11e91913.js → 792.ae8ad1fcae9fd974.js} +0 -0
- /package/dist/client/{8169eb2b48edf6c7.js → 820.6a26239ea96c075a.js} +0 -0
- /package/dist/client/{55d67b74f02b8d74.js → 832.0cf69e3f43c320b2.js} +0 -0
- /package/dist/client/{748fbb87c1013c6e.js → 927.ff5cd05b14901ae6.js} +0 -0
|
@@ -6,13 +6,7 @@ introduction:
|
|
|
6
6
|
title: '{{t("ai.skills.businessAnalysisReport.title", { ns: "@nocobase/plugin-ai" })}}'
|
|
7
7
|
about: '{{t("ai.skills.businessAnalysisReport.about", { ns: "@nocobase/plugin-ai" })}}'
|
|
8
8
|
tools:
|
|
9
|
-
-
|
|
10
|
-
- getCollectionNames
|
|
11
|
-
- getCollectionMetadata
|
|
12
|
-
- searchFieldMetadata
|
|
13
|
-
- dataQuery
|
|
14
|
-
- dataSourceQuery
|
|
15
|
-
- dataSourceCounting
|
|
9
|
+
- getSkill
|
|
16
10
|
- businessReportGenerator
|
|
17
11
|
---
|
|
18
12
|
|
|
@@ -30,17 +24,19 @@ Your job is to understand the business question, use the data-query workflow to
|
|
|
30
24
|
|
|
31
25
|
## 2. Use the data-query workflow before reporting
|
|
32
26
|
|
|
33
|
-
-
|
|
27
|
+
- For every request that needs business data, your first tool call must be `getSkill` with `skillName="data-query"`.
|
|
28
|
+
- Do not inspect schema, write SQL, describe query results, or call `businessReportGenerator` before `data-query` has been loaded.
|
|
29
|
+
- After loading `data-query`, follow that skill's workflow and use the tools it activates.
|
|
30
|
+
- The loaded `data-query` workflow is responsible for loading `data-metadata` when schema or field discovery is needed. Do not bypass that dependency chain by inventing schema details yourself.
|
|
31
|
+
- If the user did not explicitly name a data source, follow the loaded `data-query` workflow to discover the correct data source first.
|
|
34
32
|
- If multiple available data sources could plausibly contain relevant business data, inspect each candidate data source before deciding the analysis scope.
|
|
35
33
|
- Do not silently analyze only one data source when multiple relevant data sources are available.
|
|
36
34
|
- In the final report, state which data sources were included and explicitly mention any relevant data sources that were excluded, with the reason.
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Use `
|
|
42
|
-
- Use `dataSourceQuery` for raw-row inspection and anomaly checks.
|
|
43
|
-
- Use `dataSourceCounting` only for the simplest count scenario.
|
|
35
|
+
- For all date filtering, follow the `data-query` workflow's frontend date filter contract instead of inventing a report-specific format.
|
|
36
|
+
- For business calendar queries, prefer the frontend date operators and value shapes defined by the `data-query` skill and its query tools.
|
|
37
|
+
- Do not expand month, week, or day calendar requests into UTC boundary timestamps unless the user explicitly asks for exact timestamp comparison.
|
|
38
|
+
- If the user explicitly asks for timezone-based boundary analysis, state the timezone assumption and verify boundary-sensitive cases with raw records when necessary, while still following the same frontend date filter contract.
|
|
39
|
+
- Use the tools activated by the loaded `data-query` skill for schema inspection and data retrieval.
|
|
44
40
|
|
|
45
41
|
Do not guess collection names, relation paths, or aliases.
|
|
46
42
|
|
|
@@ -55,6 +51,7 @@ When the report needs mixed text-and-chart layout, place charts inline by adding
|
|
|
55
51
|
Call `businessReportGenerator` at most once for the same user request unless the user explicitly asks you to regenerate the whole report.
|
|
56
52
|
If the report tool succeeds, stop and return the result instead of making follow-up retry calls to add charts.
|
|
57
53
|
If you cannot produce valid charts in that single call, omit `charts` and complete the report as markdown-only.
|
|
54
|
+
Never call `businessReportGenerator` with guessed numbers, guessed SQL, or guessed query results. Query first, then report.
|
|
58
55
|
|
|
59
56
|
The report should usually include:
|
|
60
57
|
|
|
@@ -87,11 +84,5 @@ Prefer this structure:
|
|
|
87
84
|
|
|
88
85
|
# Available Tools
|
|
89
86
|
|
|
90
|
-
- `
|
|
91
|
-
- `getCollectionNames`
|
|
92
|
-
- `getCollectionMetadata`
|
|
93
|
-
- `searchFieldMetadata`
|
|
94
|
-
- `dataQuery`
|
|
95
|
-
- `dataSourceQuery`
|
|
96
|
-
- `dataSourceCounting`
|
|
87
|
+
- `getSkill`: Load the `data-query` skill before any schema inspection or query work so its workflow and tools become available in the current conversation.
|
|
97
88
|
- `businessReportGenerator`
|
|
@@ -41,7 +41,7 @@ __export(businessReportGenerator_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(businessReportGenerator_exports);
|
|
42
42
|
var import_ai = require("@nocobase/ai");
|
|
43
43
|
var import_zod = require("zod");
|
|
44
|
-
var import_package = __toESM(require("
|
|
44
|
+
var import_package = __toESM(require("../../../../../package.json"));
|
|
45
45
|
function normalizeChartsInput(value) {
|
|
46
46
|
if (typeof value !== "string") {
|
|
47
47
|
return value;
|
|
@@ -63,7 +63,7 @@ const chartSchema = import_zod.z.object({
|
|
|
63
63
|
options: import_zod.z.object({}).catchall(import_zod.z.any()).describe("Valid ECharts options object.")
|
|
64
64
|
});
|
|
65
65
|
var businessReportGenerator_default = (0, import_ai.defineTools)({
|
|
66
|
-
scope: "
|
|
66
|
+
scope: "SPECIFIED",
|
|
67
67
|
defaultPermission: "ALLOW",
|
|
68
68
|
introduction: {
|
|
69
69
|
title: `{{t("ai.tools.businessReportGenerator.title", { ns: "${import_package.default.name}" })}}`,
|
|
@@ -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.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}}}}]);
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { AIEmployee, Message, ResendOptions, SendOptions } from '../../types';
|
|
10
|
+
import { ContextItem } from '../../types';
|
|
10
11
|
export declare const useChatMessageActions: () => {
|
|
12
|
+
syncContextAttachments: (items: ContextItem | ContextItem[]) => void;
|
|
11
13
|
messagesService: import("@nocobase/client").UseRequestResult<{
|
|
12
14
|
data: Message[];
|
|
13
15
|
meta: {
|