@atlasharness/atlascode 0.1.73 → 0.1.75
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/cli.js +156 -597
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28664,9 +28664,6 @@ function setIsInteractive(v) {
|
|
|
28664
28664
|
function setClientType(t) {
|
|
28665
28665
|
_clientType = t;
|
|
28666
28666
|
}
|
|
28667
|
-
function getClientType() {
|
|
28668
|
-
return _clientType;
|
|
28669
|
-
}
|
|
28670
28667
|
function setQuestionPreviewFormat(f) {
|
|
28671
28668
|
_questionPreviewFormat = f;
|
|
28672
28669
|
}
|
|
@@ -85413,17 +85410,13 @@ async function main() {
|
|
|
85413
85410
|
return "local-agent";
|
|
85414
85411
|
if (process.env.ATLAS_ENTRYPOINT === "claude-desktop")
|
|
85415
85412
|
return "claude-desktop";
|
|
85416
|
-
const hasSessionIngressToken = process.env.ATLAS_SESSION_ACCESS_TOKEN || process.env.ATLAS_WEBSOCKET_AUTH_FILE_DESCRIPTOR;
|
|
85417
|
-
if (process.env.ATLAS_ENTRYPOINT === "remote" || hasSessionIngressToken) {
|
|
85418
|
-
return "remote";
|
|
85419
|
-
}
|
|
85420
85413
|
return "cli";
|
|
85421
85414
|
})();
|
|
85422
85415
|
setClientType(clientType);
|
|
85423
85416
|
const previewFormat = process.env.ATLAS_QUESTION_PREVIEW_FORMAT;
|
|
85424
85417
|
if (previewFormat === "markdown" || previewFormat === "html") {
|
|
85425
85418
|
setQuestionPreviewFormat(previewFormat);
|
|
85426
|
-
} else if (!clientType.startsWith("sdk-") && clientType !== "claude-desktop" && clientType !== "local-agent"
|
|
85419
|
+
} else if (!clientType.startsWith("sdk-") && clientType !== "claude-desktop" && clientType !== "local-agent") {
|
|
85427
85420
|
setQuestionPreviewFormat("markdown");
|
|
85428
85421
|
}
|
|
85429
85422
|
eagerLoadSettings();
|
|
@@ -125692,7 +125685,7 @@ var _spSectionCache, _agentColorMap, _invokedSkillsByAgent, _invokedSkillAgentKe
|
|
|
125692
125685
|
_spSectionCache.clear();
|
|
125693
125686
|
}, getSystemPromptSectionCache = () => _spSectionCache, setSystemPromptSectionCacheEntry = (name, value) => {
|
|
125694
125687
|
_spSectionCache.set(name, value);
|
|
125695
|
-
}, setCachedClaudeMdContent = () => ({}), getLastApiCompletionTimestamp = () => ({}), getPromptCache1hAllowlist = () => null, getPromptCache1hEligible = () => null, setPromptCache1hAllowlist = () => ({}), setPromptCache1hEligible = () => ({}), setLastApiCompletionTimestamp = () => ({}), hasExitedPlanModeInSession = () => ({}), getLastEmittedDate = () => ({}), preferThirdPartyAuthentication = () => ({}), getApiKeyFromFd = () => ({}), getOauthTokenFromFd = () => ({}), setApiKeyFromFd = () => ({}), setOauthTokenFromFd = () => ({}), onSessionSwitch = () => ({}), getSessionCronTasks = () => ({}), removeSessionCronTasks = () => ({}), addSessionCronTask = () => ({}), getCachedClaudeMdContent = () => ({}), setLastClassifierRequests = () => ({}), clearRegisteredPluginHooks = () => ({}),
|
|
125688
|
+
}, setCachedClaudeMdContent = () => ({}), getLastApiCompletionTimestamp = () => ({}), getPromptCache1hAllowlist = () => null, getPromptCache1hEligible = () => null, setPromptCache1hAllowlist = () => ({}), setPromptCache1hEligible = () => ({}), setLastApiCompletionTimestamp = () => ({}), hasExitedPlanModeInSession = () => ({}), getLastEmittedDate = () => ({}), preferThirdPartyAuthentication = () => ({}), getApiKeyFromFd = () => ({}), getOauthTokenFromFd = () => ({}), setApiKeyFromFd = () => ({}), setOauthTokenFromFd = () => ({}), onSessionSwitch = () => ({}), getSessionCronTasks = () => ({}), removeSessionCronTasks = () => ({}), addSessionCronTask = () => ({}), getCachedClaudeMdContent = () => ({}), setLastClassifierRequests = () => ({}), clearRegisteredPluginHooks = () => ({}), getSessionProjectDir = () => null, getLastMainRequestId = () => ({}), getStatsStore = () => null, getFlagSettingsPath = () => "/tmp/.claude-flags.json", needsPlanModeExitAttachment = () => ({}), needsAutoModeExitAttachment = () => ({}), getScheduledTasksEnabled = () => ({}), _turnHookDurationMs = 0, _turnHookCount = 0, _turnToolDurationMs = 0, _turnToolCount = 0, _turnClassifierDurationMs = 0, _turnClassifierCount = 0, addToTurnHookDuration = (durationMs) => {
|
|
125696
125689
|
_turnHookDurationMs += durationMs;
|
|
125697
125690
|
_turnHookCount++;
|
|
125698
125691
|
}, handleAutoModeTransition = () => ({}), addToTurnClassifierDuration = (durationMs) => {
|
|
@@ -166835,7 +166828,7 @@ var init_addDirPluginSettings = __esm(() => {
|
|
|
166835
166828
|
});
|
|
166836
166829
|
|
|
166837
166830
|
// src/tui/entrypoints/sdk/coreSchemas.ts
|
|
166838
|
-
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema2, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema2, McpSSEServerConfigSchema2, McpHttpServerConfigSchema, McpSdkServerConfigSchema, McpServerConfigForProcessTransportSchema,
|
|
166831
|
+
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema2, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema2, McpSSEServerConfigSchema2, McpHttpServerConfigSchema, McpSdkServerConfigSchema, McpServerConfigForProcessTransportSchema, McpServerStatusConfigSchema, McpServerStatusSchema, McpSetServersResultSchema, PermissionUpdateDestinationSchema, PermissionBehaviorSchema, PreToolUsePermissionDecisionSchema, PermissionRuleValueSchema, PermissionUpdateSchema, PermissionDecisionClassificationSchema, PermissionResultSchema, PermissionModeSchema2, HOOK_EVENTS2, HookEventSchema, BaseHookInputSchema, PreToolUseHookInputSchema, PermissionRequestHookInputSchema, PostToolUseHookInputSchema, PostToolUseFailureHookInputSchema, PermissionDeniedHookInputSchema, NotificationHookInputSchema, UserPromptSubmitHookInputSchema, SessionStartHookInputSchema, PreModelSwitchHookInputSchema, PostModelSwitchHookInputSchema, SetupHookInputSchema, StopHookInputSchema, StopFailureHookInputSchema, SubagentStartHookInputSchema, SubagentStopHookInputSchema, PreCompactHookInputSchema, PostCompactHookInputSchema, TeammateIdleHookInputSchema, TaskCreatedHookInputSchema, TaskCompletedHookInputSchema, ElicitationHookInputSchema, ElicitationResultHookInputSchema, CONFIG_CHANGE_SOURCES, ConfigChangeHookInputSchema, INSTRUCTIONS_LOAD_REASONS, INSTRUCTIONS_MEMORY_TYPES, InstructionsLoadedHookInputSchema, WorktreeCreateHookInputSchema, WorktreeRemoveHookInputSchema, CwdChangedHookInputSchema, FileChangedHookInputSchema, EXIT_REASONS, ExitReasonSchema, SessionEndHookInputSchema, HookInputSchema, AsyncHookJSONOutputSchema, PreToolUseHookSpecificOutputSchema, UserPromptSubmitHookSpecificOutputSchema, SessionStartHookSpecificOutputSchema, SetupHookSpecificOutputSchema, SubagentStartHookSpecificOutputSchema, PostToolUseHookSpecificOutputSchema, PostToolUseFailureHookSpecificOutputSchema, PermissionDeniedHookSpecificOutputSchema, NotificationHookSpecificOutputSchema, PermissionRequestHookSpecificOutputSchema, CwdChangedHookSpecificOutputSchema, FileChangedHookSpecificOutputSchema, SyncHookJSONOutputSchema, ElicitationHookSpecificOutputSchema, ElicitationResultHookSpecificOutputSchema, WorktreeCreateHookSpecificOutputSchema, HookJSONOutputSchema, PromptRequestOptionSchema, PromptRequestSchema, PromptResponseSchema, SlashCommandSchema, AgentInfoSchema, ModelInfoSchema, AccountInfoSchema, AgentMcpServerSpecSchema, AgentDefinitionSchema, SettingSourceSchema, SdkPluginConfigSchema, RewindFilesResultSchema, APIUserMessagePlaceholder, APIAssistantMessagePlaceholder, RawMessageStreamEventPlaceholder, UUIDPlaceholder, NonNullableUsagePlaceholder, SDKAssistantMessageErrorSchema, SDKStatusSchema, SDKUserMessageContentSchema, SDKUserMessageSchema, SDKUserMessageReplaySchema, SDKRateLimitInfoSchema, SDKAssistantMessageSchema, SDKRateLimitEventSchema, SDKStreamlinedTextMessageSchema, SDKStreamlinedToolUseSummaryMessageSchema, SDKPermissionDenialSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKResultMessageSchema, SDKSystemMessageSchema, SDKPartialAssistantMessageSchema, SDKCompactBoundaryMessageSchema, SDKStatusMessageSchema, SDKPostTurnSummaryMessageSchema, SDKAPIRetryMessageSchema, SDKLocalCommandOutputMessageSchema, SDKHookStartedMessageSchema, SDKHookProgressMessageSchema, SDKHookResponseMessageSchema, SDKToolProgressMessageSchema, SDKAuthStatusMessageSchema, SDKFilesPersistedEventSchema, SDKTaskNotificationMessageSchema, SDKTaskStartedMessageSchema, SDKSessionStateChangedMessageSchema, SDKTaskProgressMessageSchema, SDKToolUseSummaryMessageSchema, SDKElicitationCompleteMessageSchema, SDKPromptSuggestionMessageSchema, SDKSessionInfoSchema, SDKMessageSchema, FastModeStateSchema;
|
|
166839
166832
|
var init_coreSchemas = __esm(() => {
|
|
166840
166833
|
init_v4();
|
|
166841
166834
|
ModelUsageSchema = lazySchema2(() => object({
|
|
@@ -166900,15 +166893,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
166900
166893
|
McpHttpServerConfigSchema(),
|
|
166901
166894
|
McpSdkServerConfigSchema()
|
|
166902
166895
|
]));
|
|
166903
|
-
|
|
166904
|
-
type: literal("claudeai-proxy"),
|
|
166905
|
-
url: string2(),
|
|
166906
|
-
id: string2()
|
|
166907
|
-
}));
|
|
166908
|
-
McpServerStatusConfigSchema = lazySchema2(() => union([
|
|
166909
|
-
McpServerConfigForProcessTransportSchema(),
|
|
166910
|
-
McpClaudeAIProxyServerConfigSchema()
|
|
166911
|
-
]));
|
|
166896
|
+
McpServerStatusConfigSchema = lazySchema2(() => McpServerConfigForProcessTransportSchema());
|
|
166912
166897
|
McpServerStatusSchema = lazySchema2(() => object({
|
|
166913
166898
|
name: string2().describe("Server name as configured"),
|
|
166914
166899
|
status: _enum(["connected", "failed", "needs-auth", "pending", "disabled"]).describe("Current connection status"),
|
|
@@ -167965,7 +167950,7 @@ var init_hooks3 = __esm(() => {
|
|
|
167965
167950
|
});
|
|
167966
167951
|
|
|
167967
167952
|
// src/tui/services/mcp/types.ts
|
|
167968
|
-
var ConfigScopeSchema3, TransportSchema2, McpStdioServerConfigSchema3, McpXaaConfigSchema2, McpOAuthConfigSchema2, McpSSEServerConfigSchema3, McpSSEIDEServerConfigSchema, McpWebSocketIDEServerConfigSchema, McpHTTPServerConfigSchema2, McpWebSocketServerConfigSchema2, McpSdkServerConfigSchema2,
|
|
167953
|
+
var ConfigScopeSchema3, TransportSchema2, McpStdioServerConfigSchema3, McpXaaConfigSchema2, McpOAuthConfigSchema2, McpSSEServerConfigSchema3, McpSSEIDEServerConfigSchema, McpWebSocketIDEServerConfigSchema, McpHTTPServerConfigSchema2, McpWebSocketServerConfigSchema2, McpSdkServerConfigSchema2, McpServerConfigSchema2, McpJsonConfigSchema2;
|
|
167969
167954
|
var init_types9 = __esm(() => {
|
|
167970
167955
|
init_v4();
|
|
167971
167956
|
ConfigScopeSchema3 = lazySchema2(() => _enum([
|
|
@@ -167991,6 +167976,9 @@ var init_types9 = __esm(() => {
|
|
|
167991
167976
|
authServerMetadataUrl: string2().url().startsWith("https://", {
|
|
167992
167977
|
message: "authServerMetadataUrl must use https://"
|
|
167993
167978
|
}).optional(),
|
|
167979
|
+
clientMetadataUrl: string2().url().startsWith("https://", {
|
|
167980
|
+
message: "clientMetadataUrl must use https://"
|
|
167981
|
+
}).optional(),
|
|
167994
167982
|
xaa: McpXaaConfigSchema2().optional()
|
|
167995
167983
|
}));
|
|
167996
167984
|
McpSSEServerConfigSchema3 = lazySchema2(() => object({
|
|
@@ -168030,11 +168018,6 @@ var init_types9 = __esm(() => {
|
|
|
168030
168018
|
type: literal("sdk"),
|
|
168031
168019
|
name: string2()
|
|
168032
168020
|
}));
|
|
168033
|
-
McpClaudeAIProxyServerConfigSchema2 = lazySchema2(() => object({
|
|
168034
|
-
type: literal("claudeai-proxy"),
|
|
168035
|
-
url: string2(),
|
|
168036
|
-
id: string2()
|
|
168037
|
-
}));
|
|
168038
168021
|
McpServerConfigSchema2 = lazySchema2(() => union([
|
|
168039
168022
|
McpStdioServerConfigSchema3(),
|
|
168040
168023
|
McpSSEServerConfigSchema3(),
|
|
@@ -168042,8 +168025,7 @@ var init_types9 = __esm(() => {
|
|
|
168042
168025
|
McpWebSocketIDEServerConfigSchema(),
|
|
168043
168026
|
McpHTTPServerConfigSchema2(),
|
|
168044
168027
|
McpWebSocketServerConfigSchema2(),
|
|
168045
|
-
McpSdkServerConfigSchema2()
|
|
168046
|
-
McpClaudeAIProxyServerConfigSchema2()
|
|
168028
|
+
McpSdkServerConfigSchema2()
|
|
168047
168029
|
]));
|
|
168048
168030
|
McpJsonConfigSchema2 = lazySchema2(() => object({
|
|
168049
168031
|
mcpServers: record(string2(), McpServerConfigSchema2())
|
|
@@ -181794,28 +181776,6 @@ var init_argumentSubstitution2 = __esm(() => {
|
|
|
181794
181776
|
init_shellQuote2();
|
|
181795
181777
|
});
|
|
181796
181778
|
|
|
181797
|
-
// src/tui/constants/product.ts
|
|
181798
|
-
function isRemoteSessionStaging(sessionId, ingressUrl) {
|
|
181799
|
-
return sessionId?.includes("_staging_") === true || ingressUrl?.includes("staging") === true;
|
|
181800
|
-
}
|
|
181801
|
-
function isRemoteSessionLocal(sessionId, ingressUrl) {
|
|
181802
|
-
return sessionId?.includes("_local_") === true || ingressUrl?.includes("localhost") === true;
|
|
181803
|
-
}
|
|
181804
|
-
function getClaudeAiBaseUrl(sessionId, ingressUrl) {
|
|
181805
|
-
if (isRemoteSessionLocal(sessionId, ingressUrl)) {
|
|
181806
|
-
return CLAUDE_AI_LOCAL_BASE_URL;
|
|
181807
|
-
}
|
|
181808
|
-
if (isRemoteSessionStaging(sessionId, ingressUrl)) {
|
|
181809
|
-
return CLAUDE_AI_STAGING_BASE_URL;
|
|
181810
|
-
}
|
|
181811
|
-
return CLAUDE_AI_BASE_URL;
|
|
181812
|
-
}
|
|
181813
|
-
function getRemoteSessionUrl(sessionId, ingressUrl) {
|
|
181814
|
-
const baseUrl = getClaudeAiBaseUrl(sessionId, ingressUrl);
|
|
181815
|
-
return `${baseUrl}/code/${sessionId}`;
|
|
181816
|
-
}
|
|
181817
|
-
var CLAUDE_AI_BASE_URL = "https://claude.ai", CLAUDE_AI_STAGING_BASE_URL = "https://claude-ai.staging.ant.dev", CLAUDE_AI_LOCAL_BASE_URL = "http://localhost:4000";
|
|
181818
|
-
|
|
181819
181779
|
// src/tui/utils/generatedFiles.ts
|
|
181820
181780
|
import { basename as basename18, extname as extname7, posix as posix4, sep as sep15 } from "path";
|
|
181821
181781
|
function isGeneratedFile(filePath) {
|
|
@@ -187932,20 +187892,6 @@ var init_p_map = __esm(() => {
|
|
|
187932
187892
|
pMapSkip = Symbol("skip");
|
|
187933
187893
|
});
|
|
187934
187894
|
|
|
187935
|
-
// src/tui/constants/oauth.ts
|
|
187936
|
-
function getOauthConfig() {
|
|
187937
|
-
return PROD_OAUTH_CONFIG;
|
|
187938
|
-
}
|
|
187939
|
-
var PROD_OAUTH_CONFIG, MCP_CLIENT_METADATA_URL = undefined;
|
|
187940
|
-
var init_oauth = __esm(() => {
|
|
187941
|
-
PROD_OAUTH_CONFIG = {
|
|
187942
|
-
BASE_API_URL: undefined,
|
|
187943
|
-
CLAUDE_AI_ORIGIN: undefined,
|
|
187944
|
-
MCP_PROXY_URL: undefined,
|
|
187945
|
-
MCP_PROXY_PATH: "/v1/mcp/{server_id}"
|
|
187946
|
-
};
|
|
187947
|
-
});
|
|
187948
|
-
|
|
187949
187895
|
// src/tui/keybindings/defaultBindings.ts
|
|
187950
187896
|
var IMAGE_PASTE_KEY, SUPPORTS_TERMINAL_VT_MODE, MODE_CYCLE_KEY, DEFAULT_BINDINGS;
|
|
187951
187897
|
var init_defaultBindings = __esm(() => {
|
|
@@ -193435,7 +193381,6 @@ function resolvePluginMcpEnvironment(config, plugin, userConfig, errors, pluginN
|
|
|
193435
193381
|
case "sse-ide":
|
|
193436
193382
|
case "ws-ide":
|
|
193437
193383
|
case "sdk":
|
|
193438
|
-
case "claudeai-proxy":
|
|
193439
193384
|
resolved = config;
|
|
193440
193385
|
break;
|
|
193441
193386
|
}
|
|
@@ -193833,9 +193778,6 @@ function expandEnvVars(config) {
|
|
|
193833
193778
|
case "sdk":
|
|
193834
193779
|
expanded = config;
|
|
193835
193780
|
break;
|
|
193836
|
-
case "claudeai-proxy":
|
|
193837
|
-
expanded = config;
|
|
193838
|
-
break;
|
|
193839
193781
|
}
|
|
193840
193782
|
return {
|
|
193841
193783
|
expanded,
|
|
@@ -195907,12 +195849,34 @@ class ClaudeAuthProvider {
|
|
|
195907
195849
|
return metadata;
|
|
195908
195850
|
}
|
|
195909
195851
|
get clientMetadataUrl() {
|
|
195852
|
+
const describe = (raw) => {
|
|
195853
|
+
try {
|
|
195854
|
+
const u = new URL(raw);
|
|
195855
|
+
return `${u.protocol}//${u.host}${u.pathname}`;
|
|
195856
|
+
} catch {
|
|
195857
|
+
return `<invalid url, ${raw.length} chars>`;
|
|
195858
|
+
}
|
|
195859
|
+
};
|
|
195910
195860
|
const override = process.env.MCP_OAUTH_CLIENT_METADATA_URL;
|
|
195911
195861
|
if (override) {
|
|
195912
|
-
|
|
195913
|
-
|
|
195862
|
+
let valid = false;
|
|
195863
|
+
try {
|
|
195864
|
+
valid = new URL(override).protocol === "https:";
|
|
195865
|
+
} catch {
|
|
195866
|
+
valid = false;
|
|
195867
|
+
}
|
|
195868
|
+
if (valid) {
|
|
195869
|
+
logMCPDebug(this.serverName, `Using CIMD URL from env: ${describe(override)}`);
|
|
195870
|
+
return override;
|
|
195871
|
+
}
|
|
195872
|
+
logMCPDebug(this.serverName, `Ignoring invalid MCP_OAUTH_CLIENT_METADATA_URL env value: ${describe(override)}`);
|
|
195873
|
+
}
|
|
195874
|
+
const perServer = this.serverConfig.oauth?.clientMetadataUrl;
|
|
195875
|
+
if (perServer) {
|
|
195876
|
+
logMCPDebug(this.serverName, `Using CIMD URL from server config: ${describe(perServer)}`);
|
|
195877
|
+
return perServer;
|
|
195914
195878
|
}
|
|
195915
|
-
return
|
|
195879
|
+
return;
|
|
195916
195880
|
}
|
|
195917
195881
|
setMetadata(metadata) {
|
|
195918
195882
|
this._metadata = metadata;
|
|
@@ -196528,7 +196492,6 @@ var init_auth3 = __esm(() => {
|
|
|
196528
196492
|
init_errors5();
|
|
196529
196493
|
init_auth();
|
|
196530
196494
|
init_axios2();
|
|
196531
|
-
init_oauth();
|
|
196532
196495
|
init_browser();
|
|
196533
196496
|
init_envUtils2();
|
|
196534
196497
|
init_errors4();
|
|
@@ -196597,14 +196560,6 @@ function createMcpAuthTool(serverName, config) {
|
|
|
196597
196560
|
return { behavior: "allow", updatedInput: input };
|
|
196598
196561
|
},
|
|
196599
196562
|
async call(_input, context) {
|
|
196600
|
-
if (config.type === "claudeai-proxy") {
|
|
196601
|
-
return {
|
|
196602
|
-
data: {
|
|
196603
|
-
status: "unsupported",
|
|
196604
|
-
message: `This is a claude.ai MCP connector. Ask the user to run /mcp and select "${serverName}" to authenticate.`
|
|
196605
|
-
}
|
|
196606
|
-
};
|
|
196607
|
-
}
|
|
196608
196563
|
if (config.type !== "sse" && config.type !== "http") {
|
|
196609
196564
|
return {
|
|
196610
196565
|
data: {
|
|
@@ -197312,6 +197267,53 @@ function createChildAbortController2(parent, maxListeners) {
|
|
|
197312
197267
|
var DEFAULT_MAX_LISTENERS2 = 50;
|
|
197313
197268
|
var init_abortController2 = () => {};
|
|
197314
197269
|
|
|
197270
|
+
// src/tui/utils/codeIndexing.ts
|
|
197271
|
+
function detectCodeIndexingFromMcpServerName(serverName) {
|
|
197272
|
+
for (const { pattern, tool } of MCP_SERVER_PATTERNS) {
|
|
197273
|
+
if (pattern.test(serverName)) {
|
|
197274
|
+
return tool;
|
|
197275
|
+
}
|
|
197276
|
+
}
|
|
197277
|
+
return;
|
|
197278
|
+
}
|
|
197279
|
+
var MCP_SERVER_PATTERNS;
|
|
197280
|
+
var init_codeIndexing = __esm(() => {
|
|
197281
|
+
MCP_SERVER_PATTERNS = [
|
|
197282
|
+
{ pattern: /^sourcegraph$/i, tool: "sourcegraph" },
|
|
197283
|
+
{ pattern: /^cody$/i, tool: "cody" },
|
|
197284
|
+
{ pattern: /^openctx$/i, tool: "openctx" },
|
|
197285
|
+
{ pattern: /^aider$/i, tool: "aider" },
|
|
197286
|
+
{ pattern: /^continue$/i, tool: "continue" },
|
|
197287
|
+
{ pattern: /^github[-_]?copilot$/i, tool: "github-copilot" },
|
|
197288
|
+
{ pattern: /^copilot$/i, tool: "github-copilot" },
|
|
197289
|
+
{ pattern: /^cursor$/i, tool: "cursor" },
|
|
197290
|
+
{ pattern: /^tabby$/i, tool: "tabby" },
|
|
197291
|
+
{ pattern: /^codeium$/i, tool: "codeium" },
|
|
197292
|
+
{ pattern: /^tabnine$/i, tool: "tabnine" },
|
|
197293
|
+
{ pattern: /^augment[-_]?code$/i, tool: "augment" },
|
|
197294
|
+
{ pattern: /^augment$/i, tool: "augment" },
|
|
197295
|
+
{ pattern: /^windsurf$/i, tool: "windsurf" },
|
|
197296
|
+
{ pattern: /^aide$/i, tool: "aide" },
|
|
197297
|
+
{ pattern: /^codestory$/i, tool: "aide" },
|
|
197298
|
+
{ pattern: /^pieces$/i, tool: "pieces" },
|
|
197299
|
+
{ pattern: /^qodo$/i, tool: "qodo" },
|
|
197300
|
+
{ pattern: /^amazon[-_]?q$/i, tool: "amazon-q" },
|
|
197301
|
+
{ pattern: /^gemini[-_]?code[-_]?assist$/i, tool: "gemini" },
|
|
197302
|
+
{ pattern: /^gemini$/i, tool: "gemini" },
|
|
197303
|
+
{ pattern: /^hound$/i, tool: "hound" },
|
|
197304
|
+
{ pattern: /^seagoat$/i, tool: "seagoat" },
|
|
197305
|
+
{ pattern: /^bloop$/i, tool: "bloop" },
|
|
197306
|
+
{ pattern: /^gitloop$/i, tool: "gitloop" },
|
|
197307
|
+
{ pattern: /^claude[-_]?context$/i, tool: "claude-context" },
|
|
197308
|
+
{ pattern: /^code[-_]?index[-_]?mcp$/i, tool: "code-index-mcp" },
|
|
197309
|
+
{ pattern: /^code[-_]?index$/i, tool: "code-index-mcp" },
|
|
197310
|
+
{ pattern: /^local[-_]?code[-_]?search$/i, tool: "local-code-search" },
|
|
197311
|
+
{ pattern: /^codebase$/i, tool: "autodev-codebase" },
|
|
197312
|
+
{ pattern: /^autodev[-_]?codebase$/i, tool: "autodev-codebase" },
|
|
197313
|
+
{ pattern: /^code[-_]?context$/i, tool: "claude-context" }
|
|
197314
|
+
];
|
|
197315
|
+
});
|
|
197316
|
+
|
|
197315
197317
|
// src/tui/utils/authFileDescriptor.ts
|
|
197316
197318
|
import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
197317
197319
|
import { join as join82 } from "path";
|
|
@@ -197407,7 +197409,7 @@ function getApiKeyFromFileDescriptor() {
|
|
|
197407
197409
|
setCached: setApiKeyFromFd
|
|
197408
197410
|
});
|
|
197409
197411
|
}
|
|
197410
|
-
var CCR_TOKEN_DIR, CCR_OAUTH_TOKEN_PATH, CCR_API_KEY_PATH
|
|
197412
|
+
var CCR_TOKEN_DIR, CCR_OAUTH_TOKEN_PATH, CCR_API_KEY_PATH;
|
|
197411
197413
|
var init_authFileDescriptor = __esm(() => {
|
|
197412
197414
|
init_bootstrapState();
|
|
197413
197415
|
init_debug();
|
|
@@ -197417,7 +197419,6 @@ var init_authFileDescriptor = __esm(() => {
|
|
|
197417
197419
|
CCR_TOKEN_DIR = join82(getAtlasConfigHomeDir3(), "remote");
|
|
197418
197420
|
CCR_OAUTH_TOKEN_PATH = `${CCR_TOKEN_DIR}/.oauth_token`;
|
|
197419
197421
|
CCR_API_KEY_PATH = `${CCR_TOKEN_DIR}/.api_key`;
|
|
197420
|
-
CCR_SESSION_INGRESS_TOKEN_PATH = `${CCR_TOKEN_DIR}/.session_ingress_token`;
|
|
197421
197422
|
});
|
|
197422
197423
|
|
|
197423
197424
|
// src/tui/utils/authPortable.ts
|
|
@@ -197764,53 +197765,6 @@ var init_auth4 = __esm(() => {
|
|
|
197764
197765
|
DEFAULT_OTEL_HEADERS_DEBOUNCE_MS = 29 * 60 * 1000;
|
|
197765
197766
|
});
|
|
197766
197767
|
|
|
197767
|
-
// src/tui/utils/codeIndexing.ts
|
|
197768
|
-
function detectCodeIndexingFromMcpServerName(serverName) {
|
|
197769
|
-
for (const { pattern, tool } of MCP_SERVER_PATTERNS) {
|
|
197770
|
-
if (pattern.test(serverName)) {
|
|
197771
|
-
return tool;
|
|
197772
|
-
}
|
|
197773
|
-
}
|
|
197774
|
-
return;
|
|
197775
|
-
}
|
|
197776
|
-
var MCP_SERVER_PATTERNS;
|
|
197777
|
-
var init_codeIndexing = __esm(() => {
|
|
197778
|
-
MCP_SERVER_PATTERNS = [
|
|
197779
|
-
{ pattern: /^sourcegraph$/i, tool: "sourcegraph" },
|
|
197780
|
-
{ pattern: /^cody$/i, tool: "cody" },
|
|
197781
|
-
{ pattern: /^openctx$/i, tool: "openctx" },
|
|
197782
|
-
{ pattern: /^aider$/i, tool: "aider" },
|
|
197783
|
-
{ pattern: /^continue$/i, tool: "continue" },
|
|
197784
|
-
{ pattern: /^github[-_]?copilot$/i, tool: "github-copilot" },
|
|
197785
|
-
{ pattern: /^copilot$/i, tool: "github-copilot" },
|
|
197786
|
-
{ pattern: /^cursor$/i, tool: "cursor" },
|
|
197787
|
-
{ pattern: /^tabby$/i, tool: "tabby" },
|
|
197788
|
-
{ pattern: /^codeium$/i, tool: "codeium" },
|
|
197789
|
-
{ pattern: /^tabnine$/i, tool: "tabnine" },
|
|
197790
|
-
{ pattern: /^augment[-_]?code$/i, tool: "augment" },
|
|
197791
|
-
{ pattern: /^augment$/i, tool: "augment" },
|
|
197792
|
-
{ pattern: /^windsurf$/i, tool: "windsurf" },
|
|
197793
|
-
{ pattern: /^aide$/i, tool: "aide" },
|
|
197794
|
-
{ pattern: /^codestory$/i, tool: "aide" },
|
|
197795
|
-
{ pattern: /^pieces$/i, tool: "pieces" },
|
|
197796
|
-
{ pattern: /^qodo$/i, tool: "qodo" },
|
|
197797
|
-
{ pattern: /^amazon[-_]?q$/i, tool: "amazon-q" },
|
|
197798
|
-
{ pattern: /^gemini[-_]?code[-_]?assist$/i, tool: "gemini" },
|
|
197799
|
-
{ pattern: /^gemini$/i, tool: "gemini" },
|
|
197800
|
-
{ pattern: /^hound$/i, tool: "hound" },
|
|
197801
|
-
{ pattern: /^seagoat$/i, tool: "seagoat" },
|
|
197802
|
-
{ pattern: /^bloop$/i, tool: "bloop" },
|
|
197803
|
-
{ pattern: /^gitloop$/i, tool: "gitloop" },
|
|
197804
|
-
{ pattern: /^claude[-_]?context$/i, tool: "claude-context" },
|
|
197805
|
-
{ pattern: /^code[-_]?index[-_]?mcp$/i, tool: "code-index-mcp" },
|
|
197806
|
-
{ pattern: /^code[-_]?index$/i, tool: "code-index-mcp" },
|
|
197807
|
-
{ pattern: /^local[-_]?code[-_]?search$/i, tool: "local-code-search" },
|
|
197808
|
-
{ pattern: /^codebase$/i, tool: "autodev-codebase" },
|
|
197809
|
-
{ pattern: /^autodev[-_]?codebase$/i, tool: "autodev-codebase" },
|
|
197810
|
-
{ pattern: /^code[-_]?context$/i, tool: "claude-context" }
|
|
197811
|
-
];
|
|
197812
|
-
});
|
|
197813
|
-
|
|
197814
197768
|
// src/tui/utils/workloadContext.ts
|
|
197815
197769
|
import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
|
|
197816
197770
|
function getWorkload() {
|
|
@@ -200955,63 +200909,6 @@ function recursivelySanitizeUnicode2(value) {
|
|
|
200955
200909
|
return value;
|
|
200956
200910
|
}
|
|
200957
200911
|
|
|
200958
|
-
// src/tui/utils/sessionIngressAuth.ts
|
|
200959
|
-
function getTokenFromFileDescriptor() {
|
|
200960
|
-
const cachedToken = getSessionIngressToken();
|
|
200961
|
-
if (cachedToken !== undefined) {
|
|
200962
|
-
return cachedToken;
|
|
200963
|
-
}
|
|
200964
|
-
const fdEnv = process.env.ATLAS_WEBSOCKET_AUTH_FILE_DESCRIPTOR;
|
|
200965
|
-
if (!fdEnv) {
|
|
200966
|
-
const path = process.env.ATLAS_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH;
|
|
200967
|
-
const fromFile = readTokenFromWellKnownFile(path, "session ingress token");
|
|
200968
|
-
setSessionIngressToken(fromFile);
|
|
200969
|
-
return fromFile;
|
|
200970
|
-
}
|
|
200971
|
-
const fd = parseInt(fdEnv, 10);
|
|
200972
|
-
if (Number.isNaN(fd)) {
|
|
200973
|
-
logForDebugging3(`ATLAS_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${fdEnv}`, { level: "error" });
|
|
200974
|
-
setSessionIngressToken(null);
|
|
200975
|
-
return null;
|
|
200976
|
-
}
|
|
200977
|
-
try {
|
|
200978
|
-
const fsOps = getFsImplementation2();
|
|
200979
|
-
const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd}` : `/proc/self/fd/${fd}`;
|
|
200980
|
-
const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim();
|
|
200981
|
-
if (!token) {
|
|
200982
|
-
logForDebugging3("File descriptor contained empty token", {
|
|
200983
|
-
level: "error"
|
|
200984
|
-
});
|
|
200985
|
-
setSessionIngressToken(null);
|
|
200986
|
-
return null;
|
|
200987
|
-
}
|
|
200988
|
-
logForDebugging3(`Successfully read token from file descriptor ${fd}`);
|
|
200989
|
-
setSessionIngressToken(token);
|
|
200990
|
-
maybePersistTokenForSubprocesses(CCR_SESSION_INGRESS_TOKEN_PATH, token, "session ingress token");
|
|
200991
|
-
return token;
|
|
200992
|
-
} catch (error) {
|
|
200993
|
-
logForDebugging3(`Failed to read token from file descriptor ${fd}: ${errorMessage2(error)}`, { level: "error" });
|
|
200994
|
-
const path = process.env.ATLAS_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH;
|
|
200995
|
-
const fromFile = readTokenFromWellKnownFile(path, "session ingress token");
|
|
200996
|
-
setSessionIngressToken(fromFile);
|
|
200997
|
-
return fromFile;
|
|
200998
|
-
}
|
|
200999
|
-
}
|
|
201000
|
-
function getSessionIngressAuthToken() {
|
|
201001
|
-
const envToken = process.env.ATLAS_SESSION_ACCESS_TOKEN;
|
|
201002
|
-
if (envToken) {
|
|
201003
|
-
return envToken;
|
|
201004
|
-
}
|
|
201005
|
-
return getTokenFromFileDescriptor();
|
|
201006
|
-
}
|
|
201007
|
-
var init_sessionIngressAuth = __esm(() => {
|
|
201008
|
-
init_bootstrapState();
|
|
201009
|
-
init_authFileDescriptor();
|
|
201010
|
-
init_debug();
|
|
201011
|
-
init_errors4();
|
|
201012
|
-
init_fsOperations();
|
|
201013
|
-
});
|
|
201014
|
-
|
|
201015
200912
|
// src/tui/utils/subprocessEnv.ts
|
|
201016
200913
|
function subprocessEnv() {
|
|
201017
200914
|
const proxyEnv = _getUpstreamProxyEnv?.() ?? {};
|
|
@@ -209270,43 +209167,12 @@ function clearMcpAuthCache() {
|
|
|
209270
209167
|
function handleRemoteAuthFailure(name, serverRef, transportType) {
|
|
209271
209168
|
const label = {
|
|
209272
209169
|
sse: "SSE",
|
|
209273
|
-
http: "HTTP"
|
|
209274
|
-
"claudeai-proxy": "claude.ai proxy"
|
|
209170
|
+
http: "HTTP"
|
|
209275
209171
|
};
|
|
209276
209172
|
logMCPDebug(name, `Authentication required for ${label[transportType]} server`);
|
|
209277
209173
|
setMcpAuthCacheEntry(name);
|
|
209278
209174
|
return { name, type: "needs-auth", config: serverRef };
|
|
209279
209175
|
}
|
|
209280
|
-
function createClaudeAiProxyFetch(innerFetch) {
|
|
209281
|
-
return async (url, init) => {
|
|
209282
|
-
const doRequest = async () => {
|
|
209283
|
-
const currentTokens = getOAuthTokens();
|
|
209284
|
-
if (!currentTokens) {
|
|
209285
|
-
throw new Error("No claude.ai OAuth token available");
|
|
209286
|
-
}
|
|
209287
|
-
const headers = new Headers(init?.headers);
|
|
209288
|
-
headers.set("Authorization", `Bearer ${currentTokens.accessToken}`);
|
|
209289
|
-
const response = await innerFetch(url, { ...init, headers });
|
|
209290
|
-
return { response, sentToken: currentTokens.accessToken };
|
|
209291
|
-
};
|
|
209292
|
-
const { response, sentToken } = await doRequest();
|
|
209293
|
-
if (response.status !== 401) {
|
|
209294
|
-
return response;
|
|
209295
|
-
}
|
|
209296
|
-
const tokenChanged = false;
|
|
209297
|
-
if (!tokenChanged) {
|
|
209298
|
-
const now = getOAuthTokens()?.accessToken;
|
|
209299
|
-
if (!now || now === sentToken) {
|
|
209300
|
-
return response;
|
|
209301
|
-
}
|
|
209302
|
-
}
|
|
209303
|
-
try {
|
|
209304
|
-
return (await doRequest()).response;
|
|
209305
|
-
} catch {
|
|
209306
|
-
return response;
|
|
209307
|
-
}
|
|
209308
|
-
};
|
|
209309
|
-
}
|
|
209310
209176
|
async function createNodeWsClient(url, options) {
|
|
209311
209177
|
const wsModule = await Promise.resolve().then(() => (init_wrapper2(), {}));
|
|
209312
209178
|
const WS = wrapper_default;
|
|
@@ -209496,7 +209362,7 @@ async function getMcpToolsCommandsAndResources(onConnectionAttempt, mcpConfigs)
|
|
|
209496
209362
|
});
|
|
209497
209363
|
return;
|
|
209498
209364
|
}
|
|
209499
|
-
if ((config.type === "
|
|
209365
|
+
if ((config.type === "http" || config.type === "sse") && (await isMcpAuthCached(name) || hasMcpDiscoveryButNoToken(name, config))) {
|
|
209500
209366
|
logMCPDebug(name, `Skipping connection (cached needs-auth)`);
|
|
209501
209367
|
onConnectionAttempt({
|
|
209502
209368
|
client: { name, type: "needs-auth", config },
|
|
@@ -209978,7 +209844,7 @@ async function callMCPTool({
|
|
|
209978
209844
|
throw new McpAuthError(name, `MCP server "${name}" requires re-authorization (token expired)`);
|
|
209979
209845
|
}
|
|
209980
209846
|
const isSessionExpired = isMcpSessionExpiredError(e);
|
|
209981
|
-
const isConnectionClosedOnHttp = "code" in e && e.code === -32000 && e.message.includes("Connection closed") &&
|
|
209847
|
+
const isConnectionClosedOnHttp = "code" in e && e.code === -32000 && e.message.includes("Connection closed") && config.type === "http";
|
|
209982
209848
|
if (isSessionExpired || isConnectionClosedOnHttp) {
|
|
209983
209849
|
logMCPDebug(name, `MCP session expired during tool call (${isSessionExpired ? "404/-32001" : "connection closed"}), clearing connection cache for re-initialization`);
|
|
209984
209850
|
await clearServerCache(name, config);
|
|
@@ -210014,14 +209880,12 @@ var init_client4 = __esm(() => {
|
|
|
210014
209880
|
init_zipObject();
|
|
210015
209881
|
init_p_map();
|
|
210016
209882
|
init_bootstrap();
|
|
210017
|
-
init_oauth();
|
|
210018
209883
|
init_Tool();
|
|
210019
209884
|
init_ListMcpResourcesTool();
|
|
210020
209885
|
init_MCPTool();
|
|
210021
209886
|
init_McpAuthTool();
|
|
210022
209887
|
init_ReadMcpResourceTool();
|
|
210023
209888
|
init_abortController2();
|
|
210024
|
-
init_auth4();
|
|
210025
209889
|
init_cleanupRegistry3();
|
|
210026
209890
|
init_codeIndexing();
|
|
210027
209891
|
init_debug();
|
|
@@ -210037,7 +209901,6 @@ var init_client4 = __esm(() => {
|
|
|
210037
209901
|
init_memoize2();
|
|
210038
209902
|
init_mtls();
|
|
210039
209903
|
init_proxy();
|
|
210040
|
-
init_sessionIngressAuth();
|
|
210041
209904
|
init_subprocessEnv();
|
|
210042
209905
|
init_toolResultStorage();
|
|
210043
209906
|
init_elicitationHandler();
|
|
@@ -210089,7 +209952,6 @@ var init_client4 = __esm(() => {
|
|
|
210089
209952
|
let inProcessServer;
|
|
210090
209953
|
try {
|
|
210091
209954
|
let transport;
|
|
210092
|
-
const sessionIngressToken = getSessionIngressAuthToken();
|
|
210093
209955
|
if (serverRef.type === "sse") {
|
|
210094
209956
|
const authProvider = new ClaudeAuthProvider(name, serverRef);
|
|
210095
209957
|
const combinedHeaders = await getMcpServerHeaders(name, serverRef);
|
|
@@ -210175,16 +210037,12 @@ var init_client4 = __esm(() => {
|
|
|
210175
210037
|
const tlsOptions = getWebSocketTLSOptions();
|
|
210176
210038
|
const wsHeaders = {
|
|
210177
210039
|
"User-Agent": getMCPUserAgent(),
|
|
210178
|
-
...sessionIngressToken && {
|
|
210179
|
-
Authorization: `Bearer ${sessionIngressToken}`
|
|
210180
|
-
},
|
|
210181
210040
|
...combinedHeaders
|
|
210182
210041
|
};
|
|
210183
210042
|
const wsHeadersForLogging = mapValues_default(wsHeaders, (value, key) => key.toLowerCase() === "authorization" ? "[REDACTED]" : value);
|
|
210184
210043
|
logMCPDebug(name, `WebSocket transport options: ${jsonStringify5({
|
|
210185
210044
|
url: serverRef.url,
|
|
210186
|
-
headers: wsHeadersForLogging
|
|
210187
|
-
hasSessionAuth: !!sessionIngressToken
|
|
210045
|
+
headers: wsHeadersForLogging
|
|
210188
210046
|
})}`);
|
|
210189
210047
|
let wsClient;
|
|
210190
210048
|
if (typeof Bun !== "undefined") {
|
|
@@ -210214,7 +210072,6 @@ var init_client4 = __esm(() => {
|
|
|
210214
210072
|
})}`);
|
|
210215
210073
|
const authProvider = new ClaudeAuthProvider(name, serverRef);
|
|
210216
210074
|
const combinedHeaders = await getMcpServerHeaders(name, serverRef);
|
|
210217
|
-
const hasOAuthTokens = !!await authProvider.tokens();
|
|
210218
210075
|
const proxyOptions = getProxyFetchOptions();
|
|
210219
210076
|
logMCPDebug(name, `Proxy options: ${proxyOptions.dispatcher ? "custom dispatcher" : "default"}`);
|
|
210220
210077
|
const transportOptions = {
|
|
@@ -210224,9 +210081,6 @@ var init_client4 = __esm(() => {
|
|
|
210224
210081
|
...proxyOptions,
|
|
210225
210082
|
headers: {
|
|
210226
210083
|
"User-Agent": getMCPUserAgent(),
|
|
210227
|
-
...sessionIngressToken && !hasOAuthTokens && {
|
|
210228
|
-
Authorization: `Bearer ${sessionIngressToken}`
|
|
210229
|
-
},
|
|
210230
210084
|
...combinedHeaders
|
|
210231
210085
|
}
|
|
210232
210086
|
}
|
|
@@ -210242,29 +210096,6 @@ var init_client4 = __esm(() => {
|
|
|
210242
210096
|
logMCPDebug(name, `HTTP transport created successfully`);
|
|
210243
210097
|
} else if (serverRef.type === "sdk") {
|
|
210244
210098
|
throw new Error("SDK servers should be handled in print.ts");
|
|
210245
|
-
} else if (serverRef.type === "claudeai-proxy") {
|
|
210246
|
-
logMCPDebug(name, `Initializing claude.ai proxy transport for server ${serverRef.id}`);
|
|
210247
|
-
const tokens = getOAuthTokens();
|
|
210248
|
-
if (!tokens) {
|
|
210249
|
-
throw new Error("No claude.ai OAuth token found");
|
|
210250
|
-
}
|
|
210251
|
-
const oauthConfig = getOauthConfig();
|
|
210252
|
-
const proxyUrl = `${oauthConfig.MCP_PROXY_URL}${oauthConfig.MCP_PROXY_PATH.replace("{server_id}", serverRef.id)}`;
|
|
210253
|
-
logMCPDebug(name, `Using claude.ai proxy at ${proxyUrl}`);
|
|
210254
|
-
const fetchWithAuth = createClaudeAiProxyFetch(globalThis.fetch);
|
|
210255
|
-
const proxyOptions = getProxyFetchOptions();
|
|
210256
|
-
const transportOptions = {
|
|
210257
|
-
fetch: wrapFetchWithTimeout(fetchWithAuth),
|
|
210258
|
-
requestInit: {
|
|
210259
|
-
...proxyOptions,
|
|
210260
|
-
headers: {
|
|
210261
|
-
"User-Agent": getMCPUserAgent(),
|
|
210262
|
-
"X-Mcp-Client-Session-Id": getSessionId()
|
|
210263
|
-
}
|
|
210264
|
-
}
|
|
210265
|
-
};
|
|
210266
|
-
transport = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions);
|
|
210267
|
-
logMCPDebug(name, `claude.ai proxy transport created successfully`);
|
|
210268
210099
|
} else if (feature("CHICAGO_MCP") && (serverRef.type === "stdio" || !serverRef.type) && isComputerUseMCPServer2(name)) {
|
|
210269
210100
|
await Promise.resolve().then(() => init_mcpServer());
|
|
210270
210101
|
await Promise.resolve();
|
|
@@ -210386,13 +210217,6 @@ var init_client4 = __esm(() => {
|
|
|
210386
210217
|
if (error instanceof UnauthorizedError) {
|
|
210387
210218
|
return handleRemoteAuthFailure(name, serverRef, "http");
|
|
210388
210219
|
}
|
|
210389
|
-
} else if (serverRef.type === "claudeai-proxy" && error instanceof Error) {
|
|
210390
|
-
logMCPDebug(name, `claude.ai proxy connection failed after ${elapsed}ms: ${error.message}`);
|
|
210391
|
-
logMCPError(name, error);
|
|
210392
|
-
const errorCode = error.code;
|
|
210393
|
-
if (errorCode === 401) {
|
|
210394
|
-
return handleRemoteAuthFailure(name, serverRef, "claudeai-proxy");
|
|
210395
|
-
}
|
|
210396
210220
|
} else if (serverRef.type === "sse-ide" || serverRef.type === "ws-ide") {}
|
|
210397
210221
|
if (inProcessServer) {
|
|
210398
210222
|
inProcessServer.close().catch(() => {});
|
|
@@ -210474,7 +210298,7 @@ var init_client4 = __esm(() => {
|
|
|
210474
210298
|
logMCPDebug(name, `Connection error: ${error.message}`);
|
|
210475
210299
|
}
|
|
210476
210300
|
}
|
|
210477
|
-
if (
|
|
210301
|
+
if (transportType === "http" && isMcpSessionExpiredError(error)) {
|
|
210478
210302
|
logMCPDebug(name, `MCP session expired (server returned 404 with session-not-found), triggering reconnection`);
|
|
210479
210303
|
closeTransportAndRejectPending("session expired");
|
|
210480
210304
|
if (originalOnerror) {
|
|
@@ -210482,7 +210306,7 @@ var init_client4 = __esm(() => {
|
|
|
210482
210306
|
}
|
|
210483
210307
|
return;
|
|
210484
210308
|
}
|
|
210485
|
-
if (transportType === "sse" || transportType === "http"
|
|
210309
|
+
if (transportType === "sse" || transportType === "http") {
|
|
210486
210310
|
if (error.message.includes("Maximum reconnection attempts")) {
|
|
210487
210311
|
closeTransportAndRejectPending("SSE reconnection exhausted");
|
|
210488
210312
|
if (originalOnerror) {
|
|
@@ -254905,17 +254729,6 @@ function buildPRTrailers(_attributionData, _attribution) {
|
|
|
254905
254729
|
// src/tui/utils/attribution.ts
|
|
254906
254730
|
import { stat as stat30 } from "fs/promises";
|
|
254907
254731
|
function getAttributionTexts() {
|
|
254908
|
-
if (getClientType() === "remote") {
|
|
254909
|
-
const remoteSessionId = process.env.ATLAS_REMOTE_SESSION_ID;
|
|
254910
|
-
if (remoteSessionId) {
|
|
254911
|
-
const ingressUrl = process.env.SESSION_INGRESS_URL;
|
|
254912
|
-
if (!isRemoteSessionLocal(remoteSessionId, ingressUrl)) {
|
|
254913
|
-
const sessionUrl = getRemoteSessionUrl(remoteSessionId, ingressUrl);
|
|
254914
|
-
return { commit: sessionUrl, pr: sessionUrl };
|
|
254915
|
-
}
|
|
254916
|
-
}
|
|
254917
|
-
return { commit: "", pr: "" };
|
|
254918
|
-
}
|
|
254919
254732
|
const model = getMainLoopModel();
|
|
254920
254733
|
const isKnownPublicModel = getPublicModelDisplayName(model) !== null;
|
|
254921
254734
|
const modelName = isInternalModelRepoCached() || isKnownPublicModel ? getPublicModelName(model) : "Atlas Opus 4.6";
|
|
@@ -255028,16 +254841,6 @@ async function getTranscriptStats() {
|
|
|
255028
254841
|
}
|
|
255029
254842
|
}
|
|
255030
254843
|
async function getEnhancedPRAttribution(getAppState) {
|
|
255031
|
-
if (getClientType() === "remote") {
|
|
255032
|
-
const remoteSessionId = process.env.ATLAS_REMOTE_SESSION_ID;
|
|
255033
|
-
if (remoteSessionId) {
|
|
255034
|
-
const ingressUrl = process.env.SESSION_INGRESS_URL;
|
|
255035
|
-
if (!isRemoteSessionLocal(remoteSessionId, ingressUrl)) {
|
|
255036
|
-
return getRemoteSessionUrl(remoteSessionId, ingressUrl);
|
|
255037
|
-
}
|
|
255038
|
-
}
|
|
255039
|
-
return "";
|
|
255040
|
-
}
|
|
255041
254844
|
const settings = getInitialSettings2();
|
|
255042
254845
|
if (settings.attribution?.pr) {
|
|
255043
254846
|
return settings.attribution.pr;
|
|
@@ -255085,7 +254888,6 @@ ${trailers.join(`
|
|
|
255085
254888
|
var MEMORY_ACCESS_TOOL_NAMES;
|
|
255086
254889
|
var init_attribution = __esm(() => {
|
|
255087
254890
|
init_shared();
|
|
255088
|
-
init_bootstrap();
|
|
255089
254891
|
init_xml();
|
|
255090
254892
|
init_constants8();
|
|
255091
254893
|
init_prompt2();
|
|
@@ -311158,9 +310960,6 @@ function gracefulShutdownSync(exitCode = 0, reason = "other", options) {
|
|
|
311158
310960
|
forceExit(exitCode);
|
|
311159
310961
|
}).catch(() => {});
|
|
311160
310962
|
}
|
|
311161
|
-
function isShuttingDown() {
|
|
311162
|
-
return shutdownInProgress;
|
|
311163
|
-
}
|
|
311164
310963
|
async function gracefulShutdown(exitCode = 0, reason = "other", options) {
|
|
311165
310964
|
if (shutdownInProgress) {
|
|
311166
310965
|
return;
|
|
@@ -347307,171 +347106,6 @@ var init_fileSuggestions = __esm(() => {
|
|
|
347307
347106
|
cachedTrackedDirs = [];
|
|
347308
347107
|
});
|
|
347309
347108
|
|
|
347310
|
-
// src/tui/services/api/sessionIngress.ts
|
|
347311
|
-
function getOrCreateSequentialAppend(sessionId) {
|
|
347312
|
-
let sequentialAppend = sequentialAppendBySession.get(sessionId);
|
|
347313
|
-
if (!sequentialAppend) {
|
|
347314
|
-
sequentialAppend = sequential(async (entry, url, headers) => await appendSessionLogImpl(sessionId, entry, url, headers));
|
|
347315
|
-
sequentialAppendBySession.set(sessionId, sequentialAppend);
|
|
347316
|
-
}
|
|
347317
|
-
return sequentialAppend;
|
|
347318
|
-
}
|
|
347319
|
-
async function appendSessionLogImpl(sessionId, entry, url, headers) {
|
|
347320
|
-
for (let attempt = 1;attempt <= MAX_RETRIES; attempt++) {
|
|
347321
|
-
try {
|
|
347322
|
-
const lastUuid = lastUuidMap.get(sessionId);
|
|
347323
|
-
const requestHeaders = { ...headers };
|
|
347324
|
-
if (lastUuid) {
|
|
347325
|
-
requestHeaders["Last-Uuid"] = lastUuid;
|
|
347326
|
-
}
|
|
347327
|
-
const response = await axios_default.put(url, entry, {
|
|
347328
|
-
headers: requestHeaders,
|
|
347329
|
-
validateStatus: (status) => status < 500
|
|
347330
|
-
});
|
|
347331
|
-
if (response.status === 200 || response.status === 201) {
|
|
347332
|
-
lastUuidMap.set(sessionId, entry.uuid);
|
|
347333
|
-
logForDebugging3(`Successfully persisted session log entry for session ${sessionId}`);
|
|
347334
|
-
return true;
|
|
347335
|
-
}
|
|
347336
|
-
if (response.status === 409) {
|
|
347337
|
-
const serverLastUuid = response.headers["x-last-uuid"];
|
|
347338
|
-
if (serverLastUuid === entry.uuid) {
|
|
347339
|
-
lastUuidMap.set(sessionId, entry.uuid);
|
|
347340
|
-
logForDebugging3(`Session entry ${entry.uuid} already present on server, recovering from stale state`);
|
|
347341
|
-
logForDiagnosticsNoPII("info", "session_persist_recovered_from_409");
|
|
347342
|
-
return true;
|
|
347343
|
-
}
|
|
347344
|
-
if (serverLastUuid) {
|
|
347345
|
-
lastUuidMap.set(sessionId, serverLastUuid);
|
|
347346
|
-
logForDebugging3(`Session 409: adopting server lastUuid=${serverLastUuid} from header, retrying entry ${entry.uuid}`);
|
|
347347
|
-
} else {
|
|
347348
|
-
const logs = await fetchSessionLogsFromUrl(sessionId, url, headers);
|
|
347349
|
-
const adoptedUuid = findLastUuid(logs);
|
|
347350
|
-
if (adoptedUuid) {
|
|
347351
|
-
lastUuidMap.set(sessionId, adoptedUuid);
|
|
347352
|
-
logForDebugging3(`Session 409: re-fetched ${logs.length} entries, adopting lastUuid=${adoptedUuid}, retrying entry ${entry.uuid}`);
|
|
347353
|
-
} else {
|
|
347354
|
-
const errorData = response.data;
|
|
347355
|
-
const errorMessage = errorData.error?.message || "Concurrent modification detected";
|
|
347356
|
-
logError3(new Error(`Session persistence conflict: UUID mismatch for session ${sessionId}, entry ${entry.uuid}. ${errorMessage}`));
|
|
347357
|
-
logForDiagnosticsNoPII("error", "session_persist_fail_concurrent_modification");
|
|
347358
|
-
return false;
|
|
347359
|
-
}
|
|
347360
|
-
}
|
|
347361
|
-
logForDiagnosticsNoPII("info", "session_persist_409_adopt_server_uuid");
|
|
347362
|
-
continue;
|
|
347363
|
-
}
|
|
347364
|
-
if (response.status === 401) {
|
|
347365
|
-
logForDebugging3("Session token expired or invalid");
|
|
347366
|
-
logForDiagnosticsNoPII("error", "session_persist_fail_bad_token");
|
|
347367
|
-
return false;
|
|
347368
|
-
}
|
|
347369
|
-
logForDebugging3(`Failed to persist session log: ${response.status} ${response.statusText}`);
|
|
347370
|
-
logForDiagnosticsNoPII("error", "session_persist_fail_status", {
|
|
347371
|
-
status: response.status,
|
|
347372
|
-
attempt
|
|
347373
|
-
});
|
|
347374
|
-
} catch (error) {
|
|
347375
|
-
const axiosError = error;
|
|
347376
|
-
logError3(new Error(`Error persisting session log: ${axiosError.message}`));
|
|
347377
|
-
logForDiagnosticsNoPII("error", "session_persist_fail_status", {
|
|
347378
|
-
status: axiosError.status,
|
|
347379
|
-
attempt
|
|
347380
|
-
});
|
|
347381
|
-
}
|
|
347382
|
-
if (attempt === MAX_RETRIES) {
|
|
347383
|
-
logForDebugging3(`Remote persistence failed after ${MAX_RETRIES} attempts`);
|
|
347384
|
-
logForDiagnosticsNoPII("error", "session_persist_error_retries_exhausted", { attempt });
|
|
347385
|
-
return false;
|
|
347386
|
-
}
|
|
347387
|
-
const delayMs = Math.min(BASE_DELAY_MS2 * Math.pow(2, attempt - 1), 8000);
|
|
347388
|
-
logForDebugging3(`Remote persistence attempt ${attempt}/${MAX_RETRIES} failed, retrying in ${delayMs}ms…`);
|
|
347389
|
-
await sleep9(delayMs);
|
|
347390
|
-
}
|
|
347391
|
-
return false;
|
|
347392
|
-
}
|
|
347393
|
-
async function appendSessionLog(sessionId, entry, url) {
|
|
347394
|
-
const sessionToken = getSessionIngressAuthToken();
|
|
347395
|
-
if (!sessionToken) {
|
|
347396
|
-
logForDebugging3("No session token available for session persistence");
|
|
347397
|
-
logForDiagnosticsNoPII("error", "session_persist_fail_jwt_no_token");
|
|
347398
|
-
return false;
|
|
347399
|
-
}
|
|
347400
|
-
const headers = {
|
|
347401
|
-
Authorization: `Bearer ${sessionToken}`,
|
|
347402
|
-
"Content-Type": "application/json"
|
|
347403
|
-
};
|
|
347404
|
-
const sequentialAppend = getOrCreateSequentialAppend(sessionId);
|
|
347405
|
-
return sequentialAppend(entry, url, headers);
|
|
347406
|
-
}
|
|
347407
|
-
async function fetchSessionLogsFromUrl(sessionId, url, headers) {
|
|
347408
|
-
try {
|
|
347409
|
-
const response = await axios_default.get(url, {
|
|
347410
|
-
headers,
|
|
347411
|
-
timeout: 20000,
|
|
347412
|
-
validateStatus: (status) => status < 500,
|
|
347413
|
-
params: isEnvTruthy2(process.env.ATLAS_AFTER_LAST_COMPACT) ? { after_last_compact: true } : undefined
|
|
347414
|
-
});
|
|
347415
|
-
if (response.status === 200) {
|
|
347416
|
-
const data = response.data;
|
|
347417
|
-
if (!data || typeof data !== "object" || !Array.isArray(data.loglines)) {
|
|
347418
|
-
logError3(new Error(`Invalid session logs response format: ${jsonStringify5(data)}`));
|
|
347419
|
-
logForDiagnosticsNoPII("error", "session_get_fail_invalid_response");
|
|
347420
|
-
return null;
|
|
347421
|
-
}
|
|
347422
|
-
const logs = data.loglines;
|
|
347423
|
-
logForDebugging3(`Fetched ${logs.length} session logs for session ${sessionId}`);
|
|
347424
|
-
return logs;
|
|
347425
|
-
}
|
|
347426
|
-
if (response.status === 404) {
|
|
347427
|
-
logForDebugging3(`No existing logs for session ${sessionId}`);
|
|
347428
|
-
logForDiagnosticsNoPII("warn", "session_get_no_logs_for_session");
|
|
347429
|
-
return [];
|
|
347430
|
-
}
|
|
347431
|
-
if (response.status === 401) {
|
|
347432
|
-
logForDebugging3("Auth token expired or invalid");
|
|
347433
|
-
logForDiagnosticsNoPII("error", "session_get_fail_bad_token");
|
|
347434
|
-
throw new Error("Your session has expired. Please run /login to sign in again.");
|
|
347435
|
-
}
|
|
347436
|
-
logForDebugging3(`Failed to fetch session logs: ${response.status} ${response.statusText}`);
|
|
347437
|
-
logForDiagnosticsNoPII("error", "session_get_fail_status", {
|
|
347438
|
-
status: response.status
|
|
347439
|
-
});
|
|
347440
|
-
return null;
|
|
347441
|
-
} catch (error) {
|
|
347442
|
-
const axiosError = error;
|
|
347443
|
-
logError3(new Error(`Error fetching session logs: ${axiosError.message}`));
|
|
347444
|
-
logForDiagnosticsNoPII("error", "session_get_fail_status", {
|
|
347445
|
-
status: axiosError.status
|
|
347446
|
-
});
|
|
347447
|
-
return null;
|
|
347448
|
-
}
|
|
347449
|
-
}
|
|
347450
|
-
function findLastUuid(logs) {
|
|
347451
|
-
if (!logs) {
|
|
347452
|
-
return;
|
|
347453
|
-
}
|
|
347454
|
-
const entry = logs.findLast((e) => ("uuid" in e) && e.uuid);
|
|
347455
|
-
return entry && "uuid" in entry ? entry.uuid : undefined;
|
|
347456
|
-
}
|
|
347457
|
-
function clearAllSessions() {
|
|
347458
|
-
lastUuidMap.clear();
|
|
347459
|
-
sequentialAppendBySession.clear();
|
|
347460
|
-
}
|
|
347461
|
-
var lastUuidMap, MAX_RETRIES = 10, BASE_DELAY_MS2 = 500, sequentialAppendBySession;
|
|
347462
|
-
var init_sessionIngress = __esm(() => {
|
|
347463
|
-
init_axios2();
|
|
347464
|
-
init_oauth();
|
|
347465
|
-
init_debug();
|
|
347466
|
-
init_diagLogs();
|
|
347467
|
-
init_envUtils2();
|
|
347468
|
-
init_log5();
|
|
347469
|
-
init_sessionIngressAuth();
|
|
347470
|
-
init_slowOperations();
|
|
347471
|
-
lastUuidMap = new Map;
|
|
347472
|
-
sequentialAppendBySession = new Map;
|
|
347473
|
-
});
|
|
347474
|
-
|
|
347475
347109
|
// src/tui/utils/hooks/postSamplingHooks.ts
|
|
347476
347110
|
function registerPostSamplingHook(hook) {
|
|
347477
347111
|
postSamplingHooks.push(hook);
|
|
@@ -347739,7 +347373,6 @@ function clearSessionCaches(preservedAgentIds = new Set) {
|
|
|
347739
347373
|
resetSentSkillNames();
|
|
347740
347374
|
resetGetMemoryFilesCache("session_start");
|
|
347741
347375
|
clearStoredImagePaths();
|
|
347742
|
-
clearAllSessions();
|
|
347743
347376
|
if (!hasPreserved)
|
|
347744
347377
|
clearAllPendingCallbacks2();
|
|
347745
347378
|
if (feature("COMMIT_ATTRIBUTION")) {
|
|
@@ -347770,7 +347403,6 @@ var init_caches = __esm(() => {
|
|
|
347770
347403
|
init_useSwarmPermissionPoller();
|
|
347771
347404
|
init_dumpPrompts();
|
|
347772
347405
|
init_promptCacheBreakDetection();
|
|
347773
|
-
init_sessionIngress();
|
|
347774
347406
|
init_engineCompat();
|
|
347775
347407
|
init_LSPDiagnosticRegistry();
|
|
347776
347408
|
init_magicDocs();
|
|
@@ -368996,11 +368628,11 @@ function _temp419(a_0, b_0) {
|
|
|
368996
368628
|
function _temp323(a, b) {
|
|
368997
368629
|
return a.name.localeCompare(b.name);
|
|
368998
368630
|
}
|
|
368999
|
-
function _temp231(
|
|
369000
|
-
return
|
|
368631
|
+
function _temp231(_s_0) {
|
|
368632
|
+
return false;
|
|
369001
368633
|
}
|
|
369002
|
-
function _temp85(
|
|
369003
|
-
return
|
|
368634
|
+
function _temp85(_s) {
|
|
368635
|
+
return true;
|
|
369004
368636
|
}
|
|
369005
368637
|
var import_compiler_runtime154, import_react109, jsx_dev_runtime189, SCOPE_ORDER;
|
|
369006
368638
|
var init_MCPListPanel = __esm(() => {
|
|
@@ -370148,8 +369780,6 @@ function MCPRemoteServerMenu({
|
|
|
370148
369780
|
}
|
|
370149
369781
|
}, [server.client.type, server.name, toggleMcpServer, onCancel, onComplete]);
|
|
370150
369782
|
const handleAuthenticate = import_react113.default.useCallback(async () => {
|
|
370151
|
-
if (server.config.type === "claudeai-proxy")
|
|
370152
|
-
return;
|
|
370153
369783
|
setIsAuthenticating(true);
|
|
370154
369784
|
setError(null);
|
|
370155
369785
|
const controller = new AbortController;
|
|
@@ -370189,8 +369819,6 @@ function MCPRemoteServerMenu({
|
|
|
370189
369819
|
}
|
|
370190
369820
|
}, [server.isAuthenticated, server.config, server.name, onComplete, reconnectMcpServer, isEffectivelyAuthenticated]);
|
|
370191
369821
|
const handleClearAuth = async () => {
|
|
370192
|
-
if (server.config.type === "claudeai-proxy")
|
|
370193
|
-
return;
|
|
370194
369822
|
if (server.config) {
|
|
370195
369823
|
await revokeServerTokens(server.name, server.config);
|
|
370196
369824
|
await clearServerCache(server.name, {
|
|
@@ -370360,23 +369988,21 @@ function MCPRemoteServerMenu({
|
|
|
370360
369988
|
value: "tools"
|
|
370361
369989
|
});
|
|
370362
369990
|
}
|
|
370363
|
-
if (
|
|
370364
|
-
|
|
370365
|
-
|
|
370366
|
-
|
|
370367
|
-
|
|
370368
|
-
|
|
370369
|
-
|
|
370370
|
-
|
|
370371
|
-
|
|
370372
|
-
|
|
370373
|
-
|
|
370374
|
-
|
|
370375
|
-
|
|
370376
|
-
|
|
370377
|
-
|
|
370378
|
-
});
|
|
370379
|
-
}
|
|
369991
|
+
if (isEffectivelyAuthenticated) {
|
|
369992
|
+
menuOptions.push({
|
|
369993
|
+
label: "Re-authenticate",
|
|
369994
|
+
value: "reauth"
|
|
369995
|
+
});
|
|
369996
|
+
menuOptions.push({
|
|
369997
|
+
label: "Clear authentication",
|
|
369998
|
+
value: "clear-auth"
|
|
369999
|
+
});
|
|
370000
|
+
}
|
|
370001
|
+
if (!isEffectivelyAuthenticated) {
|
|
370002
|
+
menuOptions.push({
|
|
370003
|
+
label: "Authenticate",
|
|
370004
|
+
value: "auth"
|
|
370005
|
+
});
|
|
370380
370006
|
}
|
|
370381
370007
|
if (server.client.type !== "disabled") {
|
|
370382
370008
|
if (server.client.type !== "needs-auth") {
|
|
@@ -370457,7 +370083,7 @@ function MCPRemoteServerMenu({
|
|
|
370457
370083
|
}, undefined, true, undefined, this)
|
|
370458
370084
|
]
|
|
370459
370085
|
}, undefined, true, undefined, this),
|
|
370460
|
-
|
|
370086
|
+
/* @__PURE__ */ jsx_dev_runtime193.jsxDEV(ThemedBox_default, {
|
|
370461
370087
|
children: [
|
|
370462
370088
|
/* @__PURE__ */ jsx_dev_runtime193.jsxDEV(ThemedText, {
|
|
370463
370089
|
bold: true,
|
|
@@ -371468,50 +371094,39 @@ function MCPSettings(t0) {
|
|
|
371468
371094
|
const scope = client_0.config.scope;
|
|
371469
371095
|
const isSSE = client_0.config.type === "sse";
|
|
371470
371096
|
const isHTTP = client_0.config.type === "http";
|
|
371471
|
-
const isClaudeAIProxy = client_0.config.type === "claudeai-proxy";
|
|
371472
371097
|
let isAuthenticated = undefined;
|
|
371473
371098
|
if (isSSE || isHTTP) {
|
|
371474
371099
|
const authProvider = new ClaudeAuthProvider(client_0.name, client_0.config);
|
|
371475
371100
|
const tokens = await authProvider.tokens();
|
|
371476
|
-
const hasSessionAuth = getSessionIngressAuthToken() !== null && client_0.type === "connected";
|
|
371477
371101
|
const hasToolsAndConnected = client_0.type === "connected" && filterToolsByServer(mcp.tools, client_0.name).length > 0;
|
|
371478
|
-
isAuthenticated = Boolean(tokens) ||
|
|
371102
|
+
isAuthenticated = Boolean(tokens) || hasToolsAndConnected;
|
|
371479
371103
|
}
|
|
371480
371104
|
const baseInfo = {
|
|
371481
371105
|
name: client_0.name,
|
|
371482
371106
|
client: client_0,
|
|
371483
371107
|
scope
|
|
371484
371108
|
};
|
|
371485
|
-
if (
|
|
371109
|
+
if (isSSE) {
|
|
371486
371110
|
return {
|
|
371487
371111
|
...baseInfo,
|
|
371488
|
-
transport: "
|
|
371489
|
-
isAuthenticated
|
|
371112
|
+
transport: "sse",
|
|
371113
|
+
isAuthenticated,
|
|
371490
371114
|
config: client_0.config
|
|
371491
371115
|
};
|
|
371492
371116
|
} else {
|
|
371493
|
-
if (
|
|
371117
|
+
if (isHTTP) {
|
|
371494
371118
|
return {
|
|
371495
371119
|
...baseInfo,
|
|
371496
|
-
transport: "
|
|
371120
|
+
transport: "http",
|
|
371497
371121
|
isAuthenticated,
|
|
371498
371122
|
config: client_0.config
|
|
371499
371123
|
};
|
|
371500
371124
|
} else {
|
|
371501
|
-
|
|
371502
|
-
|
|
371503
|
-
|
|
371504
|
-
|
|
371505
|
-
|
|
371506
|
-
config: client_0.config
|
|
371507
|
-
};
|
|
371508
|
-
} else {
|
|
371509
|
-
return {
|
|
371510
|
-
...baseInfo,
|
|
371511
|
-
transport: "stdio",
|
|
371512
|
-
config: client_0.config
|
|
371513
|
-
};
|
|
371514
|
-
}
|
|
371125
|
+
return {
|
|
371126
|
+
...baseInfo,
|
|
371127
|
+
transport: "stdio",
|
|
371128
|
+
config: client_0.config
|
|
371129
|
+
};
|
|
371515
371130
|
}
|
|
371516
371131
|
}
|
|
371517
371132
|
}));
|
|
@@ -371608,7 +371223,7 @@ function MCPSettings(t0) {
|
|
|
371608
371223
|
t9 = $[25];
|
|
371609
371224
|
}
|
|
371610
371225
|
const serverTools_0 = t9;
|
|
371611
|
-
const defaultTab =
|
|
371226
|
+
const defaultTab = "Atlas";
|
|
371612
371227
|
if (viewState.server.transport === "stdio") {
|
|
371613
371228
|
let t10;
|
|
371614
371229
|
if ($[26] !== viewState.server) {
|
|
@@ -371822,7 +371437,6 @@ var init_MCPSettings = __esm(() => {
|
|
|
371822
371437
|
init_auth3();
|
|
371823
371438
|
init_utils6();
|
|
371824
371439
|
init_AppState();
|
|
371825
|
-
init_sessionIngressAuth();
|
|
371826
371440
|
init_MCPAgentServerMenu();
|
|
371827
371441
|
init_MCPListPanel();
|
|
371828
371442
|
init_MCPRemoteServerMenu();
|
|
@@ -408873,23 +408487,6 @@ function ManagePlugins({
|
|
|
408873
408487
|
onComplete: handleMcpComplete,
|
|
408874
408488
|
borderless: true
|
|
408875
408489
|
}, undefined, false, undefined, this);
|
|
408876
|
-
} else if (configType === "claudeai-proxy") {
|
|
408877
|
-
const server_2 = {
|
|
408878
|
-
name: client_3.name,
|
|
408879
|
-
client: client_3,
|
|
408880
|
-
scope: scope_5,
|
|
408881
|
-
transport: "claudeai-proxy",
|
|
408882
|
-
isAuthenticated: undefined,
|
|
408883
|
-
config: client_3.config
|
|
408884
|
-
};
|
|
408885
|
-
return /* @__PURE__ */ jsx_dev_runtime291.jsxDEV(MCPRemoteServerMenu, {
|
|
408886
|
-
server: server_2,
|
|
408887
|
-
serverToolsCount,
|
|
408888
|
-
onViewTools: handleMcpViewTools,
|
|
408889
|
-
onCancel: handleMcpCancel,
|
|
408890
|
-
onComplete: handleMcpComplete,
|
|
408891
|
-
borderless: true
|
|
408892
|
-
}, undefined, false, undefined, this);
|
|
408893
408490
|
}
|
|
408894
408491
|
setViewState("plugin-list");
|
|
408895
408492
|
return null;
|
|
@@ -408930,7 +408527,7 @@ function ManagePlugins({
|
|
|
408930
408527
|
name: client_4.name,
|
|
408931
408528
|
client: client_4,
|
|
408932
408529
|
scope: scope_6,
|
|
408933
|
-
transport: "
|
|
408530
|
+
transport: "http",
|
|
408934
408531
|
isAuthenticated: undefined,
|
|
408935
408532
|
config: client_4.config
|
|
408936
408533
|
};
|
|
@@ -408989,7 +408586,7 @@ function ManagePlugins({
|
|
|
408989
408586
|
name: client_5.name,
|
|
408990
408587
|
client: client_5,
|
|
408991
408588
|
scope: scope_7,
|
|
408992
|
-
transport: "
|
|
408589
|
+
transport: "http",
|
|
408993
408590
|
isAuthenticated: undefined,
|
|
408994
408591
|
config: client_5.config
|
|
408995
408592
|
};
|
|
@@ -421840,10 +421437,6 @@ class Project2 {
|
|
|
421840
421437
|
currentSessionPrRepository;
|
|
421841
421438
|
sessionFile = null;
|
|
421842
421439
|
pendingEntries = [];
|
|
421843
|
-
remoteIngressUrl = null;
|
|
421844
|
-
internalEventWriter = null;
|
|
421845
|
-
internalEventReader = null;
|
|
421846
|
-
internalSubagentEventReader = null;
|
|
421847
421440
|
pendingWriteCount = 0;
|
|
421848
421441
|
flushResolvers = [];
|
|
421849
421442
|
writeQueues = new Map;
|
|
@@ -422307,9 +421900,6 @@ class Project2 {
|
|
|
422307
421900
|
this.enqueueWrite(targetFile, entry);
|
|
422308
421901
|
if (!isAgentSidechain) {
|
|
422309
421902
|
messageSet.add(entry.uuid);
|
|
422310
|
-
if (isTranscriptMessage2(entry)) {
|
|
422311
|
-
await this.persistToRemote(sessionId, entry);
|
|
422312
|
-
}
|
|
422313
421903
|
}
|
|
422314
421904
|
}
|
|
422315
421905
|
}
|
|
@@ -422337,55 +421927,6 @@ class Project2 {
|
|
|
422337
421927
|
throw e;
|
|
422338
421928
|
}
|
|
422339
421929
|
}
|
|
422340
|
-
async persistToRemote(sessionId, entry) {
|
|
422341
|
-
if (isShuttingDown()) {
|
|
422342
|
-
return;
|
|
422343
|
-
}
|
|
422344
|
-
if (this.internalEventWriter) {
|
|
422345
|
-
try {
|
|
422346
|
-
await this.internalEventWriter("transcript", entry, {
|
|
422347
|
-
...isCompactBoundaryMessage2(entry) && { isCompaction: true },
|
|
422348
|
-
...entry.agentId && { agentId: entry.agentId }
|
|
422349
|
-
});
|
|
422350
|
-
} catch {
|
|
422351
|
-
logForDebugging3("Failed to write transcript as internal event");
|
|
422352
|
-
}
|
|
422353
|
-
return;
|
|
422354
|
-
}
|
|
422355
|
-
if (!isEnvTruthy2(process.env.ENABLE_SESSION_PERSISTENCE) || !this.remoteIngressUrl) {
|
|
422356
|
-
return;
|
|
422357
|
-
}
|
|
422358
|
-
const success = await appendSessionLog(sessionId, entry, this.remoteIngressUrl);
|
|
422359
|
-
if (!success) {
|
|
422360
|
-
gracefulShutdownSync(1, "other");
|
|
422361
|
-
}
|
|
422362
|
-
}
|
|
422363
|
-
setRemoteIngressUrl(url) {
|
|
422364
|
-
this.remoteIngressUrl = url;
|
|
422365
|
-
logForDebugging3(`Remote persistence enabled with URL: ${url}`);
|
|
422366
|
-
if (url) {
|
|
422367
|
-
this.FLUSH_INTERVAL_MS = REMOTE_FLUSH_INTERVAL_MS;
|
|
422368
|
-
}
|
|
422369
|
-
}
|
|
422370
|
-
setInternalEventWriter(writer) {
|
|
422371
|
-
this.internalEventWriter = writer;
|
|
422372
|
-
logForDebugging3("CCR v2 internal event writer registered for transcript persistence");
|
|
422373
|
-
this.FLUSH_INTERVAL_MS = REMOTE_FLUSH_INTERVAL_MS;
|
|
422374
|
-
}
|
|
422375
|
-
setInternalEventReader(reader) {
|
|
422376
|
-
this.internalEventReader = reader;
|
|
422377
|
-
logForDebugging3("CCR v2 internal event reader registered for session resume");
|
|
422378
|
-
}
|
|
422379
|
-
setInternalSubagentEventReader(reader) {
|
|
422380
|
-
this.internalSubagentEventReader = reader;
|
|
422381
|
-
logForDebugging3("CCR v2 subagent event reader registered for session resume");
|
|
422382
|
-
}
|
|
422383
|
-
getInternalEventReader() {
|
|
422384
|
-
return this.internalEventReader;
|
|
422385
|
-
}
|
|
422386
|
-
getInternalSubagentEventReader() {
|
|
422387
|
-
return this.internalSubagentEventReader;
|
|
422388
|
-
}
|
|
422389
421930
|
}
|
|
422390
421931
|
async function recordTranscript2(messages, teamInfo, startingParentUuidHint, allMessages) {
|
|
422391
421932
|
const cleanedMessages = cleanMessagesForLogging2(messages, allMessages);
|
|
@@ -424244,7 +423785,7 @@ async function enrichLogs(allLogs, startIndex, count) {
|
|
|
424244
423785
|
}
|
|
424245
423786
|
return { logs: result, nextIndex: i };
|
|
424246
423787
|
}
|
|
424247
|
-
var VERSION6, MAX_TOMBSTONE_REWRITE_BYTES, SKIP_FIRST_PROMPT_PATTERN2, EPHEMERAL_PROGRESS_TYPES2, MAX_TRANSCRIPT_READ_BYTES2, agentTranscriptSubdirs2, getProjectDir3, project2 = null, cleanupRegistered3 = false,
|
|
423788
|
+
var VERSION6, MAX_TOMBSTONE_REWRITE_BYTES, SKIP_FIRST_PROMPT_PATTERN2, EPHEMERAL_PROGRESS_TYPES2, MAX_TRANSCRIPT_READ_BYTES2, agentTranscriptSubdirs2, getProjectDir3, project2 = null, cleanupRegistered3 = false, METADATA_TYPE_MARKERS2, METADATA_MARKER_BUFS2, METADATA_PREFIX_BOUND2 = 25, getSessionMessages2 = (sessionId) => getSessionMessages(sessionId), INITIAL_ENRICH_COUNT = 50;
|
|
424248
423789
|
var init_sessionStorage = __esm(() => {
|
|
424249
423790
|
init_memoize();
|
|
424250
423791
|
init_bootstrap();
|
|
@@ -424253,21 +423794,18 @@ var init_sessionStorage = __esm(() => {
|
|
|
424253
423794
|
init_commands5();
|
|
424254
423795
|
init_xml();
|
|
424255
423796
|
init_growthbook();
|
|
424256
|
-
init_sessionIngress();
|
|
424257
423797
|
init_constants9();
|
|
424258
423798
|
init_ids();
|
|
424259
423799
|
init_cleanupRegistry3();
|
|
424260
423800
|
init_concurrentSessions2();
|
|
424261
423801
|
init_cwd3();
|
|
424262
423802
|
init_debug();
|
|
424263
|
-
init_diagLogs();
|
|
424264
423803
|
init_envUtils2();
|
|
424265
423804
|
init_errors4();
|
|
424266
423805
|
init_format2();
|
|
424267
423806
|
init_fsOperations();
|
|
424268
423807
|
init_getWorktreePaths();
|
|
424269
423808
|
init_git2();
|
|
424270
|
-
init_gracefulShutdown();
|
|
424271
423809
|
init_json2();
|
|
424272
423810
|
init_log5();
|
|
424273
423811
|
init_messages3();
|
|
@@ -434620,6 +434158,18 @@ var init_client5 = __esm(() => {
|
|
|
434620
434158
|
init_config6();
|
|
434621
434159
|
});
|
|
434622
434160
|
|
|
434161
|
+
// src/tui/constants/oauth.ts
|
|
434162
|
+
function getOauthConfig() {
|
|
434163
|
+
return PROD_OAUTH_CONFIG;
|
|
434164
|
+
}
|
|
434165
|
+
var PROD_OAUTH_CONFIG;
|
|
434166
|
+
var init_oauth = __esm(() => {
|
|
434167
|
+
PROD_OAUTH_CONFIG = {
|
|
434168
|
+
BASE_API_URL: undefined,
|
|
434169
|
+
CLAUDE_AI_ORIGIN: undefined
|
|
434170
|
+
};
|
|
434171
|
+
});
|
|
434172
|
+
|
|
434623
434173
|
// src/tui/utils/apiPreconnect.ts
|
|
434624
434174
|
function preconnectAtlasApi() {
|
|
434625
434175
|
if (fired)
|
|
@@ -434804,8 +434354,19 @@ function withoutCcdSpawnEnvKeys(env) {
|
|
|
434804
434354
|
}
|
|
434805
434355
|
return out;
|
|
434806
434356
|
}
|
|
434357
|
+
function withoutMcpOauthCimdVars(env) {
|
|
434358
|
+
if (!env)
|
|
434359
|
+
return {};
|
|
434360
|
+
const out = {};
|
|
434361
|
+
for (const [key, value] of Object.entries(env)) {
|
|
434362
|
+
if (key.toUpperCase() !== "MCP_OAUTH_CLIENT_METADATA_URL") {
|
|
434363
|
+
out[key] = value;
|
|
434364
|
+
}
|
|
434365
|
+
}
|
|
434366
|
+
return out;
|
|
434367
|
+
}
|
|
434807
434368
|
function filterSettingsEnv(env) {
|
|
434808
|
-
return withoutCcdSpawnEnvKeys(withoutHostManagedProviderVars(withoutSSHTunnelVars(env)));
|
|
434369
|
+
return withoutCcdSpawnEnvKeys(withoutMcpOauthCimdVars(withoutHostManagedProviderVars(withoutSSHTunnelVars(env))));
|
|
434809
434370
|
}
|
|
434810
434371
|
function applySafeConfigEnvironmentVariables2() {
|
|
434811
434372
|
if (ccdSpawnEnvKeys === undefined) {
|
|
@@ -473529,13 +473090,13 @@ function _temp436(client_2) {
|
|
|
473529
473090
|
return false;
|
|
473530
473091
|
}
|
|
473531
473092
|
function _temp350(client_1) {
|
|
473532
|
-
return client_1.type === "needs-auth"
|
|
473093
|
+
return client_1.type === "needs-auth";
|
|
473533
473094
|
}
|
|
473534
473095
|
function _temp279(client_0) {
|
|
473535
473096
|
return false;
|
|
473536
473097
|
}
|
|
473537
473098
|
function _temp181(client) {
|
|
473538
|
-
return client.type === "failed" && client.config.type !== "sse-ide" && client.config.type !== "ws-ide"
|
|
473099
|
+
return client.type === "failed" && client.config.type !== "sse-ide" && client.config.type !== "ws-ide";
|
|
473539
473100
|
}
|
|
473540
473101
|
var import_compiler_runtime307, import_react264, jsx_dev_runtime418, EMPTY_MCP_CLIENTS;
|
|
473541
473102
|
var init_useMcpConnectivityStatus = __esm(() => {
|
|
@@ -490411,8 +489972,6 @@ async function mcpListHandler2() {
|
|
|
490411
489972
|
console.log(`${name}: ${server.url} (SSE) - ${status}`);
|
|
490412
489973
|
} else if (server.type === "http") {
|
|
490413
489974
|
console.log(`${name}: ${server.url} (HTTP) - ${status}`);
|
|
490414
|
-
} else if (server.type === "claudeai-proxy") {
|
|
490415
|
-
console.log(`${name}: ${server.url} - ${status}`);
|
|
490416
489975
|
} else if (!server.type || server.type === "stdio") {
|
|
490417
489976
|
const stdioServer = server;
|
|
490418
489977
|
const args = Array.isArray(stdioServer.args) ? stdioServer.args : [];
|
|
@@ -490440,7 +489999,7 @@ async function mcpGetHandler2(name) {
|
|
|
490440
489999
|
console.log(` ${key}: ${value}`);
|
|
490441
490000
|
}
|
|
490442
490001
|
}
|
|
490443
|
-
if (server.oauth?.clientId || server.oauth?.callbackPort) {
|
|
490002
|
+
if (server.oauth?.clientId || server.oauth?.callbackPort || server.oauth?.clientMetadataUrl) {
|
|
490444
490003
|
const parts = [];
|
|
490445
490004
|
if (server.oauth.clientId) {
|
|
490446
490005
|
parts.push("client_id configured");
|
|
@@ -490450,6 +490009,8 @@ async function mcpGetHandler2(name) {
|
|
|
490450
490009
|
}
|
|
490451
490010
|
if (server.oauth.callbackPort)
|
|
490452
490011
|
parts.push(`callback_port ${server.oauth.callbackPort}`);
|
|
490012
|
+
if (server.oauth.clientMetadataUrl)
|
|
490013
|
+
parts.push(`client_metadata_url ${server.oauth.clientMetadataUrl}`);
|
|
490453
490014
|
console.log(` OAuth: ${parts.join(", ")}`);
|
|
490454
490015
|
}
|
|
490455
490016
|
} else if (server.type === "http") {
|
|
@@ -490461,7 +490022,7 @@ async function mcpGetHandler2(name) {
|
|
|
490461
490022
|
console.log(` ${key}: ${value}`);
|
|
490462
490023
|
}
|
|
490463
490024
|
}
|
|
490464
|
-
if (server.oauth?.clientId || server.oauth?.callbackPort) {
|
|
490025
|
+
if (server.oauth?.clientId || server.oauth?.callbackPort || server.oauth?.clientMetadataUrl) {
|
|
490465
490026
|
const parts = [];
|
|
490466
490027
|
if (server.oauth.clientId) {
|
|
490467
490028
|
parts.push("client_id configured");
|
|
@@ -490471,6 +490032,8 @@ async function mcpGetHandler2(name) {
|
|
|
490471
490032
|
}
|
|
490472
490033
|
if (server.oauth.callbackPort)
|
|
490473
490034
|
parts.push(`callback_port ${server.oauth.callbackPort}`);
|
|
490035
|
+
if (server.oauth.clientMetadataUrl)
|
|
490036
|
+
parts.push(`client_metadata_url ${server.oauth.clientMetadataUrl}`);
|
|
490474
490037
|
console.log(` OAuth: ${parts.join(", ")}`);
|
|
490475
490038
|
}
|
|
490476
490039
|
} else if (server.type === "stdio") {
|
|
@@ -492847,17 +492410,13 @@ async function main2() {
|
|
|
492847
492410
|
return "local-agent";
|
|
492848
492411
|
if (process.env.ATLAS_ENTRYPOINT === "claude-desktop")
|
|
492849
492412
|
return "claude-desktop";
|
|
492850
|
-
const hasSessionIngressToken = process.env.ATLAS_SESSION_ACCESS_TOKEN || process.env.ATLAS_WEBSOCKET_AUTH_FILE_DESCRIPTOR;
|
|
492851
|
-
if (process.env.ATLAS_ENTRYPOINT === "remote" || hasSessionIngressToken) {
|
|
492852
|
-
return "remote";
|
|
492853
|
-
}
|
|
492854
492413
|
return "cli";
|
|
492855
492414
|
})();
|
|
492856
492415
|
setClientType(clientType);
|
|
492857
492416
|
const previewFormat = process.env.ATLAS_QUESTION_PREVIEW_FORMAT;
|
|
492858
492417
|
if (previewFormat === "markdown" || previewFormat === "html") {
|
|
492859
492418
|
setQuestionPreviewFormat(previewFormat);
|
|
492860
|
-
} else if (!clientType.startsWith("sdk-") && clientType !== "claude-desktop" && clientType !== "local-agent"
|
|
492419
|
+
} else if (!clientType.startsWith("sdk-") && clientType !== "claude-desktop" && clientType !== "local-agent") {
|
|
492861
492420
|
setQuestionPreviewFormat("markdown");
|
|
492862
492421
|
}
|
|
492863
492422
|
profileCheckpoint("main_client_type_determined");
|
package/package.json
CHANGED