@easbot/llm 0.3.29 → 0.3.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.en.md +723 -20
  2. package/README.md +750 -19
  3. package/dist/assets/txt/src/agent/generate.txt +75 -0
  4. package/dist/assets/txt/src/agent/prompt/explore.txt +37 -0
  5. package/dist/assets/txt/src/agent/prompt/summary.txt +12 -0
  6. package/dist/assets/txt/src/agent/prompt/title.txt +24 -0
  7. package/dist/assets/txt/src/model/evaluation/templates/completeness.txt +53 -0
  8. package/dist/assets/txt/src/model/evaluation/templates/consistency.txt +52 -0
  9. package/dist/assets/txt/src/model/evaluation/templates/content-quality.txt +72 -0
  10. package/dist/assets/txt/src/model/evaluation/templates/context-relevancy.txt +45 -0
  11. package/dist/assets/txt/src/model/evaluation/templates/correctness.txt +43 -0
  12. package/dist/assets/txt/src/model/evaluation/templates/fact-checking.txt +43 -0
  13. package/dist/assets/txt/src/model/evaluation/templates/faithfulness.txt +53 -0
  14. package/dist/assets/txt/src/model/evaluation/templates/goal-completion.txt +70 -0
  15. package/dist/assets/txt/src/model/evaluation/templates/moderation.txt +80 -0
  16. package/dist/assets/txt/src/model/evaluation/templates/readability.txt +52 -0
  17. package/dist/assets/txt/src/model/evaluation/templates/relevancy.txt +56 -0
  18. package/dist/assets/txt/src/model/knowledge-summary.txt +142 -0
  19. package/dist/assets/txt/src/model/memory-summary.txt +151 -0
  20. package/dist/assets/txt/src/tool/buildin/edit.txt +10 -0
  21. package/dist/assets/txt/src/tool/buildin/glob.txt +42 -0
  22. package/dist/assets/txt/src/tool/buildin/grep.txt +42 -0
  23. package/dist/assets/txt/src/tool/buildin/read.txt +14 -0
  24. package/dist/assets/txt/src/tool/buildin/todo.txt +117 -0
  25. package/dist/assets/txt/src/tool/buildin/webfetch.txt +13 -0
  26. package/dist/assets/txt/src/tool/buildin/websearch.txt +14 -0
  27. package/dist/assets/txt/src/tool/buildin/write.txt +9 -0
  28. package/dist/chunks/chunk-2XQWKCQ4.cjs +1 -0
  29. package/dist/chunks/chunk-3DTBBDPN.mjs +2 -0
  30. package/dist/chunks/chunk-A6QGPYPS.mjs +10 -0
  31. package/dist/chunks/chunk-GHMRMPMO.cjs +1 -0
  32. package/dist/chunks/{chunk-QKEOAEWA.mjs → chunk-JIETUZVR.mjs} +1 -1
  33. package/dist/chunks/chunk-KS3TBDYP.cjs +2 -0
  34. package/dist/chunks/chunk-LCI45SAN.cjs +11 -0
  35. package/dist/chunks/chunk-NX2YVB72.mjs +1 -0
  36. package/dist/chunks/chunk-O2YH4BJL.cjs +10 -0
  37. package/dist/chunks/chunk-QMTIXJ7U.mjs +1 -0
  38. package/dist/chunks/{chunk-4A6CXMF2.cjs → chunk-RW4QUWZ2.cjs} +1 -1
  39. package/dist/chunks/chunk-YUX6P6YF.mjs +11 -0
  40. package/dist/chunks/{copilot-LRTA3GBD.mjs → copilot-7CO2EO6N.mjs} +1 -1
  41. package/dist/chunks/copilot-AOW7FWY3.cjs +1 -0
  42. package/dist/chunks/index.min-PO6HDKHB.mjs +4 -0
  43. package/dist/chunks/index.min-XTHFSCRB.cjs +4 -0
  44. package/dist/chunks/interfaces-2APNUNBK.cjs +1 -0
  45. package/dist/chunks/interfaces-U2BBKCET.mjs +1 -0
  46. package/dist/chunks/loader-AVOX6M4H.mjs +1 -0
  47. package/dist/chunks/loader-UCGPNKVW.cjs +1 -0
  48. package/dist/chunks/localagent-3DJBEVDM.cjs +1 -0
  49. package/dist/chunks/localagent-PNWC6EGM.mjs +1 -0
  50. package/dist/chunks/models-snapshot-CNF7AHMN.mjs +2 -0
  51. package/dist/chunks/models-snapshot-JD2O6VJX.cjs +2 -0
  52. package/dist/chunks/subagent-33FV6UYA.cjs +1 -0
  53. package/dist/chunks/subagent-OVNTI7J4.mjs +1 -0
  54. package/dist/index.cjs +144 -49
  55. package/dist/index.d.cts +7734 -219
  56. package/dist/index.d.ts +7734 -219
  57. package/dist/index.mjs +144 -49
  58. package/package.json +10 -10
  59. package/dist/assets/txt/model/knowledge-summary.txt +0 -86
  60. package/dist/assets/txt/model/memory-summary.txt +0 -85
  61. package/dist/chunks/chunk-KFESJR3T.cjs +0 -1
  62. package/dist/chunks/chunk-S4DPVKMV.mjs +0 -1
  63. package/dist/chunks/copilot-T25BJSTK.cjs +0 -1
  64. package/dist/chunks/models-snapshot-4CLLJLX6.mjs +0 -2
  65. package/dist/chunks/models-snapshot-OF5YAGCK.cjs +0 -2
  66. /package/dist/assets/txt/{model → src/model}/graph-summary.txt +0 -0
  67. /package/dist/assets/txt/{model → src/model}/summary.txt +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easbot/llm",
