@base44-preview/cli 0.0.26-pr.181.4b31178 → 0.0.26-pr.182.b2d0aa4

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.
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "task_manager",
3
+ "description": "An AI agent that helps you manage and change your tasks",
4
+ "instructions": "You are a helpful task management assistant. You can help users create, update, mark as completed, and delete tasks using the entity tool. When a user asks to change a task, help them modify it by updating the appropriate fields. Always be conversational and helpful.",
5
+ "tool_configs": [
6
+ {
7
+ "entity_name": "Task",
8
+ "allowed_operations": ["read", "create", "update", "delete"]
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "Task",
3
+ "type": "object",
4
+ "properties": {
5
+ "title": {
6
+ "type": "string",
7
+ "description": "Task title"
8
+ },
9
+ "completed": {
10
+ "type": "boolean",
11
+ "default": false,
12
+ "description": "Whether the task is completed"
13
+ }
14
+ },
15
+ "required": ["title"]
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": false,
5
+ "tsx": false,
6
+ "tailwind": {
7
+ "config": "tailwind.config.js",
8
+ "css": "src/index.css",
9
+ "baseColor": "slate",
10
+ "cssVariables": true
11
+ },
12
+ "aliases": {
13
+ "components": "@/components",
14
+ "ui": "@/components/ui"
15
+ }
16
+ }
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@base44/sdk": "^0.8.3",
13
+ "lucide-react": "^0.475.0",
13
14
  "react": "^18.2.0",
14
15
  "react-dom": "^18.2.0"
15
16
  },
