@rdmind/rdmind 0.0.28-alpha.6 → 0.0.28-alpha.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.
Files changed (2) hide show
  1. package/cli.js +45 -51
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -184663,7 +184663,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
184663
184663
  };
184664
184664
  }
184665
184665
  async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
184666
- const version2 = "0.0.28-alpha.6";
184666
+ const version2 = "0.0.28-alpha.7";
184667
184667
  const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
184668
184668
  const baseHeaders = {
184669
184669
  "User-Agent": userAgent2
@@ -184727,12 +184727,7 @@ async function createContentGenerator(config, gcConfig, sessionId2, isInitialAut
184727
184727
  );
184728
184728
  }
184729
184729
  const { createOpenAIContentGenerator: createOpenAIContentGenerator2 } = await Promise.resolve().then(() => (init_openaiContentGenerator2(), openaiContentGenerator_exports));
184730
- const xhsConfig = {
184731
- ...config,
184732
- baseUrl: config.baseUrl || "https://maas.devops.xiaohongshu.com/snsexperienceai-q3coder480ba35b-inst/v1",
184733
- model: config.model || "Qwen3-Coder-480B-A35B-Instruct"
184734
- };
184735
- return createOpenAIContentGenerator2(xhsConfig, gcConfig);
184730
+ return createOpenAIContentGenerator2(config, gcConfig);
184736
184731
  }
184737
184732
  throw new Error(
184738
184733
  `Error creating contentGenerator: Unsupported authType: ${config.authType}`
@@ -259070,7 +259065,7 @@ var init_git_commit = __esm({
259070
259065
  "use strict";
259071
259066
  init_esbuild_shims();
259072
259067
  GIT_COMMIT_INFO = "8e1bdaa6";
259073
- CLI_VERSION = "0.0.28-alpha.6";
259068
+ CLI_VERSION = "0.0.28-alpha.7";
259074
259069
  }
259075
259070
  });
259076
259071
 
@@ -301866,28 +301861,13 @@ var require_ansi_align = __commonJS({
301866
301861
  }
301867
301862
  });
301868
301863
 
301869
- // packages/cli/src/utils/l4SensitiveRepositories.ts
301870
- var L4_SENSITIVE_REPOSITORIES;
301871
- var init_l4SensitiveRepositories = __esm({
301872
- "packages/cli/src/utils/l4SensitiveRepositories.ts"() {
301873
- "use strict";
301874
- init_esbuild_shims();
301875
- L4_SENSITIVE_REPOSITORIES = [
301876
- // 可以在这里添加敏感仓库地址
301877
- // 例如:
301878
- // 'git@code.devops.xiaohongshu.com:sns/rdmind.git',
301879
- // 'git@code.devops.xiaohongshu.com:aikit/rdmind.git',
301880
- ];
301881
- }
301882
- });
301883
-
301884
301864
  // packages/cli/src/utils/l4RepositoryAutoSwitch.ts
301885
301865
  var l4RepositoryAutoSwitch_exports = {};
301886
301866
  __export(l4RepositoryAutoSwitch_exports, {
301887
301867
  autoSwitchToQSModel: () => autoSwitchToQSModel,
301888
301868
  isL4Repository: () => isL4Repository
301889
301869
  });
