fmode-ng 0.0.75 → 0.0.76
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/esm2022/lib/aigc/agent/fm-agent-task/fm-agent-task.component.mjs +10 -0
- package/esm2022/lib/aigc/agent/index.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-list/chat-list.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-modal-input/modal-input.component.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2022/lib/aigc/voice/stream.player.mjs +1 -1
- package/esm2022/lib/aigc/voice/tts/fmode-tts-class.mjs +1 -1
- package/esm2022/lib/core/agent/chat/completion/fmode-completion.mjs +10 -0
- package/esm2022/lib/core/agent/chat/completion/index.mjs +10 -0
- package/esm2022/lib/core/agent/chat/fmode-chat.mjs +10 -0
- package/esm2022/lib/core/agent/chat/index.mjs +10 -0
- package/esm2022/lib/core/agent/chat/interface.mjs +10 -0
- package/esm2022/lib/core/agent/index.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/agent.prompt.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/index.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/prompt-util.mjs +10 -0
- package/esm2022/lib/core/agent/story/agent.story.mjs +10 -0
- package/esm2022/lib/core/agent/story/index.mjs +10 -0
- package/esm2022/lib/core/agent/task/agent.task.mjs +10 -0
- package/esm2022/lib/core/agent/task/index.mjs +10 -0
- package/esm2022/lib/core/voice/tts/index.mjs +10 -0
- package/esm2022/lib/storage/service-upload/nova-upload.service.mjs +1 -1
- package/esm2022/lib/user/login/auth.service.mjs +1 -1
- package/esm2022/lib/user/login/login.component.mjs +1 -1
- package/esm2022/lib/user/modal-user-login/modal-user-login.component.mjs +1 -1
- package/fesm2022/fmode-ng.mjs +1 -1
- package/fesm2022/fmode-ng.mjs.map +1 -1
- package/lib/aigc/agent/fm-agent-task/fm-agent-task.component.d.ts +34 -0
- package/lib/aigc/agent/index.d.ts +2 -1
- package/lib/aigc/chat/chat-list/chat-list.component.d.ts +3 -2
- package/lib/aigc/chat/chat-message-card/comp-message-card.component.d.ts +2 -1
- package/lib/aigc/chat/chat-modal-input/modal-input.component.d.ts +6 -4
- package/lib/aigc/chat/chat-panel/chat-panel.component.d.ts +2 -1
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +1 -199
- package/lib/aigc/voice/stream.player.d.ts +1 -1
- package/lib/core/agent/chat/completion/fmode-completion.d.ts +29 -0
- package/lib/core/agent/chat/completion/index.d.ts +1 -0
- package/lib/core/agent/chat/fmode-chat.d.ts +137 -0
- package/lib/core/agent/chat/index.d.ts +3 -0
- package/lib/core/agent/chat/interface.d.ts +35 -0
- package/lib/core/agent/index.d.ts +4 -0
- package/lib/{aigc/agent → core/agent/prompt}/agent.prompt.d.ts +1 -4
- package/lib/core/agent/prompt/index.d.ts +1 -0
- package/lib/core/agent/prompt/prompt-util.d.ts +3 -0
- package/lib/core/agent/story/agent.story.d.ts +12 -0
- package/lib/core/agent/story/index.d.ts +1 -0
- package/lib/core/agent/task/agent.task.d.ts +51 -0
- package/lib/core/agent/task/index.d.ts +1 -0
- package/lib/core/voice/tts/index.d.ts +1 -0
- package/lib/storage/service-upload/nova-upload.service.d.ts +5 -1
- package/lib/user/login/auth.service.d.ts +10 -1
- package/lib/user/login/login.component.d.ts +9 -3
- package/lib/user/modal-user-login/modal-user-login.component.d.ts +9 -4
- package/package.json +1 -1
- package/esm2022/lib/aigc/agent/agent.prompt.mjs +0 -10
|
@@ -22,6 +22,7 @@ export interface NovaFile {
|
|
|
22
22
|
type: string;
|
|
23
23
|
size: number;
|
|
24
24
|
md5?: string;
|
|
25
|
+
attachment?: Parse.Object;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* NovaUploadService 上传服务
|
|
@@ -30,6 +31,7 @@ export interface NovaFile {
|
|
|
30
31
|
export declare class NovaUploadService {
|
|
31
32
|
private platform;
|
|
32
33
|
private diagnostic;
|
|
34
|
+
store: Parse.Object;
|
|
33
35
|
company: string;
|
|
34
36
|
uptoken: string;
|
|
35
37
|
qiniuConf: any;
|
|
@@ -58,11 +60,13 @@ export declare class NovaUploadService {
|
|
|
58
60
|
}
|
|
59
61
|
*/
|
|
60
62
|
upload(file: File, onProgress?: Function): Promise<NovaFile>;
|
|
63
|
+
getAttachByMd5(fileMd5: string): Promise<Parse.Object<Parse.Attributes>>;
|
|
61
64
|
/**
|
|
62
65
|
* 移动端上传专用方法
|
|
63
66
|
* @returns
|
|
64
67
|
*/
|
|
65
68
|
isCapacitor(): boolean;
|
|
69
|
+
getFileMd5(file: File): Promise<string>;
|
|
66
70
|
requestPermission(): Promise<void>;
|
|
67
71
|
requestStoagePermission(): Promise<void>;
|
|
68
72
|
requestCameraPermission(): Promise<void>;
|
|
@@ -97,7 +101,7 @@ export declare class NovaUploadService {
|
|
|
97
101
|
name: string;
|
|
98
102
|
type: string;
|
|
99
103
|
md5?: string;
|
|
100
|
-
}, domain: any, cateId?: any, company?: any): Promise<Parse.Object>;
|
|
104
|
+
}, domain: any, cateId?: any, company?: any, fileSrc?: File): Promise<Parse.Object>;
|
|
101
105
|
/**
|
|
102
106
|
* 录像并上传
|
|
103
107
|
*/
|
|
@@ -15,6 +15,7 @@ export declare class AuthService {
|
|
|
15
15
|
*/
|
|
16
16
|
guardType: "page" | "modal";
|
|
17
17
|
guardMap: any;
|
|
18
|
+
modalType: "fullscreen" | "sheet";
|
|
18
19
|
isModalShow: boolean;
|
|
19
20
|
isGuardLock(url: any): boolean;
|
|
20
21
|
showBackHome: boolean;
|
|
@@ -48,14 +49,22 @@ export declare class AuthService {
|
|
|
48
49
|
redirectUrl: string;
|
|
49
50
|
constructor(router: Router, toastCtrl: ToastController, novaCloud: NovaCloudService, http: HttpClient);
|
|
50
51
|
toast(options: any): Promise<void>;
|
|
52
|
+
message: {
|
|
53
|
+
success: (msg: string) => void;
|
|
54
|
+
create: (type: string, msg: string) => void;
|
|
55
|
+
info: (msg: string) => void;
|
|
56
|
+
error: (msg: string) => void;
|
|
57
|
+
};
|
|
51
58
|
init(options: {
|
|
52
59
|
company?: string;
|
|
53
60
|
guardType?: "page" | "modal";
|
|
54
61
|
LoginPage?: string;
|
|
62
|
+
modalType?: "fullscreen" | "sheet";
|
|
55
63
|
}): void;
|
|
56
64
|
checkLoginLock(): boolean;
|
|
57
65
|
LoginPage: string;
|
|
58
|
-
checkLogin(url: string): boolean
|
|
66
|
+
checkLogin(url: string): Promise<boolean>;
|
|
67
|
+
checkAndLoginWithToken(): Promise<void>;
|
|
59
68
|
setAccount(user: any): Promise<Parse.Object<Parse.Attributes>>;
|
|
60
69
|
login(username: any, password: any): Promise<unknown>;
|
|
61
70
|
refreshPage(): Promise<unknown>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { FormBuilder, FormControl, FormGroup, ValidationErrors } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
5
4
|
import { AuthService } from './auth.service';
|
|
6
5
|
import Parse from "parse";
|
|
7
6
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
8
7
|
import { HttpClient } from "@angular/common/http";
|
|
9
8
|
import { NovaCloudService } from '../../nova-cloud/nova-cloud.service';
|
|
9
|
+
import { ToastController } from '@ionic/angular/standalone';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare class LoginComponent implements OnInit {
|
|
12
12
|
authServ: AuthService;
|
|
13
13
|
private novaCloud;
|
|
14
14
|
private fb;
|
|
15
|
-
private
|
|
15
|
+
private toastCtrl;
|
|
16
16
|
router: Router;
|
|
17
17
|
private route;
|
|
18
18
|
private activatedRoute;
|
|
@@ -130,7 +130,13 @@ export declare class LoginComponent implements OnInit {
|
|
|
130
130
|
companyId: string;
|
|
131
131
|
app: Parse.Object;
|
|
132
132
|
appId: string;
|
|
133
|
-
|
|
133
|
+
message: {
|
|
134
|
+
success: (msg: string) => void;
|
|
135
|
+
create: (type: string, msg: string) => void;
|
|
136
|
+
info: (msg: string) => void;
|
|
137
|
+
error: (msg: string) => void;
|
|
138
|
+
};
|
|
139
|
+
constructor(authServ: AuthService, novaCloud: NovaCloudService, fb: FormBuilder, toastCtrl: ToastController, router: Router, route: ActivatedRoute, activatedRoute: ActivatedRoute, http: HttpClient);
|
|
134
140
|
initCompanyConfig(): Promise<void>;
|
|
135
141
|
initAppConfig(): Promise<boolean>;
|
|
136
142
|
initLoginForm(): void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { OnInit, ElementRef } from "@angular/core";
|
|
2
|
-
import { Router } from "@angular/router";
|
|
2
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
3
3
|
import { AuthService } from "../login/auth.service";
|
|
4
|
-
import { NzMessageService } from "ng-zorro-antd/message";
|
|
5
4
|
import { HttpClient } from '@angular/common/http';
|
|
6
5
|
import { ToastController } from "@ionic/angular/standalone";
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
export declare class ModalUserLoginComponent implements OnInit {
|
|
9
|
-
private msg;
|
|
10
8
|
authServ: AuthService;
|
|
11
9
|
private router;
|
|
10
|
+
private route;
|
|
12
11
|
private http;
|
|
13
12
|
private toastCtrl;
|
|
14
13
|
mobile: string;
|
|
@@ -19,7 +18,13 @@ export declare class ModalUserLoginComponent implements OnInit {
|
|
|
19
18
|
loginInfo: any;
|
|
20
19
|
smsCodeInput: ElementRef<HTMLInputElement>;
|
|
21
20
|
localCodeNum: string;
|
|
22
|
-
|
|
21
|
+
msg: {
|
|
22
|
+
success: (msg: string) => void;
|
|
23
|
+
create: (type: string, msg: string) => void;
|
|
24
|
+
info: (msg: string) => void;
|
|
25
|
+
error: (msg: string) => void;
|
|
26
|
+
};
|
|
27
|
+
constructor(authServ: AuthService, router: Router, route: ActivatedRoute, http: HttpClient, toastCtrl: ToastController);
|
|
23
28
|
ngOnInit(): void;
|
|
24
29
|
ngAfterViewInit(): void;
|
|
25
30
|
signMobilePassword(): void;
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @copyright © 未来飞马 © 未来全栈 www.fmode.cn
|
|
4
|
-
* 版权所有 © 未来飞马 © 江西脑控科技有限公司 Copyright © Fmode Technology Co., Ltd.
|
|
5
|
-
* 保留所有权利 All Rights Reserved.
|
|
6
|
-
* /home/ryan/workspace/nova/nova-admin/dist/fmode-ng/esm2022/lib/aigc/agent/agent.prompt.mjs
|
|
7
|
-
*/
|
|
8
|
-
import{PromptTemplate}from"@langchain/core/prompts";import Parse from"parse";import{finalize}from"rxjs";import{FmodeChatCompletion}from"../service-fmai/service-chat/chat-class";export class AgentPrompt{constructor(){}jsonCompletion(e,t){let r,o=new FmodeChatCompletion([{role:"user",content:e}]);return o.model=t||"fmode-4.5-128k",o.sendCompletion({isDirect:!0}).pipe(finalize((()=>{let e;console.log(r),r.json=this.extractAndParseJson(e),r.complete=!0})))}extractAndParseJson(e){let t=e.indexOf("{");if(-1===t)return{};let r=0,o=t;for(let l=t;l<e.length;l++)if("{"===e[l]?r++:"}"===e[l]&&r--,0===r){o=l;break}if(0!==r)return{};const l=e.slice(t,o+1);try{return JSON.parse(l)}catch(e){return console.error("Failed to parse JSON:",e),{}}}extractMarkdownToMultiArray(e){let t=e.split("\n"),r=[],o=r,l=[r];for(let e of t){if(!e.trim())continue;if(e.startsWith("#")){let t=e.replace(/^#+\s*/,"");o.push([t]);continue}let t=e.search(/\S/)/2,r=e.trim().replace(/^-+\s*/,"");for(;t<l.length-1;)l.pop();for(;t>l.length-1;){let e=[];l[l.length-1].push(e),l.push(e)}o=l[l.length-1],o.push(r)}return r}async getFormatTpl(e,t){let r=await this.getPromptTpl(e);return await r.format(t)}async getPromptTpl(e){let t=new Parse.Query("PromptTemplate");t.equalTo("code",e);let r=await t.first();return PromptTemplate.fromTemplate(r?.get("template"),{templateFormat:"mustache"})}getTokens(e){return e=e||"",2*e?.length}}
|
|
9
|
-
var MODULE_PATH_NEED = `6K+l5paH5Lu25piv5pys6aG555uu55qE5LiA6YOo5YiGIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBDb21wb25lbnRzIGluIEZtb2RlIEluYy4KICAgIOeJiOadg+aJgOaciSDCqSDmnKrmnaXpo57pqawgwqkg5rGf6KW/6ISR5o6n56eR5oqA5pyJ6ZmQ5YWs5Y+4IENvcHlyaWdodCDCqSBGbW9kZSBUZWNobm9sb2d5IENvLiwgTHRkLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCiAgICDkuKXnpoHlnKjmnKrnu4/mjojmnYPnmoTmg4XlhrXkuIvvvIzpgJrov4fku7vkvZXlqpLku4vlpI3liLbmraTmlofku7YgVW5hdXRob3JpemVkIGNvcHlpbmcgb2YgdGhpcyBmaWxlLCB2aWEgYW55IG1lZGl1bSBpcyBzdHJpY3RseSBwcm9oaWJpdGVkCiAgICDor6Xmlofku7bmmK/kuJPmnInnmoTmnLrlr4bmlofku7YgUHJvcHJpZXRhcnkgYW5kIGNvbmZpZGVudGlhbAogICAKICAgIENvcHlyaWdodCAyMDIxLW5vdyBGbW9kZSBJbmMuIHN1cHBvcnRAZm1vZGUuY24uIDE4NjA3MDA3MDczLgogICAg5L+d55WZ5omA5pyJ5p2D5YipIEFsbCByaWdodHMgcmVzZXJ2ZWQuCgogICAgUEFUSDovaG9tZS9yeWFuL3dvcmtzcGFjZS9ub3ZhL25vdmEtYWRtaW4vZGlzdC9mbW9kZS1uZy9lc20yMDIyL2xpYi9haWdjL2FnZW50L2FnZW50LnByb21wdC5tanM=`
|
|
10
|
-
|