@rdmind/rdmind 0.2.3-alpha.6 → 0.2.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 +71 -18
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -157519,18 +157519,24 @@ var init_converter2 = __esm({
157519
157519
  }
157520
157520
  model;
157521
157521
  schemaCompliance;
157522
- constructor(model, schemaCompliance = "auto") {
157522
+ disableCacheControl;
157523
+ constructor(model, schemaCompliance = "auto", disableCacheControl = false) {
157523
157524
  this.model = model;
157524
157525
  this.schemaCompliance = schemaCompliance;
157526
+ this.disableCacheControl = disableCacheControl;
157525
157527
  }
157526
157528
  convertGeminiRequestToAnthropic(request4) {
157527
157529
  const messages = [];
157528
- const system = this.extractTextFromContentUnion(
157530
+ const systemText = this.extractTextFromContentUnion(
157529
157531
  request4.config?.systemInstruction
157530
157532
  );
157531
157533
  this.processContents(request4.contents, messages);
157534
+ const system = this.disableCacheControl ? systemText : this.buildSystemWithCacheControl(systemText);
157535
+ if (!this.disableCacheControl) {
157536
+ this.addCacheControlToMessages(messages);
157537
+ }
157532
157538
  return {
157533
- system: system || void 0,
157539
+ system,
157534
157540
  messages
157535
157541
  };
157536
157542
  }
@@ -157570,6 +157576,13 @@ var init_converter2 = __esm({
157570
157576
  });
157571
157577
  }
157572
157578
  }
157579
+ if (!this.disableCacheControl && tools.length > 0) {
157580
+ const lastToolIndex = tools.length - 1;
157581
+ tools[lastToolIndex] = {
157582
+ ...tools[lastToolIndex],
157583
+ cache_control: { type: "ephemeral" }
157584
+ };
157585
+ }
157573
157586
  return tools;
157574
157587
  }
157575
157588
  convertAnthropicResponseToGemini(response) {
@@ -157858,6 +157871,44 @@ var init_converter2 = __esm({
157858
157871
  isContentObject(content) {
157859
157872
  return typeof content === "object" && content !== null && "role" in content && "parts" in content && Array.isArray(content["parts"]);
157860
157873
  }
157874
+ /**
157875
+ * Build system content blocks with cache_control.
157876
+ * Anthropic prompt caching requires cache_control on system content.
157877
+ */
157878
+ buildSystemWithCacheControl(systemText) {
157879
+ if (!systemText) {
157880
+ return systemText;
157881
+ }
157882
+ return [
157883
+ {
157884
+ type: "text",
157885
+ text: systemText,
157886
+ cache_control: { type: "ephemeral" }
157887
+ }
157888
+ ];
157889
+ }
157890
+ /**
157891
+ * Add cache_control to the last user message's content.
157892
+ * This enables prompt caching for the conversation context.
157893
+ */
157894
+ addCacheControlToMessages(messages) {
157895
+ for (let i3 = messages.length - 1; i3 >= 0; i3--) {
157896
+ const msg = messages[i3];
157897
+ if (msg.role === "user") {
157898
+ const content = Array.isArray(msg.content) ? msg.content : [{ type: "text", text: msg.content }];
157899
+ if (content.length > 0) {
157900
+ const lastContent = content[content.length - 1];
157901
+ if (typeof lastContent === "object" && "type" in lastContent && lastContent.type === "text" && "text" in lastContent && lastContent.text) {
157902
+ lastContent.cache_control = {
157903
+ type: "ephemeral"
157904
+ };
157905
+ }
157906
+ msg.content = content;
157907
+ }
157908
+ break;
157909
+ }
157910
+ }
157911
+ }
157861
157912
  };
157862
157913
  }
157863
157914
  });
@@ -157895,7 +157946,8 @@ var init_anthropicContentGenerator = __esm({
157895
157946
  });
157896
157947
  this.converter = new AnthropicContentConverter(
157897
157948
  contentGeneratorConfig.model,
157898
- contentGeneratorConfig.schemaCompliance
157949
+ contentGeneratorConfig.schemaCompliance,
157950
+ contentGeneratorConfig.disableCacheControl
157899
157951
  );
157900
157952
  }
