@proposit/proposit-core 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/parse.d.ts.map +1 -1
- package/dist/cli/commands/parse.js +27 -29
- package/dist/cli/commands/parse.js.map +1 -1
- package/dist/extensions/chat-completions/errors.d.ts +66 -0
- package/dist/extensions/chat-completions/errors.d.ts.map +1 -0
- package/dist/extensions/chat-completions/errors.js +139 -0
- package/dist/extensions/chat-completions/errors.js.map +1 -0
- package/dist/extensions/chat-completions/http.d.ts +10 -0
- package/dist/extensions/chat-completions/http.d.ts.map +1 -0
- package/dist/extensions/chat-completions/http.js +80 -0
- package/dist/extensions/chat-completions/http.js.map +1 -0
- package/dist/extensions/chat-completions/index.d.ts +7 -0
- package/dist/extensions/chat-completions/index.d.ts.map +1 -0
- package/dist/extensions/chat-completions/index.js +18 -0
- package/dist/extensions/chat-completions/index.js.map +1 -0
- package/dist/extensions/chat-completions/provider.d.ts +5 -0
- package/dist/extensions/chat-completions/provider.d.ts.map +1 -0
- package/dist/extensions/chat-completions/provider.js +192 -0
- package/dist/extensions/chat-completions/provider.js.map +1 -0
- package/dist/extensions/chat-completions/structured-output.d.ts +18 -0
- package/dist/extensions/chat-completions/structured-output.d.ts.map +1 -0
- package/dist/extensions/{ollama → chat-completions}/structured-output.js +14 -10
- package/dist/extensions/chat-completions/structured-output.js.map +1 -0
- package/dist/extensions/chat-completions/types.d.ts +65 -0
- package/dist/extensions/chat-completions/types.d.ts.map +1 -0
- package/dist/extensions/chat-completions/types.js +19 -0
- package/dist/extensions/chat-completions/types.js.map +1 -0
- package/dist/extensions/openai/errors.js +1 -1
- package/dist/extensions/openai/errors.js.map +1 -1
- package/dist/extensions/openai/provider.d.ts +2 -2
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/basics-extension.d.ts +1 -1
- package/dist/extensions/pipelines/base/basics-extension.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/basics-extension.js +5 -4
- package/dist/extensions/pipelines/base/basics-extension.js.map +1 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/finalize-response-v2.js +1 -1
- package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -0
- package/dist/extensions/pipelines/base/index.d.ts +9 -0
- package/dist/extensions/pipelines/base/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/index.js +17 -0
- package/dist/extensions/pipelines/base/index.js.map +1 -0
- package/dist/extensions/pipelines/base/resolve-llm-stage-options.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/resolve-llm-stage-options.js +2 -2
- package/dist/extensions/pipelines/base/resolve-llm-stage-options.js.map +1 -0
- package/dist/extensions/pipelines/base/role-derivation.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/role-derivation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/axiom-indicator-detection.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/axiom-indicator-detection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/axiom-indicator-detection.js +1 -1
- package/dist/extensions/pipelines/base/stages/axiom-indicator-detection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/citation-source-detection.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/citation-source-detection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/citation-source-detection.js +1 -1
- package/dist/extensions/pipelines/base/stages/citation-source-detection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-canonicalization.d.ts +20 -3
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-canonicalization.js +20 -6
- package/dist/extensions/pipelines/base/stages/claim-canonicalization.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-mention-extraction.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/claim-mention-extraction.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-mention-extraction.js +1 -1
- package/dist/extensions/pipelines/base/stages/claim-mention-extraction.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-reference-validation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/claim-reference-validation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-reference-validation.js +1 -1
- package/dist/extensions/pipelines/base/stages/claim-reference-validation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-type-classification.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/claim-type-classification.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/claim-type-classification.js +2 -2
- package/dist/extensions/pipelines/base/stages/claim-type-classification.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/conclusion-selection.d.ts +21 -3
- package/dist/extensions/pipelines/base/stages/conclusion-selection.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/conclusion-selection.js +8 -2
- package/dist/extensions/pipelines/base/stages/conclusion-selection.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-compilation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-compilation.js +1 -1
- package/dist/extensions/pipelines/base/stages/formula-compilation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-validation.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/formula-validation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/formula-validation.js +2 -2
- package/dist/extensions/pipelines/base/stages/formula-validation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/index.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/index.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/index.js +5 -3
- package/dist/extensions/pipelines/base/stages/index.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/relation-extraction.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/relation-extraction.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/relation-extraction.js +1 -1
- package/dist/extensions/pipelines/base/stages/relation-extraction.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/schemas.d.ts +2 -0
- package/dist/extensions/pipelines/base/stages/schemas.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/schemas.js +8 -0
- package/dist/extensions/pipelines/base/stages/schemas.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/segmentation.d.ts +2 -2
- package/dist/extensions/pipelines/base/stages/segmentation.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/segmentation.js +2 -2
- package/dist/extensions/pipelines/base/stages/segmentation.js.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/variable-assignment.d.ts +1 -1
- package/dist/extensions/pipelines/base/stages/variable-assignment.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion → pipelines/base}/stages/variable-assignment.js +1 -1
- package/dist/extensions/pipelines/base/stages/variable-assignment.js.map +1 -0
- package/dist/extensions/{argument-ingestion/shared → pipelines/base}/types.d.ts +6 -5
- package/dist/extensions/pipelines/base/types.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/types.js +15 -0
- package/dist/extensions/pipelines/base/types.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts +5 -0
- package/dist/extensions/pipelines/ingestion/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/index.js +5 -0
- package/dist/extensions/pipelines/ingestion/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.d.ts +3 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.js +3 -0
- package/dist/extensions/pipelines/ingestion/scholar/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts +48 -0
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts.map +1 -0
- package/dist/extensions/{argument-ingestion/v2-multi-stage.js → pipelines/ingestion/scholar/scholar.js} +25 -18
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +33 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +103 -0
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.d.ts +3 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.js +3 -0
- package/dist/extensions/pipelines/ingestion/scribe/index.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +17 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js +26 -0
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts +20 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js +81 -0
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts +30 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts.map +1 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js +142 -0
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js.map +1 -0
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +7 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/pipelines/debug-log.js +1 -1
- package/dist/lib/pipelines/debug-log.js.map +1 -1
- package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
- package/dist/lib/pipelines/stage-helpers.js +37 -1
- package/dist/lib/pipelines/stage-helpers.js.map +1 -1
- package/dist/lib/pipelines/types.d.ts +2 -2
- package/package.json +16 -16
- package/dist/extensions/argument-ingestion/index.d.ts +0 -15
- package/dist/extensions/argument-ingestion/index.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/index.js +0 -17
- package/dist/extensions/argument-ingestion/index.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/basics-extension.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/basics-extension.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response-v2.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response-v2.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts +0 -21
- package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/finalize-response.js +0 -33
- package/dist/extensions/argument-ingestion/shared/finalize-response.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/resolve-llm-stage-options.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/role-derivation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/role-derivation.js.map +0 -1
- package/dist/extensions/argument-ingestion/shared/types.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/shared/types.js +0 -16
- package/dist/extensions/argument-ingestion/shared/types.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/citation-source-detection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-reference-validation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-reference-validation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/claim-type-classification.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/conclusion-selection.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-compilation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-compilation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-validation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/formula-validation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/index.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/index.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/relation-extraction.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/schemas.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/schemas.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/segmentation.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/segmentation.js.map +0 -1
- package/dist/extensions/argument-ingestion/stages/variable-assignment.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/stages/variable-assignment.js.map +0 -1
- package/dist/extensions/argument-ingestion/v1-single-shot.d.ts +0 -26
- package/dist/extensions/argument-ingestion/v1-single-shot.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/v1-single-shot.js +0 -113
- package/dist/extensions/argument-ingestion/v1-single-shot.js.map +0 -1
- package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts +0 -38
- package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts.map +0 -1
- package/dist/extensions/argument-ingestion/v2-multi-stage.js.map +0 -1
- package/dist/extensions/ollama/errors.d.ts +0 -73
- package/dist/extensions/ollama/errors.d.ts.map +0 -1
- package/dist/extensions/ollama/errors.js +0 -228
- package/dist/extensions/ollama/errors.js.map +0 -1
- package/dist/extensions/ollama/index.d.ts +0 -6
- package/dist/extensions/ollama/index.d.ts.map +0 -1
- package/dist/extensions/ollama/index.js +0 -17
- package/dist/extensions/ollama/index.js.map +0 -1
- package/dist/extensions/ollama/provider.d.ts +0 -22
- package/dist/extensions/ollama/provider.d.ts.map +0 -1
- package/dist/extensions/ollama/provider.js +0 -417
- package/dist/extensions/ollama/provider.js.map +0 -1
- package/dist/extensions/ollama/structured-output.d.ts +0 -18
- package/dist/extensions/ollama/structured-output.d.ts.map +0 -1
- package/dist/extensions/ollama/structured-output.js.map +0 -1
- package/dist/extensions/ollama/timeout-fetch.d.ts +0 -24
- package/dist/extensions/ollama/timeout-fetch.d.ts.map +0 -1
- package/dist/extensions/ollama/timeout-fetch.js +0 -76
- package/dist/extensions/ollama/timeout-fetch.js.map +0 -1
- package/dist/extensions/ollama/types.d.ts +0 -219
- package/dist/extensions/ollama/types.d.ts.map +0 -1
- package/dist/extensions/ollama/types.js +0 -7
- package/dist/extensions/ollama/types.js.map +0 -1
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/finalize-response-v2.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/resolve-llm-stage-options.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/role-derivation.d.ts +0 -0
- /package/dist/extensions/{argument-ingestion/shared → pipelines/base}/role-derivation.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/extensions/ollama/errors.ts"],"names":[],"mappings":"AA0CA,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,SAAgB,WAAW,EAAG,WAAW,CAAS;IAClD,SAAgB,IAAI,wBAAsB;IAC1C,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,SAAgB,WAAW,EAAG,YAAY,CAAS;IACnD,SAAgB,IAAI,qBAAmB;IACvC,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAC/C,SAAgB,WAAW,EAAG,WAAW,CAAS;IAClD,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C,SAAgB,IAAI,4BAA0B;IAC9C,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,SAAgB,MAAM,EAAE,MAAM,CAAA;gBAElB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAKxD;AAkDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CA6EvD"}
|
|
@@ -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/extensions/ollama/errors.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,qEAAqE;AACrE,8DAA8D;AAC9D,sEAAsE;AACtE,qDAAqD;AACrD,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,yDAAyD;AACzD,EAAE;AACF,mDAAmD;AACnD,mDAAmD;AACnD,EAAE;AACF,kEAAkE;AAClE,oEAAoE;AACpE,8DAA8D;AAC9D,wEAAwE;AACxE,qEAAqE;AACrE,sEAAsE;AACtE,kDAAkD;AAClD,iEAAiE;AACjE,uEAAuE;AACvE,iEAAiE;AACjE,wDAAwD;AACxD,uEAAuE;AACvE,8DAA8D;AAC9D,sEAAsE;AACtE,4DAA4D;AAC5D,6DAA6D;AAC7D,iEAAiE;AACjE,gEAAgE;AAChE,uEAAuE;AACvE,sEAAsE;AACtE,yDAAyD;AAEzD,OAAO,EACH,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,GACtB,MAAM,sCAAsC,CAAA;AAE7C,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxB,WAAW,GAAG,WAAoB,CAAA;IAClC,IAAI,GAAG,mBAAmB,CAAA;IAC1B,MAAM,CAAS;IAE/B,YAAY,IAA0C;QAClD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,CAAC;CACJ;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAA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CAAC;QACzC,OAAO,IAAI,oBAAoB,CAAC;YAC5B,OAAO,EAAE,uKAAuK,OAAO,EAAE;YACzL,MAAM;SACT,CAAC,CAAA;IACN,CAAC;IAED,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,IAAI,iBAAiB,CAAC;YACzB,OAAO,EAAE,2EAA2E,OAAO,EAAE;YAC7F,MAAM;SACT,CAAC,CAAA;IACN,CAAC;IAED,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"}
|