@jamiexiongr/panda-hub 0.1.11 → 0.1.13

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,7 +5,7 @@ import {
5
5
  resolveTailscalePublicationMode,
6
6
  resolveTailscaleServePort,
7
7
  startPandaSessionService
8
- } from "./chunk-ABDBJQSF.mjs";
8
+ } from "./chunk-CHS6ZMEF.mjs";
9
9
 
10
10
  // release/panda-hub/src/index.ts
11
11
  import fs from "fs";
@@ -15,7 +15,7 @@ import { fileURLToPath } from "url";
15
15
  // release/panda-hub/package.json
16
16
  var package_default = {
17
17
  name: "@jamiexiongr/panda-hub",
18
- version: "0.1.11",
18
+ version: "0.1.13",
19
19
  type: "module",
20
20
  private: false,
21
21
  description: "Panda hub runtime",
@@ -30870,6 +30870,55 @@ import os5 from "os";
30870
30870
  import path8 from "path";
30871
30871
  import { createHash as createHash4, randomUUID as randomUUID2 } from "crypto";
30872
30872
  import { spawn as spawn3, spawnSync as spawnSync2 } from "child_process";
30873
+ var MANAGED_ENV_PASSTHROUGH_KEYS = [
30874
+ "ALLUSERSPROFILE",
30875
+ "APPDATA",
30876
+ "COMPUTERNAME",
30877
+ "ComSpec",
30878
+ "HOME",
30879
+ "HOMEDRIVE",
30880
+ "HOMEPATH",
30881
+ "LOCALAPPDATA",
30882
+ "NUMBER_OF_PROCESSORS",
30883
+ "OS",
30884
+ "PATH",
30885
+ "PATHEXT",
30886
+ "PROCESSOR_ARCHITECTURE",
30887
+ "PROCESSOR_IDENTIFIER",
30888
+ "PROCESSOR_LEVEL",
30889
+ "PROCESSOR_REVISION",
30890
+ "ProgramData",
30891
+ "ProgramFiles",
30892
+ "ProgramFiles(x86)",
30893
+ "ProgramW6432",
30894
+ "PUBLIC",
30895
+ "SYSTEMDRIVE",
30896
+ "SystemDrive",
30897
+ "SYSTEMROOT",
30898
+ "SystemRoot",
30899
+ "TEMP",
30900
+ "TMP",
30901
+ "USERDOMAIN",
30902
+ "USERDOMAIN_ROAMINGPROFILE",
30903
+ "USERNAME",
30904
+ "USERPROFILE",
30905
+ "WINDIR"
30906
+ ];
30907
+ var MANAGED_ENV_STRIP_PREFIXES = [
30908
+ "npm_config_",
30909
+ "NPM_CONFIG_",
30910
+ "TSX_",
30911
+ "VSCODE_",
30912
+ "ELECTRON_"
30913
+ ];
30914
+ var MANAGED_ENV_STRIP_KEYS = /* @__PURE__ */ new Set([
30915
+ "NODE_OPTIONS",
30916
+ "NODE_INSPECT_RESUME_ON_START",
30917
+ "npm_config_userconfig",
30918
+ "NPM_CONFIG_USERCONFIG",
30919
+ "npm_config_registry",
30920
+ "NPM_CONFIG_REGISTRY"
30921
+ ]);
30873
30922
  var DEV_MANAGER_RELATIVE_ROOT = path8.join("state", "panda", "dev-manager");
30874
30923
  var CONFIG_FILE_NAME = "config.json";
30875
30924
  var CREDENTIALS_FILE_NAME = "credentials.json";
@@ -31289,6 +31338,48 @@ var resolveManagedCommand = async (input) => {
31289
31338
  runtimeNodeVersion: execution.runtime_node_version
31290
31339
  };
31291
31340
  };
