use-vibes 0.19.33-dev-cli → 0.20.1-dev-push

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 (47) hide show
  1. package/README.md +529 -29
  2. package/package.json +13 -18
  3. package/bin.d.ts +0 -2
  4. package/bin.js +0 -12
  5. package/bin.js.map +0 -1
  6. package/cli/exec/info.d.ts +0 -2
  7. package/cli/exec/info.js +0 -16
  8. package/cli/exec/info.js.map +0 -1
  9. package/cli/exec/result-to-exit-code.d.ts +0 -3
  10. package/cli/exec/result-to-exit-code.js +0 -8
  11. package/cli/exec/result-to-exit-code.js.map +0 -1
  12. package/cli/exec/skills.d.ts +0 -2
  13. package/cli/exec/skills.js +0 -11
  14. package/cli/exec/skills.js.map +0 -1
  15. package/cli/exec/system.d.ts +0 -2
  16. package/cli/exec/system.js +0 -20
  17. package/cli/exec/system.js.map +0 -1
  18. package/cli/exec/whoami.d.ts +0 -2
  19. package/cli/exec/whoami.js +0 -11
  20. package/cli/exec/whoami.js.map +0 -1
  21. package/cli/executable.d.ts +0 -11
  22. package/cli/executable.js +0 -2
  23. package/cli/executable.js.map +0 -1
  24. package/commands/cli-output-node.d.ts +0 -5
  25. package/commands/cli-output-node.js +0 -6
  26. package/commands/cli-output-node.js.map +0 -1
  27. package/commands/config.d.ts +0 -15
  28. package/commands/config.js +0 -26
  29. package/commands/config.js.map +0 -1
  30. package/commands/info.d.ts +0 -6
  31. package/commands/info.js +0 -25
  32. package/commands/info.js.map +0 -1
  33. package/commands/resolve-target.d.ts +0 -12
  34. package/commands/resolve-target.js +0 -43
  35. package/commands/resolve-target.js.map +0 -1
  36. package/commands/skills.d.ts +0 -3
  37. package/commands/skills.js +0 -14
  38. package/commands/skills.js.map +0 -1
  39. package/commands/system.d.ts +0 -6
  40. package/commands/system.js +0 -70
  41. package/commands/system.js.map +0 -1
  42. package/commands/whoami.d.ts +0 -3
  43. package/commands/whoami.js +0 -5
  44. package/commands/whoami.js.map +0 -1
  45. package/dispatcher.d.ts +0 -3
  46. package/dispatcher.js +0 -34
  47. package/dispatcher.js.map +0 -1
package/README.md CHANGED
@@ -1,49 +1,549 @@
1
1
  # use-vibes
2
2
 
