@anuma/sdk 6.28.0 → 6.29.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.
@@ -32758,6 +32758,9 @@ function createDurableAutoExtractor(options) {
32758
32758
  };
32759
32759
  }
32760
32760
 
32761
+ // src/tools/confirmConstants.ts
32762
+ var CONFIRM_TOOL_NAME = "prompt_user_confirm";
32763
+
32761
32764
  // src/tools/appBuilderPrompt.ts
32762
32765
  var APP_BUILDER_PROMPT = `App Builder tools (create_file, patch_file, and the rest described below) are available this turn, but they are OPTIONAL \u2014 having them does not mean you should build anything.
32763
32766
 
@@ -33050,6 +33053,7 @@ function filterServerTools(serverTools, includeNames) {
33050
33053
  const includeSet = new Set(includeNames);
33051
33054
  return serverTools.filter((tool) => includeSet.has(tool.name));
33052
33055
  }
33056
+ var TOOL_SEARCH_TOOL_NAME = "tool_search_tool_regex";
33053
33057
  function resolveDeferredServerTools(allServerTools, serverToolsFilter, config) {
33054
33058
  const allowed = serverToolsFilter === void 0 || typeof serverToolsFilter === "function" ? allServerTools : filterServerTools(allServerTools, [...serverToolsFilter]);
33055
33059
  const excluded = new Set(config.excludeTools ?? []);
@@ -33286,22 +33290,61 @@ var BUILT_IN_TOOL_SETS = [
33286
33290
  },
33287
33291
  {
33288
33292
  // Server tools, so this set does its work through
33289
- // withActiveToolSetServerTools: once a restaurant tool has run, terse
33290
- // follow-ups ("okay", "same as before") keep the booking chain. Each tool
33291
- // still reaches a fresh booking request on its own description.
33293
+ // withActiveToolSetServerTools: once any restaurant tool has run, terse
33294
+ // follow-ups ("okay", "same as before", "cancel it") keep every restaurant
33295
+ // tool — discovery, booking and cancelling. Each tool still reaches a fresh
33296
+ // request on its own description.
33292
33297
  // Anchors are deliberately empty (like the client's Nearby set): the set
33293
33298
  // is only for stickiness, not a new way to activate on a prompt.
33294
33299
  // prompt_user_confirm is left out of members: autoFilterClientTools always
33295
33300
  // sends it, and as a member any unrelated confirmation would pin this set.
33296
33301
  name: "restaurant-booking",
33302
+ members: [
33303
+ "AnumaPaymentsMCP-anuma_find_restaurant",
33304
+ "AnumaPaymentsMCP-anuma_check_restaurant_availability",
33305
+ "AnumaPaymentsMCP-anuma_book_restaurant",
33306
+ "AnumaPaymentsMCP-anuma_list_reservations",
33307
+ "AnumaPaymentsMCP-anuma_cancel_reservation",
33308
+ "AnumaPaymentsMCP-anuma_discover_restaurants"
33309
+ ],
33310
+ anchors: []
33311
+ },
33312
+ {
33313
+ // What a confirmed booking card narrows the rest of the turn to (see
33314
+ // CONFIRMED_ACTION_TOOL_SETS): the booking chain only, without the
33315
+ // discovery and cancel tools that restaurant-booking keeps sticky.
33316
+ // Anchors are empty for the same reason as restaurant-cancel below.
33317
+ name: "restaurant-book",
33297
33318
  members: [
33298
33319
  "AnumaPaymentsMCP-anuma_find_restaurant",
33299
33320
  "AnumaPaymentsMCP-anuma_check_restaurant_availability",
33300
33321
  "AnumaPaymentsMCP-anuma_book_restaurant"
33301
33322
  ],
33302
33323
  anchors: []
33324
+ },
33325
+ {
33326
+ // What a confirmed cancel card narrows the rest of the turn to (see
33327
+ // CONFIRMED_ACTION_TOOL_SETS). Anchors are empty for the same reason as
33328
+ // restaurant-booking: anchors here are scored against client tools only,
33329
+ // so a server-tool anchor could never fire. The "cancel brings list"
33330
+ // edge on a fresh prompt is restaurant-cancel-lookup in
33331
+ // SERVER_TOOL_DEPENDENCY_SETS.
33332
+ name: "restaurant-cancel",
33333
+ members: [
33334
+ "AnumaPaymentsMCP-anuma_list_reservations",
33335
+ "AnumaPaymentsMCP-anuma_cancel_reservation"
33336
+ ],
33337
+ anchors: []
33303
33338
  }
33304
33339
  ];
33340
+ var CONFIRMED_ACTION_TOOL_SETS = /* @__PURE__ */ new Map([
33341
+ ["book_restaurant", "restaurant-book"],
33342
+ ["anuma_book_restaurant", "restaurant-book"],
33343
+ ["anumapaymentsmcp-anuma_book_restaurant", "restaurant-book"],
33344
+ ["cancel_reservation", "restaurant-cancel"],
33345
+ ["anuma_cancel_reservation", "restaurant-cancel"],
33346
+ ["anumapaymentsmcp-anuma_cancel_reservation", "restaurant-cancel"]
33347
+ ]);
33305
33348
  function expandToolSetsAdditive(matchedNames, availableNames, scores, toolSets, activeSetNames) {
33306
33349
  const result = new Set(matchedNames);
33307
33350
  for (const ts of toolSets) {
@@ -33440,6 +33483,16 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
33440
33483
  "OpenMeteoMCP-elevation"
33441
33484
  ],
33442
33485
  anchorMinSimilarity: 0.5
33486
+ },
33487
+ {
33488
+ // The cancel tool takes its resy_token and the other values only from a
33489
+ // live anuma_list_reservations result in the same turn, never from
33490
+ // memory, so the list tool must ride in whenever cancel is offered.
33491
+ // Members hold only the dependency, like openmeteo-geocode.
33492
+ name: "restaurant-cancel-lookup",
33493
+ members: ["AnumaPaymentsMCP-anuma_list_reservations"],
33494
+ anchors: ["AnumaPaymentsMCP-anuma_cancel_reservation"],
33495
+ anchorMinSimilarity: 0.5
33443
33496
  }
33444
33497
  ];
33445
33498
  var defaultServerToolsFilter = createServerToolsFilter({
@@ -37263,6 +37316,22 @@ function getToolName(tool) {
37263
37316
  if (typeof flatName === "string") return flatName;
37264
37317
  return void 0;
37265
37318
  }
37319
+ function toolsAfterConfirmation(apiTools, executionResults) {
37320
+ const members = /* @__PURE__ */ new Set();
37321
+ for (const r of executionResults) {
37322
+ if (r.name !== CONFIRM_TOOL_NAME) continue;
37323
+ const answer = r.result;
37324
+ if (answer?.confirmed !== true || typeof answer.action !== "string") continue;
37325
+ const setName = CONFIRMED_ACTION_TOOL_SETS.get(answer.action.trim().toLowerCase());
37326
+ const set = BUILT_IN_TOOL_SETS.find((s) => s.name === setName);
37327
+ for (const member of set?.members ?? []) members.add(member);
37328
+ }
37329
+ if (!apiTools.some((t) => members.has(getToolName(t) ?? ""))) return void 0;
37330
+ return apiTools.filter((t) => {
37331
+ const name = getToolName(t) ?? "";
37332
+ return members.has(name) || name === CONFIRM_TOOL_NAME || name === TOOL_SEARCH_TOOL_NAME;
37333
+ });
37334
+ }
37266
37335
  var STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
37267
37336
  var INFERENCE_ID_HEADER = "X-Inference-ID";
37268
37337
  var CONVERSATION_ID_HEADER = "X-Conversation-ID";
@@ -37948,6 +38017,19 @@ Executing tool: ${toolInfo}
37948
38017
  }
37949
38018
  }
37950
38019
  }
38020
+ if (apiTools) {
38021
+ const confirmedTools = toolsAfterConfirmation(apiTools, executionResults);
38022
+ if (confirmedTools) {
38023
+ const kept = new Set(confirmedTools.map(getToolName));
38024
+ if (typeof toolChoice === "string" && !kept.has(toolChoice) && apiTools.some((t) => getToolName(t) === toolChoice)) {
38025
+ toolChoice = "auto";
38026
+ }
38027
+ apiTools = confirmedTools;
38028
+ for (const [name] of executorMap) {
38029
+ if (!kept.has(name)) executorMap.delete(name);
38030
+ }
38031
+ }
38032
+ }
37951
38033
  if (onThinking) {
37952
38034
  const thinkingResults = executionResults.filter(
37953
38035
  (r) => !r.name || executorMap.get(r.name)?.skipContinuation !== true
@@ -31023,6 +31023,9 @@ function createDurableAutoExtractor(options) {
31023
31023
  };
31024
31024
  }
31025
31025
 
31026
+ // src/tools/confirmConstants.ts
31027
+ var CONFIRM_TOOL_NAME = "prompt_user_confirm";
31028
+
31026
31029
  // src/tools/appBuilderPrompt.ts
31027
31030
  var APP_BUILDER_PROMPT = `App Builder tools (create_file, patch_file, and the rest described below) are available this turn, but they are OPTIONAL \u2014 having them does not mean you should build anything.
