@hardlydifficult/chat 1.1.21 → 1.1.23

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,44 @@
1
+ import type { Message } from "./Message.js";
2
+ import type { Platform } from "./types.js";
3
+ /**
4
+ * Buffers text and periodically updates a single thread message in place.
5
+ *
6
+ * Created via {@link Thread.editableStream}. Unlike {@link StreamingReply}
7
+ * which posts a new message on every flush, this class edits the same
8
+ * message so the user sees a single message that grows over time.
9
+ *
10
+ * When the accumulated content exceeds the platform's message-length
11
+ * limit, the beginning is truncated with an `…` prefix so the most
12
+ * recent output is always visible.
13
+ */
14
+ export declare class EditableStreamReply {
15
+ private readonly postFn;
16
+ private readonly platform;
17
+ private buffer;
18
+ private lastFlushed;
19
+ private currentMessage;
20
+ private flushing;
21
+ private intervalId;
22
+ constructor(postFn: (content: string) => Promise<Message>, platform: Platform, flushIntervalMs: number);
23
+ /**
24
+ * Append text to the accumulated buffer. The message will be updated
25
+ * on the next flush (either automatic or manual).
26
+ */
27
+ append(text: string): void;
28
+ /**
29
+ * The full accumulated content, including text not yet flushed.
30
+ * Useful for reading back the complete response after {@link stop}.
31
+ */
32
+ get content(): string;
33
+ /**
34
+ * Post (first time) or edit (subsequent) the message with the full
35
+ * accumulated buffer. No-op if the buffer hasn't changed since the
36
+ * last flush or is empty/whitespace-only.
37
+ */
38
+ flush(): Promise<void>;
39
+ /**
40
+ * Stop the automatic flush timer and flush any remaining buffered text.
41
+ */
42
+ stop(): Promise<void>;
43
+ }
44
+ //# sourceMappingURL=EditableStreamReply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableStreamReply.d.ts","sourceRoot":"","sources":["../src/EditableStreamReply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;;;;;;;;;GAUG;AACH,qBAAa,mBAAmB;IAQ5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAA+C;gBAG9C,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAC7C,QAAQ,EAAE,QAAQ,EACnC,eAAe,EAAE,MAAM;IAUzB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1B;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditableStreamReply = void 0;
4
+ const MESSAGE_LIMITS = {
5
+ discord: 2000,
6
+ slack: 4000,
7
+ };
8
+ /**
9
+ * Buffers text and periodically updates a single thread message in place.
10
+ *
11
+ * Created via {@link Thread.editableStream}. Unlike {@link StreamingReply}
12
+ * which posts a new message on every flush, this class edits the same
13
+ * message so the user sees a single message that grows over time.
14
+ *
15
+ * When the accumulated content exceeds the platform's message-length
16
+ * limit, the beginning is truncated with an `…` prefix so the most
17
+ * recent output is always visible.
18
+ */
19
+ class EditableStreamReply {
20
+ postFn;
21
+ platform;
22
+ buffer = "";
23
+ lastFlushed = "";
24
+ currentMessage = null;
25
+ flushing = false;
26
+ intervalId = null;
27
+ constructor(postFn, platform, flushIntervalMs) {
28
+ this.postFn = postFn;
29
+ this.platform = platform;
30
+ this.intervalId = setInterval(() => {
31
+ this.flush().catch(() => {
32
+ // Interval flush errors are swallowed; callers observe errors
33
+ // via the flush() and stop() return values.
34
+ });
35
+ }, flushIntervalMs);
36
+ }
37
+ /**
38
+ * Append text to the accumulated buffer. The message will be updated
39
+ * on the next flush (either automatic or manual).
40
+ */
41
+ append(text) {
42
+ this.buffer += text;
43
+ }
44
+ /**
45
+ * The full accumulated content, including text not yet flushed.
46
+ * Useful for reading back the complete response after {@link stop}.
47
+ */
48
+ get content() {
49
+ return this.buffer;
50
+ }
51
+ /**
52
+ * Post (first time) or edit (subsequent) the message with the full
53
+ * accumulated buffer. No-op if the buffer hasn't changed since the
54
+ * last flush or is empty/whitespace-only.
55
+ */
56
+ async flush() {
57
+ if (this.buffer === this.lastFlushed || !this.buffer.trim()) {
58
+ return;
59
+ }
60
+ if (this.flushing) {
61
+ return;
62
+ }
63
+ this.flushing = true;
64
+ this.lastFlushed = this.buffer;
65
+ const limit = MESSAGE_LIMITS[this.platform];
66
+ const text = this.buffer.length > limit
67
+ ? `\u2026${this.buffer.slice(-(limit - 1))}`
68
+ : this.buffer;
69
+ try {
70
+ if (!this.currentMessage) {
71
+ this.currentMessage = await this.postFn(text);
72
+ }
73
+ else {
74
+ await this.currentMessage.update(text);
75
+ }
76
+ }
77
+ finally {
78
+ this.flushing = false;
79
+ }
80
+ }
81
+ /**
82
+ * Stop the automatic flush timer and flush any remaining buffered text.
83
+ */
84
+ async stop() {
85
+ if (this.intervalId) {
86
+ clearInterval(this.intervalId);
87
+ this.intervalId = null;
88
+ }
89
+ await this.flush();
90
+ }
91
+ }
92
+ exports.EditableStreamReply = EditableStreamReply;
93
+ //# sourceMappingURL=EditableStreamReply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableStreamReply.js","sourceRoot":"","sources":["../src/EditableStreamReply.ts"],"names":[],"mappings":";;;AAGA,MAAM,cAAc,GAA6B;IAC/C,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAa,mB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AAC,CAAC,EAAE;YAC5C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QAElB,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;gBACzB,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AA/ED,kDA+EC"}
package/dist/Thread.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import { EditableStreamReply } from "./EditableStreamReply.js";
1
2
  import { Message, type MessageOperations } from "./Message.js";
