create-supyagent-app 0.1.12 → 0.1.14

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.
Files changed (38) hide show
  1. package/dist/index.js +37 -0
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/base/src/app/globals.css +0 -1
  5. package/templates/base/src/components/ai-elements/tool.tsx +166 -0
  6. package/templates/base/src/components/chat-message.tsx +2 -2
  7. package/templates/base/src/components/supyagent/tool-message.tsx +98 -0
  8. package/templates/base/src/components/supyagent/tool-renderers.tsx +69 -0
  9. package/templates/base/src/components/supyagent/tools/brevo.tsx +140 -0
  10. package/templates/base/src/components/supyagent/tools/calendar.tsx +158 -0
  11. package/templates/base/src/components/supyagent/tools/calendly.tsx +161 -0
  12. package/templates/base/src/components/supyagent/tools/compute.tsx +113 -0
  13. package/templates/base/src/components/supyagent/tools/discord.tsx +174 -0
  14. package/templates/base/src/components/supyagent/tools/docs.tsx +94 -0
  15. package/templates/base/src/components/supyagent/tools/drive.tsx +124 -0
  16. package/templates/base/src/components/supyagent/tools/generic.tsx +19 -0
  17. package/templates/base/src/components/supyagent/tools/github.tsx +142 -0
  18. package/templates/base/src/components/supyagent/tools/gmail.tsx +161 -0
  19. package/templates/base/src/components/supyagent/tools/hubspot.tsx +206 -0
  20. package/templates/base/src/components/supyagent/tools/inbox.tsx +158 -0
  21. package/templates/base/src/components/supyagent/tools/jira.tsx +164 -0
  22. package/templates/base/src/components/supyagent/tools/linear.tsx +196 -0
  23. package/templates/base/src/components/supyagent/tools/linkedin.tsx +151 -0
  24. package/templates/base/src/components/supyagent/tools/notion.tsx +223 -0
  25. package/templates/base/src/components/supyagent/tools/pipedrive.tsx +154 -0
  26. package/templates/base/src/components/supyagent/tools/resend.tsx +92 -0
  27. package/templates/base/src/components/supyagent/tools/salesforce.tsx +163 -0
  28. package/templates/base/src/components/supyagent/tools/search.tsx +141 -0
  29. package/templates/base/src/components/supyagent/tools/sheets.tsx +109 -0
  30. package/templates/base/src/components/supyagent/tools/slack.tsx +135 -0
  31. package/templates/base/src/components/supyagent/tools/slides.tsx +64 -0
  32. package/templates/base/src/components/supyagent/tools/stripe.tsx +235 -0
  33. package/templates/base/src/components/supyagent/tools/telegram.tsx +116 -0
  34. package/templates/base/src/components/supyagent/tools/twilio.tsx +118 -0
  35. package/templates/base/src/components/supyagent/tools/twitter.tsx +139 -0
  36. package/templates/base/src/components/ui/badge.tsx +35 -0
  37. package/templates/base/src/components/ui/collapsible.tsx +11 -0
  38. package/templates/package-json/package.json.tmpl +3 -1
