@zibby/skills 0.1.33 → 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.
Files changed (87) hide show
  1. package/README.md +2 -0
  2. package/dist/browser.d.ts +19 -0
  3. package/dist/chat-memory.d.ts +355 -0
  4. package/dist/chat-notify.d.ts +409 -0
  5. package/dist/core-tools.d.ts +131 -0
  6. package/dist/function-skill.d.ts +149 -0
  7. package/dist/git.d.ts +72 -0
  8. package/dist/github.d.ts +777 -0
  9. package/dist/github.js +4 -3
  10. package/dist/gitlab.d.ts +396 -0
  11. package/dist/gitlab.js +19 -0
  12. package/dist/index.d.ts +45 -0
  13. package/dist/index.js +145 -126
  14. package/dist/integrations.d.ts +110 -0
  15. package/dist/jira.d.ts +547 -0
  16. package/dist/lark.d.ts +161 -0
  17. package/dist/linear.d.ts +344 -0
  18. package/dist/llm-billing.d.ts +294 -0
  19. package/dist/memory.d.ts +137 -0
  20. package/dist/package.json +67 -17
  21. package/dist/plane.d.ts +24 -0
  22. package/dist/report.d.ts +354 -0
  23. package/dist/report.js +9 -9
  24. package/dist/sentry.d.ts +43 -0
  25. package/dist/skill-installer.d.ts +86 -0
  26. package/dist/slack.d.ts +284 -0
  27. package/dist/test-runner.d.ts +220 -0
  28. package/dist/trackers/github-adapter.d.ts +96 -0
  29. package/dist/trackers/github-adapter.js +4 -3
  30. package/dist/trackers/index.d.ts +27 -0
  31. package/dist/trackers/index.js +16 -15
  32. package/dist/trackers/jira-adapter.d.ts +90 -0
  33. package/dist/trackers/linear-adapter.d.ts +89 -0
  34. package/dist/trackers/plane-adapter.d.ts +101 -0
  35. package/dist/trackers/types.d.ts +335 -0
  36. package/dist/workflow-builder.d.ts +245 -0
  37. package/docs/apps/agent-ops.md +6 -6
  38. package/docs/apps/deploy.md +1 -1
  39. package/docs/apps/index.md +1 -1
  40. package/docs/apps/managing.md +1 -1
  41. package/docs/cli-reference.md +65 -65
  42. package/docs/cloning-repositories.md +9 -9
  43. package/docs/cloud/bundles.md +8 -8
  44. package/docs/cloud/dedicated-egress.md +6 -6
  45. package/docs/cloud/env-vars.md +29 -29
  46. package/docs/cloud/limits.md +11 -11
  47. package/docs/cloud/triggering.md +16 -16
  48. package/docs/concepts/agents.md +4 -4
  49. package/docs/concepts/sessions.md +7 -7
  50. package/docs/concepts/state.md +1 -1
  51. package/docs/concepts/sub-graphs.md +9 -9
  52. package/docs/get-started/deploy.md +14 -14
  53. package/docs/get-started/install.md +4 -4
  54. package/docs/get-started/run-locally.md +12 -12
  55. package/docs/get-started/trigger-and-logs.md +14 -14
  56. package/docs/get-started/use-from-agents.md +17 -17
  57. package/docs/get-started/your-first-workflow.md +8 -8
  58. package/docs/integrations/gitlab.md +1 -1
  59. package/docs/integrations/lark.md +2 -2
  60. package/docs/integrations/linear.md +1 -1
  61. package/docs/integrations/notion.md +2 -2
  62. package/docs/integrations/plane.md +1 -1
  63. package/docs/integrations/slack.md +1 -1
  64. package/docs/intro.md +4 -4
  65. package/docs/legacy/test-automation.md +2 -2
  66. package/docs/packages/cli.md +11 -11
  67. package/docs/packages/core.md +2 -2
  68. package/docs/packages/mcp-cli.md +18 -18
  69. package/docs/packages/skills.md +2 -2
  70. package/docs/packages/ui-memory.md +1 -1
  71. package/docs/recipes/bug-autofix.md +1 -1
  72. package/docs/recipes/index.md +3 -3
  73. package/docs/recipes/pipeline-supervisor.md +4 -4
  74. package/docs/recipes/sentry-triage.md +7 -7
  75. package/docs/recipes/test.md +6 -6
  76. package/docs/skills/browser.md +2 -2
  77. package/docs/skills/chat-memory.md +1 -1
  78. package/docs/skills/core-tools.md +1 -1
  79. package/docs/skills/function-skill.md +1 -1
  80. package/docs/skills/github.md +2 -2
  81. package/docs/skills/index.md +1 -1
  82. package/docs/skills/jira.md +1 -1
  83. package/docs/skills/lark.md +1 -1
  84. package/docs/skills/memory.md +2 -2
  85. package/docs/skills/sentry.md +1 -1
  86. package/docs/skills/slack.md +2 -2
  87. package/package.json +67 -17
