fix(extensions): finalize stash merge reconciliation
This commit is contained in:
parent
51376e2620
commit
0eb38387a3
10 changed files with 14 additions and 16 deletions
|
|
@ -21,7 +21,6 @@ async function buildManagementCliEnvForBinary(binaryPath: string): Promise<NodeJ
|
||||||
});
|
});
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExtensionsRuntimeAdapter {
|
export interface ExtensionsRuntimeAdapter {
|
||||||
readonly flavor: CliFlavor;
|
readonly flavor: CliFlavor;
|
||||||
buildManagementCliEnv(binaryPath: string): Promise<NodeJS.ProcessEnv>;
|
buildManagementCliEnv(binaryPath: string): Promise<NodeJS.ProcessEnv>;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ function isSensitiveCliFlag(flag: string): boolean {
|
||||||
const normalizedFlag = flag.toLowerCase().replace(/^--/, '').replace(/[-_]/g, '');
|
const normalizedFlag = flag.toLowerCase().replace(/^--/, '').replace(/[-_]/g, '');
|
||||||
return SENSITIVE_FLAG_NAMES.has(normalizedFlag);
|
return SENSITIVE_FLAG_NAMES.has(normalizedFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractJsonObject<T>(raw: string): T {
|
function extractJsonObject<T>(raw: string): T {
|
||||||
const trimmed = raw.trim();
|
const trimmed = raw.trim();
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ import { Button } from '@renderer/components/ui/button';
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip';
|
||||||
import { useStore } from '@renderer/store';
|
import { useStore } from '@renderer/store';
|
||||||
import { formatCompactNumber, formatRelativeTime } from '@renderer/utils/formatters';
|
import { formatCompactNumber, formatRelativeTime } from '@renderer/utils/formatters';
|
||||||
|
import { getDefaultMcpSharedScope } from '@shared/utils/mcpScopes';
|
||||||
import {
|
import {
|
||||||
getMcpInstallationSummaryLabel,
|
getMcpInstallationSummaryLabel,
|
||||||
getMcpOperationKey,
|
getMcpOperationKey,
|
||||||
sanitizeMcpServerName,
|
sanitizeMcpServerName,
|
||||||
} from '@shared/utils/extensionNormalizers';
|
} from '@shared/utils/extensionNormalizers';
|
||||||
import { getDefaultMcpSharedScope } from '@shared/utils/mcpScopes';
|
|
||||||
import { Clock, Cloud, Globe, KeyRound, Lock, Monitor, Star, Tag, Wrench } from 'lucide-react';
|
import { Clock, Cloud, Globe, KeyRound, Lock, Monitor, Star, Tag, Wrench } from 'lucide-react';
|
||||||
import { Github as GithubIcon } from 'lucide-react';
|
import { Github as GithubIcon } from 'lucide-react';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,18 @@ import {
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from '@renderer/components/ui/select';
|
} from '@renderer/components/ui/select';
|
||||||
import { useStore } from '@renderer/store';
|
import { useStore } from '@renderer/store';
|
||||||
import {
|
|
||||||
getMcpInstallationSummaryLabel,
|
|
||||||
getMcpOperationKey,
|
|
||||||
getPreferredMcpInstallationEntry,
|
|
||||||
sanitizeMcpServerName,
|
|
||||||
} from '@shared/utils/extensionNormalizers';
|
|
||||||
import {
|
import {
|
||||||
getDefaultMcpSharedScope,
|
getDefaultMcpSharedScope,
|
||||||
getMcpScopeLabel,
|
getMcpScopeLabel,
|
||||||
isProjectScopedMcpScope,
|
isProjectScopedMcpScope,
|
||||||
isSharedMcpScope,
|
isSharedMcpScope,
|
||||||
} from '@shared/utils/mcpScopes';
|
} from '@shared/utils/mcpScopes';
|
||||||
|
import {
|
||||||
|
getMcpInstallationSummaryLabel,
|
||||||
|
getMcpOperationKey,
|
||||||
|
getPreferredMcpInstallationEntry,
|
||||||
|
sanitizeMcpServerName,
|
||||||
|
} from '@shared/utils/extensionNormalizers';
|
||||||
import { ExternalLink, Lock, Plus, Star, Trash2, Wrench } from 'lucide-react';
|
import { ExternalLink, Lock, Plus, Star, Trash2, Wrench } from 'lucide-react';
|
||||||
|
|
||||||
import { InstallButton } from '../common/InstallButton';
|
import { InstallButton } from '../common/InstallButton';
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ import {
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from '@renderer/components/ui/select';
|
} from '@renderer/components/ui/select';
|
||||||
import { useStore } from '@renderer/store';
|
import { useStore } from '@renderer/store';
|
||||||
import { inferCapabilities, normalizeCategory } from '@shared/utils/extensionNormalizers';
|
|
||||||
import { getCliProviderExtensionCapability } from '@shared/utils/providerExtensionCapabilities';
|
import { getCliProviderExtensionCapability } from '@shared/utils/providerExtensionCapabilities';
|
||||||
|
import { inferCapabilities, normalizeCategory } from '@shared/utils/extensionNormalizers';
|
||||||
import { ArrowUpDown, Filter, Puzzle, Search } from 'lucide-react';
|
import { ArrowUpDown, Filter, Puzzle, Search } from 'lucide-react';
|
||||||
import { useShallow } from 'zustand/react/shallow';
|
import { useShallow } from 'zustand/react/shallow';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import { useShallow } from 'zustand/react/shallow';
|
||||||
|
|
||||||
import { resolveSkillProjectPath } from './skillProjectUtils';
|
import { resolveSkillProjectPath } from './skillProjectUtils';
|
||||||
|
|
||||||
import type { SkillValidationIssue } from '@shared/types';
|
import type { SkillValidationIssue } from '@shared/types/extensions';
|
||||||
|
|
||||||
interface SkillDetailDialogProps {
|
interface SkillDetailDialogProps {
|
||||||
skillId: string | null;
|
skillId: string | null;
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ import { validateSkillFolderName } from './skillValidationUtils';
|
||||||
import type {
|
import type {
|
||||||
SkillDetail,
|
SkillDetail,
|
||||||
SkillInvocationMode,
|
SkillInvocationMode,
|
||||||
SkillReviewPreview,
|
|
||||||
SkillRootKind,
|
SkillRootKind,
|
||||||
|
SkillReviewPreview,
|
||||||
} from '@shared/types/extensions';
|
} from '@shared/types/extensions';
|
||||||
|
|
||||||
type EditorMode = 'create' | 'edit';
|
type EditorMode = 'create' | 'edit';
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ function formatRuntimeAudienceLabel(providerNames: readonly string[]): string {
|
||||||
return 'the configured runtime';
|
return 'the configured runtime';
|
||||||
}
|
}
|
||||||
if (providerNames.length === 1) {
|
if (providerNames.length === 1) {
|
||||||
return providerNames[0];
|
return providerNames[0]!;
|
||||||
}
|
}
|
||||||
if (providerNames.length === 2) {
|
if (providerNames.length === 2) {
|
||||||
return `${providerNames[0]} and ${providerNames[1]}`;
|
return `${providerNames[0]} and ${providerNames[1]}`;
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,15 @@ vi.mock('@main/utils/pathDecoder', () => ({
|
||||||
const windowsRoot = cwd.match(/^[A-Za-z]:[\\/]/)?.[0] ?? null;
|
const windowsRoot = cwd.match(/^[A-Za-z]:[\\/]/)?.[0] ?? null;
|
||||||
const root = windowsRoot ?? '/';
|
const root = windowsRoot ?? '/';
|
||||||
const sep = windowsRoot ? '\\' : '/';
|
const sep = windowsRoot ? '\\' : '/';
|
||||||
return `${root}tmp${sep}mock-home`.replaceAll('//', '/');
|
return `${root}${root.endsWith(sep) ? '' : sep}tmp${sep}mock-home`;
|
||||||
},
|
},
|
||||||
getClaudeBasePath: () => {
|
getClaudeBasePath: () => {
|
||||||
const cwd = process.cwd();
|
const cwd = process.cwd();
|
||||||
const windowsRoot = cwd.match(/^[A-Za-z]:[\\/]/)?.[0] ?? null;
|
const windowsRoot = cwd.match(/^[A-Za-z]:[\\/]/)?.[0] ?? null;
|
||||||
const root = windowsRoot ?? '/';
|
const root = windowsRoot ?? '/';
|
||||||
const sep = windowsRoot ? '\\' : '/';
|
const sep = windowsRoot ? '\\' : '/';
|
||||||
return `${root}tmp${sep}mock-home${sep}.claude`.replaceAll('//', '/');
|
const mockHome = `${root}${root.endsWith(sep) ? '' : sep}tmp${sep}mock-home`;
|
||||||
|
return `${mockHome}${sep}.claude`;
|
||||||
},
|
},
|
||||||
setClaudeBasePathOverride: vi.fn(),
|
setClaudeBasePathOverride: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import {
|
||||||
getVisibleMultimodelProviders,
|
getVisibleMultimodelProviders,
|
||||||
isMultimodelRuntimeStatus,
|
isMultimodelRuntimeStatus,
|
||||||
} from '@renderer/utils/multimodelProviderVisibility';
|
} from '@renderer/utils/multimodelProviderVisibility';
|
||||||
|
|
||||||
import type { CliInstallationStatus, CliProviderStatus } from '@shared/types';
|
import type { CliInstallationStatus, CliProviderStatus } from '@shared/types';
|
||||||
import { createDefaultCliExtensionCapabilities } from '@shared/utils/providerExtensionCapabilities';
|
import { createDefaultCliExtensionCapabilities } from '@shared/utils/providerExtensionCapabilities';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue