@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.
- package/LICENSE +201 -0
- package/README.md +63 -0
- package/dist/dev-server/auth.d.ts +44 -0
- package/dist/dev-server/auth.d.ts.map +1 -0
- package/dist/dev-server/auth.js +176 -0
- package/dist/dev-server/events.d.ts +43 -0
- package/dist/dev-server/events.d.ts.map +1 -0
- package/dist/dev-server/events.js +61 -0
- package/dist/dev-server/http.d.ts +79 -0
- package/dist/dev-server/http.d.ts.map +1 -0
- package/dist/dev-server/http.js +277 -0
- package/dist/dev-server/hub-preview.d.ts +56 -0
- package/dist/dev-server/hub-preview.d.ts.map +1 -0
- package/dist/dev-server/hub-preview.js +237 -0
- package/dist/dev-server/hub.d.ts +59 -0
- package/dist/dev-server/hub.d.ts.map +1 -0
- package/dist/dev-server/hub.js +723 -0
- package/dist/hub-preview/client.js +52346 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/local-registry/compile-ui.d.ts +67 -0
- package/dist/local-registry/compile-ui.d.ts.map +1 -0
- package/dist/local-registry/compile-ui.js +148 -0
- package/dist/local-registry/local-registry.d.ts +93 -0
- package/dist/local-registry/local-registry.d.ts.map +1 -0
- package/dist/local-registry/local-registry.js +272 -0
- package/dist/local-registry/watcher.d.ts +42 -0
- package/dist/local-registry/watcher.d.ts.map +1 -0
- package/dist/local-registry/watcher.js +208 -0
- package/dist/run-dev.d.ts +147 -0
- package/dist/run-dev.d.ts.map +1 -0
- package/dist/run-dev.js +216 -0
- package/dist/runtime-supervisor.d.ts +140 -0
- package/dist/runtime-supervisor.d.ts.map +1 -0
- package/dist/runtime-supervisor.js +91 -0
- 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"}
|