pre-release: fix ci (#1)
* fix aoneci * remove codeql * sync version to 0.0.1-alpha.7 * renaming org to qwen-code
This commit is contained in:
parent
13c0b24110
commit
daad04613e
|
@ -144,22 +144,3 @@ jobs:
|
||||||
core_full_text_summary_file: coverage_artifact/core/coverage/full-text-summary.txt
|
core_full_text_summary_file: coverage_artifact/core/coverage/full-text-summary.txt
|
||||||
node_version: ${{ matrix.node-version }}
|
node_version: ${{ matrix.node-version }}
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
codeql:
|
|
||||||
name: CodeQL
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3
|
|
||||||
with:
|
|
||||||
languages: javascript
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ Qwen Code is a command-line AI workflow tool adapted from [**Gemini CLI**](https
|
||||||
|
|
||||||
Ensure you have [Node.js version 20](https://nodejs.org/en/download) or higher installed.
|
Ensure you have [Node.js version 20](https://nodejs.org/en/download) or higher installed.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -qL https://www.npmjs.com/install.sh | sh
|
curl -qL https://www.npmjs.com/install.sh | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@qwen/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@qwen/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
|
@ -81,18 +81,6 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@qwen/qwen-code": {
|
|
||||||
"resolved": "packages/cli",
|
|
||||||
"link": true
|
|
||||||
},
|
|
||||||
"node_modules/@qwen/qwen-code-core": {
|
|
||||||
"resolved": "packages/core",
|
|
||||||
"link": true
|
|
||||||
},
|
|
||||||
"node_modules/@qwen/qwen-code-vscode-ide-companion": {
|
|
||||||
"resolved": "packages/vscode-ide-companion",
|
|
||||||
"link": true
|
|
||||||
},
|
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
|
||||||
|
@ -1970,6 +1958,18 @@
|
||||||
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
|
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
|
"node_modules/@qwen-code/qwen-code": {
|
||||||
|
"resolved": "packages/cli",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
|
"node_modules/@qwen-code/qwen-code-core": {
|
||||||
|
"resolved": "packages/core",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
|
"node_modules/@qwen-code/qwen-code-vscode-ide-companion": {
|
||||||
|
"resolved": "packages/vscode-ide-companion",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||||
"version": "4.44.0",
|
"version": "4.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.0.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.0.tgz",
|
||||||
|
@ -11935,10 +11935,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/cli": {
|
"packages/cli": {
|
||||||
"name": "@qwen/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@qwen/qwen-code-core": "file:../core",
|
"@qwen-code/qwen-code-core": "file:../core",
|
||||||
"@types/update-notifier": "^6.0.8",
|
"@types/update-notifier": "^6.0.8",
|
||||||
"command-exists": "^1.2.9",
|
"command-exists": "^1.2.9",
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
|
@ -12113,8 +12113,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/core": {
|
"packages/core": {
|
||||||
"name": "@qwen/qwen-code-core",
|
"name": "@qwen-code/qwen-code-core",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "1.8.0",
|
"@google/genai": "1.8.0",
|
||||||
"@modelcontextprotocol/sdk": "^1.11.0",
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||||
|
@ -12186,8 +12186,8 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"packages/vscode-ide-companion": {
|
"packages/vscode-ide-companion": {
|
||||||
"name": "@qwen/qwen-code-vscode-ide-companion",
|
"name": "@qwen-code/qwen-code-vscode-ide-companion",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.15.1",
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@qwen/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
"url": "git+http://gitlab.alibaba-inc.com/Qwen-Coder/qwen-code.git"
|
"url": "git+http://gitlab.alibaba-inc.com/Qwen-Coder/qwen-code.git"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.0.1-dev1"
|
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.0.1-alpha.7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node scripts/start.js",
|
"start": "node scripts/start.js",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@qwen/qwen-code",
|
"name": "@qwen-code/qwen-code",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"description": "Gemini CLI",
|
"description": "Gemini CLI",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -25,10 +25,10 @@
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.0.1-dev1"
|
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.0.1-alpha.7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@qwen/qwen-code-core": "file:../core",
|
"@qwen-code/qwen-code-core": "file:../core",
|
||||||
"@types/update-notifier": "^6.0.8",
|
"@types/update-notifier": "^6.0.8",
|
||||||
"command-exists": "^1.2.9",
|
"command-exists": "^1.2.9",
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AuthType } from '@qwen/qwen-code-core';
|
import { AuthType } from '@qwen-code/qwen-code-core';
|
||||||
import { vi } from 'vitest';
|
import { vi } from 'vitest';
|
||||||
import { validateAuthMethod } from './auth.js';
|
import { validateAuthMethod } from './auth.js';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AuthType } from '@qwen/qwen-code-core';
|
import { AuthType } from '@qwen-code/qwen-code-core';
|
||||||
import { loadEnvironment } from './settings.js';
|
import { loadEnvironment } from './settings.js';
|
||||||
|
|
||||||
export const validateAuthMethod = (authMethod: string): string | null => {
|
export const validateAuthMethod = (authMethod: string): string | null => {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
Config,
|
Config,
|
||||||
ConfigParameters,
|
ConfigParameters,
|
||||||
ContentGeneratorConfig,
|
ContentGeneratorConfig,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = {
|
const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = {
|
||||||
apiKey: 'test-key',
|
apiKey: 'test-key',
|
||||||
|
@ -21,8 +21,8 @@ const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mock file discovery service and tool registry
|
// Mock file discovery service and tool registry
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actual = await vi.importActual('@qwen/qwen-code-core');
|
const actual = await vi.importActual('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn().mockImplementation(() => ({
|
FileDiscoveryService: vi.fn().mockImplementation(() => ({
|
||||||
|
|
|
@ -9,12 +9,12 @@ import * as os from 'os';
|
||||||
import { loadCliConfig, parseArguments } from './config.js';
|
import { loadCliConfig, parseArguments } from './config.js';
|
||||||
import { Settings } from './settings.js';
|
import { Settings } from './settings.js';
|
||||||
import { Extension } from './extension.js';
|
import { Extension } from './extension.js';
|
||||||
import * as ServerConfig from '@qwen/qwen-code-core';
|
import * as ServerConfig from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
TelemetryTarget,
|
TelemetryTarget,
|
||||||
ConfigParameters,
|
ConfigParameters,
|
||||||
DEFAULT_TELEMETRY_TARGET,
|
DEFAULT_TELEMETRY_TARGET,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
vi.mock('os', async (importOriginal) => {
|
vi.mock('os', async (importOriginal) => {
|
||||||
const actualOs = await importOriginal<typeof os>();
|
const actualOs = await importOriginal<typeof os>();
|
||||||
|
@ -34,9 +34,9 @@ vi.mock('read-package-up', () => ({
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actualServer = await vi.importActual<typeof ServerConfig>(
|
const actualServer = await vi.importActual<typeof ServerConfig>(
|
||||||
'@qwen/qwen-code-core',
|
'@qwen-code/qwen-code-core',
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...actualServer,
|
...actualServer,
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
FileDiscoveryService,
|
FileDiscoveryService,
|
||||||
TelemetryTarget,
|
TelemetryTarget,
|
||||||
MCPServerConfig,
|
MCPServerConfig,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { Settings } from './settings.js';
|
import { Settings } from './settings.js';
|
||||||
|
|
||||||
import { Extension, filterActiveExtensions } from './extension.js';
|
import { Extension, filterActiveExtensions } from './extension.js';
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { MCPServerConfig } from '@qwen/qwen-code-core';
|
import { MCPServerConfig } from '@qwen-code/qwen-code-core';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { SandboxConfig } from '@qwen/qwen-code-core';
|
import { SandboxConfig } from '@qwen-code/qwen-code-core';
|
||||||
import commandExists from 'command-exists';
|
import commandExists from 'command-exists';
|
||||||
import * as os from 'node:os';
|
import * as os from 'node:os';
|
||||||
import { getPackageJson } from '../utils/package.js';
|
import { getPackageJson } from '../utils/package.js';
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
BugCommandSettings,
|
BugCommandSettings,
|
||||||
TelemetrySettings,
|
TelemetrySettings,
|
||||||
AuthType,
|
AuthType,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import stripJsonComments from 'strip-json-comments';
|
import stripJsonComments from 'strip-json-comments';
|
||||||
import { DefaultLight } from '../ui/themes/default-light.js';
|
import { DefaultLight } from '../ui/themes/default-light.js';
|
||||||
import { DefaultDark } from '../ui/themes/default.js';
|
import { DefaultDark } from '../ui/themes/default.js';
|
||||||
|
|
|
@ -37,7 +37,7 @@ import {
|
||||||
logUserPrompt,
|
logUserPrompt,
|
||||||
AuthType,
|
AuthType,
|
||||||
getOauthClient,
|
getOauthClient,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { validateAuthMethod } from './config/auth.js';
|
import { validateAuthMethod } from './config/auth.js';
|
||||||
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
|
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||||
import { runNonInteractive } from './nonInteractiveCli.js';
|
import { runNonInteractive } from './nonInteractiveCli.js';
|
||||||
import { Config, GeminiClient, ToolRegistry } from '@qwen/qwen-code-core';
|
import { Config, GeminiClient, ToolRegistry } from '@qwen-code/qwen-code-core';
|
||||||
import { GenerateContentResponse, Part, FunctionCall } from '@google/genai';
|
import { GenerateContentResponse, Part, FunctionCall } from '@google/genai';
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actualCore = await vi.importActual<
|
const actualCore = await vi.importActual<
|
||||||
typeof import('@qwen/qwen-code-core')
|
typeof import('@qwen-code/qwen-code-core')
|
||||||
>('@qwen/qwen-code-core');
|
>('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actualCore,
|
...actualCore,
|
||||||
GeminiClient: vi.fn(),
|
GeminiClient: vi.fn(),
|
||||||
|
@ -114,7 +114,7 @@ describe('runNonInteractive', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@qwen/qwen-code-core'
|
'@qwen-code/qwen-code-core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fc1',
|
callId: 'fc1',
|
||||||
|
@ -168,7 +168,7 @@ describe('runNonInteractive', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@qwen/qwen-code-core'
|
'@qwen-code/qwen-code-core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fcError',
|
callId: 'fcError',
|
||||||
|
@ -241,7 +241,7 @@ describe('runNonInteractive', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@qwen/qwen-code-core'
|
'@qwen-code/qwen-code-core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fcNotFound',
|
callId: 'fcNotFound',
|
||||||
|
@ -314,7 +314,7 @@ describe('runNonInteractive', () => {
|
||||||
vi.mocked(mockConfig.getMaxSessionTurns).mockReturnValue(1);
|
vi.mocked(mockConfig.getMaxSessionTurns).mockReturnValue(1);
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@qwen/qwen-code-core'
|
'@qwen-code/qwen-code-core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fcLoop',
|
callId: 'fcLoop',
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
shutdownTelemetry,
|
shutdownTelemetry,
|
||||||
isTelemetrySdkInitialized,
|
isTelemetrySdkInitialized,
|
||||||
ToolResultDisplay,
|
ToolResultDisplay,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
Content,
|
Content,
|
||||||
Part,
|
Part,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
AccessibilitySettings,
|
AccessibilitySettings,
|
||||||
SandboxConfig,
|
SandboxConfig,
|
||||||
GeminiClient,
|
GeminiClient,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js';
|
import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import { useGeminiStream } from './hooks/useGeminiStream.js';
|
import { useGeminiStream } from './hooks/useGeminiStream.js';
|
||||||
|
@ -74,10 +74,10 @@ interface MockServerConfig {
|
||||||
getUserTier: Mock<() => Promise<string | undefined>>;
|
getUserTier: Mock<() => Promise<string | undefined>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mock @qwen/qwen-code-core and its Config class
|
// Mock @qwen-code/qwen-code-core and its Config class
|
||||||
vi.mock('@qwen/qwen-code-core', async (importOriginal) => {
|
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||||
const actualCore =
|
const actualCore =
|
||||||
await importOriginal<typeof import('@qwen/qwen-code-core')>();
|
await importOriginal<typeof import('@qwen-code/qwen-code-core')>();
|
||||||
const ConfigClassMock = vi
|
const ConfigClassMock = vi
|
||||||
.fn()
|
.fn()
|
||||||
.mockImplementation((optionsPassedToConstructor) => {
|
.mockImplementation((optionsPassedToConstructor) => {
|
||||||
|
|
|
@ -57,7 +57,7 @@ import {
|
||||||
EditorType,
|
EditorType,
|
||||||
FlashFallbackEvent,
|
FlashFallbackEvent,
|
||||||
logFlashFallback,
|
logFlashFallback,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { validateAuthMethod } from '../config/auth.js';
|
import { validateAuthMethod } from '../config/auth.js';
|
||||||
import { useLogger } from './hooks/useLogger.js';
|
import { useLogger } from './hooks/useLogger.js';
|
||||||
import { StreamingContext } from './contexts/StreamingContext.js';
|
import { StreamingContext } from './contexts/StreamingContext.js';
|
||||||
|
@ -74,7 +74,7 @@ import {
|
||||||
isProQuotaExceededError,
|
isProQuotaExceededError,
|
||||||
isGenericQuotaExceededError,
|
isGenericQuotaExceededError,
|
||||||
UserTierId,
|
UserTierId,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { checkForUpdates } from './utils/updateCheck.js';
|
import { checkForUpdates } from './utils/updateCheck.js';
|
||||||
import ansiEscapes from 'ansi-escapes';
|
import ansiEscapes from 'ansi-escapes';
|
||||||
import { OverflowProvider } from './contexts/OverflowContext.js';
|
import { OverflowProvider } from './contexts/OverflowContext.js';
|
||||||
|
|
|
@ -9,10 +9,11 @@ import { memoryCommand } from './memoryCommand.js';
|
||||||
import { type CommandContext, SlashCommand } from './types.js';
|
import { type CommandContext, SlashCommand } from './types.js';
|
||||||
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
|
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
|
||||||
import { MessageType } from '../types.js';
|
import { MessageType } from '../types.js';
|
||||||
import { getErrorMessage } from '@qwen/qwen-code-core';
|
import { getErrorMessage } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async (importOriginal) => {
|
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||||
const original = await importOriginal<typeof import('@qwen/qwen-code-core')>();
|
const original =
|
||||||
|
await importOriginal<typeof import('@qwen-code/qwen-code-core')>();
|
||||||
return {
|
return {
|
||||||
...original,
|
...original,
|
||||||
getErrorMessage: vi.fn((error: unknown) => {
|
getErrorMessage: vi.fn((error: unknown) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getErrorMessage } from '@qwen/qwen-code-core';
|
import { getErrorMessage } from '@qwen-code/qwen-code-core';
|
||||||
import { MessageType } from '../types.js';
|
import { MessageType } from '../types.js';
|
||||||
import { SlashCommand, SlashCommandActionReturn } from './types.js';
|
import { SlashCommand, SlashCommandActionReturn } from './types.js';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Config, GitService, Logger } from '@qwen/qwen-code-core';
|
import { Config, GitService, Logger } from '@qwen-code/qwen-code-core';
|
||||||
import { LoadedSettings } from '../../config/settings.js';
|
import { LoadedSettings } from '../../config/settings.js';
|
||||||
import { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js';
|
import { UseHistoryManagerReturn } from '../hooks/useHistoryManager.js';
|
||||||
import { SessionStatsState } from '../contexts/SessionContext.js';
|
import { SessionStatsState } from '../contexts/SessionContext.js';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { render } from 'ink-testing-library';
|
||||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||||
import { AuthDialog } from './AuthDialog.js';
|
import { AuthDialog } from './AuthDialog.js';
|
||||||
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
||||||
import { AuthType } from '@qwen/qwen-code-core';
|
import { AuthType } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
describe('AuthDialog', () => {
|
describe('AuthDialog', () => {
|
||||||
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
|
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Box, Text, useInput } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
||||||
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
||||||
import { AuthType } from '@qwen/qwen-code-core';
|
import { AuthType } from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
validateAuthMethod,
|
validateAuthMethod,
|
||||||
setOpenAIApiKey,
|
setOpenAIApiKey,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { ApprovalMode } from '@qwen/qwen-code-core';
|
import { ApprovalMode } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface AutoAcceptIndicatorProps {
|
interface AutoAcceptIndicatorProps {
|
||||||
approvalMode: ApprovalMode;
|
approvalMode: ApprovalMode;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'ink';
|
import { Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { type MCPServerConfig } from '@qwen/qwen-code-core';
|
import { type MCPServerConfig } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface ContextSummaryDisplayProps {
|
interface ContextSummaryDisplayProps {
|
||||||
geminiMdFileCount: number;
|
geminiMdFileCount: number;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
} from '../editors/editorSettingsManager.js';
|
} from '../editors/editorSettingsManager.js';
|
||||||
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
||||||
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
import { LoadedSettings, SettingScope } from '../../config/settings.js';
|
||||||
import { EditorType, isEditorAvailable } from '@qwen/qwen-code-core';
|
import { EditorType, isEditorAvailable } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface EditorDialogProps {
|
interface EditorDialogProps {
|
||||||
onSelect: (editorType: EditorType | undefined, scope: SettingScope) => void;
|
onSelect: (editorType: EditorType | undefined, scope: SettingScope) => void;
|
||||||
|
|
|
@ -7,7 +7,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { shortenPath, tildeifyPath, tokenLimit } from '@qwen/qwen-code-core';
|
import {
|
||||||
|
shortenPath,
|
||||||
|
tildeifyPath,
|
||||||
|
tokenLimit,
|
||||||
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
|
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import Gradient from 'ink-gradient';
|
import Gradient from 'ink-gradient';
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { StatsDisplay } from './StatsDisplay.js';
|
||||||
import { ModelStatsDisplay } from './ModelStatsDisplay.js';
|
import { ModelStatsDisplay } from './ModelStatsDisplay.js';
|
||||||
import { ToolStatsDisplay } from './ToolStatsDisplay.js';
|
import { ToolStatsDisplay } from './ToolStatsDisplay.js';
|
||||||
import { SessionSummaryDisplay } from './SessionSummaryDisplay.js';
|
import { SessionSummaryDisplay } from './SessionSummaryDisplay.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface HistoryItemDisplayProps {
|
interface HistoryItemDisplayProps {
|
||||||
item: HistoryItem;
|
item: HistoryItem;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { render } from 'ink-testing-library';
|
import { render } from 'ink-testing-library';
|
||||||
import { InputPrompt, InputPromptProps } from './InputPrompt.js';
|
import { InputPrompt, InputPromptProps } from './InputPrompt.js';
|
||||||
import type { TextBuffer } from './shared/text-buffer.js';
|
import type { TextBuffer } from './shared/text-buffer.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
import { CommandContext, SlashCommand } from '../commands/types.js';
|
import { CommandContext, SlashCommand } from '../commands/types.js';
|
||||||
import { vi } from 'vitest';
|
import { vi } from 'vitest';
|
||||||
import { useShellHistory } from '../hooks/useShellHistory.js';
|
import { useShellHistory } from '../hooks/useShellHistory.js';
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { useCompletion } from '../hooks/useCompletion.js';
|
||||||
import { useKeypress, Key } from '../hooks/useKeypress.js';
|
import { useKeypress, Key } from '../hooks/useKeypress.js';
|
||||||
import { isAtCommand, isSlashCommand } from '../utils/commandUtils.js';
|
import { isAtCommand, isSlashCommand } from '../utils/commandUtils.js';
|
||||||
import { CommandContext, SlashCommand } from '../commands/types.js';
|
import { CommandContext, SlashCommand } from '../commands/types.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
clipboardHasImage,
|
clipboardHasImage,
|
||||||
saveClipboardImage,
|
saveClipboardImage,
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ThoughtSummary } from '@qwen/qwen-code-core';
|
import { ThoughtSummary } from '@qwen-code/qwen-code-core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { type Config } from '@qwen/qwen-code-core';
|
import { type Config } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface TipsProps {
|
interface TipsProps {
|
||||||
config: Config;
|
config: Config;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
USER_AGREEMENT_RATE_MEDIUM,
|
USER_AGREEMENT_RATE_MEDIUM,
|
||||||
} from '../utils/displayUtils.js';
|
} from '../utils/displayUtils.js';
|
||||||
import { useSessionStats } from '../contexts/SessionContext.js';
|
import { useSessionStats } from '../contexts/SessionContext.js';
|
||||||
import { ToolCallStats } from '@qwen/qwen-code-core';
|
import { ToolCallStats } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const TOOL_NAME_COL_WIDTH = 25;
|
const TOOL_NAME_COL_WIDTH = 25;
|
||||||
const CALLS_COL_WIDTH = 8;
|
const CALLS_COL_WIDTH = 8;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { render } from 'ink-testing-library';
|
import { render } from 'ink-testing-library';
|
||||||
import { describe, it, expect, vi } from 'vitest';
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
|
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
|
||||||
import { ToolCallConfirmationDetails } from '@qwen/qwen-code-core';
|
import { ToolCallConfirmationDetails } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
describe('ToolConfirmationMessage', () => {
|
describe('ToolConfirmationMessage', () => {
|
||||||
it('should not display urls if prompt and url are the same', () => {
|
it('should not display urls if prompt and url are the same', () => {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
ToolExecuteConfirmationDetails,
|
ToolExecuteConfirmationDetails,
|
||||||
ToolMcpConfirmationDetails,
|
ToolMcpConfirmationDetails,
|
||||||
Config,
|
Config,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
RadioButtonSelect,
|
RadioButtonSelect,
|
||||||
RadioSelectItem,
|
RadioSelectItem,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js';
|
||||||
import { ToolMessage } from './ToolMessage.js';
|
import { ToolMessage } from './ToolMessage.js';
|
||||||
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
|
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
|
||||||
import { Colors } from '../../colors.js';
|
import { Colors } from '../../colors.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface ToolGroupMessageProps {
|
interface ToolGroupMessageProps {
|
||||||
groupId: number;
|
groupId: number;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import os from 'os';
|
||||||
import pathMod from 'path';
|
import pathMod from 'path';
|
||||||
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
|
||||||
import stringWidth from 'string-width';
|
import stringWidth from 'string-width';
|
||||||
import { unescapePath } from '@qwen/qwen-code-core';
|
import { unescapePath } from '@qwen-code/qwen-code-core';
|
||||||
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
|
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
|
||||||
|
|
||||||
export type Direction =
|
export type Direction =
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
SessionMetrics,
|
SessionMetrics,
|
||||||
} from './SessionContext.js';
|
} from './SessionContext.js';
|
||||||
import { describe, it, expect, vi } from 'vitest';
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
import { uiTelemetryService } from '@qwen/qwen-code-core';
|
import { uiTelemetryService } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A test harness component that uses the hook and exposes the context value
|
* A test harness component that uses the hook and exposes the context value
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
uiTelemetryService,
|
uiTelemetryService,
|
||||||
SessionMetrics,
|
SessionMetrics,
|
||||||
ModelMetrics,
|
ModelMetrics,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
// --- Interface Definitions ---
|
// --- Interface Definitions ---
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
allowEditorTypeInSandbox,
|
allowEditorTypeInSandbox,
|
||||||
checkHasEditorType,
|
checkHasEditorType,
|
||||||
type EditorType,
|
type EditorType,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
export interface EditorDisplay {
|
export interface EditorDisplay {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
|
||||||
import type { Mocked } from 'vitest';
|
import type { Mocked } from 'vitest';
|
||||||
import { handleAtCommand } from './atCommandProcessor.js';
|
import { handleAtCommand } from './atCommandProcessor.js';
|
||||||
import { Config, FileDiscoveryService } from '@qwen/qwen-code-core';
|
import { Config, FileDiscoveryService } from '@qwen-code/qwen-code-core';
|
||||||
import { ToolCallStatus } from '../types.js';
|
import { ToolCallStatus } from '../types.js';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
import * as fsPromises from 'fs/promises';
|
import * as fsPromises from 'fs/promises';
|
||||||
|
@ -52,8 +52,8 @@ vi.mock('fs/promises', async () => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actual = await vi.importActual('@qwen/qwen-code-core');
|
const actual = await vi.importActual('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn(),
|
FileDiscoveryService: vi.fn(),
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
getErrorMessage,
|
getErrorMessage,
|
||||||
isNodeError,
|
isNodeError,
|
||||||
unescapePath,
|
unescapePath,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
HistoryItem,
|
HistoryItem,
|
||||||
IndividualToolCallDisplay,
|
IndividualToolCallDisplay,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { act, renderHook } from '@testing-library/react';
|
import { act, renderHook } from '@testing-library/react';
|
||||||
import { vi } from 'vitest';
|
import { vi } from 'vitest';
|
||||||
import { useShellCommandProcessor } from './shellCommandProcessor';
|
import { useShellCommandProcessor } from './shellCommandProcessor';
|
||||||
import { Config, GeminiClient } from '@qwen/qwen-code-core';
|
import { Config, GeminiClient } from '@qwen-code/qwen-code-core';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ vi.mock('os', () => ({
|
||||||
platform: () => 'linux',
|
platform: () => 'linux',
|
||||||
tmpdir: () => '/tmp',
|
tmpdir: () => '/tmp',
|
||||||
}));
|
}));
|
||||||
vi.mock('@qwen/qwen-code-core');
|
vi.mock('@qwen-code/qwen-code-core');
|
||||||
vi.mock('../utils/textUtils.js', () => ({
|
vi.mock('../utils/textUtils.js', () => ({
|
||||||
isBinary: vi.fn(),
|
isBinary: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { spawn } from 'child_process';
|
||||||
import { StringDecoder } from 'string_decoder';
|
import { StringDecoder } from 'string_decoder';
|
||||||
import type { HistoryItemWithoutId } from '../types.js';
|
import type { HistoryItemWithoutId } from '../types.js';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { Config, GeminiClient } from '@qwen/qwen-code-core';
|
import { Config, GeminiClient } from '@qwen-code/qwen-code-core';
|
||||||
import { type PartListUnion } from '@google/genai';
|
import { type PartListUnion } from '@google/genai';
|
||||||
import { formatMemoryUsage } from '../utils/formatters.js';
|
import { formatMemoryUsage } from '../utils/formatters.js';
|
||||||
import { isBinary } from '../utils/textUtils.js';
|
import { isBinary } from '../utils/textUtils.js';
|
||||||
|
|
|
@ -65,7 +65,7 @@ import {
|
||||||
getMCPDiscoveryState,
|
getMCPDiscoveryState,
|
||||||
getMCPServerStatus,
|
getMCPServerStatus,
|
||||||
GeminiClient,
|
GeminiClient,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { useSessionStats } from '../contexts/SessionContext.js';
|
import { useSessionStats } from '../contexts/SessionContext.js';
|
||||||
import { LoadedSettings } from '../../config/settings.js';
|
import { LoadedSettings } from '../../config/settings.js';
|
||||||
import * as ShowMemoryCommandModule from './useShowMemoryCommand.js';
|
import * as ShowMemoryCommandModule from './useShowMemoryCommand.js';
|
||||||
|
@ -88,8 +88,9 @@ vi.mock('open', () => ({
|
||||||
default: vi.fn(),
|
default: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async (importOriginal) => {
|
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||||
const actual = await importOriginal<typeof import('@qwen/qwen-code-core')>();
|
const actual =
|
||||||
|
await importOriginal<typeof import('@qwen-code/qwen-code-core')>();
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
getMCPServerStatus: vi.fn(),
|
getMCPServerStatus: vi.fn(),
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
MCPServerStatus,
|
MCPServerStatus,
|
||||||
getMCPDiscoveryState,
|
getMCPDiscoveryState,
|
||||||
getMCPServerStatus,
|
getMCPServerStatus,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { useSessionStats } from '../contexts/SessionContext.js';
|
import { useSessionStats } from '../contexts/SessionContext.js';
|
||||||
import {
|
import {
|
||||||
Message,
|
Message,
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
Config,
|
Config,
|
||||||
clearCachedCredentialFile,
|
clearCachedCredentialFile,
|
||||||
getErrorMessage,
|
getErrorMessage,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { runExitCleanup } from '../../utils/cleanup.js';
|
import { runExitCleanup } from '../../utils/cleanup.js';
|
||||||
|
|
||||||
export const useAuthCommand = (
|
export const useAuthCommand = (
|
||||||
|
|
|
@ -20,14 +20,14 @@ import {
|
||||||
Config,
|
Config,
|
||||||
Config as ActualConfigType,
|
Config as ActualConfigType,
|
||||||
ApprovalMode,
|
ApprovalMode,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { useInput, type Key as InkKey } from 'ink';
|
import { useInput, type Key as InkKey } from 'ink';
|
||||||
|
|
||||||
vi.mock('ink');
|
vi.mock('ink');
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actualServerModule = (await vi.importActual(
|
const actualServerModule = (await vi.importActual(
|
||||||
'@qwen/qwen-code-core',
|
'@qwen-code/qwen-code-core',
|
||||||
)) as Record<string, unknown>;
|
)) as Record<string, unknown>;
|
||||||
return {
|
return {
|
||||||
...actualServerModule,
|
...actualServerModule,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useInput } from 'ink';
|
import { useInput } from 'ink';
|
||||||
import { ApprovalMode, type Config } from '@qwen/qwen-code-core';
|
import { ApprovalMode, type Config } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
export interface UseAutoAcceptIndicatorArgs {
|
export interface UseAutoAcceptIndicatorArgs {
|
||||||
config: Config;
|
config: Config;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { useCompletion } from './useCompletion.js';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import { glob } from 'glob';
|
import { glob } from 'glob';
|
||||||
import { CommandContext, SlashCommand } from '../commands/types.js';
|
import { CommandContext, SlashCommand } from '../commands/types.js';
|
||||||
import { Config, FileDiscoveryService } from '@qwen/qwen-code-core';
|
import { Config, FileDiscoveryService } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface MockConfig {
|
interface MockConfig {
|
||||||
getFileFilteringRespectGitIgnore: () => boolean;
|
getFileFilteringRespectGitIgnore: () => boolean;
|
||||||
|
@ -21,8 +21,8 @@ interface MockConfig {
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
vi.mock('fs/promises');
|
vi.mock('fs/promises');
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actual = await vi.importActual('@qwen/qwen-code-core');
|
const actual = await vi.importActual('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn(),
|
FileDiscoveryService: vi.fn(),
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
getErrorMessage,
|
getErrorMessage,
|
||||||
Config,
|
Config,
|
||||||
FileDiscoveryService,
|
FileDiscoveryService,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
MAX_SUGGESTIONS_TO_SHOW,
|
MAX_SUGGESTIONS_TO_SHOW,
|
||||||
Suggestion,
|
Suggestion,
|
||||||
|
|
|
@ -22,10 +22,10 @@ import {
|
||||||
type EditorType,
|
type EditorType,
|
||||||
checkHasEditorType,
|
checkHasEditorType,
|
||||||
allowEditorTypeInSandbox,
|
allowEditorTypeInSandbox,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actual = await vi.importActual('@qwen/qwen-code-core');
|
const actual = await vi.importActual('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
checkHasEditorType: vi.fn(() => true),
|
checkHasEditorType: vi.fn(() => true),
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
allowEditorTypeInSandbox,
|
allowEditorTypeInSandbox,
|
||||||
checkHasEditorType,
|
checkHasEditorType,
|
||||||
EditorType,
|
EditorType,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
interface UseEditorSettingsReturn {
|
interface UseEditorSettingsReturn {
|
||||||
isEditorDialogOpen: boolean;
|
isEditorDialogOpen: boolean;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
TrackedExecutingToolCall,
|
TrackedExecutingToolCall,
|
||||||
TrackedCancelledToolCall,
|
TrackedCancelledToolCall,
|
||||||
} from './useReactToolScheduler.js';
|
} from './useReactToolScheduler.js';
|
||||||
import { Config, EditorType, AuthType } from '@qwen/qwen-code-core';
|
import { Config, EditorType, AuthType } from '@qwen-code/qwen-code-core';
|
||||||
import { Part, PartListUnion } from '@google/genai';
|
import { Part, PartListUnion } from '@google/genai';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
import {
|
import {
|
||||||
|
@ -47,7 +47,7 @@ const MockedUserPromptEvent = vi.hoisted(() =>
|
||||||
vi.fn().mockImplementation(() => {}),
|
vi.fn().mockImplementation(() => {}),
|
||||||
);
|
);
|
||||||
|
|
||||||
vi.mock('@qwen/qwen-code-core', async (importOriginal) => {
|
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||||
const actualCoreModule = (await importOriginal()) as any;
|
const actualCoreModule = (await importOriginal()) as any;
|
||||||
return {
|
return {
|
||||||
...actualCoreModule,
|
...actualCoreModule,
|
||||||
|
|
|
@ -25,7 +25,7 @@ import {
|
||||||
UnauthorizedError,
|
UnauthorizedError,
|
||||||
UserPromptEvent,
|
UserPromptEvent,
|
||||||
DEFAULT_GEMINI_FLASH_MODEL,
|
DEFAULT_GEMINI_FLASH_MODEL,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { type Part, type PartListUnion } from '@google/genai';
|
import { type Part, type PartListUnion } from '@google/genai';
|
||||||
import {
|
import {
|
||||||
StreamingState,
|
StreamingState,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { sessionId, Logger } from '@qwen/qwen-code-core';
|
import { sessionId, Logger } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook to manage the logger instance.
|
* Hook to manage the logger instance.
|
||||||
|
|
|
@ -6,7 +6,11 @@
|
||||||
|
|
||||||
import { GaxiosError } from 'gaxios';
|
import { GaxiosError } from 'gaxios';
|
||||||
import { useState, useEffect, useCallback } from 'react';
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
import { Config, CodeAssistServer, UserTierId } from '@qwen/qwen-code-core';
|
import {
|
||||||
|
Config,
|
||||||
|
CodeAssistServer,
|
||||||
|
UserTierId,
|
||||||
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
export interface PrivacyState {
|
export interface PrivacyState {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {
|
||||||
ToolCall,
|
ToolCall,
|
||||||
Status as CoreStatus,
|
Status as CoreStatus,
|
||||||
EditorType,
|
EditorType,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import { useCallback, useState, useMemo } from 'react';
|
import { useCallback, useState, useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
HistoryItemToolGroup,
|
HistoryItemToolGroup,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { useState, useEffect, useCallback } from 'react';
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { isNodeError, getProjectTempDir } from '@qwen/qwen-code-core';
|
import { isNodeError, getProjectTempDir } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const HISTORY_FILE = 'shell_history';
|
const HISTORY_FILE = 'shell_history';
|
||||||
const MAX_HISTORY_LENGTH = 100;
|
const MAX_HISTORY_LENGTH = 100;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Message, MessageType } from '../types.js';
|
import { Message, MessageType } from '../types.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
import { LoadedSettings } from '../../config/settings.js';
|
import { LoadedSettings } from '../../config/settings.js';
|
||||||
|
|
||||||
export function createShowMemoryAction(
|
export function createShowMemoryAction(
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
ToolCall, // Import from core
|
ToolCall, // Import from core
|
||||||
Status as ToolCallStatusType,
|
Status as ToolCallStatusType,
|
||||||
ApprovalMode, // Import from core
|
ApprovalMode, // Import from core
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
import {
|
import {
|
||||||
HistoryItemWithoutId,
|
HistoryItemWithoutId,
|
||||||
ToolCallStatus,
|
ToolCallStatus,
|
||||||
|
@ -32,8 +32,8 @@ import {
|
||||||
} from '../types.js';
|
} from '../types.js';
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
vi.mock('@qwen/qwen-code-core', async () => {
|
vi.mock('@qwen-code/qwen-code-core', async () => {
|
||||||
const actual = await vi.importActual('@qwen/qwen-code-core');
|
const actual = await vi.importActual('@qwen-code/qwen-code-core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
ToolRegistry: vi.fn(),
|
ToolRegistry: vi.fn(),
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Box, Newline, Text, useInput } from 'ink';
|
||||||
import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js';
|
import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js';
|
||||||
import { usePrivacySettings } from '../hooks/usePrivacySettings.js';
|
import { usePrivacySettings } from '../hooks/usePrivacySettings.js';
|
||||||
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
||||||
import { Config } from '@qwen/qwen-code-core';
|
import { Config } from '@qwen-code/qwen-code-core';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
|
|
||||||
interface CloudFreePrivacyNoticeProps {
|
interface CloudFreePrivacyNoticeProps {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Box } from 'ink';
|
import { Box } from 'ink';
|
||||||
import { type Config, AuthType } from '@qwen/qwen-code-core';
|
import { type Config, AuthType } from '@qwen-code/qwen-code-core';
|
||||||
import { GeminiPrivacyNotice } from './GeminiPrivacyNotice.js';
|
import { GeminiPrivacyNotice } from './GeminiPrivacyNotice.js';
|
||||||
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
|
||||||
import { CloudFreePrivacyNotice } from './CloudFreePrivacyNotice.js';
|
import { CloudFreePrivacyNotice } from './CloudFreePrivacyNotice.js';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import {
|
import {
|
||||||
ToolCallConfirmationDetails,
|
ToolCallConfirmationDetails,
|
||||||
ToolResultDisplay,
|
ToolResultDisplay,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
// Only defining the state enum needed by the UI
|
// Only defining the state enum needed by the UI
|
||||||
export enum StreamingState {
|
export enum StreamingState {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
UserTierId,
|
UserTierId,
|
||||||
DEFAULT_GEMINI_FLASH_MODEL,
|
DEFAULT_GEMINI_FLASH_MODEL,
|
||||||
isProQuotaExceededError,
|
isProQuotaExceededError,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
describe('parseAndFormatApiError', () => {
|
describe('parseAndFormatApiError', () => {
|
||||||
const _enterpriseMessage =
|
const _enterpriseMessage =
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
isGenericQuotaExceededError,
|
isGenericQuotaExceededError,
|
||||||
isApiError,
|
isApiError,
|
||||||
isStructuredError,
|
isStructuredError,
|
||||||
} from '@qwen/qwen-code-core';
|
} from '@qwen-code/qwen-code-core';
|
||||||
// Free Tier message functions
|
// Free Tier message functions
|
||||||
const getRateLimitErrorMessageGoogleFree = (
|
const getRateLimitErrorMessageGoogleFree = (
|
||||||
fallbackModel: string = DEFAULT_GEMINI_FLASH_MODEL,
|
fallbackModel: string = DEFAULT_GEMINI_FLASH_MODEL,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { getProjectTempDir } from '@qwen/qwen-code-core';
|
import { getProjectTempDir } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const cleanupFunctions: Array<() => void> = [];
|
const cleanupFunctions: Array<() => void> = [];
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
SETTINGS_DIRECTORY_NAME,
|
SETTINGS_DIRECTORY_NAME,
|
||||||
} from '../config/settings.js';
|
} from '../config/settings.js';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'util';
|
||||||
import { SandboxConfig } from '@qwen/qwen-code-core';
|
import { SandboxConfig } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const execAsync = promisify(exec);
|
const execAsync = promisify(exec);
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||||
import { getStartupWarnings } from './startupWarnings.js';
|
import { getStartupWarnings } from './startupWarnings.js';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import { getErrorMessage } from '@qwen/qwen-code-core';
|
import { getErrorMessage } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
vi.mock('fs/promises');
|
vi.mock('fs/promises');
|
||||||
vi.mock('@qwen/qwen-code-core', async (importOriginal) => {
|
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||||
const actual = await importOriginal();
|
const actual = await importOriginal();
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import { join as pathJoin } from 'node:path';
|
import { join as pathJoin } from 'node:path';
|
||||||
import { getErrorMessage } from '@qwen/qwen-code-core';
|
import { getErrorMessage } from '@qwen-code/qwen-code-core';
|
||||||
|
|
||||||
const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warnings.txt');
|
const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warnings.txt');
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@google/gemini-cli-core",
|
"name": "@google/gemini-cli-core",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@google/gemini-cli-core",
|
"name": "@google/gemini-cli-core",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^1.4.0",
|
"@google/genai": "^1.4.0",
|
||||||
"@modelcontextprotocol/sdk": "^1.11.0",
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@qwen/qwen-code-core",
|
"name": "@qwen-code/qwen-code-core",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"description": "Qwen Code Core",
|
"description": "Qwen Code Core",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "qwen-code-vscode",
|
"name": "qwen-code-vscode",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "qwen-code-vscode",
|
"name": "qwen-code-vscode",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.15.1",
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "@qwen/qwen-code-vscode-ide-companion",
|
"name": "@qwen-code/qwen-code-vscode-ide-companion",
|
||||||
"displayName": "Qwen Code VSCode IDE Companion",
|
"displayName": "Qwen Code VSCode IDE Companion",
|
||||||
"description": "",
|
"description": "",
|
||||||
"version": "0.0.1-dev1",
|
"version": "0.0.1-alpha.7",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.101.0"
|
"vscode": "^1.101.0"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue