botinabox 2.9.3 → 2.9.5

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/bin/botinabox.mjs CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  import('../dist/cli.js').then(m => m.main(process.argv.slice(2)));
@@ -0,0 +1,82 @@
1
+ import { c as ContentBlock } from './provider-BHkqkSdq.js';
2
+
3
+ /** Channel adapter types — Story 1.5 / 4.1 */
4
+
5
+ type ChatType = "direct" | "group" | "channel";
6
+ type FormattingMode = "markdown" | "mrkdwn" | "html" | "plain";
7
+ interface ChannelCapabilities {
8
+ chatTypes: ChatType[];
9
+ threads: boolean;
10
+ reactions: boolean;
11
+ editing: boolean;
12
+ media: boolean;
13
+ polls: boolean;
14
+ maxTextLength: number;
15
+ formattingMode: FormattingMode;
16
+ }
17
+ interface ChannelMeta {
18
+ displayName: string;
19
+ icon?: string;
20
+ homepage?: string;
21
+ }
22
+ interface InboundMessage {
23
+ id: string;
24
+ channel: string;
25
+ account?: string;
26
+ from: string;
27
+ userId?: string;
28
+ body: string;
29
+ threadId?: string;
30
+ replyToId?: string;
31
+ attachments?: Attachment[];
32
+ /**
33
+ * Multimodal content blocks produced by attachment enrichers.
34
+ * When set, ChatPipeline builds a multimodal user message that passes
35
+ * these blocks through to the LLM provider alongside `body`.
36
+ */
37
+ attachmentBlocks?: ContentBlock[];
38
+ receivedAt: string;
39
+ raw?: unknown;
40
+ }
41
+ type AttachmentMediaType = "image" | "video" | "audio" | "pdf" | "doc" | "excel" | "presentation" | "html" | "link" | "misc";
42
+ interface Attachment {
43
+ type: AttachmentMediaType;
44
+ url?: string;
45
+ mimeType?: string;
46
+ filename?: string;
47
+ size?: number;
48
+ }
49
+ interface OutboundPayload {
50
+ text: string;
51
+ threadId?: string;
52
+ replyToId?: string;
53
+ attachments?: Attachment[];
54
+ }
55
+ interface SendResult {
56
+ success: boolean;
57
+ messageId?: string;
58
+ error?: string;
59
+ }
60
+ interface HealthStatus {
61
+ ok: boolean;
62
+ latencyMs?: number;
63
+ error?: string;
64
+ }
65
+ type ChannelConfig = Record<string, unknown>;
66
+ interface ChannelAdapter {
67
+ /** Unique identifier for this adapter instance */
68
+ id: string;
69
+ meta: ChannelMeta;
70
+ capabilities: ChannelCapabilities;
71
+ connect(config: ChannelConfig): Promise<void>;
72
+ disconnect(): Promise<void>;
73
+ healthCheck(): Promise<HealthStatus>;
74
+ send(target: {
75
+ peerId: string;
76
+ threadId?: string;
77
+ }, payload: OutboundPayload): Promise<SendResult>;
78
+ /** Called when a message arrives — set by the framework */
79
+ onMessage?: (message: InboundMessage) => Promise<void>;
80
+ }
81
+
82
+ export type { Attachment as A, ChannelAdapter as C, FormattingMode as F, HealthStatus as H, InboundMessage as I, OutboundPayload as O, SendResult as S, AttachmentMediaType as a, ChannelCapabilities as b, ChannelConfig as c, ChannelMeta as d, ChatType as e };
@@ -0,0 +1,73 @@
1
+ /** Channel adapter types — Story 1.5 / 4.1 */
2
+ type ChatType = "direct" | "group" | "channel";
3
+ type FormattingMode = "markdown" | "mrkdwn" | "html" | "plain";
4
+ interface ChannelCapabilities {
5
+ chatTypes: ChatType[];
6
+ threads: boolean;
7
+ reactions: boolean;
8
+ editing: boolean;
9
+ media: boolean;
10
+ polls: boolean;
11
+ maxTextLength: number;
12
+ formattingMode: FormattingMode;
13
+ }
14
+ interface ChannelMeta {
15
+ displayName: string;
16
+ icon?: string;
17
+ homepage?: string;
18
+ }
19
+ interface InboundMessage {
20
+ id: string;
21
+ channel: string;
22
+ account?: string;
23
+ from: string;
24
+ userId?: string;
25
+ body: string;
26
+ threadId?: string;
27
+ replyToId?: string;
28
+ attachments?: Attachment[];
29
+ receivedAt: string;
30
+ raw?: unknown;
31
+ }
32
+ type AttachmentMediaType = "image" | "video" | "audio" | "pdf" | "doc" | "excel" | "presentation" | "html" | "link" | "misc";
33
+ interface Attachment {
34
+ type: AttachmentMediaType;
35
+ url?: string;
36
+ mimeType?: string;
37
+ filename?: string;
38
+ size?: number;
39
+ }
40
+ interface OutboundPayload {
41
+ text: string;
42
+ threadId?: string;
43
+ replyToId?: string;
44
+ attachments?: Attachment[];
45
+ }
46
+ interface SendResult {
47
+ success: boolean;
48
+ messageId?: string;
49
+ error?: string;
50
+ }
51
+ interface HealthStatus {
52
+ ok: boolean;
53
+ latencyMs?: number;
54
+ error?: string;
55
+ }
56
+ type ChannelConfig = Record<string, unknown>;
57
+ interface ChannelAdapter {
58
+ /** Unique identifier for this adapter instance */
59
+ id: string;
60
+ meta: ChannelMeta;
61
+ capabilities: ChannelCapabilities;
62
+ connect(config: ChannelConfig): Promise<void>;
63
+ disconnect(): Promise<void>;
64
+ healthCheck(): Promise<HealthStatus>;
65
+ send(target: {
66
+ peerId: string;
67
+ threadId?: string;
68
+ }, payload: OutboundPayload): Promise<SendResult>;
69
+ /** Called when a message arrives — set by the framework */
70
+ onMessage?: (message: InboundMessage) => Promise<void>;
71
+ }
72
+
73
+ export type { Attachment as A, ChannelAdapter as C, FormattingMode as F, HealthStatus as H, InboundMessage as I, OutboundPayload as O, SendResult as S, AttachmentMediaType as a, ChannelCapabilities as b, ChannelConfig as c, ChannelMeta as d, ChatType as e };
@@ -4,7 +4,7 @@ import {
4
4
  extractVoiceTranscript,
5
5
  parseSlackEvent,
6
6
  transcribeAudio
7
- } from "../../chunk-OEMM2LEA.js";
7
+ } from "../../chunk-QBBROFEL.js";
8
8
  import {
9
9
  chunkText
10
10
  } from "../../chunk-ZTZFPTOQ.js";
@@ -71,8 +71,8 @@ var SlackAdapter = class {
71
71
  /** Simulate receiving an inbound message (for testing/webhooks). */
72
72
  async receive(event) {
73
73
  if (this.onMessage) {
74
- const { parseSlackEvent: parseSlackEvent2 } = await import("../../inbound-5FKJBWPL.js");
75
- const { enrichVoiceMessage: enrichVoiceMessage2 } = await import("../../inbound-5FKJBWPL.js");
74
+ const { parseSlackEvent: parseSlackEvent2 } = await import("../../inbound-WAOVULIZ.js");
75
+ const { enrichVoiceMessage: enrichVoiceMessage2 } = await import("../../inbound-WAOVULIZ.js");
76
76
  let msg = parseSlackEvent2(event);
77
77
  if (msg.body.includes("[Voice message") && this.config?.botToken) {
78
78
  msg = await enrichVoiceMessage2(msg, this.config.botToken);
@@ -139,7 +139,7 @@ var SlackBoltAdapter = class {
139
139
  async start() {
140
140
  const boltModule = "@slack/bolt";
141
141
  const bolt = await import(boltModule);
142
- const { enrichVoiceMessage: enrichVoiceMessage2 } = await import("../../inbound-5FKJBWPL.js");
142
+ const { enrichVoiceMessage: enrichVoiceMessage2 } = await import("../../inbound-WAOVULIZ.js");
143
143
  const boltApp = new bolt.App({
144
144
  token: this.config.botToken,
145
145
  appToken: this.config.appToken,