@mastra/factory 0.29.0-alpha.0 → 0.29.0-alpha.1

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 (237) hide show
  1. package/README.md +20 -4
  2. package/dist/board-changes.d.ts +16 -0
  3. package/dist/board-changes.d.ts.map +1 -0
  4. package/dist/board-changes.js +40 -0
  5. package/dist/board-changes.js.map +1 -0
  6. package/dist/boards/index.js +2 -1
  7. package/dist/boards/semantics.d.ts +1 -3
  8. package/dist/boards/semantics.d.ts.map +1 -1
  9. package/dist/boards/semantics.js +1 -5
  10. package/dist/boards/semantics.js.map +1 -1
  11. package/dist/factory.d.ts +4 -0
  12. package/dist/factory.d.ts.map +1 -1
  13. package/dist/factory.js +51 -3
  14. package/dist/factory.js.map +1 -1
  15. package/dist/integrations/base.d.ts +9 -0
  16. package/dist/integrations/base.d.ts.map +1 -1
  17. package/dist/integrations/github/pull-request-source.js +2 -1
  18. package/dist/integrations/github/pull-request-source.js.map +1 -1
  19. package/dist/integrations/github/reconcile-worker.js +1 -1
  20. package/dist/integrations/github/reconcile-worker.js.map +1 -1
  21. package/dist/integrations/github/rules.d.ts +5 -2
  22. package/dist/integrations/github/rules.d.ts.map +1 -1
  23. package/dist/integrations/github/rules.js +16 -13
  24. package/dist/integrations/github/rules.js.map +1 -1
  25. package/dist/integrations/github/sandbox.js +2 -2
  26. package/dist/integrations/github/sandbox.js.map +1 -1
  27. package/dist/integrations/gitlab/default-rules.js +2 -1
  28. package/dist/integrations/gitlab/default-rules.js.map +1 -1
  29. package/dist/integrations/gitlab/discovery.d.ts +16 -0
  30. package/dist/integrations/gitlab/discovery.d.ts.map +1 -0
  31. package/dist/integrations/gitlab/discovery.js +107 -0
  32. package/dist/integrations/gitlab/discovery.js.map +1 -0
  33. package/dist/integrations/gitlab/integration.d.ts.map +1 -1
  34. package/dist/integrations/gitlab/integration.js +1 -2
  35. package/dist/integrations/gitlab/integration.js.map +1 -1
  36. package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -1
  37. package/dist/integrations/gitlab/issue-reconciler.js +1 -0
  38. package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
  39. package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
  40. package/dist/integrations/gitlab/merge-request-reconciler.js +26 -10
  41. package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
  42. package/dist/integrations/gitlab/reconciler.d.ts.map +1 -1
  43. package/dist/integrations/gitlab/reconciler.js +4 -2
  44. package/dist/integrations/gitlab/reconciler.js.map +1 -1
  45. package/dist/integrations/gitlab/reconciliation-config.d.ts +0 -1
  46. package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -1
  47. package/dist/integrations/gitlab/reconciliation-config.js +2 -8
  48. package/dist/integrations/gitlab/reconciliation-config.js.map +1 -1
  49. package/dist/integrations/gitlab/routes.d.ts +17 -0
  50. package/dist/integrations/gitlab/routes.d.ts.map +1 -1
  51. package/dist/integrations/gitlab/routes.js +28 -22
  52. package/dist/integrations/gitlab/routes.js.map +1 -1
  53. package/dist/integrations/gitlab/rules.d.ts +10 -4
  54. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  55. package/dist/integrations/gitlab/rules.js +32 -8
  56. package/dist/integrations/gitlab/rules.js.map +1 -1
  57. package/dist/integrations/incidentio/integration.d.ts +2 -1
  58. package/dist/integrations/incidentio/integration.d.ts.map +1 -1
  59. package/dist/integrations/incidentio/integration.js +7 -7
  60. package/dist/integrations/incidentio/integration.js.map +1 -1
  61. package/dist/integrations/incidentio/issue-reconciler.d.ts +7 -0
  62. package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -1
  63. package/dist/integrations/incidentio/issue-reconciler.js +36 -1
  64. package/dist/integrations/incidentio/issue-reconciler.js.map +1 -1
  65. package/dist/integrations/incidentio/reconciliation-config.d.ts +0 -1
  66. package/dist/integrations/incidentio/reconciliation-config.d.ts.map +1 -1
  67. package/dist/integrations/incidentio/reconciliation-config.js +2 -5
  68. package/dist/integrations/incidentio/reconciliation-config.js.map +1 -1
  69. package/dist/integrations/incidentio/routes.d.ts +24 -8
  70. package/dist/integrations/incidentio/routes.d.ts.map +1 -1
  71. package/dist/integrations/incidentio/routes.js +33 -35
  72. package/dist/integrations/incidentio/routes.js.map +1 -1
  73. package/dist/integrations/incidentio/rules.d.ts +0 -4
  74. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  75. package/dist/integrations/incidentio/rules.js +17 -14
  76. package/dist/integrations/incidentio/rules.js.map +1 -1
  77. package/dist/integrations/intake-discovery.d.ts +44 -0
  78. package/dist/integrations/intake-discovery.d.ts.map +1 -0
  79. package/dist/integrations/intake-discovery.js +60 -0
  80. package/dist/integrations/intake-discovery.js.map +1 -0
  81. package/dist/integrations/issue-reconcile-worker.js +1 -1
  82. package/dist/integrations/issue-reconcile-worker.js.map +1 -1
  83. package/dist/integrations/issue-reconciler.d.ts +7 -0
  84. package/dist/integrations/issue-reconciler.d.ts.map +1 -1
  85. package/dist/integrations/issue-reconciler.js +47 -12
  86. package/dist/integrations/issue-reconciler.js.map +1 -1
  87. package/dist/integrations/jira/integration.d.ts +3 -2
  88. package/dist/integrations/jira/integration.d.ts.map +1 -1
  89. package/dist/integrations/jira/integration.js +5 -7
  90. package/dist/integrations/jira/integration.js.map +1 -1
  91. package/dist/integrations/jira/issue-reconciler.d.ts +17 -1
  92. package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -1
  93. package/dist/integrations/jira/issue-reconciler.js +34 -1
  94. package/dist/integrations/jira/issue-reconciler.js.map +1 -1
  95. package/dist/integrations/jira/reconciliation-config.d.ts +0 -1
  96. package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -1
  97. package/dist/integrations/jira/reconciliation-config.js +2 -5
  98. package/dist/integrations/jira/reconciliation-config.js.map +1 -1
  99. package/dist/integrations/jira/routes.d.ts +0 -7
  100. package/dist/integrations/jira/routes.d.ts.map +1 -1
  101. package/dist/integrations/jira/routes.js +2 -12
  102. package/dist/integrations/jira/routes.js.map +1 -1
  103. package/dist/integrations/jira/rules.d.ts +0 -4
  104. package/dist/integrations/jira/rules.d.ts.map +1 -1
  105. package/dist/integrations/jira/rules.js +3 -13
  106. package/dist/integrations/jira/rules.js.map +1 -1
  107. package/dist/integrations/kept-cards.d.ts +49 -0
  108. package/dist/integrations/kept-cards.d.ts.map +1 -0
  109. package/dist/integrations/kept-cards.js +97 -0
  110. package/dist/integrations/kept-cards.js.map +1 -0
  111. package/dist/integrations/linear/intake-discovery.d.ts +34 -0
  112. package/dist/integrations/linear/intake-discovery.d.ts.map +1 -0
  113. package/dist/integrations/linear/intake-discovery.js +112 -0
  114. package/dist/integrations/linear/intake-discovery.js.map +1 -0
  115. package/dist/integrations/linear/integration.d.ts.map +1 -1
  116. package/dist/integrations/linear/integration.js +1 -4
  117. package/dist/integrations/linear/integration.js.map +1 -1
  118. package/dist/integrations/linear/issue-reconciler.d.ts +13 -4
  119. package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -1
  120. package/dist/integrations/linear/issue-reconciler.js +24 -20
  121. package/dist/integrations/linear/issue-reconciler.js.map +1 -1
  122. package/dist/integrations/linear/reconciliation-config.d.ts +0 -1
  123. package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -1
  124. package/dist/integrations/linear/reconciliation-config.js +2 -8
  125. package/dist/integrations/linear/reconciliation-config.js.map +1 -1
  126. package/dist/integrations/linear/routes.d.ts +0 -2
  127. package/dist/integrations/linear/routes.d.ts.map +1 -1
  128. package/dist/integrations/linear/routes.js +3 -9
  129. package/dist/integrations/linear/routes.js.map +1 -1
  130. package/dist/integrations/platform/api-client.d.ts +2 -0
  131. package/dist/integrations/platform/api-client.d.ts.map +1 -1
  132. package/dist/integrations/platform/api-client.js +6 -1
  133. package/dist/integrations/platform/api-client.js.map +1 -1
  134. package/dist/integrations/platform/connect/routes.js +4 -1
  135. package/dist/integrations/platform/connect/routes.js.map +1 -1
  136. package/dist/integrations/platform/github/event-worker.d.ts +12 -0
  137. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
  138. package/dist/integrations/platform/github/event-worker.js +56 -5
  139. package/dist/integrations/platform/github/event-worker.js.map +1 -1
  140. package/dist/integrations/platform/github/integration.d.ts +1 -0
  141. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  142. package/dist/integrations/platform/github/integration.js +8 -3
  143. package/dist/integrations/platform/github/integration.js.map +1 -1
  144. package/dist/integrations/platform/gitlab/event-worker.js +1 -1
  145. package/dist/integrations/platform/gitlab/event-worker.js.map +1 -1
  146. package/dist/integrations/platform/incidentio/integration.d.ts +3 -2
  147. package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
  148. package/dist/integrations/platform/incidentio/integration.js +7 -7
  149. package/dist/integrations/platform/incidentio/integration.js.map +1 -1
  150. package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
  151. package/dist/integrations/platform/jira/integration.js +4 -7
  152. package/dist/integrations/platform/jira/integration.js.map +1 -1
  153. package/dist/integrations/platform/jira/routes.d.ts +0 -7
  154. package/dist/integrations/platform/jira/routes.d.ts.map +1 -1
  155. package/dist/integrations/platform/jira/routes.js +2 -12
  156. package/dist/integrations/platform/jira/routes.js.map +1 -1
  157. package/dist/integrations/platform/linear/event-worker.d.ts +2 -2
  158. package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
  159. package/dist/integrations/platform/linear/event-worker.js +1 -1
  160. package/dist/integrations/platform/linear/event-worker.js.map +1 -1
  161. package/dist/integrations/platform/linear/integration.d.ts +1 -0
  162. package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
  163. package/dist/integrations/platform/linear/integration.js +7 -7
  164. package/dist/integrations/platform/linear/integration.js.map +1 -1
  165. package/dist/integrations/platform/vanta/integration.d.ts +7 -2
  166. package/dist/integrations/platform/vanta/integration.d.ts.map +1 -1
  167. package/dist/integrations/platform/vanta/integration.js +22 -6
  168. package/dist/integrations/platform/vanta/integration.js.map +1 -1
  169. package/dist/integrations/reconciliation-config.d.ts +0 -1
  170. package/dist/integrations/reconciliation-config.d.ts.map +1 -1
  171. package/dist/integrations/reconciliation-config.js +1 -8
  172. package/dist/integrations/reconciliation-config.js.map +1 -1
  173. package/dist/integrations/slack/channel-reply-processor.js +1 -1
  174. package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
  175. package/dist/integrations/startup-summary.d.ts +8 -0
  176. package/dist/integrations/startup-summary.d.ts.map +1 -0
  177. package/dist/integrations/startup-summary.js +36 -0
  178. package/dist/integrations/startup-summary.js.map +1 -0
  179. package/dist/integrations/vanta/sync.d.ts +9 -5
  180. package/dist/integrations/vanta/sync.d.ts.map +1 -1
  181. package/dist/integrations/vanta/sync.js +16 -8
  182. package/dist/integrations/vanta/sync.js.map +1 -1
  183. package/dist/linked-repositories-changed.d.ts +14 -0
  184. package/dist/linked-repositories-changed.d.ts.map +1 -0
  185. package/dist/linked-repositories-changed.js +48 -0
  186. package/dist/linked-repositories-changed.js.map +1 -0
  187. package/dist/routes/contracts.d.ts +117 -0
  188. package/dist/routes/contracts.d.ts.map +1 -1
  189. package/dist/routes/contracts.js +44 -1
  190. package/dist/routes/contracts.js.map +1 -1
  191. package/dist/routes/run-queue.d.ts +17 -0
  192. package/dist/routes/run-queue.d.ts.map +1 -0
  193. package/dist/routes/run-queue.js +69 -0
  194. package/dist/routes/run-queue.js.map +1 -0
  195. package/dist/routes/surface.d.ts +8 -0
  196. package/dist/routes/surface.d.ts.map +1 -1
  197. package/dist/routes/surface.js +4 -2
  198. package/dist/routes/surface.js.map +1 -1
  199. package/dist/routes/work-item-selection.d.ts +4 -1
  200. package/dist/routes/work-item-selection.d.ts.map +1 -1
  201. package/dist/routes/work-item-selection.js +7 -2
  202. package/dist/routes/work-item-selection.js.map +1 -1
  203. package/dist/routes/work-items.d.ts +5 -0
  204. package/dist/routes/work-items.d.ts.map +1 -1
  205. package/dist/routes/work-items.js +17 -0
  206. package/dist/routes/work-items.js.map +1 -1
  207. package/dist/rules/dispatcher.d.ts +13 -1
  208. package/dist/rules/dispatcher.d.ts.map +1 -1
  209. package/dist/rules/dispatcher.js +9 -2
  210. package/dist/rules/dispatcher.js.map +1 -1
  211. package/dist/rules/review-source-tool.js +2 -1
  212. package/dist/rules/review-source-tool.js.map +1 -1
  213. package/dist/storage/domains/projects/base.d.ts +2 -0
  214. package/dist/storage/domains/projects/base.d.ts.map +1 -1
  215. package/dist/storage/domains/projects/base.js +13 -1
  216. package/dist/storage/domains/projects/base.js.map +1 -1
  217. package/dist/storage/domains/source-control/base.d.ts +32 -0
  218. package/dist/storage/domains/source-control/base.d.ts.map +1 -1
  219. package/dist/storage/domains/source-control/base.js +54 -4
  220. package/dist/storage/domains/source-control/base.js.map +1 -1
  221. package/dist/storage/domains/source-control/inmemory.d.ts +3 -0
  222. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
  223. package/dist/storage/domains/source-control/inmemory.js +17 -0
  224. package/dist/storage/domains/source-control/inmemory.js.map +1 -1
  225. package/dist/storage/domains/work-items/base.d.ts +1 -0
  226. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  227. package/dist/storage/domains/work-items/base.js +9 -0
  228. package/dist/storage/domains/work-items/base.js.map +1 -1
  229. package/dist/timing.d.ts +8 -1
  230. package/dist/timing.d.ts.map +1 -1
  231. package/dist/timing.js +10 -2
  232. package/dist/timing.js.map +1 -1
  233. package/dist/work-items/source-external-id.d.ts +4 -0
  234. package/dist/work-items/source-external-id.d.ts.map +1 -0
  235. package/dist/work-items/source-external-id.js +9 -0
  236. package/dist/work-items/source-external-id.js.map +1 -0
  237. package/package.json +8 -8
