@theokit/sdk-tools 0.6.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5bd2f9c: @theokit/sdk: `shouldCompact`/`ShouldCompactInput` gains an optional `maxOutput` output-reserve term (`estimated >= contextWindow - buffer - (maxOutput ?? 0)`), defaulting to today's behavior. `AgentOptions.plugins` now also accepts an array of code `Plugin` objects (matching the runtime + docs), not only `{ enabled }`. @theokit/sdk-tools: `renderToolList` gains an optional `{ mode: "full" | "summary" | "names" }` — `"full"` (default) is the existing `<tools>` XML; `"summary"` renders `- name: <first sentence>`; `"names"` renders `- name`.
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -981,7 +981,18 @@ function withDescription(tool, description) {
981
981
  function esc(s) {
982
982
  return String(s).replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
983
983
  }
984
- function renderToolList(tools) {
984
+ function firstSentence(d) {
985
+ const m = d.trim().match(/\.\s+(?=[A-Z(]|$)/);
986
+ return m?.index == null ? d.trim() : d.trim().slice(0, m.index + 1);
987
+ }
988
+ function renderToolList(tools, options) {
989
+ const mode = options?.mode ?? "full";
990
+ if (mode === "summary") {
991
+ return tools.map((t) => `- ${t.name}: ${firstSentence(t.description)}`).join("\n");
992
+ }
993
+ if (mode === "names") {
994
+ return tools.map((t) => `- ${t.name}`).join("\n");
995
+ }
985
996
  if (tools.length === 0) return "<tools></tools>";
986
997
  const lines = ["<tools>"];
987
998
  for (const t of tools) {