@fideliosai/adapter-ollama-local 0.0.40
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/LICENSE +21 -0
- package/dist/cli/format-event.d.ts +8 -0
- package/dist/cli/format-event.d.ts.map +1 -0
- package/dist/cli/format-event.js +22 -0
- package/dist/cli/format-event.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/server/config.d.ts +32 -0
- package/dist/server/config.d.ts.map +1 -0
- package/dist/server/config.js +110 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/config.test.d.ts +2 -0
- package/dist/server/config.test.d.ts.map +1 -0
- package/dist/server/config.test.js +85 -0
- package/dist/server/config.test.js.map +1 -0
- package/dist/server/execute.d.ts +3 -0
- package/dist/server/execute.d.ts.map +1 -0
- package/dist/server/execute.js +267 -0
- package/dist/server/execute.js.map +1 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +6 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/models.d.ts +19 -0
- package/dist/server/models.d.ts.map +1 -0
- package/dist/server/models.js +107 -0
- package/dist/server/models.js.map +1 -0
- package/dist/server/models.test.d.ts +2 -0
- package/dist/server/models.test.d.ts.map +1 -0
- package/dist/server/models.test.js +177 -0
- package/dist/server/models.test.js.map +1 -0
- package/dist/server/session-codec.d.ts +21 -0
- package/dist/server/session-codec.d.ts.map +1 -0
- package/dist/server/session-codec.js +72 -0
- package/dist/server/session-codec.js.map +1 -0
- package/dist/server/session-codec.test.d.ts +2 -0
- package/dist/server/session-codec.test.d.ts.map +1 -0
- package/dist/server/session-codec.test.js +86 -0
- package/dist/server/session-codec.test.js.map +1 -0
- package/dist/server/test.d.ts +13 -0
- package/dist/server/test.d.ts.map +1 -0
- package/dist/server/test.js +243 -0
- package/dist/server/test.js.map +1 -0
- package/dist/server/test.test.d.ts +2 -0
- package/dist/server/test.test.d.ts.map +1 -0
- package/dist/server/test.test.js +158 -0
- package/dist/server/test.test.js.map +1 -0
- package/dist/ui/build-config.d.ts +14 -0
- package/dist/ui/build-config.d.ts.map +1 -0
- package/dist/ui/build-config.js +102 -0
- package/dist/ui/build-config.js.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/parse-stdout.d.ts +9 -0
- package/dist/ui/parse-stdout.d.ts.map +1 -0
- package/dist/ui/parse-stdout.js +23 -0
- package/dist/ui/parse-stdout.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FideliOS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ollama_local streams plain text deltas (not JSONL). The adapter
|
|
3
|
+
* already line-buffers stdout in execute.ts, so the CLI just needs to
|
|
4
|
+
* pass lines through with light coloring. Stderr lines may carry the
|
|
5
|
+
* `[thinking]` and `[ollama]` prefixes the adapter writes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function printOllamaStreamEvent(raw: string, _debug: boolean): void;
|
|
8
|
+
//# sourceMappingURL=format-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-event.d.ts","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAczE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
/**
|
|
3
|
+
* ollama_local streams plain text deltas (not JSONL). The adapter
|
|
4
|
+
* already line-buffers stdout in execute.ts, so the CLI just needs to
|
|
5
|
+
* pass lines through with light coloring. Stderr lines may carry the
|
|
6
|
+
* `[thinking]` and `[ollama]` prefixes the adapter writes.
|
|
7
|
+
*/
|
|
8
|
+
export function printOllamaStreamEvent(raw, _debug) {
|
|
9
|
+
const line = raw.replace(/\r?\n$/, "");
|
|
10
|
+
if (!line)
|
|
11
|
+
return;
|
|
12
|
+
if (line.startsWith("[thinking]")) {
|
|
13
|
+
console.log(pc.gray(line));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (line.startsWith("[ollama]")) {
|
|
17
|
+
console.log(pc.yellow(line));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log(pc.green(line));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=format-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-event.js","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,MAAe;IACjE,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const type = "ollama_local";
|
|
2
|
+
export declare const label = "Ollama (local)";
|
|
3
|
+
export declare const models: Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const agentConfigurationDoc = "# ollama_local agent configuration\n\nAdapter: ollama_local\n\nUse when:\n- You want a raw chat/streaming adapter that talks directly to Ollama\n- You want to bypass the Hermes runtime for non-agentic workloads\n (research, classification, summarization, pre-processing)\n- You want to target either a local Ollama daemon (default\n http://localhost:11434) or Ollama Cloud (https://ollama.com) by setting\n OLLAMA_API_KEY\n- You want Ollama-native knobs: keep_alive, num_ctx, think\n\nDon't use when:\n- You need agentic tool execution (Phase 2 \u2014 see FID-16)\n- You need Hermes-style provider routing across multiple backends\n- You need MCP tool servers wired into the run\n\nPhase 1 scope (current):\n- Single-turn chat, streamed deltas piped to onLog(\"stdout\")\n- If the model emits tool_calls they are logged as a warning and the\n response is treated as final (no execution)\n- Sessions: chat history is round-tripped via sessionParams.messages\n so the next heartbeat can resume the conversation if desired\n- Health check probes /api/version + /api/tags + a one-shot \"say hello\"\n chat to mirror PR #44 hermes-local parity\n\nCore fields:\n- model (string, required): Ollama model id, e.g. \"llama3.1\" or\n \"kimi-k2.6:cloud\" \u2014 any id surfaced by /api/tags is valid\n- host (string, optional): Ollama host URL. Defaults to\n http://localhost:11434. Set to https://ollama.com for cloud.\n- promptTemplate (string, optional): user prompt template; supports\n {{agent.id}}, {{agent.name}}, {{run.id}}, {{context.*}}\n- bootstrapPromptTemplate (string, optional): one-time bootstrap prompt\n prepended on the first turn (no resumed session)\n\nTunables (all optional):\n- keepAlive (string | number, optional): Ollama keep_alive \u2014 how long the\n model stays loaded after the request. Examples: \"10m\", 600, \"5m\".\n- numCtx (number, optional): context window size (Ollama options.num_ctx).\n- think (boolean | \"low\" | \"medium\" | \"high\", optional): enable extended\n reasoning for models that support it; thinking trace is streamed to\n onLog(\"stderr\") prefixed with \"[thinking] \".\n- ollamaTier (string, optional): operator-supplied tag describing the\n Ollama Cloud tier (e.g. \"free\", \"pro\", \"team\"). NOTE: there is no\n public Ollama API to verify a tier \u2014 this field is documentation only\n and is surfaced verbatim by testEnvironment.\n\nOperational fields:\n- timeoutSec (number, optional): hard cap on the chat call in seconds.\n Defaults to 300. Implemented via the SDK's .abort() method.\n- env (object, optional): KEY=VALUE bag. OLLAMA_API_KEY here (or via\n the agent secret store) is forwarded as the cloud Bearer token.\n\nNotes:\n- This adapter is in-process. There is no spawned CLI \u2014 all I/O is\n HTTP to the configured host using the official \"ollama\" npm SDK.\n- Streaming deltas are written to onLog(\"stdout\") line by line so they\n are visible live in run logs.\n- Models list is dynamic: GET /api/tags is called against the configured\n host and merged with the cloud /api/tags when OLLAMA_API_KEY is set.\n Results are cached for 60 seconds per (host, hasKey) tuple.\n";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,iBAAiB,CAAC;AACnC,eAAO,MAAM,KAAK,mBAAmB,CAAC;AAEtC,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAM,CAAC;AAE/D,eAAO,MAAM,qBAAqB,omGA+DjC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const type = "ollama_local";
|
|
2
|
+
export const label = "Ollama (local)";
|
|
3
|
+
export const models = [];
|
|
4
|
+
export const agentConfigurationDoc = `# ollama_local agent configuration
|
|
5
|
+
|
|
6
|
+
Adapter: ollama_local
|
|
7
|
+
|
|
8
|
+
Use when:
|
|
9
|
+
- You want a raw chat/streaming adapter that talks directly to Ollama
|
|
10
|
+
- You want to bypass the Hermes runtime for non-agentic workloads
|
|
11
|
+
(research, classification, summarization, pre-processing)
|
|
12
|
+
- You want to target either a local Ollama daemon (default
|
|
13
|
+
http://localhost:11434) or Ollama Cloud (https://ollama.com) by setting
|
|
14
|
+
OLLAMA_API_KEY
|
|
15
|
+
- You want Ollama-native knobs: keep_alive, num_ctx, think
|
|
16
|
+
|
|
17
|
+
Don't use when:
|
|
18
|
+
- You need agentic tool execution (Phase 2 — see FID-16)
|
|
19
|
+
- You need Hermes-style provider routing across multiple backends
|
|
20
|
+
- You need MCP tool servers wired into the run
|
|
21
|
+
|
|
22
|
+
Phase 1 scope (current):
|
|
23
|
+
- Single-turn chat, streamed deltas piped to onLog("stdout")
|
|
24
|
+
- If the model emits tool_calls they are logged as a warning and the
|
|
25
|
+
response is treated as final (no execution)
|
|
26
|
+
- Sessions: chat history is round-tripped via sessionParams.messages
|
|
27
|
+
so the next heartbeat can resume the conversation if desired
|
|
28
|
+
- Health check probes /api/version + /api/tags + a one-shot "say hello"
|
|
29
|
+
chat to mirror PR #44 hermes-local parity
|
|
30
|
+
|
|
31
|
+
Core fields:
|
|
32
|
+
- model (string, required): Ollama model id, e.g. "llama3.1" or
|
|
33
|
+
"kimi-k2.6:cloud" — any id surfaced by /api/tags is valid
|
|
34
|
+
- host (string, optional): Ollama host URL. Defaults to
|
|
35
|
+
http://localhost:11434. Set to https://ollama.com for cloud.
|
|
36
|
+
- promptTemplate (string, optional): user prompt template; supports
|
|
37
|
+
{{agent.id}}, {{agent.name}}, {{run.id}}, {{context.*}}
|
|
38
|
+
- bootstrapPromptTemplate (string, optional): one-time bootstrap prompt
|
|
39
|
+
prepended on the first turn (no resumed session)
|
|
40
|
+
|
|
41
|
+
Tunables (all optional):
|
|
42
|
+
- keepAlive (string | number, optional): Ollama keep_alive — how long the
|
|
43
|
+
model stays loaded after the request. Examples: "10m", 600, "5m".
|
|
44
|
+
- numCtx (number, optional): context window size (Ollama options.num_ctx).
|
|
45
|
+
- think (boolean | "low" | "medium" | "high", optional): enable extended
|
|
46
|
+
reasoning for models that support it; thinking trace is streamed to
|
|
47
|
+
onLog("stderr") prefixed with "[thinking] ".
|
|
48
|
+
- ollamaTier (string, optional): operator-supplied tag describing the
|
|
49
|
+
Ollama Cloud tier (e.g. "free", "pro", "team"). NOTE: there is no
|
|
50
|
+
public Ollama API to verify a tier — this field is documentation only
|
|
51
|
+
and is surfaced verbatim by testEnvironment.
|
|
52
|
+
|
|
53
|
+
Operational fields:
|
|
54
|
+
- timeoutSec (number, optional): hard cap on the chat call in seconds.
|
|
55
|
+
Defaults to 300. Implemented via the SDK's .abort() method.
|
|
56
|
+
- env (object, optional): KEY=VALUE bag. OLLAMA_API_KEY here (or via
|
|
57
|
+
the agent secret store) is forwarded as the cloud Bearer token.
|
|
58
|
+
|
|
59
|
+
Notes:
|
|
60
|
+
- This adapter is in-process. There is no spawned CLI — all I/O is
|
|
61
|
+
HTTP to the configured host using the official "ollama" npm SDK.
|
|
62
|
+
- Streaming deltas are written to onLog("stdout") line by line so they
|
|
63
|
+
are visible live in run logs.
|
|
64
|
+
- Models list is dynamic: GET /api/tags is called against the configured
|
|
65
|
+
host and merged with the cloud /api/tags when OLLAMA_API_KEY is set.
|
|
66
|
+
Results are cached for 60 seconds per (host, hasKey) tuple.
|
|
67
|
+
`;
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AACnC,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAyC,EAAE,CAAC;AAE/D,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DpC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for parsing ollama_local adapter config values out of an
|
|
3
|
+
* untrusted Record<string, unknown>. Kept separate from execute.ts so the
|
|
4
|
+
* tests can exercise them without spinning up a fake fetch().
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_HOST = "http://localhost:11434";
|
|
7
|
+
export declare const CLOUD_HOST = "https://ollama.com";
|
|
8
|
+
export declare const DEFAULT_TIMEOUT_SEC = 300;
|
|
9
|
+
export type ThinkOption = boolean | "low" | "medium" | "high";
|
|
10
|
+
export interface OllamaConfig {
|
|
11
|
+
host: string;
|
|
12
|
+
model: string;
|
|
13
|
+
apiKey: string | null;
|
|
14
|
+
keepAlive: string | number | null;
|
|
15
|
+
numCtx: number | null;
|
|
16
|
+
think: ThinkOption | null;
|
|
17
|
+
ollamaTier: string | null;
|
|
18
|
+
timeoutSec: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse and normalize the adapter config object. Throws if `model` is
|
|
22
|
+
* missing — every other field has a sensible default.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseOllamaConfig(rawConfig: unknown): OllamaConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Build the headers map handed to the Ollama SDK. Returns null when no
|
|
27
|
+
* Authorization header is needed (purely-local daemons don't need one).
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildOllamaHeaders(apiKey: string | null): Record<string, string> | undefined;
|
|
30
|
+
/** True when host points at Ollama Cloud rather than a local daemon. */
|
|
31
|
+
export declare function isCloudHost(host: string): boolean;
|
|
32
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,YAAY,2BAA2B,CAAC;AACrD,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAC/C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAwDD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,YAAY,CAkClE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAG5F;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for parsing ollama_local adapter config values out of an
|
|
3
|
+
* untrusted Record<string, unknown>. Kept separate from execute.ts so the
|
|
4
|
+
* tests can exercise them without spinning up a fake fetch().
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_HOST = "http://localhost:11434";
|
|
7
|
+
export const CLOUD_HOST = "https://ollama.com";
|
|
8
|
+
export const DEFAULT_TIMEOUT_SEC = 300;
|
|
9
|
+
function asString(value, fallback = "") {
|
|
10
|
+
return typeof value === "string" ? value : fallback;
|
|
11
|
+
}
|
|
12
|
+
function asNumberOrNull(value) {
|
|
13
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
14
|
+
return value;
|
|
15
|
+
if (typeof value === "string" && value.trim()) {
|
|
16
|
+
const n = Number(value.trim());
|
|
17
|
+
return Number.isFinite(n) ? n : null;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
function parseObject(value) {
|
|
22
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
23
|
+
return {};
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function readEnvString(envConfig, key) {
|
|
27
|
+
const raw = envConfig[key];
|
|
28
|
+
if (typeof raw === "string" && raw.trim().length > 0)
|
|
29
|
+
return raw.trim();
|
|
30
|
+
if (typeof raw === "object" && raw !== null && !Array.isArray(raw)) {
|
|
31
|
+
const rec = raw;
|
|
32
|
+
if (rec.type === "plain" && typeof rec.value === "string" && rec.value.trim().length > 0) {
|
|
33
|
+
return rec.value.trim();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function parseThink(value) {
|
|
39
|
+
if (typeof value === "boolean")
|
|
40
|
+
return value;
|
|
41
|
+
if (typeof value === "string") {
|
|
42
|
+
const lower = value.trim().toLowerCase();
|
|
43
|
+
if (lower === "low" || lower === "medium" || lower === "high")
|
|
44
|
+
return lower;
|
|
45
|
+
if (lower === "true")
|
|
46
|
+
return true;
|
|
47
|
+
if (lower === "false")
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function parseKeepAlive(value) {
|
|
53
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
54
|
+
return value;
|
|
55
|
+
if (typeof value === "string" && value.trim().length > 0)
|
|
56
|
+
return value.trim();
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function normalizeHost(host) {
|
|
60
|
+
const trimmed = host.trim();
|
|
61
|
+
if (!trimmed)
|
|
62
|
+
return DEFAULT_HOST;
|
|
63
|
+
// Strip trailing slashes so the SDK builds clean URLs
|
|
64
|
+
return trimmed.replace(/\/+$/, "");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parse and normalize the adapter config object. Throws if `model` is
|
|
68
|
+
* missing — every other field has a sensible default.
|
|
69
|
+
*/
|
|
70
|
+
export function parseOllamaConfig(rawConfig) {
|
|
71
|
+
const config = parseObject(rawConfig);
|
|
72
|
+
const envConfig = parseObject(config.env);
|
|
73
|
+
const model = asString(config.model).trim();
|
|
74
|
+
if (!model) {
|
|
75
|
+
throw new Error("ollama_local requires `adapterConfig.model`.");
|
|
76
|
+
}
|
|
77
|
+
const host = normalizeHost(asString(config.host, DEFAULT_HOST));
|
|
78
|
+
const apiKey = readEnvString(envConfig, "OLLAMA_API_KEY") ??
|
|
79
|
+
(asString(config.apiKey).trim() || null);
|
|
80
|
+
const keepAlive = parseKeepAlive(config.keepAlive);
|
|
81
|
+
const numCtx = asNumberOrNull(config.numCtx);
|
|
82
|
+
const think = parseThink(config.think);
|
|
83
|
+
const ollamaTier = asString(config.ollamaTier).trim() || null;
|
|
84
|
+
const timeoutSecRaw = asNumberOrNull(config.timeoutSec);
|
|
85
|
+
const timeoutSec = timeoutSecRaw !== null && timeoutSecRaw > 0 ? timeoutSecRaw : DEFAULT_TIMEOUT_SEC;
|
|
86
|
+
return {
|
|
87
|
+
host,
|
|
88
|
+
model,
|
|
89
|
+
apiKey: apiKey && apiKey.length > 0 ? apiKey : null,
|
|
90
|
+
keepAlive,
|
|
91
|
+
numCtx,
|
|
92
|
+
think,
|
|
93
|
+
ollamaTier,
|
|
94
|
+
timeoutSec,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Build the headers map handed to the Ollama SDK. Returns null when no
|
|
99
|
+
* Authorization header is needed (purely-local daemons don't need one).
|
|
100
|
+
*/
|
|
101
|
+
export function buildOllamaHeaders(apiKey) {
|
|
102
|
+
if (!apiKey)
|
|
103
|
+
return undefined;
|
|
104
|
+
return { Authorization: `Bearer ${apiKey}` };
|
|
105
|
+
}
|
|
106
|
+
/** True when host points at Ollama Cloud rather than a local daemon. */
|
|
107
|
+
export function isCloudHost(host) {
|
|
108
|
+
return /^https?:\/\/ollama\.com(\/|$)/i.test(host.trim());
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAwB,CAAC;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAevC,SAAS,QAAQ,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnF,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,SAAkC,EAAE,GAAW;IACpE,MAAM,GAAG,GAAG,SAAS,CAAC,GA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AAI,EAAE,IAAI,IAAI,CAAC;IAE9D,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,UAAU,GACd,aAAa,KAAK,IAAI,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAEpF,OAAO;QACL,IAAI;QACJ,KAAK;QACL,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;QACnD,SAAS;QACT,MAAM;QACN,KAAK;QACL,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;IACtD,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,EAAE,aAAa,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;AAC/C,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../src/server/config.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { CLOUD_HOST, DEFAULT_HOST, DEFAULT_TIMEOUT_SEC, buildOllamaHeaders, isCloudHost, parseOllamaConfig, } from "./config.js";
|
|
3
|
+
describe("parseOllamaConfig", () => {
|
|
4
|
+
it("requires a model", () => {
|
|
5
|
+
expect(() => parseOllamaConfig({})).toThrow(/requires.*model/i);
|
|
6
|
+
expect(() => parseOllamaConfig({ model: "" })).toThrow(/requires.*model/i);
|
|
7
|
+
expect(() => parseOllamaConfig({ model: " " })).toThrow(/requires.*model/i);
|
|
8
|
+
});
|
|
9
|
+
it("applies defaults for optional fields", () => {
|
|
10
|
+
const cfg = parseOllamaConfig({ model: "llama3.1" });
|
|
11
|
+
expect(cfg.model).toBe("llama3.1");
|
|
12
|
+
expect(cfg.host).toBe(DEFAULT_HOST);
|
|
13
|
+
expect(cfg.apiKey).toBeNull();
|
|
14
|
+
expect(cfg.keepAlive).toBeNull();
|
|
15
|
+
expect(cfg.numCtx).toBeNull();
|
|
16
|
+
expect(cfg.think).toBeNull();
|
|
17
|
+
expect(cfg.ollamaTier).toBeNull();
|
|
18
|
+
expect(cfg.timeoutSec).toBe(DEFAULT_TIMEOUT_SEC);
|
|
19
|
+
});
|
|
20
|
+
it("normalizes the host (strips trailing slashes)", () => {
|
|
21
|
+
expect(parseOllamaConfig({ model: "x", host: "http://host:1234/" }).host).toBe("http://host:1234");
|
|
22
|
+
expect(parseOllamaConfig({ model: "x", host: "https://ollama.com//" }).host).toBe("https://ollama.com");
|
|
23
|
+
});
|
|
24
|
+
it("reads OLLAMA_API_KEY from env.plain bindings", () => {
|
|
25
|
+
const cfg = parseOllamaConfig({
|
|
26
|
+
model: "x",
|
|
27
|
+
env: { OLLAMA_API_KEY: { type: "plain", value: "sk-test" } },
|
|
28
|
+
});
|
|
29
|
+
expect(cfg.apiKey).toBe("sk-test");
|
|
30
|
+
});
|
|
31
|
+
it("reads OLLAMA_API_KEY as a raw string in env", () => {
|
|
32
|
+
const cfg = parseOllamaConfig({
|
|
33
|
+
model: "x",
|
|
34
|
+
env: { OLLAMA_API_KEY: "raw-key" },
|
|
35
|
+
});
|
|
36
|
+
expect(cfg.apiKey).toBe("raw-key");
|
|
37
|
+
});
|
|
38
|
+
it("falls back to top-level apiKey when env binding missing", () => {
|
|
39
|
+
const cfg = parseOllamaConfig({ model: "x", apiKey: "top-key" });
|
|
40
|
+
expect(cfg.apiKey).toBe("top-key");
|
|
41
|
+
});
|
|
42
|
+
it("parses think option strings and booleans", () => {
|
|
43
|
+
expect(parseOllamaConfig({ model: "x", think: true }).think).toBe(true);
|
|
44
|
+
expect(parseOllamaConfig({ model: "x", think: "high" }).think).toBe("high");
|
|
45
|
+
expect(parseOllamaConfig({ model: "x", think: "MEDIUM" }).think).toBe("medium");
|
|
46
|
+
expect(parseOllamaConfig({ model: "x", think: "low" }).think).toBe("low");
|
|
47
|
+
expect(parseOllamaConfig({ model: "x", think: "garbage" }).think).toBeNull();
|
|
48
|
+
});
|
|
49
|
+
it("accepts numeric and string keepAlive", () => {
|
|
50
|
+
expect(parseOllamaConfig({ model: "x", keepAlive: "10m" }).keepAlive).toBe("10m");
|
|
51
|
+
expect(parseOllamaConfig({ model: "x", keepAlive: 600 }).keepAlive).toBe(600);
|
|
52
|
+
expect(parseOllamaConfig({ model: "x", keepAlive: "" }).keepAlive).toBeNull();
|
|
53
|
+
});
|
|
54
|
+
it("clamps timeoutSec to a positive default", () => {
|
|
55
|
+
expect(parseOllamaConfig({ model: "x", timeoutSec: 0 }).timeoutSec).toBe(DEFAULT_TIMEOUT_SEC);
|
|
56
|
+
expect(parseOllamaConfig({ model: "x", timeoutSec: -5 }).timeoutSec).toBe(DEFAULT_TIMEOUT_SEC);
|
|
57
|
+
expect(parseOllamaConfig({ model: "x", timeoutSec: 90 }).timeoutSec).toBe(90);
|
|
58
|
+
});
|
|
59
|
+
it("captures ollamaTier verbatim", () => {
|
|
60
|
+
expect(parseOllamaConfig({ model: "x", ollamaTier: "pro" }).ollamaTier).toBe("pro");
|
|
61
|
+
expect(parseOllamaConfig({ model: "x", ollamaTier: " team " }).ollamaTier).toBe("team");
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe("buildOllamaHeaders", () => {
|
|
65
|
+
it("returns undefined when no key", () => {
|
|
66
|
+
expect(buildOllamaHeaders(null)).toBeUndefined();
|
|
67
|
+
});
|
|
68
|
+
it("formats Authorization: Bearer <key>", () => {
|
|
69
|
+
expect(buildOllamaHeaders("k1")).toEqual({ Authorization: "Bearer k1" });
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe("isCloudHost", () => {
|
|
73
|
+
it("recognizes ollama.com variants", () => {
|
|
74
|
+
expect(isCloudHost(CLOUD_HOST)).toBe(true);
|
|
75
|
+
expect(isCloudHost("https://ollama.com/")).toBe(true);
|
|
76
|
+
expect(isCloudHost("https://ollama.com/api")).toBe(true);
|
|
77
|
+
expect(isCloudHost("http://ollama.com")).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
it("treats local daemons as non-cloud", () => {
|
|
80
|
+
expect(isCloudHost("http://localhost:11434")).toBe(false);
|
|
81
|
+
expect(isCloudHost("http://127.0.0.1:11434")).toBe(false);
|
|
82
|
+
expect(isCloudHost("http://my-ollama-proxy.internal")).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=config.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../src/server/config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC3E,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,C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