mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Add memory plugin with semantic search and session planning (#145)
* Add memory plugin with semantic search and session planning * Clarify Memory Plugin is optional in docs
This commit is contained in:
1 parent
da283a82cf
commit
3461f86556
132 files changed
+11448
-2834
No files matched your search
@@ -12,11 +12,7 @@ interface GitFlatFileListProps {
|
||||
onSelect: (path: string, staged: boolean) => void
|
||||
onStage?: (paths: string[]) => void
|
||||
onUnstage?: (paths: string[]) => void
|
||||
onDiscard?: (paths: string[], staged: boolean) => void
|
||||
selectedFile?: string
|
||||
readOnly?: boolean
|
||||
totalAdditions?: number
|
||||
totalDeletions?: number
|
||||
}
|
||||
|
||||
interface GroupedFiles {
|
||||
@@ -32,11 +28,7 @@ export function GitFlatFileList({
|
||||
onSelect,
|
||||
onStage,
|
||||
onUnstage,
|
||||
onDiscard,
|
||||
selectedFile,
|
||||
readOnly = false,
|
||||
totalAdditions,
|
||||
totalDeletions,
|
||||
}: GitFlatFileListProps) {
|
||||
const [collapsedGroups, setCollapsedGroups] = useState<Set<GitFileStatusType>>(new Set())
|
||||
|
||||
@@ -91,13 +83,6 @@ export function GitFlatFileList({
|
||||
}
|
||||
}
|
||||
|
||||
const handleDiscardAll = (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
if (onDiscard) {
|
||||
onDiscard(filteredFiles.map(f => f.path), staged)
|
||||
}
|
||||
}
|
||||
|
||||
if (filteredFiles.length === 0) {
|
||||
return null
|
||||
}
|
||||
@@ -108,44 +93,24 @@ export function GitFlatFileList({
|
||||
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wider">
|
||||
{staged ? 'Staged Changes' : 'Changes'} ({filteredFiles.length})
|
||||
</span>
|
||||
{(totalAdditions !== undefined && totalAdditions > 0 || totalDeletions !== undefined && totalDeletions > 0) && (
|
||||
<div className="flex items-center gap-1 text-xs">
|
||||
{totalAdditions !== undefined && totalAdditions > 0 && <span className="text-green-500">+{totalAdditions}</span>}
|
||||
{totalDeletions !== undefined && totalDeletions > 0 && <span className="text-red-500">-{totalDeletions}</span>}
|
||||
</div>
|
||||
)}
|
||||
{!readOnly && (
|
||||
<div className="flex items-center gap-1">
|
||||
{onDiscard && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 px-2 text-xs text-rose-500 hover:text-rose-600"
|
||||
onClick={handleDiscardAll}
|
||||
>
|
||||
Discard All
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 px-2 text-xs"
|
||||
onClick={staged ? handleUnstageAll : handleStageAll}
|
||||
>
|
||||
{staged ? (
|
||||
<>
|
||||
<Minus className="w-3 h-3 mr-1" />
|
||||
Unstage All
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Plus className="w-3 h-3 mr-1" />
|
||||
Stage All
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 px-2 text-xs"
|
||||
onClick={staged ? handleUnstageAll : handleStageAll}
|
||||
>
|
||||
{staged ? (
|
||||
<>
|
||||
<Minus className="w-3 h-3 mr-1" />
|
||||
Unstage All
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Plus className="w-3 h-3 mr-1" />
|
||||
Stage All
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{groupedFiles.map(({ status, files: groupFiles }) => {
|
||||
@@ -178,9 +143,8 @@ export function GitFlatFileList({
|
||||
file={file}
|
||||
isSelected={selectedFile === file.path}
|
||||
onSelect={onSelect}
|
||||
onStage={readOnly ? undefined : handleStageFile}
|
||||
onUnstage={readOnly ? undefined : handleUnstageFile}
|
||||
onDiscard={readOnly ? undefined : onDiscard ? ((path: string, staged: boolean) => onDiscard([path], staged)) : undefined}
|
||||
onStage={handleStageFile}
|
||||
onUnstage={handleUnstageFile}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user