@opencode/plugin 0.0.0-dev-551 → 0.0.0-dev-554
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/gui/registries.d.ts +100 -0
- package/dist/gui/registries.js +10 -0
- package/package.json +8 -8
package/dist/gui/registries.d.ts
CHANGED
|
@@ -642,6 +642,96 @@ export interface ComposerPill {
|
|
|
642
642
|
*/
|
|
643
643
|
menu?(input: ComposerPillMenuProps): JSX.Element;
|
|
644
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* The seed colors a theme variant generates its scales from. Each is a hex color: `#rgb`, `#rgba`, `#rrggbb` or
|
|
647
|
+
* `#rrggbbaa`.
|
|
648
|
+
*/
|
|
649
|
+
export interface ThemeSeedColors {
|
|
650
|
+
/** Base of the gray scale. */
|
|
651
|
+
readonly neutral: string;
|
|
652
|
+
/** The brand and accent color. */
|
|
653
|
+
readonly primary: string;
|
|
654
|
+
/** Success states, usually green. */
|
|
655
|
+
readonly success: string;
|
|
656
|
+
/** Warning states, usually yellow or orange. */
|
|
657
|
+
readonly warning: string;
|
|
658
|
+
/** Error and critical states, usually red. */
|
|
659
|
+
readonly error: string;
|
|
660
|
+
/** Informational states, usually blue or purple. */
|
|
661
|
+
readonly info: string;
|
|
662
|
+
/** Links and interactive elements. */
|
|
663
|
+
readonly interactive: string;
|
|
664
|
+
/** Added lines in diffs. */
|
|
665
|
+
readonly diffAdd: string;
|
|
666
|
+
/** Deleted lines in diffs. */
|
|
667
|
+
readonly diffDelete: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* The palette a theme variant derives its colors from, the form most of the app's own themes use. Each is a hex color:
|
|
671
|
+
* `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`.
|
|
672
|
+
*/
|
|
673
|
+
export interface ThemePaletteColors {
|
|
674
|
+
/** The background the neutral scale starts from. */
|
|
675
|
+
readonly neutral: string;
|
|
676
|
+
/** The text color the neutral scale ends at. */
|
|
677
|
+
readonly ink: string;
|
|
678
|
+
/** The brand color. */
|
|
679
|
+
readonly primary: string;
|
|
680
|
+
/** Success states, usually green. */
|
|
681
|
+
readonly success: string;
|
|
682
|
+
/** Warning states, usually yellow or orange. */
|
|
683
|
+
readonly warning: string;
|
|
684
|
+
/** Error and critical states, usually red. */
|
|
685
|
+
readonly error: string;
|
|
686
|
+
/** Informational states, usually blue or purple. */
|
|
687
|
+
readonly info: string;
|
|
688
|
+
/** A secondary accent. Defaults to `info`. */
|
|
689
|
+
readonly accent?: string;
|
|
690
|
+
/** Links and interactive elements. Defaults to `primary`. */
|
|
691
|
+
readonly interactive?: string;
|
|
692
|
+
/** Added lines in diffs. Defaults to one derived from `success`. */
|
|
693
|
+
readonly diffAdd?: string;
|
|
694
|
+
/** Deleted lines in diffs. Defaults to one derived from `error`. */
|
|
695
|
+
readonly diffDelete?: string;
|
|
696
|
+
}
|
|
697
|
+
/** The fields every theme variant can have, whichever colors it starts from. */
|
|
698
|
+
interface ThemeVariantBase {
|
|
699
|
+
/** Exact values for single tokens, such as `syntax-keyword`: a hex color or a `var(--token)` reference. */
|
|
700
|
+
readonly overrides?: Readonly<Record<string, string>>;
|
|
701
|
+
/** Exact values for single tokens of the app's newer token set: a hex color, a `var(--token)` reference, or CSS. */
|
|
702
|
+
readonly v2Overrides?: Readonly<Record<string, string>>;
|
|
703
|
+
}
|
|
704
|
+
/** The colors of one color scheme of a `Theme`: generated from `seeds` or from a `palette`, never both. */
|
|
705
|
+
export type ThemeVariant = (ThemeVariantBase & {
|
|
706
|
+
/** The seed colors to generate from. */
|
|
707
|
+
readonly seeds: ThemeSeedColors;
|
|
708
|
+
/** Not allowed beside `seeds`. */
|
|
709
|
+
readonly palette?: never;
|
|
710
|
+
}) | (ThemeVariantBase & {
|
|
711
|
+
/** The palette to derive from. */
|
|
712
|
+
readonly palette: ThemePaletteColors;
|
|
713
|
+
/** Not allowed beside `palette`. */
|
|
714
|
+
readonly seeds?: never;
|
|
715
|
+
});
|
|
716
|
+
/**
|
|
717
|
+
* A color theme, in the format of the app's own themes (`https://opencode.ai/desktop-theme.json`), so a theme file
|
|
718
|
+
* imports as it is. The host lists it in Settings › Appearance › Theme among the app's themes, alphabetically by
|
|
719
|
+
* `name`, under the key `${plugin}:${id}`; withdrawing the theme takes it out of the list. A user who picked it keeps the choice: the window
|
|
720
|
+
* shows the theme's colors from the last run until the plugin contributes it again, and the default theme while it is
|
|
721
|
+
* withdrawn.
|
|
722
|
+
*/
|
|
723
|
+
export interface Theme {
|
|
724
|
+
/** The JSON Schema reference of a theme file. Ignored. */
|
|
725
|
+
readonly $schema?: string;
|
|
726
|
+
/** The name the theme list shows. */
|
|
727
|
+
readonly name: string;
|
|
728
|
+
/** The theme's id, unique within the plugin, in lowercase letters, digits and hyphens. */
|
|
729
|
+
readonly id: string;
|
|
730
|
+
/** The light color scheme. */
|
|
731
|
+
readonly light: ThemeVariant;
|
|
732
|
+
/** The dark color scheme. */
|
|
733
|
+
readonly dark: ThemeVariant;
|
|
734
|
+
}
|
|
645
735
|
/** The places a `Slot` renders, with the input each passes to `render`. */
|
|
646
736
|
export interface SlotMap {
|
|
647
737
|
/** Full-width strip under the window content, above toasts. */
|
|
@@ -805,3 +895,13 @@ export declare const Slot: Registry<Slot>;
|
|
|
805
895
|
* ```
|
|
806
896
|
*/
|
|
807
897
|
export declare const Style: Registry<string>;
|
|
898
|
+
/**
|
|
899
|
+
* The registry of color themes the user can pick in Settings › Appearance, in the format of the app's own theme files.
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* ```ts
|
|
903
|
+
* import theme from "./midnight.json"
|
|
904
|
+
* ctx.add(Theme, theme)
|
|
905
|
+
* ```
|
|
906
|
+
*/
|
|
907
|
+
export declare const Theme: Registry<Theme>;
|
package/dist/gui/registries.js
CHANGED
|
@@ -108,3 +108,13 @@ export const Slot = Registry.define("slot");
|
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
110
|
export const Style = Registry.define("style");
|
|
111
|
+
/**
|
|
112
|
+
* The registry of color themes the user can pick in Settings › Appearance, in the format of the app's own theme files.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* import theme from "./midnight.json"
|
|
117
|
+
* ctx.add(Theme, theme)
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export const Theme = Registry.define("theme");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/plugin",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-554",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@ai-sdk/provider": "3.0.8",
|
|
81
|
-
"@opencode/ai": "0.0.0-dev-
|
|
82
|
-
"@opencode/client": "0.0.0-dev-
|
|
83
|
-
"@opencode/protocol": "0.0.0-dev-
|
|
84
|
-
"@opencode/schema": "0.0.0-dev-
|
|
85
|
-
"@opencode/util": "0.0.0-dev-
|
|
81
|
+
"@opencode/ai": "0.0.0-dev-554",
|
|
82
|
+
"@opencode/client": "0.0.0-dev-554",
|
|
83
|
+
"@opencode/protocol": "0.0.0-dev-554",
|
|
84
|
+
"@opencode/schema": "0.0.0-dev-554",
|
|
85
|
+
"@opencode/util": "0.0.0-dev-554",
|
|
86
86
|
"effect": "4.1.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@opencode/theme": "0.0.0-dev-
|
|
89
|
+
"@opencode/theme": "0.0.0-dev-554",
|
|
90
90
|
"@opentui/core": ">=0.8.1",
|
|
91
91
|
"@opentui/solid": ">=0.8.1",
|
|
92
92
|
"electron": "*",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@opencode/theme": "0.0.0-dev-
|
|
121
|
+
"@opencode/theme": "0.0.0-dev-554",
|
|
122
122
|
"@opentui/core": "0.8.1",
|
|
123
123
|
"@opentui/solid": "0.8.1",
|
|
124
124
|
"@tsconfig/bun": "1.0.9",
|