@tangle-network/agent-interface 5.10.12 → 5.10.13

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.
@@ -94,11 +94,11 @@ export declare function harnessSupportsModel(harness: HarnessType, modelId: stri
94
94
  * `openai` → `codex`, `moonshot` → `kimi-code`); `null` when any router-backed harness will do. */
95
95
  export declare function preferredHarnessForModel(modelId: string): HarnessType | null;
96
96
  /**
97
- * Keep `modelId` when the harness can run it; otherwise return the harness's best compatible id from
98
- * `candidateIds` (preferred patterns in order, highest version within a pattern). When nothing in the
99
- * candidate list fits, the original id is returned unchanged so the caller sees the incompatibility
100
- * instead of a silent wrong substitution. `candidateIds` are canonical ("provider/model") ids — the
101
- * caller maps its own catalog shape down to ids, keeping this layer catalog-agnostic.
97
+ * Keep `modelId` when the harness can run it; otherwise return the first compatible id in
98
+ * `candidateIds`. When nothing in the candidate list fits, the original id is returned unchanged
99
+ * so the caller sees the incompatibility instead of a silent wrong substitution. `candidateIds` are
100
+ * canonical ("provider/model") ids — the caller maps its own catalog shape down to ids, keeping
101
+ * this layer catalog-agnostic.
102
102
  */
103
103
  export declare function snapModelToHarness(harness: HarnessType, modelId: string, candidateIds: readonly string[]): string;
104
104
  /**
@@ -41,13 +41,12 @@ export function formatSeatSpec(seat) {
41
41
  * Vendor locks, before the measured {@link harnessModelExclusions}. Absent means router-backed.
42
42
  * Claude Code and Codex run any Router model: their native vendor wire passes through for vendor
43
43
  * models and translates others to chat completions (including images/tools; hosted tools drop).
44
- * A caller's vendor key/login remains vendor-limited; this table does not know credentials.
45
- * NanoClaw also routes every provider through the Router, so it has no Anthropic lock.
46
- * {@link vendorHarness} chooses a default harness; it is not a provider restriction.
44
+ * Kimi Code on a managed box writes an `openai_legacy` provider that sends chat completions to the
45
+ * Router, so it runs any Router model too. A caller's vendor key/login remains vendor-limited;
46
+ * this table does not know credentials. {@link vendorHarness} chooses a default harness; it is not
47
+ * a provider restriction.
47
48
  */
48
- const harnessProviderLock = {
49
- "kimi-code": ["moonshot"],
50
- };
49
+ const harnessProviderLock = {};
51
50
  /**
52
51
  * The harness that natively speaks a vendor's models. A model of that vendor adopts it when the
53
52
  * caller names no harness ({@link preferredHarnessForModel}), and a locked harness handed such a
@@ -203,35 +202,15 @@ export function preferredHarnessForModel(modelId) {
203
202
  }
204
203
  // ── Harness ↔ model snapping (catalog-aware) ─────────────────────────────────
205
204
  /**
206
- * Per-harness ranking patterns for {@link snapModelToHarness}, best first; within one pattern the
207
- * highest version wins (numeric-aware). Only vendor-locked harnesses need an entry — a router-backed
208
- * harness never snaps (it runs the model as-is).
209
- */
210
- const harnessPreferredModelPatterns = {
211
- "kimi-code": [/^moonshot\//],
212
- };
213
- const numericDesc = new Intl.Collator(undefined, {
214
- numeric: true,
215
- sensitivity: "base",
216
- });
217
- /**
218
- * Keep `modelId` when the harness can run it; otherwise return the harness's best compatible id from
219
- * `candidateIds` (preferred patterns in order, highest version within a pattern). When nothing in the
220
- * candidate list fits, the original id is returned unchanged so the caller sees the incompatibility
221
- * instead of a silent wrong substitution. `candidateIds` are canonical ("provider/model") ids — the
222
- * caller maps its own catalog shape down to ids, keeping this layer catalog-agnostic.
205
+ * Keep `modelId` when the harness can run it; otherwise return the first compatible id in
206
+ * `candidateIds`. When nothing in the candidate list fits, the original id is returned unchanged
207
+ * so the caller sees the incompatibility instead of a silent wrong substitution. `candidateIds` are
208
+ * canonical ("provider/model") ids — the caller maps its own catalog shape down to ids, keeping
209
+ * this layer catalog-agnostic.
223
210
  */
224
211
  export function snapModelToHarness(harness, modelId, candidateIds) {
225
212
  if (harnessSupportsModel(harness, modelId))
226
213
  return modelId;
227
- const patterns = harnessPreferredModelPatterns[harness] ?? [];
228
- for (const pattern of patterns) {
229
- const matches = candidateIds
230
- .filter((id) => pattern.test(id))
231
- .sort((a, b) => numericDesc.compare(b, a));
232
- if (matches.length > 0)
233
- return matches[0];
234
- }
235
214
  return candidateIds.find((id) => harnessSupportsModel(harness, id)) ?? modelId;
236
215
  }
237
216
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "5.10.12",
3
+ "version": "5.10.13",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",