shortcutxl 0.3.40 → 0.3.42
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/CHANGELOG.md +5 -0
- package/dist/app/auth/auth-storage.d.ts +27 -11
- package/dist/app/auth/mcp-oauth-state.d.ts +44 -0
- package/dist/app/auth/oauth-callback-server.d.ts +7 -0
- package/dist/app/connectors/secret-store.d.ts +6 -0
- package/dist/app/index.d.ts +4 -1
- package/dist/app/mcp/auth-status.d.ts +4 -0
- package/dist/app/mcp/catalog.d.ts +8 -5
- package/dist/app/mcp/config.d.ts +1 -1
- package/dist/app/mcp/connection.d.ts +12 -9
- package/dist/app/mcp/hosted-oauth-id.d.ts +5 -0
- package/dist/app/mcp/hosted-oauth-provider.d.ts +11 -0
- package/dist/app/mcp/index.d.ts +5 -13
- package/dist/app/mcp/managed-oauth-providers.d.ts +4 -0
- package/dist/app/mcp/oauth-discovery.d.ts +16 -0
- package/dist/app/mcp/oauth-state-store.d.ts +49 -0
- package/dist/app/mcp/types.d.ts +43 -2
- package/dist/app/modes/action/prompt.d.ts +18 -0
- package/dist/app/permissions/tool-gates.d.ts +1 -1
- package/dist/app/prompts/mog-api-reference.json +12080 -11454
- package/dist/app/providers/model-registry.d.ts +1 -0
- package/dist/app/sdk.d.ts +1 -1
- package/dist/app/session/tool-registry.d.ts +1 -0
- package/dist/app/settings-manager.d.ts +8 -0
- package/dist/cli.js +1209 -1260
- package/dist/cloud/bridge-tool-catalog.d.ts +2 -2
- package/dist/cloud/cloud-shell-adapter.d.ts +1 -3
- package/dist/cloud/index.d.ts +1 -1
- package/dist/cloud/local-bridge-tools.d.ts +1 -2
- package/dist/cloud/observability/index.d.ts +0 -1
- package/dist/config.d.ts +1 -0
- package/dist/main.d.ts +2 -2
- package/dist/server/server-types.d.ts +1 -1
- package/dist/server-sse-only/server-types.d.ts +1 -1
- package/dist/shared/logging/langfuse-trace-context.d.ts +1 -0
- package/dist/shell/approvals/tool-approval.d.ts +2 -6
- package/dist/shell/commands/mcp-command.d.ts +3 -1
- package/dist/shell/commands/mcp-settings-command.d.ts +4 -0
- package/dist/shell/components/selectors/extension-selector.d.ts +1 -0
- package/dist/shell/components/selectors/login-dialog.d.ts +2 -6
- package/dist/shell/interactive/auth-workflow.d.ts +1 -1
- package/dist/shell/interactive/interactive-mode.d.ts +2 -1
- package/dist/startup/interactive-commands.d.ts +6 -4
- package/dist/tui/autocomplete.js +616 -616
- package/dist/tui/components/editor.js +1733 -1733
- package/dist/tui/skill-autocomplete.js +30 -30
- package/package.json +1 -1
- package/skills/advanced-com-api/SKILL.md +1 -1
- package/skills/advanced-mog-api/SKILL.md +1 -1
- package/skills/external-services/SKILL.md +1 -1
- package/skills/integrations/SKILL.md +1 -1
- package/skills/loop/SKILL.md +1 -1
- package/skills/mcp/SKILL.md +107 -10
- package/skills/skill-creator/SKILL.md +1 -1
- package/skills/web-crawling/SKILL.md +1 -1
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/pip-26.0.1.dist-info/RECORD +3 -3
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.12.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
- package/dist/app/excel-config.d.ts +0 -22
- package/dist/app/excel-session.d.ts +0 -27
- package/dist/app/extensions/index.impl.d.ts +0 -10
- package/dist/app/new-sheet/sheet-exec.d.ts +0 -36
- package/dist/app/session/session-retry.d.ts +0 -81
- package/dist/app/tools/excel-code-analyzer.d.ts +0 -30
- package/dist/app/tools/excel-diff.d.ts +0 -21
- package/dist/app/tools/excel-exec.d.ts +0 -25
- package/dist/cloud/observability/client-logging/client-logger.d.ts +0 -57
- package/dist/cloud/observability/client-logging/context.d.ts +0 -26
- package/dist/cloud/observability/client-logging/index.d.ts +0 -8
- package/dist/cloud/observability/client-logging/session-events.d.ts +0 -4
- package/dist/cloud/observability/client-logging/settings-events.d.ts +0 -5
- package/dist/cloud/observability/client-logging/startup-events.d.ts +0 -7
- package/dist/cloud/observability/client-logging/transport.d.ts +0 -15
- package/dist/cloud/observability/client-logging/types.d.ts +0 -31
- package/dist/shell/export-html/index.impl.d.ts +0 -35
- package/xll/python/vcruntime140.dll +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.41]
|
|
4
|
+
|
|
5
|
+
- **Hosted MCP OAuth** — ShortcutXL now supports OAuth-authenticated hosted MCP servers. Configure a hosted MCP in `mcp.json`, then log in from `/mcp` or `/login`, see `login required` status when auth is missing, and log out again directly from the MCP menu.
|
|
6
|
+
- **Agent context cleanup** — Simplified agent context and prompt behavior for cleaner single-turn and multi-turn execution.
|
|
7
|
+
|
|
3
8
|
## [0.3.40]
|
|
4
9
|
|
|
5
10
|
- **Runtime permissions** — New `/permissions` command to review and change what file and shell tools can do. Approve individual workspaces, grant narrower read or read/write exceptions to files and folders outside them, and toggle spreadsheet auto-approve per settings profile.
|
|
@@ -15,6 +15,23 @@ type LockResult<T> = {
|
|
|
15
15
|
result: T;
|
|
16
16
|
next?: string;
|
|
17
17
|
};
|
|
18
|
+
export interface AuthStorageOptions {
|
|
19
|
+
authPath?: string;
|
|
20
|
+
externalCredentialStores?: ExternalAuthCredentialStore[];
|
|
21
|
+
}
|
|
22
|
+
export interface ExternalAuthCredentialStore {
|
|
23
|
+
owns(provider: string): boolean;
|
|
24
|
+
reload(): void;
|
|
25
|
+
listProviders(): string[];
|
|
26
|
+
has(provider: string): boolean;
|
|
27
|
+
get(provider: string): AuthCredential | undefined;
|
|
28
|
+
set(provider: string, credential: AuthCredential): void;
|
|
29
|
+
remove(provider: string): void;
|
|
30
|
+
mutateCredentialWithLock<T>(provider: string, mutate: (credential: AuthCredential | undefined) => Promise<{
|
|
31
|
+
result: T;
|
|
32
|
+
credential?: AuthCredential;
|
|
33
|
+
}>): Promise<T>;
|
|
34
|
+
}
|
|
18
35
|
export interface AuthStorageBackend {
|
|
19
36
|
withLock<T>(fn: (current: string | undefined) => LockResult<T>): T;
|
|
20
37
|
withLockAsync<T>(fn: (current: string | undefined) => Promise<LockResult<T>>): Promise<T>;
|
|
@@ -55,17 +72,18 @@ export declare class AuthStorage {
|
|
|
55
72
|
private loadError;
|
|
56
73
|
private errors;
|
|
57
74
|
private _readOnly;
|
|
75
|
+
private readonly externalCredentialStores;
|
|
58
76
|
private constructor();
|
|
59
|
-
static create(
|
|
60
|
-
static fromStorage(storage: AuthStorageBackend): AuthStorage;
|
|
77
|
+
static create(authPathOrOptions?: string | AuthStorageOptions): AuthStorage;
|
|
78
|
+
static fromStorage(storage: AuthStorageBackend, options?: AuthStorageOptions): AuthStorage;
|
|
61
79
|
/**
|
|
62
80
|
* Create a read-only AuthStorage backed by auth.json.
|
|
63
81
|
* Reads without file locking — safe for concurrent subagents.
|
|
64
82
|
* Never writes or refreshes tokens; call reload() periodically
|
|
65
83
|
* to pick up tokens refreshed by the parent process.
|
|
66
84
|
*/
|
|
67
|
-
static createReadOnly(
|
|
68
|
-
static inMemory(data?: AuthStorageData): AuthStorage;
|
|
85
|
+
static createReadOnly(authPathOrOptions?: string | AuthStorageOptions): AuthStorage;
|
|
86
|
+
static inMemory(data?: AuthStorageData, options?: AuthStorageOptions): AuthStorage;
|
|
69
87
|
/**
|
|
70
88
|
* Set a runtime API key override (not persisted to disk).
|
|
71
89
|
* Used for CLI --api-key flag.
|
|
@@ -80,8 +98,10 @@ export declare class AuthStorage {
|
|
|
80
98
|
* Used for custom provider keys from models.json.
|
|
81
99
|
*/
|
|
82
100
|
setFallbackResolver(resolver: (provider: string) => string | undefined): void;
|
|
83
|
-
private
|
|
101
|
+
private getExternalCredentialStore;
|
|
84
102
|
private parseStorageData;
|
|
103
|
+
private parseStorageDocument;
|
|
104
|
+
private recordError;
|
|
85
105
|
/**
|
|
86
106
|
* Reload credentials from storage.
|
|
87
107
|
*/
|
|
@@ -104,7 +124,7 @@ export declare class AuthStorage {
|
|
|
104
124
|
*/
|
|
105
125
|
list(): string[];
|
|
106
126
|
/**
|
|
107
|
-
* Check if credentials exist for a provider
|
|
127
|
+
* Check if stored credentials exist for a provider.
|
|
108
128
|
*/
|
|
109
129
|
has(provider: string): boolean;
|
|
110
130
|
/**
|
|
@@ -141,15 +161,11 @@ export declare class AuthStorage {
|
|
|
141
161
|
* Get API key for a provider.
|
|
142
162
|
* Priority:
|
|
143
163
|
* 1. Runtime override (CLI --api-key)
|
|
144
|
-
* 2. OAuth token from
|
|
164
|
+
* 2. OAuth token from persisted storage (auto-refreshed with locking)
|
|
145
165
|
* 3. Environment variable
|
|
146
166
|
* 4. Fallback resolver (models.json custom providers)
|
|
147
167
|
*/
|
|
148
168
|
getApiKey(providerId: string): Promise<string | undefined>;
|
|
149
|
-
/**
|
|
150
|
-
* Get all registered OAuth providers
|
|
151
|
-
*/
|
|
152
|
-
getOAuthProviders(): import("@mariozechner/pi-ai").OAuthProviderInterface[];
|
|
153
169
|
}
|
|
154
170
|
export {};
|
|
155
171
|
//# sourceMappingURL=auth-storage.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
2
|
+
import type { AuthCredential, AuthStorageData } from './auth-storage.js';
|
|
3
|
+
export interface OAuthClientInformationRecord {
|
|
4
|
+
clientId: string;
|
|
5
|
+
clientSecret?: string;
|
|
6
|
+
}
|
|
7
|
+
export type OAuthDiscoveryRecord = OAuthDiscoveryState;
|
|
8
|
+
export interface McpOAuthRuntimeSettings {
|
|
9
|
+
credentialsStoreMode?: 'file' | 'keychain' | 'auto';
|
|
10
|
+
callbackPort?: number;
|
|
11
|
+
callbackUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
type OAuthStorageManifest = Record<string, 'keychain'>;
|
|
14
|
+
export interface ParsedMcpOAuthState {
|
|
15
|
+
credentials: AuthStorageData;
|
|
16
|
+
clientInfo: Record<string, OAuthClientInformationRecord>;
|
|
17
|
+
discoveryInfo: Record<string, OAuthDiscoveryRecord>;
|
|
18
|
+
storageManifest: OAuthStorageManifest;
|
|
19
|
+
}
|
|
20
|
+
export interface StoredMcpOAuthPayload {
|
|
21
|
+
credential?: AuthCredential;
|
|
22
|
+
clientInfo?: OAuthClientInformationRecord;
|
|
23
|
+
discoveryInfo?: OAuthDiscoveryRecord;
|
|
24
|
+
}
|
|
25
|
+
export declare class McpOAuthPersistence {
|
|
26
|
+
private readonly isManagedProvider;
|
|
27
|
+
private settings;
|
|
28
|
+
constructor(isManagedProvider?: (provider: string) => boolean);
|
|
29
|
+
configure(settings: McpOAuthRuntimeSettings | undefined): void;
|
|
30
|
+
getSettings(): Required<McpOAuthRuntimeSettings>;
|
|
31
|
+
shouldUseKeychain(provider: string): boolean;
|
|
32
|
+
load(content: string | undefined): ParsedMcpOAuthState;
|
|
33
|
+
loadOrEmpty(content: string | undefined): ParsedMcpOAuthState;
|
|
34
|
+
loadProviderPayload(provider: string): StoredMcpOAuthPayload | undefined;
|
|
35
|
+
getProviderPayload(state: ParsedMcpOAuthState, provider: string): StoredMcpOAuthPayload;
|
|
36
|
+
writeProviderPayload(baseState: ParsedMcpOAuthState, provider: string, nextPayload: StoredMcpOAuthPayload): string;
|
|
37
|
+
private resolveStoreMode;
|
|
38
|
+
private empty;
|
|
39
|
+
private hydrate;
|
|
40
|
+
private parse;
|
|
41
|
+
private serialize;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=mcp-oauth-state.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface OAuthCallbackServer {
|
|
2
|
+
redirectUrl: string;
|
|
3
|
+
waitForCallback(): Promise<string>;
|
|
4
|
+
close(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare function startOAuthCallbackServer(redirectUrl: string | URL, signal?: AbortSignal): Promise<OAuthCallbackServer>;
|
|
7
|
+
//# sourceMappingURL=oauth-callback-server.d.ts.map
|
|
@@ -14,6 +14,12 @@ export declare function setSecret(name: string, payload: Record<string, string>)
|
|
|
14
14
|
export declare function getSecret(name: string): Record<string, string> | undefined;
|
|
15
15
|
/** Remove a secret for a connection. Returns true if it existed. */
|
|
16
16
|
export declare function removeSecret(name: string): boolean;
|
|
17
|
+
/** Store a JSON payload in the OS keychain under a custom service namespace. */
|
|
18
|
+
export declare function setNamespacedSecret(service: string, name: string, payload: object): void;
|
|
19
|
+
/** Retrieve a JSON payload from the OS keychain for a custom service namespace. */
|
|
20
|
+
export declare function getNamespacedSecret<T extends object>(service: string, name: string): T | undefined;
|
|
21
|
+
/** Remove a JSON payload from the OS keychain for a custom service namespace. */
|
|
22
|
+
export declare function removeNamespacedSecret(service: string, name: string): boolean;
|
|
17
23
|
/**
|
|
18
24
|
* Build environment variables for a set of connections.
|
|
19
25
|
* Returns a Record to merge into a subprocess's env.
|
package/dist/app/index.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ export { ExtensionRunner, createExtensionRuntime, discoverAndLoadExtensions, loa
|
|
|
13
13
|
export type { CompactOptions, ContextUsage, Extension, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionError, ExtensionErrorListener, ExtensionFactory, ExtensionHandler, ExtensionRuntime, ExtensionSessionSetupStore, ExtensionSessionView, ExtensionUIContext, ExtensionUIDialogOptions, InputSource, LoadExtensionsResult, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, ResourcesDiscoverResult, RunnerEmitEvent, SessionBeforeSwitchEvent, ShutdownHandler, SlashCommandInfo, SlashCommandLocation, SlashCommandSource, ToolInfo } from './extensions/index.js';
|
|
14
14
|
export { formatFileUploadsContext, mergeFileUploads, sanitizeForPrompt, type FileUploadData } from './file-uploads.js';
|
|
15
15
|
export { LoopManager } from './loop/loop-manager.js';
|
|
16
|
+
export { isHostedMcpOAuthProviderId } from './mcp/hosted-oauth-provider.js';
|
|
16
17
|
export { createMcpManager, type McpManager } from './mcp/index.js';
|
|
18
|
+
export { isManagedMcpOAuthProvider } from './mcp/managed-oauth-providers.js';
|
|
19
|
+
export { McpOAuthStore } from './mcp/oauth-state-store.js';
|
|
17
20
|
export { convertToLlm, createCompactionSummaryMessage, createCustomMessage, type CustomMessage } from './messages.js';
|
|
18
21
|
export { handleNewSheetCommand } from './new-sheet-command.js';
|
|
19
22
|
export { ModelRegistry } from './providers/model-registry.js';
|
|
@@ -32,11 +35,11 @@ export { listAllSessions, listSessions } from './session/session-catalog.js';
|
|
|
32
35
|
export type { SessionInfo, SessionListProgress } from './session/session-catalog.js';
|
|
33
36
|
export { continueRecentSessionManager, createInMemorySessionManager, createSessionManager, forkSessionManager, openSessionManager } from './session/session-factory.js';
|
|
34
37
|
export { SessionManager } from './session/session-manager.js';
|
|
38
|
+
export type { SessionObservability } from './session/session-observability.js';
|
|
35
39
|
export { FileSessionPersistenceBackend } from './session/session-persistence-backend.js';
|
|
36
40
|
export type { SessionPersistenceBackend } from './session/session-persistence-backend.js';
|
|
37
41
|
export type { SessionEntry, SessionHeader, SessionInfoEntry, SessionMessageEntry } from './session/session-schema.js';
|
|
38
42
|
export type { BranchSessionStore, ModelSessionStore, PersistenceSessionStore, ProductSessionStore, SessionInfoStore } from './session/session-store-types.js';
|
|
39
|
-
export type { SessionObservability } from './session/session-observability.js';
|
|
40
43
|
export { SettingsManager, type CompactionSettings, type ImageSettings, type PackageSource, type RetrySettings } from './settings-manager.js';
|
|
41
44
|
export type { StartupInfoEntry } from './startup-info.js';
|
|
42
45
|
export { downloadSkillsWithApproval, syncSkillsConservatively } from './sync/skills-download.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuthStorage } from '../auth/auth-storage.js';
|
|
2
|
+
import { type McpAuthStatus, type McpServerConfig } from './types.js';
|
|
3
|
+
export declare function getMcpAuthStatus(serverName: string, config: McpServerConfig, authStorage?: AuthStorage): Promise<McpAuthStatus>;
|
|
4
|
+
//# sourceMappingURL=auth-status.d.ts.map
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Use mcp_describe(server) to get full tool details.
|
|
9
9
|
*/
|
|
10
|
-
import type { McpConnection } from './types.js';
|
|
10
|
+
import type { McpAuthStatus, McpConnection, McpServerStatus } from './types.js';
|
|
11
11
|
/**
|
|
12
12
|
* Build a compact tool catalog — just server names and tool names.
|
|
13
13
|
* Detailed descriptions are available via mcp_describe.
|
|
@@ -17,8 +17,11 @@ export declare function buildCatalog(connections: McpConnection[]): string;
|
|
|
17
17
|
* Build a detailed tool listing for a single server (used by mcp_describe).
|
|
18
18
|
*/
|
|
19
19
|
export declare function buildServerDetail(connection: McpConnection): string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export declare function buildStatusLine(entries: Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
connected?: McpConnection;
|
|
23
|
+
failure?: string;
|
|
24
|
+
authStatus: McpAuthStatus;
|
|
25
|
+
transport: McpServerStatus['transport'];
|
|
26
|
+
}>): string;
|
|
24
27
|
//# sourceMappingURL=catalog.d.ts.map
|
package/dist/app/mcp/config.d.ts
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP server connection —
|
|
3
|
-
*
|
|
4
|
-
* Uses the official @modelcontextprotocol/sdk for JSON-RPC over stdio.
|
|
2
|
+
* MCP server connection — connect, listTools, callTool, close.
|
|
5
3
|
*/
|
|
6
|
-
import type {
|
|
4
|
+
import type { AuthStorage } from '../auth/auth-storage.js';
|
|
5
|
+
import type { McpOAuthStore } from './oauth-state-store.js';
|
|
6
|
+
import { type McpConnection, type McpFailureKind, type McpRequestPolicy, type McpServerConfig } from './types.js';
|
|
7
|
+
export declare class McpConnectionError extends Error {
|
|
8
|
+
readonly failureKind: McpFailureKind;
|
|
9
|
+
constructor(failureKind: McpFailureKind, message: string);
|
|
10
|
+
}
|
|
7
11
|
export declare function resolveStartupTimeoutMs(config: McpServerConfig): number;
|
|
8
12
|
export declare function buildRequestPolicy(config: McpServerConfig): McpRequestPolicy;
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
11
|
-
* Throws on failure (caller handles per-server error isolation).
|
|
14
|
+
* Connect a server, list tools, and return a live MCP connection.
|
|
12
15
|
*/
|
|
13
|
-
export declare function connectServer(name: string, config: McpServerConfig, defaultCwd: string): Promise<McpConnection>;
|
|
16
|
+
export declare function connectServer(name: string, config: McpServerConfig, defaultCwd: string, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore): Promise<McpConnection>;
|
|
14
17
|
/**
|
|
15
18
|
* Call a tool on a connected server. Returns the result text or throws.
|
|
16
19
|
*/
|
|
17
|
-
export declare function callTool(connection: McpConnection, toolName: string, args: Record<string, unknown> | undefined, signal?: AbortSignal): Promise<{
|
|
20
|
+
export declare function callTool(connection: McpConnection, toolName: string, args: Record<string, unknown> | undefined, signal?: AbortSignal, attemptedReconnect?: boolean): Promise<{
|
|
18
21
|
text: string;
|
|
19
22
|
isError: boolean;
|
|
20
23
|
}>;
|
|
21
24
|
/**
|
|
22
|
-
* Close a connection.
|
|
25
|
+
* Close a connection.
|
|
23
26
|
*/
|
|
24
27
|
export declare function closeConnection(connection: McpConnection): void;
|
|
25
28
|
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpHostedServerConfig } from './types.js';
|
|
2
|
+
export declare const HOSTED_MCP_OAUTH_PROVIDER_PREFIX = "mcp:";
|
|
3
|
+
export declare function getHostedMcpOAuthConfig(config: McpHostedServerConfig): import("./types.js").McpOAuthConfig;
|
|
4
|
+
export declare function getHostedMcpOAuthProviderId(serverName: string, config: McpHostedServerConfig): string;
|
|
5
|
+
//# sourceMappingURL=hosted-oauth-id.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OAuthProviderInterface } from '@mariozechner/pi-ai';
|
|
2
|
+
import { type OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
3
|
+
import type { AuthStorage } from '../auth/auth-storage.js';
|
|
4
|
+
import type { McpOAuthStore } from './oauth-state-store.js';
|
|
5
|
+
import type { McpHostedServerConfig } from './types.js';
|
|
6
|
+
export declare function isHostedMcpOAuthProviderId(providerId: string): boolean;
|
|
7
|
+
export declare function createHostedMcpOAuthProvider(serverName: string, config: McpHostedServerConfig, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore): OAuthProviderInterface;
|
|
8
|
+
export declare function createHostedMcpRuntimeAuthProvider(serverName: string, config: McpHostedServerConfig, authStorage: AuthStorage, mcpOAuthStore: McpOAuthStore): OAuthClientProvider;
|
|
9
|
+
export declare function registerHostedMcpOAuthProviders(servers: Record<string, import('./types.js').McpServerConfig>, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore): string[];
|
|
10
|
+
export declare function unregisterHostedMcpOAuthProviders(providerIds: string[]): void;
|
|
11
|
+
//# sourceMappingURL=hosted-oauth-provider.d.ts.map
|
package/dist/app/mcp/index.d.ts
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP client manager — composition root for the MCP subsystem.
|
|
3
|
-
*
|
|
4
|
-
* createMcpManager():
|
|
5
|
-
* 1. Load config (global + project)
|
|
6
|
-
* 2. Connect all servers concurrently (graceful degradation)
|
|
7
|
-
* 3. Build catalog & gateway tools
|
|
8
|
-
* 4. Return tools + shutdown handle
|
|
9
|
-
*
|
|
10
|
-
* Returns null if no servers are configured or all fail.
|
|
11
3
|
*/
|
|
12
|
-
import type {
|
|
4
|
+
import type { AuthStorage } from '../auth/auth-storage.js';
|
|
5
|
+
import type { McpOAuthStore } from './oauth-state-store.js';
|
|
6
|
+
import { type McpManager } from './types.js';
|
|
13
7
|
export type { McpManager } from './types.js';
|
|
14
8
|
interface CreateMcpManagerOptions {
|
|
15
9
|
cwd: string;
|
|
16
10
|
globalConfigDir: string;
|
|
11
|
+
authStorage?: AuthStorage;
|
|
12
|
+
mcpOAuthStore?: McpOAuthStore;
|
|
17
13
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Create the MCP manager: load config, connect servers, build gateway tools.
|
|
20
|
-
* Returns null if no servers are configured or all connections fail.
|
|
21
|
-
*/
|
|
22
14
|
export declare function createMcpManager(options: CreateMcpManagerOptions): Promise<McpManager | null>;
|
|
23
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function registerManagedMcpOAuthProvider(providerId: string): void;
|
|
2
|
+
export declare function unregisterManagedMcpOAuthProvider(providerId: string): void;
|
|
3
|
+
export declare function isManagedMcpOAuthProvider(providerId: string): boolean;
|
|
4
|
+
//# sourceMappingURL=managed-oauth-providers.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
2
|
+
import type { McpOAuthStore } from './oauth-state-store.js';
|
|
3
|
+
import type { McpHostedServerConfig } from './types.js';
|
|
4
|
+
export interface HostedMcpOAuthResolution {
|
|
5
|
+
discoveryState?: OAuthDiscoveryState;
|
|
6
|
+
resourceMetadataUrl?: URL;
|
|
7
|
+
resource?: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
}
|
|
10
|
+
interface HostedMcpOAuthResolutionOptions {
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveHostedMcpOAuthTimeoutMs(config: McpHostedServerConfig): number;
|
|
14
|
+
export declare function resolveHostedMcpOAuth(serverName: string, config: McpHostedServerConfig, mcpOAuthStore?: McpOAuthStore, options?: HostedMcpOAuthResolutionOptions): Promise<HostedMcpOAuthResolution>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=oauth-discovery.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type AuthCredential, AuthStorageBackend, type ExternalAuthCredentialStore } from '../auth/auth-storage.js';
|
|
2
|
+
import { type McpOAuthRuntimeSettings, type OAuthClientInformationRecord, type OAuthDiscoveryRecord } from '../auth/mcp-oauth-state.js';
|
|
3
|
+
export interface McpOAuthStoreOptions {
|
|
4
|
+
authPath?: string;
|
|
5
|
+
settings?: McpOAuthRuntimeSettings;
|
|
6
|
+
isManagedMcpOAuthProvider?: (provider: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* MCP-owned OAuth protocol state.
|
|
10
|
+
*
|
|
11
|
+
* Owns hosted-MCP credentials, client registration, and discovery metadata
|
|
12
|
+
* using the shared auth backend plus optional keychain storage.
|
|
13
|
+
*/
|
|
14
|
+
export declare class McpOAuthStore implements ExternalAuthCredentialStore {
|
|
15
|
+
private readonly storage;
|
|
16
|
+
private readonly persistence;
|
|
17
|
+
private credentials;
|
|
18
|
+
private clientInfo;
|
|
19
|
+
private discoveryInfo;
|
|
20
|
+
constructor(storage: AuthStorageBackend, options?: Pick<McpOAuthStoreOptions, 'settings' | 'isManagedMcpOAuthProvider'>);
|
|
21
|
+
private readonly isManagedProvider;
|
|
22
|
+
static create(options?: McpOAuthStoreOptions): McpOAuthStore;
|
|
23
|
+
static createReadOnly(options?: McpOAuthStoreOptions): McpOAuthStore;
|
|
24
|
+
static fromStorage(storage: AuthStorageBackend, options?: McpOAuthStoreOptions): McpOAuthStore;
|
|
25
|
+
static inMemory(options?: Pick<McpOAuthStoreOptions, 'settings'>): McpOAuthStore;
|
|
26
|
+
reload(): void;
|
|
27
|
+
getSettings(): Required<McpOAuthRuntimeSettings>;
|
|
28
|
+
setSettings(settings: McpOAuthRuntimeSettings | undefined): void;
|
|
29
|
+
owns(provider: string): boolean;
|
|
30
|
+
listProviders(): string[];
|
|
31
|
+
has(provider: string): boolean;
|
|
32
|
+
get(provider: string): AuthCredential | undefined;
|
|
33
|
+
set(provider: string, credential: AuthCredential): void;
|
|
34
|
+
remove(provider: string): void;
|
|
35
|
+
mutateCredentialWithLock<T>(provider: string, mutate: (credential: AuthCredential | undefined) => Promise<{
|
|
36
|
+
result: T;
|
|
37
|
+
credential?: AuthCredential;
|
|
38
|
+
}>): Promise<T>;
|
|
39
|
+
getClientInfo(provider: string): OAuthClientInformationRecord | undefined;
|
|
40
|
+
setClientInfo(provider: string, info: OAuthClientInformationRecord): void;
|
|
41
|
+
removeClientInfo(provider: string): void;
|
|
42
|
+
getDiscoveryState(provider: string): OAuthDiscoveryRecord | undefined;
|
|
43
|
+
setDiscoveryState(provider: string, info: OAuthDiscoveryRecord): void;
|
|
44
|
+
removeDiscoveryState(provider: string): void;
|
|
45
|
+
clear(provider: string): void;
|
|
46
|
+
private applyState;
|
|
47
|
+
private persistProviderPayload;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=oauth-state-store.d.ts.map
|
package/dist/app/mcp/types.d.ts
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
7
7
|
import type { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
8
|
+
import type { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
8
9
|
export interface McpConfig {
|
|
9
10
|
mcpServers: Record<string, McpServerConfig>;
|
|
10
11
|
}
|
|
11
|
-
export interface
|
|
12
|
+
export interface McpStdioServerConfig {
|
|
12
13
|
/** Command to spawn the server */
|
|
13
14
|
command: string;
|
|
14
15
|
/** Arguments to the command */
|
|
@@ -36,6 +37,40 @@ export interface McpServerConfig {
|
|
|
36
37
|
*/
|
|
37
38
|
maxToolCallTotalTimeoutMs?: number;
|
|
38
39
|
}
|
|
40
|
+
export interface McpOAuthConfig {
|
|
41
|
+
providerId?: string;
|
|
42
|
+
providerName?: string;
|
|
43
|
+
clientId?: string;
|
|
44
|
+
clientSecret?: string;
|
|
45
|
+
redirectUrl?: string;
|
|
46
|
+
scope?: string;
|
|
47
|
+
resource?: string;
|
|
48
|
+
resourceMetadataUrl?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface McpHostedServerConfig {
|
|
51
|
+
transport: 'streamable_http';
|
|
52
|
+
url: string;
|
|
53
|
+
/** Static headers to include on every request. */
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
/** Connection name whose fields are injected as HTTP headers. */
|
|
56
|
+
connection?: string;
|
|
57
|
+
/** OAuth configuration for hosted MCP login via /login. */
|
|
58
|
+
oauth?: McpOAuthConfig;
|
|
59
|
+
/** Deprecated alias for startupTimeoutMs. Kept for config compatibility. */
|
|
60
|
+
timeout?: number;
|
|
61
|
+
/** Startup/connect timeout in ms (default: 30000) */
|
|
62
|
+
startupTimeoutMs?: number;
|
|
63
|
+
/** Per-tool-call inactivity timeout in ms (default: 600000 / 10 minutes) */
|
|
64
|
+
toolCallTimeoutMs?: number;
|
|
65
|
+
resetToolCallTimeoutOnProgress?: boolean;
|
|
66
|
+
maxToolCallTotalTimeoutMs?: number;
|
|
67
|
+
}
|
|
68
|
+
export type McpServerConfig = McpStdioServerConfig | McpHostedServerConfig;
|
|
69
|
+
export type McpAuthStatus = 'unsupported' | 'not_logged_in' | 'configured' | 'oauth';
|
|
70
|
+
export type McpFailureKind = 'auth_required' | 'connect_failed';
|
|
71
|
+
export declare function isHostedServerConfig(config: McpServerConfig): config is McpHostedServerConfig;
|
|
72
|
+
export declare function isStdioServerConfig(config: McpServerConfig): config is McpStdioServerConfig;
|
|
73
|
+
export type McpTransport = StdioClientTransport | StreamableHTTPClientTransport;
|
|
39
74
|
export interface McpRequestPolicy {
|
|
40
75
|
timeoutMs: number;
|
|
41
76
|
resetTimeoutOnProgress: boolean;
|
|
@@ -44,9 +79,10 @@ export interface McpRequestPolicy {
|
|
|
44
79
|
export interface McpConnection {
|
|
45
80
|
name: string;
|
|
46
81
|
client: Client;
|
|
47
|
-
transport:
|
|
82
|
+
transport: McpTransport;
|
|
48
83
|
tools: McpToolInfo[];
|
|
49
84
|
requestPolicy: McpRequestPolicy;
|
|
85
|
+
reconnect?: () => Promise<McpConnection | null>;
|
|
50
86
|
}
|
|
51
87
|
export interface McpToolInfo {
|
|
52
88
|
name: string;
|
|
@@ -57,6 +93,11 @@ export interface McpToolInfo {
|
|
|
57
93
|
export interface McpServerStatus {
|
|
58
94
|
name: string;
|
|
59
95
|
status: 'connected' | 'failed';
|
|
96
|
+
transport: 'stdio' | 'streamable_http';
|
|
97
|
+
authStatus: McpAuthStatus;
|
|
98
|
+
failureKind?: McpFailureKind;
|
|
99
|
+
oauthProviderId?: string;
|
|
100
|
+
oauthProviderName?: string;
|
|
60
101
|
toolCount: number;
|
|
61
102
|
toolNames: string[];
|
|
62
103
|
error?: string;
|
|
@@ -9,5 +9,23 @@
|
|
|
9
9
|
* Those are shown in the TUI status line. The agent discovers them dynamically
|
|
10
10
|
* via the health check endpoint or execute_code.
|
|
11
11
|
*/
|
|
12
|
+
interface SelfReferencePaths {
|
|
13
|
+
cwd: string;
|
|
14
|
+
packageDir: string;
|
|
15
|
+
agentDir: string;
|
|
16
|
+
settingsPath: string;
|
|
17
|
+
memoriesDir: string;
|
|
18
|
+
userSkillsDir: string;
|
|
19
|
+
sessionsDir: string;
|
|
20
|
+
tempDir: string;
|
|
21
|
+
desktopDir: string;
|
|
22
|
+
xllSpec: string;
|
|
23
|
+
xllSkill: string;
|
|
24
|
+
readme: string;
|
|
25
|
+
docs: string;
|
|
26
|
+
examples: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildSelfReferenceSection(paths: SelfReferencePaths): string;
|
|
12
29
|
export declare function buildActionPrompt(): string;
|
|
30
|
+
export {};
|
|
13
31
|
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolDefinition } from '../../core/core-types.js';
|
|
2
2
|
import { BASH, EDIT, EXECUTE_CODE, FIND, GREP, LS, READ, TASK, WRITE } from '../../tool-names.js';
|
|
3
|
-
import type { ShortcutClientLogger } from '../observability/client-logging/client-logger.js';
|
|
4
3
|
import { type ApprovalGate, type BashApprovalData, type FileAccessApprovalData } from '../approvals/types.js';
|
|
4
|
+
import type { ShortcutClientLogger } from '../observability/client-logging/client-logger.js';
|
|
5
5
|
import type { SettingsManager } from '../settings-manager.js';
|
|
6
6
|
export type PermissionedRuntimeToolName = typeof READ | typeof WRITE | typeof EDIT | typeof LS | typeof FIND | typeof GREP | typeof BASH | typeof EXECUTE_CODE | typeof TASK;
|
|
7
7
|
export declare const TOOL_GATES: {
|