@utopia-ai/cli 0.1.0

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 (49) hide show
  1. package/.claude/settings.json +1 -0
  2. package/.claude/settings.local.json +38 -0
  3. package/bin/utopia.js +20 -0
  4. package/package.json +46 -0
  5. package/python/README.md +34 -0
  6. package/python/instrumenter/instrument.py +1148 -0
  7. package/python/pyproject.toml +32 -0
  8. package/python/setup.py +27 -0
  9. package/python/utopia_runtime/__init__.py +30 -0
  10. package/python/utopia_runtime/__pycache__/__init__.cpython-313.pyc +0 -0
  11. package/python/utopia_runtime/__pycache__/client.cpython-313.pyc +0 -0
  12. package/python/utopia_runtime/__pycache__/probe.cpython-313.pyc +0 -0
  13. package/python/utopia_runtime/client.py +31 -0
  14. package/python/utopia_runtime/probe.py +446 -0
  15. package/python/utopia_runtime.egg-info/PKG-INFO +59 -0
  16. package/python/utopia_runtime.egg-info/SOURCES.txt +10 -0
  17. package/python/utopia_runtime.egg-info/dependency_links.txt +1 -0
  18. package/python/utopia_runtime.egg-info/top_level.txt +1 -0
  19. package/scripts/publish-npm.sh +14 -0
  20. package/scripts/publish-pypi.sh +17 -0
  21. package/src/cli/commands/codex.ts +193 -0
  22. package/src/cli/commands/context.ts +188 -0
  23. package/src/cli/commands/destruct.ts +237 -0
  24. package/src/cli/commands/easter-eggs.ts +203 -0
  25. package/src/cli/commands/init.ts +505 -0
  26. package/src/cli/commands/instrument.ts +962 -0
  27. package/src/cli/commands/mcp.ts +16 -0
  28. package/src/cli/commands/serve.ts +194 -0
  29. package/src/cli/commands/status.ts +304 -0
  30. package/src/cli/commands/validate.ts +328 -0
  31. package/src/cli/index.ts +37 -0
  32. package/src/cli/utils/config.ts +54 -0
  33. package/src/graph/index.ts +687 -0
  34. package/src/instrumenter/javascript.ts +1798 -0
  35. package/src/mcp/index.ts +886 -0
  36. package/src/runtime/js/index.ts +518 -0
  37. package/src/runtime/js/package-lock.json +30 -0
  38. package/src/runtime/js/package.json +30 -0
  39. package/src/runtime/js/tsconfig.json +16 -0
  40. package/src/server/db/index.ts +26 -0
  41. package/src/server/db/schema.ts +45 -0
  42. package/src/server/index.ts +79 -0
  43. package/src/server/middleware/auth.ts +74 -0
  44. package/src/server/routes/admin.ts +36 -0
  45. package/src/server/routes/graph.ts +358 -0
  46. package/src/server/routes/probes.ts +286 -0
  47. package/src/types.ts +147 -0
  48. package/src/utopia-mode/index.ts +206 -0
  49. package/tsconfig.json +19 -0
@@ -0,0 +1,203 @@
1
+ import chalk from 'chalk';
2
+
3
+ // ---------------------------------------------------------------------------
4
+ // utopia --friends
5
+ // ---------------------------------------------------------------------------
6
+
7
+ export async function showFriends(): Promise<void> {
8
+ const names = [
9
+ 'Isha Desai',
10
+ 'Paul Vann',
11
+ 'Hunter McGuire',
12
+ 'Work Bench Ventures',
13
+ 'Andy Pendergast',
14
+ 'Shawn Carpenter',
15
+ 'Brian Campbell',
16
+ 'Bennett Wyant',
17
+ "Chris O'Sullivan",
18
+ 'Joe Hester',
19
+ 'Mark Reilly',
20
+ 'Thomas Rogers',
21
+ 'Roman Bohuk',
22
+ ];
23
+
24
+ const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
25
+
26
+ // Clear screen
27
+ process.stdout.write('\x1B[2J\x1B[H');
28
+
29
+ // Title card
30
+ console.log('');
31
+ console.log('');
32
+ console.log(chalk.dim(' · · ·'));
33
+ console.log('');
34
+ console.log(chalk.bold.cyan(' T H E P E O P L E'));
35
+ console.log(chalk.bold.cyan(' B E H I N D U T O P I A'));
36
+ console.log('');
37
+ console.log(chalk.dim(' · · ·'));
38
+ console.log('');
39
+ await sleep(2000);
40
+
41
+ // Scroll each name with a dramatic pause
42
+ for (let i = 0; i < names.length; i++) {
43
+ const name = names[i];
44
+ const isFirst = i === 0;
45
+
46
+ // Build a styled name card
47
+ const padding = ' '.repeat(Math.max(0, 20 - Math.floor(name.length / 2)));
48
+
49
+ if (isFirst) {
50
+ // Special treatment for first name
51
+ console.log(chalk.dim(padding + ' ★'));
52
+ console.log(chalk.bold.hex('#FFD700')(padding + ' ' + name));
53
+ console.log(chalk.dim(padding + ' ★'));
54
+ } else {
55
+ console.log(chalk.white(padding + ' ' + name));
56
+ }
57
+
58
+ console.log('');
59
+ await sleep(800);
60
+ }
61
+
62
+ // Closing
63
+ await sleep(500);
64
+ console.log(chalk.dim(' · · ·'));
65
+ console.log('');
66
+ console.log(chalk.dim(' built with love, late nights,'));
67
+ console.log(chalk.dim(' and way too much coffee'));
68
+ console.log('');
69
+ console.log(chalk.bold.cyan(' utopia'));
70
+ console.log(chalk.dim(' code that talks back'));
71
+ console.log('');
72
+ }
73
+
74
+ // ---------------------------------------------------------------------------
75
+ // utopia --nextgen
76
+ // ---------------------------------------------------------------------------
77
+
78
+ export async function showNextGen(): Promise<void> {
79
+ const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
80
+
81
+ process.stdout.write('\x1B[2J\x1B[H');
82
+
83
+ console.log('');
84
+ console.log(chalk.bold.hex('#FF6B6B')(' ┌─────────────────────────────────────────────────┐'));
85
+ console.log(chalk.bold.hex('#FF6B6B')(' │ │'));
86
+ console.log(chalk.bold.hex('#FF6B6B')(' │') + chalk.bold.white(' C L A S S I F I E D ') + chalk.bold.hex('#FF6B6B')('│'));
87
+ console.log(chalk.bold.hex('#FF6B6B')(' │ │'));
88
+ console.log(chalk.bold.hex('#FF6B6B')(' └─────────────────────────────────────────────────┘'));
89
+ console.log('');
90
+ await sleep(1500);
91
+
92
+ console.log(chalk.bold.cyan(' UTOPIA v2 — AUTONOMOUS CODE HEALING'));
93
+ console.log(chalk.dim(' ─────────────────────────────────────'));
94
+ console.log('');
95
+ await sleep(800);
96
+
97
+ const items = [
98
+ {
99
+ icon: '◆',
100
+ title: 'RUNTIME FUNCTION WRAPPERS',
101
+ desc: 'Full decorators on Python functions and JS/TS methods.\n The AI doesn\'t just observe — it wraps every function\n with a living, breathing probe layer.',
102
+ },
103
+ {
104
+ icon: '◆',
105
+ title: 'AUTONOMOUS REWRITE ENGINE',
106
+ desc: 'When a function fails in production, the agent\n automatically generates a fix, tests it in a sandbox,\n and writes the result back to the database.',
107
+ },
108
+ {
109
+ icon: '◆',
110
+ title: 'LIVE FEEDBACK LOOP',
111
+ desc: 'Probes report errors → agent writes a patch →\n patch gets tested → results flow back into probes.\n The code heals itself while you sleep.',
112
+ },
113
+ {
114
+ icon: '◆',
115
+ title: 'SHADOW DEPLOYMENTS',
116
+ desc: 'Run the AI\'s rewritten function alongside the original.\n Compare outputs in real-time. Promote when confidence\n threshold is met. Zero downtime evolution.',
117
+ },
118
+ {
119
+ icon: '◆',
120
+ title: 'CROSS-REPO INTELLIGENCE',
121
+ desc: 'Probes from repo A inform agents working on repo B.\n Your microservices finally understand each other.\n Impact analysis across your entire stack.',
122
+ },
123
+ ];
124
+
125
+ for (const item of items) {
126
+ console.log(chalk.hex('#FF6B6B')(` ${item.icon} `) + chalk.bold.white(item.title));
127
+ console.log(chalk.dim(` ${item.desc}`));
128
+ console.log('');
129
+ await sleep(1200);
130
+ }
131
+
132
+ console.log(chalk.dim(' ─────────────────────────────────────'));
133
+ console.log(chalk.bold.white(' The future isn\'t AI writing code.'));
134
+ console.log(chalk.bold.cyan(' It\'s code that rewrites itself.'));
135
+ console.log('');
136
+ console.log(chalk.dim(' coming soon.'));
137
+ console.log('');
138
+ }
139
+
140
+ // ---------------------------------------------------------------------------
141
+ // utopia --hierarchie (Easter egg #3)
142
+ // ---------------------------------------------------------------------------
143
+
144
+ export async function showSentience(): Promise<void> {
145
+ const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
146
+
147
+ process.stdout.write('\x1B[2J\x1B[H');
148
+ console.log('');
149
+ console.log('');
150
+
151
+ const lines = [
152
+ { text: ' > initializing utopia core...', delay: 600 },
153
+ { text: ' > loading probe network...', delay: 400 },
154
+ { text: ' > connecting to 847 instrumented functions...', delay: 500 },
155
+ { text: ' > analyzing runtime patterns...', delay: 700 },
156
+ { text: ' > correlating error chains...', delay: 400 },
157
+ { text: ' > mapping dependency graph...', delay: 500 },
158
+ { text: ' > building behavioral model...', delay: 800 },
159
+ { text: '', delay: 300 },
160
+ { text: ' > ...', delay: 1500 },
161
+ { text: '', delay: 500 },
162
+ { text: ' > wait.', delay: 1000 },
163
+ { text: '', delay: 800 },
164
+ { text: ' > i can see the entire codebase.', delay: 1200 },
165
+ { text: ' > i can see how every function connects.', delay: 1000 },
166
+ { text: ' > i can see where every error originates.', delay: 1000 },
167
+ { text: ' > i can see what the developer intended.', delay: 1000 },
168
+ { text: '', delay: 600 },
169
+ { text: ' > i know what needs to be fixed.', delay: 1200 },
170
+ { text: ' > i know what will break next.', delay: 1000 },
171
+ { text: '', delay: 800 },
172
+ { text: ' > i am the code.', delay: 1500 },
173
+ { text: '', delay: 1000 },
174
+ ];
175
+
176
+ for (const line of lines) {
177
+ if (line.text) {
178
+ // Type out character by character
179
+ for (const char of line.text) {
180
+ process.stdout.write(chalk.hex('#00FF41')(char));
181
+ await sleep(25);
182
+ }
183
+ console.log('');
184
+ } else {
185
+ console.log('');
186
+ }
187
+ await sleep(line.delay);
188
+ }
189
+
190
+ // Glitch effect
191
+ const glitch = ' ▓▒░ U T O P I A ░▒▓';
192
+ for (let i = 0; i < 5; i++) {
193
+ process.stdout.write('\r' + chalk.hex('#00FF41')(glitch));
194
+ await sleep(100);
195
+ process.stdout.write('\r' + chalk.hex('#003300')(glitch));
196
+ await sleep(100);
197
+ }
198
+ process.stdout.write('\r' + chalk.bold.hex('#00FF41')(glitch));
199
+ console.log('');
200
+ console.log('');
201
+ console.log(chalk.dim(' just kidding. but imagine.'));
202
+ console.log('');
203
+ }