@brickkit/cli 0.16.0-beta.1 → 0.16.0-beta.3

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 (49) hide show
  1. package/README.md +35 -8
  2. package/dashboard-dist/{api-reference-C2_JX174.js → api-reference-ZQs4Z4Yd.js} +71 -71
  3. package/dashboard-dist/app.css +1 -1
  4. package/dashboard-dist/app.js +12 -12
  5. package/dashboard-dist/{client-DsITZplk.js → client-CFM1S4Xv.js} +1 -1
  6. package/dashboard-dist/{core-sW89OSz5.js → core-VNHGFYB7.js} +1 -1
  7. package/dashboard-dist/{docs-D3U7gUWq.js → docs-CM2krp6H.js} +2 -2
  8. package/dashboard-dist/kit.js +1 -1
  9. package/dashboard-dist/popover-CVY1eRNY.js +1 -0
  10. package/dashboard-dist/theme.css +48 -39
  11. package/dist/bin.js +3 -2
  12. package/dist/bin.js.map +1 -1
  13. package/dist/build.js +6 -1
  14. package/dist/build.js.map +1 -1
  15. package/dist/dashboard-host.js +2594 -889
  16. package/dist/dashboard-host.js.map +1 -1
  17. package/dist/dashboard-protocol.js +10 -6
  18. package/dist/dashboard-protocol.js.map +1 -1
  19. package/dist/dashboard.d.ts +3 -3
  20. package/dist/dev-inspector.js +111 -0
  21. package/dist/dev-inspector.js.map +1 -0
  22. package/dist/dev-worker.js +1 -102
  23. package/dist/dev-worker.js.map +1 -1
  24. package/dist/package.js +5 -0
  25. package/dist/package.js.map +1 -0
  26. package/dist/production-dashboard.js +27 -2
  27. package/dist/production-dashboard.js.map +1 -1
  28. package/dist/production-dashboard2.d.ts +5 -0
  29. package/dist/project.js +2 -3
  30. package/dist/project.js.map +1 -1
  31. package/dist/vite.js +2 -1
  32. package/dist/vite.js.map +1 -1
  33. package/inspector-dist/NOTICE +3 -1
  34. package/inspector-dist/client/assets/{app-Wfnqu2Ic.css → app-PJHZvcxl.css} +49 -40
  35. package/inspector-dist/client/assets/{manifest-cfc09adc.js → manifest-274ef876.js} +1 -1
  36. package/inspector-dist/client/assets/{root-CVescmwt.css → root-CPvk93Fe.css} +49 -40
  37. package/inspector-dist/server/assets/{app-w0nTXgJd.js → app-DdYuYhBk.js} +89 -17
  38. package/inspector-dist/server/assets/{functions-B9XwHSzK.js → functions-BebJWj30.js} +2 -2
  39. package/inspector-dist/server/assets/{serialization-DsMds3lJ.js → serialization-Cgu5b7aC.js} +1 -1
  40. package/inspector-dist/server/assets/{token-CvvD8Y5H.js → token-3-nUtxO2.js} +1 -1
  41. package/inspector-dist/server/assets/{token-CxjWFNNq.js → token-DH652a7D.js} +1 -1
  42. package/inspector-dist/server/assets/token-util-wQgchIHA.js +3 -0
  43. package/inspector-dist/server/assets/{ws-transport-CamzQ5O8.js → ws-transport-7nLI4Gq9.js} +1 -1
  44. package/inspector-dist/server/index.js +1 -1
  45. package/package.json +2 -2
  46. package/dashboard-dist/PopoverPopup-CiI2avT_.js +0 -1
  47. package/dashboard-dist/popover-Bb2Q3jiK.js +0 -1
  48. package/inspector-dist/server/assets/token-util-D9IsWeEs.js +0 -3
  49. /package/inspector-dist/client/assets/{root-CVhM1JOR.js → root-2KbsWt-J.js} +0 -0
package/README.md CHANGED
@@ -181,6 +181,23 @@ delete `.brick/` to start over.
181
181
  Requests that send a W3C `traceparent` header join the caller's trace, and the
182
182
  dashboard shows them under that trace id.
183
183
 