@@ -0,0 +1,139 @@
1
+ import React from "react";
2
+ import { MessageCircle, Heart, Repeat2, Clock } from "lucide-react";
3
+
4
+ interface TweetData {
5
+ id?: string;
6
+ text?: string;
7
+ author_username?: string;
8
+ username?: string;
9
+ author?: { username?: string; name?: string };
10
+ created_at?: string;
11
+ public_metrics?: {
12
+ like_count?: number;
13
+ retweet_count?: number;
14
+ reply_count?: number;
15
+ };
16
+ like_count?: number;
17
+ retweet_count?: number;
18
+ }
19
+
20
+ interface TwitterRendererProps {
21
+ data: unknown;
22
+ }
23
+
24
+ function isTweetData(data: unknown): data is TweetData {
25
+ return typeof data === "object" && data !== null && "text" in data;
26
+ }
27
+
28
+ function formatRelativeDate(dateStr: string): string {
29
+ try {
30
+ const date = new Date(dateStr);
31
+ const now = new Date();
32
+ const diffMs = now.getTime() - date.getTime();
33
+ const diffMins = Math.floor(diffMs / 60000);
34
+ const diffHours = Math.floor(diffMs / 3600000);
35
+ const diffDays = Math.floor(diffMs / 86400000);
36
+ if (diffMins < 1) return "Just now";
37
+ if (diffMins < 60) return `${diffMins}m ago`;
38
+ if (diffHours < 24) return `${diffHours}h ago`;
39
+ if (diffDays < 7) return `${diffDays}d ago`;
40
+ return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
41
+ } catch {
42
+ return dateStr;
43
+ }
44
+ }
45
+
46
+ function TweetCard({ tweet }: { tweet: TweetData }) {
47
+ const username = tweet.author_username || tweet.username || tweet.author?.username;
48
+ const likes = tweet.public_metrics?.like_count ?? tweet.like_count;
49
+ const retweets = tweet.public_metrics?.retweet_count ?? tweet.retweet_count;
50
+ const replies = tweet.public_metrics?.reply_count;
51
+
52
+ return (
53
+ <div className="rounded-lg border border-border bg-card p-3 space-y-1.5">
54
+ <div className="flex items-center gap-2">
55
+ <MessageCircle className="h-4 w-4 text-muted-foreground shrink-0" />
56
+ {username && (
57
+ <span className="text-xs font-medium text-foreground">@{username}</span>
58
+ )}
59
+ {tweet.author?.name && (
60
+ <span className="text-xs text-muted-foreground">{tweet.author.name}</span>
61
+ )}
62
+ {tweet.created_at && (
63
+ <span className="flex items-center gap-1 text-xs text-muted-foreground ml-auto">
64
+ <Clock className="h-3 w-3" />
65
+ {formatRelativeDate(tweet.created_at)}
66
+ </span>
67
+ )}
68
+ </div>
69
+ {tweet.text && (
70
+ <p className="text-sm text-foreground line-clamp-4">{tweet.text}</p>
71
+ )}
72
+ {(likes !== undefined || retweets !== undefined || replies !== undefined) && (
73
+ <div className="flex items-center gap-4 pt-0.5">
74
+ {likes !== undefined && (
75
+ <span className="flex items-center gap-1 text-xs text-muted-foreground">
76
+ <Heart className="h-3 w-3" />
77
+ {likes}
78
+ </span>
79
+ )}
80
+ {retweets !== undefined && (
81
+ <span className="flex items-center gap-1 text-xs text-muted-foreground">
82
+ <Repeat2 className="h-3 w-3" />
83
+ {retweets}
84
+ </span>
85
+ )}
86
+ {replies !== undefined && (
87
+ <span className="flex items-center gap-1 text-xs text-muted-foreground">
88
+ <MessageCircle className="h-3 w-3" />
89
+ {replies}
90
+ </span>
91
+ )}
92
+ </div>
93
+ )}
94
+ </div>
95
+ );
96
+ }
97
+
98
+ export function TwitterRenderer({ data }: TwitterRendererProps) {
99
+ // {tweets: [...]}
100
+ if (typeof data === "object" && data !== null && "tweets" in data) {
101
+ const tweets = (data as any).tweets;
102
+ if (Array.isArray(tweets)) {
103
+ return (
104
+ <div className="space-y-2">
105
+ {tweets.filter(isTweetData).map((t, i) => <TweetCard key={t.id || i} tweet={t} />)}
106
+ </div>
107
+ );
108
+ }
109
+ }
110
+
111
+ // {data: [...]} (Twitter API v2 shape)
112
+ if (typeof data === "object" && data !== null && "data" in data && Array.isArray((data as any).data)) {
113
+ const tweets = (data as any).data;
114
+ return (
115
+ <div className="space-y-2">
116
+ {tweets.filter(isTweetData).map((t: TweetData, i: number) => <TweetCard key={t.id || i} tweet={t} />)}
117
+ </div>
118
+ );
119
+ }
120
+
121
+ if (isTweetData(data)) return <TweetCard tweet={data} />;
122
+
123
+ if (Array.isArray(data)) {
124
+ const tweets = data.filter(isTweetData);
125
+ if (tweets.length > 0) {
126
+ return (
127
+ <div className="space-y-2">
128
+ {tweets.map((t, i) => <TweetCard key={t.id || i} tweet={t} />)}
129
+ </div>
130
+ );
131
+ }
132
+ }
133
+
134
+ return (
135
+ <pre className="rounded-lg border border-border bg-background p-3 text-xs text-foreground overflow-x-auto max-h-96 overflow-y-auto">
136
+ {JSON.stringify(data, null, 2)}
137
+ </pre>
138
+ );
139
+ }
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { cn } from "@/lib/utils";
4
+
5
+ const badgeVariants = cva(
6
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default:
11
+ "border-transparent bg-primary text-primary-foreground",
12
+ secondary:
13
+ "border-transparent bg-secondary text-secondary-foreground",
14
+ destructive:
15
+ "border-transparent bg-destructive text-destructive-foreground",
16
+ outline: "text-foreground",
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ variant: "default",
21
+ },
22
+ }
23
+ );
24
+
25
+ export interface BadgeProps
26
+ extends React.HTMLAttributes<HTMLDivElement>,
27
+ VariantProps<typeof badgeVariants> {}
28
+
29
+ function Badge({ className, variant, ...props }: BadgeProps) {
30
+ return (
31
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
32
+ );
33
+ }
34
+
35
+ export { Badge, badgeVariants };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
4
+
5
+ const Collapsible = CollapsiblePrimitive.Root;
6
+
7
+ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
8
+
9
+ const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
10
+
11
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -16,7 +16,9 @@
16
16
  "@ai-sdk/react": "^3.0.0",
17
17
  "{{aiProviderPackage}}": "{{aiProviderVersion}}",
18
18
  "@prisma/client": "^6.2.0",
19
- "@supyagent/sdk": "^0.1.9",
19
+ "@radix-ui/react-collapsible": "^1.1.0",
20
+ "@supyagent/sdk": "^0.1.12",
21
+ "class-variance-authority": "^0.7.0",
20
22
  "ai": "^6.0.0",
21
23
  "clsx": "^2.1.0",
22
24
  "lucide-react": "^0.468.0",