mycontext-cli 2.0.29 → 2.0.31
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/README.md +119 -25
- package/dist/agents/implementations/CodeGenSubAgent.d.ts +4 -0
- package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
- package/dist/agents/implementations/CodeGenSubAgent.js +108 -22
- package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
- package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -1
- package/dist/agents/implementations/DesignPipelineAgent.js +21 -16
- package/dist/agents/implementations/DesignPipelineAgent.js.map +1 -1
- package/dist/cli.js +11 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/generate-components.d.ts +5 -0
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +138 -12
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/commands/generate.d.ts +4 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +74 -56
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +237 -61
- package/dist/commands/init.js.map +1 -1
- package/dist/config/intent-dictionary.json +47 -4
- package/dist/config/model-versions.json +26 -0
- package/dist/package.json +6 -2
- package/dist/templates/instantdb/db.template.ts +14 -0
- package/dist/templates/instantdb/home-client.template.tsx +127 -0
- package/dist/templates/instantdb/page.template.tsx +5 -0
- package/dist/templates/instantdb/perms.template.ts +9 -0
- package/dist/templates/instantdb/schema.template.ts +28 -0
- package/dist/templates/playbooks/instantdb-integration.md +851 -0
- package/dist/templates/playbooks/mpesa-integration.md +652 -0
- package/dist/templates/pm-integration-config.json +20 -0
- package/dist/templates/ui-spec-examples.md +318 -0
- package/dist/templates/ui-spec-templates.json +244 -0
- package/dist/types/intent-dictionary.d.ts +61 -0
- package/dist/types/intent-dictionary.d.ts.map +1 -1
- package/dist/utils/envExampleGenerator.d.ts.map +1 -1
- package/dist/utils/envExampleGenerator.js +36 -27
- package/dist/utils/envExampleGenerator.js.map +1 -1
- package/dist/utils/hostedApiClient.d.ts +10 -3
- package/dist/utils/hostedApiClient.d.ts.map +1 -1
- package/dist/utils/hostedApiClient.js +144 -209
- package/dist/utils/hostedApiClient.js.map +1 -1
- package/dist/utils/hybridAIClient.d.ts.map +1 -1
- package/dist/utils/hybridAIClient.js +8 -26
- package/dist/utils/hybridAIClient.js.map +1 -1
- package/dist/utils/openRouterClient.d.ts.map +1 -1
- package/dist/utils/openRouterClient.js +4 -14
- package/dist/utils/openRouterClient.js.map +1 -1
- package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -1
- package/dist/utils/unifiedDesignContextLoader.js +25 -12
- package/dist/utils/unifiedDesignContextLoader.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { id } from "@instantdb/react";
|
|
4
|
+
import db from "@/lib/db";
|
|
5
|
+
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { Input } from "@/components/ui/input";
|
|
7
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
8
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
|
|
11
|
+
export default function HomeClient() {
|
|
12
|
+
const [newTodo, setNewTodo] = useState("");
|
|
13
|
+
const { isLoading, error, data } = db.useQuery({ todos: {} });
|
|
14
|
+
|
|
15
|
+
const addTodo = () => {
|
|
16
|
+
if (!newTodo.trim()) return;
|
|
17
|
+
|
|
18
|
+
db.transact(
|
|
19
|
+
db.tx.todos[id()].update({
|
|
20
|
+
text: newTodo,
|
|
21
|
+
done: false,
|
|
22
|
+
createdAt: Date.now(),
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
setNewTodo("");
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const toggleTodo = (todo: any) => {
|
|
29
|
+
db.transact(db.tx.todos[todo.id].update({ done: !todo.done }));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const deleteTodo = (todo: any) => {
|
|
33
|
+
db.transact(db.tx.todos[todo.id].delete());
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
if (isLoading) {
|
|
37
|
+
return (
|
|
38
|
+
<div className="max-w-2xl mx-auto p-8">
|
|
39
|
+
<div className="text-center">Loading...</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (error) {
|
|
45
|
+
return (
|
|
46
|
+
<div className="max-w-2xl mx-auto p-8">
|
|
47
|
+
<Card className="border-red-500">
|
|
48
|
+
<CardHeader>
|
|
49
|
+
<CardTitle className="text-red-500">Error</CardTitle>
|
|
50
|
+
</CardHeader>
|
|
51
|
+
<CardContent>
|
|
52
|
+
<p className="text-sm text-muted-foreground">{error.message}</p>
|
|
53
|
+
<p className="text-xs text-muted-foreground mt-4">
|
|
54
|
+
Make sure NEXT_PUBLIC_INSTANT_APP_ID is set in your .env file
|
|
55
|
+
</p>
|
|
56
|
+
</CardContent>
|
|
57
|
+
</Card>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const { todos } = data;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className="max-w-2xl mx-auto p-8">
|
|
66
|
+
<Card>
|
|
67
|
+
<CardHeader>
|
|
68
|
+
<CardTitle className="text-4xl font-bold">My Todos</CardTitle>
|
|
69
|
+
<p className="text-sm text-muted-foreground">
|
|
70
|
+
Real-time todos powered by InstantDB
|
|
71
|
+
</p>
|
|
72
|
+
</CardHeader>
|
|
73
|
+
<CardContent className="space-y-4">
|
|
74
|
+
<div className="flex gap-2">
|
|
75
|
+
<Input
|
|
76
|
+
value={newTodo}
|
|
77
|
+
onChange={(e) => setNewTodo(e.target.value)}
|
|
78
|
+
placeholder="What needs to be done?"
|
|
79
|
+
onKeyPress={(e) => e.key === "Enter" && addTodo()}
|
|
80
|
+
className="flex-1"
|
|
81
|
+
/>
|
|
82
|
+
<Button onClick={addTodo}>Add</Button>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div className="space-y-2">
|
|
86
|
+
{todos.length === 0 ? (
|
|
87
|
+
<div className="text-center py-8 text-muted-foreground">
|
|
88
|
+
No todos yet. Add one above!
|
|
89
|
+
</div>
|
|
90
|
+
) : (
|
|
91
|
+
todos.map((todo: any) => (
|
|
92
|
+
<Card key={todo.id} className="p-4">
|
|
93
|
+
<div className="flex items-center gap-4">
|
|
94
|
+
<Checkbox
|
|
95
|
+
checked={todo.done}
|
|
96
|
+
onCheckedChange={() => toggleTodo(todo)}
|
|
97
|
+
/>
|
|
98
|
+
<span
|
|
99
|
+
className={`flex-1 ${
|
|
100
|
+
todo.done ? "line-through text-muted-foreground" : ""
|
|
101
|
+
}`}
|
|
102
|
+
>
|
|
103
|
+
{todo.text}
|
|
104
|
+
</span>
|
|
105
|
+
<Button
|
|
106
|
+
variant="destructive"
|
|
107
|
+
size="sm"
|
|
108
|
+
onClick={() => deleteTodo(todo)}
|
|
109
|
+
>
|
|
110
|
+
Delete
|
|
111
|
+
</Button>
|
|
112
|
+
</div>
|
|
113
|
+
</Card>
|
|
114
|
+
))
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div className="text-xs text-muted-foreground pt-4 border-t">
|
|
119
|
+
<p>
|
|
120
|
+
✨ Try opening this in multiple tabs - changes sync in real-time!
|
|
121
|
+
</p>
|
|
122
|
+
</div>
|
|
123
|
+
</CardContent>
|
|
124
|
+
</Card>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { i } from "@instantdb/react";
|
|
2
|
+
|
|
3
|
+
const _schema = i.schema({
|
|
4
|
+
entities: {
|
|
5
|
+
$files: i.entity({
|
|
6
|
+
path: i.string().unique().indexed(),
|
|
7
|
+
url: i.string(),
|
|
8
|
+
}),
|
|
9
|
+
$users: i.entity({
|
|
10
|
+
email: i.string().unique().indexed().optional(),
|
|
11
|
+
type: i.string().optional(),
|
|
12
|
+
}),
|
|
13
|
+
todos: i.entity({
|
|
14
|
+
text: i.string(),
|
|
15
|
+
done: i.boolean(),
|
|
16
|
+
createdAt: i.number(),
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
links: {},
|
|
20
|
+
rooms: {},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
type _AppSchema = typeof _schema;
|
|
24
|
+
interface AppSchema extends _AppSchema {}
|
|
25
|
+
const schema: AppSchema = _schema;
|
|
26
|
+
|
|
27
|
+
export type { AppSchema };
|
|
28
|
+
export default schema;
|