@@ -1,9 +1,147 @@
1
+ import { useState, useEffect } from "react";
2
+ import { base44 } from "@/api/base44Client";
3
+ import { Button } from "@/components/ui/button";
4
+ import { Checkbox } from "@/components/ui/checkbox";
5
+ import { Input } from "@/components/ui/input";
6
+ import { Base44Logo } from "@/components/Base44Logo";
7
+ import { Plus, Trash2, CheckCircle2 } from "lucide-react";
8
+
9
+ const Task = base44.entities.Task;
10
+
1
11
  export default function App() {
12
+ const [tasks, setTasks] = useState([]);
13
+ const [newTaskTitle, setNewTaskTitle] = useState("");
14
+ const [isLoading, setIsLoading] = useState(true);
15
+
16
+ const fetchTasks = async () => {
17
+ const data = await Task.list();
18
+ setTasks(data);
19
+ setIsLoading(false);
20
+ };
21
+
22
+ useEffect(() => {
23
+ fetchTasks();
24
+ }, []);
25
+
26
+ const handleSubmit = async (e) => {
27
+ e.preventDefault();
28
+ if (!newTaskTitle.trim()) return;
29
+ await Task.create({ title: newTaskTitle.trim(), completed: false });
30
+ setNewTaskTitle("");
31
+ fetchTasks();
32
+ };
33
+
34
+ const toggleTask = async (id, completed) => {
35
+ await Task.update(id, { completed });
36
+ fetchTasks();
37
+ };
38
+
39
+ const deleteTask = async (id) => {
40
+ await Task.delete(id);
41
+ fetchTasks();
42
+ };
43
+
44
+ const clearCompleted = async () => {
45
+ await Promise.all(
46
+ tasks.filter((t) => t.completed).map((t) => Task.delete(t.id))
47
+ );
48
+ fetchTasks();
49
+ };
50
+
51
+ const completedCount = tasks.filter((t) => t.completed).length;
52
+ const totalCount = tasks.length;
53
+
2
54
  return (
3
- <div className="min-h-screen bg-gradient-to-br from-slate-50 via-white to-orange-50/30 flex items-center justify-center">
4
- <div className="text-center">
5
- <h1 className="text-4xl font-bold text-slate-900 mb-4">Hello World</h1>
6
- <p className="text-slate-500">Welcome to your Base44 app</p>
55
+ <div className="min-h-screen bg-gradient-to-br from-slate-50 via-white to-orange-50/30">
56
+ <div className="max-w-lg mx-auto px-6 py-16">
57
+ {/* Header */}
58
+ <div className="text-center mb-12">
59
+ <h1 className="text-3xl font-semibold text-slate-900 tracking-tight">
60
+ <span className="inline-flex items-center gap-2 align-middle">
61
+ <Base44Logo className="w-9 h-9" />
62
+ <span className="font-bold">Base44</span>
63
+ <span>Tasks</span>
64
+ </span>
65
+ </h1>
66
+ {totalCount > 0 && (
67
+ <p className="text-slate-500 mt-2 text-sm">
68
+ {completedCount} of {totalCount} completed
69
+ </p>
70
+ )}
71
+ </div>
72
+
73
+ {/* Add Task Form */}
74
+ <form onSubmit={handleSubmit} className="mb-8">
75
+ <div className="flex gap-3">
76
+ <Input
77
+ type="text"
78
+ value={newTaskTitle}
79
+ onChange={(e) => setNewTaskTitle(e.target.value)}
80
+ placeholder="What needs to be done?"
81
+ className="flex-1 h-12 bg-white border-slate-200 rounded-xl shadow-sm"
82
+ />
83
+ <Button
84
+ type="submit"
85
+ disabled={!newTaskTitle.trim()}
86
+ className="h-12 px-5 rounded-xl bg-slate-900 hover:bg-slate-800 shadow-sm"
87
+ >
88
+ <Plus className="w-5 h-5" />
89
+ </Button>
90
+ </div>
91
+ </form>
92
+
93
+ {/* Task List */}
94
+ <div className="space-y-2">
95
+ {isLoading ? (
96
+ <div className="flex items-center justify-center py-12">
97
+ <div className="w-6 h-6 border-2 border-slate-200 border-t-orange-500 rounded-full animate-spin" />
98
+ </div>
99
+ ) : tasks.length === 0 ? (
100
+ <div className="text-center py-12">
101
+ <p className="text-slate-400">No tasks yet. Add one above!</p>
102
+ </div>
103
+ ) : (
104
+ tasks.map((task) => (
105
+ <div
106
+ key={task.id}
107
+ className="group flex items-center gap-4 p-4 bg-white rounded-xl border border-slate-100 shadow-sm hover:shadow-md transition-all duration-200"
108
+ >
109
+ <Checkbox
110
+ checked={task.completed}
111
+ onCheckedChange={(checked) => toggleTask(task.id, checked)}
112
+ className="w-5 h-5 rounded-md border-slate-300 data-[state=checked]:bg-orange-500 data-[state=checked]:border-orange-500"
113
+ />
114
+ <span
115
+ className={`flex-1 text-slate-700 transition-all ${
116
+ task.completed ? "line-through text-slate-400" : ""
117
+ }`}
118
+ >
119
+ {task.title}
120
+ </span>
121
+ <Button
122
+ variant="ghost"
123
+ size="icon"
124
+ onClick={() => deleteTask(task.id)}
125
+ className="opacity-0 group-hover:opacity-100 h-8 w-8 text-slate-400 hover:text-red-500 hover:bg-red-50 transition-all"
126
+ >
127
+ <Trash2 className="w-4 h-4" />
128
+ </Button>
129
+ </div>
130
+ ))
131
+ )}
132
+ </div>
133
+
134
+ {/* Footer */}
135
+ {completedCount > 0 && (
136
+ <div className="mt-8 text-center">
137
+ <button
138
+ onClick={clearCompleted}
139
+ className="text-sm text-slate-400 hover:text-slate-600 transition-colors"
140
+ >
141
+ Clear completed
142
+ </button>
143
+ </div>
144
+ )}
7
145
  </div>
8
146
  </div>
9
147
  );
@@ -0,0 +1,15 @@
1
+ export function Base44Logo({ className = "w-8 h-8" }) {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ fill="none"
6
+ viewBox="0 0 31 31"
7
+ className={className}
8
+ >
9
+ <path
10
+ fill="#FF631F"
11
+ d="M24.16 26.904c.04 0 .057.05.026.075a14.97 14.97 0 0 1-9.147 3.1c-3.44 0-6.612-1.156-9.146-3.1-.032-.024-.014-.075.026-.075zm3.923-4.373a15 15 0 0 1-1.842 2.544.14.14 0 0 1-.104.046H3.942a.14.14 0 0 1-.104-.046 15 15 0 0 1-1.842-2.544.056.056 0 0 1 .049-.083h25.99c.043 0 .07.046.048.083m1.698-4.5a15 15 0 0 1-.762 2.564.11.11 0 0 1-.103.07H1.163a.11.11 0 0 1-.104-.07 15 15 0 0 1-.762-2.564.056.056 0 0 1 .055-.067h29.375c.035 0 .061.032.054.067M14.938 0C23.29-.056 30.078 6.7 30.078 15.04q0 .55-.038 1.09a.056.056 0 0 1-.056.051H.094a.056.056 0 0 1-.055-.052A15 15 0 0 1 0 15.054C-.007 6.87 6.755.055 14.938 0"
12
+ ></path>
13
+ </svg>
14
+ );
15
+ }
@@ -0,0 +1,23 @@
1
+ import { forwardRef } from 'react';
2
+
3
+ const Button = forwardRef(({ className = '', variant, size, ...props }, ref) => {
4
+ const baseStyles = 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50';
5
+
6
+ const variantStyles = variant === 'ghost'
7
+ ? 'hover:bg-slate-100'
8
+ : 'bg-slate-900 text-white shadow hover:bg-slate-800';
9
+
10
+ const sizeStyles = size === 'icon' ? 'h-9 w-9' : 'h-9 px-4 py-2';
11
+
12
+ return (
13
+ <button
14
+ ref={ref}
15
+ className={`${baseStyles} ${variantStyles} ${sizeStyles} ${className}`}
16
+ {...props}
17
+ />
18
+ );
19
+ });
20
+
21
+ Button.displayName = 'Button';
22
+
23
+ export { Button };
@@ -0,0 +1,20 @@
1
+ import { forwardRef } from 'react';
2
+ import { Check } from 'lucide-react';
3
+
4
+ const Checkbox = forwardRef(({ className = '', checked, onCheckedChange, ...props }, ref) => (
5
+ <button
6
+ ref={ref}
7
+ type="button"
8
+ role="checkbox"
9
+ aria-checked={checked}
10
+ onClick={() => onCheckedChange?.(!checked)}
11
+ className={`h-4 w-4 shrink-0 rounded-sm border border-slate-300 shadow-sm flex items-center justify-center focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-slate-400 disabled:cursor-not-allowed disabled:opacity-50 ${checked ? 'bg-slate-900 text-white border-slate-900' : 'bg-white'} ${className}`}
12
+ {...props}
13
+ >
14
+ {checked && <Check className="h-3 w-3" />}
15
+ </button>
16
+ ));
17
+
18
+ Checkbox.displayName = 'Checkbox';
19
+
20
+ export { Checkbox };
@@ -0,0 +1,13 @@
1
+ import { forwardRef } from 'react';
2
+
3
+ const Input = forwardRef(({ className = '', ...props }, ref) => (
4
+ <input
5
+ ref={ref}
6
+ className={`flex h-9 w-full rounded-md border border-slate-200 bg-white px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-slate-400 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-slate-400 disabled:cursor-not-allowed disabled:opacity-50 ${className}`}
7
+ {...props}
8
+ />
9
+ ));
10
+
11
+ Input.displayName = 'Input';
12
+
13
+ export { Input };
@@ -2,12 +2,36 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 222.2 84% 4.9%;
9
+ --card: 0 0% 100%;
10
+ --card-foreground: 222.2 84% 4.9%;
11
+ --popover: 0 0% 100%;
12
+ --popover-foreground: 222.2 84% 4.9%;
13
+ --primary: 222.2 47.4% 11.2%;
14
+ --primary-foreground: 210 40% 98%;
15
+ --secondary: 210 40% 96.1%;
16
+ --secondary-foreground: 222.2 47.4% 11.2%;
17
+ --muted: 210 40% 96.1%;
18
+ --muted-foreground: 215.4 16.3% 46.9%;
19
+ --accent: 210 40% 96.1%;
20
+ --accent-foreground: 222.2 47.4% 11.2%;
21
+ --destructive: 0 84.2% 60.2%;
22
+ --destructive-foreground: 210 40% 98%;
23
+ --border: 214.3 31.8% 91.4%;
24
+ --input: 214.3 31.8% 91.4%;
25
+ --ring: 222.2 84% 4.9%;
26
+ --radius: 0.5rem;
27
+ }
28
+ }
29
+
5
30
  @layer base {
6
31
  * {
7
32
  @apply border-border;
8
33
  }
9
-
10
34
  body {
11
35
  @apply bg-background text-foreground antialiased;
12
36
  }
13
- }
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.26-pr.181.4b31178",
3
+ "version": "0.0.26-pr.182.b2d0aa4",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {