@lihuu/dsh-ollama-cloud 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -1
- package/package.json +2 -1
- package/src/translate.ts +13 -1
package/dist/index.js
CHANGED
|
@@ -347,7 +347,10 @@ async function* parseSse(stream, onComment) {
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
// src/translate.ts
|
|
350
|
-
import {
|
|
350
|
+
import { EMPTY_RESPONSE_CODE, LlmError as LlmError3 } from "@deepseek-ai/dsh-llm";
|
|
351
|
+
function ToolCallId(id) {
|
|
352
|
+
return id;
|
|
353
|
+
}
|
|
351
354
|
function mapFinishReason(reason) {
|
|
352
355
|
switch (reason) {
|
|
353
356
|
case "stop":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lihuu/dsh-ollama-cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "DeepSeek Harness plugin: adds the Ollama cloud chat-completions provider for LLM models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@deepseek-ai/dsh-brand": "*",
|
|
42
43
|
"typescript": "^5.5.0",
|
|
43
44
|
"@types/node": "^22.0.0"
|
|
44
45
|
},
|
package/src/translate.ts
CHANGED
|
@@ -7,11 +7,23 @@
|
|
|
7
7
|
* @module dsh-llm-ollama-cloud/translate
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { EMPTY_RESPONSE_CODE, LlmError } from '@deepseek-ai/dsh-llm'
|
|
11
11
|
import type { ContentBlock, FinishReason, StreamChunk, TokenUsage } from '@deepseek-ai/dsh-llm'
|
|
12
|
+
import type { Branded } from '@deepseek-ai/dsh-brand'
|
|
12
13
|
import { DONE } from './sse.ts'
|
|
13
14
|
import type { WireChunk, WireUsage } from './types.ts'
|
|
14
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Brand a provider-issued tool call id. dsh-llm's export name differs across
|
|
18
|
+
* harness versions (`ToolCallId` vs `CallId`), so the plugin brands locally
|
|
19
|
+
* with the shared dsh-brand primitive; the brand is type-only, and the runtime
|
|
20
|
+
* value is the plain string either version accepts.
|
|
21
|
+
*/
|
|
22
|
+
type ToolCallId = Branded<'ToolCallId'>
|
|
23
|
+
function ToolCallId(id: string): ToolCallId {
|
|
24
|
+
return id as ToolCallId
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
/** One open block under assembly. */
|
|
16
28
|
interface OpenBlock {
|
|
17
29
|
index: number
|