Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ export const main = task({

### File Access

The entry point task (main) has access to the entire project directory. Sub-tasks have no filesystem access by default and must declare `allowed_files` to access specific paths.
Tasks can read and write files within directories specified in `allowed_files`. Any attempt to access files outside these directories is not possible.

> [!NOTE]
> Currently, `allowed_files` only supports directory paths, not individual files.
> Currently, `allowed_files` supports directory paths, not individual files.

#### Python

Expand All @@ -239,12 +239,12 @@ Python's standard file operations work normally. Use `open()`, `os`, `pathlib`,
```python
from capsule import task

@task(name="restricted_writer", allowed_files=["./output"]) # Sub-task with limited access
@task(name="restricted_writer", allowed_files=["./output"])
def restricted_writer() -> None:
with open("./output/result.txt", "w") as f:
f.write("result")

@task(name="main") # Has access to entire project
@task(name="main")
def main() -> str:
restricted_writer()
```
Expand Down
Loading