@adminforth/agent 1.43.20 → 1.43.22
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/build.log +2 -2
- package/custom/ChatSurface.vue +2 -2
- package/custom/incremark_code_renderers/incremarkCodeHighlight.ts +10 -13
- package/custom/incremark_code_renderers/renderIncremarkMarkdown.ts +12 -1
- package/dist/custom/ChatSurface.vue +2 -2
- package/dist/custom/incremark_code_renderers/incremarkCodeHighlight.ts +10 -13
- package/dist/custom/incremark_code_renderers/renderIncremarkMarkdown.ts +12 -1
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -62,5 +62,5 @@ custom/speech_recognition_frontend/voiceActivityDetection.ts
|
|
|
62
62
|
custom/speech_recognition_frontend/types/
|
|
63
63
|
custom/speech_recognition_frontend/types/voice-activity-detection.d.ts
|
|
64
64
|
|
|
65
|
-
sent 1,666,
|
|
66
|
-
total size is 1,
|
|
65
|
+
sent 1,666,511 bytes received 921 bytes 3,334,864.00 bytes/sec
|
|
66
|
+
total size is 1,662,416 speedup is 1.00
|
package/custom/ChatSurface.vue
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<div
|
|
34
34
|
class="w-full min-h-0 max-h-full flex flex-col h-dvh"
|
|
35
35
|
:style="{
|
|
36
|
-
height: !
|
|
36
|
+
height: !coreStore.isIos ? dvh + 'px' : '100dvh',
|
|
37
37
|
}"
|
|
38
38
|
>
|
|
39
39
|
<ChatHeader />
|
|
@@ -88,7 +88,7 @@ const agentStore = useAgentStore();
|
|
|
88
88
|
const agentTransitions = useAgentTransitions();
|
|
89
89
|
const coreStore = useCoreStore();
|
|
90
90
|
|
|
91
|
-
const dvh = ref(window.innerHeight)
|
|
91
|
+
const dvh = ref(window.visualViewport?.height || window.innerHeight);
|
|
92
92
|
|
|
93
93
|
let startX = 0
|
|
94
94
|
let startWidth = 0
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createBundledHighlighter,
|
|
3
|
-
type HighlighterGeneric,
|
|
4
|
-
type LanguageInput,
|
|
5
|
-
type ThemeInput
|
|
6
|
-
} from 'shiki/core';
|
|
7
|
-
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
|
|
1
|
+
import type { HighlighterGeneric, LanguageInput, ThemeInput } from 'shiki/core';
|
|
8
2
|
|
|
9
3
|
export type IncremarkCodeTheme = 'dark' | 'light';
|
|
10
4
|
|
|
@@ -116,12 +110,6 @@ const SHIKI_LANGUAGE_LOADERS = {
|
|
|
116
110
|
vue: () => import('@shikijs/langs/vue')
|
|
117
111
|
} as const satisfies Record<SupportedShikiLanguage, LanguageInput>;
|
|
118
112
|
|
|
119
|
-
const createShikiHighlighter = createBundledHighlighter({
|
|
120
|
-
themes: SHIKI_THEME_LOADERS,
|
|
121
|
-
langs: SHIKI_LANGUAGE_LOADERS,
|
|
122
|
-
engine: () => createOnigurumaEngine(() => import('shiki/wasm'))
|
|
123
|
-
});
|
|
124
|
-
|
|
125
113
|
interface HighlighterState {
|
|
126
114
|
highlighter: HighlighterGeneric<SupportedShikiLanguage, SupportedShikiTheme>;
|
|
127
115
|
loadedLanguages: Set<SupportedShikiLanguage>;
|
|
@@ -226,6 +214,15 @@ function setHighlightedHtmlCache(cacheKey: string, highlightedHtml: string): voi
|
|
|
226
214
|
async function getHighlighter(): Promise<HighlighterState> {
|
|
227
215
|
if (!highlighterPromise) {
|
|
228
216
|
highlighterPromise = (async () => {
|
|
217
|
+
const [{ createBundledHighlighter }, { createOnigurumaEngine }] = await Promise.all([
|
|
218
|
+
import('shiki/core'),
|
|
219
|
+
import('shiki/engine/oniguruma')
|
|
220
|
+
]);
|
|
221
|
+
const createShikiHighlighter = createBundledHighlighter({
|
|
222
|
+
themes: SHIKI_THEME_LOADERS,
|
|
223
|
+
langs: SHIKI_LANGUAGE_LOADERS,
|
|
224
|
+
engine: () => createOnigurumaEngine(() => import('shiki/wasm'))
|
|
225
|
+
});
|
|
229
226
|
const highlighter = await createShikiHighlighter({
|
|
230
227
|
themes: [],
|
|
231
228
|
langs: []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IncremarkParserOptions } from '@incremark/core';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
highlightCodeSnippetHtml,
|
|
@@ -13,6 +13,8 @@ const INCREMARK_PARSER_OPTIONS = {
|
|
|
13
13
|
htmlTree: true
|
|
14
14
|
} satisfies IncremarkParserOptions;
|
|
15
15
|
|
|
16
|
+
let incremarkCorePromise: Promise<typeof import('@incremark/core')> | null = null;
|
|
17
|
+
|
|
16
18
|
const INCREMARK_CODE_BLOCK_PATTERN =
|
|
17
19
|
/(<div class="incremark-block incremark-code"><div class="incremark-code-toolbar">[\s\S]*?<\/div>)<pre><code(?: class="language-([^"]+)")?>([\s\S]*?)<\/code><\/pre><\/div>/g;
|
|
18
20
|
const HTML_ENTITY_RE = /&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g;
|
|
@@ -29,6 +31,7 @@ export async function renderIncremarkMarkdown(
|
|
|
29
31
|
markdown: string,
|
|
30
32
|
theme: IncremarkCodeTheme = 'dark'
|
|
31
33
|
): Promise<string> {
|
|
34
|
+
const { createIncremarkParser } = await getIncremarkCore();
|
|
32
35
|
const parser = createIncremarkParser(INCREMARK_PARSER_OPTIONS);
|
|
33
36
|
|
|
34
37
|
if (markdown) {
|
|
@@ -42,6 +45,14 @@ export async function renderIncremarkMarkdown(
|
|
|
42
45
|
return highlightRenderedIncremarkHtmlServer(mathHtml, theme);
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
async function getIncremarkCore(): Promise<typeof import('@incremark/core')> {
|
|
49
|
+
if (!incremarkCorePromise) {
|
|
50
|
+
incremarkCorePromise = import('@incremark/core');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return incremarkCorePromise;
|
|
54
|
+
}
|
|
55
|
+
|
|
45
56
|
async function highlightRenderedIncremarkHtmlServer(
|
|
46
57
|
html: string,
|
|
47
58
|
theme: IncremarkCodeTheme
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<div
|
|
34
34
|
class="w-full min-h-0 max-h-full flex flex-col h-dvh"
|
|
35
35
|
:style="{
|
|
36
|
-
height: !
|
|
36
|
+
height: !coreStore.isIos ? dvh + 'px' : '100dvh',
|
|
37
37
|
}"
|
|
38
38
|
>
|
|
39
39
|
<ChatHeader />
|
|
@@ -88,7 +88,7 @@ const agentStore = useAgentStore();
|
|
|
88
88
|
const agentTransitions = useAgentTransitions();
|
|
89
89
|
const coreStore = useCoreStore();
|
|
90
90
|
|
|
91
|
-
const dvh = ref(window.innerHeight)
|
|
91
|
+
const dvh = ref(window.visualViewport?.height || window.innerHeight);
|
|
92
92
|
|
|
93
93
|
let startX = 0
|
|
94
94
|
let startWidth = 0
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createBundledHighlighter,
|
|
3
|
-
type HighlighterGeneric,
|
|
4
|
-
type LanguageInput,
|
|
5
|
-
type ThemeInput
|
|
6
|
-
} from 'shiki/core';
|
|
7
|
-
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
|
|
1
|
+
import type { HighlighterGeneric, LanguageInput, ThemeInput } from 'shiki/core';
|
|
8
2
|
|
|
9
3
|
export type IncremarkCodeTheme = 'dark' | 'light';
|
|
10
4
|
|
|
@@ -116,12 +110,6 @@ const SHIKI_LANGUAGE_LOADERS = {
|
|
|
116
110
|
vue: () => import('@shikijs/langs/vue')
|
|
117
111
|
} as const satisfies Record<SupportedShikiLanguage, LanguageInput>;
|
|
118
112
|
|
|
119
|
-
const createShikiHighlighter = createBundledHighlighter({
|
|
120
|
-
themes: SHIKI_THEME_LOADERS,
|
|
121
|
-
langs: SHIKI_LANGUAGE_LOADERS,
|
|
122
|
-
engine: () => createOnigurumaEngine(() => import('shiki/wasm'))
|
|
123
|
-
});
|
|
124
|
-
|
|
125
113
|
interface HighlighterState {
|
|
126
114
|
highlighter: HighlighterGeneric<SupportedShikiLanguage, SupportedShikiTheme>;
|
|
127
115
|
loadedLanguages: Set<SupportedShikiLanguage>;
|
|
@@ -226,6 +214,15 @@ function setHighlightedHtmlCache(cacheKey: string, highlightedHtml: string): voi
|
|
|
226
214
|
async function getHighlighter(): Promise<HighlighterState> {
|
|
227
215
|
if (!highlighterPromise) {
|
|
228
216
|
highlighterPromise = (async () => {
|
|
217
|
+
const [{ createBundledHighlighter }, { createOnigurumaEngine }] = await Promise.all([
|
|
218
|
+
import('shiki/core'),
|
|
219
|
+
import('shiki/engine/oniguruma')
|
|
220
|
+
]);
|
|
221
|
+
const createShikiHighlighter = createBundledHighlighter({
|
|
222
|
+
themes: SHIKI_THEME_LOADERS,
|
|
223
|
+
langs: SHIKI_LANGUAGE_LOADERS,
|
|
224
|
+
engine: () => createOnigurumaEngine(() => import('shiki/wasm'))
|
|
225
|
+
});
|
|
229
226
|
const highlighter = await createShikiHighlighter({
|
|
230
227
|
themes: [],
|
|
231
228
|
langs: []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IncremarkParserOptions } from '@incremark/core';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
highlightCodeSnippetHtml,
|
|
@@ -13,6 +13,8 @@ const INCREMARK_PARSER_OPTIONS = {
|
|
|
13
13
|
htmlTree: true
|
|
14
14
|
} satisfies IncremarkParserOptions;
|
|
15
15
|
|
|
16
|
+
let incremarkCorePromise: Promise<typeof import('@incremark/core')> | null = null;
|
|
17
|
+
|
|
16
18
|
const INCREMARK_CODE_BLOCK_PATTERN =
|
|
17
19
|
/(<div class="incremark-block incremark-code"><div class="incremark-code-toolbar">[\s\S]*?<\/div>)<pre><code(?: class="language-([^"]+)")?>([\s\S]*?)<\/code><\/pre><\/div>/g;
|
|
18
20
|
const HTML_ENTITY_RE = /&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g;
|
|
@@ -29,6 +31,7 @@ export async function renderIncremarkMarkdown(
|
|
|
29
31
|
markdown: string,
|
|
30
32
|
theme: IncremarkCodeTheme = 'dark'
|
|
31
33
|
): Promise<string> {
|
|
34
|
+
const { createIncremarkParser } = await getIncremarkCore();
|
|
32
35
|
const parser = createIncremarkParser(INCREMARK_PARSER_OPTIONS);
|
|
33
36
|
|
|
34
37
|
if (markdown) {
|
|
@@ -42,6 +45,14 @@ export async function renderIncremarkMarkdown(
|
|
|
42
45
|
return highlightRenderedIncremarkHtmlServer(mathHtml, theme);
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
async function getIncremarkCore(): Promise<typeof import('@incremark/core')> {
|
|
49
|
+
if (!incremarkCorePromise) {
|
|
50
|
+
incremarkCorePromise = import('@incremark/core');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return incremarkCorePromise;
|
|
54
|
+
}
|
|
55
|
+
|
|
45
56
|
async function highlightRenderedIncremarkHtmlServer(
|
|
46
57
|
html: string,
|
|
47
58
|
theme: IncremarkCodeTheme
|