ttp-agent-sdk 2.48.16 → 2.48.20

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/dist/index.html CHANGED
@@ -23,7 +23,7 @@
23
23
  <img src="https://talktopc.com/logo192.png" alt="TTP Logo" style="width: 40px; height: 40px; border-radius: 8px;">
24
24
  <div>
25
25
  <h1 style="margin: 0; font-size: 1.4rem;">TTP Agent SDK</h1>
26
- <p class="version" style="margin: 0;">v2.48.15</p>
26
+ <p class="version" style="margin: 0;">v2.48.16</p>
27
27
  </div>
28
28
  </div>
29
29
  </div>
@@ -62,6 +62,7 @@
62
62
  <li><a href="#widget-flavors" class="nav-link">Widget Flavors</a></li>
63
63
  <li><a href="#client-script-tools" class="nav-link">Client-Script Tools</a></li>
64
64
  <li><a href="#chain-tools" class="nav-link">Chain Tools</a></li>
65
+ <li><a href="#platform-mcp" class="nav-link">Platform MCP</a></li>
65
66
  </ul>
66
67
  </div>
67
68
 
@@ -153,6 +154,13 @@
153
154
  <p>Backend SDK for server-side TTS</p>
154
155
  <span class="quick-link-arrow">→</span>
155
156
  </a>
157
+
158
+ <a href="#platform-mcp" class="quick-link-card">
159
+ <div class="quick-link-icon">🤖</div>
160
+ <h3>Platform MCP</h3>
161
+ <p>Build agents from Cursor or Claude</p>
162
+ <span class="quick-link-arrow">→</span>
163
+ </a>
156
164
  </div>
157
165
  </div>
158
166
 
@@ -5258,6 +5266,108 @@ Files.write(Paths.get("output.wav"), response.getAudio());</code></pre>
5258
5266
  <li><strong>Examples:</strong> Check <code>src/main/java/com/talktopc/sdk/examples/</code></li>
5259
5267
  </ul>
5260
5268
  </section>