package/dist/timing.d.ts CHANGED
@@ -11,6 +11,13 @@ import type { Context } from 'hono';
11
11
  * commands). Off by default; enable per deployment with `FACTORY_TIMING=1`.
12
12
  */
13
13
  export declare const factoryTimingEnabled: boolean;
14
+ /**
15
+ * Boot diagnostics (phase timings, integration config) are on by default so
16
+ * slow or misconfigured deployed boots stay visible. `mastra factory dev`
17
+ * (`MASTRA_FACTORY_DEV=true`) keeps first boot quiet unless run with
18
+ * `--debug` (`MASTRA_FACTORY_DEBUG=true`) or `FACTORY_TIMING` is set.
19
+ */
20
+ export declare const bootDiagnosticsEnabled: boolean;
14
21
  export declare function logTiming(line: string): void;
15
22
  /** Run `fn`, logging its duration only when `FACTORY_TIMING` is enabled. */
16
23
  export declare function timed<T>(phase: string, fn: () => Promise<T>): Promise<T>;
@@ -29,7 +36,7 @@ export declare function instrumentMethods<T extends object>(target: T, label: st
29
36
  * when timing is disabled.
30
37
  */
31
38
  export declare function instrumentAsyncMethods<T extends object>(target: T, label: string): T;
32
- /** Run `fn`, always logging its duration under `phase`. Boot-phase use. */
39
+ /** Run `fn`, logging its duration under `phase` when `bootDiagnosticsEnabled`. Boot-phase use. */
33
40
  export declare function timedPhase<T>(phase: string, fn: () => Promise<T>): Promise<T>;
34
41
  /**
35
42
  * Run `fn`, logging only when it exceeds `thresholdMs`. Request-path use,
@@ -1 +1 @@
1
- {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../src/timing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,SAA2D,CAAC;AAE7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED,4EAA4E;AAC5E,wBAAsB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQ9E;AAED,kFAAkF;AAClF,wBAAgB,6BAA6B,QAC1B,OAAO,QAAQ,MAAM,OAAO,CAAC,IAAI,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAQpE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,M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MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAgB3G;AAmBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAyBpF;AAED,kGAAkG;AAClG,wBAAsB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQnF;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUjH"}
package/dist/timing.js CHANGED
@@ -4,6 +4,13 @@
4
4
  * commands). Off by default; enable per deployment with `FACTORY_TIMING=1`.
5
5
  */
6
6
  const factoryTimingEnabled = /^(1|true|yes)$/i.test(process.env.FACTORY_TIMING ?? "");
7
+ /**
8
+ * Boot diagnostics (phase timings, integration config) are on by default so
9
+ * slow or misconfigured deployed boots stay visible. `mastra factory dev`
10
+ * (`MASTRA_FACTORY_DEV=true`) keeps first boot quiet unless run with
11
+ * `--debug` (`MASTRA_FACTORY_DEBUG=true`) or `FACTORY_TIMING` is set.
12
+ */
13
+ const bootDiagnosticsEnabled = factoryTimingEnabled || process.env.MASTRA_FACTORY_DEV !== "true" || /^(1|true)$/i.test(process.env.MASTRA_FACTORY_DEBUG ?? "");
7
14
  function logTiming(line) {
8
15
  process.stderr.write(`[factory:timing] ${line}\n`);
9
16
  }
@@ -85,8 +92,9 @@ function instrumentAsyncMethods(target, label) {
85
92
  return fn;
86
93
  } });