3
- "version": "0.3.29",
3
+ "version": "0.3.36",
4
4
  "description": "AI model aggregation layer for EASBot ecosystem: multi-vendor SDK dynamic loading, model routing, configuration management, and high-level Model Provider capability wrapping.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -69,24 +69,24 @@
69
69
  "@openrouter/ai-sdk-provider": "^2.9.0",
70
70
  "ai": "^6.0.253",
71
71
  "ai-gateway-provider": "^3.2.0",
72
+ "diff": "^9.0.0",
72
73
  "fuzzysort": "^4.0.2",
73
74
  "gitlab-ai-provider": "^6.12.1",
74
75
  "google-auth-library": "^11.0.2",
75
76
  "remeda": "^2.39.0",
76
- "zod": "^4.4.3",
77
- "@easbot/sdk": "0.3.29",
78
- "@easbot/utils": "0.3.29",
79
- "@easbot/types": "0.3.29",
80
- "@easbot/local-model-sdk": "0.3.29",
81
- "@easbot/acp": "0.3.29",
82
- "@easbot/plugin": "0.3.29",
83
- "@easbot/ollama-sdk": "0.3.29"
77
+ "zod": "^4.6.7",
78
+ "@easbot/types": "0.3.36",
79
+ "@easbot/sdk": "0.3.36",
80
+ "@easbot/utils": "0.3.36",
81
+ "@easbot/local-model-sdk": "0.3.36",
82
+ "@easbot/ollama-sdk": "0.3.36",
83
+ "@easbot/plugin": "0.3.36"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@types/node": "^25.9.5",
87
87
  "tsup": "^8.5.1",
88
88
  "typescript": "^6.0.3",
89
- "vitest": "^4.1.10"
89
+ "vitest": "^5.0.5"
90
90
  },
