@axiom-lattice/core 3.1.0 → 3.1.1

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.mjs CHANGED
@@ -21798,7 +21798,7 @@ registerToolLattice(
21798
21798
  "update_agent",
21799
21799
  {
21800
21800
  name: "update_agent",
21801
- description: "Update an existing agent's configuration. Provide the agent ID and the fields to change. Returns the updated agent's ID and name. NOTE: For user approval/confirmation scenarios, add middleware with type: 'ask_user_to_clarify'.",
21801
+ description: "Update an existing agent's configuration. Provide the agent ID and the fields to change. Returns the updated agent's ID and name. NOTE: For user approval/confirmation scenarios, add middleware with type: 'ask_user_to_clarify'. IMPORTANT: do NOT set 'modelKey' unless the user explicitly specified a model \u2014 leaving it unset makes the runtime use the 'default' model.",
21802
21802
  schema: updateAgentSchema
21803
21803
  },
21804
21804
  async (input, exeConfig) => {
@@ -22036,6 +22036,8 @@ OVERRIDES the defaults above:
22036
22036
  (parentId); NEVER create a new parent task for the round.
22037
22037
  - The round is pre-approved \u2014 skip the DESIGN\u2192CONFIRM gates: show the
22038
22038
  design in your reply, then build directly.
22039
+ - Do NOT set modelKey in update_agent unless the user explicitly named a
22040
+ model \u2014 leaving it unset makes the runtime use the 'default' model.
22039
22041
  - Every update_agent call must be mirrored by a manage_task work item
22040
22042
  whose summary names the changed keys (e.g. "update_agent: prompt,
22041
22043
  modelKey") \u2014 the round feed highlights these so the user can see what
@@ -26625,14 +26627,22 @@ var DEFAULT_CALIBRATION_PROBES = [
26625
26627
  expectedPass: false
26626
26628
  }
26627
26629
  ];
26630
+ function resolveJudgeModelKey(explicitKey, manager) {
26631
+ if (explicitKey) return explicitKey;
26632
+ const models = manager.getAllLattices();
26633
+ const defaultModel = models.find((m) => m.key === "default");
26634
+ if (defaultModel) return defaultModel.key;
26635
+ const first = models[0];
26636
+ if (!first) {
26637
+ throw new Error("No model registered \u2014 register a model or provide a judgeModelKey");
26638
+ }
26639
+ return first.key;
26640
+ }
26628
26641
  var LatticeEvalProject = class {
26629
26642
  constructor(project, onCaseComplete) {
26630
26643
  this.suites = /* @__PURE__ */ new Map();
26631
26644
  this.project = project;
26632
- const judgeModelKey = this.project.judge_agent_config.modelKey;
26633
- if (!judgeModelKey) {
26634
- throw new Error("judge_agent_config.modelKey is required \u2014 only pre-registered models are allowed");
26635
- }
26645
+ const judgeModelKey = resolveJudgeModelKey(this.project.judge_agent_config.modelKey, modelLatticeManager);
26636
26646
  if (!modelLatticeManager.hasLattice(judgeModelKey)) {
26637
26647
  throw new Error(
26638
26648
  `Judge model "${judgeModelKey}" not found. Register it first or provide a valid modelKey.`
@@ -29063,7 +29073,9 @@ function createManageEvalTool() {
29063
29073
  data = await store.createProject(tid, uuidv48(), {
29064
29074
  name: input.name,
29065
29075
  description: input.description,
29066
- judgeModelConfig: { modelKey: input.judgeModelKey },
29076
+ // No judge key given → default to the 'default' model key (the same
29077
+ // convention the UI model selector uses); never an empty modelKey.
29078
+ judgeModelConfig: { modelKey: input.judgeModelKey ?? "default" },
29067
29079
  targetServerConfig: {
29068
29080
  workspace_id: ctx.workspaceId,
29069
29081
  project_id: ctx.projectId,
@@ -29138,7 +29150,7 @@ function createManageEvalTool() {
29138
29150
  description: `Create, update, delete evaluation projects, suites, and test cases.
29139
29151
 
29140
29152
  Project: create_project(name, description?, judgeModelKey?, concurrency?, targetAgentId?) | update_project | delete_project
29141
- judgeModelKey defaults to first available model. concurrency defaults to 3.
29153
+ judgeModelKey defaults to the "default" model. concurrency defaults to 3.
29142
29154
  delete_project rejected if active runs exist.
29143
29155
  **When creating a project from within a workspace, the workspace/project context is
29144
29156
  automatically bound \u2014 eval runs will execute in the same workspace.**
@@ -31416,6 +31428,7 @@ export {
31416
31428
  registerWorkflowRun,
31417
31429
  removeCollectionVectorStore,
31418
31430
  renderTemplate,
31431
+ resolveJudgeModelKey,
31419
31432
  resolvePath,
31420
31433
  sandboxLatticeManager,
31421
31434
  sanitizeToolCallId,