@vectorx/cloud-toolkit 0.1.3 → 0.3.1
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/agent.kit.js +4 -3
- package/lib/index.js +3 -0
- package/lib/utils/cos-uploader.js +2 -2
- package/lib/utils/to-hump.js +5 -0
- package/package.json +6 -5
- package/types/agent.kit.d.ts +5 -3
- package/types/index.d.ts +2 -1
- package/types/utils/to-hump.d.ts +1 -0
package/lib/agent.kit.js
CHANGED
|
@@ -34,7 +34,7 @@ function validatePort(port, name = "端口") {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
function startRcbFramework(workDir_1, port_1, watch_1) {
|
|
37
|
-
return __awaiter(this, arguments, void 0, function* (workDir, port, watch, nodePath = "node") {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (workDir, port, watch, nodePath = "node", options) {
|
|
38
38
|
return new Promise((resolve, reject) => {
|
|
39
39
|
const args = [
|
|
40
40
|
...(watch ? ["--watch"] : []),
|
|
@@ -47,6 +47,7 @@ function startRcbFramework(workDir_1, port_1, watch_1) {
|
|
|
47
47
|
"localhost,127.0.0.1",
|
|
48
48
|
"--config",
|
|
49
49
|
"agent-cloudbase-functions.json",
|
|
50
|
+
...((options === null || options === void 0 ? void 0 : options.enableRedLangfuse) ? ["--enableRedLangfuse"] : []),
|
|
50
51
|
];
|
|
51
52
|
try {
|
|
52
53
|
const packagePath = require.resolve("@vectorx/functions-framework/package.json");
|
|
@@ -95,7 +96,7 @@ function startRcbFramework(workDir_1, port_1, watch_1) {
|
|
|
95
96
|
}
|
|
96
97
|
function startDev(options) {
|
|
97
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const { workDir = process.cwd(), port: specifiedPort, simulatorPort: specifiedSimulatorPort, watch = false, } = options;
|
|
99
|
+
const { workDir = process.cwd(), port: specifiedPort, simulatorPort: specifiedSimulatorPort, watch = false, enableRedLangfuse = false, } = options;
|
|
99
100
|
if (!fs_1.default.existsSync(workDir)) {
|
|
100
101
|
throw new Error(`目录不存在: ${workDir}`);
|
|
101
102
|
}
|
|
@@ -126,7 +127,7 @@ function startDev(options) {
|
|
|
126
127
|
else {
|
|
127
128
|
simulatorPort = yield (0, port_finder_1.findAvailablePort)(port + 1);
|
|
128
129
|
}
|
|
129
|
-
yield startRcbFramework(workDir, port, watch);
|
|
130
|
+
yield startRcbFramework(workDir, port, watch, undefined, { enableRedLangfuse });
|
|
130
131
|
const simulator = new agent_simulator_1.AgentSimulator({
|
|
131
132
|
port: simulatorPort,
|
|
132
133
|
agentServerUrl: `http://localhost:${port}/v1/aiagent/agents/demo-agent`,
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Uploader = void 0;
|
|
17
18
|
__exportStar(require("./agent.kit"), exports);
|
|
19
|
+
var cos_uploader_1 = require("./utils/cos-uploader");
|
|
20
|
+
Object.defineProperty(exports, "Uploader", { enumerable: true, get: function () { return cos_uploader_1.Uploader; } });
|
|
18
21
|
__exportStar(require("./container"), exports);
|
|
19
22
|
__exportStar(require("./services"), exports);
|
|
20
23
|
__exportStar(require("./utils/config-merger"), exports);
|
|
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Uploader = void 0;
|
|
18
18
|
const cos_nodejs_sdk_v5_1 = __importDefault(require("cos-nodejs-sdk-v5"));
|
|
19
|
-
const
|
|
19
|
+
const to_hump_1 = require("./to-hump");
|
|
20
20
|
class Uploader {
|
|
21
21
|
constructor(args) {
|
|
22
22
|
this.bizName = args.bizName;
|
|
@@ -85,7 +85,7 @@ class Uploader {
|
|
|
85
85
|
Object.keys(resp.headers).forEach((v) => {
|
|
86
86
|
var _a;
|
|
87
87
|
if (v.startsWith("x-ros-")) {
|
|
88
|
-
const key = (0,
|
|
88
|
+
const key = (0, to_hump_1.toHump)(v.split("x-ros-")[1]);
|
|
89
89
|
payload[key] = (_a = resp.headers) === null || _a === void 0 ? void 0 : _a[v];
|
|
90
90
|
}
|
|
91
91
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectorx/cloud-toolkit",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "VectorX Cloud Toolkit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -21,23 +21,24 @@
|
|
|
21
21
|
"node": ">=18.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vectorx/agent-simulator": "0.
|
|
25
|
-
"@vectorx/functions-framework": "0.
|
|
24
|
+
"@vectorx/agent-simulator": "0.4.0",
|
|
25
|
+
"@vectorx/functions-framework": "0.4.0",
|
|
26
26
|
"archiver": "^5.3.1",
|
|
27
27
|
"cos-nodejs-sdk-v5": "2.x",
|
|
28
28
|
"crypto": "^1.0.1",
|
|
29
29
|
"dayjs": "^1.11.13",
|
|
30
30
|
"inversify": "^7.5.2",
|
|
31
|
+
"langfuse": "^3.38.4",
|
|
31
32
|
"lodash": "^4.17.21",
|
|
32
33
|
"log-symbols": "^3.0.0",
|
|
33
34
|
"lowdb": "^1.0.0",
|
|
34
35
|
"make-dir": "^3.0.0",
|
|
35
36
|
"node-fetch": "^2.6.0",
|
|
37
|
+
"open": "^7.4.2",
|
|
36
38
|
"ora": "^4.0.2",
|
|
37
39
|
"semver": "^7.5.4",
|
|
38
40
|
"terminal-link": "^2.1.1",
|
|
39
|
-
"uuid": "^11.1.0"
|
|
40
|
-
"open": "^7.4.2"
|
|
41
|
+
"uuid": "^11.1.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/archiver": "^5.3.2",
|
package/types/agent.kit.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AgentSimulator } from "@vectorx/agent-simulator";
|
|
2
1
|
export interface AgentDevOptions {
|
|
3
2
|
workDir?: string;
|
|
4
3
|
port?: number;
|
|
@@ -6,6 +5,7 @@ export interface AgentDevOptions {
|
|
|
6
5
|
watch?: boolean;
|
|
7
6
|
open?: boolean;
|
|
8
7
|
nodePath?: string;
|
|
8
|
+
enableRedLangfuse?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface IUploadOptions {
|
|
11
11
|
version: string;
|
|
@@ -54,11 +54,13 @@ export interface IDeployService {
|
|
|
54
54
|
desc: string;
|
|
55
55
|
}): Promise<DeployResult>;
|
|
56
56
|
}
|
|
57
|
-
export declare function startRcbFramework(workDir: string, port: number, watch: boolean, nodePath?: string
|
|
57
|
+
export declare function startRcbFramework(workDir: string, port: number, watch: boolean, nodePath?: string, options?: {
|
|
58
|
+
enableRedLangfuse?: boolean;
|
|
59
|
+
}): Promise<void>;
|
|
58
60
|
export declare function startDev(options: AgentDevOptions): Promise<{
|
|
59
61
|
port: number;
|
|
60
62
|
simulatorPort: number;
|
|
61
|
-
simulator:
|
|
63
|
+
simulator: any;
|
|
62
64
|
rcbProcess: any;
|
|
63
65
|
}>;
|
|
64
66
|
export declare function build(options: AgentBuildOptions): Promise<BuildResult>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./agent.kit";
|
|
2
|
+
export { Uploader } from "./utils/cos-uploader";
|
|
2
3
|
export * from "./container";
|
|
3
4
|
export * from "./services";
|
|
4
5
|
export * from "./utils/config-merger";
|
|
@@ -9,4 +10,4 @@ export * from "./utils/tracker";
|
|
|
9
10
|
export * from "./utils/port-finder";
|
|
10
11
|
export * from "./utils/open-browser";
|
|
11
12
|
export * from "./utils/output";
|
|
12
|
-
export
|
|
13
|
+
export { TokenRequest, TokenResponse, UploadTempPermit, InternalTokenRequest, } from "./services/upload-service";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toHump: (str: string) => string;
|