@nemesis-oss/ollama-sdk 1.17.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 (44) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +79 -0
  3. package/dist/{anthropic-AKbXnWJU.d.cts → anthropic-CAvwqIjx.d.ts} +5 -5
  4. package/dist/{anthropic-CTv2acbj.d.ts → anthropic-DIPnBwlf.d.cts} +5 -5
  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-models-schemas.cjs +2 -2
  14. package/dist/generated-models-schemas.cjs.map +1 -1
  15. package/dist/generated-models-schemas.js +2 -2
  16. package/dist/generated-models-schemas.js.map +1 -1
  17. package/dist/generated-runtime.cjs +24 -6
  18. package/dist/generated-runtime.cjs.map +1 -1
  19. package/dist/generated-runtime.d.cts +2 -2
  20. package/dist/generated-runtime.d.ts +2 -2
  21. package/dist/generated-runtime.js +24 -6
  22. package/dist/generated-runtime.js.map +1 -1
  23. package/dist/index.cjs +132 -20
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +294 -40
  26. package/dist/index.d.ts +294 -40
  27. package/dist/index.js +128 -21
  28. package/dist/index.js.map +1 -1
  29. package/dist/mcp/tools.json +8 -10
  30. package/dist/mcp-generated.cjs +5 -3
  31. package/dist/mcp-generated.cjs.map +1 -1
  32. package/dist/mcp-generated.d.cts +2 -2
  33. package/dist/mcp-generated.d.ts +2 -2
  34. package/dist/mcp-generated.js +5 -3
  35. package/dist/mcp-generated.js.map +1 -1
  36. package/dist/{runtime-CdZP-N7j.d.cts → runtime-C28YEAHC.d.cts} +28 -5
  37. package/dist/{runtime-CFuv7Ifh.d.ts → runtime-DYCxYGG-.d.ts} +28 -5
  38. package/dist/skills.cjs.map +1 -1
  39. package/dist/skills.d.cts +3 -3
  40. package/dist/skills.d.ts +3 -3
  41. package/dist/skills.js.map +1 -1
  42. package/dist/{types-DbPnfVh-.d.cts → types-Y3u0FtdN.d.cts} +10 -0
  43. package/dist/{types-DbPnfVh-.d.ts → types-Y3u0FtdN.d.ts} +10 -0
  44. package/package.json +2 -1
@@ -808,7 +808,7 @@
808
808
  },
