@aipanel/provider-opencode 1.3.8 → 1.3.10

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.
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_OPENCODE_SETTINGS, OPENCODE_STORAGE_KEYS } from "./constants.js";
2
- import { WIDGET_MSG } from "@aipanel/core";
2
+ import { DEPENDENCY_DIR_NAME, DEPENDENCY_SOURCE_NOTE, WIDGET_MSG } from "@aipanel/core";
3
3
  function mergeSettings(defaultSettings, userSettings) {
4
4
  const result = { ...defaultSettings };
5
5
  if (!userSettings) return result;
@@ -26,6 +26,8 @@ function generateBridgeScript(options = {}) {
26
26
  if (language) {
27
27
  mergedSettings.general = { ...mergedSettings.general ?? {}, language };
28
28
  }
29
+ const dependencyDir = JSON.stringify(DEPENDENCY_DIR_NAME);
30
+ const dependencyNote = JSON.stringify(DEPENDENCY_SOURCE_NOTE);
29
31
  return `
30
32
  (function() {
31
33
  // \u7ACB\u5373\u6E05\u7406\u6B8B\u7559\u7684 session tabs \u5B58\u50A8\uFF0C\u5FC5\u987B\u5728 DOMContentLoaded \u4E4B\u524D\u6267\u884C
@@ -539,6 +541,10 @@ function generateBridgeScript(options = {}) {
539
541
  }
540
542
  const displayText = '@' + selector + (textPreview ? '(' + textPreview + ')' : '');
541
543
 
544
+ // \u4F9D\u8D56\u5185\u90E8\u6587\u4EF6\u663E\u5F0F\u58F0\u660E\u5F52\u5C5E\uFF08\u5224\u5B9A\u4F9D\u636E\u4E0E\u63AA\u8F9E\u6765\u81EA @aipanel/core\uFF0C\u751F\u6210\u671F\u6CE8\u5165\uFF09
545
+ const pathSegments = String(filePath || '').replace(/\\\\/g, '/').split('/');
546
+ const isDependency = pathSegments.indexOf(${dependencyDir}) !== -1;
547
+
542
548
  const jsonStr = JSON.stringify({
543
549
  nodeContext: {
544
550
  "filePath": {
@@ -564,7 +570,13 @@ function generateBridgeScript(options = {}) {
564
570
  "selectAt": {
565
571
  "value": previewPageUrl || '\u672A\u77E5',
566
572
  "desc": "\u7528\u6237\u9009\u4E2D\u8282\u70B9\u65F6\u7684\u9875\u9762 URL"
567
- }
573
+ },
574
+ ...(isDependency ? {
575
+ "sourceKind": {
576
+ "value": ${dependencyNote},
577
+ "desc": "\u6E90\u7801\u5F52\u5C5E"
578
+ }
579
+ } : {})
568
580
  }
569
581
  });
570
582
 
@@ -48,6 +48,8 @@ function generateBridgeScript(options = {}) {
48
48
  if (language) {
49
49
  mergedSettings.general = { ...mergedSettings.general ?? {}, language };
50
50
  }
51
+ const dependencyDir = JSON.stringify(import_core.DEPENDENCY_DIR_NAME);
52
+ const dependencyNote = JSON.stringify(import_core.DEPENDENCY_SOURCE_NOTE);
51
53
  return `
52
54
  (function() {
53
55
  // \u7ACB\u5373\u6E05\u7406\u6B8B\u7559\u7684 session tabs \u5B58\u50A8\uFF0C\u5FC5\u987B\u5728 DOMContentLoaded \u4E4B\u524D\u6267\u884C
@@ -561,6 +563,10 @@ function generateBridgeScript(options = {}) {
561
563
  }
562
564
  const displayText = '@' + selector + (textPreview ? '(' + textPreview + ')' : '');
563
565
 
566
+ // \u4F9D\u8D56\u5185\u90E8\u6587\u4EF6\u663E\u5F0F\u58F0\u660E\u5F52\u5C5E\uFF08\u5224\u5B9A\u4F9D\u636E\u4E0E\u63AA\u8F9E\u6765\u81EA @aipanel/core\uFF0C\u751F\u6210\u671F\u6CE8\u5165\uFF09
567
+ const pathSegments = String(filePath || '').replace(/\\\\/g, '/').split('/');
568
+ const isDependency = pathSegments.indexOf(${dependencyDir}) !== -1;
569
+
564
570
  const jsonStr = JSON.stringify({
565
571
  nodeContext: {
566
572
  "filePath": {
@@ -586,7 +592,13 @@ function generateBridgeScript(options = {}) {
586
592
  "selectAt": {
587
593
  "value": previewPageUrl || '\u672A\u77E5',
588
594
  "desc": "\u7528\u6237\u9009\u4E2D\u8282\u70B9\u65F6\u7684\u9875\u9762 URL"
589
- }
595
+ },
596
+ ...(isDependency ? {
597
+ "sourceKind": {
598
+ "value": ${dependencyNote},
599
+ "desc": "\u6E90\u7801\u5F52\u5C5E"
600
+ }
601
+ } : {})
590
602
  }
591
603
  });
592
604
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aipanel/provider-opencode",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -24,7 +24,7 @@
24
24
  "vitest": "^4.1.0"
25
25
  },
26
26
  "dependencies": {
27
- "@aipanel/core": "1.3.8",
27
+ "@aipanel/core": "1.3.10",
28
28
  "@opencode-ai/plugin": "^1.18.0",
29
29
  "execa": "^9.6.1"
30
30
  },