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.
Files changed (54) hide show
  1. package/README.md +119 -25
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts +4 -0
  3. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  4. package/dist/agents/implementations/CodeGenSubAgent.js +108 -22
  5. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
  6. package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -1
  7. package/dist/agents/implementations/DesignPipelineAgent.js +21 -16
  8. package/dist/agents/implementations/DesignPipelineAgent.js.map +1 -1
  9. package/dist/cli.js +11 -1
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/generate-components.d.ts +5 -0
  12. package/dist/commands/generate-components.d.ts.map +1 -1
  13. package/dist/commands/generate-components.js +138 -12
  14. package/dist/commands/generate-components.js.map +1 -1
  15. package/dist/commands/generate.d.ts +4 -0
  16. package/dist/commands/generate.d.ts.map +1 -1
  17. package/dist/commands/generate.js +74 -56
  18. package/dist/commands/generate.js.map +1 -1
  19. package/dist/commands/init.d.ts +9 -0
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +237 -61
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/config/intent-dictionary.json +47 -4
  24. package/dist/config/model-versions.json +26 -0
  25. package/dist/package.json +6 -2
  26. package/dist/templates/instantdb/db.template.ts +14 -0
  27. package/dist/templates/instantdb/home-client.template.tsx +127 -0
  28. package/dist/templates/instantdb/page.template.tsx +5 -0
  29. package/dist/templates/instantdb/perms.template.ts +9 -0
  30. package/dist/templates/instantdb/schema.template.ts +28 -0
  31. package/dist/templates/playbooks/instantdb-integration.md +851 -0
  32. package/dist/templates/playbooks/mpesa-integration.md +652 -0
  33. package/dist/templates/pm-integration-config.json +20 -0
  34. package/dist/templates/ui-spec-examples.md +318 -0
  35. package/dist/templates/ui-spec-templates.json +244 -0
  36. package/dist/types/intent-dictionary.d.ts +61 -0
  37. package/dist/types/intent-dictionary.d.ts.map +1 -1
  38. package/dist/utils/envExampleGenerator.d.ts.map +1 -1
  39. package/dist/utils/envExampleGenerator.js +36 -27
  40. package/dist/utils/envExampleGenerator.js.map +1 -1
  41. package/dist/utils/hostedApiClient.d.ts +10 -3
  42. package/dist/utils/hostedApiClient.d.ts.map +1 -1
  43. package/dist/utils/hostedApiClient.js +144 -209
  44. package/dist/utils/hostedApiClient.js.map +1 -1
  45. package/dist/utils/hybridAIClient.d.ts.map +1 -1
  46. package/dist/utils/hybridAIClient.js +8 -26
  47. package/dist/utils/hybridAIClient.js.map +1 -1
  48. package/dist/utils/openRouterClient.d.ts.map +1 -1
  49. package/dist/utils/openRouterClient.js +4 -14
  50. package/dist/utils/openRouterClient.js.map +1 -1
  51. package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -1
  52. package/dist/utils/unifiedDesignContextLoader.js +25 -12
  53. package/dist/utils/unifiedDesignContextLoader.js.map +1 -1
  54. 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,5 @@
1
+ import HomeClient from "./home-client";
2
+
3
+ export default function Home() {
4
+ return <HomeClient />;
5
+ }
@@ -0,0 +1,9 @@
1
+ export default {
2
+ todos: {
3
+ allow: {
4
+ create: "auth.id != null",
5
+ update: "auth.id != null",
6
+ delete: "auth.id != null",
7
+ },
8
+ },
9
+ };
@@ -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;