OpenACP/.gitignore
0xmrpeter c16f4170a2 feat(api): add file attachment support to prompt endpoint
Extends POST /sessions/:id/prompt (REST + SSE) to accept an optional
`attachments` array of base64-encoded files. Attachments are decoded
server-side and persisted via FileService, which handles naming,
storage under ~/.openacp/files/{sessionId}/, and PathGuard whitelisting
so agents can read uploaded files without manual path configuration.

Fixes from code review:
- Restore sourceAdapterId/responseAdapterId routing args in enqueuePrompt
  (both REST and SSE routes were dropping them from the original PR)
- Extract shared resolveAttachments() utility to eliminate duplication
  between api-server and sse-adapter routes
- Return 503 with FILE_SERVICE_UNAVAILABLE when file-service plugin is
  not loaded, instead of an unhandled internal error
- Clean up already-written files on partial save failure to avoid orphans
- Validate fileName against safe-char regex at schema level so raw value
  forwarded to agent cannot contain path traversal characters
- Validate mimeType against type/subtype regex to prevent malformed MIME
  values from reaching agent processing
- Raise per-route bodyLimit to 115 MB to make the 10-attachment cap
  reachable (Fastify default 1 MB would reject payloads before schema
  validation otherwise)
- Add .DS_Store to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:43:13 +07:00

23 lines
303 B
Plaintext

.DS_Store
# References (external/third-party code)
references/
node_modules/
dist/
*.tsbuildinfo
.env
dist-publish/
dist-publish-sdk/
packages/*/dist/
.worktrees/
ui/node_modules/
ui/dist/
test/
built-in-plugins/
plugin-registry/
.worktrees/
.log
# OpenACP local workspace (contains secrets)
.openacp