@rdmind/rdmind 0.2.8-alpha.11 → 0.2.8-alpha.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.
Files changed (2) hide show
  1. package/cli.js +72 -77
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -149353,10 +149353,8 @@ var init_codexContentGenerator = __esm({
149353
149353
  const decoder = new TextDecoder();
149354
149354
  let buffer = "";
149355
149355
  let currentEvent = "";
149356
- const yieldState = { hasYieldedText: false, hasYieldedFunctionCall: false };
149357
149356
  const streamDiag = {
149358
149357
  eventTypes: [],
149359
- yieldCount: 0,
149360
149358
  totalLines: 0,
149361
149359
  skippedLines: 0,
149362
149360
  firstRawChunk: "",
@@ -149365,13 +149363,13 @@ var init_codexContentGenerator = __esm({
149365
149363
  finalStatus: "",
149366
149364
  finalOutputTypes: [],
149367
149365
  finalOutputSummary: [],
149368
- finalExtractedTextLength: 0,
149369
- finalExtractedFunctionCallCount: 0
149366
+ streamErrors: []
149370
149367
  };
149368
+ let streamFinished = false;
149371
149369
  const toolCallArgs = /* @__PURE__ */ new Map();
149372
149370
  try {
149373
149371
  let isFirstChunk = true;
149374
- while (true) {
149372
+ while (!streamFinished) {
149375
149373
  const { done, value } = await reader.read();
149376
149374
  if (done) break;
149377
149375
  const chunk = decoder.decode(value, { stream: true });
@@ -149392,7 +149390,10 @@ var init_codexContentGenerator = __esm({
149392
149390
  }
149393
149391
  if (trimmed2.startsWith("data: ")) {
149394
149392
  const dataStr = trimmed2.slice(6).trim();
149395
- if (dataStr === "[DONE]") return;
149393
+ if (dataStr === "[DONE]") {
149394
+ streamFinished = true;
149395
+ break;
149396
+ }
149396
149397
  try {
149397
149398
  const data = JSON.parse(dataStr);
149398
149399
  streamDiag.lastRawDataSnippet = dataStr.slice(0, 1e3);
@@ -149403,27 +149404,26 @@ var init_codexContentGenerator = __esm({
149403
149404
  if (eventType === "response.completed" || eventType === "response.incomplete" || eventType === "response.failed") {
149404
149405
  const finalResponse = data.response;
149405
149406
  streamDiag.finalEventType = eventType;
149406
- streamDiag.finalStatus = finalResponse?.status || "";
149407
- streamDiag.finalOutputTypes = finalResponse?.output?.map((item) => item.type) || [];
149407
+ streamDiag.finalStatus = finalResponse?.status ?? "";
149408
+ streamDiag.finalOutputTypes = finalResponse?.output?.map((item) => item.type) ?? [];
149408
149409
  streamDiag.finalOutputSummary = finalResponse?.output?.map((item) => ({
149409
149410
  type: item.type,
149410
- contentTypes: item.content?.map((content) => content.type)
149411
- })) || [];
149411
+ contentTypes: item.content?.map((c4) => c4.type)
149412
+ })) ?? [];
149413
+ }
149414
+ if (eventType === "error") {
149415
+ const errPayload = data;
149416
+ const nested = errPayload["error"];
149417
+ const code2 = errPayload["code"] || nested?.code || nested?.type || "unknown";
149418
+ const message = errPayload["message"] || nested?.message || JSON.stringify(data);
149419
+ streamDiag.streamErrors.push({ code: code2, message });
149412
149420
  }
149413
149421
  const response = this.handleStreamEvent(
149414
- eventType,
149422
+ currentEvent,
149415
149423
  data,
149416
- toolCallArgs,
149417
- yieldState,
149418
- streamDiag
149424
+ toolCallArgs
149419
149425
  );
149420
149426
  if (response) {
149421
- streamDiag.yieldCount++;
149422
- const parts = response.candidates?.[0]?.content?.parts;
149423
- if (parts?.some((p2) => p2.text))
149424
- yieldState.hasYieldedText = true;
149425
- if (parts?.some((p2) => p2.functionCall))
149426
- yieldState.hasYieldedFunctionCall = true;
149427
149427
  yield response;
149428
149428
  }
149429
149429
  } catch {
@@ -149434,10 +149434,7 @@ var init_codexContentGenerator = __esm({
149434
149434
  }
149435
149435
  }
149436
149436
  context2.duration = Date.now() - context2.startTime;
149437
- await this.logStreamingSuccess(context2, request4, {
149438
- yieldState,
149439
- ...streamDiag
149440
- });
149437
+ await this.logStreamingSuccess(context2, request4, streamDiag);
149441
149438
  } catch (error40) {
149442
149439
  context2.duration = Date.now() - context2.startTime;
149443
149440
  await this.logError(context2, error40, request4);
@@ -149446,7 +149443,7 @@ var init_codexContentGenerator = __esm({
149446
149443
  reader.releaseLock();
149447
149444
  }
149448
149445
  }
149449
- handleStreamEvent(event, data, toolCallArgs, yieldState, streamDiag) {
149446
+ handleStreamEvent(event, data, toolCallArgs) {
149450
149447
  switch (event) {
149451
149448
  case "response.reasoning_summary_text.delta": {
149452
149449
  return null;
@@ -149488,51 +149485,49 @@ var init_codexContentGenerator = __esm({
149488
149485
  }
149489
149486
  return null;
149490
149487
  }
149491
- case "response.completed":
149492
- case "response.incomplete":
149493
- case "response.failed": {
149488
+ case "response.completed": {
149494
149489
  const response = data.response;
149495
- const finishReason = event === "response.incomplete" ? FinishReason.MAX_TOKENS : event === "response.failed" ? FinishReason.FINISH_REASON_UNSPECIFIED : mapCodexStatusToFinishReason(response?.status);
149496
- const usage2 = response?.usage;
149497
- const parts = [];
149498
- if (response?.output) {
149499
- for (const item of response.output) {
149500
- if (!yieldState.hasYieldedText && item.type === "message" && item.content) {
149501
- const text = item.content.map((c4) => c4.text).filter(Boolean).join("");
149502
- if (text) {
149503
- parts.push({ text });
149504
- if (streamDiag) {
149505
- streamDiag.finalExtractedTextLength += text.length;
149506
- }
149507
- }
149508
- } else if (!yieldState.hasYieldedFunctionCall && item.type === "function_call" && item.arguments) {
149509
- try {
149510
- const args = JSON.parse(item.arguments);
149511
- parts.push({
149512
- functionCall: {
149513
- id: item.call_id || item.id || `call_${Date.now()}`,
149514
- name: item.name || "unknown",
149515
- args
149516
- }
149517
- });
149518
- if (streamDiag) {
149519
- streamDiag.finalExtractedFunctionCallCount += 1;
149520
- }
149521
- } catch {
149522
- }
149523
- }
149524
- }
149525
- }
149490
+ const finishReason = mapCodexStatusToFinishReason(response?.status);
149526
149491
  return createGeminiResponse(
149527
149492
  response?.id || "final",
149528
- parts,
149493
+ [],
149529
149494
  finishReason,
149530
- usage2 ? {
149531
- promptTokenCount: usage2.input_tokens,
149532
- candidatesTokenCount: usage2.output_tokens,
149533
- totalTokenCount: usage2.total_tokens,
149534
- cachedContentTokenCount: usage2.input_tokens_details?.cached_tokens,
149535
- thoughtsTokenCount: usage2.output_tokens_details?.reasoning_tokens
149495
+ response?.usage ? {
149496
+ promptTokenCount: response.usage.input_tokens,
149497
+ candidatesTokenCount: response.usage.output_tokens,
149498
+ totalTokenCount: response.usage.total_tokens,
149499
+ cachedContentTokenCount: response.usage.input_tokens_details?.cached_tokens,
149500
+ thoughtsTokenCount: response.usage.output_tokens_details?.reasoning_tokens
149501
+ } : void 0
149502
+ );
149503
+ }
149504
+ case "response.incomplete": {
149505
+ const response = data.response;
149506
+ return createGeminiResponse(
149507
+ response?.id || "final",
149508
+ [],
149509
+ FinishReason.MAX_TOKENS,
149510
+ response?.usage ? {
149511
+ promptTokenCount: response.usage.input_tokens,
149512
+ candidatesTokenCount: response.usage.output_tokens,
149513
+ totalTokenCount: response.usage.total_tokens,
149514
+ cachedContentTokenCount: response.usage.input_tokens_details?.cached_tokens,
149515
+ thoughtsTokenCount: response.usage.output_tokens_details?.reasoning_tokens
149516
+ } : void 0
149517
+ );
149518
+ }
149519
+ case "response.failed": {
149520
+ const response = data.response;
149521
+ return createGeminiResponse(
149522
+ response?.id || "final",
149523
+ [],
149524
+ FinishReason.FINISH_REASON_UNSPECIFIED,
149525
+ response?.usage ? {
149526
+ promptTokenCount: response.usage.input_tokens,
149527
+ candidatesTokenCount: response.usage.output_tokens,
149528
+ totalTokenCount: response.usage.total_tokens,
149529
+ cachedContentTokenCount: response.usage.input_tokens_details?.cached_tokens,
149530
+ thoughtsTokenCount: response.usage.output_tokens_details?.reasoning_tokens
149536
149531
  } : void 0
149537
149532
  );
149538
149533
  }
@@ -149591,7 +149586,7 @@ var init_codexContentGenerator = __esm({
149591
149586
  if (this.enableOpenAILogging && this.logger) {
149592
149587
  await this.logger.logInteraction(request4, {
149593
149588
  streamed: true,
149594
- ...diagnostics || {}
149589
+ ...diagnostics ?? {}
149595
149590
  });
149596
149591
  }
149597
149592
  }
@@ -161198,7 +161193,7 @@ __export(geminiContentGenerator_exports2, {
161198
161193
  createGeminiContentGenerator: () => createGeminiContentGenerator
161199
161194
  });
161200
161195
  function createGeminiContentGenerator(config2, gcConfig) {
161201
- const version2 = "0.2.8-alpha.11";
161196
+ const version2 = "0.2.8-alpha.13";
161202
161197
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
161203
161198
  const baseHeaders = {
161204
161199
  "User-Agent": userAgent2
@@ -377178,7 +377173,7 @@ __name(getPackageJson, "getPackageJson");
377178
377173
  // packages/cli/src/utils/version.ts
377179
377174
  async function getCliVersion() {
377180
377175
  const pkgJson = await getPackageJson();
377181
- return "0.2.8-alpha.11";
377176
+ return "0.2.8-alpha.13";
377182
377177
  }
377183
377178
  __name(getCliVersion, "getCliVersion");
377184
377179
 
@@ -426346,13 +426341,13 @@ var XHS_SSO_MODELS = [
426346
426341
  contextWindow: "200K",
426347
426342
  description: "\u667A\u8C31\u65B0\u4E00\u4EE3\u7684\u65D7\u8230\u57FA\u5EA7\u6A21\u578B\uFF0C\u9762\u5411 Agentic Engineering \u6253\u9020\uFF0C\u5BF9\u9F50 Claude Opus 4.5"
426348
426343
  },
426349
- {
426350
- id: "claude-opus-4-5@20251101",
426351
- displayName: "Claude Opus 4.5",
426352
- baseUrl: "https://runway.devops.rednote.life/openai/google/anthropic/v1",
426353
- contextWindow: "200K",
426354
- description: "Anthropic \u6700\u5F3A\u5927\u7684\u6A21\u578B\uFF0C\u64C5\u957F\u590D\u6742\u63A8\u7406\u548C\u4EE3\u7801\u751F\u6210"
426355
- },
426344
+ // {
426345
+ // id: 'claude-opus-4-5@20251101',
426346
+ // displayName: 'Claude Opus 4.5',
426347
+ // baseUrl: 'https://runway.devops.rednote.life/openai/google/anthropic/v1',
426348
+ // contextWindow: '200K',
426349
+ // description: 'Anthropic 最强大的模型,擅长复杂推理和代码生成',
426350
+ // },
426356
426351
  {
426357
426352
  id: "Kimi-K2.5",
426358
426353
  displayName: "Kimi-K2.5",
@@ -447277,7 +447272,7 @@ var QwenAgent = class {
447277
447272
  async initialize(args) {
447278
447273
  this.clientCapabilities = args.clientCapabilities;
447279
447274
  const authMethods = buildAuthMethods();
447280
- const version2 = "0.2.8-alpha.11";
447275
+ const version2 = "0.2.8-alpha.13";
447281
447276
  return {
447282
447277
  protocolVersion: PROTOCOL_VERSION,
447283
447278
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdmind/rdmind",
3
- "version": "0.2.8-alpha.11",
3
+ "version": "0.2.8-alpha.13",
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.11"
22
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.2.8-alpha.13"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"