@oh-my-tool/cli 0.2.0 → 0.3.1
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/README.md +7 -2
- package/assets/skills/oh-my-tool/SKILL.md +11 -3
- package/bin/ohmytool.cjs +0 -0
- package/package.json +20 -11
- package/src/cli/commands/connections.ts +98 -0
- package/src/cli/commands/describe.ts +23 -22
- package/src/cli/commands/extension.ts +24 -24
- package/src/cli/commands/index.ts +8 -6
- package/src/cli/commands/integrate.ts +64 -64
- package/src/cli/commands/mcp.ts +86 -0
- package/src/cli/commands/run.ts +14 -8
- package/src/cli/commands/search.ts +14 -13
- package/src/cli/commands/secret.ts +68 -68
- package/src/cli/context.ts +37 -4
- package/src/cli/index.ts +338 -273
- package/src/cli/output.ts +165 -0
- package/src/cli/parseArgs.ts +64 -44
- package/src/config/config.ts +207 -63
- package/src/core/executor.ts +89 -89
- package/src/core/registry.ts +31 -31
- package/src/core/result.ts +14 -14
- package/src/extension/discovery.ts +61 -61
- package/src/extension/install.ts +23 -23
- package/src/extension/loader.ts +32 -32
- package/src/extension/manifest.ts +114 -114
- package/src/integration/adapters.ts +98 -98
- package/src/integration/index.ts +4 -4
- package/src/integration/manager.ts +375 -375
- package/src/integration/skill.ts +84 -84
- package/src/integration/types.ts +55 -55
- package/src/policy/policy.ts +136 -136
- package/src/runtime/errors.ts +7 -2
- package/src/runtime/executor.ts +6 -1
- package/src/runtime/provider.ts +2 -1
- package/src/runtime/providers/mcp/normalize.ts +36 -0
- package/src/runtime/providers/mcp/oauth-callback.ts +91 -0
- package/src/runtime/providers/mcp/oauth-provider.ts +348 -0
- package/src/runtime/providers/mcp/oauth-store.ts +106 -0
- package/src/runtime/providers/mcp/provider.ts +99 -0
- package/src/runtime/providers/mcp/safe-errors.ts +63 -0
- package/src/runtime/providers/mcp/session.ts +117 -0
- package/src/runtime/providers/mcp/transport.ts +140 -0
- package/src/runtime/providers/native/provider.ts +1 -1
- package/src/runtime/result.ts +1 -1
- package/src/runtime/runtime.ts +38 -12
- package/src/runtime/schema.ts +14 -4
- package/src/search/search.ts +78 -78
- package/src/secrets/secrets.ts +45 -45
- package/src/version.ts +1 -1
package/src/secrets/secrets.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { SecretStore } from "@oh-my-tool/sdk";
|
|
2
|
-
|
|
3
|
-
export const SECRET_SERVICE = "oh-my-tool";
|
|
4
|
-
|
|
5
|
-
export function memoryStore(init: Record<string, string> = {}): SecretStore {
|
|
6
|
-
const data = new Map(Object.entries(init));
|
|
7
|
-
return {
|
|
8
|
-
async get(name) {
|
|
9
|
-
return data.get(name);
|
|
10
|
-
},
|
|
11
|
-
async set(name, value) {
|
|
12
|
-
data.set(name, value);
|
|
13
|
-
},
|
|
14
|
-
async delete(name) {
|
|
15
|
-
data.delete(name);
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const bunStore: SecretStore = {
|
|
21
|
-
async get(name) {
|
|
22
|
-
const v = await Bun.secrets.get({ service: SECRET_SERVICE, name });
|
|
23
|
-
return v ?? undefined;
|
|
24
|
-
},
|
|
25
|
-
async set(name, value) {
|
|
26
|
-
await Bun.secrets.set({ service: SECRET_SERVICE, name, value });
|
|
27
|
-
},
|
|
28
|
-
async delete(name) {
|
|
29
|
-
await Bun.secrets.delete({ service: SECRET_SERVICE, name });
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export class SecretsManager {
|
|
34
|
-
constructor(private store: SecretStore = bunStore) {}
|
|
35
|
-
|
|
36
|
-
get(name: string): Promise<string | undefined> {
|
|
37
|
-
return this.store.get(name);
|
|
38
|
-
}
|
|
39
|
-
set(name: string, value: string): Promise<void> {
|
|
40
|
-
return this.store.set(name, value);
|
|
41
|
-
}
|
|
42
|
-
delete(name: string): Promise<void> {
|
|
43
|
-
return this.store.delete(name);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
import type { SecretStore } from "@oh-my-tool/sdk";
|
|
2
|
+
|
|
3
|
+
export const SECRET_SERVICE = "oh-my-tool";
|
|
4
|
+
|
|
5
|
+
export function memoryStore(init: Record<string, string> = {}): SecretStore {
|
|
6
|
+
const data = new Map(Object.entries(init));
|
|
7
|
+
return {
|
|
8
|
+
async get(name) {
|
|
9
|
+
return data.get(name);
|
|
10
|
+
},
|
|
11
|
+
async set(name, value) {
|
|
12
|
+
data.set(name, value);
|
|
13
|
+
},
|
|
14
|
+
async delete(name) {
|
|
15
|
+
data.delete(name);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const bunStore: SecretStore = {
|
|
21
|
+
async get(name) {
|
|
22
|
+
const v = await Bun.secrets.get({ service: SECRET_SERVICE, name });
|
|
23
|
+
return v ?? undefined;
|
|
24
|
+
},
|
|
25
|
+
async set(name, value) {
|
|
26
|
+
await Bun.secrets.set({ service: SECRET_SERVICE, name, value });
|
|
27
|
+
},
|
|
28
|
+
async delete(name) {
|
|
29
|
+
await Bun.secrets.delete({ service: SECRET_SERVICE, name });
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export class SecretsManager {
|
|
34
|
+
constructor(private store: SecretStore = bunStore) {}
|
|
35
|
+
|
|
36
|
+
get(name: string): Promise<string | undefined> {
|
|
37
|
+
return this.store.get(name);
|
|
38
|
+
}
|
|
39
|
+
set(name: string, value: string): Promise<void> {
|
|
40
|
+
return this.store.set(name, value);
|
|
41
|
+
}
|
|
42
|
+
delete(name: string): Promise<void> {
|
|
43
|
+
return this.store.delete(name);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.3.1";
|