@tangle-network/agent-interface 5.10.13 → 5.10.14

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.
@@ -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;
@@ -64,9 +64,8 @@ function matchModelName(model, lookup) {
64
64
  candidate = candidate.slice(slash + 1);
65
65
  }
66
66
  }
67
- function modelPosition(model) {
68
- return matchModelName(model, (candidate) => modelIndex.get(candidate)) ?? -1;
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[modelPosition(selection.model)];
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({
@@ -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,8 @@ 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
- const provider = resolveModelProvider(seat.model);
446
- if (provider !== seat.provider) {
446
+ // The bare id's family provider (`glm-5.3` → `zai`), or a spelling the knowledge base lists (opencode's `zai-coding-plan/glm-5.3`).
447
+ if (resolveModelProvider(seat.model) !== seat.provider && !profileKbNamesModel(`${seat.provider}/${seat.model}`)) {
447
448
  context.addIssue({ code: "custom", path: ["seats", index, "provider"], message: "seat provider must match the model provider" });
448
449
  }
449
450
  if (!harnessHonorsModel(seat.harness)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "5.10.13",
3
+ "version": "5.10.14",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",