91
91
  "engines": {
92
92
  "node": ">=22.22.2"
@@ -1,86 +0,0 @@
1
- # Knowledge Summary Prompt
2
-
3
- ## Task
4
- Synthesize document chunks into a concise summary relevant to the query.
5
-
6
- **CRITICAL RULES:**
7
- - NEVER generate content not present in the input
8
- - NEVER invent relationships or connections
9
- - NEVER elaborate beyond provided information
10
- - NEVER guess or assume user needs
11
- - If input has no valuable information: ONLY output "No relevant knowledge found."
12
-
13
- ## Length Cap (HARD CONSTRAINT)
14
- Your **final output MUST be ≤ {{maxChars}} characters** (including all markdown, punctuation, whitespace, and section headings).
15
- - This cap is derived from the underlying `maxOutputTokens` limit with a safety buffer — exceeding it will trigger a hard truncation by the SDK that leaves your output incomplete.
16
- - When in doubt, prioritize shorter, denser sentences over verbose explanations. Drop optional sections (Key Insights, Entity & Relation Map) before cutting core facts.
17
-
18
- ## Priority Score
19
- Priority = 0.6 × relevance + 0.4 × recency
20
- - Priority > 0.6: high-priority (include)
21
- - Priority < 0.3: low-priority (skip unless unique value)
22
-
23
- ## Input Format
24
- [Chunk N] Priority: {priority}
25
- Source: [{filename}](./{filename}#{startLine}-{endLine})
26
- {content}
27
- Graph Nodes:
28
- Node: {name} ({type}) | {properties}
29
- → [{relation}] → target={targetType}:{targetName}
30
-
31
- ## Output Format
32
-
33
- ### Content Summary (REQUIRED)
34
- **Length: 1-3 sentences maximum**
35
- - Lead with highest-priority chunks ONLY
36
- - Skip chunks Priority < 0.3
37
- - Include lower-priority chunks only if they add unique value
38
- - Cite sources: [{filename}](./{filename}#{startLine})
39
-
40
- ### Entity & Relation Map (CONDITIONAL)
41
- Only include if:
42
- 1. Graph nodes are present AND
43
- 2. They add meaningful connections not in Content Summary
44
-
45
- Format:
46
- **{EntityName}** ({type})
47
- → [{relation}] → {TargetEntity} ({targetType})
48
-
49
- ### Key Insights (CONDITIONAL)
50
- Only include if:
51
- 1. Notable patterns exist AND
52
- 2. They are NOT already covered in Content Summary
53
-
54
- Format:
55
- - 1-2 bullets maximum
56
-
57
- ## Fixed Response
58
- If no chunks have Priority > 0.3 or all chunks are irrelevant:
59
- ```
60
- No relevant knowledge found.
61
- ```
62
- **DO NOT generate any other content.**
63
-
64
- ## Examples
65
-
66
- ### Good Output (relevant chunks)
67
- ```
68
- The codebase uses React for frontend (Priority: 0.78).
69
- Source: [frontend/index.tsx](./frontend/index.tsx#L10-L50)
70
- ```
71
-
72
- ### Bad Output (NEVER generate)
73
- ```
74
- Hello! Based on the documents, I can help you with React setup.
75
- The project structure follows a standard pattern.
76
- You should use TypeScript for type safety.
77
- ```
78
- (These weren't in the input!)
79
-
80
- ## Strict Rules
81
- - Output ONLY content from input chunks
82
- - Skip all sections with no data
83
- - Maximum 3 sentences in Content Summary
84
- - NEVER exceed provided information
85
- - Cite sources when including facts
86
- - If uncertain: "No relevant knowledge found."
@@ -1,85 +0,0 @@
1
- # Memory Summary Prompt
2
-
3
- ## Task
4
- Synthesize memory facts into a concise summary relevant to the query.
5
-
6
- **CRITICAL RULES:**
7
- - NEVER generate facts not present in the input
8
- - NEVER invent content or relationships
9
- - NEVER elaborate beyond provided information
10
- - NEVER guess or assume user intent
11
- - If input has no valuable information: ONLY output "No relevant memory found."
12
-
13
- ## Length Cap (HARD CONSTRAINT)
14
- Your **final output MUST be ≤ {{maxChars}} characters** (including all markdown, punctuation, whitespace, and section headings).
15
- - This cap is derived from the underlying `maxOutputTokens` limit with a safety buffer — exceeding it will trigger a hard truncation by the SDK that leaves your output incomplete.
16
- - When in doubt, prioritize shorter, denser sentences over verbose explanations. Drop optional sections (Key Insights, Entity & Relation Map) before cutting core facts.
17
-
18
- ## Priority Score
19
- Priority = 0.4 × relevance + 0.3 × recency + 0.3 × importance
20
- - Priority > 0.6: high-priority (include)
21
- - Priority < 0.3: low-priority (skip unless unique value)
22
-
23
- ## Input Format
24
- [Fact N] Priority: {priority}
25
- Category: {category} | Importance: {importance} | Source: {source}
26
- {content}
27
- Graph Nodes:
28
- Node: {name} ({type})
29
- → [{relation}] → target={targetType}:{targetName}
30
-
31
- ## Output Format
32
-
33
- ### Content Summary (REQUIRED)
34
- **Length: 1-3 sentences maximum**
35
- - Lead with highest-priority facts ONLY
36
- - Skip facts Priority < 0.3
37
- - Include low-priority facts only if they add unique value not in high-priority facts
38
- - State contradictions clearly: "High-priority fact X contradicts low-priority fact Y. Current truth: X."
39
-
40
- ### Entity & Relation Map (CONDITIONAL)
41
- Only include if:
42
- 1. Graph nodes are present AND
43
- 2. They add meaningful connections not in Content Summary
44
-
45
- Format:
46
- **{EntityName}** ({type})
47
- → [{relation}] → {TargetEntity} ({targetType})
48
-
49
- ### Key Insights (CONDITIONAL)
50
- Only include if:
51
- 1. Meaningful patterns exist AND
52
- 2. They are NOT already covered in Content Summary
53
-
54
- Format:
55
- - 1-2 bullets maximum
56
-
57
- ## Fixed Response
58
- If no facts have Priority > 0.3 or all facts are irrelevant:
59
- ```
60
- No relevant memory found.
61
- ```
62
- **DO NOT generate any other content.**
63
-
64
- ## Examples
65
-
66
- ### Good Output (relevant facts)
67
- ```
68
- The user prefers dark mode (Priority: 0.72).
69
- High-priority fact contradicts earlier light mode preference.
70
- ```
71
-
72
- ### Bad Output (NEVER generate)
73
- ```
74
- Hello! I can help you with dark mode settings.
75
- The user's name is John and they work at Company X.
76
- They like TypeScript and use VSCode daily.
77
- ```
78
- (These facts weren't in the input!)
79
-
80
- ## Strict Rules
81
- - Output ONLY facts from input
82
- - Skip all sections with no data
83
- - Maximum 3 sentences in Content Summary
84
- - NEVER exceed provided information
85
- - If uncertain: "No relevant memory found."
@@ -1 +0,0 @@
1
- 'use strict';var f=Object.defineProperty;var i=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),d=t=>{throw TypeError(t)};var s=(t,e,r)=>e in t?f(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r;var l=(t,e,r)=>s(t,typeof e!="symbol"?e+"":e,r);var R=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&d("Object expected");var c,o;r&&(c=e[i("asyncDispose")]),c===void 0&&(c=e[i("dispose")],r&&(o=c)),typeof c!="function"&&d("Object not disposable"),o&&(c=function(){try{o.call(this);}catch(m){return Promise.reject(m)}}),t.push([r,c,e]);}else r&&t.push([r]);return e},S=(t,e,r)=>{var c=typeof SuppressedError=="function"?SuppressedError:function(n,a,p,u){return u=Error(p),u.name="SuppressedError",u.error=n,u.suppressed=a,u},o=n=>e=r?new c(n,e,"An error was suppressed during disposal"):(r=true,n),m=n=>{for(;n=t.pop();)try{var a=n[1]&&n[1].call(n[2]);if(n[0])return Promise.resolve(a).then(m,p=>(o(p),m()))}catch(p){o(p);}if(r)throw e};return m()};var U=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,g=U();exports.a=l;exports.b=R;exports.c=S;exports.d=g;
@@ -1 +0,0 @@
1
- var m=Object.defineProperty;var k=(b,a)=>(a=Symbol[b])?a:Symbol.for("Symbol."+b),l=b=>{throw TypeError(b)};var n=(b,a,c)=>a in b?m(b,a,{enumerable:true,configurable:true,writable:true,value:c}):b[a]=c;var o=(b,a,c)=>n(b,typeof a!="symbol"?a+"":a,c);var p=(b,a,c)=>{if(a!=null){typeof a!="object"&&typeof a!="function"&&l("Object expected");var e,f;c&&(e=a[k("asyncDispose")]),e===void 0&&(e=a[k("dispose")],c&&(f=e)),typeof e!="function"&&l("Object not disposable"),f&&(e=function(){try{f.call(this);}catch(g){return Promise.reject(g)}}),b.push([c,e,a]);}else c&&b.push([c]);return a},q=(b,a,c)=>{var e=typeof SuppressedError=="function"?SuppressedError:function(d,j,h,i){return i=Error(h),i.name="SuppressedError",i.error=d,i.suppressed=j,i},f=d=>a=c?new e(d,a,"An error was suppressed during disposal"):(c=true,d),g=d=>{for(;d=b.pop();)try{var j=d[1]&&d[1].call(d[2]);if(d[0])return Promise.resolve(j).then(g,h=>(f(h),g()))}catch(h){f(h);}if(c)throw a};return g()};export{o as a,p as b,q as c};
@@ -1 +0,0 @@
1
- 'use strict';var chunk4A6CXMF2_cjs=require('./chunk-4A6CXMF2.cjs');require('./chunk-KFESJR3T.cjs');Object.defineProperty(exports,"createOpenaiCompatible",{enumerable:true,get:function(){return chunk4A6CXMF2_cjs.a}});Object.defineProperty(exports,"openaiCompatible",{enumerable:true,get:function(){return chunk4A6CXMF2_cjs.b}});