@mastra/factory 0.13.0-alpha.6 → 0.13.0-alpha.7

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 (78) hide show
  1. package/README.md +35 -0
  2. package/dist/boards/index.d.ts +4 -3
  3. package/dist/boards/index.d.ts.map +1 -1
  4. package/dist/boards/index.js +2 -1
  5. package/dist/boards/index.js.map +1 -1
  6. package/dist/boards/registry.d.ts +16 -0
  7. package/dist/boards/registry.d.ts.map +1 -0
  8. package/dist/boards/registry.js +27 -0
  9. package/dist/boards/registry.js.map +1 -0
  10. package/dist/boards/review.js +1 -1
  11. package/dist/boards/work.js +2 -2
  12. package/dist/factory.d.ts +6 -1
  13. package/dist/factory.d.ts.map +1 -1
  14. package/dist/factory.js +10 -0
  15. package/dist/factory.js.map +1 -1
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -2
  19. package/dist/integrations/github/default-rules.d.ts +194 -0
  20. package/dist/integrations/github/default-rules.d.ts.map +1 -0
  21. package/dist/integrations/github/default-rules.js +230 -0
  22. package/dist/integrations/github/default-rules.js.map +1 -0
  23. package/dist/integrations/github/integration.d.ts +4 -0
  24. package/dist/integrations/github/integration.d.ts.map +1 -1
  25. package/dist/integrations/github/integration.js +6 -0
  26. package/dist/integrations/github/integration.js.map +1 -1
  27. package/dist/integrations/github/rules.d.ts +3 -1
  28. package/dist/integrations/github/rules.d.ts.map +1 -1
  29. package/dist/integrations/github/rules.js +1 -2
  30. package/dist/integrations/github/rules.js.map +1 -1
  31. package/dist/integrations/linear/rules.js +1 -1
  32. package/dist/integrations/platform/github/integration.d.ts +4 -0
  33. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  34. package/dist/integrations/platform/github/integration.js +6 -0
  35. package/dist/integrations/platform/github/integration.js.map +1 -1
  36. package/dist/integrations/slack/slack.d.ts +3 -1
  37. package/dist/integrations/slack/slack.d.ts.map +1 -1
  38. package/dist/integrations/slack/slack.js +19 -1
  39. package/dist/integrations/slack/slack.js.map +1 -1
  40. package/dist/routes/surface.d.ts +3 -0
  41. package/dist/routes/surface.d.ts.map +1 -1
  42. package/dist/routes/surface.js +2 -1
  43. package/dist/routes/surface.js.map +1 -1
  44. package/dist/routes/work-items.d.ts +3 -0
  45. package/dist/routes/work-items.d.ts.map +1 -1
  46. package/dist/routes/work-items.js +48 -15
  47. package/dist/routes/work-items.js.map +1 -1
  48. package/dist/rules/defaults.d.ts.map +1 -1
  49. package/dist/rules/defaults.js +1 -229
  50. package/dist/rules/defaults.js.map +1 -1
  51. package/dist/rules/index.d.ts +2 -2
  52. package/dist/rules/index.d.ts.map +1 -1
  53. package/dist/rules/index.js +2 -2
  54. package/dist/rules/processor.d.ts +2 -0
  55. package/dist/rules/processor.d.ts.map +1 -1
  56. package/dist/rules/processor.js +9 -7
  57. package/dist/rules/processor.js.map +1 -1
  58. package/dist/rules/resolve.d.ts +4 -4
  59. package/dist/rules/resolve.d.ts.map +1 -1
  60. package/dist/rules/resolve.js +4 -6
  61. package/dist/rules/resolve.js.map +1 -1
  62. package/dist/rules/transition-service.d.ts +2 -0
  63. package/dist/rules/transition-service.d.ts.map +1 -1
  64. package/dist/rules/transition-service.js +16 -10
  65. package/dist/rules/transition-service.js.map +1 -1
  66. package/dist/rules/types.d.ts +3 -8
  67. package/dist/rules/types.d.ts.map +1 -1
  68. package/dist/rules/types.js +1 -1
  69. package/dist/rules/types.js.map +1 -1
  70. package/dist/rules/validation.d.ts.map +1 -1
  71. package/dist/rules/validation.js +1 -9
  72. package/dist/rules/validation.js.map +1 -1
  73. package/dist/storage/domains/work-items/base.d.ts +11 -1
  74. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  75. package/dist/storage/domains/work-items/base.js +22 -2
  76. package/dist/storage/domains/work-items/base.js.map +1 -1
  77. package/factory-skills/configure-factory-rules/SKILL.md +12 -4
  78. package/package.json +6 -6
