agentglow 0.1.0 → 0.2.0

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 (41) hide show
  1. package/README.md +38 -3
  2. package/dist/chunks/KitScene-BuFtYuhc.js +2737 -0
  3. package/dist/chunks/index-BPyTLdiF.js +792 -0
  4. package/dist/chunks/index-Bo5HRf-O.js +784 -0
  5. package/dist/chunks/index-C42Ihyo1.js +605 -0
  6. package/dist/chunks/index-C5YqtHnC.js +677 -0
  7. package/dist/chunks/index-Cyv7bII1.js +818 -0
  8. package/dist/chunks/index-D0UvupqM.js +1143 -0
  9. package/dist/chunks/index-D733n3Hf.js +1086 -0
  10. package/dist/chunks/index-DCmhxN8v.js +1010 -0
  11. package/dist/chunks/index-DO9SAG-u.js +753 -0
  12. package/dist/chunks/index-Dn6oRasS.js +887 -0
  13. package/dist/chunks/index-HyfZ0ePz.js +838 -0
  14. package/dist/chunks/index-XMOz-HBf.js +492 -0
  15. package/dist/chunks/index-ZT88hgW-.js +763 -0
  16. package/dist/chunks/index-e6egU2Q6.js +889 -0
  17. package/dist/chunks/index-jLXx_Wgk.js +68 -0
  18. package/dist/chunks/index-tonipLb2.js +980 -0
  19. package/dist/index.js +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/AgentScene.d.ts +14 -1
  22. package/dist/types/world.d.ts +59 -0
  23. package/package.json +1 -1
  24. package/dist/chunks/ClusterBall-CPsd6JvJ.js +0 -1489
  25. package/dist/chunks/index-0Bqa57T_.js +0 -786
  26. package/dist/chunks/index-4JCQqMml.js +0 -831
  27. package/dist/chunks/index-55W5crSg.js +0 -63
  28. package/dist/chunks/index-78lWZCrQ.js +0 -984
  29. package/dist/chunks/index-Bv6_kdaq.js +0 -768
  30. package/dist/chunks/index-Cgb5ir1r.js +0 -688
  31. package/dist/chunks/index-CqVCWpP7.js +0 -796
  32. package/dist/chunks/index-D1O5v601.js +0 -1065
  33. package/dist/chunks/index-DOoA9htC.js +0 -1181
  34. package/dist/chunks/index-K__sPGRy.js +0 -1134
  35. package/dist/chunks/index-N0zWN8NS.js +0 -857
  36. package/dist/chunks/index-NiYqQci9.js +0 -936
  37. package/dist/chunks/index-PQRnbPiJ.js +0 -565
  38. package/dist/chunks/index-VOXn1m-Q.js +0 -848
  39. package/dist/chunks/index-o4vs5msj.js +0 -837
  40. package/dist/chunks/index-yos7IepY.js +0 -890
  41. package/dist/chunks/spread-CWdeDFd9.js +0 -35
