OpenProgram Docs

Composer local paths

Drop or picker File Preload getPathForFile(file) Pending state, marker [attachment: … @json "/abs"]
  1. Drop or pickerFile
  2. PreloadgetPathForFile(file)
  3. Pending state, marker[attachment: … @json "/abs"]

The bridge wraps Electron's webUtils.getPathForFile and is the renderer's only source of a native path; it has no Node filesystem access. Each File is queried once, before any read.

By item

ItemResult
Document with bytesExisting upload and preview. The marker uses the original path; the backend may also keep a session copy.
ImageMultimodal payload plus one original-path marker. source_path is removed from attachment metadata before provider dispatch.
Folder or unreadable itemA valid path reference with no bytes, never "too large — not sent"
Clipboard blob, plain browser fileNo native path: existing upload and generated session path

Marker

@json
Original path as a JSON string, for the agent. Preserves brackets, quotes, backslashes and trailing spaces. Readers accept older unquoted markers.
@previewjson
Immutable session-copy path, for the UI. Older messages without it remain readable. The raw-file endpoint does not add the source's parent directory to its readable roots.
source_path
On each uploaded attachment. The backend keeps a frontend marker only when that attachment's exact source path is present, so same-name uploads stay distinct.

Project and additional folders

ControlBehaviour
Project chipThe draft's main working directory. Read-only after the first committed turn: cwd, permission baseline and session-repository placement are fixed.
Folder-plusAdditional working directories; editable during a session. Without a session it derives the main project from the draft's pending choice and never offers it.
ChoosingAn existing project updates only the draft. A new folder creates or resolves the project and selects the result.
Backend unavailableThe connected reply is authoritative; controls keep their prior state
Boundaries and rejected options

Out of scope: tile styling, directory traversal, recursive browser uploads, filesystem scanning, new IPC handlers, upload-size changes, Programs UI, dependencies.

Rejected: legacy File.path; Node integration in the renderer; path-only messages for readable files; inventing a relative path in a browser; enumerating a dropped directory.

Acceptance
  • Preload returns the exact path for the same File; capture handles an absent bridge, empty result and exception.
  • Document, image and unreadable-folder markers contain the full path; filenames with parentheses are display-safe.
  • Paths with ], quotes and trailing spaces round-trip through both parsers.
  • Path-less attachments keep their marker; same-name and mixed-source attachments stay distinct; persistence does not duplicate a pre-marked attachment.

Implementation status

Implemented. The preload boundary is exercised in a VM with the same File object, not by real-window dragging.

Last updated · 2026-11-25