@oh-my-tool/cli 0.3.3 → 0.3.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-tool/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Oh My Tool CLI - local and enterprise tools for agents",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.7.0",
|
|
31
31
|
"@modelcontextprotocol/client": "2.0.0",
|
|
32
|
-
"@oh-my-tool/sdk": "0.3.
|
|
32
|
+
"@oh-my-tool/sdk": "0.3.4",
|
|
33
33
|
"open": "11.0.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
package/src/cli/context.ts
CHANGED
|
@@ -24,8 +24,13 @@ export async function createRuntime(options: RuntimeOptions = {}) {
|
|
|
24
24
|
const secrets = new SecretsManager();
|
|
25
25
|
const extensionConnections = sanitizeExtensionConnections(config);
|
|
26
26
|
const nativeProvider = new NativeExtensionProvider(paths);
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const nativeTargetExtension = options.targetTool === undefined
|
|
28
|
+
? undefined
|
|
29
|
+
: nativeProvider.extensionForTool(options.targetTool);
|
|
30
|
+
if (nativeTargetExtension !== undefined) {
|
|
31
|
+
validateConfiguredConnections(config, nativeProvider.installedExtensions(), nativeTargetExtension);
|
|
32
|
+
}
|
|
33
|
+
const nativeTarget = nativeTargetExtension !== undefined;
|
|
29
34
|
const mcpProviders = options.includeMcp === false || nativeTarget ? [] : Object.entries(config.mcp.servers)
|
|
30
35
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
31
36
|
.filter((entry): entry is [string, McpEnabledServerConfig] => entry[1].enabled)
|
package/src/config/config.ts
CHANGED
|
@@ -213,9 +213,11 @@ export function sanitizeExtensionConnections(cfg: Config): Record<string, Record
|
|
|
213
213
|
export function validateConfiguredConnections(
|
|
214
214
|
cfg: Config,
|
|
215
215
|
installedExtensions: readonly InstalledExtension[],
|
|
216
|
+
targetExtensionId?: string,
|
|
216
217
|
): void {
|
|
217
218
|
const manifests = new Map(installedExtensions.map((extension) => [extension.id, extension.manifest]));
|
|
218
219
|
for (const [extensionId, extension] of Object.entries(cfg.extensions)) {
|
|
220
|
+
if (targetExtensionId !== undefined && targetExtensionId !== extensionId) continue;
|
|
219
221
|
const schema = manifests.get(extensionId)?.connectionSchema;
|
|
220
222
|
if (schema === undefined) continue;
|
|
221
223
|
for (const [name, connection] of Object.entries(extension.connections)) {
|
|
@@ -64,6 +64,10 @@ export class NativeExtensionProvider implements ToolProvider {
|
|
|
64
64
|
return this.getSnapshot().extensions;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
extensionForTool(toolId: string): string | undefined {
|
|
68
|
+
return this.getSnapshot().routes.get(toolId)?.manifest.id;
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
private getSnapshot(): { extensions: InstalledExtension[]; routes: Map<string, InstalledExtension> } {
|
|
68
72
|
if (this.snapshot) return this.snapshot;
|
|
69
73
|
const extensions = this.discover(this.home());
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.3.
|
|
1
|
+
export const VERSION = "0.3.4";
|