@proposit/proposit-core 2.1.0 → 2.2.1

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 (83) hide show
  1. package/dist/extensions/basics/schemata.d.ts.map +1 -1
  2. package/dist/extensions/basics/schemata.js +8 -0
  3. package/dist/extensions/basics/schemata.js.map +1 -1
  4. package/dist/extensions/chat-completions/errors.d.ts +66 -0
  5. package/dist/extensions/chat-completions/errors.d.ts.map +1 -0
  6. package/dist/extensions/chat-completions/errors.js +139 -0
  7. package/dist/extensions/chat-completions/errors.js.map +1 -0
  8. package/dist/extensions/chat-completions/http.d.ts +10 -0
  9. package/dist/extensions/chat-completions/http.d.ts.map +1 -0
  10. package/dist/extensions/chat-completions/http.js +80 -0
  11. package/dist/extensions/chat-completions/http.js.map +1 -0
  12. package/dist/extensions/chat-completions/index.d.ts +7 -0
  13. package/dist/extensions/chat-completions/index.d.ts.map +1 -0
  14. package/dist/extensions/chat-completions/index.js +18 -0
  15. package/dist/extensions/chat-completions/index.js.map +1 -0
  16. package/dist/extensions/chat-completions/provider.d.ts +5 -0
  17. package/dist/extensions/chat-completions/provider.d.ts.map +1 -0
  18. package/dist/extensions/chat-completions/provider.js +192 -0
  19. package/dist/extensions/chat-completions/provider.js.map +1 -0
  20. package/dist/extensions/chat-completions/structured-output.d.ts +18 -0
  21. package/dist/extensions/chat-completions/structured-output.d.ts.map +1 -0
  22. package/dist/extensions/{ollama → chat-completions}/structured-output.js +27 -13
  23. package/dist/extensions/chat-completions/structured-output.js.map +1 -0
  24. package/dist/extensions/chat-completions/types.d.ts +65 -0
  25. package/dist/extensions/chat-completions/types.d.ts.map +1 -0
  26. package/dist/extensions/chat-completions/types.js +19 -0
  27. package/dist/extensions/chat-completions/types.js.map +1 -0
  28. package/dist/extensions/openai/openai-retrieval.d.ts.map +1 -1
  29. package/dist/extensions/openai/openai-retrieval.js +2 -9
  30. package/dist/extensions/openai/openai-retrieval.js.map +1 -1
  31. package/dist/extensions/openai/provider.d.ts +2 -2
  32. package/dist/extensions/openai/provider.d.ts.map +1 -1
  33. package/dist/extensions/openai/provider.js +5 -9
  34. package/dist/extensions/openai/provider.js.map +1 -1
  35. package/dist/extensions/openai/structured-output.d.ts.map +1 -1
  36. package/dist/extensions/openai/structured-output.js +12 -3
  37. package/dist/extensions/openai/structured-output.js.map +1 -1
  38. package/dist/extensions/openai/types.d.ts +19 -0
  39. package/dist/extensions/openai/types.d.ts.map +1 -1
  40. package/dist/extensions/openai/types.js +22 -0
  41. package/dist/extensions/openai/types.js.map +1 -1
  42. package/dist/extensions/pipelines/base/types.d.ts +6 -5
  43. package/dist/extensions/pipelines/base/types.d.ts.map +1 -1
  44. package/dist/extensions/structured-output/length-hint.d.ts +29 -0
  45. package/dist/extensions/structured-output/length-hint.d.ts.map +1 -0
  46. package/dist/extensions/structured-output/length-hint.js +120 -0
  47. package/dist/extensions/structured-output/length-hint.js.map +1 -0
  48. package/dist/lib/pipelines/debug-log.d.ts +14 -0
  49. package/dist/lib/pipelines/debug-log.d.ts.map +1 -1
  50. package/dist/lib/pipelines/debug-log.js +13 -0
  51. package/dist/lib/pipelines/debug-log.js.map +1 -1
  52. package/dist/lib/pipelines/index.d.ts +1 -1
  53. package/dist/lib/pipelines/index.d.ts.map +1 -1
  54. package/dist/lib/pipelines/index.js +1 -1
  55. package/dist/lib/pipelines/index.js.map +1 -1
  56. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
  57. package/dist/lib/pipelines/stage-helpers.js +49 -1
  58. package/dist/lib/pipelines/stage-helpers.js.map +1 -1
  59. package/dist/lib/pipelines/types.d.ts +2 -2
  60. package/package.json +6 -16
  61. package/dist/extensions/ollama/errors.d.ts +0 -73
  62. package/dist/extensions/ollama/errors.d.ts.map +0 -1
  63. package/dist/extensions/ollama/errors.js +0 -228
  64. package/dist/extensions/ollama/errors.js.map +0 -1
  65. package/dist/extensions/ollama/index.d.ts +0 -6
  66. package/dist/extensions/ollama/index.d.ts.map +0 -1
  67. package/dist/extensions/ollama/index.js +0 -17
  68. package/dist/extensions/ollama/index.js.map +0 -1
  69. package/dist/extensions/ollama/provider.d.ts +0 -22
  70. package/dist/extensions/ollama/provider.d.ts.map +0 -1
  71. package/dist/extensions/ollama/provider.js +0 -417
  72. package/dist/extensions/ollama/provider.js.map +0 -1
  73. package/dist/extensions/ollama/structured-output.d.ts +0 -18
  74. package/dist/extensions/ollama/structured-output.d.ts.map +0 -1
  75. package/dist/extensions/ollama/structured-output.js.map +0 -1
  76. package/dist/extensions/ollama/timeout-fetch.d.ts +0 -24
  77. package/dist/extensions/ollama/timeout-fetch.d.ts.map +0 -1
  78. package/dist/extensions/ollama/timeout-fetch.js +0 -76
  79. package/dist/extensions/ollama/timeout-fetch.js.map +0 -1
  80. package/dist/extensions/ollama/types.d.ts +0 -219
  81. package/dist/extensions/ollama/types.d.ts.map +0 -1
  82. package/dist/extensions/ollama/types.js +0 -7
  83. package/dist/extensions/ollama/types.js.map +0 -1
