dsh-llm-verifier 0.1.8 → 0.1.9

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.
@@ -1,4 +1,5 @@
1
- import { BlockAssembler, ReasoningEffortId, createUserMessage, deepFreeze } from "@deepseek-ai/dsh-llm";
1
+ import * as LlmModule from "@deepseek-ai/dsh-llm";
2
+ import { BlockAssembler, ReasoningEffortId, createUserMessage } from "@deepseek-ai/dsh-llm";
2
3
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
3
4
  import { mkdir, readFile, rename, unlink, writeFile } from "node:fs/promises";
4
5
  import { dirname, isAbsolute, join, resolve } from "node:path";
@@ -212,6 +213,15 @@ var TopLogprobCapabilityCache = class {
212
213
  };
213
214
  //#endregion
214
215
  //#region src/caller.ts
216
+ function deepFreeze(value) {
217
+ const mod = LlmModule;
218
+ if (typeof mod.deepFreeze === "function") return mod.deepFreeze(value);
219
+ if (value && typeof value === "object" && !Object.isFrozen(value)) {
220
+ Object.freeze(value);
221
+ for (const key of Object.keys(value)) deepFreeze(value[key]);
222
+ }
223
+ return value;
224
+ }
215
225
  function failureMessage(finish) {
216
226
  if (finish.kind === "error" || finish.kind === "aborted") return finish.failure.message;
217
227
  if (finish.kind === "max-tokens") return "verifier response reached max tokens before completing its answer";
@@ -385,4 +395,4 @@ function emptyUsage() {
385
395
  //#endregion
386
396
  export { emptyUsage as a, resolveCapabilityFile as c, callVerifierText as i, addUsage as n, predictScoringChannel as o, callVerifier as r, TopLogprobCapabilityCache as s, RequestLimiter as t };
387
397
 
388
- //# sourceMappingURL=caller-DKaP3JOL.js.map
398
+ //# sourceMappingURL=caller-BWwSVNZf.js.map
package/lib/caller.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as emptyUsage, i as callVerifierText, n as addUsage, o as predictScoringChannel, r as callVerifier, t as RequestLimiter } from "./caller-DKaP3JOL.js";
1
+ import { a as emptyUsage, i as callVerifierText, n as addUsage, o as predictScoringChannel, r as callVerifier, t as RequestLimiter } from "./caller-BWwSVNZf.js";
2
2
  export { RequestLimiter, addUsage, callVerifier, callVerifierText, emptyUsage, predictScoringChannel };
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as emptyUsage, c as resolveCapabilityFile, i as callVerifierText, n as addUsage, o as predictScoringChannel, r as callVerifier, s as TopLogprobCapabilityCache, t as RequestLimiter } from "./caller-DKaP3JOL.js";
1
+ import { a as emptyUsage, c as resolveCapabilityFile, i as callVerifierText, n as addUsage, o as predictScoringChannel, r as callVerifier, s as TopLogprobCapabilityCache, t as RequestLimiter } from "./caller-BWwSVNZf.js";
2
2
  import { DEFAULT_CRITERIA, DEFAULT_GROUND_TRUTH_NOTE, GRANULARITY, LETTERS, SCALE_DESCRIPTION, accumulatePairs, bradleyTerry, buildPairwisePrompt, buildProgressPrompt, extractProgressScore, extractScore, normalizeScoreLetter, pivotRoundPairs, rankScores, ringCycle, seededRandom, topPivots } from "./core.js";
3
3
  import { defineTool } from "@deepseek-ai/dsh-tools";
4
4
  import { createUserMessage } from "@deepseek-ai/dsh-llm";
@@ -1,4 +1,18 @@
1
- import { BlockAssembler, ReasoningEffortId, createUserMessage, deepFreeze } from '@deepseek-ai/dsh-llm';
1
+ import { BlockAssembler, ReasoningEffortId, createUserMessage } from '@deepseek-ai/dsh-llm';
2
+ import * as LlmModule from '@deepseek-ai/dsh-llm';
3
+ function deepFreeze(value) {
4
+ const mod = LlmModule;
5
+ if (typeof mod.deepFreeze === 'function') {
6
+ return mod.deepFreeze(value);
7
+ }
8
+ if (value && typeof value === 'object' && !Object.isFrozen(value)) {
9
+ Object.freeze(value);
10
+ for (const key of Object.keys(value)) {
11
+ deepFreeze(value[key]);
12
+ }
13
+ }
14
+ return value;
15
+ }
2
16
  import { TopLogprobCapabilityCache, TopLogprobsUnsupportedError, callTopLogprobs, resolveTopLogprobRoute } from "./top-logprobs.js";
3
17
  function failureMessage(finish) {
4
18
  if (finish.kind === 'error' || finish.kind === 'aborted')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-llm-verifier",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Configurable DSH-native LLM verifier with a Web settings page",
5
5
  "repository": {
6
6
  "type": "git",
package/src/caller.ts CHANGED
@@ -1,4 +1,19 @@
1
- import { BlockAssembler, ReasoningEffortId, createUserMessage, deepFreeze, type ContentBlock, type FinishReason, type LlmRuntime } from '@deepseek-ai/dsh-llm'
1
+ import { BlockAssembler, ReasoningEffortId, createUserMessage, type ContentBlock, type FinishReason, type LlmRuntime } from '@deepseek-ai/dsh-llm'
2
+ import * as LlmModule from '@deepseek-ai/dsh-llm'
3
+
4
+ function deepFreeze<T>(value: T): T {
5
+ const mod = LlmModule as unknown as Record<string, unknown>
6
+ if (typeof mod.deepFreeze === 'function') {
7
+ return (mod.deepFreeze as Function)(value)
8
+ }
9
+ if (value && typeof value === 'object' && !Object.isFrozen(value)) {
10
+ Object.freeze(value)
11
+ for (const key of Object.keys(value)) {
12
+ deepFreeze((value as Record<string, unknown>)[key])
13
+ }
14
+ }
15
+ return value
16
+ }
2
17
  import type { AttachmentStore } from '@deepseek-ai/dsh-attachment'
3
18
  import type { CompletionLogprobs } from './core.ts'
4
19
  import { TopLogprobCapabilityCache, TopLogprobsUnsupportedError, callTopLogprobs, resolveTopLogprobRoute } from './top-logprobs.ts'