Skip to content

computer: Add workspace file tools - #81

Open
aron-cf wants to merge 4 commits into
stack/improve-tools-02-computer-fs-plumbingfrom
stack/improve-tools-03-file-tools
Open

computer: Add workspace file tools#81
aron-cf wants to merge 4 commits into
stack/improve-tools-02-computer-fs-plumbingfrom
stack/improve-tools-03-file-tools

Conversation

@aron-cf

@aron-cf aron-cf commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Stack 3 of 7. Base: stack/improve-tools-02-computer-fs-plumbing. Head: stack/improve-tools-03-file-tools.

The Computer tool set lacked recursive path search, text search, and deletion. Writes could also race an edit between its read and write phases, losing one caller's update.

This change adds find, grep, and delete to createAITools. Search remains available in read-only mode, while deletion follows the existing read-only policy for mutations. edit, write, and delete now share a store-scoped lock keyed by normalized path. Search responses are bounded and return offsets that remain valid for result sets of any size.

Verification

npm run typecheck --workspace @cloudflare/computer
npm test --workspace @cloudflare/computer -- src/tools/ai.test.ts

The next stack part improves read output and adds model-facing image and PDF content.

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

馃 Changeset detected

Latest commit: 8166cb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/computer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Thanks for your interest in Cloudflare Computer.

This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:

If a maintainer asked you to open this pull request, they can add the allow-pr label and reopen it.

@github-actions github-actions Bot closed this Aug 7, 2026
@aron-cf aron-cf added the allow-pr Allow a PR to remain open. label Aug 7, 2026
@aron-cf aron-cf reopened this Aug 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@cloudflare/computer@81

commit: 8166cb0

@aron-cf
aron-cf marked this pull request as ready for review August 7, 2026 15:21
aron-cf added 4 commits August 7, 2026 15:24
Share a store-scoped, normalized-path lock between edit and write so
read-modify-write cycles cannot clobber concurrent writes or block
unrelated workspaces.
Expose the missing workspace tools, keep find and grep available in
read-only mode, bound their result pages, and serialize delete with
other mutations.
Allow any non-negative grep offset so continuation values emitted after
large result sets remain valid inputs to the next tool call.
Record the new search and deletion tools and shared mutation locking
with the Computer package that exposes them.
@aron-cf
aron-cf force-pushed the stack/improve-tools-03-file-tools branch from 88b9b07 to 8166cb0 Compare August 7, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-pr Allow a PR to remain open.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant