mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-04 05:51:03 +00:00
* feat(vscode): migrate extension to Node SDK * fix(vscode): address CI failures * fix(vis): handle token count records * fix(vscode): keep chat toolbar and header readable at narrow widths * fix(vscode): map yolo to core yolo permission and honor the global yolo setting * docs(vscode): record Node SDK migration design * docs(vscode): split breaking changes out of the 0.6.0 changelog * fix(vscode): keep a resumed session's thinking effort instead of reapplying the default * fix(vscode): announce session status when a view attaches so the display matches it * fix(vscode): align webview thinking effort handling with the TUI
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import { createRequire } from 'node:module';
|
|
import { resolve } from 'node:path';
|
|
|
|
import { defineConfig } from 'tsdown';
|
|
|
|
import { rawTextPlugin } from '../../build/raw-text-plugin.mjs';
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const pkg = require('./package.json') as { version: string };
|
|
const root = import.meta.dirname;
|
|
|
|
export default defineConfig({
|
|
entry: ['./src/extension.ts'],
|
|
format: ['esm'],
|
|
target: 'node20',
|
|
outDir: 'dist',
|
|
clean: true,
|
|
dts: false,
|
|
sourcemap: false,
|
|
plugins: [rawTextPlugin()],
|
|
alias: {
|
|
'@moonshot-ai/kimi-code-sdk': resolve(root, '../../packages/node-sdk/src/index.ts'),
|
|
'@moonshot-ai/migration-legacy': resolve(root, '../../packages/migration-legacy/src/index.ts'),
|
|
'@moonshot-ai/agent-core': resolve(root, '../../packages/agent-core/src/index.ts'),
|
|
'@moonshot-ai/kaos': resolve(root, '../../packages/kaos/src/index.ts'),
|
|
'@moonshot-ai/kimi-code-oauth': resolve(root, '../../packages/oauth/src/index.ts'),
|
|
'@moonshot-ai/kosong': resolve(root, '../../packages/kosong/src/index.ts'),
|
|
},
|
|
define: {
|
|
__EXTENSION_VERSION__: JSON.stringify(pkg.version),
|
|
},
|
|
banner: {
|
|
js: [
|
|
"import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';",
|
|
"import { dirname as __cjsShimDirname } from 'node:path';",
|
|
'const __filename = __cjsShimFileURLToPath(import.meta.url);',
|
|
'const __dirname = __cjsShimDirname(__filename);',
|
|
].join('\n'),
|
|
},
|
|
deps: {
|
|
onlyBundle: false,
|
|
alwaysBundle: [/^@moonshot-ai\//, 'zod'],
|
|
neverBundle: ['vscode'],
|
|
},
|
|
outputOptions: {
|
|
entryFileNames: 'extension.js',
|
|
},
|
|
});
|