@ayni.org/ayni-ui-core 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/profileClient.d.ts +5 -0
- package/dist/profileClient.js +6 -0
- package/package.json +1 -1
package/dist/profileClient.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export declare class ProfileClient {
|
|
|
52
52
|
run(sessionId: string, token: string, input: RunInput, onEvent: (event: AgUiEvent) => void, signal: AbortSignal): Promise<void>;
|
|
53
53
|
cancel(sessionId: string, token: string, runId: string): Promise<boolean>;
|
|
54
54
|
history(sessionId: string, token: string, before?: string, limit?: number): Promise<HistoryPage>;
|
|
55
|
+
/**
|
|
56
|
+
* Uploads a file before the turn that references it (UI-MEDIA-003). Its name goes in a field of its own, before
|
|
57
|
+
* the file (PROF-HIST-008): platforms do not write the name of a multipart file alike, and the agent takes the
|
|
58
|
+
* field as the name when it is there.
|
|
59
|
+
*/
|
|
55
60
|
upload(sessionId: string, token: string, file: Blob, filename: string): Promise<UploadResponse>;
|
|
56
61
|
/** Attachments are fetched with the token and shown as revocable object URLs (UI-MEDIA-001). */
|
|
57
62
|
attachment(sessionId: string, token: string, attachmentId: string): Promise<Blob>;
|
package/dist/profileClient.js
CHANGED
|
@@ -178,8 +178,14 @@ export class ProfileClient {
|
|
|
178
178
|
throw await parseError(response);
|
|
179
179
|
return response.json();
|
|
180
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Uploads a file before the turn that references it (UI-MEDIA-003). Its name goes in a field of its own, before
|
|
183
|
+
* the file (PROF-HIST-008): platforms do not write the name of a multipart file alike, and the agent takes the
|
|
184
|
+
* field as the name when it is there.
|
|
185
|
+
*/
|
|
181
186
|
async upload(sessionId, token, file, filename) {
|
|
182
187
|
const form = new FormData();
|
|
188
|
+
form.append('filename', filename);
|
|
183
189
|
form.append('file', file, filename);
|
|
184
190
|
const response = await this.fetchFn(this.url(`/${sessionId}/attachments`), {
|
|
185
191
|
method: 'POST',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ayni.org/ayni-ui-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Framework-independent core of the Ayni UI (UI-SHELL-004): agents and controllers, trust resolution, sessions and binding, the conversation reducer, the local store and sync; shared by the browser UI and the Ayni app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|