87
94
  }
88
- /** Run `fn`, always logging its duration under `phase`. Boot-phase use. */
95
+ /** Run `fn`, logging its duration under `phase` when `bootDiagnosticsEnabled`. Boot-phase use. */
89
96
  async function timedPhase(phase, fn) {
97
+ if (!bootDiagnosticsEnabled) return fn();
90
98
  const start = performance.now();
91
99
  try {
92
100
  return await fn();
@@ -107,6 +115,6 @@ async function timedAboveThreshold(phase, thresholdMs, fn) {
107
115
  if (elapsed > thresholdMs) process.stderr.write(`[factory:timing] slow ${phase} ${Math.round(elapsed)}ms\n`);
108
116
  }
109
117
  }
110
- export { createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, instrumentMethods, logTiming, timed, timedAboveThreshold, timedPhase };
118
+ export { bootDiagnosticsEnabled, createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, instrumentMethods, logTiming, timed, timedAboveThreshold, timedPhase };
111
119
 
112
120
  //# sourceMappingURL=timing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"timing.js","names":[],"sources":["../src/timing.ts"],"sourcesContent":["/**\n * Lightweight phase timing for factory boot and hot request paths.\n *\n * Deliberately not a metrics framework: structured stderr lines that can be\n * grepped (`[factory:timing]`) and diffed across runs to localize slow boot\n * phases and slow per-request dependencies.\n */\n\nimport type { Context } from 'hono';\n\n/**\n * Verbose per-operation timing (HTTP requests, storage calls, sandbox\n * commands). Off by default; enable per deployment with `FACTORY_TIMING=1`.\n */\nexport const factoryTimingEnabled = /^(1|true|yes)$/i.test(process.env.FACTORY_TIMING ?? '');\n\nexport function logTiming(line: string): void {\n process.stderr.write(`[factory:timing] ${line}\\n`);\n}\n\n/** Run `fn`, logging its duration only when `FACTORY_TIMING` is enabled. */\nexport async function timed<T>(phase: string, fn: () => Promise<T>): Promise<T> {\n if (!factoryTimingEnabled) return fn();\n const start = performance.now();\n try {\n return await fn();\n } finally {\n logTiming(`${phase} ${Math.round(performance.now() - start)}ms`);\n }\n}\n\n/** Hono middleware logging method, path, status, and duration of each request. */\nexport function createRequestTimingMiddleware() {\n return async (c: Context, next: () => Promise<void>): Promise<void> => {\n const start = performance.now();\n try {\n await next();\n } finally {\n logTiming(`http ${c.req.method} ${c.req.path} ${c.res.status} ${Math.round(performance.now() - start)}ms`);\n }\n };\n}\n\n/**\n * Patch `methods` on `target` in place so each call logs `<label>.<method>`\n * duration. In-place (not a Proxy) so object identity is preserved.\n */\nexport function instrumentMethods<T extends object>(target: T, label: string, methods: readonly string[]): T {\n if (!factoryTimingEnabled) return target;\n const record = target as Record<string, unknown>;\n for (const name of methods) {\n const original = record[name];\n if (typeof original !== 'function') continue;\n record[name] = (...args: unknown[]) => {\n const start = performance.now();\n const result = original.apply(target, args);\n if (result instanceof Promise) {\n return result.finally(() => logTiming(`${label}.${name} ${Math.round(performance.now() - start)}ms`));\n }\n return result;\n };\n }\n return target;\n}\n\n/** Every method name on `target`'s prototype chain, excluding `Object.prototype`. */\nfunction prototypeMethodNames(target: object): string[] {\n const names = new Set<string>();\n for (\n let proto = Object.getPrototypeOf(target);\n proto && proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto)\n ) {\n for (const name of Object.getOwnPropertyNames(proto)) {\n if (name === 'constructor') continue;\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (typeof descriptor?.value === 'function') names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Wrap every async method on `target` so each call logs `<label>.<method>`\n * duration. Domains passed to a `registerDomain` method are instrumented in\n * place as `<label>.<domain name>`, so the handle it returns and later\n * `getDomain` lookups are the same timed object. Returns `target` unchanged\n * when timing is disabled.\n */\nexport function instrumentAsyncMethods<T extends object>(target: T, label: string): T {\n if (!factoryTimingEnabled) return target;\n const wrapped = new Map<PropertyKey, unknown>();\n return new Proxy(target, {\n get(obj, prop, receiver) {\n const value = Reflect.get(obj, prop, receiver);\n if (typeof value !== 'function' || typeof prop === 'symbol' || prop === 'constructor') return value;\n const cached = wrapped.get(prop);\n if (cached) return cached;\n const fn = (...args: unknown[]) => {\n const start = performance.now();\n const result = value.apply(obj, args);\n if (prop === 'registerDomain' && result && typeof result === 'object' && !(result instanceof Promise)) {\n const name = (result as { name?: unknown }).name;\n return instrumentMethods(result, `${label}.${String(name)}`, prototypeMethodNames(result));\n }\n if (result instanceof Promise) {\n return result.finally(() => logTiming(`${label}.${prop} ${Math.round(performance.now() - start)}ms`));\n }\n return result;\n };\n wrapped.set(prop, fn);\n return fn;\n },\n });\n}\n\n/** Run `fn`, always logging its duration under `phase`. Boot-phase use. */\nexport async function timedPhase<T>(phase: string, fn: () => Promise<T>): Promise<T> {\n const start = performance.now();\n try {\n return await fn();\n } finally {\n process.stderr.write(`[factory:timing] ${phase} ${Math.round(performance.now() - start)}ms\\n`);\n }\n}\n\n/**\n * Run `fn`, logging only when it exceeds `thresholdMs`. Request-path use,\n * where per-request logging would be noise but slow outliers must surface.\n */\nexport async function timedAboveThreshold<T>(phase: string, thresholdMs: number, fn: () => Promise<T>): Promise<T> {\n const start = performance.now();\n try {\n return await fn();\n } finally {\n const elapsed = performance.now() - start;\n if (elapsed > thresholdMs) {\n process.stderr.write(`[factory:timing] slow ${phase} ${Math.round(elapsed)}ms\\n`);\n }\n }\n}\n"],"mappings":";;;;;AAcA,MAAa,uBAAuB,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,EAAE;AAE3F,SAAgB,UAAU,MAAoB;CAC5C,QAAQ,OAAO,MAAM,oBAAoB,KAAK,GAAG;AACnD;;AAGA,eAAsB,MAAS,OAAe,IAAkC;CAC9E,IAAI,CAAC,sBAAsB,OAAO,GAAG;CACrC,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,UAAU,GAAG,MAAM,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,GAAG;CACjE;AACF;;AAGA,SAAgB,gCAAgC;CAC9C,OAAO,OAAO,GAAY,SAA6C;EACrE,MAAM,QAAQ,YAAY,IAAI;EAC9B,IAAI;GACF,MAAM,KAAK;EACb,UAAU;GACR,UAAU,QAAQ,EAAE,IAAI,OAAO,GAAG,EAAE,IAAI,KAAK,GAAG,EAAE,IAAI,OAAO,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AC/B,IAAI,QAAQ,OAAO;EACnB,MAAM,MAAM,GAAG,SAAoB;GACjC,MAAM,QAAQ,YAAY,IAAI;GAC9B,MAAM,SAAS,MAAM,MAAM,KAAK,IAAI;GACpC,IAAI,SAAS,oBAAoB,UAAU,OAAO,WAAW,YAAY,EAAE,kBAAkB,UAAU;IACrG,MAAM,OAAQ,OAA8B;IAC5C,OAAO,kBAAkB,QAAQ,GAAG,MAAM,GAAG,OAAO,IAAI,KAAK,qBAAqB,MAAM,CAAC;GAC3F;GACA,IAAI,kBAAkB,SACpB,OAAO,OAAO,cAAc,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,GAAG,CAAC;GAEtG,OAAO;EACT;EACA,QAAQ,IAAI,MAAM,EAAE;EACpB,OAAO;CACT,EACF,CAAC;AACH;;AAGA,eAAsB,WAAc,OAAe,IAAkC;CACnF,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,QAAQ,OAAO,MAAM,oBAAoB,MAAM,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,KAAK;CAC/F;AACF;;;;;AAMA,eAAsB,oBAAuB,OAAe,aAAqB,IAAkC;CACjH,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,MAAM,UAAU,YAAY,IAAI,IAAI;EACpC,IAAI,UAAU,aACZ,QAAQ,OAAO,MAAM,yBAAyB,MAAM,GAAG,KAAK,MAAM,OAAO,EAAE,KAAK;CAEpF;AACF"}
1
+ {"version":3,"file":"timing.js","names":[],"sources":["../src/timing.ts"],"sourcesContent":["/**\n * Lightweight phase timing for factory boot and hot request paths.\n *\n * Deliberately not a metrics framework: structured stderr lines that can be\n * grepped (`[factory:timing]`) and diffed across runs to localize slow boot\n * phases and slow per-request dependencies.\n */\n\nimport type { Context } from 'hono';\n\n/**\n * Verbose per-operation timing (HTTP requests, storage calls, sandbox\n * commands). Off by default; enable per deployment with `FACTORY_TIMING=1`.\n */\nexport const factoryTimingEnabled = /^(1|true|yes)$/i.test(process.env.FACTORY_TIMING ?? '');\n\n/**\n * Boot diagnostics (phase timings, integration config) are on by default so\n * slow or misconfigured deployed boots stay visible. `mastra factory dev`\n * (`MASTRA_FACTORY_DEV=true`) keeps first boot quiet unless run with\n * `--debug` (`MASTRA_FACTORY_DEBUG=true`) or `FACTORY_TIMING` is set.\n */\nexport const bootDiagnosticsEnabled =\n factoryTimingEnabled ||\n process.env.MASTRA_FACTORY_DEV !== 'true' ||\n /^(1|true)$/i.test(process.env.MASTRA_FACTORY_DEBUG ?? '');\n\nexport function logTiming(line: string): void {\n process.stderr.write(`[factory:timing] ${line}\\n`);\n}\n\n/** Run `fn`, logging its duration only when `FACTORY_TIMING` is enabled. */\nexport async function timed<T>(phase: string, fn: () => Promise<T>): Promise<T> {\n if (!factoryTimingEnabled) return fn();\n const start = performance.now();\n try {\n return await fn();\n } finally {\n logTiming(`${phase} ${Math.round(performance.now() - start)}ms`);\n }\n}\n\n/** Hono middleware logging method, path, status, and duration of each request. */\nexport function createRequestTimingMiddleware() {\n return async (c: Context, next: () => Promise<void>): Promise<void> => {\n const start = performance.now();\n try {\n await next();\n } finally {\n logTiming(`http ${c.req.method} ${c.req.path} ${c.res.status} ${Math.round(performance.now() - start)}ms`);\n }\n };\n}\n\n/**\n * Patch `methods` on `target` in place so each call logs `<label>.<method>`\n * duration. In-place (not a Proxy) so object identity is preserved.\n */\nexport function instrumentMethods<T extends object>(target: T, label: string, methods: readonly string[]): T {\n if (!factoryTimingEnabled) return target;\n const record = target as Record<string, unknown>;\n for (const name of methods) {\n const original = record[name];\n if (typeof original !== 'function') continue;\n record[name] = (...args: unknown[]) => {\n const start = performance.now();\n const result = original.apply(target, args);\n if (result instanceof Promise) {\n return result.finally(() => logTiming(`${label}.${name} ${Math.round(performance.now() - start)}ms`));\n }\n return result;\n };\n }\n return target;\n}\n\n/** Every method name on `target`'s prototype chain, excluding `Object.prototype`. */\nfunction prototypeMethodNames(target: object): string[] {\n const names = new Set<string>();\n for (\n let proto = Object.getPrototypeOf(target);\n proto && proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto)\n ) {\n for (const name of Object.getOwnPropertyNames(proto)) {\n if (name === 'constructor') continue;\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (typeof descriptor?.value === 'function') names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Wrap every async method on `target` so each call logs `<label>.<method>`\n * duration. Domains passed to a `registerDomain` method are instrumented in\n * place as `<label>.<domain name>`, so the handle it returns and later\n * `getDomain` lookups are the same timed object. Returns `target` unchanged\n * when timing is disabled.\n */\nexport function instrumentAsyncMethods<T extends object>(target: T, label: string): T {\n if (!factoryTimingEnabled) return target;\n const wrapped = new Map<PropertyKey, unknown>();\n return new Proxy(target, {\n get(obj, prop, receiver) {\n const value = Reflect.get(obj, prop, receiver);\n if (typeof value !== 'function' || typeof prop === 'symbol' || prop === 'constructor') return value;\n const cached = wrapped.get(prop);\n if (cached) return cached;\n const fn = (...args: unknown[]) => {\n const start = performance.now();\n const result = value.apply(obj, args);\n if (prop === 'registerDomain' && result && typeof result === 'object' && !(result instanceof Promise)) {\n const name = (result as { name?: unknown }).name;\n return instrumentMethods(result, `${label}.${String(name)}`, prototypeMethodNames(result));\n }\n if (result instanceof Promise) {\n return result.finally(() => logTiming(`${label}.${prop} ${Math.round(performance.now() - start)}ms`));\n }\n return result;\n };\n wrapped.set(prop, fn);\n return fn;\n },\n });\n}\n\n/** Run `fn`, logging its duration under `phase` when `bootDiagnosticsEnabled`. Boot-phase use. */\nexport async function timedPhase<T>(phase: string, fn: () => Promise<T>): Promise<T> {\n if (!bootDiagnosticsEnabled) return fn();\n const start = performance.now();\n try {\n return await fn();\n } finally {\n process.stderr.write(`[factory:timing] ${phase} ${Math.round(performance.now() - start)}ms\\n`);\n }\n}\n\n/**\n * Run `fn`, logging only when it exceeds `thresholdMs`. Request-path use,\n * where per-request logging would be noise but slow outliers must surface.\n */\nexport async function timedAboveThreshold<T>(phase: string, thresholdMs: number, fn: () => Promise<T>): Promise<T> {\n const start = performance.now();\n try {\n return await fn();\n } finally {\n const elapsed = performance.now() - start;\n if (elapsed > thresholdMs) {\n process.stderr.write(`[factory:timing] slow ${phase} ${Math.round(elapsed)}ms\\n`);\n }\n }\n}\n"],"mappings":";;;;;AAcA,MAAa,uBAAuB,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,EAAE;;;;;;;AAQ3F,MAAa,yBACX,wBACA,QAAQ,IAAI,uBAAuB,UACnC,cAAc,KAAK,QAAQ,IAAI,wBAAwB,EAAE;AAE3D,SAAgB,UAAU,MAAoB;CAC5C,QAAQ,OAAO,MAAM,oBAAoB,KAAK,GAAG;AACnD;;AAGA,eAAsB,MAAS,OAAe,IAAkC;CAC9E,IAAI,CAAC,sBAAsB,OAAO,GAAG;CACrC,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,UAAU,GAAG,MAAM,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,GAAG;CACjE;AACF;;AAGA,SAAgB,gCAAgC;CAC9C,OAAO,OAAO,GAAY,SAA6C;EACrE,MAAM,QAAQ,YAAY,IAAI;EAC9B,IAAI;GACF,MAAM,KAAK;EACb,UAAU;GACR,UAAU,QAAQ,EAAE,IAAI,OAAO,GAAG,EAAE,IAAI,KAAK,GAAG,EAAE,IAAI,OAAO,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,GAAG;EAC3G;CACF;AACF;;;;;AAMA,SAAgB,kBAAoC,QAAW,OAAe,SAA+B;CAC3G,IAAI,CAAC,sBAAsB,OAAO;CAClC,MAAM,SAAS;CACf,KAAK,MAAM,QAAQ,SAAS;EAC1B,MAAM,WAAW,OAAO;EACxB,IAAI,OAAO,aAAa,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B,QAAQ,GAAG,MAAM,GAAG,OAAO,IAAI,KAAK,qBAAqB,MAAM,CAAC;GAC3F;GACA,IAAI,kBAAkB,SACpB,OAAO,OAAO,cAAc,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,GAAG,CAAC;GAEtG,OAAO;EACT;EACA,QAAQ,IAAI,MAAM,EAAE;EACpB,OAAO;CACT,EACF,CAAC;AACH;;AAGA,eAAsB,WAAc,OAAe,IAAkC;CACnF,IAAI,CAAC,wBAAwB,OAAO,GAAG;CACvC,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,QAAQ,OAAO,MAAM,oBAAoB,MAAM,GAAG,KAAK,MAAM,YAAY,IAAI,IAAI,KAAK,EAAE,KAAK;CAC/F;AACF;;;;;AAMA,eAAsB,oBAAuB,OAAe,aAAqB,IAAkC;CACjH,MAAM,QAAQ,YAAY,IAAI;CAC9B,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,UAAU;EACR,MAAM,UAAU,YAAY,IAAI,IAAI;EACpC,IAAI,UAAU,aACZ,QAAQ,OAAO,MAAM,yBAAyB,MAAM,GAAG,KAAK,MAAM,OAAO,EAAE,KAAK;CAEpF;AACF"}
@@ -0,0 +1,4 @@
1
+ import type { WorkItemSourceRow } from '../storage/domains/work-items/work-item-schema.js';
2
+ /** A source row's external id without the type/workspace scope storage prefixes it with. */
3
+ export declare function sourceExternalId(source: Pick<WorkItemSourceRow, 'sourceType' | 'workspaceId' | 'externalId'>): string;
4
+ //# sourceMappingURL=source-external-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-external-id.d.ts","sourceRoot":"","sources":["../../src/work-items/source-external-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAE3F,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC,GAAG,MAAM,CAGrH"}
@@ -0,0 +1,9 @@
1
+ // src/work-items/source-external-id.ts
2
+ /** A source row's external id without the type/workspace scope storage prefixes it with. */
3
+ function sourceExternalId(source) {
4
+ const prefix = `${source.sourceType}:${source.workspaceId ? `${source.workspaceId}:` : ""}`;
5
+ return source.externalId.startsWith(prefix) ? source.externalId.slice(prefix.length) : source.externalId;
6
+ }
7
+ export { sourceExternalId };
8
+
9
+ //# sourceMappingURL=source-external-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-external-id.js","names":[],"sources":["../../src/work-items/source-external-id.ts"],"sourcesContent":["import type { WorkItemSourceRow } from '../storage/domains/work-items/work-item-schema.js';\n\n/** A source row's external id without the type/workspace scope storage prefixes it with. */\nexport function sourceExternalId(source: Pick<WorkItemSourceRow, 'sourceType' | 'workspaceId' | 'externalId'>): string {\n const prefix = `${source.sourceType}:${source.workspaceId ? `${source.workspaceId}:` : ''}`;\n return source.externalId.startsWith(prefix) ? source.externalId.slice(prefix.length) : source.externalId;\n}\n"],"mappings":";;AAGA,SAAgB,iBAAiB,QAAsF;CACrH,MAAM,SAAS,GAAG,OAAO,WAAW,GAAG,OAAO,cAAc,GAAG,OAAO,YAAY,KAAK;CACvF,OAAO,OAAO,WAAW,WAAW,MAAM,IAAI,OAAO,WAAW,MAAM,OAAO,MAAM,IAAI,OAAO;AAChG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/factory",
3
- "version": "0.29.0-alpha.0",
3
+ "version": "0.29.0-alpha.1",
4
4
  "description": "Mastra Software Factory module: the server core behind the Mastra Software Factory — storage domains, integrations, and surfaces for agent-powered software delivery",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -60,9 +60,9 @@
60
60
  "zod": "^4.6.7",
61
61
  "@mastra/auth-studio": "1.4.0",
62
62
  "@mastra/auth-workos": "1.6.9",
63
- "@mastra/code-sdk": "1.19.1-alpha.0",
64
- "@mastra/connect": "1.4.0",
65
- "@mastra/core": "1.84.0-alpha.0",
63
+ "@mastra/code-sdk": "1.19.1-alpha.1",
64
+ "@mastra/connect": "1.4.1-alpha.0",
65
+ "@mastra/core": "1.84.0-alpha.1",
66
66
  "@mastra/mcp": "2.9.0",
67
67
  "@mastra/platform-workspace": "1.13.0",
68
68
  "@mastra/slack": "1.9.0"
@@ -77,10 +77,10 @@
77
77
  "@internal/lint": "0.0.149",
78
78
  "@internal/types-builder": "0.0.124",
79
79
  "@internal/workspace": "0.0.21",
80
- "@mastra/deployer": "1.84.0-alpha.0",
81
- "@mastra/libsql": "1.30.0",
82
- "@mastra/pg": "1.36.0",
83
- "@mastra/server": "1.84.0-alpha.0"
80
+ "@mastra/deployer": "1.84.0-alpha.1",
81
+ "@mastra/libsql": "1.30.1-alpha.0",
82
+ "@mastra/pg": "1.36.1-alpha.0",
83
+ "@mastra/server": "1.84.0-alpha.1"
84
84
  },
85
85
  "engines": {
86
86
  "node": ">=22.19.0"