|
1 | 1 | import { existsSync, readFileSync, readdirSync } from "node:fs"; |
2 | | -import { join, resolve } from "node:path"; |
| 2 | +import { join, posix, resolve } from "node:path"; |
3 | 3 |
|
4 | 4 | export const EXTENSION_PACKAGE_BOUNDARY_BASE_CONFIG = |
5 | 5 | "extensions/tsconfig.package-boundary.base.json" as const; |
@@ -66,6 +66,35 @@ export const EXTENSION_PACKAGE_BOUNDARY_BASE_PATHS = { |
66 | 66 | "@openclaw/plugin-sdk/*": ["../packages/plugin-sdk/dist/src/plugin-sdk/*.d.ts"], |
67 | 67 | } as const; |
68 | 68 |
|
| 69 | +function prefixExtensionPackageBoundaryPaths( |
| 70 | + paths: Record<string, readonly string[]>, |
| 71 | + prefix: string, |
| 72 | +): Record<string, readonly string[]> { |
| 73 | + return Object.fromEntries( |
| 74 | + Object.entries(paths).map(([key, values]) => [ |
| 75 | + key, |
| 76 | + values.map((value) => posix.join(prefix, value)), |
| 77 | + ]), |
| 78 | + ); |
| 79 | +} |
| 80 | + |
| 81 | +export const EXTENSION_PACKAGE_BOUNDARY_XAI_PATHS = { |
| 82 | + ...prefixExtensionPackageBoundaryPaths(EXTENSION_PACKAGE_BOUNDARY_BASE_PATHS, "../"), |
| 83 | + "openclaw/plugin-sdk/cli-runtime": [ |
| 84 | + "../../packages/plugin-sdk/dist/src/plugin-sdk/cli-runtime.d.ts", |
| 85 | + ], |
| 86 | + "openclaw/plugin-sdk/provider-env-vars": [ |
| 87 | + "../../packages/plugin-sdk/dist/src/plugin-sdk/provider-env-vars.d.ts", |
| 88 | + ], |
| 89 | + "@openclaw/*.js": ["../../packages/plugin-sdk/dist/extensions/*.d.ts", "../*"], |
| 90 | + "@openclaw/*": ["../*"], |
| 91 | + "@openclaw/plugin-sdk/*": ["../../packages/plugin-sdk/dist/src/plugin-sdk/*.d.ts"], |
| 92 | + "@openclaw/anthropic-vertex/api.js": ["./.boundary-stubs/anthropic-vertex-api.d.ts"], |
| 93 | + "@openclaw/ollama/api.js": ["./.boundary-stubs/ollama-api.d.ts"], |
| 94 | + "@openclaw/ollama/runtime-api.js": ["./.boundary-stubs/ollama-runtime-api.d.ts"], |
| 95 | + "@openclaw/speech-core/runtime-api.js": ["./.boundary-stubs/speech-core-runtime-api.d.ts"], |
| 96 | +} as const; |
| 97 | + |
69 | 98 | export type ExtensionPackageBoundaryTsConfigJson = { |
70 | 99 | extends?: unknown; |
71 | 100 | compilerOptions?: { |
|
0 commit comments