@mastra/factory 0.30.0 → 0.31.0-alpha.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 +32 -10
- package/dist/factory.d.ts +12 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +72 -31
- package/dist/factory.js.map +1 -1
- package/dist/integrations/gitlab/api.d.ts +3 -2
- package/dist/integrations/gitlab/api.d.ts.map +1 -1
- package/dist/integrations/gitlab/api.js +12 -9
- package/dist/integrations/gitlab/api.js.map +1 -1
- package/dist/integrations/issue-reconcile-worker.d.ts +5 -0
- package/dist/integrations/issue-reconcile-worker.d.ts.map +1 -1
- package/dist/integrations/issue-reconcile-worker.js +17 -1
- package/dist/integrations/issue-reconcile-worker.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts +22 -13
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
- package/dist/integrations/platform/connect/routes.js +63 -64
- package/dist/integrations/platform/connect/routes.js.map +1 -1
- package/dist/integrations/platform/foundation/connect-binding.d.ts +125 -0
- package/dist/integrations/platform/foundation/connect-binding.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/connect-binding.js +252 -0
- package/dist/integrations/platform/foundation/connect-binding.js.map +1 -0
- package/dist/integrations/platform/foundation/connect-event-poller.d.ts +49 -0
- package/dist/integrations/platform/foundation/connect-event-poller.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/connect-event-poller.js +304 -0
- package/dist/integrations/platform/foundation/connect-event-poller.js.map +1 -0
- package/dist/integrations/platform/foundation/connect-events.d.ts +31 -0
- package/dist/integrations/platform/foundation/connect-events.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/connect-events.js +7 -0
- package/dist/integrations/platform/foundation/connect-events.js.map +1 -0
- package/dist/integrations/platform/foundation/index.d.ts +10 -0
- package/dist/integrations/platform/foundation/index.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/index.js +6 -0
- package/dist/integrations/platform/foundation/intake.d.ts +39 -0
- package/dist/integrations/platform/foundation/intake.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/intake.js +45 -0
- package/dist/integrations/platform/foundation/intake.js.map +1 -0
- package/dist/integrations/platform/foundation/integration.d.ts +84 -0
- package/dist/integrations/platform/foundation/integration.d.ts.map +1 -0
- package/dist/integrations/platform/foundation/integration.js +107 -0
- package/dist/integrations/platform/foundation/integration.js.map +1 -0
- package/dist/integrations/platform/github/event-worker.d.ts +2 -2
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +4 -8
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +3 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +131 -70
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/gitlab/connect-events.d.ts +22 -0
- package/dist/integrations/platform/gitlab/connect-events.d.ts.map +1 -0
- package/dist/integrations/platform/gitlab/connect-events.js +49 -0
- package/dist/integrations/platform/gitlab/connect-events.js.map +1 -0
- package/dist/integrations/platform/gitlab/integration.d.ts +24 -15
- package/dist/integrations/platform/gitlab/integration.d.ts.map +1 -1
- package/dist/integrations/platform/gitlab/integration.js +61 -26
- package/dist/integrations/platform/gitlab/integration.js.map +1 -1
- package/dist/integrations/platform/incidentio/intake.d.ts +33 -0
- package/dist/integrations/platform/incidentio/intake.d.ts.map +1 -0
- package/dist/integrations/platform/incidentio/intake.js +271 -0
- package/dist/integrations/platform/incidentio/intake.js.map +1 -0
- package/dist/integrations/platform/incidentio/integration.d.ts +11 -23
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/platform/incidentio/integration.js +27 -297
- package/dist/integrations/platform/incidentio/integration.js.map +1 -1
- package/dist/integrations/platform/jira/intake.d.ts +60 -0
- package/dist/integrations/platform/jira/intake.d.ts.map +1 -0
- package/dist/integrations/platform/jira/intake.js +445 -0
- package/dist/integrations/platform/jira/intake.js.map +1 -0
- package/dist/integrations/platform/jira/integration.d.ts +13 -37
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
- package/dist/integrations/platform/jira/integration.js +29 -468
- package/dist/integrations/platform/jira/integration.js.map +1 -1
- package/dist/integrations/platform/linear/event-worker.d.ts +2 -2
- package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/linear/event-worker.js +5 -9
- package/dist/integrations/platform/linear/event-worker.js.map +1 -1
- package/dist/integrations/platform/linear/integration.d.ts +3 -1
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +9 -9
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/integrations/platform/logging.d.ts +6 -0
- package/dist/integrations/platform/logging.d.ts.map +1 -0
- package/dist/integrations/platform/logging.js +25 -0
- package/dist/integrations/platform/logging.js.map +1 -0
- package/dist/integrations/platform/platform-connect.d.ts +38 -0
- package/dist/integrations/platform/platform-connect.d.ts.map +1 -0
- package/dist/integrations/platform/platform-connect.js +109 -0
- package/dist/integrations/platform/platform-connect.js.map +1 -0
- package/dist/integrations/platform/vanta/integration.d.ts +12 -18
- package/dist/integrations/platform/vanta/integration.d.ts.map +1 -1
- package/dist/integrations/platform/vanta/integration.js +38 -38
- package/dist/integrations/platform/vanta/integration.js.map +1 -1
- package/dist/memory-embedder.d.ts +11 -0
- package/dist/memory-embedder.d.ts.map +1 -0
- package/dist/memory-embedder.js +19 -0
- package/dist/memory-embedder.js.map +1 -0
- package/dist/metrics/config.d.ts +1 -1
- package/dist/metrics/config.d.ts.map +1 -1
- package/dist/metrics/config.js +1 -0
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/index.js +2 -2
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics/sandbox.d.ts +3 -3
- package/dist/metrics/sandbox.js +13 -13
- package/dist/metrics/sandbox.js.map +1 -1
- package/dist/metrics/session.d.ts +28 -0
- package/dist/metrics/session.d.ts.map +1 -0
- package/dist/metrics/session.js +76 -0
- package/dist/metrics/session.js.map +1 -0
- package/dist/routes/source-control-sessions.d.ts +5 -0
- package/dist/routes/source-control-sessions.d.ts.map +1 -1
- package/dist/routes/source-control-sessions.js +65 -7
- package/dist/routes/source-control-sessions.js.map +1 -1
- package/dist/routes/surface.d.ts +5 -0
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +1 -0
- package/dist/routes/surface.js.map +1 -1
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/processor.d.ts +29 -1
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +156 -23
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/public-failure-reason.js +1 -1
- package/dist/rules/public-failure-reason.js.map +1 -1
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +33 -9
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +2 -0
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +4 -2
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/work-item-branch.d.ts +7 -1
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +9 -1
- package/dist/work-item-branch.js.map +1 -1
- package/dist/work-items/card-facts.d.ts.map +1 -1
- package/dist/work-items/card-facts.js +2 -2
- package/dist/work-items/card-facts.js.map +1 -1
- package/package.json +8 -8
- package/dist/integrations/platform/api-client.d.ts +0 -34
- package/dist/integrations/platform/api-client.d.ts.map +0 -1
- package/dist/integrations/platform/api-client.js +0 -186
- package/dist/integrations/platform/api-client.js.map +0 -1
- package/dist/integrations/platform/gitlab/event-worker.d.ts +0 -64
- package/dist/integrations/platform/gitlab/event-worker.d.ts.map +0 -1
- package/dist/integrations/platform/gitlab/event-worker.js +0 -304
- package/dist/integrations/platform/gitlab/event-worker.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MountedMastraCode } from '@mastra/code-sdk';
|
|
2
|
+
import type { GitLabWebhookDispatchIntegration } from '../../gitlab/webhook-dispatch.js';
|
|
3
|
+
import { processGitLabWebhook } from '../../gitlab/webhook.js';
|
|
4
|
+
import type { ParsedGitLabWebhook } from '../../gitlab/webhook.js';
|
|
5
|
+
import type { PlatformConnectEventDelivery } from '../foundation/connect-events.js';
|
|
6
|
+
export interface GitLabConnectEventDependencies {
|
|
7
|
+
controller?: MountedMastraCode['controller'];
|
|
8
|
+
gitlab: GitLabWebhookDispatchIntegration;
|
|
9
|
+
ingestFactoryEvent?: (event: ParsedGitLabWebhook) => Promise<unknown>;
|
|
10
|
+
process?: typeof processGitLabWebhook;
|
|
11
|
+
/** Called for every unverified event dropped, for diagnostics. */
|
|
12
|
+
onUnverifiedDropped?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Feeds one Connect-forwarded GitLab webhook through the same ingress the
|
|
16
|
+
* direct `/web/gitlab/webhook` route uses: rules first, then session
|
|
17
|
+
* dispatch. Ingress failures propagate so the event poller retries the
|
|
18
|
+
* event. Unverified events are dropped: GitLab dispatches from the payload,
|
|
19
|
+
* so a body whose signature the platform could not check is never acted on.
|
|
20
|
+
*/
|
|
21
|
+
export declare function handleGitLabConnectEvent(event: PlatformConnectEventDelivery, dependencies: GitLabConnectEventDependencies): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=connect-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-events.d.ts","sourceRoot":"","sources":["../../../../src/integrations/platform/gitlab/connect-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAA0B,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAKpF,MAAM,WAAW,8BAA8B;IAC7C,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,EAAE,gCAAgC,CAAC;IACzC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACtC,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,4BAA4B,EACnC,YAAY,EAAE,8BAA8B,GAC3C,OAAO,CAAC,IAAI,CAAC,CAiDf"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { parseGitLabWebhookBody, processGitLabWebhook } from "../../gitlab/webhook.js";
|
|
2
|
+
import { logPlatformInfo, logPlatformWarn } from "../logging.js";
|
|
3
|
+
// src/integrations/platform/gitlab/connect-events.ts
|
|
4
|
+
const DELIVERY_ID_PREFIX = "platform";
|
|
5
|
+
/**
|
|
6
|
+
* Feeds one Connect-forwarded GitLab webhook through the same ingress the
|
|
7
|
+
* direct `/web/gitlab/webhook` route uses: rules first, then session
|
|
8
|
+
* dispatch. Ingress failures propagate so the event poller retries the
|
|
9
|
+
* event. Unverified events are dropped: GitLab dispatches from the payload,
|
|
10
|
+
* so a body whose signature the platform could not check is never acted on.
|
|
11
|
+
*/
|
|
12
|
+
async function handleGitLabConnectEvent(event, dependencies) {
|
|
13
|
+
const deliveryId = `${DELIVERY_ID_PREFIX}:${event.connectionId}:${event.dedupeKey}`;
|
|
14
|
+
if (event.unverified) {
|
|
15
|
+
dependencies.onUnverifiedDropped?.();
|
|
16
|
+
logPlatformWarn("Platform GitLab event dropped: the platform could not verify its signature", {
|
|
17
|
+
connectionId: event.connectionId,
|
|
18
|
+
eventId: event.id,
|
|
19
|
+
eventType: event.eventType
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const parsed = parseGitLabWebhookBody(event.payload, deliveryId);
|
|
24
|
+
if (!parsed) return;
|
|
25
|
+
const result = await (dependencies.process ?? processGitLabWebhook)(parsed, {
|
|
26
|
+
ingestFactoryEvent: dependencies.ingestFactoryEvent,
|
|
27
|
+
controller: dependencies.controller,
|
|
28
|
+
gitlab: dependencies.gitlab,
|
|
29
|
+
sourceConnectionId: event.connectionId,
|
|
30
|
+
onConnectionMismatch: () => {},
|
|
31
|
+
onTargetSkipped: () => {},
|
|
32
|
+
onTargetError: (subscription, error) => {
|
|
33
|
+
logPlatformWarn("Platform GitLab event delivery failed for a subscription", {
|
|
34
|
+
deliveryId,
|
|
35
|
+
subscriptionId: subscription.id,
|
|
36
|
+
threadId: subscription.threadId,
|
|
37
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (result.status !== 202) logPlatformInfo("Platform GitLab event was not accepted by the webhook processor", {
|
|
42
|
+
connectionId: event.connectionId,
|
|
43
|
+
deliveryId,
|
|
44
|
+
status: result.status
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export { handleGitLabConnectEvent };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=connect-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-events.js","names":[],"sources":["../../../../src/integrations/platform/gitlab/connect-events.ts"],"sourcesContent":["import type { MountedMastraCode } from '@mastra/code-sdk';\n\nimport type { GitLabWebhookDispatchIntegration } from '../../gitlab/webhook-dispatch.js';\nimport { parseGitLabWebhookBody, processGitLabWebhook } from '../../gitlab/webhook.js';\nimport type { ParsedGitLabWebhook } from '../../gitlab/webhook.js';\nimport type { PlatformConnectEventDelivery } from '../foundation/connect-events.js';\nimport { logPlatformInfo, logPlatformWarn } from '../logging.js';\n\nconst DELIVERY_ID_PREFIX = 'platform';\n\nexport interface GitLabConnectEventDependencies {\n controller?: MountedMastraCode['controller'];\n gitlab: GitLabWebhookDispatchIntegration;\n ingestFactoryEvent?: (event: ParsedGitLabWebhook) => Promise<unknown>;\n process?: typeof processGitLabWebhook;\n /** Called for every unverified event dropped, for diagnostics. */\n onUnverifiedDropped?: () => void;\n}\n\n/**\n * Feeds one Connect-forwarded GitLab webhook through the same ingress the\n * direct `/web/gitlab/webhook` route uses: rules first, then session\n * dispatch. Ingress failures propagate so the event poller retries the\n * event. Unverified events are dropped: GitLab dispatches from the payload,\n * so a body whose signature the platform could not check is never acted on.\n */\nexport async function handleGitLabConnectEvent(\n event: PlatformConnectEventDelivery,\n dependencies: GitLabConnectEventDependencies,\n): Promise<void> {\n const deliveryId = `${DELIVERY_ID_PREFIX}:${event.connectionId}:${event.dedupeKey}`;\n if (event.unverified) {\n dependencies.onUnverifiedDropped?.();\n logPlatformWarn('Platform GitLab event dropped: the platform could not verify its signature', {\n connectionId: event.connectionId,\n eventId: event.id,\n eventType: event.eventType,\n });\n return;\n }\n const parsed = parseGitLabWebhookBody(event.payload, deliveryId);\n if (!parsed) {\n // Pipelines, deployments, wiki edits and the like are acknowledged and\n // dropped, exactly as the direct route treats an unsupported event header.\n return;\n }\n\n const process = dependencies.process ?? processGitLabWebhook;\n const result = await process(parsed, {\n ingestFactoryEvent: dependencies.ingestFactoryEvent,\n controller: dependencies.controller,\n // The integration supplies subscription storage and the project-member\n // trust check, so the dispatcher's default author gate applies unchanged.\n gitlab: dependencies.gitlab,\n sourceConnectionId: event.connectionId,\n onConnectionMismatch: () => {\n // Expected whenever two connections reach the same project: the event\n // is delivered by the connection that created the subscription.\n },\n onTargetSkipped: () => {\n // Routine when a subscription's thread belongs to another deployment.\n },\n onTargetError: (subscription, error) => {\n logPlatformWarn('Platform GitLab event delivery failed for a subscription', {\n deliveryId,\n subscriptionId: subscription.id,\n threadId: subscription.threadId,\n error: error instanceof Error ? error.message : String(error),\n });\n },\n });\n if (result.status !== 202) {\n logPlatformInfo('Platform GitLab event was not accepted by the webhook processor', {\n connectionId: event.connectionId,\n deliveryId,\n status: result.status,\n });\n }\n}\n"],"mappings":";;;AAQA,MAAM,qBAAqB;;;;;;;;AAkB3B,eAAsB,yBACpB,OACA,cACe;CACf,MAAM,aAAa,GAAG,mBAAmB,GAAG,MAAM,aAAa,GAAG,MAAM;CACxE,IAAI,MAAM,YAAY;EACpB,aAAa,sBAAsB;EACnC,gBAAgB,8EAA8E;GAC5F,cAAc,MAAM;GACpB,SAAS,MAAM;GACf,WAAW,MAAM;EACnB,CAAC;EACD;CACF;CACA,MAAM,SAAS,uBAAuB,MAAM,SAAS,UAAU;CAC/D,IAAI,CAAC,QAGH;CAIF,MAAM,SAAS,OADC,aAAa,WAAW,qBAAA,CACX,QAAQ;EACnC,oBAAoB,aAAa;EACjC,YAAY,aAAa;EAGzB,QAAQ,aAAa;EACrB,oBAAoB,MAAM;EAC1B,4BAA4B,CAG5B;EACA,uBAAuB,CAEvB;EACA,gBAAgB,cAAc,UAAU;GACtC,gBAAgB,4DAA4D;IAC1E;IACA,gBAAgB,aAAa;IAC7B,UAAU,aAAa;IACvB,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAC9D,CAAC;EACH;CACF,CAAC;CACD,IAAI,OAAO,WAAW,KACpB,gBAAgB,mEAAmE;EACjF,cAAc,MAAM;EACpB;EACA,QAAQ,OAAO;CACjB,CAAC;AAEL"}
|
|
@@ -5,13 +5,11 @@ import { GitLabApiClient } from '../../gitlab/api.js';
|
|
|
5
5
|
import type { GitLabRuleOverrides } from '../../gitlab/default-rules.js';
|
|
6
6
|
import { GitLabIntegrationBase } from '../../gitlab/integration.js';
|
|
7
7
|
import type { GitLabStatusConnection } from '../../gitlab/integration.js';
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
accountLabel: string | null;
|
|
14
|
-
}
|
|
8
|
+
import type { PlatformConnectProviderRegistration, PlatformConnectProviderSource } from '../connect/routes.js';
|
|
9
|
+
import { PlatformConnectBinding } from '../foundation/connect-binding.js';
|
|
10
|
+
import type { PlatformConnection } from '../foundation/connect-binding.js';
|
|
11
|
+
import type { PlatformConnectEventRoute, PlatformConnectEventSource } from '../foundation/connect-events.js';
|
|
12
|
+
import type { PlatformConnectOption } from '../platform-connect.js';
|
|
15
13
|
interface PlatformGitLabContext {
|
|
16
14
|
id: string;
|
|
17
15
|
label: string | null;
|
|
@@ -22,7 +20,8 @@ interface PlatformGitLabContext {
|
|
|
22
20
|
}
|
|
23
21
|
export interface PlatformGitLabIntegrationConfig {
|
|
24
22
|
rules?: GitLabRuleOverrides;
|
|
25
|
-
|
|
23
|
+
/** The Connect client, or options to build one; defaults to the platform environment. */
|
|
24
|
+
connect?: PlatformConnectOption;
|
|
26
25
|
connectionId?: string;
|
|
27
26
|
/**
|
|
28
27
|
* Optional. Only a direct project webhook to `/web/gitlab/webhook` needs it;
|
|
@@ -31,13 +30,20 @@ export interface PlatformGitLabIntegrationConfig {
|
|
|
31
30
|
webhookSecret?: string;
|
|
32
31
|
/** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_ENABLED`, and to true when that is unset. */
|
|
33
32
|
pollingEnabled?: boolean;
|
|
34
|
-
/** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS`, and to the
|
|
33
|
+
/** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS`, and to the poller's 20 s when unset. */
|
|
35
34
|
pollingIntervalMs?: number;
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* GitLab through Mastra Connect. It keeps `GitLabIntegrationBase`, which the
|
|
38
|
+
* self-hosted integration shares, and composes the Connect plumbing through a
|
|
39
|
+
* `PlatformConnectBinding`.
|
|
40
|
+
*/
|
|
41
|
+
export declare class PlatformGitLabIntegration extends GitLabIntegrationBase implements PlatformConnectProviderSource, PlatformConnectEventSource {
|
|
38
42
|
#private;
|
|
43
|
+
readonly binding: PlatformConnectBinding;
|
|
39
44
|
constructor(config?: PlatformGitLabIntegrationConfig);
|
|
40
|
-
listConnections(): Promise<
|
|
45
|
+
listConnections(): Promise<PlatformConnection[]>;
|
|
46
|
+
platformConnectProviders(): PlatformConnectProviderRegistration[];
|
|
41
47
|
statusConnections(): Promise<GitLabStatusConnection[]>;
|
|
42
48
|
hasActiveConnections(): Promise<boolean>;
|
|
43
49
|
authFailureMessage(): string;
|
|
@@ -45,12 +51,15 @@ export declare class PlatformGitLabIntegration extends GitLabIntegrationBase {
|
|
|
45
51
|
protected activeContexts(): Promise<PlatformGitLabContext[]>;
|
|
46
52
|
protected contextById(connectionId: string): Promise<PlatformGitLabContext>;
|
|
47
53
|
/**
|
|
48
|
-
* The reconcile sweeps from the base class
|
|
49
|
-
* Platform event poller
|
|
50
|
-
*
|
|
51
|
-
* but nothing in Platform mode
|
|
54
|
+
* The reconcile sweeps from the base class. Events come through the
|
|
55
|
+
* deployment's Platform Connect event poller (`connectEventRoute`), which
|
|
56
|
+
* replaces the direct project webhook: the webhook route stays mounted for
|
|
57
|
+
* deployments that also configured a secret, but nothing in Platform mode
|
|
58
|
+
* requires one.
|
|
52
59
|
*/
|
|
53
60
|
workers(ctx: IntegrationContext): MastraWorker[];
|
|
61
|
+
/** The route the Platform Connect event poller reads GitLab events through, unless polling is off. */
|
|
62
|
+
connectEventRoute(ctx: IntegrationContext): PlatformConnectEventRoute | null;
|
|
54
63
|
diagnostics(): Record<string, unknown>;
|
|
55
64
|
}
|
|
56
65
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../src/integrations/platform/gitlab/integration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"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AA4F;IAC5F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qGAAqG;IACrG,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,qBAAa,yBACX,SAAQ,qBACR,YAAW,6BAA6B,EAAE,0BAA0B;;IAEpE,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAQzC,YAAY,MAAM,GAAE,+BAAoC,EAiBvD;IAED,eAAe,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAE/C;IAED,wBAAwB,IAAI,mCAAmC,EAAE,CAShE;IAEc,iBAAiB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAEpE;IAEK,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7C;IAED,kBAAkB,IAAI,MAAM,CAE3B;IAED,cAAuB,aAAa,IAAI,MAAM,GAAG,SAAS,CAEzD;IAED,UAAgB,cAAc,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAEjE;IAED,UAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAIhF;IAED;;;;;;OAMG;IACM,OAAO,CAAC,GAAG,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAKxD;IAED,sGAAsG;IACtG,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,yBAAyB,GAAG,IAAI,CAkB3E;IAED,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWrC;CAkCF"}
|
|
@@ -1,31 +1,52 @@
|
|
|
1
1
|
import { GitLabApiClient, GitLabApiError } from "../../gitlab/api.js";
|
|
2
2
|
import { GitLabIntegrationBase, gitlabConnection } from "../../gitlab/integration.js";
|
|
3
3
|
import { attachGitLabRules } from "../../gitlab/rules.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { IssueReconcileWorker } from "../../issue-reconcile-worker.js";
|
|
5
|
+
import { PlatformConnectBinding } from "../foundation/connect-binding.js";
|
|
6
|
+
import { handleGitLabConnectEvent } from "./connect-events.js";
|
|
7
|
+
import { MastraConnectError } from "@mastra/connect";
|
|
6
8
|
// src/integrations/platform/gitlab/integration.ts
|
|
7
9
|
/** The Platform's GitLab (OAuth) integration. It is the only GitLab credential flow Factory discovers. */
|
|
8
10
|
const GITLAB_INTEGRATION_ID = "gitlab";
|
|
11
|
+
/**
|
|
12
|
+
* GitLab through Mastra Connect. It keeps `GitLabIntegrationBase`, which the
|
|
13
|
+
* self-hosted integration shares, and composes the Connect plumbing through a
|
|
14
|
+
* `PlatformConnectBinding`.
|
|
15
|
+
*/
|
|
9
16
|
var PlatformGitLabIntegration = class extends GitLabIntegrationBase {
|
|
10
|
-
|
|
17
|
+
binding;
|
|
11
18
|
#connectionId;
|
|
12
19
|
#endpointHost;
|
|
13
20
|
#webhookSecret;
|
|
14
21
|
#pollingEnabled;
|
|
15
22
|
#pollingIntervalMs;
|
|
23
|
+
#reconcileWorker;
|
|
16
24
|
constructor(config = {}) {
|
|
17
25
|
super(config.rules);
|
|
18
26
|
const connectionId = config.connectionId?.trim() || process.env.MASTRA_GITLAB_CONNECTION_ID?.trim() || void 0;
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
this.binding = new PlatformConnectBinding({
|
|
28
|
+
integrationId: "gitlab",
|
|
29
|
+
providerKeys: [GITLAB_INTEGRATION_ID],
|
|
30
|
+
...config.connect ? { connect: config.connect } : {},
|
|
31
|
+
linkOrgConnectionsAtBoot: true,
|
|
32
|
+
...connectionId ? { filter: (connection) => connection.id === connectionId } : {}
|
|
33
|
+
});
|
|
21
34
|
this.#connectionId = connectionId;
|
|
22
|
-
this.#endpointHost = new URL(
|
|
35
|
+
this.#endpointHost = new URL(this.binding.connect.baseUrl).host;
|
|
23
36
|
this.#webhookSecret = config.webhookSecret?.trim() || process.env.MASTRA_GITLAB_WEBHOOK_SECRET?.trim() || void 0;
|
|
24
37
|
this.#pollingEnabled = config.pollingEnabled ?? process.env.MASTRA_PLATFORM_GITLAB_POLLING_ENABLED?.trim().toLowerCase() !== "false";
|
|
25
38
|
this.#pollingIntervalMs = config.pollingIntervalMs ?? optionalPositiveIntegerEnv("MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS");
|
|
26
39
|
}
|
|
27
|
-
|
|
28
|
-
return
|
|
40
|
+
listConnections() {
|
|
41
|
+
return this.binding.listConnections();
|
|
42
|
+
}
|
|
43
|
+
platformConnectProviders() {
|
|
44
|
+
return [{
|
|
45
|
+
provider: "gitlab",
|
|
46
|
+
integrationId: GITLAB_INTEGRATION_ID,
|
|
47
|
+
connectionIntegrationIds: [GITLAB_INTEGRATION_ID],
|
|
48
|
+
binding: this.binding
|
|
49
|
+
}];
|
|
29
50
|
}
|
|
30
51
|
async statusConnections() {
|
|
31
52
|
return this.listConnections();
|
|
@@ -48,24 +69,34 @@ var PlatformGitLabIntegration = class extends GitLabIntegrationBase {
|
|
|
48
69
|
return this.#context(connection);
|
|
49
70
|
}
|
|
50
71
|
/**
|
|
51
|
-
* The reconcile sweeps from the base class
|
|
52
|
-
* Platform event poller
|
|
53
|
-
*
|
|
54
|
-
* but nothing in Platform mode
|
|
72
|
+
* The reconcile sweeps from the base class. Events come through the
|
|
73
|
+
* deployment's Platform Connect event poller (`connectEventRoute`), which
|
|
74
|
+
* replaces the direct project webhook: the webhook route stays mounted for
|
|
75
|
+
* deployments that also configured a secret, but nothing in Platform mode
|
|
76
|
+
* requires one.
|
|
55
77
|
*/
|
|
56
78
|
workers(ctx) {
|
|
79
|
+
this.binding.ensureBootLinked();
|
|
57
80
|
const workers = super.workers(ctx);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
this.#reconcileWorker = workers.find((worker) => worker instanceof IssueReconcileWorker);
|
|
82
|
+
return workers;
|
|
83
|
+
}
|
|
84
|
+
/** The route the Platform Connect event poller reads GitLab events through, unless polling is off. */
|
|
85
|
+
connectEventRoute(ctx) {
|
|
86
|
+
if (!this.#pollingEnabled) return null;
|
|
87
|
+
const controller = ctx.controller;
|
|
88
|
+
if (!controller) throw new Error("Platform GitLab event polling requires the mounted Mastra Code controller.");
|
|
89
|
+
const ingestFactoryEvent = attachGitLabRules(this, ctx);
|
|
90
|
+
return {
|
|
91
|
+
binding: this.binding,
|
|
92
|
+
handle: (event) => handleGitLabConnectEvent(event, {
|
|
93
|
+
controller,
|
|
94
|
+
gitlab: this,
|
|
95
|
+
ingestFactoryEvent
|
|
96
|
+
}),
|
|
97
|
+
reconcile: () => this.#reconcileWorker?.requestRun(),
|
|
98
|
+
...this.#pollingIntervalMs === void 0 ? {} : { pollIntervalMs: this.#pollingIntervalMs }
|
|
99
|
+
};
|
|
69
100
|
}
|
|
70
101
|
diagnostics() {
|
|
71
102
|
return {
|
|
@@ -75,7 +106,8 @@ var PlatformGitLabIntegration = class extends GitLabIntegrationBase {
|
|
|
75
106
|
connectionFilterConfigured: Boolean(this.#connectionId),
|
|
76
107
|
webhookConfigured: Boolean(this.#webhookSecret),
|
|
77
108
|
pollingEnabled: this.#pollingEnabled,
|
|
78
|
-
...this.#pollingIntervalMs === void 0 ? {} : { pollingIntervalMs: this.#pollingIntervalMs }
|
|
109
|
+
...this.#pollingIntervalMs === void 0 ? {} : { pollingIntervalMs: this.#pollingIntervalMs },
|
|
110
|
+
...this.binding.needsLinking.length > 0 ? { needsLinking: this.binding.needsLinking } : {}
|
|
79
111
|
};
|
|
80
112
|
}
|
|
81
113
|
async #activeConnections() {
|
|
@@ -86,13 +118,16 @@ var PlatformGitLabIntegration = class extends GitLabIntegrationBase {
|
|
|
86
118
|
id: connection.id,
|
|
87
119
|
label: connection.accountLabel,
|
|
88
120
|
api: new GitLabApiClient({
|
|
89
|
-
client: this
|
|
121
|
+
client: this.binding,
|
|
90
122
|
connectionId: connection.id
|
|
91
123
|
}),
|
|
92
124
|
connection: gitlabConnection(connection.id),
|
|
93
125
|
host: "gitlab.com",
|
|
94
126
|
repositoryAccessToken: async () => {
|
|
95
|
-
const credential = await this
|
|
127
|
+
const credential = await this.binding.connect.getCredential(connection.id).catch((error) => {
|
|
128
|
+
if (error instanceof MastraConnectError && error.code === "unsupported_credential_type") return null;
|
|
129
|
+
throw error;
|
|
130
|
+
});
|
|
96
131
|
const token = credential?.type === "oauth2" ? credential.accessToken : credential?.type === "api_key" ? credential.apiKey : void 0;
|
|
97
132
|
if (typeof token !== "string" || !token.trim()) throw new GitLabApiError("GitLab connection did not provide a repository credential.", 502);
|
|
98
133
|
return token;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.js","names":[],"sources":["../../../../src/integrations/platform/gitlab/integration.ts"],"sourcesContent":["import type { MastraWorker } from '@mastra/core/worker';\n\nimport type { IntegrationConnection } from '../../../capabilities/connection.js';\nimport type { IntegrationContext } from '../../base.js';\nimport { GitLabApiClient, GitLabApiError } from '../../gitlab/api.js';\nimport type { GitLabRuleOverrides } from '../../gitlab/default-rules.js';\nimport { gitlabConnection, GitLabIntegrationBase } from '../../gitlab/integration.js';\nimport type { GitLabStatusConnection } from '../../gitlab/integration.js';\nimport { attachGitLabRules } from '../../gitlab/rules.js';\nimport { PlatformApiClient, platformApiClientConfigFromEnv } from '../api-client.js';\nimport type { PlatformApiClientConfig } from '../api-client.js';\nimport { PlatformGitLabEventWorker } from './event-worker.js';\nimport type { PlatformGitLabEventStorage } from './event-worker.js';\n\ninterface PlatformIntegrationConnection {\n id: string;\n integrationId: string;\n status: 'active' | 'needs_reauth';\n accountLabel: string | null;\n}\n\ninterface PlatformGitLabContext {\n id: string;\n label: string | null;\n api: GitLabApiClient;\n connection: IntegrationConnection;\n host: string;\n repositoryAccessToken: () => Promise<string>;\n}\n\ntype PlatformGitLabCredential =\n { type: 'oauth2'; accessToken: string; expiresAt: string | null } | { type: 'api_key'; apiKey: string };\n\n/** The Platform's GitLab (OAuth) integration. It is the only GitLab credential flow Factory discovers. */\nconst GITLAB_INTEGRATION_ID = 'gitlab';\n\nexport interface PlatformGitLabIntegrationConfig {\n rules?: GitLabRuleOverrides;\n clientConfig?: PlatformApiClientConfig;\n connectionId?: string;\n /**\n * Optional. Only a direct project webhook to `/web/gitlab/webhook` needs it;\n * a Platform-connected deployment receives events by polling instead.\n */\n webhookSecret?: string;\n /** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_ENABLED`, and to true when that is unset. */\n pollingEnabled?: boolean;\n /** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS`, and to the worker's 20 s when unset. */\n pollingIntervalMs?: number;\n}\n\nexport class PlatformGitLabIntegration extends GitLabIntegrationBase {\n readonly #client: PlatformApiClient;\n readonly #connectionId: string | undefined;\n readonly #endpointHost: string;\n readonly #webhookSecret: string | undefined;\n readonly #pollingEnabled: boolean;\n readonly #pollingIntervalMs: number | undefined;\n\n constructor(config: PlatformGitLabIntegrationConfig = {}) {\n super(config.rules);\n const connectionId = config.connectionId?.trim() || process.env.MASTRA_GITLAB_CONNECTION_ID?.trim() || undefined;\n const clientConfig = config.clientConfig ?? platformApiClientConfigFromEnv();\n this.#client = new PlatformApiClient(clientConfig);\n this.#connectionId = connectionId;\n this.#endpointHost = new URL(clientConfig.baseUrl).host;\n this.#webhookSecret = config.webhookSecret?.trim() || process.env.MASTRA_GITLAB_WEBHOOK_SECRET?.trim() || undefined;\n this.#pollingEnabled =\n config.pollingEnabled ?? process.env.MASTRA_PLATFORM_GITLAB_POLLING_ENABLED?.trim().toLowerCase() !== 'false';\n this.#pollingIntervalMs =\n config.pollingIntervalMs ?? optionalPositiveIntegerEnv('MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS');\n }\n\n async listConnections(): Promise<PlatformIntegrationConnection[]> {\n const result = await this.#client.request<{ connections: PlatformIntegrationConnection[] }>(\n 'GET',\n `/v2/connections?providerKey=${encodeURIComponent(GITLAB_INTEGRATION_ID)}`,\n );\n // The providerKey filter is applied server side; the exact ID check guards\n // against a server that answers more loosely than asked.\n return result.connections.filter(\n connection =>\n connection.integrationId === GITLAB_INTEGRATION_ID &&\n (!this.#connectionId || connection.id === this.#connectionId),\n );\n }\n\n override async statusConnections(): Promise<GitLabStatusConnection[]> {\n return this.listConnections();\n }\n\n async hasActiveConnections(): Promise<boolean> {\n return (await this.#activeConnections()).length > 0;\n }\n\n authFailureMessage(): string {\n return 'GitLab rejected the connected account. Reconnect it in Mastra Platform.';\n }\n\n protected override get webhookSecret(): string | undefined {\n return this.#webhookSecret;\n }\n\n protected async activeContexts(): Promise<PlatformGitLabContext[]> {\n return (await this.#activeConnections()).map(connection => this.#context(connection));\n }\n\n protected async contextById(connectionId: string): Promise<PlatformGitLabContext> {\n const connection = (await this.#activeConnections()).find(candidate => candidate.id === connectionId);\n if (!connection) throw new GitLabApiError('GitLab connection is unavailable or requires reauthentication.', 401);\n return this.#context(connection);\n }\n\n /**\n * The reconcile sweeps from the base class plus, when polling is on, the\n * Platform event poller. Polling replaces the direct project webhook: the\n * webhook route stays mounted for deployments that also configured a secret,\n * but nothing in Platform mode requires one.\n */\n override workers(ctx: IntegrationContext): MastraWorker[] {\n const workers = super.workers(ctx);\n if (!this.#pollingEnabled) return workers;\n if (!ctx.controller) {\n throw new Error('Platform GitLab event polling requires the mounted Mastra Code controller.');\n }\n return [\n ...workers,\n new PlatformGitLabEventWorker({\n client: this.#client,\n controller: ctx.controller,\n gitlab: this,\n storage: ctx.storage.generic as unknown as PlatformGitLabEventStorage,\n listConnections: () => this.listConnections(),\n ingestFactoryEvent: attachGitLabRules(this, ctx),\n intervalMs: this.#pollingIntervalMs,\n }),\n ];\n }\n\n diagnostics(): Record<string, unknown> {\n return {\n configured: true,\n mode: 'platform',\n endpointHost: this.#endpointHost,\n connectionFilterConfigured: Boolean(this.#connectionId),\n webhookConfigured: Boolean(this.#webhookSecret),\n pollingEnabled: this.#pollingEnabled,\n ...(this.#pollingIntervalMs === undefined ? {} : { pollingIntervalMs: this.#pollingIntervalMs }),\n };\n }\n\n async #activeConnections(): Promise<PlatformIntegrationConnection[]> {\n return (await this.listConnections()).filter(connection => connection.status === 'active');\n }\n\n #context(connection: PlatformIntegrationConnection): PlatformGitLabContext {\n return {\n id: connection.id,\n label: connection.accountLabel,\n api: new GitLabApiClient({ client: this.#client, connectionId: connection.id }),\n connection: gitlabConnection(connection.id),\n // Platform does not currently expose the connected GitLab instance host.\n host: 'gitlab.com',\n repositoryAccessToken: async () => {\n // Fetch for each git operation so an expiring OAuth token is refreshed by Platform.\n // Never persist or log the returned credential.\n const credential = await this.#client.request<PlatformGitLabCredential>(\n 'GET',\n `/v2/connections/${encodeURIComponent(connection.id)}/credentials`,\n );\n const token =\n credential?.type === 'oauth2'\n ? credential.accessToken\n : credential?.type === 'api_key'\n ? credential.apiKey\n : undefined;\n if (typeof token !== 'string' || !token.trim()) {\n throw new GitLabApiError('GitLab connection did not provide a repository credential.', 502);\n }\n return token;\n },\n };\n }\n}\n\nfunction optionalPositiveIntegerEnv(name: 'MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS'): number | undefined {\n const value = process.env[name]?.trim();\n if (!value) return undefined;\n const parsed = Number(value);\n if (!/^[1-9]\\d*$/.test(value) || !Number.isSafeInteger(parsed)) {\n throw new Error(`${name} must be a positive integer.`);\n }\n return parsed;\n}\n"],"mappings":";;;;;;;AAkCA,MAAM,wBAAwB;AAiB9B,IAAa,4BAAb,cAA+C,sBAAsB;CACnE;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAA0C,CAAC,GAAG;EACxD,MAAM,OAAO,KAAK;EAClB,MAAM,eAAe,OAAO,cAAc,KAAK,KAAK,QAAQ,IAAI,6BAA6B,KAAK,KAAK,KAAA;EACvG,MAAM,eAAe,OAAO,gBAAgB,+BAA+B;EAC3E,KAAK,UAAU,IAAI,kBAAkB,YAAY;EACjD,KAAK,gBAAgB;EACrB,KAAK,gBAAgB,IAAI,IAAI,aAA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T"}
|
|
1
|
+
{"version":3,"file":"integration.js","names":[],"sources":["../../../../src/integrations/platform/gitlab/integration.ts"],"sourcesContent":["import { MastraConnectError } from '@mastra/connect';\n\nimport type { MastraWorker } from '@mastra/core/worker';\nimport type { IntegrationConnection } from '../../../capabilities/connection.js';\nimport type { IntegrationContext } from '../../base.js';\nimport { GitLabApiClient, GitLabApiError } from '../../gitlab/api.js';\nimport type { GitLabRuleOverrides } from '../../gitlab/default-rules.js';\nimport { gitlabConnection, GitLabIntegrationBase } from '../../gitlab/integration.js';\nimport type { GitLabStatusConnection } from '../../gitlab/integration.js';\nimport { attachGitLabRules } from '../../gitlab/rules.js';\nimport { IssueReconcileWorker } from '../../issue-reconcile-worker.js';\nimport type { PlatformConnectProviderRegistration, PlatformConnectProviderSource } from '../connect/routes.js';\nimport { PlatformConnectBinding } from '../foundation/connect-binding.js';\nimport type { PlatformConnection } from '../foundation/connect-binding.js';\nimport type { PlatformConnectEventRoute, PlatformConnectEventSource } from '../foundation/connect-events.js';\nimport type { PlatformConnectOption } from '../platform-connect.js';\nimport { handleGitLabConnectEvent } from './connect-events.js';\n\ninterface PlatformGitLabContext {\n id: string;\n label: string | null;\n api: GitLabApiClient;\n connection: IntegrationConnection;\n host: string;\n repositoryAccessToken: () => Promise<string>;\n}\n\n/** The Platform's GitLab (OAuth) integration. It is the only GitLab credential flow Factory discovers. */\nconst GITLAB_INTEGRATION_ID = 'gitlab';\n\nexport interface PlatformGitLabIntegrationConfig {\n rules?: GitLabRuleOverrides;\n /** The Connect client, or options to build one; defaults to the platform environment. */\n connect?: PlatformConnectOption;\n connectionId?: string;\n /**\n * Optional. Only a direct project webhook to `/web/gitlab/webhook` needs it;\n * a Platform-connected deployment receives events by polling instead.\n */\n webhookSecret?: string;\n /** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_ENABLED`, and to true when that is unset. */\n pollingEnabled?: boolean;\n /** Defaults to `MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS`, and to the poller's 20 s when unset. */\n pollingIntervalMs?: number;\n}\n\n/**\n * GitLab through Mastra Connect. It keeps `GitLabIntegrationBase`, which the\n * self-hosted integration shares, and composes the Connect plumbing through a\n * `PlatformConnectBinding`.\n */\nexport class PlatformGitLabIntegration\n extends GitLabIntegrationBase\n implements PlatformConnectProviderSource, PlatformConnectEventSource\n{\n readonly binding: PlatformConnectBinding;\n readonly #connectionId: string | undefined;\n readonly #endpointHost: string;\n readonly #webhookSecret: string | undefined;\n readonly #pollingEnabled: boolean;\n readonly #pollingIntervalMs: number | undefined;\n #reconcileWorker: IssueReconcileWorker | undefined;\n\n constructor(config: PlatformGitLabIntegrationConfig = {}) {\n super(config.rules);\n const connectionId = config.connectionId?.trim() || process.env.MASTRA_GITLAB_CONNECTION_ID?.trim() || undefined;\n this.binding = new PlatformConnectBinding({\n integrationId: 'gitlab',\n providerKeys: [GITLAB_INTEGRATION_ID],\n ...(config.connect ? { connect: config.connect } : {}),\n linkOrgConnectionsAtBoot: true,\n ...(connectionId ? { filter: (connection: PlatformConnection) => connection.id === connectionId } : {}),\n });\n this.#connectionId = connectionId;\n this.#endpointHost = new URL(this.binding.connect.baseUrl).host;\n this.#webhookSecret = config.webhookSecret?.trim() || process.env.MASTRA_GITLAB_WEBHOOK_SECRET?.trim() || undefined;\n this.#pollingEnabled =\n config.pollingEnabled ?? process.env.MASTRA_PLATFORM_GITLAB_POLLING_ENABLED?.trim().toLowerCase() !== 'false';\n this.#pollingIntervalMs =\n config.pollingIntervalMs ?? optionalPositiveIntegerEnv('MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS');\n }\n\n listConnections(): Promise<PlatformConnection[]> {\n return this.binding.listConnections();\n }\n\n platformConnectProviders(): PlatformConnectProviderRegistration[] {\n return [\n {\n provider: 'gitlab',\n integrationId: GITLAB_INTEGRATION_ID,\n connectionIntegrationIds: [GITLAB_INTEGRATION_ID],\n binding: this.binding,\n },\n ];\n }\n\n override async statusConnections(): Promise<GitLabStatusConnection[]> {\n return this.listConnections();\n }\n\n async hasActiveConnections(): Promise<boolean> {\n return (await this.#activeConnections()).length > 0;\n }\n\n authFailureMessage(): string {\n return 'GitLab rejected the connected account. Reconnect it in Mastra Platform.';\n }\n\n protected override get webhookSecret(): string | undefined {\n return this.#webhookSecret;\n }\n\n protected async activeContexts(): Promise<PlatformGitLabContext[]> {\n return (await this.#activeConnections()).map(connection => this.#context(connection));\n }\n\n protected async contextById(connectionId: string): Promise<PlatformGitLabContext> {\n const connection = (await this.#activeConnections()).find(candidate => candidate.id === connectionId);\n if (!connection) throw new GitLabApiError('GitLab connection is unavailable or requires reauthentication.', 401);\n return this.#context(connection);\n }\n\n /**\n * The reconcile sweeps from the base class. Events come through the\n * deployment's Platform Connect event poller (`connectEventRoute`), which\n * replaces the direct project webhook: the webhook route stays mounted for\n * deployments that also configured a secret, but nothing in Platform mode\n * requires one.\n */\n override workers(ctx: IntegrationContext): MastraWorker[] {\n void this.binding.ensureBootLinked();\n const workers = super.workers(ctx);\n this.#reconcileWorker = workers.find(worker => worker instanceof IssueReconcileWorker);\n return workers;\n }\n\n /** The route the Platform Connect event poller reads GitLab events through, unless polling is off. */\n connectEventRoute(ctx: IntegrationContext): PlatformConnectEventRoute | null {\n if (!this.#pollingEnabled) return null;\n const controller = ctx.controller;\n if (!controller) {\n throw new Error('Platform GitLab event polling requires the mounted Mastra Code controller.');\n }\n const ingestFactoryEvent = attachGitLabRules(this, ctx);\n return {\n binding: this.binding,\n handle: event =>\n handleGitLabConnectEvent(event, {\n controller,\n gitlab: this,\n ingestFactoryEvent,\n }),\n reconcile: () => this.#reconcileWorker?.requestRun(),\n ...(this.#pollingIntervalMs === undefined ? {} : { pollIntervalMs: this.#pollingIntervalMs }),\n };\n }\n\n diagnostics(): Record<string, unknown> {\n return {\n configured: true,\n mode: 'platform',\n endpointHost: this.#endpointHost,\n connectionFilterConfigured: Boolean(this.#connectionId),\n webhookConfigured: Boolean(this.#webhookSecret),\n pollingEnabled: this.#pollingEnabled,\n ...(this.#pollingIntervalMs === undefined ? {} : { pollingIntervalMs: this.#pollingIntervalMs }),\n ...(this.binding.needsLinking.length > 0 ? { needsLinking: this.binding.needsLinking } : {}),\n };\n }\n\n async #activeConnections(): Promise<PlatformConnection[]> {\n return (await this.listConnections()).filter(connection => connection.status === 'active');\n }\n\n #context(connection: PlatformConnection): PlatformGitLabContext {\n return {\n id: connection.id,\n label: connection.accountLabel,\n api: new GitLabApiClient({ client: this.binding, connectionId: connection.id }),\n connection: gitlabConnection(connection.id),\n // Platform does not currently expose the connected GitLab instance host.\n host: 'gitlab.com',\n repositoryAccessToken: async () => {\n // Fetch for each git operation so an expiring OAuth token is refreshed by Platform.\n // Never persist or log the returned credential.\n const credential = await this.binding.connect.getCredential(connection.id).catch((error: unknown) => {\n if (error instanceof MastraConnectError && error.code === 'unsupported_credential_type') return null;\n throw error;\n });\n const token =\n credential?.type === 'oauth2'\n ? credential.accessToken\n : credential?.type === 'api_key'\n ? credential.apiKey\n : undefined;\n if (typeof token !== 'string' || !token.trim()) {\n throw new GitLabApiError('GitLab connection did not provide a repository credential.', 502);\n }\n return token;\n },\n };\n }\n}\n\nfunction optionalPositiveIntegerEnv(name: 'MASTRA_PLATFORM_GITLAB_POLLING_INTERVAL_MS'): number | undefined {\n const value = process.env[name]?.trim();\n if (!value) return undefined;\n const parsed = Number(value);\n if (!/^[1-9]\\d*$/.test(value) || !Number.isSafeInteger(parsed)) {\n throw new Error(`${name} must be a positive integer.`);\n }\n return parsed;\n}\n"],"mappings":";;;;;;;;;AA4BA,MAAM,wBAAwB;;;;;;AAuB9B,IAAa,4BAAb,cACU,sBAEV;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAA0C,CAAC,GAAG;EACxD,MAAM,OAAO,KAAK;EAClB,MAAM,eAAe,OAAO,cAAc,KAAK,KAAK,QAAQ,IAAI,6BAA6B,KAAK,KAAK,KAAA;EACvG,KAAK,UAAU,IAAI,uBAAuB;GACxC,eAAe;GACf,cAA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C,OAAO,UAAmB;KACnG,IAAI,iBAAiB,sBAAsB,MAAM,SAAS,+BAA+B,OAAO;KAChG,MAAM;IACR,CAAC;IACD,MAAM,QACJ,YAAY,SAAS,WACjB,WAAW,cACX,YAAY,SAAS,YACnB,WAAW,SACX,KAAA;IACR,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK,GAC3C,MAAM,IAAI,eAAe,8DAA8D,GAAG;IAE5F,OAAO;GACT;EACF;CACF;AACF;AAEA,SAAS,2BAA2B,MAAwE;CAC1G,MAAM,QAAQ,QAAQ,IAAI,KAAK,EAAE,KAAK;CACtC,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,MAAM,SAAS,OAAO,KAAK;CAC3B,IAAI,CAAC,aAAa,KAAK,KAAK,KAAK,CAAC,OAAO,cAAc,MAAM,GAC3D,MAAM,IAAI,MAAM,GAAG,KAAK,6BAA6B;CAEvD,OAAO;AACT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CreateIntakeCommentInput, CreatedIntakeComment, GetIntakeIssueInput, IntakeIssue, IntakeIssueDetail, IntakeItemPage, IntakeSource, ListIntakeIssuesInput, ListIntakeItemsInput, ListIntakeSourcesInput, ResolveIntakeDispatchInput, ResolvedIntakeDispatch, UpdateIntakeIssueInput } from '../../../capabilities/intake.js';
|
|
2
|
+
import { IncidentioApiError } from '../../incidentio/api.js';
|
|
3
|
+
import { PlatformIntakeCapability } from '../foundation/intake.js';
|
|
4
|
+
import type { PlatformIncidentioIntegration } from './integration.js';
|
|
5
|
+
export declare const UUID_RE: RegExp;
|
|
6
|
+
interface ScopedSourceId {
|
|
7
|
+
connectionId: string;
|
|
8
|
+
sourceId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function encodeScopedSourceId(connectionId: string, sourceId: string): string;
|
|
11
|
+
export declare function decodeScopedSourceId(value: string): ScopedSourceId | null;
|
|
12
|
+
/**
|
|
13
|
+
* The Platform incident.io intake: every active connection's incident.io
|
|
14
|
+
* intake, aggregated, with source ids scoped to their connection.
|
|
15
|
+
*/
|
|
16
|
+
export declare class PlatformIncidentioIntake extends PlatformIntakeCapability {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(incidentio: PlatformIncidentioIntegration);
|
|
19
|
+
clearCaches(): void;
|
|
20
|
+
protected notConnectedError(): IncidentioApiError;
|
|
21
|
+
resolveIntakeDispatch(input: ResolveIntakeDispatchInput): Promise<ResolvedIntakeDispatch | null>;
|
|
22
|
+
listSources(_input: ListIntakeSourcesInput): Promise<IntakeSource[]>;
|
|
23
|
+
listItems(input: ListIntakeItemsInput): Promise<IntakeItemPage>;
|
|
24
|
+
listIssues(input: ListIntakeIssuesInput): Promise<{
|
|
25
|
+
issues: IntakeIssue[];
|
|
26
|
+
nextCursor: string | null;
|
|
27
|
+
}>;
|
|
28
|
+
getIssue(input: GetIntakeIssueInput): Promise<IntakeIssueDetail | null>;
|
|
29
|
+
createComment(input: CreateIntakeCommentInput): Promise<CreatedIntakeComment | null>;
|
|
30
|
+
updateIssue(input: UpdateIntakeIssueInput): Promise<IntakeIssue | null>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=intake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intake.d.ts","sourceRoot":"","sources":["../../../../src/integrations/platform/incidentio/intake.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EAEnB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAuB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAOlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM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