3
- CLI and runtime for building and deploying React + Fireproof apps on [vibes.diy](https://vibes.diy).
3
+ A lightweight library that transforms any DOM element into an AI-powered micro-app.
4
4
 
5
- ## Quick start
5
+ ## Installation
6
6
 
7
7
  ```bash
8
- npm create vibe my-app
9
- cd my-app
10
- npm install
8
+ pnpm add use-vibes
11
9
  ```
12
10
 
13
- ## CLI commands
11
+ ## Basic Usage
14
12
 
15
- All commands run via `npm run use-vibes <command>`:
13
+ ```jsx
14
+ import { ImgGen } from "use-vibes";
16
15
 
17
- | Command | Description |
18
- |---------|-------------|
19
- | `skills` | List available skill libraries (fireproof, callai, web-audio, d3, three-js, image-gen) |
20
- | `system --skills fireproof,d3` | Emit the full system prompt for selected skills |
21
- | `login` | Authenticate with vibes.diy |
22
- | `whoami` | Print the logged-in user |
23
- | `dev` | Watch files and push on save (coming soon) |
24
- | `publish` | One-time push to production (coming soon) |
16
+ function MyComponent() {
17
+ // You can use ImgGen without any props - it includes its own form UI
18
+ return <ImgGen />;
25
19
 
26
- ## Writing app.jsx
20
+ // Or provide a prompt directly (bypasses the form UI completely)
21
+ // return <ImgGen prompt="A futuristic cityscape with flying cars" />;
22
+ }
23
+ ```
24
+
25
+ For image manipulation using base64 data:
26
+
27
+ ```jsx
28
+ import { base64ToFile } from "use-vibes";
29
+
30
+ // Convert API response to a File object
31
+ const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
32
+ ```
33
+
34
+ ## Core Features
35
+
36
+ ### Interactive Image Generation
37
+
38
+ - **Zero-config Implementation**: Add AI image generation to any React app without any configuration
39
+
40
+ ```jsx
41
+ {
42
+ /* Includes a built-in form UI for prompt entry and image upload */
43
+ }
44
+ <ImgGen />;
45
+ ```
46
+
47
+ - **One-line Implementation**: Directly specify a prompt for immediate generation (bypasses the form UI)
48
+
49
+ ```jsx
50
+ {
51
+ /* Starts generating immediately, no form shown to the user */
52
+ }
53
+ <ImgGen prompt="A sunset over mountains" />;
54
+ ```
55
+
56
+ - **Automatic Database Integration**: All images are automatically stored in Fireproof database with version history
57
+
58
+ ```jsx
59
+ // Custom database name
60
+ <ImgGen prompt="Forest landscape" database="MyCustomDB" />
61
+
62
+ // Or pass a database instance
63
+ <ImgGen prompt="Forest landscape" database={myDbInstance} />
64
+ ```
65
+
66
+ ### Prompt Management
67
+
68
+ - **Prompt Versioning**: Tracks the history of different prompts used to generate an image
69
+ - Uses a structured `prompts` object with timestamp-based keys
70
+ - Maintains `currentPromptKey` to reference the active prompt
71
+
72
+ - **Prompt Editing**: Users can edit prompts directly in the overlay UI
73
+ - Double-click the prompt text to edit
74
+ - Press Enter to submit and regenerate with new prompt
75
+ - App receives updates via `onPromptEdit` callback
76
+ ```jsx
77
+ <ImgGen
78
+ prompt="Initial prompt"
79
+ onPromptEdit={(id, newPrompt) => {
80
+ console.log(`Document ${id} updated with new prompt: ${newPrompt}`);
81
+ }}
82
+ />
83
+ ```
84
+
85
+ ### Image Control & Manipulation
86
+
87
+ - **Image Regeneration**: One-click regeneration with the same or edited prompt
88
+ - Preserves document history and adds new versions
89
+ - Uses a unique `generationId` to trigger regeneration while maintaining context
90
+
91
+ - **Image Quality Control**: Set quality levels for output images
92
+
93
+ ```jsx
94
+ <ImgGen prompt="Detailed artwork" options={{ quality: "high" }} />
95
+ ```
96
+
97
+ - **Image Editing with Uploads**: Process existing images with AI
98
+
99
+ ```jsx
100
+ <ImgGen prompt="Turn this photo into a watercolor painting" images={[myImageFile]} />
101
+ ```
102
+
103
+ - **Multiple Image Inputs**: Combine multiple images in one generation
104
+ ```jsx
105
+ <ImgGen prompt="Create a collage of these photos" images={[photo1, photo2, photo3]} />
106
+ ```
107
+
108
+ ### User Interface Components
109
+
110
+ - **Interactive Overlay**: Toggle-able information and controls overlay
111
+ - Shows prompt text (editable)
112
+ - Version navigation controls
113
+ - Regenerate/refresh button
114
+ - Delete button
115
+
116
+ ```jsx
117
+ // Disable overlay for a minimal UI
118
+ <ImgGen prompt="Clean interface" overlay={false} />
119
+ ```
120
+
121
+ - **Progress Visualization**: Shows generation progress with visual indicators
122
+ - Progress bar updates in real-time
123
+ - Automatic placeholder display during generation
124
+
125
+ - **Error Handling UI**: Clean error states with informative messages
126
+ ```jsx
127
+ <ImgGen
128
+ prompt="Test error handling"
129
+ onError={(error) => {
130
+ console.error("Generation failed:", error.message);
131
+ }}
132
+ />
133
+ ```
134
+
135
+ ### File Management
136
+
137
+ - **File Upload Interface**: Built-in support for image uploads
138
+ - Drag-and-drop capabilities
139
+ - File selection dialog
140
+ - Preview of uploaded content
141
+
142
+ - **Base64 Conversion**: Convert between base64 and File objects
143
+
144
+ ```jsx
145
+ import { base64ToFile } from "use-vibes";
146
+
147
+ // Convert API response to a File object
148
+ const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
149
+ ```
150
+
151
+ ## Integration Features
152
+
153
+ ### Event Callbacks
154
+
155
+ - **Generation Lifecycle Events**: Track the complete generation process
156
+ ```jsx
157
+ <ImgGen
158
+ prompt="Track this generation"
159
+ onComplete={() => console.log("Generation complete!")}
160
+ onError={(error) => console.error("Generation failed:", error)}
161
+ onDelete={(id) => console.log(`Document ${id} deleted`)}
162
+ onDocumentCreated={(id) => console.log(`New document created: ${id}`)}
163
+ />
164
+ ```
165
+
166
+ ### State Management
167
+
168
+ - **Loading States**: Component handles all loading states internally
169
+ - Initial waiting state
170
+ - Generation in progress state
171
+ - Upload waiting state
172
+ - Display state for completed images
173
+ - Error state
27
174
 
28
- Use the system prompt to guide AI or hand-write your vibe:
175
+ - **Document Identity Tracking**: Smart re-mounting based on document changes
176
+ - Uses internal `mountKey` system to ensure clean state transitions
177
+ - Detects identity changes through document ID, prompt, or uploaded file documents
178
+
179
+ ### UI Customization
180
+
181
+ - **Extensive Styling Options**: Multiple ways to customize appearance
182
+ - CSS Variables for global styling
183
+
184
+ ```css
185
+ :root {
186
+ --imggen-text-color: #222;
187
+ --imggen-overlay-bg: rgba(245, 245, 245, 0.85);
188
+ --imggen-accent: #0088ff;
189
+ --imggen-border-radius: 4px;
190
+ }
191
+ ```
192
+
193
+ - Custom classes for component-level styling
194
+
195
+ ```jsx
196
+ <ImgGen
197
+ prompt="Styled component"
198
+ classes={{
199
+ root: "my-custom-container",
200
+ image: "rounded-xl shadow-lg",
201
+ overlay: "bg-slate-800/70 text-white",
202
+ progress: "h-2 bg-green-500",
203
+ }}
204
+ />
205
+ ```
206
+
207
+ ### Gallery Integration
208
+
209
+ - **Thumbnail Support**: Easily create image galleries
210
+
211
+ ```jsx
212
+ <div className="image-grid">
213
+ {imageDocuments.map((doc) => (
214
+ <ImgGen key={doc._id} _id={doc._id} className="thumbnail" />
215
+ ))}
216
+ </div>
217
+ ```
218
+
219
+ - **Document Reuse**: Load existing documents by ID
220
+ ```jsx
221
+ <ImgGen _id="existing-document-id" />
222
+ ```
223
+
224
+ ## Implementation Modes
225
+
226
+ The ImgGen component has several operational modes that it switches between automatically:
227
+
228
+ 1. **Placeholder Mode**: Initial state when no prompt or document ID is provided
229
+ 2. **Upload Waiting Mode**: When files are uploaded but waiting for a prompt
230
+ 3. **Generating Mode**: During the image generation process
231
+ 4. **Display Mode**: When showing a generated image with controls
232
+ 5. **Error Mode**: When an error occurs during generation
233
+
234
+ The component automatically determines which mode to use based on the current state, providing a seamless experience for both developers and end-users.
235
+
236
+ ## Advanced Usage
237
+
238
+ ### Debug Mode
239
+
240
+ Enable debug mode to see detailed console logs about component state:
241
+
242
+ ```jsx
243
+ <ImgGen prompt="Debug this" options={{ debug: true }} />
244
+ ```
245
+
246
+ ### Custom Image Sizing
247
+
248
+ Control output image dimensions with the size option:
249
+
250
+ ```jsx
251
+ <ImgGen
252
+ prompt="Landscape format"
253
+ options={{ size: '1536x1024' }} // Landscape
254
+ />
255
+
256
+ <ImgGen
257
+ prompt="Portrait format"
258
+ options={{ size: '1024x1536' }} // Portrait
259
+ />
260
+ ```
261
+
262
+ # Advanced Usage
263
+
264
+ This guide covers the implementation, configuration, and best practices for using the ImgGen component from the use-vibes library.
265
+
266
+ ## Installation
29
267
 
30
268
  ```bash
31
- npm run use-vibes skills # browse available skills
32
- npm run use-vibes -- system --skills fireproof,d3 # get the system prompt
269
+ pnpm add use-vibes
270
+ ```
271
+
272
+ ### Styling
273
+
274
+ The ImgGen component uses inline styles with centralized theme constants, so **no separate CSS setup is required**. All styling is self-contained within the component.
275
+
276
+ ## Basic Usage
277
+
278
+ ### Simple Image Generation
279
+
280
+ Add AI image generation to any React app with minimal code:
281
+
282
+ ```jsx
283
+ import { ImgGen } from "use-vibes";
284
+
285
+ function MyComponent() {
286
+ return (
287
+ <div>
288
+ <ImgGen prompt="A sunset over mountains" />
289
+ </div>
290
+ );
291
+ }
292
+ ```
293
+
294
+ ### Configuration Options
295
+
296
+ Configure image generation with the `options` prop:
297
+
298
+ ```jsx
299
+ <ImgGen
300
+ prompt="A detailed cityscape"
301
+ options={{
302
+ model: "gpt-image-1",
303
+ quality: "high",
304
+ size: "1024x1024",
305
+ debug: false,
306
+ }}
307
+ />
33
308
  ```
34
309
 
35
- The system prompt tells you how to write `app.jsx` — a single React component with Tailwind CSS, Fireproof for data, and any selected skill libraries. All imports resolve automatically via esm.sh at runtime; no need to `npm install` additional packages.
310
+ ### Available Props
36
311
 
37
- ## Runtime
312
+ | Prop | Type | Description |
313
+ | ------------------- | ------------------ | ----------------------------------------------------------------------- |
314
+ | `prompt` | string | Text prompt for image generation (required unless `_id` is provided) |
315
+ | `_id` | string | Document ID to load a specific image instead of generating a new one |
316
+ | `className` | string | CSS class name for the image element |
317
+ | `alt` | string | Alt text for the image (defaults to prompt) |
318
+ | `images` | File[] | Array of images to edit or combine with AI |
319
+ | `options` | object | Configuration options (see table below) |
320
+ | `database` | string \| Database | Database name or instance to use for storing images |
321
+ | `onComplete` | function | Callback when image load completes successfully |
322
+ | `onError` | function | Callback when image load fails, receives the error as parameter |
323
+ | `onDelete` | function | Callback when an image is deleted, receives the document ID |
324
+ | `onPromptEdit` | function | Callback when the prompt is edited, receives document ID and new prompt |
325
+ | `onDocumentCreated` | function | Callback when a new document is created via drop or file picker |
326
+ | `overlay` | boolean | Whether to show overlay controls and info button (default: `true`) |
327
+ | `classes` | object | Custom CSS classes for styling component parts |
328
+ | `debug` | boolean | Enable debug logging |
329
+
330
+ ### Options Object Properties
331
+
332
+ | Property | Type | Description |
333
+ | --------- | ------- | ------------------------------------------------------------------------ |
334
+ | `model` | string | Model to use for image generation, defaults to 'gpt-image-1' |
335
+ | `size` | string | Size of the generated image (1024x1024, 1536x1024, 1024x1536, or 'auto') |
336
+ | `quality` | string | Quality of the generated image (high, medium, low, or auto) |
337
+ | `debug` | boolean | Enable debug logging, defaults to false |
338
+
339
+ ## Advanced Features
340
+
341
+ ### Prompt Management
342
+
343
+ The ImgGen component tracks the history of different prompts used to generate an image:
344
+
345
+ ```jsx
346
+ <ImgGen
347
+ prompt="Initial prompt"
348
+ onPromptEdit={(id, newPrompt) => {
349
+ console.log(`Document ${id} updated with new prompt: ${newPrompt}`);
350
+ }}
351
+ />
352
+ ```
353
+
354
+ Users can edit prompts directly by double-clicking the prompt text in the overlay UI, then pressing Enter to submit and regenerate with the new prompt.
355
+
356
+ ### Image Control & Manipulation
357
+
358
+ #### Image Regeneration
359
+
360
+ The component supports one-click regeneration, preserving document history while adding new versions:
361
+
362
+ ```jsx
363
+ // The regeneration happens internally when the user clicks the refresh button
364
+ // or when a new prompt is submitted
365
+ ```
366
+
367
+ #### Image Quality Control
368
+
369
+ Set quality levels for output images:
370
+
371
+ ```jsx
372
+ <ImgGen prompt="Detailed artwork" options={{ quality: "high" }} />
373
+ ```
374
+
375
+ #### Image Editing with Uploads
376
+
377
+ Process existing images with AI:
378
+
379
+ ```jsx
380
+ <ImgGen prompt="Turn this photo into a watercolor painting" images={[myImageFile]} />
381
+ ```
382
+
383
+ #### Multiple Image Inputs
384
+
385
+ Combine multiple images in one generation:
386
+
387
+ ```jsx
388
+ <ImgGen prompt="Create a collage of these photos" images={[photo1, photo2, photo3]} />
389
+ ```
390
+
391
+ ### Database Integration
392
+
393
+ All images are automatically stored in a Fireproof database with version history:
394
+
395
+ ```jsx
396
+ // Custom database name
397
+ <ImgGen prompt="Forest landscape" database="MyCustomDB" />
398
+
399
+ // Or pass a database instance
400
+ <ImgGen prompt="Forest landscape" database={myDbInstance} />
401
+ ```
402
+
403
+ ### Event Callbacks
404
+
405
+ Track the complete generation process with lifecycle events:
406
+
407
+ ```jsx
408
+ <ImgGen
409
+ prompt="Track this generation"
410
+ onComplete={() => console.log("Generation complete!")}
411
+ onError={(error) => console.error("Generation failed:", error)}
412
+ onDelete={(id) => console.log(`Document ${id} deleted`)}
413
+ onDocumentCreated={(id) => console.log(`New document created: ${id}`)}
414
+ />
415
+ ```
416
+
417
+ ### UI Controls
418
+
419
+ Toggle the information overlay and controls:
420
+
421
+ ```jsx
422
+ // Disable overlay for a minimal UI
423
+ <ImgGen prompt="Clean interface" overlay={false} />
424
+ ```
425
+
426
+ The overlay includes:
427
+
428
+ - Prompt text (editable)
429
+ - Version navigation controls
430
+ - Regenerate/refresh button
431
+ - Delete button
432
+
433
+ ### File Management
434
+
435
+ #### Base64 Conversion
436
+
437
+ Convert between base64 and File objects:
438
+
439
+ ```jsx
440
+ import { base64ToFile } from "use-vibes";
441
+
442
+ // Convert API response to a File object
443
+ const imageFile = base64ToFile(imageResponse.data[0].b64_json, "my-image.png");
444
+ ```
445
+
446
+ ## Styling and Customization
447
+
448
+ ### CSS Variables
449
+
450
+ The component uses centralized theme constants from `imgGenTheme` for consistent styling. All styles are applied inline using JavaScript objects, eliminating the need for external CSS files.
451
+
452
+ ### Custom Classes
453
+
454
+ For more granular control, provide a `classes` object with custom CSS classes for specific component parts:
455
+
456
+ ```jsx
457
+ <ImgGen
458
+ prompt="Styled component"
459
+ classes={{
460
+ root: "my-custom-container",
461
+ image: "rounded-xl shadow-lg",
462
+ overlay: "bg-slate-800/70 text-white",
463
+ progress: "h-2 bg-green-500",
464
+ button: "hover:bg-blue-600",
465
+ }}
466
+ />
467
+ ```
468
+
469
+ ### Available Class Slots
470
+
471
+ | Class Property | Description |
472
+ | --------------- | -------------------------------- |
473
+ | `root` | Main container element |
474
+ | `image` | The image element |
475
+ | `container` | Container for image and controls |
476
+ | `overlay` | Overlay panel with controls |
477
+ | `progress` | Progress indicator |
478
+ | `placeholder` | Placeholder shown during loading |
479
+ | `error` | Error message container |
480
+ | `controls` | Control buttons container |
481
+ | `button` | Individual buttons |
482
+ | `prompt` | Prompt text/input container |
483
+ | `deleteOverlay` | Delete confirmation dialog |
484
+
485
+ ## Gallery Implementation
486
+
487
+ ### Creating an Image Gallery
488
+
489
+ Easily create image galleries using document IDs:
490
+
491
+ ```jsx
492
+ <div className="image-grid">
493
+ {imageDocuments.map((doc) => (
494
+ <ImgGen key={doc._id} _id={doc._id} className="thumbnail" />
495
+ ))}
496
+ </div>
497
+ ```
498
+
499
+ ### Loading Existing Documents
500
+
501
+ Load existing documents by `_id`:
502
+
503
+ ```jsx
504
+ <ImgGen _id="existing-document-id" />
505
+ ```
506
+
507
+ ## Operation Modes
508
+
509
+ The ImgGen component has several operational modes that it switches between automatically:
510
+
511
+ 1. **Placeholder Mode**: Initial state when no prompt or document ID is provided
512
+ 2. **Upload Waiting Mode**: When files are uploaded but waiting for a prompt
513
+ 3. **Generating Mode**: During the image generation process
514
+ 4. **Display Mode**: When showing a generated image with controls
515
+ 5. **Error Mode**: When an error occurs during generation
516
+
517
+ ## Advanced Usage Examples
518
+
519
+ ### Debug Mode
520
+
521
+ Enable debug mode to see detailed console logs about component state:
522
+
523
+ ```jsx
524
+ <ImgGen prompt="Debug this" options={{ debug: true }} />
525
+ ```
526
+
527
+ ### Custom Image Sizing
528
+
529
+ Control output image dimensions with the size option:
530
+
531
+ ```jsx
532
+ <ImgGen
533
+ prompt="Landscape format"
534
+ options={{ size: '1536x1024' }} // Landscape
535
+ />
536
+
537
+ <ImgGen
538
+ prompt="Portrait format"
539
+ options={{ size: '1024x1536' }} // Portrait
540
+ />
541
+ ```
38
542
 
39
- `use-vibes` also provides React hooks and components used by vibes at runtime:
543
+ ### Browser Compatibility
40
544
 
41
- - **useFireproof** enhanced hook with sync capabilities
42
- - **callAI** — streaming AI API client
43
- - **ImgGen** — image generation components
545
+ This library is compatible with all modern browsers that support React 18+ and ES6 features.
44
546
 
45
- ## Links
547
+ ## License
46
548
 
47
- - [vibes.diy](https://vibes.diy) — build and share vibes in the browser
48
- - [GitHub](https://github.com/nicefacer/vibes.diy) — source code
49
- - [npm](https://www.npmjs.com/package/use-vibes) — npm package
549
+ MIT+Apache
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "use-vibes",
3
- "version": "0.19.33-dev-cli",
3
+ "version": "0.20.1-dev-push",
4
4
  "type": "module",
5
5
  "description": "Transform any DOM element into an AI-powered micro-app",
6
- "bin": {
7
- "use-vibes": "./bin.js"
8
- },
9
6
  "keywords": [
10
7
  "ai",
11
8
  "dom",
@@ -20,26 +17,24 @@
20
17
  "Meno Abels"
21
18
  ],
22
19
  "license": "Apache-2.0",
20
+ "bin": {
21
+ "use-vibes": "./node_modules/@vibes.diy/use-vibes-cli/run.js"
22
+ },
23
23
  "dependencies": {
24
- "@adviser/cement": "~0.5.32",
25
- "@fireproof/core": "~0.24.12",
26
- "@fireproof/core-keybag": "~0.24.12",
27
- "@fireproof/core-runtime": "~0.24.12",
28
- "@fireproof/core-types-base": "~0.24.12",
29
- "@fireproof/core-types-protocols-cloud": "~0.24.12",
30
- "@fireproof/use-fireproof": "~0.24.12",
31
- "@vibes.diy/prompts": "^0.19.33-dev-cli",
32
- "@vibes.diy/use-vibes-base": "^0.19.33-dev-cli",
33
- "cmd-ts": "~0.15.0",
34
- "find-up": "~8.0.0"
24
+ "@fireproof/core": "~0.24.13",
25
+ "@fireproof/core-keybag": "~0.24.13",
26
+ "@fireproof/core-runtime": "~0.24.13",
27
+ "@fireproof/core-types-base": "~0.24.13",
28
+ "@fireproof/core-types-protocols-cloud": "~0.24.13",
29
+ "@fireproof/use-fireproof": "~0.24.13",
30
+ "@vibes.diy/use-vibes-base": "^0.20.1-dev-push",
31
+ "@vibes.diy/use-vibes-cli": "^0.20.1-dev-push"
35
32
  },
36
33
  "peerDependencies": {
37
34
  "react": ">=19.1.0"
38
35
  },
39
36
  "scripts": {
40
37
  "build": "core-cli tsc",
41
- "test": "vitest run",
42
- "test:cli": "pnpm --dir ../tests run test:cli",
43
- "check:cli": "pnpm exec eslint ./dispatcher.ts ./cli/ ./commands/ ../tests/cli/"
38
+ "test": "vitest run"
44
39
  }
45
40
  }
package/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/bin.js DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import process from "node:process";
3
- import { defaultCliOutput } from "./commands/cli-output-node.js";
4
- import { dispatch } from "./dispatcher.js";
5
- await dispatch(process.argv.slice(2), {
6
- cwd: process.cwd(),
7
- output: defaultCliOutput,
8
- setExitCode(code) {
9
- process.exitCode = code;
10
- },
11
- });
12
- //# sourceMappingURL=bin.js.map
package/bin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../jsr/bin.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACpC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAClB,MAAM,EAAE,gBAAgB;IACxB,WAAW,CAAC,IAAY,EAAQ;QAC9B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAAA,CACzB;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { CommandExecutable } from "../executable.js";
2
- export declare const infoExec: CommandExecutable;
package/cli/exec/info.js DELETED
@@ -1,16 +0,0 @@
1
- import { runInfo } from "../../commands/info.js";
2
- import { resultToExitCode } from "./result-to-exit-code.js";
3
- export const infoExec = {
4
- name: "info",
5
- description: "Show project info from vibes.json",
6
- async run(argv, runtime) {
7
- if (argv.length > 1) {
8
- runtime.output.stderr("info accepts at most one argument (target)\n");
9
- return 1;
10
- }
11
- const target = argv[0];
12
- const result = await runInfo({ target }, runtime);
13
- return resultToExitCode(runtime, result);
14
- },
15
- };
16
- //# sourceMappingURL=info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"info.js","sourceRoot":"","sources":["../../../jsr/cli/exec/info.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,MAAM,QAAQ,GAAsB;IACzC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,mCAAmC;IAChD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE;QACvB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAC;YACtE,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAAA,CAC1C;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Result } from "@adviser/cement";
2
- import type { CliRuntime } from "../executable.js";
3
- export declare function resultToExitCode(runtime: CliRuntime, result: Result<unknown>): number;
@@ -1,8 +0,0 @@
1
- export function resultToExitCode(runtime, result) {
2
- if (result.isErr()) {
3
- runtime.output.stderr(String(result.Err()) + "\n");
4
- return 1;
5
- }
6
- return 0;
7
- }
8
- //# sourceMappingURL=result-to-exit-code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result-to-exit-code.js","sourceRoot":"","sources":["../../../jsr/cli/exec/result-to-exit-code.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,gBAAgB,CAAC,OAAmB,EAAE,MAAuB,EAAU;IACrF,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACnD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,CAAC;AAAA,CACV"}
@@ -1,2 +0,0 @@
1
- import type { CommandExecutable } from "../executable.js";
2
- export declare const skillsExec: CommandExecutable;
@@ -1,11 +0,0 @@
1
- import { runSkills } from "../../commands/skills.js";
2
- import { resultToExitCode } from "./result-to-exit-code.js";
3
- export const skillsExec = {
4
- name: "skills",
5
- description: "List available skill libraries",
6
- async run(_argv, runtime) {
7
- const result = await runSkills(runtime);
8
- return resultToExitCode(runtime, result);
9
- },
10
- };
11
- //# sourceMappingURL=skills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../jsr/cli/exec/skills.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,gCAAgC;IAC7C,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAAA,CAC1C;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { CommandExecutable } from "../executable.js";
2
- export declare const systemExec: CommandExecutable;
@@ -1,20 +0,0 @@
1
- import { runSystem } from "../../commands/system.js";
2
- import { resultToExitCode } from "./result-to-exit-code.js";
3
- function parseArgs(argv) {
4
- for (let i = 0; i < argv.length; i++) {
5
- if (argv[i] === "--skills" && i + 1 < argv.length) {
6
- return { skillsCsv: argv[i + 1] };
7
- }
8
- }
9
- return {};
10
- }
11
- export const systemExec = {
12
- name: "system",
13
- description: "Output assembled system prompt",
14
- async run(argv, runtime) {
15
- const args = parseArgs(argv);
16
- const result = await runSystem(args, runtime);
17
- return resultToExitCode(runtime, result);
18
- },
19
- };
20
- //# sourceMappingURL=system.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../../jsr/cli/exec/system.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,SAAS,SAAS,CAAC,IAAc,EAA0B;IACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAClD,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AAAA,CACX;AAED,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,gCAAgC;IAC7C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE;QACvB,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAAA,CAC1C;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { CommandExecutable } from "../executable.js";
2
- export declare const whoamiExec: CommandExecutable;
@@ -1,11 +0,0 @@
1
- import { runWhoami } from "../../commands/whoami.js";
2
- import { resultToExitCode } from "./result-to-exit-code.js";
3
- export const whoamiExec = {
4
- name: "whoami",
5
- description: "Print logged-in user",
6
- async run(_argv, runtime) {
7
- const result = await runWhoami(runtime);
8
- return resultToExitCode(runtime, result);
9
- },
10
- };
11
- //# sourceMappingURL=whoami.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../jsr/cli/exec/whoami.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sBAAsB;IACnC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAAA,CAC1C;CACF,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { CliOutput } from "../commands/cli-output-node.js";
2
- export interface CliRuntime {
3
- readonly cwd: string;
4
- readonly output: CliOutput;
5
- readonly setExitCode: (code: number) => void;
6
- }
7
- export interface CommandExecutable {
8
- readonly name: string;
9
- readonly description: string;
10
- run(argv: string[], runtime: CliRuntime): Promise<number>;
11
- }
package/cli/executable.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=executable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executable.js","sourceRoot":"","sources":["../../jsr/cli/executable.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export interface CliOutput {
2
- readonly stdout: (text: string) => void;
3
- readonly stderr: (text: string) => void;
4
- }
5
- export declare const defaultCliOutput: CliOutput;
@@ -1,6 +0,0 @@
1
- import process from "node:process";
2
- export const defaultCliOutput = {
3
- stdout: (text) => process.stdout.write(text),
4
- stderr: (text) => process.stderr.write(text),
5
- };
6
- //# sourceMappingURL=cli-output-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-output-node.js","sourceRoot":"","sources":["../../jsr/commands/cli-output-node.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAOnC,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;CAC7C,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- export interface VibesConfig {
3
- readonly app: string;
4
- readonly targets?: Record<string, {
5
- fs?: {
6
- id: string;
7
- ts: string;
8
- }[];
9
- }>;
10
- }
11
- export interface FoundConfig {
12
- readonly path: string;
13
- readonly config: VibesConfig;
14
- }
15
- export declare function findVibesJson(startDir: string): Promise<Result<FoundConfig>>;
@@ -1,26 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { Result, pathOps } from "@adviser/cement";
3
- import { findUp } from "find-up";
4
- export async function findVibesJson(startDir) {
5
- const configPath = await findUp("vibes.json", { cwd: startDir });
6
- if (!configPath) {
7
- return Result.Err(`No vibes.json found (starting at ${pathOps.join(startDir, "vibes.json")})`);
8
- }
9
- try {
10
- const raw = await readFile(configPath, "utf-8");
11
- const parsed = JSON.parse(raw);
12
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
13
- return Result.Err(`Invalid vibes.json at ${configPath}: expected an object`);
14
- }
15
- const obj = parsed;
16
- if (typeof obj.app !== "string" || obj.app === "") {
17
- return Result.Err(`Invalid vibes.json at ${configPath}: "app" must be a non-empty string`);
18
- }
19
- return Result.Ok({ path: configPath, config: obj });
20
- }
21
- catch (err) {
22
- const message = err instanceof Error ? err.message : String(err);
23
- return Result.Err(`Error reading ${configPath}: ${message}`);
24
- }
25
- }
26
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../jsr/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAYjC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAgC;IAClF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,GAAG,CAAC,oCAAoC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3E,OAAO,MAAM,CAAC,GAAG,CAAC,yBAAyB,UAAU,sBAAsB,CAAC,CAAC;QAC/E,CAAC;QACD,MAAM,GAAG,GAAG,MAAiC,CAAC;QAC9C,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;YAClD,OAAO,MAAM,CAAC,GAAG,CAAC,yBAAyB,UAAU,oCAAoC,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,GAA6B,EAAE,CAAC,CAAC;IAChF,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,MAAM,CAAC,GAAG,CAAC,iBAAiB,UAAU,KAAK,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AAAA,CACF"}
@@ -1,6 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import type { CliRuntime } from "../cli/executable.js";
3
- export interface RunInfoOptions {
4
- readonly target?: string;
5
- }
6
- export declare function runInfo(opts: RunInfoOptions, runtime: CliRuntime): Promise<Result<void>>;
package/commands/info.js DELETED
@@ -1,25 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import { findVibesJson } from "./config.js";
3
- import { resolveTarget } from "./resolve-target.js";
4
- export async function runInfo(opts, runtime) {
5
- const { output } = runtime;
6
- const startDir = runtime.cwd;
7
- const found = await findVibesJson(startDir);
8
- if (found.isErr())
9
- return Result.Err(found);
10
- const { path, config } = found.Ok();
11
- output.stdout(`vibes.json: ${path}\n`);
12
- output.stdout(`app: ${config.app}\n`);
13
- const slashCount = opts.target ? opts.target.split("/").length - 1 : 0;
14
- if (opts.target && slashCount === 2) {
15
- const resolved = resolveTarget({ app: config.app, handle: "" }, opts.target);
16
- if (resolved.isErr())
17
- return Result.Err(resolved);
18
- output.stdout(`target: ${resolved.Ok().full}\n`);
19
- }
20
- else if (opts.target) {
21
- output.stdout(`target: (requires login to resolve "${opts.target}")\n`);
22
- }
23
- return Result.Ok(undefined);
24
- }
25
- //# sourceMappingURL=info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"info.js","sourceRoot":"","sources":["../../jsr/commands/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAoB,EAAE,OAAmB,EAAyB;IAC9F,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,KAAK,CAAC,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,CAAC,eAAe,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAI7C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,IAAI,IAAI,CAAC,MAAM,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,aAAa,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7E,IAAI,QAAQ,CAAC,KAAK,EAAE;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,eAAe,QAAQ,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;IACvD,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,MAAM,CAAC,2CAA2C,IAAI,CAAC,MAAM,MAAM,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAAA,CAC7B"}
@@ -1,12 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- export interface ResolvedTarget {
3
- readonly handle: string;
4
- readonly app: string;
5
- readonly group: string;
6
- readonly full: string;
7
- }
8
- export interface ResolveTargetContext {
9
- readonly app: string;
10
- readonly handle: string;
11
- }
12
- export declare function resolveTarget(ctx: ResolveTargetContext, input?: string): Result<ResolvedTarget>;
@@ -1,43 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- export function resolveTarget(ctx, input) {
3
- const { app, handle } = ctx;
4
- if (input === undefined) {
5
- return Result.Ok({ handle, app, group: "default", full: `${handle}/${app}/default` });
6
- }
7
- if (input === "") {
8
- return Result.Err("Target must not be empty");
9
- }
10
- if (input.startsWith("/") || input.endsWith("/")) {
11
- return Result.Err(`Invalid target "${input}": must not start or end with /`);
12
- }
13
- const slashes = input.split("/").length - 1;
14
- if (slashes === 0) {
15
- return Result.Ok({ handle, app, group: input, full: `${handle}/${app}/${input}` });
16
- }
17
- if (slashes === 1) {
18
- const [targetApp, targetGroup] = input.split("/");
19
- if (!targetApp || !targetGroup) {
20
- return Result.Err(`Invalid target "${input}": app and group must both be non-empty`);
21
- }
22
- return Result.Ok({
23
- handle,
24
- app: targetApp,
25
- group: targetGroup,
26
- full: `${handle}/${targetApp}/${targetGroup}`,
27
- });
28
- }
29
- if (slashes === 2) {
30
- const [targetHandle, targetApp, targetGroup] = input.split("/");
31
- if (!targetHandle || !targetApp || !targetGroup) {
32
- return Result.Err(`Invalid target "${input}": handle, app, and group must all be non-empty`);
33
- }
34
- return Result.Ok({
35
- handle: targetHandle,
36
- app: targetApp,
37
- group: targetGroup,
38
- full: input,
39
- });
40
- }
41
- return Result.Err(`Invalid target "${input}": expected "group", "app/group", or "handle/app/group"`);
42
- }
43
- //# sourceMappingURL=resolve-target.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-target.js","sourceRoot":"","sources":["../../jsr/commands/resolve-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAczC,MAAM,UAAU,aAAa,CAAC,GAAyB,EAAE,KAAc,EAA0B;IAC/F,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAE5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,OAAO,MAAM,CAAC,GAAG,CAAC,mBAAmB,KAAK,iCAAiC,CA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CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,mBAAmB,KAAK,yDAAyD,CAAC,CAAC;AAAA,CACtG"}
@@ -1,3 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import type { CliRuntime } from "../cli/executable.js";
3
- export declare function runSkills(runtime: CliRuntime): Promise<Result<void>>;
@@ -1,14 +0,0 @@
1
- import { Result, exception2Result } from "@adviser/cement";
2
- import { getLlmCatalog } from "@vibes.diy/prompts";
3
- export async function runSkills(runtime) {
4
- const { output } = runtime;
5
- const rCatalog = await exception2Result(() => getLlmCatalog());
6
- if (rCatalog.isErr()) {
7
- return Result.Err(`Failed to load skills catalog: ${rCatalog.Err().message}`);
8
- }
9
- for (const skill of rCatalog.Ok()) {
10
- output.stdout(`${skill.name.padEnd(12)}${skill.description}\n`);
11
- }
12
- return Result.Ok(undefined);
13
- }
14
- //# sourceMappingURL=skills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../jsr/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAmB,EAAyB;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IAC/D,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,kCAAkC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAAA,CAC7B"}
@@ -1,6 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import type { CliRuntime } from "../cli/executable.js";
3
- export interface RunSystemOptions {
4
- readonly skillsCsv?: string;
5
- }
6
- export declare function runSystem(options: RunSystemOptions, runtime: CliRuntime): Promise<Result<void>>;
@@ -1,70 +0,0 @@
1
- import { Result, exception2Result } from "@adviser/cement";
2
- import { makeBaseSystemPrompt, getDefaultDependencies, getLlmCatalogNames } from "@vibes.diy/prompts";
3
- function parseSkillsCsv(options) {
4
- const skillsCsv = options.skillsCsv;
5
- if (typeof skillsCsv === "undefined") {
6
- return Result.Ok([]);
7
- }
8
- if (skillsCsv.trim().length === 0) {
9
- return Result.Err("--skills requires a value (e.g., --skills fireproof,d3)");
10
- }
11
- const parsedSkills = skillsCsv
12
- .split(",")
13
- .map((skillName) => skillName.trim())
14
- .filter((skillName) => skillName.length > 0);
15
- switch (true) {
16
- case parsedSkills.length === 0:
17
- return Result.Err("--skills requires a value (e.g., --skills fireproof,d3)");
18
- default:
19
- return Result.Ok(parsedSkills);
20
- }
21
- }
22
- async function resolveSkills(parsedSkills) {
23
- switch (true) {
24
- case parsedSkills.length > 0:
25
- return Result.Ok(parsedSkills);
26
- default: {
27
- const rDefaults = await exception2Result(() => getDefaultDependencies());
28
- if (rDefaults.isErr()) {
29
- return Result.Err(`Failed to load default skills: ${rDefaults.Err().message}`);
30
- }
31
- return Result.Ok(rDefaults.Ok());
32
- }
33
- }
34
- }
35
- export async function runSystem(options, runtime) {
36
- const { output } = runtime;
37
- const rParsedSkills = parseSkillsCsv(options);
38
- if (rParsedSkills.isErr()) {
39
- return Result.Err(rParsedSkills);
40
- }
41
- const rSelectedSkills = await resolveSkills(rParsedSkills.Ok());
42
- if (rSelectedSkills.isErr()) {
43
- return Result.Err(rSelectedSkills);
44
- }
45
- const selectedSkills = rSelectedSkills.Ok();
46
- const rValidNames = await exception2Result(() => getLlmCatalogNames());
47
- if (rValidNames.isErr()) {
48
- return Result.Err(`Failed to load skill catalog names: ${rValidNames.Err().message}`);
49
- }
50
- const validNames = rValidNames.Ok();
51
- const invalid = selectedSkills.filter((skillName) => !validNames.has(skillName));
52
- if (invalid.length > 0) {
53
- return Result.Err(`Unknown skills: ${invalid.join(", ")}\nRun: use-vibes skills`);
54
- }
55
- const rPrompt = await exception2Result(() => makeBaseSystemPrompt("cli", {
56
- dependenciesUserOverride: true,
57
- dependencies: selectedSkills,
58
- callAi: {
59
- ModuleAndOptionsSelection(_msgs) {
60
- return Promise.resolve(Result.Err("ModuleAndOptionsSelection is not used by CLI"));
61
- },
62
- },
63
- }));
64
- if (rPrompt.isErr()) {
65
- return Result.Err(`Failed to build system prompt: ${rPrompt.Err().message}`);
66
- }
67
- output.stdout(rPrompt.Ok().systemPrompt);
68
- return Result.Ok(undefined);
69
- }
70
- //# sourceMappingURL=system.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"system.js","sourceRoot":"","sources":["../../jsr/commands/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAOtG,SAAS,cAAc,CAAC,OAAyB,EAAoB;IACnE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,GAAG,CAAC,yDAAyD,CAAC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IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,GAAG,CAAC,kCAAkC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAAA,CAC7B"}
@@ -1,3 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import type { CliRuntime } from "../cli/executable.js";
3
- export declare function runWhoami(_runtime: CliRuntime): Promise<Result<void>>;
@@ -1,5 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- export function runWhoami(_runtime) {
3
- return Promise.resolve(Result.Err("Not logged in. Run: use-vibes login"));
4
- }
5
- //# sourceMappingURL=whoami.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../jsr/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,MAAM,UAAU,SAAS,CAAC,QAAoB,EAAyB;IACrE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;AAAA,CAC3E"}
package/dispatcher.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { CliRuntime } from "./cli/executable.js";
2
- export type { CliRuntime } from "./cli/executable.js";
3
- export declare function dispatch(cliArgs: readonly string[], runtime: CliRuntime): Promise<void>;
package/dispatcher.js DELETED
@@ -1,34 +0,0 @@
1
- import { whoamiExec } from "./cli/exec/whoami.js";
2
- import { skillsExec } from "./cli/exec/skills.js";
3
- import { systemExec } from "./cli/exec/system.js";
4
- import { infoExec } from "./cli/exec/info.js";
5
- const commands = [
6
- whoamiExec,
7
- skillsExec,
8
- systemExec,
9
- infoExec,
10
- ];
11
- function printHelp(output) {
12
- output.stdout("use-vibes — Build and deploy React + Fireproof apps\n\n");
13
- output.stdout("Commands:\n");
14
- for (const cmd of commands) {
15
- output.stdout(` ${cmd.name.padEnd(18)}${cmd.description}\n`);
16
- }
17
- output.stdout("\nRun: use-vibes <command> --help\n");
18
- }
19
- export async function dispatch(cliArgs, runtime) {
20
- if (cliArgs.length === 0 || cliArgs[0] === "help" || cliArgs[0] === "-h" || cliArgs[0] === "--help") {
21
- printHelp(runtime.output);
22
- return;
23
- }
24
- const token = cliArgs[0];
25
- const exec = commands.find((c) => c.name === token);
26
- if (!exec) {
27
- runtime.output.stderr(`Unknown command: ${token}\n`);
28
- runtime.setExitCode(1);
29
- return;
30
- }
31
- const code = await exec.run([...cliArgs.slice(1)], runtime);
32
- runtime.setExitCode(code);
33
- }
34
- //# sourceMappingURL=dispatcher.js.map
package/dispatcher.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../jsr/dispatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,MAAM,QAAQ,GAAiC;IAC7C,UAAU;IACV,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,SAAS,SAAS,CAAC,MAA4B,EAAQ;IACrD,MAAM,CAAC,MAAM,CAAC,2DAAyD,CAAC,CAAC;IACzE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,WAAW,IAAI,CAAC,CAAC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