@ggui-ai/dev-stack 0.1.0-rc.1

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 (37) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +63 -0
  3. package/dist/dev-server/auth.d.ts +44 -0
  4. package/dist/dev-server/auth.d.ts.map +1 -0
  5. package/dist/dev-server/auth.js +176 -0
  6. package/dist/dev-server/events.d.ts +43 -0
  7. package/dist/dev-server/events.d.ts.map +1 -0
  8. package/dist/dev-server/events.js +61 -0
  9. package/dist/dev-server/http.d.ts +79 -0
  10. package/dist/dev-server/http.d.ts.map +1 -0
  11. package/dist/dev-server/http.js +277 -0
  12. package/dist/dev-server/hub-preview.d.ts +56 -0
  13. package/dist/dev-server/hub-preview.d.ts.map +1 -0
  14. package/dist/dev-server/hub-preview.js +237 -0
  15. package/dist/dev-server/hub.d.ts +59 -0
  16. package/dist/dev-server/hub.d.ts.map +1 -0
  17. package/dist/dev-server/hub.js +723 -0
  18. package/dist/hub-preview/client.js +52346 -0
  19. package/dist/index.d.ts +34 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +49 -0
  22. package/dist/local-registry/compile-ui.d.ts +67 -0
  23. package/dist/local-registry/compile-ui.d.ts.map +1 -0
  24. package/dist/local-registry/compile-ui.js +148 -0
  25. package/dist/local-registry/local-registry.d.ts +93 -0
  26. package/dist/local-registry/local-registry.d.ts.map +1 -0
  27. package/dist/local-registry/local-registry.js +272 -0
  28. package/dist/local-registry/watcher.d.ts +42 -0
  29. package/dist/local-registry/watcher.d.ts.map +1 -0
  30. package/dist/local-registry/watcher.js +208 -0
  31. package/dist/run-dev.d.ts +147 -0
  32. package/dist/run-dev.d.ts.map +1 -0
  33. package/dist/run-dev.js +216 -0
  34. package/dist/runtime-supervisor.d.ts +140 -0
  35. package/dist/runtime-supervisor.d.ts.map +1 -0
  36. package/dist/runtime-supervisor.js +91 -0
  37. package/package.json +72 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Local dev hub — the HTML surface served from the same
3
+ * dev-stack HTTP host as the registry / runtime endpoints.
4
+ *
5
+ * Charter — what this surface is and is not:
6
+ *
7
+ * IS: runtime status, registry state, discovered UIs,
8
+ * compile/runtime errors, recent runtime events/logs,
9
+ * code-first local observability
10
+ *
11
+ * IS NOT: Studio-lite, starter gallery, no-code authoring,
12
+ * billing/workspace UI, NL playground, deploy flow,
13
+ * tunnel flow
14
+ *
15
+ * Delivery choices:
16
+ *
17
+ * - Single self-contained HTML document — no bundler, no
18
+ * framework, no build step. Matches the "code-first dev tool"
19
+ * charter and keeps `@ggui-ai/dev-stack`'s dep weight at zero
20
+ * for this feature.
21
+ * - `/hub` is **public** (bearer-exempt) so a browser that opens
22
+ * the page gets the shell without a pre-flight token dance. The
23
+ * existing origin allowlist in `auth.ts` still prevents
24
+ * cross-origin reads; the server injects the bearer token
25
+ * directly into the HTML so the hub's same-origin XHRs carry
26
+ * it automatically.
27
+ * - No parallel backend shape — every panel queries the existing
28
+ * `/health`, `/uis`, `/runtime/status`, `/runtime/events`
29
+ * endpoints. Live SSE wiring lands in a follow-up commit.
30
+ */
31
+ import type { IncomingMessage, ServerResponse } from 'node:http';
32
+ import type { GguiJsonV1 } from '@ggui-ai/project-config';
33
+ /**
34
+ * Context the hub shell needs to render. The `token` is the bearer
35
+ * the hub's own JS should send on XHRs; `null` when the server was
36
+ * started without a security policy (tests).
37
+ */
38
+ export interface HubShellContext {
39
+ /** Bearer token the hub JS uses for XHRs. `null` = server open. */
40
+ readonly token: string | null;
41
+ /** Loaded `ggui.json` — hub shows `app.name` / `app.slug`. */
42
+ readonly manifest: GguiJsonV1;
43
+ }
44
+ /**
45
+ * Build the self-contained HTML document for the hub. Pure function
46
+ * so tests can exercise the rendered shape without binding a port.
47
+ *
48
+ * HTML escaping is applied to every string that bubbles up from
49
+ * user-controlled data (manifest fields, token). The token itself
50
+ * is hex in practice, but the escape is defensive — a future
51
+ * pairing-protocol token might be arbitrary.
52
+ */
53
+ export declare function renderHubHtml(ctx: HubShellContext): string;
54
+ /**
55
+ * Write the hub shell to `res` with no-cache headers. Response is
56
+ * always 200 — there's no per-request failure mode for the shell.
57
+ */
58
+ export declare function serveHubShell(_req: IncomingMessage, res: ServerResponse, ctx: HubShellContext): void;
59
+ //# sourceMappingURL=hub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../src/dev-server/hub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CA+D1D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,GACnB,IAAI,CAcN"}