@ottocode/web-sdk 0.1.277 → 0.1.279
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/components/dashboard/UsageDashboard.d.ts +6 -0
- package/dist/components/dashboard/UsageDashboard.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1042 -5
- package/dist/components/index.js.map +10 -8
- package/dist/components/settings/SettingsSidebar.d.ts +11 -1
- package/dist/components/settings/SettingsSidebar.d.ts.map +1 -1
- package/dist/hooks/index.js +43 -3
- package/dist/hooks/index.js.map +7 -6
- package/dist/hooks/usePreferences.d.ts +1 -0
- package/dist/hooks/usePreferences.d.ts.map +1 -1
- package/dist/index.js +1088 -39
- package/dist/index.js.map +11 -8
- package/dist/lib/api-client/index.d.ts +2 -0
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/api-client/usage.d.ts +8 -0
- package/dist/lib/api-client/usage.d.ts.map +1 -0
- package/dist/lib/index.js +37 -1
- package/dist/lib/index.js.map +6 -5
- package/dist/lib/platform.d.ts +1 -0
- package/dist/lib/platform.d.ts.map +1 -1
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +12 -1
- package/dist/stores/index.js.map +5 -4
- package/dist/stores/rightRailStore.d.ts +20 -0
- package/dist/stores/rightRailStore.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
interface SettingsSidebarProps {
|
|
2
|
+
/**
|
|
3
|
+
* Override navigation for the "Usage Dashboard" button. When provided,
|
|
4
|
+
* this is called instead of `window.location.assign('/dashboard')` so
|
|
5
|
+
* embedders (e.g. the Tauri desktop app, which has no URL routing) can
|
|
6
|
+
* render the dashboard inline.
|
|
7
|
+
*/
|
|
8
|
+
onOpenDashboard?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const SettingsSidebar: import("react").NamedExoticComponent<SettingsSidebarProps>;
|
|
11
|
+
export {};
|
|
2
12
|
//# sourceMappingURL=SettingsSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsSidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsSidebar.tsx"],"names":[],"mappings":"AA8qBA,UAAU,oBAAoB;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,4DA0N1B,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -907,6 +907,30 @@ var skillsMixin = {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
|
|
910
|
+
// src/lib/api-client/usage.ts
|
|
911
|
+
import {
|
|
912
|
+
getUsageStats as apiGetUsageStats,
|
|
913
|
+
getGlobalUsageStats as apiGetGlobalUsageStats
|
|
914
|
+
} from "@ottocode/api";
|
|
915
|
+
var usageMixin = {
|
|
916
|
+
async getUsageStats() {
|
|
917
|
+
const { data, error } = await apiGetUsageStats();
|
|
918
|
+
if (error)
|
|
919
|
+
throw new Error(extractErrorMessage(error));
|
|
920
|
+
if (!data)
|
|
921
|
+
throw new Error("Empty response from /v1/usage/stats");
|
|
922
|
+
return data;
|
|
923
|
+
},
|
|
924
|
+
async getGlobalUsageStats() {
|
|
925
|
+
const { data, error } = await apiGetGlobalUsageStats();
|
|
926
|
+
if (error)
|
|
927
|
+
throw new Error(extractErrorMessage(error));
|
|
928
|
+
if (!data)
|
|
929
|
+
throw new Error("Empty response from /v1/usage/stats/global");
|
|
930
|
+
return data;
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
|
|
910
934
|
// src/lib/api-client/index.ts
|
|
911
935
|
class ApiClient {
|
|
912
936
|
getSessions = sessionsMixin.getSessions;
|
|
@@ -997,6 +1021,8 @@ class ApiClient {
|
|
|
997
1021
|
getSkillFileContent = skillsMixin.getSkillFileContent;
|
|
998
1022
|
getSkillsConfig = skillsMixin.getSkillsConfig;
|
|
999
1023
|
updateSkillsConfig = skillsMixin.updateSkillsConfig;
|
|
1024
|
+
getUsageStats = usageMixin.getUsageStats;
|
|
1025
|
+
getGlobalUsageStats = usageMixin.getGlobalUsageStats;
|
|
1000
1026
|
}
|
|
1001
1027
|
var apiClient = new ApiClient;
|
|
1002
1028
|
|
|
@@ -1105,6 +1131,15 @@ function hasPlatformOpenUrl() {
|
|
|
1105
1131
|
function hasPlatformSystemFonts() {
|
|
1106
1132
|
return !!getPlatformWindow()?.OTTO_LIST_SYSTEM_FONTS;
|
|
1107
1133
|
}
|
|
1134
|
+
function isPlatformDesktop() {
|
|
1135
|
+
if (typeof window === "undefined")
|
|
1136
|
+
return false;
|
|
1137
|
+
try {
|
|
1138
|
+
return "__TAURI__" in window || "__TAURI_INTERNALS__" in window || "__TAURI_METADATA__" in window;
|
|
1139
|
+
} catch {
|
|
1140
|
+
return false;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1108
1143
|
|
|
1109
1144
|
// src/hooks/usePreferences.ts
|
|
1110
1145
|
var STORAGE_KEY = "otto-preferences";
|
|
@@ -1112,7 +1147,8 @@ var DEFAULT_FONT_FAMILY = "IBM Plex Mono";
|
|
|
1112
1147
|
var DEFAULT_STORED_PREFERENCES = {
|
|
1113
1148
|
vimMode: false,
|
|
1114
1149
|
compactThread: true,
|
|
1115
|
-
fontFamily: DEFAULT_FONT_FAMILY
|
|
1150
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
1151
|
+
smartEdges: true
|
|
1116
1152
|
};
|
|
1117
1153
|
function cssFontFamily(fontFamily) {
|
|
1118
1154
|
const trimmed = fontFamily.trim();
|
|
@@ -1145,7 +1181,8 @@ function resolveInitialPreferences() {
|
|
|
1145
1181
|
return {
|
|
1146
1182
|
vimMode: typeof parsed.vimMode === "boolean" ? parsed.vimMode : DEFAULT_STORED_PREFERENCES.vimMode,
|
|
1147
1183
|
compactThread: typeof parsed.compactThread === "boolean" ? parsed.compactThread : DEFAULT_STORED_PREFERENCES.compactThread,
|
|
1148
|
-
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily.trim() : DEFAULT_STORED_PREFERENCES.fontFamily
|
|
1184
|
+
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily.trim() : DEFAULT_STORED_PREFERENCES.fontFamily,
|
|
1185
|
+
smartEdges: typeof parsed.smartEdges === "boolean" ? parsed.smartEdges : DEFAULT_STORED_PREFERENCES.smartEdges
|
|
1149
1186
|
};
|
|
1150
1187
|
}
|
|
1151
1188
|
} catch (error) {
|
|
@@ -1200,6 +1237,9 @@ function usePreferences() {
|
|
|
1200
1237
|
if (updates.fontFamily !== undefined) {
|
|
1201
1238
|
localUpdates.fontFamily = updates.fontFamily.trim() || DEFAULT_FONT_FAMILY;
|
|
1202
1239
|
}
|
|
1240
|
+
if (updates.smartEdges !== undefined) {
|
|
1241
|
+
localUpdates.smartEdges = updates.smartEdges;
|
|
1242
|
+
}
|
|
1203
1243
|
if (Object.keys(localUpdates).length > 0) {
|
|
1204
1244
|
updateStore(localUpdates);
|
|
1205
1245
|
}
|
|
@@ -6688,4 +6728,4 @@ export {
|
|
|
6688
6728
|
normalizeQueueState
|
|
6689
6729
|
};
|
|
6690
6730
|
|
|
6691
|
-
//# debugId=
|
|
6731
|
+
//# debugId=EBBB4F370F475FD364756E2164756E21
|