157901
157953
  static {
@@ -158441,7 +158493,7 @@ __export(geminiContentGenerator_exports2, {
158441
158493
  createGeminiContentGenerator: () => createGeminiContentGenerator
158442
158494
  });
158443
158495
  function createGeminiContentGenerator(config2, gcConfig) {
158444
- const version2 = "0.2.3-alpha.6";
158496
+ const version2 = "0.2.3";
158445
158497
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
158446
158498
  const baseHeaders = {
158447
158499
  "User-Agent": userAgent2
@@ -255242,8 +255294,8 @@ var init_git_commit = __esm({
255242
255294
  "packages/core/src/generated/git-commit.ts"() {
255243
255295
  "use strict";
255244
255296
  init_esbuild_shims();
255245
- GIT_COMMIT_INFO = "250a5d631";
255246
- CLI_VERSION = "0.2.3-alpha.6";
255297
+ GIT_COMMIT_INFO = "1d2d79a6c";
255298
+ CLI_VERSION = "0.2.3";
255247
255299
  }
255248
255300
  });
255249
255301
 
@@ -300453,7 +300505,7 @@ var init_settingsSchema = __esm({
300453
300505
  category: "Generation Configuration",
300454
300506
  requiresRestart: false,
300455
300507
  default: false,
300456
- description: "Disable cache control for DashScope providers.",
300508
+ description: "Disable cache control for Anthropic and DashScope providers.",
300457
300509
  parentKey: "generationConfig",
300458
300510
  showInDialog: false
300459
300511
  },
@@ -361160,7 +361212,7 @@ __name(getPackageJson, "getPackageJson");
361160
361212
  // packages/cli/src/utils/version.ts
361161
361213
  async function getCliVersion() {
361162
361214
  const pkgJson = await getPackageJson();
361163
- return "0.2.3-alpha.6";
361215
+ return "0.2.3";
361164
361216
  }
361165
361217
  __name(getCliVersion, "getCliVersion");
361166
361218
 
@@ -368891,7 +368943,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
368891
368943
 
368892
368944
  // packages/cli/src/generated/git-commit.ts
368893
368945
  init_esbuild_shims();
368894
- var GIT_COMMIT_INFO2 = "250a5d631";
368946
+ var GIT_COMMIT_INFO2 = "1d2d79a6c";
368895
368947
 
368896
368948
  // packages/cli/src/utils/systemInfo.ts
368897
368949
  async function getNpmVersion() {
@@ -408918,14 +408970,15 @@ var XHS_SSO_MODELS = [
408918
408970
  baseUrl: "https://runway.devops.xiaohongshu.com/openai/moonshot/v1",
408919
408971
  contextWindow: "256K",
408920
408972
  description: "\u5728 Agent\u3001\u4EE3\u7801\u3001\u89C6\u89C9\u7406\u89E3\u53CA\u4E00\u7CFB\u5217\u901A\u7528\u667A\u80FD\u4EFB\u52A1\u4E0A\u53D6\u5F97\u5F00\u6E90 SoTA \u8868\u73B0"
408921
- },
408922
- {
408923
- id: "claude-opus-4-5@20251101",
408924
- displayName: "Claude Opus 4.5",
408925
- baseUrl: "https://runway.devops.rednote.life/openai/google/anthropic/v1",
408926
- contextWindow: "200K",
408927
- description: "Anthropic \u6700\u5F3A\u5927\u7684\u6A21\u578B\uFF0C\u64C5\u957F\u590D\u6742\u63A8\u7406\u548C\u4EE3\u7801\u751F\u6210"
408928
408973
  }
408974
+ // 暂时注释,待稳定后发布
408975
+ // {
408976
+ // id: 'claude-opus-4-5@20251101',
408977
+ // displayName: 'Claude Opus 4.5',
408978
+ // baseUrl: 'https://runway.devops.rednote.life/openai/google/anthropic/v1',
408979
+ // contextWindow: '200K',
408980
+ // description: 'Anthropic 最强大的模型,擅长复杂推理和代码生成',
408981
+ // },
408929
408982
  ];
408930
408983
 
408931
408984
  // packages/cli/src/ui/components/XhsSsoModelConfigFlow.tsx
@@ -427575,7 +427628,7 @@ var GeminiAgent = class {
427575
427628
  name: APPROVAL_MODE_INFO[mode].name,
427576
427629
  description: APPROVAL_MODE_INFO[mode].description
427577
427630
  }));
427578
- const version2 = "0.2.3-alpha.6";
427631
+ const version2 = "0.2.3";
427579
427632
  return {
427580
427633
  protocolVersion: PROTOCOL_VERSION,
427581
427634
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdmind/rdmind",
3
- "version": "0.2.3-alpha.6",
3
+ "version": "0.2.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.2.3-alpha.6"
23
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.2.3"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"