@anuma/sdk 6.33.0 → 6.33.2

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 (45) hide show
  1. package/dist/design/index.cjs +0 -2
  2. package/dist/design/index.d.mts +0 -7
  3. package/dist/design/index.d.ts +0 -7
  4. package/dist/design/index.mjs +0 -2
  5. package/dist/expo/{chunk-XD6WOQ5I.mjs → chunk-GQBTAM6Y.mjs} +0 -70
  6. package/dist/expo/{consolidate-7DBUHQRK.mjs → consolidate-3H2WY3FU.mjs} +1 -8
  7. package/dist/expo/index.cjs +15401 -16279
  8. package/dist/expo/index.d.mts +5735 -6661
  9. package/dist/expo/index.d.ts +5735 -6661
  10. package/dist/expo/index.mjs +15238 -16035
  11. package/dist/index.cjs +2258 -2411
  12. package/dist/index.d.mts +914 -1054
  13. package/dist/index.d.ts +914 -1054
  14. package/dist/index.mjs +2258 -2409
  15. package/dist/memory/context.d.mts +0 -73
  16. package/dist/memory/context.d.ts +0 -73
  17. package/dist/next/index.cjs +1 -8
  18. package/dist/next/index.mjs +1 -8
  19. package/dist/pii/transformers.d.mts +0 -32
  20. package/dist/pii/transformers.d.ts +0 -32
  21. package/dist/react/{chunk-XNQRJBIH.mjs → chunk-UFO4W3JX.mjs} +0 -70
  22. package/dist/react/{consolidate-5DVINCUE.mjs → consolidate-RHIAUBT4.mjs} +1 -8
  23. package/dist/react/index.cjs +32429 -33403
  24. package/dist/react/index.d.mts +13355 -14554
  25. package/dist/react/index.d.ts +13355 -14554
  26. package/dist/react/index.mjs +32555 -33450
  27. package/dist/server/{chunk-KSYV7UO2.mjs → chunk-4RGGAOAJ.mjs} +835 -905
  28. package/dist/server/{consolidate-MCNBSUXD.mjs → consolidate-YEGACWLR.mjs} +1 -8
  29. package/dist/server/index.cjs +22308 -23109
  30. package/dist/server/index.d.mts +5355 -6302
  31. package/dist/server/index.d.ts +5355 -6302
  32. package/dist/server/index.mjs +20543 -21279
  33. package/dist/telemetry/index.cjs +0 -9
  34. package/dist/telemetry/index.d.mts +88 -198
  35. package/dist/telemetry/index.d.ts +88 -198
  36. package/dist/telemetry/index.mjs +0 -9
  37. package/dist/tools/index.cjs +13036 -13347
  38. package/dist/tools/index.d.mts +2434 -2729
  39. package/dist/tools/index.d.ts +2434 -2729
  40. package/dist/tools/index.mjs +13036 -13347
  41. package/dist/tools/selection/index.cjs +0 -116
  42. package/dist/tools/selection/index.d.mts +0 -159
  43. package/dist/tools/selection/index.d.ts +0 -159
  44. package/dist/tools/selection/index.mjs +0 -116
  45. package/package.json +1 -1
