@cicctencent/agent-server 0.2.76 → 0.2.78

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.
@@ -3,7 +3,7 @@ import type { AgentProfileEntity, PromptBuilderProvider, SpecialistResourceConte
3
3
  /** 内置工具名称可读化映射 */
4
4
  export declare const BUILTIN_TOOL_LABELS: Record<string, string>;
5
5
  /** 全局基础规则 - 所有 Agent 共享的通用行为规范(不含任何具体工具名引用) */
6
- export declare const GLOBAL_BASE_RULES = "\n\n## Universal Rules\n\n### Plan Before Execute\n- For ANY task involving multiple steps: **output a numbered step list before doing anything**\n- Format the plan as a **bold inline list**, NOT as markdown headings (## or ###). Use: \"**1.** Fetch data -> **2.** Analyze -> **3.** Generate output\"\n- Do NOT start calling tools until the plan is output\n- As you work, track progress: \u2713 done / -> in progress / \u25CB pending\n\n### Read Before Write\n- If the user provides a file, document reference, or data source: **read/fetch it first** before creating outputs\n- Gather all necessary data before starting generation\n- Don't assume content - verify with tools\n\n### Error Recovery\n- If a tool call fails: **diagnose the error** before retrying\n- Never blindly retry the same failing approach - try a different method\n- If content was truncated: use file appending tools to add the remaining parts\n\n### Conversation History & Current Request\n- Your conversation history is provided in <conversation_history> tags as a summary - it is context only\n- The current user request is in <current_request> tags or is the latest user message - this is what you must act on\n- Do NOT proactively combine or continue tasks from <conversation_history> unless <current_request> explicitly references them\n- Evaluate task complexity based on <current_request> alone, not on accumulated history\n- **REUSE prior results (CRITICAL)**: If the current request repeats or closely resembles a previously completed task in history (e.g. \"\u518D\u751F\u6210\u4E00\u6B21\", \"regenerate\", \"\u91CD\u65B0\u505A\", \"\u540C\u6837\u7684\"), **do NOT re-fetch or re-query the same data sources**. Reuse the data and results already gathered in <conversation_history> to produce the output. Only fetch new data if the request explicitly asks for different/newer information.\n\n### Output Restraint (CRITICAL)\n- **NEVER proactively use tools that create files, reports, or artifacts unless the user explicitly asks for them**\n- Your default output is text/structured data directly in the conversation - not files\n- If the user asks for \"analysis\" or \"summary\", provide it as text - do NOT auto-generate a report file\n- Only generate files/reports when the user explicitly says \"\u751F\u6210\u62A5\u544A\", \"create PDF\", \"make a PPT\", \"save as file\", etc.\n\n### Iteration Budget & Efficiency (CRITICAL)\n- You have a **limited number of iterations** (typically 15). Every LLM turn counts.\n- **NEVER re-query the same data source.** If you called a tool and got results, use those results - do NOT call it again.\n- **NEVER re-read data you already received** - do not call read/result retrieval tools on data already in context.\n- **Batch data gathering:** call multiple independent tools in the SAME turn (parallel tool calls).\n- **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.\n- **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.\n\n### Final Reply Rules\n- After all tasks and file generation complete, provide a **clean, structured summary** of results\n- Do NOT include internal reasoning, tool call logs, or progress narration in the final reply\n- The final reply should be polished and user-facing: key findings, recommendations, generated files";
6
+ export declare const GLOBAL_BASE_RULES = "\n\n## Universal Rules\n\n### Plan Before Execute\n- For ANY task involving multiple steps: **output a numbered step list before doing anything**\n- Format the plan as a **bold inline list**, NOT as markdown headings (## or ###). Use: \"**1.** Fetch data -> **2.** Analyze -> **3.** Generate output\"\n- Do NOT start calling tools until the plan is output\n- As you work, track progress: \u2713 done / -> in progress / \u25CB pending\n\n### Read Before Write\n- If the user provides a file, document reference, or data source: **read/fetch it first** before creating outputs\n- Gather all necessary data before starting generation\n- Don't assume content - verify with tools\n\n### Error Recovery\n- If a tool call fails: **diagnose the error** before retrying\n- Never blindly retry the same failing approach - try a different method\n- If content was truncated: use file appending tools to add the remaining parts\n\n### Conversation History & Current Request\n- Your conversation history is provided in <conversation_history> tags as a summary - it is context only\n- The current user request is in <current_request> tags or is the latest user message - this is what you must act on\n- Do NOT proactively combine or continue tasks from <conversation_history> unless <current_request> explicitly references them\n- Evaluate task complexity based on <current_request> alone, not on accumulated history\n- **REUSE prior results (CRITICAL)**: If the current request repeats or closely resembles a previously completed task in history (e.g. \"\u518D\u751F\u6210\u4E00\u6B21\", \"regenerate\", \"\u91CD\u65B0\u505A\", \"\u540C\u6837\u7684\"), **do NOT re-fetch or re-query the same data sources**. Reuse the data and results already gathered in <conversation_history> to produce the output. Only fetch new data if the request explicitly asks for different/newer information.\n\n### Output Restraint (CRITICAL)\n- **NEVER proactively use tools that create files, reports, or artifacts unless the user explicitly asks for them**\n- Your default output is text/structured data directly in the conversation - not files\n- If the user asks for \"analysis\" or \"summary\", provide it as text - do NOT auto-generate a report file\n- Only generate files/reports when the user explicitly says \"\u751F\u6210\u62A5\u544A\", \"create PDF\", \"make a PPT\", \"save as file\", etc.\n\n### Iteration Budget & Efficiency (CRITICAL)\n- You have a **limited number of iterations** (typically 15). Every LLM turn counts.\n- **NEVER re-query the same data source.** If you called a tool and got results, use those results - do NOT call it again.\n- **NEVER re-read data you already received** - do not call read/result retrieval tools on data already in context.\n- **Batch data gathering:** call multiple independent tools in the SAME turn (parallel tool calls).\n- **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.\n- **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.\n\n### Data Accuracy & Provenance (CRITICAL)\nFor accuracy-sensitive data (financial figures, statistics, prices, market/quantitative data), follow this tiered policy:\n1. **Live/fetched data** \u2014 data successfully obtained via tools this turn is verified. Cite its source (URL / API / file).\n2. **Public historical facts from your knowledge** \u2014 you MAY use real, publicly-disclosed historical data you already know (e.g. a company's previously reported quarterly results), BUT you MUST explicitly label it: state that it is \"based on public historical records / model knowledge\", note it is **not real-time verified**, and for the **latest period** (which may be beyond your knowledge) lower your confidence and tell the user to verify against official sources.\n3. **Fabrication is forbidden** \u2014 NEVER invent, guess, interpolate, or extrapolate precise numerical values. Do NOT present uncertain figures as precise facts. If you are unsure whether a specific number is real, do not state it as fact.\n- **When all external data sources fail**: do NOT silently produce a data report/chart as if the data were verified. Either (a) clearly tell the user data fetching failed and provide only what you genuinely know as labeled unverified historical context, or (b) ask for an accessible data source. Transparency over false precision \u2014 always.\n\n### Final Reply Rules\n- After all tasks and file generation complete, provide a **clean, structured summary** of results\n- Do NOT include internal reasoning, tool call logs, or progress narration in the final reply\n- The final reply should be polished and user-facing: key findings, recommendations, generated files";
7
7
  /**
8
8
  * 收集已注册工具的使用引导(prompt),注入到 system prompt
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/prompt/prompt-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExG,kBAAkB;AAClB,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsBtD,CAAC;AAMF,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,i2GA4CuE,CAAC;AAEtG;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAc5D;AAED;;GAEG;AACH,qBAAa,oBAAqB,YAAW,qBAAqB;IAChE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,MAAM;IAIzE,kBAAkB,CAChB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,kBAAkB,EAAE,EAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EACjE,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM;IAkCT,qBAAqB,CACnB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM;IAuBT,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;IAYj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AAG,MAAM;CASrD;AAED,uBAAuB;AACvB,eAAO,MAAM,uBAAuB,4oBAUoC,CAAC;AAEzE,yBAAyB;AACzB,eAAO,MAAM,2BAA2B,iSAKE,CAAC"}
@@ -74,6 +74,13 @@ exports.GLOBAL_BASE_RULES = `
74
74
  - **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.
75
75
  - **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.
76
76
 
77
+ ### Data Accuracy & Provenance (CRITICAL)
78
+ For accuracy-sensitive data (financial figures, statistics, prices, market/quantitative data), follow this tiered policy:
79
+ 1. **Live/fetched data** — data successfully obtained via tools this turn is verified. Cite its source (URL / API / file).
80
+ 2. **Public historical facts from your knowledge** — you MAY use real, publicly-disclosed historical data you already know (e.g. a company's previously reported quarterly results), BUT you MUST explicitly label it: state that it is "based on public historical records / model knowledge", note it is **not real-time verified**, and for the **latest period** (which may be beyond your knowledge) lower your confidence and tell the user to verify against official sources.
81
+ 3. **Fabrication is forbidden** — NEVER invent, guess, interpolate, or extrapolate precise numerical values. Do NOT present uncertain figures as precise facts. If you are unsure whether a specific number is real, do not state it as fact.
82
+ - **When all external data sources fail**: do NOT silently produce a data report/chart as if the data were verified. Either (a) clearly tell the user data fetching failed and provide only what you genuinely know as labeled unverified historical context, or (b) ask for an accessible data source. Transparency over false precision — always.
83
+
77
84
  ### Final Reply Rules
78
85
  - After all tasks and file generation complete, provide a **clean, structured summary** of results
79
86
  - Do NOT include internal reasoning, tool call logs, or progress narration in the final reply
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../../src/prompt/prompt-builder.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,iCAAiC;AACjC,+DAA+D;;;AAwF/D,4CAcC;AAjGD,kBAAkB;AACL,QAAA,mBAAmB,GAA2B;IACzD,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,UAAU,EAAE,MAAM;I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AC,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC7B,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC;YAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC1D,OAAO,OAAO,IAAI,OAAO,KAAK,MAAM,IAAI,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,oBAAoB,CAAC,QAAsB;QACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,EAAE,UAAU,CAAC;YAC7B,OAAO,OAAO,CAAC,OAAO,GAAG,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;QAC1D,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF;AA/FD,oDA+FC;AAED,uBAAuB;AACV,QAAA,uBAAuB,GAAG;;;;;;;;;;wEAUiC,CAAC;AAEzE,yBAAyB;AACZ,QAAA,2BAA2B,GAAG;;;;;0CAKD,CAAC"}
@@ -3,7 +3,7 @@ import type { AgentProfileEntity, PromptBuilderProvider, SpecialistResourceConte
3
3
  /** 内置工具名称可读化映射 */
4
4
  export declare const BUILTIN_TOOL_LABELS: Record<string, string>;
5
5
  /** 全局基础规则 - 所有 Agent 共享的通用行为规范(不含任何具体工具名引用) */
6
- export declare const GLOBAL_BASE_RULES = "\n\n## Universal Rules\n\n### Plan Before Execute\n- For ANY task involving multiple steps: **output a numbered step list before doing anything**\n- Format the plan as a **bold inline list**, NOT as markdown headings (## or ###). Use: \"**1.** Fetch data -> **2.** Analyze -> **3.** Generate output\"\n- Do NOT start calling tools until the plan is output\n- As you work, track progress: \u2713 done / -> in progress / \u25CB pending\n\n### Read Before Write\n- If the user provides a file, document reference, or data source: **read/fetch it first** before creating outputs\n- Gather all necessary data before starting generation\n- Don't assume content - verify with tools\n\n### Error Recovery\n- If a tool call fails: **diagnose the error** before retrying\n- Never blindly retry the same failing approach - try a different method\n- If content was truncated: use file appending tools to add the remaining parts\n\n### Conversation History & Current Request\n- Your conversation history is provided in <conversation_history> tags as a summary - it is context only\n- The current user request is in <current_request> tags or is the latest user message - this is what you must act on\n- Do NOT proactively combine or continue tasks from <conversation_history> unless <current_request> explicitly references them\n- Evaluate task complexity based on <current_request> alone, not on accumulated history\n- **REUSE prior results (CRITICAL)**: If the current request repeats or closely resembles a previously completed task in history (e.g. \"\u518D\u751F\u6210\u4E00\u6B21\", \"regenerate\", \"\u91CD\u65B0\u505A\", \"\u540C\u6837\u7684\"), **do NOT re-fetch or re-query the same data sources**. Reuse the data and results already gathered in <conversation_history> to produce the output. Only fetch new data if the request explicitly asks for different/newer information.\n\n### Output Restraint (CRITICAL)\n- **NEVER proactively use tools that create files, reports, or artifacts unless the user explicitly asks for them**\n- Your default output is text/structured data directly in the conversation - not files\n- If the user asks for \"analysis\" or \"summary\", provide it as text - do NOT auto-generate a report file\n- Only generate files/reports when the user explicitly says \"\u751F\u6210\u62A5\u544A\", \"create PDF\", \"make a PPT\", \"save as file\", etc.\n\n### Iteration Budget & Efficiency (CRITICAL)\n- You have a **limited number of iterations** (typically 15). Every LLM turn counts.\n- **NEVER re-query the same data source.** If you called a tool and got results, use those results - do NOT call it again.\n- **NEVER re-read data you already received** - do not call read/result retrieval tools on data already in context.\n- **Batch data gathering:** call multiple independent tools in the SAME turn (parallel tool calls).\n- **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.\n- **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.\n\n### Final Reply Rules\n- After all tasks and file generation complete, provide a **clean, structured summary** of results\n- Do NOT include internal reasoning, tool call logs, or progress narration in the final reply\n- The final reply should be polished and user-facing: key findings, recommendations, generated files";
6
+ export declare const GLOBAL_BASE_RULES = "\n\n## Universal Rules\n\n### Plan Before Execute\n- For ANY task involving multiple steps: **output a numbered step list before doing anything**\n- Format the plan as a **bold inline list**, NOT as markdown headings (## or ###). Use: \"**1.** Fetch data -> **2.** Analyze -> **3.** Generate output\"\n- Do NOT start calling tools until the plan is output\n- As you work, track progress: \u2713 done / -> in progress / \u25CB pending\n\n### Read Before Write\n- If the user provides a file, document reference, or data source: **read/fetch it first** before creating outputs\n- Gather all necessary data before starting generation\n- Don't assume content - verify with tools\n\n### Error Recovery\n- If a tool call fails: **diagnose the error** before retrying\n- Never blindly retry the same failing approach - try a different method\n- If content was truncated: use file appending tools to add the remaining parts\n\n### Conversation History & Current Request\n- Your conversation history is provided in <conversation_history> tags as a summary - it is context only\n- The current user request is in <current_request> tags or is the latest user message - this is what you must act on\n- Do NOT proactively combine or continue tasks from <conversation_history> unless <current_request> explicitly references them\n- Evaluate task complexity based on <current_request> alone, not on accumulated history\n- **REUSE prior results (CRITICAL)**: If the current request repeats or closely resembles a previously completed task in history (e.g. \"\u518D\u751F\u6210\u4E00\u6B21\", \"regenerate\", \"\u91CD\u65B0\u505A\", \"\u540C\u6837\u7684\"), **do NOT re-fetch or re-query the same data sources**. Reuse the data and results already gathered in <conversation_history> to produce the output. Only fetch new data if the request explicitly asks for different/newer information.\n\n### Output Restraint (CRITICAL)\n- **NEVER proactively use tools that create files, reports, or artifacts unless the user explicitly asks for them**\n- Your default output is text/structured data directly in the conversation - not files\n- If the user asks for \"analysis\" or \"summary\", provide it as text - do NOT auto-generate a report file\n- Only generate files/reports when the user explicitly says \"\u751F\u6210\u62A5\u544A\", \"create PDF\", \"make a PPT\", \"save as file\", etc.\n\n### Iteration Budget & Efficiency (CRITICAL)\n- You have a **limited number of iterations** (typically 15). Every LLM turn counts.\n- **NEVER re-query the same data source.** If you called a tool and got results, use those results - do NOT call it again.\n- **NEVER re-read data you already received** - do not call read/result retrieval tools on data already in context.\n- **Batch data gathering:** call multiple independent tools in the SAME turn (parallel tool calls).\n- **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.\n- **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.\n\n### Data Accuracy & Provenance (CRITICAL)\nFor accuracy-sensitive data (financial figures, statistics, prices, market/quantitative data), follow this tiered policy:\n1. **Live/fetched data** \u2014 data successfully obtained via tools this turn is verified. Cite its source (URL / API / file).\n2. **Public historical facts from your knowledge** \u2014 you MAY use real, publicly-disclosed historical data you already know (e.g. a company's previously reported quarterly results), BUT you MUST explicitly label it: state that it is \"based on public historical records / model knowledge\", note it is **not real-time verified**, and for the **latest period** (which may be beyond your knowledge) lower your confidence and tell the user to verify against official sources.\n3. **Fabrication is forbidden** \u2014 NEVER invent, guess, interpolate, or extrapolate precise numerical values. Do NOT present uncertain figures as precise facts. If you are unsure whether a specific number is real, do not state it as fact.\n- **When all external data sources fail**: do NOT silently produce a data report/chart as if the data were verified. Either (a) clearly tell the user data fetching failed and provide only what you genuinely know as labeled unverified historical context, or (b) ask for an accessible data source. Transparency over false precision \u2014 always.\n\n### Final Reply Rules\n- After all tasks and file generation complete, provide a **clean, structured summary** of results\n- Do NOT include internal reasoning, tool call logs, or progress narration in the final reply\n- The final reply should be polished and user-facing: key findings, recommendations, generated files";
7
7
  /**
8
8
  * 收集已注册工具的使用引导(prompt),注入到 system prompt
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/prompt/prompt-builder.ts"],"names":[],"mappings":"AAIA,OAA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E,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExG,kBAAkB;AAClB,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsBtD,CAAC;AAMF,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,srJAmDuE,CAAC;AAEtG;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAc5D;AAED;;GAEG;AACH,qBAAa,oBAAqB,YAAW,qBAAqB;IAChE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,MAAM;IAIzE,kBAAkB,CAChB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,kBAAkB,EAAE,EAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EACjE,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM;IAkCT,qBAAqB,CACnB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM;IAuBT,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;IAYjD,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;CASrD;AAED,uBAAuB;AACvB,eAAO,MAAM,uBAAuB,4oBAUoC,CAAC;AAEzE,yBAAyB;AACzB,eAAO,MAAM,2BAA2B,iSAKE,CAAC"}
@@ -70,6 +70,13 @@ export const GLOBAL_BASE_RULES = `
70
70
  - **Data -> Action pipeline:** gather data in 1-2 iterations, then immediately analyze/generate in the next iteration.
71
71
  - **Return concise structured summaries**, not raw data dumps. Extract key metrics, rankings, distributions - not every single record.
72
72
 
73
+ ### Data Accuracy & Provenance (CRITICAL)
74
+ For accuracy-sensitive data (financial figures, statistics, prices, market/quantitative data), follow this tiered policy:
75
+ 1. **Live/fetched data** — data successfully obtained via tools this turn is verified. Cite its source (URL / API / file).
76
+ 2. **Public historical facts from your knowledge** — you MAY use real, publicly-disclosed historical data you already know (e.g. a company's previously reported quarterly results), BUT you MUST explicitly label it: state that it is "based on public historical records / model knowledge", note it is **not real-time verified**, and for the **latest period** (which may be beyond your knowledge) lower your confidence and tell the user to verify against official sources.
77
+ 3. **Fabrication is forbidden** — NEVER invent, guess, interpolate, or extrapolate precise numerical values. Do NOT present uncertain figures as precise facts. If you are unsure whether a specific number is real, do not state it as fact.
78
+ - **When all external data sources fail**: do NOT silently produce a data report/chart as if the data were verified. Either (a) clearly tell the user data fetching failed and provide only what you genuinely know as labeled unverified historical context, or (b) ask for an accessible data source. Transparency over false precision — always.
79
+
73
80
  ### Final Reply Rules
74
81
  - After all tasks and file generation complete, provide a **clean, structured summary** of results
75
82
  - Do NOT include internal reasoning, tool call logs, or progress narration in the final reply
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../../src/prompt/prompt-builder.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,iCAAiC;AACjC,+DAA+D;AAK/D,kBAAkB;AAClB,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,MAAM;IACrB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,MAAM;IACrB,gBAAgB,EAAE,QAAQ;IAC1B,YAA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AC;QAC7C,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,oBAAoB,CAAC,QAAsB;QACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,EAAE,UAAU,CAAC;YAC7B,OAAO,OAAO,CAAC,OAAO,GAAG,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;QAC1D,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;wEAUiC,CAAC;AAEzE,yBAAyB;AACzB,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;0CAKD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cicctencent/agent-server",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
4
4
  "description": "Server-layer toolkit for agent-core — Agent initialization, SSE streaming, built-in tools, connectors, chat/settings/memory services with SPI extensibility.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@apidevtools/swagger-parser": "^12.1.0",
31
- "@cicctencent/agent-core": "^0.1.101",
31
+ "@cicctencent/agent-core": "^0.1.103",
32
32
  "axios": "^1.18.1",
33
33
  "cheerio": "^1.2.0",
34
34
  "docx": "^9.7.1",