@adminforth/agent 1.43.23 → 1.43.24

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 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,122 bytes received 921 bytes 3,334,086.00 bytes/sec
66
- total size is 1,662,027 speedup is 1.00
65
+ sent 1,666,559 bytes received 921 bytes 3,334,960.00 bytes/sec
66
+ total size is 1,662,406 speedup is 1.00
@@ -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 { createIncremarkParser, type IncremarkParserOptions } from '@incremark/core';
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
@@ -1,4 +1,4 @@
1
- const { MicVAD, utils } = await import("@ricky0123/vad-web");
1
+ import { MicVAD, utils } from "@ricky0123/vad-web";
2
2
 
3
3
  let VADInstance: any = null;
4
4
  let recordedAudioChunks: Float32Array[] = [];
@@ -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 { createIncremarkParser, type IncremarkParserOptions } from '@incremark/core';
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
@@ -1,4 +1,4 @@
1
- const { MicVAD, utils } = await import("@ricky0123/vad-web");
1
+ import { MicVAD, utils } from "@ricky0123/vad-web";
2
2
 
3
3
  let VADInstance: any = null;
4
4
  let recordedAudioChunks: Float32Array[] = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.43.23",
3
+ "version": "1.43.24",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",