awaitly-visualizer 1.0.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.
Files changed (43) hide show
  1. package/dist/index.browser.cjs +1677 -0
  2. package/dist/index.browser.cjs.map +1 -0
  3. package/dist/index.browser.d.cts +166 -0
  4. package/dist/index.browser.d.ts +166 -0
  5. package/dist/index.browser.js +1677 -0
  6. package/dist/index.browser.js.map +1 -0
  7. package/dist/index.cjs +1680 -0
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +242 -0
  10. package/dist/index.d.ts +242 -0
  11. package/dist/index.js +1680 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/kroki/fetch.cjs +3 -0
  14. package/dist/kroki/fetch.cjs.map +1 -0
  15. package/dist/kroki/fetch.d.cts +86 -0
  16. package/dist/kroki/fetch.d.ts +86 -0
  17. package/dist/kroki/fetch.js +3 -0
  18. package/dist/kroki/fetch.js.map +1 -0
  19. package/dist/notifiers/discord.cjs +3 -0
  20. package/dist/notifiers/discord.cjs.map +1 -0
  21. package/dist/notifiers/discord.d.cts +70 -0
  22. package/dist/notifiers/discord.d.ts +70 -0
  23. package/dist/notifiers/discord.js +3 -0
  24. package/dist/notifiers/discord.js.map +1 -0
  25. package/dist/notifiers/slack.cjs +38 -0
  26. package/dist/notifiers/slack.cjs.map +1 -0
  27. package/dist/notifiers/slack.d.cts +95 -0
  28. package/dist/notifiers/slack.d.ts +95 -0
  29. package/dist/notifiers/slack.js +38 -0
  30. package/dist/notifiers/slack.js.map +1 -0
  31. package/dist/notifiers/webhook.cjs +3 -0
  32. package/dist/notifiers/webhook.cjs.map +1 -0
  33. package/dist/notifiers/webhook.d.cts +115 -0
  34. package/dist/notifiers/webhook.d.ts +115 -0
  35. package/dist/notifiers/webhook.js +3 -0
  36. package/dist/notifiers/webhook.js.map +1 -0
  37. package/dist/performance-analyzer-B5VF5b1F.d.ts +663 -0
  38. package/dist/performance-analyzer-BNwE4AiO.d.cts +663 -0
  39. package/dist/types-BIZSmXif.d.ts +350 -0
  40. package/dist/types-BnWc9Wlr.d.cts +350 -0
  41. package/dist/url-PkfQz4V5.d.cts +750 -0
  42. package/dist/url-PkfQz4V5.d.ts +750 -0
  43. package/package.json +105 -0
