@nemesis-oss/ollama-sdk 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,10 +28,7 @@
28
28
  "description": "Ollama POST /api/chat (native domain)\n\n- Use /api/show to discover model-specific thinking values and defaults.\n- Structured output (format field) is rejected by Ollama Cloud.",
29
29
  "inputSchema": {
30
30
  "type": "object",
31
- "required": [
32
- "model",
33
- "messages"
34
- ],
31
+ "required": ["model", "messages"],
35
32
  "properties": {
36
33
  "model": {
37
34
  "type": "string",
@@ -42,19 +39,11 @@
42
39
  "description": "Chat history as an array of message objects (each with a role and content)",
43
40
  "items": {
44
41
  "type": "object",
45
- "required": [
46
- "role",
47
- "content"
48
- ],
42
+ "required": ["role", "content"],
49
43
  "properties": {
50
44
  "role": {
51
45
  "type": "string",
52
- "enum": [
53
- "system",
54
- "user",
55
- "assistant",
56
- "tool"
57
- ],
46
+ "enum": ["system", "user", "assistant", "tool"],
58
47
  "description": "Author of the message."
59
48
  },
60
49
  "content": {
@@ -76,9 +65,7 @@
76
65
  "properties": {
77
66
  "function": {
78
67
  "type": "object",
79
- "required": [
80
- "name"
81
- ],
68
+ "required": ["name"],
82
69
  "properties": {
83
70
  "name": {
84
71
  "type": "string",
@@ -106,24 +93,16 @@
106
93
  "description": "Optional list of function tools the model may call during the chat",
107
94
  "items": {
108
95
  "type": "object",
109
- "required": [
110
- "type",
111
- "function"
112
- ],
96
+ "required": ["type", "function"],
113
97
  "properties": {
114
98
  "type": {
115
99
  "type": "string",
116
- "enum": [
117
- "function"
118
- ],
100
+ "enum": ["function"],
119
101
  "description": "Type of tool (always `function`)"
120
102
  },
121
103
  "function": {
122
104
  "type": "object",
123
- "required": [
124
- "name",
125
- "parameters"
126
- ],
105
+ "required": ["name", "parameters"],
127
106
  "properties": {
128
107
  "name": {
129
108
  "type": "string",
@@ -146,9 +125,7 @@
146
125
  "oneOf": [
147
126
  {
148
127
  "type": "string",
149
- "enum": [
150
- "json"
151
- ]
128
+ "enum": ["json"]
152
129
  },
153
130
  {
154
131
  "type": "object"
@@ -261,10 +238,7 @@
261
238
  "description": "Ollama POST /api/copy (native domain)",
262
239
  "inputSchema": {
263
240
  "type": "object",
264
- "required": [
265
- "source",
266
- "destination"
267
- ],
241
+ "required": ["source", "destination"],
268
242
  "properties": {
269
243
  "source": {
270
244
  "type": "string",
@@ -290,9 +264,7 @@
290
264
  "description": "Ollama POST /api/create (native domain)\n\n- Model creation is local-only; Ollama Cloud does not support it.",
291
265
  "inputSchema": {
292
266
  "type": "object",
293
- "required": [
294
- "model"
295
- ],
267
+ "required": ["model"],
296
268
  "properties": {
297
269
  "model": {
298
270
  "type": "string",
@@ -355,19 +327,11 @@
355
327
  "type": "array",
356
328
  "items": {
357
329
  "type": "object",
358
- "required": [
359
- "role",
360
- "content"
361
- ],
330
+ "required": ["role", "content"],
362
331
  "properties": {
363
332
  "role": {
364
333
  "type": "string",
365
- "enum": [
366
- "system",
367
- "user",
368
- "assistant",
369
- "tool"
370
- ],
334
+ "enum": ["system", "user", "assistant", "tool"],
371
335
  "description": "Author of the message."
372
336
  },
373
337
  "content": {
@@ -389,9 +353,7 @@
389
353
  "properties": {
390
354
  "function": {
391
355
  "type": "object",
392
- "required": [
393
- "name"
394
- ],
356
+ "required": ["name"],
395
357
  "properties": {
396
358
  "name": {
397
359
  "type": "string",
@@ -447,9 +409,7 @@
447
409
  "description": "Ollama DELETE /api/delete (native domain)",
448
410
  "inputSchema": {
449
411
  "type": "object",
450
- "required": [
451
- "model"
452
- ],
412
+ "required": ["model"],
453
413
  "properties": {
454
414
  "model": {
455
415
  "type": "string",
@@ -471,10 +431,7 @@
471
431
  "description": "Ollama POST /api/embed (native domain)",
472
432
  "inputSchema": {
473
433
  "type": "object",
474
- "required": [
475
- "model",
476
- "input"
477
- ],
434
+ "required": ["model", "input"],
478
435
  "properties": {
479
436
  "model": {
480
437
  "type": "string",
@@ -575,9 +532,7 @@
575
532
  "description": "Ollama POST /api/generate (native domain)",
576
533
  "inputSchema": {
577
534
  "type": "object",
578
- "required": [
579
- "model"
580
- ],
535
+ "required": ["model"],
581
536
  "properties": {
582
537
  "model": {
583
538
  "type": "string",
@@ -745,9 +700,7 @@
745
700
  "description": "Ollama POST /api/pull (native domain)",
746
701
  "inputSchema": {
747
702
  "type": "object",
748
- "required": [
749
- "model"
750
- ],
703
+ "required": ["model"],
751
704
  "properties": {
752
705
  "model": {
753
706
  "type": "string",
@@ -778,9 +731,7 @@
778
731
  "description": "Ollama POST /api/push (native domain)",
779
732
  "inputSchema": {
780
733
  "type": "object",
781
- "required": [
782
- "model"
783
- ],
734
+ "required": ["model"],
784
735
  "properties": {
785
736
  "model": {
786
737
  "type": "string",
@@ -811,9 +762,7 @@
811
762
  "description": "Ollama POST /api/show (native domain)\n\n- Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).",
812
763
  "inputSchema": {
813
764
  "type": "object",
814
- "required": [
815
- "model"
816
- ],
765
+ "required": ["model"],
817
766
  "properties": {
818
767
  "model": {
819
768
  "type": "string",
@@ -53,7 +53,9 @@ var init_operations = __esm({
53
53
  capabilities: {},
54
54
  status: { documented: true },
55
55
  domain: "native",
56
- notes: ["HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest."]
56
+ notes: [
57
+ "HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest."
58
+ ]
57
59
  };
58
60
  chatOp = {
59
61
  operationId: "chat",
@@ -63,10 +65,19 @@ var init_operations = __esm({
63
65
  response: { $ref: "#/schemas/ChatResponse" },
64
66
  environment: { local: true, cloud: true },
65
67
  transport: { mode: "ndjson", streaming: true, streamingDefault: true },
66
- capabilities: { thinking: "model-dependent", tools: "model-dependent", vision: "model-dependent", structuredOutput: "supported", logprobs: "supported" },
68
+ capabilities: {
69
+ thinking: "model-dependent",
70
+ tools: "model-dependent",
71
+ vision: "model-dependent",
72
+ structuredOutput: "supported",
73
+ logprobs: "supported"
74
+ },
67
75
  status: { documented: true },
68
76
  domain: "native",
69
- notes: ["Use /api/show to discover model-specific thinking values and defaults.", "Structured output (format field) is rejected by Ollama Cloud."]
77
+ notes: [
78
+ "Use /api/show to discover model-specific thinking values and defaults.",
79
+ "Structured output (format field) is rejected by Ollama Cloud."
80
+ ]
70
81
  };
71
82
  copyOp = {
72
83
  operationId: "copy",
@@ -123,7 +134,12 @@ var init_operations = __esm({
123
134
  response: { $ref: "#/schemas/GenerateResponse" },
124
135
  environment: { local: true, cloud: true },
125
136
  transport: { mode: "ndjson", streaming: true, streamingDefault: true },
126
- capabilities: { thinking: "model-dependent", vision: "supported", structuredOutput: "supported", logprobs: "supported" },
137
+ capabilities: {
138
+ thinking: "model-dependent",
139
+ vision: "supported",
140
+ structuredOutput: "supported",
141
+ logprobs: "supported"
142
+ },
127
143
  status: { documented: true },
128
144
  domain: "native"
129
145
  };
@@ -173,7 +189,9 @@ var init_operations = __esm({
173
189
  capabilities: {},
174
190
  status: { documented: true },
175
191
  domain: "native",
176
- notes: ["Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings)."]
192
+ notes: [
193
+ "Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings)."
194
+ ]
177
195
  };
178
196
  systemOneOp = {
179
197
  operationId: "systemOne",
@@ -181,11 +199,23 @@ var init_operations = __esm({
181
199
  path: "/v1/systemone",
182
200
  environment: { local: true, cloud: false },
183
201
  transport: { mode: "json", streaming: false },
184
- capabilities: { thinking: "unsupported", tools: "unsupported", vision: "unsupported", structuredOutput: "unsupported", logprobs: "unsupported", embeddings: "unsupported" },
202
+ capabilities: {
203
+ thinking: "unsupported",
204
+ tools: "unsupported",
205
+ vision: "unsupported",
206
+ structuredOutput: "unsupported",
207
+ logprobs: "unsupported",
208
+ embeddings: "unsupported"
209
+ },
185
210
  constraints: { minOllamaVersion: "0.35.0", maxRequestBytes: 65536 },
186
211
  status: { documented: true, experimental: true },
187
212
  domain: "native",
188
- notes: ["Local-only; Ollama Cloud rejects /v1/systemone.", "Hard 64 KiB request body limit enforced by the server.", "No images, no tools, no generation controls (temperature, top_p, etc.).", "Experimental: behavioral surface may change between Ollama releases."]
213
+ notes: [
214
+ "Local-only; Ollama Cloud rejects /v1/systemone.",
215
+ "Hard 64 KiB request body limit enforced by the server.",
216
+ "No images, no tools, no generation controls (temperature, top_p, etc.).",
217
+ "Experimental: behavioral surface may change between Ollama releases."
218
+ ]
189
219
  };
190
220
  tagsOp = {
191
221
  operationId: "tags",
@@ -215,10 +245,18 @@ var init_operations = __esm({
215
245
  path: "/v1/chat/completions",
216
246
  environment: { local: true, cloud: true },
217
247
  transport: { mode: "sse", streaming: true, streamingDefault: false },
218
- capabilities: { thinking: "model-dependent", tools: "model-dependent", vision: "model-dependent", structuredOutput: "supported", logprobs: "supported" },
248
+ capabilities: {
249
+ thinking: "model-dependent",
250
+ tools: "model-dependent",
251
+ vision: "model-dependent",
252
+ structuredOutput: "supported",
253
+ logprobs: "supported"
254
+ },
219
255
  status: { documented: true },
220
256
  domain: "openai",
221
- notes: ["Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx."]
257
+ notes: [
258
+ "Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx."
259
+ ]
222
260
  };
223
261
  openaiCompletionsOp = {
224
262
  operationId: "openaiCompletions",
@@ -270,7 +308,9 @@ var init_operations = __esm({
270
308
  capabilities: { thinking: "model-dependent", tools: "model-dependent" },
271
309
  status: { documented: true },
272
310
  domain: "openai",
273
- notes: ["Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported."]
311
+ notes: [
312
+ "Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported."
313
+ ]
274
314
  };
275
315
  anthropicMessagesOp = {
276
316
  operationId: "anthropicMessages",
@@ -281,7 +321,10 @@ var init_operations = __esm({
281
321
  capabilities: { thinking: "model-dependent", tools: "model-dependent" },
282
322
  status: { documented: true },
283
323
  domain: "anthropic",
284
- notes: ["tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.", "Nested cache_control fields under messages[].content[].cache_control are unsupported."]
324
+ notes: [
325
+ "tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.",
326
+ "Nested cache_control fields under messages[].content[].cache_control are unsupported."
327
+ ]
285
328
  };
286
329
  allOperations = [
287
330
  blobsOp,
@@ -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,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;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,M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,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.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 blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: { },\n status: { documented: true},\n domain: 'native',\n notes: ['HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.'],\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: { thinking: 'model-dependent', tools: 'model-dependent', vision: 'model-dependent', structuredOutput: 'supported', logprobs: 'supported' },\n status: { documented: true},\n domain: 'native',\n notes: ['Use /api/show to discover model-specific thinking values and defaults.', 'Structured output (format field) is rejected by Ollama Cloud.'],\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 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 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: { thinking: 'model-dependent', vision: 'supported', structuredOutput: 'supported', logprobs: 'supported' },\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: ['Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).'],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: { thinking: 'unsupported', tools: 'unsupported', vision: 'unsupported', structuredOutput: 'unsupported', logprobs: 'unsupported', embeddings: 'unsupported' },\n constraints: { minOllamaVersion: '0.35.0', maxRequestBytes: 65536 },\n status: { documented: true, experimental: true},\n domain: 'native',\n notes: ['Local-only; Ollama Cloud rejects /v1/systemone.', 'Hard 64 KiB request body limit enforced by the server.', 'No images, no tools, no generation controls (temperature, top_p, etc.).', 'Experimental: behavioral surface may change between Ollama releases.'],\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 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 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: { thinking: 'model-dependent', tools: 'model-dependent', vision: 'model-dependent', structuredOutput: 'supported', logprobs: 'supported' },\n status: { documented: true},\n domain: 'openai',\n notes: ['Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.'],\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: 'supported' },\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 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: ['Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.'],\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: ['tool_choice and metadata are explicitly unsupported by Ollama\\'s Anthropic compat layer.', 'Nested cache_control fields under messages[].content[].cache_control are unsupported.'],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n versionOp,\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 const result = await runtime.invoke<unknown>({\n operation,\n body: args,\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,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;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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,EAAM,CAAA,wBAAA,EAA2B,IAAI,CAAA,CAAA,EAAI,CAAA;AAAA,MACnE,iBAAA,EAAmB,EAAE,KAAA,EAAO,qBAAA,EAAuB,IAAA;AAAK,KAC1D;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,MAAA,CAAgB;AAAA,MAC3C,SAAA;AAAA,MACA,IAAA,EAAM,IAAA;AAAA,MACN,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.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 blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\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 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 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 environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'unsupported',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: { minOllamaVersion: '0.35.0', maxRequestBytes: 65536 },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local-only; Ollama Cloud rejects /v1/systemone.',\n 'Hard 64 KiB request body limit enforced by the server.',\n 'No images, no tools, no generation controls (temperature, top_p, etc.).',\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 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 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: 'supported',\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: 'supported' },\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 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 blobsOp,\n chatOp,\n copyOp,\n createOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n versionOp,\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 const result = await runtime.invoke<unknown>({\n operation,\n body: args,\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"]}
@@ -50,7 +50,9 @@ var init_operations = __esm({
50
50
  capabilities: {},
51
51
  status: { documented: true },
52
52
  domain: "native",
53
- notes: ["HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest."]
53
+ notes: [
54
+ "HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest."
55
+ ]
54
56
  };
55
57
  chatOp = {
56
58
  operationId: "chat",
@@ -60,10 +62,19 @@ var init_operations = __esm({
60
62
  response: { $ref: "#/schemas/ChatResponse" },
61
63
  environment: { local: true, cloud: true },
62
64
  transport: { mode: "ndjson", streaming: true, streamingDefault: true },
63
- capabilities: { thinking: "model-dependent", tools: "model-dependent", vision: "model-dependent", structuredOutput: "supported", logprobs: "supported" },
65
+ capabilities: {
66
+ thinking: "model-dependent",
67
+ tools: "model-dependent",
68
+ vision: "model-dependent",
69
+ structuredOutput: "supported",
70
+ logprobs: "supported"
71
+ },
64
72
  status: { documented: true },
65
73
  domain: "native",
66
- notes: ["Use /api/show to discover model-specific thinking values and defaults.", "Structured output (format field) is rejected by Ollama Cloud."]
74
+ notes: [
75
+ "Use /api/show to discover model-specific thinking values and defaults.",
76
+ "Structured output (format field) is rejected by Ollama Cloud."
77
+ ]
67
78
  };
68
79
  copyOp = {
69
80
  operationId: "copy",
@@ -120,7 +131,12 @@ var init_operations = __esm({
120
131
  response: { $ref: "#/schemas/GenerateResponse" },
121
132
  environment: { local: true, cloud: true },
122
133
  transport: { mode: "ndjson", streaming: true, streamingDefault: true },
123
- capabilities: { thinking: "model-dependent", vision: "supported", structuredOutput: "supported", logprobs: "supported" },
134
+ capabilities: {
135
+ thinking: "model-dependent",
136
+ vision: "supported",
137
+ structuredOutput: "supported",
138
+ logprobs: "supported"
139
+ },
124
140
  status: { documented: true },
125
141
  domain: "native"
126
142
  };
@@ -170,7 +186,9 @@ var init_operations = __esm({
170
186
  capabilities: {},
171
187
  status: { documented: true },
172
188
  domain: "native",
173
- notes: ["Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings)."]
189
+ notes: [
190
+ "Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings)."
191
+ ]
174
192
  };
175
193
  systemOneOp = {
176
194
  operationId: "systemOne",
@@ -178,11 +196,23 @@ var init_operations = __esm({
178
196
  path: "/v1/systemone",
179
197
  environment: { local: true, cloud: false },
180
198
  transport: { mode: "json", streaming: false },
181
- capabilities: { thinking: "unsupported", tools: "unsupported", vision: "unsupported", structuredOutput: "unsupported", logprobs: "unsupported", embeddings: "unsupported" },
199
+ capabilities: {
200
+ thinking: "unsupported",
201
+ tools: "unsupported",
202
+ vision: "unsupported",
203
+ structuredOutput: "unsupported",
204
+ logprobs: "unsupported",
205
+ embeddings: "unsupported"
206
+ },
182
207
  constraints: { minOllamaVersion: "0.35.0", maxRequestBytes: 65536 },
183
208
  status: { documented: true, experimental: true },
184
209
  domain: "native",
185
- notes: ["Local-only; Ollama Cloud rejects /v1/systemone.", "Hard 64 KiB request body limit enforced by the server.", "No images, no tools, no generation controls (temperature, top_p, etc.).", "Experimental: behavioral surface may change between Ollama releases."]
210
+ notes: [
211
+ "Local-only; Ollama Cloud rejects /v1/systemone.",
212
+ "Hard 64 KiB request body limit enforced by the server.",
213
+ "No images, no tools, no generation controls (temperature, top_p, etc.).",
214
+ "Experimental: behavioral surface may change between Ollama releases."
215
+ ]
186
216
  };
187
217
  tagsOp = {
188
218
  operationId: "tags",
@@ -212,10 +242,18 @@ var init_operations = __esm({
212
242
  path: "/v1/chat/completions",
213
243
  environment: { local: true, cloud: true },
214
244
  transport: { mode: "sse", streaming: true, streamingDefault: false },
215
- capabilities: { thinking: "model-dependent", tools: "model-dependent", vision: "model-dependent", structuredOutput: "supported", logprobs: "supported" },
245
+ capabilities: {
246
+ thinking: "model-dependent",
247
+ tools: "model-dependent",
248
+ vision: "model-dependent",
249
+ structuredOutput: "supported",
250
+ logprobs: "supported"
251
+ },
216
252
  status: { documented: true },
217
253
  domain: "openai",
218
- notes: ["Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx."]
254
+ notes: [
255
+ "Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx."
256
+ ]
219
257
  };
220
258
  openaiCompletionsOp = {
221
259
  operationId: "openaiCompletions",
@@ -267,7 +305,9 @@ var init_operations = __esm({
267
305
  capabilities: { thinking: "model-dependent", tools: "model-dependent" },
268
306
  status: { documented: true },
269
307
  domain: "openai",
270
- notes: ["Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported."]
308
+ notes: [
309
+ "Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported."
310
+ ]
271
311
  };
272
312
  anthropicMessagesOp = {
273
313
  operationId: "anthropicMessages",
@@ -278,7 +318,10 @@ var init_operations = __esm({
278
318
  capabilities: { thinking: "model-dependent", tools: "model-dependent" },
279
319
  status: { documented: true },
280
320
  domain: "anthropic",
281
- notes: ["tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.", "Nested cache_control fields under messages[].content[].cache_control are unsupported."]
321
+ notes: [
322
+ "tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.",
323
+ "Nested cache_control fields under messages[].content[].cache_control are unsupported."
324
+ ]
282
325
  };
283
326
  allOperations = [
284
327
  blobsOp,