Work Resources becomes generic core composition over declarative plugin
`resources[]`, ahead of the `github` / `linear` / `slack` plugins (Wave 2B-2).
- Core knows only `branch` and `url` (cli/resource_urls.py). Every link is
mined raw, so the plugins' kinds apply at view time: installing a plugin
lights up the whole archive with zero re-parse. Notion links are plain
`url` pills.
- New backend/plugins/resources.py: PluginResourceRegistry compiled from the
owner's active plugins' `resources[]` + each plugin's settings (workers,
cwdGlobs, notifPills, channelMap, {config.*} templates); cached on the new
PluginStore.version and kept by identity while unchanged.
- manifest.py: expanded, ReDoS-checked `resources[]` (urlRegex, idRegex,
id/url/label templates, titleToken, bareKeyRegex + team gate,
branchKeyPattern cross-links, ignoreUrlRegex, toolExtractors[], icon,
color, stateTones, clickAction, priority, hueRole); the v3 shape and the
approval fingerprint stay as they were.
- ResourceMiner runs declarative toolExtractors / bare keys in-process (no
subprocess); legacy resourcesAuto / resourceTeams / slackChannels still read.
- resource_view: per-plugin scope, branchKeyPattern cross-linking, priority
primary, generic `<lead> · <title> · <shade>` title; Context cached on
(summaries, meta, registry) with per-transcript memo.
- look.subject → generic (hueKey, shadeKey) from hueRole; past.py generic.
- conv add/rm send raw links / keys; the hub's registry reads them.
- Removed: conversations/pr_state.py, sidecar/routes_gh.py (/gh/pr-states),
deps.pr_states, Profile.resources + Orus defaults (dropped on load),
GET /api/profiles/resource-directory, ProfileResourcesEditor + the
Profile page's Tracking tab.
- Frontend pills read `ui.resources` descriptors (icon, tone, stateTones,
clickAction); historical kinds keep a fallback. ResourceKind widens to str.
- Fixture manifests + test kit for the three plugins in
backend/fixtures/resource_plugins/.
OpenAPI not re-dumped (coordinator does it after Batch 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
2.4 KiB
JSON
57 lines
2.4 KiB
JSON
{
|
|
"schema": 1,
|
|
"id": "github",
|
|
"name": "GitHub",
|
|
"version": "1.0.0",
|
|
"description": "Pull request pills on the conversations about them: links, gh pr view, Claude Code's own PR link.",
|
|
"icon": "git-pull-request",
|
|
"settings": {
|
|
"subtitle": "Which conversations show pull request pills",
|
|
"fields": [
|
|
{ "key": "githubRepo", "label": "Default repository", "type": "text",
|
|
"help": "owner/repo — the repo a bare #13722 or `gh pr view 13722` belongs to" },
|
|
{ "key": "workers", "label": "Runners", "type": "list",
|
|
"help": "runner ids (local = the lab); empty = every runner" },
|
|
{ "key": "cwdGlobs", "label": "Folders", "type": "list",
|
|
"help": "cwd globs (~/work/acme*); empty = anywhere" },
|
|
{ "key": "notifPills", "label": "Pills on notifications", "type": "checkbox", "default": false }
|
|
]
|
|
},
|
|
"resources": [
|
|
{
|
|
"id": "pr",
|
|
"label": "Pull request",
|
|
"urlRegex": "^https://github\\.com/(?P<repo>[\\w.-]+/[\\w.-]+)/pulls?/(?P<num>\\d{1,7})",
|
|
"idRegex": "^(?:(?P<repo>[\\w.-]+/[\\w.-]+))?#(?P<num>\\d{1,7})$",
|
|
"idTemplate": ["{repo|config.githubRepo}#{num}", "#{num}"],
|
|
"urlTemplate": "https://github.com/{repo|config.githubRepo}/pull/{num}",
|
|
"labelTemplate": "#{num}",
|
|
"titleToken": "#{num}",
|
|
"needles": ["#{num}", "pull/{num}", "pr {num}", "pr #{num}"],
|
|
"ignoreUrlRegex": "^https://github\\.com/(?![\\w.-]+/[\\w.-]+/(?:pulls?|issues)/\\d)",
|
|
"toolExtractors": [
|
|
{
|
|
"tool": "shell",
|
|
"commandRegex": "\\bgh\\s+pr\\s+(?:view|checks|diff|checkout|merge|review|comment|edit|ready)\\s+(?:(?P<url>https://github\\.com/\\S+)|#?(?P<num>\\d{1,7}))(?:[^\\n;&|]*?(?:--repo|-R)[\\s=]+(?P<repo>[\\w.-]+/[\\w.-]+))?",
|
|
"tagOnCall": true
|
|
},
|
|
{
|
|
"tool": "shell",
|
|
"commandRegex": "\\bgh\\s+pr\\s+view\\s+(?:(?P<url>https://github\\.com/\\S+)|#?(?P<num>\\d{1,7}))(?:[^\\n;&|]*?(?:--repo|-R)[\\s=]+(?P<repo>[\\w.-]+/[\\w.-]+))?",
|
|
"urlFields": ["url"],
|
|
"titleFields": ["title"],
|
|
"stateFields": ["state"],
|
|
"stateFlags": { "isDraft": "draft" },
|
|
"xrefFields": ["headRefName", "body"]
|
|
}
|
|
],
|
|
"icon": "git-pull-request",
|
|
"color": "sky",
|
|
"stateTones": { "open": "emerald", "draft": "zinc", "merged": "violet", "closed": "rose" },
|
|
"clickAction": "open",
|
|
"priority": 20,
|
|
"hueRole": "shade"
|
|
}
|
|
]
|
|
}
|