@eum-agent/llm-provider-ollama 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  //#region src/logo.ts
2
- /** Self-contained official Ollama mark; provenance is shipped in assets/NOTICE. */
3
2
  const OLLAMA_LOGO = "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M7.25558%200.114339C7.61134%200.222519%207.93252%200.400698%208.22405%200.636149C8.70993%201.0256%209.12005%201.58303%209.433%202.24356C9.74758%202.90792%209.95182%203.64354%2010.0292%204.38171C11.0662%203.9284%2012.2171%203.65235%2013.4041%203.57227L13.4881%203.56718C14.921%203.47809%2016.3375%203.6779%2017.5728%204.17044C17.7391%204.2379%2017.9022%204.31044%2018.062%204.3868C18.1443%203.66263%2018.3453%202.94355%2018.6549%202.29447C18.9678%201.63266%2019.378%201.07651%2019.8622%200.685785C20.1328%200.459579%2020.4638%200.281532%2020.8323%200.163974C21.2556%200.0367035%2021.7053%200.0137947%2022.1434%200.110521C22.8039%200.255609%2023.3704%200.578877%2023.8168%201.04851C24.2253%201.47739%2024.5316%202.0272%2024.7408%202.68646C25.1196%203.87517%2025.1855%205.43933%2024.9302%207.32549L25.0175%207.37639L25.0603%207.40058C26.3072%208.13366%2027.1752%209.17855%2027.6348%2010.3914C28.3512%2012.284%2027.9905%2014.4068%2026.7552%2015.5943L26.7255%2015.621L26.7288%2015.6248C27.4157%2016.5946%2027.8324%2017.6192%2027.9214%2018.6793L27.9246%2018.7175C28.0301%2020.0729%2027.5952%2021.4373%2026.5839%2022.7774L26.5723%2022.7902L26.5888%2022.8207C27.3663%2024.2932%2027.6101%2025.7759%2027.3103%2027.2574L27.3004%2027.307C27.254%2027.5234%2027.0983%2027.7168%2026.8677%2027.8446C26.637%2027.9724%2026.3501%2028.0246%2026.07%2027.9892C25.9312%2027.9724%2025.7982%2027.9347%2025.6783%2027.8782C25.5585%2027.8217%2025.4543%2027.7474%2025.3717%2027.6595C25.289%2027.572%2025.2296%2027.4725%2025.1968%2027.3668C25.164%2027.2614%2025.1585%2027.152%2025.1806%2027.0448C25.4556%2025.7301%2025.197%2024.4116%2024.39%2023.0702C24.3147%2022.9456%2024.2812%2022.8083%2024.2927%2022.671C24.3043%2022.5338%2024.3604%2022.401%2024.4559%2022.2849L24.4624%2022.2773C25.4573%2021.1013%2025.869%2019.9482%2025.7801%2018.8155C25.7043%2017.8241%2025.2448%2016.8504%2024.4624%2015.9226C24.3103%2015.7423%2024.2561%2015.5229%2024.3115%2015.3119C24.367%2015.1009%2024.5277%2014.9152%2024.7589%2014.795L24.7737%2014.7874C25.174%2014.585%2025.5429%2014.0683%2025.729%2013.3619C25.9344%2012.5267%2025.8808%2011.6658%2025.5726%2010.8496C25.2349%209.95872%2024.6173%209.21546%2023.7526%208.70765C22.7726%208.12984%2021.4747%207.85111%2019.8326%207.9313C19.6178%207.94209%2019.4039%207.90286%2019.2183%207.81869C19.0327%207.73451%2018.8841%207.60927%2018.7916%207.45912C18.2744%206.61277%2017.5201%206.00696%2016.5796%205.63151C15.6767%205.2833%2014.6658%205.13696%2013.661%205.20897C11.6104%205.33497%209.80194%206.22841%209.26335%207.35476C9.18715%207.51329%209.05009%207.65005%208.87052%207.74673C8.69096%207.84338%208.47747%207.89535%208.25864%207.89566C6.50122%207.8982%205.14075%208.21638%204.14592%208.79037C3.28615%209.28673%202.6998%209.98036%202.39015%2010.8114C2.10995%2011.5937%202.07158%2012.4159%202.27815%2013.2118C2.46262%2013.9219%202.82333%2014.5099%203.23674%2014.8268L3.24992%2014.8357C3.5991%2015.0992%203.67321%2015.5103%203.42945%2015.8348C2.83651%2016.6264%202.39345%2017.8062%202.32098%2018.9402C2.23862%2020.2358%202.62733%2021.3609%203.50521%2022.1678L3.53157%2022.192C3.66406%2022.3113%203.74924%2022.4576%203.77701%2022.6133C3.80475%2022.769%203.77385%2022.9276%203.68804%2023.0702C2.73933%2024.6432%202.4478%2025.9363%202.76239%2026.9545C2.81892%2027.1662%202.76631%2027.3867%202.61573%2027.5687C2.46516%2027.7509%202.22851%2027.8805%201.95615%2027.9299C1.68379%2027.9795%201.39724%2027.9446%201.15746%2027.8334C0.917644%2027.7219%200.743586%2027.5427%200.672268%2027.3337C0.272031%2026.0381%200.543797%2024.5541%201.45133%2022.8818L1.47438%2022.8373L1.46121%2022.822C1.01515%2022.3129%200.682282%2021.7498%200.476267%2021.156L0.468032%2021.1318C0.218008%2020.391%200.119645%2019.6244%200.176502%2018.86C0.248972%2017.7019%200.634385%2016.5157%201.20097%2015.5637L1.22074%2015.5306L1.21744%2015.5281C0.734856%2014.9961%200.377443%2014.3152%200.179796%2013.5618L0.17156%2013.5312C-0.100765%2012.4803%20-0.0482896%2011.3945%200.324737%2010.3622C0.756268%209.19764%201.6045%208.19729%202.85462%207.47439C2.95345%207.41712%203.05721%207.35985%203.16098%207.3064C2.89909%205.40624%202.96498%203.8319%203.34545%202.63556C3.55463%201.97629%203.86263%201.42648%204.2711%200.997598C4.71581%200.529242%205.2824%200.205974%205.94287%200.0596123C6.38099%20-0.0371136%206.83228%20-0.0142049%207.25558%200.114339ZM14.0349%2011.6832C15.5765%2011.6832%2016.9996%2012.0816%2018.0636%2012.7714C19.1013%2013.4421%2019.7189%2014.3432%2019.7189%2015.2405C19.7189%2016.3706%2019.0502%2017.2513%2017.8528%2017.8139C16.8316%2018.2911%2015.4629%2018.5228%2013.8949%2018.5228C12.233%2018.5228%2010.8132%2018.1931%209.78876%2017.5886C8.77252%2016.9904%208.20264%2016.1504%208.20264%2015.2405C8.20264%2014.3407%208.85817%2013.437%209.94194%2012.7638C11.0422%2012.0803%2012.4949%2011.6832%2014.0349%2011.6832ZM14.0349%2012.8236C12.8922%2012.8159%2011.7798%2013.1075%2010.8791%2013.6508C10.1198%2014.1217%209.68994%2014.7136%209.68994%2015.2417C9.68994%2015.7865%2010.0358%2016.2968%2010.6946%2016.685C11.4441%2017.1266%2012.5459%2017.3824%2013.8949%2017.3824C15.2109%2017.3824%2016.321%2017.1953%2017.077%2016.8403C17.8396%2016.4839%2018.23%2015.9672%2018.23%2015.2405C18.23%2014.7021%2017.8248%2014.1077%2017.105%2013.6419C16.3078%2013.1265%2015.2274%2012.8236%2014.0349%2012.8236ZM15.1252%2014.3636L15.1318%2014.3687C15.3295%2014.5608%2015.2883%2014.8396%2015.0396%2014.9923L14.5587%2015.285V15.8526C14.5578%2015.979%2014.4921%2016.0999%2014.376%2016.1889C14.2599%2016.2779%2014.1029%2016.3277%2013.9394%2016.3274C13.7758%2016.3277%2013.6188%2016.2779%2013.5027%2016.1889C13.3866%2016.0999%2013.3209%2015.979%2013.3201%2015.8526V15.2672L12.8737%2014.9897C12.8148%2014.9533%2012.7659%2014.9082%2012.7297%2014.857C12.6935%2014.8059%2012.6707%2014.7497%2012.6628%2014.6917C12.6548%2014.6337%2012.6618%2014.5751%2012.6833%2014.5192C12.7048%2014.4633%2012.7404%2014.4113%2012.7881%2014.3661C12.8853%2014.2747%2013.0253%2014.2166%2013.1776%2014.2044C13.3299%2014.1923%2013.4824%2014.2271%2013.6017%2014.3012L13.9558%2014.5201L14.3182%2014.2987C14.4371%2014.2261%2014.588%2014.1922%2014.7388%2014.2043C14.8896%2014.2165%2015.0282%2014.2736%2015.1252%2014.3636ZM6.82405%2011.9212C7.61134%2011.9212%208.25205%2012.4176%208.25205%2013.0298C8.25248%2013.3232%208.10217%2013.6048%207.83409%2013.8127C7.56602%2014.0205%207.20215%2014.1376%206.8224%2014.1383C6.44321%2014.1373%206.08%2014.0202%205.81235%2013.8127C5.54467%2013.6051%205.3944%2013.324%205.3944%2013.031C5.39351%2012.7376%205.54342%2012.4559%205.81117%2012.2478C6.07895%2012.0397%206.4443%2011.9223%206.82405%2011.9212ZM21.1634%2011.9212C21.954%2011.9212%2022.593%2012.4176%2022.593%2013.0298C22.5935%2013.3232%2022.4432%2013.6048%2022.1751%2013.8127C21.907%2014.0205%2021.5431%2014.1376%2021.1634%2014.1383C20.7842%2014.1373%2020.421%2014.0202%2020.1533%2013.8127C19.8857%2013.6051%2019.7354%2013.324%2019.7354%2013.031C19.7345%2012.7376%2019.8844%2012.4559%2020.1522%2012.2478C20.4199%2012.0397%2020.7836%2011.9223%2021.1634%2011.9212ZM6.48969%201.6543L6.48475%201.65684C6.29392%201.72096%206.131%201.82611%206.01534%201.95975L6.0071%201.96738C5.77981%202.20793%205.58216%202.56174%205.43393%203.02628C5.15392%203.90699%205.07816%205.10206%205.22969%206.56695C5.93793%206.40405%206.7104%206.30223%207.54217%206.26532L7.55864%206.26405L7.58993%206.22077C7.6657%206.11641%207.7464%206.01587%207.8337%205.9166C8.03629%204.93534%207.86993%203.76318%207.41699%202.8061C7.19628%202.34283%206.92781%201.97884%206.67087%201.77139C6.61783%201.72827%206.55871%201.68986%206.49463%201.65684L6.48969%201.6543ZM21.5999%201.70521L21.5966%201.70648C21.5325%201.73949%2021.4734%201.7779%2021.4203%201.82102C21.1634%202.02847%2020.8933%202.39374%2020.6742%202.85701C20.1966%203.86754%2020.0368%205.11734%2020.2954%206.13041L20.3909%206.25387L20.4041%206.27168H20.4535C21.2709%206.27186%2022.0841%206.36273%2022.8681%206.5415C23.0097%205.11097%2022.9307%203.94136%2022.6573%203.07719C22.509%202.61265%2022.3114%202.25883%2022.0824%202.01829L22.0759%202.01066C21.9604%201.87654%2021.7975%201.77095%2021.6064%201.70648L21.5999%201.70521Z%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A";
