@the-magic-tower/fixhive-opencode-plugin 0.1.10 → 0.1.12

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 (2) hide show
  1. package/dist/index.js +22 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1117,7 +1117,16 @@ var CloudClient = class {
1117
1117
  similarityThreshold;
1118
1118
  constructor(config) {
1119
1119
  this.supabase = createClient(config.supabaseUrl, config.supabaseAnonKey);
1120
- this.embedding = config.openaiApiKey ? new EmbeddingService(config.openaiApiKey) : null;
1120
+ if (config.openaiApiKey) {
1121
+ try {
1122
+ this.embedding = new EmbeddingService(config.openaiApiKey);
1123
+ } catch (err) {
1124
+ console.warn("[FixHive] Failed to initialize embedding service:", err);
1125
+ this.embedding = null;
1126
+ }
1127
+ } else {
1128
+ this.embedding = null;
1129
+ }
1121
1130
  this.contributorId = config.contributorId || generateContributorId();
1122
1131
  this.similarityThreshold = config.similarityThreshold || 0.7;
1123
1132
  }
@@ -1609,13 +1618,18 @@ var FixHivePlugin = async (ctx) => {
1609
1618
  const localStore = new LocalStore(ctx.directory);
1610
1619
  let cloudClient = null;
1611
1620
  if (config.supabaseUrl && config.supabaseAnonKey) {
1612
- cloudClient = new CloudClient({
1613
- supabaseUrl: config.supabaseUrl,
1614
- supabaseAnonKey: config.supabaseAnonKey,
1615
- openaiApiKey: config.openaiApiKey,
1616
- contributorId: config.contributorId,
1617
- similarityThreshold: config.similarityThreshold
1618
- });
1621
+ try {
1622
+ cloudClient = new CloudClient({
1623
+ supabaseUrl: config.supabaseUrl,
1624
+ supabaseAnonKey: config.supabaseAnonKey,
1625
+ openaiApiKey: config.openaiApiKey,
1626
+ contributorId: config.contributorId,
1627
+ similarityThreshold: config.similarityThreshold
1628
+ });
1629
+ } catch (err) {
1630
+ console.error("[FixHive] Failed to initialize cloud client:", err);
1631
+ console.error("[FixHive] Falling back to offline mode");
1632
+ }
1619
1633
  }
1620
1634
  const pluginContext = {
1621
1635
  sessionId: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-magic-tower/fixhive-opencode-plugin",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Community-based error knowledge sharing for OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "dist"
16
16
  ],
17
17
  "scripts": {
18
- "build": "tsup src/index.ts --format esm --dts --clean --external @supabase/supabase-js --external better-sqlite3 --external openai --external uuid",
18
+ "build": "tsup src/index.ts --format esm --dts --clean --target esnext --external @supabase/supabase-js --external better-sqlite3 --external openai --external uuid --external @opencode-ai/plugin --external zod",
19
19
  "build:dts": "tsup src/index.ts --format esm --dts --clean",
20
20
  "dev": "tsup src/index.ts --format esm --watch",
21
21
  "typecheck": "tsc --noEmit",
@@ -44,7 +44,7 @@
44
44
  "@opencode-ai/plugin": "^1.1.1"
45
45
  },
46
46
  "dependencies": {
47
- "@supabase/supabase-js": "^2.45.0",
47
+ "@supabase/supabase-js": "2.43.2",
48
48
  "better-sqlite3": "^12.5.0",
49
49
  "openai": "^6.16.0",
50
50
  "uuid": "^13.0.0",