@ema.co/mcp-toolkit 2026.2.27 → 2026.2.28

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.

Potentially problematic release.


This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.

Files changed (58) hide show
  1. package/.context/public/guides/ema-user-guide.md +7 -6
  2. package/.context/public/guides/mcp-tools-guide.md +46 -23
  3. package/dist/config/index.js +11 -0
  4. package/dist/config/workflow-patterns.js +361 -0
  5. package/dist/mcp/autobuilder.js +2 -2
  6. package/dist/mcp/domain/generation-schema.js +15 -9
  7. package/dist/mcp/domain/structural-rules.js +3 -3
  8. package/dist/mcp/domain/validation-rules.js +20 -27
  9. package/dist/mcp/domain/workflow-generator.js +3 -3
  10. package/dist/mcp/domain/workflow-graph.js +1 -1
  11. package/dist/mcp/guidance.js +60 -1
  12. package/dist/mcp/handlers/conversation/adapter.js +13 -0
  13. package/dist/mcp/handlers/conversation/create.js +19 -0
  14. package/dist/mcp/handlers/conversation/delete.js +18 -0
  15. package/dist/mcp/handlers/conversation/formatters.js +62 -0
  16. package/dist/mcp/handlers/conversation/history.js +15 -0
  17. package/dist/mcp/handlers/conversation/index.js +43 -0
  18. package/dist/mcp/handlers/conversation/list.js +40 -0
  19. package/dist/mcp/handlers/conversation/messages.js +13 -0
  20. package/dist/mcp/handlers/conversation/rename.js +16 -0
  21. package/dist/mcp/handlers/conversation/send.js +90 -0
  22. package/dist/mcp/handlers/data/index.js +169 -3
  23. package/dist/mcp/handlers/feedback/client-id.js +49 -0
  24. package/dist/mcp/handlers/feedback/coalesce.js +167 -0
  25. package/dist/mcp/handlers/feedback/index.js +42 -1
  26. package/dist/mcp/handlers/feedback/outbox.js +301 -0
  27. package/dist/mcp/handlers/feedback/probes.js +127 -0
  28. package/dist/mcp/handlers/feedback/remote-store.js +59 -0
  29. package/dist/mcp/handlers/feedback/store.js +13 -1
  30. package/dist/mcp/handlers/persona/delete.js +7 -28
  31. package/dist/mcp/handlers/persona/update.js +7 -26
  32. package/dist/mcp/handlers/persona/version.js +30 -15
  33. package/dist/mcp/handlers/template/adapter.js +23 -0
  34. package/dist/mcp/handlers/template/crud.js +174 -0
  35. package/dist/mcp/handlers/template/index.js +6 -7
  36. package/dist/mcp/handlers/workflow/adapter.js +30 -46
  37. package/dist/mcp/handlers/workflow/index.js +2 -2
  38. package/dist/mcp/handlers/workflow/validation.js +2 -2
  39. package/dist/mcp/knowledge-guidance-topics.js +90 -53
  40. package/dist/mcp/knowledge.js +7 -357
  41. package/dist/mcp/prompts.js +5 -5
  42. package/dist/mcp/resources-dynamic.js +46 -38
  43. package/dist/mcp/resources-validation.js +5 -5
  44. package/dist/mcp/server.js +38 -5
  45. package/dist/mcp/tools.js +340 -8
  46. package/dist/sdk/client-adapter.js +90 -2
  47. package/dist/sdk/client.js +7 -0
  48. package/dist/sdk/ema-client.js +242 -27
  49. package/dist/sdk/generated/agent-catalog.js +96 -39
  50. package/dist/sdk/generated/deprecated-actions.js +1 -1
  51. package/dist/sdk/grpc-client.js +67 -5
  52. package/dist/sync/central-factory.js +86 -0
  53. package/dist/sync/central-version-storage.js +387 -0
  54. package/dist/sync/dis-port.js +75 -0
  55. package/dist/sync/version-policy.js +29 -31
  56. package/dist/sync/version-storage-interface.js +11 -0
  57. package/dist/sync/version-storage.js +22 -22
  58. package/package.json +2 -1
