Developer

Stages API

Read project stages and tasks from your custom resource.

Stages API

The Stages API provides read-only access to project stages and their tasks. Use it to list stages in a project or get a specific stage with its full task tree.

Capability required: stages:read

Frontend (iframe)

import { createResourceClient } from "@rightplace/sdk";

const rp = createResourceClient();
await rp.ready();

// List stages in a project
const stages = await rp.stages.list("project-id-123");
// -> [{ id: "abc", title: "Sprint 1", slug: "sprint-1", totalTasks: 12, doneTasks: 5, ... }]

// Get a specific stage with tasks
const stage = await rp.stages.get("project-id-123", "stage-id-abc");
// -> { id: "abc", title: "Sprint 1", tasks: [{ id: "t1", title: "Fix bug", status: "done", ... }] }

Backend (Node.js)

import { createResourceServer } from "@rightplace/sdk/server";

const server = createResourceServer({
  methods: {
    getProjectProgress: async (_params, { rp }) => {
      const stages = await rp.stages.list("project-id");
      return stages.map(s => ({
        title: s.title,
        progress: s.totalTasks > 0 ? s.doneTasks / s.totalTasks : 0,
      }));
    },
  },
});

server.start();

API Reference

rp.stages.list(projectId)

Returns all stages in a project.

ParameterTypeDescription
projectIdstringThe project ID
ReturnsPromise<StageSummary[]>List of stage summaries

rp.stages.get(projectId, stageId)

Returns a specific stage with its full task tree.

ParameterTypeDescription
projectIdstringThe project ID
stageIdstringThe stage ID
ReturnsPromise<StageDetail | null>The stage with tasks, or null

StageSummary

FieldTypeDescription
idstringStage ID
titlestringStage title
slugstringURL-safe slug
projectIdstringOwning project ID
totalTasksnumberTotal task count
doneTasksnumberCompleted task count
createdAtnumberUnix timestamp (seconds)
updatedAtnumberUnix timestamp (seconds)

StageDetail

FieldTypeDescription
idstringStage ID
titlestringStage title
descriptionstring | nullOptional description
slugstringURL-safe slug
versionnumberData version
createdAtnumberUnix timestamp (seconds)
updatedAtnumberUnix timestamp (seconds)
tasksStageTask[]Task tree

StageTask

FieldTypeDescription
idstringTask ID
titlestringTask title
contentstring | nullTask body/description
statusstringStatus (e.g. “todo”, “doing”, “done”)
labelsstring[]Assigned label IDs
createdAtnumberUnix timestamp (seconds)
updatedAtnumberUnix timestamp (seconds)
childrenStageTask[]Nested sub-tasks

Manifest Configuration

{
  "capabilities": [
    "stages:read"
  ]
}

Notes

  • This API is read-only. Resources cannot create, update, or delete stages or tasks.
  • Stages are stored as JSON files in the project’s rightplace/stages/ directory.
  • The task tree can be nested (tasks with children).