809
809
  {
810
810
  "name": "ollama_systemOne",
811
- "description": "Ollama POST /v1/systemone (native domain)\n\n- Local-only; Ollama Cloud rejects /v1/systemone.\n- 64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).\n- No tools, no generation controls (temperature, top_p, etc.).\n- Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.\n- Experimental: behavioral surface may change between Ollama releases.",
811
+ "description": "Ollama POST /v1/systemone (native domain)\n\n- Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.\n- Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.\n- Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.\n- 401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.\n- No tools, no generation controls (temperature, top_p, etc.).\n- Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.\n- Experimental: behavioral surface may change between Ollama releases.",
812
812
  "inputSchema": {
813
813
  "type": "object",
814
814
  "required": ["model", "state", "questions"],
@@ -816,7 +816,7 @@
816
816
  "model": {
817
817
  "type": "string",
818
818
  "pattern": "\\S",
819
- "description": "Local model trained for System One, such as nimble. Requires compatible GGUF weights and a scoring-capable runner; cloud and MLX/Safetensors models are not supported."
819
+ "description": "Model trained for System One, such as nimble, or clef:cloud for Ollama's cloud."
820
820
  },
821
821
  "state": {
822
822
  "description": "A nonempty string, or an object or array serialized as JSON text. Not interpreted as chat messages or multimodal input.",
@@ -837,7 +837,7 @@
837
837
  },
838
838
  "images": {
839
839
  "type": "array",
840
- "description": "Base64-encoded images shared by all questions, in request order. Requires Clef or Clef Flash with vision weights. URLs and data URLs are not supported.",
840
+ "description": "Base64-encoded images shared by all questions, in request order. Requires a model with vision, such as Clef. URLs and data URLs are not supported.",
841
841
  "items": {
842
842
  "type": "string",
843
843
  "format": "byte"
@@ -845,7 +845,7 @@
845
845
  },
846
846
  "questions": {
847
847
  "type": "object",
848
- "description": "Named questions about the shared state. Answers are not passed to later questions.",
848
+ "description": "Named questions about the shared state. Answers are not passed to later questions. Cloud models accept names of up to 100 ASCII letters, digits, `_`, `.`, or `-`.",
849
849
  "minProperties": 1,
850
850
  "maxProperties": 64,
851
851
  "propertyNames": {
@@ -924,12 +924,10 @@
924
924
  "description": "Optional descriptions for the two outcomes. Omitted entries use model-specific defaults.",
925
925
  "properties": {
926
926
  "false": {
927
- "type": "string",
928
- "default": "No"
927
+ "type": "string"
929
928
  },
930
929
  "true": {
931
- "type": "string",
932
- "default": "Yes"
930
+ "type": "string"
933
931
  }
934
932
  },
935
933
  "additionalProperties": false
@@ -964,9 +962,9 @@
964
962
  },
965
963
  "criteria": {
966
964
  "type": "array",
967
- "description": "Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1. The maximum number of levels depends on the model.",
965
+ "description": "Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1.",
968
966
  "minItems": 2,
969
- "maxItems": 26,
967
+ "maxItems": 10,
970
968
  "items": {
971
969
  "type": "string"
972
970
  }
@@ -240,7 +240,7 @@ var init_operations = __esm({
240
240
  path: "/v1/systemone",
241
241
  request: { $ref: "#/schemas/SystemOneRequest" },
242
242
  response: { $ref: "#/schemas/SystemOneResponse" },
243
- environment: { local: true, cloud: false },
243
+ environment: { local: true, cloud: true },
244
244
  transport: { mode: "json", streaming: false },
245
245
  capabilities: {
246
246
  thinking: "unsupported",
@@ -258,8 +258,10 @@ var init_operations = __esm({
258
258
  status: { documented: true, experimental: true },
259
259
  domain: "native",
260
260
  notes: [
261
- "Local-only; Ollama Cloud rejects /v1/systemone.",
262
- "64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).",
261
+ "Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.",
262
+ "Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.",
263
+ "Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.",
264
+ "401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.",
263
265
  "No tools, no generation controls (temperature, top_p, etc.).",
264
266
  "Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.",
265
267
  "Experimental: behavioral surface may change between Ollama releases."
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generated/api/operations.ts","../src/mcp/generated-bridge.ts"],"names":["dirname","fileURLToPath","resolve","readFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,GAAA,EAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA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mB;AAAA,KACrB;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,CAAA,YAAA,EAAe,IAAI,CAAA,SAAA,EAAY,OAAO,CAAA,CAAA,EAAI,CAAA;AAAA,MAC1E,iBAAA,EAAmB,EAAE,KAAA,EAAO,aAAA,EAAe,MAAM,OAAA;AAAQ,KAC3D;AAAA,EACF;AACF","file":"mcp-generated.cjs","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local-only; Ollama Cloud rejects /v1/systemone.',\n '64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * Generated Ollama MCP tools — runtime adapter.\n *\n * Reads the descriptor list from `src/generated/mcp/tools.json` (the Wave 6\n * MCP emitter output) and exposes them as a `McpToolDescriptor[]` that\n * `McpBridge` can register. The actual call execution delegates to the\n * generated `OllamaRuntime` via the user-provided runtime instance.\n *\n * Usage:\n * ```ts\n * import { NativeApi, OllamaRuntime } from '@nemesis-oss/ollama-sdk/runtime';\n * import { createGeneratedOllamaTools } from '@nemesis-oss/ollama-sdk/mcp/generated';\n *\n * const runtime = new OllamaRuntime({ http });\n * const tools = createGeneratedOllamaTools(runtime);\n * bridge.registerTools(tools);\n * ```\n *\n * This is a Wave 6 opt-in feature — the existing McpBridge continues to work\n * unchanged. Users who want generated MCP tools import this adapter\n * explicitly.\n */\nimport { readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { resolve, dirname } from 'node:path';\nimport type { McpToolDescriptor } from './types.js';\nimport { OllamaRuntime } from '../generated/runtime/runtime.js';\nimport type { OperationDefinition } from '../generated/runtime/operation-definition.js';\n\ninterface GeneratedToolEntry extends McpToolDescriptor {\n readonly _operationId: string;\n}\n\ninterface GeneratedToolsFile {\n readonly _comment?: string;\n readonly tools: readonly GeneratedToolEntry[];\n}\n\n/**\n * Resolve the path to `tools.json` across runtime environments:\n *\n * - **In source (development):** `src/generated/mcp/tools.json`\n * - **In the published tarball:** `dist/mcp/tools.json` (copied by tsup's\n * `onSuccess` hook; see tsup.config.ts)\n *\n * The dist bundle is at `dist/mcp-generated.js`, so the JSON sits two\n * directories up + into `mcp/`. The source file is at\n * `src/mcp/generated-bridge.ts`, so the JSON sits one directory up +\n * into `generated/mcp/`.\n */\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst TOOLS_JSON_PATH = (() => {\n // Try the source layout first (development), then fall back to the dist\n // layout (published). The order matters because in a tsx-run dev env\n // we may be executing from `src/mcp/generated-bridge.ts`, but in a\n // consumer install we're at `dist/mcp-generated.js`.\n const candidates = [\n resolve(HERE, '../generated/mcp/tools.json'), // source layout\n resolve(HERE, 'mcp/tools.json'), // dist layout (next to mcp-generated.js)\n resolve(HERE, '../mcp/tools.json'), // alt dist layout (sibling of bundled dir)\n ];\n for (const candidate of candidates) {\n try {\n readFileSync(candidate, 'utf8');\n return candidate;\n } catch {\n // try next candidate\n }\n }\n // Fall back to the source-layout path; the error will surface with a\n // clearer message when the loader is actually invoked.\n return candidates[0] ?? resolve(HERE, '../generated/mcp/tools.json');\n})();\n\nlet cachedTools: readonly GeneratedToolEntry[] | undefined;\n\n/** Load and cache the generated tool descriptors from tools.json. */\nexport function loadGeneratedOllamaTools(): readonly GeneratedToolEntry[] {\n if (cachedTools) return cachedTools;\n const raw = readFileSync(TOOLS_JSON_PATH, 'utf8');\n const parsed = JSON.parse(raw) as GeneratedToolsFile;\n cachedTools = parsed.tools;\n return cachedTools;\n}\n\n/** Drop the `_operationId` field before exposing the descriptor externally. */\nfunction publicDescriptor(entry: GeneratedToolEntry): McpToolDescriptor {\n const { _operationId, ...rest } = entry;\n void _operationId;\n return rest;\n}\n\n/**\n * Build a list of MCP tool descriptors for the generated Ollama operations.\n * Each tool can be invoked by name via {@link callGeneratedOllamaTool}.\n *\n * The descriptors are read once and cached for the lifetime of the process.\n */\nexport function listGeneratedOllamaTools(): readonly McpToolDescriptor[] {\n return loadGeneratedOllamaTools().map(publicDescriptor);\n}\n\n/**\n * Invoke a generated tool by name. The `name` must match a tool from\n * {@link listGeneratedOllamaTools}.\n *\n * Returns a `McpCallToolResult` containing the structured response. The\n * caller (typically `McpBridge`) is responsible for serializing the result\n * back over the MCP transport.\n */\nexport async function callGeneratedOllamaTool(\n runtime: OllamaRuntime,\n name: string,\n args: Record<string, unknown>,\n options?: { signal?: AbortSignal },\n): Promise<{ content: readonly { type: 'text'; text: string }[]; structuredContent: unknown }> {\n const tools = loadGeneratedOllamaTools();\n const entry = tools.find((t) => t.name === name);\n if (!entry) {\n return {\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\n structuredContent: { error: 'unknown_tool', name },\n };\n }\n\n // Look up the operation in the IR by id. We re-import the operations\n // module to avoid a circular dependency at module-load time.\n const operations = await import('../generated/api/operations.js');\n const opKey = `${entry._operationId}Op` as keyof typeof operations;\n const operation = operations[opKey] as OperationDefinition | undefined;\n if (!operation || typeof operation !== 'object' || !('operationId' in operation)) {\n return {\n content: [{ type: 'text', text: `Operation not found for ${name}` }],\n structuredContent: { error: 'operation_not_found', name },\n };\n }\n\n try {\n // Wave 15 (P0): split path/query/header parameters from the request\n // body. The MCP input schema may declare path parameters (e.g. `model`\n // for /v1/models/{model}) — those must be passed as `pathParams` to\n // the runtime, not put in the request body. The operation's\n // `parameters` field tells us which args are path/query/header vs body.\n const opParams = operation.parameters ?? [];\n const pathParams: Record<string, string> = {};\n const queryParams: Record<string, string> = {};\n const headerParams: Record<string, string> = {};\n const bodyArgs: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(args)) {\n const paramDef = opParams.find((p) => p.name === key);\n if (paramDef) {\n if (paramDef.in === 'path') {\n pathParams[key] = String(value);\n } else if (paramDef.in === 'query') {\n queryParams[key] = String(value);\n } else if (paramDef.in === 'header') {\n headerParams[key] = String(value);\n }\n } else {\n // Not a declared parameter → goes in the request body.\n bodyArgs[key] = value;\n }\n }\n\n const hasBody = Object.keys(bodyArgs).length > 0;\n const result = await runtime.invoke<unknown>({\n operation,\n body: hasBody ? bodyArgs : undefined,\n ...(Object.keys(pathParams).length > 0 ? { pathParams } : {}),\n ...(Object.keys(queryParams).length > 0 ? { queryParams } : {}),\n ...(Object.keys(headerParams).length > 0 ? { headerParams } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n structuredContent: result,\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: 'text', text: `Ollama tool ${name} failed: ${message}` }],\n structuredContent: { error: 'tool_failed', name, message },\n };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/generated/api/operations.ts","../src/mcp/generated-bridge.ts"],"names":["dirname","fileURLToPath","resolve","readFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,GAAA,EAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAA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ACrB;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,CAAA,YAAA,EAAe,IAAI,CAAA,SAAA,EAAY,OAAO,CAAA,CAAA,EAAI,CAAA;AAAA,MAC1E,iBAAA,EAAmB,EAAE,KAAA,EAAO,aAAA,EAAe,MAAM,OAAA;AAAQ,KAC3D;AAAA,EACF;AACF","file":"mcp-generated.cjs","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.',\n 'Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.',\n \"Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.\",\n '401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * Generated Ollama MCP tools — runtime adapter.\n *\n * Reads the descriptor list from `src/generated/mcp/tools.json` (the Wave 6\n * MCP emitter output) and exposes them as a `McpToolDescriptor[]` that\n * `McpBridge` can register. The actual call execution delegates to the\n * generated `OllamaRuntime` via the user-provided runtime instance.\n *\n * Usage:\n * ```ts\n * import { NativeApi, OllamaRuntime } from '@nemesis-oss/ollama-sdk/runtime';\n * import { createGeneratedOllamaTools } from '@nemesis-oss/ollama-sdk/mcp/generated';\n *\n * const runtime = new OllamaRuntime({ http });\n * const tools = createGeneratedOllamaTools(runtime);\n * bridge.registerTools(tools);\n * ```\n *\n * This is a Wave 6 opt-in feature — the existing McpBridge continues to work\n * unchanged. Users who want generated MCP tools import this adapter\n * explicitly.\n */\nimport { readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { resolve, dirname } from 'node:path';\nimport type { McpToolDescriptor } from './types.js';\nimport { OllamaRuntime } from '../generated/runtime/runtime.js';\nimport type { OperationDefinition } from '../generated/runtime/operation-definition.js';\n\ninterface GeneratedToolEntry extends McpToolDescriptor {\n readonly _operationId: string;\n}\n\ninterface GeneratedToolsFile {\n readonly _comment?: string;\n readonly tools: readonly GeneratedToolEntry[];\n}\n\n/**\n * Resolve the path to `tools.json` across runtime environments:\n *\n * - **In source (development):** `src/generated/mcp/tools.json`\n * - **In the published tarball:** `dist/mcp/tools.json` (copied by tsup's\n * `onSuccess` hook; see tsup.config.ts)\n *\n * The dist bundle is at `dist/mcp-generated.js`, so the JSON sits two\n * directories up + into `mcp/`. The source file is at\n * `src/mcp/generated-bridge.ts`, so the JSON sits one directory up +\n * into `generated/mcp/`.\n */\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst TOOLS_JSON_PATH = (() => {\n // Try the source layout first (development), then fall back to the dist\n // layout (published). The order matters because in a tsx-run dev env\n // we may be executing from `src/mcp/generated-bridge.ts`, but in a\n // consumer install we're at `dist/mcp-generated.js`.\n const candidates = [\n resolve(HERE, '../generated/mcp/tools.json'), // source layout\n resolve(HERE, 'mcp/tools.json'), // dist layout (next to mcp-generated.js)\n resolve(HERE, '../mcp/tools.json'), // alt dist layout (sibling of bundled dir)\n ];\n for (const candidate of candidates) {\n try {\n readFileSync(candidate, 'utf8');\n return candidate;\n } catch {\n // try next candidate\n }\n }\n // Fall back to the source-layout path; the error will surface with a\n // clearer message when the loader is actually invoked.\n return candidates[0] ?? resolve(HERE, '../generated/mcp/tools.json');\n})();\n\nlet cachedTools: readonly GeneratedToolEntry[] | undefined;\n\n/** Load and cache the generated tool descriptors from tools.json. */\nexport function loadGeneratedOllamaTools(): readonly GeneratedToolEntry[] {\n if (cachedTools) return cachedTools;\n const raw = readFileSync(TOOLS_JSON_PATH, 'utf8');\n const parsed = JSON.parse(raw) as GeneratedToolsFile;\n cachedTools = parsed.tools;\n return cachedTools;\n}\n\n/** Drop the `_operationId` field before exposing the descriptor externally. */\nfunction publicDescriptor(entry: GeneratedToolEntry): McpToolDescriptor {\n const { _operationId, ...rest } = entry;\n void _operationId;\n return rest;\n}\n\n/**\n * Build a list of MCP tool descriptors for the generated Ollama operations.\n * Each tool can be invoked by name via {@link callGeneratedOllamaTool}.\n *\n * The descriptors are read once and cached for the lifetime of the process.\n */\nexport function listGeneratedOllamaTools(): readonly McpToolDescriptor[] {\n return loadGeneratedOllamaTools().map(publicDescriptor);\n}\n\n/**\n * Invoke a generated tool by name. The `name` must match a tool from\n * {@link listGeneratedOllamaTools}.\n *\n * Returns a `McpCallToolResult` containing the structured response. The\n * caller (typically `McpBridge`) is responsible for serializing the result\n * back over the MCP transport.\n */\nexport async function callGeneratedOllamaTool(\n runtime: OllamaRuntime,\n name: string,\n args: Record<string, unknown>,\n options?: { signal?: AbortSignal },\n): Promise<{ content: readonly { type: 'text'; text: string }[]; structuredContent: unknown }> {\n const tools = loadGeneratedOllamaTools();\n const entry = tools.find((t) => t.name === name);\n if (!entry) {\n return {\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\n structuredContent: { error: 'unknown_tool', name },\n };\n }\n\n // Look up the operation in the IR by id. We re-import the operations\n // module to avoid a circular dependency at module-load time.\n const operations = await import('../generated/api/operations.js');\n const opKey = `${entry._operationId}Op` as keyof typeof operations;\n const operation = operations[opKey] as OperationDefinition | undefined;\n if (!operation || typeof operation !== 'object' || !('operationId' in operation)) {\n return {\n content: [{ type: 'text', text: `Operation not found for ${name}` }],\n structuredContent: { error: 'operation_not_found', name },\n };\n }\n\n try {\n // Wave 15 (P0): split path/query/header parameters from the request\n // body. The MCP input schema may declare path parameters (e.g. `model`\n // for /v1/models/{model}) — those must be passed as `pathParams` to\n // the runtime, not put in the request body. The operation's\n // `parameters` field tells us which args are path/query/header vs body.\n const opParams = operation.parameters ?? [];\n const pathParams: Record<string, string> = {};\n const queryParams: Record<string, string> = {};\n const headerParams: Record<string, string> = {};\n const bodyArgs: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(args)) {\n const paramDef = opParams.find((p) => p.name === key);\n if (paramDef) {\n if (paramDef.in === 'path') {\n pathParams[key] = String(value);\n } else if (paramDef.in === 'query') {\n queryParams[key] = String(value);\n } else if (paramDef.in === 'header') {\n headerParams[key] = String(value);\n }\n } else {\n // Not a declared parameter → goes in the request body.\n bodyArgs[key] = value;\n }\n }\n\n const hasBody = Object.keys(bodyArgs).length > 0;\n const result = await runtime.invoke<unknown>({\n operation,\n body: hasBody ? bodyArgs : undefined,\n ...(Object.keys(pathParams).length > 0 ? { pathParams } : {}),\n ...(Object.keys(queryParams).length > 0 ? { queryParams } : {}),\n ...(Object.keys(headerParams).length > 0 ? { headerParams } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n structuredContent: result,\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: 'text', text: `Ollama tool ${name} failed: ${message}` }],\n structuredContent: { error: 'tool_failed', name, message },\n };\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { a as McpToolDescriptor } from './types-CI-gM2u5.cjs';
2
- import { O as OllamaRuntime } from './runtime-CdZP-N7j.cjs';
2
+ import { O as OllamaRuntime } from './runtime-C28YEAHC.cjs';
3
3
  import 'zod';
4
- import './types-DbPnfVh-.cjs';
4
+ import './types-Y3u0FtdN.cjs';
5
5
 
6
6
  interface GeneratedToolEntry extends McpToolDescriptor {
7
7
  readonly _operationId: string;
@@ -1,7 +1,7 @@
1
1
  import { a as McpToolDescriptor } from './types-CI-gM2u5.js';
2
- import { O as OllamaRuntime } from './runtime-CFuv7Ifh.js';
2
+ import { O as OllamaRuntime } from './runtime-DYCxYGG-.js';
3
3
  import 'zod';
4
- import './types-DbPnfVh-.js';
4
+ import './types-Y3u0FtdN.js';
5
5
 
6
6
  interface GeneratedToolEntry extends McpToolDescriptor {
7
7
  readonly _operationId: string;
@@ -237,7 +237,7 @@ var init_operations = __esm({
237
237
  path: "/v1/systemone",
238
238
  request: { $ref: "#/schemas/SystemOneRequest" },
239
239
  response: { $ref: "#/schemas/SystemOneResponse" },
240
- environment: { local: true, cloud: false },
240
+ environment: { local: true, cloud: true },
241
241
  transport: { mode: "json", streaming: false },
242
242
  capabilities: {
243
243
  thinking: "unsupported",
@@ -255,8 +255,10 @@ var init_operations = __esm({
255
255
  status: { documented: true, experimental: true },
256
256
  domain: "native",
257
257
  notes: [
258
- "Local-only; Ollama Cloud rejects /v1/systemone.",
259
- "64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).",
258
+ "Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.",
259
+ "Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.",
260
+ "Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.",
261
+ "401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.",
260
262
  "No tools, no generation controls (temperature, top_p, etc.).",
261
263
  "Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.",
262
264
  "Experimental: behavioral surface may change between Ollama releases."
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generated/api/operations.ts","../src/mcp/generated-bridge.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,GAAA,EAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,uBAAA,EAAA,MAAA,uBAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,oBAAA,EAAA,MAAA,oBAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,UAAA,EAAA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I,EAAE,WAAA,EAAY,GAAI,EAAC;AAAA,MAC7D,GAAI,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,SAAS,CAAA,GAAI,EAAE,YAAA,EAAa,GAAI,EAAC;AAAA,MAC/D,GAAI,SAAS,MAAA,KAAW,KAAA,CAAA,GAAY,EAAE,MAAA,EAAQ,OAAA,CAAQ,MAAA,EAAO,GAAI;AAAC,KACnE,CAAA;AACD,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,MAAA,EAAQ,IAAA,EAAM,CAAC,CAAA,EAAG,CAAA;AAAA,MACjE,iBAAA,EAAmB;AAAA,KACrB;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,CAAA,YAAA,EAAe,IAAI,CAAA,SAAA,EAAY,OAAO,CAAA,CAAA,EAAI,CAAA;AAAA,MAC1E,iBAAA,EAAmB,EAAE,KAAA,EAAO,aAAA,EAAe,MAAM,OAAA;AAAQ,KAC3D;AAAA,EACF;AACF","file":"mcp-generated.js","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local-only; Ollama Cloud rejects /v1/systemone.',\n '64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * Generated Ollama MCP tools — runtime adapter.\n *\n * Reads the descriptor list from `src/generated/mcp/tools.json` (the Wave 6\n * MCP emitter output) and exposes them as a `McpToolDescriptor[]` that\n * `McpBridge` can register. The actual call execution delegates to the\n * generated `OllamaRuntime` via the user-provided runtime instance.\n *\n * Usage:\n * ```ts\n * import { NativeApi, OllamaRuntime } from '@nemesis-oss/ollama-sdk/runtime';\n * import { createGeneratedOllamaTools } from '@nemesis-oss/ollama-sdk/mcp/generated';\n *\n * const runtime = new OllamaRuntime({ http });\n * const tools = createGeneratedOllamaTools(runtime);\n * bridge.registerTools(tools);\n * ```\n *\n * This is a Wave 6 opt-in feature — the existing McpBridge continues to work\n * unchanged. Users who want generated MCP tools import this adapter\n * explicitly.\n */\nimport { readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { resolve, dirname } from 'node:path';\nimport type { McpToolDescriptor } from './types.js';\nimport { OllamaRuntime } from '../generated/runtime/runtime.js';\nimport type { OperationDefinition } from '../generated/runtime/operation-definition.js';\n\ninterface GeneratedToolEntry extends McpToolDescriptor {\n readonly _operationId: string;\n}\n\ninterface GeneratedToolsFile {\n readonly _comment?: string;\n readonly tools: readonly GeneratedToolEntry[];\n}\n\n/**\n * Resolve the path to `tools.json` across runtime environments:\n *\n * - **In source (development):** `src/generated/mcp/tools.json`\n * - **In the published tarball:** `dist/mcp/tools.json` (copied by tsup's\n * `onSuccess` hook; see tsup.config.ts)\n *\n * The dist bundle is at `dist/mcp-generated.js`, so the JSON sits two\n * directories up + into `mcp/`. The source file is at\n * `src/mcp/generated-bridge.ts`, so the JSON sits one directory up +\n * into `generated/mcp/`.\n */\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst TOOLS_JSON_PATH = (() => {\n // Try the source layout first (development), then fall back to the dist\n // layout (published). The order matters because in a tsx-run dev env\n // we may be executing from `src/mcp/generated-bridge.ts`, but in a\n // consumer install we're at `dist/mcp-generated.js`.\n const candidates = [\n resolve(HERE, '../generated/mcp/tools.json'), // source layout\n resolve(HERE, 'mcp/tools.json'), // dist layout (next to mcp-generated.js)\n resolve(HERE, '../mcp/tools.json'), // alt dist layout (sibling of bundled dir)\n ];\n for (const candidate of candidates) {\n try {\n readFileSync(candidate, 'utf8');\n return candidate;\n } catch {\n // try next candidate\n }\n }\n // Fall back to the source-layout path; the error will surface with a\n // clearer message when the loader is actually invoked.\n return candidates[0] ?? resolve(HERE, '../generated/mcp/tools.json');\n})();\n\nlet cachedTools: readonly GeneratedToolEntry[] | undefined;\n\n/** Load and cache the generated tool descriptors from tools.json. */\nexport function loadGeneratedOllamaTools(): readonly GeneratedToolEntry[] {\n if (cachedTools) return cachedTools;\n const raw = readFileSync(TOOLS_JSON_PATH, 'utf8');\n const parsed = JSON.parse(raw) as GeneratedToolsFile;\n cachedTools = parsed.tools;\n return cachedTools;\n}\n\n/** Drop the `_operationId` field before exposing the descriptor externally. */\nfunction publicDescriptor(entry: GeneratedToolEntry): McpToolDescriptor {\n const { _operationId, ...rest } = entry;\n void _operationId;\n return rest;\n}\n\n/**\n * Build a list of MCP tool descriptors for the generated Ollama operations.\n * Each tool can be invoked by name via {@link callGeneratedOllamaTool}.\n *\n * The descriptors are read once and cached for the lifetime of the process.\n */\nexport function listGeneratedOllamaTools(): readonly McpToolDescriptor[] {\n return loadGeneratedOllamaTools().map(publicDescriptor);\n}\n\n/**\n * Invoke a generated tool by name. The `name` must match a tool from\n * {@link listGeneratedOllamaTools}.\n *\n * Returns a `McpCallToolResult` containing the structured response. The\n * caller (typically `McpBridge`) is responsible for serializing the result\n * back over the MCP transport.\n */\nexport async function callGeneratedOllamaTool(\n runtime: OllamaRuntime,\n name: string,\n args: Record<string, unknown>,\n options?: { signal?: AbortSignal },\n): Promise<{ content: readonly { type: 'text'; text: string }[]; structuredContent: unknown }> {\n const tools = loadGeneratedOllamaTools();\n const entry = tools.find((t) => t.name === name);\n if (!entry) {\n return {\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\n structuredContent: { error: 'unknown_tool', name },\n };\n }\n\n // Look up the operation in the IR by id. We re-import the operations\n // module to avoid a circular dependency at module-load time.\n const operations = await import('../generated/api/operations.js');\n const opKey = `${entry._operationId}Op` as keyof typeof operations;\n const operation = operations[opKey] as OperationDefinition | undefined;\n if (!operation || typeof operation !== 'object' || !('operationId' in operation)) {\n return {\n content: [{ type: 'text', text: `Operation not found for ${name}` }],\n structuredContent: { error: 'operation_not_found', name },\n };\n }\n\n try {\n // Wave 15 (P0): split path/query/header parameters from the request\n // body. The MCP input schema may declare path parameters (e.g. `model`\n // for /v1/models/{model}) — those must be passed as `pathParams` to\n // the runtime, not put in the request body. The operation's\n // `parameters` field tells us which args are path/query/header vs body.\n const opParams = operation.parameters ?? [];\n const pathParams: Record<string, string> = {};\n const queryParams: Record<string, string> = {};\n const headerParams: Record<string, string> = {};\n const bodyArgs: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(args)) {\n const paramDef = opParams.find((p) => p.name === key);\n if (paramDef) {\n if (paramDef.in === 'path') {\n pathParams[key] = String(value);\n } else if (paramDef.in === 'query') {\n queryParams[key] = String(value);\n } else if (paramDef.in === 'header') {\n headerParams[key] = String(value);\n }\n } else {\n // Not a declared parameter → goes in the request body.\n bodyArgs[key] = value;\n }\n }\n\n const hasBody = Object.keys(bodyArgs).length > 0;\n const result = await runtime.invoke<unknown>({\n operation,\n body: hasBody ? bodyArgs : undefined,\n ...(Object.keys(pathParams).length > 0 ? { pathParams } : {}),\n ...(Object.keys(queryParams).length > 0 ? { queryParams } : {}),\n ...(Object.keys(headerParams).length > 0 ? { headerParams } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n structuredContent: result,\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: 'text', text: `Ollama tool ${name} failed: ${message}` }],\n structuredContent: { error: 'tool_failed', name, message },\n };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/generated/api/operations.ts","../src/mcp/generated-bridge.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,GAAA,EAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,uBAAA,EAAA,MAAA,uBAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,oBAAA,EAAA,MAAA,oBAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,WAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAAA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C;AAAA,MAC7D,GAAI,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,CAAE,SAAS,CAAA,GAAI,EAAE,YAAA,EAAa,GAAI,EAAC;AAAA,MAC/D,GAAI,SAAS,MAAA,KAAW,KAAA,CAAA,GAAY,EAAE,MAAA,EAAQ,OAAA,CAAQ,MAAA,EAAO,GAAI;AAAC,KACnE,CAAA;AACD,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,MAAA,EAAQ,IAAA,EAAM,CAAC,CAAA,EAAG,CAAA;AAAA,MACjE,iBAAA,EAAmB;AAAA,KACrB;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,CAAC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,CAAA,YAAA,EAAe,IAAI,CAAA,SAAA,EAAY,OAAO,CAAA,CAAA,EAAI,CAAA;AAAA,MAC1E,iBAAA,EAAmB,EAAE,KAAA,EAAO,aAAA,EAAe,MAAM,OAAA;AAAQ,KAC3D;AAAA,EACF;AACF","file":"mcp-generated.js","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.',\n 'Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.',\n \"Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.\",\n '401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * Generated Ollama MCP tools — runtime adapter.\n *\n * Reads the descriptor list from `src/generated/mcp/tools.json` (the Wave 6\n * MCP emitter output) and exposes them as a `McpToolDescriptor[]` that\n * `McpBridge` can register. The actual call execution delegates to the\n * generated `OllamaRuntime` via the user-provided runtime instance.\n *\n * Usage:\n * ```ts\n * import { NativeApi, OllamaRuntime } from '@nemesis-oss/ollama-sdk/runtime';\n * import { createGeneratedOllamaTools } from '@nemesis-oss/ollama-sdk/mcp/generated';\n *\n * const runtime = new OllamaRuntime({ http });\n * const tools = createGeneratedOllamaTools(runtime);\n * bridge.registerTools(tools);\n * ```\n *\n * This is a Wave 6 opt-in feature — the existing McpBridge continues to work\n * unchanged. Users who want generated MCP tools import this adapter\n * explicitly.\n */\nimport { readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { resolve, dirname } from 'node:path';\nimport type { McpToolDescriptor } from './types.js';\nimport { OllamaRuntime } from '../generated/runtime/runtime.js';\nimport type { OperationDefinition } from '../generated/runtime/operation-definition.js';\n\ninterface GeneratedToolEntry extends McpToolDescriptor {\n readonly _operationId: string;\n}\n\ninterface GeneratedToolsFile {\n readonly _comment?: string;\n readonly tools: readonly GeneratedToolEntry[];\n}\n\n/**\n * Resolve the path to `tools.json` across runtime environments:\n *\n * - **In source (development):** `src/generated/mcp/tools.json`\n * - **In the published tarball:** `dist/mcp/tools.json` (copied by tsup's\n * `onSuccess` hook; see tsup.config.ts)\n *\n * The dist bundle is at `dist/mcp-generated.js`, so the JSON sits two\n * directories up + into `mcp/`. The source file is at\n * `src/mcp/generated-bridge.ts`, so the JSON sits one directory up +\n * into `generated/mcp/`.\n */\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst TOOLS_JSON_PATH = (() => {\n // Try the source layout first (development), then fall back to the dist\n // layout (published). The order matters because in a tsx-run dev env\n // we may be executing from `src/mcp/generated-bridge.ts`, but in a\n // consumer install we're at `dist/mcp-generated.js`.\n const candidates = [\n resolve(HERE, '../generated/mcp/tools.json'), // source layout\n resolve(HERE, 'mcp/tools.json'), // dist layout (next to mcp-generated.js)\n resolve(HERE, '../mcp/tools.json'), // alt dist layout (sibling of bundled dir)\n ];\n for (const candidate of candidates) {\n try {\n readFileSync(candidate, 'utf8');\n return candidate;\n } catch {\n // try next candidate\n }\n }\n // Fall back to the source-layout path; the error will surface with a\n // clearer message when the loader is actually invoked.\n return candidates[0] ?? resolve(HERE, '../generated/mcp/tools.json');\n})();\n\nlet cachedTools: readonly GeneratedToolEntry[] | undefined;\n\n/** Load and cache the generated tool descriptors from tools.json. */\nexport function loadGeneratedOllamaTools(): readonly GeneratedToolEntry[] {\n if (cachedTools) return cachedTools;\n const raw = readFileSync(TOOLS_JSON_PATH, 'utf8');\n const parsed = JSON.parse(raw) as GeneratedToolsFile;\n cachedTools = parsed.tools;\n return cachedTools;\n}\n\n/** Drop the `_operationId` field before exposing the descriptor externally. */\nfunction publicDescriptor(entry: GeneratedToolEntry): McpToolDescriptor {\n const { _operationId, ...rest } = entry;\n void _operationId;\n return rest;\n}\n\n/**\n * Build a list of MCP tool descriptors for the generated Ollama operations.\n * Each tool can be invoked by name via {@link callGeneratedOllamaTool}.\n *\n * The descriptors are read once and cached for the lifetime of the process.\n */\nexport function listGeneratedOllamaTools(): readonly McpToolDescriptor[] {\n return loadGeneratedOllamaTools().map(publicDescriptor);\n}\n\n/**\n * Invoke a generated tool by name. The `name` must match a tool from\n * {@link listGeneratedOllamaTools}.\n *\n * Returns a `McpCallToolResult` containing the structured response. The\n * caller (typically `McpBridge`) is responsible for serializing the result\n * back over the MCP transport.\n */\nexport async function callGeneratedOllamaTool(\n runtime: OllamaRuntime,\n name: string,\n args: Record<string, unknown>,\n options?: { signal?: AbortSignal },\n): Promise<{ content: readonly { type: 'text'; text: string }[]; structuredContent: unknown }> {\n const tools = loadGeneratedOllamaTools();\n const entry = tools.find((t) => t.name === name);\n if (!entry) {\n return {\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\n structuredContent: { error: 'unknown_tool', name },\n };\n }\n\n // Look up the operation in the IR by id. We re-import the operations\n // module to avoid a circular dependency at module-load time.\n const operations = await import('../generated/api/operations.js');\n const opKey = `${entry._operationId}Op` as keyof typeof operations;\n const operation = operations[opKey] as OperationDefinition | undefined;\n if (!operation || typeof operation !== 'object' || !('operationId' in operation)) {\n return {\n content: [{ type: 'text', text: `Operation not found for ${name}` }],\n structuredContent: { error: 'operation_not_found', name },\n };\n }\n\n try {\n // Wave 15 (P0): split path/query/header parameters from the request\n // body. The MCP input schema may declare path parameters (e.g. `model`\n // for /v1/models/{model}) — those must be passed as `pathParams` to\n // the runtime, not put in the request body. The operation's\n // `parameters` field tells us which args are path/query/header vs body.\n const opParams = operation.parameters ?? [];\n const pathParams: Record<string, string> = {};\n const queryParams: Record<string, string> = {};\n const headerParams: Record<string, string> = {};\n const bodyArgs: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(args)) {\n const paramDef = opParams.find((p) => p.name === key);\n if (paramDef) {\n if (paramDef.in === 'path') {\n pathParams[key] = String(value);\n } else if (paramDef.in === 'query') {\n queryParams[key] = String(value);\n } else if (paramDef.in === 'header') {\n headerParams[key] = String(value);\n }\n } else {\n // Not a declared parameter → goes in the request body.\n bodyArgs[key] = value;\n }\n }\n\n const hasBody = Object.keys(bodyArgs).length > 0;\n const result = await runtime.invoke<unknown>({\n operation,\n body: hasBody ? bodyArgs : undefined,\n ...(Object.keys(pathParams).length > 0 ? { pathParams } : {}),\n ...(Object.keys(queryParams).length > 0 ? { queryParams } : {}),\n ...(Object.keys(headerParams).length > 0 ? { headerParams } : {}),\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n structuredContent: result,\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n content: [{ type: 'text', text: `Ollama tool ${name} failed: ${message}` }],\n structuredContent: { error: 'tool_failed', name, message },\n };\n }\n}\n"]}