@rdmind/rdmind 0.2.8-alpha.10 → 0.2.8-alpha.12
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 +86 -14
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -148831,6 +148831,7 @@ 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,
|
|
148834
148835
|
CodexContentGenerator: () => CodexContentGenerator
|
|
148835
148836
|
});
|
|
148836
148837
|
function extractBaseModel(model) {
|
|
@@ -149199,7 +149200,7 @@ function createGeminiResponse(responseId, parts, finishReason = FinishReason.STO
|
|
|
149199
149200
|
}
|
|
149200
149201
|
return response;
|
|
149201
149202
|
}
|
|
149202
|
-
var CodexContentGenerator;
|
|
149203
|
+
var CodexApiError, CodexContentGenerator;
|
|
149203
149204
|
var init_codexContentGenerator = __esm({
|
|
149204
149205
|
"packages/core/src/core/codexContentGenerator.ts"() {
|
|
149205
149206
|
"use strict";
|
|
@@ -149210,6 +149211,17 @@ var init_codexContentGenerator = __esm({
|
|
|
149210
149211
|
init_loggers();
|
|
149211
149212
|
init_types();
|
|
149212
149213
|
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
|
+
};
|
|
149213
149225
|
CodexContentGenerator = class {
|
|
149214
149226
|
static {
|
|
149215
149227
|
__name(this, "CodexContentGenerator");
|
|
@@ -149311,8 +149323,20 @@ var init_codexContentGenerator = __esm({
|
|
|
149311
149323
|
});
|
|
149312
149324
|
if (!response.ok) {
|
|
149313
149325
|
const errorText = await response.text();
|
|
149314
|
-
|
|
149315
|
-
|
|
149326
|
+
let errorCode = "unknown";
|
|
149327
|
+
let errorMessage = errorText;
|
|
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
|
|
149316
149340
|
);
|
|
149317
149341
|
}
|
|
149318
149342
|
return response;
|
|
@@ -149359,12 +149383,20 @@ var init_codexContentGenerator = __esm({
|
|
|
149359
149383
|
yieldCount: 0,
|
|
149360
149384
|
totalLines: 0,
|
|
149361
149385
|
skippedLines: 0,
|
|
149362
|
-
firstRawChunk: ""
|
|
149386
|
+
firstRawChunk: "",
|
|
149387
|
+
lastRawDataSnippet: "",
|
|
149388
|
+
finalEventType: "",
|
|
149389
|
+
finalStatus: "",
|
|
149390
|
+
finalOutputTypes: [],
|
|
149391
|
+
finalOutputSummary: [],
|
|
149392
|
+
finalExtractedTextLength: 0,
|
|
149393
|
+
finalExtractedFunctionCallCount: 0
|
|
149363
149394
|
};
|
|
149364
149395
|
const toolCallArgs = /* @__PURE__ */ new Map();
|
|
149365
149396
|
try {
|
|
149366
149397
|
let isFirstChunk = true;
|
|
149367
|
-
|
|
149398
|
+
let streamFinished = false;
|
|
149399
|
+
while (!streamFinished) {
|
|
149368
149400
|
const { done, value } = await reader.read();
|
|
149369
149401
|
if (done) break;
|
|
149370
149402
|
const chunk = decoder.decode(value, { stream: true });
|
|
@@ -149385,18 +149417,33 @@ var init_codexContentGenerator = __esm({
|
|
|
149385
149417
|
}
|
|
149386
149418
|
if (trimmed2.startsWith("data: ")) {
|
|
149387
149419
|
const dataStr = trimmed2.slice(6).trim();
|
|
149388
|
-
if (dataStr === "[DONE]")
|
|
149420
|
+
if (dataStr === "[DONE]") {
|
|
149421
|
+
streamFinished = true;
|
|
149422
|
+
break;
|
|
149423
|
+
}
|
|
149389
149424
|
try {
|
|
149390
149425
|
const data = JSON.parse(dataStr);
|
|
149426
|
+
streamDiag.lastRawDataSnippet = dataStr.slice(0, 1e3);
|
|
149391
149427
|
const eventType = currentEvent || data.type || "";
|
|
149392
149428
|
if (eventType && !streamDiag.eventTypes.includes(eventType)) {
|
|
149393
149429
|
streamDiag.eventTypes.push(eventType);
|
|
149394
149430
|
}
|
|
149431
|
+
if (eventType === "response.completed" || eventType === "response.incomplete" || eventType === "response.failed") {
|
|
149432
|
+
const finalResponse = data.response;
|
|
149433
|
+
streamDiag.finalEventType = eventType;
|
|
149434
|
+
streamDiag.finalStatus = finalResponse?.status || "";
|
|
149435
|
+
streamDiag.finalOutputTypes = finalResponse?.output?.map((item) => item.type) || [];
|
|
149436
|
+
streamDiag.finalOutputSummary = finalResponse?.output?.map((item) => ({
|
|
149437
|
+
type: item.type,
|
|
149438
|
+
contentTypes: item.content?.map((content) => content.type)
|
|
149439
|
+
})) || [];
|
|
149440
|
+
}
|
|
149395
149441
|
const response = this.handleStreamEvent(
|
|
149396
149442
|
eventType,
|
|
149397
149443
|
data,
|
|
149398
149444
|
toolCallArgs,
|
|
149399
|
-
yieldState
|
|
149445
|
+
yieldState,
|
|
149446
|
+
streamDiag
|
|
149400
149447
|
);
|
|
149401
149448
|
if (response) {
|
|
149402
149449
|
streamDiag.yieldCount++;
|
|
@@ -149407,7 +149454,8 @@ var init_codexContentGenerator = __esm({
|
|
|
149407
149454
|
yieldState.hasYieldedFunctionCall = true;
|
|
149408
149455
|
yield response;
|
|
149409
149456
|
}
|
|
149410
|
-
} catch {
|
|
149457
|
+
} catch (e4) {
|
|
149458
|
+
if (e4 instanceof CodexApiError) throw e4;
|
|
149411
149459
|
}
|
|
149412
149460
|
} else {
|
|
149413
149461
|
streamDiag.skippedLines++;
|
|
@@ -149427,7 +149475,7 @@ var init_codexContentGenerator = __esm({
|
|
|
149427
149475
|
reader.releaseLock();
|
|
149428
149476
|
}
|
|
149429
149477
|
}
|
|
149430
|
-
handleStreamEvent(event, data, toolCallArgs, yieldState) {
|
|
149478
|
+
handleStreamEvent(event, data, toolCallArgs, yieldState, streamDiag) {
|
|
149431
149479
|
switch (event) {
|
|
149432
149480
|
case "response.reasoning_summary_text.delta": {
|
|
149433
149481
|
return null;
|
|
@@ -149469,18 +149517,39 @@ var init_codexContentGenerator = __esm({
|
|
|
149469
149517
|
}
|
|
149470
149518
|
return null;
|
|
149471
149519
|
}
|
|
149520
|
+
case "error": {
|
|
149521
|
+
const errData = data;
|
|
149522
|
+
const code2 = errData["code"] || "unknown";
|
|
149523
|
+
const message = errData["message"] || "Unknown API error";
|
|
149524
|
+
throw new CodexApiError(code2, `[Codex API Error] ${code2}: ${message}`);
|
|
149525
|
+
}
|
|
149472
149526
|
case "response.completed":
|
|
149473
149527
|
case "response.incomplete":
|
|
149474
149528
|
case "response.failed": {
|
|
149475
149529
|
const response = data.response;
|
|
149476
|
-
|
|
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);
|
|
149477
149541
|
const usage2 = response?.usage;
|
|
149478
149542
|
const parts = [];
|
|
149479
149543
|
if (response?.output) {
|
|
149480
149544
|
for (const item of response.output) {
|
|
149481
149545
|
if (!yieldState.hasYieldedText && item.type === "message" && item.content) {
|
|
149482
149546
|
const text = item.content.map((c4) => c4.text).filter(Boolean).join("");
|
|
149483
|
-
if (text)
|
|
149547
|
+
if (text) {
|
|
149548
|
+
parts.push({ text });
|
|
149549
|
+
if (streamDiag) {
|
|
149550
|
+
streamDiag.finalExtractedTextLength += text.length;
|
|
149551
|
+
}
|
|
149552
|
+
}
|
|
149484
149553
|
} else if (!yieldState.hasYieldedFunctionCall && item.type === "function_call" && item.arguments) {
|
|
149485
149554
|
try {
|
|
149486
149555
|
const args = JSON.parse(item.arguments);
|
|
@@ -149491,6 +149560,9 @@ var init_codexContentGenerator = __esm({
|
|
|
149491
149560
|
args
|
|
149492
149561
|
}
|
|
149493
149562
|
});
|
|
149563
|
+
if (streamDiag) {
|
|
149564
|
+
streamDiag.finalExtractedFunctionCallCount += 1;
|
|
149565
|
+
}
|
|
149494
149566
|
} catch {
|
|
149495
149567
|
}
|
|
149496
149568
|
}
|
|
@@ -161171,7 +161243,7 @@ __export(geminiContentGenerator_exports2, {
|
|
|
161171
161243
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
161172
161244
|
});
|
|
161173
161245
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
161174
|
-
const version2 = "0.2.8-alpha.
|
|
161246
|
+
const version2 = "0.2.8-alpha.12";
|
|
161175
161247
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
161176
161248
|
const baseHeaders = {
|
|
161177
161249
|
"User-Agent": userAgent2
|
|
@@ -377151,7 +377223,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
377151
377223
|
// packages/cli/src/utils/version.ts
|
|
377152
377224
|
async function getCliVersion() {
|
|
377153
377225
|
const pkgJson = await getPackageJson();
|
|
377154
|
-
return "0.2.8-alpha.
|
|
377226
|
+
return "0.2.8-alpha.12";
|
|
377155
377227
|
}
|
|
377156
377228
|
__name(getCliVersion, "getCliVersion");
|
|
377157
377229
|
|
|
@@ -447250,7 +447322,7 @@ var QwenAgent = class {
|
|
|
447250
447322
|
async initialize(args) {
|
|
447251
447323
|
this.clientCapabilities = args.clientCapabilities;
|
|
447252
447324
|
const authMethods = buildAuthMethods();
|
|
447253
|
-
const version2 = "0.2.8-alpha.
|
|
447325
|
+
const version2 = "0.2.8-alpha.12";
|
|
447254
447326
|
return {
|
|
447255
447327
|
protocolVersion: PROTOCOL_VERSION,
|
|
447256
447328
|
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.12",
|
|
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.12"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|