@xemahq/llm-registry-api-client 0.8.12 → 0.10.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/custom-fetch.d.ts +1 -0
- package/dist/custom-fetch.js +52 -0
- package/dist/endpoints/model-strategies/model-strategies.d.ts +11 -1
- package/dist/endpoints/model-strategies/model-strategies.js +31 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/modelCapability.d.ts +1 -1
- package/dist/models/modelStrategyResponseDto.d.ts +2 -0
- package/dist/models/modelVocabularyKeyDto.d.ts +2 -0
- package/dist/models/resolveModelForInvocationDto.d.ts +1 -1
- package/dist/models/upsertModelStrategyEntriesDto.d.ts +5 -0
- package/dist/models/upsertModelStrategyEntryDto.d.ts +17 -0
- package/dist/models/upsertModelStrategyEntryDto.js +7 -0
- package/package.json +2 -2
package/dist/custom-fetch.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ export declare class ClientError extends Error {
|
|
|
97
97
|
readonly url: string;
|
|
98
98
|
readonly body: unknown;
|
|
99
99
|
constructor(status: number, url: string, body: unknown);
|
|
100
|
+
static [Symbol.hasInstance](candidate: unknown): boolean;
|
|
100
101
|
}
|
|
101
102
|
export declare function configureClient(config: ClientConfig): void;
|
|
102
103
|
export declare function getClientConfig(): ClientConfig;
|
package/dist/custom-fetch.js
CHANGED
|
@@ -19,6 +19,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.customFetch = exports.ClientError = void 0;
|
|
20
20
|
exports.configureClient = configureClient;
|
|
21
21
|
exports.getClientConfig = getClientConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Cross-package identity for `ClientError`.
|
|
24
|
+
*
|
|
25
|
+
* ── THE OUTAGE THIS IS FOR ────────────────────────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* PRODUCTION, 2026-09-22. A session launch aborted on
|
|
28
|
+
* `HTTP 503 from http://skill-registry-api…/skills`. A 503 is the archetypal
|
|
29
|
+
* TRANSIENT — agent-session's launch taxonomy already listed it as retryable —
|
|
30
|
+
* but it was classified PERMANENT and the launch was abandoned.
|
|
31
|
+
*
|
|
32
|
+
* The cause was this file. Every generated client package gets its OWN copy of
|
|
33
|
+
* `ClientError`, so there are as many classes as there are clients (81 at the
|
|
34
|
+
* time of writing), all byte-identical and all DIFFERENT OBJECTS. A consumer
|
|
35
|
+
* naturally writes `err instanceof ClientError` against the one client it
|
|
36
|
+
* imported — which reads as obviously correct and is silently package-local. An
|
|
37
|
+
* error from any OTHER client fails it, falls past every status check, and lands
|
|
38
|
+
* on whatever the default is.
|
|
39
|
+
*
|
|
40
|
+
* That was not the first time: biome-host had already switched to structural
|
|
41
|
+
* detection for the same reason, and canopy imports TWO `ClientError` classes
|
|
42
|
+
* and tests both. Three more call sites elsewhere carry the same shape.
|
|
43
|
+
*
|
|
44
|
+
* ── WHY A BRAND AND NOT A SHARED PACKAGE ─────────────────────────────────
|
|
45
|
+
*
|
|
46
|
+
* The obvious fix is one shared runtime class every client imports. It was
|
|
47
|
+
* rejected on measurement: the 81 generated clients are DEPENDENCY-FREE by
|
|
48
|
+
* design (exactly one has any dependency at all), and a shared class would have
|
|
49
|
+
* to be a PEER dependency to be safe — a normal dependency can be installed
|
|
50
|
+
* twice under version skew, which reinstates this identical bug in a form that
|
|
51
|
+
* is HARDER to see, because the classes then look like they ought to match.
|
|
52
|
+
*
|
|
53
|
+
* `Symbol.for` is a process-wide registry keyed by STRING, so every copy of
|
|
54
|
+
* this template resolves the same symbol without importing anything. The brand
|
|
55
|
+
* costs no dependency, cannot skew, and needs no new package.
|
|
56
|
+
*
|
|
57
|
+
* `Symbol.hasInstance` then makes plain `instanceof` mean the right thing
|
|
58
|
+
* fleet-wide: an error from ANY generated client satisfies `instanceof
|
|
59
|
+
* ClientError` in ANY other. A helper would have made the safe pattern
|
|
60
|
+
* available; this makes the dangerous pattern impossible.
|
|
61
|
+
*
|
|
62
|
+
* Narrow on purpose — the brand is set only by this constructor, so an unrelated
|
|
63
|
+
* error carrying a `status` is not admitted.
|
|
64
|
+
*/
|
|
65
|
+
const CLIENT_ERROR_BRAND = Symbol.for('xema.generatedClientError');
|
|
22
66
|
class ClientError extends Error {
|
|
23
67
|
status;
|
|
24
68
|
url;
|
|
@@ -29,6 +73,14 @@ class ClientError extends Error {
|
|
|
29
73
|
this.url = url;
|
|
30
74
|
this.body = body;
|
|
31
75
|
this.name = 'ClientError';
|
|
76
|
+
// Non-enumerable: it must not appear in JSON, logs or snapshots — it is an
|
|
77
|
+
// identity marker, not payload.
|
|
78
|
+
Object.defineProperty(this, CLIENT_ERROR_BRAND, { value: true });
|
|
79
|
+
}
|
|
80
|
+
static [Symbol.hasInstance](candidate) {
|
|
81
|
+
return (typeof candidate === 'object' &&
|
|
82
|
+
candidate !== null &&
|
|
83
|
+
CLIENT_ERROR_BRAND in candidate);
|
|
32
84
|
}
|
|
33
85
|
}
|
|
34
86
|
exports.ClientError = ClientError;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* LLM Registry API
|
|
4
4
|
* OpenAPI spec version: 0.1.3
|
|
5
5
|
*/
|
|
6
|
-
import type { BindModelStrategyDto, CreateModelStrategyDto, ModelStrategyControllerGetProjectBinding200, ModelStrategyResponseDtoDataArrayEnvelope, ModelStrategyResponseDtoDataEnvelope, OrgDefaultStrategyStatusResponseDtoDataEnvelope, ProjectModelStrategyBindingResponseDtoDataEnvelope, StrategyDeletionImpactResponseDtoDataEnvelope, StrategyTemplateResponseDtoDataArrayEnvelope, UpdateModelStrategyDto, UpsertModelStrategyEntriesDto } from '../../models';
|
|
6
|
+
import type { BindModelStrategyDto, CreateModelStrategyDto, ModelStrategyControllerGetProjectBinding200, ModelStrategyResponseDtoDataArrayEnvelope, ModelStrategyResponseDtoDataEnvelope, OrgDefaultStrategyStatusResponseDtoDataEnvelope, ProjectModelStrategyBindingResponseDtoDataEnvelope, StrategyDeletionImpactResponseDtoDataEnvelope, StrategyTemplateResponseDtoDataArrayEnvelope, UpdateModelStrategyDto, UpsertModelStrategyEntriesDto, UpsertModelStrategyEntryDto } from '../../models';
|
|
7
7
|
export declare const getModelStrategyControllerCreateStrategyUrl: () => string;
|
|
8
8
|
/**
|
|
9
9
|
* @summary Create a model strategy
|
|
@@ -54,6 +54,16 @@ export declare const getModelStrategyControllerUpsertEntriesUrl: (id: string) =>
|
|
|
54
54
|
* @summary Replace all strategy entries
|
|
55
55
|
*/
|
|
56
56
|
export declare const modelStrategyControllerUpsertEntries: (id: string, upsertModelStrategyEntriesDto: UpsertModelStrategyEntriesDto, options?: RequestInit) => Promise<ModelStrategyResponseDtoDataEnvelope>;
|
|
57
|
+
export declare const getModelStrategyControllerUpsertEntryUrl: (id: string, lane: string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* @summary Bind one model lane, leaving every other lane untouched
|
|
60
|
+
*/
|
|
61
|
+
export declare const modelStrategyControllerUpsertEntry: (id: string, lane: string, upsertModelStrategyEntryDto: UpsertModelStrategyEntryDto, options?: RequestInit) => Promise<ModelStrategyResponseDtoDataEnvelope>;
|
|
62
|
+
export declare const getModelStrategyControllerDeleteEntryUrl: (id: string, lane: string) => string;
|
|
63
|
+
/**
|
|
64
|
+
* @summary Clear one model lane, so it falls back to the default binding
|
|
65
|
+
*/
|
|
66
|
+
export declare const modelStrategyControllerDeleteEntry: (id: string, lane: string, options?: RequestInit) => Promise<ModelStrategyResponseDtoDataEnvelope>;
|
|
57
67
|
export declare const getModelStrategyControllerBindStrategyUrl: (projectId: string) => string;
|
|
58
68
|
/**
|
|
59
69
|
* @summary Bind a model strategy to a project
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modelStrategyControllerUnbindStrategy = exports.getModelStrategyControllerUnbindStrategyUrl = exports.modelStrategyControllerGetProjectBinding = exports.getModelStrategyControllerGetProjectBindingUrl = exports.modelStrategyControllerBindStrategy = exports.getModelStrategyControllerBindStrategyUrl = exports.modelStrategyControllerUpsertEntries = exports.getModelStrategyControllerUpsertEntriesUrl = exports.modelStrategyControllerGetStrategyDeletionImpact = exports.getModelStrategyControllerGetStrategyDeletionImpactUrl = exports.modelStrategyControllerDeleteStrategy = exports.getModelStrategyControllerDeleteStrategyUrl = exports.modelStrategyControllerUpdateStrategy = exports.getModelStrategyControllerUpdateStrategyUrl = exports.modelStrategyControllerGetStrategy = exports.getModelStrategyControllerGetStrategyUrl = exports.modelStrategyControllerAdoptTemplate = exports.getModelStrategyControllerAdoptTemplateUrl = exports.modelStrategyControllerListTemplates = exports.getModelStrategyControllerListTemplatesUrl = exports.modelStrategyControllerGetOrgDefaultStatus = exports.getModelStrategyControllerGetOrgDefaultStatusUrl = exports.modelStrategyControllerListStrategies = exports.getModelStrategyControllerListStrategiesUrl = exports.modelStrategyControllerCreateStrategy = exports.getModelStrategyControllerCreateStrategyUrl = void 0;
|
|
3
|
+
exports.modelStrategyControllerUnbindStrategy = exports.getModelStrategyControllerUnbindStrategyUrl = exports.modelStrategyControllerGetProjectBinding = exports.getModelStrategyControllerGetProjectBindingUrl = exports.modelStrategyControllerBindStrategy = exports.getModelStrategyControllerBindStrategyUrl = exports.modelStrategyControllerDeleteEntry = exports.getModelStrategyControllerDeleteEntryUrl = exports.modelStrategyControllerUpsertEntry = exports.getModelStrategyControllerUpsertEntryUrl = exports.modelStrategyControllerUpsertEntries = exports.getModelStrategyControllerUpsertEntriesUrl = exports.modelStrategyControllerGetStrategyDeletionImpact = exports.getModelStrategyControllerGetStrategyDeletionImpactUrl = exports.modelStrategyControllerDeleteStrategy = exports.getModelStrategyControllerDeleteStrategyUrl = exports.modelStrategyControllerUpdateStrategy = exports.getModelStrategyControllerUpdateStrategyUrl = exports.modelStrategyControllerGetStrategy = exports.getModelStrategyControllerGetStrategyUrl = exports.modelStrategyControllerAdoptTemplate = exports.getModelStrategyControllerAdoptTemplateUrl = exports.modelStrategyControllerListTemplates = exports.getModelStrategyControllerListTemplatesUrl = exports.modelStrategyControllerGetOrgDefaultStatus = exports.getModelStrategyControllerGetOrgDefaultStatusUrl = exports.modelStrategyControllerListStrategies = exports.getModelStrategyControllerListStrategiesUrl = exports.modelStrategyControllerCreateStrategy = exports.getModelStrategyControllerCreateStrategyUrl = void 0;
|
|
4
4
|
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
5
|
const getModelStrategyControllerCreateStrategyUrl = () => {
|
|
6
6
|
return `/model-strategies`;
|
|
@@ -148,6 +148,36 @@ const modelStrategyControllerUpsertEntries = async (id, upsertModelStrategyEntri
|
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
150
|
exports.modelStrategyControllerUpsertEntries = modelStrategyControllerUpsertEntries;
|
|
151
|
+
const getModelStrategyControllerUpsertEntryUrl = (id, lane) => {
|
|
152
|
+
return `/model-strategies/${id}/entries/${lane}`;
|
|
153
|
+
};
|
|
154
|
+
exports.getModelStrategyControllerUpsertEntryUrl = getModelStrategyControllerUpsertEntryUrl;
|
|
155
|
+
/**
|
|
156
|
+
* @summary Bind one model lane, leaving every other lane untouched
|
|
157
|
+
*/
|
|
158
|
+
const modelStrategyControllerUpsertEntry = async (id, lane, upsertModelStrategyEntryDto, options) => {
|
|
159
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getModelStrategyControllerUpsertEntryUrl)(id, lane), {
|
|
160
|
+
...options,
|
|
161
|
+
method: 'PUT',
|
|
162
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
163
|
+
body: JSON.stringify(upsertModelStrategyEntryDto)
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
exports.modelStrategyControllerUpsertEntry = modelStrategyControllerUpsertEntry;
|
|
167
|
+
const getModelStrategyControllerDeleteEntryUrl = (id, lane) => {
|
|
168
|
+
return `/model-strategies/${id}/entries/${lane}`;
|
|
169
|
+
};
|
|
170
|
+
exports.getModelStrategyControllerDeleteEntryUrl = getModelStrategyControllerDeleteEntryUrl;
|
|
171
|
+
/**
|
|
172
|
+
* @summary Clear one model lane, so it falls back to the default binding
|
|
173
|
+
*/
|
|
174
|
+
const modelStrategyControllerDeleteEntry = async (id, lane, options) => {
|
|
175
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getModelStrategyControllerDeleteEntryUrl)(id, lane), {
|
|
176
|
+
...options,
|
|
177
|
+
method: 'DELETE'
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
exports.modelStrategyControllerDeleteEntry = modelStrategyControllerDeleteEntry;
|
|
151
181
|
const getModelStrategyControllerBindStrategyUrl = (projectId) => {
|
|
152
182
|
return `/projects/${projectId}/model-strategy`;
|
|
153
183
|
};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -350,6 +350,7 @@ export * from './upsertAgentModelOverrideDto';
|
|
|
350
350
|
export * from './upsertAgentModelOverrideDtoScope';
|
|
351
351
|
export * from './upsertEmbeddingCommitmentDto';
|
|
352
352
|
export * from './upsertModelStrategyEntriesDto';
|
|
353
|
+
export * from './upsertModelStrategyEntryDto';
|
|
353
354
|
export * from './upsertToolProfileDto';
|
|
354
355
|
export * from './widgetKindDto';
|
|
355
356
|
export * from './widgetKindDtoPayloadSchema';
|
package/dist/models/index.js
CHANGED
|
@@ -367,6 +367,7 @@ __exportStar(require("./upsertAgentModelOverrideDto"), exports);
|
|
|
367
367
|
__exportStar(require("./upsertAgentModelOverrideDtoScope"), exports);
|
|
368
368
|
__exportStar(require("./upsertEmbeddingCommitmentDto"), exports);
|
|
369
369
|
__exportStar(require("./upsertModelStrategyEntriesDto"), exports);
|
|
370
|
+
__exportStar(require("./upsertModelStrategyEntryDto"), exports);
|
|
370
371
|
__exportStar(require("./upsertToolProfileDto"), exports);
|
|
371
372
|
__exportStar(require("./widgetKindDto"), exports);
|
|
372
373
|
__exportStar(require("./widgetKindDtoPayloadSchema"), exports);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.3
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* A modality this invocation REQUIRES — the Matrix `modelCapability` dimension, so one rule can route every vision-needing invocation to a multimodal model without pinning a provider. Closed kernel set; an unknown value is a 400.
|
|
7
|
+
* A modality this invocation REQUIRES — the Matrix `modelCapability` dimension, so one rule can route every vision-needing invocation to a multimodal model without pinning a provider. It is ALSO a requirement on whatever the resolution selects: a resolved model that does not provide it is refused with 422 `MODEL_CAPABILITY_UNSUPPORTED` rather than returned, and no other model is substituted. Closed kernel set; an unknown value is a 400.
|
|
8
8
|
*/
|
|
9
9
|
export type ModelCapability = typeof ModelCapability[keyof typeof ModelCapability];
|
|
10
10
|
export declare const ModelCapability: {
|
|
@@ -17,6 +17,8 @@ export interface ModelStrategyResponseDto {
|
|
|
17
17
|
isSystem: boolean;
|
|
18
18
|
isDefault: boolean;
|
|
19
19
|
createdBy: string;
|
|
20
|
+
/** The entry set's concurrency counter. Send it back as `expectedVersion` when replacing the whole entry set. Moves on every write that changes the entries — including a per-lane write — and not on an unrelated metadata edit. */
|
|
21
|
+
version: number;
|
|
20
22
|
createdAt: string;
|
|
21
23
|
updatedAt: string;
|
|
22
24
|
/**
|
|
@@ -12,4 +12,6 @@ export interface ModelVocabularyKeyDto {
|
|
|
12
12
|
title: string;
|
|
13
13
|
/** What work this key names, in the reader's words. */
|
|
14
14
|
description: string;
|
|
15
|
+
/** The biome(s) that declare this key, among the declarations visible to the caller — sorted, de-duplicated, and EVERY declarer rather than one: two biomes may declare the same key, and both are reported. Empty for a key no biome declared. PROVENANCE, NOT IDENTITY: the key alone is the stable identifier, and this list moves when a biome is renamed or replaced — group or explain by it, never key a binding on it. */
|
|
16
|
+
declaringBiomeIds: string[];
|
|
15
17
|
}
|
|
@@ -49,6 +49,6 @@ export interface ResolveModelForInvocationDto {
|
|
|
49
49
|
* @maxLength 512
|
|
50
50
|
*/
|
|
51
51
|
skillSlug?: string;
|
|
52
|
-
/** A modality this invocation REQUIRES — the Matrix `modelCapability` dimension, so one rule can route every vision-needing invocation to a multimodal model without pinning a provider. Closed kernel set; an unknown value is a 400. */
|
|
52
|
+
/** A modality this invocation REQUIRES — the Matrix `modelCapability` dimension, so one rule can route every vision-needing invocation to a multimodal model without pinning a provider. It is ALSO a requirement on whatever the resolution selects: a resolved model that does not provide it is refused with 422 `MODEL_CAPABILITY_UNSUPPORTED` rather than returned, and no other model is substituted. Closed kernel set; an unknown value is a 400. */
|
|
53
53
|
modelCapability?: ModelCapability;
|
|
54
54
|
}
|
|
@@ -7,4 +7,9 @@ import type { CreateModelStrategyEntryDto } from './createModelStrategyEntryDto.
|
|
|
7
7
|
export interface UpsertModelStrategyEntriesDto {
|
|
8
8
|
/** Role entries (replaces all entries) */
|
|
9
9
|
entries: CreateModelStrategyEntryDto[];
|
|
10
|
+
/**
|
|
11
|
+
* The `version` read from this strategy. When sent, a stale value is refused with 409 `MODEL_STRATEGY_VERSION_MISMATCH`, which carries `currentVersion` to retry with. Send it: it is optional only for one transition and will become REQUIRED — without it this route replaces the whole entry set unconditionally, so a concurrent edit to a DIFFERENT lane is silently discarded. To change one lane, use PUT /model-strategies/:id/entries/:lane, which needs no version.
|
|
12
|
+
* @minimum 1
|
|
13
|
+
*/
|
|
14
|
+
expectedVersion?: number;
|
|
10
15
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by @xemahq/api-client-generator — do not edit manually.
|
|
3
|
+
* LLM Registry API
|
|
4
|
+
* OpenAPI spec version: 0.1.3
|
|
5
|
+
*/
|
|
6
|
+
export interface UpsertModelStrategyEntryDto {
|
|
7
|
+
/** Model slug/ID to match against LlmModel.modelId */
|
|
8
|
+
modelSlug: string;
|
|
9
|
+
/**
|
|
10
|
+
* Temperature (0-2). Omitted = the engine/model owns it; no platform value is ever materialized.
|
|
11
|
+
* @minimum 0
|
|
12
|
+
* @maximum 2
|
|
13
|
+
*/
|
|
14
|
+
temperature?: number;
|
|
15
|
+
/** Reasoning effort asked of the model — the kernel's `ModelOptions.reasoningEffort`, an open string the provider interprets (`low`/`medium`/`high`/…). Omitted = the engine/model owns it. */
|
|
16
|
+
reasoningEffort?: string;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/llm-registry-api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"service": "llm-registry-api",
|
|
20
20
|
"biome": "agent-runtime",
|
|
21
21
|
"target": "server",
|
|
22
|
-
"generator": "@xemahq/api-client-generator@
|
|
22
|
+
"generator": "@xemahq/api-client-generator@1.1.2",
|
|
23
23
|
"source": "openapi.public.json"
|
|
24
24
|
},
|
|
25
25
|
"license": "LicenseRef-Xema-BSL-1.1",
|