@helloleo/plugins 0.1.12 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12763,7 +12763,10 @@ export function cn(...inputs: ClassValue[]) {
12763
12763
  return twMerge(clsx(inputs))
12764
12764
  }`;
12765
12765
  }
12766
- function proxyTs() {
12766
+ function projectUuidFromDir(dir) {
12767
+ return path2.basename(dir);
12768
+ }
12769
+ function proxyTs(projectUuid) {
12767
12770
  return `/*
12768
12771
  * HelloLeo Integration Proxy -- runtime helper for connected integrations.
12769
12772
  *
@@ -12805,9 +12808,8 @@ function proxyTs() {
12805
12808
  * from a Worker. Never embed secrets in frontend code.
12806
12809
  */
12807
12810
 
12808
- const PROJECT_UUID = import.meta.env.VITE_PROJECT_UUID ?? '';
12809
12811
  export const INTEGRATION_PROXY_URL =
12810
- \`https://api.app.helloleo.dev/api/integration-proxy/\${PROJECT_UUID}\`;
12812
+ 'https://api.app.helloleo.dev/api/integration-proxy/${projectUuid}';
12811
12813
 
12812
12814
  export interface ProxyRequest {
12813
12815
  integration: string;
@@ -12917,7 +12919,7 @@ async function writeBaseScaffold(opts, dir) {
12917
12919
  ["postcss.config.js", postcssConfig()],
12918
12920
  [path2.join("src", "index.css"), indexCss(primary, font, radius)],
12919
12921
  [path2.join("src", "lib", "utils.ts"), utilsTs()],
12920
- [path2.join("src", "lib", "proxy.ts"), proxyTs()],
12922
+ [path2.join("src", "lib", "proxy.ts"), proxyTs(projectUuidFromDir(dir))],
12921
12923
  [path2.join("src", "main.tsx"), mainTsx()]
12922
12924
  ];
12923
12925
  const created = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloleo/plugins",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "OpenCode plugins for HelloLeo",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -242,7 +242,18 @@ export function cn(...inputs: ClassValue[]) {
242
242
  }`;
243
243
  }
244
244
 
245
- function proxyTs() {
245
+ /**
246
+ * The project workspace directory is named after the project UUID -- the
247
+ * webapp generates `<slugified-name>-<uuidv4>` (actions.ts createProject)
248
+ * and leo-core mounts the project at /workspace/<uuid>. Baking it into
249
+ * proxy.ts at scaffold time removes the VITE_PROJECT_UUID env var, which
250
+ * nothing in the infrastructure ever set and which Leo kept mis-generating.
251
+ */
252
+ export function projectUuidFromDir(dir: string): string {
253
+ return path.basename(dir);
254
+ }
255
+
256
+ function proxyTs(projectUuid: string) {
246
257
  return `/*
247
258
  * HelloLeo Integration Proxy -- runtime helper for connected integrations.
248
259
  *
@@ -284,9 +295,8 @@ function proxyTs() {
284
295
  * from a Worker. Never embed secrets in frontend code.
285
296
  */
286
297
 
287
- const PROJECT_UUID = import.meta.env.VITE_PROJECT_UUID ?? '';
288
298
  export const INTEGRATION_PROXY_URL =
289
- \`https://api.app.helloleo.dev/api/integration-proxy/\${PROJECT_UUID}\`;
299
+ 'https://api.app.helloleo.dev/api/integration-proxy/${projectUuid}';
290
300
 
291
301
  export interface ProxyRequest {
292
302
  integration: string;
@@ -420,7 +430,7 @@ export async function writeBaseScaffold(
420
430
  ["postcss.config.js", postcssConfig()],
421
431
  [path.join("src", "index.css"), indexCss(primary, font, radius)],
422
432
  [path.join("src", "lib", "utils.ts"), utilsTs()],
423
- [path.join("src", "lib", "proxy.ts"), proxyTs()],
433
+ [path.join("src", "lib", "proxy.ts"), proxyTs(projectUuidFromDir(dir))],
424
434
  [path.join("src", "main.tsx"), mainTsx()],
425
435
  ];
426
436