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
8 changes: 4 additions & 4 deletions PROTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,14 @@ 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

from .view import NEW_ISSUE_PAGE, PAGE

router = APIRouter()

@router.get("/workspace")
@router.get("/view")
async def _view():
return HTMLResponse(PAGE)
Expand Down
10 changes: 4 additions & 6 deletions protoagent.plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 } }

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
22 changes: 8 additions & 14 deletions tests/test_board_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion view.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading