@autobe/rpc 0.7.1 → 0.7.3
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/lib/AutoBeRpcService.js +37 -78
- package/lib/AutoBeRpcService.js.map +1 -1
- package/package.json +5 -3
- package/src/AutoBeRpcService.ts +5 -84
package/lib/AutoBeRpcService.js
CHANGED
|
@@ -8,90 +8,49 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.AutoBeRpcService = void 0;
|
|
16
|
+
const typia_1 = __importDefault(require("typia"));
|
|
13
17
|
class AutoBeRpcService {
|
|
14
18
|
constructor(props) {
|
|
15
19
|
this.props = props;
|
|
16
20
|
const { agent, listener } = this.props;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
agent.on("prismaValidate", (event) => {
|
|
51
|
-
listener.prismaValidate(event).catch(() => { });
|
|
52
|
-
});
|
|
53
|
-
// INTERFACE
|
|
54
|
-
agent.on("interfaceStart", (event) => {
|
|
55
|
-
listener.interfaceStart(event).catch(() => { });
|
|
56
|
-
});
|
|
57
|
-
agent.on("interfaceEndpoints", (event) => {
|
|
58
|
-
listener.interfaceEndpoints(event).catch(() => { });
|
|
59
|
-
});
|
|
60
|
-
agent.on("interfaceOperations", (event) => {
|
|
61
|
-
listener.interfaceOperations(event).catch(() => { });
|
|
62
|
-
});
|
|
63
|
-
agent.on("interfaceComponents", (event) => {
|
|
64
|
-
listener.interfaceComponents(event).catch(() => { });
|
|
65
|
-
});
|
|
66
|
-
agent.on("interfaceComplement", (event) => {
|
|
67
|
-
listener.interfaceComplement(event).catch(() => { });
|
|
68
|
-
});
|
|
69
|
-
agent.on("interfaceComplete", (event) => {
|
|
70
|
-
listener.interfaceComplete(event).catch(() => { });
|
|
71
|
-
});
|
|
72
|
-
// TEST
|
|
73
|
-
agent.on("testStart", (event) => {
|
|
74
|
-
listener.testStart(event).catch(() => { });
|
|
75
|
-
});
|
|
76
|
-
agent.on("testScenario", (event) => {
|
|
77
|
-
listener.testScenario(event).catch(() => { });
|
|
78
|
-
});
|
|
79
|
-
agent.on("testProgress", (event) => {
|
|
80
|
-
listener.testProgress(event).catch(() => { });
|
|
81
|
-
});
|
|
82
|
-
agent.on("testValidate", (event) => {
|
|
83
|
-
listener.testValidate(event).catch(() => { });
|
|
84
|
-
});
|
|
85
|
-
agent.on("testComplete", (event) => {
|
|
86
|
-
listener.testComplete(event).catch(() => { });
|
|
87
|
-
});
|
|
88
|
-
// REALIZE
|
|
89
|
-
agent.on("realizeStart", (event) => {
|
|
90
|
-
listener.realizeStart(event).catch(() => { });
|
|
91
|
-
});
|
|
92
|
-
agent.on("realizeComplete", (event) => {
|
|
93
|
-
listener.realizeComplete(event).catch(() => { });
|
|
94
|
-
});
|
|
21
|
+
for (const key of [
|
|
22
|
+
"analyzeReview",
|
|
23
|
+
"analyzeComplete",
|
|
24
|
+
"analyzeStart",
|
|
25
|
+
"analyzeWriteDocument",
|
|
26
|
+
"assistantMessage",
|
|
27
|
+
"interfaceComplement",
|
|
28
|
+
"interfaceComplete",
|
|
29
|
+
"interfaceComponents",
|
|
30
|
+
"interfaceEndpoints",
|
|
31
|
+
"interfaceOperations",
|
|
32
|
+
"interfaceStart",
|
|
33
|
+
"prismaComplete",
|
|
34
|
+
"prismaComponents",
|
|
35
|
+
"prismaCorrect",
|
|
36
|
+
"prismaSchemas",
|
|
37
|
+
"prismaStart",
|
|
38
|
+
"prismaValidate",
|
|
39
|
+
"realizeComplete",
|
|
40
|
+
"realizeProgress",
|
|
41
|
+
"realizeStart",
|
|
42
|
+
"realizeValidate",
|
|
43
|
+
"testComplete",
|
|
44
|
+
"testCorrect",
|
|
45
|
+
"testProgress",
|
|
46
|
+
"testScenario",
|
|
47
|
+
"testStart",
|
|
48
|
+
"testValidate",
|
|
49
|
+
"userMessage"
|
|
50
|
+
])
|
|
51
|
+
agent.on(key, (event) => {
|
|
52
|
+
listener[key](event).catch(() => { });
|
|
53
|
+
});
|
|
95
54
|
}
|
|
96
55
|
conversate(content) {
|
|
97
56
|
return this.props.agent.conversate(content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeRpcService.js","sourceRoot":"","sources":["../src/AutoBeRpcService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoBeRpcService.js","sourceRoot":"","sources":["../src/AutoBeRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA,kDAA0B;AAE1B,MAAa,gBAAgB;IAG3B,YAAoC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;QACzE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACvC,KAAK,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YACZ,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;gBACtB,QAAQ,CAAC,GAAG,CAAE,CAAC,KAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,UAAU,CACf,OAAuE;QAEvE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEY,QAAQ;;YACnB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACrC,CAAC;KAAA;IAEY,YAAY;;YACvB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACzC,CAAC;KAAA;IAEY,aAAa;;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC;QACnD,CAAC;KAAA;CACF;AA5BD,4CA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobe/rpc",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "AI backend server code generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@samchon/openapi": "^4.3.3",
|
|
28
|
-
"
|
|
29
|
-
"@autobe/
|
|
28
|
+
"typia": "^9.3.1",
|
|
29
|
+
"@autobe/agent": "^0.7.3",
|
|
30
|
+
"@autobe/interface": "^0.7.3"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"rimraf": "^6.0.1",
|
|
34
|
+
"ts-patch": "^3.3.0",
|
|
33
35
|
"typescript": "~5.8.3"
|
|
34
36
|
},
|
|
35
37
|
"scripts": {
|
package/src/AutoBeRpcService.ts
CHANGED
|
@@ -7,96 +7,17 @@ import {
|
|
|
7
7
|
IAutoBeTokenUsageJson,
|
|
8
8
|
} from "@autobe/interface";
|
|
9
9
|
import { ILlmSchema } from "@samchon/openapi";
|
|
10
|
+
import typia from "typia";
|
|
10
11
|
|
|
11
12
|
export class AutoBeRpcService<Model extends ILlmSchema.Model>
|
|
12
13
|
implements IAutoBeRpcService
|
|
13
14
|
{
|
|
14
15
|
public constructor(private readonly props: AgenticaRpcService.IProps<Model>) {
|
|
15
16
|
const { agent, listener } = this.props;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
agent.on("userMessage", (event) => {
|
|
22
|
-
listener.userMessage!(event).catch(() => {});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// ANALYZE
|
|
26
|
-
agent.on("analyzeStart", (event) => {
|
|
27
|
-
listener.analyzeStart!(event).catch(() => {});
|
|
28
|
-
});
|
|
29
|
-
agent.on("analyzeWriteDocument", (event) => {
|
|
30
|
-
listener.analyzeWriteDocument!(event).catch(() => {});
|
|
31
|
-
});
|
|
32
|
-
agent.on("analyzeReview", (event) => {
|
|
33
|
-
listener.analyzeReview!(event).catch(() => {});
|
|
34
|
-
});
|
|
35
|
-
agent.on("analyzeComplete", (event) => {
|
|
36
|
-
listener.analyzeComplete!(event).catch(() => {});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// PRISMA
|
|
40
|
-
agent.on("prismaStart", (event) => {
|
|
41
|
-
listener.prismaStart!(event).catch(() => {});
|
|
42
|
-
});
|
|
43
|
-
agent.on("prismaComponents", (event) => {
|
|
44
|
-
listener.prismaComponents!(event).catch(() => {});
|
|
45
|
-
});
|
|
46
|
-
agent.on("prismaSchemas", (event) => {
|
|
47
|
-
listener.prismaSchemas!(event).catch(() => {});
|
|
48
|
-
});
|
|
49
|
-
agent.on("prismaComplete", (event) => {
|
|
50
|
-
listener.prismaComplete!(event).catch(() => {});
|
|
51
|
-
});
|
|
52
|
-
agent.on("prismaValidate", (event) => {
|
|
53
|
-
listener.prismaValidate!(event).catch(() => {});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// INTERFACE
|
|
57
|
-
agent.on("interfaceStart", (event) => {
|
|
58
|
-
listener.interfaceStart!(event).catch(() => {});
|
|
59
|
-
});
|
|
60
|
-
agent.on("interfaceEndpoints", (event) => {
|
|
61
|
-
listener.interfaceEndpoints!(event).catch(() => {});
|
|
62
|
-
});
|
|
63
|
-
agent.on("interfaceOperations", (event) => {
|
|
64
|
-
listener.interfaceOperations!(event).catch(() => {});
|
|
65
|
-
});
|
|
66
|
-
agent.on("interfaceComponents", (event) => {
|
|
67
|
-
listener.interfaceComponents!(event).catch(() => {});
|
|
68
|
-
});
|
|
69
|
-
agent.on("interfaceComplement", (event) => {
|
|
70
|
-
listener.interfaceComplement!(event).catch(() => {});
|
|
71
|
-
});
|
|
72
|
-
agent.on("interfaceComplete", (event) => {
|
|
73
|
-
listener.interfaceComplete!(event).catch(() => {});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// TEST
|
|
77
|
-
agent.on("testStart", (event) => {
|
|
78
|
-
listener.testStart!(event).catch(() => {});
|
|
79
|
-
});
|
|
80
|
-
agent.on("testScenario", (event) => {
|
|
81
|
-
listener.testScenario!(event).catch(() => {});
|
|
82
|
-
});
|
|
83
|
-
agent.on("testProgress", (event) => {
|
|
84
|
-
listener.testProgress!(event).catch(() => {});
|
|
85
|
-
});
|
|
86
|
-
agent.on("testValidate", (event) => {
|
|
87
|
-
listener.testValidate!(event).catch(() => {});
|
|
88
|
-
});
|
|
89
|
-
agent.on("testComplete", (event) => {
|
|
90
|
-
listener.testComplete!(event).catch(() => {});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// REALIZE
|
|
94
|
-
agent.on("realizeStart", (event) => {
|
|
95
|
-
listener.realizeStart!(event).catch(() => {});
|
|
96
|
-
});
|
|
97
|
-
agent.on("realizeComplete", (event) => {
|
|
98
|
-
listener.realizeComplete!(event).catch(() => {});
|
|
99
|
-
});
|
|
17
|
+
for (const key of typia.misc.literals<keyof IAutoBeRpcListener>())
|
|
18
|
+
agent.on(key, (event) => {
|
|
19
|
+
listener[key]!(event as any).catch(() => {});
|
|
20
|
+
});
|
|
100
21
|
}
|
|
101
22
|
|
|
102
23
|
public conversate(
|