@@ -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()}).refine(o=>o.labels.length===o.values.length,{message:"labels.length must equal values.length"}),O=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.")}).refine(o=>o.rows.every(e=>e.length===o.headers.length),{message:"every row must have headers.length entries"}),T=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.")}),E=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,O,T,E,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([]),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}"}),_=Object.freeze({up:"\u2191",down:"\u2193",flat:"\u2192"}),L=Object.freeze({ok:"green",info:"blue",warn:"orange",critical:"red"});function w(o,e,t=12){if(!Number.isFinite(o)||!Number.isFinite(e)||e<=0)return"";let c=Math.max(0,Math.min(1,o/e)),h=Math.round(c*t);return"\u2593".repeat(h)+"\u2591".repeat(t-h)}function x(o,e){let t=String(o);return t.length>=e?t:t+" ".repeat(e-t.length)}function $(o,e){let t=String(o);return t.length>=e?t:" ".repeat(e-t.length)+t}function S({headers:o,rows:e}){let t=o.map((n,r)=>{let l=Math.max(String(n).length,...e.map(s=>String(s[r]??"").length));return Math.min(l,32)}),c=n=>n.map((r,l)=>x(r,t[l])).join(" "),h=t.map(n=>"\u2500".repeat(n)).join(" ");return"```\n"+[c(o),h,...e.map(n=>c(n))].join(`
2
- `)+"\n```"}function A(o){let e=k.parse(o),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 c=[`*${e.headline.primary}*`];if(e.headline.delta){let i=_[e.headline.delta.direction]||"",n=e.headline.delta.severity?p[e.headline.delta.severity]:"";c.push(`${i} ${e.headline.delta.value} ${n}`.trim())}let h=c.join(" ");e.headline.summary&&(h+=`
3
- `+e.headline.summary),t.push({type:"section",text:{type:"mrkdwn",text:h}});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((l,s)=>{let u=i.values[s],d=w(u,n),y=(i.highlight==="last"&&s===i.labels.length-1||i.highlight==="max"&&u===n||i.highlight==="min"&&u===Math.min(...i.values))&&i.severity?` ${p[i.severity]}`:"";return`${x(l,10)} ${$(u.toLocaleString(),8)} ${d}${y}`});t.push({type:"section",text:{type:"mrkdwn",text:"```\n"+r.join(`
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 C(o){let e=k.parse(o),t=[],c=[`**${e.headline.primary}**`];if(e.headline.delta){let n=_[e.headline.delta.direction]||"",r=e.headline.delta.severity?p[e.headline.delta.severity]:"";c.push(`${n} ${e.headline.delta.value} ${r}`.trim())}let h=c.join(" ");e.headline.summary&&(h+=`
8
- `+e.headline.summary),t.push({tag:"div",text:{tag:"lark_md",content:h}});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),l=n.labels.map((s,u)=>{let d=n.values[u],b=w(d,r),f=(n.highlight==="last"&&u===n.labels.length-1||n.highlight==="max"&&d===r||n.highlight==="min"&&d===Math.min(...n.values))&&n.severity?` ${p[n.severity]}`:"";return`${x(s,10)} ${$(d.toLocaleString(),8)} ${b}${f}`});t.push({tag:"div",text:{tag:"lark_md",content:"```\n"+l.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(l=>`${r} ${l}`).join(`
10
- `)}});break}case"breakdown":{let r=n.rows.map(l=>{let s=l.severity?` ${p[l.severity]}`:"",u=l.sub?` *${l.sub}*`:"";return`**${l.label}** ${l.value}${u}${s}`});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(o,e={}){let t={type:"text",text:{content:String(o).slice(0,2e3)}};return e.annotations&&(t.annotations=e.annotations),[t]}function v(o,e){let t={object:"block",type:"paragraph",paragraph:{rich_text:m(o)}};return e&&(t.paragraph.color=e),t}function V(o){return{object:"block",type:"code",code:{rich_text:m(o),language:"plain text"}}}function W(o){let e=k.parse(o),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 c=[{type:"text",text:{content:e.headline.primary.slice(0,200)},annotations:{bold:!0}}];if(e.headline.delta){let i=_[e.headline.delta.direction]||"",n=e.headline.delta.severity?p[e.headline.delta.severity]:"",r=` ${i} ${e.headline.delta.value} ${n}`.trimEnd();c.push({type:"text",text:{content:r}})}t.push({object:"block",type:"paragraph",paragraph:{rich_text:c}}),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),l=i.labels.map((s,u)=>{let d=i.values[u],b=w(d,n),f=(i.highlight==="last"&&u===i.labels.length-1||i.highlight==="max"&&d===n||i.highlight==="min"&&d===r)&&i.severity?` ${p[i.severity]}`:"";return`${x(s,10)} ${$(d.toLocaleString(),8)} ${b}${f}`});t.push(V(l.join(`
12
- `)));break}case"table":{let n={object:"block",type:"table_row",table_row:{cells:i.headers.map(l=>m(l))}},r=i.rows.map(l=>({object:"block",type:"table_row",table_row:{cells:l.map(s=>m(String(s)))}}));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],l=N[n];for(let s of i.items)t.push({object:"block",type:"callout",callout:{rich_text:m(s),icon:{type:"emoji",emoji:r},color:l}});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 h=e.headline.delta?.severity?j[e.headline.delta.severity]:void 0;return{blocks:t,title:e.title.slice(0,200),icon:h}}export{g as SEVERITIES,k as reportObjectSchema,A as reportToBlockKit,C as reportToLarkCard,W as reportToNotionBlocks};
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};
@@ -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 {};