Write a project file
dreamagent_write_fileWRITE ACTION — overwrite or create one source file in a DreamAgent project with the exact content given. For CHANGING an existing file, prefer dreamagent_edit_file (small targeted find→replace edits — no need to send the whole file). By default the write is immediately committed and pushed to the project's GitHub repo and recorded in its session history & version history (so the user can restore/revert). Changes go live after the project is rebuilt (dreamagent_build_publish).
CONFIRM BEFORE CALLING — in ONE message show the user: the target path and a summary of the change, then call only after they agree. Never write on the first mention.
MULTI-FILE EDITS: pass auto_commit=false on each write, then call dreamagent_commit_push once at the end — one commit and one history entry for the whole batch.
GUARDS (enforced server-side, the same as the in-app code editor): path stays inside the project, hidden/credential files (.env, .git, keys) are rejected, content is scanned for malware/shell signatures and blocked, 2MB size cap. Failed scans return the reason.
The user can undo damage by editing in the DreamAgent editor or restoring a previous version from version history — still, prefer precise minimal diffs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | ||
| content | Yes | ||
| file_path | Yes | ||
| project_id | Yes | ||
| auto_commit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |