@zibby/skills 0.1.34 → 0.1.35

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,110 @@
1
+ /**
2
+ * Integration registry — the closed set of OAuth/credentialed external
3
+ * services a Zibby skill can declare a dependency on.
4
+ *
5
+ * Why this exists:
6
+ * Skills hand-off authentication to the backend's resolveIntegrationToken()
7
+ * (see packages/skills/src/jira.js, sentry.js, etc.). At deploy time we
8
+ * want to know "does THIS workflow need Slack connected before it can
9
+ * run?" without re-grepping handler source. Skills declare it explicitly
10
+ * via `requiresIntegration: INTEGRATIONS.<NAME>` and the backend
11
+ * workflow-bundler derives `workflow.requiredIntegrations` from the
12
+ * union of every node's skill list. Same pattern as npm peer-deps,
13
+ * Helm `requires`, Terraform `required_providers`.
14
+ *
15
+ * Source of truth for IDs lives here (Object.freeze) — both backend
16
+ * (`backend/src/services/skill-integrations.js`) and frontend (settings
17
+ * UI) reference these string constants. Backend mirrors the skill→
18
+ * integration mapping locally because @zibby/skills is NOT bundled into
19
+ * the Lambda layer (per CLAUDE.md: lambda-layer/nodejs/package.json must
20
+ * stay under 262MB and only carries production runtime deps).
21
+ */
22
+ export const INTEGRATIONS: Readonly<{
23
+ SENTRY: "sentry";
24
+ JIRA: "jira";
25
+ GITHUB: "github";
26
+ GITLAB: "gitlab";
27
+ SLACK: "slack";
28
+ LARK: "lark";
29
+ OPENAI_BILLING: "openai_billing";
30
+ ANTHROPIC_BILLING: "anthropic_billing";
31
+ CURSOR_ADMIN: "cursor_admin";
32
+ NOTION: "notion";
33
+ PLANE: "plane";
34
+ LINEAR: "linear";
35
+ }>;
36
+ /**
37
+ * Display metadata. Surface this to humans (modal copy, missing-list
38
+ * rendering) — backend joins this with the user's connected list and
39
+ * returns it from GET /workflows/{uuid}/integrations/status.
40
+ *
41
+ * `connectPath` points to the existing frontend Integrations page —
42
+ * verified against frontend/src/App.js (route `/integrations`) and
43
+ * frontend/src/pages/IntegrationsPage/IntegrationsPage.js (single page
44
+ * handles all six providers). We pass the provider name as a query
45
+ * param so the UI can highlight / scroll the relevant card; the page
46
+ * gracefully ignores the param if not handled yet. NO per-provider
47
+ * sub-routes exist (`/integrations/jira` etc. would 404 today).
48
+ */
49
+ export const INTEGRATION_REGISTRY: Readonly<{
50
+ sentry: {
51
+ id: string;
52
+ name: string;
53
+ connectPath: string;
54
+ };
55
+ jira: {
56
+ id: string;
57
+ name: string;
58
+ connectPath: string;
59
+ };
60
+ github: {
61
+ id: string;
62
+ name: string;
63
+ connectPath: string;
64
+ };
65
+ gitlab: {
66
+ id: string;
67
+ name: string;
68
+ connectPath: string;
69
+ };
70
+ slack: {
71
+ id: string;
72
+ name: string;
73
+ connectPath: string;
74
+ };
75
+ lark: {
76
+ id: string;
77
+ name: string;
78
+ connectPath: string;
79
+ };
80
+ openai_billing: {
81
+ id: string;
82
+ name: string;
83
+ connectPath: string;
84
+ };
85
+ anthropic_billing: {
86
+ id: string;
87
+ name: string;
88
+ connectPath: string;
89
+ };
90
+ cursor_admin: {
91
+ id: string;
92
+ name: string;
93
+ connectPath: string;
94
+ };
95
+ notion: {
96
+ id: string;
97
+ name: string;
98
+ connectPath: string;
99
+ };
100
+ plane: {
101
+ id: string;
102
+ name: string;
103
+ connectPath: string;
104
+ };
105
+ linear: {
106
+ id: string;
107
+ name: string;
108
+ connectPath: string;
109
+ };
110
+ }>;
package/dist/jira.d.ts ADDED
@@ -0,0 +1,547 @@
1
+ /**
2
+ * Low-level Jira REST helper. Resolves the OAuth bearer + cloudId via
3
+ * resolveIntegrationToken('jira'), retries once on transient auth errors,
4
+ * and returns parsed JSON (or `{ raw }` for non-JSON bodies).
5
+ *
6
+ * Exported so other templates (e.g. tracker-writeback) can issue Jira
7
+ * REST calls the JIRA skill's MCP tools don't cover — currently the only
8
+ * gap is attaching a PR remote-link; everything else (transition, comment)
9
+ * has a first-class tool. Keep this the single auth/cloudId chokepoint;
10
+ * don't re-implement token resolution at call sites.
11
+ *
12
+ * @param {string} path Jira REST path, e.g. `/rest/api/3/issue/PROJ-1`
13
+ * @param {{ method?: string, body?: any, headers?: object }} [opts]
14
+ * @returns {Promise<any>} parsed JSON response body
15
+ */
16
+ export function jiraFetch(path: string, opts?: {
17
+ method?: string;
18
+ body?: any;
19
+ headers?: object;
20
+ }): Promise<any>;
21
+ export namespace jiraSkill {
22
+ let id: string;
23
+ let serverName: string;
24
+ let allowedTools: string[];
25
+ let requiresIntegration: "jira";
26
+ let envKeys: string[];
27
+ let description: string;
28
+ let promptFragment: string;
29
+ function resolve(): {
30
+ command: string;
31
+ args: any[];
32
+ env: {
33
+ ATLASSIAN_INSTANCE_URL: any;
34
+ };
35
+ description: string;
36
+ };
37
+ function handleToolCall(name: any, args: any): Promise<string>;
38
+ let tools: ({
39
+ name: string;
40
+ description: string;
41
+ input_schema: {
42
+ type: string;
43
+ properties: {
44
+ projectKey?: undefined;
45
+ jql?: undefined;
46
+ maxResults?: undefined;
47
+ issueKey?: undefined;
48
+ summary?: undefined;
49
+ issueType?: undefined;
50
+ description?: undefined;
51
+ priority?: undefined;
52
+ labels?: undefined;
53
+ assigneeId?: undefined;
54
+ moveToSprint?: undefined;
55
+ moveToActiveSprint?: undefined;
56
+ sprintId?: undefined;
57
+ sprintName?: undefined;
58
+ target?: undefined;
59
+ state?: undefined;
60
+ status?: undefined;
61
+ body?: undefined;
62
+ fields?: undefined;
63
+ transitionId?: undefined;
64
+ toStatus?: undefined;
65
+ };
66
+ required?: undefined;
67
+ };
68
+ } | {
69
+ name: string;
70
+ description: string;
71
+ input_schema: {
72
+ type: string;
73
+ properties: {
74
+ projectKey: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ jql?: undefined;
79
+ maxResults?: undefined;
80
+ issueKey?: undefined;
81
+ summary?: undefined;
82
+ issueType?: undefined;
83
+ description?: undefined;
84
+ priority?: undefined;
85
+ labels?: undefined;
86
+ assigneeId?: undefined;
87
+ moveToSprint?: undefined;
88
+ moveToActiveSprint?: undefined;
89
+ sprintId?: undefined;
90
+ sprintName?: undefined;
91
+ target?: undefined;
92
+ state?: undefined;
93
+ status?: undefined;
94
+ body?: undefined;
95
+ fields?: undefined;
96
+ transitionId?: undefined;
97
+ toStatus?: undefined;
98
+ };
99
+ required?: undefined;
100
+ };
101
+ } | {
102
+ name: string;
103
+ description: string;
104
+ input_schema: {
105
+ type: string;
106
+ properties: {
107
+ projectKey: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ jql?: undefined;
112
+ maxResults?: undefined;
113
+ issueKey?: undefined;
114
+ summary?: undefined;
115
+ issueType?: undefined;
116
+ description?: undefined;
117
+ priority?: undefined;
118
+ labels?: undefined;
119
+ assigneeId?: undefined;
120
+ moveToSprint?: undefined;
121
+ moveToActiveSprint?: undefined;
122
+ sprintId?: undefined;
123
+ sprintName?: undefined;
124
+ target?: undefined;
125
+ state?: undefined;
126
+ status?: undefined;
127
+ body?: undefined;
128
+ fields?: undefined;
129
+ transitionId?: undefined;
130
+ toStatus?: undefined;
131
+ };
132
+ required: string[];
133
+ };
134
+ } | {
135
+ name: string;
136
+ description: string;
137
+ input_schema: {
138
+ type: string;
139
+ properties: {
140
+ jql: {
141
+ type: string;
142
+ description: string;
143
+ };
144
+ maxResults: {
145
+ type: string;
146
+ description: string;
147
+ };
148
+ projectKey?: undefined;
149
+ issueKey?: undefined;
150
+ summary?: undefined;
151
+ issueType?: undefined;
152
+ description?: undefined;
153
+ priority?: undefined;
154
+ labels?: undefined;
155
+ assigneeId?: undefined;
156
+ moveToSprint?: undefined;
157
+ moveToActiveSprint?: undefined;
158
+ sprintId?: undefined;
159
+ sprintName?: undefined;
160
+ target?: undefined;
161
+ state?: undefined;
162
+ status?: undefined;
163
+ body?: undefined;
164
+ fields?: undefined;
165
+ transitionId?: undefined;
166
+ toStatus?: undefined;
167
+ };
168
+ required: string[];
169
+ };
170
+ } | {
171
+ name: string;
172
+ description: string;
173
+ input_schema: {
174
+ type: string;
175
+ properties: {
176
+ issueKey: {
177
+ type: string;
178
+ description: string;
179
+ };
180
+ projectKey?: undefined;
181
+ jql?: undefined;
182
+ maxResults?: undefined;
183
+ summary?: undefined;
184
+ issueType?: undefined;
185
+ description?: undefined;
186
+ priority?: undefined;
187
+ labels?: undefined;
188
+ assigneeId?: undefined;
189
+ moveToSprint?: undefined;
190
+ moveToActiveSprint?: undefined;
191
+ sprintId?: undefined;
192
+ sprintName?: undefined;
193
+ target?: undefined;
194
+ state?: undefined;
195
+ status?: undefined;
196
+ body?: undefined;
197
+ fields?: undefined;
198
+ transitionId?: undefined;
199
+ toStatus?: undefined;
200
+ };
201
+ required: string[];
202
+ };
203
+ } | {
204
+ name: string;
205
+ description: string;
206
+ input_schema: {
207
+ type: string;
208
+ properties: {
209
+ projectKey: {
210
+ type: string;
211
+ description: string;
212
+ };
213
+ summary: {
214
+ type: string;
215
+ description: string;
216
+ };
217
+ issueType: {
218
+ type: string;
219
+ description: string;
220
+ };
221
+ description: {
222
+ type: string;
223
+ description: string;
224
+ };
225
+ priority: {
226
+ type: string;
227
+ description: string;
228
+ };
229
+ labels: {
230
+ type: string;
231
+ items: {
232
+ type: string;
233
+ };
234
+ description: string;
235
+ };
236
+ assigneeId: {
237
+ type: string;
238
+ description: string;
239
+ };
240
+ moveToSprint: {
241
+ type: string;
242
+ description: string;
243
+ };
244
+ moveToActiveSprint: {
245
+ type: string;
246
+ description: string;
247
+ };
248
+ sprintId: {
249
+ type: string;
250
+ description: string;
251
+ };
252
+ sprintName: {
253
+ type: string;
254
+ description: string;
255
+ };
256
+ target: {
257
+ type: string;
258
+ description: string;
259
+ };
260
+ jql?: undefined;
261
+ maxResults?: undefined;
262
+ issueKey?: undefined;
263
+ state?: undefined;
264
+ status?: undefined;
265
+ body?: undefined;
266
+ fields?: undefined;
267
+ transitionId?: undefined;
268
+ toStatus?: undefined;
269
+ };
270
+ required: string[];
271
+ };
272
+ } | {
273
+ name: string;
274
+ description: string;
275
+ input_schema: {
276
+ type: string;
277
+ properties: {
278
+ projectKey: {
279
+ type: string;
280
+ description: string;
281
+ };
282
+ state: {
283
+ type: string;
284
+ description: string;
285
+ };
286
+ jql?: undefined;
287
+ maxResults?: undefined;
288
+ issueKey?: undefined;
289
+ summary?: undefined;
290
+ issueType?: undefined;
291
+ description?: undefined;
292
+ priority?: undefined;
293
+ labels?: undefined;
294
+ assigneeId?: undefined;
295
+ moveToSprint?: undefined;
296
+ moveToActiveSprint?: undefined;
297
+ sprintId?: undefined;
298
+ sprintName?: undefined;
299
+ target?: undefined;
300
+ status?: undefined;
301
+ body?: undefined;
302
+ fields?: undefined;
303
+ transitionId?: undefined;
304
+ toStatus?: undefined;
305
+ };
306
+ required: string[];
307
+ };
308
+ } | {
309
+ name: string;
310
+ description: string;
311
+ input_schema: {
312
+ type: string;
313
+ properties: {
314
+ sprintName: {
315
+ type: string;
316
+ description: string;
317
+ };
318
+ sprintId: {
319
+ type: string;
320
+ description: string;
321
+ };
322
+ projectKey: {
323
+ type: string;
324
+ description: string;
325
+ };
326
+ status: {
327
+ type: string;
328
+ description: string;
329
+ };
330
+ maxResults: {
331
+ type: string;
332
+ description: string;
333
+ };
334
+ jql?: undefined;
335
+ issueKey?: undefined;
336
+ summary?: undefined;
337
+ issueType?: undefined;
338
+ description?: undefined;
339
+ priority?: undefined;
340
+ labels?: undefined;
341
+ assigneeId?: undefined;
342
+ moveToSprint?: undefined;
343
+ moveToActiveSprint?: undefined;
344
+ target?: undefined;
345
+ state?: undefined;
346
+ body?: undefined;
347
+ fields?: undefined;
348
+ transitionId?: undefined;
349
+ toStatus?: undefined;
350
+ };
351
+ required?: undefined;
352
+ };
353
+ } | {
354
+ name: string;
355
+ description: string;
356
+ input_schema: {
357
+ type: string;
358
+ properties: {
359
+ issueKey: {
360
+ type: string;
361
+ description: string;
362
+ };
363
+ projectKey: {
364
+ type: string;
365
+ description: string;
366
+ };
367
+ sprintId: {
368
+ type: string;
369
+ description: string;
370
+ };
371
+ sprintName: {
372
+ type: string;
373
+ description: string;
374
+ };
375
+ target: {
376
+ type: string;
377
+ description: string;
378
+ };
379
+ jql?: undefined;
380
+ maxResults?: undefined;
381
+ summary?: undefined;
382
+ issueType?: undefined;
383
+ description?: undefined;
384
+ priority?: undefined;
385
+ labels?: undefined;
386
+ assigneeId?: undefined;
387
+ moveToSprint?: undefined;
388
+ moveToActiveSprint?: undefined;
389
+ state?: undefined;
390
+ status?: undefined;
391
+ body?: undefined;
392
+ fields?: undefined;
393
+ transitionId?: undefined;
394
+ toStatus?: undefined;
395
+ };
396
+ required: string[];
397
+ };
398
+ } | {
399
+ name: string;
400
+ description: string;
401
+ input_schema: {
402
+ type: string;
403
+ properties: {
404
+ issueKey: {
405
+ type: string;
406
+ description: string;
407
+ };
408
+ maxResults: {
409
+ type: string;
410
+ description: string;
411
+ };
412
+ projectKey?: undefined;
413
+ jql?: undefined;
414
+ summary?: undefined;
415
+ issueType?: undefined;
416
+ description?: undefined;
417
+ priority?: undefined;
418
+ labels?: undefined;
419
+ assigneeId?: undefined;
420
+ moveToSprint?: undefined;
421
+ moveToActiveSprint?: undefined;
422
+ sprintId?: undefined;
423
+ sprintName?: undefined;
424
+ target?: undefined;
425
+ state?: undefined;
426
+ status?: undefined;
427
+ body?: undefined;
428
+ fields?: undefined;
429
+ transitionId?: undefined;
430
+ toStatus?: undefined;
431
+ };
432
+ required: string[];
433
+ };
434
+ } | {
435
+ name: string;
436
+ description: string;
437
+ input_schema: {
438
+ type: string;
439
+ properties: {
440
+ issueKey: {
441
+ type: string;
442
+ description: string;
443
+ };
444
+ body: {
445
+ type: string;
446
+ description: string;
447
+ };
448
+ projectKey?: undefined;
449
+ jql?: undefined;
450
+ maxResults?: undefined;
451
+ summary?: undefined;
452
+ issueType?: undefined;
453
+ description?: undefined;
454
+ priority?: undefined;
455
+ labels?: undefined;
456
+ assigneeId?: undefined;
457
+ moveToSprint?: undefined;
458
+ moveToActiveSprint?: undefined;
459
+ sprintId?: undefined;
460
+ sprintName?: undefined;
461
+ target?: undefined;
462
+ state?: undefined;
463
+ status?: undefined;
464
+ fields?: undefined;
465
+ transitionId?: undefined;
466
+ toStatus?: undefined;
467
+ };
468
+ required: string[];
469
+ };
470
+ } | {
471
+ name: string;
472
+ description: string;
473
+ input_schema: {
474
+ type: string;
475
+ properties: {
476
+ issueKey: {
477
+ type: string;
478
+ description: string;
479
+ };
480
+ fields: {
481
+ type: string;
482
+ description: string;
483
+ additionalProperties: boolean;
484
+ };
485
+ projectKey?: undefined;
486
+ jql?: undefined;
487
+ maxResults?: undefined;
488
+ summary?: undefined;
489
+ issueType?: undefined;
490
+ description?: undefined;
491
+ priority?: undefined;
492
+ labels?: undefined;
493
+ assigneeId?: undefined;
494
+ moveToSprint?: undefined;
495
+ moveToActiveSprint?: undefined;
496
+ sprintId?: undefined;
497
+ sprintName?: undefined;
498
+ target?: undefined;
499
+ state?: undefined;
500
+ status?: undefined;
501
+ body?: undefined;
502
+ transitionId?: undefined;
503
+ toStatus?: undefined;
504
+ };
505
+ required: string[];
506
+ };
507
+ } | {
508
+ name: string;
509
+ description: string;
510
+ input_schema: {
511
+ type: string;
512
+ properties: {
513
+ issueKey: {
514
+ type: string;
515
+ description: string;
516
+ };
517
+ transitionId: {
518
+ type: string;
519
+ description: string;
520
+ };
521
+ toStatus: {
522
+ type: string;
523
+ description: string;
524
+ };
525
+ projectKey?: undefined;
526
+ jql?: undefined;
527
+ maxResults?: undefined;
528
+ summary?: undefined;
529
+ issueType?: undefined;
530
+ description?: undefined;
531
+ priority?: undefined;
532
+ labels?: undefined;
533
+ assigneeId?: undefined;
534
+ moveToSprint?: undefined;
535
+ moveToActiveSprint?: undefined;
536
+ sprintId?: undefined;
537
+ sprintName?: undefined;
538
+ target?: undefined;
539
+ state?: undefined;
540
+ status?: undefined;
541
+ body?: undefined;
542
+ fields?: undefined;
543
+ };
544
+ required: string[];
545
+ };
546
+ })[];
547
+ }