@jamiexiongr/panda-hub 0.1.2 → 0.1.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.
|
@@ -5,16 +5,17 @@ import {
|
|
|
5
5
|
resolveTailscaleServeEnabled,
|
|
6
6
|
resolveTailscaleServePort,
|
|
7
7
|
startPandaSessionService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I3VRWQCP.mjs";
|
|
9
9
|
|
|
10
10
|
// release/panda-hub/src/index.ts
|
|
11
|
+
import fs from "fs";
|
|
11
12
|
import path from "path";
|
|
12
13
|
import { fileURLToPath } from "url";
|
|
13
14
|
|
|
14
15
|
// release/panda-hub/package.json
|
|
15
16
|
var package_default = {
|
|
16
17
|
name: "@jamiexiongr/panda-hub",
|
|
17
|
-
version: "0.1.
|
|
18
|
+
version: "0.1.3",
|
|
18
19
|
type: "module",
|
|
19
20
|
private: false,
|
|
20
21
|
description: "Panda hub runtime",
|
|
@@ -44,6 +45,14 @@ var package_default = {
|
|
|
44
45
|
|
|
45
46
|
// release/panda-hub/src/index.ts
|
|
46
47
|
var currentDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
48
|
+
var resolveBundledWebUiDir = () => {
|
|
49
|
+
const candidates = [
|
|
50
|
+
path.resolve(currentDirectory, "web"),
|
|
51
|
+
path.resolve(currentDirectory, "../dist/web"),
|
|
52
|
+
path.resolve(currentDirectory, "../web")
|
|
53
|
+
];
|
|
54
|
+
return candidates.find((candidate) => fs.existsSync(candidate)) ?? candidates[0];
|
|
55
|
+
};
|
|
47
56
|
var startJamiexiongrHub = async (options) => {
|
|
48
57
|
const port = Number(process.env.PANDA_HUB_PORT ?? 4343);
|
|
49
58
|
const tailscaleServe = configureTailscaleServe({
|
|
@@ -64,7 +73,7 @@ var startJamiexiongrHub = async (options) => {
|
|
|
64
73
|
if (hubApiKey.apiKey) {
|
|
65
74
|
process.env.PANDA_HUB_API_KEY = hubApiKey.apiKey;
|
|
66
75
|
}
|
|
67
|
-
const webUiDir =
|
|
76
|
+
const webUiDir = resolveBundledWebUiDir();
|
|
68
77
|
const app = await startPandaSessionService({
|
|
69
78
|
serviceName: "panda-hub",
|
|
70
79
|
mode: "hub",
|
|
@@ -12726,7 +12726,7 @@ var startPandaSessionService = async ({
|
|
|
12726
12726
|
if (managedTimeline) {
|
|
12727
12727
|
return mergeTimelineEntries(managedTimeline, readTimelineOverlay(sessionId, managedTimeline));
|
|
12728
12728
|
}
|
|
12729
|
-
const { readCodexTimeline: readCodexTimeline2 } = await import("./src-
|
|
12729
|
+
const { readCodexTimeline: readCodexTimeline2 } = await import("./src-A2O4IXQ2.mjs");
|
|
12730
12730
|
const discoveredTimeline = await readCodexTimeline2(sessionId, {
|
|
12731
12731
|
codexHome,
|
|
12732
12732
|
sessionFiles: discoveredSessionFiles
|
|
@@ -13411,7 +13411,7 @@ var startPandaSessionService = async ({
|
|
|
13411
13411
|
lastSnapshotRefreshAt = Date.now();
|
|
13412
13412
|
return snapshot;
|
|
13413
13413
|
}
|
|
13414
|
-
const { discoverLocalCodexData: discoverLocalCodexData2 } = await import("./src-
|
|
13414
|
+
const { discoverLocalCodexData: discoverLocalCodexData2 } = await import("./src-A2O4IXQ2.mjs");
|
|
13415
13415
|
const discovery = await discoverLocalCodexData2({
|
|
13416
13416
|
agentId: localAgentId,
|
|
13417
13417
|
agentName: localAgentName,
|
|
@@ -15656,6 +15656,25 @@ var parsePort = (value) => {
|
|
|
15656
15656
|
}
|
|
15657
15657
|
return parsed;
|
|
15658
15658
|
};
|
|
15659
|
+
var trimExecOutput = (value) => {
|
|
15660
|
+
if (typeof value === "string") {
|
|
15661
|
+
const trimmed = value.trim();
|
|
15662
|
+
return trimmed || null;
|
|
15663
|
+
}
|
|
15664
|
+
if (Buffer.isBuffer(value)) {
|
|
15665
|
+
const trimmed = value.toString("utf8").trim();
|
|
15666
|
+
return trimmed || null;
|
|
15667
|
+
}
|
|
15668
|
+
return null;
|
|
15669
|
+
};
|
|
15670
|
+
var describeExecError = (error) => {
|
|
15671
|
+
if (!(error instanceof Error)) {
|
|
15672
|
+
return "tailscale serve failed";
|
|
15673
|
+
}
|
|
15674
|
+
const commandError = error;
|
|
15675
|
+
const output = trimExecOutput(commandError.stderr) ?? trimExecOutput(commandError.stdout);
|
|
15676
|
+
return output ?? error.message;
|
|
15677
|
+
};
|
|
15659
15678
|
var readTailscaleStatus = () => {
|
|
15660
15679
|
try {
|
|
15661
15680
|
const stdout = execFileSync("tailscale", ["status", "--json"], {
|
|
@@ -15767,6 +15786,7 @@ var configureTailscaleServe = (options) => {
|
|
|
15767
15786
|
"tailscale",
|
|
15768
15787
|
[
|
|
15769
15788
|
"serve",
|
|
15789
|
+
"--yes",
|
|
15770
15790
|
"--bg",
|
|
15771
15791
|
`--https=${options.servePort}`,
|
|
15772
15792
|
`http://127.0.0.1:${options.localPort}`
|
|
@@ -15779,7 +15799,7 @@ var configureTailscaleServe = (options) => {
|
|
|
15779
15799
|
}
|
|
15780
15800
|
);
|
|
15781
15801
|
} catch (error) {
|
|
15782
|
-
const message = error
|
|
15802
|
+
const message = describeExecError(error);
|
|
15783
15803
|
options.logger?.warn?.(
|
|
15784
15804
|
`Unable to publish ${options.serviceName} via Tailscale Serve: ${message}`
|
|
15785
15805
|
);
|
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startJamiexiongrHub
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GX7OAH4Z.mjs";
|
|
4
4
|
import {
|
|
5
5
|
resolveTailscaleServeEnabled
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I3VRWQCP.mjs";
|
|
7
7
|
|
|
8
8
|
// release/panda-hub/src/cli.ts
|
|
9
9
|
void startJamiexiongrHub({
|
package/dist/index.mjs
CHANGED