@jamiexiongr/panda-hub 0.1.0 → 0.1.2
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/README.md +29 -0
- package/bin/panda-hub.cjs +3 -0
- package/dist/chunk-CS7XM33H.mjs +89 -0
- package/dist/{chunk-NPUEJ7HU.mjs → chunk-GPLVIR3L.mjs} +1510 -46
- package/dist/cli.mjs +9 -3
- package/dist/index.mjs +2 -2
- package/dist/{src-DT2GYCA4.mjs → src-LEEO2YLS.mjs} +23 -1
- package/dist/web/apple-touch-icon.png +0 -0
- package/dist/web/assets/{diagnostics-page-DnSAjsY5.js → diagnostics-page-D4xGds9x.js} +1 -1
- package/dist/web/assets/index-CgfCWbq0.css +1 -0
- package/dist/web/assets/index-DxHRG-hx.js +130 -0
- package/dist/web/assets/{session-diff-preview-DLGNrbUv.js → session-diff-preview-Dg7a3ySE.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/maskable-512.png +0 -0
- package/dist/web/pwa-192.png +0 -0
- package/dist/web/pwa-512.png +0 -0
- package/dist/web/pwa-home-logo.png +0 -0
- package/dist/web/sw.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-HEZ5JMF3.mjs +0 -55
- package/dist/web/assets/index-C_piwCwO.js +0 -124
- package/dist/web/assets/index-DfUcIUg_.css +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
# @jamiexiongr/panda-hub
|
|
2
2
|
|
|
3
3
|
Published hub runtime for Panda, including the built web UI.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
panda-hub
|
|
9
|
+
panda-hub tailscareserv
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`tailscareserv` and `--tailscale-serve` both enable automatic `tailscale serve` publishing.
|
|
13
|
+
|
|
14
|
+
When enabled, hub startup will:
|
|
15
|
+
|
|
16
|
+
- detect whether `tailscale` is available and online
|
|
17
|
+
- run `tailscale serve --bg`
|
|
18
|
+
- print the generated Tailscale HTTPS URL in the startup log
|
|
19
|
+
|
|
20
|
+
## Environment
|
|
21
|
+
|
|
22
|
+
- `PANDA_HUB_PORT`
|
|
23
|
+
Local hub listen port. Default: `4343`
|
|
24
|
+
- `PANDA_HUB_TAILSCALE_SERVE_PORT`
|
|
25
|
+
Tailscale HTTPS port. Default: `443`
|
|
26
|
+
- `PANDA_TAILSCALE_SERVE=1`
|
|
27
|
+
Optional env alternative to the startup flag
|
|
28
|
+
|
|
29
|
+
## Notes
|
|
30
|
+
|
|
31
|
+
- Tailscale Serve publishes a tailnet HTTPS address, not a public Internet address.
|
|
32
|
+
- This is the recommended way to run the installable PWA on mobile, because the bundled hub serves the built web assets over HTTPS.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configureTailscaleServe,
|
|
3
|
+
ensurePandaHubApiKey,
|
|
4
|
+
printTerminalQr,
|
|
5
|
+
resolveTailscaleServeEnabled,
|
|
6
|
+
resolveTailscaleServePort,
|
|
7
|
+
startPandaSessionService
|
|
8
|
+
} from "./chunk-GPLVIR3L.mjs";
|
|
9
|
+
|
|
10
|
+
// release/panda-hub/src/index.ts
|
|
11
|
+
import path from "path";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
|
|
14
|
+
// release/panda-hub/package.json
|
|
15
|
+
var package_default = {
|
|
16
|
+
name: "@jamiexiongr/panda-hub",
|
|
17
|
+
version: "0.1.2",
|
|
18
|
+
type: "module",
|
|
19
|
+
private: false,
|
|
20
|
+
description: "Panda hub runtime",
|
|
21
|
+
dependencies: {
|
|
22
|
+
"@fastify/cors": "^10.0.2",
|
|
23
|
+
"@fastify/websocket": "^11.0.2",
|
|
24
|
+
fastify: "^5.2.1"
|
|
25
|
+
},
|
|
26
|
+
bin: {
|
|
27
|
+
"panda-hub": "./bin/panda-hub.cjs"
|
|
28
|
+
},
|
|
29
|
+
exports: {
|
|
30
|
+
".": "./dist/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
files: [
|
|
33
|
+
"bin",
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
publishConfig: {
|
|
37
|
+
access: "public",
|
|
38
|
+
registry: "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
engines: {
|
|
41
|
+
node: ">=20.19.0"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// release/panda-hub/src/index.ts
|
|
46
|
+
var currentDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
47
|
+
var startJamiexiongrHub = async (options) => {
|
|
48
|
+
const port = Number(process.env.PANDA_HUB_PORT ?? 4343);
|
|
49
|
+
const tailscaleServe = configureTailscaleServe({
|
|
50
|
+
enabled: options?.tailscaleServe ?? resolveTailscaleServeEnabled(),
|
|
51
|
+
serviceName: "panda-hub",
|
|
52
|
+
localPort: port,
|
|
53
|
+
servePort: resolveTailscaleServePort({
|
|
54
|
+
envPrefix: "PANDA_HUB",
|
|
55
|
+
defaultPort: 443
|
|
56
|
+
}),
|
|
57
|
+
logger: console
|
|
58
|
+
});
|
|
59
|
+
const hubApiKey = await ensurePandaHubApiKey({
|
|
60
|
+
configuredApiKey: process.env.PANDA_HUB_API_KEY ?? null,
|
|
61
|
+
codexHome: process.env.PANDA_CODEX_HOME ?? null,
|
|
62
|
+
logger: console
|
|
63
|
+
});
|
|
64
|
+
if (hubApiKey.apiKey) {
|
|
65
|
+
process.env.PANDA_HUB_API_KEY = hubApiKey.apiKey;
|
|
66
|
+
}
|
|
67
|
+
const webUiDir = path.resolve(currentDirectory, "../web");
|
|
68
|
+
const app = await startPandaSessionService({
|
|
69
|
+
serviceName: "panda-hub",
|
|
70
|
+
mode: "hub",
|
|
71
|
+
port,
|
|
72
|
+
transport: "hub-routed",
|
|
73
|
+
version: package_default.version,
|
|
74
|
+
webUiDir
|
|
75
|
+
});
|
|
76
|
+
if (tailscaleServe.active && tailscaleServe.baseUrl) {
|
|
77
|
+
console.info(`Panda hub Tailscale HTTPS URL: ${tailscaleServe.baseUrl}`);
|
|
78
|
+
console.info(`Agent hub URL env: PANDA_HUB_URL=${tailscaleServe.baseUrl}`);
|
|
79
|
+
printTerminalQr(tailscaleServe.baseUrl, {
|
|
80
|
+
logger: console,
|
|
81
|
+
label: "Scan this QR code to open Panda hub on your phone:"
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return app;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
startJamiexiongrHub
|
|
89
|
+
};
|