@rdmind/rdmind 0.2.8-alpha.12 → 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.
- package/cli.js +70 -120
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -148831,7 +148831,6 @@ var init_vertexAnthropicContentGenerator = __esm({
|
|
|
148831
148831
|
// packages/core/src/core/codexContentGenerator.ts
|
|
148832
148832
|
var codexContentGenerator_exports = {};
|
|
148833
148833
|
__export(codexContentGenerator_exports, {
|
|
148834
|
-
CodexApiError: () => CodexApiError,
|
|
148835
148834
|
CodexContentGenerator: () => CodexContentGenerator
|
|
148836
148835
|
});
|
|
148837
148836
|
function extractBaseModel(model) {
|
|
@@ -149200,7 +149199,7 @@ function createGeminiResponse(responseId, parts, finishReason = FinishReason.STO
|
|
|
149200
149199
|
}
|
|
149201
149200
|
return response;
|
|
149202
149201
|
}
|
|
149203
|
-
var
|
|
149202
|
+
var CodexContentGenerator;
|
|
149204
149203
|
var init_codexContentGenerator = __esm({
|
|
149205
149204
|
"packages/core/src/core/codexContentGenerator.ts"() {
|
|
149206
149205
|
"use strict";
|
|
@@ -149211,17 +149210,6 @@ var init_codexContentGenerator = __esm({
|
|
|
149211
149210
|
init_loggers();
|
|
149212
149211
|
init_types();
|
|
149213
149212
|
init_openaiLogger();
|
|
149214
|
-
CodexApiError = class extends Error {
|
|
149215
|
-
constructor(code2, message, status) {
|
|
149216
|
-
super(message);
|
|
149217
|
-
this.code = code2;
|
|
149218
|
-
this.status = status;
|
|
149219
|
-
this.name = "CodexApiError";
|
|
149220
|
-
}
|
|
149221
|
-
static {
|
|
149222
|
-
__name(this, "CodexApiError");
|
|
149223
|
-
}
|
|
149224
|
-
};
|
|
149225
149213
|
CodexContentGenerator = class {
|
|
149226
149214
|
static {
|
|
149227
149215
|
__name(this, "CodexContentGenerator");
|
|
@@ -149323,20 +149311,8 @@ var init_codexContentGenerator = __esm({
|
|
|
149323
149311
|
});
|
|
149324
149312
|
if (!response.ok) {
|
|
149325
149313
|
const errorText = await response.text();
|
|
149326
|
-
|
|
149327
|
-
|
|
149328
|
-
try {
|
|
149329
|
-
const errorJson = JSON.parse(errorText);
|
|
149330
|
-
if (errorJson.error) {
|
|
149331
|
-
errorCode = errorJson.error.code || errorJson.error.type || "unknown";
|
|
149332
|
-
errorMessage = errorJson.error.message || errorText;
|
|
149333
|
-
}
|
|
149334
|
-
} catch {
|
|
149335
|
-
}
|
|
149336
|
-
throw new CodexApiError(
|
|
149337
|
-
errorCode,
|
|
149338
|
-
`[Codex API Error] ${response.status} ${errorCode}: ${errorMessage}`,
|
|
149339
|
-
response.status
|
|
149314
|
+
throw new Error(
|
|
149315
|
+
`Codex API request failed: ${response.status} - ${errorText}`
|
|
149340
149316
|
);
|
|
149341
149317
|
}
|
|
149342
149318
|
return response;
|
|
@@ -149377,10 +149353,8 @@ var init_codexContentGenerator = __esm({
|
|
|
149377
149353
|
const decoder = new TextDecoder();
|
|
149378
149354
|
let buffer = "";
|
|
149379
149355
|
let currentEvent = "";
|
|
149380
|
-
const yieldState = { hasYieldedText: false, hasYieldedFunctionCall: false };
|
|
149381
149356
|
const streamDiag = {
|
|
149382
149357
|
eventTypes: [],
|
|
149383
|
-
yieldCount: 0,
|
|
149384
149358
|
totalLines: 0,
|
|
149385
149359
|
skippedLines: 0,
|
|
149386
149360
|
firstRawChunk: "",
|
|
@@ -149389,13 +149363,12 @@ var init_codexContentGenerator = __esm({
|
|
|
149389
149363
|
finalStatus: "",
|
|
149390
149364
|
finalOutputTypes: [],
|
|
149391
149365
|
finalOutputSummary: [],
|
|
149392
|
-
|
|
149393
|
-
finalExtractedFunctionCallCount: 0
|
|
149366
|
+
streamErrors: []
|
|
149394
149367
|
};
|
|
149368
|
+
let streamFinished = false;
|
|
149395
149369
|
const toolCallArgs = /* @__PURE__ */ new Map();
|
|
149396
149370
|
try {
|
|
149397
149371
|
let isFirstChunk = true;
|
|
149398
|
-
let streamFinished = false;
|
|
149399
149372
|
while (!streamFinished) {
|
|
149400
149373
|
const { done, value } = await reader.read();
|
|
149401
149374
|
if (done) break;
|
|
@@ -149431,31 +149404,29 @@ var init_codexContentGenerator = __esm({
|
|
|
149431
149404
|
if (eventType === "response.completed" || eventType === "response.incomplete" || eventType === "response.failed") {
|
|
149432
149405
|
const finalResponse = data.response;
|
|
149433
149406
|
streamDiag.finalEventType = eventType;
|
|
149434
|
-
streamDiag.finalStatus = finalResponse?.status
|
|
149435
|
-
streamDiag.finalOutputTypes = finalResponse?.output?.map((item) => item.type)
|
|
149407
|
+
streamDiag.finalStatus = finalResponse?.status ?? "";
|
|
149408
|
+
streamDiag.finalOutputTypes = finalResponse?.output?.map((item) => item.type) ?? [];
|
|
149436
149409
|
streamDiag.finalOutputSummary = finalResponse?.output?.map((item) => ({
|
|
149437
149410
|
type: item.type,
|
|
149438
|
-
contentTypes: item.content?.map((
|
|
149439
|
-
}))
|
|
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 });
|
|
149440
149420
|
}
|
|
149441
149421
|
const response = this.handleStreamEvent(
|
|
149442
|
-
|
|
149422
|
+
currentEvent,
|
|
149443
149423
|
data,
|
|
149444
|
-
toolCallArgs
|
|
149445
|
-
yieldState,
|
|
149446
|
-
streamDiag
|
|
149424
|
+
toolCallArgs
|
|
149447
149425
|
);
|
|
149448
149426
|
if (response) {
|
|
149449
|
-
streamDiag.yieldCount++;
|
|
149450
|
-
const parts = response.candidates?.[0]?.content?.parts;
|
|
149451
|
-
if (parts?.some((p2) => p2.text))
|
|
149452
|
-
yieldState.hasYieldedText = true;
|
|
149453
|
-
if (parts?.some((p2) => p2.functionCall))
|
|
149454
|
-
yieldState.hasYieldedFunctionCall = true;
|
|
149455
149427
|
yield response;
|
|
149456
149428
|
}
|
|
149457
|
-
} catch
|
|
149458
|
-
if (e4 instanceof CodexApiError) throw e4;
|
|
149429
|
+
} catch {
|
|
149459
149430
|
}
|
|
149460
149431
|
} else {
|
|
149461
149432
|
streamDiag.skippedLines++;
|
|
@@ -149463,10 +149434,7 @@ var init_codexContentGenerator = __esm({
|
|
|
149463
149434
|
}
|
|
149464
149435
|
}
|
|
149465
149436
|
context2.duration = Date.now() - context2.startTime;
|
|
149466
|
-
await this.logStreamingSuccess(context2, request4,
|
|
149467
|
-
yieldState,
|
|
149468
|
-
...streamDiag
|
|
149469
|
-
});
|
|
149437
|
+
await this.logStreamingSuccess(context2, request4, streamDiag);
|
|
149470
149438
|
} catch (error40) {
|
|
149471
149439
|
context2.duration = Date.now() - context2.startTime;
|
|
149472
149440
|
await this.logError(context2, error40, request4);
|
|
@@ -149475,7 +149443,7 @@ var init_codexContentGenerator = __esm({
|
|
|
149475
149443
|
reader.releaseLock();
|
|
149476
149444
|
}
|
|
149477
149445
|
}
|
|
149478
|
-
handleStreamEvent(event, data, toolCallArgs
|
|
149446
|
+
handleStreamEvent(event, data, toolCallArgs) {
|
|
149479
149447
|
switch (event) {
|
|
149480
149448
|
case "response.reasoning_summary_text.delta": {
|
|
149481
149449
|
return null;
|
|
@@ -149517,67 +149485,49 @@ var init_codexContentGenerator = __esm({
|
|
|
149517
149485
|
}
|
|
149518
149486
|
return null;
|
|
149519
149487
|
}
|
|
149520
|
-
case "
|
|
149521
|
-
const
|
|
149522
|
-
const
|
|
149523
|
-
|
|
149524
|
-
|
|
149488
|
+
case "response.completed": {
|
|
149489
|
+
const response = data.response;
|
|
149490
|
+
const finishReason = mapCodexStatusToFinishReason(response?.status);
|
|
149491
|
+
return createGeminiResponse(
|
|
149492
|
+
response?.id || "final",
|
|
149493
|
+
[],
|
|
149494
|
+
finishReason,
|
|
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
|
+
);
|
|
149525
149518
|
}
|
|
149526
|
-
case "response.completed":
|
|
149527
|
-
case "response.incomplete":
|
|
149528
149519
|
case "response.failed": {
|
|
149529
149520
|
const response = data.response;
|
|
149530
|
-
if (event === "response.failed") {
|
|
149531
|
-
const respRecord = response;
|
|
149532
|
-
const err = respRecord?.["error"];
|
|
149533
|
-
const failCode = err?.code || "unknown";
|
|
149534
|
-
const failMsg = err?.message || "Response failed without details";
|
|
149535
|
-
throw new CodexApiError(
|
|
149536
|
-
failCode,
|
|
149537
|
-
`[Codex API Error] ${failCode}: ${failMsg}`
|
|
149538
|
-
);
|
|
149539
|
-
}
|
|
149540
|
-
const finishReason = event === "response.incomplete" ? FinishReason.MAX_TOKENS : mapCodexStatusToFinishReason(response?.status);
|
|
149541
|
-
const usage2 = response?.usage;
|
|
149542
|
-
const parts = [];
|
|
149543
|
-
if (response?.output) {
|
|
149544
|
-
for (const item of response.output) {
|
|
149545
|
-
if (!yieldState.hasYieldedText && item.type === "message" && item.content) {
|
|
149546
|
-
const text = item.content.map((c4) => c4.text).filter(Boolean).join("");
|
|
149547
|
-
if (text) {
|
|
149548
|
-
parts.push({ text });
|
|
149549
|
-
if (streamDiag) {
|
|
149550
|
-
streamDiag.finalExtractedTextLength += text.length;
|
|
149551
|
-
}
|
|
149552
|
-
}
|
|
149553
|
-
} else if (!yieldState.hasYieldedFunctionCall && item.type === "function_call" && item.arguments) {
|
|
149554
|
-
try {
|
|
149555
|
-
const args = JSON.parse(item.arguments);
|
|
149556
|
-
parts.push({
|
|
149557
|
-
functionCall: {
|
|
149558
|
-
id: item.call_id || item.id || `call_${Date.now()}`,
|
|
149559
|
-
name: item.name || "unknown",
|
|
149560
|
-
args
|
|
149561
|
-
}
|
|
149562
|
-
});
|
|
149563
|
-
if (streamDiag) {
|
|
149564
|
-
streamDiag.finalExtractedFunctionCallCount += 1;
|
|
149565
|
-
}
|
|
149566
|
-
} catch {
|
|
149567
|
-
}
|
|
149568
|
-
}
|
|
149569
|
-
}
|
|
149570
|
-
}
|
|
149571
149521
|
return createGeminiResponse(
|
|
149572
149522
|
response?.id || "final",
|
|
149573
|
-
|
|
149574
|
-
|
|
149575
|
-
|
|
149576
|
-
promptTokenCount:
|
|
149577
|
-
candidatesTokenCount:
|
|
149578
|
-
totalTokenCount:
|
|
149579
|
-
cachedContentTokenCount:
|
|
149580
|
-
thoughtsTokenCount:
|
|
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
|
|
149581
149531
|
} : void 0
|
|
149582
149532
|
);
|
|
149583
149533
|
}
|
|
@@ -149636,7 +149586,7 @@ var init_codexContentGenerator = __esm({
|
|
|
149636
149586
|
if (this.enableOpenAILogging && this.logger) {
|
|
149637
149587
|
await this.logger.logInteraction(request4, {
|
|
149638
149588
|
streamed: true,
|
|
149639
|
-
...diagnostics
|
|
149589
|
+
...diagnostics ?? {}
|
|
149640
149590
|
});
|
|
149641
149591
|
}
|
|
149642
149592
|
}
|
|
@@ -161243,7 +161193,7 @@ __export(geminiContentGenerator_exports2, {
|
|
|
161243
161193
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
161244
161194
|
});
|
|
161245
161195
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
161246
|
-
const version2 = "0.2.8-alpha.
|
|
161196
|
+
const version2 = "0.2.8-alpha.13";
|
|
161247
161197
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
161248
161198
|
const baseHeaders = {
|
|
161249
161199
|
"User-Agent": userAgent2
|
|
@@ -377223,7 +377173,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
377223
377173
|
// packages/cli/src/utils/version.ts
|
|
377224
377174
|
async function getCliVersion() {
|
|
377225
377175
|
const pkgJson = await getPackageJson();
|
|
377226
|
-
return "0.2.8-alpha.
|
|
377176
|
+
return "0.2.8-alpha.13";
|
|
377227
377177
|
}
|
|
377228
377178
|
__name(getCliVersion, "getCliVersion");
|
|
377229
377179
|
|
|
@@ -426391,13 +426341,13 @@ var XHS_SSO_MODELS = [
|
|
|
426391
426341
|
contextWindow: "200K",
|
|
426392
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"
|
|
426393
426343
|
},
|
|
426394
|
-
{
|
|
426395
|
-
|
|
426396
|
-
|
|
426397
|
-
|
|
426398
|
-
|
|
426399
|
-
|
|
426400
|
-
},
|
|
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
|
+
// },
|
|
426401
426351
|
{
|
|
426402
426352
|
id: "Kimi-K2.5",
|
|
426403
426353
|
displayName: "Kimi-K2.5",
|
|
@@ -447322,7 +447272,7 @@ var QwenAgent = class {
|
|
|
447322
447272
|
async initialize(args) {
|
|
447323
447273
|
this.clientCapabilities = args.clientCapabilities;
|
|
447324
447274
|
const authMethods = buildAuthMethods();
|
|
447325
|
-
const version2 = "0.2.8-alpha.
|
|
447275
|
+
const version2 = "0.2.8-alpha.13";
|
|
447326
447276
|
return {
|
|
447327
447277
|
protocolVersion: PROTOCOL_VERSION,
|
|
447328
447278
|
agentInfo: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdmind/rdmind",
|
|
3
|
-
"version": "0.2.8-alpha.
|
|
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.
|
|
22
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.2.8-alpha.13"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|