@@ -1,228 +0,0 @@
1
- // Ollama-provider error classes + the `classifyOllamaError` mapping.
2
- //
3
- // The framework's `llmStage` retry policy classifies provider errors
4
- // by inspecting a `retryReason` tag on the thrown object (see
5
- // `src/lib/pipelines/stage-helpers.ts` #classifyError) — NOT by class
6
- // identity. The failure *codes* live in the SDK-free
7
- // `src/lib/pipelines/failure-codes.ts`. So these Ollama classes carry
8
- // the same `retryReason` tags as the OpenAI provider's classes and set
9
- // their `code` from the lib constants. They deliberately do NOT import
10
- // from `extensions/openai/` and do NOT touch `src/lib/`.
11
- //
12
- // Mapping for the framework's default retry policy
13
- // (`retryOn: ["schema_validation", "transient"]`):
14
- //
15
- // * `TransientLlmError` — `retryReason: "transient"`. Genuinely
16
- // transient local hiccups: mid-stream `ECONNRESET`/socket drop,
17
- // undici timeout cause-codes (`UND_ERR_HEADERS_TIMEOUT` /
18
- // `UND_ERR_BODY_TIMEOUT` / `UND_ERR_CONNECT_TIMEOUT` — a long local
19
- // thinking-model generation that outran the dispatcher timeout),
20
- // cold-model-load 5xx (model pulled but still loading into VRAM),
21
- // generic 5xx. Retried by the default policy.
22
- // * `RateLimitLlmError` — `retryReason: "rate_limit"`. A local
23
- // daemon rarely rate-limits, but a remote-Ollama / proxy setup can
24
- // return 429; mapped for contract parity. Not in the default
25
- // `retryOn`, so it fails fast (callers can opt in).
26
- // * `SchemaValidationLlmError` — tagged `transient`; the framework's
27
- // schema-retry path handles it. Thrown only for genuinely
28
- // malformed / non-parseable JSON in the model's reply — NOT for a
29
- // context-overflow (which is deterministic; see below).
30
- // * `NonRetryableLlmError` — no tag; framework surfaces it
31
- // immediately as `LLM_NON_RETRYABLE_ERROR`. Used for: daemon
32
- // unreachable (`ECONNREFUSED`), model-not-pulled (404), and
33
- // context-length / eval errors (deterministic — a retry re-fails).
34
- // * `ToolLoopExhaustedError` — surfaces from the function-tool loop
35
- // when the round cap is hit. Non-retryable (no tag).
36
- import { LLM_NON_RETRYABLE_ERROR, LLM_RATE_LIMITED, LLM_TRANSIENT_ERROR, } from "../../lib/pipelines/failure-codes.js";
37
- export class TransientLlmError extends Error {
38
- retryReason = "transient";
39
- code = LLM_TRANSIENT_ERROR;
40
- status;
41
- constructor(args) {
42
- super(args.message);
43
- this.name = "TransientLlmError";
44
- this.status = args.status;
45
- }
46
- }
47
- export class RateLimitLlmError extends Error {
48
- retryReason = "rate_limit";
49
- code = LLM_RATE_LIMITED;
50
- status;
51
- constructor(args) {
52
- super(args.message);
53
- this.name = "RateLimitLlmError";
54
- this.status = args.status;
55
- }
56
- }
57
- /**
58
- * Thrown when the model's structured-output reply is genuinely
59
- * malformed / non-parseable JSON. Tagged `transient` so the framework's
60
- * default retry policy retries — a single re-roll often produces
61
- * conforming output.
62
- *
63
- * **Do not** route a context-length overflow here: an overflow is
64
- * deterministic and re-fails on the retried (still-oversized) prompt.
65
- * `classifyOllamaError` routes overflow to {@link NonRetryableLlmError}.
66
- */
67
- export class SchemaValidationLlmError extends Error {
68
- retryReason = "transient";
69
- status;
70
- constructor(args) {
71
- super(args.message);
72
- this.name = "SchemaValidationLlmError";
73
- this.status = args.status;
74
- }
75
- }
76
- export class NonRetryableLlmError extends Error {
77
- code = LLM_NON_RETRYABLE_ERROR;
78
- status;
79
- constructor(args) {
80
- super(args.message);
81
- this.name = "NonRetryableLlmError";
82
- this.status = args.status;
83
- }
84
- }
85
- export class ToolLoopExhaustedError extends Error {
86
- rounds;
87
- constructor(args) {
88
- super(args.message);
89
- this.name = "ToolLoopExhaustedError";
90
- this.rounds = args.rounds;
91
- }
92
- }
93
- // -- error-shape probes ---------------------------------------------------
94
- //
95
- // The `ollama` SDK throws plain `Error`s (sometimes a `ResponseError`
96
- // carrying a `status_code`) and lets low-level `fetch` failures bubble
97
- // up. undici wraps a connection refusal as `TypeError: fetch failed`
98
- // with a `.cause` carrying the Node `code`. We probe both the error
99
- // itself and one level of `.cause` for the Node-style `code` and an
100
- // HTTP-ish `status` / `status_code`.
101
- function nodeCodeOf(err) {
102
- const direct = readCode(err);
103
- if (direct !== undefined)
104
- return direct;
105
- if (typeof err === "object" && err !== null) {
106
- return readCode(err.cause);
107
- }
108
- return undefined;
109
- }
110
- function readCode(value) {
111
- if (typeof value !== "object" || value === null)
112
- return undefined;
113
- const code = value.code;
114
- return typeof code === "string" ? code : undefined;
115
- }
116
- function statusOf(err) {
117
- if (typeof err !== "object" || err === null)
118
- return undefined;
119
- // `status_code` is the `ollama` SDK's ResponseError wire field — an
120
- // external snake_case name, exempt from the camelCase rule.
121
- /* eslint-disable @typescript-eslint/naming-convention */
122
- const e = err;
123
- if (typeof e.status === "number")
124
- return e.status;
125
- if (typeof e.status_code === "number")
126
- return e.status_code;
127
- /* eslint-enable @typescript-eslint/naming-convention */
128
- return undefined;
129
- }
130
- function messageOf(err) {
131
- if (err instanceof Error)
132
- return err.message;
133
- if (typeof err === "string")
134
- return err;
135
- return String(err);
136
- }
137
- const CONTEXT_OVERFLOW_PATTERN = /context (?:length|window)|maximum context|exceeds the (?:maximum )?context|too (?:many|long).*token|num_ctx/i;
138
- const MODEL_NOT_FOUND_PATTERN = /model .* not found|not found, try pulling|no such model|pull(?:ing)? it/i;
139
- /**
140
- * Map an error surfaced by the `ollama` SDK (or an underlying `fetch`
141
- * failure) to one of the framework-recognized provider error classes.
142
- *
143
- * The mapping is deliberately exhaustive on the cases the reviewer
144
- * called out so they can't silently regress:
145
- *
146
- * - `ECONNREFUSED` → NonRetryable (daemon down; a retry
147
- * won't bring it up within backoff).
148
- * - model-not-pulled (404) → NonRetryable (`ollama pull` hint).
149
- * - context-overflow/eval err → NonRetryable (deterministic; never
150
- * SchemaValidationLlmError).
151
- * - `ECONNRESET` / socket drop→ Transient.
152
- * - undici timeout cause-codes→ Transient (`UND_ERR_HEADERS_TIMEOUT` /
153
- * `UND_ERR_BODY_TIMEOUT` / `UND_ERR_CONNECT_TIMEOUT`; a long local
154
- * thinking-model generation outran the timeout — retryable).
155
- * - cold-load / generic 5xx → Transient.
156
- * - 429 → RateLimit (remote/proxy setups).
157
- * - anything else → NonRetryable (safe fail-fast default).
158
- */
159
- export function classifyOllamaError(err) {
160
- const code = nodeCodeOf(err);
161
- const status = statusOf(err);
162
- const message = messageOf(err);
163
- // Daemon unreachable — a connection refusal is the canonical
164
- // "`ollama serve` isn't running on :11434" failure. A retry within
165
- // the framework's short backoff won't bring it back up.
166
- if (code === "ECONNREFUSED") {
167
- return new NonRetryableLlmError({
168
- message: `Cannot reach the Ollama daemon (${code}). Is \`ollama serve\` running on :11434? Original error: ${message}`,
169
- });
170
- }
171
- // Mid-stream socket drop / transient connection loss — retryable.
172
- // Includes undici's timeout cause-codes: a long local thinking-model
173
- // generation that outruns the dispatcher's headers/body timeout (or a
174
- // connect timeout) is transient against a still-working daemon, NOT a
175
- // deterministic failure. The framework's default `retryOn: ["transient"]`
176
- // then retries instead of dying `LLM_NON_RETRYABLE_ERROR`. undici wraps
177
- // these as a `TypeError: fetch failed` whose `.cause.code` is the
178
- // `UND_ERR_*` value — `nodeCodeOf` already probes one level of `.cause`.
179
- if (code === "ECONNRESET" ||
180
- code === "ETIMEDOUT" ||
181
- code === "EPIPE" ||
182
- code === "UND_ERR_HEADERS_TIMEOUT" ||
183
- code === "UND_ERR_BODY_TIMEOUT" ||
184
- code === "UND_ERR_CONNECT_TIMEOUT") {
185
- return new TransientLlmError({
186
- message: `Transient connection error talking to the Ollama daemon (${code}): ${message}`,
187
- });
188
- }
189
- // Model not pulled — Ollama returns a 404 whose body says the model
190
- // was not found. Deterministic until the user pulls it.
191
- if (status === 404 || MODEL_NOT_FOUND_PATTERN.test(message)) {
192
- return new NonRetryableLlmError({
193
- message: `Ollama model not found. Run \`ollama pull <model>\` to download it first. Original error: ${message}`,
194
- status,
195
- });
196
- }
197
- // Context-length overflow / model-eval error — DETERMINISTIC. Must
198
- // be NonRetryable: routing this to SchemaValidationLlmError (tagged
199
- // `transient`) would burn a guaranteed-failing second attempt on
200
- // the same oversized prompt.
201
- if (CONTEXT_OVERFLOW_PATTERN.test(message)) {
202
- return new NonRetryableLlmError({
203
- message: `Ollama request exceeded the model's context window (deterministic — retrying the same prompt will re-fail). Shorten the input or raise \`num_ctx\`. Original error: ${message}`,
204
- status,
205
- });
206
- }
207
- if (status === 429) {
208
- return new RateLimitLlmError({
209
- message: `Ollama returned 429 (rate-limited; typical of a remote/proxied daemon): ${message}`,
210
- status,
211
- });
212
- }
213
- // Cold-model-load (model pulled but still loading into VRAM) and
214
- // any other 5xx are transient — a retry after backoff can succeed
215
- // once the model is resident.
216
- if (status !== undefined && status >= 500) {
217
- return new TransientLlmError({
218
- message: `Ollama returned ${status.toString()} (possibly a cold model load into VRAM): ${message}`,
219
- status,
220
- });
221
- }
222
- // Safe default: fail fast rather than retry an unrecognized error.
223
- return new NonRetryableLlmError({
224
- message: `Unclassified Ollama error: ${message}`,
225
- status,
226
- });
227
- }
228
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/ext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AED,iEAAiE;IACjE,kEAAkE;IAClE,8BAA8B;IAC9B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QACxC,OAAO,IAAI,iBAAiB,CAAC;YACzB,OAAO,EAAE,mBAAmB,MAAM,CAAC,QAAQ,EAAE,4CAA4C,OAAO,EAAE;YAClG,MAAM;SACT,CAAC,CAAA;IACN,CAAC;IAED,mEAAmE;IACnE,OAAO,IAAI,oBAAoB,CAAC;QAC5B,OAAO,EAAE,8BAA8B,OAAO,EAAE;QAChD,MAAM;KACT,CAAC,CAAA;AACN,CAAC"}
@@ -1,6 +0,0 @@
1
- export { OllamaProvider } from "./provider.js";
2
- export type { TOllamaProviderConfig, TOllamaClient, TOllamaChatRequest, TOllamaChatResponse, } from "./types.js";
3
- export { typeboxToJsonSchema } from "./structured-output.js";
4
- export type { TOllamaJsonSchema } from "./structured-output.js";
5
- export { NonRetryableLlmError, RateLimitLlmError, SchemaValidationLlmError, ToolLoopExhaustedError, TransientLlmError, classifyOllamaError, } from "./errors.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/ollama/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,YAAY,EACR,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,GACtB,MAAM,aAAa,CAAA"}
@@ -1,17 +0,0 @@
1
- // Barrel for the Ollama provider extension.
2
- //
3
- // Public surface consumed via the `@proposit/proposit-core/extensions/ollama`
4
- // subpath export: the provider constructor + its config type + the
5
- // standard-JSON-schema converter + the error classes (which callers may
6
- // `instanceof`-match for finer-grained observability).
7
- //
8
- // NOTE: the error class names (`NonRetryableLlmError`, …) intentionally
9
- // mirror the OpenAI provider's names but are *distinct* classes living
10
- // in this extension. They are surfaced only from this subpath (NOT the
11
- // package root) to avoid colliding with the root-exported OpenAI error
12
- // classes. The framework classifies by the `retryReason` tag, not class
13
- // identity, so the duplication is intentional and harmless.
14
- export { OllamaProvider } from "./provider.js";
15
- export { typeboxToJsonSchema } from "./structured-output.js";
16
- export { NonRetryableLlmError, RateLimitLlmError, SchemaValidationLlmError, ToolLoopExhaustedError, TransientLlmError, classifyOllamaError, } from "./errors.js";
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/ollama/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,8EAA8E;AAC9E,mEAAmE;AACnE,wEAAwE;AACxE,uDAAuD;AACvD,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,4DAA4D;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAO9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAE5D,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,GACtB,MAAM,aAAa,CAAA"}
@@ -1,22 +0,0 @@
1
- import type { TLlmProvider, TLlmRequest, TLlmResponse } from "../../lib/llm/types.js";
2
- import type { TOllamaProviderConfig } from "./types.js";
3
- export declare class OllamaProvider implements TLlmProvider {
4
- private readonly config;
5
- private clientPromise;
6
- private readonly maxToolRounds;
7
- private readonly numCtx;
8
- private readonly requestTimeoutMs;
9
- private readonly stream;
10
- private readonly think?;
11
- constructor(config?: TOllamaProviderConfig);
12
- respond<T>(req: TLlmRequest<T>): Promise<TLlmResponse<T>>;
13
- private runChatLoop;
14
- /**
15
- * Resolve the SDK client: the injected one, or a freshly imported
16
- * `Ollama` instance. Memoized so the dynamic import + construction
17
- * runs at most once.
18
- */
19
- private getClient;
20
- private importAndConstructClient;
21
- }
22
- //# sourceMappingURL=provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/extensions/ollama/provider.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EACR,YAAY,EACZ,WAAW,EACX,YAAY,EAGf,MAAM,wBAAwB,CAAA;AAc/B,OAAO,KAAK,EAOR,qBAAqB,EAExB,MAAM,YAAY,CAAA;AAkBnB,qBAAa,cAAe,YAAW,YAAY;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,aAAa,CAAsC;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;gBAEpB,MAAM,CAAC,EAAE,qBAAqB;IAcpC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAmCjD,WAAW;IAyKzB;;;;OAIG;IACH,OAAO,CAAC,SAAS;YAQH,wBAAwB;CAiCzC"}