@rdmind/rdmind 0.2.8-alpha.8 → 0.2.8-alpha.9

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 (3) hide show
  1. package/cli.js +196 -95
  2. package/locales/zh.js +1 -4
  3. package/package.json +2 -2
package/cli.js CHANGED
@@ -19275,6 +19275,9 @@ function isSubpath(parentPath, childPath) {
19275
19275
  const relative11 = pathModule2.relative(parentPath, childPath);
19276
19276
  return !relative11.startsWith(`..${pathModule2.sep}`) && relative11 !== ".." && !pathModule2.isAbsolute(relative11);
19277
19277
  }
19278
+ function isSubpaths(parentPath, childPath) {
19279
+ return parentPath.some((p2) => isSubpath(p2, childPath));
19280
+ }
19278
19281
  function resolvePath(baseDir = process.cwd(), relativePath) {
19279
19282
  const homeDir = os.homedir();
19280
19283
  if (relativePath === "~") {
@@ -19331,6 +19334,7 @@ var init_paths = __esm({
19331
19334
  __name(getProjectHash, "getProjectHash");
19332
19335
  __name(sanitizeCwd, "sanitizeCwd");
19333
19336
  __name(isSubpath, "isSubpath");
19337
+ __name(isSubpaths, "isSubpaths");
19334
19338
  __name(resolvePath, "resolvePath");
19335
19339
  __name(validatePath, "validatePath");
19336
19340
  __name(resolveAndValidatePath, "resolveAndValidatePath");
@@ -19341,7 +19345,7 @@ var init_paths = __esm({
19341
19345
  import * as path2 from "node:path";
19342
19346
  import * as os2 from "node:os";
19343
19347
  import * as fs2 from "node:fs";
19344
- var QWEN_DIR2, GOOGLE_ACCOUNTS_FILENAME2, OAUTH_FILE, TMP_DIR_NAME, BIN_DIR_NAME, PROJECT_DIR_NAME, IDE_DIR_NAME, DEBUG_DIR_NAME, Storage;
19348
+ var QWEN_DIR2, GOOGLE_ACCOUNTS_FILENAME2, OAUTH_FILE, SKILL_PROVIDER_CONFIG_DIRS, TMP_DIR_NAME, BIN_DIR_NAME, PROJECT_DIR_NAME, IDE_DIR_NAME, DEBUG_DIR_NAME, Storage;
19345
19349
  var init_storage = __esm({
19346
19350
  "packages/core/src/config/storage.ts"() {
19347
19351
  "use strict";
@@ -19350,6 +19354,16 @@ var init_storage = __esm({
19350
19354
  QWEN_DIR2 = ".rdmind";
19351
19355
  GOOGLE_ACCOUNTS_FILENAME2 = "google_accounts.json";
19352
19356
  OAUTH_FILE = "oauth_creds.json";
19357
+ SKILL_PROVIDER_CONFIG_DIRS = [
19358
+ ".rdmind",
19359
+ ".qwen",
19360
+ ".agent",
19361
+ ".agents",
19362
+ ".claude",
19363
+ ".cursor",
19364
+ ".codex",
19365
+ ".codewiz"
19366
+ ];
19353
19367
  TMP_DIR_NAME = "tmp";
19354
19368
  BIN_DIR_NAME = "bin";
19355
19369
  PROJECT_DIR_NAME = "projects";
@@ -19447,8 +19461,11 @@ var init_storage = __esm({
19447
19461
  getExtensionsConfigPath() {
19448
19462
  return path2.join(this.getExtensionsDir(), "rdmind-extension.json");
19449
19463
  }
19450
- getUserSkillsDir() {
19451
- return path2.join(_Storage.getGlobalQwenDir(), "skills");
19464
+ getUserSkillsDirs() {
19465
+ const homeDir = os2.homedir() || os2.tmpdir();
19466
+ return SKILL_PROVIDER_CONFIG_DIRS.map(
19467
+ (dir) => path2.join(homeDir, dir, "skills")
19468
+ );
19452
19469
  }
19453
19470
  getHistoryFilePath() {
19454
19471
  return path2.join(this.getProjectTempDir(), "shell_history");
@@ -144134,6 +144151,18 @@ var init_provider = __esm({
144134
144151
  });
144135
144152
 
144136
144153
  // packages/core/src/core/openaiContentGenerator/pipeline.ts
144154
+ function buildProviderExtraBody(model) {
144155
+ const modelLower = model.toLowerCase();
144156
+ if (modelLower.includes("glm-5")) {
144157
+ return {
144158
+ thinking: {
144159
+ type: "enabled",
144160
+ clear_thinking: false
144161
+ }
144162
+ };
144163
+ }
144164
+ return void 0;
144165
+ }
144137
144166
  var StreamContentError, ContentGenerationPipeline;
144138
144167
  var init_pipeline = __esm({
144139
144168
  "packages/core/src/core/openaiContentGenerator/pipeline.ts"() {
@@ -144141,6 +144170,7 @@ var init_pipeline = __esm({
144141
144170
  init_esbuild_shims();
144142
144171
  init_node();
144143
144172
  init_converter();
144173
+ __name(buildProviderExtraBody, "buildProviderExtraBody");
144144
144174
  StreamContentError = class extends Error {
144145
144175
  static {
144146
144176
  __name(this, "StreamContentError");
@@ -144177,13 +144207,7 @@ var init_pipeline = __esm({
144177
144207
  false,
144178
144208
  effectiveModel,
144179
144209
  async (openaiRequest) => {
144180
- const extraBody = this.contentGeneratorConfig.model?.toLowerCase().includes("glm-5") ? {
144181
- thinking: {
144182
- type: "enabled",
144183
- clear_thinking: false
144184
- // Enable preserved/interleaved thinking
144185
- }
144186
- } : void 0;
144210
+ const extraBody = buildProviderExtraBody(this.contentGeneratorConfig.model);
144187
144211
  const openaiResponse = await this.client.chat.completions.create(
144188
144212
  openaiRequest,
144189
144213
  {
@@ -144206,13 +144230,7 @@ var init_pipeline = __esm({
144206
144230
  true,
144207
144231
  effectiveModel,
144208
144232
  async (openaiRequest, context2) => {
144209
- const extraBody = this.contentGeneratorConfig.model?.toLowerCase().includes("glm-5") ? {
144210
- thinking: {
144211
- type: "enabled",
144212
- clear_thinking: false
144213
- // Enable preserved/interleaved thinking
144214
- }
144215
- } : void 0;
144233
+ const extraBody = buildProviderExtraBody(this.contentGeneratorConfig.model);
144216
144234
  const stream2 = await this.client.chat.completions.create(
144217
144235
  openaiRequest,
144218
144236
  {
@@ -148823,7 +148841,7 @@ function extractReasoningEffort(model) {
148823
148841
  const match2 = model.match(/^(.+?)\((\w+)\)$/);
148824
148842
  if (!match2) return void 0;
148825
148843
  const level = match2[2].toLowerCase();
148826
- if (level === "low" || level === "medium" || level === "high") {
148844
+ if (level === "none" || level === "low" || level === "medium" || level === "high" || level === "xhigh") {
148827
148845
  return level;
148828
148846
  }
148829
148847
  return void 0;
@@ -149111,6 +149129,19 @@ function convertGeminiSchemaToOpenAI(parameters) {
149111
149129
  }, "convertTypes");
149112
149130
  return convertTypes(converted);
149113
149131
  }
149132
+ function mapCodexStatusToFinishReason(status) {
149133
+ switch (status) {
149134
+ case "completed":
149135
+ return FinishReason.STOP;
149136
+ case "incomplete":
149137
+ return FinishReason.MAX_TOKENS;
149138
+ case "failed":
149139
+ case "cancelled":
149140
+ return FinishReason.FINISH_REASON_UNSPECIFIED;
149141
+ default:
149142
+ return FinishReason.STOP;
149143
+ }
149144
+ }
149114
149145
  function convertCodexResponseToGemini(response) {
149115
149146
  const parts = [];
149116
149147
  if (response.output && Array.isArray(response.output)) {
@@ -149138,10 +149169,11 @@ function convertCodexResponseToGemini(response) {
149138
149169
  }
149139
149170
  }
149140
149171
  }
149172
+ const finishReason = mapCodexStatusToFinishReason(response.status);
149141
149173
  return createGeminiResponse(
149142
149174
  response.id,
149143
149175
  parts,
149144
- FinishReason.STOP,
149176
+ finishReason,
149145
149177
  response.usage ? {
149146
149178
  promptTokenCount: response.usage.input_tokens,
149147
149179
  candidatesTokenCount: response.usage.output_tokens,
@@ -149186,6 +149218,7 @@ var init_codexContentGenerator = __esm({
149186
149218
  apiKey;
149187
149219
  samplingParams;
149188
149220
  reasoning;
149221
+ enableOpenAILogging;
149189
149222
  modalities;
149190
149223
  cliConfig;
149191
149224
  errorHandler;
@@ -149195,6 +149228,7 @@ var init_codexContentGenerator = __esm({
149195
149228
  this.apiKey = config2.apiKey || "";
149196
149229
  this.samplingParams = config2.samplingParams;
149197
149230
  this.reasoning = config2.reasoning;
149231
+ this.enableOpenAILogging = config2.enableOpenAILogging ?? false;
149198
149232
  this.modalities = config2.modalities ?? defaultModalities(config2.model);
149199
149233
  this.cliConfig = cliConfig;
149200
149234
  if (!this.apiKey) {
@@ -149204,7 +149238,9 @@ var init_codexContentGenerator = __esm({
149204
149238
  throw new Error("Base URL is required for Codex");
149205
149239
  }
149206
149240
  this.errorHandler = new EnhancedErrorHandler(() => false);
149207
- this.logger = new OpenAILogger(config2.openAILoggingDir);
149241
+ if (this.enableOpenAILogging) {
149242
+ this.logger = new OpenAILogger(config2.openAILoggingDir);
149243
+ }
149208
149244
  }
149209
149245
  // ============================================================================
149210
149246
  // 主要 API 方法
@@ -149294,6 +149330,7 @@ var init_codexContentGenerator = __esm({
149294
149330
  input,
149295
149331
  stream: stream2,
149296
149332
  store: true,
149333
+ truncation: "auto",
149297
149334
  temperature: this.samplingParams?.temperature ?? 1,
149298
149335
  top_p: this.samplingParams?.top_p,
149299
149336
  max_output_tokens: this.samplingParams?.max_tokens,
@@ -149316,6 +149353,7 @@ var init_codexContentGenerator = __esm({
149316
149353
  const decoder = new TextDecoder();
149317
149354
  let buffer = "";
149318
149355
  let currentEvent = "";
149356
+ const yieldState = { hasYieldedText: false, hasYieldedFunctionCall: false };
149319
149357
  const toolCallArgs = /* @__PURE__ */ new Map();
149320
149358
  try {
149321
149359
  while (true) {
@@ -149336,12 +149374,19 @@ var init_codexContentGenerator = __esm({
149336
149374
  if (dataStr === "[DONE]") return;
149337
149375
  try {
149338
149376
  const data = JSON.parse(dataStr);
149377
+ const eventType = currentEvent || data.type || "";
149339
149378
  const response = this.handleStreamEvent(
149340
- currentEvent,
149379
+ eventType,
149341
149380
  data,
149342
- toolCallArgs
149381
+ toolCallArgs,
149382
+ yieldState
149343
149383
  );
149344
149384
  if (response) {
149385
+ const parts = response.candidates?.[0]?.content?.parts;
149386
+ if (parts?.some((p2) => p2.text))
149387
+ yieldState.hasYieldedText = true;
149388
+ if (parts?.some((p2) => p2.functionCall))
149389
+ yieldState.hasYieldedFunctionCall = true;
149345
149390
  yield response;
149346
149391
  }
149347
149392
  } catch {
@@ -149359,7 +149404,7 @@ var init_codexContentGenerator = __esm({
149359
149404
  reader.releaseLock();
149360
149405
  }
149361
149406
  }
149362
- handleStreamEvent(event, data, toolCallArgs) {
149407
+ handleStreamEvent(event, data, toolCallArgs, yieldState) {
149363
149408
  switch (event) {
149364
149409
  case "response.reasoning_summary_text.delta": {
149365
149410
  return null;
@@ -149369,7 +149414,7 @@ var init_codexContentGenerator = __esm({
149369
149414
  if (!text) return null;
149370
149415
  return createGeminiResponse(data.item_id || "unknown", [{ text }]);
149371
149416
  }
149372
- case "response.tool_calls.delta": {
149417
+ case "response.function_call_arguments.delta": {
149373
149418
  const index = data.tool_call_index ?? 0;
149374
149419
  const current = toolCallArgs.get(index) || { args: "" };
149375
149420
  if (data.tool_call_id) current.id = data.tool_call_id;
@@ -149380,35 +149425,64 @@ var init_codexContentGenerator = __esm({
149380
149425
  }
149381
149426
  case "response.output_item.done": {
149382
149427
  const item = data.item;
149383
- if (item?.type === "function_call" && item.arguments) {
149384
- try {
149385
- const args = JSON.parse(item.arguments);
149386
- return createGeminiResponse(data.item_id || "unknown", [
149387
- {
149388
- functionCall: {
149389
- id: item.call_id || item.id || `call_${Date.now()}`,
149390
- name: item.name || "unknown",
149391
- args
149428
+ if (item?.type === "function_call") {
149429
+ const index = data.tool_call_index ?? 0;
149430
+ const accumulated = toolCallArgs.get(index);
149431
+ const rawArgs = item.arguments || accumulated?.args;
149432
+ if (rawArgs) {
149433
+ try {
149434
+ const args = JSON.parse(rawArgs);
149435
+ const callId = item.call_id || item.id || accumulated?.id || `call_${Date.now()}`;
149436
+ const name3 = item.name || accumulated?.name || "unknown";
149437
+ toolCallArgs.delete(index);
149438
+ return createGeminiResponse(data.item_id || "unknown", [
149439
+ {
149440
+ functionCall: { id: callId, name: name3, args }
149392
149441
  }
149393
- }
149394
- ]);
149395
- } catch {
149442
+ ]);
149443
+ } catch {
149444
+ }
149396
149445
  }
149397
149446
  }
149398
149447
  return null;
149399
149448
  }
149400
- case "response.completed": {
149449
+ case "response.completed":
149450
+ case "response.incomplete":
149451
+ case "response.failed": {
149401
149452
  const response = data.response;
149453
+ const finishReason = event === "response.incomplete" ? FinishReason.MAX_TOKENS : event === "response.failed" ? FinishReason.FINISH_REASON_UNSPECIFIED : mapCodexStatusToFinishReason(response?.status);
149454
+ const usage2 = response?.usage;
149455
+ const parts = [];
149456
+ if (response?.output) {
149457
+ for (const item of response.output) {
149458
+ if (!yieldState.hasYieldedText && item.type === "message" && item.content) {
149459
+ const text = item.content.map((c4) => c4.text).filter(Boolean).join("");
149460
+ if (text) parts.push({ text });
149461
+ } else if (!yieldState.hasYieldedFunctionCall && item.type === "function_call" && item.arguments) {
149462
+ try {
149463
+ const args = JSON.parse(item.arguments);
149464
+ parts.push({
149465
+ functionCall: {
149466
+ id: item.call_id || item.id || `call_${Date.now()}`,
149467
+ name: item.name || "unknown",
149468
+ args
149469
+ }
149470
+ });
149471
+ } catch {
149472
+ }
149473
+ }
149474
+ }
149475
+ }
149402
149476
  return createGeminiResponse(
149403
149477
  response?.id || "final",
149404
- [],
149405
- FinishReason.STOP,
149406
- response?.usage ? {
149407
- promptTokenCount: response.usage.input_tokens,
149408
- candidatesTokenCount: response.usage.output_tokens,
149409
- totalTokenCount: response.usage.total_tokens,
149410
- cachedContentTokenCount: response.usage.input_tokens_details?.cached_tokens,
149411
- thoughtsTokenCount: response.usage.output_tokens_details?.reasoning_tokens
149478
+ parts,
149479
+ finishReason,
149480
+ usage2 ? {
149481
+ promptTokenCount: usage2.input_tokens,
149482
+ candidatesTokenCount: usage2.output_tokens,
149483
+ totalTokenCount: usage2.total_tokens,
149484
+ cachedContentTokenCount: usage2.input_tokens_details?.cached_tokens,
149485
+ thoughtsTokenCount: usage2.output_tokens_details?.reasoning_tokens
149412
149486
  } : void 0
149413
149487
  );
149414
149488
  }
@@ -149430,7 +149504,7 @@ var init_codexContentGenerator = __esm({
149430
149504
  response.usageMetadata
149431
149505
  );
149432
149506
  logApiResponse(this.cliConfig, event);
149433
- if (request4 && rawResponse) {
149507
+ if (this.enableOpenAILogging && this.logger && request4 && rawResponse) {
149434
149508
  await this.logger.logInteraction(request4, rawResponse);
149435
149509
  }
149436
149510
  }
@@ -149449,7 +149523,7 @@ var init_codexContentGenerator = __esm({
149449
149523
  apiError?.code
149450
149524
  );
149451
149525
  logApiError(this.cliConfig, event);
149452
- if (request4) {
149526
+ if (this.enableOpenAILogging && this.logger && request4) {
149453
149527
  await this.logger.logInteraction(request4, void 0, error40);
149454
149528
  }
149455
149529
  }
@@ -149464,7 +149538,9 @@ var init_codexContentGenerator = __esm({
149464
149538
  void 0
149465
149539
  );
149466
149540
  logApiResponse(this.cliConfig, event);
149467
- await this.logger.logInteraction(request4, { streamed: true });
149541
+ if (this.enableOpenAILogging && this.logger) {
149542
+ await this.logger.logInteraction(request4, { streamed: true });
149543
+ }
149468
149544
  }
149469
149545
  };
149470
149546
  __name(extractBaseModel, "extractBaseModel");
@@ -149477,6 +149553,7 @@ var init_codexContentGenerator = __esm({
149477
149553
  __name(extractTextFromContent, "extractTextFromContent");
149478
149554
  __name(convertTools, "convertTools");
149479
149555
  __name(convertGeminiSchemaToOpenAI, "convertGeminiSchemaToOpenAI");
149556
+ __name(mapCodexStatusToFinishReason, "mapCodexStatusToFinishReason");
149480
149557
  __name(convertCodexResponseToGemini, "convertCodexResponseToGemini");
149481
149558
  __name(createGeminiResponse, "createGeminiResponse");
149482
149559
  }
@@ -161068,7 +161145,7 @@ __export(geminiContentGenerator_exports2, {
161068
161145
  createGeminiContentGenerator: () => createGeminiContentGenerator
161069
161146
  });
161070
161147
  function createGeminiContentGenerator(config2, gcConfig) {
161071
- const version2 = "0.2.8-alpha.8";
161148
+ const version2 = "0.2.8-alpha.9";
161072
161149
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
161073
161150
  const baseHeaders = {
161074
161151
  "User-Agent": userAgent2
@@ -161249,7 +161326,7 @@ async function createContentGenerator(generatorConfig, config2, isInitialAuth) {
161249
161326
  generatorConfig,
161250
161327
  config2
161251
161328
  );
161252
- } else if (model.includes("codex")) {
161329
+ } else if (model.includes("codex") || model.startsWith("gpt-5.4")) {
161253
161330
  const { CodexContentGenerator: CodexContentGenerator2 } = await Promise.resolve().then(() => (init_codexContentGenerator(), codexContentGenerator_exports));
161254
161331
  baseGenerator = new CodexContentGenerator2(generatorConfig, config2);
161255
161332
  } else {
@@ -178610,10 +178687,10 @@ Co-authored-by: ${gitCoAuthorSettings.name} <${gitCoAuthorSettings.email}>`;
178610
178687
  if (!path20.isAbsolute(params.directory)) {
178611
178688
  return "Directory must be an absolute path.";
178612
178689
  }
178613
- const userSkillsDir = this.config.storage.getUserSkillsDir();
178690
+ const userSkillsDirs = this.config.storage.getUserSkillsDirs();
178614
178691
  const resolvedDirectoryPath = path20.resolve(params.directory);
178615
- const isWithinUserSkills = isSubpath(
178616
- userSkillsDir,
178692
+ const isWithinUserSkills = isSubpaths(
178693
+ userSkillsDirs,
178617
178694
  resolvedDirectoryPath
178618
178695
  );
178619
178696
  if (isWithinUserSkills) {
@@ -205513,10 +205590,10 @@ ${result.llmContent}`;
205513
205590
  const workspaceContext = this.config.getWorkspaceContext();
205514
205591
  const globalTempDir = Storage.getGlobalTempDir();
205515
205592
  const projectTempDir = this.config.storage.getProjectTempDir();
205516
- const userSkillsDir = this.config.storage.getUserSkillsDir();
205593
+ const userSkillsDirs = this.config.storage.getUserSkillsDirs();
205517
205594
  const resolvedFilePath = path34.resolve(filePath);
205518
205595
  const isWithinTempDir = isSubpath(projectTempDir, resolvedFilePath) || isSubpath(globalTempDir, resolvedFilePath);
205519
- const isWithinUserSkills = isSubpath(userSkillsDir, resolvedFilePath);
205596
+ const isWithinUserSkills = isSubpaths(userSkillsDirs, resolvedFilePath);
205520
205597
  if (!workspaceContext.isPathWithinWorkspace(filePath) && !isWithinTempDir && !isWithinUserSkills) {
205521
205598
  const directories = workspaceContext.getDirectories();
205522
205599
  return `File path must be within one of the workspace directories: ${directories.join(
@@ -226483,8 +226560,8 @@ ${directoryContent}`;
226483
226560
  if (!path40.isAbsolute(params.path)) {
226484
226561
  return `Path must be absolute: ${params.path}`;
226485
226562
  }
226486
- const userSkillsBase = this.config.storage.getUserSkillsDir();
226487
- const isUnderUserSkills = isSubpath(userSkillsBase, params.path);
226563
+ const userSkillsBases = this.config.storage.getUserSkillsDirs();
226564
+ const isUnderUserSkills = isSubpaths(userSkillsBases, params.path);
226488
226565
  const workspaceContext = this.config.getWorkspaceContext();
226489
226566
  if (!workspaceContext.isPathWithinWorkspace(params.path) && !isUnderUserSkills) {
226490
226567
  const directories = workspaceContext.getDirectories();
@@ -242175,6 +242252,7 @@ var init_skill_manager = __esm({
242175
242252
  init_skill_load();
242176
242253
  init_debugLogger();
242177
242254
  init_textUtils();
242255
+ init_storage();
242178
242256
  debugLogger65 = createDebugLogger("SKILL_MANAGER");
242179
242257
  QWEN_CONFIG_DIR2 = ".rdmind";
242180
242258
  SKILLS_CONFIG_DIR = "skills";
@@ -242485,15 +242563,15 @@ var init_skill_manager = __esm({
242485
242563
  * Gets the base directory for skills at a specific level.
242486
242564
  *
242487
242565
  * @param level - Storage level
242488
- * @returns Absolute directory path
242566
+ * @returns Absolute directory paths
242489
242567
  */
242490
- getSkillsBaseDir(level) {
242491
- const baseDir = level === "project" ? path51.join(
242492
- this.config.getProjectRoot(),
242493
- QWEN_CONFIG_DIR2,
242494
- SKILLS_CONFIG_DIR
242495
- ) : path51.join(os20.homedir(), QWEN_CONFIG_DIR2, SKILLS_CONFIG_DIR);
242496
- return baseDir;
242568
+ getSkillsBaseDirs(level) {
242569
+ const baseDirs = level === "project" ? SKILL_PROVIDER_CONFIG_DIRS.map(
242570
+ (v2) => path51.join(this.config.getProjectRoot(), v2, SKILLS_CONFIG_DIR)
242571
+ ) : SKILL_PROVIDER_CONFIG_DIRS.map(
242572
+ (v2) => path51.join(os20.homedir(), v2, SKILLS_CONFIG_DIR)
242573
+ );
242574
+ return baseDirs;
242497
242575
  }
242498
242576
  /**
242499
242577
  * Lists skills at a specific level.
@@ -242524,9 +242602,23 @@ var init_skill_manager = __esm({
242524
242602
  );
242525
242603
  return skills2;
242526
242604
  }
242527
- const baseDir = this.getSkillsBaseDir(level);
242528
- debugLogger65.debug(`Loading ${level} level skills from: ${baseDir}`);
242529
- const skills = await this.loadSkillsFromDir(baseDir, level);
242605
+ const baseDirs = this.getSkillsBaseDirs(level);
242606
+ const skills = [];
242607
+ const seenNames = /* @__PURE__ */ new Set();
242608
+ for (const baseDir of baseDirs) {
242609
+ debugLogger65.debug(`Loading ${level} level skills from: ${baseDir}`);
242610
+ const skillsFromDir = await this.loadSkillsFromDir(baseDir, level);
242611
+ for (const skill of skillsFromDir) {
242612
+ if (seenNames.has(skill.name)) {
242613
+ debugLogger65.debug(
242614
+ `Skipping duplicate skill at ${level} level: ${skill.name} from ${baseDir}`
242615
+ );
242616
+ continue;
242617
+ }
242618
+ seenNames.add(skill.name);
242619
+ skills.push(skill);
242620
+ }
242621
+ }
242530
242622
  debugLogger65.debug(`Loaded ${skills.length} ${level} level skills`);
242531
242623
  return skills;
242532
242624
  }
@@ -242616,7 +242708,7 @@ var init_skill_manager = __esm({
242616
242708
  }
242617
242709
  updateWatchersFromCache() {
242618
242710
  const watchTargets = new Set(
242619
- ["project", "user"].map((level) => this.getSkillsBaseDir(level)).filter((baseDir) => fsSync2.existsSync(baseDir))
242711
+ ["project", "user"].map((level) => this.getSkillsBaseDirs(level)).reduce((acc, baseDirs) => acc.concat(baseDirs), []).filter((baseDir) => fsSync2.existsSync(baseDir))
242620
242712
  );
242621
242713
  for (const existingPath of this.watchers.keys()) {
242622
242714
  if (!watchTargets.has(existingPath)) {
@@ -242660,7 +242752,7 @@ var init_skill_manager = __esm({
242660
242752
  }, 150);
242661
242753
  }
242662
242754
  async ensureUserSkillsDir() {
242663
- const baseDir = this.getSkillsBaseDir("user");
242755
+ const baseDir = path51.join(os20.homedir(), QWEN_CONFIG_DIR2, SKILLS_CONFIG_DIR);
242664
242756
  try {
242665
242757
  await fs47.mkdir(baseDir, { recursive: true });
242666
242758
  } catch (error40) {
@@ -266797,12 +266889,12 @@ async function fetchModelKey(modelName) {
266797
266889
  try {
266798
266890
  let processedModelName = modelName;
266799
266891
  const modelNameLower = modelName.toLowerCase();
266800
- if (modelNameLower.startsWith("gemini") || modelNameLower.includes("codex")) {
266892
+ if (modelNameLower.startsWith("gemini") || modelNameLower.includes("codex") || modelNameLower.startsWith("gpt-5.4")) {
266801
266893
  const match2 = modelName.match(/^(.+?)\(\w+\)$/);
266802
266894
  if (match2) {
266803
266895
  processedModelName = match2[1];
266804
266896
  logger3.debug(
266805
- `${modelNameLower.startsWith("gemini") ? "gemini" : "codex"} \u6A21\u578B\u9884\u5904\u7406: ${modelName} -> ${processedModelName}`
266897
+ `${modelNameLower.startsWith("gemini") ? "gemini" : modelNameLower.includes("codex") ? "codex" : "gpt-5.4"} \u6A21\u578B\u9884\u5904\u7406: ${modelName} -> ${processedModelName}`
266806
266898
  );
266807
266899
  }
266808
266900
  }
@@ -276250,6 +276342,7 @@ __export(core_exports5, {
276250
276342
  isSdkMcpServerConfig: () => isSdkMcpServerConfig,
276251
276343
  isStructuredError: () => isStructuredError,
276252
276344
  isSubpath: () => isSubpath,
276345
+ isSubpaths: () => isSubpaths,
276253
276346
  isSupportedImageMimeType: () => isSupportedImageMimeType,
276254
276347
  isTelemetrySdkInitialized: () => isTelemetrySdkInitialized,
276255
276348
  isTomlFormat: () => isTomlFormat,
@@ -314987,7 +315080,7 @@ var init_zh = __esm({
314987
315080
  "No sessions found. Start a new session with {{cmd}}.": "\u672A\u53D1\u73B0\u4F1A\u8BDD\u3002\u8BF7\u4F7F\u7528 {{cmd}} \u5F00\u59CB\u65B0\u4F1A\u8BDD\u3002",
314988
315081
  "No saved session found with ID {{sessionId}}. Run `rdmind --resume` without an ID to choose from existing sessions.": "\u672A\u53D1\u73B0 ID \u4E3A {{sessionId}} \u7684\u5DF2\u4FDD\u5B58\u4F1A\u8BDD\u3002\u8BF7\u8FD0\u884C\u4E0D\u5E26 ID \u7684 `rdmind --resume` \u4EE5\u4ECE\u73B0\u6709\u4F1A\u8BDD\u4E2D\u9009\u62E9\u3002",
314989
315082
  "Clear conversation history and free up context": "\u6E05\u9664\u5BF9\u8BDD\u5386\u53F2\u5E76\u91CA\u653E\u4E0A\u4E0B\u6587",
314990
- "Compresses the context by replacing it with a summary.": "\u901A\u8FC7\u7528\u6458\u8981\u66FF\u6362\u6765\u538B\u7F29\u4E0A\u4E0B\u6587",
315083
+ "Compresses the context by replacing it with a summary.": "\u901A\u8FC7\u6458\u8981\u66FF\u6362\u6765\u538B\u7F29\u4E0A\u4E0B\u6587",
314991
315084
  "open full RDMind documentation in your browser": "\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00\u5B8C\u6574\u7684 RDMind \u6587\u6863",
314992
315085
  "Configuration not available.": "\u914D\u7F6E\u4E0D\u53EF\u7528",
314993
315086
  "change the auth method": "\u66F4\u6539\u8BA4\u8BC1\u65B9\u6CD5",
@@ -315947,11 +316040,8 @@ var init_zh = __esm({
315947
316040
  "\u6B63\u5728\u5C1D\u8BD5\u9000\u51FA Vim...",
315948
316041
  "\u8FD9\u4E0D\u662F\u4E00\u4E2A\u9519\u8BEF\uFF0C\u8FD9\u662F\u4E00\u4E2A\u672A\u8BB0\u5F55\u7684\u529F\u80FD...",
315949
316042
  "\u6B63\u5728\u5199\u4E00\u4E2A\u6C38\u8FDC\u4E0D\u4F1A\u89E6\u53D1\u7684 else...",
315950
- "\u6B63\u5728\u6392\u67E5\u662F\u8C01\u5199\u7684\u8FD9\u6BB5\u7956\u4F20\u4EE3\u7801...\u54E6\u662F\u6211\u81EA\u5DF1...",
315951
316043
  "\u6B63\u5728\u628A if-else \u91CD\u6784\u6210 switch...",
315952
- "\u6B63\u5728\u89E3\u51B3\u4F9D\u8D56\u5173\u7CFB\uFF08\u5730\u72F1\uFF09...",
315953
316044
  "\u6B63\u5728\u5C06\u5496\u5561\u8F6C\u6362\u4E3A\u4EE3\u7801...",
315954
- "\u6B63\u5728\u5220\u5E93\u8DD1\u8DEF...\u7684\u8FB9\u7F18\u8BD5\u63A2...",
315955
316045
  // --- 工作/职场相关 ---
315956
316046
  "\u6B63\u5728\u7B49\u5F85\u4EA7\u54C1\u7ECF\u7406\u6539\u9700\u6C42...",
315957
316047
  "\u6B63\u5728\u5B66\u4E60\u5982\u4F55\u4F18\u96C5\u5730\u62D2\u7EDD\u9700\u6C42...",
@@ -368274,7 +368364,8 @@ var SETTINGS_SCHEMA = {
368274
368364
  requiresRestart: true,
368275
368365
  default: void 0,
368276
368366
  description: "A list of MCP servers to allow.",
368277
- showInDialog: false
368367
+ showInDialog: false,
368368
+ mergeStrategy: "concat" /* CONCAT */
368278
368369
  },
368279
368370
  excluded: {
368280
368371
  type: "array",
@@ -368283,7 +368374,8 @@ var SETTINGS_SCHEMA = {
368283
368374
  requiresRestart: true,
368284
368375
  default: void 0,
368285
368376
  description: "A list of MCP servers to exclude.",
368286
- showInDialog: false
368377
+ showInDialog: false,
368378
+ mergeStrategy: "concat" /* CONCAT */
368287
368379
  }
368288
368380
  }
368289
368381
  },
@@ -377033,7 +377125,7 @@ __name(getPackageJson, "getPackageJson");
377033
377125
  // packages/cli/src/utils/version.ts
377034
377126
  async function getCliVersion() {
377035
377127
  const pkgJson = await getPackageJson();
377036
- return "0.2.8-alpha.8";
377128
+ return "0.2.8-alpha.9";
377037
377129
  }
377038
377130
  __name(getCliVersion, "getCliVersion");
377039
377131
 
@@ -384756,7 +384848,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
384756
384848
 
384757
384849
  // packages/cli/src/generated/git-commit.ts
384758
384850
  init_esbuild_shims();
384759
- var GIT_COMMIT_INFO = "908297548";
384851
+ var GIT_COMMIT_INFO = "32931e816";
384760
384852
 
384761
384853
  // packages/cli/src/utils/systemInfo.ts
384762
384854
  async function getNpmVersion() {
@@ -426118,11 +426210,25 @@ var import_react87 = __toESM(require_react(), 1);
426118
426210
  init_esbuild_shims();
426119
426211
  var XHS_SSO_MODELS = [
426120
426212
  {
426121
- id: "gpt-5.4",
426122
- displayName: "gpt-5.4",
426123
- baseUrl: "https://runway.devops.rednote.life/openai",
426213
+ id: "gpt-5.4(none)",
426214
+ displayName: "gpt-5.4(none)",
426215
+ baseUrl: "https://runway.devops.rednote.life/openai/v1/responses?api-version=v1",
426216
+ contextWindow: "272K",
426217
+ description: "\u7528\u4E8E\u5904\u7406\u590D\u6742\u4E13\u4E1A\u5DE5\u4F5C\u7684\u524D\u6CBF\u6A21\u578B (\u4E0D\u542F\u7528\u63A8\u7406)"
426218
+ },
426219
+ {
426220
+ id: "gpt-5.4(medium)",
426221
+ displayName: "gpt-5.4(medium)",
426222
+ baseUrl: "https://runway.devops.rednote.life/openai/v1/responses?api-version=v1",
426124
426223
  contextWindow: "272K",
426125
- description: "\u7528\u4E8E\u5904\u7406\u590D\u6742\u4E13\u4E1A\u5DE5\u4F5C\u7684\u524D\u6CBF\u6A21\u578B"
426224
+ description: "\u7528\u4E8E\u5904\u7406\u590D\u6742\u4E13\u4E1A\u5DE5\u4F5C\u7684\u524D\u6CBF\u6A21\u578B (\u63A8\u7406\u5F3A\u5EA6\u4E2D)"
426225
+ },
426226
+ {
426227
+ id: "gpt-5.4(xhigh)",
426228
+ displayName: "gpt-5.4(xhigh)",
426229
+ baseUrl: "https://runway.devops.rednote.life/openai/v1/responses?api-version=v1",
426230
+ contextWindow: "272K",
426231
+ description: "\u7528\u4E8E\u5904\u7406\u590D\u6742\u4E13\u4E1A\u5DE5\u4F5C\u7684\u524D\u6CBF\u6A21\u578B (\u63A8\u7406\u5F3A\u5EA6\u6781\u9AD8)"
426126
426232
  },
426127
426233
  {
426128
426234
  id: "gpt-5.3-codex(medium)",
@@ -428057,7 +428163,7 @@ var ServerDetailStep = /* @__PURE__ */ __name(({
428057
428163
  ] }),
428058
428164
  /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Box_default, { children: [
428059
428165
  /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Box_default, { width: LABEL_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.primary, children: t4("Source:") }) }),
428060
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.primary, children: server.scope === "user" ? t4("User Settings") : server.scope === "workspace" ? t4("Workspace Settings") : t4("Extension") }) })
428166
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.primary, children: server.source === "user" ? t4("User Settings") : server.source === "project" ? t4("Workspace Settings") : t4("Extension") }) })
428061
428167
  ] }),
428062
428168
  /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Box_default, { children: [
428063
428169
  /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Box_default, { width: LABEL_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.primary, children: t4("Command:") }) }),
@@ -428485,14 +428591,10 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
428485
428591
  let source2 = "user";
428486
428592
  if (serverConfig.extensionName) {
428487
428593
  source2 = "extension";
428488
- }
428489
- let scope = "user";
428490
- if (serverConfig.extensionName) {
428491
- scope = "extension";
428492
428594
  } else if (workspaceSettings.mcpServers?.[name3]) {
428493
- scope = "workspace";
428595
+ source2 = "project";
428494
428596
  } else if (userSettings.mcpServers?.[name3]) {
428495
- scope = "user";
428597
+ source2 = "user";
428496
428598
  }
428497
428599
  const isDisabled = config2.isMcpServerDisabled(name3);
428498
428600
  const invalidToolCount = serverTools.filter(
@@ -428502,7 +428604,6 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
428502
428604
  name: name3,
428503
428605
  status,
428504
428606
  source: source2,
428505
- scope,
428506
428607
  config: serverConfig,
428507
428608
  toolCount: serverTools.length,
428508
428609
  invalidToolCount,
@@ -428668,13 +428769,13 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
428668
428769
  const server = selectedServer;
428669
428770
  const settings = loadSettings();
428670
428771
  let targetScope = "user";
428671
- if (server.scope === "extension") {
428772
+ if (server.source === "extension") {
428672
428773
  debugLogger130.warn(
428673
428774
  `Cannot disable extension MCP server '${server.name}'`
428674
428775
  );
428675
428776
  setIsLoading(false);
428676
428777
  return;
428677
- } else if (server.scope === "workspace") {
428778
+ } else if (server.source === "project") {
428678
428779
  targetScope = "workspace";
428679
428780
  }
428680
428781
  const scopeSettings = settings.forScope(
@@ -447123,7 +447224,7 @@ var QwenAgent = class {
447123
447224
  async initialize(args) {
447124
447225
  this.clientCapabilities = args.clientCapabilities;
447125
447226
  const authMethods = buildAuthMethods();
447126
- const version2 = "0.2.8-alpha.8";
447227
+ const version2 = "0.2.8-alpha.9";
447127
447228
  return {
447128
447229
  protocolVersion: PROTOCOL_VERSION,
447129
447230
  agentInfo: {
package/locales/zh.js CHANGED
@@ -145,7 +145,7 @@ export default {
145
145
  '未发现 ID 为 {{sessionId}} 的已保存会话。请运行不带 ID 的 `rdmind --resume` 以从现有会话中选择。',
146
146
  'Clear conversation history and free up context': '清除对话历史并释放上下文',
147
147
  'Compresses the context by replacing it with a summary.':
148
- '通过用摘要替换来压缩上下文',
148
+ '通过摘要替换来压缩上下文',
149
149
  'open full RDMind documentation in your browser':
150
150
  '在浏览器中打开完整的 RDMind 文档',
151
151
  'Configuration not available.': '配置不可用',
@@ -1371,11 +1371,8 @@ export default {
1371
1371
  '正在尝试退出 Vim...',
1372
1372
  '这不是一个错误,这是一个未记录的功能...',
1373
1373
  '正在写一个永远不会触发的 else...',
1374
- '正在排查是谁写的这段祖传代码...哦是我自己...',
1375
1374
  '正在把 if-else 重构成 switch...',
1376
- '正在解决依赖关系(地狱)...',
1377
1375
  '正在将咖啡转换为代码...',
1378
- '正在删库跑路...的边缘试探...',
1379
1376
 
1380
1377
  // --- 工作/职场相关 ---
1381
1378
  '正在等待产品经理改需求...',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdmind/rdmind",
3
- "version": "0.2.8-alpha.8",
3
+ "version": "0.2.8-alpha.9",
4
4
  "description": "RDMind - AI-powered coding assistant",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -19,7 +19,7 @@
19
19
  "locales"
20
20
  ],
21
21
  "config": {
22
- "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.2.8-alpha.8"
22
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.2.8-alpha.9"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"