@helloleo/plugins 0.1.11 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloleo/plugins",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "OpenCode plugins for HelloLeo",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { InspectHttpPlugin } from "./tools/inspect-http.ts";
2
2
  export { RemovePlugin } from "./tools/remove.ts";
3
+ // `scaffold` is now the TanStack scaffolder (replaced the legacy React+Vite one).
3
4
  export { ScaffoldPlugin } from "./tools/scaffold.ts";
4
5
  export { SetupNetsuitePlugin } from "./tools/setup-netsuite.ts";
5
6
  // export { CreatePlanPlugin } from "./tools/create-plan.ts";
@@ -3,10 +3,10 @@ import { tool } from "@opencode-ai/plugin";
3
3
 
4
4
  const z = tool.schema;
5
5
 
6
- const ALLOWED_EXACT_HOSTS = new Set(["api.app.helloleo.dev"]);
7
- const ALLOWED_HOST_SUFFIXES = [
8
- ".augustin-d60.workers.dev",
9
- ".live.helloleo.dev",
6
+ const ALLOWED_BASE_HOSTS = [
7
+ "helloleo.dev",
8
+ "helloleo.app",
9
+ "augustin-d60.workers.dev",
10
10
  ] as const;
11
11
 
12
12
  const DEFAULT_TIMEOUT_MS = 15_000;
@@ -22,7 +22,7 @@ const argsShape = {
22
22
  .string()
23
23
  .describe(
24
24
  "Fully-qualified URL to request. Must be on the HelloLeo whitelist " +
25
- "(api.app.helloleo.dev, *.augustin-d60.workers.dev, *.live.helloleo.dev).",
25
+ "(**.helloleo.dev, **.helloleo.app, **.augustin-d60.workers.dev).",
26
26
  ),
27
27
  method: z
28
28
  .enum(METHODS)
@@ -58,10 +58,7 @@ export const inspectHttp = tool({
58
58
  "Send an HTTP request to a HelloLeo endpoint and return the status code, " +
59
59
  "response headers, and response body. Use this to inspect the live behaviour " +
60
60
  "of HelloLeo workers, the production API, or preview deployments so you can " +
61
- "self-debug instead of operating blind. " +
62
- "Only URLs on the HelloLeo whitelist are allowed: " +
63
- "api.app.helloleo.dev, *.augustin-d60.workers.dev, *.live.helloleo.dev. " +
64
- "Supports GET, POST, PUT, PATCH and DELETE (with an optional JSON body).",
61
+ "self-debug instead of operating blind. ",
65
62
  args: argsShape,
66
63
  async execute(rawArgs, context) {
67
64
  const args = argsSchema.parse(rawArgs);
@@ -180,17 +177,13 @@ function parseTargetUrl(raw: string): URL {
180
177
  }
181
178
 
182
179
  function allowedHostsHuman(): string {
183
- return [
184
- ...ALLOWED_EXACT_HOSTS,
185
- ...ALLOWED_HOST_SUFFIXES.map((s) => `*${s}`),
186
- ].join(", ");
180
+ return ALLOWED_BASE_HOSTS.map((base) => `**.${base}`).join(", ");
187
181
  }
188
182
 
189
183
  function isAllowedHost(hostname: string): boolean {
190
184
  const host = hostname.toLowerCase().replace(/\.$/, "");
191
- if (ALLOWED_EXACT_HOSTS.has(host)) return true;
192
- for (const suffix of ALLOWED_HOST_SUFFIXES) {
193
- if (host.endsWith(suffix) && host.length > suffix.length) return true;
185
+ for (const base of ALLOWED_BASE_HOSTS) {
186
+ if (host === base || host.endsWith(`.${base}`)) return true;
194
187
  }
195
188
  return false;
196
189
  }