veryfront 0.1.13 → 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 (135) hide show
  1. package/esm/cli/app/data/slug-words.d.ts.map +1 -1
  2. package/esm/cli/app/data/slug-words.js +225 -90
  3. package/esm/cli/app/operations/project-creation.js +4 -3
  4. package/esm/cli/app/shell.js +1 -1
  5. package/esm/cli/app/utils.d.ts +5 -4
  6. package/esm/cli/app/utils.d.ts.map +1 -1
  7. package/esm/cli/app/utils.js +0 -23
  8. package/esm/cli/app/views/dashboard.d.ts +1 -1
  9. package/esm/cli/app/views/dashboard.d.ts.map +1 -1
  10. package/esm/cli/app/views/dashboard.js +22 -4
  11. package/esm/cli/auth/callback-server.d.ts.map +1 -1
  12. package/esm/cli/auth/callback-server.js +3 -2
  13. package/esm/cli/commands/dev/handler.d.ts.map +1 -1
  14. package/esm/cli/commands/dev/handler.js +2 -0
  15. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  16. package/esm/cli/commands/init/init-command.js +20 -3
  17. package/esm/cli/commands/init/interactive-wizard.d.ts +3 -2
  18. package/esm/cli/commands/init/interactive-wizard.d.ts.map +1 -1
  19. package/esm/cli/commands/init/interactive-wizard.js +55 -27
  20. package/esm/cli/mcp/remote-file-tools.d.ts +0 -6
  21. package/esm/cli/mcp/remote-file-tools.d.ts.map +1 -1
  22. package/esm/cli/mcp/remote-file-tools.js +37 -15
  23. package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
  24. package/esm/cli/shared/reserve-slug.js +8 -3
  25. package/esm/cli/utils/env-prompt.d.ts.map +1 -1
  26. package/esm/cli/utils/env-prompt.js +3 -0
  27. package/esm/deno.d.ts +2 -1
  28. package/esm/deno.js +8 -4
  29. package/esm/src/agent/chat-handler.d.ts +4 -3
  30. package/esm/src/agent/chat-handler.d.ts.map +1 -1
  31. package/esm/src/agent/chat-handler.js +55 -4
  32. package/esm/src/agent/react/index.d.ts +1 -1
  33. package/esm/src/agent/react/index.d.ts.map +1 -1
  34. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +18 -0
  35. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -0
  36. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +54 -0
  37. package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +43 -0
  38. package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +1 -0
  39. package/esm/src/agent/react/use-chat/browser-inference/types.js +4 -0
  40. package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +23 -0
  41. package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +1 -0
  42. package/esm/src/agent/react/use-chat/browser-inference/worker-client.js +67 -0
  43. package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts +8 -0
  44. package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts.map +1 -0
  45. package/esm/src/agent/react/use-chat/browser-inference/worker-script.js +97 -0
  46. package/esm/src/agent/react/use-chat/index.d.ts +1 -1
  47. package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
  48. package/esm/src/agent/react/use-chat/types.d.ts +12 -0
  49. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  50. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  51. package/esm/src/agent/react/use-chat/use-chat.js +120 -6
  52. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  53. package/esm/src/agent/runtime/index.js +59 -7
  54. package/esm/src/build/production-build/templates.d.ts +2 -2
  55. package/esm/src/build/production-build/templates.d.ts.map +1 -1
  56. package/esm/src/build/production-build/templates.js +2 -68
  57. package/esm/src/chat/index.d.ts +1 -1
  58. package/esm/src/chat/index.d.ts.map +1 -1
  59. package/esm/src/errors/veryfront-error.d.ts +3 -0
  60. package/esm/src/errors/veryfront-error.d.ts.map +1 -1
  61. package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
  62. package/esm/src/platform/adapters/runtime/deno/adapter.js +5 -1
  63. package/esm/src/platform/compat/http/deno-server.d.ts.map +1 -1
  64. package/esm/src/platform/compat/http/deno-server.js +3 -2
  65. package/esm/src/provider/index.d.ts +1 -1
  66. package/esm/src/provider/index.d.ts.map +1 -1
  67. package/esm/src/provider/index.js +1 -1
  68. package/esm/src/provider/local/ai-sdk-adapter.d.ts +19 -0
  69. package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -0
  70. package/esm/src/provider/local/ai-sdk-adapter.js +164 -0
  71. package/esm/src/provider/local/env.d.ts +10 -0
  72. package/esm/src/provider/local/env.d.ts.map +1 -0
  73. package/esm/src/provider/local/env.js +23 -0
  74. package/esm/src/provider/local/local-engine.d.ts +61 -0
  75. package/esm/src/provider/local/local-engine.d.ts.map +1 -0
  76. package/esm/src/provider/local/local-engine.js +211 -0
  77. package/esm/src/provider/local/model-catalog.d.ts +30 -0
  78. package/esm/src/provider/local/model-catalog.d.ts.map +1 -0
  79. package/esm/src/provider/local/model-catalog.js +58 -0
  80. package/esm/src/provider/model-registry.d.ts +14 -0
  81. package/esm/src/provider/model-registry.d.ts.map +1 -1
  82. package/esm/src/provider/model-registry.js +58 -2
  83. package/esm/src/proxy/main.js +34 -6
  84. package/esm/src/proxy/server-resolver.d.ts +23 -0
  85. package/esm/src/proxy/server-resolver.d.ts.map +1 -0
  86. package/esm/src/proxy/server-resolver.js +124 -0
  87. package/esm/src/react/components/ai/chat/components/inference-badge.d.ts +8 -0
  88. package/esm/src/react/components/ai/chat/components/inference-badge.d.ts.map +1 -0
  89. package/esm/src/react/components/ai/chat/components/inference-badge.js +36 -0
  90. package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts +7 -0
  91. package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +1 -0
  92. package/esm/src/react/components/ai/chat/components/upgrade-cta.js +33 -0
  93. package/esm/src/react/components/ai/chat/index.d.ts +7 -1
  94. package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
  95. package/esm/src/react/components/ai/chat/index.js +16 -4
  96. package/package.json +5 -1
  97. package/src/cli/app/data/slug-words.ts +225 -90
  98. package/src/cli/app/operations/project-creation.ts +3 -3
  99. package/src/cli/app/shell.ts +1 -1
  100. package/src/cli/app/utils.ts +0 -30
  101. package/src/cli/app/views/dashboard.ts +27 -4
  102. package/src/cli/auth/callback-server.ts +3 -2
  103. package/src/cli/commands/dev/handler.ts +2 -0
  104. package/src/cli/commands/init/init-command.ts +30 -3
  105. package/src/cli/commands/init/interactive-wizard.ts +62 -34
  106. package/src/cli/mcp/remote-file-tools.ts +50 -15
  107. package/src/cli/shared/reserve-slug.ts +9 -2
  108. package/src/cli/utils/env-prompt.ts +3 -0
  109. package/src/deno.js +8 -4
  110. package/src/src/agent/chat-handler.ts +57 -4
  111. package/src/src/agent/react/index.ts +2 -0
  112. package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +81 -0
  113. package/src/src/agent/react/use-chat/browser-inference/types.ts +52 -0
  114. package/src/src/agent/react/use-chat/browser-inference/worker-client.ts +89 -0
  115. package/src/src/agent/react/use-chat/browser-inference/worker-script.ts +98 -0
  116. package/src/src/agent/react/use-chat/index.ts +2 -0
  117. package/src/src/agent/react/use-chat/types.ts +20 -0
  118. package/src/src/agent/react/use-chat/use-chat.ts +148 -8
  119. package/src/src/agent/runtime/index.ts +72 -6
  120. package/src/src/build/production-build/templates.ts +2 -68
  121. package/src/src/chat/index.ts +2 -0
  122. package/src/src/errors/veryfront-error.ts +2 -1
  123. package/src/src/platform/adapters/runtime/deno/adapter.ts +5 -1
  124. package/src/src/platform/compat/http/deno-server.ts +3 -1
  125. package/src/src/provider/index.ts +1 -0
  126. package/src/src/provider/local/ai-sdk-adapter.ts +207 -0
  127. package/src/src/provider/local/env.ts +26 -0
  128. package/src/src/provider/local/local-engine.ts +288 -0
  129. package/src/src/provider/local/model-catalog.ts +73 -0
  130. package/src/src/provider/model-registry.ts +66 -2
  131. package/src/src/proxy/main.ts +41 -6
  132. package/src/src/proxy/server-resolver.ts +151 -0
  133. package/src/src/react/components/ai/chat/components/inference-badge.tsx +48 -0
  134. package/src/src/react/components/ai/chat/components/upgrade-cta.tsx +56 -0
  135. package/src/src/react/components/ai/chat/index.tsx +43 -6
