assistant-ui 0.0.125 → 0.0.126

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/index.js CHANGED
File without changes
@@ -13,7 +13,7 @@ const parseCloudCliResponse = (value) => {
13
13
  if (actions !== void 0 && !(Array.isArray(actions) && actions.every((action) => !!action && typeof action === "object" && typeof action.type === "string"))) return null;
14
14
  return body;
15
15
  };
16
- const cliVersion = "0.0.125";
16
+ const cliVersion = "0.0.126";
17
17
  const sendCloudCommand = async (cloudUrl, args, accessToken) => {
18
18
  const url = `${validateCloudUrl(cloudUrl)}${CLOUD_CLI_RUN_PATH}`;
19
19
  let response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistant-ui",
3
- "version": "0.0.125",
3
+ "version": "0.0.126",
4
4
  "description": "CLI for assistant-ui",
5
5
  "keywords": [
6
6
  "cli",
@@ -39,20 +39,20 @@
39
39
  "glob": "^13.0.6",
40
40
  "jscodeshift": "^17.4.0",
41
41
  "jsonc-parser": "^3.3.1",
42
- "react": "^19.3.0",
42
+ "react": "^19.3.1",
43
43
  "semver": "^7.8.5",
44
- "statewire": "^0.19.4"
44
+ "statewire": "^0.20.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@assistant-ui/x-buildutils": "0.0.30",
47
+ "@assistant-ui/x-buildutils": "0.0.31",
48
48
  "@types/cli-progress": "^3.11.6",
49
49
  "@types/cross-spawn": "^6.0.6",
50
50
  "@types/debug": "^4.1.13",
51
51
  "@types/jscodeshift": "^17.3.0",
52
- "@types/node": "^26.6.4",
52
+ "@types/node": "^26.6.5",
53
53
  "@types/semver": "^7.8.0",
54
- "@vitest/coverage-v8": "^5.0.3",
55
- "vitest": "^5.0.3"
54
+ "@vitest/coverage-v8": "^5.0.5",
55
+ "vitest": "^5.0.5"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public",
@@ -0,0 +1,59 @@
1
+ "use client";
2
+
3
+ import { useAui, useAuiState } from "@assistant-ui/react";
4
+ import { useAttachmentSrc } from "@/hooks/use-attachment-src";
5
+
6
+ export function useAttachmentState() {
7
+ const aui = useAui();
8
+ const isComposer = aui.attachment.source !== "message";
9
+ const src = useAttachmentSrc();
10
+
11
+ const isImage = useAuiState((s) => s.attachment.type === "image");
12
+ const name = useAuiState((s) => s.attachment.name);
13
+ const typeLabel = useAuiState((s) => {
14
+ const type = s.attachment.type;
15
+ switch (type) {
16
+ case "image":
17
+ return "Image";
18
+ case "document":
19
+ return "Document";
20
+ case "file":
21
+ return "File";
22
+ default:
23
+ return type;
24
+ }
25
+ });
26
+
27
+ // An attachment on a submission is still being prepared, whether or not the
28
+ // adapter reports progress while it uploads.
29
+ const uploadState = useAuiState((s) =>
30
+ s.attachment.status.type === "incomplete" &&
31
+ s.attachment.status.reason === "error"
32
+ ? "error"
33
+ : s.attachment.status.type === "running" ||
34
+ (s.optional.message?.submission !== undefined &&
35
+ s.attachment.status.type !== "complete")
36
+ ? "uploading"
37
+ : undefined,
38
+ );
39
+ const isUploading = uploadState === "uploading";
40
+ const isError = uploadState === "error";
41
+
42
+ const errorMessage = useAuiState((s) =>
43
+ s.attachment.status.type === "incomplete" &&
44
+ s.attachment.status.reason === "error"
45
+ ? (s.attachment.status.message ?? "Upload failed")
46
+ : undefined,
47
+ );
48
+
49
+ return {
50
+ isComposer,
51
+ src,
52
+ isImage,
53
+ name,
54
+ typeLabel,
55
+ isUploading,
56
+ isError,
57
+ errorMessage,
58
+ };
59
+ }
@@ -17,8 +17,6 @@ import {
17
17
  AttachmentPrimitive,
18
18
  ComposerPrimitive,
19
19
  MessagePrimitive,
20
- useAuiState,
21
- useAui,
22
20
  } from "@assistant-ui/react";
23
21
  import {
24
22
  Tooltip,
@@ -34,7 +32,7 @@ import {
34
32
  } from "@/components/ui/dialog";
35
33
  import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
36
34
  import { TooltipIconButton } from "@/components/assistant-ui/elements/tooltip-icon-button";
37
- import { useAttachmentSrc } from "@/hooks/use-attachment-src";
35
+ import { useAttachmentState } from "./attachment-state";
38
36
  import { cn } from "@/lib/utils";
39
37
 
40
38
  type AttachmentPreviewProps = {
@@ -112,47 +110,16 @@ const AttachmentThumb: FC<{ src: string | undefined }> = ({ src }) => {
112
110
  };
113
111
 
114
112
  const AttachmentUI: FC = () => {
115
- const aui = useAui();
116
- const isComposer = aui.attachment.source !== "message";
117
- const src = useAttachmentSrc();
118
-
119
- const isImage = useAuiState((s) => s.attachment.type === "image");
120
- const name = useAuiState((s) => s.attachment.name);
121
- const typeLabel = useAuiState((s) => {
122
- const type = s.attachment.type;
123
- switch (type) {
124
- case "image":
125
- return "Image";
126
- case "document":
127
- return "Document";
128
- case "file":
129
- return "File";
130
- default:
131
- return type;
132
- }
133
- });
134
-
135
- // An attachment on a submission is still being prepared, whether or not the
136
- // adapter reports progress while it uploads.
137
- const uploadState = useAuiState((s) =>
138
- s.attachment.status.type === "incomplete" &&
139
- s.attachment.status.reason === "error"
140
- ? "error"
141
- : s.attachment.status.type === "running" ||
142
- (s.optional.message?.submission !== undefined &&
143
- s.attachment.status.type !== "complete")
144
- ? "uploading"
145
- : undefined,
146
- );
147
- const isUploading = uploadState === "uploading";
148
- const isError = uploadState === "error";
149
-
150
- const errorMessage = useAuiState((s) =>
151
- s.attachment.status.type === "incomplete" &&
152
- s.attachment.status.reason === "error"
153
- ? (s.attachment.status.message ?? "Upload failed")
154
- : undefined,
155
- );
113
+ const {
114
+ isComposer,
115
+ src,
116
+ isImage,
117
+ name,
118
+ typeLabel,
119
+ isUploading,
120
+ isError,
121
+ errorMessage,
122
+ } = useAttachmentState();
156
123
 
157
124
  return (
158
125
  <TooltipProvider>
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "@ai-sdk/openai": "^4.0.86",
16
+ "@ai-sdk/openai": "^4.0.96",
17
17
  "@assistant-ui/ai-sdk": "workspace:*",
18
18
  "@assistant-ui/core": "workspace:*",
19
19
  "@assistant-ui/react": "workspace:*",
@@ -21,16 +21,16 @@
21
21
  "@assistant-ui/react-markdown": "workspace:*",
22
22
  "@assistant-ui/store": "workspace:*",
23
23
  "@assistant-ui/tap": "workspace:*",
24
- "@base-ui/react": "^1.8.0",
25
- "ai": "^7.0.130",
24
+ "@base-ui/react": "^1.9.0",
25
+ "ai": "^7.0.143",
26
26
  "assistant-cloud": "workspace:*",
27
27
  "class-variance-authority": "^0.7.1",
28
- "cn": "^0.4.0",
28
+ "cn": "^0.5.0",
29
29
  "harness-sdk": "file:vendor/harness-sdk-0.3.1.tgz",
30
- "lucide-react": "^1.52.0",
31
- "next": "^16.4.1",
32
- "react": "^19.3.0",
33
- "react-dom": "^19.3.0",
30
+ "lucide-react": "^1.59.0",
31
+ "next": "^16.4.2",
32
+ "react": "^19.3.1",
33
+ "react-dom": "^19.3.1",
34
34
  "remark-gfm": "^4.0.1",
35
35
  "statewire": "file:vendor/statewire-0.19.3.tgz",
36
36
  "tw-animate-css": "^1.4.0",
@@ -40,11 +40,11 @@
40
40
  "devDependencies": {
41
41
  "@assistant-ui/next": "workspace:*",
42
42
  "@tailwindcss/postcss": "^4.3.3",
43
- "@types/node": "^26.6.4",
43
+ "@types/node": "^26.6.5",
44
44
  "@types/react": "^19.3.0",
45
45
  "@types/react-dom": "^19.3.0",
46
- "oxfmt": "^0.72.0",
47
- "oxlint": "^1.87.0",
46
+ "oxfmt": "^0.73.0",
47
+ "oxlint": "^1.88.0",
48
48
  "tailwindcss": "^4.3.3",
49
49
  "typescript": "^7.0.2"
50
50
  }
@@ -1,42 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
- /.pnp
6
- .pnp.*
7
- .yarn/*
8
- !.yarn/patches
9
- !.yarn/plugins
10
- !.yarn/releases
11
- !.yarn/versions
12
-
13
- # testing
14
- /coverage
15
-
16
- # next.js
17
- /.next/
18
- /out/
19
-
20
- # production
21
- /build
22
-
23
- # misc
24
- .DS_Store
25
- *.pem
26
-
27
- # debug
28
- npm-debug.log*
29
- yarn-debug.log*
30
- yarn-error.log*
31
- .pnpm-debug.log*
32
-
33
- # env files (can opt-in for committing if needed)
34
- .env*
35
- !.env.example
36
-
37
- # vercel
38
- .vercel
39
-
40
- # typescript
41
- *.tsbuildinfo
42
- next-env.d.ts