feat: upgrade investigation and presentation runtime
Generic Container CI/CD / test-build-publish (push) Successful in 1m6s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m7s

This commit is contained in:
2026-10-30 17:30:19 +08:00
parent 3b52a0ddab
commit 6336157ff4
104 changed files with 6541 additions and 961 deletions
+9
View File
@@ -1,4 +1,6 @@
import dotenv from "dotenv";
import { createHash } from "node:crypto";
import { hostname } from "node:os";
import { z } from "zod";
import { loadAgentModelConfig, type AgentModelConfig } from "./chat/modelConfig.js";
@@ -7,6 +9,11 @@ import { DEFAULT_SESSION_WORKSPACE_ROOT } from "./runtime/conversationWorkspace.
// 本地开发可在项目根目录放 .local.env;已存在的系统环境变量优先级更高。
dotenv.config({ path: ".local.env", override: false });
const defaultAgentInstanceId = `agent-${createHash("sha256")
.update(`${hostname()}\0${process.cwd()}\0${process.env.PORT ?? "8787"}`)
.digest("hex")
.slice(0, 24)}`;
const optionalString = () =>
z.preprocess(
(value) => {
@@ -43,6 +50,8 @@ const envSchema = z
PORT: z.coerce.number().int().positive().default(8787),
// HTTP 服务监听地址。
HOST: z.string().default("127.0.0.1"),
// Stable owner identity for durable task sessions. Set explicitly in replicated deployments.
AGENT_INSTANCE_ID: z.string().trim().min(1).max(128).default(defaultAgentInstanceId),
// Product Server base URL used to verify browser identity and project scope.
TJWATER_SERVER_BASE_URL: z.string().url().default("http://127.0.0.1:8000"),
// 工况任务调用 Server 的最长等待时间,必须短于两次租约心跳之间的间隔。