@@ -1 +1 @@
1
- {"version":3,"file":"slug-words.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/data/slug-words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,UA6EtB,CAAC;AAEF,eAAO,MAAM,KAAK,UAwFjB,CAAC"}
1
+ {"version":3,"file":"slug-words.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/data/slug-words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,UA4JtB,CAAC;AAEF,eAAO,MAAM,KAAK,UAgJjB,CAAC"}
@@ -1,167 +1,302 @@
1
1
  export const ADJECTIVES = [
2
- "amber",
3
- "azure",
4
- "coral",
5
- "crimson",
6
- "cyan",
7
- "golden",
8
- "indigo",
9
- "ivory",
10
- "jade",
11
- "magenta",
12
- "maroon",
13
- "olive",
14
- "onyx",
15
- "opal",
16
- "pearl",
17
- "ruby",
18
- "scarlet",
19
- "silver",
20
- "teal",
21
- "topaz",
22
- "turquoise",
23
- "violet",
2
+ "agile",
24
3
  "alpine",
4
+ "amber",
5
+ "ancient",
6
+ "aqua",
25
7
  "arctic",
8
+ "arid",
9
+ "astral",
26
10
  "autumn",
27
- "coastal",
28
- "crystal",
29
- "desert",
30
- "floral",
31
- "forest",
32
- "frozen",
33
- "lunar",
34
- "misty",
35
- "mossy",
36
- "ocean",
37
- "polar",
38
- "rainy",
39
- "snowy",
40
- "solar",
41
- "spring",
42
- "stormy",
43
- "sunny",
44
- "tidal",
45
- "tropic",
46
- "windy",
47
- "agile",
11
+ "azure",
12
+ "balmy",
13
+ "blazing",
48
14
  "bold",
49
15
  "brave",
16
+ "breezy",
50
17
  "bright",
18
+ "brisk",
19
+ "bronze",
51
20
  "calm",
21
+ "cedar",
52
22
  "clever",
23
+ "coastal",
24
+ "cobalt",
25
+ "copper",
26
+ "coral",
53
27
  "cosmic",
28
+ "crimson",
29
+ "crisp",
30
+ "crystal",
31
+ "cyan",
54
32
  "daring",
33
+ "deep",
34
+ "dewy",
35
+ "dreamy",
36
+ "dusky",
37
+ "dusty",
55
38
  "eager",
39
+ "earthy",
40
+ "ebony",
41
+ "emerald",
56
42
  "epic",
43
+ "faint",
44
+ "feral",
57
45
  "fierce",
46
+ "fleet",
47
+ "floral",
48
+ "fluid",
49
+ "forest",
50
+ "fresh",
51
+ "frozen",
52
+ "frosty",
53
+ "garnet",
58
54
  "gentle",
55
+ "glacial",
56
+ "gleaming",
57
+ "glowing",
58
+ "golden",
59
+ "graceful",
59
60
  "grand",
61
+ "hazy",
62
+ "hollow",
63
+ "hushed",
64
+ "icy",
65
+ "indigo",
66
+ "ivory",
67
+ "jade",
60
68
  "keen",
61
69
  "kind",
70
+ "lasting",
71
+ "lavender",
72
+ "leafy",
73
+ "light",
74
+ "lilac",
62
75
  "lively",
76
+ "lone",
77
+ "lucid",
78
+ "lunar",
79
+ "magic",
80
+ "magenta",
81
+ "marine",
82
+ "maroon",
83
+ "mellow",
84
+ "mighty",
85
+ "misty",
86
+ "mossy",
63
87
  "mystic",
64
88
  "nimble",
65
89
  "noble",
90
+ "obsidian",
91
+ "olive",
92
+ "onyx",
93
+ "opal",
94
+ "pale",
95
+ "pearl",
96
+ "placid",
97
+ "platinum",
98
+ "polar",
99
+ "prime",
66
100
  "proud",
101
+ "pure",
67
102
  "quiet",
103
+ "rainy",
68
104
  "rapid",
105
+ "rare",
106
+ "regal",
107
+ "rosy",
108
+ "ruby",
109
+ "rugged",
110
+ "russet",
111
+ "rustic",
112
+ "saffron",
113
+ "sage",
114
+ "sandy",
115
+ "sapphire",
116
+ "scarlet",
69
117
  "serene",
118
+ "shady",
119
+ "sharp",
70
120
  "silent",
121
+ "silver",
122
+ "slate",
123
+ "sleek",
124
+ "smooth",
125
+ "snowy",
126
+ "soft",
127
+ "solar",
128
+ "somber",
129
+ "stark",
130
+ "starry",
71
131
  "steady",
132
+ "stormy",
133
+ "strong",
134
+ "subtle",
135
+ "sunny",
136
+ "sunlit",
72
137
  "swift",
138
+ "tawny",
139
+ "teal",
140
+ "tidal",
141
+ "topaz",
142
+ "tropic",
143
+ "turquoise",
144
+ "vast",
145
+ "velvet",
146
+ "verdant",
147
+ "violet",
73
148
  "vivid",
149
+ "warm",
74
150
  "wild",
151
+ "windy",
152
+ "wintry",
75
153
  "wise",
76
154
  "witty",
155
+ "woody",
77
156
  "zen",
78
157
  ];