31028
31031
 
@@ -31314,6 +31317,7 @@ function filterServerTools(serverTools, includeNames) {
31314
31317
  const includeSet = new Set(includeNames);
31315
31318
  return serverTools.filter((tool) => includeSet.has(tool.name));
31316
31319
  }
31320
+ var TOOL_SEARCH_TOOL_NAME = "tool_search_tool_regex";
31317
31321
  function resolveDeferredServerTools(allServerTools, serverToolsFilter, config) {
31318
31322
  const allowed = serverToolsFilter === void 0 || typeof serverToolsFilter === "function" ? allServerTools : filterServerTools(allServerTools, [...serverToolsFilter]);
31319
31323
  const excluded = new Set(config.excludeTools ?? []);
@@ -31550,22 +31554,61 @@ var BUILT_IN_TOOL_SETS = [
31550
31554
  },
31551
31555
  {
31552
31556
  // Server tools, so this set does its work through
31553
- // withActiveToolSetServerTools: once a restaurant tool has run, terse
31554
- // follow-ups ("okay", "same as before") keep the booking chain. Each tool
31555
- // still reaches a fresh booking request on its own description.
31557
+ // withActiveToolSetServerTools: once any restaurant tool has run, terse
31558
+ // follow-ups ("okay", "same as before", "cancel it") keep every restaurant
31559
+ // tool — discovery, booking and cancelling. Each tool still reaches a fresh
31560
+ // request on its own description.
31556
31561
  // Anchors are deliberately empty (like the client's Nearby set): the set
31557
31562
  // is only for stickiness, not a new way to activate on a prompt.
31558
31563
  // prompt_user_confirm is left out of members: autoFilterClientTools always
31559
31564
  // sends it, and as a member any unrelated confirmation would pin this set.
31560
31565
  name: "restaurant-booking",
31566
+ members: [
31567
+ "AnumaPaymentsMCP-anuma_find_restaurant",
31568
+ "AnumaPaymentsMCP-anuma_check_restaurant_availability",
31569
+ "AnumaPaymentsMCP-anuma_book_restaurant",
31570
+ "AnumaPaymentsMCP-anuma_list_reservations",
31571
+ "AnumaPaymentsMCP-anuma_cancel_reservation",
31572
+ "AnumaPaymentsMCP-anuma_discover_restaurants"
31573
+ ],
31574
+ anchors: []
31575
+ },
31576
+ {
31577
+ // What a confirmed booking card narrows the rest of the turn to (see
31578
+ // CONFIRMED_ACTION_TOOL_SETS): the booking chain only, without the
31579
+ // discovery and cancel tools that restaurant-booking keeps sticky.
31580
+ // Anchors are empty for the same reason as restaurant-cancel below.
31581
+ name: "restaurant-book",
31561
31582
  members: [
31562
31583
  "AnumaPaymentsMCP-anuma_find_restaurant",
31563
31584
  "AnumaPaymentsMCP-anuma_check_restaurant_availability",
31564
31585
  "AnumaPaymentsMCP-anuma_book_restaurant"
31565
31586
  ],
31566
31587
  anchors: []
31588
+ },
31589
+ {
31590
+ // What a confirmed cancel card narrows the rest of the turn to (see
31591
+ // CONFIRMED_ACTION_TOOL_SETS). Anchors are empty for the same reason as
31592
+ // restaurant-booking: anchors here are scored against client tools only,
31593
+ // so a server-tool anchor could never fire. The "cancel brings list"
31594
+ // edge on a fresh prompt is restaurant-cancel-lookup in
31595
+ // SERVER_TOOL_DEPENDENCY_SETS.
31596
+ name: "restaurant-cancel",
31597
+ members: [
31598
+ "AnumaPaymentsMCP-anuma_list_reservations",
31599
+ "AnumaPaymentsMCP-anuma_cancel_reservation"
31600
+ ],
31601
+ anchors: []
31567
31602
  }
31568
31603
  ];
