@nemesis-oss/ollama-sdk 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/dist/{anthropic-BvHOsidk.d.cts → anthropic-CAvwqIjx.d.ts} +3 -3
- package/dist/{anthropic-CvGVSoVP.d.ts → anthropic-DIPnBwlf.d.cts} +3 -3
- package/dist/{compose-CeFbHJeO.d.ts → compose-75UFDzOO.d.ts} +1 -1
- package/dist/{compose-DFkmtUOP.d.cts → compose-C4QxEZOS.d.cts} +1 -1
- package/dist/generated-api.cjs +5 -3
- package/dist/generated-api.cjs.map +1 -1
- package/dist/generated-api.d.cts +9 -9
- package/dist/generated-api.d.ts +9 -9
- package/dist/generated-api.js +5 -3
- package/dist/generated-api.js.map +1 -1
- package/dist/generated-runtime.cjs +22 -4
- package/dist/generated-runtime.cjs.map +1 -1
- package/dist/generated-runtime.d.cts +2 -2
- package/dist/generated-runtime.d.ts +2 -2
- package/dist/generated-runtime.js +22 -4
- package/dist/generated-runtime.js.map +1 -1
- package/dist/index.cjs +48 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -36
- package/dist/index.d.ts +76 -36
- package/dist/index.js +48 -15
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools.json +3 -3
- package/dist/mcp-generated.cjs +5 -3
- package/dist/mcp-generated.cjs.map +1 -1
- package/dist/mcp-generated.d.cts +2 -2
- package/dist/mcp-generated.d.ts +2 -2
- package/dist/mcp-generated.js +5 -3
- package/dist/mcp-generated.js.map +1 -1
- package/dist/{runtime-CdZP-N7j.d.cts → runtime-C28YEAHC.d.cts} +28 -5
- package/dist/{runtime-CFuv7Ifh.d.ts → runtime-DYCxYGG-.d.ts} +28 -5
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.d.cts +3 -3
- package/dist/skills.d.ts +3 -3
- package/dist/skills.js.map +1 -1
- package/dist/{types-DbPnfVh-.d.cts → types-Y3u0FtdN.d.cts} +10 -0
- package/dist/{types-DbPnfVh-.d.ts → types-Y3u0FtdN.d.ts} +10 -0
- package/package.json +2 -1
package/dist/mcp/tools.json
CHANGED
|
@@ -808,7 +808,7 @@
|
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
810
|
"name": "ollama_systemOne",
|
|
811
|
-
"description": "Ollama POST /v1/systemone (native domain)\n\n- Local
|
|
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": "
|
|
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.",
|
|
@@ -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": {
|
package/dist/mcp-generated.cjs
CHANGED
|
@@ -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:
|
|
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
|
|
262
|
-
"64 KiB
|
|
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,"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C;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.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.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AAA,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.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"]}
|
package/dist/mcp-generated.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as McpToolDescriptor } from './types-CI-gM2u5.cjs';
|
|
2
|
-
import { O as OllamaRuntime } from './runtime-
|
|
2
|
+
import { O as OllamaRuntime } from './runtime-C28YEAHC.cjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-Y3u0FtdN.cjs';
|
|
5
5
|
|
|
6
6
|
interface GeneratedToolEntry extends McpToolDescriptor {
|
|
7
7
|
readonly _operationId: string;
|
package/dist/mcp-generated.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as McpToolDescriptor } from './types-CI-gM2u5.js';
|
|
2
|
-
import { O as OllamaRuntime } from './runtime-
|
|
2
|
+
import { O as OllamaRuntime } from './runtime-DYCxYGG-.js';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-Y3u0FtdN.js';
|
|
5
5
|
|
|
6
6
|
interface GeneratedToolEntry extends McpToolDescriptor {
|
|
7
7
|
readonly _operationId: string;
|
package/dist/mcp-generated.js
CHANGED
|
@@ -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:
|
|
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
|
|
259
|
-
"64 KiB
|
|
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;AAA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AAQ,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,M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,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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Message, m as ChatResponse, i as ToolCall, b as ProgressResponse, o as GenerateResponse } from './types-
|
|
1
|
+
import { n as Message, m as ChatResponse, i as ToolCall, b as ProgressResponse, o as GenerateResponse } from './types-Y3u0FtdN.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -140,6 +140,23 @@ declare class OllamaTimeoutError extends OllamaClientError {
|
|
|
140
140
|
declare class OllamaAuthError extends OllamaClientError {
|
|
141
141
|
constructor(message: string, options?: Omit<OllamaClientErrorOptions, 'code' | 'retryable'> | undefined);
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Thrown for HTTP 402 responses — payment required. Ollama's cloud returns
|
|
145
|
+
* 402 when a cloud model (for example `clef:cloud` through
|
|
146
|
+
* `/v1/systemone`) is not included in the Free plan, when usage credits
|
|
147
|
+
* are needed, or when a payment fails.
|
|
148
|
+
*
|
|
149
|
+
* Distinct from {@link OllamaAuthError} (401/403): the credentials are
|
|
150
|
+
* fine; the billing relationship is the problem. Callers should branch
|
|
151
|
+
* to an upgrade/add-credits flow, not re-prompt for an API key.
|
|
152
|
+
*
|
|
153
|
+
* 2026-10-16 refresh: 402 joined the documented `/v1/systemone` response
|
|
154
|
+
* set with the System One cloud launch; previously it fell through to
|
|
155
|
+
* {@link OllamaGenericClientError}.
|
|
156
|
+
*/
|
|
157
|
+
declare class OllamaPaymentRequiredError extends OllamaClientError {
|
|
158
|
+
constructor(message: string, options?: Omit<OllamaClientErrorOptions, 'code' | 'retryable' | 'status'> | undefined);
|
|
159
|
+
}
|
|
143
160
|
declare class OllamaNotFoundError extends OllamaClientError {
|
|
144
161
|
constructor(message: string, options?: Omit<OllamaClientErrorOptions, 'code' | 'retryable'> | undefined);
|
|
145
162
|
}
|
|
@@ -264,9 +281,15 @@ declare class OllamaRequestValidationError extends OllamaClientError {
|
|
|
264
281
|
}
|
|
265
282
|
/**
|
|
266
283
|
* Thrown by `OllamaRuntime.invoke` BEFORE any HTTP request is made when the
|
|
267
|
-
* serialized request body exceeds the operation's declared
|
|
268
|
-
*
|
|
269
|
-
*
|
|
284
|
+
* serialized request body exceeds the operation's declared size constraints.
|
|
285
|
+
* The Ollama server returns 413 for such payloads; this client-side check
|
|
286
|
+
* fails fast so the round-trip is avoided.
|
|
287
|
+
*
|
|
288
|
+
* Dual bound (2026-10-16 refresh, matching the upstream clarification):
|
|
289
|
+
* `constraints.maxRequestBytes` bounds the text and schema portion of the
|
|
290
|
+
* body (images excluded), `constraints.maxRequestBytesWithImages` bounds
|
|
291
|
+
* the whole serialized request (images included) — both apply to every
|
|
292
|
+
* request simultaneously.
|
|
270
293
|
*
|
|
271
294
|
* Wave 12 (P0 #5): the IR has carried `maxRequestBytes` for System One
|
|
272
295
|
* (64 KiB) since v1.7.0, but the runtime never enforced it. This closes
|
|
@@ -956,4 +979,4 @@ declare class OllamaRuntime {
|
|
|
956
979
|
private assertOperationAllowed;
|
|
957
980
|
}
|
|
958
981
|
|
|
959
|
-
export {
|
|
982
|
+
export { OllamaPaymentRequiredError as $, type AbortableAsyncIterable as A, type BinaryBody as B, type ChatStreamResult as C, type DoneEvent as D, type ErrorEvent as E, type FetchLike as F, type GenerateStreamResult as G, HttpClient as H, type InvokeRequest as I, type OllamaClientErrorOptions as J, type OllamaErrorRequestContext as K, type Logger as L, type Middleware as M, NANOS_PER_MS as N, OllamaRuntime as O, type ProgressStreamResult as P, type OllamaErrorResponseContext as Q, type RequestLifecycleHook as R, type SchemaRef as S, type TokenUsage as T, OllamaGenericClientError as U, OllamaIncompatibleModelError as V, OllamaMcpError as W, OllamaModelRoutingError as X, OllamaNetworkError as Y, OllamaNotFoundError as Z, OllamaOverloadedError as _, type OperationDefinition as a, OllamaQuotaExceededError as a0, OllamaRateLimitError as a1, OllamaRequestTooLargeError as a2, OllamaRequestValidationError as a3, OllamaResponseValidationError as a4, OllamaServerError as a5, OllamaServerVersionUnknownError as a6, OllamaSkillInvalidError as a7, OllamaSkillNotFoundError as a8, OllamaStreamError as a9, OllamaTimeoutError as aa, OllamaToolTimeoutError as ab, OllamaToolValidationError as ac, OllamaUnsupportedCapabilityError as ad, type RequestContext as ae, type RequestLifecycleEvent as af, type ResponseContext as ag, type SseEvent as ah, type ThinkingEvent as ai, type TokenEvent as aj, type ToolCallEvent as ak, composeMiddleware as al, createConsoleLogger as am, extractUsage as an, isNetworkLevelError as ao, mapError as ap, parseSseStream as aq, type OllamaRuntimeOptions as b, type OllamaStreamEvent as c, type OllamaStreamEventType as d, type RawUsageSource as e, type HttpBody as f, type HttpClientOptions as g, type HttpRequestOptions as h, type LifecycleErrorEvent as i, type LifecycleRetryEvent as j, type LifecycleStartEvent as k, type LifecycleSuccessEvent as l, type LogFn as m, type MessageEvent as n, type MiddlewareContext as o, NANOS_PER_SECOND as p, NETWORK_ERROR_CODES as q, NOOP_LOGGER as r, type NextFunction as s, OllamaAbortError as t, OllamaAgentMaxIterationsError as u, OllamaAgentMaxToolCallsError as v, OllamaAgentToolLoopError as w, OllamaAuthError as x, OllamaBadGatewayError as y, OllamaClientError as z };
|