79
158
  export const NOUNS = [
159
+ "arc",
160
+ "arch",
161
+ "aurora",
162
+ "basin",
80
163
  "bay",
164
+ "beam",
165
+ "bend",
166
+ "blaze",
167
+ "bluff",
168
+ "bog",
169
+ "bolt",
170
+ "breeze",
81
171
  "brook",
82
172
  "canal",
83
- "cascade",
84
- "coast",
85
- "creek",
86
- "delta",
87
- "falls",
88
- "fjord",
89
- "gulf",
90
- "harbor",
91
- "lagoon",
92
- "lake",
93
- "marsh",
94
- "ocean",
95
- "pond",
96
- "rapids",
97
- "reef",
98
- "river",
99
- "shore",
100
- "spring",
101
- "strait",
102
- "stream",
103
- "tide",
104
- "wave",
105
- "bluff",
106
173
  "canyon",
174
+ "cape",
175
+ "cascade",
107
176
  "cave",
177
+ "cavern",
178
+ "channel",
108
179
  "cliff",
109
- "crater",
110
- "desert",
111
- "dune",
112
- "field",
113
- "glade",
114
- "gorge",
115
- "grove",
116
- "hill",
117
- "isle",
118
- "mesa",
119
- "oasis",
120
- "pass",
121
- "peak",
122
- "plain",
123
- "plateau",
124
- "ridge",
125
- "rock",
126
- "slope",
127
- "stone",
128
- "summit",
129
- "trail",
130
- "valley",
131
- "volcano",
132
- "aurora",
133
180
  "cloud",
181
+ "coast",
134
182
  "comet",
183
+ "copse",
184
+ "corona",
135
185
  "cosmos",
186
+ "cove",
187
+ "crater",
188
+ "creek",
189
+ "crest",
190
+ "dale",
136
191
  "dawn",
192
+ "delta",
193
+ "desert",
194
+ "drift",
195
+ "dune",
137
196
  "dusk",
138
197
  "eclipse",
198
+ "edge",
139
199
  "ember",
200
+ "falls",
201
+ "fen",
202
+ "field",
203
+ "fjord",
140
204
  "flare",
205
+ "flame",
206
+ "ford",
141
207
  "frost",
142
208
  "galaxy",
209
+ "gap",
210
+ "glade",
211
+ "glen",
143
212
  "glow",
213
+ "gorge",
214
+ "grove",
215
+ "gulf",
216
+ "gust",
217
+ "harbor",
218
+ "haven",
144
219
  "haze",
220
+ "heath",
221
+ "hill",
222
+ "hollow",
145
223
  "horizon",
224
+ "inlet",
225
+ "isle",
226
+ "knoll",
227
+ "lagoon",
228
+ "lake",
229
+ "ledge",
230
+ "loch",
231
+ "marsh",
232
+ "meadow",
233
+ "mesa",
146
234
  "meteor",
147
235
  "mist",
148
236
  "moon",
237
+ "moor",
238
+ "mount",
149
239
  "nebula",
240
+ "north",
150
241
  "nova",
242
+ "oasis",
243
+ "ocean",
151
244
  "orbit",
245
+ "pass",
246
+ "peak",
247
+ "pine",
248
+ "plain",
249
+ "plateau",
250
+ "plume",
251
+ "pond",
252
+ "pool",
152
253
  "prism",
153
254
  "pulse",
154
255
  "quasar",
256
+ "rain",
257
+ "range",
258
+ "rapids",
259
+ "ravine",
155
260
  "ray",
261
+ "reef",
262
+ "ridge",
263
+ "rift",
264
+ "ripple",
265
+ "river",
266
+ "rock",
267
+ "sand",
268
+ "shade",
156
269
  "shadow",
270
+ "shoal",
271
+ "shore",
157
272
  "sky",
273
+ "slope",
274
+ "snow",
158
275
  "spark",
276
+ "spring",
159
277
  "star",
278
+ "stone",
160
279
  "storm",
280
+ "strait",
281
+ "stream",
282
+ "summit",
161
283
  "sun",
284
+ "surf",
162
285
  "thunder",
286
+ "tide",
287
+ "torch",
288
+ "trail",
289
+ "tundra",
163
290
  "twilight",
291
+ "vale",
292
+ "valley",
164
293
  "vapor",
294
+ "volcano",
295
+ "vortex",
296
+ "wake",
297
+ "wave",
298
+ "wisp",
165
299
  "wind",
166
300
  "zenith",
301
+ "zephyr",
167
302
  ];
