@acruxcoreai/mcp-server 0.2.0 → 0.3.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/index.d.mts CHANGED
@@ -162,7 +162,7 @@ declare function resolveConfig(sources: ConfigSources): McpServerConfig;
162
162
  declare function parseToolsets(raw: string): Toolset[];
163
163
 
164
164
  /** Version reported to clients in `initialize`. Kept in step with package.json. */
165
- declare const SERVER_VERSION = "0.2.0";
165
+ declare const SERVER_VERSION = "0.3.0";
166
166
  /** What the caller gets back, so a host can inspect what was registered. */
167
167
  interface BuiltServer {
168
168
  /** The configured MCP server, not yet connected to a transport. */
package/dist/index.d.ts CHANGED
@@ -162,7 +162,7 @@ declare function resolveConfig(sources: ConfigSources): McpServerConfig;
162
162
  declare function parseToolsets(raw: string): Toolset[];
163
163
 
164
164
  /** Version reported to clients in `initialize`. Kept in step with package.json. */
165
- declare const SERVER_VERSION = "0.2.0";
165
+ declare const SERVER_VERSION = "0.3.0";
166
166
  /** What the caller gets back, so a host can inspect what was registered. */
167
167
  interface BuiltServer {
168
168
  /** The configured MCP server, not yet connected to a transport. */
package/dist/index.js CHANGED
@@ -792,21 +792,29 @@ var evaluationTools = [
792
792
  title: "Create and start an experiment run",
793
793
  toolset: "evaluations",
794
794
  readOnlyHint: false,
795
- description: "Create an experiment over a dataset and immediately start a run of it. The grid is every (version x model) pair you list. When `prompt` is given, a baseline cell for its production alias is added automatically unless that version is already in the grid. Returns as soon as the run is queued \u2014 the worker executes it asynchronously, so poll get_experiment_run for results. Note the judge model (gpt-4o-mini by default) must itself be registered in the gateway or every score fails.",
795
+ description: "Create an experiment over a dataset and immediately start a run of it. The grid is every (version x model) pair you list. When `prompt` is given, a baseline cell for its production alias is added automatically unless that version is already in the grid. Returns as soon as the run is queued \u2014 the worker executes it asynchronously, so poll get_experiment_run for results. `judge_model` scores every answer and must be registered in the gateway (see list_models). `judge_prompt` grades with one of your prompts instead of the built-in judge.",
796
796
  inputSchema: {
797
797
  dataset_id: import_zod2.z.string().uuid().describe("Dataset to evaluate against."),
798
798
  version_ids: import_zod2.z.array(import_zod2.z.string().uuid()).min(1).describe("Prompt-version UUIDs to sweep. At least one."),
799
799
  models: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).describe("Gateway model public names to sweep."),
800
800
  prompt: import_zod2.z.string().optional().describe("Prompt name or UUID under test \u2014 enables the automatic baseline cell."),
801
801
  name: import_zod2.z.string().optional().describe("Experiment name, for the run history."),
802
- alias: import_zod2.z.string().optional().describe('Which alias the automatic baseline points at. Default "production".')
802
+ alias: import_zod2.z.string().optional().describe('Which alias the automatic baseline points at. Default "production".'),
803
+ judge_model: import_zod2.z.string().min(1).describe("Gateway model that scores every answer. Required."),
804
+ judge_prompt: import_zod2.z.string().min(1).optional().describe(
805
+ "Name or UUID of a team prompt that grades instead of the built-in judge. The run uses its production version (else its latest). Default: the built-in judge."
806
+ )
803
807
  },
804
808
  async handler(args, { client, config }) {
805
809
  const body = {
806
810
  dataset_id: args.dataset_id,
807
811
  version_ids: args.version_ids,
808
- models: args.models
812
+ models: args.models,
813
+ judge_model: args.judge_model
809
814
  };
815
+ if (args.judge_prompt !== void 0) {
816
+ body.judge_prompt_id = await resolvePromptRef(client, args.judge_prompt);
817
+ }
810
818
  if (args.name !== void 0) body.name = args.name;
811
819
  if (args.alias !== void 0) body.alias = args.alias;
812
820
  if (args.prompt !== void 0) body.prompt_id = await resolvePromptRef(client, args.prompt);
@@ -873,7 +881,7 @@ var evaluationTools = [
873
881
  title: "Start an optimizer run for a prompt",
874
882
  toolset: "evaluations",
875
883
  readOnlyHint: false,
876
- description: 'Ask the optimizer to improve a prompt against a dataset. An optimizer model drafts up to `draft_count` rewrites of the version behind `alias` (default "production"), then every rewrite and that baseline run over the dataset on each of `models`, and `judge_model` scores every answer. Returns the run id as soon as the run is queued \u2014 drafting and scoring take minutes, so poll get_optimize_report. Nothing is promoted automatically: a rewrite only ships when promote_optimize_candidate is called. The dataset\'s examples need `criteria`, or the judge has nothing to grade against. Every model named here must be registered in the gateway (see list_models).',
884
+ description: 'Ask the optimizer to improve a prompt against a dataset. An optimizer model drafts `draft_count` rewrites of the version behind `alias` (default "production"), then every rewrite and that baseline run over the dataset on each of `models`, and `judge_model` scores every answer. Returns the run id as soon as the run is queued \u2014 drafting and scoring take minutes, so poll get_optimize_report. Nothing is promoted automatically: a rewrite only ships when promote_optimize_candidate is called. The dataset\'s examples need `criteria`, or the built-in judge has nothing to grade against. `judge_prompt` grades with one of your prompts instead, and the optimizer reads it too, so the rewrites aim at that rubric. Every model named here must be registered in the gateway (see list_models).',
877
885
  inputSchema: {
878
886
  prompt: import_zod2.z.string().min(1).describe("Prompt name or UUID to improve."),
879
887
  dataset_id: import_zod2.z.string().uuid().describe("Dataset whose examples the rewrites are scored on."),
@@ -882,7 +890,10 @@ var evaluationTools = [
882
890
  optimizer_model: import_zod2.z.string().min(1).optional().describe("Gateway model that writes the rewrites. Default: the first entry of `models`."),
883
891
  draft_count: import_zod2.z.number().int().min(1).max(6).optional().describe("How many rewrites to draft, 1 to 6. Default 3."),
884
892
  alias: import_zod2.z.string().min(1).optional().describe('Alias whose version is the baseline to beat. Default "production".'),
885
- optimizer_prompt: import_zod2.z.string().optional().describe("Name or UUID of a team prompt to use as the optimizer's instructions.")
893
+ optimizer_prompt: import_zod2.z.string().optional().describe("Name or UUID of a team prompt to use as the optimizer's instructions."),
894
+ judge_prompt: import_zod2.z.string().min(1).optional().describe(
895
+ "Name or UUID of a team prompt that grades instead of the built-in judge. The run uses its production version (else its latest). Default: the built-in judge."
896
+ )
886
897
  },
887
898
  async handler(args, { client, config }) {
888
899
  const promptId = await resolvePromptRef(client, args.prompt);
@@ -897,6 +908,9 @@ var evaluationTools = [
897
908
  if (args.optimizer_prompt !== void 0) {
898
909
  body.optimizer_prompt_id = await resolvePromptRef(client, args.optimizer_prompt);
899
910
  }
911
+ if (args.judge_prompt !== void 0) {
912
+ body.judge_prompt_id = await resolvePromptRef(client, args.judge_prompt);
913
+ }
900
914
  const result = await client.post(`/prompts/${promptId}/optimize`, body);
901
915
  const warning = result.prompt_mismatch_warning ? " Warning: some dataset examples were built from a different prompt \u2014 see prompt_mismatch_warning." : "";
902
916
  return okResult(
@@ -965,12 +979,17 @@ var evaluationTools = [
965
979
  });
966
980
  const best = bestCandidate(candidates);
967
981
  const winners = candidates.filter((candidate) => candidate.beatsBaseline).length;
968
- const summary = best ? `Optimize run ${run_id} succeeded. ${winners} of ${candidates.length} rewrite(s) beat the baseline. Recommended: ${best.label} (candidate_id ${best.candidateId}), ` + best.scores.map((score) => `${formatDelta(score.scoreDelta)} on ${score.model}`).join(", ") + ". Promote it with promote_optimize_candidate only if the user agrees." : `Optimize run ${run_id} succeeded, but none of its ${candidates.length} rewrite(s) beat the baseline. Nothing is worth promoting; keep the current version.`;
982
+ const rejected = report?.optimizerRejections ?? [];
983
+ const rejectedNote = rejected.length > 0 ? ` ${rejected.length} more rewrite(s) were dropped before scoring: ${rejected.join(" | ")}.` : "";
984
+ const summary = (best ? `Optimize run ${run_id} succeeded. ${winners} of ${candidates.length} rewrite(s) beat the baseline. Recommended: ${best.label} (candidate_id ${best.candidateId}), ` + best.scores.map((score) => `${formatDelta(score.scoreDelta)} on ${score.model}`).join(", ") + ". Promote it with promote_optimize_candidate only if the user agrees." : `Optimize run ${run_id} succeeded, but none of its ${candidates.length} rewrite(s) beat the baseline. Nothing is worth promoting; keep the current version.`) + rejectedNote;
969
985
  const payload = {
970
986
  runId: run_id,
971
987
  status: run.status,
972
988
  judgeModel: report?.judge?.model ?? null,
989
+ // Null means the built-in judge graded the run.
990
+ judgePromptVersionId: report?.judge?.promptVersionId ?? null,
973
991
  recommended: best?.candidateId ?? null,
992
+ rejectedRewrites: rejected,
974
993
  baseline: (report?.cells ?? []).filter((cell) => cell.isProductionBaseline).map((cell) => ({
975
994
  label: cell.variantLabel,
976
995
  model: cell.model,
@@ -1595,7 +1614,7 @@ function selectTools(config) {
1595
1614
  }
1596
1615
 
1597
1616
  // src/server.ts
1598
- var SERVER_VERSION = "0.2.0";
1617
+ var SERVER_VERSION = "0.3.0";
1599
1618
  function buildInstructions(toolNames, readOnly) {
1600
1619
  const parts = [
1601
1620
  `AcruxCore is an LLM-ops platform: a prompt registry, a versioned tool catalog, an AI gateway, tracing, and evaluation.