@@ -0,0 +1,95 @@
1
+ import { B as BaseNotifierOptions, P as ProviderOptions, N as Notifier } from '../types-BnWc9Wlr.cjs';
2
+ import 'awaitly';
3
+ import 'awaitly/workflow';
4
+ import '../url-PkfQz4V5.cjs';
5
+ import 'awaitly/core';
6
+
7
+ /**
8
+ * Slack Notifier
9
+ *
10
+ * Slack notifier for pushing workflow visualizations.
11
+ * Requires @slack/web-api as an optional peer dependency.
12
+ */
13
+
14
+ /**
15
+ * Options for Slack notifier.
16
+ */
17
+ interface SlackNotifierOptions extends BaseNotifierOptions {
18
+ /** Slack Bot OAuth token (xoxb-...) */
19
+ token: string;
20
+ /** Channel ID or name to post to */
21
+ channel: string;
22
+ /** Bot username to display (optional) */
23
+ username?: string;
24
+ /** Bot icon emoji (optional, e.g., ":robot_face:") */
25
+ iconEmoji?: string;
26
+ /** Bot icon URL (optional) */
27
+ iconUrl?: string;
28
+ /**
29
+ * Diagram rendering provider configuration.
30
+ * REQUIRED - no silent default to prevent surprise network calls.
31
+ */
32
+ diagramProvider: ProviderOptions;
33
+ }
34
+ /**
35
+ * Minimal Slack Web API interface.
36
+ * This allows us to work without requiring the full @slack/web-api package.
37
+ */
38
+ interface SlackWebApi {
39
+ chat: {
40
+ postMessage(args: unknown): Promise<{
41
+ ok: boolean;
42
+ ts?: string;
43
+ error?: string;
44
+ }>;
45
+ update(args: unknown): Promise<{
46
+ ok: boolean;
47
+ error?: string;
48
+ }>;
49
+ };
50
+ }
51
+ /**
52
+ * Create a Slack notifier.
53
+ *
54
+ * @param options - Slack configuration
55
+ * @param deps - Optional dependencies (for testing)
56
+ * @returns A Notifier instance
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { createSlackNotifier } from 'awaitly-visualizer/notifiers/slack';
61
+ *
62
+ * // Using Kroki (default)
63
+ * const slack = createSlackNotifier({
64
+ * token: process.env.SLACK_TOKEN!,
65
+ * channel: '#workflows',
66
+ * username: 'Workflow Bot',
67
+ * iconEmoji: ':robot_face:',
68
+ * diagramProvider: { provider: 'kroki' },
69
+ * });
70
+ *
71
+ * // Using mermaid.ink with dark theme
72
+ * const slackDark = createSlackNotifier({
73
+ * token: process.env.SLACK_TOKEN!,
74
+ * channel: '#workflows',
75
+ * diagramProvider: {
76
+ * provider: 'mermaid-ink',
77
+ * theme: 'dark',
78
+ * bgColor: '1b1b1f',
79
+ * },
80
+ * });
81
+ *
82
+ * // One-time notification
83
+ * await slack.notify(workflowIR, { title: 'Order Processing' });
84
+ *
85
+ * // Live updates (posts once, then UPDATES same message - no spam)
86
+ * const live = slack.createLive({ title: 'Order #123' });
87
+ * workflow.on('event', (e) => live.update(e));
88
+ * await live.finalize();
89
+ * ```
90
+ */
91
+ declare function createSlackNotifier(options: SlackNotifierOptions, deps?: {
92
+ client?: SlackWebApi;
93
+ }): Notifier;
94
+
95
+ export { type SlackNotifierOptions, createSlackNotifier };
@@ -0,0 +1,95 @@
1
+ import { B as BaseNotifierOptions, P as ProviderOptions, N as Notifier } from '../types-BIZSmXif.js';
2
+ import 'awaitly';
3
+ import 'awaitly/workflow';
4
+ import '../url-PkfQz4V5.js';
5
+ import 'awaitly/core';
6
+
7
+ /**
8
+ * Slack Notifier
9
+ *
10
+ * Slack notifier for pushing workflow visualizations.
11
+ * Requires @slack/web-api as an optional peer dependency.
12
+ */
13
+
14
+ /**
15
+ * Options for Slack notifier.
16
+ */
17
+ interface SlackNotifierOptions extends BaseNotifierOptions {
18
+ /** Slack Bot OAuth token (xoxb-...) */
19
+ token: string;
20
+ /** Channel ID or name to post to */
21
+ channel: string;
22
+ /** Bot username to display (optional) */
23
+ username?: string;
24
+ /** Bot icon emoji (optional, e.g., ":robot_face:") */
25
+ iconEmoji?: string;
26
+ /** Bot icon URL (optional) */
27
+ iconUrl?: string;
28
+ /**
29
+ * Diagram rendering provider configuration.
30
+ * REQUIRED - no silent default to prevent surprise network calls.
31
+ */
32
+ diagramProvider: ProviderOptions;
33
+ }
34
+ /**
35
+ * Minimal Slack Web API interface.
36
+ * This allows us to work without requiring the full @slack/web-api package.
37
+ */
38
+ interface SlackWebApi {
39
+ chat: {
40
+ postMessage(args: unknown): Promise<{
41
+ ok: boolean;
42
+ ts?: string;
43
+ error?: string;
44
+ }>;
45
+ update(args: unknown): Promise<{
46
+ ok: boolean;
47
+ error?: string;
48
+ }>;
49
+ };
50
+ }
51
+ /**
52
+ * Create a Slack notifier.
53
+ *
54
+ * @param options - Slack configuration
55
+ * @param deps - Optional dependencies (for testing)
56
+ * @returns A Notifier instance
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { createSlackNotifier } from 'awaitly-visualizer/notifiers/slack';
61
+ *
62
+ * // Using Kroki (default)
63
+ * const slack = createSlackNotifier({
64
+ * token: process.env.SLACK_TOKEN!,
65
+ * channel: '#workflows',
66
+ * username: 'Workflow Bot',
67
+ * iconEmoji: ':robot_face:',
68
+ * diagramProvider: { provider: 'kroki' },
69
+ * });
70
+ *
71
+ * // Using mermaid.ink with dark theme
72
+ * const slackDark = createSlackNotifier({
73
+ * token: process.env.SLACK_TOKEN!,
74
+ * channel: '#workflows',
75
+ * diagramProvider: {
76
+ * provider: 'mermaid-ink',
77
+ * theme: 'dark',
78
+ * bgColor: '1b1b1f',
79
+ * },
80
+ * });
81
+ *
82
+ * // One-time notification
83
+ * await slack.notify(workflowIR, { title: 'Order Processing' });
84
+ *
85
+ * // Live updates (posts once, then UPDATES same message - no spam)
86
+ * const live = slack.createLive({ title: 'Order #123' });
87
+ * workflow.on('event', (e) => live.update(e));
88
+ * await live.finalize();
89
+ * ```
90
+ */
91
+ declare function createSlackNotifier(options: SlackNotifierOptions, deps?: {
92
+ client?: SlackWebApi;
93
+ }): Notifier;
94
+
95
+ export { type SlackNotifierOptions, createSlackNotifier };