@wengine-ai/claude-code-router-shared 2.0.26 → 2.3.235
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/LICENSE +21 -0
- package/dist/__tests__/auto-compact-state.test.d.ts +1 -0
- package/dist/__tests__/pi-models.test.d.ts +1 -0
- package/dist/client-integrations.d.ts +219 -0
- package/dist/constants.d.ts +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -14
- package/dist/projectConfig.d.ts +111 -0
- package/package.json +9 -3
- package/src/constants.ts +0 -32
- package/src/index.ts +0 -12
- package/src/preset/export.ts +0 -115
- package/src/preset/install.ts +0 -416
- package/src/preset/marketplace.ts +0 -56
- package/src/preset/merge.ts +0 -229
- package/src/preset/readPreset.ts +0 -30
- package/src/preset/schema.ts +0 -720
- package/src/preset/sensitiveFields.ts +0 -227
- package/src/preset/types.ts +0 -267
- package/tsconfig.json +0 -9
package/src/preset/readPreset.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read preset configuration file
|
|
3
|
-
* Used by CLI to quickly read preset configuration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as fs from 'fs/promises';
|
|
7
|
-
import * as path from 'path';
|
|
8
|
-
import JSON5 from 'json5';
|
|
9
|
-
import { getPresetDir } from './install';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Read preset configuration file
|
|
13
|
-
* @param name Preset name
|
|
14
|
-
* @returns Preset configuration object, or null if file does not exist
|
|
15
|
-
*/
|
|
16
|
-
export async function readPresetFile(name: string): Promise<any | null> {
|
|
17
|
-
try {
|
|
18
|
-
const presetDir = getPresetDir(name);
|
|
19
|
-
const manifestPath = path.join(presetDir, 'manifest.json');
|
|
20
|
-
const manifest = JSON5.parse(await fs.readFile(manifestPath, 'utf-8'));
|
|
21
|
-
// manifest is already a flat structure, return directly
|
|
22
|
-
return manifest;
|
|
23
|
-
} catch (error: any) {
|
|
24
|
-
if (error.code === 'ENOENT') {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
console.error(`Failed to read preset file: ${error.message}`);
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
}
|