@opencode-ai/ui 0.0.0-dev-202608040358 → 0.0.0-dev-202608040433

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,2 @@
1
+ import { Marked } from "marked";
2
+ export declare function createMarkdownParser(highlight: (code: string, language: string) => string | Promise<string>): Marked<string, string>;
@@ -0,0 +1 @@
1
+ export declare function registerOpenCodeTheme(): void;
@@ -0,0 +1,2 @@
1
+ import type { ThemeRegistrationResolved } from "@pierre/diffs";
2
+ export declare const OpenCodeTheme: ThemeRegistrationResolved;
@@ -1,9 +1,2 @@
1
- import { marked } from "marked";
2
- import { ThemeRegistrationResolved } from "@pierre/diffs";
3
- export declare const OpenCodeTheme: ThemeRegistrationResolved;
4
- export type NativeMarkdownParser = (markdown: string) => Promise<string>;
5
- export declare const useMarked: () => NonNullable<typeof marked | {
6
- parse(markdown: string): Promise<string>;
7
- }>, MarkedProvider: (props: import("solid-js").ParentProps<{
8
- nativeParser?: NativeMarkdownParser;
9
- }>) => import("solid-js").JSX.Element;
1
+ export { OpenCodeTheme } from "./marked-theme";
2
+ export declare const useMarked: () => import("marked").Marked<string, string>, MarkedProvider: (props: import("solid-js").ParentProps<Record<string, any>>) => import("solid-js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode-ai/ui",
3
- "version": "0.0.0-dev-202608040358",
3
+ "version": "0.0.0-dev-202608040433",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -135,8 +135,7 @@
135
135
  "fuzzysort": "3.1.0",
136
136
  "katex": "0.16.27",
137
137
  "luxon": "3.6.1",
138
- "marked": "17.0.6",
139
- "marked-katex-extension": "5.1.6",
138
+ "marked": "18.0.7",
140
139
  "marked-shiki": "1.2.1",
141
140
  "morphdom": "2.7.8",
142
141
  "motion": "12.34.5",
@@ -0,0 +1,68 @@
1
+ import katex from "katex"
2
+ import { Marked, type MarkedExtension, type Tokens } from "marked"
3
+ import markedShiki from "marked-shiki"
4
+
5
+ export function createMarkdownParser(highlight: (code: string, language: string) => string | Promise<string>) {
6
+ return new Marked(
7
+ {
8
+ renderer: {
9
+ link({ href, title, text }) {
10
+ const titleAttr = title ? ` title="${title}"` : ""
11
+ return `<a href="${href}"${titleAttr} class="external-link" target="_blank" rel="noopener noreferrer">${text}</a>`
12
+ },
13
+ },
14
+ },
15
+ katexExtension,
16
+ markedShiki({ highlight }),
17
+ )
18
+ }
19
+
20
+ const inlineMathRegex = /^\\\(((?:\\.|[^\\\n])*?)\\\)/
21
+ const blockMathRegex = /^\$\$\n([\s\S]+?)\n\$\$(?:\n|$)/
22
+
23
+ const katexExtension: MarkedExtension = {
24
+ extensions: [
25
+ {
26
+ name: "inlineKatex",
27
+ level: "inline",
28
+ start(src) {
29
+ const index = src.indexOf("\\(")
30
+ if (index === -1) return
31
+ return index
32
+ },
33
+ tokenizer(src) {
34
+ const match = src.match(inlineMathRegex)
35
+ if (!match) return
36
+ return {
37
+ type: "inlineKatex",
38
+ raw: match[0],
39
+ text: match[1].trim(),
40
+ displayMode: false,
41
+ }
42
+ },
43
+ renderer: renderKatexToken,
44
+ },
45
+ {
46
+ name: "blockKatex",
47
+ level: "block",
48
+ tokenizer(src) {
49
+ const match = src.match(blockMathRegex)
50
+ if (!match) return
51
+ return {
52
+ type: "blockKatex",
53
+ raw: match[0],
54
+ text: match[1].trim(),
55
+ displayMode: true,
56
+ }
57
+ },
58
+ renderer: renderKatexToken,
59
+ },
60
+ ],
61
+ }
62
+
63
+ function renderKatexToken(token: Tokens.Generic) {
64
+ return katex.renderToString(typeof token.text === "string" ? token.text : "", {
65
+ displayMode: token.displayMode === true,
66
+ throwOnError: false,
67
+ })
68
+ }
@@ -0,0 +1,10 @@
1
+ import { registerCustomTheme } from "@pierre/diffs"
2
+ import { OpenCodeTheme } from "./marked-theme"
3
+
4
+ let registered = false
5
+
6
+ export function registerOpenCodeTheme() {
7
+ if (registered) return
8
+ registered = true
9
+ registerCustomTheme("OpenCode", () => Promise.resolve(OpenCodeTheme))
10
+ }
@@ -0,0 +1,372 @@
1
+ import type { ThemeRegistrationResolved } from "@pierre/diffs"
2
+
3
+ export const OpenCodeTheme = {
4
+ name: "OpenCode",
5
+ bg: "var(--color-background-stronger)",
6
+ fg: "var(--text-base)",
7
+ colors: {
8
+ "editor.background": "var(--color-background-stronger)",
9
+ "editor.foreground": "var(--text-base)",
10
+ "gitDecoration.addedResourceForeground": "var(--syntax-diff-add)",
11
+ "gitDecoration.deletedResourceForeground": "var(--syntax-diff-delete)",
12
+ "gitDecoration.modifiedResourceForeground": "var(--syntax-diff-unknown)",
13
+ // "gitDecoration.conflictingResourceForeground": "#ffca00",
14
+ // "gitDecoration.modifiedResourceForeground": "#1a76d4",
15
+ // "gitDecoration.untrackedResourceForeground": "#00cab1",
16
+ // "gitDecoration.ignoredResourceForeground": "#84848A",
17
+ // "terminal.titleForeground": "#adadb1",
18
+ // "terminal.titleInactiveForeground": "#84848A",
19
+ // "terminal.background": "#141415",
20
+ // "terminal.foreground": "#adadb1",
21
+ // "terminal.ansiBlack": "#141415",
22
+ // "terminal.ansiRed": "#ff2e3f",
23
+ // "terminal.ansiGreen": "#0dbe4e",
24
+ // "terminal.ansiYellow": "#ffca00",
25
+ // "terminal.ansiBlue": "#008cff",
26
+ // "terminal.ansiMagenta": "#c635e4",
27
+ // "terminal.ansiCyan": "#08c0ef",
28
+ // "terminal.ansiWhite": "#c6c6c8",
29
+ // "terminal.ansiBrightBlack": "#141415",
30
+ // "terminal.ansiBrightRed": "#ff2e3f",
31
+ // "terminal.ansiBrightGreen": "#0dbe4e",
32
+ // "terminal.ansiBrightYellow": "#ffca00",
33
+ // "terminal.ansiBrightBlue": "#008cff",
34
+ // "terminal.ansiBrightMagenta": "#c635e4",
35
+ // "terminal.ansiBrightCyan": "#08c0ef",
36
+ // "terminal.ansiBrightWhite": "#c6c6c8",
37
+ },
38
+ tokenColors: [
39
+ {
40
+ scope: ["comment", "punctuation.definition.comment", "string.comment"],
41
+ settings: {
42
+ foreground: "var(--syntax-comment)",
43
+ },
44
+ },
45
+ {
46
+ scope: ["entity.other.attribute-name"],
47
+ settings: {
48
+ foreground: "var(--syntax-property)", // maybe attribute
49
+ },
50
+ },
51
+ {
52
+ scope: ["constant", "entity.name.constant", "variable.other.constant", "variable.language", "entity"],
53
+ settings: {
54
+ foreground: "var(--syntax-constant)",
55
+ },
56
+ },
57
+ {
58
+ scope: ["entity.name", "meta.export.default", "meta.definition.variable"],
59
+ settings: {
60
+ foreground: "var(--syntax-type)",
61
+ },
62
+ },
63
+ {
64
+ scope: ["meta.object.member"],
65
+ settings: {
66
+ foreground: "var(--syntax-primitive)",
67
+ },
68
+ },
69
+ {
70
+ scope: [
71
+ "variable.parameter.function",
72
+ "meta.jsx.children",
73
+ "meta.block",
74
+ "meta.tag.attributes",
75
+ "entity.name.constant",
76
+ "meta.embedded.expression",
77
+ "meta.template.expression",
78
+ "string.other.begin.yaml",
79
+ "string.other.end.yaml",
80
+ ],
81
+ settings: {
82
+ foreground: "var(--syntax-punctuation)",
83
+ },
84
+ },
85
+ {
86
+ scope: ["entity.name.function", "support.type.primitive"],
87
+ settings: {
88
+ foreground: "var(--syntax-primitive)",
89
+ },
90
+ },
91
+ {
92
+ scope: ["support.class.component"],
93
+ settings: {
94
+ foreground: "var(--syntax-type)",
95
+ },
96
+ },
97
+ {
98
+ scope: "keyword",
99
+ settings: {
100
+ foreground: "var(--syntax-keyword)",
101
+ },
102
+ },
103
+ {
104
+ scope: [
105
+ "keyword.operator",
106
+ "storage.type.function.arrow",
107
+ "punctuation.separator.key-value.css",
108
+ "entity.name.tag.yaml",
109
+ "punctuation.separator.key-value.mapping.yaml",
110
+ ],
111
+ settings: {
112
+ foreground: "var(--syntax-operator)",
113
+ },
114
+ },
115
+ {
116
+ scope: ["storage", "storage.type"],
117
+ settings: {
118
+ foreground: "var(--syntax-keyword)",
119
+ },
120
+ },
121
+ {
122
+ scope: ["storage.modifier.package", "storage.modifier.import", "storage.type.java"],
123
+ settings: {
124
+ foreground: "var(--syntax-primitive)",
125
+ },
126
+ },
127
+ {
128
+ scope: [
129
+ "string",
130
+ "punctuation.definition.string",
131
+ "string punctuation.section.embedded source",
132
+ "entity.name.tag",
133
+ ],
134
+ settings: {
135
+ foreground: "var(--syntax-string)",
136
+ },
137
+ },
138
+ {
139
+ scope: "support",
140
+ settings: {
141
+ foreground: "var(--syntax-primitive)",
142
+ },
143
+ },
144
+ {
145
+ scope: ["support.type.object.module", "variable.other.object", "support.type.property-name.css"],
146
+ settings: {
147
+ foreground: "var(--syntax-object)",
148
+ },
149
+ },
150
+ {
151
+ scope: "meta.property-name",
152
+ settings: {
153
+ foreground: "var(--syntax-property)",
154
+ },
155
+ },
156
+ {
157
+ scope: "variable",
158
+ settings: {
159
+ foreground: "var(--syntax-variable)",
160
+ },
161
+ },
162
+ {
163
+ scope: "variable.other",
164
+ settings: {
165
+ foreground: "var(--syntax-variable)",
166
+ },
167
+ },
168
+ {
169
+ scope: [
170
+ "invalid.broken",
171
+ "invalid.illegal",
172
+ "invalid.unimplemented",
173
+ "invalid.deprecated",
174
+ "message.error",
175
+ "markup.deleted",
176
+ "meta.diff.header.from-file",
177
+ "punctuation.definition.deleted",
178
+ "brackethighlighter.unmatched",
179
+ "token.error-token",
180
+ ],
181
+ settings: {
182
+ foreground: "var(--syntax-critical)",
183
+ },
184
+ },
185
+ {
186
+ scope: "carriage-return",
187
+ settings: {
188
+ foreground: "var(--syntax-keyword)",
189
+ },
190
+ },
191
+ {
192
+ scope: "string source",
193
+ settings: {
194
+ foreground: "var(--syntax-variable)",
195
+ },
196
+ },
197
+ {
198
+ scope: "string variable",
199
+ settings: {
200
+ foreground: "var(--syntax-constant)",
201
+ },
202
+ },
203
+ {
204
+ scope: [
205
+ "source.regexp",
206
+ "string.regexp",
207
+ "string.regexp.character-class",
208
+ "string.regexp constant.character.escape",
209
+ "string.regexp source.ruby.embedded",
210
+ "string.regexp string.regexp.arbitrary-repitition",
211
+ "string.regexp constant.character.escape",
212
+ ],
213
+ settings: {
214
+ foreground: "var(--syntax-regexp)",
215
+ },
216
+ },
217
+ {
218
+ scope: "support.constant",
219
+ settings: {
220
+ foreground: "var(--syntax-primitive)",
221
+ },
222
+ },
223
+ {
224
+ scope: "support.variable",
225
+ settings: {
226
+ foreground: "var(--syntax-variable)",
227
+ },
228
+ },
229
+ {
230
+ scope: "meta.module-reference",
231
+ settings: {
232
+ foreground: "var(--syntax-info)",
233
+ },
234
+ },
235
+ {
236
+ scope: "punctuation.definition.list.begin.markdown",
237
+ settings: {
238
+ foreground: "var(--syntax-punctuation)",
239
+ },
240
+ },
241
+ {
242
+ scope: ["markup.heading", "markup.heading entity.name"],
243
+ settings: {
244
+ fontStyle: "bold",
245
+ foreground: "var(--syntax-info)",
246
+ },
247
+ },
248
+ {
249
+ scope: "markup.quote",
250
+ settings: {
251
+ foreground: "var(--syntax-info)",
252
+ },
253
+ },
254
+ {
255
+ scope: "markup.italic",
256
+ settings: {
257
+ fontStyle: "italic",
258
+ // foreground: "",
259
+ },
260
+ },
261
+ {
262
+ scope: "markup.bold",
263
+ settings: {
264
+ fontStyle: "bold",
265
+ foreground: "var(--text-strong)",
266
+ },
267
+ },
268
+ {
269
+ scope: [
270
+ "markup.raw",
271
+ "markup.inserted",
272
+ "meta.diff.header.to-file",
273
+ "punctuation.definition.inserted",
274
+ "markup.changed",
275
+ "punctuation.definition.changed",
276
+ "markup.ignored",
277
+ "markup.untracked",
278
+ ],
279
+ settings: {
280
+ foreground: "var(--text-base)",
281
+ },
282
+ },
283
+ {
284
+ scope: "meta.diff.range",
285
+ settings: {
286
+ fontStyle: "bold",
287
+ foreground: "var(--syntax-unknown)",
288
+ },
289
+ },
290
+ {
291
+ scope: "meta.diff.header",
292
+ settings: {
293
+ foreground: "var(--syntax-unknown)",
294
+ },
295
+ },
296
+ {
297
+ scope: "meta.separator",
298
+ settings: {
299
+ fontStyle: "bold",
300
+ foreground: "var(--syntax-unknown)",
301
+ },
302
+ },
303
+ {
304
+ scope: "meta.output",
305
+ settings: {
306
+ foreground: "var(--syntax-unknown)",
307
+ },
308
+ },
309
+ {
310
+ scope: "meta.export.default",
311
+ settings: {
312
+ foreground: "var(--syntax-unknown)",
313
+ },
314
+ },
315
+ {
316
+ scope: [
317
+ "brackethighlighter.tag",
318
+ "brackethighlighter.curly",
319
+ "brackethighlighter.round",
320
+ "brackethighlighter.square",
321
+ "brackethighlighter.angle",
322
+ "brackethighlighter.quote",
323
+ ],
324
+ settings: {
325
+ foreground: "var(--syntax-unknown)",
326
+ },
327
+ },
328
+ {
329
+ scope: ["constant.other.reference.link", "string.other.link"],
330
+ settings: {
331
+ fontStyle: "underline",
332
+ foreground: "var(--syntax-unknown)",
333
+ },
334
+ },
335
+ {
336
+ scope: "token.info-token",
337
+ settings: {
338
+ foreground: "var(--syntax-info)",
339
+ },
340
+ },
341
+ {
342
+ scope: "token.warn-token",
343
+ settings: {
344
+ foreground: "var(--syntax-warning)",
345
+ },
346
+ },
347
+ {
348
+ scope: "token.debug-token",
349
+ settings: {
350
+ foreground: "var(--syntax-info)",
351
+ },
352
+ },
353
+ ],
354
+ semanticTokenColors: {
355
+ comment: "var(--syntax-comment)",
356
+ string: "var(--syntax-string)",
357
+ number: "var(--syntax-constant)",
358
+ regexp: "var(--syntax-regexp)",
359
+ keyword: "var(--syntax-keyword)",
360
+ variable: "var(--syntax-variable)",
361
+ parameter: "var(--syntax-variable)",
362
+ property: "var(--syntax-property)",
363
+ function: "var(--syntax-primitive)",
364
+ method: "var(--syntax-primitive)",
365
+ type: "var(--syntax-type)",
366
+ class: "var(--syntax-type)",
367
+ namespace: "var(--syntax-type)",
368
+ enumMember: "var(--syntax-primitive)",
369
+ "variable.constant": "var(--syntax-constant)",
370
+ "variable.defaultLibrary": "var(--syntax-unknown)",
371
+ },
372
+ } as unknown as ThemeRegistrationResolved
@@ -1,570 +1,28 @@
1
- import { marked, type MarkedExtension, type Tokens } from "marked"
2
- import markedShiki from "marked-shiki"
3
- import katex from "katex"
1
+ import { getSharedHighlighter } from "@pierre/diffs"
4
2
  import { bundledLanguages, type BundledLanguage } from "shiki"
5
3
  import { createSimpleContext } from "./helper"
6
- import { markedCodeSpanBoundary } from "./marked-code-span"
7
- import { getSharedHighlighter, registerCustomTheme, ThemeRegistrationResolved } from "@pierre/diffs"
4
+ import { createMarkdownParser } from "./marked-parser"
5
+ import { registerOpenCodeTheme } from "./marked-theme-register"
8
6
 
9
- export const OpenCodeTheme = {
10
- name: "OpenCode",
11
- bg: "var(--color-background-stronger)",
12
- fg: "var(--text-base)",
13
- colors: {
14
- "editor.background": "var(--color-background-stronger)",
15
- "editor.foreground": "var(--text-base)",
16
- "gitDecoration.addedResourceForeground": "var(--syntax-diff-add)",
17
- "gitDecoration.deletedResourceForeground": "var(--syntax-diff-delete)",
18
- "gitDecoration.modifiedResourceForeground": "var(--syntax-diff-unknown)",
19
- // "gitDecoration.conflictingResourceForeground": "#ffca00",
20
- // "gitDecoration.modifiedResourceForeground": "#1a76d4",
21
- // "gitDecoration.untrackedResourceForeground": "#00cab1",
22
- // "gitDecoration.ignoredResourceForeground": "#84848A",
23
- // "terminal.titleForeground": "#adadb1",
24
- // "terminal.titleInactiveForeground": "#84848A",
25
- // "terminal.background": "#141415",
26
- // "terminal.foreground": "#adadb1",
27
- // "terminal.ansiBlack": "#141415",
28
- // "terminal.ansiRed": "#ff2e3f",
29
- // "terminal.ansiGreen": "#0dbe4e",
30
- // "terminal.ansiYellow": "#ffca00",
31
- // "terminal.ansiBlue": "#008cff",
32
- // "terminal.ansiMagenta": "#c635e4",
33
- // "terminal.ansiCyan": "#08c0ef",
34
- // "terminal.ansiWhite": "#c6c6c8",
35
- // "terminal.ansiBrightBlack": "#141415",
36
- // "terminal.ansiBrightRed": "#ff2e3f",
37
- // "terminal.ansiBrightGreen": "#0dbe4e",
38
- // "terminal.ansiBrightYellow": "#ffca00",
39
- // "terminal.ansiBrightBlue": "#008cff",
40
- // "terminal.ansiBrightMagenta": "#c635e4",
41
- // "terminal.ansiBrightCyan": "#08c0ef",
42
- // "terminal.ansiBrightWhite": "#c6c6c8",
43
- },
44
- tokenColors: [
45
- {
46
- scope: ["comment", "punctuation.definition.comment", "string.comment"],
47
- settings: {
48
- foreground: "var(--syntax-comment)",
49
- },
50
- },
51
- {
52
- scope: ["entity.other.attribute-name"],
53
- settings: {
54
- foreground: "var(--syntax-property)", // maybe attribute
55
- },
56
- },
57
- {
58
- scope: ["constant", "entity.name.constant", "variable.other.constant", "variable.language", "entity"],
59
- settings: {
60
- foreground: "var(--syntax-constant)",
61
- },
62
- },
63
- {
64
- scope: ["entity.name", "meta.export.default", "meta.definition.variable"],
65
- settings: {
66
- foreground: "var(--syntax-type)",
67
- },
68
- },
69
- {
70
- scope: ["meta.object.member"],
71
- settings: {
72
- foreground: "var(--syntax-primitive)",
73
- },
74
- },
75
- {
76
- scope: [
77
- "variable.parameter.function",
78
- "meta.jsx.children",
79
- "meta.block",
80
- "meta.tag.attributes",
81
- "entity.name.constant",
82
- "meta.embedded.expression",
83
- "meta.template.expression",
84
- "string.other.begin.yaml",
85
- "string.other.end.yaml",
86
- ],
87
- settings: {
88
- foreground: "var(--syntax-punctuation)",
89
- },
90
- },
91
- {
92
- scope: ["entity.name.function", "support.type.primitive"],
93
- settings: {
94
- foreground: "var(--syntax-primitive)",
95
- },
96
- },
97
- {
98
- scope: ["support.class.component"],
99
- settings: {
100
- foreground: "var(--syntax-type)",
101
- },
102
- },
103
- {
104
- scope: "keyword",
105
- settings: {
106
- foreground: "var(--syntax-keyword)",
107
- },
108
- },
109
- {
110
- scope: [
111
- "keyword.operator",
112
- "storage.type.function.arrow",
113
- "punctuation.separator.key-value.css",
114
- "entity.name.tag.yaml",
115
- "punctuation.separator.key-value.mapping.yaml",
116
- ],
117
- settings: {
118
- foreground: "var(--syntax-operator)",
119
- },
120
- },
121
- {
122
- scope: ["storage", "storage.type"],
123
- settings: {
124
- foreground: "var(--syntax-keyword)",
125
- },
126
- },
127
- {
128
- scope: ["storage.modifier.package", "storage.modifier.import", "storage.type.java"],
129
- settings: {
130
- foreground: "var(--syntax-primitive)",
131
- },
132
- },
133
- {
134
- scope: [
135
- "string",
136
- "punctuation.definition.string",
137
- "string punctuation.section.embedded source",
138
- "entity.name.tag",
139
- ],
140
- settings: {
141
- foreground: "var(--syntax-string)",
142
- },
143
- },
144
- {
145
- scope: "support",
146
- settings: {
147
- foreground: "var(--syntax-primitive)",
148
- },
149
- },
150
- {
151
- scope: ["support.type.object.module", "variable.other.object", "support.type.property-name.css"],
152
- settings: {
153
- foreground: "var(--syntax-object)",
154
- },
155
- },
156
- {
157
- scope: "meta.property-name",
158
- settings: {
159
- foreground: "var(--syntax-property)",
160
- },
161
- },
162
- {
163
- scope: "variable",
164
- settings: {
165
- foreground: "var(--syntax-variable)",
166
- },
167
- },
168
- {
169
- scope: "variable.other",
170
- settings: {
171
- foreground: "var(--syntax-variable)",
172
- },
173
- },
174
- {
175
- scope: [
176
- "invalid.broken",
177
- "invalid.illegal",
178
- "invalid.unimplemented",
179
- "invalid.deprecated",
180
- "message.error",
181
- "markup.deleted",
182
- "meta.diff.header.from-file",
183
- "punctuation.definition.deleted",
184
- "brackethighlighter.unmatched",
185
- "token.error-token",
186
- ],
187
- settings: {
188
- foreground: "var(--syntax-critical)",
189
- },
190
- },
191
- {
192
- scope: "carriage-return",
193
- settings: {
194
- foreground: "var(--syntax-keyword)",
195
- },
196
- },
197
- {
198
- scope: "string source",
199
- settings: {
200
- foreground: "var(--syntax-variable)",
201
- },
202
- },
203
- {
204
- scope: "string variable",
205
- settings: {
206
- foreground: "var(--syntax-constant)",
207
- },
208
- },
209
- {
210
- scope: [
211
- "source.regexp",
212
- "string.regexp",
213
- "string.regexp.character-class",
214
- "string.regexp constant.character.escape",
215
- "string.regexp source.ruby.embedded",
216
- "string.regexp string.regexp.arbitrary-repitition",
217
- "string.regexp constant.character.escape",
218
- ],
219
- settings: {
220
- foreground: "var(--syntax-regexp)",
221
- },
222
- },
223
- {
224
- scope: "support.constant",
225
- settings: {
226
- foreground: "var(--syntax-primitive)",
227
- },
228
- },
229
- {
230
- scope: "support.variable",
231
- settings: {
232
- foreground: "var(--syntax-variable)",
233
- },
234
- },
235
- {
236
- scope: "meta.module-reference",
237
- settings: {
238
- foreground: "var(--syntax-info)",
239
- },
240
- },
241
- {
242
- scope: "punctuation.definition.list.begin.markdown",
243
- settings: {
244
- foreground: "var(--syntax-punctuation)",
245
- },
246
- },
247
- {
248
- scope: ["markup.heading", "markup.heading entity.name"],
249
- settings: {
250
- fontStyle: "bold",
251
- foreground: "var(--syntax-info)",
252
- },
253
- },
254
- {
255
- scope: "markup.quote",
256
- settings: {
257
- foreground: "var(--syntax-info)",
258
- },
259
- },
260
- {
261
- scope: "markup.italic",
262
- settings: {
263
- fontStyle: "italic",
264
- // foreground: "",
265
- },
266
- },
267
- {
268
- scope: "markup.bold",
269
- settings: {
270
- fontStyle: "bold",
271
- foreground: "var(--text-strong)",
272
- },
273
- },
274
- {
275
- scope: [
276
- "markup.raw",
277
- "markup.inserted",
278
- "meta.diff.header.to-file",
279
- "punctuation.definition.inserted",
280
- "markup.changed",
281
- "punctuation.definition.changed",
282
- "markup.ignored",
283
- "markup.untracked",
284
- ],
285
- settings: {
286
- foreground: "var(--text-base)",
287
- },
288
- },
289
- {
290
- scope: "meta.diff.range",
291
- settings: {
292
- fontStyle: "bold",
293
- foreground: "var(--syntax-unknown)",
294
- },
295
- },
296
- {
297
- scope: "meta.diff.header",
298
- settings: {
299
- foreground: "var(--syntax-unknown)",
300
- },
301
- },
302
- {
303
- scope: "meta.separator",
304
- settings: {
305
- fontStyle: "bold",
306
- foreground: "var(--syntax-unknown)",
307
- },
308
- },
309
- {
310
- scope: "meta.output",
311
- settings: {
312
- foreground: "var(--syntax-unknown)",
313
- },
314
- },
315
- {
316
- scope: "meta.export.default",
317
- settings: {
318
- foreground: "var(--syntax-unknown)",
319
- },
320
- },
321
- {
322
- scope: [
323
- "brackethighlighter.tag",
324
- "brackethighlighter.curly",
325
- "brackethighlighter.round",
326
- "brackethighlighter.square",
327
- "brackethighlighter.angle",
328
- "brackethighlighter.quote",
329
- ],
330
- settings: {
331
- foreground: "var(--syntax-unknown)",
332
- },
333
- },
334
- {
335
- scope: ["constant.other.reference.link", "string.other.link"],
336
- settings: {
337
- fontStyle: "underline",
338
- foreground: "var(--syntax-unknown)",
339
- },
340
- },
341
- {
342
- scope: "token.info-token",
343
- settings: {
344
- foreground: "var(--syntax-info)",
345
- },
346
- },
347
- {
348
- scope: "token.warn-token",
349
- settings: {
350
- foreground: "var(--syntax-warning)",
351
- },
352
- },
353
- {
354
- scope: "token.debug-token",
355
- settings: {
356
- foreground: "var(--syntax-info)",
357
- },
358
- },
359
- ],
360
- semanticTokenColors: {
361
- comment: "var(--syntax-comment)",
362
- string: "var(--syntax-string)",
363
- number: "var(--syntax-constant)",
364
- regexp: "var(--syntax-regexp)",
365
- keyword: "var(--syntax-keyword)",
366
- variable: "var(--syntax-variable)",
367
- parameter: "var(--syntax-variable)",
368
- property: "var(--syntax-property)",
369
- function: "var(--syntax-primitive)",
370
- method: "var(--syntax-primitive)",
371
- type: "var(--syntax-type)",
372
- class: "var(--syntax-type)",
373
- namespace: "var(--syntax-type)",
374
- enumMember: "var(--syntax-primitive)",
375
- "variable.constant": "var(--syntax-constant)",
376
- "variable.defaultLibrary": "var(--syntax-unknown)",
377
- },
378
- } as unknown as ThemeRegistrationResolved
7
+ export { OpenCodeTheme } from "./marked-theme"
379
8
 
380
- registerCustomTheme("OpenCode", () => Promise.resolve(OpenCodeTheme))
381
-
382
- function renderMathInText(text: string): string {
383
- let result = text
384
-
385
- // Display math: $$...$$
386
- const displayMathRegex = /\$\$([\s\S]*?)\$\$/g
387
- result = result.replace(displayMathRegex, (_, math) => {
388
- try {
389
- return katex.renderToString(math, {
390
- displayMode: true,
391
- throwOnError: false,
392
- })
393
- } catch {
394
- return `$$${math}$$`
395
- }
396
- })
397
-
398
- // Inline math: \(...\)
399
- const inlineMathRegex = /\\\(((?:\\.|[^\\\n])*?)\\\)/g
400
- result = result.replace(inlineMathRegex, (_, math) => {
401
- try {
402
- return katex.renderToString(math, {
403
- displayMode: false,
404
- throwOnError: false,
405
- })
406
- } catch {
407
- return `\\(${math}\\)`
408
- }
409
- })
410
-
411
- return result
412
- }
413
-
414
- const inlineMathRegex = /^\\\(((?:\\.|[^\\\n])*?)\\\)/
415
- const blockMathRegex = /^\$\$\n([\s\S]+?)\n\$\$(?:\n|$)/
416
-
417
- const katexExtension: MarkedExtension = {
418
- extensions: [
419
- {
420
- name: "inlineKatex",
421
- level: "inline",
422
- start(src) {
423
- const index = src.indexOf("\\(")
424
- if (index === -1) return
425
- return index
426
- },
427
- tokenizer(src) {
428
- const match = src.match(inlineMathRegex)
429
- if (!match) return
430
- return {
431
- type: "inlineKatex",
432
- raw: match[0],
433
- text: match[1].trim(),
434
- displayMode: false,
435
- }
436
- },
437
- renderer: renderKatexToken,
438
- },
439
- {
440
- name: "blockKatex",
441
- level: "block",
442
- tokenizer(src) {
443
- const match = src.match(blockMathRegex)
444
- if (!match) return
445
- return {
446
- type: "blockKatex",
447
- raw: match[0],
448
- text: match[1].trim(),
449
- displayMode: true,
450
- }
451
- },
452
- renderer: renderKatexToken,
453
- },
454
- ],
455
- }
456
-
457
- function renderKatexToken(token: Tokens.Generic) {
458
- return katex.renderToString(typeof token.text === "string" ? token.text : "", {
459
- displayMode: token.displayMode === true,
460
- throwOnError: false,
461
- })
462
- }
463
-
464
- function renderMathExpressions(html: string): string {
465
- // Split on code/pre/kbd tags to avoid processing their contents
466
- const codeBlockPattern = /(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi
467
- const parts = html.split(codeBlockPattern)
468
-
469
- return parts
470
- .map((part, i) => {
471
- // Odd indices are the captured code blocks - leave them alone
472
- if (i % 2 === 1) return part
473
- // Process math only in non-code parts
474
- return renderMathInText(part)
475
- })
476
- .join("")
477
- }
478
-
479
- async function highlightCodeBlocks(html: string): Promise<string> {
480
- const codeBlockRegex = /<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g
481
- const matches = [...html.matchAll(codeBlockRegex)]
482
- if (matches.length === 0) return html
483
-
484
- const highlighter = await getSharedHighlighter({
485
- themes: ["OpenCode"],
486
- langs: [],
487
- preferredHighlighter: "shiki-wasm",
488
- })
489
-
490
- let result = html
491
- for (const match of matches) {
492
- const [fullMatch, lang, escapedCode] = match
493
- const code = escapedCode
494
- .replace(/&lt;/g, "<")
495
- .replace(/&gt;/g, ">")
496
- .replace(/&amp;/g, "&")
497
- .replace(/&quot;/g, '"')
498
- .replace(/&#39;/g, "'")
499
-
500
- let language = lang || "text"
501
- if (!(language in bundledLanguages)) {
502
- language = "text"
503
- }
504
- if (!highlighter.getLoadedLanguages().includes(language)) {
505
- await highlighter.loadLanguage(language as BundledLanguage)
506
- }
507
-
508
- const highlighted = highlighter.codeToHtml(code, {
509
- lang: language,
510
- theme: "OpenCode",
511
- tabindex: false,
512
- })
513
- result = result.replace(fullMatch, () => highlighted)
514
- }
515
-
516
- return result
517
- }
518
-
519
- export type NativeMarkdownParser = (markdown: string) => Promise<string>
9
+ registerOpenCodeTheme()
520
10
 
521
11
  export const { use: useMarked, provider: MarkedProvider } = createSimpleContext({
522
12
  name: "Marked",
523
- init: (props: { nativeParser?: NativeMarkdownParser }) => {
524
- const jsParser = marked.use(
525
- markedCodeSpanBoundary,
526
- {
527
- renderer: {
528
- link({ href, title, text }) {
529
- const titleAttr = title ? ` title="${title}"` : ""
530
- return `<a href="${href}"${titleAttr} class="external-link" target="_blank" rel="noopener noreferrer">${text}</a>`
531
- },
532
- },
533
- },
534
- katexExtension,
535
- markedShiki({
536
- async highlight(code, lang) {
537
- const highlighter = await getSharedHighlighter({
538
- themes: ["OpenCode"],
539
- langs: [],
540
- preferredHighlighter: "shiki-wasm",
541
- })
542
- if (!(lang in bundledLanguages)) {
543
- lang = "text"
544
- }
545
- if (!highlighter.getLoadedLanguages().includes(lang)) {
546
- await highlighter.loadLanguage(lang as BundledLanguage)
547
- }
548
- return highlighter.codeToHtml(code, {
549
- lang: lang || "text",
550
- theme: "OpenCode",
551
- tabindex: false,
552
- })
553
- },
554
- }),
555
- )
556
-
557
- if (props.nativeParser) {
558
- const nativeParser = props.nativeParser
559
- return {
560
- async parse(markdown: string): Promise<string> {
561
- const html = await nativeParser(markdown)
562
- const withMath = renderMathExpressions(html)
563
- return highlightCodeBlocks(withMath)
564
- },
565
- }
566
- }
567
-
568
- return jsParser
569
- },
13
+ init: () =>
14
+ createMarkdownParser(async (code, language) => {
15
+ const highlighter = await getSharedHighlighter({
16
+ themes: ["OpenCode"],
17
+ langs: [],
18
+ preferredHighlighter: "shiki-wasm",
19
+ })
20
+ const name = language in bundledLanguages ? language : "text"
21
+ if (!highlighter.getLoadedLanguages().includes(name)) await highlighter.loadLanguage(name as BundledLanguage)
22
+ return highlighter.codeToHtml(code, {
23
+ lang: name,
24
+ theme: "OpenCode",
25
+ tabindex: false,
26
+ })
27
+ }),
570
28
  })
package/src/i18n/hi.ts CHANGED
@@ -26,7 +26,8 @@ export const dict: Record<string, string> = {
26
26
  "ui.sessionReviewV2.nextFile": "अगली फ़ाइल",
27
27
  "ui.sessionReviewV2.diffView": "डिफ़ दृश्य",
28
28
  "ui.sessionReviewV2.empty.noGit.title": "कोई ट्रैक किए गए परिवर्तन नहीं",
29
- "ui.sessionReviewV2.empty.noGit.description": "इस प्रोजेक्ट में परिवर्तनों को ट्रैक करें, समीक्षा करें और पूर्ववत करें",
29
+ "ui.sessionReviewV2.empty.noGit.description":
30
+ "इस प्रोजेक्ट में परिवर्तनों को ट्रैक करें, समीक्षा करें और पूर्ववत करें",
30
31
  "ui.sessionReviewV2.empty.noGit.action": "Git रिपॉजिटरी बनाएं",
31
32
  "ui.sessionReviewV2.empty.noGit.actionLoading": "Git रिपॉजिटरी बनाई जा रही है...",
32
33
  "ui.sessionReviewV2.empty.changes.title": "अभी तक कोई फ़ाइल परिवर्तन नहीं हुआ",
@@ -67,10 +68,12 @@ export const dict: Record<string, string> = {
67
68
  "ui.sessionTurn.error.freeUsageExceeded": "मुफ़्त उपयोग की सीमा पार हो गई",
68
69
  "ui.sessionTurn.error.addCredits": "क्रेडिट जोड़ें",
69
70
  "dialog.usageExceeded.freeTier.title": "मुफ़्त सीमा पूरी हो गई",
70
- "dialog.usageExceeded.freeTier.description": "$5/month से शुरू होने वाली सदस्यता के साथ सर्वोत्तम ओपन-सोर्स मॉडलों तक विश्वसनीय पहुँच के लिए OpenCode Go की सदस्यता लें।",
71
+ "dialog.usageExceeded.freeTier.description":
72
+ "$5/month से शुरू होने वाली सदस्यता के साथ सर्वोत्तम ओपन-सोर्स मॉडलों तक विश्वसनीय पहुँच के लिए OpenCode Go की सदस्यता लें।",
71
73
  "dialog.usageExceeded.freeTier.actionLabel": "सदस्यता लें",
72
74
  "dialog.usageExceeded.accountRateLimit.title": "Go सीमा पूरी हो गई",
73
- "dialog.usageExceeded.accountRateLimit.description": "उपयोग सीमा पूरी हो गई। इस मॉडल का उपयोग अभी जारी रखने के लिए अपनी उपलब्ध शेष राशि से उपयोग सक्षम करें",
75
+ "dialog.usageExceeded.accountRateLimit.description":
76
+ "उपयोग सीमा पूरी हो गई। इस मॉडल का उपयोग अभी जारी रखने के लिए अपनी उपलब्ध शेष राशि से उपयोग सक्षम करें",
74
77
  "dialog.usageExceeded.accountRateLimit.actionLabel": "सेटिंग्स खोलें",
75
78
  "ui.sessionTurn.status.delegating": "कार्य सौंपना",
76
79
  "ui.sessionTurn.status.planning": "अगले चरणों की योजना बनाना",
package/src/i18n/it.ts CHANGED
@@ -13,7 +13,8 @@ export const dict: Record<string, string> = {
13
13
  "ui.sessionReview.image.loading": "Caricamento...",
14
14
  "ui.sessionReview.image.placeholder": "Immagine",
15
15
  "ui.sessionReview.largeDiff.title": "Diff troppo grande per essere visualizzato",
16
- "ui.sessionReview.largeDiff.meta": "Limite: {{limit}} righe modificate. Numero attuale: {{current}} righe modificate.",
16
+ "ui.sessionReview.largeDiff.meta":
17
+ "Limite: {{limit}} righe modificate. Numero attuale: {{current}} righe modificate.",
17
18
  "ui.sessionReview.largeDiff.renderAnyway": "Visualizza comunque",
18
19
  "ui.sessionReviewV2.expandMode": "Espandi o comprimi il diff",
19
20
  "ui.sessionReviewV2.filterFiles": "Filtra file",
package/src/i18n/pa.ts CHANGED
@@ -13,7 +13,8 @@ export const dict: Record<string, string> = {
13
13
  "ui.sessionReview.image.loading": "لوڈ ہو رہیا اے...",
14
14
  "ui.sessionReview.image.placeholder": "تصویر",
15
15
  "ui.sessionReview.largeDiff.title": "رینڈر کرن لئی فرق بہوں وڈا اے",
16
- "ui.sessionReview.largeDiff.meta": "حد: {{limit}} تبدیل کیتیاں گئیاں لائناں۔ موجودہ: {{current}} بدلیاں گئیاں لائناں۔",
16
+ "ui.sessionReview.largeDiff.meta":
17
+ "حد: {{limit}} تبدیل کیتیاں گئیاں لائناں۔ موجودہ: {{current}} بدلیاں گئیاں لائناں۔",
17
18
  "ui.sessionReview.largeDiff.renderAnyway": "ویسے وی رینڈر کرو",
18
19
  "ui.sessionReviewV2.expandMode": "فرق ودھاؤ یا منہدم کرو",
19
20
  "ui.sessionReviewV2.filterFiles": "فائلاں نو فلٹر کرو",
@@ -67,10 +68,12 @@ export const dict: Record<string, string> = {
67
68
  "ui.sessionTurn.error.freeUsageExceeded": "مفت استعمال توں ودھ گیا",
68
69
  "ui.sessionTurn.error.addCredits": "کریڈٹ شامل کرو",
69
70
  "dialog.usageExceeded.freeTier.title": "مفت حد پوری ہو گئی",
70
- "dialog.usageExceeded.freeTier.description": "$5/مہینہ توں شروع ہون والے بہترین اوپن سورس ماڈلاں تک بھروسے جوگی رسائی لئی OpenCode Go دی رکنیت لوو۔",
71
+ "dialog.usageExceeded.freeTier.description":
72
+ "$5/مہینہ توں شروع ہون والے بہترین اوپن سورس ماڈلاں تک بھروسے جوگی رسائی لئی OpenCode Go دی رکنیت لوو۔",
71
73
  "dialog.usageExceeded.freeTier.actionLabel": "سبسکرائب کرو",
72
74
  "dialog.usageExceeded.accountRateLimit.title": "Go دی حد پوری ہو گئی",
73
- "dialog.usageExceeded.accountRateLimit.description": "ورتوں دی حد پوری ہو گئی۔ ہن ایہہ ماڈل ورتدے رہن لئی اپنے دستیاب بیلنس توں ورتوں چالو کرو",
75
+ "dialog.usageExceeded.accountRateLimit.description":
76
+ "ورتوں دی حد پوری ہو گئی۔ ہن ایہہ ماڈل ورتدے رہن لئی اپنے دستیاب بیلنس توں ورتوں چالو کرو",
74
77
  "dialog.usageExceeded.accountRateLimit.actionLabel": "ترتیبات کھولو",
75
78
  "ui.sessionTurn.status.delegating": "کم سونپیا جا رہیا اے",
76
79
  "ui.sessionTurn.status.planning": "اگلے قدماں دی ویونت بندی ہو رہی اے",
package/src/i18n/th.ts CHANGED
@@ -16,8 +16,7 @@ export const dict = {
16
16
  "ui.sessionReview.image.loading": "กำลังโหลด...",
17
17
  "ui.sessionReview.image.placeholder": "รูปภาพ",
18
18
  "ui.sessionReview.largeDiff.title": "Diff มีขนาดใหญ่เกินกว่าจะแสดงผลได้",
19
- "ui.sessionReview.largeDiff.meta":
20
- "ขีดจำกัด: บรรทัดที่เปลี่ยนแปลง {{limit}} บรรทัด ปัจจุบัน: {{current}} บรรทัด",
19
+ "ui.sessionReview.largeDiff.meta": "ขีดจำกัด: บรรทัดที่เปลี่ยนแปลง {{limit}} บรรทัด ปัจจุบัน: {{current}} บรรทัด",
21
20
  "ui.sessionReview.largeDiff.renderAnyway": "แสดงผลต่อไป",
22
21
  "ui.sessionReviewV2.expandMode": "ขยายหรือย่อ diff",
23
22
  "ui.sessionReviewV2.filterFiles": "กรองไฟล์",
package/src/i18n/ur.ts CHANGED
@@ -26,7 +26,8 @@ export const dict: Record<string, string> = {
26
26
  "ui.sessionReviewV2.nextFile": "اگلی فائل",
27
27
  "ui.sessionReviewV2.diffView": "تبدیلیوں کا نظارہ",
28
28
  "ui.sessionReviewV2.empty.noGit.title": "کوئی ٹریک شدہ تبدیلیاں نہیں۔",
29
- "ui.sessionReviewV2.empty.noGit.description": "اس پروجیکٹ میں تبدیلیوں کو ٹریک کریں، ان کا جائزہ لیں اور ان کو کالعدم کریں۔",
29
+ "ui.sessionReviewV2.empty.noGit.description":
30
+ "اس پروجیکٹ میں تبدیلیوں کو ٹریک کریں، ان کا جائزہ لیں اور ان کو کالعدم کریں۔",
30
31
  "ui.sessionReviewV2.empty.noGit.action": "Git ریپوزٹری بنائیں",
31
32
  "ui.sessionReviewV2.empty.noGit.actionLoading": "Git ریپوزٹری بنائی جا رہی ہے...",
32
33
  "ui.sessionReviewV2.empty.changes.title": "ابھی تک کوئی فائل تبدیل نہیں ہوئی ہے۔",
@@ -67,10 +68,12 @@ export const dict: Record<string, string> = {
67
68
  "ui.sessionTurn.error.freeUsageExceeded": "مفت استعمال کی حد ختم ہو گئی",
68
69
  "ui.sessionTurn.error.addCredits": "کریڈٹ شامل کریں۔",
69
70
  "dialog.usageExceeded.freeTier.title": "مفت استعمال کی حد پوری ہو گئی",
70
- "dialog.usageExceeded.freeTier.description": "$5/ماہ سے شروع ہونے والے بہترین اوپن سورس ماڈلز تک قابل اعتماد رسائی کے لیے OpenCode Go کو سبسکرائب کریں۔",
71
+ "dialog.usageExceeded.freeTier.description":
72
+ "$5/ماہ سے شروع ہونے والے بہترین اوپن سورس ماڈلز تک قابل اعتماد رسائی کے لیے OpenCode Go کو سبسکرائب کریں۔",
71
73
  "dialog.usageExceeded.freeTier.actionLabel": "سبسکرائب کریں۔",
72
74
  "dialog.usageExceeded.accountRateLimit.title": "Go حد تک پہنچ گئی۔",
73
- "dialog.usageExceeded.accountRateLimit.description": "استعمال کی حد تک پہنچ گئی۔ ابھی اس ماڈل کا استعمال جاری رکھنے کے لیے، اپنے دستیاب بیلنس سے استعمال کو فعال کریں۔",
75
+ "dialog.usageExceeded.accountRateLimit.description":
76
+ "استعمال کی حد تک پہنچ گئی۔ ابھی اس ماڈل کا استعمال جاری رکھنے کے لیے، اپنے دستیاب بیلنس سے استعمال کو فعال کریں۔",
74
77
  "dialog.usageExceeded.accountRateLimit.actionLabel": "ترتیبات کھولیں۔",
75
78
  "ui.sessionTurn.status.delegating": "کام سونپا جا رہا ہے",
76
79
  "ui.sessionTurn.status.planning": "اگلے اقدامات کی منصوبہ بندی کی جا رہی ہے",
package/src/i18n/vi.ts CHANGED
@@ -67,10 +67,12 @@ export const dict: Record<string, string> = {
67
67
  "ui.sessionTurn.error.freeUsageExceeded": "Đã vượt quá mức sử dụng miễn phí",
68
68
  "ui.sessionTurn.error.addCredits": "Thêm số dư",
69
69
  "dialog.usageExceeded.freeTier.title": "Đã đạt đến giới hạn miễn phí",
70
- "dialog.usageExceeded.freeTier.description": "Đăng ký OpenCode Go để có quyền truy cập đáng tin cậy vào các mô hình nguồn mở tốt nhất, bắt đầu từ $5/tháng.",
70
+ "dialog.usageExceeded.freeTier.description":
71
+ "Đăng ký OpenCode Go để có quyền truy cập đáng tin cậy vào các mô hình nguồn mở tốt nhất, bắt đầu từ $5/tháng.",
71
72
  "dialog.usageExceeded.freeTier.actionLabel": "Đăng ký",
72
73
  "dialog.usageExceeded.accountRateLimit.title": "Đã đạt giới hạn Go",
73
- "dialog.usageExceeded.accountRateLimit.description": "Đã đạt đến giới hạn sử dụng. Để tiếp tục sử dụng mô hình này ngay bây giờ, hãy cho phép sử dụng từ số dư khả dụng của bạn",
74
+ "dialog.usageExceeded.accountRateLimit.description":
75
+ "Đã đạt đến giới hạn sử dụng. Để tiếp tục sử dụng mô hình này ngay bây giờ, hãy cho phép sử dụng từ số dư khả dụng của bạn",
74
76
  "dialog.usageExceeded.accountRateLimit.actionLabel": "Mở cài đặt",
75
77
  "ui.sessionTurn.status.delegating": "Phân công công việc",
76
78
  "ui.sessionTurn.status.planning": "Lập kế hoạch các bước tiếp theo",
package/src/i18n/zh.ts CHANGED
@@ -78,8 +78,7 @@ export const dict = {
78
78
  "dialog.usageExceeded.freeTier.description": "订阅 OpenCode Go,可靠地使用最佳开源模型,每月 $5 起。",
79
79
  "dialog.usageExceeded.freeTier.actionLabel": "订阅",
80
80
  "dialog.usageExceeded.accountRateLimit.title": "Go 额度已用完",
81
- "dialog.usageExceeded.accountRateLimit.description":
82
- "使用额度已达上限。如需立即继续使用此模型,请启用余额付费",
81
+ "dialog.usageExceeded.accountRateLimit.description": "使用额度已达上限。如需立即继续使用此模型,请启用余额付费",
83
82
  "dialog.usageExceeded.accountRateLimit.actionLabel": "打开设置",
84
83
 
85
84
  "ui.sessionTurn.status.delegating": "正在委派工作",
package/src/i18n/zht.ts CHANGED
@@ -78,8 +78,7 @@ export const dict = {
78
78
  "dialog.usageExceeded.freeTier.description": "訂閱 OpenCode Go,可靠地使用最佳開源模型,每月 $5 起。",
79
79
  "dialog.usageExceeded.freeTier.actionLabel": "訂閱",
80
80
  "dialog.usageExceeded.accountRateLimit.title": "已達 Go 額度上限",
81
- "dialog.usageExceeded.accountRateLimit.description":
82
- "已達使用額度上限。若要立即繼續使用此模型,請啟用可用餘額計費",
81
+ "dialog.usageExceeded.accountRateLimit.description": "已達使用額度上限。若要立即繼續使用此模型,請啟用可用餘額計費",
83
82
  "dialog.usageExceeded.accountRateLimit.actionLabel": "開啟設定",
84
83
 
85
84
  "ui.sessionTurn.status.delegating": "正在委派工作",
@@ -1,10 +0,0 @@
1
- export declare const markedCodeSpanBoundary: {
2
- tokenizer: {
3
- inlineText(this: import("marked").Tokenizer<string, string>, src: string): false | {
4
- type: "text";
5
- raw: string;
6
- text: string;
7
- escaped: boolean;
8
- };
9
- };
10
- };
@@ -1,17 +0,0 @@
1
- import type { MarkedExtension } from "marked"
2
-
3
- // Keep adjacent tilde and backtick runs separate until markedjs/marked#4011 is released.
4
- export const markedCodeSpanBoundary = {
5
- tokenizer: {
6
- inlineText(src) {
7
- const match = /^(`+(?=~)|~+(?=`))/.exec(src)
8
- if (!match) return false
9
- return {
10
- type: "text",
11
- raw: match[0],
12
- text: match[0],
13
- escaped: this.lexer.state.inRawBlock,
14
- }
15
- },
16
- },
17
- } satisfies MarkedExtension