@mastra/factory 0.15.1-alpha.0 → 0.16.0-alpha.10
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 +4 -3
- package/dist/boards/index.d.ts +1 -1
- package/dist/boards/index.d.ts.map +1 -1
- package/dist/boards/index.js +2 -2
- package/dist/boards/index.js.map +1 -1
- package/dist/boards/review.d.ts.map +1 -1
- package/dist/boards/review.js +4 -1
- package/dist/boards/review.js.map +1 -1
- package/dist/boards/semantics.d.ts +7 -0
- package/dist/boards/semantics.d.ts.map +1 -1
- package/dist/boards/semantics.js +15 -1
- package/dist/boards/semantics.js.map +1 -1
- package/dist/boards/work.d.ts.map +1 -1
- package/dist/boards/work.js +37 -3
- package/dist/boards/work.js.map +1 -1
- package/dist/capabilities/intake.d.ts +4 -0
- package/dist/capabilities/intake.d.ts.map +1 -1
- package/dist/factory.d.ts +6 -3
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +40 -17
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +2 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/incidentio/agent-tools.d.ts +49 -0
- package/dist/integrations/incidentio/agent-tools.d.ts.map +1 -0
- package/dist/integrations/incidentio/agent-tools.js +90 -0
- package/dist/integrations/incidentio/agent-tools.js.map +1 -0
- package/dist/integrations/incidentio/claim.d.ts +8 -0
- package/dist/integrations/incidentio/claim.d.ts.map +1 -0
- package/dist/integrations/incidentio/claim.js +14 -0
- package/dist/integrations/incidentio/claim.js.map +1 -0
- package/dist/integrations/incidentio/default-rules.d.ts +46 -0
- package/dist/integrations/incidentio/default-rules.d.ts.map +1 -0
- package/dist/integrations/incidentio/default-rules.js +66 -0
- package/dist/integrations/incidentio/default-rules.js.map +1 -0
- package/dist/integrations/incidentio/integration.d.ts +48 -2
- package/dist/integrations/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/incidentio/integration.js +88 -2
- package/dist/integrations/incidentio/integration.js.map +1 -1
- package/dist/integrations/incidentio/issue-reconciler.d.ts +2 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/incidentio/issue-reconciler.js +38 -2
- package/dist/integrations/incidentio/issue-reconciler.js.map +1 -1
- package/dist/integrations/incidentio/routes.d.ts +71 -0
- package/dist/integrations/incidentio/routes.d.ts.map +1 -0
- package/dist/integrations/incidentio/routes.js +245 -0
- package/dist/integrations/incidentio/routes.js.map +1 -0
- package/dist/integrations/incidentio/rules.d.ts +55 -0
- package/dist/integrations/incidentio/rules.d.ts.map +1 -0
- package/dist/integrations/incidentio/rules.js +175 -0
- package/dist/integrations/incidentio/rules.js.map +1 -0
- package/dist/integrations/jira/adf.d.ts +26 -0
- package/dist/integrations/jira/adf.d.ts.map +1 -0
- package/dist/integrations/jira/adf.js +73 -0
- package/dist/integrations/jira/adf.js.map +1 -0
- package/dist/integrations/jira/agent-tools.d.ts +45 -0
- package/dist/integrations/jira/agent-tools.d.ts.map +1 -0
- package/dist/integrations/jira/agent-tools.js +87 -0
- package/dist/integrations/jira/agent-tools.js.map +1 -0
- package/dist/integrations/jira/api.d.ts +157 -0
- package/dist/integrations/jira/api.d.ts.map +1 -0
- package/dist/integrations/jira/api.js +141 -0
- package/dist/integrations/jira/api.js.map +1 -0
- package/dist/integrations/jira/claim.d.ts +9 -0
- package/dist/integrations/jira/claim.d.ts.map +1 -0
- package/dist/integrations/jira/claim.js +15 -0
- package/dist/integrations/jira/claim.js.map +1 -0
- package/dist/integrations/jira/default-rules.d.ts +47 -0
- package/dist/integrations/jira/default-rules.d.ts.map +1 -0
- package/dist/integrations/jira/default-rules.js +67 -0
- package/dist/integrations/jira/default-rules.js.map +1 -0
- package/dist/integrations/jira/integration.d.ts +114 -0
- package/dist/integrations/jira/integration.d.ts.map +1 -0
- package/dist/integrations/jira/integration.js +401 -0
- package/dist/integrations/jira/integration.js.map +1 -0
- package/dist/integrations/jira/issue-reconciler.d.ts +10 -0
- package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/jira/issue-reconciler.js +70 -0
- package/dist/integrations/jira/issue-reconciler.js.map +1 -0
- package/dist/integrations/jira/reconciliation-config.d.ts +3 -0
- package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/jira/reconciliation-config.js +17 -0
- package/dist/integrations/jira/reconciliation-config.js.map +1 -0
- package/dist/integrations/jira/routes.d.ts +54 -0
- package/dist/integrations/jira/routes.d.ts.map +1 -0
- package/dist/integrations/jira/routes.js +260 -0
- package/dist/integrations/jira/routes.js.map +1 -0
- package/dist/integrations/jira/rules.d.ts +57 -0
- package/dist/integrations/jira/rules.d.ts.map +1 -0
- package/dist/integrations/jira/rules.js +175 -0
- package/dist/integrations/jira/rules.js.map +1 -0
- package/dist/integrations/linear/claim.d.ts +8 -0
- package/dist/integrations/linear/claim.d.ts.map +1 -0
- package/dist/integrations/linear/claim.js +14 -0
- package/dist/integrations/linear/claim.js.map +1 -0
- package/dist/integrations/linear/default-rules.d.ts +1 -0
- package/dist/integrations/linear/default-rules.d.ts.map +1 -1
- package/dist/integrations/linear/default-rules.js +2 -0
- package/dist/integrations/linear/default-rules.js.map +1 -1
- package/dist/integrations/linear/integration.d.ts +24 -6
- package/dist/integrations/linear/integration.d.ts.map +1 -1
- package/dist/integrations/linear/integration.js +257 -37
- package/dist/integrations/linear/integration.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts +10 -0
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +74 -10
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts +1 -1
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +27 -2
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts +39 -0
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -0
- package/dist/integrations/platform/connect/routes.js +129 -0
- package/dist/integrations/platform/connect/routes.js.map +1 -0
- package/dist/integrations/platform/github/event-worker.js +1 -1
- package/dist/integrations/platform/github/integration.js +1 -1
- package/dist/integrations/platform/incidentio/integration.d.ts +61 -4
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/platform/incidentio/integration.js +371 -22
- package/dist/integrations/platform/incidentio/integration.js.map +1 -1
- package/dist/integrations/platform/jira/agent-tools.d.ts +36 -0
- package/dist/integrations/platform/jira/agent-tools.d.ts.map +1 -0
- package/dist/integrations/platform/jira/agent-tools.js +85 -0
- package/dist/integrations/platform/jira/agent-tools.js.map +1 -0
- package/dist/integrations/platform/jira/integration.d.ts +65 -0
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -0
- package/dist/integrations/platform/jira/integration.js +540 -0
- package/dist/integrations/platform/jira/integration.js.map +1 -0
- package/dist/integrations/platform/jira/routes.d.ts +55 -0
- package/dist/integrations/platform/jira/routes.d.ts.map +1 -0
- package/dist/integrations/platform/jira/routes.js +274 -0
- package/dist/integrations/platform/jira/routes.js.map +1 -0
- package/dist/integrations/platform/linear/integration.d.ts +34 -1
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +271 -48
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +12 -2
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/oauth.js +2 -5
- package/dist/routes/oauth.js.map +1 -1
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +24 -4
- package/dist/routes/surface.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +8 -0
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +1 -0
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +180 -106
- 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.map +1 -1
- package/dist/rules/start-coordinator.js +4 -1
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/terminal-cleanup.d.ts +14 -1
- package/dist/rules/terminal-cleanup.d.ts.map +1 -1
- package/dist/rules/terminal-cleanup.js +20 -0
- package/dist/rules/terminal-cleanup.js.map +1 -1
- package/dist/rules/tools.d.ts +2 -0
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +30 -2
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +3 -0
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +4 -2
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +72 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +9 -1
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +13 -2
- package/dist/rules/validation.js.map +1 -1
- package/dist/session/run-audit.d.ts +9 -0
- package/dist/session/run-audit.d.ts.map +1 -1
- package/dist/session/run-audit.js +37 -6
- package/dist/session/run-audit.js.map +1 -1
- package/dist/skills/service.d.ts +12 -0
- package/dist/skills/service.d.ts.map +1 -1
- package/dist/skills/service.js +27 -1
- package/dist/skills/service.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +41 -2
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +159 -12
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/supervisor/session-messaging.d.ts +23 -0
- package/dist/supervisor/session-messaging.d.ts.map +1 -0
- package/dist/supervisor/session-messaging.js +15 -0
- package/dist/supervisor/session-messaging.js.map +1 -0
- package/dist/supervisor/write-tools.d.ts +2 -1
- package/dist/supervisor/write-tools.d.ts.map +1 -1
- package/dist/supervisor/write-tools.js +11 -7
- package/dist/supervisor/write-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 +4 -2
- package/dist/work-item-branch.js.map +1 -1
- package/package.json +12 -12
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { assertFactoryDecisionTarget, validateFactoryRuleDecisions } from "../../rules/validation.js";
|
|
2
|
+
import { boardForWorkItem, isTerminalWorkItem } from "../../boards/semantics.js";
|
|
3
|
+
import "../../boards/index.js";
|
|
4
|
+
import { jiraClaimKey } from "./claim.js";
|
|
5
|
+
//#region src/integrations/jira/rules.ts
|
|
6
|
+
const RULE_TIMEOUT_MS = 5e3;
|
|
7
|
+
async function withRuleTimeout(promise) {
|
|
8
|
+
let timeout;
|
|
9
|
+
try {
|
|
10
|
+
return await Promise.race([promise, new Promise((_, reject) => {
|
|
11
|
+
timeout = setTimeout(() => reject(/* @__PURE__ */ new Error("FACTORY_RULE_TIMEOUT")), RULE_TIMEOUT_MS);
|
|
12
|
+
})]);
|
|
13
|
+
} finally {
|
|
14
|
+
if (timeout) clearTimeout(timeout);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
var JiraRules = class {
|
|
18
|
+
options;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
}
|
|
22
|
+
async ingest(input) {
|
|
23
|
+
if (!await this.options.projects.get({
|
|
24
|
+
orgId: input.orgId,
|
|
25
|
+
id: input.factoryProjectId
|
|
26
|
+
})) return {
|
|
27
|
+
status: "missing",
|
|
28
|
+
ingested: 0
|
|
29
|
+
};
|
|
30
|
+
const items = await this.options.storage.list({
|
|
31
|
+
orgId: input.orgId,
|
|
32
|
+
factoryProjectId: input.factoryProjectId
|
|
33
|
+
});
|
|
34
|
+
const itemsBySourceKey = new Map(items.map((item) => [item.externalSource?.externalId, item]));
|
|
35
|
+
const itemsByClaimKey = new Map(items.filter((item) => item.claimKey).map((item) => [item.claimKey, item]));
|
|
36
|
+
const statuses = [];
|
|
37
|
+
for (const issue of input.issues) {
|
|
38
|
+
const relatedItem = itemsByClaimKey.get(jiraClaimKey(issue.id)) ?? itemsBySourceKey.get(issue.id);
|
|
39
|
+
if (!relatedItem && await this.#heldElsewhere(input, issue)) {
|
|
40
|
+
statuses.push("missing");
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
statuses.push(await this.#ingestIssue(input, issue, relatedItem));
|
|
44
|
+
}
|
|
45
|
+
if (statuses.some((status) => status === "committed")) return {
|
|
46
|
+
status: "committed",
|
|
47
|
+
ingested: statuses.length
|
|
48
|
+
};
|
|
49
|
+
if (statuses.some((status) => status === "replayed")) return {
|
|
50
|
+
status: "replayed",
|
|
51
|
+
ingested: statuses.length
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
status: "missing",
|
|
55
|
+
ingested: statuses.length
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async #heldElsewhere(input, issue) {
|
|
59
|
+
const heldLive = (row) => row.factoryProjectId !== input.factoryProjectId && !isTerminalWorkItem(this.options.boards, row);
|
|
60
|
+
const claimant = await this.options.storage.getByClaimKey({
|
|
61
|
+
orgId: input.orgId,
|
|
62
|
+
claimKey: jiraClaimKey(issue.id)
|
|
63
|
+
});
|
|
64
|
+
if (claimant && heldLive(claimant)) return true;
|
|
65
|
+
return (await this.options.storage.listBySource({
|
|
66
|
+
orgId: input.orgId,
|
|
67
|
+
source: {
|
|
68
|
+
integrationId: "jira",
|
|
69
|
+
type: "issue",
|
|
70
|
+
externalId: issue.id
|
|
71
|
+
}
|
|
72
|
+
})).some(heldLive);
|
|
73
|
+
}
|
|
74
|
+
async #ingestIssue(input, issue, relatedItem) {
|
|
75
|
+
const ingressId = `jira:${issue.id}:${issue.updatedAt}`;
|
|
76
|
+
const actor = {
|
|
77
|
+
type: "human",
|
|
78
|
+
id: input.userId
|
|
79
|
+
};
|
|
80
|
+
const isClosed = issue.stateType === "completed" || issue.stateType === "canceled";
|
|
81
|
+
if (isClosed && !relatedItem) return "missing";
|
|
82
|
+
const event = isClosed ? "issueClosed" : "issueObserved";
|
|
83
|
+
const boundBoardId = issue.sourceId ? input.intakeBoards?.[issue.sourceId] : void 0;
|
|
84
|
+
const boundBoard = boundBoardId ? this.options.boards.get(boundBoardId) : void 0;
|
|
85
|
+
const context = {
|
|
86
|
+
tenant: {
|
|
87
|
+
orgId: input.orgId,
|
|
88
|
+
projectId: input.factoryProjectId
|
|
89
|
+
},
|
|
90
|
+
actor,
|
|
91
|
+
ingress: {
|
|
92
|
+
type: "jira",
|
|
93
|
+
id: ingressId
|
|
94
|
+
},
|
|
95
|
+
cause: `jira.${event}`,
|
|
96
|
+
causalChain: [],
|
|
97
|
+
configVersion: this.options.configVersion,
|
|
98
|
+
...relatedItem ? {
|
|
99
|
+
item: {
|
|
100
|
+
id: relatedItem.id,
|
|
101
|
+
source: "jira-issue",
|
|
102
|
+
sourceKey: relatedItem.externalSource?.externalId ?? null,
|
|
103
|
+
parentWorkItemId: relatedItem.parentWorkItemId,
|
|
104
|
+
title: relatedItem.title,
|
|
105
|
+
url: relatedItem.externalSource?.url ?? null,
|
|
106
|
+
stages: relatedItem.stages,
|
|
107
|
+
acceptedAt: relatedItem.acceptedAt,
|
|
108
|
+
metadata: relatedItem.metadata
|
|
109
|
+
},
|
|
110
|
+
board: boardForWorkItem(relatedItem),
|
|
111
|
+
itemRevision: relatedItem.revision
|
|
112
|
+
} : {},
|
|
113
|
+
...boundBoard ? { intake: {
|
|
114
|
+
board: boundBoard.id,
|
|
115
|
+
initialPhase: boundBoard.initialPhase
|
|
116
|
+
} } : {},
|
|
117
|
+
event,
|
|
118
|
+
issue
|
|
119
|
+
};
|
|
120
|
+
const rule = this.options.jiraRules[context.event];
|
|
121
|
+
let decision;
|
|
122
|
+
let decisions = [];
|
|
123
|
+
let outcome = { status: "accepted" };
|
|
124
|
+
try {
|
|
125
|
+
decision = rule ? await withRuleTimeout(Promise.resolve(rule(Object.freeze(context)))) : void 0;
|
|
126
|
+
if (decision?.type === "reject") outcome = {
|
|
127
|
+
status: "rejected",
|
|
128
|
+
code: decision.code,
|
|
129
|
+
reason: decision.reason
|
|
130
|
+
};
|
|
131
|
+
else if (decision) decisions = validateFactoryRuleDecisions([decision]).map((entry) => {
|
|
132
|
+
assertFactoryDecisionTarget(entry, this.options.boards, relatedItem ? boardForWorkItem(relatedItem) : void 0);
|
|
133
|
+
return { ...entry };
|
|
134
|
+
});
|
|
135
|
+
} catch (error) {
|
|
136
|
+
const timedOut = error instanceof Error && error.message === "FACTORY_RULE_TIMEOUT";
|
|
137
|
+
outcome = {
|
|
138
|
+
status: "rejected",
|
|
139
|
+
code: timedOut ? "timeout" : "rule_error",
|
|
140
|
+
reason: timedOut ? "Factory rule evaluation timed out." : error instanceof Error ? error.message.slice(0, 2e3) : "Factory Jira rule failed."
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return (await this.options.storage.commitRuleEvaluation({
|
|
144
|
+
orgId: input.orgId,
|
|
145
|
+
factoryProjectId: input.factoryProjectId,
|
|
146
|
+
workItemId: relatedItem?.id ?? null,
|
|
147
|
+
ingress: {
|
|
148
|
+
identity: ingressId,
|
|
149
|
+
triggerType: "jira.issueObserved"
|
|
150
|
+
},
|
|
151
|
+
configVersion: this.options.configVersion,
|
|
152
|
+
expectedRevision: relatedItem?.revision ?? null,
|
|
153
|
+
actor,
|
|
154
|
+
outcome,
|
|
155
|
+
decisions,
|
|
156
|
+
causalChain: [],
|
|
157
|
+
now: /* @__PURE__ */ new Date()
|
|
158
|
+
})).status;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
function attachJiraRules(jira, context) {
|
|
162
|
+
if (!context.runtime) return void 0;
|
|
163
|
+
const rules = new JiraRules({
|
|
164
|
+
projects: context.storage.projects,
|
|
165
|
+
storage: context.runtime.workItems,
|
|
166
|
+
configVersion: context.runtime.configVersion,
|
|
167
|
+
boards: context.runtime.boards,
|
|
168
|
+
jiraRules: jira.rules
|
|
169
|
+
});
|
|
170
|
+
return (input) => rules.ingest(input);
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { JiraRules, attachJiraRules };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","names":["#heldElsewhere","#ingestIssue"],"sources":["../../../src/integrations/jira/rules.ts"],"sourcesContent":["import { boardForWorkItem, isTerminalWorkItem } from '../../boards/index.js';\nimport type { BoardRegistry } from '../../boards/index.js';\nimport type { FactoryJiraRuleContext, FactoryRuleDecision } from '../../rules/types.js';\nimport { assertFactoryDecisionTarget, validateFactoryRuleDecisions } from '../../rules/validation.js';\nimport type { FactoryProjectsStorage } from '../../storage/domains/projects/base.js';\nimport type { WorkItemRow, WorkItemsStorage } from '../../storage/domains/work-items/base.js';\nimport type { IntegrationContext } from '../base.js';\nimport { jiraClaimKey } from './claim.js';\nimport type { JiraEventRules } from './default-rules.js';\n\nconst RULE_TIMEOUT_MS = 5_000;\n\nasync function withRuleTimeout<T>(promise: Promise<T>): Promise<T> {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n promise,\n new Promise<never>((_, reject) => {\n timeout = setTimeout(() => reject(new Error('FACTORY_RULE_TIMEOUT')), RULE_TIMEOUT_MS);\n }),\n ]);\n } finally {\n if (timeout) clearTimeout(timeout);\n }\n}\n\nexport interface JiraIssueIngress {\n /** Stable issue reference — direct Jira id or the Platform-encoded issue reference. */\n id: string;\n identifier: string;\n title: string;\n url: string;\n state: string;\n stateType: string;\n priorityLabel: string;\n assignee: string | null;\n /** Display name of the Jira reporter, when available. */\n author: string | null;\n /** Jira project key the issue belongs to, when available. */\n project: string | null;\n /** Jira site host the issue was read from, when available. */\n site: string | null;\n labels: string[];\n createdAt: string;\n updatedAt: string;\n /** Jira source the issue was read from; resolves the bound board via `intakeBoards`. */\n sourceId?: string | null;\n}\n\nexport interface JiraRulesOptions {\n projects: Pick<FactoryProjectsStorage, 'get'>;\n storage: WorkItemsStorage;\n configVersion: string;\n boards: BoardRegistry;\n jiraRules: JiraEventRules;\n}\n\nexport interface JiraRulesIngress {\n orgId: string;\n userId: string;\n factoryProjectId: string;\n issues: JiraIssueIngress[];\n /** Board id per bound Jira source id, from the project's intake bindings. */\n intakeBoards?: Readonly<Record<string, string>>;\n}\n\ntype IngressStatus = 'committed' | 'replayed' | 'missing';\n\nexport class JiraRules {\n constructor(private readonly options: JiraRulesOptions) {}\n\n async ingest(input: JiraRulesIngress): Promise<{ status: IngressStatus; ingested: number }> {\n const project = await this.options.projects.get({ orgId: input.orgId, id: input.factoryProjectId });\n if (!project) return { status: 'missing', ingested: 0 };\n\n const items = await this.options.storage.list({ orgId: input.orgId, factoryProjectId: input.factoryProjectId });\n const itemsBySourceKey = new Map(items.map(item => [item.externalSource?.externalId, item]));\n const itemsByClaimKey = new Map(items.filter(item => item.claimKey).map(item => [item.claimKey, item]));\n const statuses: IngressStatus[] = [];\n for (const issue of input.issues) {\n // The claim finds the card even after a metadata drift; the raw issue\n // reference covers cards filed before claims existed.\n const relatedItem = itemsByClaimKey.get(jiraClaimKey(issue.id)) ?? itemsBySourceKey.get(issue.id);\n // One live card per Jira issue per org. The store's claim index is the\n // guarantee; this check spares the dispatcher a refused upsert.\n if (!relatedItem && (await this.#heldElsewhere(input, issue))) {\n statuses.push('missing');\n continue;\n }\n statuses.push(await this.#ingestIssue(input, issue, relatedItem));\n }\n if (statuses.some(status => status === 'committed')) return { status: 'committed', ingested: statuses.length };\n if (statuses.some(status => status === 'replayed')) return { status: 'replayed', ingested: statuses.length };\n return { status: 'missing', ingested: statuses.length };\n }\n\n async #heldElsewhere(input: JiraRulesIngress, issue: JiraIssueIngress): Promise<boolean> {\n const heldLive = (row: WorkItemRow) =>\n row.factoryProjectId !== input.factoryProjectId && !isTerminalWorkItem(this.options.boards, row);\n const claimant = await this.options.storage.getByClaimKey({\n orgId: input.orgId,\n claimKey: jiraClaimKey(issue.id),\n });\n if (claimant && heldLive(claimant)) return true;\n // Cards filed before claims existed carry only the issue reference.\n const legacy = await this.options.storage.listBySource({\n orgId: input.orgId,\n source: { integrationId: 'jira', type: 'issue', externalId: issue.id },\n });\n return legacy.some(heldLive);\n }\n\n async #ingestIssue(\n input: JiraRulesIngress,\n issue: JiraIssueIngress,\n relatedItem: WorkItemRow | undefined,\n ): Promise<IngressStatus> {\n const ingressId = `jira:${issue.id}:${issue.updatedAt}`;\n const actor = { type: 'human' as const, id: input.userId };\n\n // Closed issues without existing work items should not create new ones.\n const isClosed = issue.stateType === 'completed' || issue.stateType === 'canceled';\n if (isClosed && !relatedItem) {\n return 'missing';\n }\n\n const event = isClosed ? 'issueClosed' : 'issueObserved';\n const boundBoardId = issue.sourceId ? input.intakeBoards?.[issue.sourceId] : undefined;\n const boundBoard = boundBoardId ? this.options.boards.get(boundBoardId) : undefined;\n const context: FactoryJiraRuleContext = {\n tenant: { orgId: input.orgId, projectId: input.factoryProjectId },\n actor,\n ingress: { type: 'jira', id: ingressId },\n cause: `jira.${event}`,\n causalChain: [],\n configVersion: this.options.configVersion,\n ...(relatedItem\n ? {\n item: {\n id: relatedItem.id,\n source: 'jira-issue',\n sourceKey: relatedItem.externalSource?.externalId ?? null,\n parentWorkItemId: relatedItem.parentWorkItemId,\n title: relatedItem.title,\n url: relatedItem.externalSource?.url ?? null,\n stages: relatedItem.stages,\n acceptedAt: relatedItem.acceptedAt,\n metadata: relatedItem.metadata,\n },\n board: boardForWorkItem(relatedItem),\n itemRevision: relatedItem.revision,\n }\n : {}),\n ...(boundBoard ? { intake: { board: boundBoard.id, initialPhase: boundBoard.initialPhase } } : {}),\n event,\n issue,\n };\n\n const rule = this.options.jiraRules[context.event];\n let decision: FactoryRuleDecision | void;\n let decisions: Record<string, unknown>[] = [];\n let outcome: { status: 'accepted' | 'rejected'; code?: string; reason?: string } = { status: 'accepted' };\n try {\n decision = rule ? await withRuleTimeout(Promise.resolve(rule(Object.freeze(context)))) : undefined;\n if (decision?.type === 'reject') {\n outcome = { status: 'rejected', code: decision.code, reason: decision.reason };\n } else if (decision) {\n decisions = validateFactoryRuleDecisions([decision]).map(entry => {\n assertFactoryDecisionTarget(\n entry,\n this.options.boards,\n relatedItem ? boardForWorkItem(relatedItem) : undefined,\n );\n return { ...entry };\n });\n }\n } catch (error) {\n const timedOut = error instanceof Error && error.message === 'FACTORY_RULE_TIMEOUT';\n outcome = {\n status: 'rejected',\n code: timedOut ? 'timeout' : 'rule_error',\n reason: timedOut\n ? 'Factory rule evaluation timed out.'\n : error instanceof Error\n ? error.message.slice(0, 2_000)\n : 'Factory Jira rule failed.',\n };\n }\n\n const committed = await this.options.storage.commitRuleEvaluation({\n orgId: input.orgId,\n factoryProjectId: input.factoryProjectId,\n workItemId: relatedItem?.id ?? null,\n ingress: { identity: ingressId, triggerType: 'jira.issueObserved' },\n configVersion: this.options.configVersion,\n expectedRevision: relatedItem?.revision ?? null,\n actor,\n outcome,\n decisions,\n causalChain: [],\n now: new Date(),\n });\n return committed.status;\n }\n}\n\nexport function attachJiraRules(\n jira: { readonly rules: JiraEventRules },\n context: IntegrationContext,\n): ((input: JiraRulesIngress) => Promise<unknown>) | undefined {\n if (!context.runtime) return undefined;\n const rules = new JiraRules({\n projects: context.storage.projects,\n storage: context.runtime.workItems,\n configVersion: context.runtime.configVersion,\n boards: context.runtime.boards,\n jiraRules: jira.rules,\n });\n return input => rules.ingest(input);\n}\n"],"mappings":";;;;;AAUA,MAAM,kBAAkB;AAExB,eAAe,gBAAmB,SAAiC;CACjE,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,QAAQ,KAAK,CACxB,SACA,IAAI,SAAgB,GAAG,WAAW;GAChC,UAAU,iBAAiB,uBAAO,IAAI,MAAM,sBAAsB,CAAC,GAAG,eAAe;EACvF,CAAC,CACH,CAAC;CACH,UAAU;EACR,IAAI,SAAS,aAAa,OAAO;CACnC;AACF;AA4CA,IAAa,YAAb,MA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,QAAQ;EACzB,eAAe,QAAQ,QAAQ;EAC/B,QAAQ,QAAQ,QAAQ;EACxB,WAAW,KAAK;CAClB,CAAC;CACD,QAAO,UAAS,MAAM,OAAO,KAAK;AACpC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org-wide ownership key for a Linear issue's Factory card. Keyed by the issue's
|
|
3
|
+
* stable UUID, never its human identifier: identifiers change when an issue
|
|
4
|
+
* moves between teams, and the UUID is unique across every Linear workspace, so
|
|
5
|
+
* one key names one issue no matter which workspace or source it was read from.
|
|
6
|
+
*/
|
|
7
|
+
export declare function linearClaimKey(issueId: string): string;
|
|
8
|
+
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/claim.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/integrations/linear/claim.ts
|
|
2
|
+
/**
|
|
3
|
+
* Org-wide ownership key for a Linear issue's Factory card. Keyed by the issue's
|
|
4
|
+
* stable UUID, never its human identifier: identifiers change when an issue
|
|
5
|
+
* moves between teams, and the UUID is unique across every Linear workspace, so
|
|
6
|
+
* one key names one issue no matter which workspace or source it was read from.
|
|
7
|
+
*/
|
|
8
|
+
function linearClaimKey(issueId) {
|
|
9
|
+
return `linear:issue:${issueId}`;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { linearClaimKey };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=claim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.js","names":[],"sources":["../../../src/integrations/linear/claim.ts"],"sourcesContent":["/**\n * Org-wide ownership key for a Linear issue's Factory card. Keyed by the issue's\n * stable UUID, never its human identifier: identifiers change when an issue\n * moves between teams, and the UUID is unique across every Linear workspace, so\n * one key names one issue no matter which workspace or source it was read from.\n */\nexport function linearClaimKey(issueId: string): string {\n return `linear:issue:${issueId}`;\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,eAAe,SAAyB;CACtD,OAAO,gBAAgB;AACzB"}
|
|
@@ -7,6 +7,7 @@ declare function linearIssueObserved(context: FactoryLinearRuleContext): {
|
|
|
7
7
|
readonly board: string;
|
|
8
8
|
readonly source: "linear-issue";
|
|
9
9
|
readonly sourceKey: `linear:${string}`;
|
|
10
|
+
readonly claimKey: string;
|
|
10
11
|
readonly title: `${string}: ${string}`;
|
|
11
12
|
readonly url: string;
|
|
12
13
|
readonly stage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-rules.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/default-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"default-rules.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/default-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGjH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAChG,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACrC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC,CACpF,CAAC;AAEF,iBAAS,mBAAmB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;yBAwBnB,MAAM,EAAE;;cAKlD;AAED,iBAAS,iBAAiB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;cAkB3D;AAED,eAAO,MAAM,kBAAkB;;;EAGF,CAAC;AAE9B,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,CAsBpF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { linearClaimKey } from "./claim.js";
|
|
1
2
|
//#region src/integrations/linear/default-rules.ts
|
|
2
3
|
function linearIssueObserved(context) {
|
|
3
4
|
if (context.item) return;
|
|
@@ -7,6 +8,7 @@ function linearIssueObserved(context) {
|
|
|
7
8
|
board: context.intake?.board ?? "work",
|
|
8
9
|
source: "linear-issue",
|
|
9
10
|
sourceKey: `linear:${context.issue.identifier}`,
|
|
11
|
+
claimKey: linearClaimKey(context.issue.id),
|
|
10
12
|
title: `${context.issue.identifier}: ${context.issue.title}`,
|
|
11
13
|
url: context.issue.url,
|
|
12
14
|
stage: context.intake?.initialPhase ?? "triage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-rules.js","names":[],"sources":["../../../src/integrations/linear/default-rules.ts"],"sourcesContent":["import type { FactoryLinearEventName, FactoryLinearRuleContext, FactoryRuleHandler } from '../../rules/types.js';\n\nexport type LinearRuleOverrides = Partial<\n Record<FactoryLinearEventName, FactoryRuleHandler<FactoryLinearRuleContext> | null | undefined>\n>;\nexport type LinearEventRules = Readonly<\n Record<FactoryLinearEventName, FactoryRuleHandler<FactoryLinearRuleContext> | null>\n>;\n\nfunction linearIssueObserved(context: FactoryLinearRuleContext) {\n if (context.item) return;\n return {\n type: 'upsertLinkedWorkItem',\n idempotencyKey: `${context.ingress.id}:issue-triage`,\n // A source bound to a custom board lands on that board's initial phase;\n // otherwise Work auto-triages the new issue.\n board: context.intake?.board ?? 'work',\n source: 'linear-issue',\n sourceKey: `linear:${context.issue.identifier}`,\n title: `${context.issue.identifier}: ${context.issue.title}`,\n url: context.issue.url,\n stage: context.intake?.initialPhase ?? 'triage',\n metadata: {\n linearIssueId: context.issue.id,\n identifier: context.issue.identifier,\n sourceCreatedAt: context.issue.createdAt,\n linearState: context.issue.state,\n linearStateType: context.issue.stateType,\n linearPriority: context.issue.priorityLabel,\n linearAssignee: context.issue.assignee,\n linearCreator: context.issue.creator,\n linearTeam: context.issue.team,\n labels: [...context.issue.labels] as string[],\n ...(context.issue.assignee ? { assignee: context.issue.assignee } : {}),\n ...(context.issue.creator ? { creator: context.issue.creator, author: context.issue.creator } : {}),\n },\n } as const;\n}\n\nfunction linearIssueClosed(context: FactoryLinearRuleContext) {\n if (!context.item || context.item.source !== 'linear-issue') return;\n if (context.board !== 'work') return;\n // Already off the board: nothing to reconcile.\n if (context.item.stages.some(stage => stage === 'done' || stage === 'canceled')) return;\n // Only terminal state types trigger close.\n const stateType = context.issue.stateType;\n if (stateType !== 'completed' && stateType !== 'canceled') return;\n const canceled = stateType === 'canceled';\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:issue-closed`,\n board: 'work',\n stage: canceled ? 'canceled' : 'done',\n message: {\n text: `Linear issue ${context.issue.identifier} was ${canceled ? 'canceled' : 'completed'}; this Work card was moved to ${canceled ? 'Canceled' : 'Done'}.`,\n },\n } as const;\n}\n\nexport const defaultLinearRules = Object.freeze({\n issueObserved: linearIssueObserved,\n issueClosed: linearIssueClosed,\n} satisfies LinearEventRules);\n\nexport function resolveLinearRules(overrides?: LinearRuleOverrides): LinearEventRules {\n if (\n overrides !== undefined &&\n (overrides === null ||\n typeof overrides !== 'object' ||\n Array.isArray(overrides) ||\n ![Object.prototype, null].includes(Object.getPrototypeOf(overrides)))\n ) {\n throw new Error('Linear rules must be a plain object.');\n }\n const rules: Record<string, FactoryRuleHandler<FactoryLinearRuleContext> | null> = { ...defaultLinearRules };\n for (const key of Reflect.ownKeys(overrides ?? {})) {\n if (typeof key !== 'string' || !Object.hasOwn(defaultLinearRules, key)) {\n throw new Error(`Unknown Linear rule event: ${String(key)}.`);\n }\n const handler = overrides?.[key as FactoryLinearEventName];\n if (handler !== undefined && handler !== null && typeof handler !== 'function') {\n throw new Error(`Linear rule ${key} must be a function, null, or undefined.`);\n }\n if (handler !== undefined) rules[key] = handler;\n }\n return Object.freeze(rules) as LinearEventRules;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-rules.js","names":[],"sources":["../../../src/integrations/linear/default-rules.ts"],"sourcesContent":["import type { FactoryLinearEventName, FactoryLinearRuleContext, FactoryRuleHandler } from '../../rules/types.js';\nimport { linearClaimKey } from './claim.js';\n\nexport type LinearRuleOverrides = Partial<\n Record<FactoryLinearEventName, FactoryRuleHandler<FactoryLinearRuleContext> | null | undefined>\n>;\nexport type LinearEventRules = Readonly<\n Record<FactoryLinearEventName, FactoryRuleHandler<FactoryLinearRuleContext> | null>\n>;\n\nfunction linearIssueObserved(context: FactoryLinearRuleContext) {\n if (context.item) return;\n return {\n type: 'upsertLinkedWorkItem',\n idempotencyKey: `${context.ingress.id}:issue-triage`,\n // A source bound to a custom board lands on that board's initial phase;\n // otherwise Work auto-triages the new issue.\n board: context.intake?.board ?? 'work',\n source: 'linear-issue',\n sourceKey: `linear:${context.issue.identifier}`,\n claimKey: linearClaimKey(context.issue.id),\n title: `${context.issue.identifier}: ${context.issue.title}`,\n url: context.issue.url,\n stage: context.intake?.initialPhase ?? 'triage',\n metadata: {\n linearIssueId: context.issue.id,\n identifier: context.issue.identifier,\n sourceCreatedAt: context.issue.createdAt,\n linearState: context.issue.state,\n linearStateType: context.issue.stateType,\n linearPriority: context.issue.priorityLabel,\n linearAssignee: context.issue.assignee,\n linearCreator: context.issue.creator,\n linearTeam: context.issue.team,\n labels: [...context.issue.labels] as string[],\n ...(context.issue.assignee ? { assignee: context.issue.assignee } : {}),\n ...(context.issue.creator ? { creator: context.issue.creator, author: context.issue.creator } : {}),\n },\n } as const;\n}\n\nfunction linearIssueClosed(context: FactoryLinearRuleContext) {\n if (!context.item || context.item.source !== 'linear-issue') return;\n if (context.board !== 'work') return;\n // Already off the board: nothing to reconcile.\n if (context.item.stages.some(stage => stage === 'done' || stage === 'canceled')) return;\n // Only terminal state types trigger close.\n const stateType = context.issue.stateType;\n if (stateType !== 'completed' && stateType !== 'canceled') return;\n const canceled = stateType === 'canceled';\n return {\n type: 'transition',\n idempotencyKey: `${context.ingress.id}:issue-closed`,\n board: 'work',\n stage: canceled ? 'canceled' : 'done',\n message: {\n text: `Linear issue ${context.issue.identifier} was ${canceled ? 'canceled' : 'completed'}; this Work card was moved to ${canceled ? 'Canceled' : 'Done'}.`,\n },\n } as const;\n}\n\nexport const defaultLinearRules = Object.freeze({\n issueObserved: linearIssueObserved,\n issueClosed: linearIssueClosed,\n} satisfies LinearEventRules);\n\nexport function resolveLinearRules(overrides?: LinearRuleOverrides): LinearEventRules {\n if (\n overrides !== undefined &&\n (overrides === null ||\n typeof overrides !== 'object' ||\n Array.isArray(overrides) ||\n ![Object.prototype, null].includes(Object.getPrototypeOf(overrides)))\n ) {\n throw new Error('Linear rules must be a plain object.');\n }\n const rules: Record<string, FactoryRuleHandler<FactoryLinearRuleContext> | null> = { ...defaultLinearRules };\n for (const key of Reflect.ownKeys(overrides ?? {})) {\n if (typeof key !== 'string' || !Object.hasOwn(defaultLinearRules, key)) {\n throw new Error(`Unknown Linear rule event: ${String(key)}.`);\n }\n const handler = overrides?.[key as FactoryLinearEventName];\n if (handler !== undefined && handler !== null && typeof handler !== 'function') {\n throw new Error(`Linear rule ${key} must be a function, null, or undefined.`);\n }\n if (handler !== undefined) rules[key] = handler;\n }\n return Object.freeze(rules) as LinearEventRules;\n}\n"],"mappings":";;AAUA,SAAS,oBAAoB,SAAmC;CAC9D,IAAI,QAAQ,MAAM;CAClB,OAAO;EACL,MAAM;EACN,gBAAgB,GAAG,QAAQ,QAAQ,GAAG;EAGtC,OAAO,QAAQ,QAAQ,SAAS;EAChC,QAAQ;EACR,WAAW,UAAU,QAAQ,MAAM;EACnC,UAAU,eAAe,QAAQ,MAAM,EAAE;EACzC,OAAO,GAAG,QAAQ,MAAM,WAAW,I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YACrB,MAAM,QAAQ,SAAS,KACvB,CAAC,CAAC,OAAO,WAAW,IAAI,CAAC,CAAC,SAAS,OAAO,eAAe,SAAS,CAAC,IAErE,MAAM,IAAI,MAAM,sCAAsC;CAExD,MAAM,QAA6E,EAAE,GAAG,mBAAmB;CAC3G,KAAK,MAAM,OAAO,QAAQ,QAAQ,aAAa,CAAC,CAAC,GAAG;EAClD,IAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,OAAO,oBAAoB,GAAG,GACnE,MAAM,IAAI,MAAM,8BAA8B,OAAO,GAAG,EAAE,EAAE;EAE9D,MAAM,UAAU,YAAY;EAC5B,IAAI,YAAY,KAAA,KAAa,YAAY,QAAQ,OAAO,YAAY,YAClE,MAAM,IAAI,MAAM,eAAe,IAAI,yCAAyC;EAE9E,IAAI,YAAY,KAAA,GAAW,MAAM,OAAO;CAC1C;CACA,OAAO,OAAO,OAAO,KAAK;AAC5B"}
|
|
@@ -57,7 +57,11 @@ export interface LinearWorkspace {
|
|
|
57
57
|
}
|
|
58
58
|
export interface LinearIssue {
|
|
59
59
|
id: string;
|
|
60
|
-
projectId: string;
|
|
60
|
+
projectId: string | null;
|
|
61
|
+
/** Backend workspace identity when source ids span multiple workspaces. */
|
|
62
|
+
workspaceId?: string;
|
|
63
|
+
/** Raw Linear team id for exact team-source attribution. */
|
|
64
|
+
teamId: string | null;
|
|
61
65
|
/** Human key like `ENG-123`. */
|
|
62
66
|
identifier: string;
|
|
63
67
|
title: string;
|
|
@@ -94,14 +98,22 @@ export interface LinearProject {
|
|
|
94
98
|
/** Teams the project belongs to (the Settings picker groups by these). */
|
|
95
99
|
teams: LinearProjectTeam[];
|
|
96
100
|
}
|
|
101
|
+
/** A Linear team, selectable as an intake source in its own right. */
|
|
102
|
+
export interface LinearTeam {
|
|
103
|
+
id: string;
|
|
104
|
+
/** Short team key, e.g. `ENG`. */
|
|
105
|
+
key: string;
|
|
106
|
+
name: string;
|
|
107
|
+
/** Opaque intake source identifier. Optional on the wire for compatibility. */
|
|
108
|
+
sourceId?: string;
|
|
109
|
+
}
|
|
97
110
|
export interface LinearIssueComment {
|
|
98
111
|
author: string | null;
|
|
99
112
|
body: string;
|
|
100
113
|
createdAt: string;
|
|
101
114
|
}
|
|
102
115
|
/** Full issue payload for agent context: everything in {@link LinearIssue} plus description and discussion. */
|
|
103
|
-
export interface LinearIssueDetail extends
|
|
104
|
-
projectId: string | null;
|
|
116
|
+
export interface LinearIssueDetail extends LinearIssue {
|
|
105
117
|
/** Markdown body of the issue, or `null` when empty. */
|
|
106
118
|
description: string | null;
|
|
107
119
|
/** Discussion comments, oldest first. */
|
|
@@ -201,20 +213,26 @@ export declare class LinearIntegration implements FactoryIntegration {
|
|
|
201
213
|
fetchWorkspace(accessToken: string): Promise<LinearWorkspace>;
|
|
202
214
|
/** List the workspace's projects (for the Settings intake-source picker). */
|
|
203
215
|
listProjects(accessToken: string): Promise<LinearProject[]>;
|
|
216
|
+
/** List the workspace's teams (for the Settings intake-source picker). */
|
|
217
|
+
listTeams(accessToken: string): Promise<LinearTeam[]>;
|
|
218
|
+
sourceMatchesIssue(sourceId: string, issue: Pick<LinearIssueDetail, 'projectId' | 'teamId'>): boolean;
|
|
204
219
|
/**
|
|
205
220
|
* List one page of the workspace's active issues (triage/backlog/unstarted/
|
|
206
221
|
* started — completed and canceled are excluded), most recently updated
|
|
207
222
|
* first. When `projectIds` is provided, only issues from those projects are
|
|
208
|
-
* returned.
|
|
223
|
+
* returned. When `teamIds` is provided, only issues in those teams are
|
|
224
|
+
* returned, including issues that belong to no project. Callers list team
|
|
225
|
+
* sources and project sources in separate calls so the two filters are not
|
|
226
|
+
* AND-ed together.
|
|
209
227
|
*/
|
|
210
|
-
listActiveIssues(accessToken: string, after?: string, projectIds?: string[], labels?: string[]): Promise<LinearIssuePage>;
|
|
228
|
+
listActiveIssues(accessToken: string, after?: string, projectIds?: string[], labels?: string[], teamIds?: string[]): Promise<LinearIssuePage>;
|
|
211
229
|
/**
|
|
212
230
|
* Fetch one issue with its description and comments. `idOrIdentifier`
|
|
213
231
|
* accepts both the Linear UUID and the human key (`ENG-123`). Returns
|
|
214
232
|
* `null` when the issue doesn't exist (Linear reports it as an "Entity not
|
|
215
233
|
* found" error).
|
|
216
234
|
*/
|
|
217
|
-
fetchIssueDetail(accessToken: string, idOrIdentifier: string): Promise<LinearIssueDetail | null>;
|
|
235
|
+
fetchIssueDetail(accessToken: string, idOrIdentifier: string, _sourceIds?: string[], _routedSourceIds?: string[]): Promise<LinearIssueDetail | null>;
|
|
218
236
|
/**
|
|
219
237
|
* Post a comment on an issue. `idOrIdentifier` accepts both the Linear UUID
|
|
220
238
|
* and the human key (`ENG-123`) — the identifier is resolved to a UUID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAGV,MAAM,EAKP,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,m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