@mastra/factory 0.1.0-alpha.7 → 0.1.0-alpha.9
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.
- package/CHANGELOG.md +20 -0
- package/dist/factory.js +31 -8
- package/dist/factory.js.map +1 -1
- package/dist/index.js +31 -8
- package/dist/index.js.map +1 -1
- package/dist/rules/defaults.d.ts.map +1 -1
- package/dist/rules/defaults.js +20 -6
- package/dist/rules/defaults.js.map +1 -1
- package/dist/rules/index.js +20 -6
- package/dist/rules/index.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +11 -2
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-plan/SKILL.md +61 -0
- package/factory-skills/factory-review/SKILL.md +73 -0
- package/factory-skills/factory-triage/SKILL.md +77 -0
- package/package.json +7 -7
- package/factory-skills/understand-issue/SKILL.md +0 -251
- package/factory-skills/understand-pr/SKILL.md +0 -270
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @mastra/factory
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed GitHub PATs saved in Settings not taking effect for the gh CLI in already-running Factory sessions until the server was restarted ([#20069](https://github.com/mastra-ai/mastra/pull/20069))
|
|
8
|
+
|
|
9
|
+
- Fixed web chat sessions getting stuck in a "Connection lost — reconnecting…" loop while the session workspace was still starting up ([#20067](https://github.com/mastra-ai/mastra/pull/20067))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.8
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Added autonomous first-pass skills to the Software Factory. Work items now get an automatic investigation, planning, or review pass as soon as they enter the matching board column — no human input needed mid-run: ([#20058](https://github.com/mastra-ai/mastra/pull/20058))
|
|
16
|
+
|
|
17
|
+
- **factory-triage** runs when an issue enters triage: it investigates the issue, diagnoses the root cause, and requests a move to planning (or done if the issue should be closed).
|
|
18
|
+
- **factory-plan** runs when an item enters planning: it produces a phased implementation plan and requests a move to execute.
|
|
19
|
+
- **factory-review** runs when a pull request enters review: it reviews the changes, posts a verdict, and requests completion.
|
|
20
|
+
|
|
21
|
+
Instead of stopping to ask questions, the skills decide and record each decision as an assumption, batching assumptions and genuinely-human questions into one terminal handoff message. The superseded interactive skills (understand-issue, understand-pr) were removed.
|
|
22
|
+
|
|
3
23
|
## 0.1.0-alpha.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/factory.js
CHANGED
|
@@ -35423,9 +35423,9 @@ function trustedGithubActor(context) {
|
|
|
35423
35423
|
function invokeIssueInvestigation(context) {
|
|
35424
35424
|
return {
|
|
35425
35425
|
type: "invokeSkill",
|
|
35426
|
-
idempotencyKey: `${context.ingress.id}:
|
|
35426
|
+
idempotencyKey: `${context.ingress.id}:factory-triage`,
|
|
35427
35427
|
role: "triage",
|
|
35428
|
-
skillName: "
|
|
35428
|
+
skillName: "factory-triage",
|
|
35429
35429
|
arguments: context.item.url ? `GitHub issue (${context.item.url})` : context.item.title
|
|
35430
35430
|
};
|
|
35431
35431
|
}
|
|
@@ -35436,18 +35436,27 @@ function investigateTriagedLinearIssue(context) {
|
|
|
35436
35436
|
const identifier = context.item.sourceKey?.startsWith("linear:") ? context.item.sourceKey.slice("linear:".length) : context.item.title;
|
|
35437
35437
|
return {
|
|
35438
35438
|
type: "invokeSkill",
|
|
35439
|
-
idempotencyKey: `${context.ingress.id}:
|
|
35439
|
+
idempotencyKey: `${context.ingress.id}:factory-triage-linear`,
|
|
35440
35440
|
role: "triage",
|
|
35441
|
-
skillName: "
|
|
35441
|
+
skillName: "factory-triage",
|
|
35442
35442
|
arguments: `Linear issue ${identifier}${context.item.url ? ` (${context.item.url})` : ""}`
|
|
35443
35443
|
};
|
|
35444
35444
|
}
|
|
35445
|
+
function planWorkItem(context) {
|
|
35446
|
+
return {
|
|
35447
|
+
type: "invokeSkill",
|
|
35448
|
+
idempotencyKey: `${context.ingress.id}:factory-plan`,
|
|
35449
|
+
role: "plan",
|
|
35450
|
+
skillName: "factory-plan",
|
|
35451
|
+
arguments: context.item.url ? `Work item (${context.item.url})` : context.item.title
|
|
35452
|
+
};
|
|
35453
|
+
}
|
|
35445
35454
|
function reviewPullRequest(context) {
|
|
35446
35455
|
return {
|
|
35447
35456
|
type: "invokeSkill",
|
|
35448
|
-
idempotencyKey: `${context.ingress.id}:
|
|
35457
|
+
idempotencyKey: `${context.ingress.id}:factory-review`,
|
|
35449
35458
|
role: "review",
|
|
35450
|
-
skillName: "
|
|
35459
|
+
skillName: "factory-review",
|
|
35451
35460
|
arguments: context.item.url ? `GitHub pull request (${context.item.url})` : context.item.title
|
|
35452
35461
|
};
|
|
35453
35462
|
}
|
|
@@ -35545,6 +35554,11 @@ var BUILT_IN_DEFAULTS = {
|
|
|
35545
35554
|
triage: {
|
|
35546
35555
|
issue: { onEnter: investigateTriagedIssue },
|
|
35547
35556
|
linearIssue: { onEnter: investigateTriagedLinearIssue }
|
|
35557
|
+
},
|
|
35558
|
+
planning: {
|
|
35559
|
+
issue: { onEnter: planWorkItem },
|
|
35560
|
+
linearIssue: { onEnter: planWorkItem },
|
|
35561
|
+
manual: { onEnter: planWorkItem }
|
|
35548
35562
|
}
|
|
35549
35563
|
},
|
|
35550
35564
|
review: { review: { pullRequest: { onEnter: reviewPullRequest } } },
|
|
@@ -38462,7 +38476,7 @@ var FACTORY_SKILLS_SOURCE_PATH = [
|
|
|
38462
38476
|
join3(process.cwd(), "src", "mastra", "public", "factory-skills")
|
|
38463
38477
|
].find(existsSync2) ?? bundledFactorySkillsPath;
|
|
38464
38478
|
var FACTORY_SKILLS_MOUNT = path2.resolve(path2.parse(process.cwd()).root, "__mastracode_factory_skills__");
|
|
38465
|
-
var FACTORY_SKILL_NAMES = /* @__PURE__ */ new Set(["configure-factory-rules", "
|
|
38479
|
+
var FACTORY_SKILL_NAMES = /* @__PURE__ */ new Set(["configure-factory-rules", "factory-plan", "factory-review", "factory-triage"]);
|
|
38466
38480
|
var FactorySkillSource = class {
|
|
38467
38481
|
constructor(fallback, fallbackSkillRoots) {
|
|
38468
38482
|
this.fallback = fallback;
|
|
@@ -38566,6 +38580,13 @@ function createWorkspaceFactory(options = {}) {
|
|
|
38566
38580
|
if (registered) {
|
|
38567
38581
|
registerGithubTokenInjector(requestContext, registered.inject);
|
|
38568
38582
|
registerGithubPatKind(requestContext, registered.patKind);
|
|
38583
|
+
try {
|
|
38584
|
+
const pat = await getGithubPat(() => github.integrationStorage, session.orgId, registered.patKind);
|
|
38585
|
+
if (pat && pat !== registered.ghToken) {
|
|
38586
|
+
registered.inject(pat);
|
|
38587
|
+
}
|
|
38588
|
+
} catch {
|
|
38589
|
+
}
|
|
38569
38590
|
}
|
|
38570
38591
|
return existing;
|
|
38571
38592
|
}
|
|
@@ -38612,8 +38633,10 @@ function createWorkspaceFactory(options = {}) {
|
|
|
38612
38633
|
throw new Error("The active sandbox provider does not support runtime GitHub token refresh.");
|
|
38613
38634
|
}
|
|
38614
38635
|
sandbox.setEnvironmentVariable("GH_TOKEN", freshToken);
|
|
38636
|
+
const registered = githubTokenInjectors.get(workspaceId);
|
|
38637
|
+
if (registered) registered.ghToken = freshToken;
|
|
38615
38638
|
};
|
|
38616
|
-
githubTokenInjectors.set(workspaceId, { inject: injectGithubToken2, patKind });
|
|
38639
|
+
githubTokenInjectors.set(workspaceId, { inject: injectGithubToken2, patKind, ghToken: ghCliToken });
|
|
38617
38640
|
registerGithubTokenInjector(requestContext, injectGithubToken2);
|
|
38618
38641
|
registerGithubPatKind(requestContext, patKind);
|
|
38619
38642
|
const filesystem = new SandboxFilesystem({ sandbox, workdir });
|