Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot]
8eb5e46956 chore(release): v0.0.4 2025-08-03 10:25:43 +00:00
Fan
8d6dfaac19 fix system md (#189) 2025-08-03 15:12:18 +08:00
Fan
dbc0eb4336 fix ci (#185) 2025-08-02 23:44:35 +08:00
9 changed files with 38 additions and 18 deletions

10
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.3",
"version": "0.0.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@qwen-code/qwen-code",
"version": "0.0.3",
"version": "0.0.4",
"workspaces": [
"packages/*"
],
@@ -11771,7 +11771,7 @@
},
"packages/cli": {
"name": "@qwen-code/qwen-code",
"version": "0.0.3",
"version": "0.0.4",
"dependencies": {
"@google/genai": "1.9.0",
"@iarna/toml": "^2.2.5",
@@ -11846,7 +11846,7 @@
},
"packages/core": {
"name": "@qwen-code/qwen-code-core",
"version": "0.0.3",
"version": "0.0.4",
"dependencies": {
"@google/genai": "1.9.0",
"@modelcontextprotocol/sdk": "^1.11.0",
@@ -11912,7 +11912,7 @@
},
"packages/vscode-ide-companion": {
"name": "qwen-code-vscode-ide-companion",
"version": "0.0.3",
"version": "0.0.4",
"license": "LICENSE",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.15.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.3",
"version": "0.0.4",
"engines": {
"node": ">=20.0.0"
},
@@ -13,7 +13,7 @@
"url": "git+https://github.com/QwenLM/qwen-code.git"
},
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.3"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.4"
},
"scripts": {
"start": "node scripts/start.js",

View File

@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.3",
"version": "0.0.4",
"description": "Qwen Code",
"repository": {
"type": "git",
@@ -25,7 +25,7 @@
"dist"
],
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.3"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.4"
},
"dependencies": {
"@qwen-code/qwen-code-core": "file:../core",

View File

@@ -15,6 +15,7 @@ describe('validateNonInterActiveAuth', () => {
let originalEnvGeminiApiKey: string | undefined;
let originalEnvVertexAi: string | undefined;
let originalEnvGcp: string | undefined;
let originalEnvOpenAiApiKey: string | undefined;
let consoleErrorSpy: ReturnType<typeof vi.spyOn>;
let processExitSpy: ReturnType<typeof vi.spyOn>;
let refreshAuthMock: jest.MockedFunction<
@@ -25,9 +26,11 @@ describe('validateNonInterActiveAuth', () => {
originalEnvGeminiApiKey = process.env.GEMINI_API_KEY;
originalEnvVertexAi = process.env.GOOGLE_GENAI_USE_VERTEXAI;
originalEnvGcp = process.env.GOOGLE_GENAI_USE_GCA;
originalEnvOpenAiApiKey = process.env.OPENAI_API_KEY;
delete process.env.GEMINI_API_KEY;
delete process.env.GOOGLE_GENAI_USE_VERTEXAI;
delete process.env.GOOGLE_GENAI_USE_GCA;
delete process.env.OPENAI_API_KEY;
consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
processExitSpy = vi.spyOn(process, 'exit').mockImplementation((code) => {
throw new Error(`process.exit(${code}) called`);
@@ -51,6 +54,11 @@ describe('validateNonInterActiveAuth', () => {
} else {
delete process.env.GOOGLE_GENAI_USE_GCA;
}
if (originalEnvOpenAiApiKey !== undefined) {
process.env.OPENAI_API_KEY = originalEnvOpenAiApiKey;
} else {
delete process.env.OPENAI_API_KEY;
}
vi.restoreAllMocks();
});
@@ -88,6 +96,15 @@ describe('validateNonInterActiveAuth', () => {
expect(refreshAuthMock).toHaveBeenCalledWith(AuthType.USE_GEMINI);
});
it('uses USE_OPENAI if OPENAI_API_KEY is set', async () => {
process.env.OPENAI_API_KEY = 'fake-openai-key';
const nonInteractiveConfig: NonInteractiveConfig = {
refreshAuth: refreshAuthMock,
};
await validateNonInteractiveAuth(undefined, nonInteractiveConfig);
expect(refreshAuthMock).toHaveBeenCalledWith(AuthType.USE_OPENAI);
});
it('uses USE_VERTEX_AI if GOOGLE_GENAI_USE_VERTEXAI is true (with GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION)', async () => {
process.env.GOOGLE_GENAI_USE_VERTEXAI = 'true';
process.env.GOOGLE_CLOUD_PROJECT = 'test-project';

View File

@@ -18,6 +18,9 @@ function getAuthTypeFromEnv(): AuthType | undefined {
if (process.env.GEMINI_API_KEY) {
return AuthType.USE_GEMINI;
}
if (process.env.OPENAI_API_KEY) {
return AuthType.USE_OPENAI;
}
return undefined;
}
@@ -29,7 +32,7 @@ export async function validateNonInteractiveAuth(
if (!effectiveAuthType) {
console.error(
`Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`,
`Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, OPENAI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`,
);
process.exit(1);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code-core",
"version": "0.0.3",
"version": "0.0.4",
"description": "Qwen Code Core",
"repository": {
"type": "git",

View File

@@ -20,7 +20,7 @@ import * as os from 'os';
vi.mock('fs/promises');
vi.mock('os');
const MEMORY_SECTION_HEADER = '## Gemini Added Memories';
const MEMORY_SECTION_HEADER = '## Qwen Added Memories';
// Define a type for our fsAdapter to ensure consistency
interface FsAdapter {
@@ -87,7 +87,7 @@ describe('MemoryTool', () => {
describe('performAddMemoryEntry (static method)', () => {
const testFilePath = path.join(
'/mock/home',
'.gemini',
'.qwen',
DEFAULT_CONTEXT_FILENAME, // Use the default for basic tests
);
@@ -207,7 +207,7 @@ describe('MemoryTool', () => {
// Use getCurrentGeminiMdFilename for the default expectation before any setGeminiMdFilename calls in a test
const expectedFilePath = path.join(
'/mock/home',
'.gemini',
'.qwen',
getCurrentGeminiMdFilename(), // This will be DEFAULT_CONTEXT_FILENAME unless changed by a test
);

View File

@@ -46,9 +46,9 @@ Do NOT use this tool:
- \`fact\` (string, required): The specific fact or piece of information to remember. This should be a clear, self-contained statement. For example, if the user says "My favorite color is blue", the fact would be "My favorite color is blue".
`;
export const GEMINI_CONFIG_DIR = '.gemini';
export const DEFAULT_CONTEXT_FILENAME = 'GEMINI.md';
export const MEMORY_SECTION_HEADER = '## Gemini Added Memories';
export const GEMINI_CONFIG_DIR = '.qwen';
export const DEFAULT_CONTEXT_FILENAME = 'QWEN.md';
export const MEMORY_SECTION_HEADER = '## Qwen Added Memories';
// This variable will hold the currently configured filename for GEMINI.md context files.
// It defaults to DEFAULT_CONTEXT_FILENAME but can be overridden by setGeminiMdFilename.

View File

@@ -2,7 +2,7 @@
"name": "qwen-code-vscode-ide-companion",
"displayName": "Qwen Code Companion",
"description": "Enable Qwen Code with direct access to your VS Code workspace.",
"version": "0.0.3",
"version": "0.0.4",
"publisher": "qwenlm",
"icon": "assets/icon.png",
"repository": {