@liquidmetal-ai/raindrop 0.6.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +440 -73
  2. package/bin/cjs-shims.js +7 -0
  3. package/bin/run.js +20 -2
  4. package/bundle/chunk-5GH4FS6C.js +12148 -0
  5. package/bundle/chunk-6B4I2CKP.js +231 -0
  6. package/bundle/chunk-6UE75KX2.js +4481 -0
  7. package/bundle/chunk-AU3EGGJP.js +44 -0
  8. package/bundle/chunk-CDQRD3JA.js +75 -0
  9. package/bundle/chunk-CMCEP64V.js +380 -0
  10. package/bundle/chunk-CW5ZHVPX.js +292 -0
  11. package/bundle/chunk-G6NE675D.js +238720 -0
  12. package/bundle/chunk-GLIYVKQA.js +48 -0
  13. package/bundle/chunk-KXEV6E63.js +133 -0
  14. package/bundle/chunk-MCRKUPJY.js +4515 -0
  15. package/bundle/chunk-MGM2L2T3.js +805 -0
  16. package/bundle/chunk-MVQYQJHI.js +502 -0
  17. package/bundle/chunk-NG7CZTTE.js +147 -0
  18. package/bundle/chunk-PU4RCSXF.js +22452 -0
  19. package/bundle/chunk-VXAZKB3J.js +292 -0
  20. package/bundle/chunk-W2L3MYN6.js +4480 -0
  21. package/bundle/chunk-XYJACVNA.js +231 -0
  22. package/bundle/commands/annotation/get.js +153 -0
  23. package/bundle/commands/annotation/list.js +226 -0
  24. package/bundle/commands/annotation/put.js +177 -0
  25. package/bundle/commands/auth/list.js +75 -0
  26. package/bundle/commands/auth/login.js +1654 -0
  27. package/bundle/commands/auth/logout.js +27 -0
  28. package/bundle/commands/auth/select.js +53 -0
  29. package/bundle/commands/bucket/create-credential.js +173 -0
  30. package/bundle/commands/bucket/delete-credential.js +140 -0
  31. package/bundle/commands/bucket/get-credential.js +151 -0
  32. package/bundle/commands/bucket/list-credentials.js +148 -0
  33. package/bundle/commands/build/branch.js +126 -0
  34. package/bundle/commands/build/checkout.js +198 -0
  35. package/bundle/commands/build/clone.js +153 -0
  36. package/bundle/commands/build/delete.js +227 -0
  37. package/bundle/commands/build/deploy.js +160 -0
  38. package/bundle/commands/build/env/get.js +105 -0
  39. package/bundle/commands/build/env/set.js +115 -0
  40. package/bundle/commands/build/find.js +333 -0
  41. package/bundle/commands/build/generate.js +75 -0
  42. package/bundle/commands/build/init.js +76 -0
  43. package/bundle/commands/build/list.js +11 -0
  44. package/bundle/commands/build/sandbox.js +65 -0
  45. package/bundle/commands/build/start.js +84 -0
  46. package/bundle/commands/build/status.js +1839 -0
  47. package/bundle/commands/build/stop.js +84 -0
  48. package/bundle/commands/build/tools/check.js +32 -0
  49. package/bundle/commands/build/tools/fmt.js +49 -0
  50. package/bundle/commands/build/unsandbox.js +65 -0
  51. package/bundle/commands/build/upload.js +83 -0
  52. package/bundle/commands/build/validate.js +71 -0
  53. package/bundle/commands/build/workos/delete.js +86 -0
  54. package/bundle/commands/build/workos/env/attach.js +134 -0
  55. package/bundle/commands/build/workos/env/create.js +176 -0
  56. package/bundle/commands/build/workos/env/delete.js +84 -0
  57. package/bundle/commands/build/workos/env/detach.js +115 -0
  58. package/bundle/commands/build/workos/env/get.js +117 -0
  59. package/bundle/commands/build/workos/env/list.js +139 -0
  60. package/bundle/commands/build/workos/env/set.js +138 -0
  61. package/bundle/commands/build/workos/invite.js +91 -0
  62. package/bundle/commands/build/workos/setup.js +124 -0
  63. package/bundle/commands/build/workos/status.js +93 -0
  64. package/bundle/commands/dns/create.js +128 -0
  65. package/bundle/commands/dns/delete.js +80 -0
  66. package/bundle/commands/dns/get.js +167 -0
  67. package/bundle/commands/dns/list.js +193 -0
  68. package/bundle/commands/dns/records/create.js +150 -0
  69. package/bundle/commands/dns/records/delete.js +76 -0
  70. package/bundle/commands/dns/records/get.js +118 -0
  71. package/bundle/commands/dns/records/list.js +153 -0
  72. package/bundle/commands/dns/records/update.js +146 -0
  73. package/bundle/commands/logs/query.js +237 -0
  74. package/bundle/commands/logs/tail.js +155 -0
  75. package/bundle/commands/mcp/install-claude.js +220 -0
  76. package/bundle/commands/mcp/install-gemini.js +220 -0
  77. package/bundle/commands/mcp/install-goose.js +232 -0
  78. package/bundle/commands/mcp/status.js +153 -0
  79. package/bundle/commands/object/delete.js +180 -0
  80. package/bundle/commands/object/get.js +209 -0
  81. package/bundle/commands/object/list.js +206 -0
  82. package/bundle/commands/object/put.js +211 -0
  83. package/bundle/commands/query/chunk-search.js +123 -0
  84. package/bundle/commands/query/document.js +126 -0
  85. package/bundle/commands/query/events.js +98 -0
  86. package/bundle/commands/query/reindex.js +147 -0
  87. package/bundle/commands/query/search.js +169 -0
  88. package/bundle/commands/tail.js +31 -0
  89. package/bundle/index.js +51 -0
  90. package/dist/base-command.d.ts +6 -0
  91. package/dist/base-command.d.ts.map +1 -1
  92. package/dist/base-command.js +21 -8
  93. package/dist/build.d.ts +2 -1
  94. package/dist/build.d.ts.map +1 -1
  95. package/dist/build.js +169 -51
  96. package/dist/codegen.d.ts +1 -1
  97. package/dist/codegen.d.ts.map +1 -1
  98. package/dist/codegen.js +20 -3
  99. package/dist/codegen.test.js +59 -1
  100. package/dist/commands/build/checkout.d.ts +17 -0
  101. package/dist/commands/build/checkout.d.ts.map +1 -1
  102. package/dist/commands/build/checkout.js +144 -7
  103. package/dist/commands/build/delete.d.ts +15 -0
  104. package/dist/commands/build/delete.d.ts.map +1 -1
  105. package/dist/commands/build/delete.js +133 -0
  106. package/dist/commands/build/deploy.d.ts.map +1 -1
  107. package/dist/commands/build/deploy.js +10 -2
  108. package/dist/commands/build/find.d.ts +1 -0
  109. package/dist/commands/build/find.d.ts.map +1 -1
  110. package/dist/commands/build/find.js +33 -2
  111. package/dist/commands/build/validate.d.ts.map +1 -1
  112. package/dist/commands/build/validate.js +0 -1
  113. package/dist/commands/build/workos/delete.d.ts +18 -0
  114. package/dist/commands/build/workos/delete.d.ts.map +1 -0
  115. package/dist/commands/build/workos/delete.js +72 -0
  116. package/dist/commands/build/workos/env/attach.d.ts +24 -0
  117. package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
  118. package/dist/commands/build/workos/env/attach.js +111 -0
  119. package/dist/commands/build/workos/env/create.d.ts +26 -0
  120. package/dist/commands/build/workos/env/create.d.ts.map +1 -0
  121. package/dist/commands/build/workos/env/create.js +156 -0
  122. package/dist/commands/build/workos/env/delete.d.ts +20 -0
  123. package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
  124. package/dist/commands/build/workos/env/delete.js +61 -0
  125. package/dist/commands/build/workos/env/detach.d.ts +21 -0
  126. package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
  127. package/dist/commands/build/workos/env/detach.js +94 -0
  128. package/dist/commands/build/workos/env/get.d.ts +20 -0
  129. package/dist/commands/build/workos/env/get.d.ts.map +1 -0
  130. package/dist/commands/build/workos/env/get.js +94 -0
  131. package/dist/commands/build/workos/env/list.d.ts +18 -0
  132. package/dist/commands/build/workos/env/list.d.ts.map +1 -0
  133. package/dist/commands/build/workos/env/list.js +114 -0
  134. package/dist/commands/build/workos/env/set.d.ts +27 -0
  135. package/dist/commands/build/workos/env/set.d.ts.map +1 -0
  136. package/dist/commands/build/workos/env/set.js +115 -0
  137. package/dist/commands/build/workos/invite.d.ts +21 -0
  138. package/dist/commands/build/workos/invite.d.ts.map +1 -0
  139. package/dist/commands/build/workos/invite.js +68 -0
  140. package/dist/commands/build/workos/setup.d.ts +20 -0
  141. package/dist/commands/build/workos/setup.d.ts.map +1 -0
  142. package/dist/commands/build/workos/setup.js +106 -0
  143. package/dist/commands/build/workos/status.d.ts +18 -0
  144. package/dist/commands/build/workos/status.d.ts.map +1 -0
  145. package/dist/commands/build/workos/status.js +70 -0
  146. package/dist/commands/mcp/install-claude.d.ts.map +1 -1
  147. package/dist/commands/mcp/install-claude.js +2 -2
  148. package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
  149. package/dist/commands/mcp/install-gemini.js +2 -2
  150. package/dist/commands/mcp/install-goose.d.ts +22 -0
  151. package/dist/commands/mcp/install-goose.d.ts.map +1 -0
  152. package/dist/commands/mcp/install-goose.js +252 -0
  153. package/dist/commands/object/delete.d.ts.map +1 -1
  154. package/dist/commands/object/delete.js +20 -12
  155. package/dist/commands/object/get.d.ts.map +1 -1
  156. package/dist/commands/object/get.js +20 -12
  157. package/dist/commands/object/list.d.ts.map +1 -1
  158. package/dist/commands/object/list.js +20 -12
  159. package/dist/commands/object/put.d.ts.map +1 -1
  160. package/dist/commands/object/put.js +20 -12
  161. package/dist/deploy.d.ts.map +1 -1
  162. package/dist/deploy.js +2 -2
  163. package/dist/index.d.ts +2 -0
  164. package/dist/index.d.ts.map +1 -1
  165. package/dist/index.js +37 -4
  166. package/dist/index.test.js +54 -2
  167. package/oclif.manifest.json +4533 -2284
  168. package/package.json +8 -5
  169. package/templates/claude-code/debug-raindrop-app.md +89 -0
  170. package/templates/claude-code/new-raindrop-app.md +12 -4
  171. package/templates/claude-code/reattach-raindrop-session.md +50 -12
  172. package/templates/claude-code/update-raindrop-app.md +61 -9
  173. package/templates/db/node_modules/.bin/prisma +2 -2
  174. package/templates/db/node_modules/.bin/prisma-kysely +2 -2
  175. package/templates/db/node_modules/.bin/tsc +2 -2
  176. package/templates/db/node_modules/.bin/tsserver +2 -2
  177. package/templates/db/node_modules/.bin/zx +2 -2
  178. package/templates/gemini-code/debug-raindrop-app.toml +86 -0
  179. package/templates/gemini-code/new-raindrop-app.toml +10 -3
  180. package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
  181. package/templates/gemini-code/update-raindrop-app.toml +55 -10
  182. package/templates/goose/debug-raindrop-app.yaml +91 -0
  183. package/templates/goose/new-raindrop-app.yaml +21 -0
  184. package/templates/goose/reattach-raindrop-session.yaml +20 -0
  185. package/templates/goose/update-raindrop-app.yaml +65 -0
  186. package/templates/init/src/_app/auth.ts +18 -0
  187. package/templates/init/src/_app/cors.ts +64 -0
  188. package/dist/tsconfig.tsbuildinfo +0 -1
  189. package/templates/claude-code/raindrop-guidelines.md +0 -322
  190. package/templates/gemini-code/raindrop-guidelines.md +0 -322