4
3
  //#endregion
5
4
  //#region src/routing.ts
6
- /** Maps only declared official roots; protocol implementations own the remaining resource URI. */
7
5
  function connectionConfig(endpoint, protocolId, config, aliases = []) {
8
6
  const defaults = Object.values(endpoint.capabilities).find((one) => one.protocolIds.includes(protocolId))?.protocolDefaults?.[protocolId] ?? {};
9
7
  const configured = config.baseUrl;
@@ -23,11 +21,16 @@ function connectionConfig(endpoint, protocolId, config, aliases = []) {
23
21
  }
24
22
  //#endregion
25
23
  //#region src/type.ts
26
- /** Stable provider registration identifier. */
27
24
  const TYPE = "ollama";
28
25
  const baseUrl = "http://localhost:11434";
29
26
  const endpoint = {
30
27
  id: "ollama",
28
+ resourceCapability: {
29
+ support: "not-applicable",
30
+ reason: "not-applicable",
31
+ sources: [],
32
+ presets: []
33
+ },
31
34
  label: "Ollama",
32
35
  capabilities: {
33
36
  image: {
@@ -51,10 +54,14 @@ const endpoint = {
51
54
  },
52
55
  defaults: { baseUrl }
53
56
  };
54
- /** Builds the no-key local-model provider without network activity or an inferred model catalogue. */
57
+ function compatibleRoot(baseUrl) {
58
+ const root = baseUrl.replace(/\/+$/, "");
59
+ return root.endsWith("/v1") ? root : `${root}/v1`;
60
+ }
55
61
  function ollamaProviderType() {
56
62
  return {
57
63
  type: TYPE,
64
+ listingContractVersion: "capacity-listing-v1",
58
65
  label: "Ollama",
59
66
  fields: [],
60
67
  endpoints: [endpoint],
@@ -85,8 +92,12 @@ function ollamaProviderType() {
85
92
  },
86
93
  prepareConnection(input) {
87
94
  if (input.endpointId !== endpoint.id || !Object.values(endpoint.capabilities).some((one) => one.protocolIds.includes(input.protocolId))) throw new Error("Unsupported Ollama endpoint or protocol");
95
+ const config = connectionConfig(endpoint, input.protocolId, input.config);
88
96
  return {
89
- config: connectionConfig(endpoint, input.protocolId, input.config),
97
+ config: input.protocolId === "ollama" || typeof config.baseUrl !== "string" ? config : {
98
+ ...config,
99
+ baseUrl: compatibleRoot(config.baseUrl)
100
+ },
90
101
  options: input.protocolId === "openai-responses" ? {
91
102
  reasoningReplay: "omit",
92
103
  effortCache: false,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "en-US": "Ollama Model Connection",
5
5
  "zh-CN": "模型接入 · Ollama"
6
6
  },
7
- "version": "1.1.0",
7
+ "version": "1.2.0",
8
8
  "type": "module",
9
9
  "description": "Native local Ollama provider and image tool",
10
10
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "assets"
19
19
  ],
20
20
  "devDependencies": {
21
- "@eum-agent/plugin": "1.1.0"
21
+ "@eum-agent/plugin": "1.2.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "zod": "^4.4.3"
@@ -26,10 +26,10 @@
26
26
  "yaoguang": {
27
27
  "kind": "extension",
28
28
  "dependencies": {
29
- "@eum-agent/llm-management": "1.1.0"
29
+ "@eum-agent/llm-management": "1.2.0"
30
30
  },
31
31
  "foundationDependencies": {
32
- "@eum-agent/infra-local": "1.0.1"
32
+ "@eum-agent/infra-local": "1.2.0"
33
33
  },
34
34
  "description": {
35
35
  "en-US": "Native local Ollama provider and image tool",