@minjun0219/mdwire 0.1.9 → 0.1.11

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/node/mdwire.d.ts CHANGED
@@ -1,19 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
- /** 변환 옵션. 생략하면 표준 마크다운 입력이다. */
4
+ /** Conversion options. Anything omitted uses the channel's default. */
5
5
  export interface RenderOptions {
6
- /** 입력 표기. 슬랙 레거시 mrkdwn(`*굵게*` `~취소~`)으로 쓴 에이전트 출력이면 "slack-mrkdwn". */
7
- from?: "markdown" | "slack-mrkdwn";
8
- /** 조각 한도(글자 수). 생략하면 채널의 한도다 — plain 을 텔레그램에 보내면 4096. 스트리밍은 나누지 않는다. */
6
+ /** Part size limit (in characters). Defaults to the channel's limit; for example, 4096 when sending plain to Telegram. Streaming does not split. */
9
7
  limit?: number;
10
- /** 브라우저 채널("html")의 정책. 기본값이 가장 보수적이다. */
8
+ /** Policy for the browser channel ("html"). The defaults are the most conservative. */
11
9
  html?: {
12
- /** 블록 안 줄바꿈. "br"(기본) 은 `<br>`, "space" 는 브라우저가 공백으로 접게 둔다. */
10
+ /** Line breaks inside a block. "br" (default) emits `<br>`; "space" lets the browser collapse them into spaces. */
13
11
  lineBreaks?: "br" | "space";
14
- /** 이미지. "link"(기본) 는 누르기 전에 아무것도 안 불러온다, "load" 는 `<img>`. */
12
+ /** Images. "link" (default) loads nothing until clicked; "load" emits `<img>`. */
15
13
  images?: "link" | "load";
16
- /** 링크·이미지 주소로 받는 스킴(콜론 없이). 주면 그것만 받는다. 기본 ["http","https","mailto"]. */
14
+ /** Schemes allowed in link and image URLs (without the colon). If given, only these are allowed. Default ["http","https","mailto"]. */
17
15
  schemes?: string[];
18
16
  };
19
17
  }