@@ -0,0 +1,51 @@
1
+ import {
2
+ EPOCH_TS,
3
+ annotationService,
4
+ bucketApiService,
5
+ catalogService,
6
+ configFromAppFile,
7
+ createAuthenticateInterceptor,
8
+ createTraceInterceptor,
9
+ dnsService,
10
+ ensureDirectory,
11
+ eventStreamService,
12
+ getCurrentVersion,
13
+ import_core,
14
+ joinPath,
15
+ objectService,
16
+ rainbowAuthService,
17
+ readState,
18
+ replaceState,
19
+ riverjackService,
20
+ searchAgentService,
21
+ selectedOrganization,
22
+ serviceClient,
23
+ versionInterceptor,
24
+ workosIntegrationService
25
+ } from "./chunk-G6NE675D.js";
26
+ var export_run = import_core.run;
27
+ export {
28
+ EPOCH_TS,
29
+ annotationService,
30
+ bucketApiService,
31
+ catalogService,
32
+ configFromAppFile,
33
+ createAuthenticateInterceptor,
34
+ createTraceInterceptor,
35
+ dnsService,
36
+ ensureDirectory,
37
+ eventStreamService,
38
+ getCurrentVersion,
39
+ joinPath,
40
+ objectService,
41
+ rainbowAuthService,
42
+ readState,
43
+ replaceState,
44
+ riverjackService,
45
+ export_run as run,
46
+ searchAgentService,
47
+ selectedOrganization,
48
+ serviceClient,
49
+ versionInterceptor,
50
+ workosIntegrationService
51
+ };
@@ -8,6 +8,7 @@ import { AnnotationService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/
8
8
  import { EventStreamService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/events_pb';
9
9
  import { RiverjackService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/riverjack_pb';
10
10
  import { S3CredentialService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/bucket_api_pb';
11
+ import { WorkOSIntegrationService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/workos_integration_pb';
11
12
  import { Command, Interfaces } from '@oclif/core';
12
13
  import { Config } from './config.js';
13
14
  import { ServiceIdentity } from './index.js';
@@ -79,6 +80,11 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
79
80
  organizationId: string;
80
81
  userId: string;
81
82
  }>;
83
+ workosIntegrationService(configDir?: string): Promise<{
84
+ client: StrictClient<typeof WorkOSIntegrationService>;
85
+ userId: string;
86
+ organizationId: string;
87
+ }>;
82
88
  protected rainbowAuthService(): Promise<{
83
89
  client: StrictClient<typeof RainbowAuthService>;
84
90
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;AAGjG,OAAO,EAAE,OAAO,EAAS,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,MAAM,EAA0B,MAAM,aAAa,CAAC;AAC7D,OAAO,EAOL,eAAe,EAKhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACvH,MAAM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AO,CAAC;QAC5C,MAAM,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;KACjD,CAAC;IAMI,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC;IAWjD,GAAG,CAAC,OAAO,GAAE,MAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAGhD"}
@@ -5,7 +5,7 @@ import { Command, Flags } from '@oclif/core';
5
5
  import * as fs from 'node:fs/promises';
6
6
  import path from 'node:path';
7
7
  import { loadConfig, saveConfig } from './config.js';
8
- import { catalogService, dnsService, objectService, rainbowAuthService, searchAgentService, selectedOrganization, annotationService, eventStreamService, riverjackService, bucketApiService, } from './index.js';
8
+ import { catalogService, dnsService, objectService, rainbowAuthService, searchAgentService, selectedOrganization, annotationService, eventStreamService, riverjackService, bucketApiService, workosIntegrationService, } from './index.js';
9
9
  export class BaseCommand extends Command {
10
10
  static HIDDEN_FLAGS = {
11
11
  config: Flags.string({
@@ -151,7 +151,7 @@ export class BaseCommand extends Command {
151
151
  identity: await this.catalogIdentity(),
152
152
  overrideAuthToken: this.flags.rainbowAuthToken,
153
153
  logger: this,
154
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
154
+ enableSendVersion: false,
155
155
  });
156
156
  }
157
157
  async searchAgentService() {
@@ -166,7 +166,7 @@ export class BaseCommand extends Command {
166
166
  baseUrl,
167
167
  },
168
168
  logger: this,
169
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
169
+ enableSendVersion: false,
170
170
  });
171
171
  return result;
172
172
  }
@@ -182,7 +182,7 @@ export class BaseCommand extends Command {
182
182
  baseUrl,
183
183
  },
184
184
  logger: this,
185
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
185
+ enableSendVersion: false,
186
186
  });
187
187
  return result;
188
188
  }
@@ -198,7 +198,7 @@ export class BaseCommand extends Command {
198
198
  baseUrl,
199
199
  },
200
200
  logger: this,
201
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
201
+ enableSendVersion: false,
202
202
  });
