@liquidmetal-ai/raindrop 0.9.0 → 0.9.1

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 (129) hide show
  1. package/README.md +85 -134
  2. package/bundle/chunk-2NAMGQLL.js +805 -0
  3. package/bundle/chunk-4C3ZVVH7.js +502 -0
  4. package/bundle/chunk-4RVUC2XX.js +4539 -0
  5. package/bundle/chunk-5QVCT2XX.js +380 -0
  6. package/bundle/chunk-67CBWZ7Y.js +380 -0
  7. package/bundle/chunk-7ERI6IFL.js +22452 -0
  8. package/bundle/chunk-CZCDV5DC.js +147 -0
  9. package/bundle/chunk-D5TOYPUE.js +12148 -0
  10. package/bundle/chunk-DIDBQB37.js +12148 -0
  11. package/bundle/chunk-DV2VD4JX.js +44 -0
  12. package/bundle/chunk-FQ3UM2WC.js +4480 -0
  13. package/bundle/chunk-FTG32FZ4.js +44 -0
  14. package/bundle/chunk-GCLJVMUS.js +4539 -0
  15. package/bundle/chunk-GDYEPR67.js +75 -0
  16. package/bundle/chunk-HBDFBL3W.js +133 -0
  17. package/bundle/chunk-IMQTVYRB.js +502 -0
  18. package/bundle/chunk-IXNEFD7W.js +133 -0
  19. package/bundle/chunk-JDMAG4KE.js +147 -0
  20. package/bundle/chunk-JXNZYHAI.js +238750 -0
  21. package/bundle/chunk-OMXHWEID.js +75 -0
  22. package/bundle/chunk-ORPX7FPP.js +4484 -0
  23. package/bundle/chunk-QKHN66ZN.js +805 -0
  24. package/bundle/chunk-SP4Q3T7T.js +48 -0
  25. package/bundle/chunk-UA3E47QH.js +231 -0
  26. package/bundle/chunk-UL64FJVV.js +22452 -0
  27. package/bundle/chunk-VEVVJAL6.js +238722 -0
  28. package/bundle/chunk-Z2AQLL53.js +292 -0
  29. package/bundle/chunk-ZHLA64FP.js +48 -0
  30. package/bundle/chunk-ZHYJWVIA.js +292 -0
  31. package/bundle/chunk-ZLRYUJ5P.js +231 -0
  32. package/bundle/commands/annotation/get.js +3 -3
  33. package/bundle/commands/annotation/list.js +3 -3
  34. package/bundle/commands/annotation/put.js +3 -3
  35. package/bundle/commands/auth/list.js +2 -2
  36. package/bundle/commands/auth/login.js +3 -3
  37. package/bundle/commands/auth/logout.js +2 -2
  38. package/bundle/commands/auth/select.js +3 -3
  39. package/bundle/commands/bucket/create-credential.js +2 -2
  40. package/bundle/commands/bucket/delete-credential.js +2 -2
  41. package/bundle/commands/bucket/get-credential.js +2 -2
  42. package/bundle/commands/bucket/list-credentials.js +2 -2
  43. package/bundle/commands/build/branch.js +9 -9
  44. package/bundle/commands/build/checkout.js +5 -5
  45. package/bundle/commands/build/clone.js +5 -5
  46. package/bundle/commands/build/delete.js +5 -5
  47. package/bundle/commands/build/deploy.js +9 -9
  48. package/bundle/commands/build/env/get.js +2 -2
  49. package/bundle/commands/build/env/set.js +2 -2
  50. package/bundle/commands/build/find.js +3 -3
  51. package/bundle/commands/build/generate.js +3 -3
  52. package/bundle/commands/build/init.js +3 -3
  53. package/bundle/commands/build/list.js +4 -4
  54. package/bundle/commands/build/sandbox.js +7 -7
  55. package/bundle/commands/build/start.js +2 -2
  56. package/bundle/commands/build/status.js +4 -4
  57. package/bundle/commands/build/stop.js +2 -2
  58. package/bundle/commands/build/tools/check.js +2 -2
  59. package/bundle/commands/build/tools/fmt.js +2 -2
  60. package/bundle/commands/build/unsandbox.js +7 -7
  61. package/bundle/commands/build/upload.js +5 -5
  62. package/bundle/commands/build/validate.js +4 -4
  63. package/bundle/commands/build/workos/delete.js +4 -4
  64. package/bundle/commands/build/workos/env/attach.js +3 -3
  65. package/bundle/commands/build/workos/env/create.js +3 -3
  66. package/bundle/commands/build/workos/env/delete.js +3 -3
  67. package/bundle/commands/build/workos/env/detach.js +3 -3
  68. package/bundle/commands/build/workos/env/get.js +3 -3
  69. package/bundle/commands/build/workos/env/list.js +3 -3
  70. package/bundle/commands/build/workos/env/set.js +3 -3
  71. package/bundle/commands/build/workos/invite.js +3 -3
  72. package/bundle/commands/build/workos/setup.js +3 -3
  73. package/bundle/commands/build/workos/status.js +3 -3
  74. package/bundle/commands/dns/create.js +2 -2
  75. package/bundle/commands/dns/delete.js +4 -4
  76. package/bundle/commands/dns/get.js +4 -4
  77. package/bundle/commands/dns/list.js +3 -3
  78. package/bundle/commands/dns/records/create.js +2 -2
  79. package/bundle/commands/dns/records/delete.js +3 -3
  80. package/bundle/commands/dns/records/get.js +2 -2
  81. package/bundle/commands/dns/records/list.js +2 -2
  82. package/bundle/commands/dns/records/update.js +2 -2
  83. package/bundle/commands/logs/query.js +3 -3
  84. package/bundle/commands/logs/tail.js +3 -3
  85. package/bundle/commands/mcp/install-claude.js +2 -2
  86. package/bundle/commands/mcp/install-gemini.js +2 -2
  87. package/bundle/commands/mcp/install-goose.js +2 -2
  88. package/bundle/commands/mcp/status.js +2 -2
  89. package/bundle/commands/object/delete.js +2 -2
  90. package/bundle/commands/object/get.js +2 -2
  91. package/bundle/commands/object/list.js +2 -2
  92. package/bundle/commands/object/put.js +2 -2
  93. package/bundle/commands/query/chunk-search.js +3 -3
  94. package/bundle/commands/query/document.js +3 -3
  95. package/bundle/commands/query/events.js +2 -2
  96. package/bundle/commands/query/reindex.js +2 -2
  97. package/bundle/commands/query/search.js +3 -3
  98. package/bundle/commands/tail.js +2 -2
  99. package/bundle/index.js +1 -1
  100. package/dist/base-command.d.ts +4 -4
  101. package/dist/base-command.d.ts.map +1 -1
  102. package/dist/base-command.js +2 -2
  103. package/dist/commands/{build/package-template.d.ts → killswitch.d.ts} +7 -15
  104. package/dist/commands/killswitch.d.ts.map +1 -0
  105. package/dist/commands/killswitch.js +58 -0
  106. package/dist/index.d.ts +5 -5
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +5 -5
  109. package/dist/utils/mixpanel.d.ts +10 -0
  110. package/dist/utils/mixpanel.d.ts.map +1 -0
  111. package/dist/utils/mixpanel.js +43 -0
  112. package/oclif.manifest.json +1920 -2187
  113. package/package.json +3 -3
  114. package/templates/db/node_modules/.bin/prisma +2 -2
  115. package/templates/db/node_modules/.bin/prisma-kysely +2 -2
  116. package/templates/db/node_modules/.bin/tsc +2 -2
  117. package/templates/db/node_modules/.bin/tsserver +2 -2
  118. package/templates/db/node_modules/.bin/zx +2 -2
  119. package/bundle/chunk-6CDCK5IP.js +0 -58
  120. package/bundle/commands/build/list-templates.js +0 -63
  121. package/bundle/commands/build/package-template.js +0 -238
  122. package/dist/commands/build/list-templates.d.ts +0 -11
  123. package/dist/commands/build/list-templates.d.ts.map +0 -1
  124. package/dist/commands/build/list-templates.js +0 -47
  125. package/dist/commands/build/package-template.d.ts.map +0 -1
  126. package/dist/commands/build/package-template.js +0 -256
  127. package/dist/templates/registry.d.ts +0 -38
  128. package/dist/templates/registry.d.ts.map +0 -1
  129. package/dist/templates/registry.js +0 -72
@@ -1,256 +0,0 @@
1
- import { Args } from '@oclif/core';
2
- import * as fs from 'node:fs/promises';
3
- import * as path from 'node:path';
4
- import { BaseCommand } from '../../base-command.js';
5
- import os from 'node:os';
6
- export default class PackageTemplate extends BaseCommand {
7
- static args = {
8
- 'app-name': Args.string({ description: 'Name for the template application (kebab-case)', required: true }),
9
- description: Args.string({ description: 'Description of the template', required: true }),
10
- path: Args.string({ description: 'Destination path for the template', required: true }),
11
- };
12
- static description = 'Package the current raindrop project as a template';
13
- static examples = [
14
- '<%= config.bin %> <%= command.id %> my-app "A sample application" ./templates',
15
- ];
16
- static flags = {
17
- ...BaseCommand.HIDDEN_FLAGS,
18
- };
19
- async run() {
20
- const { 'app-name': appName, description, path: destPath } = this.args;
21
- // Validate app-name is kebab-case
22
- if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(appName)) {
23
- this.error('App name must be in kebab-case format (e.g., my-app-name)', { exit: 1 });
24
- }
25
- // Get the current working directory (project root)
26
- const projectRoot = process.cwd();
27
- // Construct destination directory
28
- const destDir = path.resolve(destPath, appName);
29
- // Check if destination exists and warn user
30
- try {
31
- await fs.access(destDir);
32
- this.warn(`Directory ${destDir} already exists. It will be overwritten.`);
33
- }
34
- catch {
35
- // Directory doesn't exist, which is fine
36
- }
37
- // Create destination directory
38
- await fs.mkdir(destDir, { recursive: true });
39
- this.log(`Packaging template from ${projectRoot} to ${destDir}...`);
40
- // Copy project files with exclusions
41
- await this.copyProjectFiles(projectRoot, destDir);
42
- // Update package.json
43
- await this.updatePackageJson(destDir, appName);
44
- // Update raindrop.manifest
45
- await this.updateManifest(destDir, appName);
46
- // Copy ~/.raindrop/ docs
47
- await this.copyRaindropDocs(destDir);
48
- // Remove .git directory
49
- await this.removeGitInfo(destDir);
50
- // Create docs/README.md
51
- await this.createDocsReadme(destDir, appName, description);
52
- // Create .gitignore
53
- await this.createGitignore(destDir);
54
- this.log(`\nTemplate packaged successfully at ${destDir}`);
55
- }
56
- async copyProjectFiles(source, dest) {
57
- const excludeDirs = ['node_modules', 'dist', 'build', '.git'];
58
- const excludeFiles = ['.env', '.env.local', '.env.production', 'secrets.json'];
59
- const copyRecursive = async (src, dst) => {
60
- const entries = await fs.readdir(src, { withFileTypes: true });
61
- for (const entry of entries) {
62
- const srcPath = path.join(src, entry.name);
63
- const dstPath = path.join(dst, entry.name);
64
- if (entry.isDirectory()) {
65
- if (excludeDirs.includes(entry.name)) {
66
- continue;
67
- }
68
- await fs.mkdir(dstPath, { recursive: true });
69
- await copyRecursive(srcPath, dstPath);
70
- }
71
- else {
72
- if (excludeFiles.includes(entry.name)) {
73
- continue;
74
- }
75
- await fs.copyFile(srcPath, dstPath);
76
- }
77
- }
78
- };
79
- await copyRecursive(source, dest);
80
- }
81
- async updatePackageJson(destDir, appName) {
82
- const packageJsonPath = path.join(destDir, 'package.json');
83
- try {
84
- const content = await fs.readFile(packageJsonPath, 'utf-8');
85
- const packageJson = JSON.parse(content);
86
- packageJson.name = appName;
87
- await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
88
- this.log(`Updated package.json with name: ${appName}`);
89
- }
90
- catch (_error) {
91
- this.warn(`Could not update package.json: ${_error}`);
92
- }
93
- }
94
- async updateManifest(destDir, appName) {
95
- const manifestPath = path.join(destDir, 'raindrop.manifest');
96
- try {
97
- const content = await fs.readFile(manifestPath, 'utf-8');
98
- // Replace the application name in HCL format
99
- const updated = content.replace(/^application\s+"[^"]+"\s*{/m, `application "${appName}" {`);
100
- await fs.writeFile(manifestPath, updated, 'utf-8');
101
- this.log(`Updated raindrop.manifest with application: ${appName}`);
102
- }
103
- catch (_error) {
104
- this.warn(`Could not update raindrop.manifest: ${_error}`);
105
- }
106
- }
107
- async copyRaindropDocs(destDir) {
108
- const raindropDir = path.join(os.homedir(), '.raindrop');
109
- const indexPath = path.join(raindropDir, 'index.json');
110
- try {
111
- // Read the current project's raindrop.manifest to get the application name
112
- const manifestPath = path.join(process.cwd(), 'raindrop.manifest');
113
- const manifestContent = await fs.readFile(manifestPath, 'utf-8');
114
- const appNameMatch = manifestContent.match(/^application\s+"([^"]+)"\s*{/m);
115
- if (!appNameMatch) {
116
- this.warn('Could not parse application name from raindrop.manifest');
117
- await fs.mkdir(path.join(destDir, 'docs'), { recursive: true });
118
- return;
119
- }
120
- const currentAppName = appNameMatch[1];
121
- // Read index.json to find the session for this application
122
- const indexContent = await fs.readFile(indexPath, 'utf-8');
123
- const index = JSON.parse(indexContent);
124
- // Find the application and get its latest_session_id
125
- let sessionId = null;
126
- if (index.applications && index.applications[currentAppName]) {
127
- sessionId = index.applications[currentAppName].latest_session_id;
128
- }
129
- if (!sessionId) {
130
- this.warn(`Could not find raindrop session for application: ${currentAppName}`);
131
- await fs.mkdir(path.join(destDir, 'docs'), { recursive: true });
132
- return;
133
- }
134
- // The docs are stored in ~/.raindrop/<session_id>/
135
- const appDocsDir = path.join(raindropDir, sessionId);
136
- // Verify the directory exists
137
- try {
138
- await fs.access(appDocsDir);
139
- }
140
- catch {
141
- this.warn(`Raindrop docs directory not found: ${appDocsDir}`);
142
- await fs.mkdir(path.join(destDir, 'docs'), { recursive: true });
143
- return;
144
- }
145
- const destDocsDir = path.join(destDir, 'docs');
146
- await fs.mkdir(destDocsDir, { recursive: true });
147
- // Copy all files from the application docs directory
148
- const entries = await fs.readdir(appDocsDir, { withFileTypes: true });
149
- for (const entry of entries) {
150
- const srcPath = path.join(appDocsDir, entry.name);
151
- const dstPath = path.join(destDocsDir, entry.name);
152
- if (entry.isDirectory()) {
153
- await fs.mkdir(dstPath, { recursive: true });
154
- // Simple recursive copy for subdirectories
155
- const copyDir = async (src, dst) => {
156
- const subEntries = await fs.readdir(src, { withFileTypes: true });
157
- for (const subEntry of subEntries) {
158
- const subSrc = path.join(src, subEntry.name);
159
- const subDst = path.join(dst, subEntry.name);
160
- if (subEntry.isDirectory()) {
161
- await fs.mkdir(subDst, { recursive: true });
162
- await copyDir(subSrc, subDst);
163
- }
164
- else {
165
- await fs.copyFile(subSrc, subDst);
166
- }
167
- }
168
- };
169
- await copyDir(srcPath, dstPath);
170
- }
171
- else {
172
- await fs.copyFile(srcPath, dstPath);
173
- }
174
- }
175
- this.log(`Copied raindrop docs from ${appDocsDir}`);
176
- }
177
- catch (_error) {
178
- this.warn(`Could not copy raindrop docs: ${_error}`);
179
- // Create empty docs directory
180
- await fs.mkdir(path.join(destDir, 'docs'), { recursive: true });
181
- }
182
- }
183
- async removeGitInfo(destDir) {
184
- const gitDir = path.join(destDir, '.git');
185
- try {
186
- await fs.rm(gitDir, { recursive: true, force: true });
187
- this.log('Removed .git directory');
188
- }
189
- catch {
190
- // .git directory might not exist, which is fine
191
- }
192
- }
193
- async createDocsReadme(destDir, appName, description) {
194
- const docsDir = path.join(destDir, 'docs');
195
- const readmePath = path.join(docsDir, 'README.md');
196
- const readmeContent = `# ${appName}
197
-
198
- ## Description
199
-
200
- ${description}
201
-
202
- ## Usage
203
-
204
- Instructions for using this template will be added here.
205
- `;
206
- await fs.writeFile(readmePath, readmeContent, 'utf-8');
207
- this.log('Created docs/README.md');
208
- }
209
- async createGitignore(destDir) {
210
- const gitignorePath = path.join(destDir, '.gitignore');
211
- const gitignoreContent = `# Dependencies
212
- node_modules/
213
- .pnpm-store/
214
-
215
- # Build outputs
216
- dist/
217
- build/
218
- *.tsbuildinfo
219
-
220
- # Environment variables
221
- .env
222
- .env.local
223
- .env.production
224
- .env.*.local
225
-
226
- # Secrets
227
- secrets.json
228
- *.key
229
- *.pem
230
-
231
- # IDE
232
- .vscode/
233
- .idea/
234
- *.swp
235
- *.swo
236
- *~
237
-
238
- # OS
239
- .DS_Store
240
- Thumbs.db
241
-
242
- # Logs
243
- *.log
244
- logs/
245
-
246
- # Testing
247
- coverage/
248
- .nyc_output/
249
-
250
- # Raindrop local config
251
- .raindrop/
252
- `;
253
- await fs.writeFile(gitignorePath, gitignoreContent, 'utf-8');
254
- this.log('Created .gitignore');
255
- }
256
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * Template Registry for Raindrop Projects
3
- *
4
- * This registry defines all available templates that can be cloned via
5
- * `raindrop build clone <template-id>`
6
- */
7
- export type TemplateType = 'init' | 'clone';
8
- export interface TemplateDefinition {
9
- /** Unique identifier for the template (e.g., "liquidmetal/smartbucket") */
10
- id: string;
11
- /** Human-readable name */
12
- name: string;
13
- /** Description of what this template provides */
14
- description: string;
15
- /** Template type: 'init' generates from scratch, 'clone' clones from GitHub */
16
- type: TemplateType;
17
- /** For 'clone' type: the directory name in lm-raindrop-demos repo */
18
- githubPath?: string;
19
- /** For 'clone' type: the full GitHub repository URL */
20
- githubRepo?: string;
21
- }
22
- /**
23
- * Registry of all available Raindrop templates
24
- */
25
- export declare const TEMPLATE_REGISTRY: TemplateDefinition[];
26
- /**
27
- * Get a template definition by ID
28
- */
29
- export declare function getTemplateById(id: string): TemplateDefinition | undefined;
30
- /**
31
- * List all available templates
32
- */
33
- export declare function listTemplates(): TemplateDefinition[];
34
- /**
35
- * Search templates by query string (searches name and description)
36
- */
37
- export declare function searchTemplates(query: string): TemplateDefinition[];
38
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,IAAI,EAAE,YAAY,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,EAuCjD,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAEpD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAMnE"}
@@ -1,72 +0,0 @@
1
- /**
2
- * Template Registry for Raindrop Projects
3
- *
4
- * This registry defines all available templates that can be cloned via
5
- * `raindrop build clone <template-id>`
6
- */
7
- const GITHUB_DEMOS_REPO = 'https://github.com/LiquidMetal-AI/lm-raindrop-demos.git';
8
- /**
9
- * Registry of all available Raindrop templates
10
- */
11
- export const TEMPLATE_REGISTRY = [
12
- {
13
- id: 'liquidmetal/smartbucket',
14
- name: 'SmartBucket',
15
- description: 'Initialize a new Raindrop project with SmartBucket and service components from scratch',
16
- type: 'init',
17
- },
18
- {
19
- id: 'liquidmetal/agent-template',
20
- name: 'Agent Template',
21
- description: 'A foundational template for building agents on the LiquidMetal platform',
22
- type: 'clone',
23
- githubPath: 'agent-template',
24
- githubRepo: GITHUB_DEMOS_REPO,
25
- },
26
- {
27
- id: 'liquidmetal/git-haiku-demo',
28
- name: 'Git Haiku Demo',
29
- description: 'A demonstration application showcasing git integration capabilities',
30
- type: 'clone',
31
- githubPath: 'git-haiku-demo',
32
- githubRepo: GITHUB_DEMOS_REPO,
33
- },
34
- {
35
- id: 'liquidmetal/hello-world',
36
- name: 'Hello World',
37
- description: 'An introductory example for getting started with the platform',
38
- type: 'clone',
39
- githubPath: 'hello-world',
40
- githubRepo: GITHUB_DEMOS_REPO,
41
- },
42
- {
43
- id: 'liquidmetal/voice-agent-demo',
44
- name: 'Voice Agent Demo',
45
- description: 'A sample application demonstrating voice-based agent functionality',
46
- type: 'clone',
47
- githubPath: 'voice-agent-demo',
48
- githubRepo: GITHUB_DEMOS_REPO,
49
- },
50
- ];
51
- /**
52
- * Get a template definition by ID
53
- */
54
- export function getTemplateById(id) {
55
- return TEMPLATE_REGISTRY.find(template => template.id === id);
56
- }
57
- /**
58
- * List all available templates
59
- */
60
- export function listTemplates() {
61
- return TEMPLATE_REGISTRY;
62
- }
63
- /**
64
- * Search templates by query string (searches name and description)
65
- */
66
- export function searchTemplates(query) {
67
- const lowerQuery = query.toLowerCase();
68
- return TEMPLATE_REGISTRY.filter(template => {
69
- const searchText = `${template.name} ${template.description}`.toLowerCase();
70
- return searchText.includes(lowerQuery);
71
- });
72
- }