@vectorx/functions-framework 0.0.0-beta-20251112071234 → 0.0.0-beta-20251209102230

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 CHANGED
@@ -75,7 +75,6 @@ class AgentServerFramework {
75
75
  return __awaiter(this, void 0, void 0, function* () {
76
76
  const { functionsConfigFile } = this.options;
77
77
  let cloudFunctionConfig;
78
- console.log("==== process.env.OPEN_PLATFORM_STAGE ====", process.env.OPEN_PLATFORM_STAGE);
79
78
  if (!process.env.OPEN_PLATFORM_STAGE) {
80
79
  process.stdout.write(chalk_1.default.yellow(`未设置 OPEN_PLATFORM_STAGE 环境变量,使用默认值: development\n`));
81
80
  process.env.OPEN_PLATFORM_STAGE = "development";
@@ -140,7 +140,6 @@ const wrapEventFunction = (execute, projectConfig) => {
140
140
  result = yield execute(event, context);
141
141
  }
142
142
  catch (e) {
143
- console.log("============>>>>>>>>>> function wrapper error ", e);
144
143
  ctx.state.error = e;
145
144
  if (hasSwitchSSEMode) {
146
145
  const sse = (_a = ctx.sse) === null || _a === void 0 ? void 0 : _a.call(ctx);
@@ -150,9 +149,7 @@ const wrapEventFunction = (execute, projectConfig) => {
150
149
  data: e.message,
151
150
  comment: "uncaught-exception-from-user-code",
152
151
  };
153
- console.log("============>>>>>>>>>> errorEvent ", errorEvent);
154
152
  sse.emit("error", errorEvent);
155
- console.log("============>>>>>>>>>> sse.end(errorEvent) ");
156
153
  sse.end(errorEvent);
157
154
  }
158
155
  }
@@ -25,6 +25,7 @@ function apmMiddleware() {
25
25
  kit_agent_desc: agentInfo.desc,
26
26
  kit_agent_id: agentInfo.agentId,
27
27
  kit_agent_version: agentInfo.version,
28
+ kit_agent_name: agentInfo.name,
28
29
  context_artifactVersion: kitInfo.agentRuntimeVersion,
29
30
  kit_agent_runtime_version: kitInfo.agentRuntimeVersion,
30
31
  kit_function_framework_version: kitInfo.functionsFrameworkVersion,
@@ -27,6 +27,7 @@ function contextInjectionMiddleware(frameworkOptions, projectConfig) {
27
27
  agentId: projectConfig.agentId,
28
28
  version: projectConfig.version || "",
29
29
  desc: projectConfig.desc || "",
30
+ name: projectConfig.name || "",
30
31
  };
31
32
  yield next();
32
33
  });
package/lib/server.js CHANGED
@@ -36,19 +36,6 @@ function createServer(options, router, projectConfig) {
36
36
  const app = new koa_1.default();
37
37
  app.use(corsMiddleware());
38
38
  app.use((0, middlewares_1.logsQueryMiddleware)());
39
- app.use((ctx, next) => __awaiter(this, void 0, void 0, function* () {
40
- try {
41
- const h = ctx.request.headers || {};
42
- console.log("[REQ-IN]", ctx.method, ctx.url, {
43
- "content-type": h["content-type"],
44
- "content-length": h["content-length"],
45
- "transfer-encoding": h["transfer-encoding"],
46
- });
47
- }
48
- catch (e) {
49
- }
50
- yield next();
51
- }));
52
39
  app.use((0, middlewares_1.contextInjectionMiddleware)(options, projectConfig));
53
40
  app.use((0, middlewares_1.eventIdMiddleware)());
54
41
  app.use((0, middlewares_1.apmMiddleware)());
@@ -85,29 +72,6 @@ function createServer(options, router, projectConfig) {
85
72
  return (0, unified_responder_1.sendResponse)(ctx, undefined, (0, error_1.newBadRequestErr)(err), 400);
86
73
  },
87
74
  }));
88
- app.use((ctx, next) => __awaiter(this, void 0, void 0, function* () {
89
- var _a, _b;
90
- try {
91
- const fields = ((_a = ctx.request) === null || _a === void 0 ? void 0 : _a.body) ? Object.keys(ctx.request.body) : [];
92
- const files = (_b = ctx.request) === null || _b === void 0 ? void 0 : _b.files;
93
- console.log("[REQ-PARSED] Body", JSON.stringify(ctx.request.body, null, 2));
94
- console.log("[REQ-PARSED] files", JSON.stringify(ctx.request.files, null, 2));
95
- }
96
- catch (_) { }
97
- yield next();
98
- }));
99
- app.use((ctx, next) => __awaiter(this, void 0, void 0, function* () {
100
- if (!(ctx.request.files || ctx.request.body || ctx.state.isTimeout)) {
101
- try {
102
- console.log("==== ctx.request.files ====", ctx.request.files);
103
- console.log("==== ctx.request.body ====", ctx.request.body);
104
- }
105
- catch (err) {
106
- return (0, unified_responder_1.sendResponse)(ctx, undefined, (0, error_1.newBadRequestErr)(err), 400);
107
- }
108
- }
109
- yield next();
110
- }));
111
75
  app.use((0, middlewares_1.openGwRequestMiddleware)(projectConfig.agentId));
112
76
  app.use((0, middlewares_1.functionRouteMiddleware)(router, projectConfig));
113
77
  const httpServer = http_1.default.createServer(app.callback());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorx/functions-framework",
3
- "version": "0.0.0-beta-20251112071234",
3
+ "version": "0.0.0-beta-20251209102230",
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.0.0-beta-20251112071234",
28
+ "@vectorx/ai-types": "0.0.0-beta-20251209102230",
29
29
  "async_hooks": "^1.0.0",
30
30
  "chalk": "4",
31
31
  "commander": "^12.1.0",
@@ -19,6 +19,7 @@ export interface ProjectConfig {
19
19
  agentId: string;
20
20
  version: string;
21
21
  desc: string;
22
+ name: string;
22
23
  "@vectorx/agent-runtime": string;
23
24
  "@vectorx/functions-framework": string;
24
25
  }