203
203
  return result;
204
204
  }
@@ -212,7 +212,7 @@ export class BaseCommand extends Command {
212
212
  identity: await this.catalogIdentity(),
213
213
  overrideAuthToken: this.flags.rainbowAuthToken,
214
214
  logger: this,
215
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
215
+ enableSendVersion: false,
216
216
  });
217
217
  }
218
218
  async tenantRiverjackService() {
@@ -227,7 +227,7 @@ export class BaseCommand extends Command {
227
227
  baseUrl,
228
228
  },
229
229
  logger: this,
230
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
230
+ enableSendVersion: false,
231
231
  });
232
232
  return result;
233
233
  }
@@ -242,10 +242,23 @@ export class BaseCommand extends Command {
242
242
  baseUrl,
243
243
  },
244
244
  logger: this,
245
- enableSendVersion: this.flags.sendVersionMetadata === 'true',
245
+ enableSendVersion: false,
246
246
  });
247
247
  return result;
248
248
  }
249
+ async workosIntegrationService(configDir) {
250
+ if (this.flags.raindropCatalogService) {
251
+ this.log(`[DEBUG] Using workos-integration-service: ${this.flags.raindropCatalogService}`);
252
+ }
253
+ return workosIntegrationService({
254
+ rainbowAuth: (await this.rainbowAuthService()).client,
255
+ configDir: configDir ?? this.config.configDir,
256
+ identity: await this.catalogIdentity(),
257
+ overrideAuthToken: this.flags.rainbowAuthToken,
258
+ logger: this,
259
+ enableSendVersion: false,
260
+ });
261
+ }
249
262
  async rainbowAuthService() {
250
263
  const baseUrl = this.flags.rainbowAuthService;
251
264
  return rainbowAuthService(baseUrl);
package/dist/build.d.ts CHANGED
@@ -3,8 +3,9 @@ import { PrettyPrintableError } from '@oclif/core/interfaces';
3
3
  import * as esbuild from 'esbuild';
4
4
  export default function build(options: {
5
5
  root: string;
6
- entryPoints: string[];
6
+ handlerDir: string;
7
7
  outdir: string;
8
+ isProtected: boolean;
8
9
  }): Promise<esbuild.BuildResult>;
9
10
  export interface Cmd {
10
11
  log: (message?: string, ...args: any[]) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot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AW,CAAC,CAuE/B;AAED,MAAM,WAAW,GAAG;IAGlB,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChD,KAAK,CACH,KAAK,EAAE,KAAK,GAAG,MAAM,EACrB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,oBAAoB,GACvB,KAAK,CAAC;CACV;AAGD,wBAAsB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAoHhG"}
package/dist/build.js CHANGED
@@ -1,49 +1,113 @@
1
- import { valueOf } from '@liquidmetal-ai/drizzle/appify/build';
1
+ import { Actor, Service, valueOf } from '@liquidmetal-ai/drizzle/appify/build';
2
+ import { init, parse } from 'es-module-lexer';
2
3
  import * as esbuild from 'esbuild';
3
- import { exec } from 'node:child_process';
4
+ import { exec, spawn } from 'node:child_process';
4
5
  import fs from 'node:fs/promises';
5
6
  import * as path from 'node:path';
6
7
  import { promisify } from 'node:util';
7
8
  import { HANDLERS_DIR } from './codegen.js';
8
9
  const execAsync = promisify(exec);
9
- async function typeCheck(cwd) {
10
+ // Plugin to selectively rewrite raindrop-framework imports
11
+ function raindropFrameworkPlugin() {
12
+ return {
13
+ name: 'raindrop-framework-resolver',
14
+ setup(build) {
15
+ // Handle bare package imports - rewrite to ./runtime.js
16
+ build.onResolve({ filter: /^@liquidmetal-ai\/raindrop-framework$/ }, (_args) => {
17
+ return {
18
+ path: './runtime.js',
19
+ external: true,
20
+ };
21
+ });
22
+ // Handle subpath imports - bundle them.
23
+ build.onResolve({ filter: /^@liquidmetal-ai\/raindrop-framework\/.+/ }, (_args) => {
24
+ // Let esbuild handle these normally (will bundle them)
25
+ return undefined;
26
+ });
27
+ },
28
+ };
29
+ }
30
+ // Analyze what exports the user has in their index.ts using es-module-lexer
31
+ async function analyzeExports(indexPath) {
10
32
  try {
11
- await execAsync('npx tsc --noEmit', {
12
- cwd,
13
- });
14
- return true;
33
+ // Initialize es-module-lexer (required once)
34
+ await init;
35
+ // Read the source file
36
+ const content = await fs.readFile(indexPath, 'utf-8');
37
+ // Parse to get exports
38
+ const [, exports] = parse(content);
39
+ // Convert export names to a Set
40
+ const exportNames = new Set();
41
+ for (const exp of exports) {
42
+ if (exp.n) {
43
+ // Named export
44
+ exportNames.add(exp.n);
45
+ }
46
+ }
47
+ return exportNames;
48
+ }
49
+ catch (_error) {
50
+ // If we can't read or parse the file, assume no exports
51
+ return new Set();
52
+ }
53
+ }
54
+ // Generate the entry point content based on what the user has exported
55
+ async function generateEntryPoint(handlerDir, isProtected) {
56
+ const indexPath = path.join(handlerDir, 'index.ts');
57
+ const userExports = await analyzeExports(indexPath);
58
+ let content = '';
59
+ // Only inject auth exports for protected handlers
60
+ if (isProtected) {
61
+ const authExports = ['verify', 'authorize'];
62
+ const missingAuthExports = authExports.filter(exp => !userExports.has(exp));
63
+ // Only export auth functions that the user hasn't already exported
64
+ if (missingAuthExports.length > 0) {
65
+ content += `export { ${missingAuthExports.join(', ')} } from '../_app/auth.js';\n`;
66
+ }
15
67
  }
16
- catch (err) {
17
- console.error(err);
18
- return false;
68
+ // Inject cors export if user hasn't exported it
69
+ // CORS is available for all handlers (not just protected ones)
70
+ if (!userExports.has('cors')) {
71
+ // Try to check if _app/cors.ts exists to avoid import errors
72
+ content += `export { cors } from '../_app/cors.js';\n`;
19
73
  }
74
+ // Explicitly export all user's exports to ensure they get bundled
75
+ content += `export * from './index.js';\n`;
76
+ content += `import * as userDefault from './index.js';\n`;
77
+ content += `export default userDefault.default;\n`;
78
+ return content;
79
+ }
80
+ async function typeCheck(cwd) {
81
+ return new Promise((resolve) => {
82
+ const tsc = spawn('npx', ['tsc', '--noEmit'], {
83
+ cwd,
84
+ stdio: 'inherit', // Inherit stdio to show compiler output in real-time
85
+ });
86
+ tsc.on('exit', (code) => {
87
+ resolve(code === 0);
88
+ });
89
+ });
20
90
  }
21
91
  export default async function build(options) {
22
92
  // Ensure that TypeScript errors are fixed before building
23
93
  const typeCheckPassed = await typeCheck(options.root);
24
94
  if (!typeCheckPassed) {
25
- throw new Error(`TypeScript type checking failed. Run 'raindrop build validate' and fix all errors before building.`);
95
+ throw new Error(`TypeScript type checking failed.Run 'raindrop build validate' and fix all errors before building.`);
26
96
  }
27
97
  // Customize outbase so that even when only one entryPoint is provided,
28
98
  // the output file is placed in the same directory as it would if
29
99
  // another entryPoint were provided later.
30
- let outbase;
31
- if (options.entryPoints.length === 1) {
32
- outbase = path.join(options.root, HANDLERS_DIR);
33
- }
34
100
  const gitCommitSha = await currentGitCommitSha();
101
+ // Generate entry point dynamically based on user's exports and handler visibility
102
+ const entryPointContent = await generateEntryPoint(options.handlerDir, options.isProtected);
35
103
  const buildResult = await esbuild.build({
36
- entryPoints: options.entryPoints,
37
- external: ['node:crypto', 'crypto', '@liquidmetal-ai/raindrop-framework', './runtime.js'],
38
- alias: {
39
- '@liquidmetal-ai/raindrop-framework': './runtime.js',
40
- },
104
+ external: ['node:crypto', 'crypto', './runtime.js'],
105
+ plugins: [raindropFrameworkPlugin()],
41
106
  banner: {
42
- js: `globalThis.__RAINDROP_GIT_COMMIT_SHA = "${gitCommitSha}";`,
107
+ js: `globalThis.__RAINDROP_GIT_COMMIT_SHA = "${gitCommitSha}"; `,
43
108
  },
44
109
  bundle: true,
45
- outdir: options.outdir,
46
- outbase,
110
+ outfile: `${options.outdir}/index.js`,
47
111
  tsconfig: `${options.root}/tsconfig.json`,
48
112
  // TODO [bosgood] Add support for middleware/code injection from wrangler
49
113
  inject: [],
@@ -51,7 +115,11 @@ export default async function build(options) {
51
115
  // Until we switch to fflate for compression, we need to disable
52
116
  // sourcemaps (JSZip uses ~10x memory).
53
117
  sourcemap: false,
54
- sourceRoot: options.outdir,
118
+ stdin: {
119
+ contents: entryPointContent,
120
+ loader: 'ts',
121
+ resolveDir: options.handlerDir,
122
+ },
55
123
  // Experiment: let's see how far we can get without minification because:
56
124
  // 1) It should be slightly faster to build
57
125
  // 2) It should be easier to debug
@@ -82,46 +150,96 @@ export async function buildHandlers(cmd, apps, buildDir, root) {
82
150
  // Wipe out the output directory then rebuild
83
151
  await fs.rm(buildDir, { force: true, recursive: true });
84
152
  cmd.log(`Building to ${buildDir}`);
85
- // Discover entrypoints from manifest
86
- let entryPoints = [];
153
+ const buildTasks = [];
87
154
  for (const app of apps) {
88
- entryPoints = entryPoints.concat(app.handlers().map((handler) => path.join(root, HANDLERS_DIR, valueOf(handler.name), 'index.ts')));
89
- }
90
- if (entryPoints.length === 0) {
91
- cmd.log('Nothing to build');
92
- return;
155
+ for (const handler of app.handlers()) {
156
+ const handlerName = valueOf(handler.name);
157
+ // Check if this handler is protected (only for Service and Actor types)
158
+ let isProtected = false;
159
+ if (handler instanceof Service || handler instanceof Actor) {
160
+ isProtected = handler.visibility !== undefined && valueOf(handler.visibility) === 'protected';
161
+ }
162
+ buildTasks.push({
163
+ handlerName,
164
+ isProtected,
165
+ handlerDir: `${root}/${HANDLERS_DIR}/${handlerName}`,
166
+ outdir: path.join(buildDir, handlerName),
167
+ });
168
+ }
93
169
  }
94
- cmd.log(`Building entry points:\n${entryPoints.join('\n')}`);
95
- try {
170
+ // Run all builds in parallel
171
+ const results = await Promise.allSettled(buildTasks.map(async (task) => {
96
172
  const buildResult = await build({
97
173
  root: root,
98
- entryPoints,
99
- outdir: buildDir,
174
+ handlerDir: task.handlerDir,
175
+ outdir: task.outdir,
176
+ isProtected: task.isProtected,
100
177
  });
101
- if (buildResult.errors.length > 0 || buildResult.warnings.length > 0) {
102
- cmd.log('Build results');
178
+ return { task, buildResult };
179
+ }));
180
+ // Aggregate results
181
+ const successful = [];
182
+ const failed = [];
183
+ for (const result of results) {
184
+ if (result.status === 'fulfilled') {
185
+ const { task, buildResult } = result.value;
186
+ if (buildResult.errors.length === 0) {
187
+ successful.push({ task, buildResult });
188
+ }
189
+ else {
190
+ failed.push({ task, error: buildResult });
191
+ }
103
192
  }
104
- if (buildResult.errors.length > 0) {
105
- cmd.log(buildResult.errors.map((e) => e.text).join('\n'));
106
- }
107
- if (buildResult.warnings.length > 0) {
108
- cmd.log(buildResult.warnings.map((w) => w.text).join('\n'));
193
+ else {
194
+ // Extract task from the rejection - this is tricky, we need to match by index
195
+ const index = results.indexOf(result);
196
+ const task = buildTasks[index];
197
+ failed.push({ task, error: result.reason });
109
198
  }
110
- if (buildResult.errors.length === 0) {
111
- cmd.log('Build successful');
199
+ }
200
+ // Log results
201
+ cmd.log(`\nBuild Summary: ${successful.length}/${buildTasks.length} handlers built successfully`);
202
+ // Log successful builds
203
+ if (successful.length > 0) {
204
+ cmd.log('\nSuccessful builds:');
205
+ for (const { task } of successful) {
206
+ cmd.log(` ✓ ${task.handlerName}`);
112
207
  }
113
- else {
114
- cmd.error('Build failed', { exit: 1 });
208
+ }
209
+ // Log warnings across all builds
210
+ const buildsWithWarnings = [];
211
+ for (const { task, buildResult } of successful) {
212
+ if (buildResult.warnings.length > 0) {
213
+ buildsWithWarnings.push({ handler: task.handlerName, warnings: buildResult.warnings });
115
214
  }
116
215
  }
117
- catch (error) {
118
- if (error instanceof Error) {
119
- cmd.error(`Build failed: ${error.message}`, { exit: 1 });
216
+ if (buildsWithWarnings.length > 0) {
217
+ cmd.log('\nWarnings:');
218
+ for (const { handler, warnings } of buildsWithWarnings) {
219
+ cmd.log(` ${handler}:`);
220
+ for (const warning of warnings) {
221
+ cmd.log(` ${warning.text}`);
222
+ }
120
223
  }
121
- else {
122
- cmd.error('Build failed with unknown error', { exit: 1 });
224
+ }
225
+ // Log errors
226
+ if (failed.length > 0) {
227
+ cmd.log('\nFailed builds:');
228
+ for (const { task, error } of failed) {
229
+ cmd.log(` ✗ ${task.handlerName}:`);
230
+ if (error instanceof Error) {
231
+ cmd.log(` ${error.message}`);
232
+ }
233
+ else {
234
+ // esbuild.BuildResult with errors
235
+ for (const err of error.errors) {
236
+ cmd.log(` ${err.text}`);
237
+ }
238
+ }
123
239
  }
240
+ cmd.error(`Build failed for ${failed.length} handler(s)`, { exit: 1 });
124
241
  }
242
+ cmd.log('\nBuild completed successfully');
125
243
  }
126
244
  async function currentGitCommitSha() {
127
245
  try {
package/dist/codegen.d.ts CHANGED
@@ -39,7 +39,7 @@ export declare function codegenPlan(apps: Application[]): CodegenPlan;
39
39
  export declare function gatherEnvForHandler(handler: Actor | Service | Observer | Task, app: Application): string;
40
40
  export declare function fileExists(path: string): Promise<boolean>;
41
41
  export type DirWalkCallback = (relPath: string) => void | Promise<void>;
42
- export declare function dirWalk(dir: string, visitFn: DirWalkCallback): Promise<void>;
42
+ export declare function dirWalk(dir: string, visitFn: DirWalkCallback, relativeBase?: string): Promise<void>;
43
43
  export declare function kebabCaseToConstantCase(s: string): string;
44
44
  export declare function kebabCaseToCamelCase(s: string): string;
45
45
  export declare function kebabCaseToUpperCamelCase(s: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAW,MAAM,sCAAsC,CAAC;AAK5G,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAC1C,eAAO,MAAM,aAAa,QAA6E,CAAC;AACxG,eAAO,MAAM,aAAa,SAAS,CAAC;AACpC,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,YAAY,QAAQ,CAAC;AAClC,eAAO,MAAM,UAAU,WAAW,CAAC;AACnC,eAAO,MAAM,MAAM,OAAO,CAAC;AAC3B,eAAO,MAAM,UAAU,WAAW,CAAC;AACnC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAoBzD,wBAAgB,kBAAkB,CAAC,QAAQ,E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EAAE,MAAM,GAAG,SAAqB,EACvC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,EAAE,CAAC;AAGJ,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,WAAW,CAgF5D;AAoBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CA2HxG;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAGxE,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB7G;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D"}
package/dist/codegen.js CHANGED
@@ -301,6 +301,19 @@ export function gatherEnvForHandler(handler, app) {
301
301
  for (const env of handler.env) {
302
302
  bindings[kebabCaseToConstantCase(valueOf(env.name))] = 'string';
303
303
  }
304
+ // Add auth environment variables for protected handlers
305
+ if ('visibility' in handler && handler.visibility && valueOf(handler.visibility) === 'protected') {
306
+ // Core auth bindings (provider-agnostic)
307
+ bindings['LM_AUTH_ALLOWED_ORIGINS'] = 'string';
308
+ bindings['LM_AUTH_ALLOWED_ISSUERS'] = 'string';
309
+ // WorkOS provider-specific bindings (optional)
310
+ bindings['LM_PROVIDER_WORKOS_ORG_ID?'] = 'string';
311
+ bindings['LM_PROVIDER_WORKOS_CLIENT_ID?'] = 'string';
312
+ bindings['LM_PROVIDER_WORKOS_API_KEY?'] = 'string';
313
+ // Add optional jwt field populated by auth middleware
314
+ bindings['jwt?'] = 'JWTVerifyResult';
315
+ types.add('JWTVerifyResult');
316
+ }
304
317
  //
305
318
  // (nothing to do for Tasks)
306
319
  //
@@ -312,6 +325,9 @@ export function gatherEnvForHandler(handler, app) {
312
325
  bindings['annotation'] = `Annotation<Omit<MRNObject, 'type' | 'applicationName' | 'versionId'>>`;
313
326
  types.add('Annotation');
314
327
  types.add('MRNObject');
328
+ // Add mem binding (automatic KV cache)
329
+ bindings['mem'] = 'KvCache';
330
+ types.add('KvCache');
315
331
  // Add logger binding.
316
332
  bindings['logger'] = 'Logger';
317
333
  types.add('Logger');
@@ -339,15 +355,16 @@ export async function fileExists(path) {
339
355
  }
340
356
  }
341
357
  // dirWalk walks a directory tree and calls the callback for each file it encounters
342
- export async function dirWalk(dir, visitFn) {
358
+ export async function dirWalk(dir, visitFn, relativeBase = '') {
343
359
  const entries = await fs.readdir(dir, { withFileTypes: true });
344
360
  const tasks = entries.map(async (entry) => {
361
+ const relativePath = relativeBase ? path.join(relativeBase, entry.name) : entry.name;
345
362
  if (entry.isDirectory()) {
346
- await dirWalk(path.join(dir, entry.name), visitFn);
363
+ await dirWalk(path.join(dir, entry.name), visitFn, relativePath);
347
364
  }
348
365
  else {
349
366
  // Process encountered file
350
- await visitFn(entry.name);
367
+ await visitFn(relativePath);
351
368
  }
352
369
  });
353
370
  const settled = await Promise.allSettled(tasks);
@@ -3,7 +3,7 @@ import * as fs from 'node:fs/promises';
3
3
  import * as os from 'node:os';
4
4
  import * as path from 'node:path';
5
5
  import { expect, test } from 'vitest';
6
- import { codegenPlan, gatherEnvForHandler, renderTemplatesFromDirectory, shouldWriteTemplate, trimTemplateSuffix, kebabCaseToConstantCase, kebabCaseToCamelCase, kebabCaseToUpperCamelCase, } from './codegen.js';
6
+ import { codegenPlan, gatherEnvForHandler, kebabCaseToCamelCase, kebabCaseToConstantCase, kebabCaseToUpperCamelCase, renderTemplatesFromDirectory, shouldWriteTemplate, trimTemplateSuffix, } from './codegen.js';
7
7
  test('trims handlebars suffix', async () => {
8
8
  expect(trimTemplateSuffix('index.ts.hbs')).toEqual('index.ts');
9
9
  });
@@ -121,6 +121,14 @@ test('codegens template files', async () => {
121
121
  renderNonUserModifiableCode: true,
122
122
  },
123
123
  });
124
+ // Verify nested directory structure is preserved
125
+ const authFilePath = path.join(outPath, 'src', '_app', 'auth.ts');
126
+ const authFileExists = await fs.access(authFilePath).then(() => true, () => false);
127
+ expect(authFileExists).toBe(true);
128
+ // Verify the file content was copied correctly
129
+ const authFileContent = await fs.readFile(authFilePath, 'utf-8');
130
+ expect(authFileContent).toContain('verifyIssuer');
131
+ expect(authFileContent).toContain('requireAuthenticated');
124
132
  });
125
133
  test('kebabCaseToConstantCase', () => {
126
134
  expect(kebabCaseToConstantCase('my-variable')).toEqual('MY_VARIABLE');
@@ -163,3 +171,53 @@ test('generates SmartBucket type bindings', async () => {
163
171
  // Should include SmartBucket type binding with constant case naming
164
172
  expect(generated).toMatch(/DATA_BUCKET:\s*SmartBucket/);
165
173
  });
174
+ test('always includes mem KvCache binding', async () => {
175
+ const apps = await mustManifestFromString(`
176
+ application "test-app" {
177
+ service "test-service" {}
178
+ }
179
+ `);
180
+ const app = apps[0];
181
+ const service = app.service[0];
182
+ const generated = gatherEnvForHandler(service, app);
183
+ // Should include KvCache import
184
+ expect(generated).toMatch(/import\s+{[^}]*KvCache[^}]*}\s+from\s+'@liquidmetal-ai\/raindrop-framework'/);
185
+ // Should include mem type binding
186
+ expect(generated).toMatch(/mem:\s*KvCache/);
187
+ });
188
+ test('includes auth env vars for protected service', async () => {
189
+ const apps = await mustManifestFromString(`
190
+ application "test-app" {
191
+ service "protected-service" {
192
+ visibility = "protected"
193
+ }
194
+ }
195
+ `);
196
+ const app = apps[0];
197
+ const service = app.service[0];
198
+ const generated = gatherEnvForHandler(service, app);
199
+ // Should include core auth bindings and WorkOS provider bindings for protected services
200
+ expect(generated).toMatch(/LM_AUTH_ALLOWED_ORIGINS:\s*string/);
201
+ expect(generated).toMatch(/LM_AUTH_ALLOWED_ISSUERS:\s*string/);
202
+ expect(generated).toMatch(/LM_PROVIDER_WORKOS_ORG_ID\?:\s*string/);
203
+ expect(generated).toMatch(/LM_PROVIDER_WORKOS_CLIENT_ID\?:\s*string/);
204
+ expect(generated).toMatch(/LM_PROVIDER_WORKOS_API_KEY\?:\s*string/);
205
+ });
206
+ test('does not include auth env vars for public service', async () => {
207
+ const apps = await mustManifestFromString(`
208
+ application "test-app" {
209
+ service "public-service" {
210
+ visibility = "public"
211
+ }
212
+ }
213
+ `);
214
+ const app = apps[0];
215
+ const service = app.service[0];
216
+ const generated = gatherEnvForHandler(service, app);
217
+ // Should NOT include auth env vars for non-protected services
218
+ expect(generated).not.toMatch(/LM_AUTH_ALLOWED_ORIGINS/);
219
+ expect(generated).not.toMatch(/LM_AUTH_ALLOWED_ISSUERS/);
220
+ expect(generated).not.toMatch(/LM_PROVIDER_WORKOS_ORG_ID/);
221
+ expect(generated).not.toMatch(/LM_PROVIDER_WORKOS_CLIENT_ID/);
222
+ expect(generated).not.toMatch(/LM_PROVIDER_WORKOS_API_KEY/);
223
+ });
@@ -1,4 +1,12 @@
1
+ import { ApplicationsResponse_Application } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
1
2
  import { BaseCommand } from '../../base-command.js';
3
+ interface VersionNode {
4
+ versionId: string;
5
+ previousVersionId: string | null;
6
+ application: ApplicationsResponse_Application;
7
+ children: VersionNode[];
8
+ branch?: string;
9
+ }
2
10
  export default class Branch extends BaseCommand<typeof Branch> {
3
11
  static args: {
4
12
  version: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
@@ -7,6 +15,8 @@ export default class Branch extends BaseCommand<typeof Branch> {
7
15
  static examples: string[];
8
16
  static flags: {
9
17
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
18
+ manifest: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
19
+ impersonate: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
20
  config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
21
  rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
22
  raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -15,6 +25,13 @@ export default class Branch extends BaseCommand<typeof Branch> {
15
25
  rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
26
  sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
27
  };
28
+ buildVersionTree(applications: ApplicationsResponse_Application[]): {
29
+ rootNodes: VersionNode[];
30
+ nodesMap: Map<string, VersionNode>;
31
+ };
32
+ fetchApplicationVersions(applicationName: string, userId: string, organizationId: string): Promise<ApplicationsResponse_Application[]>;
33
+ promptVersionSelection(versions: ApplicationsResponse_Application[]): Promise<string | undefined>;
18
34
  run(): Promise<void>;
19
35
  }
36
+ export {};
20
37
  //# sourceMappingURL=checkout.d.ts.map