adminforth 2.42.0-next.2 → 2.42.0-next.4

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.
@@ -333,7 +333,7 @@ onMounted(async () => {
333
333
  await loadMenu(); // and this
334
334
  // before init flowbite we have to wait router initialized because it affects dom(our v-ifs) and fetch menu
335
335
  await initRouter();
336
-
336
+ document.documentElement.setAttribute('data-theme', theme.value);
337
337
  menu.refreshMenuBadges = async () => {
338
338
  await coreStore.fetchMenuBadges();
339
339
  }
@@ -7,12 +7,33 @@ export type CompletionStreamEvent = {
7
7
  source?: "summary" | "text";
8
8
  };
9
9
 
10
+ export type CompletionReasoningEffort =
11
+ | "none"
12
+ | "minimal"
13
+ | "low"
14
+ | "medium"
15
+ | "high"
16
+ | "xhigh";
17
+
10
18
  export type CompletionTool<Input = Record<string, any>, Output = any> = {
11
19
  name: string;
12
20
  input_schema: JSONSchemaType<Input>;
13
21
  description?: string;
14
22
  handler: (input: Input) => Promise<Output> | Output;
15
23
  };
24
+
25
+ export type CompletionRequest = {
26
+ content: string;
27
+ maxTokens: number;
28
+ outputSchema?: any;
29
+ reasoningEffort?: CompletionReasoningEffort;
30
+ tools?: CompletionTool[];
31
+ onChunk?: (
32
+ chunk: string,
33
+ event?: CompletionStreamEvent,
34
+ ) => void | Promise<void>;
35
+ };
36
+
16
37
  export interface CompletionAdapter {
17
38
 
18
39
  /**
@@ -23,24 +44,10 @@ export interface CompletionAdapter {
23
44
 
24
45
  /**
25
46
  * This method should return a text completion based on the provided content.
26
- * @param content - The input text to complete
27
- * @param maxTokens - The maximum number of tokens to generate
28
- * @param outputSchema - Optional structured output schema for the response
29
- * @param reasoningEffort - Optional parameter to indicate the level of reasoning effort for the completion
30
- * @param onChunk - Optional callback invoked for each streamed chunk or reasoning event
47
+ * @param request - Completion request options
31
48
  * @returns A promise that resolves to an object containing the completed text and other metadata
32
49
  */
33
- complete(
34
- content: string,
35
- maxTokens: number,
36
- outputSchema?: any,
37
- reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh',
38
- tools?: CompletionTool[],
39
- onChunk?: (
40
- chunk: string,
41
- event?: CompletionStreamEvent,
42
- ) => void | Promise<void>,
43
- ): Promise<{
50
+ complete(request: CompletionRequest): Promise<{
44
51
  content?: string;
45
52
  finishReason?: string;
46
53
  error?: string;
@@ -1,5 +1,11 @@
1
1
  export type { EmailAdapter } from './EmailAdapter.js';
2
- export type { CompletionAdapter, CompletionStreamEvent, CompletionTool } from './CompletionAdapter.js';
2
+ export type {
3
+ CompletionAdapter,
4
+ CompletionReasoningEffort,
5
+ CompletionRequest,
6
+ CompletionStreamEvent,
7
+ CompletionTool,
8
+ } from './CompletionAdapter.js';
3
9
  export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
4
10
  export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
11
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
@@ -5,12 +5,21 @@ export type CompletionStreamEvent = {
5
5
  text: string;
6
6
  source?: "summary" | "text";
7
7
  };
8
+ export type CompletionReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
8
9
  export type CompletionTool<Input = Record<string, any>, Output = any> = {
9
10
  name: string;
10
11
  input_schema: JSONSchemaType<Input>;
11
12
  description?: string;
12
13
  handler: (input: Input) => Promise<Output> | Output;
13
14
  };
15
+ export type CompletionRequest = {
16
+ content: string;
17
+ maxTokens: number;
18
+ outputSchema?: any;
19
+ reasoningEffort?: CompletionReasoningEffort;
20
+ tools?: CompletionTool[];
21
+ onChunk?: (chunk: string, event?: CompletionStreamEvent) => void | Promise<void>;
22
+ };
14
23
  export interface CompletionAdapter {
15
24
  /**
16
25
  * This method is called to validate the configuration of the adapter
@@ -19,14 +28,10 @@ export interface CompletionAdapter {
19
28
  validate(): void;
20
29
  /**
21
30
  * This method should return a text completion based on the provided content.
22
- * @param content - The input text to complete
23
- * @param maxTokens - The maximum number of tokens to generate
24
- * @param outputSchema - Optional structured output schema for the response
25
- * @param reasoningEffort - Optional parameter to indicate the level of reasoning effort for the completion
26
- * @param onChunk - Optional callback invoked for each streamed chunk or reasoning event
31
+ * @param request - Completion request options
27
32
  * @returns A promise that resolves to an object containing the completed text and other metadata
28
33
  */
29
- complete(content: string, maxTokens: number, outputSchema?: any, reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh', tools?: CompletionTool[], onChunk?: (chunk: string, event?: CompletionStreamEvent) => void | Promise<void>): Promise<{
34
+ complete(request: CompletionRequest): Promise<{
30
35
  content?: string;
31
36
  finishReason?: string;
32
37
  error?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CompletionAdapter.d.ts","sourceRoot":"","sources":["../../../types/adapters/CompletionAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,IAAI;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CACrD,CAAC;AACF,MAAM,WAAW,iBAAiB;IAEhC;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;IAEjB;;;;;;;;OAQG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,YAAY,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,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,qBAAqB,KAC1B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAEhC;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IAEH;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC/D"}
@@ -1,5 +1,5 @@
1
1
  export type { EmailAdapter } from './EmailAdapter.js';
2
- export type { CompletionAdapter, CompletionStreamEvent, CompletionTool } from './CompletionAdapter.js';
2
+ export type { CompletionAdapter, CompletionReasoningEffort, CompletionRequest, CompletionStreamEvent, CompletionTool, } from './CompletionAdapter.js';
3
3
  export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
4
4
  export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
5
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvG,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACX,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.42.0-next.2",
3
+ "version": "2.42.0-next.4",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",