opencode-supabase 0.1.2-alpha.1 → 0.1.2-alpha.2

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/README.md CHANGED
@@ -22,7 +22,7 @@ Connect your account and ask your agent about Supabase capabilities.
22
22
 
23
23
  ## Bundled Supabase Skills
24
24
 
25
- `opencode-supabase` ships the official Supabase agent skills by default:
25
+ `opencode-supabase` ships the official [Supabase agent skills](https://github.com/supabase/agent-skills) by default:
26
26
 
27
27
  - `supabase`
28
28
  - `supabase-postgres-best-practices`
@@ -43,7 +43,7 @@ If you want Supabase tools without bundled skills, disable them in plugin option
43
43
 
44
44
  ### Select Individual Skills
45
45
 
46
- Per-skill config is a partial override. Omitted skills stay enabled.
46
+ Set a bundled skill name to `false` to disable only that skill. Omitted skills stay enabled. Unknown keys are ignored with a warning.
47
47
 
48
48
  ```json
49
49
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-supabase",
3
- "version": "0.1.2-alpha.1",
3
+ "version": "0.1.2-alpha.2",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Supabase integration with server and TUI components",
6
6
  "license": "Apache-2.0",
@@ -27,7 +27,7 @@ to recognize anti-patterns.
27
27
 
28
28
  Include specific metrics. Helps agents prioritize fixes.
29
29
 
30
- **Good:** "10x faster queries", "50% smaller index", "Eliminates N+1"
30
+ **Good:** "10x faster queries", "50% smaller index", "Eliminates N+1"
31
31
  **Bad:** "Faster", "Better", "More efficient"
32
32
 
33
33
  ### 4. Self-Contained Examples
@@ -1,5 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
3
4
 
4
5
  export const BUNDLED_SUPABASE_SKILLS = [
5
6
  "supabase",
@@ -22,7 +23,7 @@ type RegisterDeps = ResolverDeps & {
22
23
  type ConfigWithSkills = object & {
23
24
  skills?: {
24
25
  paths?: unknown;
25
- } | false;
26
+ };
26
27
  };
27
28
 
28
29
  type SkillsConfig = {
@@ -66,7 +67,7 @@ export function resolveEnabledSupabaseSkills(options: unknown, deps: ResolverDep
66
67
  }
67
68
 
68
69
  export function defaultSkillsRoot() {
69
- return path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../skills");
70
+ return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../skills");
70
71
  }
71
72
 
72
73
  export function registerSupabaseSkillPaths(
@@ -78,19 +79,26 @@ export function registerSupabaseSkillPaths(
78
79
  const skillsRoot = deps.skillsRoot ?? defaultSkillsRoot();
79
80
  const exists = deps.exists ?? fs.existsSync;
80
81
  const enabled = resolveEnabledSupabaseSkills(options, deps);
81
- const skillsConfig: SkillsConfig = isRecord(configWithSkills.skills)
82
- ? (configWithSkills.skills as SkillsConfig)
83
- : {};
82
+ let skillsConfig: SkillsConfig;
84
83
 
85
- if (!isRecord(configWithSkills.skills)) {
84
+ if (configWithSkills.skills === undefined) {
85
+ skillsConfig = {};
86
86
  configWithSkills.skills = skillsConfig;
87
+ } else if (isRecord(configWithSkills.skills)) {
88
+ skillsConfig = configWithSkills.skills as SkillsConfig;
89
+ } else {
90
+ deps.warn?.("invalid Supabase skills config; leaving unchanged", {
91
+ value: configWithSkills.skills as unknown,
92
+ });
93
+ return;
87
94
  }
88
95
 
89
96
  if (!Array.isArray(skillsConfig.paths)) {
90
97
  if (skillsConfig.paths !== undefined) {
91
- deps.warn?.("invalid Supabase skills.paths value; resetting to array", {
98
+ deps.warn?.("invalid Supabase skills.paths value; leaving unchanged", {
92
99
  value: skillsConfig.paths as unknown,
93
100
  });
101
+ return;
94
102
  }
95
103
  skillsConfig.paths = [];
96
104
  }