@lihuu/dsh-ollama-cloud 0.1.0 → 0.1.2

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 CHANGED
@@ -347,7 +347,10 @@ async function* parseSse(stream, onComment) {
347
347
  }
348
348
 
349
349
  // src/translate.ts
350
- import { ToolCallId, EMPTY_RESPONSE_CODE, LlmError as LlmError3 } from "@deepseek-ai/dsh-llm";
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":
@@ -794,7 +797,7 @@ function resolveAdapterOptions(config) {
794
797
  retryPolicy: resolveRetryPolicy(config.retryPolicy, "llm-ollama-cloud: retryPolicy")
795
798
  };
796
799
  }
797
- function apply(ctx, config) {
800
+ function apply(ctx, config = {}) {
798
801
  const options = () => resolveAdapterOptions(config);
799
802
  const connection = options();
800
803
  credentialRef(connection.apiKeyEnv);
package/lib/index.d.ts CHANGED
@@ -59,4 +59,4 @@ export declare const PUBLIC_BASE_URL = "https://ollama.com/v1";
59
59
  * @returns validated connection facts plus the credential reference.
60
60
  */
61
61
  export declare function resolveAdapterOptions(config: Config): OllamaConnectionOptions;
62
- export declare function apply(ctx: Context, config: Config): void;
62
+ export declare function apply(ctx: Context, config?: Config): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lihuu/dsh-ollama-cloud",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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/index.ts CHANGED
@@ -181,7 +181,7 @@ interface CredentialsLike {
181
181
  resolve(ref: string): Promise<{ value: string; source: string } | undefined>
182
182
  }
183
183
 
184
- export function apply(ctx: Context, config: Config): void {
184
+ export function apply(ctx: Context, config: Config = {}): void {
185
185
  // Static composition: connection facts resolve once at load. A config
186
186
  // change in the mount requires a restart — there is no settings section.
187
187
  const options = (): OllamaConnectionOptions => resolveAdapterOptions(config)
package/src/translate.ts CHANGED
@@ -7,11 +7,23 @@
7
7
  * @module dsh-llm-ollama-cloud/translate
8
8
  */
9
9
 
10
- import { ToolCallId, EMPTY_RESPONSE_CODE, LlmError } from '@deepseek-ai/dsh-llm'
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