31341
+ var buildIsolatedManagedEnv = (baseEnv, overrides) => {
31342
+ const nextEnv = {};
31343
+ for (const key of MANAGED_ENV_PASSTHROUGH_KEYS) {
31344
+ const value = baseEnv[key];
31345
+ if (typeof value === "string" && value.length > 0) {
31346
+ nextEnv[key] = value;
31347
+ }
31348
+ }
31349
+ for (const [key, value] of Object.entries(baseEnv)) {
31350
+ if (!key || MANAGED_ENV_STRIP_KEYS.has(key)) {
31351
+ continue;
31352
+ }
31353
+ if (MANAGED_ENV_STRIP_PREFIXES.some((prefix) => key.startsWith(prefix))) {
31354
+ continue;
31355
+ }
31356
+ if (key in nextEnv) {
31357
+ continue;
31358
+ }
31359
+ if (typeof value === "string" && value.length > 0) {
31360
+ nextEnv[key] = value;
31361
+ }
31362
+ }
31363
+ nextEnv.NODE_OPTIONS = "";
31364
+ nextEnv.NODE_INSPECT_RESUME_ON_START = "";
31365
+ nextEnv.ELECTRON_RUN_AS_NODE = "";
31366
+ nextEnv.VSCODE_INSPECTOR_OPTIONS = "";
31367
+ for (const [key, value] of Object.entries(overrides ?? {})) {
31368
+ nextEnv[key] = value ?? "";
31369
+ }
31370
+ return nextEnv;
31371
+ };
31372
+ var createTempNpmPublishUserConfig = async (token) => {
31373
+ const filePath = path8.join(
31374
+ os5.tmpdir(),
31375
+ `panda-dev-manager-${process.pid}-${Date.now()}.npmrc`
31376
+ );
31377
+ const content = `//registry.npmjs.org/:_authToken=${token}
31378
+ registry=${NPM_REGISTRY_URL}
31379
+ `;
31380
+ await fs7.writeFile(filePath, content, "utf8");
31381
+ return filePath;
31382
+ };
31292
31383
  var readStoredConfig = async (codexHome) => {
31293
31384
  const storedConfig = await readJsonFile(resolveConfigPath(codexHome));
31294
31385
  const parsedConfig = devManagerConfigSchema.safeParse(storedConfig);
@@ -32140,25 +32231,33 @@ var createDevManager = ({
32140
32231
  };
32141
32232
  const runNpmPublish = async () => {
32142
32233
  const { config, credentials } = await readStoredConfig(codexHome);
32234
+ const npmToken = credentials.npm_token;
32143
32235
  await validateRepoPath(config.repo_path);
32144
32236
  if (!config.repo_path) {
32145
32237
  throw new Error("\u8BF7\u5148\u914D\u7F6E\u5F00\u53D1\u7248\u4EE3\u7801\u8DEF\u5F84\u3002");
32146
32238
  }
32147
- if (!credentials.npm_token) {
32239
+ if (!npmToken) {
32148
32240
  throw new Error("\u8BF7\u5148\u5728\u8BBE\u7F6E\u9875\u4FDD\u5B58 npm \u4EE4\u724C\u3002");
32149
32241
  }
32150
32242
  return runManagedJob("npm-publish", "\u53D1\u5E03 npm \u6B63\u5F0F\u5305", async (job) => {
32151
32243
  await job.append("info", "\u51C6\u5907\u6267\u884C release-publish \u811A\u672C\u3002");
32152
- const command = await resolveManagedCommand({
32153
- projectPath: config.repo_path,
32154
- command: "node ./scripts/release-publish.mjs",
32155
- nodeVersion: config.nvm_version,
32156
- env: {
32157
- NODE_AUTH_TOKEN: credentials.npm_token
32158
- }
32159
- });
32160
- await runCommandWithLogs(command, job, "npm \u53D1\u5E03");
32161
- await job.succeed("npm \u53D1\u5E03\u5B8C\u6210\u3002");
32244
+ const userConfigPath = await createTempNpmPublishUserConfig(npmToken);
32245
+ try {
32246
+ const command = await resolveManagedCommand({
32247
+ projectPath: config.repo_path,
32248
+ command: "node ./scripts/release-publish.mjs",
32249
+ nodeVersion: config.nvm_version
32250
+ });
32251
+ command.env = buildIsolatedManagedEnv(command.env, {
32252
+ NODE_AUTH_TOKEN: npmToken,
32253
+ NPM_CONFIG_USERCONFIG: userConfigPath,
32254
+ PANDA_NPM_PUBLISH_USERCONFIG: userConfigPath
32255
+ });
32256
+ await runCommandWithLogs(command, job, "npm \u53D1\u5E03");
32257
+ await job.succeed("npm \u53D1\u5E03\u5B8C\u6210\u3002");
32258
+ } finally {
32259
+ await fs7.rm(userConfigPath, { force: true }).catch(() => void 0);
32260
+ }
32162
32261
  });
32163
32262
  };
32164
32263
  const runApkBuild = async () => {
@@ -33837,7 +33936,7 @@ var startPandaSessionService = async ({
33837
33936
  return nextOverlayEntries;
33838
33937
  };
33839
33938
  const readTimelineFromRollout = async (sessionId) => {
33840
- const { readCodexTimeline } = await import("./src-YQZMKGKR.mjs");
33939
+ const { readCodexTimeline } = await import("./src-N4432F53.mjs");
33841
33940
  return readCodexTimeline(sessionId, {
33842
33941
  codexHome,
33843
33942
  sessionFiles: discoveredSessionFiles
@@ -35305,7 +35404,7 @@ var startPandaSessionService = async ({
35305
35404
  lastSnapshotRefreshAt = Date.now();
35306
35405
  return snapshot;
35307
35406
  }
35308
- const { discoverLocalCodexData } = await import("./src-YQZMKGKR.mjs");
35407
+ const { discoverLocalCodexData } = await import("./src-N4432F53.mjs");
35309
35408
  const discovery = await discoverLocalCodexData({
35310
35409
  agentId: localAgentId,
35311
35410
  agentName: localAgentName,
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  startJamiexiongrHub
3
- } from "./chunk-QEWCSAJZ.mjs";
3
+ } from "./chunk-6JQUAIUY.mjs";
4
4
  import {
5
5
  resolveTailscalePublicationMode
6
- } from "./chunk-ABDBJQSF.mjs";
6
+ } from "./chunk-CHS6ZMEF.mjs";
7
7
  import "./chunk-JY3C7BVD.mjs";
8
8
 
9
9
  // release/panda-hub/src/cli.ts
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  startJamiexiongrHub
3
- } from "./chunk-QEWCSAJZ.mjs";
4
- import "./chunk-ABDBJQSF.mjs";
3
+ } from "./chunk-6JQUAIUY.mjs";
4
+ import "./chunk-CHS6ZMEF.mjs";
5
5
  import "./chunk-JY3C7BVD.mjs";
6
6
  export {
7
7
  startJamiexiongrHub
@@ -42,7 +42,7 @@ import {
42
42
  writeCodexGlobalState,
43
43
  writePandaSessionPrefs,
44
44
  writePandaThreadPrefs
45
- } from "./chunk-ABDBJQSF.mjs";
45
+ } from "./chunk-CHS6ZMEF.mjs";
46
46
  import "./chunk-JY3C7BVD.mjs";
47
47
 
48
48
  // packages/provider-codex/src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamiexiongr/panda-hub",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Panda hub runtime",