@dbx-tools/appkit-mastra 0.1.58 → 0.1.67

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 (44) hide show
  1. package/README.md +41 -1
  2. package/dist/index.d.ts +1229 -17
  3. package/dist/index.js +3348 -19
  4. package/package.json +17 -28
  5. package/src/agents.ts +7 -1
  6. package/src/config.ts +64 -0
  7. package/src/genie.ts +9 -21
  8. package/{index.ts → src/index.ts} +7 -9
  9. package/src/mcp.ts +89 -0
  10. package/src/model.ts +9 -3
  11. package/src/plugin.ts +51 -8
  12. package/src/serving.ts +5 -9
  13. package/src/statement.ts +8 -36
  14. package/dist/src/agents.d.ts +0 -316
  15. package/dist/src/agents.js +0 -470
  16. package/dist/src/chart.d.ts +0 -153
  17. package/dist/src/chart.js +0 -570
  18. package/dist/src/config.d.ts +0 -295
  19. package/dist/src/config.js +0 -55
  20. package/dist/src/genie.d.ts +0 -161
  21. package/dist/src/genie.js +0 -973
  22. package/dist/src/history.d.ts +0 -95
  23. package/dist/src/history.js +0 -278
  24. package/dist/src/memory.d.ts +0 -109
  25. package/dist/src/memory.js +0 -253
  26. package/dist/src/model.d.ts +0 -52
  27. package/dist/src/model.js +0 -198
  28. package/dist/src/observability.d.ts +0 -64
  29. package/dist/src/observability.js +0 -83
  30. package/dist/src/plugin.d.ts +0 -177
  31. package/dist/src/plugin.js +0 -554
  32. package/dist/src/processor.d.ts +0 -8
  33. package/dist/src/processor.js +0 -40
  34. package/dist/src/processors/strip-stale-charts.d.ts +0 -32
  35. package/dist/src/processors/strip-stale-charts.js +0 -98
  36. package/dist/src/server.d.ts +0 -51
  37. package/dist/src/server.js +0 -152
  38. package/dist/src/serving.d.ts +0 -65
  39. package/dist/src/serving.js +0 -79
  40. package/dist/src/statement.d.ts +0 -66
  41. package/dist/src/statement.js +0 -111
  42. package/dist/src/writer.d.ts +0 -23
  43. package/dist/src/writer.js +0 -37
  44. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,37 +0,0 @@
1
- /**
2
- * Shared helper for publishing events through Mastra's
3
- * `ctx.writer`. Centralizes the "the downstream stream may already
4
- * be closed, don't take the whole tool down" pattern that the
5
- * Genie agent and chart tool both need.
6
- *
7
- * Failures are logged at `warn` (a persistently-closed writer is
8
- * the most likely culprit when events go missing client-side) but
9
- * swallowed so a cancelled request or a client that navigated
10
- * away can't crash a tool mid-flight.
11
- */
12
- import { commonUtils } from "@dbx-tools/shared";
13
- /**
14
- * Best-effort `writer.write`. No-op when `writer` is undefined;
15
- * caught errors are logged via `log.warn("writer:error", ...)`
16
- * along with any caller-supplied `context` fields (e.g. a
17
- * `chartId` or `messageId`) so the warning is greppable per
18
- * resource.
19
- *
20
- * Returns when the write resolves or rejects; never throws.
21
- */
22
- export async function safeWrite(log, writer, chunk, context = {}) {
23
- if (!writer) {
24
- log.debug("writer:no-writer", context);
25
- return;
26
- }
27
- try {
28
- await writer.write(chunk);
29
- log.debug("writer:ok", context);
30
- }
31
- catch (err) {
32
- log.warn("writer:error", {
33
- ...context,
34
- error: commonUtils.errorMessage(err),
35
- });
36
- }
37
- }