tool registry, claude tool awareness, and model selector fix

- Add agent-agnostic tool registry (tool-registry.ts) that discovers tools from disk
- Embed tool-loader extension as platform infrastructure (ensure-tool-loader.ts)
- Inject tool context into Claude prompts on first message
- Add marketplace tool sync (sync-marketplace.ts)
- Fix model selector defaulting to claude-code when no model explicitly selected
- Exclude tool-loader-source.ts from tsconfig (Pi-specific deps)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 11:55:38 +00:00
co-authored by Claude Opus 4.6
parent e97b4b2459
commit 49cd559c8a
8 changed files with 565 additions and 11 deletions
@@ -1,3 +1,4 @@
import { useEffect } from 'react';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import type { ModelOption } from 'state/useModels';
import { getProviderDisplayName } from 'state/useModels';
@@ -54,6 +55,13 @@ export function ModelSelector({
const providerModels = availableModels.filter((m) => m.provider === activeProvider);
const fallbackModelId = providerModels[0]?.id ?? null;
// Sync actual selection when UI shows a fallback provider but nothing is selected
useEffect(() => {
if (!selectedModel && !model && fallbackModelId) {
onModelChange(fallbackModelId);
}
}, [selectedModel, model, fallbackModelId]);
// Lock after session has started
const isLocked = hasStarted || isGenerating || !isConnected;