@anvia/jev 1.0.0 → 1.1.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ModelId, ModelList, ModelListingClient } from "@anvia/core/model-listing";
2
- import { TypeSafeClient } from "@typesafe-ai/sdk";
2
+ import { Compression, Fetch, TypeSafeClient } from "@typesafe-ai/sdk";
3
3
  import { DecisionModel } from "@anvia/core/decision";
4
4
  export declare const JEV_LATEST = "jev-latest";
5
5
  export declare const JEV_PREVIEW = "jev-preview";
@@ -8,13 +8,19 @@ type JevDecisionModelId = ModelId<KnownJevDecisionModelId>;
8
8
  type JevClientOptions = {
9
9
  apiKey?: string | undefined;
10
10
  baseUrl?: string | undefined;
11
+ decisionEndpoint?: string | undefined;
11
12
  headers?: Record<string, string> | undefined;
13
+ compression?: Compression | undefined;
14
+ fetch?: Fetch | undefined;
12
15
  client?: never;
13
16
  } | {
14
17
  client: TypeSafeClient;
15
18
  apiKey?: never;
16
19
  baseUrl?: never;
20
+ decisionEndpoint?: never;
17
21
  headers?: never;
22
+ compression?: never;
23
+ fetch?: never;
18
24
  };
19
25
  type JevDecisionModelOptions = {
20
26
  modelId: JevDecisionModelId;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/jev/models.ts","../src/jev/client.ts","../src/jev/index.ts"],"mappings":";;;qBAEa;qBACA;KACD,iCAAiC,oBAAoB;KACrD,qBAAqB,QAAQ;KCM7B;EAEN;EACA;EACA,UAAU;EACV;;EAGA,QAAQ;EACR;EACA;EACA;;KAGM;EAA4B,SAAS;;KACrC,yBAAyB;qBAExB,qBAAqB;mBACf;EAEL,YAAA,SAAS;EAiCrB,cAAc,SAAS,0BAA0B;EAQ3C,WAAW;IAAY,cAAc;MAA4B,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/jev/models.ts","../src/jev/client.ts","../src/jev/index.ts"],"mappings":";;;qBAEa;qBACA;KACD,iCAAiC,oBAAoB;KACrD,qBAAqB,QAAQ;KCM7B;EAEN;EACA;EACA;EACA,UAAU;EACV,cAAc;EACd,QAAQ;EACR;;EAGA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;;KAGM;EAA4B,SAAS;;KACrC,yBAAyB;qBA2BxB,qBAAqB;mBACf;EAEL,YAAA,SAAS;EA4ErB,cAAc,SAAS,0BAA0B;EAQ3C,WAAW;IAAY,cAAc;MAA4B,QAAQ"}
package/dist/index.js CHANGED
@@ -219,6 +219,22 @@ var JevDecisionModel = class {
219
219
  }
220
220
  };
221
221
  // src/jev/client.ts
