Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Repository Guidelines

## Project Structure & Module Organization
- Root solution lives in `SemanticDeveloper/SemanticDeveloper.sln`; the primary desktop app sits under `SemanticDeveloper/SemanticDeveloper/`.
- UI resources are split between Avalonia XAML (`*.axaml`) and backing C# files (`*.axaml.cs`); dialogs reside in `Views/`, shared models in `Models/`, and service logic (Codex, Git, MCP, settings) in `Services/`.
- Static assets (icons, images) are in `SemanticDeveloper/SemanticDeveloper/Images/`; installer scaffolding lives in `SemanticDeveloper/Installers/`.

## Build, Test, and Development Commands
- Restore & compile the app: `dotnet build SemanticDeveloper/SemanticDeveloper/SemanticDeveloper.csproj` (the installer projects lack entry points).
- Run the desktop app: `dotnet run --project SemanticDeveloper/SemanticDeveloper`.
- Update NuGet dependencies: `dotnet restore SemanticDeveloper/SemanticDeveloper/SemanticDeveloper.csproj`.

## Coding Style & Naming Conventions
- Follow standard C# conventions: 4-space indentation, PascalCase for types, camelCase for locals/fields (prefix private fields with `_` when mutable).
- Keep Avalonia XAML tidy: align attributes, prefer named handlers declared in the paired code-behind.
- Favor expression-bodied members for single-line getters and avoid trailing whitespace; run `dotnet format` before large refactors.
- When logging to the CLI pane, use `AppendCliLog` for line entries and prefer the existing `System:` prefixes for system-generated lines.

## Testing Guidelines
- No automated test project exists yet; add new tests alongside features if appropriate.
- For manual verification, exercise key flows: workspace selection, MCP server loading, Codex login (`codex auth login`), and session restarts.
- If you introduce automated tests, place them under a `Tests/` sibling folder and document the execution command (e.g., `dotnet test`).

## Commit & Pull Request Guidelines
- Write concise, imperative commit subjects (`Add MCP startup summary`, `Fix Codex auth probe`), with optional body paragraphs for context.
- Reference issue IDs in the body when applicable and squash trivial commits before submitting a PR.
- Pull requests should include: a brief summary, testing notes, screenshots/GIFs for UI changes, and links to relevant issues or discussions.

## Configuration & Security Notes
- User-specific MCP servers live at `~/.config/SemanticDeveloper/mcp_servers.json` (or `%AppData%\SemanticDeveloper\mcp_servers.json` on Windows); avoid committing sample credentials.
- API keys are configured through the app settings; never hard-code secrets—use environment variables or the settings dialog.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

![Semantic Developer Img](/SemanticDeveloper/SemanticDeveloper/Images/SemanticDeveloperLogo.ico)

A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI using its JSON protocol. It lets you:
A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI app server using its JSON protocol. It lets you:

- Select a workspace folder and browse files via a lazy file tree
- Start a Codex session and stream assistant output in real time
- Send user input that is wrapped as protocol `Submission`s (proto)
- Send user input that is wrapped as protocol `Submission`s (app server)
- Auto‑approve exec/patch requests (automatic)
- Select a Codex profile (from `config.toml`) and load MCP servers from a JSON config
– See live token usage and estimated context remaining in the header

> Important: This app always runs Codex in proto mode via the `proto` subcommand.
> Important: This app runs Codex through the `app-server` subcommand.

## Requirements

- .NET SDK 8.0+
- Codex CLI installed and on `PATH`
- Verify with: `codex proto --help`
- Verify with: `codex app-server --help`
- No external Git required — uses LibGit2Sharp for repo init/staging/commit

