anomalyco / anomalyco/opencode-drive

Script fs capability: add remove, mkdir, readFile, exists; frame-to-text helper

Open
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
32
Forks
3
Avg merge
12m
Merged PRs (30d)
17

Description

Drive 2.0.0 (464f9a3).

defineScript's fs exposes only writeFile. Removing a runtime-added plugin directory in plugin-registry.ts had to reach for node:fs/promises with a hand-built ${artifacts}/files/... path, which bypasses the project abstraction and will break if the files root ever moves.

Wish list, all relative to the project files root:

  • fs.remove(path, { recursive? })
  • fs.mkdir(path)
  • fs.readFile(path)
  • fs.exists(path)

A frame-to-text helper would also save every probe from re-deriving frame.lines.map(l => l.spans.map(s => s.text).join("")) when printing a screen on failure; ui.text() or a Frame.text(frame) export would do.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the defineScript filesystem capability and plugin-registry.ts, especially the current writeFile use and direct node:fs/promises path handling. Trace the frame structure behind frame.lines and its spans before choosing the requested text helper. Done means the four filesystem operations work relative to the project files root and callers can obtain frame text without re-deriving the mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.