@mastra/factory 0.28.0 → 0.29.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 +6 -4
- package/dist/boards/reroute.d.ts +31 -0
- package/dist/boards/reroute.d.ts.map +1 -0
- package/dist/boards/reroute.js +71 -0
- package/dist/boards/reroute.js.map +1 -0
- package/dist/environment/repository-access.d.ts +2 -0
- package/dist/environment/repository-access.d.ts.map +1 -1
- package/dist/environment/repository-access.js +9 -4
- package/dist/environment/repository-access.js.map +1 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +9 -6
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +8 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/dependabot/default-rules.d.ts +38 -0
- package/dist/integrations/dependabot/default-rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/default-rules.js +63 -0
- package/dist/integrations/dependabot/default-rules.js.map +1 -0
- package/dist/integrations/dependabot/rules.d.ts +42 -0
- package/dist/integrations/dependabot/rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/rules.js +187 -0
- package/dist/integrations/dependabot/rules.js.map +1 -0
- package/dist/integrations/dependabot/sync.d.ts +76 -0
- package/dist/integrations/dependabot/sync.d.ts.map +1 -0
- package/dist/integrations/dependabot/sync.js +111 -0
- package/dist/integrations/dependabot/sync.js.map +1 -0
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +7 -2
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +12 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +22 -1
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
- package/dist/integrations/platform/connect/routes.js +4 -0
- package/dist/integrations/platform/connect/routes.js.map +1 -1
- package/dist/integrations/platform/github/event-worker.d.ts +5 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +33 -2
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +19 -1
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +46 -0
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/vanta/integration.d.ts +33 -0
- package/dist/integrations/platform/vanta/integration.d.ts.map +1 -0
- package/dist/integrations/platform/vanta/integration.js +133 -0
- package/dist/integrations/platform/vanta/integration.js.map +1 -0
- package/dist/integrations/vanta/default-rules.d.ts +34 -0
- package/dist/integrations/vanta/default-rules.d.ts.map +1 -0
- package/dist/integrations/vanta/default-rules.js +61 -0
- package/dist/integrations/vanta/default-rules.js.map +1 -0
- package/dist/integrations/vanta/rules.d.ts +40 -0
- package/dist/integrations/vanta/rules.d.ts.map +1 -0
- package/dist/integrations/vanta/rules.js +208 -0
- package/dist/integrations/vanta/rules.js.map +1 -0
- package/dist/integrations/vanta/sync.d.ts +36 -0
- package/dist/integrations/vanta/sync.d.ts.map +1 -0
- package/dist/integrations/vanta/sync.js +73 -0
- package/dist/integrations/vanta/sync.js.map +1 -0
- package/dist/mcp/routes.d.ts.map +1 -1
- package/dist/mcp/routes.js +1 -1
- package/dist/mcp/routes.js.map +1 -1
- package/dist/routes/board-snapshot.d.ts +8 -1
- package/dist/routes/board-snapshot.d.ts.map +1 -1
- package/dist/routes/board-snapshot.js +23 -2
- package/dist/routes/board-snapshot.js.map +1 -1
- package/dist/routes/contracts.d.ts +205 -0
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +159 -5
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/intake-routes.d.ts +3 -0
- package/dist/routes/intake-routes.d.ts.map +1 -1
- package/dist/routes/intake-routes.js +44 -0
- package/dist/routes/intake-routes.js.map +1 -1
- package/dist/routes/knowledge.d.ts.map +1 -1
- package/dist/routes/knowledge.js +3 -2
- package/dist/routes/knowledge.js.map +1 -1
- package/dist/routes/source-control-sessions.d.ts +1 -1
- package/dist/routes/source-control-sessions.d.ts.map +1 -1
- package/dist/routes/source-control-sessions.js +109 -3
- package/dist/routes/source-control-sessions.js.map +1 -1
- package/dist/routes/surface.d.ts +6 -1
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +72 -9
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-item-selection.d.ts +0 -4
- package/dist/routes/work-item-selection.d.ts.map +1 -1
- package/dist/routes/work-item-selection.js +4 -21
- package/dist/routes/work-item-selection.js.map +1 -1
- package/dist/routes/work-item-starters.d.ts.map +1 -1
- package/dist/routes/work-item-starters.js +4 -21
- package/dist/routes/work-item-starters.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +112 -36
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts +3 -0
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +5 -0
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +2 -0
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +39 -18
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/index.d.ts +2 -2
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +2 -2
- package/dist/rules/start-coordinator.d.ts +6 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +6 -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 +3 -2
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +71 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +10 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +5 -0
- package/dist/rules/validation.js.map +1 -1
- package/dist/session/factory-session.d.ts +20 -5
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +20 -6
- package/dist/session/factory-session.js.map +1 -1
- package/dist/storage/domains/audit/actions.d.ts +1 -1
- package/dist/storage/domains/audit/actions.d.ts.map +1 -1
- package/dist/storage/domains/audit/actions.js +2 -1
- package/dist/storage/domains/audit/actions.js.map +1 -1
- package/dist/storage/domains/audit/actors.d.ts.map +1 -1
- package/dist/storage/domains/audit/actors.js +1 -1
- package/dist/storage/domains/audit/actors.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +1 -1
- package/dist/storage/domains/intake/base.js +2 -2
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +8 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +11 -1
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +15 -4
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +19 -1
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/tools/approval-tools.d.ts +20 -0
- package/dist/tools/approval-tools.d.ts.map +1 -1
- package/dist/tools/approval-tools.js +79 -30
- package/dist/tools/approval-tools.js.map +1 -1
- package/dist/tools/audit-events-tool.d.ts +1 -1
- package/dist/tools/messaging-tools.d.ts.map +1 -1
- package/dist/tools/messaging-tools.js +1 -1
- package/dist/tools/messaging-tools.js.map +1 -1
- package/dist/tools/read-tools.d.ts +0 -2
- package/dist/tools/read-tools.d.ts.map +1 -1
- package/dist/tools/read-tools.js +2 -7
- package/dist/tools/read-tools.js.map +1 -1
- package/dist/tools/reports.d.ts +3 -0
- package/dist/tools/reports.d.ts.map +1 -1
- package/dist/tools/reports.js +3 -3
- package/dist/tools/reports.js.map +1 -1
- package/dist/tools/run-watch.d.ts +14 -2
- package/dist/tools/run-watch.d.ts.map +1 -1
- package/dist/tools/run-watch.js +24 -4
- package/dist/tools/run-watch.js.map +1 -1
- package/dist/tools/session-tools.d.ts.map +1 -1
- package/dist/tools/session-tools.js +17 -6
- package/dist/tools/session-tools.js.map +1 -1
- package/dist/tools/side-sessions.d.ts.map +1 -1
- package/dist/tools/side-sessions.js +1 -1
- package/dist/tools/side-sessions.js.map +1 -1
- package/dist/tools/work-item-tools.d.ts.map +1 -1
- package/dist/tools/work-item-tools.js +12 -2
- package/dist/tools/work-item-tools.js.map +1 -1
- package/dist/work-item-branch.d.ts +1 -1
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +2 -0
- package/dist/work-item-branch.js.map +1 -1
- package/dist/work-items/board-filter-options.d.ts +5 -0
- package/dist/work-items/board-filter-options.d.ts.map +1 -0
- package/dist/work-items/board-filter-options.js +27 -0
- package/dist/work-items/board-filter-options.js.map +1 -0
- package/dist/work-items/board-phases.d.ts +28 -0
- package/dist/work-items/board-phases.d.ts.map +1 -0
- package/dist/work-items/board-phases.js +165 -0
- package/dist/work-items/board-phases.js.map +1 -0
- package/dist/work-items/card-facts.d.ts +24 -0
- package/dist/work-items/card-facts.d.ts.map +1 -0
- package/dist/work-items/card-facts.js +75 -0
- package/dist/work-items/card-facts.js.map +1 -0
- package/dist/work-items/card-labels.d.ts +5 -0
- package/dist/work-items/card-labels.d.ts.map +1 -0
- package/dist/work-items/card-labels.js +13 -0
- package/dist/work-items/card-labels.js.map +1 -0
- package/dist/work-items/card-number.d.ts +10 -0
- package/dist/work-items/card-number.d.ts.map +1 -0
- package/dist/work-items/card-number.js +15 -0
- package/dist/work-items/card-number.js.map +1 -0
- package/dist/work-items/card-people.d.ts +25 -0
- package/dist/work-items/card-people.d.ts.map +1 -0
- package/dist/work-items/card-people.js +100 -0
- package/dist/work-items/card-people.js.map +1 -0
- package/dist/work-items/card-search-text.d.ts +4 -0
- package/dist/work-items/card-search-text.d.ts.map +1 -0
- package/dist/work-items/card-search-text.js +15 -0
- package/dist/work-items/card-search-text.js.map +1 -0
- package/dist/work-items/card-source-filters.d.ts +23 -0
- package/dist/work-items/card-source-filters.d.ts.map +1 -0
- package/dist/work-items/card-source-filters.js +25 -0
- package/dist/work-items/card-source-filters.js.map +1 -0
- package/dist/work-items/create-work-item.d.ts +0 -6
- package/dist/work-items/create-work-item.d.ts.map +1 -1
- package/dist/work-items/create-work-item.js +2 -7
- package/dist/work-items/create-work-item.js.map +1 -1
- package/dist/work-items/list-related-cards.d.ts +4 -0
- package/dist/work-items/list-related-cards.d.ts.map +1 -0
- package/dist/work-items/list-related-cards.js +24 -0
- package/dist/work-items/list-related-cards.js.map +1 -0
- package/dist/work-items/search-words.d.ts +5 -0
- package/dist/work-items/search-words.d.ts.map +1 -0
- package/dist/work-items/search-words.js +12 -0
- package/dist/work-items/search-words.js.map +1 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +92 -47
- package/dist/workspace.js.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { vantaLabels } from "./rules.js";
|
|
2
|
+
// src/integrations/vanta/sync.ts
|
|
3
|
+
const VANTA_VULNERABILITIES_SOURCE_ID = "vanta:vulnerabilities";
|
|
4
|
+
const DEFAULT_VANTA_SYNC_INTERVAL_MS = 9e5;
|
|
5
|
+
function toVantaIngress(vulnerability) {
|
|
6
|
+
const severity = vulnerability.severity?.toLowerCase() ?? null;
|
|
7
|
+
const packageIdentifier = vulnerability.packageIdentifier ?? null;
|
|
8
|
+
return {
|
|
9
|
+
id: vulnerability.id,
|
|
10
|
+
name: vulnerability.name,
|
|
11
|
+
title: packageIdentifier ? `${packageIdentifier}: ${vulnerability.name}` : vulnerability.name,
|
|
12
|
+
description: vulnerability.description && vulnerability.description !== vulnerability.name ? vulnerability.description : null,
|
|
13
|
+
url: vulnerability.externalURL ?? null,
|
|
14
|
+
state: "open",
|
|
15
|
+
severity,
|
|
16
|
+
packageIdentifier,
|
|
17
|
+
fixable: vulnerability.isFixable ?? null,
|
|
18
|
+
remediateBy: vulnerability.remediateByDate ?? null,
|
|
19
|
+
labels: vantaLabels(severity),
|
|
20
|
+
createdAt: vulnerability.firstDetectedDate ?? (/* @__PURE__ */ new Date(0)).toISOString()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads Vanta's active vulnerabilities once and hands them to every Factory project that takes
|
|
25
|
+
* Vanta intake. A project takes it when its org has Vanta intake enabled and either binds the
|
|
26
|
+
* vulnerabilities source to it or binds it to no project at all.
|
|
27
|
+
*/
|
|
28
|
+
function createVantaSync(options) {
|
|
29
|
+
return async () => {
|
|
30
|
+
const summary = {
|
|
31
|
+
projects: 0,
|
|
32
|
+
checked: 0,
|
|
33
|
+
updated: 0,
|
|
34
|
+
closed: 0,
|
|
35
|
+
missing: 0,
|
|
36
|
+
failed: 0,
|
|
37
|
+
errors: []
|
|
38
|
+
};
|
|
39
|
+
const projects = await options.listProjects();
|
|
40
|
+
if (projects.length === 0) return summary;
|
|
41
|
+
const vulnerabilities = (await options.listVulnerabilities()).map(toVantaIngress);
|
|
42
|
+
const orgTargets = /* @__PURE__ */ new Map();
|
|
43
|
+
for (const project of projects) try {
|
|
44
|
+
let target = orgTargets.get(project.orgId);
|
|
45
|
+
if (!target) {
|
|
46
|
+
target = {
|
|
47
|
+
enabled: await options.intakeEnabled(project.orgId),
|
|
48
|
+
bound: await options.boundProjectIds(project.orgId)
|
|
49
|
+
};
|
|
50
|
+
orgTargets.set(project.orgId, target);
|
|
51
|
+
}
|
|
52
|
+
if (!target.enabled || target.bound.length > 0 && !target.bound.includes(project.id)) continue;
|
|
53
|
+
await options.ingest({
|
|
54
|
+
orgId: project.orgId,
|
|
55
|
+
userId: options.userId,
|
|
56
|
+
factoryProjectId: project.id,
|
|
57
|
+
vulnerabilities
|
|
58
|
+
});
|
|
59
|
+
summary.projects += 1;
|
|
60
|
+
summary.checked += vulnerabilities.length;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
summary.failed += 1;
|
|
63
|
+
summary.errors.push({
|
|
64
|
+
projectId: project.id,
|
|
65
|
+
error: error instanceof Error ? error.message : String(error)
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return summary;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export { DEFAULT_VANTA_SYNC_INTERVAL_MS, VANTA_VULNERABILITIES_SOURCE_ID, createVantaSync, toVantaIngress };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","names":[],"sources":["../../../src/integrations/vanta/sync.ts"],"sourcesContent":["import type { IssueReconcileSummary } from '../issue-reconciler.js';\nimport { vantaLabels } from './rules.js';\nimport type { VantaRulesIngress, VantaVulnerabilityIngress } from './rules.js';\n\nexport const VANTA_VULNERABILITIES_SOURCE_ID = 'vanta:vulnerabilities';\nexport const DEFAULT_VANTA_SYNC_INTERVAL_MS = 15 * 60_000;\n\n/** The subset of Vanta's `GET /v1/vulnerabilities` item Factory reads. */\nexport interface VantaVulnerability {\n id: string;\n name: string;\n description?: string | null;\n packageIdentifier?: string | null;\n severity?: string | null;\n isFixable?: boolean | null;\n remediateByDate?: string | null;\n firstDetectedDate?: string | null;\n externalURL?: string | null;\n}\n\n/** Lists every active Vanta vulnerability. Throws when Vanta can't be read. */\nexport type VantaVulnerabilityLister = () => Promise<VantaVulnerability[]>;\n\nexport function toVantaIngress(vulnerability: VantaVulnerability): VantaVulnerabilityIngress {\n const severity = vulnerability.severity?.toLowerCase() ?? null;\n const packageIdentifier = vulnerability.packageIdentifier ?? null;\n return {\n id: vulnerability.id,\n name: vulnerability.name,\n title: packageIdentifier ? `${packageIdentifier}: ${vulnerability.name}` : vulnerability.name,\n description: vulnerability.description && vulnerability.description !== vulnerability.name ? vulnerability.description : null,\n url: vulnerability.externalURL ?? null,\n state: 'open',\n severity,\n packageIdentifier,\n fixable: vulnerability.isFixable ?? null,\n remediateBy: vulnerability.remediateByDate ?? null,\n labels: vantaLabels(severity),\n createdAt: vulnerability.firstDetectedDate ?? new Date(0).toISOString(),\n };\n}\n\n/**\n * Reads Vanta's active vulnerabilities once and hands them to every Factory project that takes\n * Vanta intake. A project takes it when its org has Vanta intake enabled and either binds the\n * vulnerabilities source to it or binds it to no project at all.\n */\nexport function createVantaSync(options: {\n listVulnerabilities: VantaVulnerabilityLister;\n listProjects: () => Promise<ReadonlyArray<{ orgId: string; id: string }>>;\n intakeEnabled: (orgId: string) => Promise<boolean>;\n boundProjectIds: (orgId: string) => Promise<string[]>;\n ingest: (input: VantaRulesIngress) => Promise<unknown>;\n userId: string;\n}): () => Promise<IssueReconcileSummary> {\n return async () => {\n const summary: IssueReconcileSummary = { projects: 0, checked: 0, updated: 0, closed: 0, missing: 0, failed: 0, errors: [] };\n const projects = await options.listProjects();\n if (projects.length === 0) return summary;\n const vulnerabilities = (await options.listVulnerabilities()).map(toVantaIngress);\n const orgTargets = new Map<string, { enabled: boolean; bound: string[] }>();\n for (const project of projects) {\n try {\n let target = orgTargets.get(project.orgId);\n if (!target) {\n target = {\n enabled: await options.intakeEnabled(project.orgId),\n bound: await options.boundProjectIds(project.orgId),\n };\n orgTargets.set(project.orgId, target);\n }\n if (!target.enabled || (target.bound.length > 0 && !target.bound.includes(project.id))) continue;\n await options.ingest({\n orgId: project.orgId,\n userId: options.userId,\n factoryProjectId: project.id,\n vulnerabilities,\n });\n summary.projects += 1;\n summary.checked += vulnerabilities.length;\n } catch (error) {\n summary.failed += 1;\n summary.errors.push({ projectId: project.id, error: error instanceof Error ? error.message : String(error) });\n }\n }\n return summary;\n };\n}\n"],"mappings":";;AAIA,MAAa,kCAAkC;AAC/C,MAAa,iCAAiC;AAkB9C,SAAgB,eAAe,eAA8D;CAC3F,MAAM,WAAW,cAAc,UAAU,YAAY,KAAK;CAC1D,MAAM,oBAAoB,cAAc,qBAAqB;CAC7D,OAAO;EACL,IAA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QAAQ,OAAO,KAAK;IAAE,WAAW,QAAQ;IAAI,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAAE,CAAC;EAC9G;EAEF,OAAO;CACT;AACF"}
|
package/dist/mcp/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/mcp/routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/mcp/routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKnF,eAAO,MAAM,gBAAgB,yCAAyC,CAAC;AASvE,MAAM,WAAW,gBAAgB;IAC/B,2FAA2F;IAC3F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAgBD,+FAA+F;AAC/F,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,EAAE,CAMV;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAC9C,qFAAqF;IACrF,cAAc,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACtD,KAAK,EAAE,uBAAuB,CAAC;CAChC;AAED,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAGlG;AAsFD,sEAAsE;AACtE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAe1C;AAuFD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,QAAQ,EAAE,CAoB5E"}
|
package/dist/mcp/routes.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getFactoryAuthUser } from "../auth.js";
|
|
2
2
|
import "../platform-auth-host.js";
|
|
3
|
-
import { hasEveryWord, searchWords } from "../routes/work-item-selection.js";
|
|
4
3
|
import { FactorySourceSessionResolutionError, ensureFactorySourceSession } from "../session/factory-session.js";
|
|
5
4
|
import { auditActorProfile } from "../storage/domains/audit/base.js";
|
|
6
5
|
import { FACTORY_TOOL_ANNOTATIONS } from "../tools/annotations.js";
|
|
7
6
|
import { createFactoryTools } from "../tools/index.js";
|
|
7
|
+
import { hasEveryWord, searchWords } from "../work-items/search-words.js";
|
|
8
8
|
import { propagateClientDisconnect } from "./disconnect.js";
|
|
9
9
|
import { factoryActivityEvent } from "./events.js";
|
|
10
10
|
import { registerApiRoute } from "@mastra/core/server";
|
package/dist/mcp/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","names":[],"sources":["../../src/mcp/routes.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\nimport type { ApiRoute } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\nimport { createTool } from '@mastra/core/tools';\nimport type { Tool } from '@mastra/core/tools';\nimport { MCPServer } from '@mastra/mcp';\nimport { toFetchResponse, toReqRes } from 'fetch-to-node';\nimport type { Context } from 'hono';\nimport { z } from 'zod';\n\nimport { getFactoryAuthUser } from '../auth.js';\nimport { PLATFORM_AUTH_PROVIDER } from '../platform-auth-host.js';\nimport type { RouteAuth } from '../routes/route.js';\nimport { hasEveryWord, searchWords } from '../routes/work-item-selection.js';\nimport { ensureFactorySourceSession, FactorySourceSessionResolutionError } from '../session/factory-session.js';\nimport { auditActorProfile } from '../storage/domains/audit/base.js';\nimport type { FactoryProjectsStorage } from '../storage/domains/projects/base.js';\nimport type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js';\nimport { FACTORY_TOOL_ANNOTATIONS } from '../tools/annotations.js';\nimport { createFactoryTools } from '../tools/index.js';\nimport type { FactoryToolDependencies, FactoryToolScope } from '../tools/index.js';\nimport { propagateClientDisconnect } from './disconnect.js';\nimport { factoryActivityEvent } from './events.js';\n\nexport const FACTORY_MCP_PATH = '/web/factory/projects/:projectId/mcp';\nconst PROTECTED_RESOURCE_PREFIX = '/.well-known/oauth-protected-resource';\n\n/**\n * Tools an MCP client never gets. `factory_message_origin` answers the session\n * that started this one; a connector session is started by a person, not a session.\n */\nconst EXCLUDED_TOOLS = new Set(['factory_message_origin']);\n\nexport interface FactoryMcpConfig {\n /** Serve the MCP endpoint. Default `true`; it is never served without an auth provider. */\n enabled?: boolean;\n /**\n * OAuth authorization servers advertised in the protected-resource metadata\n * (RFC 9728) so clients like ChatGPT know where to sign in. Defaults to the\n * `MASTRA_FACTORY_MCP_AUTHORIZATION_SERVER` env var, then to Mastra Platform's\n * AuthKit when the Factory uses Platform auth. The endpoint isn't served\n * without one, since clients would have nowhere to sign in.\n */\n authorizationServers?: string[];\n}\n\n/**\n * MCP requires a server version. The Factory doesn't expose its package\n * version at runtime, so this versions the endpoint's interface instead.\n */\nconst FACTORY_MCP_SERVER_VERSION = '1.0.0';\n\n/** What a connected client is told the server is for and where to start. */\nconst FACTORY_MCP_INSTRUCTIONS = [\n 'A Mastra Factory tracks software work as work items on a board; agent sessions plan and build them.',\n 'Start with `factory_list_attention` for what needs a person, or `search` and `fetch` to find a work item.',\n 'Work item tools file, update, move and follow items; session tools start, message and follow the agent sessions working on them.',\n 'Every call runs as the signed-in user. When the Factory has a repository, session tools act from a private connector session of theirs.',\n].join(' ');\n\n/** Mastra Platform's WorkOS AuthKit, which issues tokens Platform's `/auth/verify` accepts. */\nexport const PLATFORM_MCP_AUTHORIZATION_SERVER = 'https://auth-kit.mastra.ai';\n\nexport function resolveMcpAuthorizationServers(\n providerName: string | undefined,\n config: FactoryMcpConfig | undefined,\n env: Record<string, string | undefined> = process.env,\n): string[] {\n if (config?.authorizationServers?.length) return config.authorizationServers;\n const fromEnv = env.MASTRA_FACTORY_MCP_AUTHORIZATION_SERVER?.trim();\n if (fromEnv) return [fromEnv];\n if (providerName === PLATFORM_AUTH_PROVIDER) return [PLATFORM_MCP_AUTHORIZATION_SERVER];\n return [];\n}\n\nexport interface FactoryMcpRoutesDeps {\n auth: RouteAuth;\n publicOrigin: string;\n authorizationServers: string[];\n projects: Pick<FactoryProjectsStorage, 'get'>;\n /** Source-control handles a connector session can be filed under, tried in order. */\n sourceControls: readonly SourceControlStorageHandle[];\n tools: FactoryToolDependencies;\n}\n\n/** The connector session a user's MCP client acts from: one per user and Factory, stable across requests. */\nexport function connectorSessionId(orgId: string, userId: string, factoryProjectId: string): string {\n const hex = createHash('sha256').update(`mcp\\0${orgId}\\0${userId}\\0${factoryProjectId}`).digest('hex');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-8${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\n/**\n * Get or create the private user session behind a person's MCP client, so\n * session-scoped tools (start/signal sessions, follow work items) have a real\n * session to act from. A Factory without a connected repository has nowhere to\n * file one; its tools still run against the stable id.\n */\nasync function ensureConnectorSession(\n deps: FactoryMcpRoutesDeps,\n args: { orgId: string; userId: string; factoryProjectId: string },\n): Promise<{ sessionId: string; persisted: boolean }> {\n const sessionId = connectorSessionId(args.orgId, args.userId, args.factoryProjectId);\n if (await deps.tools.sessions.getBySessionId(sessionId)) return { sessionId, persisted: true };\n for (const sourceControl of deps.sourceControls) {\n try {\n await ensureFactorySourceSession({\n sourceControl,\n orgId: args.orgId,\n factoryProjectId: args.factoryProjectId,\n branch: `factory/mcp-${sessionId.slice(0, 8)}`,\n attributeToUserId: args.userId,\n sessionId,\n visibility: 'private',\n });\n return { sessionId, persisted: true };\n } catch (error) {\n if (!(error instanceof FactorySourceSessionResolutionError)) throw error;\n }\n }\n return { sessionId, persisted: false };\n}\n\nfunction workItemUrl(publicOrigin: string, factoryProjectId: string, workItemId: string): string {\n return `${publicOrigin}/factory/${encodeURIComponent(factoryProjectId)}/work-items/${encodeURIComponent(workItemId)}`;\n}\n\n/**\n * `search` and `fetch`, the two tools ChatGPT's connectors and deep research\n * look for, answered from the Factory's work items.\n */\nfunction createSearchFetchTools(\n scope: FactoryToolScope,\n deps: FactoryMcpRoutesDeps,\n inspect: Tool<any, any, any, any> | undefined,\n): Record<string, Tool<any, any, any, any>> {\n const project = { orgId: scope.orgId, factoryProjectId: scope.factoryProjectId };\n return {\n search: createTool({\n id: 'search',\n description:\n 'Search this Factory’s work items by title or id. Returns matching items with ids to pass to `fetch`.',\n inputSchema: z.object({ query: z.string().describe('Words to look for in work item titles.') }),\n execute: async ({ query }) => {\n const words = searchWords(query);\n const items = await deps.tools.workItems.listShared(project);\n const results = items\n .filter(item => hasEveryWord(`${item.id} ${item.title}`.toLowerCase(), words))\n .slice(0, 20)\n .map(item => ({\n id: item.id,\n title: item.title,\n url: workItemUrl(deps.publicOrigin, scope.factoryProjectId, item.id),\n }));\n return { results };\n },\n }),\n fetch: createTool({\n id: 'fetch',\n description: 'Fetch everything the Factory knows about one work item, by the id `search` returned.',\n inputSchema: z.object({ id: z.string().describe('Work item id.') }),\n execute: async ({ id }, context) => {\n if (!inspect?.execute) throw new Error('Work item details are unavailable.');\n const details = (await inspect.execute({ workItem: id }, context)) as { item?: { title?: string } };\n return {\n id,\n title: details.item?.title ?? id,\n text: JSON.stringify(details, null, 2),\n url: workItemUrl(deps.publicOrigin, scope.factoryProjectId, id),\n metadata: { factoryProjectId: scope.factoryProjectId },\n };\n },\n }),\n };\n}\n\n/** The tools a signed-in person's MCP client sees for one Factory. */\nexport function createFactoryMcpTools(\n scope: FactoryToolScope,\n deps: FactoryMcpRoutesDeps,\n options: { persistedSession?: boolean } = {},\n): Record<string, Tool<any, any, any, any>> {\n const factoryTools = createFactoryTools({ scope, deps: deps.tools }) as Record<string, Tool<any, any, any, any>>;\n const tools: Record<string, Tool<any, any, any, any>> = {};\n for (const [name, tool] of Object.entries(factoryTools)) {\n if (EXCLUDED_TOOLS.has(name)) continue;\n // Starting a sub-session needs a real parent session row to file it under.\n if (name === 'factory_start_session' && options.persistedSession === false) continue;\n tools[name] = tool;\n }\n Object.assign(tools, createSearchFetchTools(scope, deps, factoryTools.factory_inspect_work_item));\n for (const [name, tool] of Object.entries(tools)) {\n const annotations = FACTORY_TOOL_ANNOTATIONS[name];\n if (annotations) tool.mcp = { ...tool.mcp, annotations };\n }\n return tools;\n}\n\nfunction resourceMetadataUrl(deps: FactoryMcpRoutesDeps, mcpPath: string): string {\n return `${deps.publicOrigin}${PROTECTED_RESOURCE_PREFIX}${mcpPath}`;\n}\n\nfunction unauthorized(deps: FactoryMcpRoutesDeps, mcpPath: string, error = 'unauthorized'): Response {\n return new Response(JSON.stringify({ error }), {\n status: 401,\n headers: {\n 'Content-Type': 'application/json',\n 'WWW-Authenticate': `Bearer resource_metadata=\"${resourceMetadataUrl(deps, mcpPath)}\"`,\n },\n });\n}\n\nasync function handleMcp(deps: FactoryMcpRoutesDeps, c: Context): Promise<Response> {\n const factoryProjectId = c.req.param('projectId') ?? '';\n const mcpPath = new URL(c.req.url).pathname;\n\n await deps.auth.ensureUser(c);\n const tenant = deps.auth.tenant(c);\n if (!tenant) return unauthorized(deps, mcpPath);\n if (!tenant.orgId) return c.json({ error: 'organization_required' }, 403);\n\n const project = await deps.projects.get({ orgId: tenant.orgId, id: factoryProjectId });\n if (!project) return c.json({ error: 'not_found' }, 404);\n\n const { sessionId, persisted } = await ensureConnectorSession(deps, {\n orgId: tenant.orgId,\n userId: tenant.userId,\n factoryProjectId,\n });\n const actorProfile = auditActorProfile(getFactoryAuthUser(c));\n const scope: FactoryToolScope = {\n orgId: tenant.orgId,\n factoryProjectId,\n userId: tenant.userId,\n sessionId,\n // A user session's memory lives under its owner.\n resourceId: tenant.userId,\n threadId: sessionId,\n kind: 'user',\n // A signed-in person is driving the client: the same reach as a web UI turn.\n interactive: true,\n ...(actorProfile ? { actorProfile } : {}),\n };\n\n const server = new MCPServer({\n id: `factory-${factoryProjectId}`,\n name: `${project.name ?? 'Mastra'} Factory`,\n version: FACTORY_MCP_SERVER_VERSION,\n description: 'Manage work items, sessions and decisions in a Mastra Factory.',\n instructions: FACTORY_MCP_INSTRUCTIONS,\n // VS Code and Cursor still open with 2025-era `initialize`; serve them statelessly.\n legacy: 'stateless',\n tools: createFactoryMcpTools(scope, deps, { persistedSession: persisted }),\n events: {\n 'factory.activity': factoryActivityEvent({\n orgId: tenant.orgId,\n factoryProjectId,\n audit: deps.tools.audit,\n workItems: deps.tools.workItems,\n sessions: deps.tools.sessions,\n viewer: { orgId: tenant.orgId, userId: tenant.userId },\n }),\n },\n });\n\n const { req, res } = toReqRes(c.req.raw);\n const done = server\n .startHTTP({ url: new URL(c.req.url), httpPath: mcpPath, req, res })\n .catch(error => {\n console.warn('[factory] MCP request failed:', error);\n if (!res.headersSent) {\n res.writeHead(500, { 'Content-Type': 'application/json' });\n res.end(\n JSON.stringify({ jsonrpc: '2.0', error: { code: -32603, message: 'Internal server error' }, id: null }),\n );\n }\n })\n .finally(() => void server.close());\n const response = propagateClientDisconnect(await toFetchResponse(res), res);\n if (res.writableEnded) await done;\n return response;\n}\n\n/**\n * The Factory's MCP endpoint: Streamable HTTP at\n * `/web/factory/projects/:projectId/mcp`, plus its RFC 9728 protected-resource\n * metadata. Callers sign in with OAuth through the Factory's auth provider and\n * get the tools a web UI session would, under the same permissions.\n */\nexport function buildFactoryMcpRoutes(deps: FactoryMcpRoutesDeps): ApiRoute[] {\n const handler = (c: unknown) => handleMcp(deps, c as Context);\n return [\n ...(['POST', 'GET', 'DELETE'] as const).map(method =>\n registerApiRoute(FACTORY_MCP_PATH, { method, requiresAuth: false, handler }),\n ),\n registerApiRoute(`${PROTECTED_RESOURCE_PREFIX}${FACTORY_MCP_PATH}`, {\n method: 'GET',\n requiresAuth: false,\n handler: c => {\n const mcpPath = new URL(c.req.url).pathname.slice(PROTECTED_RESOURCE_PREFIX.length);\n return c.json({\n resource: `${deps.publicOrigin}${mcpPath}`,\n authorization_servers: deps.authorizationServers,\n bearer_methods_supported: ['header'],\n resource_name: 'Mastra Factory',\n });\n },\n }),\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,MAAa,mBAAmB;AAChC,MAAM,4BAA4B;;;;;AAMlC,MAAM,iCAAiB,IAAI,IAAI,CAAC,wBAAwB,CAAC;;;;;AAmBzD,MAAM,6BAA6B;;AAGnC,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;;AAGV,MA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AK,OAAO,MAAM,CAAC;CACpC,MAAM,WAAW,0BAA0B,MAAM,gBAAgB,GAAG,GAAG,GAAG;CAC1E,IAAI,IAAI,eAAe,MAAM;CAC7B,OAAO;AACT;;;;;;;AAQA,SAAgB,sBAAsB,MAAwC;CAC5E,MAAM,WAAW,MAAe,UAAU,MAAM,CAAY;CAC5D,OAAO,CACL,GAAI;EAAC;EAAQ;EAAO;CAAQ,CAAC,CAAW,KAAI,WAC1C,iBAAiB,kBAAkB;EAAE;EAAQ,cAAc;EAAO;CAAQ,CAAC,CAC7E,GACA,iBAAiB,GAAG,4BAA4B,oBAAoB;EAClE,QAAQ;EACR,cAAc;EACd,UAAS,MAAK;GACZ,MAAM,UAAU,IAAI,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,MAAM,EAAgC;GAClF,OAAO,EAAE,KAAK;IACZ,UAAU,GAAG,KAAK,eAAe;IACjC,uBAAuB,KAAK;IAC5B,0BAA0B,CAAC,QAAQ;IACnC,eAAe;GACjB,CAAC;EACH;CACF,CAAC,CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"routes.js","names":[],"sources":["../../src/mcp/routes.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\nimport type { ApiRoute } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\nimport { createTool } from '@mastra/core/tools';\nimport type { Tool } from '@mastra/core/tools';\nimport { MCPServer } from '@mastra/mcp';\nimport { toFetchResponse, toReqRes } from 'fetch-to-node';\nimport type { Context } from 'hono';\nimport { z } from 'zod';\n\nimport { getFactoryAuthUser } from '../auth.js';\nimport { PLATFORM_AUTH_PROVIDER } from '../platform-auth-host.js';\nimport type { RouteAuth } from '../routes/route.js';\nimport { ensureFactorySourceSession, FactorySourceSessionResolutionError } from '../session/factory-session.js';\nimport { auditActorProfile } from '../storage/domains/audit/base.js';\nimport type { FactoryProjectsStorage } from '../storage/domains/projects/base.js';\nimport type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js';\nimport { FACTORY_TOOL_ANNOTATIONS } from '../tools/annotations.js';\nimport { createFactoryTools } from '../tools/index.js';\nimport type { FactoryToolDependencies, FactoryToolScope } from '../tools/index.js';\nimport { hasEveryWord, searchWords } from '../work-items/search-words.js';\nimport { propagateClientDisconnect } from './disconnect.js';\nimport { factoryActivityEvent } from './events.js';\n\nexport const FACTORY_MCP_PATH = '/web/factory/projects/:projectId/mcp';\nconst PROTECTED_RESOURCE_PREFIX = '/.well-known/oauth-protected-resource';\n\n/**\n * Tools an MCP client never gets. `factory_message_origin` answers the session\n * that started this one; a connector session is started by a person, not a session.\n */\nconst EXCLUDED_TOOLS = new Set(['factory_message_origin']);\n\nexport interface FactoryMcpConfig {\n /** Serve the MCP endpoint. Default `true`; it is never served without an auth provider. */\n enabled?: boolean;\n /**\n * OAuth authorization servers advertised in the protected-resource metadata\n * (RFC 9728) so clients like ChatGPT know where to sign in. Defaults to the\n * `MASTRA_FACTORY_MCP_AUTHORIZATION_SERVER` env var, then to Mastra Platform's\n * AuthKit when the Factory uses Platform auth. The endpoint isn't served\n * without one, since clients would have nowhere to sign in.\n */\n authorizationServers?: string[];\n}\n\n/**\n * MCP requires a server version. The Factory doesn't expose its package\n * version at runtime, so this versions the endpoint's interface instead.\n */\nconst FACTORY_MCP_SERVER_VERSION = '1.0.0';\n\n/** What a connected client is told the server is for and where to start. */\nconst FACTORY_MCP_INSTRUCTIONS = [\n 'A Mastra Factory tracks software work as work items on a board; agent sessions plan and build them.',\n 'Start with `factory_list_attention` for what needs a person, or `search` and `fetch` to find a work item.',\n 'Work item tools file, update, move and follow items; session tools start, message and follow the agent sessions working on them.',\n 'Every call runs as the signed-in user. When the Factory has a repository, session tools act from a private connector session of theirs.',\n].join(' ');\n\n/** Mastra Platform's WorkOS AuthKit, which issues tokens Platform's `/auth/verify` accepts. */\nexport const PLATFORM_MCP_AUTHORIZATION_SERVER = 'https://auth-kit.mastra.ai';\n\nexport function resolveMcpAuthorizationServers(\n providerName: string | undefined,\n config: FactoryMcpConfig | undefined,\n env: Record<string, string | undefined> = process.env,\n): string[] {\n if (config?.authorizationServers?.length) return config.authorizationServers;\n const fromEnv = env.MASTRA_FACTORY_MCP_AUTHORIZATION_SERVER?.trim();\n if (fromEnv) return [fromEnv];\n if (providerName === PLATFORM_AUTH_PROVIDER) return [PLATFORM_MCP_AUTHORIZATION_SERVER];\n return [];\n}\n\nexport interface FactoryMcpRoutesDeps {\n auth: RouteAuth;\n publicOrigin: string;\n authorizationServers: string[];\n projects: Pick<FactoryProjectsStorage, 'get'>;\n /** Source-control handles a connector session can be filed under, tried in order. */\n sourceControls: readonly SourceControlStorageHandle[];\n tools: FactoryToolDependencies;\n}\n\n/** The connector session a user's MCP client acts from: one per user and Factory, stable across requests. */\nexport function connectorSessionId(orgId: string, userId: string, factoryProjectId: string): string {\n const hex = createHash('sha256').update(`mcp\\0${orgId}\\0${userId}\\0${factoryProjectId}`).digest('hex');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-8${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\n/**\n * Get or create the private user session behind a person's MCP client, so\n * session-scoped tools (start/signal sessions, follow work items) have a real\n * session to act from. A Factory without a connected repository has nowhere to\n * file one; its tools still run against the stable id.\n */\nasync function ensureConnectorSession(\n deps: FactoryMcpRoutesDeps,\n args: { orgId: string; userId: string; factoryProjectId: string },\n): Promise<{ sessionId: string; persisted: boolean }> {\n const sessionId = connectorSessionId(args.orgId, args.userId, args.factoryProjectId);\n if (await deps.tools.sessions.getBySessionId(sessionId)) return { sessionId, persisted: true };\n for (const sourceControl of deps.sourceControls) {\n try {\n await ensureFactorySourceSession({\n sourceControl,\n orgId: args.orgId,\n factoryProjectId: args.factoryProjectId,\n branch: `factory/mcp-${sessionId.slice(0, 8)}`,\n attributeToUserId: args.userId,\n sessionId,\n visibility: 'private',\n });\n return { sessionId, persisted: true };\n } catch (error) {\n if (!(error instanceof FactorySourceSessionResolutionError)) throw error;\n }\n }\n return { sessionId, persisted: false };\n}\n\nfunction workItemUrl(publicOrigin: string, factoryProjectId: string, workItemId: string): string {\n return `${publicOrigin}/factory/${encodeURIComponent(factoryProjectId)}/work-items/${encodeURIComponent(workItemId)}`;\n}\n\n/**\n * `search` and `fetch`, the two tools ChatGPT's connectors and deep research\n * look for, answered from the Factory's work items.\n */\nfunction createSearchFetchTools(\n scope: FactoryToolScope,\n deps: FactoryMcpRoutesDeps,\n inspect: Tool<any, any, any, any> | undefined,\n): Record<string, Tool<any, any, any, any>> {\n const project = { orgId: scope.orgId, factoryProjectId: scope.factoryProjectId };\n return {\n search: createTool({\n id: 'search',\n description:\n 'Search this Factory’s work items by title or id. Returns matching items with ids to pass to `fetch`.',\n inputSchema: z.object({ query: z.string().describe('Words to look for in work item titles.') }),\n execute: async ({ query }) => {\n const words = searchWords(query);\n const items = await deps.tools.workItems.listShared(project);\n const results = items\n .filter(item => hasEveryWord(`${item.id} ${item.title}`.toLowerCase(), words))\n .slice(0, 20)\n .map(item => ({\n id: item.id,\n title: item.title,\n url: workItemUrl(deps.publicOrigin, scope.factoryProjectId, item.id),\n }));\n return { results };\n },\n }),\n fetch: createTool({\n id: 'fetch',\n description: 'Fetch everything the Factory knows about one work item, by the id `search` returned.',\n inputSchema: z.object({ id: z.string().describe('Work item id.') }),\n execute: async ({ id }, context) => {\n if (!inspect?.execute) throw new Error('Work item details are unavailable.');\n const details = (await inspect.execute({ workItem: id }, context)) as { item?: { title?: string } };\n return {\n id,\n title: details.item?.title ?? id,\n text: JSON.stringify(details, null, 2),\n url: workItemUrl(deps.publicOrigin, scope.factoryProjectId, id),\n metadata: { factoryProjectId: scope.factoryProjectId },\n };\n },\n }),\n };\n}\n\n/** The tools a signed-in person's MCP client sees for one Factory. */\nexport function createFactoryMcpTools(\n scope: FactoryToolScope,\n deps: FactoryMcpRoutesDeps,\n options: { persistedSession?: boolean } = {},\n): Record<string, Tool<any, any, any, any>> {\n const factoryTools = createFactoryTools({ scope, deps: deps.tools }) as Record<string, Tool<any, any, any, any>>;\n const tools: Record<string, Tool<any, any, any, any>> = {};\n for (const [name, tool] of Object.entries(factoryTools)) {\n if (EXCLUDED_TOOLS.has(name)) continue;\n // Starting a sub-session needs a real parent session row to file it under.\n if (name === 'factory_start_session' && options.persistedSession === false) continue;\n tools[name] = tool;\n }\n Object.assign(tools, createSearchFetchTools(scope, deps, factoryTools.factory_inspect_work_item));\n for (const [name, tool] of Object.entries(tools)) {\n const annotations = FACTORY_TOOL_ANNOTATIONS[name];\n if (annotations) tool.mcp = { ...tool.mcp, annotations };\n }\n return tools;\n}\n\nfunction resourceMetadataUrl(deps: FactoryMcpRoutesDeps, mcpPath: string): string {\n return `${deps.publicOrigin}${PROTECTED_RESOURCE_PREFIX}${mcpPath}`;\n}\n\nfunction unauthorized(deps: FactoryMcpRoutesDeps, mcpPath: string, error = 'unauthorized'): Response {\n return new Response(JSON.stringify({ error }), {\n status: 401,\n headers: {\n 'Content-Type': 'application/json',\n 'WWW-Authenticate': `Bearer resource_metadata=\"${resourceMetadataUrl(deps, mcpPath)}\"`,\n },\n });\n}\n\nasync function handleMcp(deps: FactoryMcpRoutesDeps, c: Context): Promise<Response> {\n const factoryProjectId = c.req.param('projectId') ?? '';\n const mcpPath = new URL(c.req.url).pathname;\n\n await deps.auth.ensureUser(c);\n const tenant = deps.auth.tenant(c);\n if (!tenant) return unauthorized(deps, mcpPath);\n if (!tenant.orgId) return c.json({ error: 'organization_required' }, 403);\n\n const project = await deps.projects.get({ orgId: tenant.orgId, id: factoryProjectId });\n if (!project) return c.json({ error: 'not_found' }, 404);\n\n const { sessionId, persisted } = await ensureConnectorSession(deps, {\n orgId: tenant.orgId,\n userId: tenant.userId,\n factoryProjectId,\n });\n const actorProfile = auditActorProfile(getFactoryAuthUser(c));\n const scope: FactoryToolScope = {\n orgId: tenant.orgId,\n factoryProjectId,\n userId: tenant.userId,\n sessionId,\n // A user session's memory lives under its owner.\n resourceId: tenant.userId,\n threadId: sessionId,\n kind: 'user',\n // A signed-in person is driving the client: the same reach as a web UI turn.\n interactive: true,\n ...(actorProfile ? { actorProfile } : {}),\n };\n\n const server = new MCPServer({\n id: `factory-${factoryProjectId}`,\n name: `${project.name ?? 'Mastra'} Factory`,\n version: FACTORY_MCP_SERVER_VERSION,\n description: 'Manage work items, sessions and decisions in a Mastra Factory.',\n instructions: FACTORY_MCP_INSTRUCTIONS,\n // VS Code and Cursor still open with 2025-era `initialize`; serve them statelessly.\n legacy: 'stateless',\n tools: createFactoryMcpTools(scope, deps, { persistedSession: persisted }),\n events: {\n 'factory.activity': factoryActivityEvent({\n orgId: tenant.orgId,\n factoryProjectId,\n audit: deps.tools.audit,\n workItems: deps.tools.workItems,\n sessions: deps.tools.sessions,\n viewer: { orgId: tenant.orgId, userId: tenant.userId },\n }),\n },\n });\n\n const { req, res } = toReqRes(c.req.raw);\n const done = server\n .startHTTP({ url: new URL(c.req.url), httpPath: mcpPath, req, res })\n .catch(error => {\n console.warn('[factory] MCP request failed:', error);\n if (!res.headersSent) {\n res.writeHead(500, { 'Content-Type': 'application/json' });\n res.end(\n JSON.stringify({ jsonrpc: '2.0', error: { code: -32603, message: 'Internal server error' }, id: null }),\n );\n }\n })\n .finally(() => void server.close());\n const response = propagateClientDisconnect(await toFetchResponse(res), res);\n if (res.writableEnded) await done;\n return response;\n}\n\n/**\n * The Factory's MCP endpoint: Streamable HTTP at\n * `/web/factory/projects/:projectId/mcp`, plus its RFC 9728 protected-resource\n * metadata. Callers sign in with OAuth through the Factory's auth provider and\n * get the tools a web UI session would, under the same permissions.\n */\nexport function buildFactoryMcpRoutes(deps: FactoryMcpRoutesDeps): ApiRoute[] {\n const handler = (c: unknown) => handleMcp(deps, c as Context);\n return [\n ...(['POST', 'GET', 'DELETE'] as const).map(method =>\n registerApiRoute(FACTORY_MCP_PATH, { method, requiresAuth: false, handler }),\n ),\n registerApiRoute(`${PROTECTED_RESOURCE_PREFIX}${FACTORY_MCP_PATH}`, {\n method: 'GET',\n requiresAuth: false,\n handler: c => {\n const mcpPath = new URL(c.req.url).pathname.slice(PROTECTED_RESOURCE_PREFIX.length);\n return c.json({\n resource: `${deps.publicOrigin}${mcpPath}`,\n authorization_servers: deps.authorizationServers,\n bearer_methods_supported: ['header'],\n resource_name: 'Mastra Factory',\n });\n },\n }),\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,MAAa,mBAAmB;AAChC,MAAM,4BAA4B;;;;;AAMlC,MAAM,iCAAiB,IAAI,IAAI,CAAC,wBAAwB,CAAC;;;;;AAmBzD,MAAM,6BAA6B;;AAGnC,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;;AAGV,MAAa,oCAAoC;AAEjD,SAAgB,+BACd,cACA,QACA,MAA0C,QAAQ,KACxC;CACV,IAAI,QAAQ,sBAAsB,QAAQ,OAAO,OAAO;CACxD,MAAM,UAAU,IAAI,yCAAyC,KAAK;CAClE,IAAI,SAAS,OAAO,CAAC,OAAO;CAC5B,IAAI,iBAAA,iBAAyC,OAAO,CAAC,iCAAiC;CACtF,OAAO,CAAC;AACV;;AAaA,SAAgB,mBAAmB,OAAe,QAAgB,kBAAkC;CAClG,MAAM,MAAM,WAAW,QAAQ,CAAC,CAAC,OAAO,QAAQ,MAAM,IAAI,OAAO,IAAI,kBAAkB,CAAC,CAAC,OAAO,KAAK;CACrG,OAAO,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE,IAAI,IAAI,MAAM,IAAI,EAAE,EAAE,IAAI,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE;AAC/G;;;;;;;AAQA,eAAe,uBACb,MACA,MACoD;CACpD,MAAM,YAAY,mBAAmB,KAAK,OAAO,KAAK,QAAQ,KAAK,gBAAgB;CACnF,IAAI,MAAM,KAAK,MAAM,SAAS,eAAe,SAAS,GAAG,OAAO;EAAE;EAAW,WAAW;CAA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,EAAE,KAAK,QAAQ,SAAS,EAAE,IAAI,GAAG;CACvC,MAAM,OAAO,OACV,UAAU;EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,GAAG;EAAG,UAAU;EAAS;EAAK;CAAI,CAAC,CAAC,CACnE,OAAM,UAAS;EACd,QAAQ,KAAK,iCAAiC,KAAK;EACnD,IAAI,CAAC,IAAI,aAAa;GACpB,IAAI,UAAU,KAAK,EAAE,gBAAgB,mBAAmB,CAAC;GACzD,IAAI,IACF,KAAK,UAAU;IAAE,SAAS;IAAO,OAAO;KAAE,MAAM;KAAQ,SAAS;IAAwB;IAAG,IAAI;GAAK,CAAC,CACxG;EACF;CACF,CAAC,CAAC,CACD,cAAc,KAAK,OAAO,MAAM,CAAC;CACpC,MAAM,WAAW,0BAA0B,MAAM,gBAAgB,GAAG,GAAG,GAAG;CAC1E,IAAI,IAAI,eAAe,MAAM;CAC7B,OAAO;AACT;;;;;;;AAQA,SAAgB,sBAAsB,MAAwC;CAC5E,MAAM,WAAW,MAAe,UAAU,MAAM,CAAY;CAC5D,OAAO,CACL,GAAI;EAAC;EAAQ;EAAO;CAAQ,CAAC,CAAW,KAAI,WAC1C,iBAAiB,kBAAkB;EAAE;EAAQ,cAAc;EAAO;CAAQ,CAAC,CAC7E,GACA,iBAAiB,GAAG,4BAA4B,oBAAoB;EAClE,QAAQ;EACR,cAAc;EACd,UAAS,MAAK;GACZ,MAAM,UAAU,IAAI,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,MAAM,EAAgC;GAClF,OAAO,EAAE,KAAK;IACZ,UAAU,GAAG,KAAK,eAAe;IACjC,uBAAuB,KAAK;IAC5B,0BAA0B,CAAC,QAAQ;IACnC,eAAe;GACjB,CAAC;EACH;CACF,CAAC,CACH;AACF"}
|
|
@@ -23,9 +23,16 @@ export declare function movedBody(body: unknown): Pick<BoardSnapshot, 'json' | '
|
|
|
23
23
|
* A computed answer's wire body, named by a hash of itself: a reader that kept it revalidates
|
|
24
24
|
* instead of downloading it again.
|
|
25
25
|
*/
|
|
26
|
-
export declare function hashedBody(body: unknown):
|
|
26
|
+
export declare function hashedBody(body: unknown): BoardSnapshot;
|
|
27
|
+
/**
|
|
28
|
+
* An answer whose `names` hold the version of every card body `bodies` adds: its ETag is a hash of
|
|
29
|
+
* `names`, and the bodies are serialized only for a reader that does not hold the answer.
|
|
30
|
+
*/
|
|
31
|
+
export declare function namedBody(names: object, bodies?: () => object): BoardSnapshot;
|
|
27
32
|
/** {@link boardCheck} of a cached list, computed once for every reader that sends its cursor. */
|
|
28
33
|
export declare function listCheck(items: readonly Card[]): string;
|
|
34
|
+
/** Names a text: a reader holding another text holds another name. */
|
|
35
|
+
export declare function sha1(text: string): string;
|
|
29
36
|
/** Whether an `If-None-Match` header names this ETag (weak comparison, as for GET). */
|
|
30
37
|
export declare function matchesEtag(ifNoneMatch: string | undefined, etag: string): boolean;
|
|
31
38
|
//# sourceMappingURL=board-snapshot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-snapshot.d.ts","sourceRoot":"","sources":["../../src/routes/board-snapshot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAYlE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B;AAMD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAC/B,iBAAiB,EAAE,SAAS,MAAM,EAAE,EACpC,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnC,MAAM,CAAC,EAAE,MAAM,GACd,aAAa,CAGf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB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,MAAM,GAAG,SAAS,CAAC,CAGhF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,CAGvD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,MAAM,GAAG,aAAa,CAY7E;AAID,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,CAIxD;AA4BD,sEAAsE;AACtE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAIlF"}
|
|
@@ -38,7 +38,27 @@ function hashedBody(body) {
|
|
|
38
38
|
const json = JSON.stringify(body);
|
|
39
39
|
return {
|
|
40
40
|
etag: `W/"${sha1(json)}"`,
|
|
41
|
-
json
|
|
41
|
+
json,
|
|
42
|
+
gzipped: () => gzip$1(json)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* An answer whose `names` hold the version of every card body `bodies` adds: its ETag is a hash of
|
|
47
|
+
* `names`, and the bodies are serialized only for a reader that does not hold the answer.
|
|
48
|
+
*/
|
|
49
|
+
function namedBody(names, bodies) {
|
|
50
|
+
const named = JSON.stringify(names);
|
|
51
|
+
let whole;
|
|
52
|
+
const json = () => whole ??= bodies ? JSON.stringify({
|
|
53
|
+
...names,
|
|
54
|
+
...bodies()
|
|
55
|
+
}) : named;
|
|
56
|
+
return {
|
|
57
|
+
etag: `W/"${sha1(named)}${bodies ? ".bodies" : ""}"`,
|
|
58
|
+
get json() {
|
|
59
|
+
return json();
|
|
60
|
+
},
|
|
61
|
+
gzipped: () => gzip$1(json())
|
|
42
62
|
};
|
|
43
63
|
}
|
|
44
64
|
const checks = /* @__PURE__ */ new WeakMap();
|
|
@@ -74,6 +94,7 @@ function snapshot(items, toWire, runningSessionIds, parkedSessionIds, cardsId, m
|
|
|
74
94
|
};
|
|
75
95
|
return cards.latest;
|
|
76
96
|
}
|
|
97
|
+
/** Names a text: a reader holding another text holds another name. */
|
|
77
98
|
function sha1(text) {
|
|
78
99
|
return createHash("sha1").update(text).digest("base64url");
|
|
79
100
|
}
|
|
@@ -83,6 +104,6 @@ function matchesEtag(ifNoneMatch, etag) {
|
|
|
83
104
|
const bare = (tag) => tag.trim().replace(/^W\//, "");
|
|
84
105
|
return ifNoneMatch.split(",").some((tag) => tag.trim() === "*" || bare(tag) === bare(etag));
|
|
85
106
|
}
|
|
86
|
-
export { boardSnapshot, hashedBody, listCheck, matchesEtag, movedBody, scopedSnapshot };
|
|
107
|
+
export { boardSnapshot, hashedBody, listCheck, matchesEtag, movedBody, namedBody, scopedSnapshot, sha1 };
|
|
87
108
|
|
|
88
109
|
//# sourceMappingURL=board-snapshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-snapshot.js","names":["gzip","gzipCallback"],"sources":["../../src/routes/board-snapshot.ts"],"sourcesContent":["import { createHash, randomUUID } from 'node:crypto';\nimport { promisify } from 'node:util';\nimport { gzip as gzipCallback } from 'node:zlib';\n\nimport type { Card } from '../storage/domains/work-items/base.js';\nimport { boardCheck } from '../work-items/board-check.js';\n\nconst gzip = promisify(gzipCallback);\n\ninterface CardsJson {\n /** Names the cards in the ETag. */\n id: string;\n json: string;\n latest?: BoardSnapshot;\n}\n\nexport interface BoardSnapshot {\n etag: string;\n json: string;\n gzipped(): Promise<Buffer>;\n}\n\n// Keyed on the list a caller keeps per board version: `listShared` returns one frozen array until\n// a card changes, so a new version or an evicted list drops its entry with it.\nconst cardsJson = new WeakMap<readonly Card[], CardsJson>();\n\n/**\n * The listing's wire body for one board version and its run activity. Every tab\n * polling an unchanged board shares one serialization and one gzip, and its\n * ETag lets the browser revalidate instead of downloading the board again.\n */\nexport function boardSnapshot(\n items: readonly Card[],\n toWire: (item: Card) => unknown,\n runningSessionIds: readonly string[],\n parkedSessionIds: readonly string[],\n cursor?: string,\n): BoardSnapshot {\n // Random per cached list, so an ETag from before a restart never matches a different board.\n return snapshot(items, toWire, runningSessionIds, parkedSessionIds, () => randomUUID(), { cursor });\n}\n\n/**\n * The wire body for the cards a scoped listing picked. Its ETag names the cards by a hash of\n * their body, not by the board version: a write to a card outside the scope leaves it unchanged,\n * so the tab gets a 304. A caller that passes the same list again shares its serialization.\n * `total` is how many cards matched when `items` is only the first of them.\n */\nexport function scopedSnapshot(\n items: readonly Card[],\n toWire: (item: Card) => unknown,\n runningSessionIds: readonly string[],\n parkedSessionIds: readonly string[],\n total?: number,\n): BoardSnapshot {\n return snapshot(items, toWire, runningSessionIds, parkedSessionIds, sha1, { total });\n}\n\n/** What moved on a board, for the one reader whose cursor it answers: nothing of it is kept. */\nexport function movedBody(body: unknown): Pick<BoardSnapshot, 'json' | 'gzipped'> {\n const json = JSON.stringify(body);\n return { json, gzipped: () => gzip(json) };\n}\n\n/**\n * A computed answer's wire body, named by a hash of itself: a reader that kept it revalidates\n * instead of downloading it again.\n */\nexport function hashedBody(body: unknown):
|
|
1
|
+
{"version":3,"file":"board-snapshot.js","names":["gzip","gzipCallback"],"sources":["../../src/routes/board-snapshot.ts"],"sourcesContent":["import { createHash, randomUUID } from 'node:crypto';\nimport { promisify } from 'node:util';\nimport { gzip as gzipCallback } from 'node:zlib';\n\nimport type { Card } from '../storage/domains/work-items/base.js';\nimport { boardCheck } from '../work-items/board-check.js';\n\nconst gzip = promisify(gzipCallback);\n\ninterface CardsJson {\n /** Names the cards in the ETag. */\n id: string;\n json: string;\n latest?: BoardSnapshot;\n}\n\nexport interface BoardSnapshot {\n etag: string;\n json: string;\n gzipped(): Promise<Buffer>;\n}\n\n// Keyed on the list a caller keeps per board version: `listShared` returns one frozen array until\n// a card changes, so a new version or an evicted list drops its entry with it.\nconst cardsJson = new WeakMap<readonly Card[], CardsJson>();\n\n/**\n * The listing's wire body for one board version and its run activity. Every tab\n * polling an unchanged board shares one serialization and one gzip, and its\n * ETag lets the browser revalidate instead of downloading the board again.\n */\nexport function boardSnapshot(\n items: readonly Card[],\n toWire: (item: Card) => unknown,\n runningSessionIds: readonly string[],\n parkedSessionIds: readonly string[],\n cursor?: string,\n): BoardSnapshot {\n // Random per cached list, so an ETag from before a restart never matches a different board.\n return snapshot(items, toWire, runningSessionIds, parkedSessionIds, () => randomUUID(), { cursor });\n}\n\n/**\n * The wire body for the cards a scoped listing picked. Its ETag names the cards by a hash of\n * their body, not by the board version: a write to a card outside the scope leaves it unchanged,\n * so the tab gets a 304. A caller that passes the same list again shares its serialization.\n * `total` is how many cards matched when `items` is only the first of them.\n */\nexport function scopedSnapshot(\n items: readonly Card[],\n toWire: (item: Card) => unknown,\n runningSessionIds: readonly string[],\n parkedSessionIds: readonly string[],\n total?: number,\n): BoardSnapshot {\n return snapshot(items, toWire, runningSessionIds, parkedSessionIds, sha1, { total });\n}\n\n/** What moved on a board, for the one reader whose cursor it answers: nothing of it is kept. */\nexport function movedBody(body: unknown): Pick<BoardSnapshot, 'json' | 'gzipped'> {\n const json = JSON.stringify(body);\n return { json, gzipped: () => gzip(json) };\n}\n\n/**\n * A computed answer's wire body, named by a hash of itself: a reader that kept it revalidates\n * instead of downloading it again.\n */\nexport function hashedBody(body: unknown): BoardSnapshot {\n const json = JSON.stringify(body);\n return { etag: `W/\"${sha1(json)}\"`, json, gzipped: () => gzip(json) };\n}\n\n/**\n * An answer whose `names` hold the version of every card body `bodies` adds: its ETag is a hash of\n * `names`, and the bodies are serialized only for a reader that does not hold the answer.\n */\nexport function namedBody(names: object, bodies?: () => object): BoardSnapshot {\n const named = JSON.stringify(names);\n let whole: string | undefined;\n const json = () => (whole ??= bodies ? JSON.stringify({ ...names, ...bodies() }) : named);\n return {\n // An answer with bodies is not one a reader of the names alone holds.\n etag: `W/\"${sha1(named)}${bodies ? '.bodies' : ''}\"`,\n get json() {\n return json();\n },\n gzipped: () => gzip(json()),\n };\n}\n\nconst checks = new WeakMap<readonly Card[], string>();\n\n/** {@link boardCheck} of a cached list, computed once for every reader that sends its cursor. */\nexport function listCheck(items: readonly Card[]): string {\n let check = checks.get(items);\n if (check === undefined) checks.set(items, (check = boardCheck(items)));\n return check;\n}\n\nfunction snapshot(\n items: readonly Card[],\n toWire: (item: Card) => unknown,\n runningSessionIds: readonly string[],\n parkedSessionIds: readonly string[],\n cardsId: (json: string) => string,\n more: { total?: number; cursor?: string },\n): BoardSnapshot {\n let cards = cardsJson.get(items);\n if (!cards) {\n const json = JSON.stringify(items.map(toWire));\n cards = { id: cardsId(json), json };\n cardsJson.set(items, cards);\n }\n // Everything the body holds beside the cards: a 304 must never hide a change to any of it.\n const rest = JSON.stringify({ runningSessionIds, parkedSessionIds, ...more });\n const etag = `W/\"${cards.id}.${sha1(rest)}\"`;\n if (cards.latest?.etag === etag) return cards.latest;\n\n const json = `{\"workItems\":${cards.json},${rest.slice(1)}`;\n let gzipped: Promise<Buffer> | undefined;\n // zlib runs on the libuv pool, off the event loop.\n cards.latest = { etag, json, gzipped: () => (gzipped ??= gzip(json)) };\n return cards.latest;\n}\n\n/** Names a text: a reader holding another text holds another name. */\nexport function sha1(text: string): string {\n return createHash('sha1').update(text).digest('base64url');\n}\n\n/** Whether an `If-None-Match` header names this ETag (weak comparison, as for GET). */\nexport function matchesEtag(ifNoneMatch: string | undefined, etag: string): boolean {\n if (!ifNoneMatch) return false;\n const bare = (tag: string) => tag.trim().replace(/^W\\//, '');\n return ifNoneMatch.split(',').some(tag => tag.trim() === '*' || bare(tag) === bare(etag));\n}\n"],"mappings":";;;;;AAOA,MAAMA,SAAO,UAAUC,IAAY;AAiBnC,MAAM,4BAAY,IAAI,QAAoC;;;;;;AAO1D,SAAgB,cACd,OACA,QACA,mBACA,kBACA,QACe;CAEf,OAAO,SAAS,OAAO,QAAQ,mBAAmB,wBAAwB,WAAW,GAAG,EAAE,OAAO,CAAC;A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GAAG;CAAK,CAAC;CAC5E,MAAM,OAAO,MAAM,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;CAC1C,IAAI,MAAM,QAAQ,SAAS,MAAM,OAAO,MAAM;CAE9C,MAAM,OAAO,gBAAgB,MAAM,KAAK,GAAG,KAAK,MAAM,CAAC;CACvD,IAAI;CAEJ,MAAM,SAAS;EAAE;EAAM;EAAM,eAAgB,YAAYA,OAAK,IAAI;CAAG;CACrE,OAAO,MAAM;AACf;;AAGA,SAAgB,KAAK,MAAsB;CACzC,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,WAAW;AAC3D;;AAGA,SAAgB,YAAY,aAAiC,MAAuB;CAClF,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,QAAQ,QAAgB,IAAI,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAC3D,OAAO,YAAY,MAAM,GAAG,CAAC,CAAC,MAAK,QAAO,IAAI,KAAK,MAAM,OAAO,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;AAC1F"}
|
|
@@ -367,6 +367,89 @@ export declare const workItemActivityResponseSchema: z.ZodObject<{
|
|
|
367
367
|
createdAt: z.ZodArray<z.ZodString>;
|
|
368
368
|
doneAt: z.ZodArray<z.ZodString>;
|
|
369
369
|
}, z.core.$strip>;
|
|
370
|
+
export declare const BOARD_PHASES_SORTS: readonly ['recent', 'recent-mine', 'created-newest', 'created-oldest'];
|
|
371
|
+
/** One view of a board: its order, its search and filters, and how deep each phase is listed. */
|
|
372
|
+
export declare const boardPhasesQuerySchema: z.ZodObject<{
|
|
373
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
374
|
+
"created-newest": "created-newest";
|
|
375
|
+
"created-oldest": "created-oldest";
|
|
376
|
+
recent: "recent";
|
|
377
|
+
"recent-mine": "recent-mine";
|
|
378
|
+
}>>;
|
|
379
|
+
q: z.ZodOptional<z.ZodString>;
|
|
380
|
+
source: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
381
|
+
linearProject: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
382
|
+
label: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
383
|
+
teammate: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
384
|
+
author: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
385
|
+
assignee: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
386
|
+
reviewer: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
387
|
+
worked: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
388
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number, string | undefined>>;
|
|
389
|
+
window: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<[phase: string, count: string], string>>, z.ZodTuple<[z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>], null>>>>, z.ZodTransform<Map<string, number>, [string, number][]>>;
|
|
390
|
+
item: z.ZodOptional<z.ZodString>;
|
|
391
|
+
cards: z.ZodOptional<z.ZodEnum<{
|
|
392
|
+
true: "true";
|
|
393
|
+
}>>;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
export declare const boardPhasesResponseSchema: z.ZodObject<{
|
|
396
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
397
|
+
phase: z.ZodString;
|
|
398
|
+
total: z.ZodNumber;
|
|
399
|
+
cards: z.ZodArray<z.ZodObject<{
|
|
400
|
+
id: z.ZodString;
|
|
401
|
+
version: z.ZodString;
|
|
402
|
+
}, z.core.$strip>>;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
item: z.ZodOptional<z.ZodObject<{
|
|
405
|
+
id: z.ZodString;
|
|
406
|
+
version: z.ZodString;
|
|
407
|
+
places: z.ZodArray<z.ZodObject<{
|
|
408
|
+
phase: z.ZodString;
|
|
409
|
+
position: z.ZodNumber;
|
|
410
|
+
}, z.core.$strip>>;
|
|
411
|
+
}, z.core.$strip>>;
|
|
412
|
+
related: z.ZodArray<z.ZodObject<{
|
|
413
|
+
id: z.ZodString;
|
|
414
|
+
version: z.ZodString;
|
|
415
|
+
}, z.core.$strip>>;
|
|
416
|
+
relatedTotal: z.ZodNumber;
|
|
417
|
+
boardTotal: z.ZodNumber;
|
|
418
|
+
matchingTotal: z.ZodNumber;
|
|
419
|
+
workItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
420
|
+
workItem: z.ZodOptional<z.ZodObject<{
|
|
421
|
+
provider: z.ZodString;
|
|
422
|
+
key: z.ZodNullable<z.ZodString>;
|
|
423
|
+
url: z.ZodNullable<z.ZodString>;
|
|
424
|
+
title: z.ZodString;
|
|
425
|
+
state: z.ZodNullable<z.ZodString>;
|
|
426
|
+
labels: z.ZodArray<z.ZodString>;
|
|
427
|
+
author: z.ZodNullable<z.ZodString>;
|
|
428
|
+
}, z.core.$loose>>;
|
|
429
|
+
version: z.ZodString;
|
|
430
|
+
}, z.core.$loose>>>;
|
|
431
|
+
runningSessionIds: z.ZodArray<z.ZodString>;
|
|
432
|
+
parkedSessionIds: z.ZodArray<z.ZodString>;
|
|
433
|
+
}, z.core.$strip>;
|
|
434
|
+
/** What the board's filter menus offer, read over every card of the project. */
|
|
435
|
+
export declare const workItemFilterOptionsResponseSchema: z.ZodObject<{
|
|
436
|
+
labels: z.ZodArray<z.ZodString>;
|
|
437
|
+
people: z.ZodArray<z.ZodObject<{
|
|
438
|
+
id: z.ZodString;
|
|
439
|
+
name: z.ZodString;
|
|
440
|
+
source: z.ZodEnum<{
|
|
441
|
+
github: "github";
|
|
442
|
+
gitlab: "gitlab";
|
|
443
|
+
incidentio: "incidentio";
|
|
444
|
+
jira: "jira";
|
|
445
|
+
linear: "linear";
|
|
446
|
+
}>;
|
|
447
|
+
}, z.core.$strip>>;
|
|
448
|
+
actorIds: z.ZodArray<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>;
|
|
450
|
+
export type BoardPhasesQuery = z.output<typeof boardPhasesQuerySchema>;
|
|
451
|
+
export type BoardPhasesResponse = z.infer<typeof boardPhasesResponseSchema>;
|
|
452
|
+
export type WorkItemFilterOptionsResponse = z.infer<typeof workItemFilterOptionsResponseSchema>;
|
|
370
453
|
export declare const createWorkItemBodySchema: z.ZodObject<{
|
|
371
454
|
title: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
372
455
|
description: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string | null, string>>>>;
|
|
@@ -1074,6 +1157,77 @@ export declare const FACTORY_ROUTE_CONTRACTS: {
|
|
|
1074
1157
|
canEdit: z.ZodOptional<z.ZodBoolean>;
|
|
1075
1158
|
}, z.core.$strip>;
|
|
1076
1159
|
};
|
|
1160
|
+
readonly boardPhases: {
|
|
1161
|
+
readonly method: 'GET';
|
|
1162
|
+
readonly path: '/web/factory/projects/:id/boards/:boardKey/phases';
|
|
1163
|
+
readonly description: 'List the cards under each phase of a board view, in order, with how many match';
|
|
1164
|
+
readonly pathSchema: z.ZodObject<{
|
|
1165
|
+
id: z.ZodString;
|
|
1166
|
+
boardKey: z.ZodString;
|
|
1167
|
+
}, z.core.$strip>;
|
|
1168
|
+
readonly querySchema: z.ZodObject<{
|
|
1169
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
1170
|
+
"created-newest": "created-newest";
|
|
1171
|
+
"created-oldest": "created-oldest";
|
|
1172
|
+
recent: "recent";
|
|
1173
|
+
"recent-mine": "recent-mine";
|
|
1174
|
+
}>>;
|
|
1175
|
+
q: z.ZodOptional<z.ZodString>;
|
|
1176
|
+
source: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1177
|
+
linearProject: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1178
|
+
label: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1179
|
+
teammate: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1180
|
+
author: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1181
|
+
assignee: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1182
|
+
reviewer: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1183
|
+
worked: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodString>>, z.ZodTransform<Set<string>, string[]>>;
|
|
1184
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number, string | undefined>>;
|
|
1185
|
+
window: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<[phase: string, count: string], string>>, z.ZodTuple<[z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>], null>>>>, z.ZodTransform<Map<string, number>, [string, number][]>>;
|
|
1186
|
+
item: z.ZodOptional<z.ZodString>;
|
|
1187
|
+
cards: z.ZodOptional<z.ZodEnum<{
|
|
1188
|
+
true: "true";
|
|
1189
|
+
}>>;
|
|
1190
|
+
}, z.core.$strip>;
|
|
1191
|
+
readonly responseSchema: z.ZodObject<{
|
|
1192
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
1193
|
+
phase: z.ZodString;
|
|
1194
|
+
total: z.ZodNumber;
|
|
1195
|
+
cards: z.ZodArray<z.ZodObject<{
|
|
1196
|
+
id: z.ZodString;
|
|
1197
|
+
version: z.ZodString;
|
|
1198
|
+
}, z.core.$strip>>;
|
|
1199
|
+
}, z.core.$strip>>;
|
|
1200
|
+
item: z.ZodOptional<z.ZodObject<{
|
|
1201
|
+
id: z.ZodString;
|
|
1202
|
+
version: z.ZodString;
|
|
1203
|
+
places: z.ZodArray<z.ZodObject<{
|
|
1204
|
+
phase: z.ZodString;
|
|
1205
|
+
position: z.ZodNumber;
|
|
1206
|
+
}, z.core.$strip>>;
|
|
1207
|
+
}, z.core.$strip>>;
|
|
1208
|
+
related: z.ZodArray<z.ZodObject<{
|
|
1209
|
+
id: z.ZodString;
|
|
1210
|
+
version: z.ZodString;
|
|
1211
|
+
}, z.core.$strip>>;
|
|
1212
|
+
relatedTotal: z.ZodNumber;
|
|
1213
|
+
boardTotal: z.ZodNumber;
|
|
1214
|
+
matchingTotal: z.ZodNumber;
|
|
1215
|
+
workItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1216
|
+
workItem: z.ZodOptional<z.ZodObject<{
|
|
1217
|
+
provider: z.ZodString;
|
|
1218
|
+
key: z.ZodNullable<z.ZodString>;
|
|
1219
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1220
|
+
title: z.ZodString;
|
|
1221
|
+
state: z.ZodNullable<z.ZodString>;
|
|
1222
|
+
labels: z.ZodArray<z.ZodString>;
|
|
1223
|
+
author: z.ZodNullable<z.ZodString>;
|
|
1224
|
+
}, z.core.$loose>>;
|
|
1225
|
+
version: z.ZodString;
|
|
1226
|
+
}, z.core.$loose>>>;
|
|
1227
|
+
runningSessionIds: z.ZodArray<z.ZodString>;
|
|
1228
|
+
parkedSessionIds: z.ZodArray<z.ZodString>;
|
|
1229
|
+
}, z.core.$strip>;
|
|
1230
|
+
};
|
|
1077
1231
|
readonly boardCreate: {
|
|
1078
1232
|
readonly method: 'POST';
|
|
1079
1233
|
readonly path: '/web/factory/projects/:id/boards';
|
|
@@ -1547,6 +1701,34 @@ export declare const FACTORY_ROUTE_CONTRACTS: {
|
|
|
1547
1701
|
}, z.core.$strip>;
|
|
1548
1702
|
readonly responseSchema: z.ZodNull;
|
|
1549
1703
|
};
|
|
1704
|
+
readonly intakeRouteReroutePreview: {
|
|
1705
|
+
readonly method: 'GET';
|
|
1706
|
+
readonly path: '/web/factory/projects/:id/intake-routes/reroute';
|
|
1707
|
+
readonly description: "Untouched cards the project's intake routes would now file on a different board";
|
|
1708
|
+
readonly pathSchema: z.ZodObject<{
|
|
1709
|
+
id: z.ZodString;
|
|
1710
|
+
}, z.core.$strip>;
|
|
1711
|
+
readonly responseSchema: z.ZodObject<{
|
|
1712
|
+
total: z.ZodNumber;
|
|
1713
|
+
moves: z.ZodArray<z.ZodObject<{
|
|
1714
|
+
fromBoard: z.ZodString;
|
|
1715
|
+
toBoard: z.ZodString;
|
|
1716
|
+
count: z.ZodNumber;
|
|
1717
|
+
}, z.core.$strip>>;
|
|
1718
|
+
}, z.core.$strip>;
|
|
1719
|
+
};
|
|
1720
|
+
readonly intakeRouteRerouteApply: {
|
|
1721
|
+
readonly method: 'POST';
|
|
1722
|
+
readonly path: '/web/factory/projects/:id/intake-routes/reroute';
|
|
1723
|
+
readonly description: "Move untouched cards to the start of the board the project's intake routes now file them on";
|
|
1724
|
+
readonly pathSchema: z.ZodObject<{
|
|
1725
|
+
id: z.ZodString;
|
|
1726
|
+
}, z.core.$strip>;
|
|
1727
|
+
readonly responseSchema: z.ZodObject<{
|
|
1728
|
+
moved: z.ZodNumber;
|
|
1729
|
+
skipped: z.ZodNumber;
|
|
1730
|
+
}, z.core.$strip>;
|
|
1731
|
+
};
|
|
1550
1732
|
readonly intakeRouteReorder: {
|
|
1551
1733
|
readonly method: 'POST';
|
|
1552
1734
|
readonly path: '/web/factory/projects/:id/intake-routes/reorder';
|
|
@@ -1688,6 +1870,29 @@ export declare const FACTORY_ROUTE_CONTRACTS: {
|
|
|
1688
1870
|
doneAt: z.ZodArray<z.ZodString>;
|
|
1689
1871
|
}, z.core.$strip>;
|
|
1690
1872
|
};
|
|
1873
|
+
readonly workItemFilterOptions: {
|
|
1874
|
+
readonly method: 'GET';
|
|
1875
|
+
readonly path: '/web/factory/projects/:id/work-items/filter-options';
|
|
1876
|
+
readonly description: 'List the labels and people the cards of a project can be filtered by';
|
|
1877
|
+
readonly pathSchema: z.ZodObject<{
|
|
1878
|
+
id: z.ZodString;
|
|
1879
|
+
}, z.core.$strip>;
|
|
1880
|
+
readonly responseSchema: z.ZodObject<{
|
|
1881
|
+
labels: z.ZodArray<z.ZodString>;
|
|
1882
|
+
people: z.ZodArray<z.ZodObject<{
|
|
1883
|
+
id: z.ZodString;
|
|
1884
|
+
name: z.ZodString;
|
|
1885
|
+
source: z.ZodEnum<{
|
|
1886
|
+
github: "github";
|
|
1887
|
+
gitlab: "gitlab";
|
|
1888
|
+
incidentio: "incidentio";
|
|
1889
|
+
jira: "jira";
|
|
1890
|
+
linear: "linear";
|
|
1891
|
+
}>;
|
|
1892
|
+
}, z.core.$strip>>;
|
|
1893
|
+
actorIds: z.ZodArray<z.ZodString>;
|
|
1894
|
+
}, z.core.$strip>;
|
|
1895
|
+
};
|
|
1691
1896
|
readonly workItemCreate: {
|
|
1692
1897
|
readonly method: 'POST';
|
|
1693
1898
|
readonly path: '/web/factory/projects/:id/work-items';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/routes/contracts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,eAAe,EAA4B,CAAC,oBAAoB,EAAE,GAAG,oBAAoB,EAAE,CAAC,CAA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