@unclick/mcp-server 0.3.0 → 0.3.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 (130) hide show
  1. package/README.md +34 -13
  2. package/dist/abn-tool.js +1 -1
  3. package/dist/bgg-tool.js +1 -1
  4. package/dist/carboninterface-tool.js +1 -1
  5. package/dist/cards/card.d.ts +9 -0
  6. package/dist/cards/card.d.ts.map +1 -0
  7. package/dist/cards/card.js +4 -0
  8. package/dist/cards/card.js.map +1 -0
  9. package/dist/cards/search-memory-card.d.ts +11 -0
  10. package/dist/cards/search-memory-card.d.ts.map +1 -0
  11. package/dist/cards/search-memory-card.js +75 -0
  12. package/dist/cards/search-memory-card.js.map +1 -0
  13. package/dist/cards/search-memory-card.test.d.ts +2 -0
  14. package/dist/cards/search-memory-card.test.d.ts.map +1 -0
  15. package/dist/cards/search-memory-card.test.js +59 -0
  16. package/dist/cards/search-memory-card.test.js.map +1 -0
  17. package/dist/catalog.js +36 -36
  18. package/dist/catalog.js.map +1 -1
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +96 -6
  21. package/dist/client.js.map +1 -1
  22. package/dist/converter-tools.js +1 -1
  23. package/dist/crews-tool.d.ts +12 -0
  24. package/dist/crews-tool.d.ts.map +1 -0
  25. package/dist/crews-tool.js +125 -0
  26. package/dist/crews-tool.js.map +1 -0
  27. package/dist/gdelt-tool.js +4 -4
  28. package/dist/hackernews-tool.js +1 -1
  29. package/dist/line-tool.js +1 -1
  30. package/dist/local-catalog-handlers.js +1 -1
  31. package/dist/local-catalog-handlers.js.map +1 -1
  32. package/dist/local-tools.js +7 -7
  33. package/dist/local-tools.js.map +1 -1
  34. package/dist/memory/__tests__/bitemporal.test.d.ts +8 -0
  35. package/dist/memory/__tests__/bitemporal.test.d.ts.map +1 -0
  36. package/dist/memory/__tests__/bitemporal.test.js +148 -0
  37. package/dist/memory/__tests__/bitemporal.test.js.map +1 -0
  38. package/dist/memory/__tests__/hybrid-search.test.d.ts +14 -0
  39. package/dist/memory/__tests__/hybrid-search.test.d.ts.map +1 -0
  40. package/dist/memory/__tests__/hybrid-search.test.js +304 -0
  41. package/dist/memory/__tests__/hybrid-search.test.js.map +1 -0
  42. package/dist/memory/agent.d.ts +34 -0
  43. package/dist/memory/agent.d.ts.map +1 -0
  44. package/dist/memory/agent.js +69 -0
  45. package/dist/memory/agent.js.map +1 -0
  46. package/dist/memory/conflicts.d.ts +48 -0
  47. package/dist/memory/conflicts.d.ts.map +1 -0
  48. package/dist/memory/conflicts.js +209 -0
  49. package/dist/memory/conflicts.js.map +1 -0
  50. package/dist/memory/db.d.ts +18 -3
  51. package/dist/memory/db.d.ts.map +1 -1
  52. package/dist/memory/db.js +133 -11
  53. package/dist/memory/db.js.map +1 -1
  54. package/dist/memory/device.d.ts +20 -0
  55. package/dist/memory/device.d.ts.map +1 -0
  56. package/dist/memory/device.js +48 -0
  57. package/dist/memory/device.js.map +1 -0
  58. package/dist/memory/embeddings.d.ts +10 -0
  59. package/dist/memory/embeddings.d.ts.map +1 -0
  60. package/dist/memory/embeddings.js +40 -0
  61. package/dist/memory/embeddings.js.map +1 -0
  62. package/dist/memory/handlers.d.ts.map +1 -1
  63. package/dist/memory/handlers.js +98 -4
  64. package/dist/memory/handlers.js.map +1 -1
  65. package/dist/memory/instrumentation.d.ts +38 -0
  66. package/dist/memory/instrumentation.d.ts.map +1 -0
  67. package/dist/memory/instrumentation.js +97 -0
  68. package/dist/memory/instrumentation.js.map +1 -0
  69. package/dist/memory/load-events.d.ts +18 -0
  70. package/dist/memory/load-events.d.ts.map +1 -0
  71. package/dist/memory/load-events.js +61 -0
  72. package/dist/memory/load-events.js.map +1 -0
  73. package/dist/memory/local.d.ts +4 -1
  74. package/dist/memory/local.d.ts.map +1 -1
  75. package/dist/memory/local.js +14 -0
  76. package/dist/memory/local.js.map +1 -1
  77. package/dist/memory/session-state.d.ts +37 -0
  78. package/dist/memory/session-state.d.ts.map +1 -0
  79. package/dist/memory/session-state.js +82 -0
  80. package/dist/memory/session-state.js.map +1 -0
  81. package/dist/memory/supabase.d.ts +75 -5
  82. package/dist/memory/supabase.d.ts.map +1 -1
  83. package/dist/memory/supabase.js +584 -83
  84. package/dist/memory/supabase.js.map +1 -1
  85. package/dist/memory/tenant-settings.d.ts +33 -0
  86. package/dist/memory/tenant-settings.d.ts.map +1 -0
  87. package/dist/memory/tenant-settings.js +79 -0
  88. package/dist/memory/tenant-settings.js.map +1 -0
  89. package/dist/memory/tool-awareness.d.ts +66 -0
  90. package/dist/memory/tool-awareness.d.ts.map +1 -0
  91. package/dist/memory/tool-awareness.js +307 -0
  92. package/dist/memory/tool-awareness.js.map +1 -0
  93. package/dist/memory/types.d.ts +18 -2
  94. package/dist/memory/types.d.ts.map +1 -1
  95. package/dist/numbers-tool.js +2 -2
  96. package/dist/openfoodfacts-tool.js +1 -1
  97. package/dist/openmeteo-tool.js +1 -1
  98. package/dist/radiobrowser-tool.js +2 -2
  99. package/dist/server.d.ts.map +1 -1
  100. package/dist/server.js +779 -55
  101. package/dist/server.js.map +1 -1
  102. package/dist/signals/emit.d.ts +11 -0
  103. package/dist/signals/emit.d.ts.map +1 -0
  104. package/dist/signals/emit.js +26 -0
  105. package/dist/signals/emit.js.map +1 -0
  106. package/dist/testpass-tool.d.ts +12 -0
  107. package/dist/testpass-tool.d.ts.map +1 -0
  108. package/dist/testpass-tool.js +121 -0
  109. package/dist/testpass-tool.js.map +1 -0
  110. package/dist/tool-wiring.d.ts +320 -4
  111. package/dist/tool-wiring.d.ts.map +1 -1
  112. package/dist/tool-wiring.js +246 -5
  113. package/dist/tool-wiring.js.map +1 -1
  114. package/dist/trivia-tool.js +5 -5
  115. package/dist/usgs-tool.js +1 -1
  116. package/dist/uxpass-tool.d.ts +24 -0
  117. package/dist/uxpass-tool.d.ts.map +1 -0
  118. package/dist/uxpass-tool.js +165 -0
  119. package/dist/uxpass-tool.js.map +1 -0
  120. package/dist/vault-bridge.js +7 -7
  121. package/dist/vercel-tool.d.ts +3 -0
  122. package/dist/vercel-tool.d.ts.map +1 -1
  123. package/dist/vercel-tool.js +198 -7
  124. package/dist/vercel-tool.js.map +1 -1
  125. package/dist/web-tools.d.ts +62 -0
  126. package/dist/web-tools.d.ts.map +1 -0
  127. package/dist/web-tools.js +271 -0
  128. package/dist/web-tools.js.map +1 -0
  129. package/package.json +6 -3
  130. package/server.json +1 -1