@@ -133,7 +133,7 @@ export class VersionStorage {
133
133
  getManifestPath(personaId) {
134
134
  return path.join(this.getSnapshotDir(personaId), MANIFEST_FILE);
135
135
  }
136
- getManifest(personaId) {
136
+ async getManifest(personaId) {
137
137
  const manifestPath = this.getManifestPath(personaId);
138
138
  if (!fs.existsSync(manifestPath)) {
139
139
  return null;
@@ -195,7 +195,7 @@ export class VersionStorage {
195
195
  /**
196
196
  * Save a version snapshot to storage.
197
197
  */
198
- saveVersion(version) {
198
+ async saveVersion(version) {
199
199
  this.ensurePersonaDir(version.persona_id);
200
200
  // Save blob if dedup enabled
201
201
  if (this.config.enable_blob_dedup) {
@@ -208,7 +208,7 @@ export class VersionStorage {
208
208
  const latestPath = this.getLatestPath(version.persona_id);
209
209
  fs.writeFileSync(latestPath, JSON.stringify(version, null, 2));
210
210
  // Update manifest
211
- let manifest = this.getManifest(version.persona_id);
211
+ let manifest = await this.getManifest(version.persona_id);
212
212
  if (!manifest) {
213
213
  manifest = this.createEmptyManifest(version.persona_id, version.environment);
214
214
  }
@@ -232,7 +232,7 @@ export class VersionStorage {
232
232
  /**
233
233
  * Get a specific version by number.
234
234
  */
235
- getVersion(personaId, versionNumber) {
235
+ async getVersion(personaId, versionNumber) {
236
236
  const versionPath = this.getVersionPath(personaId, versionNumber);
237
237
  if (!fs.existsSync(versionPath)) {
238
238
  return null;
@@ -248,8 +248,8 @@ export class VersionStorage {
248
248
  /**
249
249
  * Get a version by ID.
250
250
  */
251
- getVersionById(personaId, versionId) {
252
- const manifest = this.getManifest(personaId);
251
+ async getVersionById(personaId, versionId) {
252
+ const manifest = await this.getManifest(personaId);
253
253
  if (!manifest)
254
254
  return null;
255
255
  const entry = manifest.versions.find((v) => v.id === versionId);
@@ -260,11 +260,11 @@ export class VersionStorage {
260
260
  /**
261
261
  * Get a version by name (e.g., "v3", "latest").
262
262
  */
263
- getVersionByName(personaId, versionName) {
263
+ async getVersionByName(personaId, versionName) {
264
264
  if (versionName === "latest") {
265
265
  return this.getLatestVersion(personaId);
266
266
  }
267
- const manifest = this.getManifest(personaId);
267
+ const manifest = await this.getManifest(personaId);
268
268
  if (!manifest)
269
269
  return null;
270
270
  const entry = manifest.versions.find((v) => v.version_name === versionName);
@@ -275,7 +275,7 @@ export class VersionStorage {
275
275
  /**
276
276
  * Get the latest version.
277
277
  */
278
- getLatestVersion(personaId) {
278
+ async getLatestVersion(personaId) {
279
279
  const latestPath = this.getLatestPath(personaId);
280
280
  if (!fs.existsSync(latestPath)) {
281
281
  return null;
@@ -291,15 +291,15 @@ export class VersionStorage {
291
291
  /**
292
292
  * List all versions for a persona (from manifest).
293
293
  */
294
- listVersions(personaId) {
295
- const manifest = this.getManifest(personaId);
294
+ async listVersions(personaId) {
295
+ const manifest = await this.getManifest(personaId);
296
296
  return manifest?.versions ?? [];
297
297
  }
298
298
  /**
299
299
  * Check if a content hash already exists (for deduplication).
300
300
  */
301
- hasContentHash(personaId, contentHash) {
302
- const manifest = this.getManifest(personaId);
301
+ async hasContentHash(personaId, contentHash) {
302
+ const manifest = await this.getManifest(personaId);
303
303
  if (!manifest)
304
304
  return false;
305
305
  return manifest.versions.some((v) => v.content_hash === contentHash);
@@ -307,15 +307,15 @@ export class VersionStorage {
307
307
  /**
308
308
  * Get the next version number for a persona.
309
309
  */
310
- getNextVersionNumber(personaId) {
311
- const manifest = this.getManifest(personaId);
310
+ async getNextVersionNumber(personaId) {
311
+ const manifest = await this.getManifest(personaId);
312
312
  return (manifest?.latest_version_number ?? 0) + 1;
313
313
  }
314
314
  // ─────────────── Policy Management ───────────────
315
315
  getPolicyPath(personaId) {
316
316
  return path.join(this.baseDir, POLICIES_DIR, `${personaId}.yaml`);
317
317
  }
318
- getPolicy(personaId) {
318
+ async getPolicy(personaId) {
319
319
  const policyPath = this.getPolicyPath(personaId);
320
320
  if (fs.existsSync(policyPath)) {
321
321
  try {
@@ -343,7 +343,7 @@ export class VersionStorage {
343
343
  prune_strategy: this.config.default_prune_strategy,
344
344
  };
345
345
  }
346
- savePolicy(policy) {
346
+ async savePolicy(policy) {
347
347
  const policyPath = this.getPolicyPath(policy.persona_id);
348
348
  const lines = [
349
349
  `# Version policy for persona ${policy.persona_id}`,
@@ -362,12 +362,12 @@ export class VersionStorage {
362
362
  * Prune old versions according to policy.
363
363
  * Returns the number of versions pruned.
364
364
  */
365
- pruneVersions(personaId) {
366
- const policy = this.getPolicy(personaId);
365
+ async pruneVersions(personaId) {
366
+ const policy = await this.getPolicy(personaId);
367
367
  if (policy.max_versions === 0) {
368
368
  return 0; // Unlimited
369
369
  }
370
- const manifest = this.getManifest(personaId);
370
+ const manifest = await this.getManifest(personaId);
371
371
  if (!manifest || manifest.versions.length <= policy.max_versions) {
372
372
  return 0;
373
373
  }
@@ -419,12 +419,12 @@ export class VersionStorage {
419
419
  /**
420
420
  * Get storage statistics.
421
421
  */
422
- getStats() {
422
+ async getStats() {
423
423
  const personas = this.listPersonasWithVersions();
424
424
  let totalVersions = 0;
425
425
  let storageBytes = 0;
426
426
  for (const personaId of personas) {
427
- const manifest = this.getManifest(personaId);
427
+ const manifest = await this.getManifest(personaId);
428
428
  if (manifest) {
429
429
  totalVersions += manifest.versions.length;
430
430
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ema.co/mcp-toolkit",
3
- "version": "2026.2.27",
3
+ "version": "2026.2.28",
4
4
  "description": "Ema AI Employee toolkit - MCP server, CLI, and SDK for managing AI Employees across environments",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -111,6 +111,7 @@
111
111
  "zod": "^3.24.1"
112
112
  },
113
113
  "devDependencies": {
114
+ "@anthropic-ai/sdk": "^0.78.0",
114
115
  "@bufbuild/buf": "^1.34.0",
115
116
  "@bufbuild/protoc-gen-es": "^2.2.0",
116
117
  "@hey-api/openapi-ts": "^0.90.4",