Skip to content

Feature: add workspace.inspect() and the workspace_summary tool #226

Description

@AmolDerickSoans

I've built two additions to @cloudflare/computer on my fork. Pull requests are restricted to collaborators, so I'm posting them here first for a maintainer to review.

workspace.inspect() (branch: https://github.com/AmolDerickSoans/computer/tree/feat/workspace-inspect) returns a read-only snapshot of a workspace: storage counters, the current revision, sync cursors per backend, backend connection status, mounted roots, and tracked executions. It reads the local durable object store and in-memory state only, so it never dials a backend and is cheap enough to call from a health check or a logging loop.

workspace_summary (branch: https://github.com/AmolDerickSoans/computer/tree/feat/workspace-summary-tool, stacked on the first) is a new tool for all three tool sets. One call returns a directory's entry count, file and directory counts, total bytes, and every entry with its size and kind. Its description is built from the workspace, so it names the registered execution backends or says that none is registered. The tool is read-only, so it ships in read-only sets too.

Both branches include unit tests, documentation, and changesets. The test suite, typecheck, and npm run check pass:

npm run build --workspace @cloudflare/dofs --workspace @cloudflare/computer-rpc --workspace @cloudflare/computer
npm test --workspace @cloudflare/computer
npm run check

I have the implementation and unit tests ready on my fork branches. Since PR submissions are restricted to collaborators, could a maintainer review the branches or temporarily grant access to open the pull requests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions