@mastra/factory 0.16.0-alpha.9 → 0.16.0
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/README.md +37 -0
- package/dist/auth.js +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/boards/review.d.ts.map +1 -1
- package/dist/boards/review.js +19 -8
- package/dist/boards/review.js.map +1 -1
- package/dist/boards/work.d.ts.map +1 -1
- package/dist/boards/work.js +31 -3
- package/dist/boards/work.js.map +1 -1
- package/dist/capabilities/intake.d.ts +4 -0
- package/dist/capabilities/intake.d.ts.map +1 -1
- package/dist/capabilities/version-control.d.ts +15 -0
- package/dist/capabilities/version-control.d.ts.map +1 -1
- package/dist/factory.d.ts +7 -7
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +100 -40
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +3 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/github/integration.d.ts.map +1 -1
- package/dist/integrations/github/integration.js +21 -0
- package/dist/integrations/github/integration.js.map +1 -1
- package/dist/integrations/github/routes.js +2 -1
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +41 -42
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +416 -227
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/github/webhook.d.ts +2 -5
- package/dist/integrations/github/webhook.d.ts.map +1 -1
- package/dist/integrations/github/webhook.js +8 -48
- package/dist/integrations/github/webhook.js.map +1 -1
- package/dist/integrations/gitlab/agent-tools.d.ts +14 -0
- package/dist/integrations/gitlab/agent-tools.d.ts.map +1 -0
- package/dist/integrations/gitlab/agent-tools.js +42 -0
- package/dist/integrations/gitlab/agent-tools.js.map +1 -0
- package/dist/integrations/gitlab/api.d.ts +222 -0
- package/dist/integrations/gitlab/api.d.ts.map +1 -0
- package/dist/integrations/gitlab/api.js +274 -0
- package/dist/integrations/gitlab/api.js.map +1 -0
- package/dist/integrations/gitlab/default-rules.d.ts +125 -0
- package/dist/integrations/gitlab/default-rules.d.ts.map +1 -0
- package/dist/integrations/gitlab/default-rules.js +172 -0
- package/dist/integrations/gitlab/default-rules.js.map +1 -0
- package/dist/integrations/gitlab/integration.d.ts +138 -0
- package/dist/integrations/gitlab/integration.d.ts.map +1 -0
- package/dist/integrations/gitlab/integration.js +705 -0
- package/dist/integrations/gitlab/integration.js.map +1 -0
- package/dist/integrations/gitlab/issue-reconciler.d.ts +6 -0
- package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/issue-reconciler.js +123 -0
- package/dist/integrations/gitlab/issue-reconciler.js.map +1 -0
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts +6 -0
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/merge-request-reconciler.js +267 -0
- package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -0
- package/dist/integrations/gitlab/reconciler.d.ts +5 -0
- package/dist/integrations/gitlab/reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/reconciler.js +31 -0
- package/dist/integrations/gitlab/reconciler.js.map +1 -0
- package/dist/integrations/gitlab/reconciliation-config.d.ts +3 -0
- package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/gitlab/reconciliation-config.js +17 -0
- package/dist/integrations/gitlab/reconciliation-config.js.map +1 -0
- package/dist/integrations/gitlab/routes.d.ts +20 -0
- package/dist/integrations/gitlab/routes.d.ts.map +1 -0
- package/dist/integrations/gitlab/routes.js +473 -0
- package/dist/integrations/gitlab/routes.js.map +1 -0
- package/dist/integrations/gitlab/rules.d.ts +35 -0
- package/dist/integrations/gitlab/rules.d.ts.map +1 -0
- package/dist/integrations/gitlab/rules.js +391 -0
- package/dist/integrations/gitlab/rules.js.map +1 -0
- package/dist/integrations/gitlab/session-subscriptions.d.ts +32 -0
- package/dist/integrations/gitlab/session-subscriptions.d.ts.map +1 -0
- package/dist/integrations/gitlab/session-subscriptions.js +192 -0
- package/dist/integrations/gitlab/session-subscriptions.js.map +1 -0
- package/dist/integrations/gitlab/subscriptions.d.ts +70 -0
- package/dist/integrations/gitlab/subscriptions.d.ts.map +1 -0
- package/dist/integrations/gitlab/subscriptions.js +76 -0
- package/dist/integrations/gitlab/subscriptions.js.map +1 -0
- package/dist/integrations/gitlab/version-control.d.ts +16 -0
- package/dist/integrations/gitlab/version-control.d.ts.map +1 -0
- package/dist/integrations/gitlab/version-control.js +622 -0
- package/dist/integrations/gitlab/version-control.js.map +1 -0
- package/dist/integrations/gitlab/webhook-dispatch.d.ts +75 -0
- package/dist/integrations/gitlab/webhook-dispatch.d.ts.map +1 -0
- package/dist/integrations/gitlab/webhook-dispatch.js +235 -0
- package/dist/integrations/gitlab/webhook-dispatch.js.map +1 -0
- package/dist/integrations/gitlab/webhook.d.ts +72 -0
- package/dist/integrations/gitlab/webhook.d.ts.map +1 -0
- package/dist/integrations/gitlab/webhook.js +201 -0
- package/dist/integrations/gitlab/webhook.js.map +1 -0
- package/dist/integrations/incidentio/integration.js +1 -1
- package/dist/integrations/issue-reconciler.d.ts +3 -3
- package/dist/integrations/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/issue-reconciler.js +22 -2
- package/dist/integrations/issue-reconciler.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +21 -0
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/gitlab/event-worker.d.ts +64 -0
- package/dist/integrations/platform/gitlab/event-worker.d.ts.map +1 -0
- package/dist/integrations/platform/gitlab/event-worker.js +306 -0
- package/dist/integrations/platform/gitlab/event-worker.js.map +1 -0
- package/dist/integrations/platform/gitlab/integration.d.ts +57 -0
- package/dist/integrations/platform/gitlab/integration.d.ts.map +1 -0
- package/dist/integrations/platform/gitlab/integration.js +125 -0
- package/dist/integrations/platform/gitlab/integration.js.map +1 -0
- package/dist/integrations/platform/incidentio/integration.js +1 -1
- package/dist/integrations/slack/integration.d.ts.map +1 -1
- package/dist/integrations/slack/integration.js +3 -3
- package/dist/integrations/slack/integration.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts +2 -0
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +21 -7
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/integrations/subscription-session.d.ts +37 -0
- package/dist/integrations/subscription-session.d.ts.map +1 -0
- package/dist/integrations/subscription-session.js +83 -0
- package/dist/integrations/subscription-session.js.map +1 -0
- package/dist/packages/_internals/workspace/dist/index.js +1 -11
- package/dist/packages/_internals/workspace/dist/index.js.map +1 -1
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +4 -2
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/oauth.js +1 -1
- package/dist/routes/projects.d.ts +1 -0
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +1 -0
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/source-control-sessions.d.ts +20 -0
- package/dist/routes/source-control-sessions.d.ts.map +1 -0
- package/dist/routes/source-control-sessions.js +319 -0
- package/dist/routes/source-control-sessions.js.map +1 -0
- package/dist/routes/source-control-settings.d.ts +10 -0
- package/dist/routes/source-control-settings.d.ts.map +1 -0
- package/dist/routes/source-control-settings.js +87 -0
- package/dist/routes/source-control-settings.js.map +1 -0
- package/dist/routes/surface.d.ts +3 -3
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +55 -13
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/tenant-credentials.d.ts +8 -0
- package/dist/routes/tenant-credentials.d.ts.map +1 -1
- package/dist/routes/tenant-credentials.js +20 -3
- package/dist/routes/tenant-credentials.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +1 -1
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +7 -1
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +1 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +3 -2
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +6 -3
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +67 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +23 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +2 -0
- package/dist/rules/validation.js.map +1 -1
- package/dist/sandbox/git-ref.d.ts +7 -0
- package/dist/sandbox/git-ref.d.ts.map +1 -0
- package/dist/sandbox/git-ref.js +15 -0
- package/dist/sandbox/git-ref.js.map +1 -0
- package/dist/sandbox/session-retirement.js +1 -1
- package/dist/sandbox/workdir.d.ts.map +1 -1
- package/dist/sandbox/workdir.js +6 -6
- package/dist/sandbox/workdir.js.map +1 -1
- package/dist/session/factory-session.d.ts +31 -1
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +60 -1
- package/dist/session/factory-session.js.map +1 -1
- package/dist/session/source-control-tools.d.ts +16 -0
- package/dist/session/source-control-tools.d.ts.map +1 -0
- package/dist/session/source-control-tools.js +464 -0
- package/dist/session/source-control-tools.js.map +1 -0
- package/dist/storage/domains/intake/base.d.ts +18 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -1
- package/dist/storage/domains/intake/base.js +77 -0
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/work-item-branch.d.ts +3 -1
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +22 -4
- package/dist/work-item-branch.js.map +1 -1
- package/dist/workspace.d.ts +15 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +57 -23
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-gitlab-rereview/SKILL.md +19 -0
- package/factory-skills/factory-gitlab-review/SKILL.md +30 -0
- package/factory-skills/factory-rereview/SKILL.md +13 -6
- package/factory-skills/factory-review/SKILL.md +13 -6
- package/factory-skills/factory-review/references/archaeology.md +225 -0
- package/factory-skills/factory-review/references/categories/README.md +34 -0
- package/factory-skills/factory-review/references/categories/behavior-change.md +36 -0
- package/factory-skills/factory-review/references/categories/bug-fix.md +37 -0
- package/factory-skills/factory-review/references/categories/docs.md +32 -0
- package/factory-skills/factory-review/references/categories/experimental-flagged.md +34 -0
- package/factory-skills/factory-review/references/categories/infra-tooling.md +37 -0
- package/factory-skills/factory-review/references/categories/internal-capability.md +35 -0
- package/factory-skills/factory-review/references/categories/large-cross-cutting.md +35 -0
- package/factory-skills/factory-review/references/categories/mechanical.md +36 -0
- package/factory-skills/factory-review/references/categories/performance.md +33 -0
- package/factory-skills/factory-review/references/categories/public-api.md +38 -0
- package/factory-skills/factory-review/references/categories/refactor.md +35 -0
- package/factory-skills/factory-review/references/categories/revert.md +31 -0
- package/factory-skills/factory-review/references/categories/schema-storage.md +39 -0
- package/factory-skills/factory-review/references/categories/security.md +35 -0
- package/factory-skills/factory-review/references/categories/tests-only.md +38 -0
- package/package.json +9 -9
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { FactoryGitLabEventName, FactoryGitLabRuleContext, FactoryRuleHandler } from '../../rules/types.js';
|
|
2
|
+
export type GitLabRuleOverrides = Partial<Record<FactoryGitLabEventName, FactoryRuleHandler<FactoryGitLabRuleContext> | null | undefined>>;
|
|
3
|
+
export type GitLabEventRules = Readonly<Record<FactoryGitLabEventName, FactoryRuleHandler<FactoryGitLabRuleContext> | null>>;
|
|
4
|
+
declare function issueOpened(context: FactoryGitLabRuleContext): {
|
|
5
|
+
readonly type: "upsertLinkedWorkItem";
|
|
6
|
+
readonly idempotencyKey: `${string}:issue-intake`;
|
|
7
|
+
readonly board: string;
|
|
8
|
+
readonly source: "gitlab-issue";
|
|
9
|
+
readonly sourceKey: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly stage: string;
|
|
13
|
+
readonly metadata: {
|
|
14
|
+
readonly authorTrusted: boolean;
|
|
15
|
+
readonly autoStartCandidate: boolean;
|
|
16
|
+
readonly assignees: string[];
|
|
17
|
+
readonly labels: string[];
|
|
18
|
+
readonly labelColors: Record<string, string>;
|
|
19
|
+
readonly author?: string | undefined;
|
|
20
|
+
readonly sourceCreatedAt?: string | undefined;
|
|
21
|
+
readonly gitlabHost: string;
|
|
22
|
+
readonly gitlabProjectId: number;
|
|
23
|
+
readonly gitlabIssueIid: number;
|
|
24
|
+
readonly identifier: `${string}#${number}`;
|
|
25
|
+
};
|
|
26
|
+
} | undefined;
|
|
27
|
+
declare function retriageIssue(context: FactoryGitLabRuleContext): {
|
|
28
|
+
readonly type: "invokeSkill";
|
|
29
|
+
readonly idempotencyKey: `${string}:factory-triage`;
|
|
30
|
+
readonly role: "triage";
|
|
31
|
+
readonly skillName: "factory-triage";
|
|
32
|
+
readonly arguments: `Re-triage GitLab issue (${string}) after a comment was added.` | `Re-triage GitLab issue (${string}) after the issue changed.`;
|
|
33
|
+
} | undefined;
|
|
34
|
+
declare function issueClosed(context: FactoryGitLabRuleContext): {
|
|
35
|
+
readonly type: "transition";
|
|
36
|
+
readonly idempotencyKey: `${string}:issue-closed`;
|
|
37
|
+
readonly board: "work";
|
|
38
|
+
readonly stage: "done";
|
|
39
|
+
readonly message: {
|
|
40
|
+
readonly text: `GitLab issue #${number} was closed; this Work card was moved to Done.` | "GitLab issue # was closed; this Work card was moved to Done.";
|
|
41
|
+
};
|
|
42
|
+
} | undefined;
|
|
43
|
+
declare function materializeMergeRequest(context: FactoryGitLabRuleContext): {
|
|
44
|
+
readonly type: "upsertLinkedWorkItem";
|
|
45
|
+
readonly idempotencyKey: `${string}:merge-request-intake`;
|
|
46
|
+
readonly board: "review";
|
|
47
|
+
readonly source: "gitlab-pr";
|
|
48
|
+
readonly sourceKey: string;
|
|
49
|
+
readonly title: string;
|
|
50
|
+
readonly url: string;
|
|
51
|
+
readonly stage: "intake";
|
|
52
|
+
readonly metadata: {
|
|
53
|
+
readonly author?: string | undefined;
|
|
54
|
+
readonly factoryAuthored: boolean;
|
|
55
|
+
readonly authorTrusted: boolean;
|
|
56
|
+
readonly autoStartCandidate: boolean;
|
|
57
|
+
readonly state: "closed" | "open";
|
|
58
|
+
readonly draft: boolean;
|
|
59
|
+
readonly merged: boolean;
|
|
60
|
+
readonly assignees: string[];
|
|
61
|
+
readonly requestedReviewers: string[];
|
|
62
|
+
readonly labels: string[];
|
|
63
|
+
readonly labelColors: Record<string, string>;
|
|
64
|
+
readonly headBranch: string;
|
|
65
|
+
readonly baseBranch: string;
|
|
66
|
+
readonly sourceCreatedAt?: string | undefined;
|
|
67
|
+
readonly gitlabHost: string;
|
|
68
|
+
readonly gitlabProjectId: number;
|
|
69
|
+
readonly gitlabMergeRequestIid: number;
|
|
70
|
+
};
|
|
71
|
+
} | undefined;
|
|
72
|
+
declare function mergeRequestUpdated(context: FactoryGitLabRuleContext): {
|
|
73
|
+
readonly reenter?: boolean | undefined;
|
|
74
|
+
readonly type: "transition";
|
|
75
|
+
readonly idempotencyKey: `${string}:re-review-updated`;
|
|
76
|
+
readonly board: "review";
|
|
77
|
+
readonly stage: "review";
|
|
78
|
+
} | undefined;
|
|
79
|
+
declare function mergeRequestCommented(context: FactoryGitLabRuleContext): {
|
|
80
|
+
readonly type: "sendMessage";
|
|
81
|
+
readonly idempotencyKey: `${string}:address-merge-request-comment`;
|
|
82
|
+
readonly role: "work";
|
|
83
|
+
readonly priority: "high";
|
|
84
|
+
readonly message: string;
|
|
85
|
+
} | undefined;
|
|
86
|
+
declare function mergeRequestMerged(context: FactoryGitLabRuleContext): {
|
|
87
|
+
readonly type: "transition";
|
|
88
|
+
readonly idempotencyKey: `${string}:merge-request-merged`;
|
|
89
|
+
readonly board: "review";
|
|
90
|
+
readonly stage: "done";
|
|
91
|
+
readonly message: {
|
|
92
|
+
readonly text: `GitLab merge request !${number} merged; this Review card was moved to Done.`;
|
|
93
|
+
};
|
|
94
|
+
readonly role?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
readonly type: "sendMessage";
|
|
97
|
+
readonly idempotencyKey: `${string}:assess-work-completion`;
|
|
98
|
+
readonly role: "work";
|
|
99
|
+
readonly message: string;
|
|
100
|
+
readonly board?: undefined;
|
|
101
|
+
readonly stage?: undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
declare function mergeRequestClosed(context: FactoryGitLabRuleContext): {
|
|
104
|
+
readonly type: "transition";
|
|
105
|
+
readonly idempotencyKey: `${string}:merge-request-closed`;
|
|
106
|
+
readonly board: "review";
|
|
107
|
+
readonly stage: "canceled";
|
|
108
|
+
readonly message: {
|
|
109
|
+
readonly text: string;
|
|
110
|
+
};
|
|
111
|
+
} | undefined;
|
|
112
|
+
export declare const defaultGitLabRules: Readonly<{
|
|
113
|
+
issueOpened: typeof issueOpened;
|
|
114
|
+
issueUpdated: typeof retriageIssue;
|
|
115
|
+
issueClosed: typeof issueClosed;
|
|
116
|
+
issueCommented: typeof retriageIssue;
|
|
117
|
+
mergeRequestOpened: typeof materializeMergeRequest;
|
|
118
|
+
mergeRequestUpdated: typeof mergeRequestUpdated;
|
|
119
|
+
mergeRequestCommented: typeof mergeRequestCommented;
|
|
120
|
+
mergeRequestMerged: typeof mergeRequestMerged;
|
|
121
|
+
mergeRequestClosed: typeof mergeRequestClosed;
|
|
122
|
+
}>;
|
|
123
|
+
export declare function resolveGitLabRules(overrides?: GitLabRuleOverrides): GitLabEventRules;
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=default-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-rules.d.ts","sourceRoot":"","sources":["../../../src/integrations/gitlab/default-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAChG,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACrC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC,CACpF,CAAC;AAkBF,iBAAS,WAAW,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;cA8BrD;AAED,iBAAS,aAAa,CAAC,OAAO,EAAE,wBAAwB;;;;;;cAWvD;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;cAYrD;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCjE;AAED,iBAAS,mBAAmB,CAAC,OAAO,EAAE,wBAAwB;;;;;;cAY7D;AAED,iBAAS,qBAAqB,CAAC,OAAO,EAAE,wBAAwB;;;;;;cAc/D;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;cAsB5D;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;cAa5D;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;EAUF,CAAC;AAE9B,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,CAgBpF"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
//#region src/integrations/gitlab/default-rules.ts
|
|
2
|
+
function actorUsername(context) {
|
|
3
|
+
return context.actor.type === "gitlab" ? context.actor.username : void 0;
|
|
4
|
+
}
|
|
5
|
+
function trustedGitLabActor(context) {
|
|
6
|
+
return context.actor.type === "gitlab" && context.actor.trusted;
|
|
7
|
+
}
|
|
8
|
+
function createdAfterFactory(createdAt, factoryCreatedAt) {
|
|
9
|
+
if (!createdAt) return false;
|
|
10
|
+
const sourceCreatedAt = Date.parse(createdAt);
|
|
11
|
+
const projectCreatedAt = Date.parse(factoryCreatedAt);
|
|
12
|
+
return Number.isFinite(sourceCreatedAt) && Number.isFinite(projectCreatedAt) && sourceCreatedAt > projectCreatedAt;
|
|
13
|
+
}
|
|
14
|
+
function issueOpened(context) {
|
|
15
|
+
if (!context.issue) return;
|
|
16
|
+
return {
|
|
17
|
+
type: "upsertLinkedWorkItem",
|
|
18
|
+
idempotencyKey: `${context.ingress.id}:issue-intake`,
|
|
19
|
+
board: context.intake?.board ?? "work",
|
|
20
|
+
source: "gitlab-issue",
|
|
21
|
+
sourceKey: context.issue.sourceKey,
|
|
22
|
+
title: context.issue.title,
|
|
23
|
+
url: context.issue.url,
|
|
24
|
+
stage: context.intake?.initialPhase ?? "intake",
|
|
25
|
+
metadata: {
|
|
26
|
+
gitlabHost: context.repository.host,
|
|
27
|
+
gitlabProjectId: context.repository.id,
|
|
28
|
+
gitlabIssueIid: context.issue.number,
|
|
29
|
+
identifier: `${context.repository.fullName}#${context.issue.number}`,
|
|
30
|
+
...context.issue.createdAt ? { sourceCreatedAt: context.issue.createdAt } : {},
|
|
31
|
+
...context.issue.author ?? actorUsername(context) ? { author: context.issue.author ?? actorUsername(context) } : {},
|
|
32
|
+
authorTrusted: context.issue.authorTrusted,
|
|
33
|
+
autoStartCandidate: trustedGitLabActor(context) && context.issue.authorTrusted && createdAfterFactory(context.issue.createdAt, context.factory.createdAt),
|
|
34
|
+
assignees: context.issue.assignees ?? [],
|
|
35
|
+
labels: context.issue.labels ?? [],
|
|
36
|
+
labelColors: context.issue.labelColors ?? {}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function retriageIssue(context) {
|
|
41
|
+
if (!context.item || context.item.source !== "gitlab-issue" || !context.item.url) return;
|
|
42
|
+
if (context.actor.type === "gitlab" && context.actor.factoryAuthored) return;
|
|
43
|
+
const reason = context.event === "issueCommented" ? "a comment was added" : "the issue changed";
|
|
44
|
+
return {
|
|
45
|
+
type: "invokeSkill",
|
|
46
|
+
idempotencyKey: `${context.ingress.id}:factory-triage`,
|
|
47
|
+
role: "triage",
|
|
48
|
+
skillName: "factory-triage",
|
|
49
|
+
arguments: `Re-triage GitLab issue (${context.item.url}) after ${reason}.`
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function issueClosed(context) {
|
|
53
|
+
if (!context.item || context.item.source !== "gitlab-issue" || context.board !== "work") return;
|
|
54
|
+
if (context.item.stages.some((stage) => stage === "done" || stage === "canceled")) return;
|
|
55
|
+
return {
|
|
56
|
+
type: "transition",
|
|
57
|
+
idempotencyKey: `${context.ingress.id}:issue-closed`,
|
|
58
|
+
board: "work",
|
|
59
|
+
stage: "done",
|
|
60
|
+
message: { text: `GitLab issue #${context.issue?.number ?? ""} was closed; this Work card was moved to Done.` }
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function materializeMergeRequest(context) {
|
|
64
|
+
if (!context.mergeRequest) return;
|
|
65
|
+
return {
|
|
66
|
+
type: "upsertLinkedWorkItem",
|
|
67
|
+
idempotencyKey: `${context.ingress.id}:merge-request-intake`,
|
|
68
|
+
board: "review",
|
|
69
|
+
source: "gitlab-pr",
|
|
70
|
+
sourceKey: context.mergeRequest.sourceKey,
|
|
71
|
+
title: context.mergeRequest.title,
|
|
72
|
+
url: context.mergeRequest.url,
|
|
73
|
+
stage: "intake",
|
|
74
|
+
metadata: {
|
|
75
|
+
gitlabHost: context.repository.host,
|
|
76
|
+
gitlabProjectId: context.repository.id,
|
|
77
|
+
gitlabMergeRequestIid: context.mergeRequest.number,
|
|
78
|
+
...context.mergeRequest.createdAt ? { sourceCreatedAt: context.mergeRequest.createdAt } : {},
|
|
79
|
+
factoryAuthored: context.mergeRequest.factoryAuthored,
|
|
80
|
+
authorTrusted: context.mergeRequest.authorTrusted,
|
|
81
|
+
autoStartCandidate: (trustedGitLabActor(context) && context.mergeRequest.authorTrusted || context.mergeRequest.factoryAuthored) && createdAfterFactory(context.mergeRequest.createdAt, context.factory.createdAt),
|
|
82
|
+
state: context.mergeRequest.state,
|
|
83
|
+
draft: context.mergeRequest.draft,
|
|
84
|
+
merged: context.mergeRequest.merged,
|
|
85
|
+
assignees: context.mergeRequest.assignees ?? [],
|
|
86
|
+
requestedReviewers: context.mergeRequest.reviewers ?? [],
|
|
87
|
+
labels: context.mergeRequest.labels ?? [],
|
|
88
|
+
labelColors: context.mergeRequest.labelColors ?? {},
|
|
89
|
+
headBranch: context.mergeRequest.headBranch,
|
|
90
|
+
baseBranch: context.mergeRequest.baseBranch,
|
|
91
|
+
...context.mergeRequest.author ? { author: context.mergeRequest.author } : {}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function mergeRequestUpdated(context) {
|
|
96
|
+
if (!context.item || context.item.source !== "gitlab-pr" || context.board !== "review") return;
|
|
97
|
+
if (!context.mergeRequest || context.mergeRequest.state !== "open" || context.mergeRequest.merged) return;
|
|
98
|
+
if (context.item.stages.some((stage) => stage === "intake")) return;
|
|
99
|
+
const alreadyReviewing = context.item.stages.some((stage) => stage === "review");
|
|
100
|
+
return {
|
|
101
|
+
type: "transition",
|
|
102
|
+
idempotencyKey: `${context.ingress.id}:re-review-updated`,
|
|
103
|
+
board: "review",
|
|
104
|
+
stage: "review",
|
|
105
|
+
...alreadyReviewing ? { reenter: true } : {}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function mergeRequestCommented(context) {
|
|
109
|
+
if (!context.item || !context.mergeRequest || !context.note || context.board !== "work") return;
|
|
110
|
+
if (context.mergeRequest.state !== "open" || context.mergeRequest.merged) return;
|
|
111
|
+
if (context.actor.type === "gitlab" && context.actor.factoryAuthored) return;
|
|
112
|
+
return {
|
|
113
|
+
type: "sendMessage",
|
|
114
|
+
idempotencyKey: `${context.ingress.id}:address-merge-request-comment`,
|
|
115
|
+
role: "work",
|
|
116
|
+
priority: "high",
|
|
117
|
+
message: `${context.note.author ?? "Someone"} commented on GitLab merge request !${context.mergeRequest.number} (${context.note.url ?? context.mergeRequest.url}). Read the comment, address it if you agree, and push the fixes to the merge-request branch. Reply in GitLab to anything you are deliberately not changing.`
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function mergeRequestMerged(context) {
|
|
121
|
+
if (!context.item || !context.mergeRequest?.merged) return;
|
|
122
|
+
if (context.board === "review") return {
|
|
123
|
+
type: "transition",
|
|
124
|
+
idempotencyKey: `${context.ingress.id}:merge-request-merged`,
|
|
125
|
+
board: "review",
|
|
126
|
+
stage: "done",
|
|
127
|
+
message: { text: `GitLab merge request !${context.mergeRequest.number} merged; this Review card was moved to Done.` }
|
|
128
|
+
};
|
|
129
|
+
if (context.board !== "work") return;
|
|
130
|
+
return {
|
|
131
|
+
type: "sendMessage",
|
|
132
|
+
idempotencyKey: `${context.ingress.id}:assess-work-completion`,
|
|
133
|
+
role: "work",
|
|
134
|
+
message: `GitLab merge request !${context.mergeRequest.number} merged. Assess whether the linked Work item is complete. Do not mark it Done solely because this merge request merged.`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function mergeRequestClosed(context) {
|
|
138
|
+
if (!context.item || !context.mergeRequest || context.mergeRequest.merged || context.board !== "review") return;
|
|
139
|
+
return {
|
|
140
|
+
type: "transition",
|
|
141
|
+
idempotencyKey: `${context.ingress.id}:merge-request-closed`,
|
|
142
|
+
board: "review",
|
|
143
|
+
stage: "canceled",
|
|
144
|
+
message: { text: `GitLab merge request !${context.mergeRequest.number} was closed without merging; this Review card was moved to Canceled.` }
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const defaultGitLabRules = Object.freeze({
|
|
148
|
+
issueOpened,
|
|
149
|
+
issueUpdated: retriageIssue,
|
|
150
|
+
issueClosed,
|
|
151
|
+
issueCommented: retriageIssue,
|
|
152
|
+
mergeRequestOpened: materializeMergeRequest,
|
|
153
|
+
mergeRequestUpdated,
|
|
154
|
+
mergeRequestCommented,
|
|
155
|
+
mergeRequestMerged,
|
|
156
|
+
mergeRequestClosed
|
|
157
|
+
});
|
|
158
|
+
function resolveGitLabRules(overrides) {
|
|
159
|
+
if (overrides !== void 0 && (overrides === null || typeof overrides !== "object" || Array.isArray(overrides))) throw new Error("GitLab rules must be an object.");
|
|
160
|
+
const rules = { ...defaultGitLabRules };
|
|
161
|
+
for (const key of Reflect.ownKeys(overrides ?? {})) {
|
|
162
|
+
if (typeof key !== "string" || !Object.hasOwn(defaultGitLabRules, key)) throw new Error(`Unknown GitLab rule event: ${String(key)}.`);
|
|
163
|
+
const handler = overrides?.[key];
|
|
164
|
+
if (handler !== void 0 && handler !== null && typeof handler !== "function") throw new Error(`GitLab rule ${key} must be a function, null, or undefined.`);
|
|
165
|
+
if (handler !== void 0) rules[key] = handler;
|
|
166
|
+
}
|
|
167
|
+
return Object.freeze(rules);
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
export { defaultGitLabRules, resolveGitLabRules };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=default-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-rules.js","names":[],"sources":["../../../src/integrations/gitlab/default-rules.ts"],"sourcesContent":["import type {\n FactoryGitLabEventName,\n FactoryGitLabRuleContext,\n FactoryRuleHandler,\n} from '../../rules/types.js';\n\nexport type GitLabRuleOverrides = Partial<\n Record<FactoryGitLabEventName, FactoryRuleHandler<FactoryGitLabRuleContext> | null | undefined>\n>;\nexport type GitLabEventRules = Readonly<\n Record<FactoryGitLabEventName, FactoryRuleHandler<FactoryGitLabRuleContext> | null>\n>;\n\n\nfunction actorUsername(context: Pick<FactoryGitLabRuleContext, 'actor'>): string | undefined {\n return context.actor.type === 'gitlab' ? context.actor.username : undefined;\n}\n\nfunction trustedGitLabActor(context: Pick<FactoryGitLabRuleContext, 'actor'>): boolean {\n return context.actor.type === 'gitlab' && context.actor.trusted;\n}\n\nfunction createdAfterFactory(createdAt: string | undefined, factoryCreatedAt: string): boolean {\n if (!createdAt) return false;\n const sourceCreatedAt = Date.parse(createdAt);\n const projectCreatedAt = Date.parse(factoryCreatedAt);\n return Number.isFinite(sourceCreatedAt) && Number.isFinite(projectCreatedAt) && sourceCreatedAt > projectCreatedAt;\n}\n\nfunction issueOpened(context: FactoryGitLabRuleContext) {\n if (!context.issue) return;\n return {\n type: 'upsertLinkedWorkItem',\n idempotencyKey: `${context.ingress.id}:issue-intake`,\n board: context.intake?.board ?? 'work',\n source: 'gitlab-issue',\n sourceKey: context.issue.sourceKey,\n title: context.issue.title,\n url: context.issue.url,\n stage: context.intake?.initialPhase ?? 'intake',\n metadata: {\n gitlabHost: context.repository.host,\n gitlabProjectId: context.repository.id,\n gitlabIssueIid: context.issue.number,\n identifier: `${context.repository.fullName}#${context.issue.number}`,\n ...(context.issue.createdAt ? { sourceCreatedAt: context.issue.createdAt } : {}),\n ...(context.issue.author ?? actorUsername(context)\n ? { author: context.issue.author ?? actorUsername(context) }\n : {}),\n authorTrusted: context.issue.authorTrusted,\n autoStartCandidate:\n trustedGitLabActor(context) &&\n context.issue.authorTrusted &&\n createdAfterFactory(context.issue.createdAt, context.factory.createdAt),\n assignees: context.issue.assignees ?? [],\n labels: context.issue.labels ?? [],\n labelColors: context.issue.labelColors ?? {},\n },\n } as const;\n}\n\nfunction retriageIssue(context: FactoryGitLabRuleContext) {\n if (!context.item || context.item.source !== 'gitlab-issue' || !context.item.url) return;\n if (context.actor.type === 'gitlab' && context.actor.factoryAuthored) return;\n const reason = context.event === 'issueCommented' ? 'a comment was added' : 'the issue changed';\n return {\n type: 'invokeSkill',\n idempotencyKey: `${context.ingress.id}:factory-triage`,\n role: 'triage',\n skillName: 'factory-triage',\n arguments: `Re-triage GitLab issue (${context.item.url}) after ${reason}.`,\n } as const;\n}\n\nfunction issueClosed(context: FactoryGitLabRuleContext) {\n if (!context.item || context.item.source !== 'gitlab-issue' || context.board !== 'work') return;\n if (context.item.stages.some(stage => stage === 'done' || stage === 'canceled')) return;\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:issue-closed`,\n board: 'work',\n stage: 'done',\n message: {\n text: `GitLab issue #${context.issue?.number ?? ''} was closed; this Work card was moved to Done.`,\n },\n } as const;\n}\n\nfunction materializeMergeRequest(context: FactoryGitLabRuleContext) {\n if (!context.mergeRequest) return;\n return {\n type: 'upsertLinkedWorkItem',\n idempotencyKey: `${context.ingress.id}:merge-request-intake`,\n board: 'review',\n source: 'gitlab-pr',\n sourceKey: context.mergeRequest.sourceKey,\n title: context.mergeRequest.title,\n url: context.mergeRequest.url,\n stage: 'intake',\n metadata: {\n gitlabHost: context.repository.host,\n gitlabProjectId: context.repository.id,\n gitlabMergeRequestIid: context.mergeRequest.number,\n ...(context.mergeRequest.createdAt ? { sourceCreatedAt: context.mergeRequest.createdAt } : {}),\n factoryAuthored: context.mergeRequest.factoryAuthored,\n authorTrusted: context.mergeRequest.authorTrusted,\n autoStartCandidate:\n ((trustedGitLabActor(context) && context.mergeRequest.authorTrusted) || context.mergeRequest.factoryAuthored) &&\n createdAfterFactory(context.mergeRequest.createdAt, context.factory.createdAt),\n state: context.mergeRequest.state,\n draft: context.mergeRequest.draft,\n merged: context.mergeRequest.merged,\n assignees: context.mergeRequest.assignees ?? [],\n requestedReviewers: context.mergeRequest.reviewers ?? [],\n labels: context.mergeRequest.labels ?? [],\n labelColors: context.mergeRequest.labelColors ?? {},\n headBranch: context.mergeRequest.headBranch,\n baseBranch: context.mergeRequest.baseBranch,\n ...(context.mergeRequest.author ? { author: context.mergeRequest.author } : {}),\n },\n } as const;\n}\n\nfunction mergeRequestUpdated(context: FactoryGitLabRuleContext) {\n if (!context.item || context.item.source !== 'gitlab-pr' || context.board !== 'review') return;\n if (!context.mergeRequest || context.mergeRequest.state !== 'open' || context.mergeRequest.merged) return;\n if (context.item.stages.some(stage => stage === 'intake')) return;\n const alreadyReviewing = context.item.stages.some(stage => stage === 'review');\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:re-review-updated`,\n board: 'review',\n stage: 'review',\n ...(alreadyReviewing ? { reenter: true } : {}),\n } as const;\n}\n\nfunction mergeRequestCommented(context: FactoryGitLabRuleContext) {\n if (!context.item || !context.mergeRequest || !context.note || context.board !== 'work') return;\n if (context.mergeRequest.state !== 'open' || context.mergeRequest.merged) return;\n if (context.actor.type === 'gitlab' && context.actor.factoryAuthored) return;\n return {\n type: 'sendMessage',\n idempotencyKey: `${context.ingress.id}:address-merge-request-comment`,\n role: 'work',\n priority: 'high',\n message:\n `${context.note.author ?? 'Someone'} commented on GitLab merge request !${context.mergeRequest.number} ` +\n `(${context.note.url ?? context.mergeRequest.url}). Read the comment, address it if you agree, and push ` +\n 'the fixes to the merge-request branch. Reply in GitLab to anything you are deliberately not changing.',\n } as const;\n}\n\nfunction mergeRequestMerged(context: FactoryGitLabRuleContext) {\n if (!context.item || !context.mergeRequest?.merged) return;\n if (context.board === 'review') {\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:merge-request-merged`,\n board: 'review',\n stage: 'done',\n message: {\n text: `GitLab merge request !${context.mergeRequest.number} merged; this Review card was moved to Done.`,\n },\n } as const;\n }\n if (context.board !== 'work') return;\n return {\n type: 'sendMessage',\n idempotencyKey: `${context.ingress.id}:assess-work-completion`,\n role: 'work',\n message:\n `GitLab merge request !${context.mergeRequest.number} merged. Assess whether the linked Work item is complete. ` +\n 'Do not mark it Done solely because this merge request merged.',\n } as const;\n}\n\nfunction mergeRequestClosed(context: FactoryGitLabRuleContext) {\n if (!context.item || !context.mergeRequest || context.mergeRequest.merged || context.board !== 'review') return;\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:merge-request-closed`,\n board: 'review',\n stage: 'canceled',\n message: {\n text:\n `GitLab merge request !${context.mergeRequest.number} was closed without merging; ` +\n 'this Review card was moved to Canceled.',\n },\n } as const;\n}\n\nexport const defaultGitLabRules = Object.freeze({\n issueOpened,\n issueUpdated: retriageIssue,\n issueClosed,\n issueCommented: retriageIssue,\n mergeRequestOpened: materializeMergeRequest,\n mergeRequestUpdated,\n mergeRequestCommented,\n mergeRequestMerged,\n mergeRequestClosed,\n} satisfies GitLabEventRules);\n\nexport function resolveGitLabRules(overrides?: GitLabRuleOverrides): GitLabEventRules {\n if (overrides !== undefined && (overrides === null || typeof overrides !== 'object' || Array.isArray(overrides))) {\n throw new Error('GitLab rules must be an object.');\n }\n const rules: Record<string, FactoryRuleHandler<FactoryGitLabRuleContext> | null> = { ...defaultGitLabRules };\n for (const key of Reflect.ownKeys(overrides ?? {})) {\n if (typeof key !== 'string' || !Object.hasOwn(defaultGitLabRules, key)) {\n throw new Error(`Unknown GitLab rule event: ${String(key)}.`);\n }\n const handler = overrides?.[key as FactoryGitLabEventName];\n if (handler !== undefined && handler !== null && typeof handler !== 'function') {\n throw new Error(`GitLab rule ${key} must be a function, null, or undefined.`);\n }\n if (handler !== undefined) rules[key] = handler;\n }\n return Object.freeze(rules) as GitLabEventRules;\n}\n"],"mappings":";AAcA,SAAS,cAAc,SAAsE;CAC3F,OAAO,QAAQ,MAAM,SAAS,WAAW,QAAQ,MAAM,WAAW,KAAA;AACpE;AAEA,SAAS,mBAAmB,SAA2D;CACrF,OAAO,QAAQ,MAAM,SAAS,YAAY,QAAQ,MAAM;AAC1D;AAEA,SAAS,oBAAoB,WAA+B,kBAAmC;CAC7F,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,kBAAkB,KAAK,MAAM,SAAS;CAC5C,MAAM,mBAAmB,KAAK,MAAM,gBAAgB;CACpD,OAAO,OAAO,SAAS,eAAe,KAAK,OAAO,SAAS,gBAAgB,KAAK,kBAAkB;AACpG;AAEA,SAAS,YAAY,SAAmC;CACtD,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO;EACL,MAAM;EACN,gBAAgB,GAAG,QAAQ,QAAQ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;EACtC,MAAM;EACN,SACE,yBAAyB,QAAQ,aAAa,OAAO;CAEzD;AACF;AAEA,SAAS,mBAAmB,SAAmC;CAC7D,IAAI,CAAC,QAAQ,QAAQ,CAAC,QAAQ,gBAAgB,QAAQ,aAAa,UAAU,QAAQ,UAAU,UAAU;CACzG,OAAO;EACL,MAAM;EACN,gBAAgB,GAAG,QAAQ,QAAQ,GAAG;EACtC,OAAO;EACP,OAAO;EACP,SAAS,EACP,MACE,yBAAyB,QAAQ,aAAa,OAAO,sEAEzD;CACF;AACF;AAEA,MAAa,qBAAqB,OAAO,OAAO;CAC9C;CACA,cAAc;CACd;CACA,gBAAgB;CAChB,oBAAoB;CACpB;CACA;CACA;CACA;AACF,CAA4B;AAE5B,SAAgB,mBAAmB,WAAmD;CACpF,IAAI,cAAc,KAAA,MAAc,cAAc,QAAQ,OAAO,cAAc,YAAY,MAAM,QAAQ,SAAS,IAC5G,MAAM,IAAI,MAAM,iCAAiC;CAEnD,MAAM,QAA6E,EAAE,GAAG,mBAAmB;CAC3G,KAAK,MAAM,OAAO,QAAQ,QAAQ,aAAa,CAAC,CAAC,GAAG;EAClD,IAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,OAAO,oBAAoB,GAAG,GACnE,MAAM,IAAI,MAAM,8BAA8B,OAAO,GAAG,EAAE,EAAE;EAE9D,MAAM,UAAU,YAAY;EAC5B,IAAI,YAAY,KAAA,KAAa,YAAY,QAAQ,OAAO,YAAY,YAClE,MAAM,IAAI,MAAM,eAAe,IAAI,yCAAyC;EAE9E,IAAI,YAAY,KAAA,GAAW,MAAM,OAAO;CAC1C;CACA,OAAO,OAAO,OAAO,KAAK;AAC5B"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
|
+
import type { ApiRoute } from '@mastra/core/server';
|
|
3
|
+
import type { MastraWorker } from '@mastra/core/worker';
|
|
4
|
+
import type { IntegrationConnection } from '../../capabilities/connection.js';
|
|
5
|
+
import type { Intake, IntakeIssueDetail } from '../../capabilities/intake.js';
|
|
6
|
+
import type { RouteAuth } from '../../routes/route.js';
|
|
7
|
+
import type { IntegrationStorageHandle } from '../../storage/domains/integrations/base.js';
|
|
8
|
+
import type { FactoryProjectsStorage } from '../../storage/domains/projects/base.js';
|
|
9
|
+
import type { SourceControlStorageHandle } from '../../storage/domains/source-control/base.js';
|
|
10
|
+
import type { FactoryIntegration, IntegrationContext, IntegrationTools } from '../base.js';
|
|
11
|
+
import { GitLabApiClient } from './api.js';
|
|
12
|
+
import type { GitLabEventRules, GitLabRuleOverrides } from './default-rules.js';
|
|
13
|
+
import type { GitLabSubscriptionStorage } from './subscriptions.js';
|
|
14
|
+
interface GitLabConnectionContext {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string | null;
|
|
17
|
+
api: GitLabApiClient;
|
|
18
|
+
connection: IntegrationConnection;
|
|
19
|
+
host: string;
|
|
20
|
+
webBaseUrl?: string;
|
|
21
|
+
/** Resolves a fresh provider token for a single brokered git operation. */
|
|
22
|
+
repositoryAccessToken?: () => Promise<string>;
|
|
23
|
+
}
|
|
24
|
+
interface GitLabSourceReference {
|
|
25
|
+
/** Present only on legacy v1 ids; authentication is not resource identity. */
|
|
26
|
+
connectionId?: string;
|
|
27
|
+
/** Canonical v2 ids use the GitLab instance host plus immutable project id. */
|
|
28
|
+
host?: string;
|
|
29
|
+
projectId: string;
|
|
30
|
+
/** Legacy ids carry display metadata; v2 resolves it from GitLab. */
|
|
31
|
+
projectPath?: string;
|
|
32
|
+
}
|
|
33
|
+
interface GitLabIssueReference extends GitLabSourceReference {
|
|
34
|
+
issueIid: number;
|
|
35
|
+
}
|
|
36
|
+
export interface GitLabMergeRequestReference {
|
|
37
|
+
version: 1;
|
|
38
|
+
host: string;
|
|
39
|
+
projectId: number;
|
|
40
|
+
mergeRequestIid: number;
|
|
41
|
+
}
|
|
42
|
+
export interface GitLabStatusConnection {
|
|
43
|
+
id: string;
|
|
44
|
+
integrationId: string;
|
|
45
|
+
status: 'active' | 'needs_reauth';
|
|
46
|
+
accountLabel: string | null;
|
|
47
|
+
}
|
|
48
|
+
export declare const GITLAB_TRUSTED_ACCESS_LEVEL = 30;
|
|
49
|
+
export declare abstract class GitLabIntegrationBase implements FactoryIntegration {
|
|
50
|
+
#private;
|
|
51
|
+
readonly id = "gitlab";
|
|
52
|
+
readonly rules: GitLabEventRules;
|
|
53
|
+
constructor(rules?: GitLabRuleOverrides);
|
|
54
|
+
readonly intake: Intake;
|
|
55
|
+
readonly versionControl: import("../../capabilities/version-control.js").VersionControl;
|
|
56
|
+
initialize({ storage, projects, auth, sourceControl, }: {
|
|
57
|
+
storage?: IntegrationStorageHandle;
|
|
58
|
+
projects: FactoryProjectsStorage;
|
|
59
|
+
auth: RouteAuth;
|
|
60
|
+
sourceControl?: SourceControlStorageHandle;
|
|
61
|
+
}): void;
|
|
62
|
+
/** Generic integration persistence (merge-request subscriptions). */
|
|
63
|
+
get integrationStorage(): GitLabSubscriptionStorage;
|
|
64
|
+
/** Source-control rows for this integration; absent when the host runs without them. */
|
|
65
|
+
get sourceControlStorage(): SourceControlStorageHandle | undefined;
|
|
66
|
+
get authEnabled(): boolean;
|
|
67
|
+
get projects(): FactoryProjectsStorage;
|
|
68
|
+
resolveOrgId(resourceId: string): Promise<string | null>;
|
|
69
|
+
clearCaches(): void;
|
|
70
|
+
abstract hasActiveConnections(): Promise<boolean>;
|
|
71
|
+
abstract authFailureMessage(): string;
|
|
72
|
+
protected abstract activeContexts(): Promise<GitLabConnectionContext[]>;
|
|
73
|
+
protected abstract contextById(connectionId: string): Promise<GitLabConnectionContext>;
|
|
74
|
+
/** Resolve only a GitLab repository linked to this Factory in this organization. */
|
|
75
|
+
getLinkedRepository(input: {
|
|
76
|
+
orgId: string;
|
|
77
|
+
factoryProjectId: string;
|
|
78
|
+
projectRepositoryId: string;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
repository: import("../../storage/domains/source-control/base.js").SourceControlRepository;
|
|
81
|
+
host: string;
|
|
82
|
+
} | null>;
|
|
83
|
+
getProjectMemberAccessLevel(connectionId: string, projectId: string, username: string): Promise<number | undefined>;
|
|
84
|
+
getWorkItemAuthorUsername(connectionId: string, projectId: string, kind: 'issue' | 'merge_request', iid: number): Promise<string | undefined>;
|
|
85
|
+
isProjectMemberTrustedForSource(sourceId: string, username: string): Promise<boolean>;
|
|
86
|
+
getIssueForFactoryProject(input: {
|
|
87
|
+
orgId: string;
|
|
88
|
+
factoryProjectId: string;
|
|
89
|
+
issueId: string;
|
|
90
|
+
}): Promise<IntakeIssueDetail | null>;
|
|
91
|
+
/** Platform mode exposes org connections; direct mode returns undefined. */
|
|
92
|
+
statusConnections(): Promise<GitLabStatusConnection[] | undefined>;
|
|
93
|
+
/** Direct mode verifies its configured credential; Platform mode uses connection status. */
|
|
94
|
+
verifyStatus(): Promise<void>;
|
|
95
|
+
protected get webhookSecret(): string | undefined;
|
|
96
|
+
workers(ctx: IntegrationContext): MastraWorker[];
|
|
97
|
+
routes(ctx: IntegrationContext): ApiRoute[];
|
|
98
|
+
agentTools(args: {
|
|
99
|
+
requestContext: RequestContext;
|
|
100
|
+
}): Promise<IntegrationTools>;
|
|
101
|
+
sessionTools({ requestContext }: {
|
|
102
|
+
requestContext: RequestContext;
|
|
103
|
+
}): IntegrationTools;
|
|
104
|
+
postToolObserver({ toolContext, requestContext, }: Parameters<NonNullable<FactoryIntegration['postToolObserver']>>[0]): Promise<void>;
|
|
105
|
+
abstract diagnostics(): Record<string, unknown>;
|
|
106
|
+
/** Prefer the configured direct token over an older Platform installation on the same host. */
|
|
107
|
+
resolveActiveConnectionForHost(storedConnectionId: string, host: string): Promise<string>;
|
|
108
|
+
}
|
|
109
|
+
export type GitLabAccessTokenType = 'personal' | 'group';
|
|
110
|
+
export interface GitLabIntegrationConfig {
|
|
111
|
+
rules?: GitLabRuleOverrides;
|
|
112
|
+
accessToken?: string;
|
|
113
|
+
/** Defaults to `personal`; both token types authenticate identically but have different resource reach. */
|
|
114
|
+
accessTokenType?: GitLabAccessTokenType;
|
|
115
|
+
baseUrl?: string;
|
|
116
|
+
webhookSecret?: string;
|
|
117
|
+
fetchImpl?: typeof fetch;
|
|
118
|
+
}
|
|
119
|
+
export declare class GitLabIntegration extends GitLabIntegrationBase {
|
|
120
|
+
#private;
|
|
121
|
+
constructor(config?: GitLabIntegrationConfig);
|
|
122
|
+
protected get webhookSecret(): string | undefined;
|
|
123
|
+
hasActiveConnections(): Promise<boolean>;
|
|
124
|
+
verifyStatus(): Promise<void>;
|
|
125
|
+
authFailureMessage(): string;
|
|
126
|
+
protected activeContexts(): Promise<GitLabConnectionContext[]>;
|
|
127
|
+
protected contextById(connectionId: string): Promise<GitLabConnectionContext>;
|
|
128
|
+
diagnostics(): Record<string, unknown>;
|
|
129
|
+
}
|
|
130
|
+
export declare function encodeSourceId(reference: GitLabSourceReference): string;
|
|
131
|
+
export declare function decodeSourceId(value: string): GitLabSourceReference | null;
|
|
132
|
+
export declare function encodeIssueReference(reference: GitLabIssueReference): string;
|
|
133
|
+
export declare function decodeIssueReference(value: string): GitLabIssueReference | null;
|
|
134
|
+
export declare function decodeMergeRequestReference(value: string): GitLabMergeRequestReference | null;
|
|
135
|
+
export declare function gitlabConnection(connectionId: string): IntegrationConnection;
|
|
136
|
+
export declare function normalizeGitLabHost(host: string): string;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integrations/gitlab/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9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