bitfab-cli 0.2.497 → 0.2.499

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.
Files changed (2) hide show
  1. package/dist/index.js +113 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30222,18 +30222,6 @@ function createBitfabToolHandlers(platform2, getConfig2, pluginVersion) {
30222
30222
  });
30223
30223
  };
30224
30224
  }
30225
- async function handleSaveExperiment(args) {
30226
- const { experimentId, name, notes, experimentGroupId } = args;
30227
- if (name === void 0 && notes === void 0 && experimentGroupId === void 0) {
30228
- return errorResult("Error saving experiment: provide name, notes, and/or experimentGroupId.");
30229
- }
30230
- return proxyToolCall("save_experiment", {
30231
- experimentId,
30232
- name,
30233
- notes,
30234
- experimentGroupId
30235
- });
30236
- }
30237
30225
  async function handleSaveExperimentGroup(args) {
30238
30226
  const { experimentGroupId, experimentIds, name, notes } = args;
30239
30227
  if (experimentGroupId === void 0 && experimentIds === void 0) {
@@ -30272,7 +30260,6 @@ function createBitfabToolHandlers(platform2, getConfig2, pluginVersion) {
30272
30260
  const specialHandlers = {
30273
30261
  [saveAgentVerdicts.name]: handleSaveAgentVerdictsAs(saveAgentVerdicts.name),
30274
30262
  [saveAgentLabels.name]: handleSaveAgentVerdictsAs(saveAgentLabels.name),
30275
- [saveExperiment.name]: handleSaveExperiment,
30276
30263
  [saveExperimentGroup.name]: handleSaveExperimentGroup,
30277
30264
  [saveScenario.name]: handleSaveScenario
30278
30265
  };
@@ -31139,10 +31126,10 @@ var semver2 = __toESM(require_semver2(), 1);
31139
31126
 
31140
31127
  // ../bitfab-plugin-lib/dist/bakedSdkVersions.js
31141
31128
  var BAKED_SDK_VERSIONS = {
31142
- typescript: "0.72.0",
31143
- python: "0.72.0",
31144
- ruby: "0.71.0",
31145
- go: "0.70.0"
31129
+ typescript: "0.72.1",
31130
+ python: "0.72.1",
31131
+ ruby: "0.71.1",
31132
+ go: "0.70.1"
31146
31133
  };
31147
31134
 
31148
31135
  // ../bitfab-plugin-lib/dist/installedSdk.js
@@ -46786,6 +46773,109 @@ var StdioServerTransport = class {
46786
46773
  }
46787
46774
  };
46788
46775
 
46776
+ // ../bitfab-lib/dist/deprecatedToolNames.js
46777
+ var DEPRECATED_TOOL_NAMES = {
46778
+ read_traces: "get_traces",
46779
+ read_trace_labels: "get_trace_verdicts",
46780
+ read_grader_labels: "get_grader_verdicts",
46781
+ read_span_field: "get_span_field",
46782
+ get_experiment_traces: "list_experiment_traces",
46783
+ update_template: "save_template",
46784
+ update_agent_labels: "save_agent_verdicts",
46785
+ set_human_labels: "save_human_verdicts",
46786
+ create_dataset: "save_dataset",
46787
+ add_grader_to_experiment_group: "add_graders_to_experiment_group"
46788
+ };
46789
+ function isRecord2(value) {
46790
+ return typeof value === "object" && value !== null && !Array.isArray(value);
46791
+ }
46792
+ function rewriteRenamedToolArguments(deprecatedName, args) {
46793
+ if (deprecatedName !== "add_grader_to_experiment_group" || !isRecord2(args)) {
46794
+ return args;
46795
+ }
46796
+ const { graderId, ...rest } = args;
46797
+ if (typeof graderId !== "string" || "graderIds" in rest) {
46798
+ return args;
46799
+ }
46800
+ return { ...rest, graderIds: [graderId] };
46801
+ }
46802
+ var DEPRECATED_ARGUMENT_NAMES = {
46803
+ search_traces: { testRunId: "experimentId" },
46804
+ save_agent_verdicts: { testRunId: "experimentId" },
46805
+ save_agent_labels: { testRunId: "experimentId" },
46806
+ rerun_graders_on_experiment: { testRunId: "experimentId" },
46807
+ add_graders_to_experiment: { testRunId: "experimentId" },
46808
+ remove_graders_from_experiment: { testRunId: "experimentId" },
46809
+ list_experiment_traces: { testRunId: "experimentId" },
46810
+ get_replay_status: { testRunId: "experimentId" },
46811
+ save_experiment_group: { testRunIds: "experimentIds" },
46812
+ save_experiment: { testRunId: "experimentId" },
46813
+ get_experiment: { testRunId: "experimentId" }
46814
+ };
46815
+ function rewriteArgumentNames(toolName, args) {
46816
+ const renames = DEPRECATED_ARGUMENT_NAMES[toolName];
46817
+ if (!renames || !isRecord2(args)) {
46818
+ return { args, deprecatedNames: [], changed: false };
46819
+ }
46820
+ const rewritten = { ...args };
46821
+ const deprecatedNames = [];
46822
+ let changed = false;
46823
+ for (const [deprecatedKey, currentKey] of Object.entries(renames)) {
46824
+ if (!(deprecatedKey in rewritten)) {
46825
+ continue;
46826
+ }
46827
+ changed = true;
46828
+ if (currentKey in rewritten) {
46829
+ delete rewritten[deprecatedKey];
46830
+ continue;
46831
+ }
46832
+ rewritten[currentKey] = rewritten[deprecatedKey];
46833
+ delete rewritten[deprecatedKey];
46834
+ deprecatedNames.push(`${toolName}.${deprecatedKey}`);
46835
+ }
46836
+ return changed ? { args: rewritten, deprecatedNames, changed } : { args, deprecatedNames, changed };
46837
+ }
46838
+ function rewriteMessage(message) {
46839
+ if (!isRecord2(message) || message.method !== "tools/call") {
46840
+ return { message, deprecatedNames: [], changed: false };
46841
+ }
46842
+ const params = message.params;
46843
+ if (!isRecord2(params) || typeof params.name !== "string") {
46844
+ return { message, deprecatedNames: [], changed: false };
46845
+ }
46846
+ const renamedTo = DEPRECATED_TOOL_NAMES[params.name];
46847
+ const currentName = renamedTo ?? params.name;
46848
+ const toolArgs = renamedTo ? rewriteRenamedToolArguments(params.name, params.arguments) : params.arguments;
46849
+ const argumentRewrite = rewriteArgumentNames(currentName, toolArgs);
46850
+ const deprecatedNames = [
46851
+ ...renamedTo ? [params.name] : [],
46852
+ ...argumentRewrite.deprecatedNames
46853
+ ];
46854
+ if (renamedTo === void 0 && !argumentRewrite.changed) {
46855
+ return { message, deprecatedNames, changed: false };
46856
+ }
46857
+ return {
46858
+ message: {
46859
+ ...message,
46860
+ params: {
46861
+ ...params,
46862
+ name: currentName,
46863
+ arguments: argumentRewrite.args
46864
+ }
46865
+ },
46866
+ deprecatedNames,
46867
+ changed: true
46868
+ };
46869
+ }
46870
+ function installDeprecatedToolCallRewrites(protocolServer) {
46871
+ const method = "tools/call";
46872
+ const originalHandler = protocolServer._requestHandlers.get(method);
46873
+ if (!originalHandler) {
46874
+ throw new Error("Cannot install deprecated tool call rewrites before tools register");
46875
+ }
46876
+ protocolServer._requestHandlers.set(method, (request, extra) => originalHandler(rewriteMessage(request).message, extra));
46877
+ }
46878
+
46789
46879
  // ../bitfab-plugin-lib/dist/mcpServer.js
46790
46880
  function createMcpServer(platform2, getConfig2, pluginVersion) {
46791
46881
  const { proxy, handlers } = createBitfabToolHandlers(platform2, getConfig2, pluginVersion);
@@ -46797,6 +46887,7 @@ function createMcpServer(platform2, getConfig2, pluginVersion) {
46797
46887
  server.registerTool(contract.name, toolConfig(contract), async (args) => handle(args));
46798
46888
  }
46799
46889
  installToolParameterWarnings(server.server, handlers.map(({ contract }) => contract), `Bitfab plugin ${pluginVersion}`);
46890
+ installDeprecatedToolCallRewrites(server.server);
46800
46891
  return { server, proxy };
46801
46892
  }
46802
46893
  async function startMcpServer(platform2, getConfig2, pluginVersion) {
@@ -49581,7 +49672,7 @@ var AUTO_APPROVED_TOOLS = /* @__PURE__ */ new Set([
49581
49672
  ).map((tool) => `mcp__Bitfab__${tool.name}`)
49582
49673
  ]);
49583
49674
  var OTHER_VALUE = "__bitfab_other__";
49584
- function isRecord2(value) {
49675
+ function isRecord3(value) {
49585
49676
  return typeof value === "object" && value !== null;
49586
49677
  }
49587
49678
  function parseQuestions(input2) {
@@ -49589,11 +49680,11 @@ function parseQuestions(input2) {
49589
49680
  return [];
49590
49681
  }
49591
49682
  return input2.questions.flatMap((candidate) => {
49592
- if (!isRecord2(candidate) || typeof candidate.question !== "string" || !Array.isArray(candidate.options)) {
49683
+ if (!isRecord3(candidate) || typeof candidate.question !== "string" || !Array.isArray(candidate.options)) {
49593
49684
  return [];
49594
49685
  }
49595
49686
  const options = candidate.options.flatMap((option) => {
49596
- if (!isRecord2(option) || typeof option.label !== "string") {
49687
+ if (!isRecord3(option) || typeof option.label !== "string") {
49597
49688
  return [];
49598
49689
  }
49599
49690
  return [
@@ -49785,7 +49876,7 @@ function createPreToolUseHook() {
49785
49876
  if (input2.hook_event_name !== "PreToolUse") {
49786
49877
  return { continue: true };
49787
49878
  }
49788
- const toolInput = isRecord2(input2.tool_input) ? input2.tool_input : {};
49879
+ const toolInput = isRecord3(input2.tool_input) ? input2.tool_input : {};
49789
49880
  if (input2.tool_name === "AskUserQuestion") {
49790
49881
  return { continue: true };
49791
49882
  }
@@ -49816,7 +49907,7 @@ function createPostToolUseHook(verification) {
49816
49907
  }
49817
49908
  verification.recordToolSuccess(
49818
49909
  input2.tool_name,
49819
- isRecord2(input2.tool_input) ? input2.tool_input : {},
49910
+ isRecord3(input2.tool_input) ? input2.tool_input : {},
49820
49911
  input2.tool_response
49821
49912
  );
49822
49913
  return { continue: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitfab-cli",
3
- "version": "0.2.497",
3
+ "version": "0.2.499",
4
4
  "description": "Install and configure the Bitfab plugin in Claude Code, Codex, or Cursor, or the Bitfab skill pack in Amp (Alpha).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",