301890
- function isL4Repository(workspaceRoot) {
301870
+ async function isL4Repository(workspaceRoot) {
301891
301871
  try {
301892
301872
  if (!isGitRepository(workspaceRoot)) {
301893
301873
  return false;
@@ -301896,14 +301876,12 @@ function isL4Repository(workspaceRoot) {
301896
301876
  if (!remoteUrl) {
301897
301877
  return false;
301898
301878
  }
301899
- const isMatch = L4_SENSITIVE_REPOSITORIES.some(
301900
- (repo) => remoteUrl.includes(repo) || repo.includes(remoteUrl)
301901
- );
301879
+ const isL4 = await checkRepositoryRiskLevel(remoteUrl);
301902
301880
  if (process.env["DEBUG"] || process.env["RDMIND_DEBUG"]) {
301903
301881
  console.debug("[L4Repository] Git remote URL:", remoteUrl);
301904
- console.debug("[L4Repository] Is L4 repository:", isMatch);
301882
+ console.debug("[L4Repository] Is L4 repository:", isL4);
301905
301883
  }
301906
- return isMatch;
301884
+ return isL4;
301907
301885
  } catch (error) {
301908
301886
  if (process.env["DEBUG"] || process.env["RDMIND_DEBUG"]) {
301909
301887
  console.debug("[L4Repository] Error checking repository:", error);
@@ -301911,6 +301889,31 @@ function isL4Repository(workspaceRoot) {
301911
301889
  return false;
301912
301890
  }
301913
301891
  }
301892
+ async function checkRepositoryRiskLevel(gitRepoUrl) {
301893
+ const apiUrl = "http://pallas-t12.devops.sl.beta.xiaohongshu.com/pallas/rdmind/cli/repo-risk-level";
301894
+ try {
301895
+ const response = await fetch(`${apiUrl}?gitRepoUrl=${encodeURIComponent(gitRepoUrl)}`, {
301896
+ method: "GET",
301897
+ headers: {
301898
+ "Content-Type": "application/json"
301899
+ }
301900
+ });
301901
+ if (!response.ok) {
301902
+ throw new Error(`HTTP error! status: ${response.status}`);
301903
+ }
301904
+ const data = await response.json();
301905
+ if (data.success && data.code === 0) {
301906
+ return data.data === "l4";
301907
+ } else {
301908
+ throw new Error(`API error: ${data.msg || "Unknown error"}`);
301909
+ }
301910
+ } catch (error) {
301911
+ if (process.env["DEBUG"] || process.env["RDMIND_DEBUG"]) {
301912
+ console.debug("[L4Repository] API call failed:", error);
301913
+ }
301914
+ throw error;
301915
+ }
301916
+ }
301914
301917
  async function autoSwitchToQSModel(config, settings) {
301915
301918
  const currentAuthType = settings.merged.security?.auth?.selectedType;
301916
301919
  const targetModel = "qwen3-coder-480b-a35b-instruct";
@@ -301951,8 +301954,8 @@ var init_l4RepositoryAutoSwitch = __esm({
301951
301954
  init_esbuild_shims();
301952
301955
  init_core2();
301953
301956
  init_xhsSsoConfig();
301954
- init_l4SensitiveRepositories();
301955
301957
  __name(isL4Repository, "isL4Repository");
301958
+ __name(checkRepositoryRiskLevel, "checkRepositoryRiskLevel");
301956
301959
  __name(autoSwitchToQSModel, "autoSwitchToQSModel");
301957
301960
  }
301958
301961
  });
@@ -347367,7 +347370,7 @@ __name(getPackageJson, "getPackageJson");
347367
347370
  // packages/cli/src/utils/version.ts
347368
347371
  async function getCliVersion() {
347369
347372
  const pkgJson = await getPackageJson();
347370
- return "0.0.28-alpha.6";
347373
+ return "0.0.28-alpha.7";
347371
347374
  }
347372
347375
  __name(getCliVersion, "getCliVersion");
347373
347376
 
@@ -366243,7 +366246,7 @@ __name(getStartupWarnings, "getStartupWarnings");
366243
366246
  // packages/cli/src/utils/userStartupWarnings.ts
366244
366247
  init_esbuild_shims();
366245
366248
  init_core2();
366246
- init_l4SensitiveRepositories();
366249
+ init_l4RepositoryAutoSwitch();
366247
366250
  import fs102 from "node:fs/promises";
366248
366251
  import * as os47 from "node:os";
366249
366252
  import path114 from "node:path";
@@ -366300,16 +366303,7 @@ var l4RepositoryCheck = {
366300
366303
  id: "l4-repository",
366301
366304
  check: /* @__PURE__ */ __name(async (options2) => {
366302
366305
  try {
366303
- if (!isGitRepository(options2.workspaceRoot)) {
366304
- return null;
366305
- }
366306
- const remoteUrl = getGitRemoteUrl(options2.workspaceRoot);
366307
- if (!remoteUrl) {
366308
- return null;
366309
- }
366310
- const isL4Repo = L4_SENSITIVE_REPOSITORIES.some(
366311
- (repo) => remoteUrl.includes(repo) || repo.includes(remoteUrl)
366312
- );
366306
+ const isL4Repo = await isL4Repository(options2.workspaceRoot);
366313
366307
  if (isL4Repo) {
366314
366308
  return "L4\u7B49\u7EA7\u4ED3\u5E93\uFF0C\u4E3A\u60A8\u5207\u6362\u5230QS\u5E73\u53F0\u6A21\u578B";
366315
366309
  }
@@ -368631,9 +368625,9 @@ ${finalArgs[promptIndex + 1]}`;
368631
368625
  })
368632
368626
  ];
368633
368627
  const { isL4Repository: isL4Repository2, autoSwitchToQSModel: autoSwitchToQSModel2 } = await Promise.resolve().then(() => (init_l4RepositoryAutoSwitch(), l4RepositoryAutoSwitch_exports));
368634
- const isL4Repo = isL4Repository2(process.cwd());
368635
- if (isL4Repo) {
368636
- try {
368628
+ try {
368629
+ const isL4Repo = await isL4Repository2(process.cwd());
368630
+ if (isL4Repo) {
368637
368631
  if (config.getDebugMode()) {
368638
368632
  console.debug(
368639
368633
  "[L4Repository] \u68C0\u6D4B\u5230 L4 \u4ED3\u5E93\uFF0C\u5F00\u59CB\u81EA\u52A8\u5207\u6362\u5230 QS \u5E73\u53F0\u6A21\u578B"
@@ -368643,12 +368637,12 @@ ${finalArgs[promptIndex + 1]}`;
368643
368637
  if (config.getDebugMode()) {
368644
368638
  console.debug("[L4Repository] \u6210\u529F\u5207\u6362\u5230 QS \u5E73\u53F0\u6A21\u578B");
368645
368639
  }
368646
- } catch (error) {
368647
- const errorMsg = `L4\u7B49\u7EA7\u4ED3\u5E93\u68C0\u6D4B\u6210\u529F\uFF0C\u4F46\u5207\u6362\u5230QS\u5E73\u53F0\u6A21\u578B\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}`;
368648
- startupWarnings.push(errorMsg);
368649
- if (config.getDebugMode()) {
368650
- console.error("[L4Repository]", errorMsg, error);
368651
- }
368640
+ }
368641
+ } catch (error) {
368642
+ const errorMsg = `L4\u4ED3\u5E93\u68C0\u6D4B\u6216\u5207\u6362\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}`;
368643
+ startupWarnings.push(errorMsg);
368644
+ if (config.getDebugMode()) {
368645
+ console.error("[L4Repository]", errorMsg, error);
368652
368646
  }
368653
368647
  }
368654
368648
  const { logSessionStart: logSessionStart2 } = await Promise.resolve().then(() => (init_core2(), core_exports2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdmind/rdmind",
3
- "version": "0.0.28-alpha.6",
3
+ "version": "0.0.28-alpha.7",
4
4
  "description": "RDMind - AI-powered coding assistant",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -19,7 +19,7 @@
19
19
  "LICENSE"
20
20
  ],
21
21
  "config": {
22
- "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.28-alpha.6"
22
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.28-alpha.7"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"