@openwaggle/extension-sdk 0.0.0-bootstrap.0 → 0.1.0
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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/agent-loop.d.ts +128 -0
- package/dist/agent-loop.js +47 -0
- package/dist/broker-validation.d.ts +17 -0
- package/dist/broker-validation.js +99 -0
- package/dist/broker.d.ts +193 -0
- package/dist/broker.js +81 -0
- package/dist/constants.d.ts +183 -0
- package/dist/constants.js +245 -0
- package/dist/context.d.ts +66 -0
- package/dist/context.js +49 -0
- package/dist/contribution-types.d.ts +21 -0
- package/dist/contribution-types.js +1 -0
- package/dist/core-types.d.ts +58 -0
- package/dist/core-types.js +1 -0
- package/dist/docs-validation.d.ts +3 -0
- package/dist/docs-validation.js +93 -0
- package/dist/docs.d.ts +231 -0
- package/dist/docs.js +85 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +10 -0
- package/dist/internal-validation.d.ts +4 -0
- package/dist/internal-validation.js +24 -0
- package/dist/json.d.ts +9 -0
- package/dist/json.js +3 -0
- package/dist/manifest-contributions.d.ts +380 -0
- package/dist/manifest-contributions.js +75 -0
- package/dist/manifest-primitives.d.ts +20 -0
- package/dist/manifest-primitives.js +118 -0
- package/dist/manifest.d.ts +303 -0
- package/dist/manifest.js +89 -0
- package/dist/openwaggle-sdk.d.ts +2 -0
- package/dist/openwaggle-sdk.js +127 -0
- package/dist/openwaggle-types.d.ts +111 -0
- package/dist/openwaggle-types.js +1 -0
- package/dist/openwaggle-validation.d.ts +12 -0
- package/dist/openwaggle-validation.js +135 -0
- package/dist/registry-types.d.ts +34 -0
- package/dist/registry-types.js +1 -0
- package/dist/runtime-sdk.d.ts +2 -0
- package/dist/runtime-sdk.js +19 -0
- package/dist/runtime-types.d.ts +19 -0
- package/dist/runtime-types.js +1 -0
- package/dist/runtime.d.ts +22 -0
- package/dist/runtime.js +22 -0
- package/dist/schema.d.ts +13 -0
- package/dist/schema.js +25 -0
- package/dist/sdk-types.d.ts +92 -0
- package/dist/sdk-types.js +1 -0
- package/dist/storage-sdk.d.ts +2 -0
- package/dist/storage-sdk.js +51 -0
- package/dist/storage-types.d.ts +40 -0
- package/dist/storage-types.js +1 -0
- package/dist/theme-data.d.ts +126 -0
- package/dist/theme-data.js +144 -0
- package/dist/theme-types.d.ts +61 -0
- package/dist/theme-types.js +1 -0
- package/dist/theme.d.ts +6 -0
- package/dist/theme.js +128 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +1 -0
- package/dist/ui-constants.d.ts +24 -0
- package/dist/ui-constants.js +22 -0
- package/dist/ui-stylesheet.d.ts +8 -0
- package/dist/ui-stylesheet.js +223 -0
- package/dist/ui.d.ts +6 -0
- package/dist/ui.js +16 -0
- package/dist-cjs/agent-loop.js +83 -0
- package/dist-cjs/broker-validation.js +109 -0
- package/dist-cjs/broker.js +120 -0
- package/dist-cjs/constants.js +248 -0
- package/dist-cjs/context.js +54 -0
- package/dist-cjs/contribution-types.js +2 -0
- package/dist-cjs/core-types.js +2 -0
- package/dist-cjs/docs-validation.js +97 -0
- package/dist-cjs/docs.js +121 -0
- package/dist-cjs/index.js +56 -0
- package/dist-cjs/internal-validation.js +30 -0
- package/dist-cjs/json.js +39 -0
- package/dist-cjs/manifest-contributions.js +111 -0
- package/dist-cjs/manifest-primitives.js +158 -0
- package/dist-cjs/manifest.js +140 -0
- package/dist-cjs/openwaggle-sdk.js +130 -0
- package/dist-cjs/openwaggle-types.js +2 -0
- package/dist-cjs/openwaggle-validation.js +148 -0
- package/dist-cjs/package.json +3 -0
- package/dist-cjs/registry-types.js +2 -0
- package/dist-cjs/runtime-sdk.js +22 -0
- package/dist-cjs/runtime-types.js +2 -0
- package/dist-cjs/runtime.js +61 -0
- package/dist-cjs/schema.js +61 -0
- package/dist-cjs/sdk-types.js +2 -0
- package/dist-cjs/storage-sdk.js +54 -0
- package/dist-cjs/storage-types.js +2 -0
- package/dist-cjs/theme-data.js +147 -0
- package/dist-cjs/theme-types.js +2 -0
- package/dist-cjs/theme.js +135 -0
- package/dist-cjs/types.js +2 -0
- package/dist-cjs/ui-constants.js +25 -0
- package/dist-cjs/ui-stylesheet.js +227 -0
- package/dist-cjs/ui.js +24 -0
- package/package.json +98 -8
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExtensionActionSelectProjectResult, ExtensionSettingsGetResult, ExtensionSettingsGetSettingResult, ExtensionSettingsUpdateResult, ExtensionSettingsUpdateSettingResult, ExtensionStateCurrentBranchReadResult, ExtensionStateCurrentProjectReadResult, ExtensionStateCurrentSessionReadResult, ExtensionStateModelPreferencesReadResult, ExtensionStateReadResult, ExtensionStateRecentProjectsReadResult } from './types.js';
|
|
2
|
+
export declare function isStateReadResult(value: unknown): value is ExtensionStateReadResult;
|
|
3
|
+
export declare function isStateCurrentProjectReadResult(value: unknown): value is ExtensionStateCurrentProjectReadResult;
|
|
4
|
+
export declare function isStateCurrentSessionReadResult(value: unknown): value is ExtensionStateCurrentSessionReadResult;
|
|
5
|
+
export declare function isStateCurrentBranchReadResult(value: unknown): value is ExtensionStateCurrentBranchReadResult;
|
|
6
|
+
export declare function isStateRecentProjectsReadResult(value: unknown): value is ExtensionStateRecentProjectsReadResult;
|
|
7
|
+
export declare function isStateModelPreferencesReadResult(value: unknown): value is ExtensionStateModelPreferencesReadResult;
|
|
8
|
+
export declare function isActionSelectProjectResult(value: unknown): value is ExtensionActionSelectProjectResult;
|
|
9
|
+
export declare function isSettingsGetResult(value: unknown): value is ExtensionSettingsGetResult;
|
|
10
|
+
export declare function isSettingsUpdateResult(value: unknown): value is ExtensionSettingsUpdateResult;
|
|
11
|
+
export declare function isSettingsGetSettingResult(value: unknown): value is ExtensionSettingsGetSettingResult;
|
|
12
|
+
export declare function isSettingsUpdateSettingResult(value: unknown): value is ExtensionSettingsUpdateSettingResult;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
2
|
+
import { isNonEmptyString, isRecord, isStringArray } from './internal-validation.js';
|
|
3
|
+
function isStringOrNull(value) {
|
|
4
|
+
return value === null || typeof value === 'string';
|
|
5
|
+
}
|
|
6
|
+
function isInvokeScope(value) {
|
|
7
|
+
if (!isRecord(value)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (value.kind === 'app') {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (value.kind === 'project') {
|
|
14
|
+
return isNonEmptyString(value.projectPath);
|
|
15
|
+
}
|
|
16
|
+
if (value.kind === 'session') {
|
|
17
|
+
return isNonEmptyString(value.projectPath) && isNonEmptyString(value.sessionId);
|
|
18
|
+
}
|
|
19
|
+
return (value.kind === 'branch' &&
|
|
20
|
+
isNonEmptyString(value.projectPath) &&
|
|
21
|
+
isNonEmptyString(value.sessionId) &&
|
|
22
|
+
isNonEmptyString(value.branchId));
|
|
23
|
+
}
|
|
24
|
+
function isStringRecord(value) {
|
|
25
|
+
return isRecord(value) && Object.values(value).every((entry) => typeof entry === 'string');
|
|
26
|
+
}
|
|
27
|
+
function isModelPreferences(value) {
|
|
28
|
+
return (isRecord(value) &&
|
|
29
|
+
typeof value.selectedModel === 'string' &&
|
|
30
|
+
isStringArray(value.favoriteModels) &&
|
|
31
|
+
isStringArray(value.enabledModels) &&
|
|
32
|
+
typeof value.thinkingLevel === 'string');
|
|
33
|
+
}
|
|
34
|
+
function isProjectView(value) {
|
|
35
|
+
return (isRecord(value) &&
|
|
36
|
+
isNonEmptyString(value.projectPath) &&
|
|
37
|
+
isStringOrNull(value.displayName) &&
|
|
38
|
+
typeof value.active === 'boolean');
|
|
39
|
+
}
|
|
40
|
+
function isSessionView(value) {
|
|
41
|
+
return (isRecord(value) &&
|
|
42
|
+
isNonEmptyString(value.sessionId) &&
|
|
43
|
+
isNonEmptyString(value.title) &&
|
|
44
|
+
isStringOrNull(value.projectPath));
|
|
45
|
+
}
|
|
46
|
+
function isBranchView(value) {
|
|
47
|
+
return (isRecord(value) &&
|
|
48
|
+
isNonEmptyString(value.branchId) &&
|
|
49
|
+
isNonEmptyString(value.sessionId) &&
|
|
50
|
+
isNonEmptyString(value.name) &&
|
|
51
|
+
typeof value.main === 'boolean' &&
|
|
52
|
+
typeof value.archived === 'boolean');
|
|
53
|
+
}
|
|
54
|
+
function hasOpenWaggleResultBase(value, capability, method) {
|
|
55
|
+
return (isNonEmptyString(value.extensionId) &&
|
|
56
|
+
isNonEmptyString(value.contributionId) &&
|
|
57
|
+
value.capability === capability &&
|
|
58
|
+
value.method === method);
|
|
59
|
+
}
|
|
60
|
+
export function isStateReadResult(value) {
|
|
61
|
+
return (isRecord(value) &&
|
|
62
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE, OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_STATE) &&
|
|
63
|
+
isInvokeScope(value.scope) &&
|
|
64
|
+
isStringOrNull(value.activeProjectPath) &&
|
|
65
|
+
(value.currentProject === null || isProjectView(value.currentProject)) &&
|
|
66
|
+
(value.currentSession === null || isSessionView(value.currentSession)) &&
|
|
67
|
+
(value.currentBranch === null || isBranchView(value.currentBranch)) &&
|
|
68
|
+
isStringArray(value.recentProjects) &&
|
|
69
|
+
isModelPreferences(value.modelPreferences));
|
|
70
|
+
}
|
|
71
|
+
function isSelectedStateResult(value, selector, isSelectedValue) {
|
|
72
|
+
return (isRecord(value) &&
|
|
73
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE, OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE) &&
|
|
74
|
+
isInvokeScope(value.scope) &&
|
|
75
|
+
value.selector === selector &&
|
|
76
|
+
isSelectedValue(value.value));
|
|
77
|
+
}
|
|
78
|
+
export function isStateCurrentProjectReadResult(value) {
|
|
79
|
+
return isSelectedStateResult(value, OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_PROJECT, (selectedValue) => selectedValue === null || isProjectView(selectedValue));
|
|
80
|
+
}
|
|
81
|
+
export function isStateCurrentSessionReadResult(value) {
|
|
82
|
+
return isSelectedStateResult(value, OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_SESSION, (selectedValue) => selectedValue === null || isSessionView(selectedValue));
|
|
83
|
+
}
|
|
84
|
+
export function isStateCurrentBranchReadResult(value) {
|
|
85
|
+
return isSelectedStateResult(value, OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_BRANCH, (selectedValue) => selectedValue === null || isBranchView(selectedValue));
|
|
86
|
+
}
|
|
87
|
+
export function isStateRecentProjectsReadResult(value) {
|
|
88
|
+
return isSelectedStateResult(value, OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.RECENT_PROJECTS, isStringArray);
|
|
89
|
+
}
|
|
90
|
+
export function isStateModelPreferencesReadResult(value) {
|
|
91
|
+
return isSelectedStateResult(value, OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.MODEL_PREFERENCES, isModelPreferences);
|
|
92
|
+
}
|
|
93
|
+
export function isActionSelectProjectResult(value) {
|
|
94
|
+
return (isRecord(value) &&
|
|
95
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.ACTIONS, OPENWAGGLE_EXTENSION_BROKER.METHOD.SELECT_PROJECT) &&
|
|
96
|
+
isStringOrNull(value.previousProjectPath) &&
|
|
97
|
+
isNonEmptyString(value.projectPath) &&
|
|
98
|
+
isStringArray(value.recentProjects));
|
|
99
|
+
}
|
|
100
|
+
function isSettingsView(value) {
|
|
101
|
+
return (isRecord(value) &&
|
|
102
|
+
isModelPreferences(value.modelPreferences) &&
|
|
103
|
+
isStringRecord(value.projectDisplayNames));
|
|
104
|
+
}
|
|
105
|
+
function isSettingsSelectedValue(value) {
|
|
106
|
+
if (!isRecord(value)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (value.key === OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.MODEL_PREFERENCES) {
|
|
110
|
+
return isModelPreferences(value.value);
|
|
111
|
+
}
|
|
112
|
+
return (value.key === OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.PROJECT_DISPLAY_NAME &&
|
|
113
|
+
isNonEmptyString(value.projectPath) &&
|
|
114
|
+
isStringOrNull(value.value));
|
|
115
|
+
}
|
|
116
|
+
export function isSettingsGetResult(value) {
|
|
117
|
+
return (isRecord(value) &&
|
|
118
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS, OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTINGS) &&
|
|
119
|
+
isSettingsView(value.settings));
|
|
120
|
+
}
|
|
121
|
+
export function isSettingsUpdateResult(value) {
|
|
122
|
+
return (isRecord(value) &&
|
|
123
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS, OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTINGS) &&
|
|
124
|
+
isSettingsView(value.settings));
|
|
125
|
+
}
|
|
126
|
+
export function isSettingsGetSettingResult(value) {
|
|
127
|
+
return (isRecord(value) &&
|
|
128
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS, OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTING) &&
|
|
129
|
+
isSettingsSelectedValue(value.setting));
|
|
130
|
+
}
|
|
131
|
+
export function isSettingsUpdateSettingResult(value) {
|
|
132
|
+
return (isRecord(value) &&
|
|
133
|
+
hasOpenWaggleResultBase(value, OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS, OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTING) &&
|
|
134
|
+
isSettingsSelectedValue(value.setting));
|
|
135
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ExtensionCapabilityScope, ExtensionContributionFamily, ExtensionContributionMatchView, ExtensionContributionRuntime, ExtensionContributionTargetView, ExtensionExecutionPlacement } from './contribution-types.js';
|
|
2
|
+
export type ExtensionPackageScopeKind = 'global' | 'project';
|
|
3
|
+
export interface ExtensionPackageScopeView {
|
|
4
|
+
readonly kind: ExtensionPackageScopeKind;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly projectPath?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtensionContributionRegistryEntry {
|
|
9
|
+
readonly extensionId: string;
|
|
10
|
+
readonly extensionName: string;
|
|
11
|
+
readonly extensionVersion: string;
|
|
12
|
+
readonly scope: ExtensionPackageScopeView;
|
|
13
|
+
readonly packagePath: string;
|
|
14
|
+
readonly manifestPath: string;
|
|
15
|
+
readonly contentHash: string;
|
|
16
|
+
readonly projectPaths: readonly string[];
|
|
17
|
+
readonly sessionId?: string;
|
|
18
|
+
readonly appliesToAllRequestedProjects: boolean;
|
|
19
|
+
readonly family: ExtensionContributionFamily;
|
|
20
|
+
readonly contributionId: string;
|
|
21
|
+
readonly title: string;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly category?: string;
|
|
24
|
+
readonly capability?: string;
|
|
25
|
+
readonly method?: string;
|
|
26
|
+
readonly methods?: readonly string[];
|
|
27
|
+
readonly declaredScopes?: readonly ExtensionCapabilityScope[];
|
|
28
|
+
readonly networkOrigins?: readonly string[];
|
|
29
|
+
readonly target?: ExtensionContributionTargetView;
|
|
30
|
+
readonly matches?: ExtensionContributionMatchView;
|
|
31
|
+
readonly runtime?: ExtensionContributionRuntime;
|
|
32
|
+
readonly execution?: ExtensionExecutionPlacement;
|
|
33
|
+
readonly entryPath?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isRuntimeRegisterContributionResult, isRuntimeUnregisterContributionResult, toDecodedOperationResult, } from './broker-validation.js';
|
|
2
|
+
import { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
3
|
+
const RUNTIME_CONTRIBUTION_RESULT_ERROR = 'Extension broker returned an invalid runtime contribution result.';
|
|
4
|
+
export function createRuntimeContributionSdk(invoke) {
|
|
5
|
+
return {
|
|
6
|
+
registerContribution: async (scope, registration) => toDecodedOperationResult(await invoke({
|
|
7
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME,
|
|
8
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.REGISTER_CONTRIBUTION,
|
|
9
|
+
scope,
|
|
10
|
+
payload: registration,
|
|
11
|
+
}), isRuntimeRegisterContributionResult, RUNTIME_CONTRIBUTION_RESULT_ERROR),
|
|
12
|
+
unregisterContribution: async (scope, unregistration) => toDecodedOperationResult(await invoke({
|
|
13
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME,
|
|
14
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.UNREGISTER_CONTRIBUTION,
|
|
15
|
+
scope,
|
|
16
|
+
payload: unregistration,
|
|
17
|
+
}), isRuntimeUnregisterContributionResult, RUNTIME_CONTRIBUTION_RESULT_ERROR),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
2
|
+
import type { ExtensionContributionFamily } from './contribution-types.js';
|
|
3
|
+
export interface ExtensionRuntimeRegisterContributionResult {
|
|
4
|
+
readonly extensionId: string;
|
|
5
|
+
readonly contributionId: string;
|
|
6
|
+
readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME;
|
|
7
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.REGISTER_CONTRIBUTION;
|
|
8
|
+
readonly family: ExtensionContributionFamily;
|
|
9
|
+
readonly registeredContributionId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ExtensionRuntimeUnregisterContributionResult {
|
|
12
|
+
readonly extensionId: string;
|
|
13
|
+
readonly contributionId: string;
|
|
14
|
+
readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME;
|
|
15
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.UNREGISTER_CONTRIBUTION;
|
|
16
|
+
readonly family: ExtensionContributionFamily;
|
|
17
|
+
readonly unregisteredContributionId: string;
|
|
18
|
+
readonly unregistered: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
export type { ExtensionContributionRegistration, ExtensionContributionUnregistration, } from './manifest.js';
|
|
3
|
+
export { extensionContributionRegistrationSchema, extensionContributionUnregistrationSchema, } from './manifest.js';
|
|
4
|
+
export { createRuntimeContributionSdk } from './runtime-sdk.js';
|
|
5
|
+
export type * from './runtime-types.js';
|
|
6
|
+
export declare const extensionRuntimeRegisterContributionResultSchema: Schema.Struct<{
|
|
7
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
8
|
+
contributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
9
|
+
capability: Schema.Literal<["openwaggle.runtime"]>;
|
|
10
|
+
method: Schema.Literal<["register-contribution"]>;
|
|
11
|
+
family: Schema.Literal<["commands", "slashCommands", "routes", "settingsSections", "sidePanels", "dialogs", "transcriptRenderers", "toolRenderers", "customMessageRenderers", "interactionRenderers", "statusWidgets"]>;
|
|
12
|
+
registeredContributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const extensionRuntimeUnregisterContributionResultSchema: Schema.Struct<{
|
|
15
|
+
extensionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
16
|
+
contributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
17
|
+
capability: Schema.Literal<["openwaggle.runtime"]>;
|
|
18
|
+
method: Schema.Literal<["unregister-contribution"]>;
|
|
19
|
+
family: Schema.Literal<["commands", "slashCommands", "routes", "settingsSections", "sidePanels", "dialogs", "transcriptRenderers", "toolRenderers", "customMessageRenderers", "interactionRenderers", "statusWidgets"]>;
|
|
20
|
+
unregisteredContributionId: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
21
|
+
unregistered: typeof Schema.Boolean;
|
|
22
|
+
}>;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
3
|
+
import { extensionContributionFamilySchema, extensionContributionIdSchema, extensionIdSchema, } from './manifest.js';
|
|
4
|
+
export { extensionContributionRegistrationSchema, extensionContributionUnregistrationSchema, } from './manifest.js';
|
|
5
|
+
export { createRuntimeContributionSdk } from './runtime-sdk.js';
|
|
6
|
+
export const extensionRuntimeRegisterContributionResultSchema = Schema.Struct({
|
|
7
|
+
extensionId: extensionIdSchema,
|
|
8
|
+
contributionId: extensionContributionIdSchema,
|
|
9
|
+
capability: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME),
|
|
10
|
+
method: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.METHOD.REGISTER_CONTRIBUTION),
|
|
11
|
+
family: extensionContributionFamilySchema,
|
|
12
|
+
registeredContributionId: extensionContributionIdSchema,
|
|
13
|
+
});
|
|
14
|
+
export const extensionRuntimeUnregisterContributionResultSchema = Schema.Struct({
|
|
15
|
+
extensionId: extensionIdSchema,
|
|
16
|
+
contributionId: extensionContributionIdSchema,
|
|
17
|
+
capability: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.RUNTIME),
|
|
18
|
+
method: Schema.Literal(OPENWAGGLE_EXTENSION_BROKER.METHOD.UNREGISTER_CONTRIBUTION),
|
|
19
|
+
family: extensionContributionFamilySchema,
|
|
20
|
+
unregisteredContributionId: extensionContributionIdSchema,
|
|
21
|
+
unregistered: Schema.Boolean,
|
|
22
|
+
});
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
|
+
type AnySchema = Schema.Schema.AnyNoContext;
|
|
3
|
+
export type SchemaType<TSchema extends AnySchema> = Schema.Schema.Type<TSchema>;
|
|
4
|
+
export interface ExtensionSchemaDecodeSuccess<TValue> {
|
|
5
|
+
readonly success: true;
|
|
6
|
+
readonly data: TValue;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtensionSchemaDecodeFailure {
|
|
9
|
+
readonly success: false;
|
|
10
|
+
readonly issues: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function safeDecodeExtensionSchema<TValue, TEncoded>(schema: Schema.Schema<TValue, TEncoded, never>, value: unknown): ExtensionSchemaDecodeSuccess<TValue> | ExtensionSchemaDecodeFailure;
|
|
13
|
+
export {};
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as ParseResult from 'effect/ParseResult';
|
|
2
|
+
function formatIssuePath(path) {
|
|
3
|
+
const joinedPath = path.map(String).join('.');
|
|
4
|
+
return joinedPath.length > 0 ? joinedPath : '(root)';
|
|
5
|
+
}
|
|
6
|
+
function formatParseError(error) {
|
|
7
|
+
return ParseResult.ArrayFormatter.formatErrorSync(error).map((issue) => `${formatIssuePath(issue.path)}: ${issue.message}`);
|
|
8
|
+
}
|
|
9
|
+
export function safeDecodeExtensionSchema(schema, value) {
|
|
10
|
+
try {
|
|
11
|
+
return {
|
|
12
|
+
success: true,
|
|
13
|
+
data: ParseResult.decodeUnknownSync(schema)(value),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (ParseResult.isParseError(error)) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
issues: formatParseError(error),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { JsonValue } from './json.js';
|
|
2
|
+
import type { ExtensionActionSelectProjectResult, ExtensionDocsDiscoverPayload, ExtensionDocsDiscoverResult, ExtensionDocsResolveTopicPayload, ExtensionDocsResolveTopicResult, ExtensionInvokeFailure, ExtensionInvokeInput, ExtensionInvokeResult, ExtensionInvokeScope, ExtensionInvokeSuccess, ExtensionModelPreferencesSettingsPatch, ExtensionRuntimeRegisterContributionPayload, ExtensionRuntimeRegisterContributionResult, ExtensionRuntimeUnregisterContributionPayload, ExtensionRuntimeUnregisterContributionResult, ExtensionSettingsGetResult, ExtensionSettingsGetSettingResult, ExtensionSettingsUpdatePayload, ExtensionSettingsUpdateResult, ExtensionSettingsUpdateSettingResult, ExtensionStateCurrentBranchReadResult, ExtensionStateCurrentProjectReadResult, ExtensionStateCurrentSessionReadResult, ExtensionStateModelPreferencesReadResult, ExtensionStateReadResult, ExtensionStateRecentProjectsReadResult, ExtensionStorageDeleteResult, ExtensionStorageGetResult, ExtensionStorageListResult, ExtensionStorageSetResult } from './types.js';
|
|
3
|
+
export type ExtensionOperationSuccess<TValue> = ExtensionInvokeSuccess<TValue>;
|
|
4
|
+
export type ExtensionStorageGetOperationResult = ExtensionOperationSuccess<ExtensionStorageGetResult> | ExtensionInvokeFailure;
|
|
5
|
+
export type ExtensionStorageSetOperationResult = ExtensionOperationSuccess<ExtensionStorageSetResult> | ExtensionInvokeFailure;
|
|
6
|
+
export type ExtensionStorageDeleteOperationResult = ExtensionOperationSuccess<ExtensionStorageDeleteResult> | ExtensionInvokeFailure;
|
|
7
|
+
export type ExtensionStorageListOperationResult = ExtensionOperationSuccess<ExtensionStorageListResult> | ExtensionInvokeFailure;
|
|
8
|
+
export type ExtensionRuntimeRegisterContributionOperationResult = ExtensionOperationSuccess<ExtensionRuntimeRegisterContributionResult> | ExtensionInvokeFailure;
|
|
9
|
+
export type ExtensionRuntimeUnregisterContributionOperationResult = ExtensionOperationSuccess<ExtensionRuntimeUnregisterContributionResult> | ExtensionInvokeFailure;
|
|
10
|
+
export type ExtensionStateReadOperationResult = ExtensionOperationSuccess<ExtensionStateReadResult> | ExtensionInvokeFailure;
|
|
11
|
+
export type ExtensionStateCurrentProjectReadOperationResult = ExtensionOperationSuccess<ExtensionStateCurrentProjectReadResult> | ExtensionInvokeFailure;
|
|
12
|
+
export type ExtensionStateCurrentSessionReadOperationResult = ExtensionOperationSuccess<ExtensionStateCurrentSessionReadResult> | ExtensionInvokeFailure;
|
|
13
|
+
export type ExtensionStateCurrentBranchReadOperationResult = ExtensionOperationSuccess<ExtensionStateCurrentBranchReadResult> | ExtensionInvokeFailure;
|
|
14
|
+
export type ExtensionStateRecentProjectsReadOperationResult = ExtensionOperationSuccess<ExtensionStateRecentProjectsReadResult> | ExtensionInvokeFailure;
|
|
15
|
+
export type ExtensionStateModelPreferencesReadOperationResult = ExtensionOperationSuccess<ExtensionStateModelPreferencesReadResult> | ExtensionInvokeFailure;
|
|
16
|
+
export type ExtensionSelectProjectOperationResult = ExtensionOperationSuccess<ExtensionActionSelectProjectResult> | ExtensionInvokeFailure;
|
|
17
|
+
export type ExtensionDocsDiscoverOperationResult = ExtensionOperationSuccess<ExtensionDocsDiscoverResult> | ExtensionInvokeFailure;
|
|
18
|
+
export type ExtensionDocsResolveTopicOperationResult = ExtensionOperationSuccess<ExtensionDocsResolveTopicResult> | ExtensionInvokeFailure;
|
|
19
|
+
export type ExtensionSettingsGetOperationResult = ExtensionOperationSuccess<ExtensionSettingsGetResult> | ExtensionInvokeFailure;
|
|
20
|
+
export type ExtensionSettingsGetSettingOperationResult = ExtensionOperationSuccess<ExtensionSettingsGetSettingResult> | ExtensionInvokeFailure;
|
|
21
|
+
export type ExtensionSettingsUpdateOperationResult = ExtensionOperationSuccess<ExtensionSettingsUpdateResult> | ExtensionInvokeFailure;
|
|
22
|
+
export type ExtensionSettingsUpdateSettingOperationResult = ExtensionOperationSuccess<ExtensionSettingsUpdateSettingResult> | ExtensionInvokeFailure;
|
|
23
|
+
export interface ExtensionSdkIdentity {
|
|
24
|
+
readonly extensionId: string;
|
|
25
|
+
readonly contributionId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ExtensionSdkInvokeRequest {
|
|
28
|
+
readonly capability: string;
|
|
29
|
+
readonly method: string;
|
|
30
|
+
readonly scope: ExtensionInvokeScope;
|
|
31
|
+
readonly payload?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export type ExtensionBrokerTransport = (input: ExtensionInvokeInput) => Promise<ExtensionInvokeResult>;
|
|
34
|
+
export type ExtensionSdkInvoke = (request: ExtensionSdkInvokeRequest) => Promise<ExtensionInvokeResult>;
|
|
35
|
+
export interface ExtensionStorageScopeSdk {
|
|
36
|
+
readonly get: (scope: ExtensionInvokeScope, key: string) => Promise<ExtensionInvokeResult<ExtensionStorageGetResult>>;
|
|
37
|
+
readonly set: (scope: ExtensionInvokeScope, key: string, value: JsonValue) => Promise<ExtensionInvokeResult<ExtensionStorageSetResult>>;
|
|
38
|
+
readonly delete: (scope: ExtensionInvokeScope, key: string) => Promise<ExtensionInvokeResult<ExtensionStorageDeleteResult>>;
|
|
39
|
+
readonly list: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStorageListResult>>;
|
|
40
|
+
}
|
|
41
|
+
export interface ExtensionPackageStorageKindSdk {
|
|
42
|
+
readonly global: ExtensionStorageScopeSdk;
|
|
43
|
+
readonly project: ExtensionStorageScopeSdk;
|
|
44
|
+
}
|
|
45
|
+
export interface ExtensionPackageStorageSdk {
|
|
46
|
+
readonly packageState: ExtensionPackageStorageKindSdk;
|
|
47
|
+
readonly packageConfig: ExtensionPackageStorageKindSdk;
|
|
48
|
+
}
|
|
49
|
+
export interface ExtensionOpenWaggleStateSdk {
|
|
50
|
+
readonly get: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateReadResult>>;
|
|
51
|
+
readonly readCurrentProject: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateCurrentProjectReadResult>>;
|
|
52
|
+
readonly readCurrentSession: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateCurrentSessionReadResult>>;
|
|
53
|
+
readonly readCurrentBranch: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateCurrentBranchReadResult>>;
|
|
54
|
+
readonly readRecentProjects: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateRecentProjectsReadResult>>;
|
|
55
|
+
readonly readModelPreferences: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionStateModelPreferencesReadResult>>;
|
|
56
|
+
}
|
|
57
|
+
export interface ExtensionOpenWaggleSettingsSdk {
|
|
58
|
+
readonly get: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionSettingsGetResult>>;
|
|
59
|
+
readonly getModelPreferences: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult<ExtensionSettingsGetSettingResult>>;
|
|
60
|
+
readonly updateModelPreferences: (scope: ExtensionInvokeScope, value: ExtensionModelPreferencesSettingsPatch) => Promise<ExtensionInvokeResult<ExtensionSettingsUpdateSettingResult>>;
|
|
61
|
+
readonly getProjectDisplayName: (scope: ExtensionInvokeScope, projectPath: string) => Promise<ExtensionInvokeResult<ExtensionSettingsGetSettingResult>>;
|
|
62
|
+
readonly setProjectDisplayName: (scope: ExtensionInvokeScope, projectPath: string, value: string | null) => Promise<ExtensionInvokeResult<ExtensionSettingsUpdateSettingResult>>;
|
|
63
|
+
readonly update: (scope: ExtensionInvokeScope, settings: ExtensionSettingsUpdatePayload) => Promise<ExtensionInvokeResult<ExtensionSettingsUpdateResult>>;
|
|
64
|
+
}
|
|
65
|
+
export interface ExtensionOpenWaggleSdk {
|
|
66
|
+
readonly state: ExtensionOpenWaggleStateSdk;
|
|
67
|
+
readonly actions: {
|
|
68
|
+
readonly selectProject: (scope: ExtensionInvokeScope, projectPath: string) => Promise<ExtensionInvokeResult<ExtensionActionSelectProjectResult>>;
|
|
69
|
+
readonly openExternal: (url: string) => Promise<void>;
|
|
70
|
+
};
|
|
71
|
+
readonly settings: ExtensionOpenWaggleSettingsSdk;
|
|
72
|
+
readonly docs: {
|
|
73
|
+
readonly discover: (scope: ExtensionInvokeScope, input?: ExtensionDocsDiscoverPayload) => Promise<ExtensionInvokeResult<ExtensionDocsDiscoverResult>>;
|
|
74
|
+
readonly resolveTopic: (scope: ExtensionInvokeScope, input: ExtensionDocsResolveTopicPayload) => Promise<ExtensionInvokeResult<ExtensionDocsResolveTopicResult>>;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface ExtensionRuntimeContributionSdk {
|
|
78
|
+
readonly registerContribution: (scope: ExtensionInvokeScope, registration: ExtensionRuntimeRegisterContributionPayload) => Promise<ExtensionInvokeResult<ExtensionRuntimeRegisterContributionResult>>;
|
|
79
|
+
readonly unregisterContribution: (scope: ExtensionInvokeScope, unregistration: ExtensionRuntimeUnregisterContributionPayload) => Promise<ExtensionInvokeResult<ExtensionRuntimeUnregisterContributionResult>>;
|
|
80
|
+
}
|
|
81
|
+
export interface ExtensionBrokerSdk {
|
|
82
|
+
readonly invoke: ExtensionSdkInvoke;
|
|
83
|
+
readonly hostContext: {
|
|
84
|
+
readonly getScope: (scope: ExtensionInvokeScope) => Promise<ExtensionInvokeResult>;
|
|
85
|
+
};
|
|
86
|
+
readonly storage: ExtensionPackageStorageSdk;
|
|
87
|
+
readonly openWaggle: ExtensionOpenWaggleSdk;
|
|
88
|
+
readonly runtime: ExtensionRuntimeContributionSdk;
|
|
89
|
+
}
|
|
90
|
+
export interface CreateOpenWaggleSdkOptions {
|
|
91
|
+
readonly openExternal?: (url: string) => Promise<void>;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isStorageDeleteResult, isStorageGetResult, isStorageListResult, isStorageSetResult, toDecodedOperationResult, } from './broker-validation.js';
|
|
2
|
+
import { OPENWAGGLE_EXTENSION, OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
3
|
+
const STORAGE_RESULT_ERROR = 'Extension broker returned an invalid storage result.';
|
|
4
|
+
function storagePayload(storageKind, storageScope, key, value) {
|
|
5
|
+
return {
|
|
6
|
+
storageKind,
|
|
7
|
+
storageScope,
|
|
8
|
+
...(key !== undefined ? { key } : {}),
|
|
9
|
+
...(value !== undefined ? { value } : {}),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function createStorageScopeSdk(invoke, storageKind, storageScope) {
|
|
13
|
+
return {
|
|
14
|
+
get: async (scope, key) => toDecodedOperationResult(await invoke({
|
|
15
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STORAGE,
|
|
16
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.GET,
|
|
17
|
+
scope,
|
|
18
|
+
payload: storagePayload(storageKind, storageScope, key),
|
|
19
|
+
}), isStorageGetResult, STORAGE_RESULT_ERROR),
|
|
20
|
+
set: async (scope, key, value) => toDecodedOperationResult(await invoke({
|
|
21
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STORAGE,
|
|
22
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.SET,
|
|
23
|
+
scope,
|
|
24
|
+
payload: storagePayload(storageKind, storageScope, key, value),
|
|
25
|
+
}), isStorageSetResult, STORAGE_RESULT_ERROR),
|
|
26
|
+
delete: async (scope, key) => toDecodedOperationResult(await invoke({
|
|
27
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STORAGE,
|
|
28
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.DELETE,
|
|
29
|
+
scope,
|
|
30
|
+
payload: storagePayload(storageKind, storageScope, key),
|
|
31
|
+
}), isStorageDeleteResult, STORAGE_RESULT_ERROR),
|
|
32
|
+
list: async (scope) => toDecodedOperationResult(await invoke({
|
|
33
|
+
capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STORAGE,
|
|
34
|
+
method: OPENWAGGLE_EXTENSION_BROKER.METHOD.LIST,
|
|
35
|
+
scope,
|
|
36
|
+
payload: storagePayload(storageKind, storageScope),
|
|
37
|
+
}), isStorageListResult, STORAGE_RESULT_ERROR),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function createStorageKindSdk(invoke, storageKind) {
|
|
41
|
+
return {
|
|
42
|
+
global: createStorageScopeSdk(invoke, storageKind, OPENWAGGLE_EXTENSION.STORAGE.SCOPE.GLOBAL_KIND),
|
|
43
|
+
project: createStorageScopeSdk(invoke, storageKind, OPENWAGGLE_EXTENSION.STORAGE.SCOPE.PROJECT_KIND),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function createPackageStorageSdk(invoke) {
|
|
47
|
+
return {
|
|
48
|
+
packageState: createStorageKindSdk(invoke, OPENWAGGLE_EXTENSION.STORAGE.KIND.STATE),
|
|
49
|
+
packageConfig: createStorageKindSdk(invoke, OPENWAGGLE_EXTENSION.STORAGE.KIND.CONFIG),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { OPENWAGGLE_EXTENSION, OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
|
|
2
|
+
import type { JsonValue } from './json.js';
|
|
3
|
+
type ConstantValue<TObject> = TObject[keyof TObject];
|
|
4
|
+
export type ExtensionStorageKind = ConstantValue<typeof OPENWAGGLE_EXTENSION.STORAGE.KIND>;
|
|
5
|
+
export type ExtensionStorageScopeSelector = (typeof OPENWAGGLE_EXTENSION.STORAGE.SCOPE_KINDS)[number];
|
|
6
|
+
export type ExtensionStorageScope = {
|
|
7
|
+
readonly kind: typeof OPENWAGGLE_EXTENSION.STORAGE.SCOPE.GLOBAL_KIND;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: typeof OPENWAGGLE_EXTENSION.STORAGE.SCOPE.PROJECT_KIND;
|
|
10
|
+
readonly projectPath: string;
|
|
11
|
+
};
|
|
12
|
+
export interface ExtensionStorageResultBase {
|
|
13
|
+
readonly extensionId: string;
|
|
14
|
+
readonly contributionId: string;
|
|
15
|
+
readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STORAGE;
|
|
16
|
+
readonly storageKind: ExtensionStorageKind;
|
|
17
|
+
readonly storageScope: ExtensionStorageScope;
|
|
18
|
+
}
|
|
19
|
+
export interface ExtensionStorageGetResult extends ExtensionStorageResultBase {
|
|
20
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.GET;
|
|
21
|
+
readonly key: string;
|
|
22
|
+
readonly value: JsonValue | null;
|
|
23
|
+
}
|
|
24
|
+
export interface ExtensionStorageSetResult extends ExtensionStorageResultBase {
|
|
25
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.SET;
|
|
26
|
+
readonly key: string;
|
|
27
|
+
readonly value: JsonValue;
|
|
28
|
+
readonly createdAt: number;
|
|
29
|
+
readonly updatedAt: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ExtensionStorageDeleteResult extends ExtensionStorageResultBase {
|
|
32
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.DELETE;
|
|
33
|
+
readonly key: string;
|
|
34
|
+
readonly deleted: true;
|
|
35
|
+
}
|
|
36
|
+
export interface ExtensionStorageListResult extends ExtensionStorageResultBase {
|
|
37
|
+
readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.LIST;
|
|
38
|
+
readonly keys: readonly string[];
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export declare const OPENWAGGLE_EXTENSION_THEME_CSS_VARIABLES: {
|
|
2
|
+
readonly color: {
|
|
3
|
+
readonly background: "--ow-color-background";
|
|
4
|
+
readonly surface: "--ow-color-surface";
|
|
5
|
+
readonly surfaceRaised: "--ow-color-surface-raised";
|
|
6
|
+
readonly surfaceHover: "--ow-color-surface-hover";
|
|
7
|
+
readonly surfaceActive: "--ow-color-surface-active";
|
|
8
|
+
readonly border: "--ow-color-border";
|
|
9
|
+
readonly borderStrong: "--ow-color-border-strong";
|
|
10
|
+
readonly text: "--ow-color-text";
|
|
11
|
+
readonly textSubtle: "--ow-color-text-subtle";
|
|
12
|
+
readonly textMuted: "--ow-color-text-muted";
|
|
13
|
+
readonly textDim: "--ow-color-text-dim";
|
|
14
|
+
readonly accent: "--ow-color-accent";
|
|
15
|
+
readonly accentDim: "--ow-color-accent-dim";
|
|
16
|
+
readonly success: "--ow-color-success";
|
|
17
|
+
readonly danger: "--ow-color-danger";
|
|
18
|
+
readonly warning: "--ow-color-warning";
|
|
19
|
+
readonly info: "--ow-color-info";
|
|
20
|
+
};
|
|
21
|
+
readonly typography: {
|
|
22
|
+
readonly sansFamily: "--ow-font-family-sans";
|
|
23
|
+
readonly monoFamily: "--ow-font-family-mono";
|
|
24
|
+
};
|
|
25
|
+
readonly spacing: {
|
|
26
|
+
readonly xs: "--ow-space-xs";
|
|
27
|
+
readonly sm: "--ow-space-sm";
|
|
28
|
+
readonly md: "--ow-space-md";
|
|
29
|
+
readonly lg: "--ow-space-lg";
|
|
30
|
+
readonly xl: "--ow-space-xl";
|
|
31
|
+
};
|
|
32
|
+
readonly radius: {
|
|
33
|
+
readonly sm: "--ow-radius-sm";
|
|
34
|
+
readonly md: "--ow-radius-md";
|
|
35
|
+
readonly lg: "--ow-radius-lg";
|
|
36
|
+
readonly panel: "--ow-radius-panel";
|
|
37
|
+
};
|
|
38
|
+
readonly focus: {
|
|
39
|
+
readonly ring: "--ow-focus-ring";
|
|
40
|
+
readonly shadow: "--ow-focus-shadow";
|
|
41
|
+
};
|
|
42
|
+
readonly elevation: {
|
|
43
|
+
readonly card: "--ow-elevation-card";
|
|
44
|
+
readonly overlay: "--ow-elevation-overlay";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const DEFAULT_EXTENSION_THEME_TOKENS: {
|
|
48
|
+
readonly color: {
|
|
49
|
+
readonly background: "#141619";
|
|
50
|
+
readonly surface: "#1a1d22";
|
|
51
|
+
readonly surfaceRaised: "#1f232a";
|
|
52
|
+
readonly surfaceHover: "#262b33";
|
|
53
|
+
readonly surfaceActive: "#1d1a10";
|
|
54
|
+
readonly border: "#1e2229";
|
|
55
|
+
readonly borderStrong: "#2a3240";
|
|
56
|
+
readonly text: "#e7e9ee";
|
|
57
|
+
readonly textSubtle: "#c9cdd6";
|
|
58
|
+
readonly textMuted: "#9098a8";
|
|
59
|
+
readonly textDim: "#666f7d";
|
|
60
|
+
readonly accent: "#f5a623";
|
|
61
|
+
readonly accentDim: "#b87410";
|
|
62
|
+
readonly success: "#4caf72";
|
|
63
|
+
readonly danger: "#ef4444";
|
|
64
|
+
readonly warning: "#f5a623";
|
|
65
|
+
readonly info: "#61a8ff";
|
|
66
|
+
};
|
|
67
|
+
readonly typography: {
|
|
68
|
+
readonly sansFamily: "Inter, \"SF Pro Text\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif";
|
|
69
|
+
readonly monoFamily: "\"SF Mono\", \"JetBrains Mono\", \"Cascadia Mono\", ui-monospace, monospace";
|
|
70
|
+
};
|
|
71
|
+
readonly spacing: {
|
|
72
|
+
readonly xs: "4px";
|
|
73
|
+
readonly sm: "8px";
|
|
74
|
+
readonly md: "12px";
|
|
75
|
+
readonly lg: "16px";
|
|
76
|
+
readonly xl: "24px";
|
|
77
|
+
};
|
|
78
|
+
readonly radius: {
|
|
79
|
+
readonly sm: "6px";
|
|
80
|
+
readonly md: "9px";
|
|
81
|
+
readonly lg: "12px";
|
|
82
|
+
readonly panel: "22px";
|
|
83
|
+
};
|
|
84
|
+
readonly focus: {
|
|
85
|
+
readonly ring: "#9aa3b2";
|
|
86
|
+
readonly shadow: "0 0 0 1px color-mix(in srgb, #9aa3b2 76%, transparent), 0 0 0 3px color-mix(in srgb, #9aa3b2 15%, transparent)";
|
|
87
|
+
};
|
|
88
|
+
readonly elevation: {
|
|
89
|
+
readonly card: "inset 0 1px 0 rgba(255, 255, 255, 0.02)";
|
|
90
|
+
readonly overlay: "0 24px 80px rgba(0, 0, 0, 0.45)";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare const SOURCE_EXTENSION_THEME_CSS_VARIABLES: {
|
|
94
|
+
readonly color: {
|
|
95
|
+
readonly background: "--color-bg";
|
|
96
|
+
readonly surface: "--color-bg-secondary";
|
|
97
|
+
readonly surfaceRaised: "--color-bg-tertiary";
|
|
98
|
+
readonly surfaceHover: "--color-bg-hover";
|
|
99
|
+
readonly surfaceActive: "--color-bg-active";
|
|
100
|
+
readonly border: "--color-border";
|
|
101
|
+
readonly borderStrong: "--color-border-light";
|
|
102
|
+
readonly text: "--color-text-primary";
|
|
103
|
+
readonly textSubtle: "--color-text-secondary";
|
|
104
|
+
readonly textMuted: "--color-text-tertiary";
|
|
105
|
+
readonly textDim: "--color-text-muted";
|
|
106
|
+
readonly accent: "--color-accent";
|
|
107
|
+
readonly accentDim: "--color-accent-dim";
|
|
108
|
+
readonly success: "--color-success";
|
|
109
|
+
readonly danger: "--color-error";
|
|
110
|
+
readonly warning: "--color-warning";
|
|
111
|
+
readonly info: "--color-info";
|
|
112
|
+
};
|
|
113
|
+
readonly typography: {
|
|
114
|
+
readonly sansFamily: "--font-sans";
|
|
115
|
+
readonly monoFamily: "--font-mono";
|
|
116
|
+
};
|
|
117
|
+
readonly radius: {
|
|
118
|
+
readonly panel: "--radius-panel";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export declare const EXTENSION_THEME_COLOR_KEYS: readonly ["background", "surface", "surfaceRaised", "surfaceHover", "surfaceActive", "border", "borderStrong", "text", "textSubtle", "textMuted", "textDim", "accent", "accentDim", "success", "danger", "warning", "info"];
|
|
122
|
+
export declare const EXTENSION_THEME_TYPOGRAPHY_KEYS: readonly ["sansFamily", "monoFamily"];
|
|
123
|
+
export declare const EXTENSION_THEME_SPACING_KEYS: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
124
|
+
export declare const EXTENSION_THEME_RADIUS_KEYS: readonly ["sm", "md", "lg", "panel"];
|
|
125
|
+
export declare const EXTENSION_THEME_FOCUS_KEYS: readonly ["ring", "shadow"];
|
|
126
|
+
export declare const EXTENSION_THEME_ELEVATION_KEYS: readonly ["card", "overlay"];
|