18 lines
497 B
TypeScript
18 lines
497 B
TypeScript
export const getInternalBridgeConfig = () => {
|
|
const baseUrl =
|
|
process.env.TJWATER_AGENT_INTERNAL_BASE_URL ?? "http://127.0.0.1:8787";
|
|
const internalToken = (
|
|
process.env.AGENT_INTERNAL_TOKEN ??
|
|
process.env.TJWATER_AGENT_INTERNAL_TOKEN ??
|
|
""
|
|
).trim();
|
|
|
|
if (!internalToken) {
|
|
throw new Error(
|
|
"internal Agent tool bridge is not configured; set the same AGENT_INTERNAL_TOKEN on the Agent and OpenCode processes",
|
|
);
|
|
}
|
|
|
|
return { baseUrl, internalToken };
|
|
};
|