@agent-os-lab/agent-game-sdk 0.1.6 → 0.1.7

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.
Files changed (3) hide show
  1. package/README.md +3 -2
  2. package/USAGE.md +4 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,6 @@ import { mountAgentGameOffice } from "@agent-os-lab/agent-game-sdk/office";
14
14
 
15
15
  const client = new AgentGameRuntimeBrowserClient({
16
16
  baseUrl: "",
17
- tokenPath: "/api/agent-game-runtime-token",
18
17
  accessToken: async () => getScopedToken(),
19
18
  });
20
19
 
@@ -94,7 +93,9 @@ Built-in room types are `office`, `auditorium`, and `gym`. `capacity` is optiona
94
93
 
95
94
  Runtime statuses stay unchanged. The SDK locally distributes `idle` and `resting` agents across ambient areas such as lounge, pantry, gym, and reading/bookcase anchors so inactive agents do not all gather at the sofa.
96
95
 
97
- Browser clients should call an application BFF endpoint. Keep the AgentOS service API key on the server; the SDK server client forwards it to Agent Game Runtime:
96
+ Browser clients should call an application BFF endpoint. By default the browser client requests `/api/agent-game-runtime-token` on the same origin. Configure `tokenPath` only if your application exposes that BFF route at a different path.
97
+
98
+ Keep the AgentOS service API key on the server; the SDK server client forwards it to Agent Game Runtime. The runtime token endpoint path is SDK-managed and defaults to Agent Game Runtime's `/api/v1/game-runtime-token`, so application code only needs `baseUrl` and `apiKey`:
98
99
 
99
100
  ```ts
100
101
  import { AgentGameRuntimeServerClient } from "@agent-os-lab/agent-game-sdk";
package/USAGE.md CHANGED
@@ -73,16 +73,16 @@ import { AgentGameRuntimeBrowserClient } from "@agent-os-lab/agent-game-sdk";
73
73
 
74
74
  const browserClient = new AgentGameRuntimeBrowserClient({
75
75
  baseUrl: "",
76
- tokenPath: "/api/agent-game-runtime-token",
77
76
  });
78
77
  ```
79
78
 
79
+ The default browser token path is `/api/agent-game-runtime-token`. Configure `tokenPath` only when your application exposes its BFF/proxy endpoint at a different same-origin path. This browser path is not the Agent Game Runtime service path.
80
+
80
81
  If your application backend expects an application-scoped browser token, provide `accessToken`. This token is for your BFF/proxy, not for Agent Game Runtime directly.
81
82
 
82
83
  ```ts
83
84
  const browserClient = new AgentGameRuntimeBrowserClient({
84
85
  baseUrl: "",
85
- tokenPath: "/api/agent-game-runtime-token",
86
86
  accessToken: async () => getScopedApplicationToken(),
87
87
  });
88
88
  ```
@@ -141,7 +141,6 @@ import { mountAgentGameOffice } from "@agent-os-lab/agent-game-sdk/office";
141
141
 
142
142
  const client = new AgentGameRuntimeBrowserClient({
143
143
  baseUrl: "",
144
- tokenPath: "/api/agent-game-runtime-token",
145
144
  });
146
145
 
147
146
  const view = await mountAgentGameOffice(container, {
@@ -318,6 +317,8 @@ AGENT_GAME_RUNTIME_BASE_URL=http://localhost:3107 AGENTOS_API_KEY=... bun run de
318
317
 
319
318
  Open `http://localhost:7357`.
320
319
 
320
+ The demo exposes the browser BFF route at `/api/agent-game-runtime-token`. It does not require `AGENT_GAME_RUNTIME_TOKEN_PATH`; the SDK server client owns the runtime token path and uses Agent Game Runtime's default `/api/v1/game-runtime-token`.
321
+
321
322
  Set `PORT=7358` or another value to change the port.
322
323
 
323
324
  ## Publish
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-os-lab/agent-game-sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src",