@@ -12,18 +12,26 @@ Help the user change Factory policy in the typed deployment configuration. Facto
12
12
  1. Search for `new MastraFactory`, `defaultFactoryRules`, and the `rules` property.
13
13
  2. Read the existing rule configuration and its tests before editing.
14
14
  3. Import rule helpers and types from the same local Factory module used by the deployment.
15
- 4. If the deployment doesn't configure `rules`, start with `defaultFactoryRules({ version, overrides })` and pass the result to `MastraFactory`.
15
+ 4. For board, tool, or Linear rules, start with `defaultFactoryRules({ version, overrides })` if needed and pass the result to `MastraFactory`. For GitHub rules, configure the installed GitHub integration constructor directly.
16
16
 
17
17
  Do not guess a file path. Factory deployments can assemble `MastraFactory` from different entry points.
18
18
 
19
19
  ## Preserve the public shape
20
20
 
21
- Use one rules tree:
21
+ Use the global rules tree for board, tool, and Linear handlers:
22
22
 
23
23
  - `work.<stage>.<source>.onEnter` or `onExit`
24
24
  - `review.<stage>.<source>.onEnter` or `onExit`
25
25
  - `tools.<toolName>.onResult`
26
- - `github.<event>.onEvent`
26
+ - `linear.<event>.onEvent`
27
+
28
+ Configure GitHub on the installed `GithubIntegration` or `PlatformGithubIntegration` constructor instead:
29
+
30
+ ```typescript
31
+ new PlatformGithubIntegration({ rules: { issueCommentCreated: null } });
32
+ ```
33
+
34
+ GitHub integrations exclusively own their event handlers; configure them through constructor `rules[event]`, not the global Factory rules tree. A function replaces the default, `null` disables that event's handler, and omitted or `undefined` values retain defaults. Constructors validate names and handler values, then copy and freeze the effective map per instance. Disabling a handler does not disable webhook authentication or reconciliation bookkeeping.
27
35
 
28
36
  Do not create an `actions` config or execute authoritative policy in React. Each handler returns one typed `FactoryRuleDecision` or `undefined`.
29
37
 
@@ -35,7 +43,7 @@ An override replaces the exact handler leaf. It does not compose with the built-
35
43
 
36
44
  Before replacing a built-in leaf:
37
45
 
38
- 1. Read the built-in handler in `src/web/factory/rules/defaults.ts`.
46
+ 1. Find and read the built-in handler: GitHub handlers live in `src/integrations/github/default-rules.ts` within the Factory package; global defaults live in `src/rules/defaults.ts`.
39
47
  2. Decide whether the replacement must preserve part of that behavior explicitly.
40
48
  3. Use only fields exposed by the typed context. Do not reach into Factory storage or raw webhook payloads.
41
49
  4. Return `undefined` to allow the ingress with no decision, or return a typed rejection or bounded structured decision.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/factory",
3
- "version": "0.13.0-alpha.6",
3
+ "version": "0.13.0-alpha.7",
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": {
@@ -52,9 +52,9 @@
52
52
  "zod": "^4.3.6",
53
53
  "@mastra/auth-studio": "1.3.5",
54
54
  "@mastra/auth-workos": "1.6.5",
55
- "@mastra/code-sdk": "1.7.0-alpha.5",
56
- "@mastra/core": "1.65.0-alpha.4",
57
- "@mastra/slack": "1.6.3"
55
+ "@mastra/slack": "1.6.3",
56
+ "@mastra/code-sdk": "1.7.0-alpha.6",
57
+ "@mastra/core": "1.65.0-alpha.5"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "22.20.1",
@@ -63,9 +63,9 @@
63
63
  "typescript": "^6.0.3",
64
64
  "typescript-eslint": "^8.57.0",
65
65
  "vitest": "4.1.10",
66
- "@mastra/libsql": "1.22.4-alpha.0",
67
- "@mastra/pg": "1.23.0-alpha.1",
68
66
  "@internal/lint": "0.0.130",
67
+ "@mastra/pg": "1.23.0-alpha.1",
68
+ "@mastra/libsql": "1.22.4-alpha.0",
69
69
  "@internal/workspace": "0.0.2",
70
70
  "@internal/types-builder": "0.0.105"
71
71
  },