@tokagent/tokagentos 2.0.10 → 2.0.11
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/package.json
CHANGED
package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/dashboard-routes.ts
CHANGED
|
@@ -89,9 +89,25 @@ function buildConfigJs(runtime: IAgentRuntime): string {
|
|
|
89
89
|
10: "https://optimistic.etherscan.io",
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
// In client-mode the dashboard talks to the upstream gateway DIRECTLY via
|
|
93
|
+
// CORS rather than forwarding through the local agent. This sidesteps three
|
|
94
|
+
// bugs in vanilla elizaOS that the scaffolder pins (the auth-gate runs
|
|
95
|
+
// before plugin route resolution and rejects /v1/* with 401 when the
|
|
96
|
+
// operator has TOKAGENT_API_TOKEN set; the runtime-plugin-routes shim
|
|
97
|
+
// historically only exposed res.json on the inline object returned by
|
|
98
|
+
// .status(); the plugin-prefixed mount path drops JSON body parsing). The
|
|
99
|
+
// Railway-hosted gateway has all three patched in its own fork. Server-mode
|
|
100
|
+
// keeps PROXY_BASE="" so same-origin calls hit the plugin's own
|
|
101
|
+
// serverAuthRoutes handlers locally — no upstream needed there.
|
|
102
|
+
const billingMode =
|
|
103
|
+
get("BILLING_MODE").toLowerCase() === "client" ? "client" : "server";
|
|
104
|
+
const proxyBase =
|
|
105
|
+
billingMode === "client"
|
|
106
|
+
? get("TOKAGENT_GATEWAY_URL").replace(/\/+$/, "")
|
|
107
|
+
: "";
|
|
108
|
+
|
|
92
109
|
const config = {
|
|
93
|
-
|
|
94
|
-
PROXY_BASE: "",
|
|
110
|
+
PROXY_BASE: proxyBase,
|
|
95
111
|
CHAIN_ID: chainId,
|
|
96
112
|
CHAIN_NAME: chainNames[chainId] ?? `chain-${chainId}`,
|
|
97
113
|
CHAIN_RPC_URL: get("BILLING_CHAIN_RPC_URL"),
|