@ductape/mcp 0.1.48 → 0.1.49

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.js CHANGED
@@ -1192,9 +1192,58 @@ const docsInputSchema = z.object({
1192
1192
  topic: z.string().describe('Feature topic to look up. Supported: ' +
1193
1193
  'transactions, presave, triggers, aggregations, migrations, indexes, performance, actions, ' +
1194
1194
  'graphs, storage, cloud, vector, warehouse, secrets, apps, products, sessions, caches, ' +
1195
- 'notifications, resilience, features, events, logs'),
1195
+ 'notifications, resilience, features, events, logs, frontend, client, react, vue'),
1196
1196
  });
1197
1197
  const DOCS = {
1198
+ frontend: `
1199
+ DUCTAPE FRONTEND SDK GUIDE
1200
+
1201
+ Choose one integration package:
1202
+ React 17+ — npm install @ductape/react
1203
+ Provider and hooks built on @ductape/client.
1204
+ Continue with ductape_docs({ topic: "react" }).
1205
+ Vue 3+ — npm install @ductape/vue
1206
+ Plugin and composables built on @ductape/client.
1207
+ Continue with ductape_docs({ topic: "vue" }).
1208
+ Other UI — npm install @ductape/client
1209
+ frameworks Use directly with Svelte, Angular, vanilla JavaScript, or a custom adapter.
1210
+ Continue with ductape_docs({ topic: "client" }).
1211
+
1212
+ Do not install @ductape/client separately when using @ductape/react or @ductape/vue unless the
1213
+ application also needs direct access to a client API not exposed by the framework package. Both
1214
+ framework packages wrap @ductape/client and expose the underlying client through useDuctape().
1215
+
1216
+ SHARED APPLICATION LIFECYCLE
1217
+ 1. Create one client at the application root using a browser-safe publishableKey, proxy baseUrl,
1218
+ default product tag, and environment slug.
1219
+ 2. Connect the real-time client only in the browser. In React use DuctapeProvider autoConnect or
1220
+ connect() after mount; in Vue use createDuctape({ autoConnect: true }) or connect() in onMounted.
1221
+ 3. Authenticate the player with the sessions API and retain the returned session token according
1222
+ to the application's security policy. Refresh it before expiry (the React/Vue packages provide
1223
+ useSessionAutoRefresh) and revoke it on logout.
1224
+ 4. Pass the session value when connecting a broker that requires player-scoped authorization.
1225
+ 5. Subscribe through the framework hook/composable or the client service. Always unsubscribe on
1226
+ component teardown; the framework integrations do this automatically for declarative hooks.
1227
+ 6. The underlying client reconnects its WebSocket and restores active subscriptions. Observe
1228
+ connectionState to render disconnected/reconnecting UI; do not create duplicate subscriptions.
1229
+ 7. Disconnect resource sessions and the root client when the owning application scope is torn down.
1230
+
1231
+ AUTHENTICATION AND SECURITY
1232
+ - Use publishableKey in browser applications. Never ship workspace private keys or privileged
1233
+ access keys in frontend bundles.
1234
+ - A Ductape player session and the real-time transport connection are separate: authenticate or
1235
+ refresh the session, then use that session when opening player-scoped broker resources.
1236
+ - For SSR, create/connect the real-time client only on the browser side.
1237
+
1238
+ MIGRATING A CUSTOM WRAPPER
1239
+ - Keep @ductape/client when the wrapper implements application-specific projection or state logic.
1240
+ - For React, move root connection ownership to DuctapeProvider, replace imperative subscriptions
1241
+ with useBroker/useBrokerSubscription, and keep projection reduction in an application hook.
1242
+ - For Vue, move root ownership to createDuctape(), replace imperative subscriptions with
1243
+ useBroker/useBrokerSubscription, and keep projection reduction in an application composable.
1244
+ - Verify session handoff, initial loading state, error state, reconnect UI, subscription cleanup,
1245
+ and duplicate-event behavior with a live end-to-end run before removing the old wrapper.
1246
+ `.trim(),
1198
1247
  transactions: `
1199
1248
  DUCTAPE DATABASE TRANSACTIONS
1200
1249
 
@@ -3549,7 +3598,7 @@ async function main() {
3549
3598
  'index strategy, operation types) that should be confirmed with the user first.\n\n' +
3550
3599
  'Available topics: transactions, presave, triggers, aggregations, migrations, indexes, performance, actions, ' +
3551
3600
  'graphs, storage, cloud, vector, warehouse, secrets, apps, products, sessions, caches, ' +
3552
- 'notifications, resilience, features, events, logs, client, react, vue',
3601
+ 'notifications, resilience, features, events, logs, frontend, client, react, vue',
3553
3602
  inputSchema: docsInputSchema,
3554
3603
  }, docsHandler);
3555
3604
  server.registerTool('ductape_cli', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/mcp",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "MCP server that exposes Ductape SDK operations via the backend proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -1242,11 +1242,61 @@ const docsInputSchema = z.object({
1242
1242
  'Feature topic to look up. Supported: ' +
1243
1243
  'transactions, presave, triggers, aggregations, migrations, indexes, performance, actions, ' +
1244
1244
  'graphs, storage, cloud, vector, warehouse, secrets, apps, products, sessions, caches, ' +
1245
- 'notifications, resilience, features, events, logs',
1245
+ 'notifications, resilience, features, events, logs, frontend, client, react, vue',
1246
1246
  ),
1247
1247
  });
1248
1248
 
1249
1249
  const DOCS: Record<string, string> = {
1250
+ frontend: `
1251
+ DUCTAPE FRONTEND SDK GUIDE
1252
+
1253
+ Choose one integration package:
1254
+ React 17+ — npm install @ductape/react
1255
+ Provider and hooks built on @ductape/client.
1256
+ Continue with ductape_docs({ topic: "react" }).
1257
+ Vue 3+ — npm install @ductape/vue
1258
+ Plugin and composables built on @ductape/client.
1259
+ Continue with ductape_docs({ topic: "vue" }).
1260
+ Other UI — npm install @ductape/client
1261
+ frameworks Use directly with Svelte, Angular, vanilla JavaScript, or a custom adapter.
1262
+ Continue with ductape_docs({ topic: "client" }).
1263
+
1264
+ Do not install @ductape/client separately when using @ductape/react or @ductape/vue unless the
1265
+ application also needs direct access to a client API not exposed by the framework package. Both
1266
+ framework packages wrap @ductape/client and expose the underlying client through useDuctape().
1267
+
1268
+ SHARED APPLICATION LIFECYCLE
1269
+ 1. Create one client at the application root using a browser-safe publishableKey, proxy baseUrl,
1270
+ default product tag, and environment slug.
1271
+ 2. Connect the real-time client only in the browser. In React use DuctapeProvider autoConnect or
1272
+ connect() after mount; in Vue use createDuctape({ autoConnect: true }) or connect() in onMounted.
1273
+ 3. Authenticate the player with the sessions API and retain the returned session token according
1274
+ to the application's security policy. Refresh it before expiry (the React/Vue packages provide
1275
+ useSessionAutoRefresh) and revoke it on logout.
1276
+ 4. Pass the session value when connecting a broker that requires player-scoped authorization.
1277
+ 5. Subscribe through the framework hook/composable or the client service. Always unsubscribe on
1278
+ component teardown; the framework integrations do this automatically for declarative hooks.
1279
+ 6. The underlying client reconnects its WebSocket and restores active subscriptions. Observe
1280
+ connectionState to render disconnected/reconnecting UI; do not create duplicate subscriptions.
1281
+ 7. Disconnect resource sessions and the root client when the owning application scope is torn down.
1282
+
1283
+ AUTHENTICATION AND SECURITY
1284
+ - Use publishableKey in browser applications. Never ship workspace private keys or privileged
1285
+ access keys in frontend bundles.
1286
+ - A Ductape player session and the real-time transport connection are separate: authenticate or
1287
+ refresh the session, then use that session when opening player-scoped broker resources.
1288
+ - For SSR, create/connect the real-time client only on the browser side.
1289
+
1290
+ MIGRATING A CUSTOM WRAPPER
1291
+ - Keep @ductape/client when the wrapper implements application-specific projection or state logic.
1292
+ - For React, move root connection ownership to DuctapeProvider, replace imperative subscriptions
1293
+ with useBroker/useBrokerSubscription, and keep projection reduction in an application hook.
1294
+ - For Vue, move root ownership to createDuctape(), replace imperative subscriptions with
1295
+ useBroker/useBrokerSubscription, and keep projection reduction in an application composable.
1296
+ - Verify session handoff, initial loading state, error state, reconnect UI, subscription cleanup,
1297
+ and duplicate-event behavior with a live end-to-end run before removing the old wrapper.
1298
+ `.trim(),
1299
+
1250
1300
  transactions: `
1251
1301
  DUCTAPE DATABASE TRANSACTIONS
1252
1302
 
@@ -3682,7 +3732,7 @@ async function main() {
3682
3732
  'index strategy, operation types) that should be confirmed with the user first.\n\n' +
3683
3733
  'Available topics: transactions, presave, triggers, aggregations, migrations, indexes, performance, actions, ' +
3684
3734
  'graphs, storage, cloud, vector, warehouse, secrets, apps, products, sessions, caches, ' +
3685
- 'notifications, resilience, features, events, logs, client, react, vue',
3735
+ 'notifications, resilience, features, events, logs, frontend, client, react, vue',
3686
3736
  inputSchema: docsInputSchema,
3687
3737
  },
3688
3738
  docsHandler,