package/README.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  **MCP server for the [UnClick](https://unclick.world) tool marketplace.**
4
4
 
5
- Lets any MCP-compatible AI agent (Claude, Cursor, etc.) discover and use every tool in the UnClick marketplace — URL shortening, QR codes, image processing, hashing, CSV/JSON, regex, cron, color utilities, key-value storage, and more.
5
+ One install gives any MCP-compatible AI agent (Claude, Cursor, etc.) access to:
6
+ - **450+ callable endpoints** across 60+ integrations (social, e-commerce, accounting, messaging, and more)
7
+ - **Persistent cross-session memory** — the agent remembers you across sessions, zero config
6
8
 
7
9
  ## Quick Start
8
10
 
9
- ### Claude Desktop
11
+ ### Claude Desktop / Claude Code
10
12
 
11
- Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
13
+ Add to your MCP config (Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json`, or run `claude mcp add` in Claude Code):
12
14
 
13
15
  ```json
14
16
  {
@@ -26,12 +28,34 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
26
28
 
27
29
  Get your API key at [unclick.world](https://unclick.world).
28
30
 
31
+ > **Install codes.** The `UNCLICK_API_KEY` can also be a short-lived install code like `unclick-ember-falcon-2847` (good for 24 hours). On first boot the server exchanges it for the real key and caches it at `~/.unclick/credentials.json`. This means install snippets shared in chat look like project slugs rather than credentials.
32
+
33
+ ### Cursor
34
+
35
+ Same config snippet as above — Cursor uses the same MCP format.
36
+
29
37
  ### Local / Development
30
38
 
31
39
  ```bash
32
40
  UNCLICK_API_KEY=unck_... npx @unclick/mcp-server
33
41
  ```
34
42
 
43
+ ## Memory (built in, zero config)
44
+
45
+ Memory works out of the box. No setup needed — data is stored as JSON files in `~/.unclick/memory/`.
46
+
47
+ **Want cross-machine sync?** Add Supabase env vars to your config:
48
+
49
+ ```json
50
+ "env": {
51
+ "UNCLICK_API_KEY": "your_api_key_here",
52
+ "SUPABASE_URL": "https://your-project.supabase.co",
53
+ "SUPABASE_SERVICE_ROLE_KEY": "your_service_role_key"
54
+ }
55
+ ```
56
+
57
+ Memory tools exposed at session level: `load_memory`, `save_session`, `save_fact`, `search_memory`, `save_identity`. Full 17 operations available via `unclick_call` with `endpoint_id: "memory.*"`. The prior names (`get_startup_context`, `write_session_summary`, `add_fact`, `set_business_context`) still work as backward-compatible aliases.
58
+
35
59
  ## Configuration
36
60
 
37
61
  | Environment Variable | Default | Description |
@@ -41,21 +65,18 @@ UNCLICK_API_KEY=unck_... npx @unclick/mcp-server
41
65
 
42
66
  ## Tools Exposed
43
67
 
44
- ### Discovery (Meta Tools)
45
-
46
- These tools let agents explore the full marketplace dynamically.
68
+ ### Discovery
47
69
 
48
70
  | Tool | Description |
49
71
  |---|---|
50
- | `unclick_search` | Search for tools by keyword. "I need to resize an image" returns the image tool with endpoints and schemas. |
51
- | `unclick_browse` | Browse all tools, optionally filtered by category (text, data, media, time, network, generation, storage). |
52
- | `unclick_tool_info` | Get full details on a specific tool: all endpoints, required params, and response shapes. |
53
- | `unclick_call` | Universal caller — specify any `endpoint_id` and `params`, the server routes the call. |
72
+ | `unclick_search` | Search for tools by keyword. "I need to resize an image" returns the image tool with endpoints and schemas. |
73
+
74
+ `unclick_browse`, `unclick_tool_info`, and `unclick_call` remain callable for backward compatibility but are hidden from the advertised tool list so end users are not shown internal machinery.
54
75
 
55
76
  **Discovery flow for an agent:**
56
- 1. `unclick_search` "what tool handles X?"
57
- 2. `unclick_tool_info` → "what are the exact params for that tool?"
58
- 3. `unclick_call` call it
77
+ 1. `unclick_search` to find relevant tools
78
+ 2. Inspect the returned endpoint schemas
79
+ 3. Invoke the matching endpoint via the raw call interface
59
80
 
60
81
  ### Direct Tools (Zero Friction)
61
82
 
package/dist/abn-tool.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Australian Business Registry (ABN Lookup) integration.
2
- // Uses the free ABR JSONP API no authentication required.
2
+ // Uses the free ABR JSONP API - no authentication required.
3
3
  // Base URL: https://abr.business.gov.au/json/
4
4
  const ABN_BASE = "https://abr.business.gov.au/json";
5
5
  // ─── JSONP helper ─────────────────────────────────────────────────────────────
package/dist/bgg-tool.js CHANGED
@@ -187,7 +187,7 @@ export async function bggUserCollection(args) {
187
187
  };
188
188
  }
189
189
  // ─── bgg_top_games ────────────────────────────────────────────────────────────
190
- // GET /hot?type=boardgame returns BGG's "Hotness" list (top 50)
190
+ // GET /hot?type=boardgame - returns BGG's "Hotness" list (top 50)
191
191
  export async function bggTopGames(args) {
192
192
  const limit = Math.min(Number(args.limit ?? 20), 50);
193
193
  const data = await bggFetch("/hot?type=boardgame");
@@ -34,7 +34,7 @@ export async function estimateFlightEmissions(args) {
34
34
  const legs = args.legs;
35
35
  const passengers = Number(args.passengers ?? 1);
36
36
  if (!Array.isArray(legs) || legs.length === 0) {
37
- throw new Error("legs is required array of { departure_airport, destination_airport } " +
37
+ throw new Error("legs is required - array of { departure_airport, destination_airport } " +
38
38
  "(IATA codes, e.g. [{departure_airport:'SFO', destination_airport:'LAX'}]).");
39
39
  }
40
40
  const mappedLegs = legs.map((leg) => {
@@ -0,0 +1,9 @@
1
+ export interface ConversationalCard {
2
+ headline: string;
3
+ summary: string;
4
+ keyFacts: string[];
5
+ nextActions: string[];
6
+ deepLink?: string;
7
+ }
8
+ export declare function buildCard(fields: ConversationalCard): ConversationalCard;
9
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/cards/card.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAExE"}
@@ -0,0 +1,4 @@
1
+ export function buildCard(fields) {
2
+ return fields;
3
+ }
4
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/cards/card.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,SAAS,CAAC,MAA0B;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Phase 1 example wrap. Builds a ConversationalCard summarising a
3
+ * search_memory result list. Only invoked when the caller opts in via
4
+ * include_card=true on search_memory; the legacy raw-array response is the
5
+ * default so existing agents keep working unchanged.
6
+ *
7
+ * Type imported from the new @unclick/wizard package (Phase 1 deliverable).
8
+ */
9
+ import type { ConversationalCard } from "@unclick/wizard";
10
+ export declare function buildSearchMemoryCard(query: string, results: unknown): ConversationalCard;
11
+ //# sourceMappingURL=search-memory-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-memory-card.d.ts","sourceRoot":"","sources":["../../src/cards/search-memory-card.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAqB1D,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,GACf,kBAAkB,CA6DpB"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Phase 1 example wrap. Builds a ConversationalCard summarising a
3
+ * search_memory result list. Only invoked when the caller opts in via
4
+ * include_card=true on search_memory; the legacy raw-array response is the
5
+ * default so existing agents keep working unchanged.
6
+ *
7
+ * Type imported from the new @unclick/wizard package (Phase 1 deliverable).
8
+ */
9
+ const MAX_PREVIEW_RESULTS = 5;
10
+ const MAX_PREVIEW_LENGTH = 140;
11
+ function rowText(row) {
12
+ const raw = row.fact ?? row.content ?? "";
13
+ const trimmed = raw.replace(/\s+/g, " ").trim();
14
+ if (trimmed.length <= MAX_PREVIEW_LENGTH)
15
+ return trimmed;
16
+ return `${trimmed.slice(0, MAX_PREVIEW_LENGTH - 1)}…`;
17
+ }
18
+ export function buildSearchMemoryCard(query, results) {
19
+ const rows = Array.isArray(results) ? results : [];
20
+ const total = rows.length;
21
+ const safeQuery = query.trim() || "(empty query)";
22
+ if (total === 0) {
23
+ return {
24
+ title: `No memories found for "${safeQuery}"`,
25
+ summary: "Memory was searched but nothing matched. Try a broader query or save a new fact if this is novel context.",
26
+ severity: "info",
27
+ followUps: [
28
+ { label: "Refine the search query and try again" },
29
+ {
30
+ label: "Save this as a new fact",
31
+ action: {
32
+ tool: "save_fact",
33
+ args: { fact: "", category: "general" },
34
+ confirmation: "confirm",
35
+ },
36
+ },
37
+ ],
38
+ meta: { tool: "search_memory", query: safeQuery, result_count: 0 },
39
+ };
40
+ }
41
+ const preview = rows.slice(0, MAX_PREVIEW_RESULTS).map(rowText).filter(Boolean);
42
+ const shownCount = preview.length;
43
+ const hiddenCount = Math.max(0, total - shownCount);
44
+ return {
45
+ title: `Found ${total} memor${total === 1 ? "y" : "ies"} matching "${safeQuery}"`,
46
+ summary: hiddenCount > 0
47
+ ? `Showing the top ${shownCount} of ${total}. The rest are in the raw results payload.`
48
+ : `Showing all ${total}.`,
49
+ severity: "success",
50
+ body: [
51
+ {
52
+ kind: "list",
53
+ heading: "Top matches",
54
+ items: preview,
55
+ },
56
+ ],
57
+ followUps: [
58
+ { label: "Refine the search query and try again" },
59
+ {
60
+ label: "Save a new fact related to this query",
61
+ action: {
62
+ tool: "save_fact",
63
+ args: { fact: "", category: "general" },
64
+ confirmation: "confirm",
65
+ },
66
+ },
67
+ ],
68
+ meta: {
69
+ tool: "search_memory",
70
+ query: safeQuery,
71
+ result_count: total,
72
+ },
73
+ };
74
+ }
75
+ //# sourceMappingURL=search-memory-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-memory-card.js","sourceRoot":"","sources":["../../src/cards/search-memory-card.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAW/B,SAAS,OAAO,CAAC,GAAkB;IACjC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB;QAAE,OAAO,OAAO,CAAC;IACzD,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,CAAC,GAAG,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,OAAgB;IAEhB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,eAAe,CAAC;IAElD,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO;YACL,KAAK,EAAE,0BAA0B,SAAS,GAAG;YAC7C,OAAO,EACL,2GAA2G;YAC7G,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE;gBACT,EAAE,KAAK,EAAE,uCAAuC,EAAE;gBAClD;oBACE,KAAK,EAAE,yBAAyB;o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Ae;YACrB,KAAK,EAAE,SAAS;YAChB,YAAY,EAAE,KAAK;SACpB;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=search-memory-card.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-memory-card.test.d.ts","sourceRoot":"","sources":["../../src/cards/search-memory-card.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { buildSearchMemoryCard } from "./search-memory-card.js";
3
+ describe("buildSearchMemoryCard - Phase 1 Wizard wrap", () => {
4
+ it("renders an empty-state card when no results match", () => {
5
+ const card = buildSearchMemoryCard("functional programming", []);
6
+ expect(card.title).toContain("No memories found");
7
+ expect(card.title).toContain("functional programming");
8
+ expect(card.severity).toBe("info");
9
+ expect(card.followUps?.length ?? 0).toBeGreaterThanOrEqual(2);
10
+ expect(card.meta?.result_count).toBe(0);
11
+ });
12
+ it("renders a results card with truncated previews when matches exist", () => {
13
+ const results = [
14
+ { id: "1", fact: "Chris prefers TypeScript over JavaScript", confidence: 0.95 },
15
+ { id: "2", fact: "Chris's timezone is Australia/Melbourne", confidence: 0.9 },
16
+ { id: "3", fact: "Bailey reviews and merges Phase 1 wizard PRs", confidence: 0.85 },
17
+ ];
18
+ const card = buildSearchMemoryCard("Chris", results);
19
+ expect(card.title).toBe('Found 3 memories matching "Chris"');
20
+ expect(card.severity).toBe("success");
21
+ expect(card.body?.[0]?.kind).toBe("list");
22
+ if (card.body?.[0]?.kind === "list") {
23
+ expect(card.body[0].items).toHaveLength(3);
24
+ expect(card.body[0].items[0]).toContain("TypeScript");
25
+ }
26
+ expect(card.meta?.result_count).toBe(3);
27
+ });
28
+ it("singular wording when exactly one match is returned", () => {
29
+ const card = buildSearchMemoryCard("timezone", [{ fact: "Australia/Melbourne" }]);
30
+ expect(card.title).toBe('Found 1 memory matching "timezone"');
31
+ });
32
+ it("truncates long fact previews to keep cards renderable", () => {
33
+ const longFact = "x".repeat(500);
34
+ const card = buildSearchMemoryCard("noisy", [{ fact: longFact }]);
35
+ if (card.body?.[0]?.kind === "list") {
36
+ expect(card.body[0].items[0].length).toBeLessThanOrEqual(140);
37
+ expect(card.body[0].items[0].endsWith("…")).toBe(true);
38
+ }
39
+ else {
40
+ throw new Error("expected list section");
41
+ }
42
+ });
43
+ it("caps the preview list at five entries even with more matches", () => {
44
+ const results = Array.from({ length: 12 }, (_, i) => ({ fact: `fact ${i}` }));
45
+ const card = buildSearchMemoryCard("many", results);
46
+ expect(card.title).toBe('Found 12 memories matching "many"');
47
+ expect(card.summary).toContain("Showing the top 5 of 12");
48
+ if (card.body?.[0]?.kind === "list") {
49
+ expect(card.body[0].items).toHaveLength(5);
50
+ }
51
+ });
52
+ it("includes a save_fact follow-up wired with confirmation", () => {
53
+ const card = buildSearchMemoryCard("anything", [{ fact: "x" }]);
54
+ const saveFollowUp = card.followUps?.find((f) => f.action?.tool === "save_fact");
55
+ expect(saveFollowUp).toBeDefined();
56
+ expect(saveFollowUp?.action?.confirmation).toBe("confirm");
57
+ });
58
+ });
59
+ //# sourceMappingURL=search-memory-card.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-memory-card.test.js","sourceRoot":"","sources":["../../src/cards/search-memory-card.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IAC3D,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,IAAI,GAAuB,qBAAqB,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACrF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,KAAK,C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ATALOG = [
652
652
  {
653
653
  id: "json.merge",
654
654
  name: "Deep Merge",
655
- description: "Deep-merge 210 JSON objects.",
655
+ description: "Deep-merge 2-10 JSON objects.",
656
656
  method: "POST",
657
657
  path: "/v1/json/merge",
658
658
  requiresAuth: true,
@@ -1143,7 +1143,7 @@ export const CATALOG = [
1143
1143
  {
1144
1144
  id: "color.mix",
1145
1145
  name: "Mix Colors",
1146
- description: "Blend two colors at a given weight (0.01.0).",
1146
+ description: "Blend two colors at a given weight (0.0-1.0).",
1147
1147
  method: "POST",
1148
1148
  path: "/v1/color/mix",
1149
1149
  requiresAuth: true,
@@ -1176,7 +1176,7 @@ export const CATALOG = [
1176
1176
  {
1177
1177
  id: "color.lighten",
1178
1178
  name: "Lighten",
1179
- description: "Increase a color's lightness by a percentage (0100).",
1179
+ description: "Increase a color's lightness by a percentage (0-100).",
1180
1180
  method: "POST",
1181
1181
  path: "/v1/color/lighten",
1182
1182
  requiresAuth: true,
@@ -1192,7 +1192,7 @@ export const CATALOG = [
1192
1192
  {
1193
1193
  id: "color.darken",
1194
1194
  name: "Darken",
1195
- description: "Decrease a color's lightness by a percentage (0100).",
1195
+ description: "Decrease a color's lightness by a percentage (0-100).",
1196
1196
  method: "POST",
1197
1197
  path: "/v1/color/darken",
1198
1198
  requiresAuth: true,
@@ -1853,7 +1853,7 @@ export const CATALOG = [
1853
1853
  ],
1854
1854
  },
1855
1855
  // ─── MEMORY (persistent cross-session memory) ────────────────────────
1856
- // Handled by the local memory module no HTTP call is made. The 5 most
1856
+ // Handled by the local memory module - no HTTP call is made. The 5 most
1857
1857
  // important tools (get_startup_context, write_session_summary, add_fact,
1858
1858
  // search_memory, set_business_context) are also registered as direct
1859
1859
  // MCP tools so agents discover the session protocol.
@@ -1866,8 +1866,8 @@ export const CATALOG = [
1866
1866
  endpoints: [
1867
1867
  {
1868
1868
  id: "memory.get_startup_context",
1869
- name: "Get Startup Context",
1870
- description: "Load business context, recent sessions, and hot facts. Call FIRST in every new session.",
1869
+ name: "Load Session Context",
1870
+ description: "Load Session Context - Loads business context, recent sessions, and hot facts. Call FIRST in every new session.",
1871
1871
  method: "POST",
1872
1872
  path: "/v1/memory/startup",
1873
1873
  requiresAuth: false,
@@ -1878,8 +1878,8 @@ export const CATALOG = [
1878
1878
  },
1879
1879
  {
1880
1880
  id: "memory.search_memory",
1881
- name: "Search Memory",
1882
- description: "Full-text search across conversation logs.",
1881
+ name: "Search Conversations",
1882
+ description: "Search Conversations - Full-text search across conversation logs.",
1883
1883
  method: "POST",
1884
1884
  path: "/v1/memory/search",
1885
1885
  requiresAuth: false,
@@ -1895,7 +1895,7 @@ export const CATALOG = [
1895
1895
  {
1896
1896
  id: "memory.search_facts",
1897
1897
  name: "Search Facts",
1898
- description: "Search active (non-superseded) extracted facts.",
1898
+ description: "Search Facts - Search active (non-superseded) extracted facts.",
1899
1899
  method: "POST",
1900
1900
  path: "/v1/memory/facts/search",
1901
1901
  requiresAuth: false,
@@ -1907,8 +1907,8 @@ export const CATALOG = [
1907
1907
  },
1908
1908
  {
1909
1909
  id: "memory.search_library",
1910
- name: "Search Library",
1911
- description: "Search versioned reference documents in the Knowledge Library.",
1910
+ name: "Search Knowledge Library",
1911
+ description: "Search Knowledge Library - Search versioned reference documents in the Knowledge Library.",
1912
1912
  method: "POST",
1913
1913
  path: "/v1/memory/library/search",
1914
1914
  requiresAuth: false,
@@ -1920,8 +1920,8 @@ export const CATALOG = [
1920
1920
  },
1921
1921
  {
1922
1922
  id: "memory.get_library_doc",
1923
- name: "Get Library Doc",
1924
- description: "Get the full content of a library doc by slug.",
1923
+ name: "Read Library Document",
1924
+ description: "Read Library Document - Get the full content of a library doc by slug.",
1925
1925
  method: "POST",
1926
1926
  path: "/v1/memory/library/get",
1927
1927
  requiresAuth: false,
@@ -1933,8 +1933,8 @@ export const CATALOG = [
1933
1933
  },
1934
1934
  {
1935
1935
  id: "memory.list_library",
1936
- name: "List Library",
1937
- description: "List all documents in the Knowledge Library.",
1936
+ name: "List Library Documents",
1937
+ description: "List Library Documents - List all documents in the Knowledge Library.",
1938
1938
  method: "POST",
1939
1939
  path: "/v1/memory/library/list",
1940
1940
  requiresAuth: false,
@@ -1942,8 +1942,8 @@ export const CATALOG = [
1942
1942
  },
1943
1943
  {
1944
1944
  id: "memory.write_session_summary",
1945
- name: "Write Session Summary",
1946
- description: "Save an end-of-session summary. Call BEFORE session ends.",
1945
+ name: "Save Session Summary",
1946
+ description: "Save Session Summary - Write an end-of-session summary. Call BEFORE session ends.",
1947
1947
  method: "POST",
1948
1948
  path: "/v1/memory/session/write",
1949
1949
  requiresAuth: false,
@@ -1963,8 +1963,8 @@ export const CATALOG = [
1963
1963
  },
1964
1964
  {
1965
1965
  id: "memory.add_fact",
1966
- name: "Add Fact",
1967
- description: "Add an atomic fact. One fact = one statement.",
1966
+ name: "Store New Fact",
1967
+ description: "Store New Fact - Add an atomic fact. One fact = one statement.",
1968
1968
  method: "POST",
1969
1969
  path: "/v1/memory/facts/add",
1970
1970
  requiresAuth: false,
@@ -1981,8 +1981,8 @@ export const CATALOG = [
1981
1981
  },
1982
1982
  {
1983
1983
  id: "memory.supersede_fact",
1984
- name: "Supersede Fact",
1985
- description: "Replace an outdated fact with a new version (old one marked superseded, never deleted).",
1984
+ name: "Replace Existing Fact",
1985
+ description: "Replace Existing Fact - Replace an outdated fact with a new version (old one marked superseded, never deleted).",
1986
1986
  method: "POST",
1987
1987
  path: "/v1/memory/facts/supersede",
1988
1988
  requiresAuth: false,
@@ -2000,7 +2000,7 @@ export const CATALOG = [
2000
2000
  {
2001
2001
  id: "memory.log_conversation",
2002
2002
  name: "Log Conversation",
2003
- description: "Log a conversation exchange for later search.",
2003
+ description: "Log Conversation - Log a conversation exchange for later search.",
2004
2004
  method: "POST",
2005
2005
  path: "/v1/memory/conversation/log",
2006
2006
  requiresAuth: false,
@@ -2017,8 +2017,8 @@ export const CATALOG = [
2017
2017
  },
2018
2018
  {
2019
2019
  id: "memory.get_conversation_detail",
2020
- name: "Get Conversation Detail",
2021
- description: "Retrieve the full conversation log for a session.",
2020
+ name: "View Conversation Detail",
2021
+ description: "View Conversation Detail - Retrieve the full conversation log for a session.",
2022
2022
  method: "POST",
2023
2023
  path: "/v1/memory/conversation/get",
2024
2024
  requiresAuth: false,
@@ -2030,8 +2030,8 @@ export const CATALOG = [
2030
2030
  },
2031
2031
  {
2032
2032
  id: "memory.store_code",
2033
- name: "Store Code",
2034
- description: "Store a code block in the code dump layer.",
2033
+ name: "Store Code Snippet",
2034
+ description: "Store Code Snippet - Store a code block in the code dump layer.",
2035
2035
  method: "POST",
2036
2036
  path: "/v1/memory/code/store",
2037
2037
  requiresAuth: false,
@@ -2050,7 +2050,7 @@ export const CATALOG = [
2050
2050
  {
2051
2051
  id: "memory.get_business_context",
2052
2052
  name: "Get Business Context",
2053
- description: "Get all business context entries (standing rules).",
2053
+ description: "Get Business Context - Get all business context entries (standing rules).",
2054
2054
  method: "POST",
2055
2055
  path: "/v1/memory/context/get",
2056
2056
  requiresAuth: false,
@@ -2058,8 +2058,8 @@ export const CATALOG = [
2058
2058
  },
2059
2059
  {
2060
2060
  id: "memory.set_business_context",
2061
- name: "Set Business Context",
2062
- description: "Add or update a business context entry (always loaded at session start).",
2061
+ name: "Update Business Context",
2062
+ description: "Update Business Context - Add or update a business context entry (always loaded at session start).",
2063
2063
  method: "POST",
2064
2064
  path: "/v1/memory/context/set",
2065
2065
  requiresAuth: false,
@@ -2076,8 +2076,8 @@ export const CATALOG = [
2076
2076
  },
2077
2077
  {
2078
2078
  id: "memory.upsert_library_doc",
2079
- name: "Upsert Library Doc",
2080
- description: "Create or update a Knowledge Library document (auto-versioned).",
2079
+ name: "Save Library Document",
2080
+ description: "Save Library Document - Create or update a Knowledge Library document (auto-versioned).",
2081
2081
  method: "POST",
2082
2082
  path: "/v1/memory/library/upsert",
2083
2083
  requiresAuth: false,
@@ -2095,8 +2095,8 @@ export const CATALOG = [
2095
2095
  },
2096
2096
  {
2097
2097
  id: "memory.manage_decay",
2098
- name: "Manage Decay",
2099
- description: "Run the memory decay manager. Promotes/demotes items between hot/warm/cold tiers.",
2098
+ name: "Run Memory Decay",
2099
+ description: "Run Memory Decay - Run the memory decay manager. Promotes/demotes items between hot/warm/cold tiers.",
2100
2100
  method: "POST",
2101
2101
  path: "/v1/memory/decay",
2102
2102
  requiresAuth: false,
@@ -2104,8 +2104,8 @@ export const CATALOG = [
2104
2104
  },
2105
2105
  {
2106
2106
  id: "memory.memory_status",
2107
- name: "Memory Status",
2108
- description: "Get memory usage stats: storage mode, counts per layer, decay tier distribution.",
2107
+ name: "Check Memory Status",
2108
+ description: "Check Memory Status - Get memory usage stats: storage mode, counts per layer, decay tier distribution.",
2109
2109
  method: "POST",
2110
2110
  path: "/v1/memory/status",
2111
2111
  requiresAuth: false,