31604
+ var CONFIRMED_ACTION_TOOL_SETS = /* @__PURE__ */ new Map([
31605
+ ["book_restaurant", "restaurant-book"],
31606
+ ["anuma_book_restaurant", "restaurant-book"],
31607
+ ["anumapaymentsmcp-anuma_book_restaurant", "restaurant-book"],
31608
+ ["cancel_reservation", "restaurant-cancel"],
31609
+ ["anuma_cancel_reservation", "restaurant-cancel"],
31610
+ ["anumapaymentsmcp-anuma_cancel_reservation", "restaurant-cancel"]
31611
+ ]);
31569
31612
  function expandToolSetsAdditive(matchedNames, availableNames, scores, toolSets, activeSetNames) {
31570
31613
  const result = new Set(matchedNames);
31571
31614
  for (const ts of toolSets) {
@@ -31704,6 +31747,16 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
31704
31747
  "OpenMeteoMCP-elevation"
31705
31748
  ],
31706
31749
  anchorMinSimilarity: 0.5
31750
+ },
31751
+ {
31752
+ // The cancel tool takes its resy_token and the other values only from a
31753
+ // live anuma_list_reservations result in the same turn, never from
31754
+ // memory, so the list tool must ride in whenever cancel is offered.
31755
+ // Members hold only the dependency, like openmeteo-geocode.
31756
+ name: "restaurant-cancel-lookup",
31757
+ members: ["AnumaPaymentsMCP-anuma_list_reservations"],
31758
+ anchors: ["AnumaPaymentsMCP-anuma_cancel_reservation"],
31759
+ anchorMinSimilarity: 0.5
31707
31760
  }
