Merge remote-tracking branch 'origin/main' into nostr-git-support

This commit is contained in:
Alex Gleason committed 2025-10-15 14:59:02 -05:00
commit 6a456e64f0
17 files changed
+151 -28

No files matched your search

+1
View File
@@ -26,6 +26,7 @@ const AppConfigSchema = z.object({
language: z.string(),
showcaseEnabled: z.boolean(),
showcaseModerator: z.string(),
ngitServers: z.array(z.string()),
}) satisfies z.ZodType<AppConfig>;
export function AppProvider(props: AppProviderProps) {
+4 -4
View File
@@ -55,6 +55,7 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useNostr } from '@nostrify/react';
import { useNostrPublish } from '@/hooks/useNostrPublish';
import { usePullRequests } from '@/hooks/usePullRequests';
import { useAppContext } from '@/hooks/useAppContext';
import { cn } from '@/lib/utils';
import { findCredentialsForRepo } from '@/lib/gitCredentials';
import { nip19 } from 'nostr-tools';
@@ -62,8 +63,6 @@ import { GitManagementDialog } from '@/components/git/GitManagementDialog';
import { MergeDialog } from '@/components/git/MergeDialog';
import { PullRequestDialog } from '@/components/git/PullRequestDialog';
const GRASP_SERVERS = ["git.shakespeare.diy", "relay.ngit.dev"];
interface GitDialogProps {
projectId: string;
children?: React.ReactNode;
@@ -96,6 +95,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
const { nostr } = useNostr();
const { mutateAsync: publishEvent } = useNostrPublish();
const { data: pullRequests, isLoading: isLoadingPRs } = usePullRequests(originUrl);
const { config } = useAppContext();
const projectPath = `/projects/${projectId}`;
@@ -303,10 +303,10 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
}
// Create repo announcement event (NIP-34 kind 30617)
const cloneUrls = GRASP_SERVERS.map(server =>
const cloneUrls = config.ngitServers.map(server =>
`https://${server}/${nip19.npubEncode(user.pubkey)}/${projectId}.git`
);
const relayUrls = GRASP_SERVERS.map(server => `wss://${server}`);
const relayUrls = config.ngitServers.map(server => `wss://${server}`);
await publishEvent({
kind: 30617,
+3 -7
View File
@@ -15,15 +15,11 @@ const GIT_KINDS = [
1621, // NIP-34 Issue
];
const GIT_RELAYS = [
'wss://git.shakespeare.diy/',
'wss://relay.ngit.dev/',
];
const NostrProvider: React.FC<NostrProviderProps> = (props) => {
const { children } = props;
const { config, presetRelays } = useAppContext();
const gitRelays = config.ngitServers.map(server => `wss://${server}/`);
const queryClient = useQueryClient();
// Create NPool instance only once
@@ -50,7 +46,7 @@ const NostrProvider: React.FC<NostrProviderProps> = (props) => {
if (filters.every((f) => f.kinds?.every((k) => GIT_KINDS.includes(k)))) {
// If all filters are git-related, route to all git relays
for (const url of GIT_RELAYS) {
for (const url of gitRelays) {
routes.set(url, filters);
}
}
@@ -62,7 +58,7 @@ const NostrProvider: React.FC<NostrProviderProps> = (props) => {
// If it's a git-related event, also publish to the git relays
if (GIT_KINDS.includes(event.kind)) {
for (const url of GIT_RELAYS) {
for (const url of gitRelays) {
allRelays.add(url);
}
}
+1 -1
View File
@@ -222,7 +222,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
Welcome to Shakespeare!
</h2>
<p className="text-lg text-muted-foreground max-w-md mx-auto">
Your AI-powered development assistant for building custom Nostr applications.
Your AI-powered development assistant for building custom applications.
Simply describe what you want to build, and AI will help you create it.
</p>
</div>
+2 -2
View File
@@ -645,8 +645,8 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
</div>
)}
{/* Error Alert (Console or AI) */}
{displayError && (
{/* Error Alert (Console or AI) - Don't show while assistant is loading */}
{displayError && !isLoading && (
<Quilly
error={displayError}
onDismiss={handleErrorDismiss}