## Build & Run
Expand All @@ -32,7 +32,7 @@ A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI using
1. Open the app, click “Select Workspace…” and choose a folder.
- If it isn’t a git repo and the Git library is available, you’ll be prompted to initialize one.
- You can also initialize later from the header via “Initialize Git…”.
2. Click “Restart Session” to launch `codex proto` in the workspace directory (a session also starts automatically after you select a workspace).
2. Click “Restart Session” to launch `codex app-server` in the workspace directory (a session also starts automatically after you select a workspace).
3. Type into the input box and press Enter to send. Output appears in the right panel.
4. “CLI Settings” lets you change:
- Profile (from Codex `config.toml`) — passed via `-c profile=<name>`
Expand Down Expand Up @@ -154,7 +154,7 @@ Notes

## Conversation & Protocol Behavior

- Always uses proto mode: the app starts the CLI with `codex proto`.
- Always uses the Codex app server: the app starts the CLI with `codex app-server`.
- User input is wrapped as a protocol `Submission` with a new `id` and an `op` payload:
- Defaults to `user_input` with `items: [{ type: "text", text: "..." }]`.
- When the app infers that a full turn is required, it sends `user_turn` and includes
Expand All @@ -175,7 +175,7 @@ Notes
- Returns to `idle` only when the server signals `task_complete` (or `turn_aborted`).

- Stop vs. Restart:
- Stop sends a proto `interrupt` to abort the current turn (like pressing Esc in the CLI) without killing the session; it falls back to terminating the process if needed.
- Stop sends an `interrupt` to the app server to abort the current turn (like pressing Esc in the CLI) without killing the session; it falls back to terminating the process if needed.
- Restart ends the current process and starts a fresh session in the same workspace.

- Clear Log clears both the on‑screen log and the underlying editor document; it does not affect the session.
Expand Down Expand Up @@ -206,12 +206,12 @@ Selection behavior:
- Change selections, then click “Restart Session” to apply.
## Troubleshooting

- “Failed to start 'codex'”: Ensure the CLI is installed and on `PATH`. Test with `codex --help` and `codex proto --help`.
- “Failed to start 'codex'”: Ensure the CLI is installed and on `PATH`. Test with `codex --help` and `codex app-server --help`.
- Model selection: Prefer using `config.toml` (via Profiles). You can set `model`, `model_provider`, and related options per the Codex docs.
- Git init issues: The app uses LibGit2Sharp (no Git CLI needed). If the native lib fails to load, the app skips initialization. Commits use your configured name/email if available; otherwise a fallback signature is used.

- Authentication:
- If you are not using an API key and the Codex CLI is not logged in (no `~/.codex/auth.json`), the proto stream returns 401. The app detects this and prompts to run `codex auth login` for you. Follow the browser flow; on success the app restarts the proto session automatically.
- If you are not using an API key and the Codex CLI is not logged in (no `~/.codex/auth.json`), the app-server stream returns 401. The app detects this and prompts to run `codex auth login` for you. Follow the browser flow; on success the app restarts the session automatically.
- If your CLI version doesn’t support `auth login`, the app falls back to `codex login`.
- When “Use API Key” is enabled in CLI Settings, the app attempts a non‑interactive `codex login --api-key <key>` before sessions and on 401. If login succeeds, it restarts the session automatically.

Expand All @@ -235,7 +235,7 @@ Selection behavior:

## Notes

- Proto mode is enforced in code; the app does not fall back to non‑proto modes.
- App-server mode is enforced in code; the app does not fall back to legacy proto mode.
- Settings are stored under the OS‑specific application data directory and loaded on startup.
- The log view uses AvaloniaEdit + TextMate (Dark+) for better legibility and simple JSON syntax coloring.

Expand Down
2 changes: 1 addition & 1 deletion SemanticDeveloper/Installers/Linux/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ APP_PROJ="$ROOT/SemanticDeveloper/SemanticDeveloper.csproj"
PUBLISH_DIR="$SCRIPT_DIR/out/publish"
PKG_ROOT="$SCRIPT_DIR/pkgroot"
DIST_DIR="$SCRIPT_DIR/dist"
VERSION="1.0.2"
VERSION="1.0.3"
ARCH="amd64"
if [[ "$RID" == "linux-arm64" ]]; then ARCH="arm64"; fi

Expand Down
Binary file not shown.
Loading