@jamiexiongr/panda 0.1.6 → 0.1.7

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/dist/cli.mjs CHANGED
@@ -1,9 +1,13 @@
1
+ import {
2
+ resolveTailscalePublicationMode
3
+ } from "./chunk-JBN6ZR6W.mjs";
4
+
1
5
  // release/panda/src/cli.ts
2
6
  var printUsage = () => {
3
7
  console.log(`panda <command>
4
8
 
5
9
  Commands:
6
- agent [tailscareserv] [--hub-url=<url>] Start the Panda agent service
10
+ agent [tailscareserv|tailscareserv-pub] [--hub-url=<url>] Start the Panda agent service
7
11
  hub [tailscareserv|tailscareserv-pub] Start the Panda hub service with the bundled web UI
8
12
  help Show this message`);
9
13
  };
@@ -22,77 +26,17 @@ var resolveCliOptionValue = (argv, aliases) => {
22
26
  }
23
27
  return null;
24
28
  };
25
- var resolveTailscaleServeArg = (argv) => {
26
- for (const arg of argv) {
27
- const normalized = arg.trim().toLowerCase();
28
- if (["tailscareserv", "--tailscareserv", "tailscale-serve", "--tailscale-serve"].includes(
29
- normalized
30
- )) {
31
- return true;
32
- }
33
- if (["no-tailscareserv", "--no-tailscareserv", "no-tailscale-serve", "--no-tailscale-serve"].includes(normalized)) {
34
- return false;
35
- }
36
- }
37
- const envValue = process.env.PANDA_TAILSCALE_SERVE?.trim().toLowerCase();
38
- if (envValue && ["1", "true", "yes", "on"].includes(envValue)) {
39
- return true;
40
- }
41
- if (envValue && ["0", "false", "no", "off"].includes(envValue)) {
42
- return false;
43
- }
44
- return false;
45
- };
46
- var resolveHubPublicationMode = (argv) => {
47
- for (const arg of argv) {
48
- const normalized = arg.trim().toLowerCase();
49
- if ([
50
- "tailscareserv-pub",
51
- "--tailscareserv-pub",
52
- "tailscale-serve-pub",
53
- "--tailscale-serve-pub",
54
- "tailscalefunnel",
55
- "--tailscalefunnel",
56
- "tailscale-funnel",
57
- "--tailscale-funnel"
58
- ].includes(normalized)) {
59
- return "funnel";
60
- }
61
- if (["tailscareserv", "--tailscareserv", "tailscale-serve", "--tailscale-serve"].includes(
62
- normalized
63
- )) {
64
- return "serve";
65
- }
66
- if ([
67
- "no-tailscareserv",
68
- "--no-tailscareserv",
69
- "no-tailscale-serve",
70
- "--no-tailscale-serve",
71
- "no-tailscareserv-pub",
72
- "--no-tailscareserv-pub",
73
- "no-tailscale-funnel",
74
- "--no-tailscale-funnel"
75
- ].includes(normalized)) {
76
- return "disabled";
77
- }
78
- }
79
- const envMode = process.env.PANDA_HUB_TAILSCALE_PUBLISH_MODE?.trim().toLowerCase();
80
- if (envMode && ["funnel", "public", "pub"].includes(envMode)) {
81
- return "funnel";
82
- }
83
- if (envMode && ["serve", "private", "tailnet"].includes(envMode)) {
84
- return "serve";
85
- }
86
- if (envMode && ["disabled", "none", "off"].includes(envMode)) {
87
- return "disabled";
88
- }
89
- return resolveTailscaleServeArg(argv) ? "serve" : "disabled";
90
- };
91
29
  var main = async () => {
92
30
  const command = process.argv[2]?.trim().toLowerCase() ?? "help";
93
31
  const commandArgs = process.argv.slice(3);
94
- const tailscaleServe = resolveTailscaleServeArg(commandArgs);
95
- const hubPublicationMode = resolveHubPublicationMode(commandArgs);
32
+ const agentPublicationMode = resolveTailscalePublicationMode({
33
+ argv: commandArgs,
34
+ envPrefix: "PANDA_AGENT"
35
+ });
36
+ const hubPublicationMode = resolveTailscalePublicationMode({
37
+ argv: commandArgs,
38
+ envPrefix: "PANDA_HUB"
39
+ });
96
40
  if (command === "help" || command === "--help" || command === "-h") {
97
41
  printUsage();
98
42
  return;
@@ -100,7 +44,7 @@ var main = async () => {
100
44
  if (command === "agent") {
101
45
  const { startJamiexiongrAgent } = await import("@jamiexiongr/panda-agent");
102
46
  await startJamiexiongrAgent({
103
- tailscaleServe,
47
+ tailscalePublicationMode: agentPublicationMode,
104
48
  hubUrl: resolveCliOptionValue(commandArgs, [
105
49
  "hub",
106
50
  "--hub",
@@ -0,0 +1,92 @@
1
+ import {
2
+ CodexAdapter,
3
+ appendSessionIndexUpdate,
4
+ buildTailscaleHttpsUrl,
5
+ configureTailscaleServe,
6
+ createCodexLiveSessionStream,
7
+ createCodexRolloutMonitor,
8
+ deleteRolloutFile,
9
+ discoverLocalCodexData,
10
+ ensurePandaHubApiKey,
11
+ getOrderedWorkspaceRoots,
12
+ getPandaHubApiKeyFilePath,
13
+ getPinnedSessionIds,
14
+ getPinnedWorkspaceRoots,
15
+ getSavedWorkspaceRoots,
16
+ getWorkspaceRootLabels,
17
+ isTailscaleRunning,
18
+ isWithinWorkspaceRoot,
19
+ moveRolloutFileFromArchived,
20
+ moveRolloutFileToArchived,
21
+ normalizeWorkspacePathKey,
22
+ printTerminalQr,
23
+ readCodexGlobalState,
24
+ readCodexTimeline,
25
+ readCodexTimelineDetails,
26
+ readPandaSessionPrefs,
27
+ readPandaThreadPrefs,
28
+ readTailscaleStatus,
29
+ resolveAgentNetworkIdentity,
30
+ resolveCliOptionValue,
31
+ resolvePandaHubApiKey,
32
+ resolveTailscalePublicationMode,
33
+ resolveTailscaleServeEnabled,
34
+ resolveTailscaleServePort,
35
+ setSessionPinned,
36
+ setWorkspaceRootLabel,
37
+ setWorkspaceRootOrder,
38
+ setWorkspaceRootPinned,
39
+ setWorkspaceRootVisibility,
40
+ sortByStoredWorkspaceOrder,
41
+ startAgentHubSync,
42
+ startPandaSessionService,
43
+ writeCodexGlobalState,
44
+ writePandaSessionPrefs,
45
+ writePandaThreadPrefs
46
+ } from "./chunk-JBN6ZR6W.mjs";
47
+ export {
48
+ CodexAdapter,
49
+ appendSessionIndexUpdate,
50
+ buildTailscaleHttpsUrl,
51
+ configureTailscaleServe,
52
+ createCodexLiveSessionStream,
53
+ createCodexRolloutMonitor,
54
+ deleteRolloutFile,
55
+ discoverLocalCodexData,
56
+ ensurePandaHubApiKey,
57
+ getOrderedWorkspaceRoots,
58
+ getPandaHubApiKeyFilePath,
59
+ getPinnedSessionIds,
60
+ getPinnedWorkspaceRoots,
61
+ getSavedWorkspaceRoots,
62
+ getWorkspaceRootLabels,
63
+ isTailscaleRunning,
64
+ isWithinWorkspaceRoot,
65
+ moveRolloutFileFromArchived,
66
+ moveRolloutFileToArchived,
67
+ normalizeWorkspacePathKey,
68
+ printTerminalQr,
69
+ readCodexGlobalState,
70
+ readCodexTimeline,
71
+ readCodexTimelineDetails,
72
+ readPandaSessionPrefs,
73
+ readPandaThreadPrefs,
74
+ readTailscaleStatus,
75
+ resolveAgentNetworkIdentity,
76
+ resolveCliOptionValue,
77
+ resolvePandaHubApiKey,
78
+ resolveTailscalePublicationMode,
79
+ resolveTailscaleServeEnabled,
80
+ resolveTailscaleServePort,
81
+ setSessionPinned,
82
+ setWorkspaceRootLabel,
83
+ setWorkspaceRootOrder,
84
+ setWorkspaceRootPinned,
85
+ setWorkspaceRootVisibility,
86
+ sortByStoredWorkspaceOrder,
87
+ startAgentHubSync,
88
+ startPandaSessionService,
89
+ writeCodexGlobalState,
90
+ writePandaSessionPrefs,
91
+ writePandaThreadPrefs
92
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamiexiongr/panda",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Panda combined installer",
@@ -8,8 +8,8 @@
8
8
  "panda": "./bin/panda.cjs"
9
9
  },
10
10
  "dependencies": {
11
- "@jamiexiongr/panda-agent": "0.1.6",
12
- "@jamiexiongr/panda-hub": "0.1.6"
11
+ "@jamiexiongr/panda-agent": "0.1.7",
12
+ "@jamiexiongr/panda-hub": "0.1.7"
13
13
  },
14
14
  "files": [
15
15
  "bin",