184
+ `brick dev` also serves `/mcp` on the dashboard's port, an MCP endpoint
185
+ for coding agents (Claude Code, Cursor, Codex) with read-only tools for every
186
+ view: `summary`, `list_requests`, `get_trace`, `search_logs`, `list_errors`,
187
+ `list_reloads` and `app_overview`; `list_schedules`, `list_runs` and `get_run`
188
+ while the workflow inspector is served; and, under `brick dev` only,
189
+ `get_openapi`, `list_docs` and `read_doc`. A tool whose data is not there is left
190
+ out of the list. It prints the address on start; connect with
191
+ `claude mcp add --transport http brick http://127.0.0.1:9400/mcp`. They only
192
+ read, a hook's token is never sent, there is no live stream (each call is a
193
+ plain request and response), and a request from another origin is refused. Tools of
194
+ the app's own marked `dashboard: true` (`service.tool`, or a plugin's) are
195
+ listed beside them; one without `readOnlyHint: true` can change data and is
196
+ advertised as destructive. `list_errors` reads only the failures held in memory
197
+ since the process started (the last 200), even when history is kept on disk;
198
+ older ones are found with `list_requests` and `outcome: "server"`. What an agent reads (paths, errors, SQL text, log lines) goes to its
199
+ model provider.
200
+
184
201
  ### Monitoring dashboard for production
185
202
 
186
203
  `brick start` serves a read-only dashboard of the running app when the app,
@@ -200,10 +217,17 @@ export default brick({
200
217
 
201
218
  It listens on a port of its own, so it can be kept private or mounted at another
202
219
  address, and it answers while the app's routes do not. It shows Requests, Logs,
203
- Errors, Overview, and Reloads; there is no restart, API proxy, APIs, Docs, or Workflows, and
204
- OpenAPI documents are not served. Setting it turns `telemetry` on, and from then
205
- `ctx.logger` and `console` lines written during a request go to the dashboard
206
- and not to the container's console.
220
+ Errors, Overview, and Reloads; there is no restart, API proxy, APIs, or Docs, and
221
+ OpenAPI documents are not served. `dashboard: { inspector: true }` adds
222
+ Schedules and Workflows, where only a signed-in user can change anything.
223
+ `dashboard: { mcp: true }` serves `/mcp` for coding agents behind the same
224
+ `auth` (agents send `Authorization: Bearer <token>`); it is off otherwise. The
225
+ dashboard's own tools only read; the app's `dashboard: true` tools that can
226
+ change data are offered only to a signed-in user (`authorize` returned
227
+ `{ user }`).
228
+ Setting it turns `telemetry` on, and from then `ctx.logger` and `console`
229
+ lines written during a request go to the dashboard and not to the container's
230
+ console.
207
231
 
208
232
  Beyond loopback, access control is required, and `brick start` will not run the
209
233
  dashboard without it. `auth.token` is a secret (or several, to rotate), at least
@@ -211,13 +235,16 @@ dashboard without it. `auth.token` is a secret (or several, to rotate), at least
211
235
  secret as the password), and monitors send `Authorization: Bearer <secret>`.
212
236
  `auth.authorize(request)` is your own check, for the auth the app already has
213
237
  (Better Auth, Clerk, a header from a proxy): it gets a standard `Request` without
214
- a body and returns `true`, `false`, or a `Response` such as a redirect to a login
215
- page; a throw or five seconds without an answer refuses the request with 503. A
216
- request passes with a valid token or when `authorize` allows it.
238
+ a body and returns `true`, `false`, `{ user }` for someone signed in, or a
239
+ `Response` such as a redirect to a login page; a throw or five seconds without
240
+ an answer refuses the request with 503. A request passes with a valid token or
241
+ when `authorize` allows it.
217
242
 
218
243
  `GET /_health` on the dashboard's port needs no sign-in: 200 while the app answers
219
244
  its own `/_health`, 503 when it does not, for uptime monitors. Responses are
220
- `no-store`, with a strict Content-Security-Policy and `X-Frame-Options: DENY`;
245
+ `no-store`, with a strict Content-Security-Policy and `X-Frame-Options: DENY`
246
+ (the Workflows page and an extension's `/app` pages may be framed by the
247
+ dashboard itself);
221
248
  serve it over HTTPS. Failed sign-ins are not rate limited, so use long random
222
249
  tokens. The dashboard runs in the app's process: it survives errors in handlers,
223
250
  not the process dying. `brick dev` has its own dashboard and ignores the option.