@vectorx/functions-framework 0.1.0 → 0.1.2
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/framework.js +1 -14
- package/lib/function-wrapper.js +1 -0
- package/lib/sse.js +1 -1
- package/package.json +2 -2
package/lib/framework.js
CHANGED
|
@@ -109,7 +109,7 @@ class AgentServerFramework {
|
|
|
109
109
|
1. 配置文件 'project.config.json' 存在于项目根目录
|
|
110
110
|
2. 配置文件格式正确,示例:
|
|
111
111
|
{
|
|
112
|
-
"agentId": "示例
|
|
112
|
+
"agentId": "示例 agentId ",
|
|
113
113
|
"version": "0.0.1",
|
|
114
114
|
"desc": "发布示例",
|
|
115
115
|
}
|
|
@@ -138,16 +138,6 @@ class AgentServerFramework {
|
|
|
138
138
|
}
|
|
139
139
|
try {
|
|
140
140
|
cloudFunctionConfig = (0, function_loader_1.loadFunctionsConfig)(functionsConfigFile);
|
|
141
|
-
const { agentId } = cloudFunctionConfig;
|
|
142
|
-
if (!agentId) {
|
|
143
|
-
throw new Error(`
|
|
144
|
-
❌ 函数加载失败: agentId is required in cloudbase-functions.json
|
|
145
|
-
|
|
146
|
-
请检查:
|
|
147
|
-
1. 配置文件是否存在: ${functionsConfigFile}
|
|
148
|
-
2. 配置文件格式是否正确
|
|
149
|
-
`);
|
|
150
|
-
}
|
|
151
141
|
for (const fn of cloudFunctionConfig.functions) {
|
|
152
142
|
const mainFn = (0, function_loader_1.loadFunction)(cloudFunctionConfig.functionsRoot, fn);
|
|
153
143
|
if (!mainFn) {
|
|
@@ -178,9 +168,6 @@ class AgentServerFramework {
|
|
|
178
168
|
配置文件路径: ${functionsConfigFile}
|
|
179
169
|
`);
|
|
180
170
|
}
|
|
181
|
-
console.log(`
|
|
182
|
-
projectConfig: ${JSON.stringify(projectConfig)}
|
|
183
|
-
`);
|
|
184
171
|
const server = (0, server_1.createServer)(this.options, this.router, projectConfig);
|
|
185
172
|
return server;
|
|
186
173
|
});
|
package/lib/function-wrapper.js
CHANGED
package/lib/sse.js
CHANGED
|
@@ -65,7 +65,7 @@ class ServerSentEvent extends events_1.EventEmitter {
|
|
|
65
65
|
Connection: "keep-alive",
|
|
66
66
|
};
|
|
67
67
|
if (ctx.state && ctx.state.eventID) {
|
|
68
|
-
headers["
|
|
68
|
+
headers["x-open-agent-trace-id"] = ctx.state.eventID;
|
|
69
69
|
}
|
|
70
70
|
ctx.set(headers);
|
|
71
71
|
ctx.status = 200;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectorx/functions-framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "VectorX Functions Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"node": ">=18.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@vectorx/ai-types": "0.1.
|
|
28
|
+
"@vectorx/ai-types": "0.1.2",
|
|
29
29
|
"commander": "^12.1.0",
|
|
30
30
|
"nodemon": "^3.1.10",
|
|
31
31
|
"async_hooks": "^1.0.0",
|