@@ -8,7 +8,8 @@ import { cwd } from "../../../src/platform/index.js";
8
8
  import { addLog, navigateTo, setProjects, startInput, updateRemote } from "../state.js";
9
9
  import { readToken } from "../../auth/token-store.js";
10
10
  import { fetchRemoteProjects } from "../../sync/index.js";
11
- import { copyDirectory, createRemoteProject, generateRandomSlug, getLocalProjectsFromState, normalizeSlug, } from "../utils.js";
11
+ import { copyDirectory, generateRandomSlug, getLocalProjectsFromState, normalizeSlug, } from "../utils.js";
12
+ import { reserveProjectSlug } from "../../shared/reserve-slug.js";
12
13
  import { initCommand } from "../../commands/init/init-command.js";
13
14
  /**
14
15
  * Create a new project from a template
@@ -23,7 +24,7 @@ export async function createProject(ctx, projectName, template) {
23
24
  return addLog("error", "Not authenticated. Press 'a' to login.")(state);
24
25
  }
25
26
  const normalizedSlug = normalizeSlug(projectName);
26
- const { slug } = await createRemoteProject(token, normalizedSlug);
27
+ const { slug } = await reserveProjectSlug(normalizedSlug, token);
27
28
  const projectPath = `${cwd()}/projects/${slug}`;
28
29
  await initCommand({
29
30
  name: `projects/${slug}`,
@@ -62,7 +63,7 @@ export async function createProjectFromExample(ctx, projectName, example) {
62
63
  return addLog("error", "Not authenticated. Press 'a' to login.")(state);
63
64
  }
64
65
  const normalizedSlug = normalizeSlug(projectName);
65
- const { slug } = await createRemoteProject(token, normalizedSlug);
66
+ const { slug } = await reserveProjectSlug(normalizedSlug, token);
66
67
  const projectPath = `${cwd()}/projects/${slug}`;
67
68
  await copyDirectory(example.path, projectPath);
68
69
  const currentProjects = getLocalProjectsFromState(state);
@@ -96,7 +96,7 @@ export function createApp(config) {
96
96
  case "dashboard":
97
97
  content = state.projects.items.length > 0 || state.examples.items.length > 0
98
98
  ? renderDashboard(state)
99
- : renderEmptyState();
99
+ : renderEmptyState(state);
100
100
  break;
101
101
  case "new-project":
102
102
  content = renderNewProjectView(state);
@@ -1,11 +1,12 @@
1
+ /**
2
+ * App Utilities
3
+ *
4
+ * Helper functions for project creation and management.
5
+ */
1
6
  import { type AppState, type StateUpdater } from "./state.js";
