@zibby/skills 0.1.34 → 0.1.36
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/dist/browser.d.ts +19 -0
- package/dist/chat-memory.d.ts +355 -0
- package/dist/chat-notify.d.ts +409 -0
- package/dist/core-tools.d.ts +131 -0
- package/dist/function-skill.d.ts +149 -0
- package/dist/git.d.ts +72 -0
- package/dist/github.d.ts +778 -0
- package/dist/github.js +1 -1
- package/dist/gitlab.d.ts +396 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +43 -43
- package/dist/integrations.d.ts +110 -0
- package/dist/jira.d.ts +547 -0
- package/dist/lark.d.ts +161 -0
- package/dist/linear.d.ts +344 -0
- package/dist/llm-billing.d.ts +294 -0
- package/dist/memory.d.ts +137 -0
- package/dist/package.json +67 -19
- package/dist/plane.d.ts +24 -0
- package/dist/report.d.ts +354 -0
- package/dist/report.js +9 -9
- package/dist/sentry.d.ts +43 -0
- package/dist/skill-installer.d.ts +86 -0
- package/dist/slack.d.ts +284 -0
- package/dist/test-runner.d.ts +220 -0
- package/dist/trackers/github-adapter.d.ts +96 -0
- package/dist/trackers/github-adapter.js +1 -1
- package/dist/trackers/index.d.ts +27 -0
- package/dist/trackers/index.js +1 -1
- package/dist/trackers/jira-adapter.d.ts +90 -0
- package/dist/trackers/linear-adapter.d.ts +89 -0
- package/dist/trackers/plane-adapter.d.ts +101 -0
- package/dist/trackers/types.d.ts +335 -0
- package/dist/workflow-builder.d.ts +245 -0
- package/package.json +67 -19
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a report-object → Slack Block-Kit `blocks` array.
|
|
3
|
+
*
|
|
4
|
+
* Pure function: input → output, no I/O. Throws on invalid input
|
|
5
|
+
* (zod parse error). Callers should validate before calling if they
|
|
6
|
+
* want softer error messages.
|
|
7
|
+
*
|
|
8
|
+
* @param {z.infer<typeof reportObjectSchema>} report
|
|
9
|
+
* @returns {Object[]} Block Kit blocks suitable for chat.postMessage's
|
|
10
|
+
* `blocks` field.
|
|
11
|
+
*/
|
|
12
|
+
export function reportToBlockKit(report: z.infer<typeof reportObjectSchema>): any[];
|
|
13
|
+
/**
|
|
14
|
+
* Convert a report-object → Lark interactive-card JSON.
|
|
15
|
+
*
|
|
16
|
+
* @param {z.infer<typeof reportObjectSchema>} report
|
|
17
|
+
* @returns {Object} Lark message card payload — use as `card` field on
|
|
18
|
+
* im/v1/messages with msg_type=interactive.
|
|
19
|
+
*/
|
|
20
|
+
export function reportToLarkCard(report: z.infer<typeof reportObjectSchema>): any;
|
|
21
|
+
/**
|
|
22
|
+
* Convert a report-object → Notion blocks payload.
|
|
23
|
+
*
|
|
24
|
+
* Returns three things rather than just `blocks` because Notion's
|
|
25
|
+
* page-create endpoint takes title + icon as page properties (separate
|
|
26
|
+
* from the children blocks). Callers wire them as:
|
|
27
|
+
* POST /v1/pages
|
|
28
|
+
* { parent: { database_id }, properties: { Name: { title: [...] } },
|
|
29
|
+
* icon: { type: 'emoji', emoji }, children: blocks }
|
|
30
|
+
* — or, for append-to-existing-page:
|
|
31
|
+
* PATCH /v1/blocks/{pageId}/children
|
|
32
|
+
* { children: blocks }
|
|
33
|
+
* (the title + icon are dropped when appending).
|
|
34
|
+
*
|
|
35
|
+
* Pure function: input → output, no I/O. Throws on invalid input
|
|
36
|
+
* (zod parse error). Notion's block schema documented at:
|
|
37
|
+
* https://developers.notion.com/reference/block
|
|
38
|
+
*
|
|
39
|
+
* @param {z.infer<typeof reportObjectSchema>} report
|
|
40
|
+
* @returns {{ blocks: Object[], title: string, icon?: string }}
|
|
41
|
+
* blocks: array of Notion block objects (no `id` / `parent` — those
|
|
42
|
+
* are server-assigned at create time)
|
|
43
|
+
* title: string for the page's Name title property
|
|
44
|
+
* icon: optional severity-mapped emoji for the page icon
|
|
45
|
+
*/
|
|
46
|
+
export function reportToNotionBlocks(report: z.infer<typeof reportObjectSchema>): {
|
|
47
|
+
blocks: any[];
|
|
48
|
+
title: string;
|
|
49
|
+
icon?: string;
|
|
50
|
+
};
|
|
51
|
+
export const SEVERITIES: readonly ["ok", "info", "warn", "critical"];
|
|
52
|
+
export const reportObjectSchema: z.ZodObject<{
|
|
53
|
+
title: z.ZodString;
|
|
54
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
55
|
+
headline: z.ZodObject<{
|
|
56
|
+
primary: z.ZodString;
|
|
57
|
+
delta: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
value: z.ZodString;
|
|
59
|
+
direction: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
|
|
60
|
+
severity: z.ZodOptional<z.ZodEnum<["ok", "info", "warn", "critical"]>>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
value?: string;
|
|
63
|
+
direction?: "flat" | "up" | "down";
|
|
64
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
65
|
+
}, {
|
|
66
|
+
value?: string;
|
|
67
|
+
direction?: "flat" | "up" | "down";
|
|
68
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
69
|
+
}>>;
|
|
70
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
summary?: string;
|
|
73
|
+
primary?: string;
|
|
74
|
+
delta?: {
|
|
75
|
+
value?: string;
|
|
76
|
+
direction?: "flat" | "up" | "down";
|
|
77
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
summary?: string;
|
|
81
|
+
primary?: string;
|
|
82
|
+
delta?: {
|
|
83
|
+
value?: string;
|
|
84
|
+
direction?: "flat" | "up" | "down";
|
|
85
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
sections: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<"trend">;
|
|
90
|
+
title: z.ZodOptional<z.ZodString>;
|
|
91
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
92
|
+
values: z.ZodArray<z.ZodNumber, "many">;
|
|
93
|
+
highlight: z.ZodOptional<z.ZodDefault<z.ZodEnum<["last", "max", "min", "none"]>>>;
|
|
94
|
+
severity: z.ZodOptional<z.ZodEnum<["ok", "info", "warn", "critical"]>>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
title?: string;
|
|
97
|
+
values?: number[];
|
|
98
|
+
labels?: string[];
|
|
99
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
100
|
+
kind?: "trend";
|
|
101
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
102
|
+
}, {
|
|
103
|
+
title?: string;
|
|
104
|
+
values?: number[];
|
|
105
|
+
labels?: string[];
|
|
106
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
107
|
+
kind?: "trend";
|
|
108
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
109
|
+
}>, z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"table">;
|
|
111
|
+
title: z.ZodOptional<z.ZodString>;
|
|
112
|
+
headers: z.ZodArray<z.ZodString, "many">;
|
|
113
|
+
rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">, "many">;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
title?: string;
|
|
116
|
+
kind?: "table";
|
|
117
|
+
headers?: string[];
|
|
118
|
+
rows?: (string | number)[][];
|
|
119
|
+
}, {
|
|
120
|
+
title?: string;
|
|
121
|
+
kind?: "table";
|
|
122
|
+
headers?: string[];
|
|
123
|
+
rows?: (string | number)[][];
|
|
124
|
+
}>, z.ZodObject<{
|
|
125
|
+
kind: z.ZodLiteral<"callouts">;
|
|
126
|
+
title: z.ZodOptional<z.ZodString>;
|
|
127
|
+
tone: z.ZodOptional<z.ZodDefault<z.ZodEnum<["ok", "info", "warn", "critical"]>>>;
|
|
128
|
+
items: z.ZodArray<z.ZodString, "many">;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
title?: string;
|
|
131
|
+
kind?: "callouts";
|
|
132
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
133
|
+
items?: string[];
|
|
134
|
+
}, {
|
|
135
|
+
title?: string;
|
|
136
|
+
kind?: "callouts";
|
|
137
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
138
|
+
items?: string[];
|
|
139
|
+
}>, z.ZodObject<{
|
|
140
|
+
kind: z.ZodLiteral<"breakdown">;
|
|
141
|
+
title: z.ZodOptional<z.ZodString>;
|
|
142
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
143
|
+
label: z.ZodString;
|
|
144
|
+
value: z.ZodString;
|
|
145
|
+
sub: z.ZodOptional<z.ZodString>;
|
|
146
|
+
severity: z.ZodOptional<z.ZodEnum<["ok", "info", "warn", "critical"]>>;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
sub?: string;
|
|
149
|
+
label?: string;
|
|
150
|
+
value?: string;
|
|
151
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
152
|
+
}, {
|
|
153
|
+
sub?: string;
|
|
154
|
+
label?: string;
|
|
155
|
+
value?: string;
|
|
156
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
157
|
+
}>, "many">;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
title?: string;
|
|
160
|
+
kind?: "breakdown";
|
|
161
|
+
rows?: {
|
|
162
|
+
sub?: string;
|
|
163
|
+
label?: string;
|
|
164
|
+
value?: string;
|
|
165
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
166
|
+
}[];
|
|
167
|
+
}, {
|
|
168
|
+
title?: string;
|
|
169
|
+
kind?: "breakdown";
|
|
170
|
+
rows?: {
|
|
171
|
+
sub?: string;
|
|
172
|
+
label?: string;
|
|
173
|
+
value?: string;
|
|
174
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
175
|
+
}[];
|
|
176
|
+
}>, z.ZodObject<{
|
|
177
|
+
kind: z.ZodLiteral<"paragraph">;
|
|
178
|
+
title: z.ZodOptional<z.ZodString>;
|
|
179
|
+
text: z.ZodString;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
title?: string;
|
|
182
|
+
text?: string;
|
|
183
|
+
kind?: "paragraph";
|
|
184
|
+
}, {
|
|
185
|
+
title?: string;
|
|
186
|
+
text?: string;
|
|
187
|
+
kind?: "paragraph";
|
|
188
|
+
}>]>, "many">>, ({
|
|
189
|
+
title?: string;
|
|
190
|
+
values?: number[];
|
|
191
|
+
labels?: string[];
|
|
192
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
193
|
+
kind?: "trend";
|
|
194
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
195
|
+
} | {
|
|
196
|
+
title?: string;
|
|
197
|
+
kind?: "table";
|
|
198
|
+
headers?: string[];
|
|
199
|
+
rows?: (string | number)[][];
|
|
200
|
+
} | {
|
|
201
|
+
title?: string;
|
|
202
|
+
kind?: "callouts";
|
|
203
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
204
|
+
items?: string[];
|
|
205
|
+
} | {
|
|
206
|
+
title?: string;
|
|
207
|
+
kind?: "breakdown";
|
|
208
|
+
rows?: {
|
|
209
|
+
sub?: string;
|
|
210
|
+
label?: string;
|
|
211
|
+
value?: string;
|
|
212
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
213
|
+
}[];
|
|
214
|
+
} | {
|
|
215
|
+
title?: string;
|
|
216
|
+
text?: string;
|
|
217
|
+
kind?: "paragraph";
|
|
218
|
+
})[], ({
|
|
219
|
+
title?: string;
|
|
220
|
+
values?: number[];
|
|
221
|
+
labels?: string[];
|
|
222
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
223
|
+
kind?: "trend";
|
|
224
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
225
|
+
} | {
|
|
226
|
+
title?: string;
|
|
227
|
+
kind?: "table";
|
|
228
|
+
headers?: string[];
|
|
229
|
+
rows?: (string | number)[][];
|
|
230
|
+
} | {
|
|
231
|
+
title?: string;
|
|
232
|
+
kind?: "callouts";
|
|
233
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
234
|
+
items?: string[];
|
|
235
|
+
} | {
|
|
236
|
+
title?: string;
|
|
237
|
+
kind?: "breakdown";
|
|
238
|
+
rows?: {
|
|
239
|
+
sub?: string;
|
|
240
|
+
label?: string;
|
|
241
|
+
value?: string;
|
|
242
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
243
|
+
}[];
|
|
244
|
+
} | {
|
|
245
|
+
title?: string;
|
|
246
|
+
text?: string;
|
|
247
|
+
kind?: "paragraph";
|
|
248
|
+
})[]>;
|
|
249
|
+
footer: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
viewUrl: z.ZodOptional<z.ZodString>;
|
|
251
|
+
rerunUrl: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
viewUrl?: string;
|
|
254
|
+
rerunUrl?: string;
|
|
255
|
+
}, {
|
|
256
|
+
viewUrl?: string;
|
|
257
|
+
rerunUrl?: string;
|
|
258
|
+
}>>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
title?: string;
|
|
261
|
+
subtitle?: string;
|
|
262
|
+
headline?: {
|
|
263
|
+
summary?: string;
|
|
264
|
+
primary?: string;
|
|
265
|
+
delta?: {
|
|
266
|
+
value?: string;
|
|
267
|
+
direction?: "flat" | "up" | "down";
|
|
268
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
sections?: ({
|
|
272
|
+
title?: string;
|
|
273
|
+
values?: number[];
|
|
274
|
+
labels?: string[];
|
|
275
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
276
|
+
kind?: "trend";
|
|
277
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
278
|
+
} | {
|
|
279
|
+
title?: string;
|
|
280
|
+
kind?: "table";
|
|
281
|
+
headers?: string[];
|
|
282
|
+
rows?: (string | number)[][];
|
|
283
|
+
} | {
|
|
284
|
+
title?: string;
|
|
285
|
+
kind?: "callouts";
|
|
286
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
287
|
+
items?: string[];
|
|
288
|
+
} | {
|
|
289
|
+
title?: string;
|
|
290
|
+
kind?: "breakdown";
|
|
291
|
+
rows?: {
|
|
292
|
+
sub?: string;
|
|
293
|
+
label?: string;
|
|
294
|
+
value?: string;
|
|
295
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
296
|
+
}[];
|
|
297
|
+
} | {
|
|
298
|
+
title?: string;
|
|
299
|
+
text?: string;
|
|
300
|
+
kind?: "paragraph";
|
|
301
|
+
})[];
|
|
302
|
+
footer?: {
|
|
303
|
+
viewUrl?: string;
|
|
304
|
+
rerunUrl?: string;
|
|
305
|
+
};
|
|
306
|
+
}, {
|
|
307
|
+
title?: string;
|
|
308
|
+
subtitle?: string;
|
|
309
|
+
headline?: {
|
|
310
|
+
summary?: string;
|
|
311
|
+
primary?: string;
|
|
312
|
+
delta?: {
|
|
313
|
+
value?: string;
|
|
314
|
+
direction?: "flat" | "up" | "down";
|
|
315
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
sections?: ({
|
|
319
|
+
title?: string;
|
|
320
|
+
values?: number[];
|
|
321
|
+
labels?: string[];
|
|
322
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
323
|
+
kind?: "trend";
|
|
324
|
+
highlight?: "none" | "last" | "max" | "min";
|
|
325
|
+
} | {
|
|
326
|
+
title?: string;
|
|
327
|
+
kind?: "table";
|
|
328
|
+
headers?: string[];
|
|
329
|
+
rows?: (string | number)[][];
|
|
330
|
+
} | {
|
|
331
|
+
title?: string;
|
|
332
|
+
kind?: "callouts";
|
|
333
|
+
tone?: "ok" | "info" | "warn" | "critical";
|
|
334
|
+
items?: string[];
|
|
335
|
+
} | {
|
|
336
|
+
title?: string;
|
|
337
|
+
kind?: "breakdown";
|
|
338
|
+
rows?: {
|
|
339
|
+
sub?: string;
|
|
340
|
+
label?: string;
|
|
341
|
+
value?: string;
|
|
342
|
+
severity?: "ok" | "info" | "warn" | "critical";
|
|
343
|
+
}[];
|
|
344
|
+
} | {
|
|
345
|
+
title?: string;
|
|
346
|
+
text?: string;
|
|
347
|
+
kind?: "paragraph";
|
|
348
|
+
})[];
|
|
349
|
+
footer?: {
|
|
350
|
+
viewUrl?: string;
|
|
351
|
+
rerunUrl?: string;
|
|
352
|
+
};
|
|
353
|
+
}>;
|
|
354
|
+
import { z } from 'zod';
|
package/dist/report.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{z as a}from"zod";var g=["ok","info","warn","critical"],R=a.object({primary:a.string().min(1).max(200).describe('Headline number or phrase (e.g. "$8,240"). Rendered in large/bold.'),delta:a.object({value:a.string().max(40).describe('Delta vs baseline (e.g. "+12% wow"). Free-form string.'),direction:a.enum(["up","down","flat"]).optional(),severity:a.enum(g).optional().describe("Color severity for the delta (warn/critical highlights regressions).")}).optional().describe("Optional comparison vs baseline. Renders inline next to primary."),summary:a.string().max(800).optional().describe('One-sentence narrative ("why this number"). Plain prose.')}),U=a.object({kind:a.literal("trend"),title:a.string().max(120).optional(),labels:a.array(a.string().max(60)).min(2).max(20).describe('Bucket labels (e.g. ["Week-3", "Week-2", "Week-1", "This wk"]).'),values:a.array(a.number()).min(2).max(20).describe("Numeric values, one per label. Must match labels.length."),highlight:a.enum(["last","max","min","none"]).default("last").optional().describe("Which bucket to visually highlight in the rendered card."),severity:a.enum(g).optional()})
|
|
2
|
-
`)+"\n```"}function
|
|
3
|
-
`+e.headline.summary),t.push({type:"section",text:{type:"mrkdwn",text:
|
|
1
|
+
import{z as a}from"zod";var g=["ok","info","warn","critical"],R=a.object({primary:a.string().min(1).max(200).describe('Headline number or phrase (e.g. "$8,240"). Rendered in large/bold.'),delta:a.object({value:a.string().max(40).describe('Delta vs baseline (e.g. "+12% wow"). Free-form string.'),direction:a.enum(["up","down","flat"]).optional(),severity:a.enum(g).optional().describe("Color severity for the delta (warn/critical highlights regressions).")}).optional().describe("Optional comparison vs baseline. Renders inline next to primary."),summary:a.string().max(800).optional().describe('One-sentence narrative ("why this number"). Plain prose.')}),U=a.object({kind:a.literal("trend"),title:a.string().max(120).optional(),labels:a.array(a.string().max(60)).min(2).max(20).describe('Bucket labels (e.g. ["Week-3", "Week-2", "Week-1", "This wk"]).'),values:a.array(a.number()).min(2).max(20).describe("Numeric values, one per label. Must match labels.length."),highlight:a.enum(["last","max","min","none"]).default("last").optional().describe("Which bucket to visually highlight in the rendered card."),severity:a.enum(g).optional()}),E=a.object({kind:a.literal("table"),title:a.string().max(120).optional(),headers:a.array(a.string().max(40)).min(1).max(8),rows:a.array(a.array(a.union([a.string().max(200),a.number()])).min(1).max(8)).max(40).describe("2D matrix. Each inner array must have headers.length entries.")}),O=a.object({kind:a.literal("callouts"),title:a.string().max(120).optional(),tone:a.enum(g).default("info").optional(),items:a.array(a.string().min(1).max(600)).min(1).max(10).describe("Each item renders as a bullet with a severity emoji.")}),T=a.object({kind:a.literal("breakdown"),title:a.string().max(120).optional(),rows:a.array(a.object({label:a.string().min(1).max(80),value:a.string().min(1).max(80),sub:a.string().max(120).optional(),severity:a.enum(g).optional()})).min(1).max(20)}),M=a.object({kind:a.literal("paragraph"),title:a.string().max(120).optional(),text:a.string().min(1).max(3e3)}),I=a.discriminatedUnion("kind",[U,E,O,T,M]),k=a.object({title:a.string().min(1).max(200).describe('Card title (e.g. "Weekly AI Spend Report").'),subtitle:a.string().max(200).optional().describe('Date range or smaller header (e.g. "May 13 \u2014 May 20").'),headline:R,sections:a.array(I).max(20).default([]).superRefine((s,e)=>{s.forEach((t,l)=>{t.kind==="trend"&&t.labels.length!==t.values.length&&e.addIssue({code:a.ZodIssueCode.custom,path:[l,"values"],message:"labels.length must equal values.length"}),t.kind==="table"&&!t.rows.every(c=>c.length===t.headers.length)&&e.addIssue({code:a.ZodIssueCode.custom,path:[l,"rows"],message:"every row must have headers.length entries"})})}),footer:a.object({viewUrl:a.string().url().optional().describe('Optional "View in Zibby" button URL.'),rerunUrl:a.string().url().optional().describe('Optional "Run again" button URL.')}).optional()}),p=Object.freeze({ok:"\u{1F7E2}",info:"\u{1F535}",warn:"\u{1F7E0}",critical:"\u{1F534}"}),w=Object.freeze({up:"\u2191",down:"\u2193",flat:"\u2192"}),L=Object.freeze({ok:"green",info:"blue",warn:"orange",critical:"red"});function _(s,e,t=12){if(!Number.isFinite(s)||!Number.isFinite(e)||e<=0)return"";let l=Math.max(0,Math.min(1,s/e)),c=Math.round(l*t);return"\u2593".repeat(c)+"\u2591".repeat(t-c)}function y(s,e){let t=String(s);return t.length>=e?t:t+" ".repeat(e-t.length)}function $(s,e){let t=String(s);return t.length>=e?t:" ".repeat(e-t.length)+t}function S({headers:s,rows:e}){let t=s.map((n,r)=>{let o=Math.max(String(n).length,...e.map(h=>String(h[r]??"").length));return Math.min(o,32)}),l=n=>n.map((r,o)=>y(r,t[o])).join(" "),c=t.map(n=>"\u2500".repeat(n)).join(" ");return"```\n"+[l(s),c,...e.map(n=>l(n))].join(`
|
|
2
|
+
`)+"\n```"}function z(s){let e=k.parse(s),t=[];t.push({type:"header",text:{type:"plain_text",text:e.title.slice(0,150),emoji:!0}}),e.subtitle&&t.push({type:"context",elements:[{type:"mrkdwn",text:e.subtitle}]});let l=[`*${e.headline.primary}*`];if(e.headline.delta){let i=w[e.headline.delta.direction]||"",n=e.headline.delta.severity?p[e.headline.delta.severity]:"";l.push(`${i} ${e.headline.delta.value} ${n}`.trim())}let c=l.join(" ");e.headline.summary&&(c+=`
|
|
3
|
+
`+e.headline.summary),t.push({type:"section",text:{type:"mrkdwn",text:c}});for(let i of e.sections)switch(t.push({type:"divider"}),i.title&&t.push({type:"section",text:{type:"mrkdwn",text:`*${i.title}*`}}),i.kind){case"trend":{let n=Math.max(...i.values),r=i.labels.map((o,h)=>{let d=i.values[h],u=_(d,n),x=(i.highlight==="last"&&h===i.labels.length-1||i.highlight==="max"&&d===n||i.highlight==="min"&&d===Math.min(...i.values))&&i.severity?` ${p[i.severity]}`:"";return`${y(o,10)} ${$(d.toLocaleString(),8)} ${u}${x}`});t.push({type:"section",text:{type:"mrkdwn",text:"```\n"+r.join(`
|
|
4
4
|
`)+"\n```"}});break}case"table":{t.push({type:"section",text:{type:"mrkdwn",text:S(i)}});break}case"callouts":{let n=p[i.tone||"info"];t.push({type:"section",text:{type:"mrkdwn",text:i.items.map(r=>`${n} ${r}`).join(`
|
|
5
5
|
`)}});break}case"breakdown":{let n=i.rows.map(r=>({type:"mrkdwn",text:`*${r.label}*
|
|
6
6
|
${r.value}${r.sub?`
|
|
7
|
-
_${r.sub}_`:""}${r.severity?` ${p[r.severity]}`:""}`}));for(let r=0;r<n.length;r+=10)t.push({type:"section",fields:n.slice(r,r+10)});break}case"paragraph":{t.push({type:"section",text:{type:"mrkdwn",text:i.text}});break}}if(e.footer&&(e.footer.viewUrl||e.footer.rerunUrl)){let i=[];e.footer.viewUrl&&i.push({type:"button",text:{type:"plain_text",text:"View in Zibby"},url:e.footer.viewUrl,style:"primary"}),e.footer.rerunUrl&&i.push({type:"button",text:{type:"plain_text",text:"Run again"},url:e.footer.rerunUrl}),t.push({type:"divider"}),t.push({type:"actions",elements:i})}return t}function
|
|
8
|
-
`+e.headline.summary),t.push({tag:"div",text:{tag:"lark_md",content:
|
|
9
|
-
`)+"\n```"}});break}case"table":{t.push({tag:"div",text:{tag:"lark_md",content:S(n)}});break}case"callouts":{let r=p[n.tone||"info"];t.push({tag:"div",text:{tag:"lark_md",content:n.items.map(
|
|
10
|
-
`)}});break}case"breakdown":{let r=n.rows.map(
|
|
11
|
-
`)}});break}case"paragraph":{t.push({tag:"div",text:{tag:"lark_md",content:n.text}});break}}if(e.footer&&(e.footer.viewUrl||e.footer.rerunUrl)){let n=[];e.footer.viewUrl&&n.push({tag:"button",text:{tag:"plain_text",content:"View in Zibby"},url:e.footer.viewUrl,type:"primary"}),e.footer.rerunUrl&&n.push({tag:"button",text:{tag:"plain_text",content:"Run again"},url:e.footer.rerunUrl,type:"default"}),t.push({tag:"hr"}),t.push({tag:"action",actions:n})}let i="blue";return e.headline.delta?.severity&&(i=L[e.headline.delta.severity]||"blue"),{config:{wide_screen_mode:!0},header:{title:{tag:"plain_text",content:e.title.slice(0,200)},subtitle:e.subtitle?{tag:"plain_text",content:e.subtitle.slice(0,200)}:void 0,template:i},elements:t}}var N=Object.freeze({ok:"green_background",info:"blue_background",warn:"orange_background",critical:"red_background"}),j=Object.freeze({ok:"\u{1F7E2}",info:"\u2139\uFE0F",warn:"\u26A0\uFE0F",critical:"\u{1F6A8}"});function m(
|
|
12
|
-
`)));break}case"table":{let n={object:"block",type:"table_row",table_row:{cells:i.headers.map(
|
|
7
|
+
_${r.sub}_`:""}${r.severity?` ${p[r.severity]}`:""}`}));for(let r=0;r<n.length;r+=10)t.push({type:"section",fields:n.slice(r,r+10)});break}case"paragraph":{t.push({type:"section",text:{type:"mrkdwn",text:i.text}});break}}if(e.footer&&(e.footer.viewUrl||e.footer.rerunUrl)){let i=[];e.footer.viewUrl&&i.push({type:"button",text:{type:"plain_text",text:"View in Zibby"},url:e.footer.viewUrl,style:"primary"}),e.footer.rerunUrl&&i.push({type:"button",text:{type:"plain_text",text:"Run again"},url:e.footer.rerunUrl}),t.push({type:"divider"}),t.push({type:"actions",elements:i})}return t}function A(s){let e=k.parse(s),t=[],l=[`**${e.headline.primary}**`];if(e.headline.delta){let n=w[e.headline.delta.direction]||"",r=e.headline.delta.severity?p[e.headline.delta.severity]:"";l.push(`${n} ${e.headline.delta.value} ${r}`.trim())}let c=l.join(" ");e.headline.summary&&(c+=`
|
|
8
|
+
`+e.headline.summary),t.push({tag:"div",text:{tag:"lark_md",content:c}});for(let n of e.sections)switch(t.push({tag:"hr"}),n.title&&t.push({tag:"div",text:{tag:"lark_md",content:`**${n.title}**`}}),n.kind){case"trend":{let r=Math.max(...n.values),o=n.labels.map((h,d)=>{let u=n.values[d],b=_(u,r),f=(n.highlight==="last"&&d===n.labels.length-1||n.highlight==="max"&&u===r||n.highlight==="min"&&u===Math.min(...n.values))&&n.severity?` ${p[n.severity]}`:"";return`${y(h,10)} ${$(u.toLocaleString(),8)} ${b}${f}`});t.push({tag:"div",text:{tag:"lark_md",content:"```\n"+o.join(`
|
|
9
|
+
`)+"\n```"}});break}case"table":{t.push({tag:"div",text:{tag:"lark_md",content:S(n)}});break}case"callouts":{let r=p[n.tone||"info"];t.push({tag:"div",text:{tag:"lark_md",content:n.items.map(o=>`${r} ${o}`).join(`
|
|
10
|
+
`)}});break}case"breakdown":{let r=n.rows.map(o=>{let h=o.severity?` ${p[o.severity]}`:"",d=o.sub?` *${o.sub}*`:"";return`**${o.label}** ${o.value}${d}${h}`});t.push({tag:"div",text:{tag:"lark_md",content:r.join(`
|
|
11
|
+
`)}});break}case"paragraph":{t.push({tag:"div",text:{tag:"lark_md",content:n.text}});break}}if(e.footer&&(e.footer.viewUrl||e.footer.rerunUrl)){let n=[];e.footer.viewUrl&&n.push({tag:"button",text:{tag:"plain_text",content:"View in Zibby"},url:e.footer.viewUrl,type:"primary"}),e.footer.rerunUrl&&n.push({tag:"button",text:{tag:"plain_text",content:"Run again"},url:e.footer.rerunUrl,type:"default"}),t.push({tag:"hr"}),t.push({tag:"action",actions:n})}let i="blue";return e.headline.delta?.severity&&(i=L[e.headline.delta.severity]||"blue"),{config:{wide_screen_mode:!0},header:{title:{tag:"plain_text",content:e.title.slice(0,200)},subtitle:e.subtitle?{tag:"plain_text",content:e.subtitle.slice(0,200)}:void 0,template:i},elements:t}}var N=Object.freeze({ok:"green_background",info:"blue_background",warn:"orange_background",critical:"red_background"}),j=Object.freeze({ok:"\u{1F7E2}",info:"\u2139\uFE0F",warn:"\u26A0\uFE0F",critical:"\u{1F6A8}"});function m(s,e={}){let t={type:"text",text:{content:String(s).slice(0,2e3)}};return e.annotations&&(t.annotations=e.annotations),[t]}function v(s,e){let t={object:"block",type:"paragraph",paragraph:{rich_text:m(s)}};return e&&(t.paragraph.color=e),t}function V(s){return{object:"block",type:"code",code:{rich_text:m(s),language:"plain text"}}}function W(s){let e=k.parse(s),t=[];t.push({object:"block",type:"heading_1",heading_1:{rich_text:m(e.title.slice(0,200))}}),e.subtitle&&t.push(v(e.subtitle,"gray_background"));let l=[{type:"text",text:{content:e.headline.primary.slice(0,200)},annotations:{bold:!0}}];if(e.headline.delta){let i=w[e.headline.delta.direction]||"",n=e.headline.delta.severity?p[e.headline.delta.severity]:"",r=` ${i} ${e.headline.delta.value} ${n}`.trimEnd();l.push({type:"text",text:{content:r}})}t.push({object:"block",type:"paragraph",paragraph:{rich_text:l}}),e.headline.summary&&t.push(v(e.headline.summary));for(let i of e.sections)switch(t.push({object:"block",type:"divider",divider:{}}),i.title&&t.push({object:"block",type:"heading_2",heading_2:{rich_text:m(i.title)}}),i.kind){case"trend":{let n=Math.max(...i.values),r=Math.min(...i.values),o=i.labels.map((h,d)=>{let u=i.values[d],b=_(u,n),f=(i.highlight==="last"&&d===i.labels.length-1||i.highlight==="max"&&u===n||i.highlight==="min"&&u===r)&&i.severity?` ${p[i.severity]}`:"";return`${y(h,10)} ${$(u.toLocaleString(),8)} ${b}${f}`});t.push(V(o.join(`
|
|
12
|
+
`)));break}case"table":{let n={object:"block",type:"table_row",table_row:{cells:i.headers.map(o=>m(o))}},r=i.rows.map(o=>({object:"block",type:"table_row",table_row:{cells:o.map(h=>m(String(h)))}}));t.push({object:"block",type:"table",table:{table_width:i.headers.length,has_column_header:!0,has_row_header:!1,children:[n,...r]}});break}case"callouts":{let n=i.tone||"info",r=j[n],o=N[n];for(let h of i.items)t.push({object:"block",type:"callout",callout:{rich_text:m(h),icon:{type:"emoji",emoji:r},color:o}});break}case"breakdown":{for(let n of i.rows){let r=[{type:"text",text:{content:`${n.label}: `},annotations:{bold:!0}},{type:"text",text:{content:String(n.value)}}];n.sub&&r.push({type:"text",text:{content:` (${n.sub})`},annotations:{italic:!0}}),n.severity&&r.push({type:"text",text:{content:` ${p[n.severity]}`}}),t.push({object:"block",type:"bulleted_list_item",bulleted_list_item:{rich_text:r}})}break}case"paragraph":{t.push(v(i.text));break}}e.footer&&(e.footer.viewUrl||e.footer.rerunUrl)&&(t.push({object:"block",type:"divider",divider:{}}),e.footer.viewUrl&&t.push({object:"block",type:"embed",embed:{url:e.footer.viewUrl}}),e.footer.rerunUrl&&t.push({object:"block",type:"embed",embed:{url:e.footer.rerunUrl}}));let c=e.headline.delta?.severity?j[e.headline.delta.severity]:void 0;return{blocks:t,title:e.title.slice(0,200),icon:c}}export{g as SEVERITIES,k as reportObjectSchema,z as reportToBlockKit,A as reportToLarkCard,W as reportToNotionBlocks};
|
package/dist/sentry.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Low-level Sentry REST helper, scoped to the user's connected org.
|
|
3
|
+
* All endpoints under `/api/0/organizations/<slug>/…` route through
|
|
4
|
+
* this — auth header + base URL + non-2xx → throw are handled once.
|
|
5
|
+
*
|
|
6
|
+
* Exported so deterministic workflow nodes can talk to Sentry without
|
|
7
|
+
* going through the LLM tool layer. `sentryListIssues / Projects /
|
|
8
|
+
* GetIssue` below are thin wrappers — prefer those over raw `sentryFetch`.
|
|
9
|
+
*/
|
|
10
|
+
export function sentryFetch(path: any, opts?: {}): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* List Sentry projects in the connected organization. Returns raw
|
|
13
|
+
* Sentry-shape objects ({ slug, name, platform, id, … }).
|
|
14
|
+
*
|
|
15
|
+
* Single source of truth for the `sentry_list_projects` tool (MCP +
|
|
16
|
+
* assistant), and for deterministic workflow nodes.
|
|
17
|
+
*/
|
|
18
|
+
export function sentryListProjects(): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* List Sentry issues. Returns the raw Sentry array. Wrappers above
|
|
21
|
+
* (MCP / assistant tool handlers) format the shape for LLM consumers;
|
|
22
|
+
* deterministic callers get the raw issue objects so their own
|
|
23
|
+
* outputSchema can validate / reshape.
|
|
24
|
+
*
|
|
25
|
+
* @param {{ query?: string, sort?: string, project?: string, limit?: number }} opts
|
|
26
|
+
*/
|
|
27
|
+
export function sentryListIssues({ query, sort, project, limit }?: {
|
|
28
|
+
query?: string;
|
|
29
|
+
sort?: string;
|
|
30
|
+
project?: string;
|
|
31
|
+
limit?: number;
|
|
32
|
+
}): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch one Sentry issue's details. Uses the global `/issues/<id>/`
|
|
35
|
+
* endpoint (NOT under /organizations/<slug>/) — Sentry routes issue
|
|
36
|
+
* details by ID without an org scope. Auth still uses the connected
|
|
37
|
+
* integration's token.
|
|
38
|
+
*/
|
|
39
|
+
export function sentryGetIssue(issueId: any): Promise<any>;
|
|
40
|
+
export namespace sentrySkill {
|
|
41
|
+
import tools = sentrySkill.toolsForAssistant;
|
|
42
|
+
export { tools };
|
|
43
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export namespace skillInstallerSkill {
|
|
2
|
+
export let id: string;
|
|
3
|
+
export let description: string;
|
|
4
|
+
export let envKeys: any[];
|
|
5
|
+
export { catalog };
|
|
6
|
+
export { buildPromptFragment as promptFragment };
|
|
7
|
+
export let tools: ({
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
input_schema: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {
|
|
13
|
+
skillId: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
required: string[];
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
input_schema: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
skillId?: undefined;
|
|
27
|
+
};
|
|
28
|
+
required?: undefined;
|
|
29
|
+
};
|
|
30
|
+
})[];
|
|
31
|
+
export function handleToolCall(name: any, args: any, context: any): Promise<string>;
|
|
32
|
+
export function resolve(): any;
|
|
33
|
+
}
|
|
34
|
+
declare const catalog: {
|
|
35
|
+
jira: {
|
|
36
|
+
description: string;
|
|
37
|
+
integrationProvider: string;
|
|
38
|
+
envKeys: any[];
|
|
39
|
+
setupInstructions: string;
|
|
40
|
+
};
|
|
41
|
+
github: {
|
|
42
|
+
description: string;
|
|
43
|
+
integrationProvider: string;
|
|
44
|
+
envKeys: any[];
|
|
45
|
+
setupInstructions: string;
|
|
46
|
+
};
|
|
47
|
+
slack: {
|
|
48
|
+
description: string;
|
|
49
|
+
integrationProvider: string;
|
|
50
|
+
envKeys: any[];
|
|
51
|
+
setupInstructions: string;
|
|
52
|
+
};
|
|
53
|
+
sentry: {
|
|
54
|
+
description: string;
|
|
55
|
+
integrationProvider: string;
|
|
56
|
+
envKeys: any[];
|
|
57
|
+
setupInstructions: string;
|
|
58
|
+
};
|
|
59
|
+
runner: {
|
|
60
|
+
description: string;
|
|
61
|
+
envKeys: any[];
|
|
62
|
+
setupInstructions: string;
|
|
63
|
+
};
|
|
64
|
+
browser: {
|
|
65
|
+
description: string;
|
|
66
|
+
envKeys: any[];
|
|
67
|
+
setupInstructions: string;
|
|
68
|
+
};
|
|
69
|
+
memory: {
|
|
70
|
+
description: string;
|
|
71
|
+
envKeys: any[];
|
|
72
|
+
setupInstructions: string;
|
|
73
|
+
};
|
|
74
|
+
'chat-memory': {
|
|
75
|
+
description: string;
|
|
76
|
+
envKeys: any[];
|
|
77
|
+
setupInstructions: string;
|
|
78
|
+
};
|
|
79
|
+
git: {
|
|
80
|
+
description: string;
|
|
81
|
+
envKeys: any[];
|
|
82
|
+
setupInstructions: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
declare function buildPromptFragment(): string;
|
|
86
|
+
export {};
|