agentfootprint 8.0.0 → 8.1.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.
- package/AGENTS.md +14 -9
- package/README.md +11 -7
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/ai-instructions/clinerules +1 -1
- package/ai-instructions/copilot-instructions.md +1 -1
- package/ai-instructions/cursor/agentfootprint.md +1 -1
- package/ai-instructions/kiro/agentfootprint.md +1 -1
- package/ai-instructions/windsurfrules +1 -1
- package/dist/adapters/llm/OllamaProvider.js +628 -0
- package/dist/adapters/llm/OllamaProvider.js.map +1 -0
- package/dist/adapters/llm/OpenAIProvider.js +12 -21
- package/dist/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/adapters/llm/createProvider.js +35 -6
- package/dist/adapters/llm/createProvider.js.map +1 -1
- package/dist/core/agent/window/errors.js +4 -3
- package/dist/core/agent/window/errors.js.map +1 -1
- package/dist/core/agent/window/strategies/slidingWindow.js +2 -2
- package/dist/esm/adapters/llm/OllamaProvider.d.ts +182 -0
- package/dist/esm/adapters/llm/OllamaProvider.js +622 -0
- package/dist/esm/adapters/llm/OllamaProvider.js.map +1 -0
- package/dist/esm/adapters/llm/OpenAIProvider.d.ts +0 -12
- package/dist/esm/adapters/llm/OpenAIProvider.js +11 -19
- package/dist/esm/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/esm/adapters/llm/createProvider.d.ts +25 -8
- package/dist/esm/adapters/llm/createProvider.js +35 -6
- package/dist/esm/adapters/llm/createProvider.js.map +1 -1
- package/dist/esm/core/agent/window/errors.js +4 -3
- package/dist/esm/core/agent/window/errors.js.map +1 -1
- package/dist/esm/core/agent/window/strategies/slidingWindow.d.ts +2 -2
- package/dist/esm/core/agent/window/strategies/slidingWindow.js +2 -2
- package/dist/esm/providers.d.ts +13 -5
- package/dist/esm/providers.js +13 -5
- package/dist/esm/providers.js.map +1 -1
- package/dist/esm/thinking/OllamaThinkingHandler.d.ts +60 -0
- package/dist/esm/thinking/OllamaThinkingHandler.js +107 -0
- package/dist/esm/thinking/OllamaThinkingHandler.js.map +1 -0
- package/dist/esm/thinking/index.d.ts +1 -0
- package/dist/esm/thinking/index.js +1 -0
- package/dist/esm/thinking/index.js.map +1 -1
- package/dist/esm/thinking/registry.js +2 -0
- package/dist/esm/thinking/registry.js.map +1 -1
- package/dist/providers.js +16 -6
- package/dist/providers.js.map +1 -1
- package/dist/thinking/OllamaThinkingHandler.js +111 -0
- package/dist/thinking/OllamaThinkingHandler.js.map +1 -0
- package/dist/thinking/index.js +4 -1
- package/dist/thinking/index.js.map +1 -1
- package/dist/thinking/registry.js +2 -0
- package/dist/thinking/registry.js.map +1 -1
- package/dist/types/adapters/llm/OllamaProvider.d.ts +183 -0
- package/dist/types/adapters/llm/OllamaProvider.d.ts.map +1 -0
- package/dist/types/adapters/llm/OpenAIProvider.d.ts +0 -12
- package/dist/types/adapters/llm/OpenAIProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/createProvider.d.ts +25 -8
- package/dist/types/adapters/llm/createProvider.d.ts.map +1 -1
- package/dist/types/core/agent/window/errors.d.ts.map +1 -1
- package/dist/types/core/agent/window/strategies/slidingWindow.d.ts +2 -2
- package/dist/types/providers.d.ts +13 -5
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/thinking/OllamaThinkingHandler.d.ts +61 -0
- package/dist/types/thinking/OllamaThinkingHandler.d.ts.map +1 -0
- package/dist/types/thinking/index.d.ts +1 -0
- package/dist/types/thinking/index.d.ts.map +1 -1
- package/dist/types/thinking/registry.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OllamaThinkingHandler — normalizes a local reasoning model's thinking
|
|
3
|
+
* into the framework's `ThinkingBlock[]` contract.
|
|
4
|
+
*
|
|
5
|
+
* Local reasoning models (deepseek-r1, qwen3, gpt-oss, …) reason in the
|
|
6
|
+
* open, and where that reasoning LANDS depends on how they were asked:
|
|
7
|
+
*
|
|
8
|
+
* 1. ASKED (`ollama('qwen3', { think: true })`, or the agent's
|
|
9
|
+
* `.thinking({ budget })`) — Ollama lifts the reasoning out of the
|
|
10
|
+
* answer into `message.thinking`. The adapter forwards it as
|
|
11
|
+
* `{ kind: 'field', thinking }`. This is the good path.
|
|
12
|
+
*
|
|
13
|
+
* 2. NOT ASKED — the same model writes `<think>…</think>` straight into
|
|
14
|
+
* the answer text. The adapter recognizes the shape and forwards the
|
|
15
|
+
* whole answer as `{ kind: 'inline', content }`.
|
|
16
|
+
*
|
|
17
|
+
* **The library recognizes the inline shape; it never rewrites the
|
|
18
|
+
* answer.** Blocks produced from case 2 describe text that is STILL
|
|
19
|
+
* present, verbatim, in `LLMResponse.content` — because silently editing
|
|
20
|
+
* a model's answer is a meaning change, and that is the application's
|
|
21
|
+
* decision to make, not this library's. If you want the reasoning out of
|
|
22
|
+
* the answer, ask for it: turn `think` on, and the model stops putting it
|
|
23
|
+
* there.
|
|
24
|
+
*
|
|
25
|
+
* **No signature** — nothing on this wire is signed, so there is no
|
|
26
|
+
* round-trip integrity invariant (unlike Anthropic). `signature` stays
|
|
27
|
+
* undefined.
|
|
28
|
+
*
|
|
29
|
+
* **No `summary` flag** — this is raw reasoning, not a structured summary
|
|
30
|
+
* (unlike OpenAI's `reasoning_summary`).
|
|
31
|
+
*
|
|
32
|
+
* **`parseChunk`** — the adapter already emits `LLMChunk.thinkingDelta`
|
|
33
|
+
* directly while streaming (Ollama sends `message.thinking` deltas frame
|
|
34
|
+
* by frame), so the framework does not need this to see live reasoning.
|
|
35
|
+
* It is implemented anyway for consumers driving the handler themselves.
|
|
36
|
+
*/
|
|
37
|
+
import type { ThinkingHandler } from './types.js';
|
|
38
|
+
/**
|
|
39
|
+
* What `OllamaProvider` puts on `LLMResponse.rawThinking`.
|
|
40
|
+
*
|
|
41
|
+
* Tagged rather than a bare string so the handler never has to GUESS which
|
|
42
|
+
* of the two situations it is looking at — and so a consumer reading the
|
|
43
|
+
* raw value can tell whether the reasoning is also sitting in the answer.
|
|
44
|
+
*/
|
|
45
|
+
export type OllamaRawThinking = {
|
|
46
|
+
readonly kind: 'field';
|
|
47
|
+
readonly thinking: string;
|
|
48
|
+
} | {
|
|
49
|
+
readonly kind: 'inline';
|
|
50
|
+
readonly content: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Pull the reasoning out of text that carries `<think>` tags.
|
|
54
|
+
*
|
|
55
|
+
* All tag PARSING lives here, in the handler — the adapter only notices
|
|
56
|
+
* that a `<think` substring is present and tags the payload accordingly.
|
|
57
|
+
* Exported so a consumer driving normalization by hand can reuse it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function extractInlineThinking(text: string): readonly string[];
|
|
60
|
+
export declare const ollamaThinkingHandler: ThinkingHandler;
|
|
61
|
+
//# sourceMappingURL=OllamaThinkingHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OllamaThinkingHandler.d.ts","sourceRoot":"","sources":["../../../src/thinking/OllamaThinkingHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAK1D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAUrE;AAMD,eAAO,MAAM,qBAAqB,EAAE,eAkCnC,CAAC"}
|
|
@@ -52,5 +52,6 @@ export type { ThinkingBlock, ThinkingHandler } from './types.js';
|
|
|
52
52
|
export { mockThinkingHandler, mockAnthropicRaw, mockOpenAIRaw } from './MockThinkingHandler.js';
|
|
53
53
|
export { anthropicThinkingHandler } from './AnthropicThinkingHandler.js';
|
|
54
54
|
export { openAIThinkingHandler } from './OpenAIThinkingHandler.js';
|
|
55
|
+
export { ollamaThinkingHandler, extractInlineThinking, type OllamaRawThinking, } from './OllamaThinkingHandler.js';
|
|
55
56
|
export { SHIPPED_THINKING_HANDLERS, findThinkingHandler } from './registry.js';
|
|
56
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/thinking/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/thinking/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/thinking/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/thinking/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,eAAe,EAK/D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAKrF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfootprint",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"claude",
|
|
39
39
|
"openai",
|
|
40
40
|
"bedrock",
|
|
41
|
+
"ollama",
|
|
42
|
+
"local-llm",
|
|
41
43
|
"mcp",
|
|
42
44
|
"a2a",
|
|
43
45
|
"human-in-the-loop",
|