feat(features,service): read a repository's tree and skills by workspace and repository
Merged
DA
3d ago+566+566+012345678901234567890123456789-78-78-01234567890123456789
Summary
Chain C, step C1 (item 11's service half). Two reads are keyed by plan today: the file tree behind @ (PLANNING_TREE) and the skills behind / (PLANNING_SKILLS). An agent with no plan, such as one an automation's run starts, therefore can't mention a file or choose a skill. This PR adds a form of both reads keyed by workspace and repository. C2 uses it on the one-off agent page.
- Service:
GET /api/github/repositories/treeandGET /api/github/repositories/skillsare new routes ingithub-repositories-app.ts. Each takes theworkspaceIdandrepositoryqueries exactly once. Both answer only a member of the workspace and read through the same installation reach a plan's read uses. Each answers exactly what a plan's tree or skills read answers.plan-tree.tsandplan-skills.tsnow hold the repository-level reads (readRepositoryTree,readWorkspaceSkills), and the plan reads call them. The folder-query parser (treeRequestOf) moved fromplans-app.tsintoplan-tree.tsso both routes share it. Rewrites were regenerated (api-rewrites.json,vercel.json). - Features:
repositoryTreePath,repositorySkillsPathandHostedPlanClient.readRepositoryTree/readRepositorySkills.planningTreeParamsSchemaandplanningSkillsParamsSchemanow accept{ planId }or{ workspaceId, repository }. - Host: the gateway handlers and the operator branch on which key the read names.
Nothing in the desktop uses the new form yet; C2 does.
Evidence
pnpm check:affected: exit 0.packages/service/src/github/github-repositories-app.test.ts: +2 tests, both fail on main (no route). They cover:- A member reads a folder and the skills by workspace and repository, and gets the same answer shape as a plan's read.
- A repository the installation doesn't reach is refused as
not-reachable. - A workspace the account isn't in is
not-found, and a read with no repository isinvalid-request, both before GitHub is asked.
packages/host/src/compose-planning.test.ts: +1 test. A tree and skills read by workspace and repository reaches the client's place reads, and the plan form still reaches the plan reads.- CI is Linux only and couldn't verify the Mac. This change has no UI.
Invariants
-
./scripts/check.shgreen. (CI) - JSON Schema goldens unchanged.
- Every behavior change has, in this PR, the test that fails without it; no change-detector test added.
- Gateway envelope goldens unchanged.
- No new
astype assertion outside the allowlisted files. - No
Effect.runPromise/runSync/runForkoutside the runtime edges. - No new raw async primitives.
- No discarded Effect.
- Test count: +3.
- No hand-rolled file replaced.
-
packages/service/README.mdnames the two routes. -
PRIVACY.mdunchanged. - Deps unchanged.
- Barrel/door rule unaffected.
Notes
- Blockers or follow-up verification: None. C2 (one agent pane) stacks on this.
š¤ Generated with Claude Code
Summary by cubic
Adds repository tree and skills reads keyed by workspace and repository, so an agent with no plan (like one an automation starts) can mention a file or choose a skill.
- Adds
GET /api/github/repositories/treeandGET /api/github/repositories/skills, each answering exactly as a plan's tree or skills read does, to a workspace member, through the same installation reach. PLANNING_TREEandPLANNING_SKILLSnow accept either{ planId }or{ workspaceId, repository }; the host and desktop client route by key, and plan reads share the underlying repository-level logic.- Nothing in the desktop uses the new key yet; the one-off agent page does.