31708
31761
  ];
31709
31762
  var defaultServerToolsFilter = createServerToolsFilter({
@@ -35509,6 +35562,22 @@ function getToolName(tool) {
35509
35562
  if (typeof flatName === "string") return flatName;
35510
35563
  return void 0;
35511
35564
  }
35565
+ function toolsAfterConfirmation(apiTools, executionResults) {
35566
+ const members = /* @__PURE__ */ new Set();
35567
+ for (const r of executionResults) {
35568
+ if (r.name !== CONFIRM_TOOL_NAME) continue;
35569
+ const answer = r.result;
35570
+ if (answer?.confirmed !== true || typeof answer.action !== "string") continue;
35571
+ const setName = CONFIRMED_ACTION_TOOL_SETS.get(answer.action.trim().toLowerCase());
35572
+ const set = BUILT_IN_TOOL_SETS.find((s) => s.name === setName);
35573
+ for (const member of set?.members ?? []) members.add(member);
35574
+ }
35575
+ if (!apiTools.some((t) => members.has(getToolName(t) ?? ""))) return void 0;
35576
+ return apiTools.filter((t) => {
35577
+ const name = getToolName(t) ?? "";
35578
+ return members.has(name) || name === CONFIRM_TOOL_NAME || name === TOOL_SEARCH_TOOL_NAME;
35579
+ });
35580
+ }
35512
35581
  var STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
35513
35582
  var INFERENCE_ID_HEADER = "X-Inference-ID";
35514
35583
  var CONVERSATION_ID_HEADER = "X-Conversation-ID";
@@ -36194,6 +36263,19 @@ Executing tool: ${toolInfo}
36194
36263
  }
36195
36264
  }
36196
36265
  }
36266
+ if (apiTools) {
36267
+ const confirmedTools = toolsAfterConfirmation(apiTools, executionResults);
36268
+ if (confirmedTools) {
36269
+ const kept = new Set(confirmedTools.map(getToolName));
36270
+ if (typeof toolChoice === "string" && !kept.has(toolChoice) && apiTools.some((t) => getToolName(t) === toolChoice)) {
36271
+ toolChoice = "auto";
36272
+ }
36273
+ apiTools = confirmedTools;
36274
+ for (const [name] of executorMap) {
36275
+ if (!kept.has(name)) executorMap.delete(name);
36276
+ }
36277
+ }
36278
+ }
36197
36279
  if (onThinking) {
36198
36280
  const thinkingResults = executionResults.filter(
36199
36281
  (r) => !r.name || executorMap.get(r.name)?.skipContinuation !== true
@@ -847,7 +847,7 @@ var CONFIRM_TOOL_NAME = "prompt_user_confirm";
847
847
  function createConfirmTool(options) {
848
848
  return createInteractiveTool(options, {
849
849
  name: CONFIRM_TOOL_NAME,
850
- description: "Ask the user to approve a specific action before it happens. Use before anything that spends money or is hard to undo, such as booking a restaurant table or placing an order. List every parameter of the action, with the exact values you are about to use \u2014 the user approves what this card shows, and nothing else. Returns whether they confirmed. Do not use for ordinary yes/no questions; use prompt_user_choice for those.",
850
+ description: "Ask the user to approve a specific action before it happens. Use before anything that spends money or is hard to undo, such as booking or cancelling a restaurant table, or placing an order. List every parameter of the action, with the exact values you are about to use \u2014 the user approves what this card shows, and nothing else. Returns whether they confirmed. Do not use for ordinary yes/no questions; use prompt_user_choice for those.",
851
851
  parameters: {
852
852
  type: "object",
853
853
  properties: {
@@ -691,7 +691,7 @@ var CONFIRM_TOOL_NAME = "prompt_user_confirm";
691
691
  function createConfirmTool(options) {
692
692
  return createInteractiveTool(options, {
693
693
  name: CONFIRM_TOOL_NAME,
694
- description: "Ask the user to approve a specific action before it happens. Use before anything that spends money or is hard to undo, such as booking a restaurant table or placing an order. List every parameter of the action, with the exact values you are about to use \u2014 the user approves what this card shows, and nothing else. Returns whether they confirmed. Do not use for ordinary yes/no questions; use prompt_user_choice for those.",
694
+ description: "Ask the user to approve a specific action before it happens. Use before anything that spends money or is hard to undo, such as booking or cancelling a restaurant table, or placing an order. List every parameter of the action, with the exact values you are about to use \u2014 the user approves what this card shows, and nothing else. Returns whether they confirmed. Do not use for ordinary yes/no questions; use prompt_user_choice for those.",
695
695
  parameters: {
696
696
  type: "object",
697
697
  properties: {
@@ -1997,20 +1997,51 @@ var BUILT_IN_TOOL_SETS = [
1997
1997
  },
1998
1998
  {
1999
1999
  // Server tools, so this set does its work through
2000
- // withActiveToolSetServerTools: once a restaurant tool has run, terse
2001
- // follow-ups ("okay", "same as before") keep the booking chain. Each tool
2002
- // still reaches a fresh booking request on its own description.
2000
+ // withActiveToolSetServerTools: once any restaurant tool has run, terse
2001
+ // follow-ups ("okay", "same as before", "cancel it") keep every restaurant
2002
+ // tool — discovery, booking and cancelling. Each tool still reaches a fresh
2003
+ // request on its own description.
2003
2004
  // Anchors are deliberately empty (like the client's Nearby set): the set
2004
2005
  // is only for stickiness, not a new way to activate on a prompt.
2005
2006
  // prompt_user_confirm is left out of members: autoFilterClientTools always
2006
2007
  // sends it, and as a member any unrelated confirmation would pin this set.
2007
2008
  name: "restaurant-booking",
2009
+ members: [
2010
+ "AnumaPaymentsMCP-anuma_find_restaurant",
2011
+ "AnumaPaymentsMCP-anuma_check_restaurant_availability",
2012
+ "AnumaPaymentsMCP-anuma_book_restaurant",
2013
+ "AnumaPaymentsMCP-anuma_list_reservations",
2014
+ "AnumaPaymentsMCP-anuma_cancel_reservation",
2015
+ "AnumaPaymentsMCP-anuma_discover_restaurants"
2016
+ ],
2017
+ anchors: []
2018
+ },
2019
+ {
2020
+ // What a confirmed booking card narrows the rest of the turn to (see
2021
+ // CONFIRMED_ACTION_TOOL_SETS): the booking chain only, without the
2022
+ // discovery and cancel tools that restaurant-booking keeps sticky.
2023
+ // Anchors are empty for the same reason as restaurant-cancel below.
2024
+ name: "restaurant-book",
2008
2025
  members: [
2009
2026
  "AnumaPaymentsMCP-anuma_find_restaurant",
2010
2027
  "AnumaPaymentsMCP-anuma_check_restaurant_availability",
2011
2028
  "AnumaPaymentsMCP-anuma_book_restaurant"
2012
2029
  ],
2013
2030
  anchors: []
2031
+ },
2032
+ {
2033
+ // What a confirmed cancel card narrows the rest of the turn to (see
2034
+ // CONFIRMED_ACTION_TOOL_SETS). Anchors are empty for the same reason as
2035
+ // restaurant-booking: anchors here are scored against client tools only,
2036
+ // so a server-tool anchor could never fire. The "cancel brings list"
2037
+ // edge on a fresh prompt is restaurant-cancel-lookup in
2038
+ // SERVER_TOOL_DEPENDENCY_SETS.
2039
+ name: "restaurant-cancel",
2040
+ members: [
2041
+ "AnumaPaymentsMCP-anuma_list_reservations",
2042
+ "AnumaPaymentsMCP-anuma_cancel_reservation"
2043
+ ],
2044
+ anchors: []
2014
2045
  }
2015
2046
  ];
2016
2047
  function applyToolSets(matchedNames, availableNames, scores, toolSets = BUILT_IN_TOOL_SETS, independentThreshold = 0.65) {
@@ -2180,6 +2211,16 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
2180
2211
  "OpenMeteoMCP-elevation"
2181
2212
  ],
2182
2213
  anchorMinSimilarity: 0.5
2214
+ },
2215
+ {
2216
+ // The cancel tool takes its resy_token and the other values only from a
2217
+ // live anuma_list_reservations result in the same turn, never from
2218
+ // memory, so the list tool must ride in whenever cancel is offered.
2219
+ // Members hold only the dependency, like openmeteo-geocode.
2220
+ name: "restaurant-cancel-lookup",
2221
+ members: ["AnumaPaymentsMCP-anuma_list_reservations"],
2222
+ anchors: ["AnumaPaymentsMCP-anuma_cancel_reservation"],
2223
+ anchorMinSimilarity: 0.5
2183
2224
  }
2184
2225
  ];
2185
2226
  var defaultServerToolsFilter = createServerToolsFilter({
@@ -1875,20 +1875,51 @@ var BUILT_IN_TOOL_SETS = [
1875
1875
  },
1876
1876
  {
1877
1877
  // Server tools, so this set does its work through
1878
- // withActiveToolSetServerTools: once a restaurant tool has run, terse
1879
- // follow-ups ("okay", "same as before") keep the booking chain. Each tool
1880
- // still reaches a fresh booking request on its own description.
1878
+ // withActiveToolSetServerTools: once any restaurant tool has run, terse
1879
+ // follow-ups ("okay", "same as before", "cancel it") keep every restaurant
1880
+ // tool — discovery, booking and cancelling. Each tool still reaches a fresh
1881
+ // request on its own description.
1881
1882
  // Anchors are deliberately empty (like the client's Nearby set): the set
1882
1883
  // is only for stickiness, not a new way to activate on a prompt.
1883
1884
  // prompt_user_confirm is left out of members: autoFilterClientTools always
1884
1885
  // sends it, and as a member any unrelated confirmation would pin this set.
1885
1886
  name: "restaurant-booking",
1887
+ members: [
1888
+ "AnumaPaymentsMCP-anuma_find_restaurant",
1889
+ "AnumaPaymentsMCP-anuma_check_restaurant_availability",
1890
+ "AnumaPaymentsMCP-anuma_book_restaurant",
1891
+ "AnumaPaymentsMCP-anuma_list_reservations",
1892
+ "AnumaPaymentsMCP-anuma_cancel_reservation",
1893
+ "AnumaPaymentsMCP-anuma_discover_restaurants"
1894
+ ],
1895
+ anchors: []
1896
+ },
1897
+ {
1898
+ // What a confirmed booking card narrows the rest of the turn to (see
1899
+ // CONFIRMED_ACTION_TOOL_SETS): the booking chain only, without the
1900
+ // discovery and cancel tools that restaurant-booking keeps sticky.
1901
+ // Anchors are empty for the same reason as restaurant-cancel below.
1902
+ name: "restaurant-book",
1886
1903
  members: [
1887
1904
  "AnumaPaymentsMCP-anuma_find_restaurant",
1888
1905
  "AnumaPaymentsMCP-anuma_check_restaurant_availability",
1889
1906
  "AnumaPaymentsMCP-anuma_book_restaurant"
1890
1907
  ],
1891
1908
  anchors: []
1909
+ },
1910
+ {
1911
+ // What a confirmed cancel card narrows the rest of the turn to (see
1912
+ // CONFIRMED_ACTION_TOOL_SETS). Anchors are empty for the same reason as
1913
+ // restaurant-booking: anchors here are scored against client tools only,
1914
+ // so a server-tool anchor could never fire. The "cancel brings list"
1915
+ // edge on a fresh prompt is restaurant-cancel-lookup in
1916
+ // SERVER_TOOL_DEPENDENCY_SETS.
1917
+ name: "restaurant-cancel",
1918
+ members: [
1919
+ "AnumaPaymentsMCP-anuma_list_reservations",
1920
+ "AnumaPaymentsMCP-anuma_cancel_reservation"
1921
+ ],
1922
+ anchors: []
1892
1923
  }
1893
1924
  ];
1894
1925
  function applyToolSets(matchedNames, availableNames, scores, toolSets = BUILT_IN_TOOL_SETS, independentThreshold = 0.65) {
@@ -2058,6 +2089,16 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
2058
2089
  "OpenMeteoMCP-elevation"
2059
2090
  ],
2060
2091
  anchorMinSimilarity: 0.5
2092
+ },
2093
+ {
2094
+ // The cancel tool takes its resy_token and the other values only from a
2095
+ // live anuma_list_reservations result in the same turn, never from
2096
+ // memory, so the list tool must ride in whenever cancel is offered.
2097
+ // Members hold only the dependency, like openmeteo-geocode.
2098
+ name: "restaurant-cancel-lookup",
2099
+ members: ["AnumaPaymentsMCP-anuma_list_reservations"],
2100
+ anchors: ["AnumaPaymentsMCP-anuma_cancel_reservation"],
2101
+ anchorMinSimilarity: 0.5
2061
2102
  }
2062
2103
  ];
2063
2104
  var defaultServerToolsFilter = createServerToolsFilter({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "6.28.0",
3
+ "version": "6.29.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",