@@ -1025,8 +1025,6 @@ async function embedOne(text, options, outer) {
1025
1025
  (signal) => postApiV1Embeddings({
1026
1026
  baseUrl,
1027
1027
  body: {
1028
- // Mask PII from the request body only — the cache above still keys on
1029
- // the original `text`, so callers keep their original values.
1030
1028
  input: options.maskInput ? options.maskInput(text) : text,
1031
1029
  model: model ?? DEFAULT_API_EMBEDDING_MODEL
1032
1030
  },
@@ -1065,7 +1063,6 @@ async function generateEmbeddingsBatch(texts, headers, baseUrl, model, onUsage,
1065
1063
  () => withDeadline(
1066
1064
  (signal) => postApiV1Embeddings({
1067
1065
  baseUrl,
1068
- // Mask PII from the request body only; cache/order still key on originals.
1069
1066
  body: { input: maskInput ? texts.map(maskInput) : texts, model },
1070
1067
  headers,
1071
1068
  ...signal && { signal }
@@ -1668,9 +1665,7 @@ function clientToolToResponsesFormat(tool) {
1668
1665
  type: "function",
1669
1666
  name: func.name,
1670
1667
  description: func.description,
1671
- // Handle both 'parameters' and 'arguments' field names
1672
1668
  parameters: func.parameters ?? func.arguments,
1673
- // Preserve executor functions for client-side execution
1674
1669
  ...toolConfig.executor && { executor: toolConfig.executor },
1675
1670
  ...toolConfig.skipContinuation !== void 0 && {
1676
1671
  skipContinuation: toolConfig.skipContinuation
@@ -1706,7 +1701,6 @@ function clientToolToCompletionsFormat(tool) {
1706
1701
  ...restFunc,
1707
1702
  parameters: args ?? { type: "object", properties: {} }
1708
1703
  },
1709
- // Preserve executor functions for client-side execution
1710
1704
  ...toolConfig.executor && { executor: toolConfig.executor },
1711
1705
  ...toolConfig.skipContinuation !== void 0 && {
1712
1706
  skipContinuation: toolConfig.skipContinuation
@@ -1869,17 +1863,7 @@ function scoreTools(promptEmbeddings, tools) {
1869
1863
  var BUILT_IN_TOOL_SETS = [
1870
1864
  {
1871
1865
  name: "app-generation",
1872
- // Appended to the base prompt (not replacing it) whenever this set
1873
- // activates, so the App Builder guidance — including the window.app.complete
1874
- // runtime-AI contract — rides in with the app-gen tools via the same
1875
- // semantic selection that includes them. Collected by toolSetSystemPrompts.
1876
1866
  systemPrompt: APP_BUILDER_PROMPT,
1877
- // Must stay in sync with APP_FILE_TOOL_NAMES in src/tools/appGeneration.ts.
1878
- // If a new app-gen tool ships there but isn't added here, semantic
1879
- // selection will exclude it on every request — the model literally
1880
- // doesn't see it. The quality tools (audit_design / critique_design /
1881
- // verify_app) are non-obvious to a user prompt ("build me a kanban")
1882
- // and rely entirely on set expansion to reach the model.
1883
1867
  members: [
1884
1868
  "create_file",
1885
1869
  "patch_file",
@@ -1890,52 +1874,20 @@ var BUILT_IN_TOOL_SETS = [
1890
1874
  "critique_design",
1891
1875
  "verify_app"
1892
1876
  ],
1893
- // Anchors stay limited to the primary entry-point tools. Users phrase
1894
- // app intent as "build / make / fix" → semantic match on create_file
1895
- // or patch_file → full set pulled in. The quality tools fire later in
1896
- // the workflow and don't anchor on their own; including them as
1897
- // anchors would risk pulling the set in on unrelated "audit my code"
1898
- // prompts that have nothing to do with app generation.
1899
1877
  anchors: ["create_file", "patch_file"],
1900
- // 0.55: above the global filter floor (0.53) so a barely-relevant match
1901
- // can't pull in the whole toolkit, but no higher — and we tried higher.
1902
- // create_file scores chitchat ("what's up" ~0.56, "...about programming"
1903
- // ~0.57) in the SAME band as legitimate app-EDIT prompts: "Edit the app to
1904
- // change the background…" measured create_file 0.56 on one e2e run. Raising
1905
- // the floor to 0.575 to exclude the chitchat therefore also stripped the
1906
- // file tools from real edit requests — leaving the model unable to touch the
1907
- // app at all. The bands genuinely overlap; there is no clean cut. So we keep
1908
- // 0.55 (max recall) and rely on two safety nets instead: APP_BUILDER_PROMPT
1909
- // is conditional (it no-ops unless the user is actually asking for an app),
1910
- // and very short greetings ("hey") are filtered out earlier by the
1911
- // MIN_CONTENT_LENGTH_FOR_TOOLS length gate before embeddings even run.
1912
1878
  anchorMinSimilarity: 0.55
1913
1879
  },
1914
1880
  {
1915
1881
  name: "slides",
1916
1882
  members: ["plan_deck", "add_slide", "read_slides", "patch_slides"],
1917
1883
  anchors: ["plan_deck", "patch_slides"],
1918
- // Match the client-tool floor (0.53). Short colloquial prompts like
1919
- // "make me a powerpoint about X" score plan_deck around 0.535 — above
1920
- // the global floor but inside any anchor gap. plan_deck and patch_slides
1921
- // are specific enough names that 0.53 won't false-positive in practice.
1922
1884
  anchorMinSimilarity: 0.53
1923
1885
  },
1924
1886
  {
1925
1887
  name: "documents",
1926
- // Conditional rider (no-ops unless the user actually asks for a document),
1927
- // attached so the Document Builder guidance rides in with the document
1928
- // tools via the same semantic selection that includes them.
1929
1888
  systemPrompt: DOCUMENT_BUILDER_PROMPT,
1930
1889
  members: ["create_document", "read_document", "patch_document"],
1931
- // Entry-point tools anchor; read_document rides in via set expansion.
1932
1890
  anchors: ["create_document", "patch_document"],
1933
- // 0.53: match the client-tool floor. "draft me a contract", "write a cover
1934
- // letter", "make a memo" should pull the set in. Like app-gen's create_file,
1935
- // document intent ("write me X") overlaps generic chitchat in this band, so
1936
- // the same two safety nets apply: DOCUMENT_BUILDER_PROMPT is conditional and
1937
- // the MIN_CONTENT_LENGTH_FOR_TOOLS gate drops bare greetings before
1938
- // embeddings run. Tune empirically against the tool-selection parity suite.
1939
1891
  anchorMinSimilarity: 0.53
1940
1892
  },
1941
1893
  {
@@ -1944,11 +1896,6 @@ var BUILT_IN_TOOL_SETS = [
1944
1896
  anchors: ["github_api"],
1945
1897
  anchorMinSimilarity: 0.55
1946
1898
  },
1947
- // Connector sets (#587). Connector chat tools belong to no set, so per-message
1948
- // semantic filtering silently prunes them on vague prompts ("check my email").
1949
- // Grouping each connector's tools behind a search/action anchor keeps the
1950
- // whole connector reachable once any one of its tools matches. Mirrors github:
1951
- // no systemPrompt rider — per-set prompt guidance is a follow-up.
1952
1899
  {
1953
1900
  name: "gmail",
1954
1901
  members: [
@@ -2005,9 +1952,6 @@ var BUILT_IN_TOOL_SETS = [
2005
1952
  "slack_get_thread_replies",
2006
1953
  "slack_post_message"
2007
1954
  ],
2008
- // search is the primary entry point; list_channels also anchors so "what
2009
- // channels am I in" reaches the set without going through search. post_message
2010
- // anchors too so post-only prompts surface the write tool past the cutoff.
2011
1955
  anchors: ["slack_search_messages", "slack_list_channels", "slack_post_message"],
2012
1956
  anchorMinSimilarity: 0.53
2013
1957
  },
@@ -2018,15 +1962,6 @@ var BUILT_IN_TOOL_SETS = [
2018
1962
  anchorMinSimilarity: 0.53
2019
1963
  },
2020
1964
  {
2021
- // Server tools, so this set does its work through
2022
- // withActiveToolSetServerTools: once any restaurant tool has run, terse
2023
- // follow-ups ("okay", "same as before", "cancel it") keep every restaurant
2024
- // tool — discovery, booking and cancelling. Each tool still reaches a fresh
2025
- // request on its own description.
2026
- // Anchors are deliberately empty (like the client's Nearby set): the set
2027
- // is only for stickiness, not a new way to activate on a prompt.
2028
- // prompt_user_confirm is left out of members: autoFilterClientTools always
2029
- // sends it, and as a member any unrelated confirmation would pin this set.
2030
1965
  name: "restaurant-booking",
2031
1966
  members: [
2032
1967
  "AnumaPaymentsMCP-anuma_find_restaurant",
@@ -2039,10 +1974,6 @@ var BUILT_IN_TOOL_SETS = [
2039
1974
  anchors: []
2040
1975
  },
2041
1976
  {
2042
- // What a confirmed booking card narrows the rest of the turn to (see
2043
- // CONFIRMED_ACTION_TOOL_SETS): the booking chain only, without the
2044
- // discovery and cancel tools that restaurant-booking keeps sticky.
2045
- // Anchors are empty for the same reason as restaurant-cancel below.
2046
1977
  name: "restaurant-book",
2047
1978
  members: [
2048
1979
  "AnumaPaymentsMCP-anuma_find_restaurant",
@@ -2052,12 +1983,6 @@ var BUILT_IN_TOOL_SETS = [
2052
1983
  anchors: []
2053
1984
  },
2054
1985
  {
2055
- // What a confirmed cancel card narrows the rest of the turn to (see
2056
- // CONFIRMED_ACTION_TOOL_SETS). Anchors are empty for the same reason as
2057
- // restaurant-booking: anchors here are scored against client tools only,
2058
- // so a server-tool anchor could never fire. The "cancel brings list"
2059
- // edge on a fresh prompt is restaurant-cancel-lookup in
2060
- // SERVER_TOOL_DEPENDENCY_SETS.
2061
1986
  name: "restaurant-cancel",
2062
1987
  members: [
2063
1988
  "AnumaPaymentsMCP-anuma_list_reservations",
@@ -2181,11 +2106,6 @@ function createServerToolsFilter(options = {}) {
2181
2106
  var DEFAULT_EXCLUDED_SERVER_TOOLS = [
2182
2107
  "AnumaVisionMCP-anuma_analyze_image",
2183
2108
  "OpenMeteoMCP-weather_forecast",
2184
- // Same native-capability argument as the vision tool: modern models reason
2185
- // step-by-step natively (and reasoning-mode models do it structurally), so
2186
- // a server-side sequential-thinking tool is a redundant hop. Its broad
2187
- // description also embeds near virtually every prompt — observed live
2188
- // riding into news-search, scheduling, and chitchat requests.
2189
2109
  "AnumaSequentialThinkingMCP-sequentialthinking"
2190
2110
  ];
2191
2111
  var DEFAULT_SERVER_TOOLS_MATCH_OPTIONS = {
@@ -2194,10 +2114,6 @@ var DEFAULT_SERVER_TOOLS_MATCH_OPTIONS = {
2194
2114
  };
2195
2115
  var SERVER_TOOL_DEPENDENCY_SETS = [
2196
2116
  {
2197
- // search finds links; reading them is always the next step. The reader now
2198
- // lives on the search server — Jina's read_url / parallel_read_url were
2199
- // removed in favour of anuma_scrape_url, which takes a batch of URLs — so
2200
- // this edge deliberately spans two MCP servers.
2201
2117
  name: "web-research",
2202
2118
  members: [
2203
2119
  "AnumaJinaMCP-search_web",
@@ -2205,22 +2121,9 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
2205
2121
  "AnumaJinaMCP-parallel_search_web"
2206
2122
  ],
2207
2123
  anchors: ["AnumaJinaMCP-search_web"],
2208
- // Activation floor = the selection floor (0.5), not the 0.6 ToolSet
2209
- // default. A dependency edge has different semantics from a persona-style
2210
- // tool set: if the entry tool is plausibly offered at all, the chain must
2211
- // ride along — "Search the web for recent news…" scores search_web in the
2212
- // 0.5–0.6 band, and shipping search without read would dead-end the model.
2213
2124
  anchorMinSimilarity: 0.5
2214
2125
  },
2215
2126
  {
2216
- // Every OpenMeteo data tool requires latitude/longitude (verified in the
2217
- // catalog schemas), but users speak in place names — geocoding is the
2218
- // mandatory first hop. Members deliberately contain ONLY the dependency:
2219
- // the anchor that fired is already in the semantic matches, and pulling
2220
- // sibling data tools in would re-create vendor-suite over-inclusion.
2221
- // Excluded tools (e.g. weather_forecast under the default filter) can't
2222
- // anchor this set — createServerToolsFilter drops them before expansion —
2223
- // but the non-weather data tools still deliver geocoding when they match.
2224
2127
  name: "openmeteo-geocode",
2225
2128
  members: ["OpenMeteoMCP-geocoding"],
2226
2129
  anchors: [
@@ -2235,10 +2138,6 @@ var SERVER_TOOL_DEPENDENCY_SETS = [
2235
2138
  anchorMinSimilarity: 0.5
2236
2139
  },
2237
2140
  {
2238
- // The cancel tool takes its resy_token and the other values only from a
2239
- // live anuma_list_reservations result in the same turn, never from
2240
- // memory, so the list tool must ride in whenever cancel is offered.
2241
- // Members hold only the dependency, like openmeteo-geocode.
2242
2141
  name: "restaurant-cancel-lookup",
2243
2142
  members: ["AnumaPaymentsMCP-anuma_list_reservations"],
2244
2143
  anchors: ["AnumaPaymentsMCP-anuma_cancel_reservation"],
@@ -2445,11 +2344,6 @@ async function autoFilterClientTools(clientTools, promptEmbeddings, cache, embed
2445
2344
  limit: MAX_CLIENT_TOOLS_AFTER_FILTER,
2446
2345
  minSimilarity: CLIENT_TOOLS_MIN_SIMILARITY,
2447
2346
  filterAmbiguous: true,
2448
- // See CLIENT_TOOLS_RELEVANCE_RATIO: 0.75 admits the second intent of a
2449
- // multi-intent prompt (which lands ~75-80% of the dominant match), while
2450
- // still trimming the loose tail. The earlier 0.9 made a second intent
2451
- // structurally unselectable; the anchorMinSimilarity gates (0.53-0.55)
2452
- // remain the guard against borderline anchors activating a whole set.
2453
2347
  relevanceRatio: CLIENT_TOOLS_RELEVANCE_RATIO
2454
2348
  });
2455
2349
  const matchedNames = new Set(matches.map((m) => m.tool.name));
@@ -2478,12 +2372,10 @@ async function autoFilterClientTools(clientTools, promptEmbeddings, cache, embed
2478
2372
 
2479
2373
  // src/lib/tools/toolCatalog.ts
2480
2374
  var TOOL_CATALOG = {
2481
- // Gmail (src/tools/gmail.ts)
2482
2375
  gmail_search_messages: { label: "Search emails", provider: "gmail", connector: "Gmail" },
2483
2376
  gmail_get_message: { label: "Read an email", provider: "gmail", connector: "Gmail" },
2484
2377
  gmail_create_draft: { label: "Draft a reply", provider: "gmail", connector: "Gmail" },
2485
2378
  gmail_send_message: { label: "Send an email", provider: "gmail", connector: "Gmail" },
2486
- // Google Calendar (src/tools/googleCalendar.ts)
2487
2379
  google_calendar_list_events: {
2488
2380
  label: "Search calendar events",
2489
2381
  provider: "gcalendar",
@@ -2499,7 +2391,6 @@ var TOOL_CATALOG = {
2499
2391
  provider: "gcalendar",
2500
2392
  connector: "Calendar"
2501
2393
  },
2502
- // Google Drive (src/tools/googleDrive.ts)
2503
2394
  google_drive_search: { label: "Search files", provider: "gdrive", connector: "Drive" },
2504
2395
  google_drive_list_recent: { label: "List recent files", provider: "gdrive", connector: "Drive" },
2505
2396
  google_drive_get_content: { label: "Read file content", provider: "gdrive", connector: "Drive" },
@@ -2513,7 +2404,6 @@ var TOOL_CATALOG = {
2513
2404
  provider: "gdrive",
2514
2405
  connector: "Drive"
2515
2406
  },
2516
- // Notion (src/tools/notion.ts)
2517
2407
  "notion-search": { label: "Search", provider: "notion", connector: "Notion" },
2518
2408
  "notion-fetch": { label: "Read page", provider: "notion", connector: "Notion" },
2519
2409
  "notion-create-pages": { label: "Create page", provider: "notion", connector: "Notion" },
@@ -2534,17 +2424,14 @@ var TOOL_CATALOG = {
2534
2424
  connector: "Notion"
2535
2425
  },
2536
2426
  "notion-get-teams": { label: "List teamspaces", provider: "notion", connector: "Notion" },
2537
- // GitHub (src/tools/github.ts)
2538
2427
  github_api: { label: "Use GitHub", provider: "github", connector: "GitHub" },
2539
2428
  github_get_authenticated_user: {
2540
2429
  label: "Read GitHub profile",
2541
2430
  provider: "github",
2542
2431
  connector: "GitHub"
2543
2432
  },
2544
- // X / Twitter (src/tools/x.ts)
2545
2433
  x_get_me: { label: "Get my X profile", provider: "x", connector: "X" },
2546
2434
  x_get_my_posts: { label: "Read my recent posts", provider: "x", connector: "X" },
2547
- // Dropbox (src/tools/dropbox.ts)
2548
2435
  dropbox_list_folders: { label: "List files", provider: "dropbox", connector: "Dropbox" },
2549
2436
  dropbox_get_file_content: {
2550
2437
  label: "Read file content",
@@ -2552,7 +2439,6 @@ var TOOL_CATALOG = {
2552
2439
  connector: "Dropbox"
2553
2440
  },
2554
2441
  dropbox_search: { label: "Search files", provider: "dropbox", connector: "Dropbox" },
2555
- // Slack (src/tools/slack.ts)
2556
2442
  slack_get_me: { label: "Get my Slack profile", provider: "slack", connector: "Slack" },
2557
2443
  slack_list_channels: { label: "List channels", provider: "slack", connector: "Slack" },
2558
2444
  slack_list_dms: { label: "List direct messages", provider: "slack", connector: "Slack" },
@@ -2723,8 +2609,6 @@ var CREATION_INTENT_CLIENT_FACTORIES = {
2723
2609
  document: FULL_GENERATIVE_CLIENT_FACTORIES,
2724
2610
  "web-search": FULL_GENERATIVE_CLIENT_FACTORIES,
2725
2611
  "deep-research": FULL_GENERATIVE_CLIENT_FACTORIES,
2726
- // Builder modes: restrict to their own toolkit; a `saved` toolkit rides
2727
- // along on app builds (parity with web's app branch).
2728
2612
  app: ["app", "saved"],
2729
2613
  slides: ["slides"]
2730
2614
  };
@@ -77,13 +77,6 @@ type ToolConfig = LlmapiChatCompletionTool & {
77
77
  dependsOn?: string[];
78
78
  };
79
79
 
80
- /**
81
- * Server-side tools caching module
82
- *
83
- * Fetches and caches tools from /api/v1/tools endpoint
84
- * with configurable expiration and localStorage persistence.
85
- */
86
-
87
80
  /** Tool parameters schema */
88
81
  interface ToolParameters {
89
82
  properties: Record<string, unknown>;
@@ -808,23 +801,6 @@ interface SelectServerSideToolsOptions {
808
801
  */
809
802
  declare function selectServerSideTools(options: SelectServerSideToolsOptions): Promise<Array<Record<string, unknown>>>;
810
803
 
811
- /**
812
- * Client-tool selection — the per-turn semantic filter over a client-tool
813
- * catalog.
814
- *
815
- * Extracted out of `../../react/useChatStorage` (a `"use client"` React +
816
- * WatermelonDB file) so the identical selection can run anywhere the engine
817
- * runs: the standalone council path that bypasses the hook, Node unit tests,
818
- * and the node/RN-safe `@anuma/sdk/tools/selection` subpath. The hook re-imports
819
- * these — behavior is unchanged from when they lived inline.
820
- *
821
- * Dependency-safe by construction: `generateEmbeddings` comes from the db-free
822
- * `../memoryEngine/generate` core, `RECALL_TOOL_NAME` from the
823
- * dependency-free `../memory/recallConstants`, and `CONFIRM_TOOL_NAME` from the
824
- * dependency-free `../../tools/confirmConstants`, so nothing here drags in the
825
- * WatermelonDB data layer.
826
- */
827
-
828
804
  /** Typed accessor for client tool name (handles function-call style and flat). */
829
805
  declare function getToolName(t: LlmapiChatCompletionTool): string;
830
806
  /** Typed accessor for client tool description. */
@@ -868,35 +844,6 @@ noEmbeddingsReason?: "short-prompt" | "error"): Promise<{
868
844
  matchedSetNames: ReadonlySet<string>;
869
845
  }>;
870
846
 
871
- /**
872
- * Connector tool catalog + denied-tools system-prompt rider.
873
- *
874
- * Granular connector access works by ALLOW/DENY-ing individual SDK tools.
875
- * Denying a tool means it's never handed to the model that turn, so it
876
- * physically can't be called — bypass-proof at the model layer.
877
- *
878
- * Consumer contract (this PR ships the foundation only — it does NOT wire
879
- * anything into runtime filtering or the client; those are later phases):
880
- *
881
- * 1. Hide the denied tools from the model — pass the denied tool names as
882
- * `createServerToolsFilter({ excludeTools })` so they're dropped from the
883
- * toolset before it reaches the LLM.
884
- * 2. Tell the user how to re-enable — append `buildDeniedToolsRider(denied)`
885
- * to the system prompt. Because the tool is absent, the model can't name
886
- * it on its own and would give a generic "I don't have access". The rider
887
- * gives it the specific capability names (grouped by connector) so it can
888
- * tell the user to re-enable that exact tool in Connected Apps settings.
889
- *
890
- * `TOOL_CATALOG` is the single source of truth for connector tool → friendly
891
- * label + provider. `provider` is the canonical logical-provider identifier the
892
- * portal and SDK already key on (matches `internal/oauth/providers.go` and the
893
- * `createConnectorTokenGetter` call sites) — Phase 2/3 use it to group and
894
- * persist per-tool denial. `connector` is the human-facing UI display string.
895
- * Consumers (portal, client) read this on a version bump rather than re-encoding
896
- * tool names. Labels are placeholders that will be refined later — keep them
897
- * sensible.
898
- */
899
-
900
847
  interface ToolCatalogEntry {
901
848
  label: string;
902
849
  /** Canonical logical-provider id (e.g. "gmail", "gcalendar", "gdrive"). */
@@ -956,22 +903,6 @@ interface ConnectorGuidance {
956
903
  */
957
904
  declare function buildConnectorGuidance(input: ConnectorGuidanceInput): ConnectorGuidance;
958
905
 
959
- /**
960
- * `deriveActiveToolSets` — event-shape-agnostic sticky tool-set derivation
961
- * (issue #702, Phase 4).
962
- *
963
- * Web derived sticky sets by scanning `ChatMessage[]` for two web-specific
964
- * signals: synthetic tool-result user messages (`Tool "<name>" returned: …`)
965
- * and `ActivityPhase.id`s shaped `server-tool-<name>-<n>`. This module keeps the
966
- * exact matching logic but keys on a neutral {@link ToolActivationEvent[]}, so
967
- * both apps feed it through a tiny adapter that maps their own message/activity
968
- * store to events. That closes the terse-follow-up gap on mobile: a 3-char
969
- * "yes" inside a slide conversation keeps the slide toolkit because the set
970
- * stays sticky.
971
- *
972
- * Pure and node/RN-safe.
973
- */
974
-
975
906
  /**
976
907
  * A neutral activation signal derived from conversation history.
977
908
  *
@@ -1004,26 +935,6 @@ declare function deriveActiveToolSets(events: ToolActivationEvent[], sets?: read
1004
935
  */
1005
936
  declare function mergeActiveToolSets(current: string[], derived: string[]): string[];
1006
937
 
1007
- /**
1008
- * Tool-selection vocabulary — the neutral, product-agnostic types that let the
1009
- * SDK own the "which tools this turn" orchestration both `apps/web` and
1010
- * `apps/mobile` previously hand-duplicated (see issue #702).
1011
- *
1012
- * The split of ownership is deliberate:
1013
- *
1014
- * - The SDK owns the neutral {@link CreationIntent}→client-factory mapping
1015
- * ({@link CREATION_INTENT_CLIENT_FACTORIES}) and the send-policy rules.
1016
- * - Each app owns its UI→{@link ToolIntentDescriptor} mapper and injects a
1017
- * {@link ServerToolCatalog} (built from its own static server-tool lists) and
1018
- * {@link ../assembleClientTools.ToolSelectionAdapters | adapters}. The SDK
1019
- * never imports the app's tool lists — the dependency direction stays
1020
- * app→SDK.
1021
- *
1022
- * This module has no runtime dependency on React, the DOM, WatermelonDB, or the
1023
- * generated HTTP client, so it is safe to import from the node/RN-safe
1024
- * `@anuma/sdk/tools/selection` subpath.
1025
- */
1026
-
1027
938
  /**
1028
939
  * Which orchestration path a turn runs through.
1029
940
  *
@@ -1223,27 +1134,6 @@ declare const CREATION_INTENT_CLIENT_FILTER: Record<CreationIntent, ClientToolsF
1223
1134
  */
1224
1135
  declare const CREATION_INTENT_TOOL_SET: Partial<Record<CreationIntent, string>>;
1225
1136
 
1226
- /**
1227
- * `assembleClientTools` — capability-gated client-tool assembly (issue #702,
1228
- * Phase 3). Given a resolved plan's `clientFactories` and a set of adapters, it
1229
- * instantiates only the factories whose adapter is present and concatenates
1230
- * them in a canonical order.
1231
- *
1232
- * The presence of an adapter GATES its factory — the generalization of
1233
- * `createDocumentTools` returning `[]` when `displayDocument` is absent
1234
- * (src/tools/document/index.ts). This is what lets ONE unified plan produce
1235
- * web's full toolkit and mobile's subset automatically: web wires every
1236
- * builder, mobile wires only the ones its RN surface supports, and the absent
1237
- * ones contribute nothing.
1238
- *
1239
- * The SDK deliberately owns the GATING, ORDER, and filter application — not the
1240
- * per-factory wiring. Each app's factory instantiation (slide auto-display,
1241
- * app-lineage tracking, RN-vs-web storage, logging instrumentation) is
1242
- * genuinely app-specific and stays app-side, expressed as a builder here.
1243
- *
1244
- * Pure and node/RN-safe.
1245
- */
1246
-
1247
1137
  /** Minimal logger the assembler uses when a builder throws. */
1248
1138
  interface SelectionLogger {
1249
1139
  warn(message: string, context?: unknown): void;
@@ -1300,18 +1190,6 @@ declare function filterAssembledClientTools<TTool = ToolConfig>(tools: TTool[],
1300
1190
  getName?: (t: TTool) => string;
1301
1191
  }): TTool[] | Promise<TTool[]>;
1302
1192
 
1303
- /**
1304
- * `resolvePlan` — the single source of truth for "which tools this turn"
1305
- * (issue #702, Phase 2). Given a neutral {@link ToolIntentDescriptor} and an
1306
- * app-injected {@link ServerToolCatalog}, it produces a fully-resolved
1307
- * {@link ToolPlanSpec} that both web and mobile consume, replacing each app's
1308
- * hand-written per-mode switch.
1309
- *
1310
- * Pure and node/RN-safe. The plan is data — the host feeds `clientFactories`
1311
- * into `assembleClientTools`, and `serverTools`/`toolChoice`/`maxToolRounds`/
1312
- * `thinkingMode` into its send layer.
1313
- */
1314
-
1315
1193
  /** Context for {@link resolvePlan}: the injected catalog plus host defaults. */
1316
1194
  interface ResolvePlanContext {
1317
1195
  /** The app-built per-intent/-lane server-tool catalog. */
@@ -1343,23 +1221,6 @@ interface ResolvePlanContext {
1343
1221
  */
1344
1222
  declare function resolvePlan(descriptor: ToolIntentDescriptor, ctx: ResolvePlanContext): ToolPlanSpec;
1345
1223
 
1346
- /**
1347
- * Council tool resolution (issue #702, Phase 6).
1348
- *
1349
- * The council path bypasses the per-mode chat switch: each worker sees the full
1350
- * semantic server-tool filter and its OWN per-worker memory tools (built from
1351
- * that worker's model so a private-capable model sees `['private','shared']`
1352
- * and a standard model sees `['shared']` only). The aggregation ("unify")
1353
- * worker must never persist — its `memory_vault_save` is dropped.
1354
- *
1355
- * This module composes each worker's client-tool candidate array and runs it
1356
- * through the SAME `autoFilterClientTools` the chat hook uses, so council and
1357
- * chat share one selection. Building this on the exported selector is what lets
1358
- * mobile council gain per-worker memory tools without re-implementing anything.
1359
- *
1360
- * Pure and node/RN-safe.
1361
- */
1362
-
1363
1224
  /**
1364
1225
  * Resolve the council/aggregation server-tool plan. This is the chat resolver's
1365
1226
  * council-lane path: a semantic server-tool filter, no per-mode client toolkit,
@@ -1414,16 +1275,6 @@ declare function selectCouncilClientTools<TTool extends LlmapiChatCompletionTool
1414
1275
  activatedSetNames?: ReadonlySet<string>;
1415
1276
  }>;
1416
1277
 
1417
- /**
1418
- * Send-policy primitives — the per-turn `tool_choice` / `maxToolRounds` /
1419
- * thinking-mode / coerced-memory-write rules, unified so web and mobile stop
1420
- * hand-duplicating them (issue #702, Phase 1).
1421
- *
1422
- * These were previously spread across web's `useChatSetup` + `useChatSubmitHandler`
1423
- * + `webChatSendMessage` and mobile's `chatModeRouting`. They are pure and
1424
- * node/RN-safe.
1425
- */
1426
-
1427
1278
  /** The vault-save tool name — the one client tool stripped on a coerced turn. */
1428
1279
  declare const MEMORY_SAVE_TOOL_NAME = "memory_vault_save";
1429
1280
  /**
@@ -1465,16 +1316,6 @@ declare function getThinkingMode(entry: ServerToolCatalogEntry | undefined, fall
1465
1316
  */
1466
1317
  declare function stripCoercedMemoryWrite<T extends LlmapiChatCompletionTool>(clientTools: T[], toolChoice: ToolChoice): T[];
1467
1318
 
1468
- /**
1469
- * Server-tools policy — resolve the concrete server-tools filter for a turn
1470
- * from the app-injected {@link ServerToolCatalog} (issue #702, Phase 2).
1471
- *
1472
- * The catalog is opaque to the SDK: each app builds it from its own static
1473
- * server-tool lists (`IMAGE_SERVER_TOOLS`, `SLIDE_SERVER_TOOLS`, …) and passes
1474
- * it in. This module only knows how to pick the right entry and, when the entry
1475
- * is an attachment-aware factory, apply it with the turn's context.
1476
- */
1477
-
1478
1319
  /**
1479
1320
  * Look up the catalog entry for a descriptor. Chat turns key on the creation
1480
1321
  * intent; council/aggregation turns key on the lane.