@leitwerk-dev/jira 0.0.0-bootstrap.0 → 0.4.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.
@@ -0,0 +1,69 @@
1
+ import { type JiraClientLike, type JiraComment, type JiraComponent, type JiraCreateMetadata, type JiraCreateProject, type JiraIssue, type JiraIssueReceipt, type JiraProject, type JiraRemoteLink, type JiraTransition } from "./client.js";
2
+ export { registerJiraTools } from "./tools.js";
3
+ /** @internal */
4
+ export declare class LocalJiraSplitAdapter implements JiraClientLike {
5
+ /** @internal */ readonly baseUrl = "https://jira.test/context";
6
+ /** @internal */ readonly issues: Map<string, JiraIssue>;
7
+ /** @internal */ readonly comments: Map<string, JiraComment[]>;
8
+ /** @internal */ readonly remoteLinks: Map<string, JiraRemoteLink[]>;
9
+ /** @internal */ transitions: JiraTransition[];
10
+ /** @internal */ readonly creations: Record<string, unknown>[];
11
+ /** @internal */ loseNextCreateResponse: boolean;
12
+ /** @internal */ searchVisible: boolean;
13
+ /** @internal */ components: JiraComponent[];
14
+ /** @internal */ epicLinkField: string | null;
15
+ /** @internal */ issueTypes: JiraCreateMetadata["issueTypes"];
16
+ /** @internal */ seedIssue(issue: JiraIssue, epicKey?: string): void;
17
+ /** @internal */ getIssue(id: string): Promise<JiraIssue>;
18
+ /** @internal */ listProjects(): Promise<JiraProject[]>;
19
+ /** @internal */ listCreateProjects(projectId?: string): Promise<JiraCreateProject[]>;
20
+ /** @internal */ listProjectIssues(projectId: string): Promise<JiraIssue[]>;
21
+ /** @internal */ listComponents(): Promise<JiraComponent[]>;
22
+ /** @internal */ searchIssues(projectIds: readonly string[], triggerLabel?: string): Promise<JiraIssue[]>;
23
+ /** @internal */ searchSplitIssues(projectIds: readonly string[]): Promise<JiraIssue[]>;
24
+ /** @internal */ getEpic(issue: JiraIssue): Promise<JiraIssue | null>;
25
+ /** @internal */ createMetadata(_projectId: string, includeEpicLink?: boolean): Promise<JiraCreateMetadata>;
26
+ /** @internal */ createIssueReceipt(fields: Record<string, unknown>): Promise<JiraIssueReceipt>;
27
+ /** @internal */ createIssue(fields: Record<string, unknown>): Promise<JiraIssue>;
28
+ /** @internal */ findSplitIssue(projectId: string, marker: string): Promise<JiraIssue | null>;
29
+ /** @internal */ listComments(id: string): Promise<JiraComment[]>;
30
+ /** @internal */ addComment(id: string, body: string): Promise<JiraComment>;
31
+ /** @internal */ updateLabels(id: string, remove: string[], add: string[]): Promise<void>;
32
+ /** @internal */ listRemoteLinks(id: string): Promise<JiraRemoteLink[]>;
33
+ /** @internal */ upsertRemoteLink(id: string, input: Omit<JiraRemoteLink, "id">): Promise<Pick<JiraRemoteLink, "id">>;
34
+ /** @internal */ listTransitions(_id: string): Promise<JiraTransition[]>;
35
+ /** @internal */ transitionIssue(id: string, transitionId: string): Promise<void>;
36
+ }
37
+ /** @internal */
38
+ export declare class LocalJiraAdapter {
39
+ /** @internal */ readonly root: string;
40
+ /** @internal */ readonly baseUrl: string;
41
+ /** @internal */
42
+ readonly state: {
43
+ /** @internal */
44
+ version: number;
45
+ /** @internal */
46
+ projects: JiraCreateProject[];
47
+ /** @internal */
48
+ issues: JiraIssue[];
49
+ /** @internal */
50
+ comments: Record<string, JiraComment[]>;
51
+ /** @internal */
52
+ remoteLinks: Record<string, JiraRemoteLink[]>;
53
+ };
54
+ /** @internal */
55
+ loseNextIssueResponse: boolean;
56
+ /** @internal */
57
+ constructor(
58
+ /** @internal */ root: string,
59
+ /** @internal */ baseUrl?: string);
60
+ /** @internal */
61
+ save(): void;
62
+ /** @internal */
63
+ seed(project: JiraCreateProject): void;
64
+ /** @internal */
65
+ client(): JiraClientLike;
66
+ }
67
+ /** @internal */
68
+ export declare function localJiraIssueClient(state: Pick<LocalJiraAdapter["state"], "issues" | "comments"> & Partial<Pick<LocalJiraAdapter["state"], "remoteLinks">>, save: () => void): Pick<JiraClientLike, "getIssue" | "listComments" | "addComment" | "updateLabels" | "listRemoteLinks" | "upsertRemoteLink" | "listTransit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,CAAC,EAAE,aAAa,CAAC,CAAC,EACxD,IAAI,EAAE,MAAM,IAAI,GACd,IAAI,CACN,cAAc,EACZ,UAAU,GACV,cAAc,GACd,YAAY,GACZ,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,CACnB,CAwCA"}
@@ -0,0 +1,384 @@
1
+ import {
2
+ jiraEligible,
3
+ jiraSplitEligible,
4
+ registerJiraTools
5
+ } from "./chunk-3DM3KSZC.js";
6
+
7
+ // src/testing.ts
8
+ import { readLocalJson, writeLocalJson } from "@leitwerk-dev/test-support/local-git";
9
+ function upsertRemoteLink(links, input) {
10
+ const previous = links.find((link2) => link2.globalId === input.globalId);
11
+ const link = { ...structuredClone(input), id: previous?.id ?? links.length + 1 };
12
+ if (previous) links[links.indexOf(previous)] = link;
13
+ else links.push(link);
14
+ const result = { id: link.id };
15
+ return result;
16
+ }
17
+ var workflowTransitions = [
18
+ {
19
+ id: "31",
20
+ name: "Start work",
21
+ to: { id: "3", name: "In Progress", statusCategory: { key: "indeterminate" } }
22
+ },
23
+ {
24
+ id: "41",
25
+ name: "Request review",
26
+ to: { id: "4", name: "In Review", statusCategory: { key: "indeterminate" } }
27
+ },
28
+ {
29
+ id: "51",
30
+ name: "Verify change",
31
+ to: { id: "5", name: "In Verification", statusCategory: { key: "indeterminate" } }
32
+ }
33
+ ];
34
+ var LocalJiraSplitAdapter = class {
35
+ /** @internal */
36
+ baseUrl = "https://jira.test/context";
37
+ /** @internal */
38
+ issues = /* @__PURE__ */ new Map();
39
+ /** @internal */
40
+ comments = /* @__PURE__ */ new Map();
41
+ /** @internal */
42
+ remoteLinks = /* @__PURE__ */ new Map();
43
+ /** @internal */
44
+ transitions = structuredClone(workflowTransitions);
45
+ /** @internal */
46
+ creations = [];
47
+ /** @internal */
48
+ loseNextCreateResponse = false;
49
+ /** @internal */
50
+ searchVisible = true;
51
+ /** @internal */
52
+ components = [{ id: "200", name: "Service" }];
53
+ /** @internal */
54
+ epicLinkField = "customfield_100";
55
+ /** @internal */
56
+ issueTypes = [
57
+ { id: "Story", name: "Story", subtask: false, fields: {} },
58
+ { id: "Task", name: "Task", subtask: false, fields: {} },
59
+ { id: "10003", name: "Sub-task", subtask: true, fields: {} }
60
+ ];
61
+ /** @internal */
62
+ seedIssue(issue, epicKey) {
63
+ const stored = structuredClone(issue);
64
+ if (epicKey) Object.assign(stored.fields, { customfield_100: epicKey });
65
+ this.issues.set(issue.id, stored);
66
+ }
67
+ /** @internal */
68
+ async getIssue(id) {
69
+ const issue = this.issues.get(id) ?? [...this.issues.values()].find((candidate) => candidate.key === id);
70
+ if (!issue) throw new Error("Jira issue unavailable");
71
+ return structuredClone(issue);
72
+ }
73
+ /** @internal */
74
+ async listProjects() {
75
+ return [
76
+ ...new Map(
77
+ [...this.issues.values()].map((issue) => [issue.fields.project.id, issue.fields.project])
78
+ ).values()
79
+ ];
80
+ }
81
+ /** @internal */
82
+ async listCreateProjects(projectId) {
83
+ return (await this.listProjects()).filter((project) => !projectId || project.id === projectId).map((project) => ({
84
+ ...project,
85
+ issuetypes: this.issueTypes.filter((type) => !type.subtask).map((type) => ({
86
+ ...type,
87
+ subtask: false,
88
+ fields: Object.fromEntries(
89
+ Object.entries(type.fields).map(([key, field]) => [
90
+ key,
91
+ {
92
+ ...field,
93
+ name: key,
94
+ required: field.required ?? false
95
+ }
96
+ ])
97
+ )
98
+ }))
99
+ }));
100
+ }
101
+ /** @internal */
102
+ async listProjectIssues(projectId) {
103
+ return structuredClone(
104
+ [...this.issues.values()].filter((issue) => issue.fields.project.id === projectId)
105
+ );
106
+ }
107
+ /** @internal */
108
+ async listComponents() {
109
+ return structuredClone(this.components);
110
+ }
111
+ /** @internal */
112
+ async searchIssues(projectIds, triggerLabel) {
113
+ return [...this.issues.values()].filter(
114
+ (issue) => projectIds.includes(issue.fields.project.id) && jiraEligible(issue, triggerLabel)
115
+ ).map((issue) => structuredClone(issue));
116
+ }
117
+ /** @internal */
118
+ async searchSplitIssues(projectIds) {
119
+ return [...this.issues.values()].filter((issue) => projectIds.includes(issue.fields.project.id) && jiraSplitEligible(issue)).map((issue) => structuredClone(issue));
120
+ }
121
+ /** @internal */
122
+ async getEpic(issue) {
123
+ if (issue.fields.issuetype?.name === "Epic") return issue;
124
+ if (!this.epicLinkField) return null;
125
+ const key = issue.fields[this.epicLinkField];
126
+ return typeof key === "string" ? this.getIssue(key) : null;
127
+ }
128
+ /** @internal */
129
+ async createMetadata(_projectId, includeEpicLink = true) {
130
+ if (includeEpicLink && !this.epicLinkField)
131
+ throw new Error("Splitting a Jira epic requires an Epic Link field");
132
+ return {
133
+ epicLinkField: includeEpicLink ? this.epicLinkField : null,
134
+ issueTypes: structuredClone(this.issueTypes)
135
+ };
136
+ }
137
+ /** @internal */
138
+ async createIssueReceipt(fields) {
139
+ const { id, key } = await this.createIssue(fields);
140
+ return { id, key };
141
+ }
142
+ /** @internal */
143
+ async createIssue(fields) {
144
+ const type = this.issueTypes.find(
145
+ (candidate) => candidate.id === fields.issuetype.id
146
+ );
147
+ if (!type) throw new Error("Unknown Jira issue type");
148
+ if (Boolean(type.subtask) !== Boolean(fields.parent))
149
+ throw new Error("Jira subtask creation requires its parent");
150
+ this.creations.push(structuredClone(fields));
151
+ const id = String(1e3 + this.creations.length), key = `APP-${id}`;
152
+ const project = (await this.listProjects()).find(
153
+ (candidate) => candidate.id === fields.project.id
154
+ );
155
+ if (!project) throw new Error("Unknown Jira project");
156
+ this.seedIssue(
157
+ {
158
+ id,
159
+ key,
160
+ fields: {
161
+ summary: String(fields.summary),
162
+ description: String(fields.description),
163
+ components: fields.components.map(
164
+ ({ id: id2 }) => this.components.find((component) => component.id === id2)
165
+ ),
166
+ labels: fields.labels,
167
+ project,
168
+ issuetype: {
169
+ id: fields.issuetype.id,
170
+ name: type.name,
171
+ subtask: type.subtask
172
+ },
173
+ ...fields.parent ? { parent: await this.getIssue(fields.parent.id) } : {},
174
+ status: { statusCategory: { key: "new" } }
175
+ }
176
+ },
177
+ typeof fields.customfield_100 === "string" ? fields.customfield_100 : void 0
178
+ );
179
+ if (this.loseNextCreateResponse) {
180
+ this.loseNextCreateResponse = false;
181
+ throw new Error("Response lost after Jira creation");
182
+ }
183
+ return this.getIssue(id);
184
+ }
185
+ /** @internal */
186
+ async findSplitIssue(projectId, marker) {
187
+ return this.searchVisible ? structuredClone(
188
+ [...this.issues.values()].find(
189
+ (issue) => issue.fields.project.id === projectId && issue.fields.labels.includes(marker)
190
+ ) ?? null
191
+ ) : null;
192
+ }
193
+ /** @internal */
194
+ async listComments(id) {
195
+ return structuredClone(this.comments.get(id) ?? []);
196
+ }
197
+ /** @internal */
198
+ async addComment(id, body) {
199
+ const comments = this.comments.get(id) ?? [];
200
+ const comment = { id: String(comments.length + 1), body };
201
+ comments.push(comment);
202
+ this.comments.set(id, comments);
203
+ return comment;
204
+ }
205
+ /** @internal */
206
+ async updateLabels(id, remove, add) {
207
+ const issue = this.issues.get(id);
208
+ if (!issue) throw new Error("Unknown issue");
209
+ issue.fields.labels = [
210
+ .../* @__PURE__ */ new Set([...issue.fields.labels.filter((label) => !remove.includes(label)), ...add])
211
+ ];
212
+ }
213
+ /** @internal */
214
+ async listRemoteLinks(id) {
215
+ return structuredClone(this.remoteLinks.get(id) ?? []);
216
+ }
217
+ /** @internal */
218
+ async upsertRemoteLink(id, input) {
219
+ const links = this.remoteLinks.get(id) ?? [];
220
+ const result = upsertRemoteLink(links, input);
221
+ this.remoteLinks.set(id, links);
222
+ return result;
223
+ }
224
+ /** @internal */
225
+ async listTransitions(_id) {
226
+ return structuredClone(this.transitions);
227
+ }
228
+ /** @internal */
229
+ async transitionIssue(id, transitionId) {
230
+ const issue = this.issues.get(id);
231
+ const transition = this.transitions.find((transition2) => transition2.id === transitionId);
232
+ if (!issue || !transition) throw new Error("Jira transition unavailable");
233
+ issue.fields.status = structuredClone(transition.to);
234
+ }
235
+ };
236
+ var LocalJiraAdapter = class {
237
+ /** @internal */
238
+ constructor(root, baseUrl = "https://jira.test") {
239
+ this.root = root;
240
+ this.baseUrl = baseUrl;
241
+ this.state = readLocalJson(root, "jira.json", {
242
+ version: 1,
243
+ projects: [],
244
+ issues: [],
245
+ comments: {},
246
+ remoteLinks: {}
247
+ });
248
+ this.state.remoteLinks ??= {};
249
+ }
250
+ root;
251
+ baseUrl;
252
+ /** @internal */
253
+ state;
254
+ /** @internal */
255
+ loseNextIssueResponse = false;
256
+ /** @internal */
257
+ save() {
258
+ writeLocalJson(this.root, "jira.json", this.state);
259
+ }
260
+ /** @internal */
261
+ seed(project) {
262
+ if (this.state.projects.some((candidate) => candidate.id === project.id)) return;
263
+ this.state.projects.push(structuredClone(project));
264
+ this.save();
265
+ }
266
+ /** @internal */
267
+ client() {
268
+ return {
269
+ ...localJiraIssueClient(this.state, () => this.save()),
270
+ baseUrl: this.baseUrl,
271
+ listProjects: async () => structuredClone(this.state.projects),
272
+ listCreateProjects: async (id) => structuredClone(this.state.projects.filter((project) => !id || project.id === id)),
273
+ listComponents: async () => [],
274
+ searchIssues: async (ids) => structuredClone(this.state.issues.filter((issue) => ids.includes(issue.fields.project.id))),
275
+ listProjectIssues: async (id) => structuredClone(this.state.issues.filter((issue) => issue.fields.project.id === id)),
276
+ searchSplitIssues: async (ids) => structuredClone(
277
+ this.state.issues.filter(
278
+ (issue) => ids.includes(issue.fields.project.id) && jiraSplitEligible(issue)
279
+ )
280
+ ),
281
+ getEpic: async (issue) => issue.fields.issuetype?.name === "Epic" ? structuredClone(issue) : null,
282
+ createMetadata: async (id, includeEpicLink = true) => {
283
+ if (includeEpicLink)
284
+ throw new Error("Local ticket creation does not configure an Epic Link field");
285
+ const project = this.state.projects.find((project2) => project2.id === id);
286
+ if (!project) throw new Error("Unknown local Jira project");
287
+ return { epicLinkField: null, issueTypes: structuredClone(project.issuetypes) };
288
+ },
289
+ findSplitIssue: async (id, marker) => {
290
+ const matches = this.state.issues.filter(
291
+ (issue) => issue.fields.project.id === id && issue.fields.labels.includes(marker)
292
+ );
293
+ if (matches.length > 1) throw new Error("Multiple Jira tickets share the split identity");
294
+ return structuredClone(matches[0] ?? null);
295
+ },
296
+ createIssueReceipt: async (fields, signal) => {
297
+ const { id, key } = await this.client().createIssue(fields, signal);
298
+ return { id, key };
299
+ },
300
+ createIssue: async (fields) => {
301
+ const project = this.state.projects.find(
302
+ (project2) => project2.id === fields.project.id
303
+ );
304
+ if (!project) throw new Error("Unknown local Jira project");
305
+ const issueType = project.issuetypes.find(
306
+ (type) => type.id === fields.issuetype.id
307
+ );
308
+ if (!issueType) throw new Error("Unknown local Jira issue type");
309
+ for (const key of Object.keys(fields)) {
310
+ if (!["project", "issuetype"].includes(key) && !Object.hasOwn(issueType.fields, key))
311
+ throw new Error(`Jira field '${key}' is not on the create screen`);
312
+ }
313
+ const created = {
314
+ id: String(this.state.issues.length + 1),
315
+ key: `${project.key}-${this.state.issues.filter((issue) => issue.fields.project.id === project.id).length + 1}`,
316
+ fields: {
317
+ ...fields,
318
+ summary: String(fields.summary),
319
+ description: String(fields.description),
320
+ labels: fields.labels ?? [],
321
+ project,
322
+ components: [],
323
+ status: { statusCategory: { key: "new" } }
324
+ }
325
+ };
326
+ this.state.issues.push(created);
327
+ this.save();
328
+ if (this.loseNextIssueResponse) {
329
+ this.loseNextIssueResponse = false;
330
+ throw new Error("Response lost after issue write");
331
+ }
332
+ return structuredClone(created);
333
+ }
334
+ };
335
+ }
336
+ };
337
+ function localJiraIssueClient(state, save) {
338
+ const issue = (id) => {
339
+ const found = state.issues.find((issue2) => issue2.id === id || issue2.key === id);
340
+ if (!found) throw new Error("Unknown local Jira issue");
341
+ return found;
342
+ };
343
+ return {
344
+ getIssue: async (id) => structuredClone(issue(id)),
345
+ listComments: async (id) => structuredClone(state.comments[issue(id).id] ?? []),
346
+ addComment: async (id, body) => {
347
+ state.comments[issue(id).id] ??= [];
348
+ const comments = state.comments[issue(id).id];
349
+ const comment = { id: String(comments.length + 1), body };
350
+ comments.push(comment);
351
+ save();
352
+ return structuredClone(comment);
353
+ },
354
+ updateLabels: async (id, remove, add) => {
355
+ const current = issue(id);
356
+ current.fields.labels = [
357
+ .../* @__PURE__ */ new Set([...current.fields.labels.filter((label) => !remove.includes(label)), ...add])
358
+ ];
359
+ save();
360
+ },
361
+ listRemoteLinks: async (id) => structuredClone(state.remoteLinks?.[issue(id).id] ?? []),
362
+ upsertRemoteLink: async (id, input) => {
363
+ state.remoteLinks ??= {};
364
+ state.remoteLinks[issue(id).id] ??= [];
365
+ const result = upsertRemoteLink(state.remoteLinks[issue(id).id], input);
366
+ save();
367
+ return result;
368
+ },
369
+ listTransitions: async () => structuredClone(workflowTransitions),
370
+ transitionIssue: async (id, transitionId) => {
371
+ const transition = workflowTransitions.find((candidate) => candidate.id === transitionId);
372
+ if (!transition) throw new Error("Jira transition unavailable");
373
+ issue(id).fields.status = structuredClone(transition.to);
374
+ save();
375
+ }
376
+ };
377
+ }
378
+ export {
379
+ LocalJiraAdapter,
380
+ LocalJiraSplitAdapter,
381
+ localJiraIssueClient,
382
+ registerJiraTools
383
+ };
384
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/testing.ts"],"sourcesContent":["import { readLocalJson, writeLocalJson } from \"@leitwerk-dev/test-support/local-git\";\nimport {\n\ttype JiraClientLike,\n\ttype JiraComment,\n\ttype JiraComponent,\n\ttype JiraCreateMetadata,\n\ttype JiraCreateProject,\n\ttype JiraIssue,\n\ttype JiraIssueReceipt,\n\ttype JiraProject,\n\ttype JiraRemoteLink,\n\ttype JiraTransition,\n\tjiraEligible,\n\tjiraSplitEligible,\n} from \"./client.js\";\n\nexport { registerJiraTools } from \"./tools.js\";\n\nfunction upsertRemoteLink(links: JiraRemoteLink[], input: Omit<JiraRemoteLink, \"id\">) {\n\tconst previous = links.find((link) => link.globalId === input.globalId);\n\tconst link = { ...structuredClone(input), id: previous?.id ?? links.length + 1 };\n\tif (previous) links[links.indexOf(previous)] = link;\n\telse links.push(link);\n\tconst result: Pick<JiraRemoteLink, \"id\"> = { id: link.id };\n\treturn result;\n}\n\nconst workflowTransitions: JiraTransition[] = [\n\t{\n\t\tid: \"31\",\n\t\tname: \"Start work\",\n\t\tto: { id: \"3\", name: \"In Progress\", statusCategory: { key: \"indeterminate\" } },\n\t},\n\t{\n\t\tid: \"41\",\n\t\tname: \"Request review\",\n\t\tto: { id: \"4\", name: \"In Review\", statusCategory: { key: \"indeterminate\" } },\n\t},\n\t{\n\t\tid: \"51\",\n\t\tname: \"Verify change\",\n\t\tto: { id: \"5\", name: \"In Verification\", statusCategory: { key: \"indeterminate\" } },\n\t},\n];\n\n/** @internal */\nexport class LocalJiraSplitAdapter implements JiraClientLike {\n\t/** @internal */ readonly baseUrl = \"https://jira.test/context\";\n\t/** @internal */ readonly issues = new Map<string, JiraIssue>();\n\t/** @internal */ readonly comments = new Map<string, JiraComment[]>();\n\t/** @internal */ readonly remoteLinks = new Map<string, JiraRemoteLink[]>();\n\t/** @internal */ transitions = structuredClone(workflowTransitions);\n\t/** @internal */ readonly creations: Record<string, unknown>[] = [];\n\t/** @internal */ loseNextCreateResponse = false;\n\t/** @internal */ searchVisible = true;\n\t/** @internal */ components: JiraComponent[] = [{ id: \"200\", name: \"Service\" }];\n\t/** @internal */ epicLinkField: string | null = \"customfield_100\";\n\t/** @internal */ issueTypes: JiraCreateMetadata[\"issueTypes\"] = [\n\t\t{ id: \"Story\", name: \"Story\", subtask: false, fields: {} },\n\t\t{ id: \"Task\", name: \"Task\", subtask: false, fields: {} },\n\t\t{ id: \"10003\", name: \"Sub-task\", subtask: true, fields: {} },\n\t];\n\n\t/** @internal */ seedIssue(issue: JiraIssue, epicKey?: string): void {\n\t\tconst stored = structuredClone(issue);\n\t\tif (epicKey) Object.assign(stored.fields, { customfield_100: epicKey });\n\t\tthis.issues.set(issue.id, stored);\n\t}\n\t/** @internal */ async getIssue(id: string): Promise<JiraIssue> {\n\t\tconst issue =\n\t\t\tthis.issues.get(id) ?? [...this.issues.values()].find((candidate) => candidate.key === id);\n\t\tif (!issue) throw new Error(\"Jira issue unavailable\");\n\t\treturn structuredClone(issue);\n\t}\n\t/** @internal */ async listProjects(): Promise<JiraProject[]> {\n\t\treturn [\n\t\t\t...new Map(\n\t\t\t\t[...this.issues.values()].map((issue) => [issue.fields.project.id, issue.fields.project]),\n\t\t\t).values(),\n\t\t];\n\t}\n\t/** @internal */ async listCreateProjects(projectId?: string): Promise<JiraCreateProject[]> {\n\t\treturn (await this.listProjects())\n\t\t\t.filter((project) => !projectId || project.id === projectId)\n\t\t\t.map((project) => ({\n\t\t\t\t...project,\n\t\t\t\tissuetypes: this.issueTypes\n\t\t\t\t\t.filter((type) => !type.subtask)\n\t\t\t\t\t.map((type) => ({\n\t\t\t\t\t\t...type,\n\t\t\t\t\t\tsubtask: false,\n\t\t\t\t\t\tfields: Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries(type.fields).map(([key, field]) => [\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\t\t\trequired: field.required ?? false,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t),\n\t\t\t\t\t})),\n\t\t\t}));\n\t}\n\t/** @internal */ async listProjectIssues(projectId: string): Promise<JiraIssue[]> {\n\t\treturn structuredClone(\n\t\t\t[...this.issues.values()].filter((issue) => issue.fields.project.id === projectId),\n\t\t);\n\t}\n\t/** @internal */ async listComponents(): Promise<JiraComponent[]> {\n\t\treturn structuredClone(this.components);\n\t}\n\t/** @internal */ async searchIssues(projectIds: readonly string[], triggerLabel?: string) {\n\t\treturn [...this.issues.values()]\n\t\t\t.filter(\n\t\t\t\t(issue) =>\n\t\t\t\t\tprojectIds.includes(issue.fields.project.id) && jiraEligible(issue, triggerLabel),\n\t\t\t)\n\t\t\t.map((issue) => structuredClone(issue));\n\t}\n\t/** @internal */ async searchSplitIssues(projectIds: readonly string[]) {\n\t\treturn [...this.issues.values()]\n\t\t\t.filter((issue) => projectIds.includes(issue.fields.project.id) && jiraSplitEligible(issue))\n\t\t\t.map((issue) => structuredClone(issue));\n\t}\n\t/** @internal */ async getEpic(issue: JiraIssue): Promise<JiraIssue | null> {\n\t\tif (issue.fields.issuetype?.name === \"Epic\") return issue;\n\t\tif (!this.epicLinkField) return null;\n\t\tconst key = (issue.fields as unknown as Record<string, unknown>)[this.epicLinkField];\n\t\treturn typeof key === \"string\" ? this.getIssue(key) : null;\n\t}\n\t/** @internal */ async createMetadata(\n\t\t_projectId: string,\n\t\tincludeEpicLink = true,\n\t): Promise<JiraCreateMetadata> {\n\t\tif (includeEpicLink && !this.epicLinkField)\n\t\t\tthrow new Error(\"Splitting a Jira epic requires an Epic Link field\");\n\t\treturn {\n\t\t\tepicLinkField: includeEpicLink ? this.epicLinkField : null,\n\t\t\tissueTypes: structuredClone(this.issueTypes),\n\t\t};\n\t}\n\t/** @internal */ async createIssueReceipt(\n\t\tfields: Record<string, unknown>,\n\t): Promise<JiraIssueReceipt> {\n\t\tconst { id, key } = await this.createIssue(fields);\n\t\treturn { id, key };\n\t}\n\t/** @internal */ async createIssue(fields: Record<string, unknown>): Promise<JiraIssue> {\n\t\tconst type = this.issueTypes.find(\n\t\t\t(candidate) => candidate.id === (fields.issuetype as { id: string }).id,\n\t\t);\n\t\tif (!type) throw new Error(\"Unknown Jira issue type\");\n\t\tif (Boolean(type.subtask) !== Boolean(fields.parent))\n\t\t\tthrow new Error(\"Jira subtask creation requires its parent\");\n\t\tthis.creations.push(structuredClone(fields));\n\t\tconst id = String(1000 + this.creations.length),\n\t\t\tkey = `APP-${id}`;\n\t\tconst project = (await this.listProjects()).find(\n\t\t\t(candidate) => candidate.id === (fields.project as { id: string }).id,\n\t\t);\n\t\tif (!project) throw new Error(\"Unknown Jira project\");\n\t\tthis.seedIssue(\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tkey,\n\t\t\t\tfields: {\n\t\t\t\t\tsummary: String(fields.summary),\n\t\t\t\t\tdescription: String(fields.description),\n\t\t\t\t\tcomponents: (fields.components as { id: string }[]).map(\n\t\t\t\t\t\t({ id }) => this.components.find((component) => component.id === id)!,\n\t\t\t\t\t),\n\t\t\t\t\tlabels: fields.labels as string[],\n\t\t\t\t\tproject,\n\t\t\t\t\tissuetype: {\n\t\t\t\t\t\tid: (fields.issuetype as { id: string }).id,\n\t\t\t\t\t\tname: type.name,\n\t\t\t\t\t\tsubtask: type.subtask,\n\t\t\t\t\t},\n\t\t\t\t\t...(fields.parent\n\t\t\t\t\t\t? { parent: await this.getIssue((fields.parent as { id: string }).id) }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\tstatus: { statusCategory: { key: \"new\" } },\n\t\t\t\t},\n\t\t\t},\n\t\t\ttypeof fields.customfield_100 === \"string\" ? fields.customfield_100 : undefined,\n\t\t);\n\t\tif (this.loseNextCreateResponse) {\n\t\t\tthis.loseNextCreateResponse = false;\n\t\t\tthrow new Error(\"Response lost after Jira creation\");\n\t\t}\n\t\treturn this.getIssue(id);\n\t}\n\t/** @internal */ async findSplitIssue(projectId: string, marker: string) {\n\t\treturn this.searchVisible\n\t\t\t? structuredClone(\n\t\t\t\t\t[...this.issues.values()].find(\n\t\t\t\t\t\t(issue) =>\n\t\t\t\t\t\t\tissue.fields.project.id === projectId && issue.fields.labels.includes(marker),\n\t\t\t\t\t) ?? null,\n\t\t\t\t)\n\t\t\t: null;\n\t}\n\t/** @internal */ async listComments(id: string) {\n\t\treturn structuredClone(this.comments.get(id) ?? []);\n\t}\n\t/** @internal */ async addComment(id: string, body: string): Promise<JiraComment> {\n\t\tconst comments = this.comments.get(id) ?? [];\n\t\tconst comment = { id: String(comments.length + 1), body };\n\t\tcomments.push(comment);\n\t\tthis.comments.set(id, comments);\n\t\treturn comment;\n\t}\n\t/** @internal */ async updateLabels(id: string, remove: string[], add: string[]) {\n\t\tconst issue = this.issues.get(id);\n\t\tif (!issue) throw new Error(\"Unknown issue\");\n\t\tissue.fields.labels = [\n\t\t\t...new Set([...issue.fields.labels.filter((label) => !remove.includes(label)), ...add]),\n\t\t];\n\t}\n\t/** @internal */ async listRemoteLinks(id: string) {\n\t\treturn structuredClone(this.remoteLinks.get(id) ?? []);\n\t}\n\t/** @internal */ async upsertRemoteLink(id: string, input: Omit<JiraRemoteLink, \"id\">) {\n\t\tconst links = this.remoteLinks.get(id) ?? [];\n\t\tconst result = upsertRemoteLink(links, input);\n\t\tthis.remoteLinks.set(id, links);\n\t\treturn result;\n\t}\n\t/** @internal */ async listTransitions(_id: string) {\n\t\treturn structuredClone(this.transitions);\n\t}\n\t/** @internal */ async transitionIssue(id: string, transitionId: string) {\n\t\tconst issue = this.issues.get(id);\n\t\tconst transition = this.transitions.find((transition) => transition.id === transitionId);\n\t\tif (!issue || !transition) throw new Error(\"Jira transition unavailable\");\n\t\tissue.fields.status = structuredClone(transition.to);\n\t}\n}\n\n/** @internal */\nexport class LocalJiraAdapter {\n\t/** @internal */\n\treadonly state: {\n\t\t/** @internal */\n\t\tversion: number;\n\t\t/** @internal */\n\t\tprojects: JiraCreateProject[];\n\t\t/** @internal */\n\t\tissues: JiraIssue[];\n\t\t/** @internal */\n\t\tcomments: Record<string, JiraComment[]>;\n\t\t/** @internal */\n\t\tremoteLinks: Record<string, JiraRemoteLink[]>;\n\t};\n\t/** @internal */\n\tloseNextIssueResponse = false;\n\t/** @internal */\n\tconstructor(\n\t\t/** @internal */ readonly root: string,\n\t\t/** @internal */ readonly baseUrl = \"https://jira.test\",\n\t) {\n\t\tthis.state = readLocalJson(root, \"jira.json\", {\n\t\t\tversion: 1,\n\t\t\tprojects: [],\n\t\t\tissues: [],\n\t\t\tcomments: {},\n\t\t\tremoteLinks: {},\n\t\t});\n\t\tthis.state.remoteLinks ??= {};\n\t}\n\t/** @internal */\n\tsave(): void {\n\t\twriteLocalJson(this.root, \"jira.json\", this.state);\n\t}\n\t/** @internal */\n\tseed(project: JiraCreateProject): void {\n\t\tif (this.state.projects.some((candidate) => candidate.id === project.id)) return;\n\t\tthis.state.projects.push(structuredClone(project));\n\t\tthis.save();\n\t}\n\t/** @internal */\n\tclient(): JiraClientLike {\n\t\treturn {\n\t\t\t...localJiraIssueClient(this.state, () => this.save()),\n\t\t\tbaseUrl: this.baseUrl,\n\t\t\tlistProjects: async () => structuredClone(this.state.projects),\n\t\t\tlistCreateProjects: async (id) =>\n\t\t\t\tstructuredClone(this.state.projects.filter((project) => !id || project.id === id)),\n\t\t\tlistComponents: async () => [],\n\t\t\tsearchIssues: async (ids) =>\n\t\t\t\tstructuredClone(this.state.issues.filter((issue) => ids.includes(issue.fields.project.id))),\n\t\t\tlistProjectIssues: async (id) =>\n\t\t\t\tstructuredClone(this.state.issues.filter((issue) => issue.fields.project.id === id)),\n\t\t\tsearchSplitIssues: async (ids) =>\n\t\t\t\tstructuredClone(\n\t\t\t\t\tthis.state.issues.filter(\n\t\t\t\t\t\t(issue) => ids.includes(issue.fields.project.id) && jiraSplitEligible(issue),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\tgetEpic: async (issue) =>\n\t\t\t\tissue.fields.issuetype?.name === \"Epic\" ? structuredClone(issue) : null,\n\t\t\tcreateMetadata: async (id, includeEpicLink = true) => {\n\t\t\t\tif (includeEpicLink)\n\t\t\t\t\tthrow new Error(\"Local ticket creation does not configure an Epic Link field\");\n\t\t\t\tconst project = this.state.projects.find((project) => project.id === id);\n\t\t\t\tif (!project) throw new Error(\"Unknown local Jira project\");\n\t\t\t\treturn { epicLinkField: null, issueTypes: structuredClone(project.issuetypes) };\n\t\t\t},\n\t\t\tfindSplitIssue: async (id, marker) => {\n\t\t\t\tconst matches = this.state.issues.filter(\n\t\t\t\t\t(issue) => issue.fields.project.id === id && issue.fields.labels.includes(marker),\n\t\t\t\t);\n\t\t\t\tif (matches.length > 1) throw new Error(\"Multiple Jira tickets share the split identity\");\n\t\t\t\treturn structuredClone(matches[0] ?? null);\n\t\t\t},\n\t\t\tcreateIssueReceipt: async (fields, signal) => {\n\t\t\t\tconst { id, key } = await this.client().createIssue(fields, signal);\n\t\t\t\treturn { id, key };\n\t\t\t},\n\t\t\tcreateIssue: async (fields) => {\n\t\t\t\tconst project = this.state.projects.find(\n\t\t\t\t\t(project) => project.id === (fields.project as { id: string }).id,\n\t\t\t\t);\n\t\t\t\tif (!project) throw new Error(\"Unknown local Jira project\");\n\t\t\t\tconst issueType = project.issuetypes.find(\n\t\t\t\t\t(type) => type.id === (fields.issuetype as { id: string }).id,\n\t\t\t\t);\n\t\t\t\tif (!issueType) throw new Error(\"Unknown local Jira issue type\");\n\t\t\t\tfor (const key of Object.keys(fields)) {\n\t\t\t\t\tif (![\"project\", \"issuetype\"].includes(key) && !Object.hasOwn(issueType.fields, key))\n\t\t\t\t\t\tthrow new Error(`Jira field '${key}' is not on the create screen`);\n\t\t\t\t}\n\t\t\t\tconst created: JiraIssue = {\n\t\t\t\t\tid: String(this.state.issues.length + 1),\n\t\t\t\t\tkey: `${project.key}-${this.state.issues.filter((issue) => issue.fields.project.id === project.id).length + 1}`,\n\t\t\t\t\tfields: {\n\t\t\t\t\t\t...fields,\n\t\t\t\t\t\tsummary: String(fields.summary),\n\t\t\t\t\t\tdescription: String(fields.description),\n\t\t\t\t\t\tlabels: (fields.labels as string[] | undefined) ?? [],\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\tcomponents: [],\n\t\t\t\t\t\tstatus: { statusCategory: { key: \"new\" } },\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tthis.state.issues.push(created);\n\t\t\t\tthis.save();\n\t\t\t\tif (this.loseNextIssueResponse) {\n\t\t\t\t\tthis.loseNextIssueResponse = false;\n\t\t\t\t\tthrow new Error(\"Response lost after issue write\");\n\t\t\t\t}\n\t\t\t\treturn structuredClone(created);\n\t\t\t},\n\t\t};\n\t}\n}\n\n/** @internal */\nexport function localJiraIssueClient(\n\tstate: Pick<LocalJiraAdapter[\"state\"], \"issues\" | \"comments\"> &\n\t\tPartial<Pick<LocalJiraAdapter[\"state\"], \"remoteLinks\">>,\n\tsave: () => void,\n): Pick<\n\tJiraClientLike,\n\t| \"getIssue\"\n\t| \"listComments\"\n\t| \"addComment\"\n\t| \"updateLabels\"\n\t| \"listRemoteLinks\"\n\t| \"upsertRemoteLink\"\n\t| \"listTransitions\"\n\t| \"transitionIssue\"\n> {\n\tconst issue = (id: string) => {\n\t\tconst found = state.issues.find((issue) => issue.id === id || issue.key === id);\n\t\tif (!found) throw new Error(\"Unknown local Jira issue\");\n\t\treturn found;\n\t};\n\treturn {\n\t\tgetIssue: async (id) => structuredClone(issue(id)),\n\t\tlistComments: async (id) => structuredClone(state.comments[issue(id).id] ?? []),\n\t\taddComment: async (id, body) => {\n\t\t\tstate.comments[issue(id).id] ??= [];\n\t\t\tconst comments = state.comments[issue(id).id];\n\t\t\tconst comment = { id: String(comments.length + 1), body };\n\t\t\tcomments.push(comment);\n\t\t\tsave();\n\t\t\treturn structuredClone(comment);\n\t\t},\n\t\tupdateLabels: async (id, remove, add) => {\n\t\t\tconst current = issue(id);\n\t\t\tcurrent.fields.labels = [\n\t\t\t\t...new Set([...current.fields.labels.filter((label) => !remove.includes(label)), ...add]),\n\t\t\t];\n\t\t\tsave();\n\t\t},\n\t\tlistRemoteLinks: async (id) => structuredClone(state.remoteLinks?.[issue(id).id] ?? []),\n\t\tupsertRemoteLink: async (id, input) => {\n\t\t\tstate.remoteLinks ??= {};\n\t\t\tstate.remoteLinks[issue(id).id] ??= [];\n\t\t\tconst result = upsertRemoteLink(state.remoteLinks[issue(id).id], input);\n\t\t\tsave();\n\t\t\treturn result;\n\t\t},\n\t\tlistTransitions: async () => structuredClone(workflowTransitions),\n\t\ttransitionIssue: async (id, transitionId) => {\n\t\t\tconst transition = workflowTransitions.find((candidate) => candidate.id === transitionId);\n\t\t\tif (!transition) throw new Error(\"Jira transition unavailable\");\n\t\t\tissue(id).fields.status = structuredClone(transition.to);\n\t\t\tsave();\n\t\t},\n\t};\n}\n"],"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AAgB,OAAO;AAAA,IAC/B;AAAA,IACA,cAAc,OAAO,IAAI,QAAQ,QAAQ;AACxC,YAAM,UAAU,MAAM,EAAE;AACxB,cAAQ,OAAO,SAAS;AAAA,QACvB,GAAG,oBAAI,IAAI,CAAC,GAAG,QAAQ,OAAO,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,SAAS,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,MACzF;AACA,WAAK;AAAA,IACN;AAAA,IACA,iBAAiB,OAAO,OAAO,gBAAgB,MAAM,cAAc,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AAAA,IACtF,kBAAkB,OAAO,IAAI,UAAU;AACtC,YAAM,gBAAgB,CAAC;AACvB,YAAM,YAAY,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC;AACrC,YAAM,SAAS,iBAAiB,MAAM,YAAY,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK;AACtE,WAAK;AACL,aAAO;AAAA,IACR;AAAA,IACA,iBAAiB,YAAY,gBAAgB,mBAAmB;AAAA,IAChE,iBAAiB,OAAO,IAAI,iBAAiB;AAC5C,YAAM,aAAa,oBAAoB,KAAK,CAAC,cAAc,UAAU,OAAO,YAAY;AACxF,UAAI,CAAC,WAAY,OAAM,IAAI,MAAM,6BAA6B;AAC9D,YAAM,EAAE,EAAE,OAAO,SAAS,gBAAgB,WAAW,EAAE;AACvD,WAAK;AAAA,IACN;AAAA,EACD;AACD;","names":["link","id","transition","project","issue"]}
@@ -0,0 +1,5 @@
1
+ import { type ServerExtensionAPI, type TicketCreationConfig } from "@leitwerk-dev/process-sdk";
2
+ import type { JiraIntegration } from "./index.js";
3
+ /** @internal */
4
+ export declare function registerJiraTicketCreation(api: ServerExtensionAPI, integration: JiraIntegration, config: TicketCreationConfig): void;
5
+ //# sourceMappingURL=ticket-creation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket-creation.d.ts","sourceRoot":"","sources":["../src/ticket-creation.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAKzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAwBlD,gBAAgB;AAChB,wBAAgB,0BAA0B,CACzC,GAAG,EAAE,kBAAkB,EACvB,WAAW,EAAE,eAAe,EAC5B,MAAM,EAAE,oBAAoB,GAC1B,IAAI,CA+KN"}
@@ -0,0 +1,18 @@
1
+ /** @internal */
2
+ export declare const jiraTicketWritingInstructions = "Write summary and description as a normal standalone Jira task for its assignee, using Markdown for the description. Explain the work and acceptance criteria in plain language; retain concrete file paths, prerequisites, and validation steps when needed. Keep evidence, inspected revisions, repository keys, and other tracking data in the separate evidence fields. Do not put raw commit hashes, internal IDs, split identities, solution-wiki references, or model citation tokens in the summary or description. Refer to repositories by their readable names and Jira issues by their issue keys. The publisher adds repository and source-issue links. When revising an existing ticket, preserve useful task details and human notes, and omit any previous generated tracking footer.";
3
+ /** @internal */
4
+ export declare function jiraTicketTextProblem(summary: string, description: string): string | null;
5
+ /** @internal */
6
+ export declare function assertJiraTicketText(summary: string, description: string): void;
7
+ /** @internal */
8
+ export declare function ticketDescriptionMarkdown(description: string, links: {
9
+ /** @internal */
10
+ repositoryName: string;
11
+ /** @internal */
12
+ repositoryUrl: string;
13
+ /** @internal */
14
+ sourceKey: string;
15
+ /** @internal */
16
+ sourceUrl: string;
17
+ }): string;
18
+ //# sourceMappingURL=ticket-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket-text.d.ts","sourceRoot":"","sources":["../src/ticket-text.ts"],"names":[],"mappings":"AAEA,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,0wBAC8tB,CAAC;AAMzwB,gBAAgB;AAChB,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIzF;AAED,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAG/E;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,CACxC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE;IACN,gBAAgB;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB,GACC,MAAM,CAGR"}
@@ -0,0 +1,5 @@
1
+ import { type ServerExtensionAPI } from "@leitwerk-dev/process-sdk";
2
+ import type { JiraIntegration } from "./index.js";
3
+ /** @internal */
4
+ export declare function registerJiraTools(api: ServerExtensionAPI, integration: JiraIntegration): void;
5
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,kBAAkB,EAAa,MAAM,2BAA2B,CAAC;AAElG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,QAwEtF"}
package/dist/wiki.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { TopicWikiStore } from "@leitwerk-dev/wiki";
2
+ import type { WikiSourceResolver } from "@leitwerk-dev/wiki/integration";
3
+ import { type JiraClientLike, type JiraIssue } from "./client.js";
4
+ import type { JiraIntegration } from "./index.js";
5
+ /** @internal */
6
+ export declare function jiraEpicRevision(epic: JiraIssue): string;
7
+ /** @internal */
8
+ export declare function ensureIssueWiki(store: TopicWikiStore, client: JiraClientLike, issue: JiraIssue, retainedTopicId?: string): import("@leitwerk-dev/wiki").WikiTopic;
9
+ /** Refreshes retained current and legacy issue bindings; credentials stay in the integration. @internal */
10
+ export declare function jiraWikiSource(store: TopicWikiStore, integration: JiraIntegration): WikiSourceResolver;
11
+ //# sourceMappingURL=wiki.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiki.d.ts","sourceRoot":"","sources":["../src/wiki.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAc,MAAM,aAAa,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAaxD;AAED,gBAAgB;AAChB,wBAAgB,eAAe,CAC9B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,SAAS,EAChB,eAAe,CAAC,EAAE,MAAM,0CAmCxB;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAC7B,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,eAAe,GAC1B,kBAAkB,CAkBpB"}
@@ -0,0 +1,11 @@
1
+ import { type IntegrationToolExecutionContext, type ServerExtensionAPI } from "@leitwerk-dev/process-sdk";
2
+ import type { JiraIntegration } from "./index.js";
3
+ /** @internal */
4
+ export declare function resolveJiraSourceClient(ctx: IntegrationToolExecutionContext, integration: JiraIntegration): {
5
+ client: import("./client.js").JiraClientLike;
6
+ id: string;
7
+ binding: Record<string, unknown>;
8
+ };
9
+ /** @internal */
10
+ export declare function registerJiraWorkflowTools(api: ServerExtensionAPI, integration: JiraIntegration): void;
11
+ //# sourceMappingURL=workflow-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../src/workflow-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,+BAA+B,EAEpC,KAAK,kBAAkB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,gBAAgB;AAChB,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,+BAA+B,EACpC,WAAW,EAAE,eAAe;;;;EAY5B;AAMD,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,QAoH9F"}