@rdmind/rdmind 0.1.9-alpha.2 → 0.1.9-alpha.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.
Files changed (2) hide show
  1. package/cli.js +85 -28
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -132122,6 +132122,7 @@ var init_converter = __esm({
132122
132122
  const totalTokens = usage2.total_tokens || 0;
132123
132123
  const extendedUsage = usage2;
132124
132124
  const cachedTokens = usage2.prompt_tokens_details?.cached_tokens ?? extendedUsage.cached_tokens ?? 0;
132125
+ const thinkingTokens = usage2.completion_tokens_details?.reasoning_tokens || 0;
132125
132126
  let finalPromptTokens = promptTokens;
132126
132127
  let finalCompletionTokens = completionTokens;
132127
132128
  if (totalTokens > 0 && promptTokens === 0 && completionTokens === 0) {
@@ -132132,7 +132133,8 @@ var init_converter = __esm({
132132
132133
  promptTokenCount: finalPromptTokens,
132133
132134
  candidatesTokenCount: finalCompletionTokens,
132134
132135
  totalTokenCount: totalTokens,
132135
- cachedContentTokenCount: cachedTokens
132136
+ cachedContentTokenCount: cachedTokens,
132137
+ thoughtsTokenCount: thinkingTokens
132136
132138
  };
132137
132139
  }
132138
132140
  return response;
@@ -140529,9 +140531,7 @@ var init_default = __esm({
140529
140531
  };
140530
140532
  }
140531
140533
  getDefaultGenerationConfig() {
140532
- return {
140533
- topP: 0.95
140534
- };
140534
+ return {};
140535
140535
  }
140536
140536
  };
140537
140537
  }
@@ -141406,13 +141406,7 @@ var init_pipeline = __esm({
141406
141406
  return params;
141407
141407
  }
141408
141408
  buildReasoningConfig() {
141409
- const reasoning = this.contentGeneratorConfig.reasoning;
141410
- if (reasoning === false) {
141411
- return {};
141412
- }
141413
- return {
141414
- reasoning_effort: reasoning?.effort ?? "medium"
141415
- };
141409
+ return {};
141416
141410
  }
141417
141411
  /**
141418
141412
  * Common error handling wrapper for execute methods
@@ -156107,7 +156101,7 @@ __export(geminiContentGenerator_exports2, {
156107
156101
  createGeminiContentGenerator: () => createGeminiContentGenerator
156108
156102
  });
156109
156103
  function createGeminiContentGenerator(config2, gcConfig) {
156110
- const version2 = "0.1.9-alpha.2";
156104
+ const version2 = "0.1.9-alpha.3";
156111
156105
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
156112
156106
  const baseHeaders = {
156113
156107
  "User-Agent": userAgent2
@@ -173762,7 +173756,7 @@ var init_coreToolScheduler = __esm({
173762
173756
  );
173763
173757
  this.setStatusInternal(reqInfo.callId, "scheduled");
173764
173758
  } else {
173765
- const shouldAutoDeny = !this.config.isInteractive() && !this.config.getIdeMode() && !this.config.getExperimentalZedIntegration() && this.config.getInputFormat() !== "stream-json" /* STREAM_JSON */;
173759
+ const shouldAutoDeny = !this.config.isInteractive() && !this.config.getExperimentalZedIntegration() && this.config.getInputFormat() !== "stream-json" /* STREAM_JSON */;
173766
173760
  if (shouldAutoDeny) {
173767
173761
  const errorMessage = `RDMind requires permission to use "${reqInfo.name}", but that permission was declined.`;
173768
173762
  this.setStatusInternal(
@@ -233609,6 +233603,7 @@ var init_src2 = __esm({
233609
233603
  init_fileUtils();
233610
233604
  init_retry();
233611
233605
  init_shell_utils();
233606
+ init_tool_utils();
233612
233607
  init_terminalSerializer();
233613
233608
  init_systemEncoding();
233614
233609
  init_textUtils();
@@ -233810,8 +233805,8 @@ var init_git_commit = __esm({
233810
233805
  "packages/core/src/generated/git-commit.ts"() {
233811
233806
  "use strict";
233812
233807
  init_esbuild_shims();
233813
- GIT_COMMIT_INFO = "94f47fed";
233814
- CLI_VERSION = "0.1.9-alpha.2";
233808
+ GIT_COMMIT_INFO = "47c20480";
233809
+ CLI_VERSION = "0.1.9-alpha.3";
233815
233810
  }
233816
233811
  });
233817
233812
 
@@ -234902,6 +234897,7 @@ __export(core_exports5, {
234902
234897
  discoverMcpTools: () => discoverMcpTools,
234903
234898
  discoverPrompts: () => discoverPrompts,
234904
234899
  discoverTools: () => discoverTools,
234900
+ doesToolInvocationMatch: () => doesToolInvocationMatch,
234905
234901
  encodeTagName: () => encodeTagName,
234906
234902
  encryptApiKey: () => encryptApiKey,
234907
234903
  ensureMacBinarySigned: () => ensureMacBinarySigned,
@@ -234998,6 +234994,7 @@ __export(core_exports5, {
234998
234994
  isSupportedImageMimeType: () => isSupportedImageMimeType,
234999
234995
  isTelemetrySdkInitialized: () => isTelemetrySdkInitialized,
235000
234996
  isTool: () => isTool,
234997
+ isToolEnabled: () => isToolEnabled,
235001
234998
  isValidNonThoughtTextPart: () => isValidNonThoughtTextPart,
235002
234999
  isWindows: () => isWindows,
235003
235000
  isWithinRoot: () => isWithinRoot,
@@ -344140,7 +344137,7 @@ __name(getPackageJson, "getPackageJson");
344140
344137
  // packages/cli/src/utils/version.ts
344141
344138
  async function getCliVersion() {
344142
344139
  const pkgJson = await getPackageJson();
344143
- return "0.1.9-alpha.2";
344140
+ return "0.1.9-alpha.3";
344144
344141
  }
344145
344142
  __name(getCliVersion, "getCliVersion");
344146
344143
 
@@ -348777,14 +348774,36 @@ async function loadCliConfig(settings, extensions, extensionEnablementManager, a
348777
348774
  interactive = false;
348778
348775
  }
348779
348776
  const extraExcludes = [];
348777
+ const resolvedCoreTools = argv.coreTools || settings.tools?.core || [];
348778
+ const resolvedAllowedTools = argv.allowedTools || settings.tools?.allowed || [];
348779
+ const isExplicitlyEnabled = /* @__PURE__ */ __name((toolName) => {
348780
+ if (resolvedCoreTools.length > 0) {
348781
+ if (isToolEnabled(toolName, resolvedCoreTools, [])) {
348782
+ return true;
348783
+ }
348784
+ }
348785
+ if (resolvedAllowedTools.length > 0) {
348786
+ if (isToolEnabled(toolName, resolvedAllowedTools, [])) {
348787
+ return true;
348788
+ }
348789
+ }
348790
+ return false;
348791
+ }, "isExplicitlyEnabled");
348792
+ const excludeUnlessExplicit = /* @__PURE__ */ __name((toolName) => {
348793
+ if (!isExplicitlyEnabled(toolName)) {
348794
+ extraExcludes.push(toolName);
348795
+ }
348796
+ }, "excludeUnlessExplicit");
348780
348797
  if (!interactive && !argv.experimentalAcp && inputFormat !== "stream-json" /* STREAM_JSON */) {
348781
348798
  switch (approvalMode) {
348782
348799
  case "plan" /* PLAN */:
348783
348800
  case "default" /* DEFAULT */:
348784
- extraExcludes.push(ShellTool.Name, EditTool.Name, WriteFileTool.Name);
348801
+ excludeUnlessExplicit(ShellTool.Name);
348802
+ excludeUnlessExplicit(EditTool.Name);
348803
+ excludeUnlessExplicit(WriteFileTool.Name);
348785
348804
  break;
348786
348805
  case "auto-edit" /* AUTO_EDIT */:
348787
- extraExcludes.push(ShellTool.Name);
348806
+ excludeUnlessExplicit(ShellTool.Name);
348788
348807
  break;
348789
348808
  case "yolo" /* YOLO */:
348790
348809
  break;
@@ -352391,7 +352410,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
352391
352410
 
352392
352411
  // packages/cli/src/generated/git-commit.ts
352393
352412
  init_esbuild_shims();
352394
- var GIT_COMMIT_INFO2 = "94f47fed";
352413
+ var GIT_COMMIT_INFO2 = "47c20480";
352395
352414
 
352396
352415
  // packages/cli/src/utils/systemInfo.ts
352397
352416
  async function getNpmVersion() {
@@ -353469,6 +353488,13 @@ async function createIdlProject(context2, projectName) {
353469
353488
  // 标记为IDL项目
353470
353489
  );
353471
353490
  const searchKeyword = projectName.replace(/[-_]idl$/, "").replace(/_/g, "-");
353491
+ const hasIdlSuffix = /[-_]idl$/.test(projectName);
353492
+ const namingTip = hasIdlSuffix ? `
353493
+ \u{1F4A1} \u5DF2\u81EA\u52A8\u5904\u7406\u9879\u76EE\u540D\u540E\u7F00\uFF1A
353494
+ \u2022 Maven artifactId: ${searchKeyword}-api
353495
+ \u2022 \u641C\u7D22\u5173\u952E\u8BCD: ${searchKeyword}-sdk` : `
353496
+ \u{1F4A1} \u63D0\u793A\uFF1A\u5EFA\u8BAEIDL\u9879\u76EE\u540D\u4EE5 _idl \u6216 -idl \u7ED3\u5C3E\uFF08\u5982\uFF1A${projectName}_idl\uFF09
353497
+ \u8FD9\u6837\u53EF\u4EE5\u81EA\u52A8\u4F18\u5316\u751F\u6210\u7684 artifactId \u548C\u641C\u7D22\u5173\u952E\u8BCD`;
353472
353498
  context2.ui.addItem(
353473
353499
  {
353474
353500
  type: "info" /* INFO */,
@@ -353476,6 +353502,7 @@ async function createIdlProject(context2, projectName) {
353476
353502
  \u{1F4C1} \u4F4D\u7F6E\uFF1A${targetPath}
353477
353503
 
353478
353504
  \u2728 \u5DF2\u81EA\u52A8\u8FC7\u6EE4\u6784\u5EFA\u4EA7\u7269\u548CIDE\u914D\u7F6E\u6587\u4EF6
353505
+ ${namingTip}
353479
353506
 
353480
353507
  \u9879\u76EE\u7ED3\u6784\uFF1A
353481
353508
  ${projectDirectoryName}/
@@ -353531,7 +353558,7 @@ async function createIdlCommand(context2, projectName) {
353531
353558
  context2.ui.addItem(
353532
353559
  {
353533
353560
  type: "error" /* ERROR */,
353534
- text: "\u274C IDL\u9879\u76EE\u540D\u79F0\u65E0\u6548\u3002\n\u2022 \u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u548C\u4E0B\u5212\u7EBF\n\u2022 \u4E0D\u80FD\u5305\u542B\u5176\u4ED6\u7279\u6B8A\u7B26\u53F7\uFF08\u70B9\u7B49\uFF09\n\u2022 \u4E0D\u80FD\u4EE5\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u6216\u4E0B\u5212\u7EBF\u5F00\u5934"
353561
+ text: "\u274C IDL\u9879\u76EE\u540D\u79F0\u65E0\u6548\u3002\n\n\u547D\u540D\u89C4\u8303\uFF1A\n\u2022 \u5EFA\u8BAE\u4EE5 _idl \u6216 -idl \u7ED3\u5C3E\uFF08\u5982\uFF1Aangelos_idl \u6216 angelos-idl\uFF09\n\u2022 \u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u548C\u4E0B\u5212\u7EBF\n\u2022 \u4E0D\u80FD\u5305\u542B\u5176\u4ED6\u7279\u6B8A\u7B26\u53F7\uFF08\u70B9\u7B49\uFF09\n\u2022 \u4E0D\u80FD\u4EE5\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u6216\u4E0B\u5212\u7EBF\u5F00\u5934\n\n\u793A\u4F8B\uFF1A\n\u2022 /create idl angelos_idl\n\u2022 /create idl angelos-idl\n\u2022 /create idl user_service_idl"
353535
353562
  },
353536
353563
  Date.now()
353537
353564
  );
@@ -353542,7 +353569,7 @@ async function createIdlCommand(context2, projectName) {
353542
353569
  __name(createIdlCommand, "createIdlCommand");
353543
353570
  var idlCommand = {
353544
353571
  name: "idl",
353545
- description: "IDL \u9879\u76EE\u811A\u624B\u67B6",
353572
+ description: "IDL \u9879\u76EE\u811A\u624B\u67B6\uFF08\u5EFA\u8BAE\u9879\u76EE\u540D\u4EE5 _idl \u6216 -idl \u7ED3\u5C3E\uFF09",
353546
353573
  kind: "built-in" /* BUILT_IN */,
353547
353574
  action: /* @__PURE__ */ __name(async (context2, args) => {
353548
353575
  const projectName = args.trim();
@@ -353550,7 +353577,7 @@ var idlCommand = {
353550
353577
  context2.ui.addItem(
353551
353578
  {
353552
353579
  type: "error" /* ERROR */,
353553
- text: "\u274C \u8BF7\u63D0\u4F9B\u9879\u76EE\u540D\u79F0\u3002\n\n\u4F7F\u7528\u683C\u5F0F\uFF1A/create idl <\u9879\u76EE\u540D>\n\u4F8B\u5982\uFF1A/create idl my-service"
353580
+ text: "\u274C \u8BF7\u63D0\u4F9B\u9879\u76EE\u540D\u79F0\u3002\n\n\u4F7F\u7528\u683C\u5F0F\uFF1A/create idl <\u9879\u76EE\u540D>\n\n\u{1F4A1} \u5EFA\u8BAE\u9879\u76EE\u540D\u4EE5 _idl \u6216 -idl \u7ED3\u5C3E\uFF0C\u4F8B\u5982\uFF1A\n\u2022 /create idl angelos_idl\n\u2022 /create idl angelos-idl\n\u2022 /create idl user_service_idl\n\n\u8FD9\u6837\u751F\u6210\u7684 artifactId \u4F1A\u81EA\u52A8\u53BB\u9664 _idl/-idl \u540E\u7F00\u3002"
353554
353581
  },
353555
353582
  Date.now()
353556
353583
  );
@@ -354381,11 +354408,23 @@ var ideCommand = /* @__PURE__ */ __name(async () => {
354381
354408
  kind: "built-in" /* BUILT_IN */,
354382
354409
  action: /* @__PURE__ */ __name(async (context2) => {
354383
354410
  const installer = getIdeInstaller(currentIDE);
354411
+ const isSandBox = !!process.env["SANDBOX"];
354412
+ if (isSandBox) {
354413
+ context2.ui.addItem(
354414
+ {
354415
+ type: "info",
354416
+ text: `IDE integration needs to be installed on the host. If you have already installed it, you can directly connect the ide`
354417
+ },
354418
+ Date.now()
354419
+ );
354420
+ return;
354421
+ }
354384
354422
  if (!installer) {
354423
+ const ideName = ideClient.getDetectedIdeDisplayName();
354385
354424
  context2.ui.addItem(
354386
354425
  {
354387
354426
  type: "error",
354388
- text: `No installer is available for ${ideClient.getDetectedIdeDisplayName()}. Please install the '${QWEN_CODE_COMPANION_EXTENSION_NAME}' extension manually from the marketplace.`
354427
+ text: `Automatic installation is not supported for ${ideName}. Please install the '${QWEN_CODE_COMPANION_EXTENSION_NAME}' extension manually from the marketplace.`
354389
354428
  },
354390
354429
  Date.now()
354391
354430
  );
@@ -358970,15 +359009,28 @@ var ShellProcessor = class {
358970
359009
  const command2 = injection.resolvedCommand;
358971
359010
  if (!command2) continue;
358972
359011
  const { allAllowed, disallowedCommands, blockReason, isHardDenial } = checkCommandPermissions(command2, config2, sessionShellAllowlist);
359012
+ const allowedTools = config2.getAllowedTools() || [];
359013
+ const invocation = {
359014
+ params: { command: command2 }
359015
+ };
359016
+ const isAllowedBySettings = doesToolInvocationMatch(
359017
+ "run_shell_command",
359018
+ invocation,
359019
+ allowedTools
359020
+ );
358973
359021
  if (!allAllowed) {
358974
359022
  if (isHardDenial) {
358975
359023
  throw new Error(
358976
359024
  `${this.commandName} cannot be run. Blocked command: "${command2}". Reason: ${blockReason || "Blocked by configuration."}`
358977
359025
  );
358978
359026
  }
358979
- if (config2.getApprovalMode() !== "yolo" /* YOLO */) {
358980
- disallowedCommands.forEach((uc) => commandsToConfirm.add(uc));
359027
+ if (isAllowedBySettings) {
359028
+ continue;
358981
359029
  }
359030
+ if (config2.getApprovalMode() === "yolo" /* YOLO */) {
359031
+ continue;
359032
+ }
359033
+ disallowedCommands.forEach((uc) => commandsToConfirm.add(uc));
358982
359034
  }
358983
359035
  }
358984
359036
  if (commandsToConfirm.size > 0) {
@@ -387943,6 +387995,7 @@ function IdeIntegrationNudge({
387943
387995
  { isActive: true }
387944
387996
  );
387945
387997
  const { displayName: ideName } = ide;
387998
+ const isInSandbox = !!process.env["SANDBOX"];
387946
387999
  const isExtensionPreInstalled = !!process.env["RDMIND_CODE_IDE_SERVER_PORT"] && !!process.env["RDMIND_CODE_IDE_WORKSPACE_PATH"];
387947
388000
  const OPTIONS = [
387948
388001
  {
@@ -387970,7 +388023,7 @@ function IdeIntegrationNudge({
387970
388023
  key: "No, don't ask again"
387971
388024
  }
387972
388025
  ];
387973
- const installText = isExtensionPreInstalled ? `If you select Yes, the CLI will have access to your open files and display diffs directly in ${ideName ?? "your editor"}.` : `If you select Yes, we'll install an extension that allows the CLI to access your open files and display diffs directly in ${ideName ?? "your editor"}.`;
388026
+ const installText = isInSandbox ? `Note: In sandbox environments, IDE integration requires manual setup on the host system. If you select Yes, you'll receive instructions on how to set this up.` : isExtensionPreInstalled ? `If you select Yes, the CLI will connect to your ${ideName ?? "editor"} and have access to your open files and display diffs directly.` : `If you select Yes, we'll install an extension that allows the CLI to access your open files and display diffs directly in ${ideName ?? "your editor"}.`;
387974
388027
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
387975
388028
  Box_default,
387976
388029
  {
@@ -404463,7 +404516,11 @@ ${queuedText}` : queuedText;
404463
404516
  const handleIdePromptComplete = (0, import_react134.useCallback)(
404464
404517
  (result) => {
404465
404518
  if (result.userSelection === "yes") {
404466
- handleSlashCommand2("/ide install");
404519
+ if (result.isExtensionPreInstalled) {
404520
+ handleSlashCommand2("/ide enable");
404521
+ } else {
404522
+ handleSlashCommand2("/ide install");
404523
+ }
404467
404524
  settings.setValue("User" /* User */, "ide.hasSeenNudge", true);
404468
404525
  } else if (result.userSelection === "dismiss") {
404469
404526
  settings.setValue("User" /* User */, "ide.hasSeenNudge", true);
@@ -408407,7 +408464,7 @@ var GeminiAgent = class {
408407
408464
  name: APPROVAL_MODE_INFO[mode].name,
408408
408465
  description: APPROVAL_MODE_INFO[mode].description
408409
408466
  }));
408410
- const version2 = "0.1.9-alpha.2";
408467
+ const version2 = "0.1.9-alpha.3";
408411
408468
  return {
408412
408469
  protocolVersion: PROTOCOL_VERSION,
408413
408470
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdmind/rdmind",
3
- "version": "0.1.9-alpha.2",
3
+ "version": "0.1.9-alpha.3",
4
4
  "description": "RDMind - AI-powered coding assistant",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -20,7 +20,7 @@
20
20
  "locales"
21
21
  ],
22
22
  "config": {
23
- "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.9-alpha.2"
23
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.9-alpha.3"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"