2
7
  export declare function copyDirectory(src: string, dest: string): Promise<void>;
3
8
  export declare function generateRandomSlug(): string;
4
9
  export declare function normalizeSlug(projectName: string): string;
5
- export declare function slugToName(slug: string): string;
6
- export declare function createRemoteProject(token: string, slug: string): Promise<{
7
- slug: string;
8
- }>;
9
10
  export declare function getLocalProjectsFromState(appState: AppState): Array<{
10
11
  slug: string;
11
12
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cli/app/utils.ts"],"names":[],"mappings":"AAcA,OAAO,EAAU,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAGtE,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB5E;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAiB3B;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,GACjB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAQvC;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,QAAQ,EACnB,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,EACvC,MAAM,EAAE,MAAM,IAAI,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cli/app/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAU,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAGtE,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB5E;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,GACjB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAQvC;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,QAAQ,EACnB,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,EACvC,MAAM,EAAE,MAAM,IAAI,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
@@ -3,11 +3,8 @@
3
3
  *
4
4
  * Helper functions for project creation and management.
5
5
  */
6
- import * as dntShim from "../../_dnt.shims.js";
7
6
  import { cwd } from "../../src/platform/index.js";
8
7
  import { join } from "../../src/platform/compat/path/index.js";
9
- import { getEnvironmentConfig } from "../../src/config/index.js";
10
- import { capitalizeSeparatedWords } from "../../src/utils/case-utils.js";
11
8
  import { readToken } from "../auth/token-store.js";
12
9
  import { pullCommand } from "../commands/pull/index.js";
13
10
  import { addLog } from "./state.js";
@@ -36,26 +33,6 @@ export function generateRandomSlug() {
36
33
  export function normalizeSlug(projectName) {
37
34
  return projectName.replace(/[^a-z0-9-]/gi, "-").toLowerCase();
38
35
  }
39
- export function slugToName(slug) {
40
- return capitalizeSeparatedWords(slug, "-", " ");
41
- }
42
- export async function createRemoteProject(token, slug) {
43
- const apiUrl = getEnvironmentConfig().apiUrl || "https://api.veryfront.com";
44
- const response = await dntShim.fetch(`${apiUrl}/projects`, {
45
- method: "POST",
46
- headers: {
47
- Authorization: `Bearer ${token}`,
48
- "Content-Type": "application/json",
49
- Accept: "application/json",
50
- },
51
- body: JSON.stringify({ slug, name: slugToName(slug) }),
52
- });
53
- if (response.ok)
54
- return (await response.json());
55
- const error = await response.json().catch(() => ({}));
56
- const msg = error.message || `HTTP ${response.status}`;
57
- throw new Error(msg);
58
- }
59
36
  export function getLocalProjectsFromState(appState) {
60
37
  const result = [];
61
38
  for (const item of appState.projects.items) {
@@ -15,5 +15,5 @@ export declare function renderDashboardBoxed(state: AppState): string;
15
15
  /**
16
16
  * Render empty state when no projects found
17
17
  */
18
- export declare function renderEmptyState(): string;
18
+ export declare function renderEmptyState(state: AppState): string;
19
19
  //# sourceMappingURL=dashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAwEvD;AAuFD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAY5D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAwEvD;AAwGD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAY5D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAQxD"}
@@ -126,17 +126,31 @@ function renderSection(title, isActive = true) {
126
126
  * Render the help bar at the bottom
127
127
  */
128
128
  function renderHelpBar(state) {
129
+ const hasItems = state.projects.items.length > 0 || state.examples.items.length > 0 ||
130
+ (!!state.remote.user && state.remote.projects.length > 0);
129
131
  if (!state.showHelp) {
130
132
  const userInfo = state.remote.user ? ` ${dim("-")} ${brand(state.remote.user.email)}` : "";
133
+ if (!hasItems) {
134
+ const authHint = state.remote.user
135
+ ? `${dim("x")} ${dim("logout")}`
136
+ : `${dim("a")} ${dim("login")}`;
137
+ return ` ${dim("n")} ${dim("new project")} ${authHint} ${dim("? more")} ${dim("q quit")}${userInfo}`;
138
+ }
131
139
  return ` ${dim("↑↓ select enter open ? more q quit")}${userInfo}`;
132
140
  }
133
141
  const lines = [];
134
- lines.push(` ${dim("o")} open ${dim("s")} studio ${dim("i")} ide`);
142
+ if (hasItems) {
143
+ lines.push(` ${dim("o")} open ${dim("s")} studio ${dim("i")} ide`);
144
+ }
135
145
  if (!state.remote.user) {
136
146
  lines.push(` ${dim("n")} new ${dim("a")} login`);
137
147
  }
138
148
  else {
139
- lines.push(` ${dim("n")} new ${dim("p")} pull ${dim("u")} push ${dim("x")} logout`);
149
+ const parts = [` ${dim("n")} new`];
150
+ if (hasItems)
151
+ parts.push(`${dim("p")} pull ${dim("u")} push`);
152
+ parts.push(`${dim("x")} logout`);
153
+ lines.push(parts.join(" "));
140
154
  }
141
155
  lines.push(` ${dim("? hide q quit")}`);
142
156
  return lines.join("\n");
@@ -159,6 +173,10 @@ export function renderDashboardBoxed(state) {
159
173
  /**
160
174
  * Render empty state when no projects found
161
175
  */
162
- export function renderEmptyState() {
163
- return `\n ${dim("No projects.")} ${brand("n")} ${dim("to create")}\n`;
176
+ export function renderEmptyState(state) {
177
+ const lines = [];
178
+ lines.push(renderBanner(state), "");
179
+ lines.push(` ${dim("No projects.")} ${brand("n")} ${dim("to create")}`, "");
180
+ lines.push(renderHelpBar(state));
181
+ return lines.join("\n");
164
182
  }
@@ -1 +1 @@
1
- {"version":3,"file":"callback-server.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/callback-server.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AA4QD,wBAAsB,mBAAmB,CACvC,aAAa,GAAE,MAA8B,GAC5C,OAAO,CAAC,cAAc,CAAC,CAGzB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
1
+ {"version":3,"file":"callback-server.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/callback-server.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AA6QD,wBAAsB,mBAAmB,CACvC,aAAa,GAAE,MAA8B,GAC5C,OAAO,CAAC,cAAc,CAAC,CAGzB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
@@ -159,8 +159,9 @@ function tryStartDenoServer(port) {
159
159
  const callbackPromise = new Promise((resolve) => {
160
160
  resolveCallback = resolve;
161
161
  });
162
- // @ts-ignore - Deno global
163
- const server = dntShim.Deno.serve({ port, hostname: "127.0.0.1", onListen: () => { } }, (request) => {
162
+ // Access native Deno.serve via `self` to bypass dnt shim transform.
163
+ const nativeDeno = self["Deno"];
164
+ const server = nativeDeno.serve({ port, hostname: "127.0.0.1", onListen: () => { } }, (request) => {
164
165
  const url = new URL(request.url);
165
166
  if (url.pathname !== "/callback") {
166
167
  return new dntShim.Response("Not Found", { status: 404, headers: { Connection: "close" } });
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AASxD,eAAO,MAAM,YAAY;;;;;EAKvB,CAAC;AAwBH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBtE"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AASxD,eAAO,MAAM,YAAY;;;;;EAKvB,CAAC;AAwBH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBtE"}
@@ -51,5 +51,7 @@ export async function handleDevCommand(args) {
51
51
  projectDir,
52
52
  hmr: opts.hmr,
53
53
  });
54
+ // Block until the dev server shuts down.
55
+ // Without this, main.ts reaches exitProcess(0) and terminates immediately.
54
56
  await done;
55
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAUjC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AA+J5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgWrE"}
1
+ {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAUjC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAmK5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuXrE"}
@@ -3,7 +3,7 @@
3
3
  * @module
4
4
  *******************************/
5
5
  import { cliLogger as logger } from "../../utils/index.js";
6
- import { brand, dim, green } from "../../ui/index.js";
6
+ import { brand, dim, green, red } from "../../ui/index.js";
7
7
  import { createSpinner } from "../../ui/progress.js";
8
8
  import { box } from "../../ui/box.js";
9
9
  import { ensureDir } from "../../../deps/jsr.io/@std/fs/1.0.22/mod.js";
@@ -16,7 +16,7 @@ import { detectPackageManager, getInstallCommand, getRunCommand, installDependen
16
16
  import { generateGitignoreContent, promptForEnvVars } from "../../utils/env-prompt.js";
17
17
  import { loadFeature, mergeFiles, resolveFeatures, validateFeatures, } from "../../templates/feature-loader.js";
18
18
  import { getIntegrationBaseFiles, loadIntegrationBaseConfig, loadIntegrationBaseFilesFromDirectory, loadIntegrations, validateIntegrations, } from "../../templates/integration-loader.js";
19
- import { runInteractiveWizard, shouldRunWizard } from "./interactive-wizard.js";
19
+ import { runInteractiveWizard, shouldRunWizard, validateProjectName, } from "./interactive-wizard.js";
20
20
  /**
21
21
  * Icon mapping for integrations based on category/name
22
22
  */
@@ -153,8 +153,25 @@ export async function initCommand(options) {
153
153
  let template;
154
154
  let projectName = name;
155
155
  let initGit = false;
156
+ // Validate project name before doing anything else
157
+ if (name) {
158
+ const nameError = validateProjectName(name);
159
+ if (nameError) {
160
+ console.error(red(nameError));
161
+ return;
162
+ }
163
+ }
164
+ // Check if directory already exists before entering the wizard
165
+ if (name && !options.force) {
166
+ const fs = createFileSystem();
167
+ const targetDir = join(cwd(), name);
168
+ if (await fs.exists(targetDir)) {
169
+ console.error(red(`Directory "${name}" already exists. Choose a different name or use --force to overwrite.`));
170
+ return;
171
+ }
172
+ }
156
173
  if (shouldRunWizard(options)) {
157
- const wizardResult = await runInteractiveWizard();
174
+ const wizardResult = await runInteractiveWizard(name);
158
175
  if (wizardResult.cancelled) {
159
176
  return;
160
177
  }
@@ -1,4 +1,6 @@
1
1
  import type { InitTemplate } from "./types.js";
2
+ /** Reject path separators and traversal so the name stays a single directory. */
3
+ export declare function validateProjectName(name: string): string | null;
2
4
  export interface WizardResult {
3
5
  projectName: string | null;
4
6
  template: InitTemplate;
@@ -6,9 +8,8 @@ export interface WizardResult {
6
8
  skipped: boolean;
7
9
  cancelled: boolean;
8
10
  }
9
- export declare function runInteractiveWizard(): Promise<WizardResult>;
11
+ export declare function runInteractiveWizard(existingName?: string): Promise<WizardResult>;
10
12
  export declare function shouldRunWizard(options: {
11
13
  template?: string;
12
- name?: string;
13
14
  }): boolean;
14
15
  //# sourceMappingURL=interactive-wizard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-wizard.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/interactive-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAMD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,YAAY,CAAC,CAoHlE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAGtF"}
1
+ {"version":3,"file":"interactive-wizard.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/interactive-wizard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/D;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAMD,wBAAsB,oBAAoB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAyIvF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAGvE"}