claude-code-session-manager 0.88.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentLibrary-kQF8_wAw.js → AgentLibrary-CrmoSn9-.js} +1 -1
- package/dist/assets/DataModel-SPLQTR8E.js +1 -0
- package/dist/assets/{History-Sji2brb0.js → History-DT6S3abz.js} +2 -2
- package/dist/assets/{Hooks-CtqpO-p5.js → Hooks-CC2iv5Oq.js} +3 -3
- package/dist/assets/{HostBilko-DN0ydOCr.js → HostBilko-DqY7dA2a.js} +1 -1
- package/dist/assets/{Library-CoiLZTKh.js → Library-CUoOC77T.js} +1 -1
- package/dist/assets/{ListDetail-CmqiQ_io.js → ListDetail-DgrG72f4.js} +1 -1
- package/dist/assets/MarkdownEditor-C8dB3ZWU.js +1 -0
- package/dist/assets/{McpServers-Bj1X3_NT.js → McpServers-DupdjvFt.js} +2 -2
- package/dist/assets/{Memory-1PKjsM3b.js → Memory-C_4LhC2r.js} +6 -6
- package/dist/assets/{Panel-I1s6ghPo.js → Panel-DWmE5Fu9.js} +1 -1
- package/dist/assets/{Permissions-BhiiZjHQ.js → Permissions-hxiN2IWM.js} +3 -3
- package/dist/assets/{Plugins-gv3_fkPX.js → Plugins-fttEgZqy.js} +2 -2
- package/dist/assets/{ProvenanceBadge-BGcgBd8V.js → ProvenanceBadge-DROCzlbx.js} +1 -1
- package/dist/assets/{SaveBar-BGr9eZ4g.js → SaveBar-BZs0IQHq.js} +1 -1
- package/dist/assets/Scheduler-Bi4oZ8gg.js +16 -0
- package/dist/assets/{ScopeSwitcher-ukl0qWaA.js → ScopeSwitcher-C0538XU8.js} +1 -1
- package/dist/assets/{Settings-DJkFj22G.js → Settings-CcW6x-wu.js} +2 -2
- package/dist/assets/{SkillReferenceGraph-0t1Qblp6.js → SkillReferenceGraph-BtCcPAYO.js} +1 -1
- package/dist/assets/{Skills-CeVdBGE-.js → Skills-Daf_1sQR.js} +2 -2
- package/dist/assets/SystemPrompt-rYIla_wt.js +1 -0
- package/dist/assets/{TagLibrary-DAzNaUPd.js → TagLibrary-81Mr1RLU.js} +1 -1
- package/dist/assets/{TiptapBody--S_rGXoA.js → TiptapBody-BxuLNg1e.js} +1 -1
- package/dist/assets/{Toggle-Dszm0xnp.js → Toggle-CN8EVEai.js} +1 -1
- package/dist/assets/{index-Dp4Rc--q.js → index-A9TWmB7_.js} +345 -345
- package/dist/assets/{index-BHTX4OTc.css → index-Dh7BLxdA.css} +1 -1
- package/dist/assets/{settingsSchema-BLbssMYo.js → settingsSchema-C9I9a0jv.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/scripts/README.md +1 -0
- package/src/main/__tests__/chatRunner-session-flag-retry.test.cjs +159 -0
- package/src/main/__tests__/health-delegation-chain.test.cjs +3 -1
- package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +16 -4
- package/src/main/__tests__/scheduler-default-eligible-heal.test.cjs +10 -3
- package/src/main/__tests__/scheduler-integration-failure-stamp.test.cjs +41 -0
- package/src/main/__tests__/scheduler-looks-done.test.cjs +9 -2
- package/src/main/__tests__/scheduler-mechanical-recovery.test.cjs +23 -0
- package/src/main/__tests__/scheduler-needs-review-autoresolve.test.cjs +14 -6
- package/src/main/__tests__/scheduler-shard-quarantine.test.cjs +2 -2
- package/src/main/__tests__/scheduler-stranded-autofix-park.test.cjs +8 -1
- package/src/main/__tests__/transcripts-paged-reads.test.cjs +4 -2
- package/src/main/__tests__/transcripts-worktree-epic-path.test.cjs +154 -0
- package/src/main/__tests__/usageSingleFlight.test.cjs +3 -1
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +108 -45
- package/src/main/health.cjs +20 -3
- package/src/main/ipcSchemas.cjs +3 -0
- package/src/main/lib/__tests__/epicSpawnCwd.test.cjs +34 -0
- package/src/main/lib/__tests__/epicSpawnPlan.test.cjs +117 -0
- package/src/main/lib/__tests__/epicTranscriptPath.test.cjs +163 -0
- package/src/main/lib/__tests__/gitWorktree.test.cjs +172 -0
- package/src/main/lib/__tests__/localAdminHttp.test.cjs +5 -1
- package/src/main/lib/__tests__/schedulerPathsWorktree.test.cjs +40 -1
- package/src/main/lib/__tests__/telemetryCountersMetadataColumn.test.cjs +8 -5
- package/src/main/lib/effectiveModelInfo.cjs +3 -3
- package/src/main/lib/epicDelegationStats.cjs +3 -2
- package/src/main/lib/epicSpawnCwd.cjs +36 -5
- package/src/main/lib/epicSpawnPlan.cjs +119 -0
- package/src/main/lib/epicTranscriptDiagnostic.cjs +79 -0
- package/src/main/lib/epicTranscriptPath.cjs +184 -0
- package/src/main/lib/gitWorktree.cjs +196 -4
- package/src/main/lib/mcpToolCatalog.cjs +6 -1
- package/src/main/lib/prdCreate.cjs +27 -1
- package/src/main/lib/prdFrontmatter.cjs +16 -5
- package/src/main/lib/rcaReport.cjs +35 -4
- package/src/main/lib/schedulerPaths.cjs +27 -4
- package/src/main/lib/telemetryClient.cjs +11 -4
- package/src/main/lib/terminalRunOutcome.cjs +1 -0
- package/src/main/pty.cjs +1 -1
- package/src/main/runVerify.cjs +89 -1
- package/src/main/scheduler.cjs +106 -18
- package/src/main/templates/PRD_AUTHORING.md +11 -0
- package/src/main/transcripts.cjs +28 -7
- package/src/preload/api.d.ts +2 -0
- package/src/preload/index.cjs +1 -0
- package/dist/assets/DataModel-CY_mMnsr.js +0 -1
- package/dist/assets/MarkdownEditor-HPoNeKhT.js +0 -1
- package/dist/assets/Scheduler-Bdo_awPq.js +0 -14
- package/dist/assets/SystemPrompt-CfKvNHi3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aC as D,al as m,aa as e,j as P,b as j,aw as T}from"./index-Dp4Rc--q.js";const G=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],q=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],M=[{id:"session-manager-dev",name:"Session Manager Dev",description:"Default end-to-end dev skillset: /develop + /prd (decompose → scheduler PRDs), /process-feedback + /my-feedback (cross-project intake), /project-status + /optimize-kpi + /local-project-health (status & KPI loop), /requesting-code-review + /security-review (review gate), /explain-to-me (HUMAN_LEARN docs).",official:!1,source:"https://github.com/StanislavBG/claude-code-session-manager/tree/main/plugins/session-manager-dev",bundles:["skills"],marketplace:{add:"bundled",name:"session-manager"}},{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]},{id:"clangd-lsp",name:"clangd-lsp",description:"C/C++ diagnostics via clangd. Requires clangd on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp",bundles:["hooks","commands"]},{id:"csharp-lsp",name:"csharp-lsp",description:"C# diagnostics. Requires OmniSharp or Roslyn LSP on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp",bundles:["hooks","commands"]},{id:"jdtls-lsp",name:"jdtls-lsp",description:"Java diagnostics via Eclipse JDT LS. Requires jdtls on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp",bundles:["hooks","commands"]},{id:"kotlin-lsp",name:"kotlin-lsp",description:"Kotlin diagnostics. Requires kotlin-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp",bundles:["hooks","commands"]},{id:"lua-lsp",name:"lua-lsp",description:"Lua diagnostics. Requires lua-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp",bundles:["hooks","commands"]},{id:"php-lsp",name:"php-lsp",description:"PHP diagnostics. Requires intelephense or phpactor on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp",bundles:["hooks","commands"]},{id:"swift-lsp",name:"swift-lsp",description:"Swift diagnostics via sourcekit-lsp. Requires sourcekit-lsp on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp",bundles:["hooks","commands"]},{id:"github",name:"github",description:"GitHub PRs, issues, gh-style flows.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/github",bundles:["mcp"]},{id:"gitlab",name:"gitlab",description:"GitLab MRs, issues, pipelines.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gitlab",bundles:["mcp"]},{id:"atlassian",name:"atlassian",description:"Jira / Confluence search and updates.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/atlassian",bundles:["mcp"]},{id:"asana",name:"asana",description:"Asana task and project ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/asana",bundles:["mcp"]},{id:"linear",name:"linear",description:"Linear issue tracking — pairs with the Tasks tab.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/linear",bundles:["mcp"]},{id:"notion",name:"notion",description:"Notion document lookup and edits.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/notion",bundles:["mcp"]},{id:"figma",name:"figma",description:"Figma file inspection for UI work.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/figma",bundles:["mcp"]},{id:"vercel",name:"vercel",description:"Vercel deploy diagnostics.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/vercel",bundles:["mcp"]},{id:"firebase",name:"firebase",description:"Firebase project + Firestore ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/firebase",bundles:["mcp"]},{id:"supabase",name:"supabase",description:"Supabase database operations.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/supabase",bundles:["mcp"]},{id:"slack",name:"slack",description:"Slack DM / channel posting from agents.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/slack",bundles:["mcp"]},{id:"sentry",name:"sentry",description:"Sentry bug triage and event lookup.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/sentry",bundles:["mcp"]}],F=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],A=(t,o,l,n)=>`---
|
|
1
|
+
import{aN as D,au as m,ah as e,l as P,b as j,aH as T}from"./index-A9TWmB7_.js";const G=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],q=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],M=[{id:"session-manager-dev",name:"Session Manager Dev",description:"Default end-to-end dev skillset: /develop + /prd (decompose → scheduler PRDs), /process-feedback + /my-feedback (cross-project intake), /project-status + /optimize-kpi + /local-project-health (status & KPI loop), /requesting-code-review + /security-review (review gate), /explain-to-me (HUMAN_LEARN docs).",official:!1,source:"https://github.com/StanislavBG/claude-code-session-manager/tree/main/plugins/session-manager-dev",bundles:["skills"],marketplace:{add:"bundled",name:"session-manager"}},{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]},{id:"clangd-lsp",name:"clangd-lsp",description:"C/C++ diagnostics via clangd. Requires clangd on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp",bundles:["hooks","commands"]},{id:"csharp-lsp",name:"csharp-lsp",description:"C# diagnostics. Requires OmniSharp or Roslyn LSP on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp",bundles:["hooks","commands"]},{id:"jdtls-lsp",name:"jdtls-lsp",description:"Java diagnostics via Eclipse JDT LS. Requires jdtls on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp",bundles:["hooks","commands"]},{id:"kotlin-lsp",name:"kotlin-lsp",description:"Kotlin diagnostics. Requires kotlin-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp",bundles:["hooks","commands"]},{id:"lua-lsp",name:"lua-lsp",description:"Lua diagnostics. Requires lua-language-server on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp",bundles:["hooks","commands"]},{id:"php-lsp",name:"php-lsp",description:"PHP diagnostics. Requires intelephense or phpactor on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp",bundles:["hooks","commands"]},{id:"swift-lsp",name:"swift-lsp",description:"Swift diagnostics via sourcekit-lsp. Requires sourcekit-lsp on $PATH.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp",bundles:["hooks","commands"]},{id:"github",name:"github",description:"GitHub PRs, issues, gh-style flows.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/github",bundles:["mcp"]},{id:"gitlab",name:"gitlab",description:"GitLab MRs, issues, pipelines.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gitlab",bundles:["mcp"]},{id:"atlassian",name:"atlassian",description:"Jira / Confluence search and updates.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/atlassian",bundles:["mcp"]},{id:"asana",name:"asana",description:"Asana task and project ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/asana",bundles:["mcp"]},{id:"linear",name:"linear",description:"Linear issue tracking — pairs with the Tasks tab.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/linear",bundles:["mcp"]},{id:"notion",name:"notion",description:"Notion document lookup and edits.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/notion",bundles:["mcp"]},{id:"figma",name:"figma",description:"Figma file inspection for UI work.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/figma",bundles:["mcp"]},{id:"vercel",name:"vercel",description:"Vercel deploy diagnostics.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/vercel",bundles:["mcp"]},{id:"firebase",name:"firebase",description:"Firebase project + Firestore ops.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/firebase",bundles:["mcp"]},{id:"supabase",name:"supabase",description:"Supabase database operations.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/supabase",bundles:["mcp"]},{id:"slack",name:"slack",description:"Slack DM / channel posting from agents.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/slack",bundles:["mcp"]},{id:"sentry",name:"sentry",description:"Sentry bug triage and event lookup.",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/sentry",bundles:["mcp"]}],F=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],A=(t,o,l,n)=>`---
|
|
2
2
|
name: ${t}
|
|
3
3
|
description: ${o}
|
|
4
4
|
tools: ${l}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ah as e}from"./index-A9TWmB7_.js";function o({sidebar:r,detail:s,sidebarWidth:i="18rem"}){return e.jsxs("div",{className:"h-full flex",children:[e.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:i},children:r}),e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:s})]})}export{o as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ah as i,F as r}from"./index-A9TWmB7_.js";function l({value:e,onChange:n,path:o,readOnly:a}){return i.jsx(r,{path:`file://${o}`,defaultLanguage:"markdown",value:e,onChange:t=>n(t??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:a,automaticLayout:!0}})}export{l as M};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`}function we(n){let t=Object.keys(n).length+1,a=`server-${t}`;for(;n[a];)t+=1,a=`server-${t}`;return a}function Se(){const n=oe(),t=ie(),a=(t==null?void 0:t.cwd)??null,d=ce(s=>s.navFace),p=c.useRef(!1),b=c.useRef(d),[o,j]=c.useState(()=>d==="project"&&a?"project":"user"),[r,h]=c.useState(null),[x,u]=c.useState("installed"),[w,_]=c.useState("");c.useEffect(()=>{if(b.current!==d){if(b.current=d,p.current){p.current=!1;return}j(d==="project"&&a?"project":"user")}},[d,a]);const f=c.useMemo(()=>n?ve(o,n,a):null,[n,o,a]),E=N(s=>s.files),l=N(s=>s.loadJson),v=N(s=>s.setDraft),m=N(s=>s.saveJson),I=N(s=>s.revert),T=N(s=>s.watchFile),X=N(s=>s.unwatchFile);c.useEffect(()=>{if(f)return E[f]||l(f),T(f),()=>X(f)},[f]);const[ee,R]=c.useState(null),[J,z]=c.useState(null),[B,K]=c.useState(!1),F=c.useRef(0),A=c.useRef(!0);c.useEffect(()=>()=>{A.current=!1},[]);const V=async()=>{const s=++F.current;K(!0);try{const i=await window.api.mcp.status();if(!A.current||s!==F.current)return;z(i),i.ok||q.error(i.error??"MCP status probe failed")}catch(i){if(!A.current||s!==F.current)return;z(null),q.error(i.message||"MCP status probe failed")}finally{A.current&&s===F.current&&K(!1)}};if(c.useEffect(()=>{V()},[]),!n)return e.jsx(O,{title:"loading…"});if(x==="library")return e.jsx($,{toolbar:e.jsx(D,{active:x,onChange:u}),children:e.jsx(ue,{})});if(o==="project"&&!a)return e.jsx($,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(D,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(Y,{scopes:["user","project"],active:o,onChange:s=>{p.current=!0,j(s)}})]}),children:e.jsx(O,{title:"no active project"})});if(!f)return e.jsx(O,{title:"loading…"});const y=E[f],{full:te,servers:g,err:se}=y?ye(y.draftRaw):{full:{},servers:{},err:null},L=Object.keys(g).sort(),M=r?g[r]:null,P=s=>{R(null),v(f,Ne(te,s))},ae=()=>{const s=we(g);P({...g,[s]:{type:"stdio",command:"",args:[]}}),h(s)},le=s=>{const i={...g};delete i[s],P(i),r===s&&h(null)},ne=(s,i)=>{if(!i||i===s||g[i])return;const S={};for(const C of Object.keys(g))S[C===s?i:C]=g[C];P(S),h(i)},re=(s,i)=>{P({...g,[s]:i})};return e.jsx($,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(D,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(Y,{scopes:["user","project"],active:o,onChange:s=>{p.current=!0,j(s)}}),e.jsxs("span",{className:"ml-3 px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-faint",children:[L.length," server",L.length===1?"":"s"]}),e.jsx("span",{className:"ml-2 text-fg-faint truncate",children:f}),e.jsx("div",{className:"flex-1"}),r&&M&&e.jsx(G,{scope:o,input:U(r,M),className:"mr-2"}),e.jsx("button",{onClick:V,disabled:B,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50 mr-2",children:B?"checking…":"⟳ test connections"}),e.jsx("button",{onClick:ae,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:y?e.jsx(xe,{dirty:y.dirty,busy:y.busy,parseError:ee||se||y.parseError,lastSavedAt:y.lastSavedAt,onSave:async()=>{R(null);const s=await m(f);s.ok||R(s.error??"save failed")},onRevert:()=>{R(null),I(f)}}):null,children:e.jsx(de,{sidebar:e.jsxs("div",{className:"py-2",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:w,onChange:s=>_(s.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),L.length===0?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):L.filter(s=>!w||s.toLowerCase().includes(w.toLowerCase())).map(s=>{var C;const i=H(s,J),S=(C=g[s].description)==null?void 0:C.trim();return e.jsxs("button",{onClick:()=>h(s),className:`w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 ${r===s?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(W,{state:i.dotState,title:i.label}),e.jsx("span",{className:"truncate",children:s})]}),e.jsxs("span",{className:"ml-2 flex items-center gap-2 shrink-0",children:[e.jsx(Q,{tone:i.badgeTone,children:i.label}),e.jsx(G,{interactive:!1,scope:o,input:U(s,g[s])}),e.jsx("span",{className:"text-fg-faint",children:g[s].type??"stdio"})]})]}),S?e.jsx("span",{className:"pl-5 text-fg-faint truncate",title:S,children:S}):null]},s)})]}),detail:r&&M?e.jsx(Ce,{name:r,server:M,connection:H(r,J),onTestConnection:V,testing:B,onRename:s=>ne(r,s),onChange:s=>re(r,s),onRemove:()=>le(r)}):e.jsx(O,{title:"select a server or click + new"})})})}const Pe=c.memo(Se);function Ce({name:n,server:t,connection:a,onTestConnection:d,testing:p,onRename:b,onChange:o,onRemove:j}){var E;const r=t.type??"stdio",h=be.has(n),x=je.has(n),u=(E=t.permissions)==null?void 0:E.tools,w=u===void 0?"inherit":u==="allow"?"allow":u==="deny"?"deny":"list",_=Array.isArray(u)?u:[],f=(t.disabledTools??[]).join(", ");return e.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{state:a.dotState,size:"md",title:a.label}),e.jsx(Q,{tone:a.badgeTone,children:a.label}),e.jsx("button",{onClick:d,disabled:p,className:"ml-auto px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50",children:p?"checking…":"test connection"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),e.jsx("input",{defaultValue:n,onBlur:l=>b(l.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),e.jsx("button",{onClick:j,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),e.jsx(k,{label:"description",value:t.description??"",onChange:l=>o({...t,description:l||void 0}),placeholder:"what this server does…"}),h?e.jsxs("div",{className:"text-xs px-2 py-1 border border-red-500/50 rounded text-red-300 bg-red-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:n})," is a reserved name — Claude Code will refuse to load this server (v2.1.128+)."]}):x?e.jsxs("div",{className:"text-xs px-2 py-1 border border-yellow-600/50 rounded text-yellow-200 bg-yellow-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:n})," collides with a commonly-bundled MCP name; expect surprises in other tools."]}):null,e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),e.jsx("select",{value:r,onChange:l=>o({...t,type:l.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:he.map(l=>e.jsx("option",{value:l,children:l},l))}),r==="sse"?e.jsx("span",{className:"text-xs text-yellow-400/80",children:"sse is deprecated — prefer streamable-http"}):null]}),r==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"command",value:t.command??"",onChange:l=>o({...t,command:l}),placeholder:"npx / node / python …"}),e.jsx(k,{label:"args",value:(t.args??[]).join(" "),onChange:l=>o({...t,args:l.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),e.jsx(Z,{label:"env",value:t.env??{},onChange:l=>o({...t,env:l})})]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"url",value:t.url??"",onChange:l=>o({...t,url:l}),placeholder:"https://…"}),e.jsx(Z,{label:"headers",value:t.headers??{},onChange:l=>o({...t,headers:l})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"alwaysLoad"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.alwaysLoad===!0,onChange:l=>o({...t,alwaysLoad:l.target.checked||void 0})}),e.jsx("span",{className:"text-fg-dim",children:"bypass tool-search deferral (v2.1.121+)"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"enabled"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.enabled!==!1,onChange:l=>o({...t,enabled:l.target.checked?void 0:!1})}),e.jsx("span",{className:"text-fg-dim",children:"load this server in new sessions"})]})]}),e.jsx(k,{label:"disabledTools",value:f,onChange:l=>{const v=l.split(",").map(m=>m.trim()).filter(Boolean);o({...t,disabledTools:v.length?v:void 0})},placeholder:"comma-separated tool names to hide"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:"permissions"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("select",{value:w,onChange:l=>{const v=l.target.value,m={...t};if(v==="inherit"){if(m.permissions){const{tools:I,...T}=m.permissions;m.permissions=Object.keys(T).length?T:void 0}}else v==="list"?m.permissions={...m.permissions??{},tools:[]}:m.permissions={...m.permissions??{},tools:v};o(m)},className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[e.jsx("option",{value:"inherit",children:"inherit (default)"}),e.jsx("option",{value:"allow",children:"allow all tools"}),e.jsx("option",{value:"deny",children:"deny all tools"}),e.jsx("option",{value:"list",children:"allowlist…"})]}),w==="list"?e.jsx("input",{value:_.join(", "),onChange:l=>{const v=l.target.value.split(",").map(m=>m.trim()).filter(Boolean);o({...t,permissions:{...t.permissions??{},tools:v}})},placeholder:"comma-separated tool names",className:"w-full bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}):null]})]})]})}function k({label:n,value:t,onChange:a,placeholder:d}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:n}),e.jsx("input",{value:t,onChange:p=>a(p.target.value),placeholder:d,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function Z({label:n,value:t,onChange:a}){const[d,p]=c.useState(""),[b,o]=c.useState(""),j=Object.entries(t);return e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:n}),e.jsxs("div",{className:"flex-1 space-y-1",children:[j.map(([r,h])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:r,onChange:x=>{const u={...t};delete u[r],u[x.target.value]=h,a(u)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("input",{value:h,onChange:x=>a({...t,[r]:x.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("button",{onClick:()=>{const x={...t};delete x[r],a(x)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},r)),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:d,onChange:r=>p(r.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("input",{value:b,onChange:r=>o(r.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("button",{onClick:()=>{d.trim()&&(a({...t,[d.trim()]:b}),p(""),o(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}export{Pe as McpServers,we as nextServerName};
|
|
1
|
+
import{ah as e,au as c,aN as oe,aI as ie,aP as ce,aK as N,l as O,b as Q,aH as q}from"./index-A9TWmB7_.js";import{P as $}from"./Panel-DWmE5Fu9.js";import{L as de}from"./ListDetail-DgrG72f4.js";import{S as xe}from"./SaveBar-BZs0IQHq.js";import{S as H}from"./ScopeSwitcher-C0538XU8.js";import{P as Y}from"./ProvenanceBadge-DROCzlbx.js";import{M as ue,V as D}from"./Library-CUoOC77T.js";import"./monaco-editor-BW5C4Iv1.js";const pe={live:"bg-emerald-400",idle:"bg-amber-400",offline:"bg-fg-faint",attention:"bg-accent",paused:"bg-zinc-500"},fe={sm:"w-1.5 h-1.5",md:"w-2 h-2"},me={on:"live",off:"offline",warn:"attention",live:"live",idle:"idle"};function W({state:n,kind:t,pulse:a=!1,size:d="sm",className:p="",title:b,"aria-label":o}){const j=n??(t?me[t]:"idle"),r=pe[j],g=fe[d],x=a?"animate-pulse":"",u=o??b??j;return e.jsx("span",{role:"img","aria-label":u,className:`inline-block rounded-full ${g} ${r} ${x} ${p}`.trim(),title:b})}const he={failed:"Failed","needs-auth":"Needs auth",pending:"Pending approval"};function G(n,t){const a=t!=null&&t.ok?t.servers.find(d=>d.name===n):void 0;return!a||a.status==="unknown"?{state:"unprobed",label:"Not checked",probeStatus:(a==null?void 0:a.status)??null,badgeTone:"dim",dotState:"offline"}:a.status==="connected"?{state:"ready",label:"Ready",probeStatus:a.status,badgeTone:"good",dotState:"live"}:{state:"not-ready",label:he[a.status],probeStatus:a.status,badgeTone:"warn",dotState:"attention"}}const U=(n,t)=>({type:"mcp",name:n,command:t.command,args:t.args,url:t.url}),ge=["stdio","http","streamable-http","sse","ws"],be=new Set(["workspace"]),je=new Set(["ide","tasks"]);function ve(n,t,a){return n==="user"?`${t}/.claude.json`:a?`${a}/.mcp.json`:null}function ye(n){if(n.trim()==="")return{full:{},servers:{},err:null};try{const t=JSON.parse(n),a=t.mcpServers??{};return{full:t,servers:a,err:null}}catch(t){return{full:{},servers:{},err:t.message}}}function Ne(n,t){return JSON.stringify({...n,mcpServers:t},null,2)+`
|
|
2
|
+
`}function we(n){let t=Object.keys(n).length+1,a=`server-${t}`;for(;n[a];)t+=1,a=`server-${t}`;return a}function Se(){const n=oe(),t=ie(),a=(t==null?void 0:t.cwd)??null,d=ce(s=>s.navFace),p=c.useRef(!1),b=c.useRef(d),[o,j]=c.useState(()=>d==="project"&&a?"project":"user"),[r,g]=c.useState(null),[x,u]=c.useState("installed"),[w,_]=c.useState("");c.useEffect(()=>{if(b.current!==d){if(b.current=d,p.current){p.current=!1;return}j(d==="project"&&a?"project":"user")}},[d,a]);const f=c.useMemo(()=>n?ve(o,n,a):null,[n,o,a]),k=N(s=>s.files),l=N(s=>s.loadJson),v=N(s=>s.setDraft),m=N(s=>s.saveJson),I=N(s=>s.revert),T=N(s=>s.watchFile),X=N(s=>s.unwatchFile);c.useEffect(()=>{if(f)return k[f]||l(f),T(f),()=>X(f)},[f]);const[ee,R]=c.useState(null),[J,K]=c.useState(null),[B,z]=c.useState(!1),F=c.useRef(0),A=c.useRef(!0);c.useEffect(()=>()=>{A.current=!1},[]);const V=async()=>{const s=++F.current;z(!0);try{const i=await window.api.mcp.status();if(!A.current||s!==F.current)return;K(i),i.ok||q.error(i.error??"MCP status probe failed")}catch(i){if(!A.current||s!==F.current)return;K(null),q.error(i.message||"MCP status probe failed")}finally{A.current&&s===F.current&&z(!1)}};if(c.useEffect(()=>{V()},[]),!n)return e.jsx(O,{title:"loading…"});if(x==="library")return e.jsx($,{toolbar:e.jsx(D,{active:x,onChange:u}),children:e.jsx(ue,{})});if(o==="project"&&!a)return e.jsx($,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(D,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(H,{scopes:["user","project"],active:o,onChange:s=>{p.current=!0,j(s)}})]}),children:e.jsx(O,{title:"no active project"})});if(!f)return e.jsx(O,{title:"loading…"});const y=k[f],{full:te,servers:h,err:se}=y?ye(y.draftRaw):{full:{},servers:{},err:null},L=Object.keys(h).sort(),M=r?h[r]:null,P=s=>{R(null),v(f,Ne(te,s))},ae=()=>{const s=we(h);P({...h,[s]:{type:"stdio",command:"",args:[]}}),g(s)},le=s=>{const i={...h};delete i[s],P(i),r===s&&g(null)},ne=(s,i)=>{if(!i||i===s||h[i])return;const S={};for(const C of Object.keys(h))S[C===s?i:C]=h[C];P(S),g(i)},re=(s,i)=>{P({...h,[s]:i})};return e.jsx($,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(D,{active:x,onChange:u}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(H,{scopes:["user","project"],active:o,onChange:s=>{p.current=!0,j(s)}}),e.jsxs("span",{className:"ml-3 px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-faint",children:[L.length," server",L.length===1?"":"s"]}),e.jsx("span",{className:"ml-2 text-fg-faint truncate",children:f}),e.jsx("div",{className:"flex-1"}),r&&M&&e.jsx(Y,{scope:o,input:U(r,M),className:"mr-2"}),e.jsx("button",{onClick:V,disabled:B,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50 mr-2",children:B?"checking…":"⟳ test connections"}),e.jsx("button",{onClick:ae,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:y?e.jsx(xe,{dirty:y.dirty,busy:y.busy,parseError:ee||se||y.parseError,lastSavedAt:y.lastSavedAt,onSave:async()=>{R(null);const s=await m(f);s.ok||R(s.error??"save failed")},onRevert:()=>{R(null),I(f)}}):null,children:e.jsx(de,{sidebar:e.jsxs("div",{className:"py-2",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:w,onChange:s=>_(s.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),L.length===0?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):L.filter(s=>!w||s.toLowerCase().includes(w.toLowerCase())).map(s=>{var C;const i=G(s,J),S=(C=h[s].description)==null?void 0:C.trim();return e.jsxs("button",{onClick:()=>g(s),className:`w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 ${r===s?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(W,{state:i.dotState,title:i.label}),e.jsx("span",{className:"truncate",children:s})]}),e.jsxs("span",{className:"ml-2 flex items-center gap-2 shrink-0",children:[e.jsx(Q,{tone:i.badgeTone,children:i.label}),e.jsx(Y,{interactive:!1,scope:o,input:U(s,h[s])}),e.jsx("span",{className:"text-fg-faint",children:h[s].type??"stdio"})]})]}),S?e.jsx("span",{className:"pl-5 text-fg-faint truncate",title:S,children:S}):null]},s)})]}),detail:r&&M?e.jsx(Ce,{name:r,server:M,connection:G(r,J),onTestConnection:V,testing:B,onRename:s=>ne(r,s),onChange:s=>re(r,s),onRemove:()=>le(r)}):e.jsx(O,{title:"select a server or click + new"})})})}const Pe=c.memo(Se);function Ce({name:n,server:t,connection:a,onTestConnection:d,testing:p,onRename:b,onChange:o,onRemove:j}){var k;const r=t.type??"stdio",g=be.has(n),x=je.has(n),u=(k=t.permissions)==null?void 0:k.tools,w=u===void 0?"inherit":u==="allow"?"allow":u==="deny"?"deny":"list",_=Array.isArray(u)?u:[],f=(t.disabledTools??[]).join(", ");return e.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{state:a.dotState,size:"md",title:a.label}),e.jsx(Q,{tone:a.badgeTone,children:a.label}),e.jsx("button",{onClick:d,disabled:p,className:"ml-auto px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-50",children:p?"checking…":"test connection"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),e.jsx("input",{defaultValue:n,onBlur:l=>b(l.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),e.jsx("button",{onClick:j,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),e.jsx(E,{label:"description",value:t.description??"",onChange:l=>o({...t,description:l||void 0}),placeholder:"what this server does…"}),g?e.jsxs("div",{className:"text-xs px-2 py-1 border border-red-500/50 rounded text-red-300 bg-red-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:n})," is a reserved name — Claude Code will refuse to load this server (v2.1.128+)."]}):x?e.jsxs("div",{className:"text-xs px-2 py-1 border border-yellow-600/50 rounded text-yellow-200 bg-yellow-500/5",children:["⚠ ",e.jsx("span",{className:"font-mono",children:n})," collides with a commonly-bundled MCP name; expect surprises in other tools."]}):null,e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),e.jsx("select",{value:r,onChange:l=>o({...t,type:l.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:ge.map(l=>e.jsx("option",{value:l,children:l},l))}),r==="sse"?e.jsx("span",{className:"text-xs text-yellow-400/80",children:"sse is deprecated — prefer streamable-http"}):null]}),r==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(E,{label:"command",value:t.command??"",onChange:l=>o({...t,command:l}),placeholder:"npx / node / python …"}),e.jsx(E,{label:"args",value:(t.args??[]).join(" "),onChange:l=>o({...t,args:l.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),e.jsx(Z,{label:"env",value:t.env??{},onChange:l=>o({...t,env:l})})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{label:"url",value:t.url??"",onChange:l=>o({...t,url:l}),placeholder:"https://…"}),e.jsx(Z,{label:"headers",value:t.headers??{},onChange:l=>o({...t,headers:l})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"alwaysLoad"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.alwaysLoad===!0,onChange:l=>o({...t,alwaysLoad:l.target.checked||void 0})}),e.jsx("span",{className:"text-fg-dim",children:"bypass tool-search deferral (v2.1.121+)"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:"enabled"}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-fg",children:[e.jsx("input",{type:"checkbox",checked:t.enabled!==!1,onChange:l=>o({...t,enabled:l.target.checked?void 0:!1})}),e.jsx("span",{className:"text-fg-dim",children:"load this server in new sessions"})]})]}),e.jsx(E,{label:"disabledTools",value:f,onChange:l=>{const v=l.split(",").map(m=>m.trim()).filter(Boolean);o({...t,disabledTools:v.length?v:void 0})},placeholder:"comma-separated tool names to hide"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:"permissions"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("select",{value:w,onChange:l=>{const v=l.target.value,m={...t};if(v==="inherit"){if(m.permissions){const{tools:I,...T}=m.permissions;m.permissions=Object.keys(T).length?T:void 0}}else v==="list"?m.permissions={...m.permissions??{},tools:[]}:m.permissions={...m.permissions??{},tools:v};o(m)},className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[e.jsx("option",{value:"inherit",children:"inherit (default)"}),e.jsx("option",{value:"allow",children:"allow all tools"}),e.jsx("option",{value:"deny",children:"deny all tools"}),e.jsx("option",{value:"list",children:"allowlist…"})]}),w==="list"?e.jsx("input",{value:_.join(", "),onChange:l=>{const v=l.target.value.split(",").map(m=>m.trim()).filter(Boolean);o({...t,permissions:{...t.permissions??{},tools:v}})},placeholder:"comma-separated tool names",className:"w-full bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}):null]})]})]})}function E({label:n,value:t,onChange:a,placeholder:d}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20",children:n}),e.jsx("input",{value:t,onChange:p=>a(p.target.value),placeholder:d,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function Z({label:n,value:t,onChange:a}){const[d,p]=c.useState(""),[b,o]=c.useState(""),j=Object.entries(t);return e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:n}),e.jsxs("div",{className:"flex-1 space-y-1",children:[j.map(([r,g])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:r,onChange:x=>{const u={...t};delete u[r],u[x.target.value]=g,a(u)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("input",{value:g,onChange:x=>a({...t,[r]:x.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),e.jsx("button",{onClick:()=>{const x={...t};delete x[r],a(x)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},r)),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:d,onChange:r=>p(r.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("input",{value:b,onChange:r=>o(r.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),e.jsx("button",{onClick:()=>{d.trim()&&(a({...t,[d.trim()]:b}),p(""),o(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}export{Pe as McpServers,we as nextServerName};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`);function me(t){const o=t.trim();if(!o)return{kind:"freeform",arg:"",raw:t};const r=o.toLowerCase();if(r==="help"||r==="?")return{kind:"help",arg:"",raw:t};if(r==="list"||r==="ls"||r==="list memories"||r==="list all"||r==="what do you remember"||r==="what do you remember?")return{kind:"list",arg:"",raw:t};const i=o.match(/^(?:show|read|open)\s+(.+)$/i);if(i)return{kind:"show",arg:i[1].trim(),raw:t};const m=o.match(/^(?:forget|delete|remove)\s+(.+)$/i);if(m)return{kind:"forget",arg:m[1].trim(),raw:t};const s=o.match(/^(?:search|find)\s+(.+)$/i)||o.match(/^what (?:do )?you know about\s+(.+?)\??$/i);if(s)return{kind:"search",arg:s[1].trim(),raw:t};const
|
|
3
|
-
`)}function X(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function xe({workspace:t,entries:o,onChanged:r}){const i=
|
|
4
|
-
`),h=d.findIndex(
|
|
1
|
+
import{aN as Y,aI as K,au as l,aH as A,ah as e,l as F,W as oe,a5 as H,$ as le,a9 as I,V as q}from"./index-A9TWmB7_.js";import{P as ee}from"./Panel-DWmE5Fu9.js";import{L as te}from"./ListDetail-DgrG72f4.js";import{M as se}from"./MarkdownEditor-C8dB3ZWU.js";import"./monaco-editor-BW5C4Iv1.js";function ie(t){return!t||!t.trim()?"default":t.replace(/[^a-zA-Z0-9]/g,"-")}const re=/^[a-z0-9-_]+$/;function ce(t,o,r,i){return t.filter(m=>!o||m.name.toLowerCase().includes(o.toLowerCase())).filter(m=>{var s;return!r||((s=i[m.name])==null?void 0:s.stale)===!0})}const de=["Commands:"," list — show all memory entries"," show <slug> — read one entry"," search <text> — find entries containing <text>"," forget <slug> — delete an entry (with confirm)"," remember <free-form> — ask Claude to save this"," help — this message","","Anything else: I will offer to send it to Claude in the terminal,","or add it as a new memory entry directly."].join(`
|
|
2
|
+
`);function me(t){const o=t.trim();if(!o)return{kind:"freeform",arg:"",raw:t};const r=o.toLowerCase();if(r==="help"||r==="?")return{kind:"help",arg:"",raw:t};if(r==="list"||r==="ls"||r==="list memories"||r==="list all"||r==="what do you remember"||r==="what do you remember?")return{kind:"list",arg:"",raw:t};const i=o.match(/^(?:show|read|open)\s+(.+)$/i);if(i)return{kind:"show",arg:i[1].trim(),raw:t};const m=o.match(/^(?:forget|delete|remove)\s+(.+)$/i);if(m)return{kind:"forget",arg:m[1].trim(),raw:t};const s=o.match(/^(?:search|find)\s+(.+)$/i)||o.match(/^what (?:do )?you know about\s+(.+?)\??$/i);if(s)return{kind:"search",arg:s[1].trim(),raw:t};const u=o.match(/^remember(?:\s+that)?\s+(.+)$/i)||o.match(/^note(?:\s+that)?\s+(.+)$/i)||o.match(/^save(?:\s+that)?\s+(.+)$/i);return u?{kind:"remember",arg:u[1].trim(),raw:t}:{kind:"freeform",arg:o,raw:t}}function G(t,o){const r=t.toLowerCase().replace(/\.md$/,""),i=o.find(u=>u.name.replace(/\.md$/,"").toLowerCase()===r);if(i)return i;const m=o.filter(u=>u.name.replace(/\.md$/,"").toLowerCase().startsWith(r));if(m.length===1)return m[0];const s=o.filter(u=>u.name.replace(/\.md$/,"").toLowerCase().includes(r));return s.length===1?s[0]:null}function Z(t){const o=new Set(["the","a","an","is","are","to","of","in","for","and","or"]);return t.toLowerCase().replace(/[^a-z0-9\s-]/g," ").split(/\s+/).filter(m=>m&&!o.has(m)).slice(0,4).join("-").replace(/-+/g,"-").replace(/^-|-$/g,"")||`note-${Date.now().toString(36).slice(-4)}`}function Q(t,o){return[`Please save this to my workspace memory (workspace: ${t}).`,`Use the memory tool (or write a markdown file under ~/.claude/projects/${t}/memory/).`,"Pick a short kebab-case filename and add a one-line title at the top.","","Memory to save:",o].join(`
|
|
3
|
+
`)}function X(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function xe({workspace:t,entries:o,onChanged:r}){const i=Y(),m=K(),s=(m==null?void 0:m.id)??null,[u,f]=l.useState(""),[c,b]=l.useState(()=>[{id:X(),role:"system",text:"Hi — I am the memory assistant for this workspace. Type `help` for what I understand, or just talk to me."}]),[C,g]=l.useState(!1),N=l.useRef(null),$=l.useRef(null);l.useEffect(()=>{const a=N.current;a&&(a.scrollTop=a.scrollHeight)},[c]);const x=l.useCallback(a=>{b(p=>[...p,{...a,id:X()}])},[]),S=l.useCallback(()=>{if(o.length===0){x({role:"result",text:"No memories saved for this workspace yet."});return}x({role:"result",text:`Found ${o.length} ${o.length===1?"memory":"memories"}:`,payload:{kind:"entries",entries:o}})},[o,x]),T=l.useCallback(async a=>{const p=G(a,o);if(!p){x({role:"result",text:`No memory matches "${a}". Try \`list\` to see what is here.`});return}const y=await window.api.memory.read(p.name,t);if(y.error){A.error(`Memory read failed: ${y.error}`),x({role:"result",text:`Read failed: ${y.error}`});return}x({role:"result",text:`${p.name}`,payload:{kind:"entry",entry:p,content:y.content}})},[o,t,x]),B=l.useCallback(async a=>{const p=a.toLowerCase(),y=o.filter(k=>k.name.toLowerCase().includes(p)),O=[];for(const k of o){if(y.includes(k))continue;const L=await window.api.memory.read(k.name,t);if(L.error)continue;const d=L.content.split(`
|
|
4
|
+
`),h=d.findIndex(w=>w.toLowerCase().includes(p));h>=0&&O.push({entry:k,snippet:d[h].trim().slice(0,200)})}const n=[...y.map(k=>({entry:k,snippet:"(filename match)"})),...O];if(n.length===0){x({role:"result",text:`No matches for "${a}".`});return}x({role:"result",text:`Found ${n.length} ${n.length===1?"match":"matches"} for "${a}":`,payload:{kind:"search",query:a,hits:n}})},[o,t,x]),D=l.useCallback(async a=>{const p=G(a,o);if(!p){x({role:"result",text:`No memory matches "${a}". Try \`list\` to see what is here.`});return}if(!window.confirm(`Delete memory "${p.name}"? This cannot be undone.`))return;const y=await window.api.memory.delete(p.name,t);if(!y.ok){A.error(`Memory delete failed: ${y.error??"unknown error"}`),x({role:"result",text:`Delete failed: ${y.error??"unknown error"}`});return}x({role:"result",text:`Deleted ${p.name}.`}),r()},[o,t,x,r]),v=l.useCallback(a=>{const p=Z(a),y=Q(t,a);x({role:"result",text:"I do not write to memory from this panel. Send the request to Claude in the active terminal, or add it directly as a new memory entry below.",payload:{kind:"suggest-send",prompt:y,original:a}}),x({role:"result",text:`Add it directly as \`${p}.md\` instead?`,payload:{kind:"suggest-add",slug:p,content:a}})},[t,x]),_=l.useCallback(a=>{const p=Z(a),y=Q(t,a);x({role:"result",text:"Not a recognised command. Options:",payload:{kind:"suggest-send",prompt:y,original:a}}),x({role:"result",text:`…or save it directly as \`${p}.md\`.`,payload:{kind:"suggest-add",slug:p,content:a}})},[t,x]),M=l.useCallback(async a=>{g(!0);try{switch(a.kind){case"list":S();break;case"show":await T(a.arg);break;case"search":await B(a.arg);break;case"forget":await D(a.arg);break;case"help":x({role:"result",text:de});break;case"remember":v(a.arg);break;case"freeform":_(a.arg);break}}finally{g(!1)}},[S,T,B,D,v,_,x]),R=l.useCallback(async()=>{const a=u.trim();!a||C||(f(""),x({role:"user",text:a}),await M(me(a)))},[u,C,M,x]),j=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),R())},E=l.useCallback(a=>{if(!s){A.error("No active terminal session — open or focus a tab first.");return}window.api.pty.write({tabId:s,data:a}),A.info("Prompt sent to active terminal (not submitted)")},[s]),P=l.useCallback(async(a,p)=>{if(!re.test(a)){A.error(`Invalid slug "${a}" — must be [a-z0-9-_]+`);return}const y=`${a}.md`,O=await window.api.memory.create(y,void 0,t);if(!O.ok){A.error(`Create failed: ${O.error??"unknown error"}`);return}const n=await window.api.memory.read(y,t),k=n.error?p:`${n.content.trimEnd()}
|
|
5
5
|
|
|
6
6
|
${p}
|
|
7
|
-
`,L=await window.api.memory.write(y,k,t);if(!L.ok){A.error(`Write failed: ${L.error??"unknown error"}`);return}x({role:"result",text:`Saved as ${y}.`}),r()},[t,x,r]),F=l.useMemo(()=>[{label:"List memories",value:"list"},{label:"Help",value:"help"},{label:"Search…",value:"search "},{label:"Remember…",value:"remember "}],[]);return i?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{ref:N,className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-2",children:[c.map(a=>e.jsx(fe,{message:a,entries:o,onShow:p=>{var y;u(`show ${p.replace(/\.md$/,"")}`),(y=$.current)==null||y.focus()},onSendToClaude:E,onAddDirect:P},a.id)),C&&e.jsx("div",{className:"text-xs text-fg-faint italic",children:"working…"})]}),e.jsxs("div",{className:"shrink-0 border-t border-line px-3 py-2 space-y-2",children:[e.jsx("div",{className:"flex gap-1 flex-wrap",children:F.map(a=>e.jsx("button",{onClick:()=>{var p;u(a.value),(p=$.current)==null||p.focus()},className:"px-2 py-0.5 text-[11px] text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors",children:a.label},a.label))}),e.jsxs("div",{className:"flex gap-2 items-end",children:[e.jsx(oe,{}),e.jsx("textarea",{ref:$,value:f,onChange:a=>u(a.target.value),onKeyDown:j,placeholder:"Type `list`, `show <slug>`, `search <text>`, `remember …`, or talk freely. Enter to send, Shift+Enter for newline.",rows:2,className:"flex-1 bg-bg border border-line rounded px-2 py-1 text-xs text-fg resize-none focus:outline-none focus:border-fg-faint"}),e.jsx("button",{onClick:R,disabled:!f.trim()||C,className:"px-3 py-1 text-xs text-fg border border-line hover:bg-bg-hi rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Send"})]}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:["Workspace: ",e.jsx("span",{className:"font-mono",children:t}),!s&&e.jsx("span",{className:"ml-2 text-amber-400",children:"(no active terminal — Send-to-Claude disabled)"})]})]})]}):e.jsx(W,{title:"loading…"})}function fe({message:t,entries:o,onShow:r,onSendToClaude:i,onAddDirect:m}){var f,u,c,b,C;const s=t.role==="user"?"bg-bg-hi text-fg ml-8":t.role==="system"?"bg-bg text-fg-dim italic":"bg-bg text-fg-dim";return e.jsxs("div",{className:`text-xs rounded border border-line px-3 py-2 ${s}`,children:[e.jsx("div",{className:"whitespace-pre-wrap font-mono text-[11px] leading-relaxed",children:t.text}),((f=t.payload)==null?void 0:f.kind)==="entries"&&e.jsx("div",{className:"mt-2 space-y-0.5",children:t.payload.entries.map(g=>e.jsxs("button",{onClick:()=>r(g.name),className:"block w-full text-left px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg hover:bg-bg-hi rounded font-mono",children:[g.name," ",e.jsxs("span",{className:"text-fg-faint",children:["(",H(g.bytes),")"]})]},g.name))}),((u=t.payload)==null?void 0:u.kind)==="entry"&&e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto px-2 py-1 bg-bg-hi rounded text-[11px] whitespace-pre-wrap text-fg",children:t.payload.content}),((c=t.payload)==null?void 0:c.kind)==="search"&&e.jsx("div",{className:"mt-2 space-y-1",children:t.payload.hits.map((g,N)=>e.jsxs("button",{onClick:()=>r(g.entry.name),className:"block w-full text-left px-2 py-1 hover:bg-bg-hi rounded",children:[e.jsx("div",{className:"font-mono text-[11px] text-fg-dim",children:g.entry.name}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",children:g.snippet})]},`${g.entry.name}-${N}`))}),((b=t.payload)==null?void 0:b.kind)==="suggest-send"&&e.jsxs("div",{className:"mt-2 flex gap-2 items-center",children:[e.jsx("button",{onClick:()=>i(t.payload.kind==="suggest-send"?t.payload.prompt:""),className:"px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"Send to Claude in terminal"}),e.jsx("span",{className:"text-[10px] text-fg-faint",children:"paste-only — you press Enter"})]}),((C=t.payload)==null?void 0:C.kind)==="suggest-add"&&e.jsxs("div",{className:"mt-2 flex gap-2 items-center",children:[e.jsx("button",{onClick:()=>{var g;return((g=t.payload)==null?void 0:g.kind)==="suggest-add"&&m(t.payload.slug,t.payload.content)},className:"px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"Add as new memory"}),e.jsxs("span",{className:"text-[10px] text-fg-faint font-mono",children:[t.payload.slug,".md"]})]})]})}const z=le((t,o)=>({entriesByAgent:new Map,loading:null,errorByAgent:new Map,loadAgent:async r=>{t({loading:r});const i=await window.api.agentMemory.list(r),m=new Map(o().entriesByAgent);m.set(r,i.entries);const s=new Map(o().errorByAgent);i.error?(s.set(r,i.error),A.error(`Agent memory load failed: ${i.error}`)):s.delete(r),t({entriesByAgent:m,loading:null,errorByAgent:s})},setEntry:async(r,i,m,s)=>{const f=await window.api.agentMemory.set(r,i,m,s);return f.ok&&await o().loadAgent(r),f},deleteEntry:async(r,i)=>{const m=await window.api.agentMemory.delete(r,i);if(m.ok){const s=new Map(o().entriesByAgent),f=s.get(r)??[];s.set(r,f.filter(u=>u.id!==i)),t({entriesByAgent:s})}return m}})),V=/^[A-Za-z0-9._-]{1,128}$/,Y={command:"Commands",preference:"Preferences",pattern:"Patterns",failure:"Avoid",workflow:"Workflow"},ne=["command","preference","pattern","failure","workflow"];async function ue(t,o){const r=[{dir:`${t}/.claude/agents`,scope:"user"}];o&&r.push({dir:`${o}/.claude/agents`,scope:"project"});const i=[];for(const{dir:s,scope:f}of r)try{const u=await window.api.config.listDir(s,{filesOnly:!0});for(const c of u.entries){if(!c.name.endsWith(".md"))continue;const b=c.name.replace(/\.md$/,"");V.test(b)&&i.push({id:b,label:b,scope:f})}}catch{}const m=new Map;for(const s of i)s.scope==="project"?m.set(s.id,s):m.has(s.id)||m.set(s.id,s);return Array.from(m.values()).sort((s,f)=>s.id.localeCompare(f.id))}function he(){const t=G(),o=I(),r=(o==null?void 0:o.cwd)??null,[i,m]=l.useState([]),[s,f]=l.useState(null),[u,c]=l.useState(null),[b,C]=l.useState(""),[g,N]=l.useState(!1),[$,x]=l.useState(!1),[S,T]=l.useState({}),B=z(n=>n.entriesByAgent),D=z(n=>n.loadAgent),w=z(n=>n.setEntry),O=z(n=>n.deleteEntry);l.useEffect(()=>{if(!t)return;let n=!1;return ue(t,r).then(k=>{n||(m(k),f(L=>{var d;return L&&k.find(h=>h.id===L)?L:((d=k[0])==null?void 0:d.id)??null}))}),()=>{n=!0}},[t,r]),l.useEffect(()=>{s&&(c(null),D(s))},[s,D]);const M=s?B.get(s)??[]:[],R=l.useMemo(()=>M.filter(n=>!b||n.id.toLowerCase().includes(b.toLowerCase())||n.body.toLowerCase().includes(b.toLowerCase())),[M,b]),j=l.useMemo(()=>M.find(n=>n.id===u)??null,[M,u]);l.useEffect(()=>{var n;!u&&R.length>0?c(R[0].id):u&&!R.find(k=>k.id===u)&&c(((n=R[0])==null?void 0:n.id)??null)},[R,u]);const E=s&&u?`${s}::${u}`:null,P=E?S[E]??(j==null?void 0:j.body)??"":"",F=!!E&&j!==null&&P!==j.body,a=l.useCallback(async()=>{s&&await D(s)},[s,D]),p=async()=>{if(!s||!u||!E)return;N(!0);const n=await w(s,u,P,(j==null?void 0:j.category)??void 0);if(N(!1),!n.ok){A.error(`Save failed: ${n.error??"unknown"}`);return}T(k=>{const L={...k};return delete L[E],L})},y=async()=>{if(!s||!u||!window.confirm(`Delete memory "${u}"? This cannot be undone.`))return;N(!0);const n=await O(s,u);if(N(!1),!n.ok){A.error(`Delete failed: ${n.error??"unknown"}`);return}c(null)},_=async n=>{if(!s||!u||!j)return;N(!0);const k=await w(s,u,j.body,n??void 0);N(!1),k.ok||A.error(`Update failed: ${k.error??"unknown"}`)};return t?e.jsx(ee,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-fg-faint",children:"Agent"}),e.jsxs("select",{value:s??"",onChange:n=>f(n.target.value||null),className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg max-w-[16rem]",children:[i.length===0&&e.jsx("option",{value:"",children:"(no agents found)"}),i.map(n=>e.jsxs("option",{value:n.id,children:[n.label," ",n.scope==="project"?"· project":""]},`${n.scope}:${n.id}`))]}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[M.length," ",M.length===1?"entry":"entries"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>x(!0),disabled:!s,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40",children:"+ New entry"}),e.jsx("button",{onClick:a,disabled:!s,className:"ml-2 px-2 py-0.5 text-xs text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40",children:"Refresh"})]}),footer:j?e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsx("button",{onClick:p,disabled:!F||g,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:g?"Saving…":"Save"}),e.jsx("button",{onClick:y,disabled:g,className:"px-2 py-0.5 text-xs text-red-400 hover:text-red-300 border border-line hover:border-red-400/50 rounded transition-colors disabled:opacity-40",children:"Delete"}),e.jsx("span",{className:"text-fg-faint",children:"Category:"}),e.jsxs("select",{value:j.category??"",onChange:n=>_(n.target.value||null),disabled:g,className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim disabled:opacity-40",children:[e.jsx("option",{value:"",children:"(none)"}),ne.map(n=>e.jsx("option",{value:n,children:Y[n]},n))]}),e.jsx("span",{className:"text-fg-faint truncate flex-1",children:j.id}),F&&e.jsx("span",{className:"text-accent",children:"unsaved"})]}):null,children:e.jsx(te,{sidebar:e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:b,onChange:n=>C(n.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),s?R.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:M.length===0?"no entries yet":"no matches"}):R.map(n=>e.jsxs("button",{onClick:()=>c(n.id),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${u===n.id?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,title:n.id,children:[e.jsx("span",{className:"truncate",children:n.id}),e.jsxs("span",{className:"ml-2 text-fg-faint shrink-0 text-[10px]",children:[H(n.bytes)," · ",U(n.updatedAt)]})]},n.id)):e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:"select an agent first"})]}),detail:$&&s?e.jsx(pe,{agentId:s,existingIds:new Set(M.map(n=>n.id)),onCancel:()=>x(!1),onCreated:n=>{x(!1),c(n),D(s)}}):j&&s&&u&&E?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-line text-xs",children:[e.jsx("div",{className:"text-fg truncate",children:j.id}),e.jsxs("div",{className:"text-fg-faint truncate",children:[H(j.bytes)," · modified ",U(j.updatedAt),j.category?` · ${Y[j.category]}`:""]})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(se,{path:`agent-memory/${s}/${j.id}.md`,value:P,onChange:n=>T(k=>({...k,[E]:n}))})})]}):e.jsx(W,{title:s?M.length===0?"no entries yet":"select an entry":"no agent selected",hint:s&&M.length===0?"Use “+ New entry” to give this subagent its first memory.":void 0})})}):e.jsx(W,{title:"loading…"})}function pe({agentId:t,existingIds:o,onCancel:r,onCreated:i}){const m=z(w=>w.setEntry),[s,f]=l.useState(""),[u,c]=l.useState(""),[b,C]=l.useState(""),[g,N]=l.useState(!1),[$,x]=l.useState(null),S=s.trim(),T=V.test(S)&&!o.has(S),B=s?V.test(S)?o.has(S)?"an entry with this id already exists":null:"must match [A-Za-z0-9._-]+":null,D=async()=>{if(!T)return;N(!0),x(null);const w=await m(t,S,u,b||void 0);if(N(!1),!w.ok){x(w.error??"create failed");return}i(S)};return e.jsxs("div",{className:"p-4 max-w-xl space-y-3",children:[e.jsxs("div",{className:"text-sm text-fg",children:["New memory entry for ",e.jsx("span",{className:"font-mono text-fg-dim",children:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Entry id"}),e.jsx("input",{autoFocus:!0,value:s,onChange:w=>f(w.target.value),placeholder:"e.g. preferred-test-runner",className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),B&&e.jsx("div",{className:"text-[10px] text-red-400",children:B}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:["Letters, digits, dots, dashes, underscores. Persists at",e.jsxs("code",{className:"ml-1 font-mono text-fg-dim",children:["~/.claude/session-manager/agent-memory/",t,".json"]}),"."]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Category (optional)"}),e.jsxs("select",{value:b,onChange:w=>C(w.target.value),className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg",children:[e.jsx("option",{value:"",children:"(none)"}),ne.map(w=>e.jsx("option",{value:w,children:Y[w]},w))]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Body (markdown)"}),e.jsx("textarea",{value:u,onChange:w=>c(w.target.value),rows:6,placeholder:"What should this subagent remember?",className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]}),$&&e.jsx("div",{className:"text-xs text-red-400",children:$}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:D,disabled:!T||g,className:"px-3 py-1 text-xs text-fg border border-line hover:bg-bg-hi rounded transition-colors disabled:opacity-40",children:g?"Creating…":"Create"}),e.jsx("button",{onClick:r,disabled:g,className:"px-3 py-1 text-xs text-fg-faint hover:text-fg-dim rounded transition-colors",children:"Cancel"})]})]})}function ge({workspace:t,onOpenMember:o}){const[r,i]=l.useState(null),[m,s]=l.useState(!1),[f,u]=l.useState(!1),c=l.useRef(0),b=l.useCallback(async $=>{const x=++c.current;s(!0);try{const S=await window.api.memory.aggregate(t,$);if(c.current!==x)return;i(S)}catch(S){if(c.current!==x)return;A.error(`Memory aggregate failed: ${S instanceof Error?S.message:String(S)}`)}finally{c.current===x&&(s(!1),u(!0))}},[t]);l.useEffect(()=>{i(null),u(!1),b(!1)},[b]);const C=(r==null?void 0:r.clusters)??[],g=(r==null?void 0:r.orphans)??[],N=C.length>0||g.length>0;return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 py-2 border-b border-line text-xs",children:[e.jsx("span",{className:"text-fg-faint",children:r!=null&&r.generatedAt?`generated ${U(r.generatedAt)} ago`:"not yet aggregated"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>b(!0),disabled:m,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:m?"Aggregating…":r!=null&&r.generatedAt?"Refresh":"Aggregate"})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:f?N?e.jsxs("div",{className:"space-y-4",children:[C.length>0&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:C.map($=>e.jsx(be,{cluster:$,onOpenMember:o},$.id))}),g.length>0&&e.jsxs("div",{className:"border border-line rounded p-3",children:[e.jsx("div",{className:"text-xs text-fg mb-2",children:"Unclustered"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:g.map($=>e.jsx("button",{onClick:()=>o($),className:"px-2 py-0.5 text-[11px] font-mono text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:$},$))})]})]}):e.jsx(W,{title:"no clusters yet",hint:"Click Aggregate to organize this workspace's memories into named clusters."}):e.jsx(W,{title:"loading…"})})]})}function be({cluster:t,onOpenMember:o}){return e.jsxs("div",{className:"border border-line rounded p-3",children:[e.jsx("div",{className:"text-sm text-fg",children:t.name}),t.summary&&e.jsx("div",{className:"text-xs text-fg-faint mt-0.5",children:t.summary}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.memberSlugs.map(r=>e.jsx("button",{onClick:()=>o(r),className:"px-2 py-0.5 text-[11px] font-mono text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:r},r))}),t.links.length>0&&e.jsx("div",{className:"mt-2 space-y-0.5",children:t.links.map((r,i)=>e.jsxs("div",{className:"text-[10px] text-fg-faint font-mono",children:[r.from," → ",r.to,r.label?` (${r.label})`:""]},`${r.from}-${r.to}-${i}`))})]})}const ye=[{key:"workspace",label:"Workspace"},{key:"subagent",label:"Subagent"}],J="sm.memoryTab.scope";function je(){const[t,o]=l.useState(()=>localStorage.getItem(J)==="subagent"?"subagent":"workspace");return l.useEffect(()=>{localStorage.setItem(J,t)},[t]),e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-3 px-3 py-2 border-b border-line",children:[e.jsx(q,{options:ye,active:t,onChange:o}),e.jsx("span",{className:"text-[11px] text-fg-faint",children:t==="workspace"?"memories scoped to the active project":"long-term memory per subagent"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:t==="workspace"?e.jsx(we,{}):e.jsx(he,{})})]})}const Ee=l.memo(je);function we(){const t=G(),o=I(),r=(o==null?void 0:o.cwd)??null,i=l.useMemo(()=>ie(r),[r]),[m,s]=l.useState("classic"),[f,u]=l.useState([]),[c,b]=l.useState(null),[C,g]=l.useState(""),[N,$]=l.useState({}),[x,S]=l.useState(!1),[T,B]=l.useState({}),[D,w]=l.useState({}),[O,M]=l.useState(!1),[R,j]=l.useState(!1),E=l.useCallback(async()=>{if(!t)return;const d=await window.api.memory.list(i);u(d.entries),d.error&&A.error(`Memory list failed: ${d.error}`),b(h=>{var v;return h&&d.entries.some(ae=>ae.name===h)?h:((v=d.entries[0])==null?void 0:v.name)??null});try{const h=await window.api.memory.stale(i,r??void 0);$(Object.fromEntries(h.entries.map(v=>[v.name,v])))}catch(h){$({}),A.error(`Memory staleness check failed: ${h instanceof Error?h.message:String(h)}`)}},[t,i,r]);if(l.useEffect(()=>{B({}),w({}),b(null),E()},[i,E]),l.useEffect(()=>{if(!t)return;const d=`${t}/.claude/projects/${i}/memory`;window.api.config.watch([d]);const h=window.api.config.onChanged(({path:v})=>{(v===d||v.startsWith(d+"/"))&&E()});return()=>{h(),window.api.config.unwatch([d])}},[t,i,E]),l.useEffect(()=>{if(!c||T[c]!==void 0)return;let d=!1;return(async()=>{const h=await window.api.memory.read(c,i);if(!d){if(h.error){A.error(`Memory read failed: ${h.error}`);return}B(v=>({...v,[c]:h.content})),w(v=>({...v,[c]:h.content}))}})(),()=>{d=!0}},[c,i]),!t)return e.jsx(W,{title:"loading…"});const P=f.reduce((d,h)=>{var v;return d+((v=N[h.name])!=null&&v.stale?1:0)},0),F=ce(f,C,x,N),a=f.find(d=>d.name===c)??null,p=c?N[c]:void 0,y=c?T[c]??"":"",_=c?D[c]??"":"",n=c?y!==_:!1,k=async()=>{if(!c)return;M(!0);const d=await window.api.memory.write(c,y,i);if(M(!1),!d.ok){A.error(`Memory save failed: ${d.error??"unknown error"}`);return}w(h=>({...h,[c]:y})),E()},L=async()=>{if(!c||!window.confirm(`Delete memory "${c}"? This cannot be undone.`))return;M(!0);const d=await window.api.memory.delete(c,i);if(M(!1),!d.ok){A.error(`Memory delete failed: ${d.error??"unknown error"}`);return}B(h=>{const v={...h};return delete v[c],v}),w(h=>{const v={...h};return delete v[c],v}),b(null),E()};return e.jsx(ee,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(q,{options:[{key:"classic",label:"Editor"},{key:"natural",label:"Natural"},{key:"clusters",label:"Clusters"}],active:m,onChange:s}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-faint",children:"Workspace"}),e.jsx("span",{className:"font-mono text-fg-dim truncate max-w-[24rem]",title:i,children:i}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[f.length," ",f.length===1?"entry":"entries"]}),e.jsx("div",{className:"flex-1"}),m==="classic"&&P>0&&e.jsxs("button",{onClick:()=>S(d=>!d),className:`px-2 py-0.5 text-xs border rounded transition-colors ${x?"text-amber-400 border-amber-400/50 bg-amber-400/10":"text-fg-dim hover:text-fg border-line hover:border-fg-faint"}`,children:["Stale only (",P,")"]}),m==="classic"&&e.jsx("button",{onClick:()=>j(!0),className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"+ New memory"}),m!=="clusters"&&e.jsx("button",{onClick:E,className:"ml-2 px-2 py-0.5 text-xs text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors",children:"Refresh"})]}),footer:m==="classic"&&a?e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsx("button",{onClick:k,disabled:!n||O,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:O?"Saving…":"Save"}),e.jsx("button",{onClick:L,disabled:O,className:"px-2 py-0.5 text-xs text-red-400 hover:text-red-300 border border-line hover:border-red-400/50 rounded transition-colors disabled:opacity-40",children:"Delete"}),(p==null?void 0:p.stale)&&e.jsxs("span",{className:"text-amber-400/90 truncate",title:p.reasons.join("; "),children:["stale · ",p.reasons.join(", ")]}),e.jsx("span",{className:"text-fg-faint truncate flex-1",children:a.path}),n&&e.jsx("span",{className:"text-accent",children:"unsaved"})]}):null,children:m==="natural"?e.jsx(xe,{workspace:i,entries:f,onChanged:E}):m==="clusters"?e.jsx(ge,{workspace:i,onOpenMember:d=>{b(`${d}.md`),s("classic")}}):e.jsx(te,{sidebar:e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:C,onChange:d=>g(d.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),F.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:f.length===0?"no memories yet":"no matches"}):F.map(d=>{const h=N[d.name],v=h!=null&&h.stale?`${d.path}
|
|
8
|
-
stale: ${h.reasons.join(", ")}`:d.path;return e.jsxs("button",{onClick:()=>b(d.name),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${c===d.name?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,title:
|
|
7
|
+
`,L=await window.api.memory.write(y,k,t);if(!L.ok){A.error(`Write failed: ${L.error??"unknown error"}`);return}x({role:"result",text:`Saved as ${y}.`}),r()},[t,x,r]),W=l.useMemo(()=>[{label:"List memories",value:"list"},{label:"Help",value:"help"},{label:"Search…",value:"search "},{label:"Remember…",value:"remember "}],[]);return i?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{ref:N,className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-2",children:[c.map(a=>e.jsx(ue,{message:a,entries:o,onShow:p=>{var y;f(`show ${p.replace(/\.md$/,"")}`),(y=$.current)==null||y.focus()},onSendToClaude:E,onAddDirect:P},a.id)),C&&e.jsx("div",{className:"text-xs text-fg-faint italic",children:"working…"})]}),e.jsxs("div",{className:"shrink-0 border-t border-line px-3 py-2 space-y-2",children:[e.jsx("div",{className:"flex gap-1 flex-wrap",children:W.map(a=>e.jsx("button",{onClick:()=>{var p;f(a.value),(p=$.current)==null||p.focus()},className:"px-2 py-0.5 text-[11px] text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors",children:a.label},a.label))}),e.jsxs("div",{className:"flex gap-2 items-end",children:[e.jsx(oe,{}),e.jsx("textarea",{ref:$,value:u,onChange:a=>f(a.target.value),onKeyDown:j,placeholder:"Type `list`, `show <slug>`, `search <text>`, `remember …`, or talk freely. Enter to send, Shift+Enter for newline.",rows:2,className:"flex-1 bg-bg border border-line rounded px-2 py-1 text-xs text-fg resize-none focus:outline-none focus:border-fg-faint"}),e.jsx("button",{onClick:R,disabled:!u.trim()||C,className:"px-3 py-1 text-xs text-fg border border-line hover:bg-bg-hi rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Send"})]}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:["Workspace: ",e.jsx("span",{className:"font-mono",children:t}),!s&&e.jsx("span",{className:"ml-2 text-amber-400",children:"(no active terminal — Send-to-Claude disabled)"})]})]})]}):e.jsx(F,{title:"loading…"})}function ue({message:t,entries:o,onShow:r,onSendToClaude:i,onAddDirect:m}){var u,f,c,b,C;const s=t.role==="user"?"bg-bg-hi text-fg ml-8":t.role==="system"?"bg-bg text-fg-dim italic":"bg-bg text-fg-dim";return e.jsxs("div",{className:`text-xs rounded border border-line px-3 py-2 ${s}`,children:[e.jsx("div",{className:"whitespace-pre-wrap font-mono text-[11px] leading-relaxed",children:t.text}),((u=t.payload)==null?void 0:u.kind)==="entries"&&e.jsx("div",{className:"mt-2 space-y-0.5",children:t.payload.entries.map(g=>e.jsxs("button",{onClick:()=>r(g.name),className:"block w-full text-left px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg hover:bg-bg-hi rounded font-mono",children:[g.name," ",e.jsxs("span",{className:"text-fg-faint",children:["(",H(g.bytes),")"]})]},g.name))}),((f=t.payload)==null?void 0:f.kind)==="entry"&&e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto px-2 py-1 bg-bg-hi rounded text-[11px] whitespace-pre-wrap text-fg",children:t.payload.content}),((c=t.payload)==null?void 0:c.kind)==="search"&&e.jsx("div",{className:"mt-2 space-y-1",children:t.payload.hits.map((g,N)=>e.jsxs("button",{onClick:()=>r(g.entry.name),className:"block w-full text-left px-2 py-1 hover:bg-bg-hi rounded",children:[e.jsx("div",{className:"font-mono text-[11px] text-fg-dim",children:g.entry.name}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",children:g.snippet})]},`${g.entry.name}-${N}`))}),((b=t.payload)==null?void 0:b.kind)==="suggest-send"&&e.jsxs("div",{className:"mt-2 flex gap-2 items-center",children:[e.jsx("button",{onClick:()=>i(t.payload.kind==="suggest-send"?t.payload.prompt:""),className:"px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"Send to Claude in terminal"}),e.jsx("span",{className:"text-[10px] text-fg-faint",children:"paste-only — you press Enter"})]}),((C=t.payload)==null?void 0:C.kind)==="suggest-add"&&e.jsxs("div",{className:"mt-2 flex gap-2 items-center",children:[e.jsx("button",{onClick:()=>{var g;return((g=t.payload)==null?void 0:g.kind)==="suggest-add"&&m(t.payload.slug,t.payload.content)},className:"px-2 py-0.5 text-[11px] text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"Add as new memory"}),e.jsxs("span",{className:"text-[10px] text-fg-faint font-mono",children:[t.payload.slug,".md"]})]})]})}const z=le((t,o)=>({entriesByAgent:new Map,loading:null,errorByAgent:new Map,loadAgent:async r=>{t({loading:r});const i=await window.api.agentMemory.list(r),m=new Map(o().entriesByAgent);m.set(r,i.entries);const s=new Map(o().errorByAgent);i.error?(s.set(r,i.error),A.error(`Agent memory load failed: ${i.error}`)):s.delete(r),t({entriesByAgent:m,loading:null,errorByAgent:s})},setEntry:async(r,i,m,s)=>{const u=await window.api.agentMemory.set(r,i,m,s);return u.ok&&await o().loadAgent(r),u},deleteEntry:async(r,i)=>{const m=await window.api.agentMemory.delete(r,i);if(m.ok){const s=new Map(o().entriesByAgent),u=s.get(r)??[];s.set(r,u.filter(f=>f.id!==i)),t({entriesByAgent:s})}return m}})),U=/^[A-Za-z0-9._-]{1,128}$/,V={command:"Commands",preference:"Preferences",pattern:"Patterns",failure:"Avoid",workflow:"Workflow"},ne=["command","preference","pattern","failure","workflow"];async function fe(t,o){const r=[{dir:`${t}/.claude/agents`,scope:"user"}];o&&r.push({dir:`${o}/.claude/agents`,scope:"project"});const i=[];for(const{dir:s,scope:u}of r)try{const f=await window.api.config.listDir(s,{filesOnly:!0});for(const c of f.entries){if(!c.name.endsWith(".md"))continue;const b=c.name.replace(/\.md$/,"");U.test(b)&&i.push({id:b,label:b,scope:u})}}catch{}const m=new Map;for(const s of i)s.scope==="project"?m.set(s.id,s):m.has(s.id)||m.set(s.id,s);return Array.from(m.values()).sort((s,u)=>s.id.localeCompare(u.id))}function he(){const t=Y(),o=K(),r=(o==null?void 0:o.cwd)??null,[i,m]=l.useState([]),[s,u]=l.useState(null),[f,c]=l.useState(null),[b,C]=l.useState(""),[g,N]=l.useState(!1),[$,x]=l.useState(!1),[S,T]=l.useState({}),B=z(n=>n.entriesByAgent),D=z(n=>n.loadAgent),v=z(n=>n.setEntry),_=z(n=>n.deleteEntry);l.useEffect(()=>{if(!t)return;let n=!1;return fe(t,r).then(k=>{n||(m(k),u(L=>{var d;return L&&k.find(h=>h.id===L)?L:((d=k[0])==null?void 0:d.id)??null}))}),()=>{n=!0}},[t,r]),l.useEffect(()=>{s&&(c(null),D(s))},[s,D]);const M=s?B.get(s)??[]:[],R=l.useMemo(()=>M.filter(n=>!b||n.id.toLowerCase().includes(b.toLowerCase())||n.body.toLowerCase().includes(b.toLowerCase())),[M,b]),j=l.useMemo(()=>M.find(n=>n.id===f)??null,[M,f]);l.useEffect(()=>{var n;!f&&R.length>0?c(R[0].id):f&&!R.find(k=>k.id===f)&&c(((n=R[0])==null?void 0:n.id)??null)},[R,f]);const E=s&&f?`${s}::${f}`:null,P=E?S[E]??(j==null?void 0:j.body)??"":"",W=!!E&&j!==null&&P!==j.body,a=l.useCallback(async()=>{s&&await D(s)},[s,D]),p=async()=>{if(!s||!f||!E)return;N(!0);const n=await v(s,f,P,(j==null?void 0:j.category)??void 0);if(N(!1),!n.ok){A.error(`Save failed: ${n.error??"unknown"}`);return}T(k=>{const L={...k};return delete L[E],L})},y=async()=>{if(!s||!f||!window.confirm(`Delete memory "${f}"? This cannot be undone.`))return;N(!0);const n=await _(s,f);if(N(!1),!n.ok){A.error(`Delete failed: ${n.error??"unknown"}`);return}c(null)},O=async n=>{if(!s||!f||!j)return;N(!0);const k=await v(s,f,j.body,n??void 0);N(!1),k.ok||A.error(`Update failed: ${k.error??"unknown"}`)};return t?e.jsx(ee,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-fg-faint",children:"Agent"}),e.jsxs("select",{value:s??"",onChange:n=>u(n.target.value||null),className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg max-w-[16rem]",children:[i.length===0&&e.jsx("option",{value:"",children:"(no agents found)"}),i.map(n=>e.jsxs("option",{value:n.id,children:[n.label," ",n.scope==="project"?"· project":""]},`${n.scope}:${n.id}`))]}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[M.length," ",M.length===1?"entry":"entries"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>x(!0),disabled:!s,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40",children:"+ New entry"}),e.jsx("button",{onClick:a,disabled:!s,className:"ml-2 px-2 py-0.5 text-xs text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40",children:"Refresh"})]}),footer:j?e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsx("button",{onClick:p,disabled:!W||g,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:g?"Saving…":"Save"}),e.jsx("button",{onClick:y,disabled:g,className:"px-2 py-0.5 text-xs text-red-400 hover:text-red-300 border border-line hover:border-red-400/50 rounded transition-colors disabled:opacity-40",children:"Delete"}),e.jsx("span",{className:"text-fg-faint",children:"Category:"}),e.jsxs("select",{value:j.category??"",onChange:n=>O(n.target.value||null),disabled:g,className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim disabled:opacity-40",children:[e.jsx("option",{value:"",children:"(none)"}),ne.map(n=>e.jsx("option",{value:n,children:V[n]},n))]}),e.jsx("span",{className:"text-fg-faint truncate flex-1",children:j.id}),W&&e.jsx("span",{className:"text-accent",children:"unsaved"})]}):null,children:e.jsx(te,{sidebar:e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:b,onChange:n=>C(n.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),s?R.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:M.length===0?"no entries yet":"no matches"}):R.map(n=>e.jsxs("button",{onClick:()=>c(n.id),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${f===n.id?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,title:n.id,children:[e.jsx("span",{className:"truncate",children:n.id}),e.jsxs("span",{className:"ml-2 text-fg-faint shrink-0 text-[10px]",children:[H(n.bytes)," · ",I(n.updatedAt)]})]},n.id)):e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:"select an agent first"})]}),detail:$&&s?e.jsx(pe,{agentId:s,existingIds:new Set(M.map(n=>n.id)),onCancel:()=>x(!1),onCreated:n=>{x(!1),c(n),D(s)}}):j&&s&&f&&E?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-line text-xs",children:[e.jsx("div",{className:"text-fg truncate",children:j.id}),e.jsxs("div",{className:"text-fg-faint truncate",children:[H(j.bytes)," · modified ",I(j.updatedAt),j.category?` · ${V[j.category]}`:""]})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(se,{path:`agent-memory/${s}/${j.id}.md`,value:P,onChange:n=>T(k=>({...k,[E]:n}))})})]}):e.jsx(F,{title:s?M.length===0?"no entries yet":"select an entry":"no agent selected",hint:s&&M.length===0?"Use “+ New entry” to give this subagent its first memory.":void 0})})}):e.jsx(F,{title:"loading…"})}function pe({agentId:t,existingIds:o,onCancel:r,onCreated:i}){const m=z(v=>v.setEntry),[s,u]=l.useState(""),[f,c]=l.useState(""),[b,C]=l.useState(""),[g,N]=l.useState(!1),[$,x]=l.useState(null),S=s.trim(),T=U.test(S)&&!o.has(S),B=s?U.test(S)?o.has(S)?"an entry with this id already exists":null:"must match [A-Za-z0-9._-]+":null,D=async()=>{if(!T)return;N(!0),x(null);const v=await m(t,S,f,b||void 0);if(N(!1),!v.ok){x(v.error??"create failed");return}i(S)};return e.jsxs("div",{className:"p-4 max-w-xl space-y-3",children:[e.jsxs("div",{className:"text-sm text-fg",children:["New memory entry for ",e.jsx("span",{className:"font-mono text-fg-dim",children:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Entry id"}),e.jsx("input",{autoFocus:!0,value:s,onChange:v=>u(v.target.value),placeholder:"e.g. preferred-test-runner",className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),B&&e.jsx("div",{className:"text-[10px] text-red-400",children:B}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:["Letters, digits, dots, dashes, underscores. Persists at",e.jsxs("code",{className:"ml-1 font-mono text-fg-dim",children:["~/.claude/session-manager/agent-memory/",t,".json"]}),"."]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Category (optional)"}),e.jsxs("select",{value:b,onChange:v=>C(v.target.value),className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg",children:[e.jsx("option",{value:"",children:"(none)"}),ne.map(v=>e.jsx("option",{value:v,children:V[v]},v))]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Body (markdown)"}),e.jsx("textarea",{value:f,onChange:v=>c(v.target.value),rows:6,placeholder:"What should this subagent remember?",className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]}),$&&e.jsx("div",{className:"text-xs text-red-400",children:$}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:D,disabled:!T||g,className:"px-3 py-1 text-xs text-fg border border-line hover:bg-bg-hi rounded transition-colors disabled:opacity-40",children:g?"Creating…":"Create"}),e.jsx("button",{onClick:r,disabled:g,className:"px-3 py-1 text-xs text-fg-faint hover:text-fg-dim rounded transition-colors",children:"Cancel"})]})]})}function ge({workspace:t,onOpenMember:o}){const[r,i]=l.useState(null),[m,s]=l.useState(!1),[u,f]=l.useState(!1),c=l.useRef(0),b=l.useCallback(async $=>{const x=++c.current;s(!0);try{const S=await window.api.memory.aggregate(t,$);if(c.current!==x)return;i(S)}catch(S){if(c.current!==x)return;A.error(`Memory aggregate failed: ${S instanceof Error?S.message:String(S)}`)}finally{c.current===x&&(s(!1),f(!0))}},[t]);l.useEffect(()=>{i(null),f(!1),b(!1)},[b]);const C=(r==null?void 0:r.clusters)??[],g=(r==null?void 0:r.orphans)??[],N=C.length>0||g.length>0;return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 py-2 border-b border-line text-xs",children:[e.jsx("span",{className:"text-fg-faint",children:r!=null&&r.generatedAt?`generated ${I(r.generatedAt)} ago`:"not yet aggregated"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>b(!0),disabled:m,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:m?"Aggregating…":r!=null&&r.generatedAt?"Refresh":"Aggregate"})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:u?N?e.jsxs("div",{className:"space-y-4",children:[C.length>0&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:C.map($=>e.jsx(be,{cluster:$,onOpenMember:o},$.id))}),g.length>0&&e.jsxs("div",{className:"border border-line rounded p-3",children:[e.jsx("div",{className:"text-xs text-fg mb-2",children:"Unclustered"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:g.map($=>e.jsx("button",{onClick:()=>o($),className:"px-2 py-0.5 text-[11px] font-mono text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:$},$))})]})]}):e.jsx(F,{title:"no clusters yet",hint:"Click Aggregate to organize this workspace's memories into named clusters."}):e.jsx(F,{title:"loading…"})})]})}function be({cluster:t,onOpenMember:o}){return e.jsxs("div",{className:"border border-line rounded p-3",children:[e.jsx("div",{className:"text-sm text-fg",children:t.name}),t.summary&&e.jsx("div",{className:"text-xs text-fg-faint mt-0.5",children:t.summary}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.memberSlugs.map(r=>e.jsx("button",{onClick:()=>o(r),className:"px-2 py-0.5 text-[11px] font-mono text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:r},r))}),t.links.length>0&&e.jsx("div",{className:"mt-2 space-y-0.5",children:t.links.map((r,i)=>e.jsxs("div",{className:"text-[10px] text-fg-faint font-mono",children:[r.from," → ",r.to,r.label?` (${r.label})`:""]},`${r.from}-${r.to}-${i}`))})]})}const ye=[{key:"workspace",label:"Workspace"},{key:"subagent",label:"Subagent"}],J="sm.memoryTab.scope";function je(){const[t,o]=l.useState(()=>localStorage.getItem(J)==="subagent"?"subagent":"workspace");return l.useEffect(()=>{localStorage.setItem(J,t)},[t]),e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-3 px-3 py-2 border-b border-line",children:[e.jsx(q,{options:ye,active:t,onChange:o}),e.jsx("span",{className:"text-[11px] text-fg-faint",children:t==="workspace"?"memories scoped to the active project":"long-term memory per subagent"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:t==="workspace"?e.jsx(ve,{}):e.jsx(he,{})})]})}const Ee=l.memo(je);function ve(){const t=Y(),o=K(),r=(o==null?void 0:o.cwd)??null,i=l.useMemo(()=>ie(r),[r]),[m,s]=l.useState("classic"),[u,f]=l.useState([]),[c,b]=l.useState(null),[C,g]=l.useState(""),[N,$]=l.useState({}),[x,S]=l.useState(!1),[T,B]=l.useState({}),[D,v]=l.useState({}),[_,M]=l.useState(!1),[R,j]=l.useState(!1),E=l.useCallback(async()=>{if(!t)return;const d=await window.api.memory.list(i);f(d.entries),d.error&&A.error(`Memory list failed: ${d.error}`),b(h=>{var w;return h&&d.entries.some(ae=>ae.name===h)?h:((w=d.entries[0])==null?void 0:w.name)??null});try{const h=await window.api.memory.stale(i,r??void 0);$(Object.fromEntries(h.entries.map(w=>[w.name,w])))}catch(h){$({}),A.error(`Memory staleness check failed: ${h instanceof Error?h.message:String(h)}`)}},[t,i,r]);if(l.useEffect(()=>{B({}),v({}),b(null),E()},[i,E]),l.useEffect(()=>{if(!t)return;const d=`${t}/.claude/projects/${i}/memory`;window.api.config.watch([d]);const h=window.api.config.onChanged(({path:w})=>{(w===d||w.startsWith(d+"/"))&&E()});return()=>{h(),window.api.config.unwatch([d])}},[t,i,E]),l.useEffect(()=>{if(!c||T[c]!==void 0)return;let d=!1;return(async()=>{const h=await window.api.memory.read(c,i);if(!d){if(h.error){A.error(`Memory read failed: ${h.error}`);return}B(w=>({...w,[c]:h.content})),v(w=>({...w,[c]:h.content}))}})(),()=>{d=!0}},[c,i]),!t)return e.jsx(F,{title:"loading…"});const P=u.reduce((d,h)=>{var w;return d+((w=N[h.name])!=null&&w.stale?1:0)},0),W=ce(u,C,x,N),a=u.find(d=>d.name===c)??null,p=c?N[c]:void 0,y=c?T[c]??"":"",O=c?D[c]??"":"",n=c?y!==O:!1,k=async()=>{if(!c)return;M(!0);const d=await window.api.memory.write(c,y,i);if(M(!1),!d.ok){A.error(`Memory save failed: ${d.error??"unknown error"}`);return}v(h=>({...h,[c]:y})),E()},L=async()=>{if(!c||!window.confirm(`Delete memory "${c}"? This cannot be undone.`))return;M(!0);const d=await window.api.memory.delete(c,i);if(M(!1),!d.ok){A.error(`Memory delete failed: ${d.error??"unknown error"}`);return}B(h=>{const w={...h};return delete w[c],w}),v(h=>{const w={...h};return delete w[c],w}),b(null),E()};return e.jsx(ee,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(q,{options:[{key:"classic",label:"Editor"},{key:"natural",label:"Natural"},{key:"clusters",label:"Clusters"}],active:m,onChange:s}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-faint",children:"Workspace"}),e.jsx("span",{className:"font-mono text-fg-dim truncate max-w-[24rem]",title:i,children:i}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[u.length," ",u.length===1?"entry":"entries"]}),e.jsx("div",{className:"flex-1"}),m==="classic"&&P>0&&e.jsxs("button",{onClick:()=>S(d=>!d),className:`px-2 py-0.5 text-xs border rounded transition-colors ${x?"text-amber-400 border-amber-400/50 bg-amber-400/10":"text-fg-dim hover:text-fg border-line hover:border-fg-faint"}`,children:["Stale only (",P,")"]}),m==="classic"&&e.jsx("button",{onClick:()=>j(!0),className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",children:"+ New memory"}),m!=="clusters"&&e.jsx("button",{onClick:E,className:"ml-2 px-2 py-0.5 text-xs text-fg-faint hover:text-fg-dim border border-line hover:border-fg-faint rounded transition-colors",children:"Refresh"})]}),footer:m==="classic"&&a?e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsx("button",{onClick:k,disabled:!n||_,className:"px-2 py-0.5 text-xs text-fg-dim hover:text-fg border border-line hover:border-fg-faint rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:_?"Saving…":"Save"}),e.jsx("button",{onClick:L,disabled:_,className:"px-2 py-0.5 text-xs text-red-400 hover:text-red-300 border border-line hover:border-red-400/50 rounded transition-colors disabled:opacity-40",children:"Delete"}),(p==null?void 0:p.stale)&&e.jsxs("span",{className:"text-amber-400/90 truncate",title:p.reasons.join("; "),children:["stale · ",p.reasons.join(", ")]}),e.jsx("span",{className:"text-fg-faint truncate flex-1",children:a.path}),n&&e.jsx("span",{className:"text-accent",children:"unsaved"})]}):null,children:m==="natural"?e.jsx(xe,{workspace:i,entries:u,onChanged:E}):m==="clusters"?e.jsx(ge,{workspace:i,onOpenMember:d=>{b(`${d}.md`),s("classic")}}):e.jsx(te,{sidebar:e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-2 pb-1",children:e.jsx("input",{value:C,onChange:d=>g(d.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),W.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-fg-faint italic",children:u.length===0?"no memories yet":"no matches"}):W.map(d=>{const h=N[d.name],w=h!=null&&h.stale?`${d.path}
|
|
8
|
+
stale: ${h.reasons.join(", ")}`:d.path;return e.jsxs("button",{onClick:()=>b(d.name),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${c===d.name?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,title:w,children:[e.jsxs("span",{className:"truncate flex items-center",children:[e.jsx("span",{className:"truncate",children:d.name.replace(/\.md$/,"")}),(h==null?void 0:h.stale)&&e.jsx("span",{className:"ml-1.5 shrink-0 px-1 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30",children:"stale"})]}),e.jsxs("span",{className:"ml-2 text-fg-faint shrink-0 text-[10px]",children:[H(d.bytes)," · ",I(d.mtimeMs)]})]},d.name)})]}),detail:R?e.jsx(we,{workspace:i,onCancel:()=>j(!1),onCreated:d=>{j(!1),b(d),E()}}):a&&c?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-line text-xs",children:[e.jsx("div",{className:"text-fg truncate",children:a.name}),e.jsxs("div",{className:"text-fg-faint truncate",children:[H(a.bytes)," · modified ",I(a.mtimeMs)]})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(se,{path:a.path,value:y,onChange:d=>B(h=>({...h,[c]:d}))})})]}):e.jsx(F,{title:u.length===0?"no memories yet":"select a memory",hint:u.length===0?"Claude writes to memories during sessions when you ask it to remember things, or you can create one manually with the + New memory button.":void 0})})})}function we({workspace:t,onCancel:o,onCreated:r}){const[i,m]=l.useState(""),[s,u]=l.useState(""),[f,c]=l.useState(!1),[b,C]=l.useState(null),g=i.trim().toLowerCase(),N=re.test(g),$=async()=>{if(!N){C("Slug must match [a-z0-9-_]+");return}c(!0),C(null);const x=`${g}.md`,S=await window.api.memory.create(x,s.trim()||void 0,t);if(c(!1),!S.ok){C(S.error??"create failed");return}r(x)};return e.jsxs("div",{className:"p-4 max-w-xl space-y-3",children:[e.jsx("div",{className:"text-sm text-fg",children:"New memory"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Slug"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{autoFocus:!0,value:i,onChange:x=>m(x.target.value),placeholder:"my-notes",className:"flex-1 bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),e.jsx("span",{className:"text-xs text-fg-faint",children:".md"})]}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:["Lowercase letters, digits, dashes, underscores. The file is created at",e.jsxs("code",{className:"ml-1 font-mono text-fg-dim",children:["~/.claude/projects/",t,"/memory/",g||"…",".md"]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs text-fg-faint",children:"Description (optional)"}),e.jsx("input",{value:s,onChange:x=>u(x.target.value),placeholder:"one-line summary",className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})]}),b&&e.jsx("div",{className:"text-xs text-red-400",children:b}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:$,disabled:!N||f,className:"px-3 py-1 text-xs text-fg border border-line hover:bg-bg-hi rounded transition-colors disabled:opacity-40",children:f?"Creating…":"Create"}),e.jsx("button",{onClick:o,disabled:f,className:"px-3 py-1 text-xs text-fg-faint hover:text-fg-dim rounded transition-colors",children:"Cancel"})]})]})}export{Ee as Memory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ah as e}from"./index-A9TWmB7_.js";function n({toolbar:s,footer:l,children:r}){return e.jsxs("div",{className:"h-full flex flex-col",children:[s&&e.jsx("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:s}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:r}),l&&e.jsx("div",{className:"shrink-0 border-t border-line bg-bg-elev",children:l})]})}export{n as P};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`}function ie(){const r=
|
|
3
|
-
`)};if(!r)return e.jsx(w,{title:"loading…"});if(m==="presets")return e.jsx(A,{toolbar:k,children:e.jsx(ee,{})});const C=t=>t!=="user"&&!a,h=f?j[f]:null,{perms:x,full:L,err:T}=h?ae(h.draftRaw):{perms:{},full:{},err:null},S=t=>{f&&(y(null),E(f,oe(L,t)))},_=(t,l)=>{const o=l.trim();if(!o)return;const g=x[t]??[];g.includes(o)||S({...x,[t]:[...g,o]})},
|
|
1
|
+
import{au as d,aN as B,aI as H,aP as W,aK as N,aj as q,an as G,ad as Q,ah as e,l as w,P as D,V as U,az as X}from"./index-A9TWmB7_.js";import{P as A}from"./Panel-DWmE5Fu9.js";import{S as Y}from"./ScopeSwitcher-C0538XU8.js";import{S as Z}from"./SaveBar-BZs0IQHq.js";import{P as ee}from"./Library-CUoOC77T.js";import{u as te,E as se,s as re}from"./settingsSchema-C9I9a0jv.js";import"./monaco-editor-BW5C4Iv1.js";const ne=["allow","deny","ask"];function ae(r){if(r.trim()==="")return{perms:{},full:{},err:null};try{const n=JSON.parse(r);return{perms:n.permissions??{},full:n,err:null}}catch(n){return{perms:{},full:{},err:n.message}}}function oe(r,n){const a={...r,permissions:n};return JSON.stringify(a,null,2)+`
|
|
2
|
+
`}function ie(){const r=B(),n=H(),a=(n==null?void 0:n.cwd)??null,s=W(t=>t.navFace),i=d.useRef(!1),u=d.useRef(s),[p,c]=d.useState(()=>s==="project"&&a?"project":"user"),[m,P]=d.useState("effective");d.useEffect(()=>{if(u.current!==s){if(u.current=s,i.current){i.current=!1;return}c(s==="project"&&a?"project":"user")}},[s,a]),d.useEffect(()=>{s==="project"&&m==="presets"&&P("effective")},[s,m]);const I=t=>{i.current=!0,c(t)},b=te(D,r,a),f=b[p]??null,j=N(t=>t.files),E=N(t=>t.setDraft),J=N(t=>t.saveJson),O=N(t=>t.revert),[M,y]=d.useState(null),k=e.jsx(U,{options:[{key:"effective",label:"Effective"},{key:"rules",label:"Rules"},...s==="home"?[{key:"presets",label:"Presets"}]:[]],active:m,onChange:P}),$=d.useMemo(()=>{const t=q(G(j,b));return Q(t,["permissions"])??{kind:"object",children:{}}},[j,b]),F=(t,l)=>{var R;const o=b[p];if(!o)return;y(null);const g=((R=j[o])==null?void 0:R.draftRaw)??"";let v={};if(g.trim())try{v=JSON.parse(g)}catch{v={}}const V=X(v.permissions??{},t,l),z={...v,permissions:V};E(o,JSON.stringify(z,null,2)+`
|
|
3
|
+
`)};if(!r)return e.jsx(w,{title:"loading…"});if(m==="presets")return e.jsx(A,{toolbar:k,children:e.jsx(ee,{})});const C=t=>t!=="user"&&!a,h=f?j[f]:null,{perms:x,full:L,err:T}=h?ae(h.draftRaw):{perms:{},full:{},err:null},S=t=>{f&&(y(null),E(f,oe(L,t)))},_=(t,l)=>{const o=l.trim();if(!o)return;const g=x[t]??[];g.includes(o)||S({...x,[t]:[...g,o]})},K=(t,l)=>{const o=x[t]??[];S({...x,[t]:o.filter((g,v)=>v!==l)})};return e.jsx(A,{toolbar:e.jsxs(e.Fragment,{children:[k,e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(Y,{scopes:D.scopes,active:p,onChange:I,annotate:t=>{if(C(t))return{exists:!1};const l=b[t];if(!l)return null;const o=j[l];return{exists:(o==null?void 0:o.exists)??!1,dirty:(o==null?void 0:o.dirty)??!1}}}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:f??"—"}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:f&&h?e.jsx(Z,{dirty:h.dirty,busy:h.busy,parseError:M||T||h.parseError,lastSavedAt:h.lastSavedAt,onSave:async()=>{y(null);const t=await J(f);t.ok||y(t.error??"save failed")},onRevert:()=>{y(null),O(f)}}):null,children:C(p)?e.jsx(w,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):m==="effective"?e.jsx(se,{node:$,targetScope:p,onOverride:F,schema:re().rootedAt(["permissions"]),rootLabel:"permissions"}):f&&h?e.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[e.jsx(le,{value:x.defaultMode??"default",onChange:t=>S({...x,defaultMode:t})}),ne.map(t=>e.jsx(ce,{list:t,rules:x[t]??[],onAdd:l=>_(t,l),onRemove:l=>K(t,l)},t)),e.jsx(de,{dirs:x.additionalDirectories??[],onChange:t=>S({...x,additionalDirectories:t})})]}):e.jsx(w,{title:"resolving…"})})}const ve=d.memo(ie);function le({value:r,onChange:n}){const a=["default","acceptEdits","plan","bypassPermissions"];return e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),e.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:a.map(s=>e.jsx("button",{onClick:()=>n(s),className:`px-2.5 py-1 text-xs transition-colors ${r===s?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:s},s))})]})}function ce({list:r,rules:n,onAdd:a,onRemove:s}){const[i,u]=d.useState(""),p=r==="allow"?"text-green-400":r==="deny"?"text-red-400":"text-yellow-400";return e.jsxs("section",{children:[e.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${p}`,children:r}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx("input",{value:i,onChange:c=>u(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(a(i),u(""))},placeholder:r==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),e.jsx("button",{onClick:()=>{a(i),u("")},disabled:!i.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),n.length===0?e.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):e.jsx("ul",{className:"space-y-0.5",children:n.map((c,m)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[e.jsx("span",{className:"flex-1 text-fg-dim truncate",children:c}),e.jsx("button",{onClick:()=>s(m),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${m}-${c}`))})]})}function de({dirs:r,onChange:n}){const[a,s]=d.useState("");return e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),e.jsx("div",{className:"flex gap-2 mb-2",children:e.jsx("input",{value:a,onChange:i=>s(i.target.value),onKeyDown:i=>{i.key==="Enter"&&a.trim()&&(n([...r,a.trim()]),s(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),e.jsx("ul",{className:"space-y-0.5",children:r.map((i,u)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[e.jsx("span",{className:"flex-1 text-fg-dim truncate",children:i}),e.jsx("button",{onClick:()=>n(r.filter((p,c)=>c!==u)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${u}-${i}`))})]})}export{ve as Permissions};
|