diff --git a/PROTO.md b/PROTO.md index 96a98c3..13e74cf 100644 --- a/PROTO.md +++ b/PROTO.md @@ -45,7 +45,7 @@ write_tools.py # 12 write tools (create/edit issue+pr/merge/close/comm release_tools.py # 3 release reads (run jobs, release, release asset) + 4 gated release writes (dispatch, tag, edit notes, upload asset) review_tools.py # 3 verdict tools (comment/approve/request-changes, guarded) — gated gh_issue.py # /issue chat command logic + repo resolution (resolve_repo, default_repo_error) -api.py # routers — public PAGES (view/workspace/new-issue) + gated data routes (config/status/issues/prs/counts/issue) +api.py # routers — public PAGES (view/new-issue) + gated data routes (config/status/issues/prs/counts/issue) view.py # PAGE = read-only board; NEW_ISSUE_PAGE = file-an-issue form; shared setup card. --pl-* themed skills/github/SKILL.md # workflow manual (review / fix round / CI / issues / merge / release) — host auto-loads skills/ tests/ # host-free pytest (gating + version coherence + routes via TestClient + the no-raise sweep) @@ -57,10 +57,10 @@ host exposes `register_router` (guarded — degrade-safe): the PAGES on the PUBL DATA routes on the GATED `/api/plugins/github` prefix (pages fetch them with the DS plugin-kit's `apiFetch`, which attaches the operator bearer from the postMessage handshake). Pages are vanilla JS themed entirely from `--pl-*` tokens (no host build). -Three manifest `views`, four surfaces, deliberately split: +Two manifest `views`, three surfaces, deliberately split: - **`/view`** — the READ-ONLY board (Issues/PRs tabs + repo picker + state filter). Right - dock + a ⌘K morph (`palette: inline`). No writes — it's a viewer. -- **`/workspace`** — the same READ-ONLY board and PR drawer in the full-width GitHub rail. + dock by default (movable to any dock) + a ⌘K morph (`palette: inline`). No writes — it's a + viewer. ONE view only: a second view of the same page just doubles the rail icon. - **`/new-issue`** — the compact file-an-issue form. A util-bar widget pill (`utility`, opens its dialog) AND a distinct ⌘K page (`palette: { path }`). `POST /issue` reuses the SAME `file_issue` gate path as the `/issue` command, so they can't diverge. diff --git a/api.py b/api.py index 0112382..0e7654a 100644 --- a/api.py +++ b/api.py @@ -225,7 +225,7 @@ def resolve_config(cfg: dict) -> dict: def build_view_router(): """The PAGES — served under the PUBLIC ``/plugins/github`` prefix (ungated): the - read-only board (``/view`` and ``/workspace``) and the compact file-an-issue form (``/new-issue``).""" + read-only board (``/view``) and the compact file-an-issue form (``/new-issue``).""" from fastapi import APIRouter from fastapi.responses import HTMLResponse @@ -233,7 +233,6 @@ def build_view_router(): router = APIRouter() - @router.get("/workspace") @router.get("/view") async def _view(): return HTMLResponse(PAGE) diff --git a/protoagent.plugin.yaml b/protoagent.plugin.yaml index d0f1ef9..b19188c 100644 --- a/protoagent.plugin.yaml +++ b/protoagent.plugin.yaml @@ -2,7 +2,7 @@ # Keep `version` in lockstep with pyproject.toml (tests/test_version.py asserts it). id: github name: GitHub (read/write tools) -version: 0.12.1 +version: 0.12.2 description: >- Read AND write GitHub tools over the `gh` CLI, with PER-AGENT write gating. The read tools (PRs — list + merge readiness, issues, comments, search-before-filing, @@ -63,15 +63,14 @@ settings: - {key: repos, label: "Repo picker list", type: string_list} # Console views (ADR 0026/0057) — sandboxed iframes the plugin serves itself (api.py). -# - the READ-ONLY board (Issues/PRs tabs over the repo picker): right dock + a ⌘K morph +# - the READ-ONLY board (Issues/PRs tabs over the repo picker): ONE view + a ⌘K morph # (`palette: inline` opens the board in the palette body). `placement: right` is just a -# default — views are drag-sortable in the console. -# - the same READ-ONLY board at /workspace: full-width GitHub rail view. +# default — views are drag-sortable across every dock, so a second view of the same +# board for another placement is only a duplicate icon (removed in 0.12.2). # - FILE AN ISSUE (the compact form): a util-bar widget pill (`utility`, opens its dialog) # AND a distinct ⌘K palette page (`palette: { path }`). Filing lives here + the palette, # NOT in the board — the board is a viewer. views: - - { id: github-workspace, label: GitHub, icon: Github, path: /plugins/github/workspace, placement: rail } - { id: github, label: GitHub, icon: Github, path: /plugins/github/view, placement: right, palette: inline } - { id: github-new-issue, label: New issue, icon: Bug, path: /plugins/github/new-issue, utility: { info: "File a GitHub issue" }, palette: { path: /plugins/github/new-issue } } @@ -80,7 +79,6 @@ views: # plugin public_paths feature; older hosts ignore it (the pages stay open-mode only). # The page is chrome; the DATA it fetches stays gated under /api/plugins/github/*. public_paths: - - /plugins/github/workspace - /plugins/github/view - /plugins/github/new-issue diff --git a/pyproject.toml b/pyproject.toml index 8c2e3ec..8a494c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "github-plugin" -version = "0.12.1" +version = "0.12.2" description = "Read/write GitHub tools for protoAgent over the gh CLI, with per-agent write gating." requires-python = ">=3.11" diff --git a/tests/test_board_view.py b/tests/test_board_view.py index 06df0a7..65589f0 100644 --- a/tests/test_board_view.py +++ b/tests/test_board_view.py @@ -562,26 +562,20 @@ def spy(cfg): assert all(t.name.startswith("asyncio_") for t in threads), [t.name for t in threads] -def test_workspace_serves_same_page_and_is_public(): +def test_board_is_one_view_and_workspace_route_is_gone(): + """One board, one rail icon: views are movable across docks, so a second view of the + same page (the old `github-workspace`) only rendered a duplicate GitHub icon.""" from pathlib import Path import yaml - from ghplugin.view import PAGE client = TestClient(_app()) - response = client.get("/plugins/github/workspace") - assert response.status_code == 200 - assert response.text == client.get("/plugins/github/view").text == PAGE + assert client.get("/plugins/github/workspace").status_code == 404 manifest = yaml.safe_load((Path(__file__).resolve().parent.parent / "protoagent.plugin.yaml").read_text()) - assert "/plugins/github/workspace" in manifest["public_paths"] - workspace = next(v for v in manifest["views"] if v["id"] == "github-workspace") - assert workspace == { - "id": "github-workspace", - "label": "GitHub", - "icon": "Github", - "path": "/plugins/github/workspace", - "placement": "rail", - } + board_views = [v for v in manifest["views"] if v["path"] == "/plugins/github/view"] + assert [v["id"] for v in board_views] == ["github"] + assert [v["id"] for v in manifest["views"]] == ["github", "github-new-issue"] + assert "/plugins/github/workspace" not in manifest["public_paths"] def test_drawer_shell_and_markdown_security_contract(): diff --git a/uv.lock b/uv.lock index 1b2a411..44c26cf 100644 --- a/uv.lock +++ b/uv.lock @@ -4,5 +4,5 @@ requires-python = ">=3.11" [[package]] name = "github-plugin" -version = "0.12.1" +version = "0.12.2" source = { virtual = "." } diff --git a/view.py b/view.py index ba2a6e8..4f8a688 100644 --- a/view.py +++ b/view.py @@ -1,7 +1,7 @@ """The GitHub console pages — served at ``/plugins/github/*`` (by api.py) and iframed by the console. Two pages, shared across console surfaces: -- ``PAGE`` (``/view`` and ``/workspace``) — the **read-only board**: a quick look at a project's board, +- ``PAGE`` (``/view``) — the **read-only board**: a quick look at a project's board, two tabs (Issues / Pull Requests) over a repo picker (the configured ``github.repos``) + an open/closed/all filter. No writes — it's a viewer. Declared in the manifest as a right-dock view AND a ⌘K palette morph (``palette: inline``), plus a full-width rail view.