feat(features,service): read a repository's tree and skills by workspace and repository

Merged
DA
3d ago
+566-78

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/tree and GET /api/github/repositories/skills are new routes in github-repositories-app.ts. Each takes the workspaceId and repository queries 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.ts and plan-skills.ts now hold the repository-level reads (readRepositoryTree, readWorkspaceSkills), and the plan reads call them. The folder-query parser (treeRequestOf) moved from plans-app.ts into plan-tree.ts so both routes share it. Rewrites were regenerated (api-rewrites.json, vercel.json).
  • Features: repositoryTreePath, repositorySkillsPath and HostedPlanClient.readRepositoryTree/readRepositorySkills. planningTreeParamsSchema and planningSkillsParamsSchema now 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 is invalid-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.sh green. (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 as type assertion outside the allowlisted files.
  • No Effect.runPromise/runSync/runFork outside the runtime edges.
  • No new raw async primitives.
  • No discarded Effect.
  • Test count: +3.
  • No hand-rolled file replaced.
  • packages/service/README.md names the two routes.
  • PRIVACY.md unchanged.
  • Deps unchanged.
  • Barrel/door rule unaffected.

Notes

  • Blockers or follow-up verification: None. C2 (one agent pane) stacks on this.

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Devin Review


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/tree and GET /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_TREE and PLANNING_SKILLS now 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.