chore(deps): upgrade claude-code-acp to v0.8.4 and optimize image upload implementation
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
||||
import type { AgentStatus, AgentUpdate, AgentNotification } from "@server/server/acp/types";
|
||||
import { parseSessionUpdate } from "@/types/agent-activity";
|
||||
import { ScrollView } from "react-native";
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
|
||||
export type MessageEntry =
|
||||
| {
|
||||
@@ -638,18 +639,16 @@ export function SessionProvider({ children, serverUrl }: SessionProviderProps) {
|
||||
imagesData = [];
|
||||
for (const imageUri of imageUris) {
|
||||
try {
|
||||
const response = await fetch(imageUri);
|
||||
const blob = await response.blob();
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
const bytes = new Uint8Array(arrayBuffer);
|
||||
let binary = '';
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
const base64 = btoa(binary);
|
||||
// Use FileSystem.File to read the image as base64
|
||||
const file = new FileSystem.File(imageUri);
|
||||
const base64 = file.base64Sync();
|
||||
|
||||
// Get MIME type from the file
|
||||
const mimeType = file.type || 'image/jpeg';
|
||||
|
||||
imagesData.push({
|
||||
data: base64,
|
||||
mimeType: blob.type || 'image/jpeg',
|
||||
mimeType,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[Session] Failed to convert image:', error);
|
||||
|
||||
@@ -202,5 +202,17 @@
|
||||
"createdAt": "2025-10-26T07:57:16.797Z",
|
||||
"lastActivityAt": "2025-10-26T07:57:29.704Z",
|
||||
"cwd": "/var/folders/xl/kkk9drfd3ms_t8x7rmy4z6900000gn/T/acp-test-GAWCrz"
|
||||
},
|
||||
{
|
||||
"id": "5bce2465-b921-4af5-9e7c-1e59d566dbe0",
|
||||
"title": "Agent 5bce2465",
|
||||
"sessionId": "23b203ae-d3fb-40ba-8ad0-ddd049d7166f",
|
||||
"options": {
|
||||
"type": "claude",
|
||||
"sessionId": "23b203ae-d3fb-40ba-8ad0-ddd049d7166f"
|
||||
},
|
||||
"createdAt": "2025-10-26T07:59:07.111Z",
|
||||
"lastActivityAt": "2025-10-26T07:59:17.913Z",
|
||||
"cwd": "/Users/moboudra/dev/voice-dev"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user