init claude-code

This commit is contained in:
2026-04-01 17:32:37 +02:00
commit 73b208c009
1902 changed files with 513237 additions and 0 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+32
View File
@@ -0,0 +1,32 @@
import { c as _c } from "react/compiler-runtime";
import figures from 'figures';
import * as React from 'react';
import { Box, Text } from '../../ink.js';
import { getPluginTrustMessage } from '../../utils/plugins/marketplaceHelpers.js';
export function PluginTrustWarning() {
const $ = _c(3);
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t0 = getPluginTrustMessage();
$[0] = t0;
} else {
t0 = $[0];
}
const customMessage = t0;
let t1;
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
t1 = <Text color="claude">{figures.warning} </Text>;
$[1] = t1;
} else {
t1 = $[1];
}
let t2;
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
t2 = <Box marginBottom={1}>{t1}<Text dimColor={true} italic={true}>Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.{customMessage ? ` ${customMessage}` : ""}</Text></Box>;
$[2] = t2;
} else {
t2 = $[2];
}
return t2;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJmaWd1cmVzIiwiUmVhY3QiLCJCb3giLCJUZXh0IiwiZ2V0UGx1Z2luVHJ1c3RNZXNzYWdlIiwiUGx1Z2luVHJ1c3RXYXJuaW5nIiwiJCIsIl9jIiwidDAiLCJTeW1ib2wiLCJmb3IiLCJjdXN0b21NZXNzYWdlIiwidDEiLCJ3YXJuaW5nIiwidDIiXSwic291cmNlcyI6WyJQbHVnaW5UcnVzdFdhcm5pbmcud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sQ0FBQyxDQUFDLE1BQU0sQ0FBTixLQUFLLENBQUMsQ0FBQyxrU0FLRSxDQUFBRCxhQUFhLEdBQWIsSUFBb0JBLGFBQWEsRUFBTyxHQUF4QyxFQUF1QyxDQUMvRCxFQU5DLElBQUksQ0FPUCxFQVRDLEdBQUcsQ0FTRTtJQUFBTCxDQUFBLE1BQUFRLEVBQUE7RUFBQTtJQUFBQSxFQUFBLEdBQUFSLENBQUE7RUFBQTtFQUFBLE9BVE5RLEVBU007QUFBQSIsImlnbm9yZUxpc3QiOltdfQ==
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
import type { Command } from '../../commands.js';
const plugin = {
type: 'local-jsx',
name: 'plugin',
aliases: ['plugins', 'marketplace'],
description: 'Manage Claude Code plugins',
immediate: true,
load: () => import('./plugin.js')
} satisfies Command;
export default plugin;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJDb21tYW5kIiwicGx1Z2luIiwidHlwZSIsIm5hbWUiLCJhbGlhc2VzIiwiZGVzY3JpcHRpb24iLCJpbW1lZGlhdGUiLCJsb2FkIl0sInNvdXJjZXMiOlsiaW5kZXgudHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ29tbWFuZCB9IGZyb20gJy4uLy4uL2NvbW1hbmRzLmpzJ1xuXG5jb25zdCBwbHVnaW4gPSB7XG4gIHR5cGU6ICdsb2NhbC1qc3gnLFxuICBuYW1lOiAncGx1Z2luJyxcbiAgYWxpYXNlczogWydwbHVnaW5zJywgJ21hcmtldHBsYWNlJ10sXG4gIGRlc2NyaXB0aW9uOiAnTWFuYWdlIENsYXVkZSBDb2RlIHBsdWdpbnMnLFxuICBpbW1lZGlhdGU6IHRydWUsXG4gIGxvYWQ6ICgpID0+IGltcG9ydCgnLi9wbHVnaW4uanMnKSxcbn0gc2F0aXNmaWVzIENvbW1hbmRcblxuZXhwb3J0IGRlZmF1bHQgcGx1Z2luXG4iXSwibWFwcGluZ3MiOiJBQUFBLGNBQWNBLE9BQU8sUUFBUSxtQkFBbUI7QUFFaEQsTUFBTUMsTUFBTSxHQUFHO0VBQ2JDLElBQUksRUFBRSxXQUFXO0VBQ2pCQyxJQUFJLEVBQUUsUUFBUTtFQUNkQyxPQUFPLEVBQUUsQ0FBQyxTQUFTLEVBQUUsYUFBYSxDQUFDO0VBQ25DQyxXQUFXLEVBQUUsNEJBQTRCO0VBQ3pDQyxTQUFTLEVBQUUsSUFBSTtFQUNmQyxJQUFJLEVBQUVBLENBQUEsS0FBTSxNQUFNLENBQUMsYUFBYTtBQUNsQyxDQUFDLFdBQVdQLE9BQU87QUFFbkIsZUFBZUMsTUFBTSIsImlnbm9yZUxpc3QiOltdfQ==
+103
View File
@@ -0,0 +1,103 @@
// Parse plugin subcommand arguments into structured commands
export type ParsedCommand =
| { type: 'menu' }
| { type: 'help' }
| { type: 'install'; marketplace?: string; plugin?: string }
| { type: 'manage' }
| { type: 'uninstall'; plugin?: string }
| { type: 'enable'; plugin?: string }
| { type: 'disable'; plugin?: string }
| { type: 'validate'; path?: string }
| {
type: 'marketplace'
action?: 'add' | 'remove' | 'update' | 'list'
target?: string
}
export function parsePluginArgs(args?: string): ParsedCommand {
if (!args) {
return { type: 'menu' }
}
const parts = args.trim().split(/\s+/)
const command = parts[0]?.toLowerCase()
switch (command) {
case 'help':
case '--help':
case '-h':
return { type: 'help' }
case 'install':
case 'i': {
const target = parts[1]
if (!target) {
return { type: 'install' }
}
// Check if it's in format plugin@marketplace
if (target.includes('@')) {
const [plugin, marketplace] = target.split('@')
return { type: 'install', plugin, marketplace }
}
// Check if the target looks like a marketplace (URL or path)
const isMarketplace =
target.startsWith('http://') ||
target.startsWith('https://') ||
target.startsWith('file://') ||
target.includes('/') ||
target.includes('\\')
if (isMarketplace) {
// This is a marketplace URL/path, no plugin specified
return { type: 'install', marketplace: target }
}
// Otherwise treat it as a plugin name
return { type: 'install', plugin: target }
}
case 'manage':
return { type: 'manage' }
case 'uninstall':
return { type: 'uninstall', plugin: parts[1] }
case 'enable':
return { type: 'enable', plugin: parts[1] }
case 'disable':
return { type: 'disable', plugin: parts[1] }
case 'validate': {
const target = parts.slice(1).join(' ').trim()
return { type: 'validate', path: target || undefined }
}
case 'marketplace':
case 'market': {
const action = parts[1]?.toLowerCase()
const target = parts.slice(2).join(' ')
switch (action) {
case 'add':
return { type: 'marketplace', action: 'add', target }
case 'remove':
case 'rm':
return { type: 'marketplace', action: 'remove', target }
case 'update':
return { type: 'marketplace', action: 'update', target }
case 'list':
return { type: 'marketplace', action: 'list' }
default:
// No action specified, show marketplace menu
return { type: 'marketplace' }
}
}
default:
// Unknown command, show menu
return { type: 'menu' }
}
}
+7
View File
@@ -0,0 +1,7 @@
import * as React from 'react';
import type { LocalJSXCommandOnDone } from '../../types/command.js';
import { PluginSettings } from './PluginSettings.js';
export async function call(onDone: LocalJSXCommandOnDone, _context: unknown, args?: string): Promise<React.ReactNode> {
return <PluginSettings onComplete={onDone} args={args} />;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSZWFjdCIsIkxvY2FsSlNYQ29tbWFuZE9uRG9uZSIsIlBsdWdpblNldHRpbmdzIiwiY2FsbCIsIm9uRG9uZSIsIl9jb250ZXh0IiwiYXJncyIsIlByb21pc2UiLCJSZWFjdE5vZGUiXSwic291cmNlcyI6WyJwbHVnaW4udHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHR5cGUgeyBMb2NhbEpTWENvbW1hbmRPbkRvbmUgfSBmcm9tICcuLi8uLi90eXBlcy9jb21tYW5kLmpzJ1xuaW1wb3J0IHsgUGx1Z2luU2V0dGluZ3MgfSBmcm9tICcuL1BsdWdpblNldHRpbmdzLmpzJ1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gY2FsbChcbiAgb25Eb25lOiBMb2NhbEpTWENvbW1hbmRPbkRvbmUsXG4gIF9jb250ZXh0OiB1bmtub3duLFxuICBhcmdzPzogc3RyaW5nLFxuKTogUHJvbWlzZTxSZWFjdC5SZWFjdE5vZGU+IHtcbiAgcmV0dXJuIDxQbHVnaW5TZXR0aW5ncyBvbkNvbXBsZXRlPXtvbkRvbmV9IGFyZ3M9e2FyZ3N9IC8+XG59XG4iXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBS0EsS0FBSyxNQUFNLE9BQU87QUFDOUIsY0FBY0MscUJBQXFCLFFBQVEsd0JBQXdCO0FBQ25FLFNBQVNDLGNBQWMsUUFBUSxxQkFBcUI7QUFFcEQsT0FBTyxlQUFlQyxJQUFJQSxDQUN4QkMsTUFBTSxFQUFFSCxxQkFBcUIsRUFDN0JJLFFBQVEsRUFBRSxPQUFPLEVBQ2pCQyxJQUFhLENBQVIsRUFBRSxNQUFNLENBQ2QsRUFBRUMsT0FBTyxDQUFDUCxLQUFLLENBQUNRLFNBQVMsQ0FBQyxDQUFDO0VBQzFCLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUNKLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDRSxJQUFJLENBQUMsR0FBRztBQUMzRCIsImlnbm9yZUxpc3QiOltdfQ==
File diff suppressed because one or more lines are too long
+171
View File
@@ -0,0 +1,171 @@
import { useCallback, useMemo, useRef } from 'react'
const DEFAULT_MAX_VISIBLE = 5
type UsePaginationOptions = {
totalItems: number
maxVisible?: number
selectedIndex?: number
}
type UsePaginationResult<T> = {
// For backwards compatibility with page-based terminology
currentPage: number
totalPages: number
startIndex: number
endIndex: number
needsPagination: boolean
pageSize: number
// Get visible slice of items
getVisibleItems: (items: T[]) => T[]
// Convert visible index to actual index
toActualIndex: (visibleIndex: number) => number
// Check if actual index is visible
isOnCurrentPage: (actualIndex: number) => boolean
// Navigation (kept for API compatibility)
goToPage: (page: number) => void
nextPage: () => void
prevPage: () => void
// Handle selection - just updates the index, scrolling is automatic
handleSelectionChange: (
newIndex: number,
setSelectedIndex: (index: number) => void,
) => void
// Page navigation - returns false for continuous scrolling (not needed)
handlePageNavigation: (
direction: 'left' | 'right',
setSelectedIndex: (index: number) => void,
) => boolean
// Scroll position info for UI display
scrollPosition: {
current: number
total: number
canScrollUp: boolean
canScrollDown: boolean
}
}
export function usePagination<T>({
totalItems,
maxVisible = DEFAULT_MAX_VISIBLE,
selectedIndex = 0,
}: UsePaginationOptions): UsePaginationResult<T> {
const needsPagination = totalItems > maxVisible
// Use a ref to track the previous scroll offset for smooth scrolling
const scrollOffsetRef = useRef(0)
// Compute the scroll offset based on selectedIndex
// This ensures the selected item is always visible
const scrollOffset = useMemo(() => {
if (!needsPagination) return 0
const prevOffset = scrollOffsetRef.current
// If selected item is above the visible window, scroll up
if (selectedIndex < prevOffset) {
scrollOffsetRef.current = selectedIndex
return selectedIndex
}
// If selected item is below the visible window, scroll down
if (selectedIndex >= prevOffset + maxVisible) {
const newOffset = selectedIndex - maxVisible + 1
scrollOffsetRef.current = newOffset
return newOffset
}
// Selected item is within visible window, keep current offset
// But ensure offset is still valid
const maxOffset = Math.max(0, totalItems - maxVisible)
const clampedOffset = Math.min(prevOffset, maxOffset)
scrollOffsetRef.current = clampedOffset
return clampedOffset
}, [selectedIndex, maxVisible, needsPagination, totalItems])
const startIndex = scrollOffset
const endIndex = Math.min(scrollOffset + maxVisible, totalItems)
const getVisibleItems = useCallback(
(items: T[]): T[] => {
if (!needsPagination) return items
return items.slice(startIndex, endIndex)
},
[needsPagination, startIndex, endIndex],
)
const toActualIndex = useCallback(
(visibleIndex: number): number => {
return startIndex + visibleIndex
},
[startIndex],
)
const isOnCurrentPage = useCallback(
(actualIndex: number): boolean => {
return actualIndex >= startIndex && actualIndex < endIndex
},
[startIndex, endIndex],
)
// These are mostly no-ops for continuous scrolling but kept for API compatibility
const goToPage = useCallback((_page: number) => {
// No-op - scrolling is controlled by selectedIndex
}, [])
const nextPage = useCallback(() => {
// No-op - scrolling is controlled by selectedIndex
}, [])
const prevPage = useCallback(() => {
// No-op - scrolling is controlled by selectedIndex
}, [])
// Simple selection handler - just updates the index
// Scrolling happens automatically via the useMemo above
const handleSelectionChange = useCallback(
(newIndex: number, setSelectedIndex: (index: number) => void) => {
const clampedIndex = Math.max(0, Math.min(newIndex, totalItems - 1))
setSelectedIndex(clampedIndex)
},
[totalItems],
)
// Page navigation - disabled for continuous scrolling
const handlePageNavigation = useCallback(
(
_direction: 'left' | 'right',
_setSelectedIndex: (index: number) => void,
): boolean => {
return false
},
[],
)
// Calculate page-like values for backwards compatibility
const totalPages = Math.max(1, Math.ceil(totalItems / maxVisible))
const currentPage = Math.floor(scrollOffset / maxVisible)
return {
currentPage,
totalPages,
startIndex,
endIndex,
needsPagination,
pageSize: maxVisible,
getVisibleItems,
toActualIndex,
isOnCurrentPage,
goToPage,
nextPage,
prevPage,
handleSelectionChange,
handlePageNavigation,
scrollPosition: {
current: selectedIndex + 1,
total: totalItems,
canScrollUp: scrollOffset > 0,
canScrollDown: scrollOffset + maxVisible < totalItems,
},
}
}