# Myagent **Repository Path**: zhongjack/myagent ## Basic Information - **Project Name**: Myagent - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-26 - **Last Updated**: 2026-07-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Personal AI Workbench Local-first VSCode extension prototype for an AI-driven work memory and knowledge management assistant. ## Phase 1 Scope - VSCode extension scaffold in TypeScript. - Workspace storage initialization under `.vscode-workspace`. - ModelHub CRUD foundation for model configs. - Context-aware chat Webview shell. - Current-file capture command and save-event capture. - Knowledge sidebar backed by local metadata. ## Current Prototype Scope - Save events create work records and Markdown archives under `.vscode-workspace/docs/{category}`. - Markdown documents can be generated from the current file or selection and stored under `.vscode-workspace/docs/{category}`. - Code files can be snapshotted by project under `.vscode-workspace/code_repo/{project}`. - Clipboard text can be captured manually or through an optional polling monitor. - Terminal commands can be captured when VSCode Shell Integration is enabled. - Editor selections can be saved as knowledge items from the editor context menu. - External JSON or Markdown knowledge files can be imported and marked with an external author. - Knowledge items can be exported as shareable JSON. - Knowledge items are grouped by type in the AI Workbench sidebar, can be searched, opened, and soft-deleted. - Knowledge metadata can be edited, voted, and saved back from an opened Markdown document. - Errors can be captured from the current selection or clipboard as knowledge items. - Chat responses can be saved directly as solution knowledge. - Work records can be viewed, searched, opened as Markdown previews, soft-deleted, exported by category/time range, and imported from exported JSON. - Workspace stats can be viewed in a compact Webview. - Local storage health can be checked and repaired. - Maintenance backups can be created manually and are created automatically before destructive maintenance. - Workspace snapshots can be exported as `.wsnap` JSON files under `.vscode-workspace/exports`. - Workspace snapshots can be imported and merged by ID for cross-device continuity. - Chat can draft a local context package from the active file or selected text before remote model calls are implemented. - Chat can call OpenAI-compatible `/v1/chat/completions` endpoints for OpenAI, OpenRouter, Ollama, and custom providers. - Chat history can be viewed from a dedicated Webview. - Built-in and installed skills can run against the current file or selection using the configured model. - A JSON skill marketplace index can be browsed to install skills. ## Development ```powershell npm.cmd install npm.cmd run compile ``` Open this folder in VSCode and run `F5` to launch an Extension Development Host. ## Commands - `Personal AI Workbench: Open Chat` - `Personal AI Workbench: Show Chat History` - `Personal AI Workbench: Add Model` - `Personal AI Workbench: List Models` - `Personal AI Workbench: Edit Model` - `Personal AI Workbench: Test Model Connection` - `Personal AI Workbench: Set Preferred Model` - `Personal AI Workbench: Toggle Model Active` - `Personal AI Workbench: Delete Model` - `Personal AI Workbench: List Skills` - `Personal AI Workbench: Install Skill` - `Personal AI Workbench: Browse Skill Marketplace` - `Personal AI Workbench: Run Skill` - `Personal AI Workbench: Toggle Clipboard Monitor` - `Personal AI Workbench: Capture Clipboard Now` - `Personal AI Workbench: Capture Current File` - `Personal AI Workbench: Snapshot Current File` - `Personal AI Workbench: Generate Document` - `Personal AI Workbench: Add Knowledge From Selection` - `Personal AI Workbench: Add Command Knowledge` - `Personal AI Workbench: Add Error From Clipboard` - `Personal AI Workbench: Import External Knowledge` - `Personal AI Workbench: Export Knowledge` - `Personal AI Workbench: Search Knowledge` - `Personal AI Workbench: Add Knowledge From Chat` - `Personal AI Workbench: Edit Knowledge Item` - `Personal AI Workbench: Save Open Knowledge Document` - `Personal AI Workbench: Upvote Knowledge Item` - `Personal AI Workbench: Downvote Knowledge Item` - `Personal AI Workbench: Show Work Records` - `Personal AI Workbench: Search Work Records` - `Personal AI Workbench: Delete Work Record` - `Personal AI Workbench: Export Work Records` - `Personal AI Workbench: Import Work Records` - `Personal AI Workbench: Show Stats` - `Personal AI Workbench: Health Check` - `Personal AI Workbench: Repair Health` - `Personal AI Workbench: Backup Now` - `Personal AI Workbench: Export Snapshot` - `Personal AI Workbench: Import Snapshot` - `Personal AI Workbench: Purge Deleted Items` - `Personal AI Workbench: Open Storage Root` ## Storage The prototype uses JSON and JSONL files to avoid native SQLite packaging friction during early iteration: - `.vscode-workspace/.workbench/models.json` - `.vscode-workspace/.workbench/work-records.jsonl` - `.vscode-workspace/.workbench/knowledge.jsonl` - `.vscode-workspace/.workbench/chat-history.jsonl` - `.vscode-workspace/.workbench/skills.json` - `.vscode-workspace/.workbench/preferences.json` - `.vscode-workspace/docs/` - `.vscode-workspace/knowledge/` - `.vscode-workspace/code_repo/` - `.vscode-workspace/skills/` - `.vscode-workspace/exports/` SQLite can replace the storage implementation behind `WorkspaceStorage` without changing command or UI code. ## Health Run `Personal AI Workbench: Health Check` to inspect duplicate JSONL IDs, missing Markdown backups, invalid preferred model references, and missing storage directories. Run `Personal AI Workbench: Backup Now` to create a maintenance `.wsnap` backup. `Repair Health` and `Purge Deleted Items` create backups before modifying data. Run `Personal AI Workbench: Repair Health` to de-duplicate JSONL records by newest revision, rebuild Markdown backups, recreate missing directories, and clear invalid preferred model references. ## Monitoring File save capture is enabled by default. Code snapshots are enabled by default for source/config-like files and can be disabled with `personalAiWorkbench.codeSnapshotOnSave`. Clipboard monitoring is disabled by default and can be enabled with `Personal AI Workbench: Toggle Clipboard Monitor` or the `personalAiWorkbench.clipboardMonitor.enabled` setting. Clipboard monitor settings: - `personalAiWorkbench.clipboardMonitor.enabled` - `personalAiWorkbench.clipboardMonitor.intervalSeconds` - `personalAiWorkbench.clipboardMonitor.minimumLength` Terminal command capture is disabled by default. Enable `personalAiWorkbench.terminalMonitor.enabled` and VSCode Shell Integration to capture completed terminal commands as work records. ## Snapshot Sync Use `Personal AI Workbench: Export Work Records` to export active work records by category and time range as a shareable JSON file under `.vscode-workspace/exports`. Use `Personal AI Workbench: Import Work Records` to preview and merge one of those JSON files by record ID, keeping the newer timestamp on conflict and rebuilding Markdown archives for imported records. Use `Personal AI Workbench: Export Snapshot` to create a `.wsnap` file. Use `Personal AI Workbench: Import Snapshot` on another workspace or device to merge: - Models by `id`. API keys are not exported and must be re-entered on the target device. - Work records by `id`, taking the newer `timestamp` on conflict. - Knowledge items by `id`, taking the newer `updatedAt` on conflict. - Chat history by `id`, taking the newer `timestamp` on conflict. - Code snapshots under `code_repo` are exported and restored by relative path. Import shows a preview and requires confirmation before merging. `Personal AI Workbench: Purge Deleted Items` permanently removes soft-deleted work records, knowledge items, chat messages, and skills. ## Skills The workspace is seeded with three built-in skills on first activation: - `code_review` - `test_gen` - `doc_gen` Run `Personal AI Workbench: Run Skill` to execute a skill against the active file or selection. Run `Personal AI Workbench: Install Skill` to install a JSON definition from a local file or URL. Run `Personal AI Workbench: Browse Skill Marketplace` to install from a JSON index. Configure `personalAiWorkbench.skillMarketplace.indexUrl` to skip URL entry. Minimal skill JSON: ```json { "id": "refactor_suggest", "name": "Refactor Suggest", "description": "Suggest pragmatic refactors for the current code.", "version": "1.0.0", "taskCapability": "coding", "promptTemplate": "Suggest pragmatic refactors. User request: {{prompt}}" } ``` Minimal marketplace index: ```json { "name": "Team Skills", "skills": [ { "id": "refactor_suggest", "name": "Refactor Suggest", "description": "Suggest pragmatic refactors.", "url": "https://example.com/skills/refactor_suggest.json" } ] } ``` Marketplace entries can also inline a `skill` object instead of `url`. ## Model Setup Run `Personal AI Workbench: Add Model` and provide: - Display name, such as `GPT-4.1 Mini` or `Local Llama`. - Provider: `openai`, `openrouter`, `ollama`, or `custom` are currently callable. - Model ID, such as `gpt-4.1-mini`, `openai/gpt-4.1-mini`, or `llama3.1`. - Endpoint. Defaults are supplied for OpenAI, OpenRouter, and Ollama. - API key when required. Keys are stored in VSCode SecretStorage, not in `.vscode-workspace`. Anthropic and Azure remain configuration-only in this prototype and need provider-specific request adapters. Use `Personal AI Workbench: Edit Model` to update display name, provider, model ID, endpoint, temperature, max token limit, routing capabilities, or the stored API key. API key edits stay in VSCode SecretStorage and are not written to workspace files or exported snapshots. Use `Personal AI Workbench: Test Model Connection` to send a minimal prompt through the selected model configuration. The command reports elapsed time and a short response preview, or the provider/request error returned by the adapter. Use `Personal AI Workbench: Set Preferred Model` to pin routing to one active model. If no preferred model is set, routing falls back to capability tags and then the first active model. Use `Personal AI Workbench: Toggle Model Active` to enable or disable a configured model without deleting it.