5269
+
5270
+ <section id="platform-mcp" class="doc-section">
5271
+ <h1>Platform MCP</h1>
5272
+ <p class="lead">The TalkToPC platform MCP lets Cursor, Claude, and other MCP clients create and edit voice agents on the control plane — prompts, tools, scripts, webhooks, knowledge bases, phonemes — without the dashboard.</p>
5273
+
5274
+ <div class="info-box">
5275
+ <strong>For AI agents:</strong> the full playbook (connect, operating rules, workflows, every tool argument) is
5276
+ <a href="mcp.md"><code>docs/mcp.md</code></a>. Read that file before calling tools.
5277
+ </div>
5278
+
5279
+ <h2>What it is (and is not)</h2>
5280
+ <p>This MCP talks to <code>backend.talktopc.com</code> and writes the same agent records the dashboard writes. After you change an agent, the <strong>SDK in this repo</strong> still connects with <code>agentId</code> + <code>appId</code> to <code>wss://speech.talktopc.com/ws/conv</code>.</p>
5281
+ <ul>
5282
+ <li><strong>URL:</strong> <code>https://mcp.talktopc.com/mcp</code></li>
5283
+ <li><strong>Auth:</strong> developer API key <code>sk_…</code> from the dashboard <strong>Developers</strong> page</li>
5284
+ <li><strong>Not</strong> the widget SDK, not the voice WebSocket, not the Gmail/Calendar MCP on port 3007</li>
5285
+ </ul>
5286
+
5287
+ <h2>Connect</h2>
5288
+ <h3>Claude.ai</h3>
5289
+ <ol>
5290
+ <li>Customize → Connectors → Add custom connector</li>
5291
+ <li>URL: <code>https://mcp.talktopc.com/mcp</code></li>
5292
+ <li>Leave OAuth Client ID / Secret <strong>empty</strong></li>
5293
+ <li>Add → Connect → paste <code>sk_…</code> on the TalkToPC sign-in page</li>
5294
+ </ol>
5295
+ <p>Do not invent a Client ID. Claude registers itself; the sign-in page is how you hand over the key.</p>
5296
+
5297
+ <h3>Cursor / Claude Code</h3>
5298
+ <pre><code>"ttp-platform": {
5299
+ "command": "node",
5300
+ "args": ["/absolute/path/to/ttp-platform-mcp/dist/stdio.js"],
5301
+ "env": {
5302
+ "TTP_API_KEY": "sk_…",
5303
+ "TTP_BACKEND_URL": "https://backend.talktopc.com"
5304
+ }
5305
+ }</code></pre>
5306
+
5307
+ <h3>Any HTTP client</h3>
5308
+ <p><code>POST https://mcp.talktopc.com/mcp</code> with <code>Authorization: Bearer sk_…</code> (or <code>x-api-key</code>). <code>GET /mcp</code> is 405 on purpose. <code>GET /health</code> is public.</p>
5309
+
5310
+ <h2>Rules for agents using the tools</h2>
5311
+ <ol>
5312
+ <li>List / get before you write. Prefer <code>get_agent</code> <code>view=summary</code> or <code>view=section</code> over <code>full</code>.</li>
5313
+ <li>Change fields with <code>patch_agent</code> dotted paths. Last write wins — do not patch the same agent in parallel.</li>
5314
+ <li>Deletes require <code>confirm: true</code>.</li>
5315
+ <li>Create library objects (tool / script / KB / webhook / phoneme set) first, then <code>attach_*</code>.</li>
5316
+ <li>Pick <code>model</code> and <code>voiceId</code> from resources <code>talktopc://llm-models</code> and <code>talktopc://voices</code>.</li>
5317
+ <li>MCP returns <code>agentid</code>. The widget still needs <code>appId</code> from the dashboard — MCP does not mint it.</li>
5318
+ <li>Never print <code>sk_</code> keys or webhook <code>auth_token</code>s.</li>
5319
+ </ol>
5320
+
5321
+ <h2>Typical flow</h2>
5322
+ <pre><code>list_agents
5323
+ get_agent { agentId, view: "section", section: "systemPrompt" }
5324
+ patch_agent { agentId, changes: { "systemPrompt": "…" } }
5325
+
5326
+ create_tool { toolData }
5327
+ attach_tool { agentId, toolId }
5328
+
5329
+ create_kb { name: "FAQ" }
5330
+ add_doc { kbId, name: "Hours", source_type: "text", text: "…" }
5331
+ attach_kb { agentId, kbId }</code></pre>
5332
+
5333
+ <h2>Tool groups</h2>
5334
+ <table class="properties-table">
5335
+ <thead>
5336
+ <tr>
5337
+ <th>Group</th>
5338
+ <th>Tools</th>
5339
+ </tr>
5340
+ </thead>
5341
+ <tbody>
5342
+ <tr>
5343
+ <td>Agents</td>
5344
+ <td><code>list_agents</code> <code>get_agent</code> <code>create_agent</code> <code>patch_agent</code> <code>delete_agent</code> <code>export_agent</code> <code>import_agent</code></td>
5345
+ </tr>
5346
+ <tr>
5347
+ <td>Tools</td>
5348
+ <td><code>list_tools</code> <code>get_tool</code> <code>create_tool</code> <code>update_tool</code> <code>delete_tool</code> <code>attach_tool</code> <code>detach_tool</code></td>
5349
+ </tr>
5350
+ <tr>
5351
+ <td>Scripts</td>
5352
+ <td><code>list_scripts</code> <code>get_script</code> <code>create_script</code> <code>update_script</code> <code>delete_script</code> <code>attach_script</code> <code>detach_script</code></td>
5353
+ </tr>
5354
+ <tr>
5355
+ <td>Webhooks</td>
5356
+ <td><code>list_webhooks</code> <code>get_webhook</code> <code>create_webhook</code> <code>update_webhook</code> <code>delete_webhook</code> <code>test_webhook</code> <code>set_call_summary</code></td>
5357
+ </tr>
5358
+ <tr>
5359
+ <td>Knowledge</td>
5360
+ <td><code>list_kbs</code> <code>create_kb</code> <code>get_kb</code> <code>delete_kb</code> <code>list_docs</code> <code>add_doc</code> <code>upload_doc</code> <code>delete_doc</code> <code>attach_kb</code> <code>detach_kb</code> <code>kb_limits</code> <code>search_kb</code></td>
5361
+ </tr>
5362
+ <tr>
5363
+ <td>Phonemes</td>
5364
+ <td><code>list_phoneme_sets</code> <code>get_phoneme_set</code> <code>create_phoneme_set</code> <code>add_phoneme_entry</code> <code>remove_phoneme_entry</code> <code>suggest_ipa</code> <code>delete_phoneme_set</code> <code>attach_phoneme_set</code></td>
5365
+ </tr>
5366
+ </tbody>
5367
+ </table>
5368
+
5369
+ <p>Arguments, resources, clone/export flow, and failure cheatsheet: <a href="mcp.md">docs/mcp.md</a>.</p>
5370
+ </section>
5261
5371
  </div>
5262
5372
 
5263
5373
  <!-- Footer -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ttp-agent-sdk",
3
- "version": "2.48.16",
3
+ "version": "2.48.20",
4
4
  "description": "Comprehensive Voice Agent SDK with Customizable Widget - Real-time audio, WebSocket communication, React components, and extensive customization options",
5
5
  "main": "dist/agent-widget.js",
6
6
  "module": "dist/agent-widget.esm.js",
@@ -40,6 +40,8 @@
40
40
  "test:compile-adapter": "node scripts/compile-adapter.test.mjs",
41
41
  "test:adapters": "npm run test:compile-adapter && npm run test:verify-adapter",
42
42
  "test:client-tools": "node --test test/client-tools-registry.test.mjs",
43
+ "test:hop": "node --test test/hop-platform.test.mjs",
44
+ "test:loopback": "node --test test/loopback-aec.test.mjs",
43
45
  "clean": "rm -rf dist/",
44
46
  "prebuild": "npm run clean"
45
47
  },