agentfootprint 7.28.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 +23 -18
- package/README.md +41 -12
- package/ai-instructions/claude-code/SKILL.md +3 -3
- package/ai-instructions/clinerules +2 -2
- package/ai-instructions/copilot-instructions.md +2 -2
- package/ai-instructions/cursor/agentfootprint.md +2 -2
- package/ai-instructions/kiro/agentfootprint.md +2 -2
- package/ai-instructions/windsurfrules +2 -2
- 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/AgentBuilder.js +45 -11
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/watch.js +39 -0
- package/dist/core/agent/watch.js.map +1 -0
- 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/debug/finders.js +4 -0
- package/dist/debug/finders.js.map +1 -1
- package/dist/debug.js +4 -0
- package/dist/debug.js.map +1 -1
- package/dist/doors/context.js +34 -0
- package/dist/doors/context.js.map +1 -0
- package/dist/doors/hosting.js +32 -0
- package/dist/doors/hosting.js.map +1 -0
- package/dist/doors/memory.js +36 -0
- package/dist/doors/memory.js.map +1 -0
- package/dist/doors/observe.js +52 -0
- package/dist/doors/observe.js.map +1 -0
- package/dist/doors/providers.js +43 -0
- package/dist/doors/providers.js.map +1 -0
- package/dist/doors/resilience.js +61 -0
- package/dist/doors/resilience.js.map +1 -0
- package/dist/doors/security.js +39 -0
- package/dist/doors/security.js.map +1 -0
- package/dist/embedders/index.js.map +1 -1
- 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/AgentBuilder.d.ts +37 -7
- package/dist/esm/core/agent/AgentBuilder.js +45 -11
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/watch.d.ts +59 -0
- package/dist/esm/core/agent/watch.js +38 -0
- package/dist/esm/core/agent/watch.js.map +1 -0
- 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/debug/finders.d.ts +4 -0
- package/dist/esm/debug/finders.js +4 -0
- package/dist/esm/debug/finders.js.map +1 -1
- package/dist/esm/debug.d.ts +4 -0
- package/dist/esm/debug.js +4 -0
- package/dist/esm/debug.js.map +1 -1
- package/dist/esm/doors/context.d.ts +17 -0
- package/dist/esm/doors/context.js +18 -0
- package/dist/esm/doors/context.js.map +1 -0
- package/dist/esm/doors/hosting.d.ts +15 -0
- package/dist/esm/doors/hosting.js +16 -0
- package/dist/esm/doors/hosting.js.map +1 -0
- package/dist/esm/doors/memory.d.ts +19 -0
- package/dist/esm/doors/memory.js +20 -0
- package/dist/esm/doors/memory.js.map +1 -0
- package/dist/esm/doors/observe.d.ts +35 -0
- package/dist/esm/doors/observe.js +36 -0
- package/dist/esm/doors/observe.js.map +1 -0
- package/dist/esm/doors/providers.d.ts +26 -0
- package/dist/esm/doors/providers.js +27 -0
- package/dist/esm/doors/providers.js.map +1 -0
- package/dist/esm/doors/resilience.d.ts +37 -0
- package/dist/esm/doors/resilience.js +39 -0
- package/dist/esm/doors/resilience.js.map +1 -0
- package/dist/esm/doors/security.d.ts +22 -0
- package/dist/esm/doors/security.js +23 -0
- package/dist/esm/doors/security.js.map +1 -0
- package/dist/esm/embedders/index.d.ts +4 -0
- package/dist/esm/embedders/index.js.map +1 -1
- package/dist/esm/hosting-providers.d.ts +4 -0
- package/dist/esm/hosting-providers.js +4 -0
- package/dist/esm/hosting-providers.js.map +1 -1
- package/dist/esm/identity.d.ts +4 -0
- package/dist/esm/identity.js +4 -0
- package/dist/esm/identity.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/injection-engine.d.ts +4 -0
- package/dist/esm/injection-engine.js +4 -0
- package/dist/esm/injection-engine.js.map +1 -1
- package/dist/esm/llm-providers.d.ts +4 -0
- package/dist/esm/llm-providers.js +4 -0
- package/dist/esm/llm-providers.js.map +1 -1
- package/dist/esm/locales/index.d.ts +4 -0
- package/dist/esm/locales/index.js +4 -0
- package/dist/esm/locales/index.js.map +1 -1
- package/dist/esm/memory-providers.d.ts +4 -0
- package/dist/esm/memory-providers.js +4 -0
- package/dist/esm/memory-providers.js.map +1 -1
- package/dist/esm/observability/contextError/finders/index.d.ts +4 -0
- package/dist/esm/observability/contextError/finders/index.js.map +1 -1
- package/dist/esm/observability-providers.d.ts +4 -0
- package/dist/esm/observability-providers.js +4 -0
- package/dist/esm/observability-providers.js.map +1 -1
- 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/reliability/index.d.ts +8 -0
- package/dist/esm/reliability/index.js +8 -0
- package/dist/esm/reliability/index.js.map +1 -1
- package/dist/esm/status.d.ts +4 -0
- package/dist/esm/status.js +4 -0
- package/dist/esm/status.js.map +1 -1
- package/dist/esm/strategies/index.d.ts +4 -0
- package/dist/esm/strategies/index.js +4 -0
- package/dist/esm/strategies/index.js.map +1 -1
- package/dist/esm/stream.d.ts +4 -0
- package/dist/esm/stream.js +4 -0
- package/dist/esm/stream.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 +5 -0
- package/dist/esm/thinking/index.js +5 -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/esm/tool-providers/index.d.ts +4 -0
- package/dist/esm/tool-providers/index.js +4 -0
- package/dist/esm/tool-providers/index.js.map +1 -1
- package/dist/hosting-providers.js +4 -0
- package/dist/hosting-providers.js.map +1 -1
- package/dist/identity.js +4 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/injection-engine.js +4 -0
- package/dist/injection-engine.js.map +1 -1
- package/dist/llm-providers.js +4 -0
- package/dist/llm-providers.js.map +1 -1
- package/dist/locales/index.js +4 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/memory-providers.js +4 -0
- package/dist/memory-providers.js.map +1 -1
- package/dist/observability/contextError/finders/index.js.map +1 -1
- package/dist/observability-providers.js +4 -0
- package/dist/observability-providers.js.map +1 -1
- package/dist/providers.js +16 -6
- package/dist/providers.js.map +1 -1
- package/dist/reliability/index.js +8 -0
- package/dist/reliability/index.js.map +1 -1
- package/dist/status.js +4 -0
- package/dist/status.js.map +1 -1
- package/dist/strategies/index.js +4 -0
- package/dist/strategies/index.js.map +1 -1
- package/dist/stream.js +4 -0
- package/dist/stream.js.map +1 -1
- package/dist/thinking/OllamaThinkingHandler.js +111 -0
- package/dist/thinking/OllamaThinkingHandler.js.map +1 -0
- package/dist/thinking/index.js +8 -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/tool-providers/index.js +4 -0
- package/dist/tool-providers/index.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/AgentBuilder.d.ts +37 -7
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/watch.d.ts +60 -0
- package/dist/types/core/agent/watch.d.ts.map +1 -0
- 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/debug/finders.d.ts +4 -0
- package/dist/types/debug/finders.d.ts.map +1 -1
- package/dist/types/debug.d.ts +4 -0
- package/dist/types/debug.d.ts.map +1 -1
- package/dist/types/doors/context.d.ts +18 -0
- package/dist/types/doors/context.d.ts.map +1 -0
- package/dist/types/doors/hosting.d.ts +16 -0
- package/dist/types/doors/hosting.d.ts.map +1 -0
- package/dist/types/doors/memory.d.ts +20 -0
- package/dist/types/doors/memory.d.ts.map +1 -0
- package/dist/types/doors/observe.d.ts +36 -0
- package/dist/types/doors/observe.d.ts.map +1 -0
- package/dist/types/doors/providers.d.ts +27 -0
- package/dist/types/doors/providers.d.ts.map +1 -0
- package/dist/types/doors/resilience.d.ts +38 -0
- package/dist/types/doors/resilience.d.ts.map +1 -0
- package/dist/types/doors/security.d.ts +23 -0
- package/dist/types/doors/security.d.ts.map +1 -0
- package/dist/types/embedders/index.d.ts +4 -0
- package/dist/types/embedders/index.d.ts.map +1 -1
- package/dist/types/hosting-providers.d.ts +4 -0
- package/dist/types/hosting-providers.d.ts.map +1 -1
- package/dist/types/identity.d.ts +4 -0
- package/dist/types/identity.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/injection-engine.d.ts +4 -0
- package/dist/types/injection-engine.d.ts.map +1 -1
- package/dist/types/llm-providers.d.ts +4 -0
- package/dist/types/llm-providers.d.ts.map +1 -1
- package/dist/types/locales/index.d.ts +4 -0
- package/dist/types/locales/index.d.ts.map +1 -1
- package/dist/types/memory-providers.d.ts +4 -0
- package/dist/types/memory-providers.d.ts.map +1 -1
- package/dist/types/observability/contextError/finders/index.d.ts +4 -0
- package/dist/types/observability/contextError/finders/index.d.ts.map +1 -1
- package/dist/types/observability-providers.d.ts +4 -0
- package/dist/types/observability-providers.d.ts.map +1 -1
- package/dist/types/providers.d.ts +13 -5
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/reliability/index.d.ts +8 -0
- package/dist/types/reliability/index.d.ts.map +1 -1
- package/dist/types/status.d.ts +4 -0
- package/dist/types/status.d.ts.map +1 -1
- package/dist/types/strategies/index.d.ts +4 -0
- package/dist/types/strategies/index.d.ts.map +1 -1
- package/dist/types/stream.d.ts +4 -0
- package/dist/types/stream.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 +5 -0
- package/dist/types/thinking/index.d.ts.map +1 -1
- package/dist/types/thinking/registry.d.ts.map +1 -1
- package/dist/types/tool-providers/index.d.ts +4 -0
- package/dist/types/tool-providers/index.d.ts.map +1 -1
- package/package.json +184 -155
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OllamaProvider — local models over Ollama's native `/api/chat`.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Adapter (GoF) + Ports-and-Adapters (Cockburn 2005).
|
|
5
|
+
* Role: Outer ring — translates `LLMRequest`/`LLMResponse` to/from
|
|
6
|
+
* Ollama's native chat wire. Knows nothing about agents,
|
|
7
|
+
* recorders, or compositions.
|
|
8
|
+
* Emits: N/A.
|
|
9
|
+
*
|
|
10
|
+
* ─── Why this exists, and why it talks the native wire ───────────────
|
|
11
|
+
*
|
|
12
|
+
* The adapter ladder is `mock()` → a local model → a paid API, and the
|
|
13
|
+
* strongest version of "the test run and the production run are the same
|
|
14
|
+
* code path" is one where the middle step costs nothing and needs no API
|
|
15
|
+
* key. Through 8.0.0 the middle step needed BOTH a competitor's SDK
|
|
16
|
+
* (`npm install openai`, because `ollama()` was a thin wrapper over
|
|
17
|
+
* `openai({ baseURL })`) and a tolerance for failures labelled `[openai]`.
|
|
18
|
+
* That is not a free rung.
|
|
19
|
+
*
|
|
20
|
+
* So this file owns the wire:
|
|
21
|
+
*
|
|
22
|
+
* • ZERO dependencies — one `fetch` POST and NDJSON. Nothing to install
|
|
23
|
+
* beyond Ollama itself. (Same choice, same reasons, as the two
|
|
24
|
+
* `Browser*Provider` adapters.)
|
|
25
|
+
* • HONEST REFUSALS — a typed {@link OllamaUnavailableError} that names
|
|
26
|
+
* the address it tried and the command to run. Owning the fetch and
|
|
27
|
+
* the status code is what makes that possible; through an SDK you get
|
|
28
|
+
* whatever the SDK decided to throw.
|
|
29
|
+
* • REAL TOKEN COUNTS — `/api/chat` returns `prompt_eval_count` /
|
|
30
|
+
* `eval_count` on every response, streaming or not, with no opt-in
|
|
31
|
+
* flag. Through the OpenAI-compatible endpoint a streamed local call
|
|
32
|
+
* reported ZERO tokens, which silently disarmed `.compaction()` and
|
|
33
|
+
* `costBudget` (see `CompactionUnmeasurableError`, whose message names
|
|
34
|
+
* this exact case).
|
|
35
|
+
* • STRUCTURED THINKING — `message.thinking` is a first-class field on
|
|
36
|
+
* this wire; the OpenAI-compatible layer renames it to a non-standard
|
|
37
|
+
* `reasoning` key that no OpenAI adapter reads. See
|
|
38
|
+
* `OllamaThinkingHandler`.
|
|
39
|
+
*
|
|
40
|
+
* Want the SDK path instead? It is still there and still supported:
|
|
41
|
+
* `openai({ baseURL: 'http://localhost:11434/v1', apiKey: 'ollama' })`.
|
|
42
|
+
*
|
|
43
|
+
* ─── Ceilings (stated, not worked around) ────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* • TOOL CALLING IS MODEL-DEPENDENT. Ollama forwards a `tools` array to
|
|
46
|
+
* any model; a model that was not trained for tools simply answers in
|
|
47
|
+
* prose and no tool call ever arrives. This adapter does not preflight
|
|
48
|
+
* `/api/show` capabilities to refuse first — a wrong refusal is worse
|
|
49
|
+
* than a weak answer, and the metadata is less reliable than the
|
|
50
|
+
* ceiling being written down. Pick a tool-capable model.
|
|
51
|
+
* • NO FORCED TOOL CHOICE. Ollama does not support `tool_choice` on
|
|
52
|
+
* either wire, so `carriesForcedToolChoice` is `false` and an agent
|
|
53
|
+
* using `.outputSchema(parser, { strategy: 'tool-forced' })` refuses at
|
|
54
|
+
* run start, naming this provider.
|
|
55
|
+
* • NO MULTI-MODAL. The wire carries `images`; `LLMMessage.content` is a
|
|
56
|
+
* string. Same ceiling as every other adapter here.
|
|
57
|
+
* • NO PROMPT CACHING — resolves to the NoOp cache strategy.
|
|
58
|
+
* • NO `providerRef`. The native wire returns no response id, and a
|
|
59
|
+
* fabricated one would point at nothing.
|
|
60
|
+
*/
|
|
61
|
+
import type { LLMCallHooks, LLMChunk, LLMProvider, LLMRequest, LLMResponse, WireRole } from '../types.js';
|
|
62
|
+
/** How hard a thinking model should think. Ollama's own vocabulary. */
|
|
63
|
+
export type ThinkLevel = 'low' | 'medium' | 'high' | 'max';
|
|
64
|
+
/**
|
|
65
|
+
* The two failures a local runtime actually has, told in words that
|
|
66
|
+
* contain the fix.
|
|
67
|
+
*
|
|
68
|
+
* Both are things the person at the keyboard can resolve in one command,
|
|
69
|
+
* which is exactly why they get a type instead of a wrapped
|
|
70
|
+
* `ECONNREFUSED` or a bare `404`. `reason` is the discriminator; the
|
|
71
|
+
* message already reads as instructions.
|
|
72
|
+
*/
|
|
73
|
+
export declare class OllamaUnavailableError extends Error {
|
|
74
|
+
readonly name = "OllamaUnavailableError";
|
|
75
|
+
/** Which of the two situations this is. */
|
|
76
|
+
readonly reason: 'daemon-unreachable' | 'model-not-pulled';
|
|
77
|
+
/** The address that was tried — the thing to check or change. */
|
|
78
|
+
readonly baseUrl: string;
|
|
79
|
+
/** The model asked for. Absent when the daemon never answered at all. */
|
|
80
|
+
readonly model?: string;
|
|
81
|
+
/** Models this machine DOES have, when the daemon could tell us. */
|
|
82
|
+
readonly availableModels?: readonly string[];
|
|
83
|
+
constructor(init: {
|
|
84
|
+
reason: 'daemon-unreachable' | 'model-not-pulled';
|
|
85
|
+
baseUrl: string;
|
|
86
|
+
model?: string;
|
|
87
|
+
availableModels?: readonly string[];
|
|
88
|
+
cause?: unknown;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export interface OllamaProviderOptions {
|
|
92
|
+
/**
|
|
93
|
+
* Where Ollama is listening. Defaults to `OLLAMA_HOST` when set,
|
|
94
|
+
* otherwise `http://localhost:11434`. A bare `host:port` gets `http://`.
|
|
95
|
+
*
|
|
96
|
+
* Point it at the ROOT, not at a path — this adapter talks to
|
|
97
|
+
* `/api/chat` and `/api/tags` itself. A URL ending in `/v1` (the
|
|
98
|
+
* OpenAI-compatible path) is accepted and trimmed, so a config written
|
|
99
|
+
* for the 8.0.0 factory keeps working.
|
|
100
|
+
*/
|
|
101
|
+
readonly baseUrl?: string;
|
|
102
|
+
/** Shipped-in-8.0.0 spelling of {@link baseUrl}. Still honored. */
|
|
103
|
+
readonly host?: string;
|
|
104
|
+
/** Shipped-in-8.0.0 spelling of {@link baseUrl}. Still honored. */
|
|
105
|
+
readonly baseURL?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Model used when `LLMRequest.model` is the `'ollama'` shorthand.
|
|
108
|
+
* Prefer the positional form: `ollama('qwen3')`.
|
|
109
|
+
*/
|
|
110
|
+
readonly defaultModel?: string;
|
|
111
|
+
/** Default token cap when the request doesn't set one. Maps to `num_predict`. */
|
|
112
|
+
readonly defaultMaxTokens?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Ask a thinking model to reason before answering. `true` turns it on;
|
|
115
|
+
* `'low' | 'medium' | 'high' | 'max'` sets how hard.
|
|
116
|
+
*
|
|
117
|
+
* Worth setting on reasoning models (deepseek-r1, qwen3, gpt-oss, …):
|
|
118
|
+
* with `think` on, Ollama lifts the reasoning OUT of the answer into
|
|
119
|
+
* `message.thinking`, where `ollamaThinkingHandler` normalizes it.
|
|
120
|
+
* With it off, the same model leaves `<think>…</think>` sitting in the
|
|
121
|
+
* answer text.
|
|
122
|
+
*
|
|
123
|
+
* A per-request `LLMRequest.thinking` (what `AgentBuilder.thinking()`
|
|
124
|
+
* sets) also turns it on; this option is the always-on default and the
|
|
125
|
+
* only way to name a level.
|
|
126
|
+
*/
|
|
127
|
+
readonly think?: boolean | ThinkLevel;
|
|
128
|
+
/** How long Ollama keeps the model in memory after a call, e.g. `'5m'`. */
|
|
129
|
+
readonly keepAlive?: string | number;
|
|
130
|
+
/**
|
|
131
|
+
* How long to wait for the daemon to ANSWER, in ms. Default 10000.
|
|
132
|
+
*
|
|
133
|
+
* This bounds the wait for response headers, NOT generation: a laptop
|
|
134
|
+
* model may take minutes to finish a long answer and that is fine. What
|
|
135
|
+
* it prevents is the failure this whole file exists to avoid — a run
|
|
136
|
+
* that hangs because nothing is listening.
|
|
137
|
+
*/
|
|
138
|
+
readonly timeoutMs?: number;
|
|
139
|
+
/** Accepted and ignored — Ollama needs no key. Kept so 8.0.0 configs still typecheck. */
|
|
140
|
+
readonly apiKey?: string;
|
|
141
|
+
/** @internal Custom fetch implementation for tests. */
|
|
142
|
+
readonly _fetch?: typeof fetch;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build an `LLMProvider` backed by a local Ollama runtime.
|
|
146
|
+
*
|
|
147
|
+
* Free, offline, no API key. The rung between `mock()` and a paid API —
|
|
148
|
+
* and the agent code above it does not change between the three.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* import { Agent } from 'agentfootprint';
|
|
152
|
+
* import { ollama } from 'agentfootprint/providers';
|
|
153
|
+
*
|
|
154
|
+
* const agent = Agent.create({
|
|
155
|
+
* provider: ollama('qwen3'),
|
|
156
|
+
* model: 'qwen3',
|
|
157
|
+
* }).build();
|
|
158
|
+
*
|
|
159
|
+
* @example // reasoning model, thinking lifted out of the answer
|
|
160
|
+
* ollama('deepseek-r1', { think: 'high' });
|
|
161
|
+
*
|
|
162
|
+
* @example // a runtime on another machine
|
|
163
|
+
* ollama('llama3.2', { baseUrl: 'http://192.168.1.20:11434' });
|
|
164
|
+
*/
|
|
165
|
+
export declare function ollama(model: string, options?: OllamaProviderOptions): LLMProvider;
|
|
166
|
+
/**
|
|
167
|
+
* Object form, as shipped in 8.0.0. Still supported — `host` / `baseURL` /
|
|
168
|
+
* `defaultModel` / `apiKey` all keep their meaning.
|
|
169
|
+
*/
|
|
170
|
+
export declare function ollama(options?: OllamaProviderOptions): LLMProvider;
|
|
171
|
+
/**
|
|
172
|
+
* Class form for consumers who prefer `new OllamaProvider(...)`.
|
|
173
|
+
*/
|
|
174
|
+
export declare class OllamaProvider implements LLMProvider {
|
|
175
|
+
readonly name = "ollama";
|
|
176
|
+
readonly carriesInMessages: readonly WireRole[];
|
|
177
|
+
readonly carriesForcedToolChoice = false;
|
|
178
|
+
private readonly inner;
|
|
179
|
+
constructor(model?: string | OllamaProviderOptions, options?: OllamaProviderOptions);
|
|
180
|
+
complete(req: LLMRequest, hooks?: LLMCallHooks): Promise<LLMResponse>;
|
|
181
|
+
stream(req: LLMRequest, hooks?: LLMCallHooks): AsyncIterable<LLMChunk>;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=OllamaProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OllamaProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/OllamaProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE,OAAO,GAAG,UAAU,CAAC;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,CAAC;CAChC;AAoBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,WAAW,CAAC;AACpF;;;GAGG;AACH,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,WAAW,CAAC;AAsHrE;;GAEG;AACH,qBAAa,cAAe,YAAW,WAAW;IAChD,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,iBAAiB,sBAAuB;IACjD,QAAQ,CAAC,uBAAuB,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,KAAK,CAAC,EAAE,MAAM,GAAG,qBAAqB,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAMnF,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAIrE,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC;CAIvE"}
|
|
@@ -218,17 +218,5 @@ export interface AzureOpenAIProviderOptions {
|
|
|
218
218
|
* }).build();
|
|
219
219
|
*/
|
|
220
220
|
export declare function azureOpenai(options?: AzureOpenAIProviderOptions): LLMProvider;
|
|
221
|
-
/**
|
|
222
|
-
* Convenience factory for Ollama (OpenAI-compatible endpoint).
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* import { ollama } from 'agentfootprint/llm-providers';
|
|
226
|
-
*
|
|
227
|
-
* const provider = ollama({ defaultModel: 'llama3.2' });
|
|
228
|
-
* // Talks to http://localhost:11434/v1 by default.
|
|
229
|
-
*/
|
|
230
|
-
export declare function ollama(options?: OpenAIProviderOptions & {
|
|
231
|
-
readonly host?: string;
|
|
232
|
-
}): LLMProvider;
|
|
233
221
|
export {};
|
|
234
222
|
//# sourceMappingURL=OpenAIProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAIProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/OpenAIProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEX,QAAQ,EACT,MAAM,aAAa,CAAC;AAKrB,UAAU,YAAY;IACpB,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,MAAM,CACJ,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;SACrE,CAAC;KACH,CAAC;CACH;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB;oFACgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,cAAc,CAAC,EAAE;QAAE,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5C;mCAC+B;IAC/B,WAAW,CAAC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7B;kEAC8D;IAC9D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CACjC;AAKD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,0BAA+B,GAAG,WAAW,CAqCjF"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* defaultModel: process.env.LLM_MODEL,
|
|
16
16
|
* } as CreateProviderOptions);
|
|
17
17
|
*
|
|
18
|
-
* For provider-specific options (Bedrock region, Ollama
|
|
18
|
+
* For provider-specific options (Bedrock region, Ollama baseUrl, Browser
|
|
19
19
|
* apiUrl, etc.) construct the underlying factory directly — this
|
|
20
20
|
* helper deliberately exposes only the common subset.
|
|
21
21
|
*/
|
|
@@ -23,6 +23,7 @@ import type { LLMProvider } from '../types.js';
|
|
|
23
23
|
import { type MockProviderOptions } from './MockProvider.js';
|
|
24
24
|
import { type AnthropicProviderOptions } from './AnthropicProvider.js';
|
|
25
25
|
import { type OpenAIProviderOptions } from './OpenAIProvider.js';
|
|
26
|
+
import { type OllamaProviderOptions } from './OllamaProvider.js';
|
|
26
27
|
import { type BedrockProviderOptions } from './BedrockProvider.js';
|
|
27
28
|
import { type BrowserAnthropicProviderOptions } from './BrowserAnthropicProvider.js';
|
|
28
29
|
import { type BrowserOpenAIProviderOptions } from './BrowserOpenAIProvider.js';
|
|
@@ -42,9 +43,7 @@ export type CreateProviderOptions = ({
|
|
|
42
43
|
readonly kind: 'openai';
|
|
43
44
|
} & OpenAIProviderOptions) | ({
|
|
44
45
|
readonly kind: 'ollama';
|
|
45
|
-
} &
|
|
46
|
-
readonly host?: string;
|
|
47
|
-
}) | ({
|
|
46
|
+
} & OllamaProviderOptions) | ({
|
|
48
47
|
readonly kind: 'bedrock';
|
|
49
48
|
} & BedrockProviderOptions) | ({
|
|
50
49
|
readonly kind: 'browser-anthropic';
|
|
@@ -60,7 +59,7 @@ export declare function createProvider(options: CreateProviderOptions): LLMProvi
|
|
|
60
59
|
export interface ProviderFromEnv {
|
|
61
60
|
readonly provider: LLMProvider;
|
|
62
61
|
readonly model: string;
|
|
63
|
-
readonly kind: 'azure-openai' | 'anthropic' | 'openai' | 'mock';
|
|
62
|
+
readonly kind: 'ollama' | 'azure-openai' | 'anthropic' | 'openai' | 'mock';
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
66
65
|
* Resolve an `LLMProvider` from environment variables — drop your company's
|
|
@@ -69,12 +68,30 @@ export interface ProviderFromEnv {
|
|
|
69
68
|
* only for the detected provider.)
|
|
70
69
|
*
|
|
71
70
|
* Detection order (first match wins):
|
|
72
|
-
* 1. **
|
|
71
|
+
* 1. **Ollama (local)** — `OLLAMA_MODEL` names a model, e.g. `qwen3`
|
|
72
|
+
* [+ `OLLAMA_HOST` for a runtime that isn't on localhost]
|
|
73
|
+
* 2. **Azure OpenAI** — `AZURE_OPENAI_API_KEY` + (`AZURE_OPENAI_ENDPOINT` |
|
|
73
74
|
* `OPENAI_BASE_URL`) [+ `AZURE_OPENAI_API_VERSION`, `AZURE_OPENAI_DEPLOYMENT`|`MODEL_NAME`]
|
|
74
|
-
*
|
|
75
|
-
*
|
|
75
|
+
* 3. **Anthropic** — `ANTHROPIC_API_KEY`
|
|
76
|
+
* 4. **OpenAI** — `OPENAI_API_KEY`
|
|
76
77
|
* Otherwise throws (or returns the mock when `{ fallbackToMock: true }`).
|
|
77
78
|
*
|
|
79
|
+
* **Why the local model goes first.** Every other arm triggers on a
|
|
80
|
+
* CREDENTIAL, and credentials arrive in a shell by accident all the time —
|
|
81
|
+
* a key exported in `.zshrc` two months ago for something else. `OLLAMA_MODEL`
|
|
82
|
+
* triggers on a NAME you had to choose and type, so its presence is a
|
|
83
|
+
* declaration rather than a leftover: someone who writes `OLLAMA_MODEL=qwen3`
|
|
84
|
+
* has said which model they want this run to use, and honoring the cloud key
|
|
85
|
+
* instead would both ignore them and cost them money. (`OLLAMA_HOST` alone is
|
|
86
|
+
* NOT a trigger — people export it just to run Ollama, and it must not hijack
|
|
87
|
+
* an app that never asked for a local model.)
|
|
88
|
+
*
|
|
89
|
+
* **No probing.** This function reads environment variables and nothing else.
|
|
90
|
+
* It never opens a socket to see whether a daemon is up — its answer stays
|
|
91
|
+
* deterministic, instant, and identical on a laptop and in CI. If `OLLAMA_MODEL`
|
|
92
|
+
* is set and the daemon is down, you get the provider, and the refusal arrives
|
|
93
|
+
* from the call itself with `ollama serve` in the message.
|
|
94
|
+
*
|
|
78
95
|
* @example
|
|
79
96
|
* import { providerFromEnv } from 'agentfootprint';
|
|
80
97
|
* const { provider, model, kind } = providerFromEnv({ fallbackToMock: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/createProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAQ,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAa,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"createProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/createProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAQ,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAa,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,E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C,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,eAAe,CAAC,IAAI,GAAE;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,eAAe,CA2DjG"}
|
|
@@ -17,6 +17,7 @@ import type { ThinkingHandler } from '../../thinking/types.js';
|
|
|
17
17
|
import type { Tool } from '../tools.js';
|
|
18
18
|
import type { CheckInBuilderOptions } from '../checkin.js';
|
|
19
19
|
import type { ToolProvider } from '../../tool-providers/types.js';
|
|
20
|
+
import type { Watcher } from './watch.js';
|
|
20
21
|
import { type SelfExplainOptions } from '../../lib/trace-toolpack/selfExplain.js';
|
|
21
22
|
import { Agent } from '../Agent.js';
|
|
22
23
|
import type { AgentOptions, RunConfigFn } from './types.js';
|
|
@@ -94,8 +95,9 @@ export declare class AgentBuilder {
|
|
|
94
95
|
*/
|
|
95
96
|
private maxIterationsOverride?;
|
|
96
97
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
98
|
+
* Observers collected via `.watch()` (or its deprecated spelling
|
|
99
|
+
* `.recorder()`). Attached to the built Agent before `build()` returns
|
|
100
|
+
* (each via `agent.attach(rec)`), in call order.
|
|
99
101
|
*/
|
|
100
102
|
private readonly recorderList;
|
|
101
103
|
private appNameValue;
|
|
@@ -403,17 +405,45 @@ export declare class AgentBuilder {
|
|
|
403
405
|
* (`clampIterations`'s upper bound).
|
|
404
406
|
*/
|
|
405
407
|
maxIterations(n: number): this;
|
|
408
|
+
/**
|
|
409
|
+
* Watch this agent. `.act()` says what the agent may do; `.watch()` says
|
|
410
|
+
* who is looking while it does it.
|
|
411
|
+
*
|
|
412
|
+
* Every observer handed here is attached before `build()` returns, so it
|
|
413
|
+
* sees every event from the very first run — there is no window where the
|
|
414
|
+
* agent has run and nobody was watching.
|
|
415
|
+
*
|
|
416
|
+
* Variadic, because observers come in sets:
|
|
417
|
+
*
|
|
418
|
+
* ```ts
|
|
419
|
+
* const agent = Agent.create({ provider, model })
|
|
420
|
+
* .watch(toolChoiceRecorder(), routeRecorder())
|
|
421
|
+
* .act({ beforeTool: [budgetGuard] })
|
|
422
|
+
* .build();
|
|
423
|
+
* ```
|
|
424
|
+
*
|
|
425
|
+
* Build time, not run time. This returns the builder; `agent.attach(o)`
|
|
426
|
+
* attaches to a live agent and returns an `Unsubscribe` you own. Same
|
|
427
|
+
* mechanism underneath — `.watch()` replays through `agent.attach()` at
|
|
428
|
+
* the end of `build()` — so mixing the two is fine and order is preserved.
|
|
429
|
+
*
|
|
430
|
+
* Called more than once, the sets concatenate in call order. Nothing is
|
|
431
|
+
* de-duplicated here; footprintjs's executor dedupes by recorder id at run
|
|
432
|
+
* time, so the same observer handed in twice still fires once.
|
|
433
|
+
*/
|
|
434
|
+
watch(...observers: readonly Watcher[]): this;
|
|
406
435
|
/**
|
|
407
436
|
* Attach a footprintjs `CombinedRecorder` to the built Agent. Wired
|
|
408
437
|
* via `agent.attach(rec)` immediately after construction, so the
|
|
409
438
|
* recorder sees every event from the very first run.
|
|
410
439
|
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
440
|
+
* @deprecated Since 8.0.0 — use {@link AgentBuilder.watch} instead. Same
|
|
441
|
+
* list, same order, same attachment: `.watch(rec)` is this method under the
|
|
442
|
+
* name the loop already used for it (see `moments.ts` — "an observer
|
|
443
|
+
* reports, a rule changes what happens next"), and it takes more than one.
|
|
444
|
+
* This method keeps working for all of 8.x and is removed in 9.0.0.
|
|
415
445
|
*/
|
|
416
|
-
recorder(rec:
|
|
446
|
+
recorder(rec: Watcher): this;
|
|
417
447
|
/**
|
|
418
448
|
* Set the agent's display name — substituted as `{{appName}}` in
|
|
419
449
|
* commentary + thinking templates. Same place to brand a tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/agent/AgentBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAG7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAqB,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/agent/AgentBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY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,IAAI,GAAE,qBAA0B,GAAG,IAAI;IAQ/C,WAAW,CAAC,IAAI,GAAE,kBAAuB,GAAG,IAAI;IAmBhD;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAyDhC,KAAK,IAAI,KAAK;CAwFf"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* watch — PUBLIC. The door named for what an observer does.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: naming, not machinery. `.watch()` attaches exactly what
|
|
5
|
+
* `.recorder()` attached; the type it takes is exactly footprintjs's
|
|
6
|
+
* `CombinedRecorder`. Nothing new happens at run time.
|
|
7
|
+
* Role: core/ layer. The counterpart `moments.ts` has described in prose
|
|
8
|
+
* since the loop moments were written down:
|
|
9
|
+
*
|
|
10
|
+
* "`watch` attends all five and more; `act` attends exactly these.
|
|
11
|
+
* The difference is what a rule may DO there — an observer
|
|
12
|
+
* reports, a rule changes what happens next."
|
|
13
|
+
*
|
|
14
|
+
* That sentence named an API that did not exist. This is it.
|
|
15
|
+
* Emits: N/A (one type alias).
|
|
16
|
+
*
|
|
17
|
+
* ## Why there is no `WATCH_MOMENTS`
|
|
18
|
+
*
|
|
19
|
+
* `.act()`'s keys are a closed, compiler-pinned list because a rule has to be
|
|
20
|
+
* TOLD where it may speak — a rule written for a moment nobody reads is a
|
|
21
|
+
* governance hole, so the list is checked and the build fails when it drifts.
|
|
22
|
+
* An observer is the opposite: it attends the entire event stream, and there
|
|
23
|
+
* is no closed set to enumerate. Publishing a `WATCH_MOMENTS` list would be
|
|
24
|
+
* inventing a vocabulary we would then have to keep true against every event
|
|
25
|
+
* added forever. The honest surface for watching is the door and the type.
|
|
26
|
+
*
|
|
27
|
+
* ## Build time and run time are different doors on purpose
|
|
28
|
+
*
|
|
29
|
+
* `.watch(observer)` — on the BUILDER. Attached before the agent exists,
|
|
30
|
+
* so the observer sees the very first run. Returns
|
|
31
|
+
* the builder, because you are still building.
|
|
32
|
+
* `agent.attach(o)` — on the RUNNER. Attached to a live agent, and
|
|
33
|
+
* returns an `Unsubscribe` you own and must call.
|
|
34
|
+
*
|
|
35
|
+
* Two return types, no ambiguity about which one you are holding.
|
|
36
|
+
*/
|
|
37
|
+
import type { CombinedRecorder } from 'footprintjs';
|
|
38
|
+
/**
|
|
39
|
+
* Anything that can watch a run.
|
|
40
|
+
*
|
|
41
|
+
* The plain name for footprintjs's `CombinedRecorder` — the substrate's word
|
|
42
|
+
* for the same thing, still exported from the main barrel for anyone typing
|
|
43
|
+
* against the engine directly. Every recorder factory in
|
|
44
|
+
* `agentfootprint/observe` returns something assignable to this, as does any
|
|
45
|
+
* object with the recorder hook methods on it.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { Agent, type Watcher } from 'agentfootprint';
|
|
50
|
+
* import { toolChoiceRecorder, routeRecorder } from 'agentfootprint/observe';
|
|
51
|
+
*
|
|
52
|
+
* const observers: Watcher[] = [toolChoiceRecorder(), routeRecorder()];
|
|
53
|
+
*
|
|
54
|
+
* const agent = Agent.create({ provider, model })
|
|
55
|
+
* .watch(...observers)
|
|
56
|
+
* .build();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export type Watcher = CombinedRecorder;
|
|
60
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../src/core/agent/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,OAAO,GAAG,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/window/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;GAYG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,SAAkB,IAAI,iCAAiC;IACvD,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/window/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;GAYG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,SAAkB,IAAI,iCAAiC;IACvD,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM;CAa7B"}
|
|
@@ -37,10 +37,10 @@ export declare const SLIDING_WINDOW = "sliding-window";
|
|
|
37
37
|
* @example
|
|
38
38
|
* ```ts
|
|
39
39
|
* import { Agent, slidingWindow } from 'agentfootprint';
|
|
40
|
-
* import { ollama } from 'agentfootprint/
|
|
40
|
+
* import { ollama } from 'agentfootprint/providers';
|
|
41
41
|
*
|
|
42
42
|
* // Works on a provider that reports no usage at all: the trigger is turns.
|
|
43
|
-
* const agent = Agent.create({ provider: ollama(), model: 'llama3' })
|
|
43
|
+
* const agent = Agent.create({ provider: ollama('llama3.2'), model: 'llama3.2' })
|
|
44
44
|
* .window(slidingWindow({ keepRecentTurns: 12 }))
|
|
45
45
|
* .build();
|
|
46
46
|
* ```
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The old `agentfootprint/observability/contextError/finders` path is kept
|
|
10
10
|
* (deprecated) for one transition version.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Since 8.0.0 — import from `agentfootprint/observe` instead.
|
|
13
|
+
* This path keeps working for all of 8.x and is removed in 9.0.0. Every name
|
|
14
|
+
* here is the same symbol on the new door, not a copy.
|
|
11
15
|
*/
|
|
12
16
|
export * from '../observability/contextError/finders/index.js';
|
|
13
17
|
//# sourceMappingURL=finders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finders.d.ts","sourceRoot":"","sources":["../../../src/debug/finders.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"finders.d.ts","sourceRoot":"","sources":["../../../src/debug/finders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,gDAAgD,CAAC"}
|
package/dist/types/debug.d.ts
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
*
|
|
17
17
|
* For backward compatibility these are ALSO re-exported (deprecated) from
|
|
18
18
|
* `agentfootprint/observe` for one transition version.
|
|
19
|
+
*
|
|
20
|
+
* @deprecated Since 8.0.0 — import from `agentfootprint/observe` instead.
|
|
21
|
+
* This path keeps working for all of 8.x and is removed in 9.0.0. Every name
|
|
22
|
+
* here is the same symbol on the new door, not a copy.
|
|
19
23
|
*/
|
|
20
24
|
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_CLEAR_WINNER_MARGIN, DEFAULT_CLEAR_WINNER_RATIO, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, DEFAULT_SHORTLIST_BAND, EmbeddingCache, embeddingCache, finalAnswerSimilarity, attributeChoice, explainChoice, lexicalOverlapStrategy, listInfluenceStrategies, marginStrategy, pairwiseSimilarity, persistence, rankingConfidence, ratioStrategy, scoreContrastiveInfluence, scoreInfluence, scoreLexicalInfluence, scoreMargin, semanticAlignmentStrategy, snippetUnits, structuralProximity, type AttributeChoiceArgs, type AttributionUnit, type CandidateScore, type ChannelVerdict, type ChoiceAttribution, type ChoiceExplanation, type ConfidenceStrategy, type Embedder, type EmbeddingCacheOptions, type EmbeddingCacheStats, type EvidenceInput, type ExplainChoiceArgs, type InfluenceScore, type InfluenceScorer, type InfluenceStrategy, type InfluenceStrategyRequirement, type InfluenceWeights, type MarginCandidate, type MarginResult, type PairwiseSimilarityArgs, type PairwiseSimilarityResult, type RankingConfidence, type RankingConfidenceOptions, type ScoreContrastiveInfluenceArgs, type ScoreInfluenceArgs, type ScoreLexicalInfluenceArgs, type ScoreMarginArgs, type SignalScores, type SimilarityItem, type SimilarityPair, type SnippetUnitsOptions, type UnitScore, } from './lib/influence-core/index.js';
|
|
21
25
|
export { callTraceTool, lazyTraceToolpack, NO_COMPLETED_RUN_MESSAGE, TOOLPACK_HARD_CAPS, traceToolpack, type TraceToolpackArtifacts, type TraceToolpackOptions, } from './lib/trace-toolpack/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAA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AwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,GACrC,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint/context — how the model's context gets assembled.
|
|
3
|
+
*
|
|
4
|
+
* The injection engine: one `Injection` type, the sugar factories that build
|
|
5
|
+
* one, and the engine subflow that resolves them into the three slots a
|
|
6
|
+
* request is made of (system prompt, messages, tools).
|
|
7
|
+
*
|
|
8
|
+
* Named for the job rather than the machine — this was
|
|
9
|
+
* `agentfootprint/injection-engine`, which described our implementation
|
|
10
|
+
* instead of your task.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { defineInjection, type Injection } from 'agentfootprint/context';
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export * from '../injection-engine.js';
|
|
18
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/doors/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint/hosting — putting an agent behind a wire.
|
|
3
|
+
*
|
|
4
|
+
* The hosts (`nodeHost`, `httpHost`, `standingAgent`), the session stores
|
|
5
|
+
* (in-memory, SQLite), the checkpoint envelope helpers, the typed host
|
|
6
|
+
* errors — and the AgentCore runtime host + session adapters that speak the
|
|
7
|
+
* same ports.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { httpHost, memorySessions, agentCoreRuntimeHost } from 'agentfootprint/hosting';
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export * from '../hosting/index.js';
|
|
15
|
+
export * from '../hosting-providers.js';
|
|
16
|
+
//# sourceMappingURL=hosting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../../src/doors/hosting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint/memory — state that outlives a turn.
|
|
3
|
+
*
|
|
4
|
+
* `defineMemory` and the whole memory subsystem (beats, facts, causal
|
|
5
|
+
* recall, embedding retrieval, pipelines, the `MemoryStore` port), together
|
|
6
|
+
* with the shipped stores you can point it at: Redis, AgentCore, and the
|
|
7
|
+
* read-only Bedrock Agents session-summary reader.
|
|
8
|
+
*
|
|
9
|
+
* Prompt caching lives at `agentfootprint/cache`, deliberately NOT here: it
|
|
10
|
+
* registers vendor cache strategies on import, and side-effectful code stays
|
|
11
|
+
* behind its own door rather than riding along with `defineMemory`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { defineMemory, MEMORY_TYPES, RedisStore } from 'agentfootprint/memory';
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export * from '../memory/index.js';
|
|
19
|
+
export * from '../memory-providers.js';
|
|
20
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/doors/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC"}
|