@standardagents/vue 0.10.1-dev.616ec2e → 0.10.1-dev.cea2b66

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/LICENSE.txt ADDED
@@ -0,0 +1,48 @@
1
+ PROPRIETARY SOFTWARE LICENSE
2
+
3
+ Copyright (c) 2024-2025 FormKit Inc. All Rights Reserved.
4
+
5
+ UNLICENSED - DO NOT USE
6
+
7
+ This software and associated documentation files (the "Software") are the sole
8
+ and exclusive property of FormKit Inc. ("FormKit").
9
+
10
+ USE RESTRICTIONS
11
+
12
+ The Software is UNLICENSED and proprietary. NO PERMISSION is granted to use,
13
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
14
+ the Software, or to permit persons to whom the Software is furnished to do so,
15
+ under any circumstances, without prior written authorization from FormKit Inc.
16
+
17
+ UNAUTHORIZED USE PROHIBITED
18
+
19
+ Any use of this Software without a valid, written license agreement signed by
20
+ authorized officers of FormKit Inc. is strictly prohibited and constitutes
21
+ unauthorized use and infringement of FormKit's intellectual property rights.
22
+
23
+ LICENSING INQUIRIES
24
+
25
+ Organizations interested in licensing this Software should contact:
26
+ enterprise@formkit.com
27
+
28
+ A written license agreement must be executed before any use of this Software
29
+ is authorized.
30
+
31
+ NO WARRANTY
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36
+ FORMKIT INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
37
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
+
40
+ GOVERNING LAW
41
+
42
+ This license shall be governed by and construed in accordance with the laws
43
+ of the jurisdiction in which FormKit Inc. is incorporated, without regard to
44
+ its conflict of law provisions.
45
+
46
+ FormKit Inc.
47
+ https://formkit.com
48
+ enterprise@formkit.com
package/dist/index.cjs CHANGED
@@ -128,10 +128,45 @@ function useThreadSetup(threadId, options = {}) {
128
128
  }, { depth, includeSilent });
129
129
  connectionManager.connect();
130
130
  }
131
+ function buildOptimisticAttachments(attachmentPaths) {
132
+ if (!attachmentPaths || attachmentPaths.length === 0) return null;
133
+ const refs = attachmentPaths.map((path) => {
134
+ const file = pendingFiles.value.find((f) => f.path === path);
135
+ const ref2 = {
136
+ id: path,
137
+ type: "file",
138
+ path,
139
+ name: file?.name || path.split("/").pop() || "file",
140
+ mimeType: file?.mimeType || "application/octet-stream",
141
+ size: file?.size || 0
142
+ };
143
+ if (file?.isImage) {
144
+ if (file.width) ref2.width = file.width;
145
+ if (file.height) ref2.height = file.height;
146
+ if (file.localPreviewUrl) ref2.localPreviewUrl = file.localPreviewUrl;
147
+ }
148
+ return ref2;
149
+ });
150
+ return JSON.stringify(refs);
151
+ }
131
152
  async function sendMessage(payload) {
153
+ const optimisticId = `optimistic-${crypto.randomUUID()}`;
154
+ const optimisticMessage = {
155
+ id: optimisticId,
156
+ role: payload.role,
157
+ content: payload.content,
158
+ attachments: buildOptimisticAttachments(payload.attachments),
159
+ created_at: Date.now() * 1e3,
160
+ // microseconds
161
+ status: "pending"
162
+ };
163
+ messages.value = [...messages.value, optimisticMessage];
132
164
  try {
133
- return await client$1.sendMessage(threadId, payload);
165
+ const result = await client$1.sendMessage(threadId, payload);
166
+ messages.value = messages.value.filter((m) => m.id !== optimisticId);
167
+ return result;
134
168
  } catch (err) {
169
+ messages.value = messages.value.filter((m) => m.id !== optimisticId);
135
170
  error.value = err instanceof Error ? err : new Error(String(err));
136
171
  throw err;
137
172
  }
package/dist/index.js CHANGED
@@ -127,10 +127,45 @@ function useThreadSetup(threadId, options = {}) {
127
127
  }, { depth, includeSilent });
128
128
  connectionManager.connect();
129
129
  }
130
+ function buildOptimisticAttachments(attachmentPaths) {
131
+ if (!attachmentPaths || attachmentPaths.length === 0) return null;
132
+ const refs = attachmentPaths.map((path) => {
133
+ const file = pendingFiles.value.find((f) => f.path === path);
134
+ const ref2 = {
135
+ id: path,
136
+ type: "file",
137
+ path,
138
+ name: file?.name || path.split("/").pop() || "file",
139
+ mimeType: file?.mimeType || "application/octet-stream",
140
+ size: file?.size || 0
141
+ };
142
+ if (file?.isImage) {
143
+ if (file.width) ref2.width = file.width;
144
+ if (file.height) ref2.height = file.height;
145
+ if (file.localPreviewUrl) ref2.localPreviewUrl = file.localPreviewUrl;
146
+ }
147
+ return ref2;
148
+ });
149
+ return JSON.stringify(refs);
150
+ }
130
151
  async function sendMessage(payload) {
152
+ const optimisticId = `optimistic-${crypto.randomUUID()}`;
153
+ const optimisticMessage = {
154
+ id: optimisticId,
155
+ role: payload.role,
156
+ content: payload.content,
157
+ attachments: buildOptimisticAttachments(payload.attachments),
158
+ created_at: Date.now() * 1e3,
159
+ // microseconds
160
+ status: "pending"
161
+ };
162
+ messages.value = [...messages.value, optimisticMessage];
131
163
  try {
132
- return await client.sendMessage(threadId, payload);
164
+ const result = await client.sendMessage(threadId, payload);
165
+ messages.value = messages.value.filter((m) => m.id !== optimisticId);
166
+ return result;
133
167
  } catch (err) {
168
+ messages.value = messages.value.filter((m) => m.id !== optimisticId);
134
169
  error.value = err instanceof Error ? err : new Error(String(err));
135
170
  throw err;
136
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standardagents/vue",
3
- "version": "0.10.1-dev.616ec2e",
3
+ "version": "0.10.1-dev.cea2b66",
4
4
  "description": "Vue SDK for Standard Agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,15 +21,8 @@
21
21
  "files": [
22
22
  "dist"
23
23
  ],
24
- "scripts": {
25
- "build": "tsup",
26
- "dev": "tsup --watch",
27
- "test": "vitest run",
28
- "test:watch": "vitest",
29
- "typecheck": "tsc --noEmit"
30
- },
31
24
  "dependencies": {
32
- "@standardagents/client": "workspace:*"
25
+ "@standardagents/client": "0.10.1-dev.cea2b66"
33
26
  },
34
27
  "peerDependencies": {
35
28
  "vue": "^3.3.0"
@@ -51,5 +44,12 @@
51
44
  "ai",
52
45
  "standardagents"
53
46
  ],
54
- "license": "MIT"
55
- }
47
+ "license": "MIT",
48
+ "scripts": {
49
+ "build": "tsup",
50
+ "dev": "tsup --watch",
51
+ "test": "vitest run",
52
+ "test:watch": "vitest",
53
+ "typecheck": "tsc --noEmit"
54
+ }
55
+ }