@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokagent/tokagentos",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "tokagentOS CLI - Create and upgrade tokagentOS project templates",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokagent/plugin-tokagent-billing",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "elizaOS plugin: Web3 credit-billing routes and middleware for the tokagentos LLM gateway.",
5
5
  "type": "module",
6
6
  "publishConfig": { "access": "public" },
@@ -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
- // Same-origin: the dashboard is served by the same agent API server.
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"),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "generatedAt": "2026-05-19T11:38:41.018Z",
3
+ "generatedAt": "2026-05-19T12:22:51.161Z",
4
4
  "repoUrl": "https://github.com/elizaos/eliza",
5
5
  "templates": [
6
6
  {