@tangle-network/agent-interface 5.10.13 → 5.10.15
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/harness-capabilities.d.ts +5 -7
- package/dist/harness-capabilities.js +6 -29
- package/dist/learning-state.d.ts +7 -7
- package/dist/profile-kb/index.d.ts +2 -0
- package/dist/profile-kb/index.js +3 -4
- package/dist/profile-kb/models.js +15 -2
- package/dist/profile-kb/types.d.ts +1 -1
- package/dist/profile-schema.js +5 -2
- package/package.json +1 -1
|
@@ -26,8 +26,9 @@ export declare function modelProvider(modelId: string): string | null;
|
|
|
26
26
|
* sentinel, whose provider only the serving harness knows.
|
|
27
27
|
*/
|
|
28
28
|
export declare function resolveModelProvider(modelId: string): string | null;
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/** Always `null`: every harness is router-backed (Claude Code and Codex translate non-vendor models;
|
|
30
|
+
* Kimi Code's managed provider sends chat completions to the Router). Credentials are not modeled. */
|
|
31
|
+
export declare function harnessProviders(_harness: HarnessType): readonly string[] | null;
|
|
31
32
|
/** A harness × model pair that a production run measured to fail at its first model call. */
|
|
32
33
|
export interface HarnessModelExclusion {
|
|
33
34
|
readonly harness: HarnessType;
|
|
@@ -67,8 +68,6 @@ export type HarnessModelSupport = {
|
|
|
67
68
|
readonly supported: false;
|
|
68
69
|
readonly model: string;
|
|
69
70
|
readonly provider: string | null;
|
|
70
|
-
/** The providers a vendor-locked harness accepts; absent for a measured exclusion. */
|
|
71
|
-
readonly allowedProviders?: readonly string[];
|
|
72
71
|
/** The measurement behind a refusal of a router-backed pair. */
|
|
73
72
|
readonly exclusion?: HarnessModelExclusion;
|
|
74
73
|
/** One sentence naming the harness, the model and the reason. */
|
|
@@ -81,9 +80,8 @@ export interface HarnessModelSupportOptions {
|
|
|
81
80
|
/**
|
|
82
81
|
* Whether a harness can run a model, and why not. A bare id resolves its provider through
|
|
83
82
|
* {@link resolveModelProvider}; an id whose provider cannot be resolved (a sentinel like `default`)
|
|
84
|
-
* is left to the harness, because its provider only the serving harness knows.
|
|
85
|
-
*
|
|
86
|
-
* {@link harnessModelExclusions}.
|
|
83
|
+
* is left to the harness, because its provider only the serving harness knows. Only the measured
|
|
84
|
+
* {@link harnessModelExclusions} are refused.
|
|
87
85
|
*/
|
|
88
86
|
export declare function harnessModelSupport(harness: HarnessType, modelId: string, options?: HarnessModelSupportOptions): HarnessModelSupport;
|
|
89
87
|
/**
|
|
@@ -37,16 +37,6 @@ export function formatSeatSpec(seat) {
|
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
39
39
|
// ── Harness ↔ model compatibility ────────────────────────────────────────────
|
|
40
|
-
/**
|
|
41
|
-
* Vendor locks, before the measured {@link harnessModelExclusions}. Absent means router-backed.
|
|
42
|
-
* Claude Code and Codex run any Router model: their native vendor wire passes through for vendor
|
|
43
|
-
* models and translates others to chat completions (including images/tools; hosted tools drop).
|
|
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.
|
|
48
|
-
*/
|
|
49
|
-
const harnessProviderLock = {};
|
|
50
40
|
/**
|
|
51
41
|
* The harness that natively speaks a vendor's models. A model of that vendor adopts it when the
|
|
52
42
|
* caller names no harness ({@link preferredHarnessForModel}), and a locked harness handed such a
|
|
@@ -93,9 +83,10 @@ export function resolveModelProvider(modelId) {
|
|
|
93
83
|
}
|
|
94
84
|
return null;
|
|
95
85
|
}
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
/** Always `null`: every harness is router-backed (Claude Code and Codex translate non-vendor models;
|
|
87
|
+
* Kimi Code's managed provider sends chat completions to the Router). Credentials are not modeled. */
|
|
88
|
+
export function harnessProviders(_harness) {
|
|
89
|
+
return null;
|
|
99
90
|
}
|
|
100
91
|
const SANDBOX_HARNESS_MATRIX_EVIDENCE = "https://github.com/tangle-network/agent-container/issues/9382";
|
|
101
92
|
/**
|
|
@@ -141,9 +132,8 @@ export const harnessModelExclusions = [
|
|
|
141
132
|
/**
|
|
142
133
|
* Whether a harness can run a model, and why not. A bare id resolves its provider through
|
|
143
134
|
* {@link resolveModelProvider}; an id whose provider cannot be resolved (a sentinel like `default`)
|
|
144
|
-
* is left to the harness, because its provider only the serving harness knows.
|
|
145
|
-
*
|
|
146
|
-
* {@link harnessModelExclusions}.
|
|
135
|
+
* is left to the harness, because its provider only the serving harness knows. Only the measured
|
|
136
|
+
* {@link harnessModelExclusions} are refused.
|
|
147
137
|
*/
|
|
148
138
|
export function harnessModelSupport(harness, modelId, options = {}) {
|
|
149
139
|
const trimmed = modelId.trim();
|
|
@@ -153,19 +143,6 @@ export function harnessModelSupport(harness, modelId, options = {}) {
|
|
|
153
143
|
: trimmed;
|
|
154
144
|
if (provider === null)
|
|
155
145
|
return { supported: true, model, provider };
|
|
156
|
-
const allowedProviders = harnessProviders(harness);
|
|
157
|
-
if (allowedProviders && !allowedProviders.includes(provider)) {
|
|
158
|
-
return {
|
|
159
|
-
supported: false,
|
|
160
|
-
model,
|
|
161
|
-
provider,
|
|
162
|
-
allowedProviders,
|
|
163
|
-
message: `Harness ${harness} runs only ${allowedProviders.join(" or ")} models, ` +
|
|
164
|
-
`not ${model} (provider ${provider}). Choose a model whose id starts with ` +
|
|
165
|
-
`${allowedProviders.map((p) => `${p}/`).join(" or ")}, or a harness that runs ` +
|
|
166
|
-
`${provider} models, such as opencode.`,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
146
|
const reasoning = options.reasoningEffort !== undefined &&
|
|
170
147
|
options.reasoningEffort !== null &&
|
|
171
148
|
options.reasoningEffort !== "none";
|
package/dist/learning-state.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export declare function agentLearningFileKind(path: string): AgentLearningFileKi
|
|
|
25
25
|
export declare const AgentLearningFileSchema: z.ZodObject<{
|
|
26
26
|
path: z.ZodString;
|
|
27
27
|
kind: z.ZodEnum<{
|
|
28
|
-
fact: "fact";
|
|
29
28
|
note: "note";
|
|
29
|
+
fact: "fact";
|
|
30
30
|
preference: "preference";
|
|
31
31
|
"skill-source": "skill-source";
|
|
32
32
|
}>;
|
|
@@ -102,8 +102,8 @@ declare const materialSchema: z.ZodObject<{
|
|
|
102
102
|
files: z.ZodArray<z.ZodObject<{
|
|
103
103
|
path: z.ZodString;
|
|
104
104
|
kind: z.ZodEnum<{
|
|
105
|
-
fact: "fact";
|
|
106
105
|
note: "note";
|
|
106
|
+
fact: "fact";
|
|
107
107
|
preference: "preference";
|
|
108
108
|
"skill-source": "skill-source";
|
|
109
109
|
}>;
|
|
@@ -180,8 +180,8 @@ export declare const AgentLearningManifestSchema: z.ZodObject<{
|
|
|
180
180
|
files: z.ZodArray<z.ZodObject<{
|
|
181
181
|
path: z.ZodString;
|
|
182
182
|
kind: z.ZodEnum<{
|
|
183
|
-
fact: "fact";
|
|
184
183
|
note: "note";
|
|
184
|
+
fact: "fact";
|
|
185
185
|
preference: "preference";
|
|
186
186
|
"skill-source": "skill-source";
|
|
187
187
|
}>;
|
|
@@ -283,8 +283,8 @@ declare const exportMaterialSchema: z.ZodObject<{
|
|
|
283
283
|
files: z.ZodArray<z.ZodObject<{
|
|
284
284
|
path: z.ZodString;
|
|
285
285
|
kind: z.ZodEnum<{
|
|
286
|
-
fact: "fact";
|
|
287
286
|
note: "note";
|
|
287
|
+
fact: "fact";
|
|
288
288
|
preference: "preference";
|
|
289
289
|
"skill-source": "skill-source";
|
|
290
290
|
}>;
|
|
@@ -384,8 +384,8 @@ export declare const AgentLearningExportSchema: z.ZodObject<{
|
|
|
384
384
|
files: z.ZodArray<z.ZodObject<{
|
|
385
385
|
path: z.ZodString;
|
|
386
386
|
kind: z.ZodEnum<{
|
|
387
|
-
fact: "fact";
|
|
388
387
|
note: "note";
|
|
388
|
+
fact: "fact";
|
|
389
389
|
preference: "preference";
|
|
390
390
|
"skill-source": "skill-source";
|
|
391
391
|
}>;
|
|
@@ -469,14 +469,14 @@ export declare const AgentLearningCapabilitiesSchema: z.ZodObject<{
|
|
|
469
469
|
revision: z.ZodString;
|
|
470
470
|
}, z.core.$strict>;
|
|
471
471
|
importKinds: z.ZodArray<z.ZodEnum<{
|
|
472
|
-
fact: "fact";
|
|
473
472
|
note: "note";
|
|
473
|
+
fact: "fact";
|
|
474
474
|
preference: "preference";
|
|
475
475
|
"skill-source": "skill-source";
|
|
476
476
|
}>>;
|
|
477
477
|
exportKinds: z.ZodArray<z.ZodEnum<{
|
|
478
|
-
fact: "fact";
|
|
479
478
|
note: "note";
|
|
479
|
+
fact: "fact";
|
|
480
480
|
preference: "preference";
|
|
481
481
|
"skill-source": "skill-source";
|
|
482
482
|
}>>;
|
|
@@ -19,6 +19,8 @@ export { composeAgentProfileGuidance, profileKbDiscrepancies, profileKbHarnesses
|
|
|
19
19
|
* replaces blocks from these sources and keeps blocks any other layer added.
|
|
20
20
|
*/
|
|
21
21
|
export declare const PROFILE_KB_SOURCES: readonly ["harness", "model", "learning"];
|
|
22
|
+
/** Whether the knowledge base lists this exact spelling: a model id or one of its aliases, such as `zai-coding-plan/glm-5.3`. */
|
|
23
|
+
export declare const profileKbNamesModel: (name: string) => boolean;
|
|
22
24
|
/** Which harness and model to compose guidance for. */
|
|
23
25
|
export interface ProfileKbSelection {
|
|
24
26
|
harness?: HarnessType | string;
|
package/dist/profile-kb/index.js
CHANGED
|
@@ -64,9 +64,8 @@ function matchModelName(model, lookup) {
|
|
|
64
64
|
candidate = candidate.slice(slash + 1);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
67
|
+
/** Whether the knowledge base lists this exact spelling: a model id or one of its aliases, such as `zai-coding-plan/glm-5.3`. */
|
|
68
|
+
export const profileKbNamesModel = (name) => modelIndex.has(name.trim().toLowerCase());
|
|
70
69
|
function learningsFor(harness, model) {
|
|
71
70
|
return learningSnapshot.filter((learning) => {
|
|
72
71
|
const scope = learning.appliesTo;
|
|
@@ -90,7 +89,7 @@ function profileKbGuidance(selection) {
|
|
|
90
89
|
const harness = selection.harness
|
|
91
90
|
? harnessSnapshot[harnessPosition(selection.harness)]
|
|
92
91
|
: undefined;
|
|
93
|
-
const model = modelSnapshot[
|
|
92
|
+
const model = modelSnapshot[matchModelName(selection.model, (candidate) => modelIndex.get(candidate)) ?? -1];
|
|
94
93
|
const blocks = [];
|
|
95
94
|
if (harness && harness.prompt.length > 0) {
|
|
96
95
|
blocks.push({
|
|
@@ -14,6 +14,10 @@ const deepseekModel = source("https://api-docs.deepseek.com/quick_start/pricing/
|
|
|
14
14
|
const deepseekThinking = source("https://api-docs.deepseek.com/guides/thinking_mode/", "Thinking mode toggle and effort control; tool calls");
|
|
15
15
|
const glmModel = source("https://docs.z.ai/guides/llm/glm-5.3#feature-changes", "Feature changes");
|
|
16
16
|
const kimiModel = source("https://platform.kimi.ai/docs/guide/kimi-k3-quickstart", "Reasoning effort; vision input; important limits");
|
|
17
|
+
/** `opencode models opencode --verbose` on OpenCode 1.18.33: the keyless free routes, all priced at 0. */
|
|
18
|
+
function opencodeFreeClaim(route, limits) {
|
|
19
|
+
return claim(`OpenCode serves ${route} keyless (no provider key), at zero cost: ${limits}. A free route can change or leave the catalog without notice.`, { url: "https://opencode.ai/inference/openai/v1", checkedAt: "2026-11-02", authority: "local", locator: `opencode 1.18.33 models opencode --verbose; ${route}` }, "local-observation");
|
|
20
|
+
}
|
|
17
21
|
/** Historical acceptance records, not a current serving or quality check. */
|
|
18
22
|
function routerClaim(note) {
|
|
19
23
|
return claim(`The 2026-09-22 record reports ${note}; this audit recovered no attached trace and made no new router request.`, {
|
|
@@ -223,14 +227,23 @@ export const profileKbModels = [
|
|
|
223
227
|
id: "deepseek-v4.1-flash",
|
|
224
228
|
name: "DeepSeek V4.1 Flash",
|
|
225
229
|
vendor: "DeepSeek",
|
|
226
|
-
surfaces: ["api", "router"],
|
|
227
|
-
aliases: ["deepseek-flash", "deepseek/deepseek-v4.1-flash"],
|
|
230
|
+
surfaces: ["api", "router", "opencode"],
|
|
231
|
+
aliases: ["deepseek-flash", "deepseek/deepseek-v4.1-flash", "opencode/deepseek-v4.1-flash-free"],
|
|
228
232
|
claims: [
|
|
229
233
|
claim("DeepSeek API ID deepseek-flash denotes V4.1-Flash: 1M context, 384K output, vision and tools; non-thinking mode is available. Router naming is a separate contract.", deepseekModel),
|
|
230
234
|
claim("Thinking defaults on at high. Native efforts are low, high and max; minimal maps to low, medium/xhigh to high, and ultra to max. With tools, preserve all previous reasoning_content, including turns without tool calls.", deepseekThinking),
|
|
231
235
|
routerClaim("deepseek/deepseek-v4.1-flash returned HTTP 200 and served that id"),
|
|
236
|
+
opencodeFreeClaim("opencode/deepseek-v4.1-flash-free", "200K context, 32K output, image input, efforts low, high and max"),
|
|
232
237
|
],
|
|
233
238
|
}),
|
|
239
|
+
kbEntry({
|
|
240
|
+
id: "glm-5.3-flash",
|
|
241
|
+
name: "GLM-5.3-Flash",
|
|
242
|
+
vendor: "Z.ai",
|
|
243
|
+
surfaces: ["opencode"],
|
|
244
|
+
aliases: ["opencode/glm-5.3-flash-free"],
|
|
245
|
+
claims: [opencodeFreeClaim("opencode/glm-5.3-flash-free", "200K context, 32K output, image input, efforts low, high and max")],
|
|
246
|
+
}),
|
|
234
247
|
kbEntry({
|
|
235
248
|
id: "glm-5.3",
|
|
236
249
|
name: "GLM-5.3",
|
|
@@ -38,7 +38,7 @@ export interface ProfileKbHarness {
|
|
|
38
38
|
claims?: ProfileKbClaim[];
|
|
39
39
|
}
|
|
40
40
|
/** Where a model is reached. A model id means different things on each surface. */
|
|
41
|
-
export type ProfileKbSurface = "api" | "codex" | "chatgpt" | "router";
|
|
41
|
+
export type ProfileKbSurface = "api" | "codex" | "chatgpt" | "router" | "opencode";
|
|
42
42
|
/**
|
|
43
43
|
* How to get the best from one model.
|
|
44
44
|
*
|
package/dist/profile-schema.js
CHANGED
|
@@ -10,6 +10,7 @@ import { canonicalCandidateDigest, sha256DigestSchema, environmentNameSchema, he
|
|
|
10
10
|
import { harnessTypeSchema } from "./harness.js";
|
|
11
11
|
import { AgentProfileValueError, assertAgentProfileValue, canonicalAgentProfileJson } from "./agent-profile-canonical.js";
|
|
12
12
|
import { harnessHonorsEffort, harnessHonorsModel, harnessModelSupport, harnessReasoningEfforts, harnessSystemPromptIntents, resolveModelProvider, } from "./harness-capabilities.js";
|
|
13
|
+
import { profileKbNamesModel } from "./profile-kb/index.js";
|
|
13
14
|
import { SANDBOX_SIZE_PRESET_NAMES, } from "./sandbox-size.js";
|
|
14
15
|
const profileOpaqueValueSchema = z.unknown().transform((value, context) => {
|
|
15
16
|
if (value === undefined || isBoundedJsonMaterial(value, { dataPropertiesOnly: true, content: true }))
|
|
@@ -442,8 +443,10 @@ export const agentProfileSchema = z
|
|
|
442
443
|
context.addIssue({ code: "custom", path: ["seats", 0, "permissions"], message: "first seat permissions must match profile permissions" });
|
|
443
444
|
}
|
|
444
445
|
for (const [index, seat] of profile.seats.entries()) {
|
|
445
|
-
|
|
446
|
-
|
|
446
|
+
// The model's own provider (prefix or bare-id family), a spelling the knowledge base lists (`zai-coding-plan/glm-5.3`,
|
|
447
|
+
// keyless `opencode/glm-5.3-flash-free`), or any provider for a model outside every family (`opencode/big-pickle`).
|
|
448
|
+
const owner = resolveModelProvider(seat.model);
|
|
449
|
+
if (owner !== null && owner !== seat.provider && !profileKbNamesModel(`${seat.provider}/${seat.model}`)) {
|
|
447
450
|
context.addIssue({ code: "custom", path: ["seats", index, "provider"], message: "seat provider must match the model provider" });
|
|
448
451
|
}
|
|
449
452
|
if (!harnessHonorsModel(seat.harness)) {
|