Skip to content

feat(agents-square): add source browsing and import flow#1883

Open
futuremeng wants to merge 2 commits intoagentscope-ai:mainfrom
futuremeng:feat/upstream/agents-square
Open

feat(agents-square): add source browsing and import flow#1883
futuremeng wants to merge 2 commits intoagentscope-ai:mainfrom
futuremeng:feat/upstream/agents-square

Conversation

@futuremeng
Copy link
Copy Markdown
Contributor

@futuremeng futuremeng commented Mar 19, 2026

Scope

This PR adds Agents Square source browsing and import flow across backend APIs and Console UI.

What Is Included

  • Agents Square config models and source management APIs.
  • Source validation and item aggregation APIs.
  • Import flow with conflict/overwrite handling.
  • Console UI for source management, search/filter, and import actions.
  • i18n updates and targeted router tests.

What Is Not Included

  • No MCP runtime/import changes.
  • No cron/channel runtime hardening changes.

Validation

  • pre-commit run --all-files
  • /Users/futuremeng/github/futuremeng/CoPaw/.venv/bin/python -m pytest tests/unit/app/routers/test_agents_square.py -q
  • cd /Users/futuremeng/github/futuremeng/CoPaw/console && npm run -s tsc -- --noEmit
  • CI pre-commit and console format jobs

Notes For Reviewers

  • Suggested review order: config/types -> router APIs -> tests -> Console page.
  • The latest follow-up commit is CI-focused and keeps feature behavior unchanged.

Copilot AI review requested due to automatic review settings March 19, 2026 14:49
@futuremeng futuremeng had a problem deploying to maintainer-approved March 19, 2026 14:49 — with GitHub Actions Failure
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “Agents Square” marketplace-style flow to CoPaw, spanning new backend config + APIs for managing agent sources and importing agents, plus a Console UI to browse sources/items and trigger imports.

Changes:

  • Introduces agents_square configuration models (sources, cache, install policy) in the root config.
  • Adds Agents Square router endpoints for listing/updating/validating sources, aggregating items, and importing agents.
  • Implements Console UI (drawer) for browsing/searching/importing agents and editing/validating sources, with i18n strings and new backend unit tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/unit/app/routers/test_agents_square.py Adds unit tests covering square items listing, source validation, import success/conflict, and pinned-source deletion rejection.
src/copaw/config/config.py Adds Pydantic models for Agents Square config and wires agents_square into the root Config.
src/copaw/app/routers/agents.py Implements Agents Square APIs, git-based aggregation, caching, source validation, and agent import flow.
console/src/pages/Settings/Agents/index.tsx Adds Agents Square drawer UI with item search/filter, import flow, and source management/editing.
console/src/pages/Settings/Agents/index.module.less Styles the Agents Square item list/cards (including dark-mode adjustments).
console/src/locales/en.json Adds English strings for Agents Square UI.
console/src/locales/zh.json Adds Chinese strings for Agents Square UI.
console/src/locales/ru.json Adds Russian strings for Agents Square UI.
console/src/locales/ja.json Adds Japanese strings for Agents Square UI.
console/src/api/types/agents.ts Adds TS types for Agents Square sources/items/import APIs.
console/src/api/modules/agents.ts Adds client methods for Agents Square endpoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

status_code=400,
detail=f"SOURCE_PINNED_CANNOT_DELETE: {source_id}",
)

Comment on lines +668 to +682
ttl_sec = int(payload.cache.get("ttl_sec", 600))
overwrite_default = bool(payload.install.get("overwrite_default", False))
preserve_workspace_files = bool(
payload.install.get("preserve_workspace_files", True),
)

return AgentsSquareConfig(
version=max(1, int(payload.version)),
sources=normalized_sources,
cache=AgentsSquareCacheConfig(ttl_sec=ttl_sec),
install=AgentsSquareInstallConfig(
overwrite_default=overwrite_default,
preserve_workspace_files=preserve_workspace_files,
),
)
async def get_square_items(refresh: bool = False) -> dict:
"""Get aggregated Agents Square items."""
config = load_config()
items, source_errors, meta, _ = _aggregate_square_items(
source_id: str
agent_id: str
overwrite: bool = False
enable: bool = True
Comment on lines +965 to +966
(workspace_dir / "AGENTS.md").write_text(content + "\n", encoding="utf-8")

Comment on lines +442 to +443
source_root = (tmp_dir / (source.path or ".")).resolve()
if not str(source_root).startswith(str(tmp_dir.resolve())):
Comment on lines +597 to +604
if _OWNER_REPO_PATTERN.fullmatch(raw):
return True
if _extract_github_source_spec(raw) is not None:
return True
if raw.startswith(("https://", "http://", "git@")):
return True
if raw.endswith(".git"):
return True
@futuremeng futuremeng had a problem deploying to maintainer-approved March 20, 2026 15:55 — with GitHub Actions Failure
@futuremeng futuremeng changed the title feat: add Agents Square source browsing and import flow feat(agents-square): add source browsing and import flow Mar 20, 2026
@github-project-automation github-project-automation Bot moved this to Todo in QwenPaw Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants