Relocate 30 non-essential .md files (investigation notes, fix summaries, implementation details, status reports) from the project root into docs/ to reduce clutter. Core operational docs (README, quickstart guides, configuration references) remain in the root. Co-authored-by: Cursor <cursoragent@cursor.com>
4.7 KiB
4.7 KiB
Manual Upload Capture Instructions
Since the Playwright browser may have restrictions, here's how to capture the upload protocol using your normal browser's Developer Tools.
Method 1: Chrome/Chromium DevTools (Recommended)
Step 1: Open DevTools
- Open Chrome/Chromium
- Navigate to https://app.kosmi.io/room/@hyperspaceout
- Press
F12orCmd+Option+I(Mac) to open DevTools - Click the Network tab
Step 2: Filter and Prepare
- In the Network tab, check the Preserve log checkbox (important!)
- Click the filter icon and select:
- Fetch/XHR (for API calls)
- WS (for WebSocket messages)
- Clear the log (trash icon) to start fresh
Step 3: Upload Image
- In the Kosmi chat, click the attachment/upload button
- Select
blurt.jpg(or any small image) - Wait for the upload to complete
- Watch the Network tab for new entries
Step 4: Find Upload Request
Look for requests that might be the upload:
- URL contains:
upload,media,file,attachment,image,cdn,s3 - Method:
POSTorPUT - Type:
fetch,xhr, orother
Step 5: Capture Details
For HTTP Upload:
- Click on the upload request
- Go to the Headers tab:
- Copy the Request URL
- Copy Request Method
- Copy Request Headers (especially
Authorization,Content-Type)
- Go to the Payload tab:
- Note the format (Form Data, Request Payload, etc.)
- Copy the structure
- Go to the Response tab:
- Copy the entire response (usually JSON with image URL)
For WebSocket Message:
- Click on the WS filter
- Click on the WebSocket connection (usually
wss://engine.kosmi.io/gql-ws) - Click the Messages tab
- Look for messages sent around the time of upload
- Look for GraphQL mutations like
uploadFile,uploadImage,sendMedia - Copy the entire message (both request and response)
Step 6: Save Information
Create a file upload-capture.txt with this information:
=== UPLOAD CAPTURE ===
Method: [HTTP or WebSocket]
--- If HTTP ---
URL: [full URL]
Method: [POST/PUT]
Headers:
Authorization: [value]
Content-Type: [value]
[other headers]
Request Body Format: [multipart/form-data, JSON, binary, etc.]
Request Body:
[paste the payload structure]
Response:
[paste the full response]
--- If WebSocket ---
Message Sent:
[paste the GraphQL mutation or message]
Message Received:
[paste the response]
--- Additional Notes ---
[any other observations]
Method 2: Firefox DevTools
Same process as Chrome, but:
- Press
F12orCmd+Option+I - Click Network tab
- Right-click on the upload request → Copy → Copy All As HAR
- Save to
upload-capture.harand share that file
Method 3: Use the Monitor (Fixed)
The monitor has been updated with:
- ✅ Better permissions handling
- ✅ Proper Ctrl+C cleanup
- ✅ Fallback message if upload doesn't work
Try running it again:
./monitor-ws
If upload still doesn't work in the Playwright browser, that's okay - just use Method 1 or 2 above.
What We Need
At minimum, we need to know:
-
Upload Method:
- HTTP POST/PUT to an endpoint
- GraphQL mutation via WebSocket
- Something else
-
Endpoint/Mutation:
- URL or mutation name
-
Authentication:
- How is the JWT token passed? (Header? Payload?)
-
Request Format:
- Multipart form-data?
- Base64 encoded in JSON?
- Binary?
-
Response Format:
- JSON with
{ url: "..." }? - Something else?
- JSON with
Example: What Good Capture Looks Like
Example HTTP Upload:
URL: https://cdn.kosmi.io/upload
Method: POST
Headers:
Authorization: Bearer eyJhbGc...
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary...
Body:
------WebKitFormBoundary...
Content-Disposition: form-data; name="file"; filename="blurt.jpg"
Content-Type: image/jpeg
[binary data]
------WebKitFormBoundary...--
Response:
{
"url": "https://cdn.kosmi.io/files/abc123.jpg",
"id": "abc123"
}
Example WebSocket Upload:
Sent:
{
"id": "upload-123",
"type": "subscribe",
"payload": {
"query": "mutation UploadFile($file: Upload!) { uploadFile(file: $file) { url } }",
"variables": {
"file": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}
}
}
Received:
{
"id": "upload-123",
"type": "next",
"payload": {
"data": {
"uploadFile": {
"url": "https://cdn.kosmi.io/files/abc123.jpg"
}
}
}
}
After Capture
Once you have the information, either:
- Paste it in a message to me
- Save to
upload-capture.txtand share - Share the HAR file if using Firefox
I'll then:
- Analyze the protocol
- Document it in
KOSMI_IMAGE_UPLOAD.md - Implement the Go client
- Complete the integration