oh-my-opencode 3.1.5 → 3.1.7
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/dist/agents/utils.d.ts +1 -1
- package/dist/cli/doctor/checks/index.d.ts +1 -0
- package/dist/cli/doctor/checks/mcp-oauth.d.ts +15 -0
- package/dist/cli/doctor/checks/mcp-oauth.test.d.ts +1 -0
- package/dist/cli/doctor/constants.d.ts +1 -0
- package/dist/cli/index.js +699 -8
- package/dist/cli/mcp-oauth/index.d.ts +6 -0
- package/dist/cli/mcp-oauth/index.test.d.ts +1 -0
- package/dist/cli/mcp-oauth/login.d.ts +6 -0
- package/dist/cli/mcp-oauth/login.test.d.ts +1 -0
- package/dist/cli/mcp-oauth/logout.d.ts +4 -0
- package/dist/cli/mcp-oauth/logout.test.d.ts +1 -0
- package/dist/cli/mcp-oauth/status.d.ts +1 -0
- package/dist/cli/mcp-oauth/status.test.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/types.d.ts +4 -0
- package/dist/features/hook-message-injector/injector.d.ts +1 -0
- package/dist/features/hook-message-injector/types.d.ts +2 -0
- package/dist/features/mcp-oauth/callback-server.d.ts +11 -0
- package/dist/features/mcp-oauth/callback-server.test.d.ts +1 -0
- package/dist/features/mcp-oauth/dcr.d.ts +34 -0
- package/dist/features/mcp-oauth/dcr.test.d.ts +1 -0
- package/dist/features/mcp-oauth/discovery.d.ts +8 -0
- package/dist/features/mcp-oauth/discovery.test.d.ts +1 -0
- package/dist/features/mcp-oauth/index.d.ts +1 -0
- package/dist/features/mcp-oauth/provider.d.ts +41 -0
- package/dist/features/mcp-oauth/provider.test.d.ts +1 -0
- package/dist/features/mcp-oauth/resource-indicator.d.ts +2 -0
- package/dist/features/mcp-oauth/resource-indicator.test.d.ts +1 -0
- package/dist/features/mcp-oauth/schema.d.ts +6 -0
- package/dist/features/mcp-oauth/schema.test.d.ts +1 -0
- package/dist/features/mcp-oauth/step-up.d.ts +8 -0
- package/dist/features/mcp-oauth/step-up.test.d.ts +1 -0
- package/dist/features/mcp-oauth/storage.d.ts +17 -0
- package/dist/features/mcp-oauth/storage.test.d.ts +1 -0
- package/dist/features/skill-mcp-manager/manager.d.ts +8 -0
- package/dist/hooks/interactive-bash-session/index.d.ts +1 -1
- package/dist/index.js +4182 -279
- package/dist/shared/model-resolver.d.ts +1 -0
- package/dist/tools/lsp/client.d.ts +4 -11
- package/package.json +9 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function status(serverName: string | undefined): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -33,11 +33,13 @@ export declare class BackgroundManager {
|
|
|
33
33
|
private config?;
|
|
34
34
|
private tmuxEnabled;
|
|
35
35
|
private onSubagentSessionCreated?;
|
|
36
|
+
private onShutdown?;
|
|
36
37
|
private queuesByKey;
|
|
37
38
|
private processingKeys;
|
|
38
39
|
constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
|
|
39
40
|
tmuxConfig?: TmuxConfig;
|
|
40
41
|
onSubagentSessionCreated?: OnSubagentSessionCreated;
|
|
42
|
+
onShutdown?: () => void;
|
|
41
43
|
});
|
|
42
44
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
43
45
|
private processKey;
|
|
@@ -11,6 +11,7 @@ export interface MessageMeta {
|
|
|
11
11
|
model?: {
|
|
12
12
|
providerID: string;
|
|
13
13
|
modelID: string;
|
|
14
|
+
variant?: string;
|
|
14
15
|
};
|
|
15
16
|
path?: {
|
|
16
17
|
cwd: string;
|
|
@@ -23,6 +24,7 @@ export interface OriginalMessageContext {
|
|
|
23
24
|
model?: {
|
|
24
25
|
providerID?: string;
|
|
25
26
|
modelID?: string;
|
|
27
|
+
variant?: string;
|
|
26
28
|
};
|
|
27
29
|
path?: {
|
|
28
30
|
cwd?: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type OAuthCallbackResult = {
|
|
2
|
+
code: string;
|
|
3
|
+
state: string;
|
|
4
|
+
};
|
|
5
|
+
export type CallbackServer = {
|
|
6
|
+
port: number;
|
|
7
|
+
waitForCallback: () => Promise<OAuthCallbackResult>;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function findAvailablePort(startPort?: number): Promise<number>;
|
|
11
|
+
export declare function startCallbackServer(startPort?: number): Promise<CallbackServer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type ClientRegistrationRequest = {
|
|
2
|
+
redirect_uris: string[];
|
|
3
|
+
client_name: string;
|
|
4
|
+
grant_types: ["authorization_code", "refresh_token"];
|
|
5
|
+
response_types: ["code"];
|
|
6
|
+
token_endpoint_auth_method: "none" | "client_secret_post";
|
|
7
|
+
};
|
|
8
|
+
export type ClientCredentials = {
|
|
9
|
+
clientId: string;
|
|
10
|
+
clientSecret?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ClientRegistrationStorage = {
|
|
13
|
+
getClientRegistration: (serverIdentifier: string) => ClientCredentials | null;
|
|
14
|
+
setClientRegistration: (serverIdentifier: string, credentials: ClientCredentials) => void;
|
|
15
|
+
};
|
|
16
|
+
export type DynamicClientRegistrationOptions = {
|
|
17
|
+
registrationEndpoint?: string | null;
|
|
18
|
+
serverIdentifier?: string;
|
|
19
|
+
clientName: string;
|
|
20
|
+
redirectUris: string[];
|
|
21
|
+
tokenEndpointAuthMethod: "none" | "client_secret_post";
|
|
22
|
+
clientId?: string | null;
|
|
23
|
+
storage: ClientRegistrationStorage;
|
|
24
|
+
fetch?: DcrFetch;
|
|
25
|
+
};
|
|
26
|
+
export type DcrFetch = (input: string, init?: {
|
|
27
|
+
method?: string;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
body?: string;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
ok: boolean;
|
|
32
|
+
json: () => Promise<unknown>;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function getOrRegisterClient(options: DynamicClientRegistrationOptions): Promise<ClientCredentials | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface OAuthServerMetadata {
|
|
2
|
+
authorizationEndpoint: string;
|
|
3
|
+
tokenEndpoint: string;
|
|
4
|
+
registrationEndpoint?: string;
|
|
5
|
+
resource: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function discoverOAuthServerMetadata(resource: string): Promise<OAuthServerMetadata>;
|
|
8
|
+
export declare function resetDiscoveryCache(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./schema";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { OAuthTokenData } from "./storage";
|
|
2
|
+
import type { OAuthServerMetadata } from "./discovery";
|
|
3
|
+
import type { ClientCredentials } from "./dcr";
|
|
4
|
+
export type McpOAuthProviderOptions = {
|
|
5
|
+
serverUrl: string;
|
|
6
|
+
clientId?: string;
|
|
7
|
+
scopes?: string[];
|
|
8
|
+
};
|
|
9
|
+
type CallbackResult = {
|
|
10
|
+
code: string;
|
|
11
|
+
state: string;
|
|
12
|
+
};
|
|
13
|
+
declare function generateCodeVerifier(): string;
|
|
14
|
+
declare function generateCodeChallenge(verifier: string): string;
|
|
15
|
+
declare function buildAuthorizationUrl(authorizationEndpoint: string, options: {
|
|
16
|
+
clientId: string;
|
|
17
|
+
redirectUri: string;
|
|
18
|
+
codeChallenge: string;
|
|
19
|
+
state: string;
|
|
20
|
+
scopes?: string[];
|
|
21
|
+
resource?: string;
|
|
22
|
+
}): string;
|
|
23
|
+
declare function startCallbackServer(port: number): Promise<CallbackResult>;
|
|
24
|
+
export declare class McpOAuthProvider {
|
|
25
|
+
private readonly serverUrl;
|
|
26
|
+
private readonly configClientId;
|
|
27
|
+
private readonly scopes;
|
|
28
|
+
private storedCodeVerifier;
|
|
29
|
+
private storedClientInfo;
|
|
30
|
+
private callbackPort;
|
|
31
|
+
constructor(options: McpOAuthProviderOptions);
|
|
32
|
+
tokens(): OAuthTokenData | null;
|
|
33
|
+
saveTokens(tokenData: OAuthTokenData): boolean;
|
|
34
|
+
clientInformation(): ClientCredentials | null;
|
|
35
|
+
redirectUrl(): string;
|
|
36
|
+
saveCodeVerifier(verifier: string): void;
|
|
37
|
+
codeVerifier(): string | null;
|
|
38
|
+
redirectToAuthorization(metadata: OAuthServerMetadata): Promise<CallbackResult>;
|
|
39
|
+
login(): Promise<OAuthTokenData>;
|
|
40
|
+
}
|
|
41
|
+
export { generateCodeVerifier, generateCodeChallenge, buildAuthorizationUrl, startCallbackServer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface StepUpInfo {
|
|
2
|
+
requiredScopes: string[];
|
|
3
|
+
error?: string;
|
|
4
|
+
errorDescription?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseWwwAuthenticate(header: string): StepUpInfo | null;
|
|
7
|
+
export declare function mergeScopes(existing: string[], required: string[]): string[];
|
|
8
|
+
export declare function isStepUpRequired(statusCode: number, headers: Record<string, string>): StepUpInfo | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface OAuthTokenData {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
refreshToken?: string;
|
|
4
|
+
expiresAt?: number;
|
|
5
|
+
clientInfo?: {
|
|
6
|
+
clientId: string;
|
|
7
|
+
clientSecret?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
type TokenStore = Record<string, OAuthTokenData>;
|
|
11
|
+
export declare function getMcpOauthStoragePath(): string;
|
|
12
|
+
export declare function loadToken(serverHost: string, resource: string): OAuthTokenData | null;
|
|
13
|
+
export declare function saveToken(serverHost: string, resource: string, token: OAuthTokenData): boolean;
|
|
14
|
+
export declare function deleteToken(serverHost: string, resource: string): boolean;
|
|
15
|
+
export declare function listTokensByHost(serverHost: string): TokenStore;
|
|
16
|
+
export declare function listAllTokens(): TokenStore;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,10 +5,16 @@ import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
|
5
5
|
export declare class SkillMcpManager {
|
|
6
6
|
private clients;
|
|
7
7
|
private pendingConnections;
|
|
8
|
+
private authProviders;
|
|
8
9
|
private cleanupRegistered;
|
|
9
10
|
private cleanupInterval;
|
|
10
11
|
private readonly IDLE_TIMEOUT;
|
|
11
12
|
private getClientKey;
|
|
13
|
+
/**
|
|
14
|
+
* Get or create an McpOAuthProvider for a given server URL + oauth config.
|
|
15
|
+
* Providers are cached by server URL to reuse tokens across reconnections.
|
|
16
|
+
*/
|
|
17
|
+
private getOrCreateAuthProvider;
|
|
12
18
|
private registerProcessCleanup;
|
|
13
19
|
getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
|
|
14
20
|
private createClient;
|
|
@@ -34,6 +40,8 @@ export declare class SkillMcpManager {
|
|
|
34
40
|
readResource(info: SkillMcpClientInfo, context: SkillMcpServerContext, uri: string): Promise<unknown>;
|
|
35
41
|
getPrompt(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, string>): Promise<unknown>;
|
|
36
42
|
private withOperationRetry;
|
|
43
|
+
private handleStepUpIfNeeded;
|
|
44
|
+
private forceReconnect;
|
|
37
45
|
private getOrCreateClientWithRetry;
|
|
38
46
|
getConnectedServers(): string[];
|
|
39
47
|
isConnected(info: SkillMcpClientInfo): boolean;
|
|
@@ -16,7 +16,7 @@ interface EventInput {
|
|
|
16
16
|
properties?: unknown;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export declare function createInteractiveBashSessionHook(
|
|
19
|
+
export declare function createInteractiveBashSessionHook(ctx: PluginInput): {
|
|
20
20
|
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
21
21
|
event: ({ event }: EventInput) => Promise<void>;
|
|
22
22
|
};
|