@@ -21,133 +19,136 @@ export interface RenderOptions {
21
19
 
22
20
 
23
21
  /**
24
- * `renderWithReport` 의 결과.
22
+ * The result of `renderWithReport`.
25
23
  */
26
24
  export class Rendered {
27
25
  private constructor();
28
26
  free(): void;
29
27
  [Symbol.dispose](): void;
30
28
  /**
31
- * 조각들. 한도를 넘지 않았으면 하나다.
29
+ * The parts. Just one if the text fit within the limit.
32
30
  */
33
31
  readonly parts: string[];
34
32
  /**
35
- * 정규화가 고친 것.
33
+ * What normalization repaired.
36
34
  */
37
35
  readonly repairs: Repairs;
38
36
  }
39
37
 
40
38
  /**
41
- * 정규화가 고친 것과 채널에 맞춰 바꾼 것의 개수.
39
+ * Counts of what normalization repaired and what was changed to fit the channel.
42
40
  */
43
41
  export class Repairs {
44
42
  private constructor();
45
43
  free(): void;
46
44
  [Symbol.dispose](): void;
47
45
  /**
48
- * 블록이 끝나도록 안 닫혀서 닫아 준 강조.
46
+ * Emphasis left open at the end of a block, closed for you.
49
47
  */
50
48
  closedEmphasis: number;
51
49
  /**
52
- * 문서 끝까지 안 닫혀서 닫아 준 코드펜스.
50
+ * Code fences left open at the end of the document, closed for you.
53
51
  */
54
52
  closedFence: number;
55
53
  /**
56
- * 다른 표기로 바꿔 쓴 강조 마커와 `<url|텍스트>` 링크.
54
+ * Emphasis markers and `<url|text>` links rewritten in a different notation.
57
55
  */
58
56
  convertedMarker: number;
59
57
  /**
60
- * 짝 잃은 채 버린 `**`.
58
+ * Unmatched `**` markers that were dropped.
61
59
  */
62
60
  droppedMarker: number;
63
61
  /**
64
- * 채널이 구문으로 읽을 글자를 탈출한 수(GitHub 의 `\~`·`\<`·`\*`).
62
+ * Characters escaped because the channel would read them as syntax (GitHub's `\~`, `\<`, `\*`).
65
63
  */
66
64
  escapedChar: number;
67
65
  /**
68
- * 짝이 없어 글자로 되돌린 백틱 런.
66
+ * Unmatched backtick runs, turned back into literal text.
69
67
  */
70
68
  revertedCodeSpan: number;
71
69
  /**
72
- * 다른 기호로 바꿔 쓴 목록 불릿.
70
+ * List bullets rewritten with a different symbol.
73
71
  */
74
72
  rewrittenBullet: number;
75
73
  /**
76
- * 원문과 다른 모양으로 다시 쓴 표.
74
+ * Tables rewritten in a different shape from the source.
77
75
  */
78
76
  rewrittenTable: number;
79
77
  /**
80
- * 벗긴 원문 HTML(태그·주석·줄바꿈으로 바꾼 `<br>`).
78
+ * Raw HTML stripped from the source (tags, comments, and `<br>` turned into line breaks).
81
79
  */
82
80
  strippedHtml: number;
83
81
  /**
84
- * 마커 대신 태그로 낸 강조(GitHub 의 `<strong>`).
82
+ * Emphasis emitted differently because the channel would not read the marker in that position (GitHub's `<strong>`, Slack's U+2060).
85
83
  */
86
84
  tagEmphasis: number;
87
85
  }
88
86
 
89
87
  /**
90
- * 스트리밍 변환기.
88
+ * Streaming converter.
91
89
  *
92
- * 조각을 넣으면 지금 안전하게 내보낼 수 있는 만큼만 돌려준다. 경계에 걸린 마크업은
93
- * 안에 남는다 — 토큰이 흘러들어오는 대로 화면에 붙이는 쪽이 이것 때문에 쓴다.
90
+ * Push a chunk and it returns only what is safe to emit now. Markup cut off at the
91
+ * chunk boundary stays inside. This is what you want when appending tokens to the
92
+ * screen as they arrive.
94
93
  */
95
94
  export class Streamer {
96
95
  free(): void;
97
96
  [Symbol.dispose](): void;
98
97
  /**
99
- * **지금까지 받은 것을 그대로 보내려면 이걸 뒤에 붙인다.**
98
+ * **To send what you have received so far as is, append this after it.**
100
99
  *
101
- * 상태는 건드리지 않으므로 붙인 뒤에도 스트리밍은 이어진다. 누적본 자체에는
102
- * 넣지 말고, 보내기 직전에만 붙인다. 토큰이 오는 대로 메시지를 편집하는 쪽이 쓴다.
100
+ * It does not touch the state, so streaming continues afterwards. Do not add it
101
+ * to the accumulated output itself; append it only right before sending. Use it
102
+ * when editing a message as tokens arrive.
103
103
  *
104
104
  * ```js
105
105
  * acc += s.push(chunk);
106
- * await edit(acc + s.closeOpen()); // 누적본은 그대로 둔다
106
+ * await edit(acc + s.closeOpen()); // leave acc unchanged
107
107
  * ```
108
108
  */
109
109
  closeOpen(): string;
110
110
  /**
111
- * 입력이 끝났다. 남은 것을 내보내고 열린 마크업을 닫는다.
111
+ * Input has ended. Emits what is left and closes open markup.
112
112
  */
113
113
  finish(): string;
114
114
  constructor(channel: string, options?: RenderOptions | null);
115
115
  /**
116
- * **지금 입력이 끝났다면 확정분 뒤에 붙을 꼬리.** `closeOpen` 과 같은 자리에 들어가지만
117
- * 붙들고 있던 것(열린 강조, 표 행, 코드 스팬)까지 그린다. 누적본을 통째로 다시 그리는 쪽의
118
- * 기본값이다. 추측이라 뒤 조각이 모양을 바꿀 수 있다 — 끝난 뒤 `revised()` 로 본다.
116
+ * **The tail that would follow the final output if input ended now.** It goes in the
117
+ * same place as `closeOpen`, but also draws what is being held back (open emphasis,
118
+ * table rows, code spans). This is the default when you redraw the whole message.
119
+ * It is a guess, so later chunks may change the shape. Check `revised()` after the end.
119
120
  *
120
121
  * ```js
121
122
  * acc += s.push(chunk);
122
- * await edit(acc + s.preview()); // 화면을 그릴 때만 부른다(열린 블록만큼 든다)
123
+ * await edit(acc + s.preview()); // call only when drawing (costs as much as the open block)
123
124
  * acc += s.finish();
124
- * if (s.revised()) await edit(acc); // 마지막 화면이 곧 완성본이면 건너뛴다
125
+ * if (s.revised()) await edit(acc); // skip if the last screen already is the final output
125
126
  * ```
126
127
  */
127
128
  preview(): string;
128
129
  push(chunk: string): string;
129
130
  /**
130
- * 지금까지 정규화가 고친 것. `finish` 뒤에 보면 문서 전체의 값이다.
131
+ * What normalization has repaired so far. After `finish`, this covers the whole document.
131
132
  */
132
133
  repairs(): Repairs;
133
134
  /**
134
- * 완성본이 마지막 `preview()` 와 다른가 — `finish` 뒤에 본다.
135
+ * Whether the final output differs from the last `preview()`. Check it after `finish`.
135
136
  */
136
137
  revised(): boolean;
137
138
  }
138
139
 
139
140
  /**
140
- * 채널의 길이 한도(문자 수). 조각을 직접 다루려는 호출자를 위해 열어 둔다.
141
+ * The channel's length limit (in characters). Exposed for callers that handle parts themselves.
141
142
  */
142
143
  export function limit(channel: string): number;
143
144
 
144
145
  /**
145
- * 완성된 문서를 변환한다. 한도를 넘으면 조각 배열로 돌아온다.
146
+ * Converts a complete document. Returns an array of parts; it has more than one when the text exceeds the limit.
146
147
  */
147
148
  export function render(input: string, channel: string, options?: RenderOptions | null): string[];
148
149
 
149
150
  /**
150
- * [`render`] 에 **정규화가 고친 것**을 같이 돌려준다. 모델이 얼마나 자주 서식을 깨는지
151
- * 로그로 남기려는 쪽이 쓴다.
151
+ * Like [`render`], but also returns **what normalization repaired**. Use it to log
152
+ * how often the model breaks formatting.
152
153
  */
153
154
  export function renderWithReport(input: string, channel: string, options?: RenderOptions | null): Rendered;
package/node/mdwire.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* @ts-self-types="./mdwire.d.ts" */
2
2
 
3
3
  /**
4
- * `renderWithReport` 의 결과.
4
+ * The result of `renderWithReport`.
5
5
  */
6
6
  class Rendered {
7
7
  static __wrap(ptr) {
@@ -21,7 +21,7 @@ class Rendered {
21
21
  wasm.__wbg_rendered_free(ptr, 0);
22
22
  }
23
23
  /**
24
- * 조각들. 한도를 넘지 않았으면 하나다.
24
+ * The parts. Just one if the text fit within the limit.
25
25
  * @returns {string[]}
26
26
  */
27
27
  get parts() {
@@ -38,7 +38,7 @@ class Rendered {
38
38
  }
39
39
  }
40
40
  /**
41
- * 정규화가 고친 것.
41
+ * What normalization repaired.
42
42
  * @returns {Repairs}
43
43
  */
44
44
  get repairs() {
@@ -50,7 +50,7 @@ if (Symbol.dispose) Rendered.prototype[Symbol.dispose] = Rendered.prototype.free
50
50
  exports.Rendered = Rendered;
51
51
 
52
52
  /**
53
- * 정규화가 고친 것과 채널에 맞춰 바꾼 것의 개수.
53
+ * Counts of what normalization repaired and what was changed to fit the channel.
54
54
  */
55
55
  class Repairs {
56
56
  static __wrap(ptr) {
@@ -70,7 +70,7 @@ class Repairs {
70
70
  wasm.__wbg_repairs_free(ptr, 0);
71
71
  }
72
72
  /**
73
- * 블록이 끝나도록 안 닫혀서 닫아 준 강조.
73
+ * Emphasis left open at the end of a block, closed for you.
74
74
  * @returns {number}
75
75
  */
76
76
  get closedEmphasis() {
@@ -78,7 +78,7 @@ class Repairs {
78
78
  return ret >>> 0;
79
79
  }
80
80
  /**
81
- * 문서 끝까지 안 닫혀서 닫아 준 코드펜스.
81
+ * Code fences left open at the end of the document, closed for you.
82
82
  * @returns {number}
83
83
  */
84
84
  get closedFence() {
@@ -86,7 +86,7 @@ class Repairs {
86
86
  return ret >>> 0;
87
87
  }
88
88
  /**
89
- * 다른 표기로 바꿔 쓴 강조 마커와 `<url|텍스트>` 링크.
89
+ * Emphasis markers and `<url|text>` links rewritten in a different notation.
90
90
  * @returns {number}
91
91
  */
92
92
  get convertedMarker() {
@@ -94,7 +94,7 @@ class Repairs {
94
94
  return ret >>> 0;
95
95
  }
96
96
  /**
97
- * 짝 잃은 채 버린 `**`.
97
+ * Unmatched `**` markers that were dropped.
98
98
  * @returns {number}
99
99
  */
100
100
  get droppedMarker() {
@@ -102,7 +102,7 @@ class Repairs {
102
102
  return ret >>> 0;
103
103
  }
104
104
  /**
105
- * 채널이 구문으로 읽을 글자를 탈출한 수(GitHub 의 `\~`·`\<`·`\*`).
105
+ * Characters escaped because the channel would read them as syntax (GitHub's `\~`, `\<`, `\*`).
106
106
  * @returns {number}
107
107
  */
108
108
  get escapedChar() {
@@ -110,7 +110,7 @@ class Repairs {
110
110
  return ret >>> 0;
111
111
  }
112
112
  /**
113
- * 짝이 없어 글자로 되돌린 백틱 런.
113
+ * Unmatched backtick runs, turned back into literal text.
114
114
  * @returns {number}
115
115
  */
116
116
  get revertedCodeSpan() {
@@ -118,7 +118,7 @@ class Repairs {
118
118
  return ret >>> 0;
119
119
  }
120
120
  /**
121
- * 다른 기호로 바꿔 쓴 목록 불릿.
121
+ * List bullets rewritten with a different symbol.
122
122
  * @returns {number}
123
123
  */
124
124
  get rewrittenBullet() {
@@ -126,7 +126,7 @@ class Repairs {
126
126
  return ret >>> 0;
127
127
  }
128
128
  /**
129
- * 원문과 다른 모양으로 다시 쓴 표.
129
+ * Tables rewritten in a different shape from the source.
130
130
  * @returns {number}
131
131
  */
132
132
  get rewrittenTable() {
@@ -134,7 +134,7 @@ class Repairs {
134
134
  return ret >>> 0;
135
135
  }
136
136
  /**
137
- * 벗긴 원문 HTML(태그·주석·줄바꿈으로 바꾼 `<br>`).
137
+ * Raw HTML stripped from the source (tags, comments, and `<br>` turned into line breaks).
138
138
  * @returns {number}
139
139
  */
140
140
  get strippedHtml() {
@@ -142,7 +142,7 @@ class Repairs {
142
142
  return ret >>> 0;
143
143
  }
144
144
  /**
145
- * 마커 대신 태그로 낸 강조(GitHub 의 `<strong>`).
145
+ * Emphasis emitted differently because the channel would not read the marker in that position (GitHub's `<strong>`, Slack's U+2060).
146
146
  * @returns {number}
147
147
  */
148
148
  get tagEmphasis() {
@@ -150,70 +150,70 @@ class Repairs {
150
150
  return ret >>> 0;
151
151
  }
152
152
  /**
153
- * 블록이 끝나도록 안 닫혀서 닫아 준 강조.
153
+ * Emphasis left open at the end of a block, closed for you.
154
154
  * @param {number} arg0
155
155
  */
156
156
  set closedEmphasis(arg0) {
157
157
  wasm.__wbg_set_repairs_closedEmphasis(this.__wbg_ptr, arg0);
158
158
  }
159
159
  /**
160
- * 문서 끝까지 안 닫혀서 닫아 준 코드펜스.
160
+ * Code fences left open at the end of the document, closed for you.
161
161
  * @param {number} arg0
162
162
  */
163
163
  set closedFence(arg0) {
164
164
  wasm.__wbg_set_repairs_closedFence(this.__wbg_ptr, arg0);
165
165
  }
166
166
  /**
167
- * 다른 표기로 바꿔 쓴 강조 마커와 `<url|텍스트>` 링크.
167
+ * Emphasis markers and `<url|text>` links rewritten in a different notation.
168
168
  * @param {number} arg0
169
169
  */
170
170
  set convertedMarker(arg0) {
171
171
  wasm.__wbg_set_repairs_convertedMarker(this.__wbg_ptr, arg0);
172
172
  }
173
173
  /**
174
- * 짝 잃은 채 버린 `**`.
174
+ * Unmatched `**` markers that were dropped.
175
175
  * @param {number} arg0
176
176
  */
177
177
  set droppedMarker(arg0) {
178
178
  wasm.__wbg_set_repairs_droppedMarker(this.__wbg_ptr, arg0);
179
179
  }
180
180
  /**
181
- * 채널이 구문으로 읽을 글자를 탈출한 수(GitHub 의 `\~`·`\<`·`\*`).
181
+ * Characters escaped because the channel would read them as syntax (GitHub's `\~`, `\<`, `\*`).
182
182
  * @param {number} arg0
183
183
  */
184
184
  set escapedChar(arg0) {
185
185
  wasm.__wbg_set_repairs_escapedChar(this.__wbg_ptr, arg0);
186
186
  }
187
187
  /**
188
- * 짝이 없어 글자로 되돌린 백틱 런.
188
+ * Unmatched backtick runs, turned back into literal text.
189
189
  * @param {number} arg0
190
190
  */
191
191
  set revertedCodeSpan(arg0) {
192
192
  wasm.__wbg_set_repairs_revertedCodeSpan(this.__wbg_ptr, arg0);
193
193
  }
194
194
  /**
195
- * 다른 기호로 바꿔 쓴 목록 불릿.
195
+ * List bullets rewritten with a different symbol.
196
196
  * @param {number} arg0
197
197
  */
198
198
  set rewrittenBullet(arg0) {
199
199
  wasm.__wbg_set_repairs_rewrittenBullet(this.__wbg_ptr, arg0);
200
200
  }
201
201
  /**
202
- * 원문과 다른 모양으로 다시 쓴 표.
202
+ * Tables rewritten in a different shape from the source.
203
203
  * @param {number} arg0
204
204
  */
205
205
  set rewrittenTable(arg0) {
206
206
  wasm.__wbg_set_repairs_rewrittenTable(this.__wbg_ptr, arg0);
207
207
  }
208
208
  /**
209
- * 벗긴 원문 HTML(태그·주석·줄바꿈으로 바꾼 `<br>`).
209
+ * Raw HTML stripped from the source (tags, comments, and `<br>` turned into line breaks).
210
210
  * @param {number} arg0
211
211
  */
212
212
  set strippedHtml(arg0) {
213
213
  wasm.__wbg_set_repairs_strippedHtml(this.__wbg_ptr, arg0);
214
214
  }
215
215
  /**
216
- * 마커 대신 태그로 낸 강조(GitHub 의 `<strong>`).
216
+ * Emphasis emitted differently because the channel would not read the marker in that position (GitHub's `<strong>`, Slack's U+2060).
217
217
  * @param {number} arg0
218
218
  */
219
219
  set tagEmphasis(arg0) {
@@ -224,10 +224,11 @@ if (Symbol.dispose) Repairs.prototype[Symbol.dispose] = Repairs.prototype.free;
224
224
  exports.Repairs = Repairs;
225
225
 
226
226
  /**
227
- * 스트리밍 변환기.
227
+ * Streaming converter.
228
228
  *
229
- * 조각을 넣으면 지금 안전하게 내보낼 수 있는 만큼만 돌려준다. 경계에 걸린 마크업은
230
- * 안에 남는다 — 토큰이 흘러들어오는 대로 화면에 붙이는 쪽이 이것 때문에 쓴다.
229
+ * Push a chunk and it returns only what is safe to emit now. Markup cut off at the
230
+ * chunk boundary stays inside. This is what you want when appending tokens to the
231
+ * screen as they arrive.
231
232
  */
232
233
  class Streamer {
233
234
  __destroy_into_raw() {
@@ -241,14 +242,15 @@ class Streamer {
241
242
  wasm.__wbg_streamer_free(ptr, 0);
242
243
  }
243
244
  /**
244
- * **지금까지 받은 것을 그대로 보내려면 이걸 뒤에 붙인다.**
245
+ * **To send what you have received so far as is, append this after it.**
245
246
  *
246
- * 상태는 건드리지 않으므로 붙인 뒤에도 스트리밍은 이어진다. 누적본 자체에는
247
- * 넣지 말고, 보내기 직전에만 붙인다. 토큰이 오는 대로 메시지를 편집하는 쪽이 쓴다.
247
+ * It does not touch the state, so streaming continues afterwards. Do not add it
248
+ * to the accumulated output itself; append it only right before sending. Use it
249
+ * when editing a message as tokens arrive.
248
250
  *
249
251
  * ```js
250
252
  * acc += s.push(chunk);
251
- * await edit(acc + s.closeOpen()); // 누적본은 그대로 둔다
253
+ * await edit(acc + s.closeOpen()); // leave acc unchanged
252
254
  * ```
253
255
  * @returns {string}
254
256
  */
@@ -269,7 +271,7 @@ class Streamer {
269
271
  }
270
272
  }
271
273
  /**
272
- * 입력이 끝났다. 남은 것을 내보내고 열린 마크업을 닫는다.
274
+ * Input has ended. Emits what is left and closes open markup.
273
275
  * @returns {string}
274
276
  */
275
277
  finish() {
@@ -312,15 +314,16 @@ class Streamer {
312
314
  }
313
315
  }
314
316
  /**
315
- * **지금 입력이 끝났다면 확정분 뒤에 붙을 꼬리.** `closeOpen` 과 같은 자리에 들어가지만
316
- * 붙들고 있던 것(열린 강조, 표 행, 코드 스팬)까지 그린다. 누적본을 통째로 다시 그리는 쪽의
317
- * 기본값이다. 추측이라 뒤 조각이 모양을 바꿀 수 있다 — 끝난 뒤 `revised()` 로 본다.
317
+ * **The tail that would follow the final output if input ended now.** It goes in the
318
+ * same place as `closeOpen`, but also draws what is being held back (open emphasis,
319
+ * table rows, code spans). This is the default when you redraw the whole message.
320
+ * It is a guess, so later chunks may change the shape. Check `revised()` after the end.
318
321
  *
319
322
  * ```js
320
323
  * acc += s.push(chunk);
321
- * await edit(acc + s.preview()); // 화면을 그릴 때만 부른다(열린 블록만큼 든다)
324
+ * await edit(acc + s.preview()); // call only when drawing (costs as much as the open block)
322
325
  * acc += s.finish();
323
- * if (s.revised()) await edit(acc); // 마지막 화면이 곧 완성본이면 건너뛴다
326
+ * if (s.revised()) await edit(acc); // skip if the last screen already is the final output
324
327
  * ```
325
328
  * @returns {string}
326
329
  */
@@ -363,7 +366,7 @@ class Streamer {
363
366
  }
364
367
  }
365
368
  /**
366
- * 지금까지 정규화가 고친 것. `finish` 뒤에 보면 문서 전체의 값이다.
369
+ * What normalization has repaired so far. After `finish`, this covers the whole document.
367
370
  * @returns {Repairs}
368
371
  */
369
372
  repairs() {
@@ -371,7 +374,7 @@ class Streamer {
371
374
  return Repairs.__wrap(ret);
372
375
  }
373
376
  /**
374
- * 완성본이 마지막 `preview()` 와 다른가 — `finish` 뒤에 본다.
377
+ * Whether the final output differs from the last `preview()`. Check it after `finish`.
375
378
  * @returns {boolean}
376
379
  */
377
380
  revised() {
@@ -383,7 +386,7 @@ if (Symbol.dispose) Streamer.prototype[Symbol.dispose] = Streamer.prototype.free
383
386
  exports.Streamer = Streamer;
384
387
 
385
388
  /**
386
- * 채널의 길이 한도(문자 수). 조각을 직접 다루려는 호출자를 위해 열어 둔다.
389
+ * The channel's length limit (in characters). Exposed for callers that handle parts themselves.
387
390
  * @param {string} channel
388
391
  * @returns {number}
389
392
  */
@@ -407,7 +410,7 @@ function limit(channel) {
407
410
  exports.limit = limit;
408
411
 
409
412
  /**
410
- * 완성된 문서를 변환한다. 한도를 넘으면 조각 배열로 돌아온다.
413
+ * Converts a complete document. Returns an array of parts; it has more than one when the text exceeds the limit.
411
414
  * @param {string} input
412
415
  * @param {string} channel
413
416
  * @param {RenderOptions | null} [options]
@@ -438,8 +441,8 @@ function render(input, channel, options) {
438
441
  exports.render = render;
439
442
 
440
443
  /**
441
- * [`render`] 에 **정규화가 고친 것**을 같이 돌려준다. 모델이 얼마나 자주 서식을 깨는지
442
- * 로그로 남기려는 쪽이 쓴다.
444
+ * Like [`render`], but also returns **what normalization repaired**. Use it to log
445
+ * how often the model breaks formatting.
443
446
  * @param {string} input
444
447
  * @param {string} channel
445
448
  * @param {RenderOptions | null} [options]
@@ -483,37 +486,30 @@ function __wbg_get_imports() {
483
486
  __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
484
487
  throw new Error(getStringFromWasm0(arg0, arg1));
485
488
  },
486
- __wbg_from_6a18a824ab73bfc5: function(arg0, arg1) {
487
- const ret = getObject(arg1).from;
488
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
489
- var len1 = WASM_VECTOR_LEN;
490
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
491
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
492
- },
493
- __wbg_html_a628fe022a5daeaf: function(arg0) {
489
+ __wbg_html_89b49615556b2850: function(arg0) {
494
490
  const ret = getObject(arg0).html;
495
491
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
496
492
  },
497
- __wbg_images_ff5cc833afad2dcf: function(arg0, arg1) {
493
+ __wbg_images_fc88426d1f55bdfc: function(arg0, arg1) {
498
494
  const ret = getObject(arg1).images;
499
495
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
500
496
  var len1 = WASM_VECTOR_LEN;
501
497
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
502
498
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
503
499
  },
504
- __wbg_limit_cce570f9381001ea: function(arg0, arg1) {
500
+ __wbg_limit_d1453e73fbf788db: function(arg0, arg1) {
505
501
  const ret = getObject(arg1).limit;
506
502
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
507
503
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
508
504
  },
509
- __wbg_lineBreaks_aa928a165d0a7659: function(arg0, arg1) {
505
+ __wbg_lineBreaks_8b98689e9716a2c8: function(arg0, arg1) {
510
506
  const ret = getObject(arg1).lineBreaks;
511
507
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
512
508
  var len1 = WASM_VECTOR_LEN;
513
509
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
514
510
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
515
511
  },
516
- __wbg_schemes_429ccca2fff29ed9: function(arg0, arg1) {
512
+ __wbg_schemes_8e39175723a07726: function(arg0, arg1) {
517
513
  const ret = getObject(arg1).schemes;
518
514
  var ptr1 = isLikeNone(ret) ? 0 : passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
519
515
  var len1 = WASM_VECTOR_LEN;
Binary file
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@minjun0219/mdwire",
3
- "version": "0.1.9",
4
- "description": "Streaming Markdown renderer for chat channels and the browser. Telegram HTML, Slack markdown_text, GitHub, HTML, React.",
3
+ "version": "0.1.11",
4
+ "description": "Send LLM-generated Markdown to Telegram, Slack, GitHub and Notion without it breaking: repaired, rendered for each channel and split within its limit, streaming included. Also safe HTML and React.",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "https://github.com/minjun0219/mdwire" },
7
7
  "homepage": "https://mdwire.minjun.dev",
8
- "keywords": ["markdown", "telegram", "slack", "github", "react", "streaming", "llm", "wasm"],
8
+ "keywords": ["markdown", "llm", "ai", "agent", "chatbot", "telegram", "telegram-bot", "slack", "slack-bot", "github", "notion", "react", "streaming", "wasm"],
9
9
  "type": "module",
10
10
  "main": "./node/mdwire.js",
11
11
  "types": "./bundler/mdwire.d.ts",