3
+ import { StreamingReply } from "./StreamingReply.js";
2
4
  import type { FileAttachment, MessageCallback, MessageContent, MessageData, Platform, ThreadData } from "./types.js";
3
5
  /**
4
6
  * Internal operations provided by Channel to power Thread methods.
@@ -40,6 +42,41 @@ export declare class Thread {
40
42
  * @returns Message object for the posted message
41
43
  */
42
44
  post(content: MessageContent, files?: FileAttachment[]): Promise<Message>;
45
+ /**
46
+ * Stream messages into this thread by buffering text and flushing
47
+ * at a fixed interval. Long text is automatically chunked to fit
48
+ * within platform message limits.
49
+ *
50
+ * @param flushIntervalMs - How often to flush buffered text (in milliseconds)
51
+ * @returns StreamingReply with append/flush/stop methods
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const stream = thread.stream(2000);
56
+ * stream.append("Processing...\n");
57
+ * stream.append("Done!\n");
58
+ * await stream.stop();
59
+ * ```
60
+ */
61
+ stream(flushIntervalMs: number): StreamingReply;
62
+ /**
63
+ * Stream messages into this thread by editing a single message in
64
+ * place. Text appended between flushes updates the same message
65
+ * rather than creating new ones. If the accumulated text exceeds the
66
+ * platform's message-length limit, the beginning is truncated.
67
+ *
68
+ * @param flushIntervalMs - How often to flush buffered text (in milliseconds)
69
+ * @returns EditableStreamReply with append/flush/stop methods
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const stream = thread.editableStream(2000);
74
+ * stream.append("Processing...\n");
75
+ * stream.append("Still going...\n");
76
+ * await stream.stop();
77
+ * ```
78
+ */
79
+ editableStream(flushIntervalMs: number): EditableStreamReply;
43
80
  /**
44
81
  * Subscribe to replies in this thread.
45
82
  * @param callback - Function called with a Message for each reply
@@ -1 +1 @@
1
- {"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../src/Thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,cAAc,EACd,WAAW,EAEX,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,EAAE,CACJ,OAAO,EAAE,cAAc,EACvB,KAAK,CAAC,EAAE,cAAc,EAAE,KACrB,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1B,SAAS,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,IAAI,CAAC;IACrD,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,MAAM;IACjB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,SAAS,EAAE,MAAM,CAAC;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a,MAAM;IACjB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC,OAAO,CAAC,GAAG,CAAmB;IAC9B,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,gBAAgB;IAOnD;;;;;OAKG;IACG,IAAI,CACR,OAAO,EAAE,cAAc,EACvB,KAAK,CAAC,EAAE,cAAc,EAAE,GACvB,OAAO,CAAC,OAAO,CAAC;IAKnB;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,cAAc;IAQ/C;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,mBAAmB;IAQ5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI;IAoBzE;;OAEG;IACH,QAAQ,IAAI,IAAI;IAOhB;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B"}
package/dist/Thread.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Thread = void 0;
4
+ const EditableStreamReply_js_1 = require("./EditableStreamReply.js");
4
5
  const Message_js_1 = require("./Message.js");
6
+ const StreamingReply_js_1 = require("./StreamingReply.js");
5
7
  /**
6
8
  * A thread with messaging capabilities: post messages, listen for replies,
7
9
  * and clean up when done.
@@ -40,6 +42,45 @@ class Thread {
40
42
  const data = await this.ops.post(content, files);
41
43
  return new Message_js_1.Message(data, this.ops.createMessageOps());
42
44
  }
45
+ /**
46
+ * Stream messages into this thread by buffering text and flushing
47
+ * at a fixed interval. Long text is automatically chunked to fit
48
+ * within platform message limits.
49
+ *
50
+ * @param flushIntervalMs - How often to flush buffered text (in milliseconds)
51
+ * @returns StreamingReply with append/flush/stop methods
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const stream = thread.stream(2000);
56
+ * stream.append("Processing...\n");
57
+ * stream.append("Done!\n");
58
+ * await stream.stop();
59
+ * ```
60
+ */
61
+ stream(flushIntervalMs) {
62
+ return new StreamingReply_js_1.StreamingReply((content) => this.ops.post(content), this.platform, flushIntervalMs);
63
+ }
64
+ /**
65
+ * Stream messages into this thread by editing a single message in
66
+ * place. Text appended between flushes updates the same message
67
+ * rather than creating new ones. If the accumulated text exceeds the
68
+ * platform's message-length limit, the beginning is truncated.
69
+ *
70
+ * @param flushIntervalMs - How often to flush buffered text (in milliseconds)
71
+ * @returns EditableStreamReply with append/flush/stop methods
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * const stream = thread.editableStream(2000);
76
+ * stream.append("Processing...\n");
77
+ * stream.append("Still going...\n");
78
+ * await stream.stop();
79
+ * ```
80
+ */
81
+ editableStream(flushIntervalMs) {
82
+ return new EditableStreamReply_js_1.EditableStreamReply((content) => this.post(content), this.platform, flushIntervalMs);
83
+ }
43
84
  /**
44
85
  * Subscribe to replies in this thread.
45
86
  * @param callback - Function called with a Message for each reply
@@ -1 +1 @@
1
- {"version":3,"file":"Thread.js","sourceRoot":"","sources":["../src/Thread.ts"],"names":[],"mappings":";;;AAAA,6CAA+D;AAyB/D;;;;;;;;;;;;;;;GAeG;AACH,MAAa,MAAM;IACD,EAAE,CAAS;IACX,SAAS,CAAS;IAClB,QAAQ,CAAW;IAE3B,GAAG,CAAmB;IACtB,kBAAkB,GAAmB,EAAE,CAAC;IAEhD,YAAY,IAAgB,EAAE,GAAqB;QACjD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,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OAAO,CAAC,EAC/B,IAAI,CAAC,QAAQ,EACb,eAAe,CAChB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,QAAoD;QAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAmB,EAAE,EAAE;YAC7D,MAAM,OAAO,GAAG,IAAI,oBAAO,CACzB;gBACE,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;aAC/B,EACD,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAC5B,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1C,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5C,KAAK,EAAE,CAAC;QACV,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;CACF;AAxHD,wBAwHC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { type Attachment, type User, type Member, type DiscordConfig, type Slack
2
2
  export { ChatClient } from "./ChatClient";
3
3
  export { Channel } from "./Channel";
4
4
  export { Message } from "./Message";
5
+ export { EditableStreamReply } from "./EditableStreamReply";
5
6
  export { StreamingReply } from "./StreamingReply";
6
7
  export { Thread } from "./Thread";
7
8
  export { DiscordChatClient } from "./discord";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAW/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAW/D"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlackChatClient = exports.DiscordChatClient = exports.Thread = exports.StreamingReply = exports.Message = exports.Channel = exports.ChatClient = void 0;
3
+ exports.SlackChatClient = exports.DiscordChatClient = exports.Thread = exports.StreamingReply = exports.EditableStreamReply = exports.Message = exports.Channel = exports.ChatClient = void 0;
4
4
  exports.createChatClient = createChatClient;
5
5
  // Core classes
6
6
  var ChatClient_1 = require("./ChatClient");
@@ -9,6 +9,8 @@ var Channel_1 = require("./Channel");
9
9
  Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return Channel_1.Channel; } });
10
10
  var Message_1 = require("./Message");
11
11
  Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return Message_1.Message; } });
12
+ var EditableStreamReply_1 = require("./EditableStreamReply");
13
+ Object.defineProperty(exports, "EditableStreamReply", { enumerable: true, get: function () { return EditableStreamReply_1.EditableStreamReply; } });
12
14
  var StreamingReply_1 = require("./StreamingReply");
13
15
  Object.defineProperty(exports, "StreamingReply", { enumerable: true, get: function () { return StreamingReply_1.StreamingReply; } });
14
16
  var Thread_1 = require("./Thread");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAwDA,4CAWC;AAhDD,eAAe;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,2BAA2B;AAC3B,qCAA8C;AAArC,4GAAA,iBAAiB,OAAA;AAC1B,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AAIxB,uCAA8C;AAC9C,mCAA0C;AAG1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,gBAAgB,CAAC,MAAkB;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,IAAI,2BAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,IAAI,uBAAe,CAAC,MAAM,CAAC,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CACb,0BAA2B,MAA2B,CAAC,IAAI,EAAE,CAC9D,CAAC;IACN,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAyDA,4CAWC;AAjDD,eAAe;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,2BAA2B;AAC3B,qCAA8C;AAArC,4GAAA,iBAAiB,OAAA;AAC1B,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AAIxB,uCAA8C;AAC9C,mCAA0C;AAG1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,gBAAgB,CAAC,MAAkB;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,IAAI,2BAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,IAAI,uBAAe,CAAC,MAAM,CAAC,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CACb,0BAA2B,MAA2B,CAAC,IAAI,EAAE,CAC9D,CAAC;IACN,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardlydifficult/chat",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [