@nemesis-oss/ollama-sdk 1.18.0 → 1.19.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/{anthropic-BvHOsidk.d.cts → anthropic-CAvwqIjx.d.ts} +3 -3
  4. package/dist/{anthropic-CvGVSoVP.d.ts → anthropic-DIPnBwlf.d.cts} +3 -3
  5. package/dist/{compose-CeFbHJeO.d.ts → compose-75UFDzOO.d.ts} +1 -1
  6. package/dist/{compose-DFkmtUOP.d.cts → compose-C4QxEZOS.d.cts} +1 -1
  7. package/dist/generated-api.cjs +5 -3
  8. package/dist/generated-api.cjs.map +1 -1
  9. package/dist/generated-api.d.cts +9 -9
  10. package/dist/generated-api.d.ts +9 -9
  11. package/dist/generated-api.js +5 -3
  12. package/dist/generated-api.js.map +1 -1
  13. package/dist/generated-runtime.cjs +22 -4
  14. package/dist/generated-runtime.cjs.map +1 -1
  15. package/dist/generated-runtime.d.cts +2 -2
  16. package/dist/generated-runtime.d.ts +2 -2
  17. package/dist/generated-runtime.js +22 -4
  18. package/dist/generated-runtime.js.map +1 -1
  19. package/dist/index.cjs +48 -14
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +76 -36
  22. package/dist/index.d.ts +76 -36
  23. package/dist/index.js +48 -15
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp/tools.json +3 -3
  26. package/dist/mcp-generated.cjs +5 -3
  27. package/dist/mcp-generated.cjs.map +1 -1
  28. package/dist/mcp-generated.d.cts +2 -2
  29. package/dist/mcp-generated.d.ts +2 -2
  30. package/dist/mcp-generated.js +5 -3
  31. package/dist/mcp-generated.js.map +1 -1
  32. package/dist/{runtime-CdZP-N7j.d.cts → runtime-C28YEAHC.d.cts} +28 -5
  33. package/dist/{runtime-CFuv7Ifh.d.ts → runtime-DYCxYGG-.d.ts} +28 -5
  34. package/dist/skills.cjs.map +1 -1
  35. package/dist/skills.d.cts +3 -3
  36. package/dist/skills.d.ts +3 -3
  37. package/dist/skills.js.map +1 -1
  38. package/dist/{types-DbPnfVh-.d.cts → types-Y3u0FtdN.d.cts} +10 -0
  39. package/dist/{types-DbPnfVh-.d.ts → types-Y3u0FtdN.d.ts} +10 -0
  40. package/package.json +2 -1
@@ -1,6 +1,6 @@
1
- export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-CdZP-N7j.cjs';
1
+ export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-C28YEAHC.cjs';
2
2
  import { z } from 'zod';
3
- import './types-DbPnfVh-.cjs';
3
+ import './types-Y3u0FtdN.cjs';
4
4
 
5
5
  /**
6
6
  * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
@@ -1,6 +1,6 @@
1
- export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-CFuv7Ifh.js';
1
+ export { I as InvokeRequest, O as OllamaRuntime, b as OllamaRuntimeOptions, a as OperationDefinition, S as SchemaRef } from './runtime-DYCxYGG-.js';
2
2
  import { z } from 'zod';
3
- import './types-DbPnfVh-.js';
3
+ import './types-Y3u0FtdN.js';
4
4
 
5
5
  /**
6
6
  * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
@@ -800,14 +800,25 @@ var OllamaRuntime = class {
800
800
  const hasImages = bodyHasImages(body);
801
801
  const maxBytesWithImages = req.operation.constraints?.maxRequestBytesWithImages;
802
802
  const maxBytesBase = req.operation.constraints?.maxRequestBytes;
803
- const applicableLimit = hasImages && maxBytesWithImages !== void 0 ? maxBytesWithImages : maxBytesBase;
804
- if (applicableLimit !== void 0 && serialized.byteLength > applicableLimit) {
803
+ const textAndSchemaBytes = hasImages ? serializeWithoutImages(body).byteLength : serialized.byteLength;
804
+ if (maxBytesBase !== void 0 && textAndSchemaBytes > maxBytesBase) {
805
805
  throw new OllamaRequestTooLargeError(
806
- `Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path}) request body is ${serialized.byteLength} bytes, exceeding the contract limit of ${applicableLimit} bytes` + (hasImages ? " (images limit)." : "."),
806
+ `Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path}) text and schema (images excluded) is ${textAndSchemaBytes} bytes, exceeding the contract limit of ${maxBytesBase} bytes.`,
807
+ {
808
+ operationId: req.operation.operationId,
809
+ actualBytes: textAndSchemaBytes,
810
+ maxBytes: maxBytesBase,
811
+ request: { method: req.operation.method, url: req.operation.path }
812
+ }
813
+ );
814
+ }
815
+ if (maxBytesWithImages !== void 0 && serialized.byteLength > maxBytesWithImages) {
816
+ throw new OllamaRequestTooLargeError(
817
+ `Operation ${req.operation.operationId} (${req.operation.method} ${req.operation.path}) request body is ${serialized.byteLength} bytes, exceeding the contract limit of ${maxBytesWithImages} bytes (whole request, images included).`,
807
818
  {
808
819
  operationId: req.operation.operationId,
809
820
  actualBytes: serialized.byteLength,
810
- maxBytes: applicableLimit,
821
+ maxBytes: maxBytesWithImages,
811
822
  request: { method: req.operation.method, url: req.operation.path }
812
823
  }
813
824
  );
@@ -949,6 +960,13 @@ function bodyHasImages(body) {
949
960
  const images = obj.images;
950
961
  return Array.isArray(images) && images.length > 0;
951
962
  }
963
+ function serializeWithoutImages(body) {
964
+ if (typeof body === "object" && body !== null && !Array.isArray(body)) {
965
+ const { images: _images, ...rest } = body;
966
+ return serializeForByteCount(rest);
967
+ }
968
+ return serializeForByteCount(body);
969
+ }
952
970
  function resolvePathParams(pathTemplate, pathParams) {
953
971
  if (!pathTemplate.includes("{")) return pathTemplate;
954
972
  const params = pathParams ?? {};