package/README.md CHANGED
@@ -77,6 +77,9 @@ export default function Live() {
77
77
  | `source` | `string` | `""` | Base URL of the agentglow server. `""` means same origin. The scene reads `${source}/live/stream` (SSE), `/live/graph` and `/live/health`. |
78
78
  | `hud` | `boolean` | `true` | Show the glass HUD: counts, event ticker and the agent inspector panel. |
79
79
  | `sim` | `boolean` | `false` | Use the built-in simulator instead of a server. |
80
+ | `scope` | `string` | none | Only show agents in this scope (a user or tenant id). Sent as the `X-AgentGlow-Scope` header, also as `scope` in the `POST /live/run` body. With a token, the token decides. |
81
+ | `run` | `string` | none | Only show this one run. Sent as the `X-AgentGlow-Run` header. |
82
+ | `token` | `string` | none | Token minted by your backend. Sent as `Authorization: Bearer <token>` on every `/live/*` request, never in a URL. |
80
83
  | `style` | `CSSProperties` | none | Applied to the container (set a `height` here or on a parent). |
81
84
  | `className` | `string` | none | Added to the container. |
82
85
 
@@ -85,7 +88,31 @@ The package also exports `THEMES` (the list of theme ids), `THEME_INFO` (names a
85
88
 
86
89
  If the server exposes `POST /live/run`, the HUD shows a **Run agents** button. Otherwise the button stays hidden.
87
90
 
88
- A cross-origin `source` requires the server to send CORS headers for `/live/*`.
91
+ A cross-origin `source` requires the server to send CORS headers for `/live/*` (allowing the `Authorization`
92
+ and `X-AgentGlow-*` request headers if you use them).
93
+
94
+ When `scope` or `run` is set, the HUD shows a chip (`scope: user-123`) so viewers know the view is filtered.
95
+ If the server answers 401, the HUD shows "not authorized for this scope" and does not fall back to the simulator.
96
+
97
+ ### Show each user only their agents
98
+
99
+ Your backend mints a short-lived token for the signed-in user (the token carries the scope; see the
100
+ [root README](https://github.com/Nideesh1/agentglow#readme) and [SPEC](https://github.com/Nideesh1/agentglow/blob/main/docs/SPEC.md)
101
+ for the format), and the page passes it through:
102
+
103
+ ```tsx
104
+ function MyAgents({ userId }: { userId: string }) {
105
+ const [token, setToken] = useState<string>();
106
+ useEffect(() => {
107
+ fetch("/api/agentglow-token").then((r) => r.json()).then((j) => setToken(j.token));
108
+ }, [userId]);
109
+ if (!token) return null;
110
+ return <AgentScene source="https://agentglow.example.com" scope={userId} token={token} style={{ height: 600 }} />;
111
+ }
112
+ ```
113
+
114
+ The stream is read with `fetch()` (not `EventSource`) so these headers go on every request; it reconnects with
115
+ backoff on its own. Changing `scope`, `run` or `token` reconnects and clears the previous view.
89
116
 
90
117
  ## Themes
91
118
 
@@ -115,6 +142,12 @@ A cross-origin `source` requires the server to send CORS headers for `/live/*`.
115
142
  | ![city](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/city.jpg) **city** | ![ocean](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/ocean.jpg) **ocean** | ![subway](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/subway.jpg) **subway** |
116
143
  | ![circuit](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/circuit.jpg) **circuit** | ![tunnel](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/tunnel.jpg) **tunnel** | ![flow](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/flow.jpg) **flow** |
117
144
 
145
+ ## Layout
146
+
147
+ Agents are always the center of the scene; the knowledge graph and MCP servers appear at the side only when used. Stats
148
+ sit in a slim top bar and agents/events/selection in a collapsible right sidebar (a thin rail in small embeds). The
149
+ camera fits the free area and batches spawns into one smooth zoom.
150
+
118
151
  ## Many agents
119
152
 
120
153
  Above 12 live agents, older runs auto-group into clickable glowing clusters and the newest ~10 stay in full
@@ -124,7 +157,8 @@ detail, so a scene stays readable (and ~60 fps) with hundreds of agents.
124
157
 
125
158
  All scenes on a page share one world model. Several `<AgentScene/>`s with the **same** `source` (or all with
126
159
  `sim`) share a single connection and show the same agents, so they work fine side by side. Scenes with
127
- **different** sources on one page aren't supported: the most recently mounted source wins.
160
+ **different** sources (or different `scope` / `run` / `token`) on one page aren't supported: the most recently
161
+ mounted one wins.
128
162
 
129
163
  ## Develop
130
164
 
@@ -136,6 +170,7 @@ npm run build:app # → ../backend/agentglow/static (served by `agentglow ser
136
170
  ```
137
171
 
138
172
  In the app, `/` is the theme gallery and `/<theme>` is a full-screen scene. It accepts `?sim=1`,
139
- `?source=http://host:8100` and `?hud=0`.
173
+ `?source=http://host:8100`, `?hud=0` and `?run=<id>` (a shareable "watch this run" link). Scope and token are
174
+ props only: they are never read from the URL.
140
175
 
141
176
  MIT License