@dbx-tools/appkit-mastra 0.1.58 → 0.1.68

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 (51) 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 -30
  5. package/dist/src/agents.d.ts +0 -316
  6. package/dist/src/agents.js +0 -470
  7. package/dist/src/chart.d.ts +0 -153
  8. package/dist/src/chart.js +0 -570
  9. package/dist/src/config.d.ts +0 -295
  10. package/dist/src/config.js +0 -55
  11. package/dist/src/genie.d.ts +0 -161
  12. package/dist/src/genie.js +0 -973
  13. package/dist/src/history.d.ts +0 -95
  14. package/dist/src/history.js +0 -278
  15. package/dist/src/memory.d.ts +0 -109
  16. package/dist/src/memory.js +0 -253
  17. package/dist/src/model.d.ts +0 -52
  18. package/dist/src/model.js +0 -198
  19. package/dist/src/observability.d.ts +0 -64
  20. package/dist/src/observability.js +0 -83
  21. package/dist/src/plugin.d.ts +0 -177
  22. package/dist/src/plugin.js +0 -554
  23. package/dist/src/processor.d.ts +0 -8
  24. package/dist/src/processor.js +0 -40
  25. package/dist/src/processors/strip-stale-charts.d.ts +0 -32
  26. package/dist/src/processors/strip-stale-charts.js +0 -98
  27. package/dist/src/server.d.ts +0 -51
  28. package/dist/src/server.js +0 -152
  29. package/dist/src/serving.d.ts +0 -65
  30. package/dist/src/serving.js +0 -79
  31. package/dist/src/statement.d.ts +0 -66
  32. package/dist/src/statement.js +0 -111
  33. package/dist/src/writer.d.ts +0 -23
  34. package/dist/src/writer.js +0 -37
  35. package/dist/tsconfig.build.tsbuildinfo +0 -1
  36. package/index.ts +0 -27
  37. package/src/agents.ts +0 -772
  38. package/src/chart.ts +0 -716
  39. package/src/config.ts +0 -320
  40. package/src/genie.ts +0 -1123
  41. package/src/history.ts +0 -322
  42. package/src/memory.ts +0 -293
  43. package/src/model.ts +0 -257
  44. package/src/observability.ts +0 -114
  45. package/src/plugin.ts +0 -623
  46. package/src/processor.ts +0 -46
  47. package/src/processors/strip-stale-charts.ts +0 -102
  48. package/src/server.ts +0 -195
  49. package/src/serving.ts +0 -104
  50. package/src/statement.ts +0 -120
  51. package/src/writer.ts +0 -44
@@ -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
- }