Files
2026-07-24 11:02:27 -05:00

46 lines
6.2 KiB
Plaintext

# mp-silma-ai-aide
This project is a basic Vite + TypeScript Chrome extension scaffold. The extension side panel reads Gitea configuration from Vite env variables, stores side panel state in Zustand, and uses Axios to call the Gitea API.
Important files:
- `AGENTS.md`: Project instructions for coding agents.
- `manifest.llm.json`: Machine-readable project metadata.
- `docs/extension-management.md`: Chrome extension management instructions, including the required Chrome profile.
- `.env.example`: Required environment variables.
- `vite.config.ts`: Vite build config and generated Chrome extension manifest logic.
- `src/api.ts`: Axios client and Gitea configuration handling.
- `src/store.ts`: Vanilla Zustand side panel state store.
- `src/main.ts`: Side panel UI behavior.
- `index.html`: Side panel document.
- `public/icons/`: Extension icon source and generated PNG sizes copied into `dist/` by Vite.
- `public/local-context.json`: Generated workspace/repo/URL context copied into `dist/`.
- `scripts/generate-local-context.mjs`: Scans `/Users/Tabitha/.openclaw/workspace_Father` plus configured local folder search roots and writes `public/local-context.json`.
- `scripts/serve-local-context.mjs`: Serves live local context at `http://127.0.0.1:23873/local-context.json` by default and rescans on each request.
Build with `npm run build`. The deployable output directory is `dist/`; load that folder in Chrome as an unpacked extension or point deployment tooling at it. Do not edit `dist/` directly.
UI behavior: the app renders as a Chrome side panel, not a draggable window. The top toolbar items are URLs, Gitea Repos, Issues, Add Issue, and a management dropdown for Agents, Prompts, and Workspaces. Add URL lives inside the URLs view as a first-row button that opens a modal dialog; it is enabled only when the active tab base URL is not already known. The user must choose either a workspace or a Gitea repo, and the app infers the linked counterpart. URLs can be deleted from the list; user-added URLs are removed from storage, while generated known URLs are hidden through stored deleted bases. Workspaces combines generated `workspace_Father` entries with user-added absolute local paths stored under `silmaAide.userWorkspaces`; workspace creation uses a first-row Add workspace button, a modal dialog, and searchable generated folder candidates instead of copy/paste path entry. Run `npm run context:serve` to make new local projects appear without rebuilding; the side panel prefers `VITE_LOCAL_CONTEXT_URL`, falls back to bundled `/local-context.json`, and polls live local context every 10 seconds on workspace-sensitive screens. The Prompts view manages workspace-scoped default prompts in `chrome.storage.local` under `silmaAide.prompts`; new prompt workspace selection defaults to the active known URL's workspace/site when available, and Add Issue shows prompts matching the active URL workspace above Content and copies the selected prompt into the editable Content field for human adjustment. The Agents view manages persisted agent files and starts with `GLOBAL AGENT` backed by `AGENTS.md`; agent markdown can use `{{git}}`, `{{repo}}`, `{{workspace}}`, `{{url}}`, `{{baseUrl}}`, `{{profile}}`, and `{{issue}}` template variables. The default global agent tells downstream agents to close the Gitea issue after pushing the implementation and to leave a Gitea issue comment when delivery is blocked, partial, or risky. Add Issue is enabled only when the active tab base URL is known and linked to a Gitea repo. It shows the target repo and active URL, captures visible-tab screenshots with thumbnails, accepts accumulated file attachments, lets the user select an agent file and issue labels, creates the Gitea issue with the selected labels, and uploads the rendered agent file plus all screenshots/files. The label options are Change Request, Idea, Tabitha, Orson, Belisarius, Ozymandias, and Ready; new issues default to Change Request. Captured screenshots can be expanded, removed, or cropped with a wider no-horizontal-scroll draggable/resizable crop panel. Created issue bodies put the human-entered idea/change request under `# Requirements` and generated metadata under `# References`, including `Chrome profile: Silma` and the selected agent. Issues lists recent issues by creation time, defaults to open issues for the active URL's linked repo through an `Only current repo` checkbox, can load recent issues across all loaded repos, supports Open/Closed status multiselect filtering, has an empty-by-default label filter, and shows selected issue subject/content/label edit fields that save against the selected issue repo with Gitea content-version readback verification, a direct Open in Gitea link, a placeholder Send to Codex console log action, attachments, comment chains, direct selected-issue screenshot/file attachment uploads, and a comment form with text, screenshots, and file attachments. Clicking the selected issue row again or the detail close control collapses the detail panel. Existing issue rows can be deleted after confirmation, and existing issue attachments can be deleted. Text-entry state updates must not blur focused Add Issue, selected issue edit, Issues comment, Agents editor controls, Prompts editor controls, or workspace folder search controls. Gitea API errors include the failed operation and network-level failures identify the configured API base with env, permissions, network/VPN, token scope, and attachment-size checks. Gitea repos are ordered by latest default-branch commit. Workspace and URL views show established links between local workspaces, known URLs, and Gitea repos.
Extension management rule: use the Codex Chrome extension with the Chrome profile named `Silma`. Do not use `Profile 1`.
Codex commands:
- Setup: `npm run codex:setup`
- Dev: `npm run dev:codex`
- Live context: `npm run context:serve`
- Build: `npm run build:codex`
- Verify output: `npm run verify:dist`
Required env variables:
- `VITE_GITEA_BASE_URL`
- `VITE_GITEA_TOKEN`
- `VITE_GITEA_REPO_OWNER`
- `VITE_GITEA_REPO_NAME`
Gitea workflows:
- `.gitea/workflows/build.yml`: build validation for pushes to `main` and pull requests.
- `.gitea/workflows/issue-opened-placeholder.yml`: new issue placeholder that prints `200 okay`.