222
+ function parseDecisionEndpoint(endpoint) {
223
+ if (typeof endpoint !== "string") throw new TypeError("JevClient decisionEndpoint must be a valid http(s) URL.");
224
+ const trimmed = endpoint.trim();
225
+ if (trimmed.length === 0) throw new TypeError("JevClient decisionEndpoint must be a valid http(s) URL.");
226
+ let parsed;
227
+ try {
228
+ parsed = new URL(trimmed);
229
+ } catch {
230
+ throw new TypeError("JevClient decisionEndpoint must be a valid http(s) URL.");
231
+ }
232
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new TypeError("JevClient decisionEndpoint must be a valid http(s) URL.");
233
+ return {
234
+ url: trimmed,
235
+ origin: parsed.origin
236
+ };
237
+ }
222
238
  var JevClient = class {
223
239
  sdk;
224
240
  constructor(options) {
@@ -226,7 +242,10 @@ var JevClient = class {
226
242
  if ([
227
243
  "apiKey",
228
244
  "baseUrl",
229
- "headers"
245
+ "decisionEndpoint",
246
+ "headers",
247
+ "compression",
248
+ "fetch"
230
249
  ].some((key) => key in options)) throw new TypeError("JevClient cannot combine an injected client with managed options.");
231
250
  this.sdk = options.client;
232
251
  return;
@@ -240,7 +259,20 @@ var JevClient = class {
240
259
  };
241
260
  if (options.baseUrl !== void 0) clientOptions.baseURL = options.baseUrl;
242
261
  if (options.headers !== void 0) clientOptions.defaultHeaders = options.headers;
262
+ if (options.compression !== void 0) clientOptions.compression = options.compression;
263
+ let expectedSystemOneUrl;
264
+ if (options.decisionEndpoint !== void 0) {
265
+ const decisionEndpoint = parseDecisionEndpoint(options.decisionEndpoint);
266
+ if (options.baseUrl === void 0) clientOptions.baseURL = decisionEndpoint.origin;
267
+ if (options.fetch === void 0 && typeof globalThis.fetch !== "function") throw new TypeError("JevClient requires a fetch implementation.");
268
+ const baseFetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
269
+ clientOptions.fetch = (input, init) => {
270
+ if ((init?.method ?? "GET").toUpperCase() === "POST" && expectedSystemOneUrl !== void 0 && input === expectedSystemOneUrl) return baseFetch(decisionEndpoint.url, init);
271
+ return baseFetch(input, init);
272
+ };
273
+ } else if (options.fetch !== void 0) clientOptions.fetch = options.fetch;
243
274
  this.sdk = new TypeSafeClient(clientOptions);
275
+ if (options.decisionEndpoint !== void 0) expectedSystemOneUrl = `${this.sdk.baseURL}/v1/systemone`;
244
276
  }
245
277
  decisionModel(options) {
246
278
  if (typeof options.modelId !== "string" || options.modelId.trim().length === 0) throw new TypeError("Jev modelId must be a non-empty string.");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isDataObject","isProbability","isTokenCount"],"sources":["../src/jev/decision-request.ts","../src/jev/decision-response.ts","../src/jev/errors.ts","../src/jev/decision.ts","../src/jev/client.ts","../src/jev/models.ts","../src/jev/index.ts"],"sourcesContent":["import type { DecisionQuestion, DecisionQuestions, JsonValue } from \"@anvia/core/decision\";\nimport type { EntryType, JsonValue as SdkJsonValue, Question } from \"@typesafe-ai/sdk\";\n\nexport type CompiledJevQuestion = {\n name: string;\n question: DecisionQuestion;\n keys: string[];\n};\n\nexport function compileJevQuestions(questions: DecisionQuestions): {\n compiled: CompiledJevQuestion[];\n wireQuestions: [string, Question][];\n} {\n const compiled: CompiledJevQuestion[] = [];\n const wireQuestions: [string, Question][] = [];\n for (const [index, [name, question]] of Object.entries(questions).entries()) {\n const key = `q${index}`;\n\n if (question.type === \"multi-label\") {\n const keys = Object.entries(question.options).map(([label, description], labelIndex) => {\n const labelKey = `${key}_${labelIndex}`;\n wireQuestions.push([\n labelKey,\n {\n type: \"noul\",\n instructions: {\n instructions: question.instructions,\n label,\n task: \"Does this label apply to the state? Evaluate it independently of other labels.\",\n },\n criteria: { true: toEntry(description) },\n },\n ]);\n return labelKey;\n });\n compiled.push({ name, question, keys });\n } else {\n const native = nativeQuestion(question);\n wireQuestions.push([key, native]);\n compiled.push({ name, question, keys: [key] });\n }\n }\n return { compiled, wireQuestions };\n}\n\n/** The SDK accepts text, objects, arrays, and null; preserve scalar JSON inside an object. */\nexport function toEntry(value: JsonValue): EntryType {\n const normalized = sdkJson(value);\n return typeof normalized === \"number\" || typeof normalized === \"boolean\"\n ? { value: normalized }\n : normalized;\n}\n\nfunction nativeQuestion(question: Exclude<DecisionQuestion, { type: \"multi-label\" }>): Question {\n switch (question.type) {\n case \"choice\":\n return {\n type: \"choice\",\n instructions: question.instructions,\n criteria: Object.fromEntries(\n Object.entries(question.options).map(([label, description]) => [\n label,\n toEntry(description),\n ]),\n ),\n };\n case \"score\":\n return {\n type: \"score\",\n instructions: question.instructions,\n criteria: question.rubric.map(toEntry) as [EntryType, EntryType, ...EntryType[]],\n };\n case \"check\":\n return { type: \"noul\", instructions: question.instructions };\n }\n}\n\nfunction sdkJson(value: JsonValue): SdkJsonValue {\n if (Array.isArray(value)) return value.map(sdkJson);\n\n if (value !== null && typeof value === \"object\") {\n return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, sdkJson(entry)]));\n }\n\n return value as string | number | boolean | null;\n}\n","import { Usage } from \"@anvia/core/completion\";\nimport {\n type DecisionAnswers,\n DecisionProviderOutputError,\n type DecisionQuestions,\n type DecisionResult,\n type JsonValue,\n} from \"@anvia/core/decision\";\nimport {\n isDecisionDataObject as isDataObject,\n isDecisionProbability as isProbability,\n isDecisionTokenCount as isTokenCount,\n probabilitiesSumToOne,\n} from \"@anvia/core/internal/provider\";\nimport { type CompiledJevQuestion, toEntry } from \"./decision-request\";\n\nexport function mapJevDecisionResponse<Questions extends DecisionQuestions>(\n rawResponse: unknown,\n compiled: CompiledJevQuestion[],\n expectedKeys: readonly string[],\n modelId: string,\n): DecisionResult<Questions, unknown> {\n const fail = (message: string, questionName?: string): never => {\n throw new DecisionProviderOutputError(message, {\n provider: \"jev\",\n modelId,\n questionName,\n });\n };\n\n if (!isDataObject(rawResponse) || !isDataObject(rawResponse.answers)) {\n return fail(\"Jev returned an invalid answer envelope.\");\n }\n\n const rawAnswers = rawResponse.answers;\n\n if (\n Object.keys(rawAnswers).length !== expectedKeys.length ||\n expectedKeys.some((key) => !Object.hasOwn(rawAnswers, key))\n ) {\n return fail(\"Jev answers do not match the requested questions.\");\n }\n\n const answers = Object.fromEntries(\n compiled.map(({ name, question, keys }) => {\n const getAnswer = (key: string | undefined): Record<string, JsonValue> => {\n const answer = key === undefined ? undefined : rawAnswers[key];\n\n if (!isDataObject(answer)) return fail(\"Jev returned an invalid answer.\", name);\n\n return answer;\n };\n\n if (question.type === \"multi-label\") {\n const labels = Object.keys(question.options);\n const probabilities = Object.fromEntries(\n labels.map((label, index) => {\n const answer = getAnswer(keys[index]);\n\n if (answer.type !== \"noul\" || !isProbability(answer.noul)) {\n return fail(\"Jev returned an invalid label probability.\", name);\n }\n\n return [label, answer.noul];\n }),\n );\n return [\n name,\n {\n type: \"multi-label\",\n labels: labels.filter((label) => probabilities[label]! >= (question.threshold ?? 0.5)),\n probabilities,\n },\n ];\n }\n\n const answer = getAnswer(keys[0]);\n\n if (question.type === \"check\") {\n if (answer.type !== \"noul\" || !isProbability(answer.noul)) {\n return fail(\"Jev returned an invalid boolean probability.\", name);\n }\n\n return [name, { type: \"check\", probability: answer.noul }];\n }\n\n if (\n answer.type !== question.type ||\n !isProbability(answer.confidence) ||\n !isDataObject(answer.probabilities)\n ) {\n return fail(\"Jev returned an invalid choice or score answer.\", name);\n }\n\n if (question.type === \"choice\") {\n if (typeof answer.choice !== \"string\" || !Object.hasOwn(question.options, answer.choice)) {\n return fail(\"Jev selected an unknown option.\", name);\n }\n\n validateDistribution(answer.probabilities, Object.keys(question.options), () =>\n fail(\"Jev returned invalid choice probabilities.\", name),\n );\n return [\n name,\n {\n type: \"choice\",\n choice: answer.choice,\n probabilities: answer.probabilities,\n confidence: answer.confidence,\n },\n ];\n }\n\n const levelKeys = question.rubric.map((_, index) => String(index));\n const expectedLegend = Object.fromEntries(\n question.rubric.map((level, index) => [String(index), toEntry(level)]),\n ) as Record<string, JsonValue>;\n\n if (!isDataObject(answer.legend) || !jsonEqual(answer.legend, expectedLegend)) {\n return fail(\"Jev returned a legend that does not match the requested rubric.\", name);\n }\n\n const scoreProbabilities = answer.probabilities;\n validateDistribution(scoreProbabilities, levelKeys, () =>\n fail(\"Jev returned invalid score probabilities.\", name),\n );\n\n if (\n typeof answer.score !== \"number\" ||\n !Number.isFinite(answer.score) ||\n answer.score < 0 ||\n answer.score > question.rubric.length - 1\n ) {\n return fail(\"Jev returned a score outside the requested rubric.\", name);\n }\n\n return [\n name,\n {\n type: \"score\",\n score: answer.score,\n rubric: question.rubric,\n probabilities: levelKeys.map((key) => scoreProbabilities[key]),\n confidence: answer.confidence,\n },\n ];\n }),\n ) as DecisionAnswers<Questions>;\n\n const usage = rawResponse.usage;\n\n if (\n !isDataObject(usage) ||\n !isTokenCount(usage.input_tokens) ||\n !isTokenCount(usage.output_tokens)\n ) {\n return fail(\"Jev returned invalid token usage.\");\n }\n\n return {\n answers,\n usage: {\n ...Usage.empty(),\n inputTokens: usage.input_tokens,\n outputTokens: usage.output_tokens,\n totalTokens: usage.input_tokens + usage.output_tokens,\n },\n rawResponse,\n };\n}\n\n/** Compare validated JSON without depending on object property order. */\nfunction jsonEqual(left: JsonValue, right: JsonValue): boolean {\n if (left === right) return true;\n\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => jsonEqual(value, right[index]!))\n );\n }\n\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\")\n return false;\n\n const leftObject = left as Record<string, JsonValue>;\n const rightObject = right as Record<string, JsonValue>;\n const keys = Object.keys(leftObject);\n return (\n Object.keys(rightObject).length === keys.length &&\n keys.every(\n (key) => Object.hasOwn(rightObject, key) && jsonEqual(leftObject[key]!, rightObject[key]!),\n )\n );\n}\n\nfunction validateDistribution(\n value: Record<string, JsonValue>,\n keys: string[],\n fail: () => never,\n): void {\n const values = Object.values(value);\n\n if (\n values.length !== keys.length ||\n keys.some((key) => !Object.hasOwn(value, key)) ||\n !values.every(isProbability) ||\n !probabilitiesSumToOne(values)\n ) {\n fail();\n }\n}\n","import { APITimeoutError } from \"@typesafe-ai/sdk\";\n\n/** Distinguish SDK timeout cancellation from cancellation requested by the caller. */\nexport function normalizeJevError(error: unknown, abortSignal?: AbortSignal): unknown {\n if (abortSignal?.aborted) {\n const aborted = new Error(\"The Jev request was aborted.\", { cause: error });\n aborted.name = \"AbortError\";\n return aborted;\n }\n\n if (error instanceof APITimeoutError) {\n return Object.assign(new Error(error.message), { name: \"TimeoutError\", providerError: error });\n }\n\n return error;\n}\n","import type {\n DecisionCapabilities,\n DecisionModel,\n DecisionQuestions,\n DecisionRequest,\n DecisionResult,\n ModelCallOptions,\n} from \"@anvia/core/decision\";\nimport type { TypeSafeClient } from \"@typesafe-ai/sdk\";\nimport { compileJevQuestions, toEntry } from \"./decision-request\";\nimport { mapJevDecisionResponse } from \"./decision-response\";\nimport { normalizeJevError } from \"./errors\";\nimport type { JevDecisionModelId } from \"./models\";\n\nexport class JevDecisionModel implements DecisionModel<unknown> {\n readonly provider = \"jev\";\n readonly capabilities: DecisionCapabilities = Object.freeze({\n questionSupport: Object.freeze({\n choice: \"native\",\n \"multi-label\": \"composed\",\n score: \"native\",\n check: \"native\",\n }),\n mixedQuestions: true,\n limits: Object.freeze({ maxChoiceOptions: 255, maxRubricLevels: 10 }),\n });\n\n constructor(\n private readonly sdk: TypeSafeClient,\n readonly modelId: JevDecisionModelId,\n ) {}\n\n async decision<const Questions extends DecisionQuestions>(\n request: DecisionRequest<Questions>,\n options?: ModelCallOptions,\n ): Promise<DecisionResult<Questions, unknown>> {\n const { compiled, wireQuestions } = compileJevQuestions(request.questions);\n\n let rawResponse: unknown;\n try {\n const body = {\n ...request.providerOptions,\n state: toEntry(request.state) ?? { value: null },\n model: this.modelId,\n questions: Object.fromEntries(wireQuestions),\n };\n const requestOptions: NonNullable<Parameters<TypeSafeClient[\"systemOne\"]>[1]> = {\n retry: { maxRetries: 0 },\n };\n\n if (options?.abortSignal !== undefined) {\n requestOptions.signal = options.abortSignal;\n }\n\n rawResponse = await this.sdk.systemOne(body, requestOptions);\n } catch (error) {\n throw normalizeJevError(error, options?.abortSignal);\n }\n\n return mapJevDecisionResponse<Questions>(\n rawResponse,\n compiled,\n wireQuestions.map(([key]) => key),\n this.modelId,\n );\n }\n}\n","import type { DecisionModel } from \"@anvia/core/decision\";\nimport {\n ModelListingError,\n type ModelList,\n type ModelListingClient,\n} from \"@anvia/core/model-listing\";\nimport { TypeSafeClient } from \"@typesafe-ai/sdk\";\nimport { JevDecisionModel } from \"./decision\";\nimport type { JevDecisionModelId } from \"./models\";\nimport { normalizeJevError } from \"./errors\";\n\nexport type JevClientOptions =\n | {\n apiKey?: string | undefined;\n baseUrl?: string | undefined;\n headers?: Record<string, string> | undefined;\n client?: never;\n }\n | {\n client: TypeSafeClient;\n apiKey?: never;\n baseUrl?: never;\n headers?: never;\n };\n\nexport type JevDecisionModelOptions = { modelId: JevDecisionModelId };\nexport type JevDecisionModelHandle = DecisionModel<unknown>;\n\nexport class JevClient implements ModelListingClient {\n private readonly sdk: TypeSafeClient;\n\n constructor(options: JevClientOptions) {\n if (options.client !== undefined) {\n if ([\"apiKey\", \"baseUrl\", \"headers\"].some((key) => key in options)) {\n throw new TypeError(\"JevClient cannot combine an injected client with managed options.\");\n }\n\n this.sdk = options.client;\n return;\n }\n\n const apiKey = options.apiKey ?? process.env.TYPESAFE_API_KEY;\n\n if (typeof apiKey !== \"string\" || apiKey.trim().length === 0) {\n throw new TypeError(\"JevClient requires apiKey or TYPESAFE_API_KEY.\");\n }\n\n const clientOptions: ConstructorParameters<typeof TypeSafeClient>[0] = {\n apiKey,\n retry: { maxRetries: 0 },\n logLevel: \"off\",\n };\n\n if (options.baseUrl !== undefined) {\n clientOptions.baseURL = options.baseUrl;\n }\n\n if (options.headers !== undefined) {\n clientOptions.defaultHeaders = options.headers;\n }\n\n this.sdk = new TypeSafeClient(clientOptions);\n }\n\n decisionModel(options: JevDecisionModelOptions): JevDecisionModelHandle {\n if (typeof options.modelId !== \"string\" || options.modelId.trim().length === 0) {\n throw new TypeError(\"Jev modelId must be a non-empty string.\");\n }\n\n return new JevDecisionModel(this.sdk, options.modelId);\n }\n\n async listModels(options?: { abortSignal?: AbortSignal | undefined }): Promise<ModelList> {\n try {\n const requestOptions: NonNullable<Parameters<TypeSafeClient[\"models\"][\"list\"]>[0]> = {\n retry: { maxRetries: 0 },\n };\n\n if (options?.abortSignal !== undefined) {\n requestOptions.signal = options.abortSignal;\n }\n\n const models = await this.sdk.models.list(requestOptions);\n\n if (\n !Array.isArray(models) ||\n models.some(\n (model) =>\n typeof model?.name !== \"string\" ||\n typeof model.description !== \"string\" ||\n typeof model.release_date !== \"string\",\n )\n ) {\n throw new TypeError(\"Jev returned invalid model metadata.\");\n }\n\n return {\n data: models.map((model) => ({\n id: model.name,\n name: model.name,\n description: model.description,\n type: \"decision\",\n })),\n };\n } catch (error) {\n const normalized = normalizeJevError(error, options?.abortSignal);\n\n if (options?.abortSignal?.aborted) {\n throw normalized;\n }\n\n throw new ModelListingError(\"Failed to list Jev models.\", {\n provider: \"jev\",\n cause: normalized,\n });\n }\n }\n}\n","import type { ModelId } from \"@anvia/core/model-listing\";\n\nexport const JEV_LATEST = \"jev-latest\";\nexport const JEV_PREVIEW = \"jev-preview\";\nexport type KnownJevDecisionModelId = typeof JEV_LATEST | typeof JEV_PREVIEW;\nexport type JevDecisionModelId = ModelId<KnownJevDecisionModelId>;\n","export {\n JevClient,\n type JevClientOptions,\n type JevDecisionModelOptions,\n type JevDecisionModelHandle,\n} from \"./client\";\nexport {\n JEV_LATEST,\n JEV_PREVIEW,\n type KnownJevDecisionModelId,\n type JevDecisionModelId,\n} from \"./models\";\n"],"mappings":";;;;;;;AASA,SAAgB,oBAAoB,WAGlC;CACA,MAAM,WAAkC,CAAC;CACzC,MAAM,gBAAsC,CAAC;CAC7C,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,OAAO,QAAQ,SAAS,CAAC,CAAC,QAAQ,GAAG;EAC3E,MAAM,MAAM,IAAI;EAEhB,IAAI,SAAS,SAAS,eAAe;GACnC,MAAM,OAAO,OAAO,QAAQ,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,eAAe;IACtF,MAAM,WAAW,GAAG,IAAI,GAAG;IAC3B,cAAc,KAAK,CACjB,UACA;KACE,MAAM;KACN,cAAc;MACZ,cAAc,SAAS;MACvB;MACA,MAAM;KACR;KACA,UAAU,EAAE,MAAM,QAAQ,WAAW,EAAE;IACzC,CACF,CAAC;IACD,OAAO;GACT,CAAC;GACD,SAAS,KAAK;IAAE;IAAM;IAAU;GAAK,CAAC;EACxC,OAAO;GACL,MAAM,SAAS,eAAe,QAAQ;GACtC,cAAc,KAAK,CAAC,KAAK,MAAM,CAAC;GAChC,SAAS,KAAK;IAAE;IAAM;IAAU,MAAM,CAAC,GAAG;GAAE,CAAC;EAC/C;CACF;CACA,OAAO;EAAE;EAAU;CAAc;AACnC;;AAGA,SAAgB,QAAQ,OAA6B;CACnD,MAAM,aAAa,QAAQ,KAAK;CAChC,OAAO,OAAO,eAAe,YAAY,OAAO,eAAe,YAC3D,EAAE,OAAO,WAAW,IACpB;AACN;AAEA,SAAS,eAAe,UAAwE;CAC9F,QAAQ,SAAS,MAAjB;EACE,KAAK,UACH,OAAO;GACL,MAA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AY,EAAE,EACzB;GAEA,IAAI,SAAS,gBAAgB,KAAA,GAC3B,eAAe,SAAS,QAAQ;GAGlC,MAAM,SAAS,MAAM,KAAK,IAAI,OAAO,KAAK,cAAc;GAExD,IACE,CAAC,MAAM,QAAQ,MAAM,KACrB,OAAO,MACJ,UACC,OAAO,OAAO,SAAS,YACvB,OAAO,MAAM,gBAAgB,YAC7B,OAAO,MAAM,iBAAiB,QAClC,GAEA,MAAM,IAAI,UAAU,sCAAsC;GAG5D,OAAO,EACL,MAAM,OAAO,KAAK,WAAW;IAC3B,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,MAAM;GACR,EAAE,EACJ;EACF,SAAS,OAAO;GACd,MAAM,aAAa,kBAAkB,OAAO,SAAS,WAAW;GAEhE,IAAI,SAAS,aAAa,SACxB,MAAM;GAGR,MAAM,IAAI,kBAAkB,8BAA8B;IACxD,UAAU;IACV,OAAO;GACT,CAAC;EACH;CACF;AACF;;ACnHA,MAAa,aAAa;AAC1B,MAAa,cAAc"}
1
+ {"version":3,"file":"index.js","names":["isDataObject","isProbability","isTokenCount"],"sources":["../src/jev/decision-request.ts","../src/jev/decision-response.ts","../src/jev/errors.ts","../src/jev/decision.ts","../src/jev/client.ts","../src/jev/models.ts","../src/jev/index.ts"],"sourcesContent":["import type { DecisionQuestion, DecisionQuestions, JsonValue } from \"@anvia/core/decision\";\nimport type { EntryType, JsonValue as SdkJsonValue, Question } from \"@typesafe-ai/sdk\";\n\nexport type CompiledJevQuestion = {\n name: string;\n question: DecisionQuestion;\n keys: string[];\n};\n\nexport function compileJevQuestions(questions: DecisionQuestions): {\n compiled: CompiledJevQuestion[];\n wireQuestions: [string, Question][];\n} {\n const compiled: CompiledJevQuestion[] = [];\n const wireQuestions: [string, Question][] = [];\n for (const [index, [name, question]] of Object.entries(questions).entries()) {\n const key = `q${index}`;\n\n if (question.type === \"multi-label\") {\n const keys = Object.entries(question.options).map(([label, description], labelIndex) => {\n const labelKey = `${key}_${labelIndex}`;\n wireQuestions.push([\n labelKey,\n {\n type: \"noul\",\n instructions: {\n instructions: question.instructions,\n label,\n task: \"Does this label apply to the state? Evaluate it independently of other labels.\",\n },\n criteria: { true: toEntry(description) },\n },\n ]);\n return labelKey;\n });\n compiled.push({ name, question, keys });\n } else {\n const native = nativeQuestion(question);\n wireQuestions.push([key, native]);\n compiled.push({ name, question, keys: [key] });\n }\n }\n return { compiled, wireQuestions };\n}\n\n/** The SDK accepts text, objects, arrays, and null; preserve scalar JSON inside an object. */\nexport function toEntry(value: JsonValue): EntryType {\n const normalized = sdkJson(value);\n return typeof normalized === \"number\" || typeof normalized === \"boolean\"\n ? { value: normalized }\n : normalized;\n}\n\nfunction nativeQuestion(question: Exclude<DecisionQuestion, { type: \"multi-label\" }>): Question {\n switch (question.type) {\n case \"choice\":\n return {\n type: \"choice\",\n instructions: question.instructions,\n criteria: Object.fromEntries(\n Object.entries(question.options).map(([label, description]) => [\n label,\n toEntry(description),\n ]),\n ),\n };\n case \"score\":\n return {\n type: \"score\",\n instructions: question.instructions,\n criteria: question.rubric.map(toEntry) as [EntryType, EntryType, ...EntryType[]],\n };\n case \"check\":\n return { type: \"noul\", instructions: question.instructions };\n }\n}\n\nfunction sdkJson(value: JsonValue): SdkJsonValue {\n if (Array.isArray(value)) return value.map(sdkJson);\n\n if (value !== null && typeof value === \"object\") {\n return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, sdkJson(entry)]));\n }\n\n return value as string | number | boolean | null;\n}\n","import { Usage } from \"@anvia/core/completion\";\nimport {\n type DecisionAnswers,\n DecisionProviderOutputError,\n type DecisionQuestions,\n type DecisionResult,\n type JsonValue,\n} from \"@anvia/core/decision\";\nimport {\n isDecisionDataObject as isDataObject,\n isDecisionProbability as isProbability,\n isDecisionTokenCount as isTokenCount,\n probabilitiesSumToOne,\n} from \"@anvia/core/internal/provider\";\nimport { type CompiledJevQuestion, toEntry } from \"./decision-request\";\n\nexport function mapJevDecisionResponse<Questions extends DecisionQuestions>(\n rawResponse: unknown,\n compiled: CompiledJevQuestion[],\n expectedKeys: readonly string[],\n modelId: string,\n): DecisionResult<Questions, unknown> {\n const fail = (message: string, questionName?: string): never => {\n throw new DecisionProviderOutputError(message, {\n provider: \"jev\",\n modelId,\n questionName,\n });\n };\n\n if (!isDataObject(rawResponse) || !isDataObject(rawResponse.answers)) {\n return fail(\"Jev returned an invalid answer envelope.\");\n }\n\n const rawAnswers = rawResponse.answers;\n\n if (\n Object.keys(rawAnswers).length !== expectedKeys.length ||\n expectedKeys.some((key) => !Object.hasOwn(rawAnswers, key))\n ) {\n return fail(\"Jev answers do not match the requested questions.\");\n }\n\n const answers = Object.fromEntries(\n compiled.map(({ name, question, keys }) => {\n const getAnswer = (key: string | undefined): Record<string, JsonValue> => {\n const answer = key === undefined ? undefined : rawAnswers[key];\n\n if (!isDataObject(answer)) return fail(\"Jev returned an invalid answer.\", name);\n\n return answer;\n };\n\n if (question.type === \"multi-label\") {\n const labels = Object.keys(question.options);\n const probabilities = Object.fromEntries(\n labels.map((label, index) => {\n const answer = getAnswer(keys[index]);\n\n if (answer.type !== \"noul\" || !isProbability(answer.noul)) {\n return fail(\"Jev returned an invalid label probability.\", name);\n }\n\n return [label, answer.noul];\n }),\n );\n return [\n name,\n {\n type: \"multi-label\",\n labels: labels.filter((label) => probabilities[label]! >= (question.threshold ?? 0.5)),\n probabilities,\n },\n ];\n }\n\n const answer = getAnswer(keys[0]);\n\n if (question.type === \"check\") {\n if (answer.type !== \"noul\" || !isProbability(answer.noul)) {\n return fail(\"Jev returned an invalid boolean probability.\", name);\n }\n\n return [name, { type: \"check\", probability: answer.noul }];\n }\n\n if (\n answer.type !== question.type ||\n !isProbability(answer.confidence) ||\n !isDataObject(answer.probabilities)\n ) {\n return fail(\"Jev returned an invalid choice or score answer.\", name);\n }\n\n if (question.type === \"choice\") {\n if (typeof answer.choice !== \"string\" || !Object.hasOwn(question.options, answer.choice)) {\n return fail(\"Jev selected an unknown option.\", name);\n }\n\n validateDistribution(answer.probabilities, Object.keys(question.options), () =>\n fail(\"Jev returned invalid choice probabilities.\", name),\n );\n return [\n name,\n {\n type: \"choice\",\n choice: answer.choice,\n probabilities: answer.probabilities,\n confidence: answer.confidence,\n },\n ];\n }\n\n const levelKeys = question.rubric.map((_, index) => String(index));\n const expectedLegend = Object.fromEntries(\n question.rubric.map((level, index) => [String(index), toEntry(level)]),\n ) as Record<string, JsonValue>;\n\n if (!isDataObject(answer.legend) || !jsonEqual(answer.legend, expectedLegend)) {\n return fail(\"Jev returned a legend that does not match the requested rubric.\", name);\n }\n\n const scoreProbabilities = answer.probabilities;\n validateDistribution(scoreProbabilities, levelKeys, () =>\n fail(\"Jev returned invalid score probabilities.\", name),\n );\n\n if (\n typeof answer.score !== \"number\" ||\n !Number.isFinite(answer.score) ||\n answer.score < 0 ||\n answer.score > question.rubric.length - 1\n ) {\n return fail(\"Jev returned a score outside the requested rubric.\", name);\n }\n\n return [\n name,\n {\n type: \"score\",\n score: answer.score,\n rubric: question.rubric,\n probabilities: levelKeys.map((key) => scoreProbabilities[key]),\n confidence: answer.confidence,\n },\n ];\n }),\n ) as DecisionAnswers<Questions>;\n\n const usage = rawResponse.usage;\n\n if (\n !isDataObject(usage) ||\n !isTokenCount(usage.input_tokens) ||\n !isTokenCount(usage.output_tokens)\n ) {\n return fail(\"Jev returned invalid token usage.\");\n }\n\n return {\n answers,\n usage: {\n ...Usage.empty(),\n inputTokens: usage.input_tokens,\n outputTokens: usage.output_tokens,\n totalTokens: usage.input_tokens + usage.output_tokens,\n },\n rawResponse,\n };\n}\n\n/** Compare validated JSON without depending on object property order. */\nfunction jsonEqual(left: JsonValue, right: JsonValue): boolean {\n if (left === right) return true;\n\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => jsonEqual(value, right[index]!))\n );\n }\n\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\")\n return false;\n\n const leftObject = left as Record<string, JsonValue>;\n const rightObject = right as Record<string, JsonValue>;\n const keys = Object.keys(leftObject);\n return (\n Object.keys(rightObject).length === keys.length &&\n keys.every(\n (key) => Object.hasOwn(rightObject, key) && jsonEqual(leftObject[key]!, rightObject[key]!),\n )\n );\n}\n\nfunction validateDistribution(\n value: Record<string, JsonValue>,\n keys: string[],\n fail: () => never,\n): void {\n const values = Object.values(value);\n\n if (\n values.length !== keys.length ||\n keys.some((key) => !Object.hasOwn(value, key)) ||\n !values.every(isProbability) ||\n !probabilitiesSumToOne(values)\n ) {\n fail();\n }\n}\n","import { APITimeoutError } from \"@typesafe-ai/sdk\";\n\n/** Distinguish SDK timeout cancellation from cancellation requested by the caller. */\nexport function normalizeJevError(error: unknown, abortSignal?: AbortSignal): unknown {\n if (abortSignal?.aborted) {\n const aborted = new Error(\"The Jev request was aborted.\", { cause: error });\n aborted.name = \"AbortError\";\n return aborted;\n }\n\n if (error instanceof APITimeoutError) {\n return Object.assign(new Error(error.message), { name: \"TimeoutError\", providerError: error });\n }\n\n return error;\n}\n","import type {\n DecisionCapabilities,\n DecisionModel,\n DecisionQuestions,\n DecisionRequest,\n DecisionResult,\n ModelCallOptions,\n} from \"@anvia/core/decision\";\nimport type { TypeSafeClient } from \"@typesafe-ai/sdk\";\nimport { compileJevQuestions, toEntry } from \"./decision-request\";\nimport { mapJevDecisionResponse } from \"./decision-response\";\nimport { normalizeJevError } from \"./errors\";\nimport type { JevDecisionModelId } from \"./models\";\n\nexport class JevDecisionModel implements DecisionModel<unknown> {\n readonly provider = \"jev\";\n readonly capabilities: DecisionCapabilities = Object.freeze({\n questionSupport: Object.freeze({\n choice: \"native\",\n \"multi-label\": \"composed\",\n score: \"native\",\n check: \"native\",\n }),\n mixedQuestions: true,\n limits: Object.freeze({ maxChoiceOptions: 255, maxRubricLevels: 10 }),\n });\n\n constructor(\n private readonly sdk: TypeSafeClient,\n readonly modelId: JevDecisionModelId,\n ) {}\n\n async decision<const Questions extends DecisionQuestions>(\n request: DecisionRequest<Questions>,\n options?: ModelCallOptions,\n ): Promise<DecisionResult<Questions, unknown>> {\n const { compiled, wireQuestions } = compileJevQuestions(request.questions);\n\n let rawResponse: unknown;\n try {\n const body = {\n ...request.providerOptions,\n state: toEntry(request.state) ?? { value: null },\n model: this.modelId,\n questions: Object.fromEntries(wireQuestions),\n };\n const requestOptions: NonNullable<Parameters<TypeSafeClient[\"systemOne\"]>[1]> = {\n retry: { maxRetries: 0 },\n };\n\n if (options?.abortSignal !== undefined) {\n requestOptions.signal = options.abortSignal;\n }\n\n rawResponse = await this.sdk.systemOne(body, requestOptions);\n } catch (error) {\n throw normalizeJevError(error, options?.abortSignal);\n }\n\n return mapJevDecisionResponse<Questions>(\n rawResponse,\n compiled,\n wireQuestions.map(([key]) => key),\n this.modelId,\n );\n }\n}\n","import type { DecisionModel } from \"@anvia/core/decision\";\nimport {\n ModelListingError,\n type ModelList,\n type ModelListingClient,\n} from \"@anvia/core/model-listing\";\nimport { type Compression, type Fetch, TypeSafeClient } from \"@typesafe-ai/sdk\";\nimport { JevDecisionModel } from \"./decision\";\nimport type { JevDecisionModelId } from \"./models\";\nimport { normalizeJevError } from \"./errors\";\n\nexport type JevClientOptions =\n | {\n apiKey?: string | undefined;\n baseUrl?: string | undefined;\n decisionEndpoint?: string | undefined;\n headers?: Record<string, string> | undefined;\n compression?: Compression | undefined;\n fetch?: Fetch | undefined;\n client?: never;\n }\n | {\n client: TypeSafeClient;\n apiKey?: never;\n baseUrl?: never;\n decisionEndpoint?: never;\n headers?: never;\n compression?: never;\n fetch?: never;\n };\n\nexport type JevDecisionModelOptions = { modelId: JevDecisionModelId };\nexport type JevDecisionModelHandle = DecisionModel<unknown>;\n\nfunction parseDecisionEndpoint(endpoint: string): { url: string; origin: string } {\n if (typeof endpoint !== \"string\") {\n throw new TypeError(\"JevClient decisionEndpoint must be a valid http(s) URL.\");\n }\n\n const trimmed = endpoint.trim();\n\n if (trimmed.length === 0) {\n throw new TypeError(\"JevClient decisionEndpoint must be a valid http(s) URL.\");\n }\n\n let parsed: URL;\n try {\n parsed = new URL(trimmed);\n } catch {\n throw new TypeError(\"JevClient decisionEndpoint must be a valid http(s) URL.\");\n }\n\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n throw new TypeError(\"JevClient decisionEndpoint must be a valid http(s) URL.\");\n }\n\n return { url: trimmed, origin: parsed.origin };\n}\n\nexport class JevClient implements ModelListingClient {\n private readonly sdk: TypeSafeClient;\n\n constructor(options: JevClientOptions) {\n if (options.client !== undefined) {\n if (\n [\"apiKey\", \"baseUrl\", \"decisionEndpoint\", \"headers\", \"compression\", \"fetch\"].some(\n (key) => key in options,\n )\n ) {\n throw new TypeError(\"JevClient cannot combine an injected client with managed options.\");\n }\n\n this.sdk = options.client;\n return;\n }\n\n const apiKey = options.apiKey ?? process.env.TYPESAFE_API_KEY;\n\n if (typeof apiKey !== \"string\" || apiKey.trim().length === 0) {\n throw new TypeError(\"JevClient requires apiKey or TYPESAFE_API_KEY.\");\n }\n\n const clientOptions: ConstructorParameters<typeof TypeSafeClient>[0] = {\n apiKey,\n retry: { maxRetries: 0 },\n logLevel: \"off\",\n };\n\n if (options.baseUrl !== undefined) {\n clientOptions.baseURL = options.baseUrl;\n }\n\n if (options.headers !== undefined) {\n clientOptions.defaultHeaders = options.headers;\n }\n\n if (options.compression !== undefined) {\n clientOptions.compression = options.compression;\n }\n\n let expectedSystemOneUrl: string | undefined;\n\n if (options.decisionEndpoint !== undefined) {\n const decisionEndpoint = parseDecisionEndpoint(options.decisionEndpoint);\n\n if (options.baseUrl === undefined) {\n clientOptions.baseURL = decisionEndpoint.origin;\n }\n\n if (options.fetch === undefined && typeof globalThis.fetch !== \"function\") {\n throw new TypeError(\"JevClient requires a fetch implementation.\");\n }\n\n const baseFetch: Fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));\n clientOptions.fetch = (input, init) => {\n const method = (init?.method ?? \"GET\").toUpperCase();\n\n if (\n method === \"POST\" &&\n expectedSystemOneUrl !== undefined &&\n input === expectedSystemOneUrl\n ) {\n return baseFetch(decisionEndpoint.url, init);\n }\n\n return baseFetch(input, init);\n };\n } else if (options.fetch !== undefined) {\n clientOptions.fetch = options.fetch;\n }\n\n this.sdk = new TypeSafeClient(clientOptions);\n\n if (options.decisionEndpoint !== undefined) {\n expectedSystemOneUrl = `${this.sdk.baseURL}/v1/systemone`;\n }\n }\n\n decisionModel(options: JevDecisionModelOptions): JevDecisionModelHandle {\n if (typeof options.modelId !== \"string\" || options.modelId.trim().length === 0) {\n throw new TypeError(\"Jev modelId must be a non-empty string.\");\n }\n\n return new JevDecisionModel(this.sdk, options.modelId);\n }\n\n async listModels(options?: { abortSignal?: AbortSignal | undefined }): Promise<ModelList> {\n try {\n const requestOptions: NonNullable<Parameters<TypeSafeClient[\"models\"][\"list\"]>[0]> = {\n retry: { maxRetries: 0 },\n };\n\n if (options?.abortSignal !== undefined) {\n requestOptions.signal = options.abortSignal;\n }\n\n const models = await this.sdk.models.list(requestOptions);\n\n if (\n !Array.isArray(models) ||\n models.some(\n (model) =>\n typeof model?.name !== \"string\" ||\n typeof model.description !== \"string\" ||\n typeof model.release_date !== \"string\",\n )\n ) {\n throw new TypeError(\"Jev returned invalid model metadata.\");\n }\n\n return {\n data: models.map((model) => ({\n id: model.name,\n name: model.name,\n description: model.description,\n type: \"decision\",\n })),\n };\n } catch (error) {\n const normalized = normalizeJevError(error, options?.abortSignal);\n\n if (options?.abortSignal?.aborted) {\n throw normalized;\n }\n\n throw new ModelListingError(\"Failed to list Jev models.\", {\n provider: \"jev\",\n cause: normalized,\n });\n }\n }\n}\n","import type { ModelId } from \"@anvia/core/model-listing\";\n\nexport const JEV_LATEST = \"jev-latest\";\nexport const JEV_PREVIEW = \"jev-preview\";\nexport type KnownJevDecisionModelId = typeof JEV_LATEST | typeof JEV_PREVIEW;\nexport type JevDecisionModelId = ModelId<KnownJevDecisionModelId>;\n","export {\n JevClient,\n type JevClientOptions,\n type JevDecisionModelOptions,\n type JevDecisionModelHandle,\n} from \"./client\";\nexport {\n JEV_LATEST,\n JEV_PREVIEW,\n type KnownJevDecisionModelId,\n type JevDecisionModelId,\n} from \"./models\";\n"],"mappings":";;;;;;;AASA,SAAgB,oBAAoB,WAGlC;CACA,MAAM,WAAkC,CAAC;CACzC,MAAM,gBAAsC,CAAC;CAC7C,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,OAAO,QAAQ,SAAS,CAAC,CAAC,QAAQ,GAAG;EAC3E,MAAM,MAAM,IAAI;EAEhB,IAAI,SAAS,SAAS,eAAe;GACnC,MAAM,OAAO,OAAO,QAAQ,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,eAAe;IACtF,MAAM,WAAW,GAAG,IAAI,GAAG;IAC3B,cAAc,KAAK,CACjB,UACA;KACE,MAAM;KACN,cAAc;MACZ,cAAc,SAAS;MACvB;MACA,MAAM;KACR;KACA,UAAU,EAAE,MAAM,QAAQ,WAAW,EAAE;IACzC,CACF,CAAC;IACD,OAAO;GACT,CAAC;GACD,SAAS,KAAK;IAAE;IAAM;IAAU;GAAK,CAAC;EACxC,OAAO;GACL,MAAM,SAAS,eAAe,QAAQ;GACtC,cAAc,KAAK,CAAC,KAAK,MAAM,CAAC;GAChC,SAAS,KAAK;IAAE;IAAM;IAAU,MAAM,CAAC,GAAG;GAAE,CAAC;EAC/C;CACF;CACA,OAAO;EAAE;EAAU;CAAc;AACnC;;AAGA,SAAgB,QAAQ,OAA6B;CACnD,MAAM,aAAa,QAAQ,KAAK;CAChC,OAAO,OAAO,eAAe,YAAY,OAAO,eAAe,YAC3D,EAAE,OAAO,WAAW,IACpB;AACN;AAEA,SAAS,eAAe,UAAwE;CAC9F,QAAQ,SAAS,MAAjB;EACE,KAAK,UACH,OAAO;GACL,MAAM;GACN,cAAc,SAAS;GACvB,UAAU,OAAO,YACf,OAAO,QAAQ,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,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,OAAO,OAAO,SAAS,YACvB,OAAO,MAAM,gBAAgB,YAC7B,OAAO,MAAM,iBAAiB,QAClC,GAEA,MAAM,IAAI,UAAU,sCAAsC;GAG5D,OAAO,EACL,MAAM,OAAO,KAAK,WAAW;IAC3B,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,MAAM;GACR,EAAE,EACJ;EACF,SAAS,OAAO;GACd,MAAM,aAAa,kBAAkB,OAAO,SAAS,WAAW;GAEhE,IAAI,SAAS,aAAa,SACxB,MAAM;GAGR,MAAM,IAAI,kBAAkB,8BAA8B;IACxD,UAAU;IACV,OAAO;GACT,CAAC;EACH;CACF;AACF;;AC7LA,MAAa,aAAa;AAC1B,MAAa,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvia/jev",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Jev decision model adapter for Anvia.",
5
5
  "author": "anvia",
6
6
  "license": "MIT",
@@ -21,7 +21,8 @@
21
21
  "exports": {
22
22
  ".": {
23
23
  "types": "./dist/index.d.ts",
24
- "import": "./dist/index.js"
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
25
26
  }
26
27
  },
27
28
  "dependencies": {
@@ -32,10 +33,10 @@
32
33
  "tsdown": "^0.23.4",
33
34
  "typescript": "^5.9.3",
34
35
  "vitest": "^4.1.11",
35
- "@anvia/core": "1.23.0"
36
+ "@anvia/core": "1.25.2"
36
37
  },
37
38
  "peerDependencies": {
38
- "@anvia/core": "^1.23.0"
39
+ "@anvia/core": "^1.25.2"
39
40
  },
40
41
  "scripts": {
41
42
  "prebuild": "test -f ../core/dist/index.d.ts || pnpm --filter @anvia/core build",