@trops/dash-core 0.1.147 → 0.1.148
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/electron/index.js +821 -161
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +584 -68
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +583 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -28,6 +28,7 @@ var require$$3$3 = require('adm-zip');
|
|
|
28
28
|
var require$$2$4 = require('os');
|
|
29
29
|
var require$$4$1 = require('url');
|
|
30
30
|
var require$$2$3 = require('vm');
|
|
31
|
+
var require$$1$4 = require('croner');
|
|
31
32
|
|
|
32
33
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
33
34
|
|
|
@@ -760,6 +761,34 @@ var notificationEvents$1 = {
|
|
|
760
761
|
NOTIFICATION_CLICKED,
|
|
761
762
|
};
|
|
762
763
|
|
|
764
|
+
/**
|
|
765
|
+
* Event Constants File - Scheduler Events
|
|
766
|
+
*
|
|
767
|
+
* IPC channel constants for the widget scheduled tasks system.
|
|
768
|
+
*/
|
|
769
|
+
|
|
770
|
+
const SCHEDULER_REGISTER_TASK$1 = "scheduler-register-task";
|
|
771
|
+
const SCHEDULER_REMOVE_TASK$1 = "scheduler-remove-task";
|
|
772
|
+
const SCHEDULER_REMOVE_TASKS$1 = "scheduler-remove-tasks";
|
|
773
|
+
const SCHEDULER_GET_TASKS$1 = "scheduler-get-tasks";
|
|
774
|
+
const SCHEDULER_UPDATE_TASK$1 = "scheduler-update-task";
|
|
775
|
+
const SCHEDULER_ENABLE_TASK$1 = "scheduler-enable-task";
|
|
776
|
+
const SCHEDULER_DISABLE_TASK$1 = "scheduler-disable-task";
|
|
777
|
+
const SCHEDULER_GET_PENDING$1 = "scheduler-get-pending";
|
|
778
|
+
const SCHEDULER_TASK_FIRED$1 = "scheduler:task-fired";
|
|
779
|
+
|
|
780
|
+
var schedulerEvents$1 = {
|
|
781
|
+
SCHEDULER_REGISTER_TASK: SCHEDULER_REGISTER_TASK$1,
|
|
782
|
+
SCHEDULER_REMOVE_TASK: SCHEDULER_REMOVE_TASK$1,
|
|
783
|
+
SCHEDULER_REMOVE_TASKS: SCHEDULER_REMOVE_TASKS$1,
|
|
784
|
+
SCHEDULER_GET_TASKS: SCHEDULER_GET_TASKS$1,
|
|
785
|
+
SCHEDULER_UPDATE_TASK: SCHEDULER_UPDATE_TASK$1,
|
|
786
|
+
SCHEDULER_ENABLE_TASK: SCHEDULER_ENABLE_TASK$1,
|
|
787
|
+
SCHEDULER_DISABLE_TASK: SCHEDULER_DISABLE_TASK$1,
|
|
788
|
+
SCHEDULER_GET_PENDING: SCHEDULER_GET_PENDING$1,
|
|
789
|
+
SCHEDULER_TASK_FIRED: SCHEDULER_TASK_FIRED$1,
|
|
790
|
+
};
|
|
791
|
+
|
|
763
792
|
/**
|
|
764
793
|
* Events
|
|
765
794
|
*
|
|
@@ -786,6 +815,7 @@ const dashboardRatingsEvents = dashboardRatingsEvents$1;
|
|
|
786
815
|
const registryAuthEvents = registryAuthEvents$1;
|
|
787
816
|
const sessionEvents = sessionEvents$1;
|
|
788
817
|
const notificationEvents = notificationEvents$1;
|
|
818
|
+
const schedulerEvents = schedulerEvents$1;
|
|
789
819
|
|
|
790
820
|
const publicEvents = {
|
|
791
821
|
...dataEvents,
|
|
@@ -813,6 +843,7 @@ var events$8 = {
|
|
|
813
843
|
...registryAuthEvents,
|
|
814
844
|
...sessionEvents,
|
|
815
845
|
...notificationEvents,
|
|
846
|
+
...schedulerEvents,
|
|
816
847
|
};
|
|
817
848
|
|
|
818
849
|
/**
|
|
@@ -847,7 +878,7 @@ var dialogController$1 = {
|
|
|
847
878
|
*/
|
|
848
879
|
|
|
849
880
|
const { safeStorage } = require$$0$1;
|
|
850
|
-
const Store$
|
|
881
|
+
const Store$2 = require$$1;
|
|
851
882
|
const events$6 = events$8;
|
|
852
883
|
|
|
853
884
|
const schema$1 = {
|
|
@@ -876,7 +907,7 @@ const decryptString = (win, str) => {
|
|
|
876
907
|
|
|
877
908
|
const saveData$1 = (key, value) => {
|
|
878
909
|
try {
|
|
879
|
-
const store = new Store$
|
|
910
|
+
const store = new Store$2({ schema: schema$1 });
|
|
880
911
|
store.set(key, value);
|
|
881
912
|
return getData$1(key);
|
|
882
913
|
} catch (e) {
|
|
@@ -886,7 +917,7 @@ const saveData$1 = (key, value) => {
|
|
|
886
917
|
|
|
887
918
|
const getData$1 = (key) => {
|
|
888
919
|
try {
|
|
889
|
-
const store = new Store$
|
|
920
|
+
const store = new Store$2({ schema: schema$1 });
|
|
890
921
|
const value = store.get(key);
|
|
891
922
|
if (value) {
|
|
892
923
|
return { [key]: value };
|
|
@@ -29778,6 +29809,521 @@ dynamicWidgetLoader$2.exports.dynamicWidgetLoader = dynamicWidgetLoader$1;
|
|
|
29778
29809
|
|
|
29779
29810
|
var dynamicWidgetLoaderExports = dynamicWidgetLoader$2.exports;
|
|
29780
29811
|
|
|
29812
|
+
/**
|
|
29813
|
+
* schedulerController.js
|
|
29814
|
+
*
|
|
29815
|
+
* Main process controller for widget scheduled tasks.
|
|
29816
|
+
* Manages a tick loop (1s resolution), persistence (electron-store),
|
|
29817
|
+
* and dispatching task-fired events to renderer windows.
|
|
29818
|
+
*/
|
|
29819
|
+
|
|
29820
|
+
const Store$1 = require$$1;
|
|
29821
|
+
const { Cron } = require$$1$4;
|
|
29822
|
+
|
|
29823
|
+
const store$3 = new Store$1({ name: "dash-scheduler" });
|
|
29824
|
+
|
|
29825
|
+
// --- In-memory state ---
|
|
29826
|
+
const tasks = new Map(); // taskId -> task object
|
|
29827
|
+
const pendingResults = new Map(); // widgetId -> Array<{ taskId, taskKey, firedAt }>
|
|
29828
|
+
|
|
29829
|
+
const MAX_TASKS_PER_WIDGET = 20;
|
|
29830
|
+
const MAX_PENDING_PER_WIDGET = 100;
|
|
29831
|
+
const PERSIST_DEBOUNCE_MS = 30_000;
|
|
29832
|
+
|
|
29833
|
+
let tickInterval = null;
|
|
29834
|
+
let persistTimeout = null;
|
|
29835
|
+
let deps = {
|
|
29836
|
+
getWindows: null,
|
|
29837
|
+
notificationController: null,
|
|
29838
|
+
getMainWindow: null,
|
|
29839
|
+
};
|
|
29840
|
+
|
|
29841
|
+
// --- Day name to cron day number ---
|
|
29842
|
+
const DAY_MAP = {
|
|
29843
|
+
sun: 0,
|
|
29844
|
+
mon: 1,
|
|
29845
|
+
tue: 2,
|
|
29846
|
+
wed: 3,
|
|
29847
|
+
thu: 4,
|
|
29848
|
+
fri: 5,
|
|
29849
|
+
sat: 6,
|
|
29850
|
+
};
|
|
29851
|
+
|
|
29852
|
+
/**
|
|
29853
|
+
* Build a cron expression from days + time for use with croner.
|
|
29854
|
+
* @param {string[]} days - ["mon","wed","fri"] or ["every"]
|
|
29855
|
+
* @param {string} time - "09:00" (HH:mm)
|
|
29856
|
+
* @returns {string} cron expression
|
|
29857
|
+
*/
|
|
29858
|
+
function buildCronExpression(days, time) {
|
|
29859
|
+
const [hours, minutes] = time.split(":").map(Number);
|
|
29860
|
+
if (days.includes("every")) {
|
|
29861
|
+
return `${minutes} ${hours} * * *`;
|
|
29862
|
+
}
|
|
29863
|
+
const dayNums = days.map((d) => DAY_MAP[d]).filter((n) => n !== undefined);
|
|
29864
|
+
return `${minutes} ${hours} * * ${dayNums.join(",")}`;
|
|
29865
|
+
}
|
|
29866
|
+
|
|
29867
|
+
/**
|
|
29868
|
+
* Compute the next fire timestamp for a task.
|
|
29869
|
+
* @param {Object} task
|
|
29870
|
+
* @param {number} now - current timestamp in ms
|
|
29871
|
+
* @returns {number} next fire timestamp in ms
|
|
29872
|
+
*/
|
|
29873
|
+
function computeNextFire(task, now) {
|
|
29874
|
+
if (task.scheduleType === "interval") {
|
|
29875
|
+
return now + (task.intervalMs || 60000);
|
|
29876
|
+
}
|
|
29877
|
+
|
|
29878
|
+
if (task.scheduleType === "dayTime" && task.days && task.time) {
|
|
29879
|
+
try {
|
|
29880
|
+
const cronExpr = buildCronExpression(task.days, task.time);
|
|
29881
|
+
const job = new Cron(cronExpr);
|
|
29882
|
+
const next = job.nextRun();
|
|
29883
|
+
if (next) {
|
|
29884
|
+
return next.getTime();
|
|
29885
|
+
}
|
|
29886
|
+
} catch (err) {
|
|
29887
|
+
console.error(
|
|
29888
|
+
`[schedulerController] Error computing next fire for ${task.taskId}:`,
|
|
29889
|
+
err,
|
|
29890
|
+
);
|
|
29891
|
+
}
|
|
29892
|
+
// Fallback: 1 hour from now
|
|
29893
|
+
return now + 3600000;
|
|
29894
|
+
}
|
|
29895
|
+
|
|
29896
|
+
// Unknown schedule type — default 1 hour
|
|
29897
|
+
return now + 3600000;
|
|
29898
|
+
}
|
|
29899
|
+
|
|
29900
|
+
/**
|
|
29901
|
+
* Fire a task: broadcast to renderer windows, queue pending, send notification if no windows.
|
|
29902
|
+
*/
|
|
29903
|
+
function fireTask(task) {
|
|
29904
|
+
const payload = {
|
|
29905
|
+
taskId: task.taskId,
|
|
29906
|
+
widgetId: task.widgetId,
|
|
29907
|
+
taskKey: task.taskKey,
|
|
29908
|
+
handler: task.handler,
|
|
29909
|
+
firedAt: Date.now(),
|
|
29910
|
+
};
|
|
29911
|
+
|
|
29912
|
+
console.log(
|
|
29913
|
+
`[schedulerController] Fired: ${task.widgetName}.${task.taskKey} (${task.displayName})`,
|
|
29914
|
+
);
|
|
29915
|
+
|
|
29916
|
+
// Add to pending results queue
|
|
29917
|
+
let queue = pendingResults.get(task.widgetId) || [];
|
|
29918
|
+
queue.push({
|
|
29919
|
+
taskId: task.taskId,
|
|
29920
|
+
taskKey: task.taskKey,
|
|
29921
|
+
firedAt: payload.firedAt,
|
|
29922
|
+
});
|
|
29923
|
+
if (queue.length > MAX_PENDING_PER_WIDGET) {
|
|
29924
|
+
queue = queue.slice(-MAX_PENDING_PER_WIDGET);
|
|
29925
|
+
}
|
|
29926
|
+
pendingResults.set(task.widgetId, queue);
|
|
29927
|
+
|
|
29928
|
+
// Broadcast to all windows
|
|
29929
|
+
const windows = deps.getWindows ? deps.getWindows() : [];
|
|
29930
|
+
if (windows.length > 0) {
|
|
29931
|
+
for (const win of windows) {
|
|
29932
|
+
if (!win.isDestroyed()) {
|
|
29933
|
+
win.webContents.send("scheduler:task-fired", payload);
|
|
29934
|
+
}
|
|
29935
|
+
}
|
|
29936
|
+
} else {
|
|
29937
|
+
// No windows open — send native OS notification
|
|
29938
|
+
if (deps.notificationController && deps.getMainWindow) {
|
|
29939
|
+
deps.notificationController.send(deps.getMainWindow(), {
|
|
29940
|
+
widgetName: task.widgetName,
|
|
29941
|
+
widgetId: task.widgetId,
|
|
29942
|
+
workspaceId: task.workspaceId || "",
|
|
29943
|
+
type: "scheduled-task",
|
|
29944
|
+
title: task.displayName || task.taskKey,
|
|
29945
|
+
body: `Scheduled task "${task.displayName}" fired`,
|
|
29946
|
+
silent: false,
|
|
29947
|
+
});
|
|
29948
|
+
}
|
|
29949
|
+
}
|
|
29950
|
+
}
|
|
29951
|
+
|
|
29952
|
+
/**
|
|
29953
|
+
* Main tick — runs every 1s, checks all enabled tasks.
|
|
29954
|
+
*/
|
|
29955
|
+
function tick() {
|
|
29956
|
+
const now = Date.now();
|
|
29957
|
+
for (const [, task] of tasks) {
|
|
29958
|
+
if (!task.enabled || !task.nextFireAt || task.nextFireAt > now) continue;
|
|
29959
|
+
fireTask(task);
|
|
29960
|
+
task.nextFireAt = computeNextFire(task, now);
|
|
29961
|
+
task.lastFiredAt = now;
|
|
29962
|
+
task.fireCount = (task.fireCount || 0) + 1;
|
|
29963
|
+
}
|
|
29964
|
+
debouncedPersist();
|
|
29965
|
+
}
|
|
29966
|
+
|
|
29967
|
+
/**
|
|
29968
|
+
* Persist tasks to electron-store (debounced).
|
|
29969
|
+
*/
|
|
29970
|
+
function debouncedPersist() {
|
|
29971
|
+
if (persistTimeout) return;
|
|
29972
|
+
persistTimeout = setTimeout(() => {
|
|
29973
|
+
persistTimeout = null;
|
|
29974
|
+
persistNow();
|
|
29975
|
+
}, PERSIST_DEBOUNCE_MS);
|
|
29976
|
+
}
|
|
29977
|
+
|
|
29978
|
+
function persistNow() {
|
|
29979
|
+
try {
|
|
29980
|
+
const data = {};
|
|
29981
|
+
for (const [taskId, task] of tasks) {
|
|
29982
|
+
data[taskId] = { ...task };
|
|
29983
|
+
}
|
|
29984
|
+
store$3.set("tasks", data);
|
|
29985
|
+
} catch (err) {
|
|
29986
|
+
console.error("[schedulerController] Error persisting tasks:", err);
|
|
29987
|
+
}
|
|
29988
|
+
}
|
|
29989
|
+
|
|
29990
|
+
/**
|
|
29991
|
+
* Load persisted tasks from electron-store.
|
|
29992
|
+
*/
|
|
29993
|
+
function loadFromStore() {
|
|
29994
|
+
try {
|
|
29995
|
+
const data = store$3.get("tasks", {});
|
|
29996
|
+
const now = Date.now();
|
|
29997
|
+
for (const [taskId, task] of Object.entries(data)) {
|
|
29998
|
+
// Recompute nextFireAt if it's in the past
|
|
29999
|
+
if (task.nextFireAt && task.nextFireAt <= now && task.enabled) {
|
|
30000
|
+
task.nextFireAt = computeNextFire(task, now);
|
|
30001
|
+
}
|
|
30002
|
+
tasks.set(taskId, task);
|
|
30003
|
+
}
|
|
30004
|
+
console.log(`[schedulerController] Loaded ${tasks.size} tasks from store`);
|
|
30005
|
+
} catch (err) {
|
|
30006
|
+
console.error("[schedulerController] Error loading tasks:", err);
|
|
30007
|
+
}
|
|
30008
|
+
}
|
|
30009
|
+
|
|
30010
|
+
/**
|
|
30011
|
+
* Count tasks for a given widget instance.
|
|
30012
|
+
*/
|
|
30013
|
+
function countTasksForWidget(widgetId) {
|
|
30014
|
+
let count = 0;
|
|
30015
|
+
for (const [, task] of tasks) {
|
|
30016
|
+
if (task.widgetId === widgetId) count++;
|
|
30017
|
+
}
|
|
30018
|
+
return count;
|
|
30019
|
+
}
|
|
30020
|
+
|
|
30021
|
+
const schedulerController$2 = {
|
|
30022
|
+
/**
|
|
30023
|
+
* Wire dependencies from the Electron main process.
|
|
30024
|
+
*/
|
|
30025
|
+
init({ getWindows, notificationController, getMainWindow }) {
|
|
30026
|
+
deps.getWindows = getWindows;
|
|
30027
|
+
deps.notificationController = notificationController;
|
|
30028
|
+
deps.getMainWindow = getMainWindow;
|
|
30029
|
+
},
|
|
30030
|
+
|
|
30031
|
+
/**
|
|
30032
|
+
* Start the tick loop and load persisted tasks.
|
|
30033
|
+
*/
|
|
30034
|
+
start() {
|
|
30035
|
+
loadFromStore();
|
|
30036
|
+
if (!tickInterval) {
|
|
30037
|
+
tickInterval = setInterval(tick, 1000);
|
|
30038
|
+
console.log("[schedulerController] Tick loop started");
|
|
30039
|
+
}
|
|
30040
|
+
},
|
|
30041
|
+
|
|
30042
|
+
/**
|
|
30043
|
+
* Stop the tick loop and persist immediately.
|
|
30044
|
+
*/
|
|
30045
|
+
stop() {
|
|
30046
|
+
if (tickInterval) {
|
|
30047
|
+
clearInterval(tickInterval);
|
|
30048
|
+
tickInterval = null;
|
|
30049
|
+
}
|
|
30050
|
+
if (persistTimeout) {
|
|
30051
|
+
clearTimeout(persistTimeout);
|
|
30052
|
+
persistTimeout = null;
|
|
30053
|
+
}
|
|
30054
|
+
persistNow();
|
|
30055
|
+
console.log("[schedulerController] Stopped");
|
|
30056
|
+
},
|
|
30057
|
+
|
|
30058
|
+
/**
|
|
30059
|
+
* Register or update a scheduled task.
|
|
30060
|
+
*
|
|
30061
|
+
* @param {Object} payload
|
|
30062
|
+
* @param {string} payload.widgetId - widget instance UUID
|
|
30063
|
+
* @param {string} payload.widgetName - component name
|
|
30064
|
+
* @param {string} [payload.workspaceId]
|
|
30065
|
+
* @param {string} payload.taskKey - key from .dash.js
|
|
30066
|
+
* @param {string} payload.handler - handler function name
|
|
30067
|
+
* @param {string} payload.displayName - human-readable name
|
|
30068
|
+
* @param {string} payload.scheduleType - "interval" | "dayTime"
|
|
30069
|
+
* @param {number} [payload.intervalMs] - for interval type
|
|
30070
|
+
* @param {string[]} [payload.days] - for dayTime type
|
|
30071
|
+
* @param {string} [payload.time] - for dayTime type (HH:mm)
|
|
30072
|
+
* @param {boolean} [payload.enabled] - defaults to true
|
|
30073
|
+
* @returns {{ success: boolean, taskId?: string, error?: string }}
|
|
30074
|
+
*/
|
|
30075
|
+
registerTask(payload) {
|
|
30076
|
+
try {
|
|
30077
|
+
const {
|
|
30078
|
+
widgetId,
|
|
30079
|
+
widgetName,
|
|
30080
|
+
workspaceId,
|
|
30081
|
+
taskKey,
|
|
30082
|
+
handler,
|
|
30083
|
+
displayName,
|
|
30084
|
+
scheduleType,
|
|
30085
|
+
intervalMs,
|
|
30086
|
+
days,
|
|
30087
|
+
time,
|
|
30088
|
+
} = payload;
|
|
30089
|
+
|
|
30090
|
+
const taskId = `${widgetId}:${taskKey}`;
|
|
30091
|
+
const existing = tasks.get(taskId);
|
|
30092
|
+
|
|
30093
|
+
// Rate limit: max tasks per widget
|
|
30094
|
+
if (!existing && countTasksForWidget(widgetId) >= MAX_TASKS_PER_WIDGET) {
|
|
30095
|
+
return { success: false, error: "max_tasks_reached" };
|
|
30096
|
+
}
|
|
30097
|
+
|
|
30098
|
+
const now = Date.now();
|
|
30099
|
+
const task = {
|
|
30100
|
+
taskId,
|
|
30101
|
+
widgetId,
|
|
30102
|
+
widgetName: widgetName || existing?.widgetName || "",
|
|
30103
|
+
workspaceId: workspaceId || existing?.workspaceId || "",
|
|
30104
|
+
taskKey,
|
|
30105
|
+
handler: handler || existing?.handler || taskKey,
|
|
30106
|
+
displayName: displayName || existing?.displayName || taskKey,
|
|
30107
|
+
scheduleType: scheduleType || existing?.scheduleType || "interval",
|
|
30108
|
+
intervalMs:
|
|
30109
|
+
intervalMs !== undefined ? intervalMs : existing?.intervalMs || null,
|
|
30110
|
+
days: days !== undefined ? days : existing?.days || null,
|
|
30111
|
+
time: time !== undefined ? time : existing?.time || null,
|
|
30112
|
+
enabled:
|
|
30113
|
+
payload.enabled !== undefined
|
|
30114
|
+
? payload.enabled
|
|
30115
|
+
: existing?.enabled !== undefined
|
|
30116
|
+
? existing.enabled
|
|
30117
|
+
: true,
|
|
30118
|
+
nextFireAt: 0,
|
|
30119
|
+
lastFiredAt: existing?.lastFiredAt || null,
|
|
30120
|
+
fireCount: existing?.fireCount || 0,
|
|
30121
|
+
createdAt: existing?.createdAt || new Date().toISOString(),
|
|
30122
|
+
};
|
|
30123
|
+
|
|
30124
|
+
// Compute next fire
|
|
30125
|
+
task.nextFireAt = task.enabled ? computeNextFire(task, now) : 0;
|
|
30126
|
+
|
|
30127
|
+
tasks.set(taskId, task);
|
|
30128
|
+
debouncedPersist();
|
|
30129
|
+
|
|
30130
|
+
console.log(
|
|
30131
|
+
`[schedulerController] Registered: ${taskId} (${task.scheduleType})`,
|
|
30132
|
+
);
|
|
30133
|
+
|
|
30134
|
+
return { success: true, taskId };
|
|
30135
|
+
} catch (error) {
|
|
30136
|
+
console.error("[schedulerController] Error registering task:", error);
|
|
30137
|
+
return { success: false, error: error.message };
|
|
30138
|
+
}
|
|
30139
|
+
},
|
|
30140
|
+
|
|
30141
|
+
/**
|
|
30142
|
+
* Remove a single task.
|
|
30143
|
+
* @param {string} taskId
|
|
30144
|
+
* @returns {{ success: boolean }}
|
|
30145
|
+
*/
|
|
30146
|
+
removeTask(taskId) {
|
|
30147
|
+
const deleted = tasks.delete(taskId);
|
|
30148
|
+
if (deleted) {
|
|
30149
|
+
debouncedPersist();
|
|
30150
|
+
console.log(`[schedulerController] Removed: ${taskId}`);
|
|
30151
|
+
}
|
|
30152
|
+
return { success: deleted };
|
|
30153
|
+
},
|
|
30154
|
+
|
|
30155
|
+
/**
|
|
30156
|
+
* Remove all tasks for a widget instance.
|
|
30157
|
+
* @param {string} widgetId
|
|
30158
|
+
* @returns {{ success: boolean, count: number }}
|
|
30159
|
+
*/
|
|
30160
|
+
removeTasks(widgetId) {
|
|
30161
|
+
let count = 0;
|
|
30162
|
+
for (const [taskId, task] of tasks) {
|
|
30163
|
+
if (task.widgetId === widgetId) {
|
|
30164
|
+
tasks.delete(taskId);
|
|
30165
|
+
count++;
|
|
30166
|
+
}
|
|
30167
|
+
}
|
|
30168
|
+
if (count > 0) {
|
|
30169
|
+
debouncedPersist();
|
|
30170
|
+
pendingResults.delete(widgetId);
|
|
30171
|
+
}
|
|
30172
|
+
console.log(
|
|
30173
|
+
`[schedulerController] Removed ${count} tasks for widget ${widgetId}`,
|
|
30174
|
+
);
|
|
30175
|
+
return { success: true, count };
|
|
30176
|
+
},
|
|
30177
|
+
|
|
30178
|
+
/**
|
|
30179
|
+
* Get all tasks for a widget instance.
|
|
30180
|
+
* @param {string} widgetId
|
|
30181
|
+
* @returns {Object[]}
|
|
30182
|
+
*/
|
|
30183
|
+
getTasks(widgetId) {
|
|
30184
|
+
const result = [];
|
|
30185
|
+
for (const [, task] of tasks) {
|
|
30186
|
+
if (task.widgetId === widgetId) {
|
|
30187
|
+
result.push({ ...task });
|
|
30188
|
+
}
|
|
30189
|
+
}
|
|
30190
|
+
return result;
|
|
30191
|
+
},
|
|
30192
|
+
|
|
30193
|
+
/**
|
|
30194
|
+
* Update a task's schedule configuration.
|
|
30195
|
+
* @param {string} taskId
|
|
30196
|
+
* @param {Object} updates
|
|
30197
|
+
* @returns {{ success: boolean }}
|
|
30198
|
+
*/
|
|
30199
|
+
updateTask(taskId, updates) {
|
|
30200
|
+
const task = tasks.get(taskId);
|
|
30201
|
+
if (!task) {
|
|
30202
|
+
return { success: false, error: "task_not_found" };
|
|
30203
|
+
}
|
|
30204
|
+
|
|
30205
|
+
const allowedFields = [
|
|
30206
|
+
"scheduleType",
|
|
30207
|
+
"intervalMs",
|
|
30208
|
+
"days",
|
|
30209
|
+
"time",
|
|
30210
|
+
"displayName",
|
|
30211
|
+
"enabled",
|
|
30212
|
+
];
|
|
30213
|
+
for (const key of allowedFields) {
|
|
30214
|
+
if (updates[key] !== undefined) {
|
|
30215
|
+
task[key] = updates[key];
|
|
30216
|
+
}
|
|
30217
|
+
}
|
|
30218
|
+
|
|
30219
|
+
// Recompute next fire
|
|
30220
|
+
if (task.enabled) {
|
|
30221
|
+
task.nextFireAt = computeNextFire(task, Date.now());
|
|
30222
|
+
} else {
|
|
30223
|
+
task.nextFireAt = 0;
|
|
30224
|
+
}
|
|
30225
|
+
|
|
30226
|
+
debouncedPersist();
|
|
30227
|
+
console.log(`[schedulerController] Updated: ${taskId}`);
|
|
30228
|
+
return { success: true };
|
|
30229
|
+
},
|
|
30230
|
+
|
|
30231
|
+
/**
|
|
30232
|
+
* Enable a task.
|
|
30233
|
+
* @param {string} taskId
|
|
30234
|
+
* @returns {{ success: boolean }}
|
|
30235
|
+
*/
|
|
30236
|
+
enableTask(taskId) {
|
|
30237
|
+
const task = tasks.get(taskId);
|
|
30238
|
+
if (!task) return { success: false, error: "task_not_found" };
|
|
30239
|
+
task.enabled = true;
|
|
30240
|
+
task.nextFireAt = computeNextFire(task, Date.now());
|
|
30241
|
+
debouncedPersist();
|
|
30242
|
+
console.log(`[schedulerController] Enabled: ${taskId}`);
|
|
30243
|
+
return { success: true };
|
|
30244
|
+
},
|
|
30245
|
+
|
|
30246
|
+
/**
|
|
30247
|
+
* Disable a task.
|
|
30248
|
+
* @param {string} taskId
|
|
30249
|
+
* @returns {{ success: boolean }}
|
|
30250
|
+
*/
|
|
30251
|
+
disableTask(taskId) {
|
|
30252
|
+
const task = tasks.get(taskId);
|
|
30253
|
+
if (!task) return { success: false, error: "task_not_found" };
|
|
30254
|
+
task.enabled = false;
|
|
30255
|
+
task.nextFireAt = 0;
|
|
30256
|
+
debouncedPersist();
|
|
30257
|
+
console.log(`[schedulerController] Disabled: ${taskId}`);
|
|
30258
|
+
return { success: true };
|
|
30259
|
+
},
|
|
30260
|
+
|
|
30261
|
+
/**
|
|
30262
|
+
* Drain pending fire results for a widget.
|
|
30263
|
+
* @param {string} widgetId
|
|
30264
|
+
* @returns {Object[]}
|
|
30265
|
+
*/
|
|
30266
|
+
getPendingResults(widgetId) {
|
|
30267
|
+
const queue = pendingResults.get(widgetId) || [];
|
|
30268
|
+
pendingResults.delete(widgetId);
|
|
30269
|
+
return queue;
|
|
30270
|
+
},
|
|
30271
|
+
|
|
30272
|
+
/**
|
|
30273
|
+
* Handle system suspend — stop tick loop.
|
|
30274
|
+
*/
|
|
30275
|
+
handleSuspend() {
|
|
30276
|
+
if (tickInterval) {
|
|
30277
|
+
clearInterval(tickInterval);
|
|
30278
|
+
tickInterval = null;
|
|
30279
|
+
console.log("[schedulerController] Suspended (tick stopped)");
|
|
30280
|
+
}
|
|
30281
|
+
},
|
|
30282
|
+
|
|
30283
|
+
/**
|
|
30284
|
+
* Handle system resume — fire missed tasks, restart tick.
|
|
30285
|
+
*/
|
|
30286
|
+
handleResume() {
|
|
30287
|
+
const now = Date.now();
|
|
30288
|
+
for (const [, task] of tasks) {
|
|
30289
|
+
if (task.enabled && task.nextFireAt && task.nextFireAt <= now) {
|
|
30290
|
+
fireTask(task);
|
|
30291
|
+
task.nextFireAt = computeNextFire(task, now);
|
|
30292
|
+
task.lastFiredAt = now;
|
|
30293
|
+
task.fireCount = (task.fireCount || 0) + 1;
|
|
30294
|
+
}
|
|
30295
|
+
}
|
|
30296
|
+
debouncedPersist();
|
|
30297
|
+
if (!tickInterval) {
|
|
30298
|
+
tickInterval = setInterval(tick, 1000);
|
|
30299
|
+
console.log("[schedulerController] Resumed (tick restarted)");
|
|
30300
|
+
}
|
|
30301
|
+
},
|
|
30302
|
+
|
|
30303
|
+
/**
|
|
30304
|
+
* Remove all tasks for a widget name (used on widget uninstall).
|
|
30305
|
+
* @param {string} widgetName - component name
|
|
30306
|
+
*/
|
|
30307
|
+
cleanupWidget(widgetName) {
|
|
30308
|
+
let count = 0;
|
|
30309
|
+
for (const [taskId, task] of tasks) {
|
|
30310
|
+
if (task.widgetName === widgetName) {
|
|
30311
|
+
tasks.delete(taskId);
|
|
30312
|
+
pendingResults.delete(task.widgetId);
|
|
30313
|
+
count++;
|
|
30314
|
+
}
|
|
30315
|
+
}
|
|
30316
|
+
if (count > 0) {
|
|
30317
|
+
debouncedPersist();
|
|
30318
|
+
console.log(
|
|
30319
|
+
`[schedulerController] Cleaned up ${count} tasks for widget "${widgetName}"`,
|
|
30320
|
+
);
|
|
30321
|
+
}
|
|
30322
|
+
},
|
|
30323
|
+
};
|
|
30324
|
+
|
|
30325
|
+
var schedulerController_1 = schedulerController$2;
|
|
30326
|
+
|
|
29781
30327
|
/**
|
|
29782
30328
|
* Widget Registry System
|
|
29783
30329
|
*
|
|
@@ -30572,6 +31118,8 @@ var dynamicWidgetLoaderExports = dynamicWidgetLoader$2.exports;
|
|
|
30572
31118
|
});
|
|
30573
31119
|
|
|
30574
31120
|
ipcMain.handle("widget:uninstall", (event, widgetName) => {
|
|
31121
|
+
const schedulerController = schedulerController_1;
|
|
31122
|
+
schedulerController.cleanupWidget(widgetName);
|
|
30575
31123
|
return getWidgetRegistry().uninstallWidget(widgetName);
|
|
30576
31124
|
});
|
|
30577
31125
|
|
|
@@ -33464,6 +34012,7 @@ const {
|
|
|
33464
34012
|
enrichPackagesWithRatings,
|
|
33465
34013
|
} = dashboardRatingsController;
|
|
33466
34014
|
const notificationController$1 = notificationController_1;
|
|
34015
|
+
const schedulerController$1 = schedulerController_1;
|
|
33467
34016
|
const {
|
|
33468
34017
|
prepareThemeForPublish,
|
|
33469
34018
|
installThemeFromRegistry,
|
|
@@ -33544,12 +34093,13 @@ var controller = {
|
|
|
33544
34093
|
saveSessionState,
|
|
33545
34094
|
clearSessionState,
|
|
33546
34095
|
notificationController: notificationController$1,
|
|
34096
|
+
schedulerController: schedulerController$1,
|
|
33547
34097
|
prepareThemeForPublish,
|
|
33548
34098
|
installThemeFromRegistry,
|
|
33549
34099
|
getThemePublishPreview,
|
|
33550
34100
|
};
|
|
33551
34101
|
|
|
33552
|
-
const { ipcRenderer: ipcRenderer$
|
|
34102
|
+
const { ipcRenderer: ipcRenderer$n } = require$$0$1;
|
|
33553
34103
|
const {
|
|
33554
34104
|
SECURE_STORE_ENCRYPTION_CHECK,
|
|
33555
34105
|
SECURE_STORE_SET_DATA,
|
|
@@ -33561,10 +34111,10 @@ const {
|
|
|
33561
34111
|
*/
|
|
33562
34112
|
const secureStoreApi$2 = {
|
|
33563
34113
|
isEncryptionAvailable: () =>
|
|
33564
|
-
ipcRenderer$
|
|
34114
|
+
ipcRenderer$n.invoke(SECURE_STORE_ENCRYPTION_CHECK, {}),
|
|
33565
34115
|
saveData: (key, value) =>
|
|
33566
|
-
ipcRenderer$
|
|
33567
|
-
getData: (key) => ipcRenderer$
|
|
34116
|
+
ipcRenderer$n.invoke(SECURE_STORE_SET_DATA, { key, value }),
|
|
34117
|
+
getData: (key) => ipcRenderer$n.invoke(SECURE_STORE_GET_DATA, { key }),
|
|
33568
34118
|
};
|
|
33569
34119
|
|
|
33570
34120
|
var secureStoreApi_1 = secureStoreApi$2;
|
|
@@ -33575,7 +34125,7 @@ var secureStoreApi_1 = secureStoreApi$2;
|
|
|
33575
34125
|
* Handle the workspace configuration file
|
|
33576
34126
|
*/
|
|
33577
34127
|
|
|
33578
|
-
const { ipcRenderer: ipcRenderer$
|
|
34128
|
+
const { ipcRenderer: ipcRenderer$m } = require$$0$1;
|
|
33579
34129
|
const {
|
|
33580
34130
|
WORKSPACE_LIST,
|
|
33581
34131
|
WORKSPACE_SAVE,
|
|
@@ -33592,7 +34142,7 @@ const workspaceApi$2 = {
|
|
|
33592
34142
|
*/
|
|
33593
34143
|
listWorkspacesForApplication: (appId) => {
|
|
33594
34144
|
console.log("listWorkspacesForApplication called with appId:", appId);
|
|
33595
|
-
return ipcRenderer$
|
|
34145
|
+
return ipcRenderer$m.invoke(WORKSPACE_LIST, { appId });
|
|
33596
34146
|
},
|
|
33597
34147
|
|
|
33598
34148
|
/**
|
|
@@ -33603,7 +34153,7 @@ const workspaceApi$2 = {
|
|
|
33603
34153
|
* @returns
|
|
33604
34154
|
*/
|
|
33605
34155
|
saveWorkspaceForApplication: (appId, data) =>
|
|
33606
|
-
ipcRenderer$
|
|
34156
|
+
ipcRenderer$m.invoke(WORKSPACE_SAVE, { appId, data }),
|
|
33607
34157
|
|
|
33608
34158
|
/**
|
|
33609
34159
|
* deleteWorkspaceForApplication
|
|
@@ -33613,7 +34163,7 @@ const workspaceApi$2 = {
|
|
|
33613
34163
|
* @returns
|
|
33614
34164
|
*/
|
|
33615
34165
|
deleteWorkspaceForApplication: (appId, workspaceId) =>
|
|
33616
|
-
ipcRenderer$
|
|
34166
|
+
ipcRenderer$m.invoke(WORKSPACE_DELETE, { appId, workspaceId }),
|
|
33617
34167
|
};
|
|
33618
34168
|
|
|
33619
34169
|
var workspaceApi_1 = workspaceApi$2;
|
|
@@ -33625,15 +34175,15 @@ var workspaceApi_1 = workspaceApi$2;
|
|
|
33625
34175
|
*/
|
|
33626
34176
|
|
|
33627
34177
|
// ipcRenderer that must be used to invoke the events
|
|
33628
|
-
const { ipcRenderer: ipcRenderer$
|
|
34178
|
+
const { ipcRenderer: ipcRenderer$l } = require$$0$1;
|
|
33629
34179
|
|
|
33630
34180
|
const { LAYOUT_LIST, LAYOUT_SAVE } = events$8;
|
|
33631
34181
|
|
|
33632
34182
|
const layoutApi$2 = {
|
|
33633
34183
|
listLayoutsForApplication: (appId) =>
|
|
33634
|
-
ipcRenderer$
|
|
34184
|
+
ipcRenderer$l.invoke(LAYOUT_LIST, { appId }),
|
|
33635
34185
|
saveLayoutForApplication: (appId, data) =>
|
|
33636
|
-
ipcRenderer$
|
|
34186
|
+
ipcRenderer$l.invoke(LAYOUT_SAVE, { appId, data }),
|
|
33637
34187
|
};
|
|
33638
34188
|
|
|
33639
34189
|
var layoutApi_1 = layoutApi$2;
|
|
@@ -33645,7 +34195,7 @@ var layoutApi_1 = layoutApi$2;
|
|
|
33645
34195
|
*/
|
|
33646
34196
|
|
|
33647
34197
|
// ipcRenderer that must be used to invoke the events
|
|
33648
|
-
const { ipcRenderer: ipcRenderer$
|
|
34198
|
+
const { ipcRenderer: ipcRenderer$k } = require$$0$1;
|
|
33649
34199
|
|
|
33650
34200
|
const {
|
|
33651
34201
|
DATA_JSON_TO_CSV_FILE,
|
|
@@ -33664,7 +34214,7 @@ const {
|
|
|
33664
34214
|
const dataApi$2 = {
|
|
33665
34215
|
// convert a json array of objects to a csv string and save to file
|
|
33666
34216
|
convertJsonToCsvFile: (appId, jsonObject, filename) =>
|
|
33667
|
-
ipcRenderer$
|
|
34217
|
+
ipcRenderer$k.invoke(DATA_JSON_TO_CSV_FILE, {
|
|
33668
34218
|
appId,
|
|
33669
34219
|
jsonObject,
|
|
33670
34220
|
filename,
|
|
@@ -33672,10 +34222,10 @@ const dataApi$2 = {
|
|
|
33672
34222
|
|
|
33673
34223
|
// convert a json array of objects to a csv string and return a string
|
|
33674
34224
|
convertJsonToCsvString: (appId, jsonObject) =>
|
|
33675
|
-
ipcRenderer$
|
|
34225
|
+
ipcRenderer$k.invoke(DATA_JSON_TO_CSV_STRING, { appId, jsonObject }),
|
|
33676
34226
|
|
|
33677
34227
|
parseXMLStream: (filepath, outpath, start) =>
|
|
33678
|
-
ipcRenderer$
|
|
34228
|
+
ipcRenderer$k.invoke(PARSE_XML_STREAM, {
|
|
33679
34229
|
filepath,
|
|
33680
34230
|
outpath,
|
|
33681
34231
|
start,
|
|
@@ -33689,7 +34239,7 @@ const dataApi$2 = {
|
|
|
33689
34239
|
headers = null,
|
|
33690
34240
|
limit = null,
|
|
33691
34241
|
) => {
|
|
33692
|
-
ipcRenderer$
|
|
34242
|
+
ipcRenderer$k.invoke(PARSE_CSV_STREAM, {
|
|
33693
34243
|
filepath,
|
|
33694
34244
|
outpath,
|
|
33695
34245
|
delimiter,
|
|
@@ -33700,15 +34250,15 @@ const dataApi$2 = {
|
|
|
33700
34250
|
},
|
|
33701
34251
|
|
|
33702
34252
|
readLinesFromFile: (filepath, lineCount) => {
|
|
33703
|
-
ipcRenderer$
|
|
34253
|
+
ipcRenderer$k.invoke(READ_LINES, { filepath, lineCount });
|
|
33704
34254
|
},
|
|
33705
34255
|
|
|
33706
34256
|
readJSONFromFile: (filepath, objectCount = null) => {
|
|
33707
|
-
ipcRenderer$
|
|
34257
|
+
ipcRenderer$k.invoke(READ_JSON, { filepath, objectCount });
|
|
33708
34258
|
},
|
|
33709
34259
|
|
|
33710
34260
|
readDataFromURL: (url, toFilepath) => {
|
|
33711
|
-
ipcRenderer$
|
|
34261
|
+
ipcRenderer$k.invoke(READ_DATA_URL, { url, toFilepath });
|
|
33712
34262
|
},
|
|
33713
34263
|
|
|
33714
34264
|
/*
|
|
@@ -33717,7 +34267,7 @@ const dataApi$2 = {
|
|
|
33717
34267
|
* @param {object} returnEmpty the return empty object
|
|
33718
34268
|
*/
|
|
33719
34269
|
saveData: (data, filename, append, returnEmpty, uuid) =>
|
|
33720
|
-
ipcRenderer$
|
|
34270
|
+
ipcRenderer$k.invoke(DATA_SAVE_TO_FILE, {
|
|
33721
34271
|
data,
|
|
33722
34272
|
filename,
|
|
33723
34273
|
append,
|
|
@@ -33729,14 +34279,14 @@ const dataApi$2 = {
|
|
|
33729
34279
|
* @param {string} filename the filename to read (not path)
|
|
33730
34280
|
*/
|
|
33731
34281
|
readData: (filename, returnEmpty = []) =>
|
|
33732
|
-
ipcRenderer$
|
|
34282
|
+
ipcRenderer$k.invoke(DATA_READ_FROM_FILE, { filename, returnEmpty }),
|
|
33733
34283
|
|
|
33734
34284
|
/**
|
|
33735
34285
|
* transformFile
|
|
33736
34286
|
* @returns
|
|
33737
34287
|
*/
|
|
33738
34288
|
transformFile: (filepath, outFilepath, mappingFunctionBody, args) => {
|
|
33739
|
-
ipcRenderer$
|
|
34289
|
+
ipcRenderer$k.invoke(TRANSFORM_FILE, {
|
|
33740
34290
|
filepath,
|
|
33741
34291
|
outFilepath,
|
|
33742
34292
|
mappingFunctionBody,
|
|
@@ -33745,7 +34295,7 @@ const dataApi$2 = {
|
|
|
33745
34295
|
},
|
|
33746
34296
|
|
|
33747
34297
|
extractColorsFromImageURL: (url) => {
|
|
33748
|
-
ipcRenderer$
|
|
34298
|
+
ipcRenderer$k.invoke(EXTRACT_COLORS_FROM_IMAGE, {
|
|
33749
34299
|
url,
|
|
33750
34300
|
});
|
|
33751
34301
|
},
|
|
@@ -33760,7 +34310,7 @@ var dataApi_1 = dataApi$2;
|
|
|
33760
34310
|
*/
|
|
33761
34311
|
|
|
33762
34312
|
// ipcRenderer that must be used to invoke the events
|
|
33763
|
-
const { ipcRenderer: ipcRenderer$
|
|
34313
|
+
const { ipcRenderer: ipcRenderer$j } = require$$0$1;
|
|
33764
34314
|
|
|
33765
34315
|
const {
|
|
33766
34316
|
SETTINGS_GET,
|
|
@@ -33771,14 +34321,14 @@ const {
|
|
|
33771
34321
|
} = events$8;
|
|
33772
34322
|
|
|
33773
34323
|
const settingsApi$2 = {
|
|
33774
|
-
getSettingsForApplication: () => ipcRenderer$
|
|
34324
|
+
getSettingsForApplication: () => ipcRenderer$j.invoke(SETTINGS_GET, {}),
|
|
33775
34325
|
saveSettingsForApplication: (data) =>
|
|
33776
|
-
ipcRenderer$
|
|
33777
|
-
getDataDirectory: () => ipcRenderer$
|
|
34326
|
+
ipcRenderer$j.invoke(SETTINGS_SAVE, { data }),
|
|
34327
|
+
getDataDirectory: () => ipcRenderer$j.invoke(SETTINGS_GET_DATA_DIR, {}),
|
|
33778
34328
|
setDataDirectory: (dataDirectory) =>
|
|
33779
|
-
ipcRenderer$
|
|
34329
|
+
ipcRenderer$j.invoke(SETTINGS_SET_DATA_DIR, { dataDirectory }),
|
|
33780
34330
|
migrateDataDirectory: (oldDirectory, newDirectory) =>
|
|
33781
|
-
ipcRenderer$
|
|
34331
|
+
ipcRenderer$j.invoke(SETTINGS_MIGRATE_DATA_DIR, {
|
|
33782
34332
|
oldDirectory,
|
|
33783
34333
|
newDirectory,
|
|
33784
34334
|
}),
|
|
@@ -33793,7 +34343,7 @@ var settingsApi_1 = settingsApi$2;
|
|
|
33793
34343
|
*/
|
|
33794
34344
|
|
|
33795
34345
|
// ipcRenderer that must be used to invoke the events
|
|
33796
|
-
const { ipcRenderer: ipcRenderer$
|
|
34346
|
+
const { ipcRenderer: ipcRenderer$i } = require$$0$1;
|
|
33797
34347
|
|
|
33798
34348
|
const { CHOOSE_FILE } = events$8;
|
|
33799
34349
|
|
|
@@ -33805,7 +34355,7 @@ const dialogApi$2 = {
|
|
|
33805
34355
|
*/
|
|
33806
34356
|
chooseFile: (allowFile = true, extensions = ["*"]) => {
|
|
33807
34357
|
console.log("dialog api choose file");
|
|
33808
|
-
return ipcRenderer$
|
|
34358
|
+
return ipcRenderer$i.invoke(CHOOSE_FILE, { allowFile, extensions });
|
|
33809
34359
|
},
|
|
33810
34360
|
};
|
|
33811
34361
|
|
|
@@ -33824,7 +34374,7 @@ var dialogApi_1 = dialogApi$2;
|
|
|
33824
34374
|
* mainApi.widgets.uninstall('Weather')
|
|
33825
34375
|
*/
|
|
33826
34376
|
|
|
33827
|
-
const { ipcRenderer: ipcRenderer$
|
|
34377
|
+
const { ipcRenderer: ipcRenderer$h } = require$$0$1;
|
|
33828
34378
|
|
|
33829
34379
|
const widgetApi$2 = {
|
|
33830
34380
|
/**
|
|
@@ -33833,7 +34383,7 @@ const widgetApi$2 = {
|
|
|
33833
34383
|
*/
|
|
33834
34384
|
list: async () => {
|
|
33835
34385
|
try {
|
|
33836
|
-
return await ipcRenderer$
|
|
34386
|
+
return await ipcRenderer$h.invoke("widget:list");
|
|
33837
34387
|
} catch (error) {
|
|
33838
34388
|
console.error("[WidgetApi] Error listing widgets:", error);
|
|
33839
34389
|
throw error;
|
|
@@ -33847,7 +34397,7 @@ const widgetApi$2 = {
|
|
|
33847
34397
|
*/
|
|
33848
34398
|
get: async (widgetName) => {
|
|
33849
34399
|
try {
|
|
33850
|
-
return await ipcRenderer$
|
|
34400
|
+
return await ipcRenderer$h.invoke("widget:get", widgetName);
|
|
33851
34401
|
} catch (error) {
|
|
33852
34402
|
console.error(`[WidgetApi] Error getting widget ${widgetName}:`, error);
|
|
33853
34403
|
throw error;
|
|
@@ -33878,7 +34428,7 @@ const widgetApi$2 = {
|
|
|
33878
34428
|
console.log(
|
|
33879
34429
|
`[WidgetApi] Installing widget: ${widgetName} from ${downloadUrl}`,
|
|
33880
34430
|
);
|
|
33881
|
-
const config = await ipcRenderer$
|
|
34431
|
+
const config = await ipcRenderer$h.invoke(
|
|
33882
34432
|
"widget:install",
|
|
33883
34433
|
widgetName,
|
|
33884
34434
|
downloadUrl,
|
|
@@ -33918,7 +34468,7 @@ const widgetApi$2 = {
|
|
|
33918
34468
|
console.log(
|
|
33919
34469
|
`[WidgetApi] Installing local widget: ${widgetName} from ${localPath}`,
|
|
33920
34470
|
);
|
|
33921
|
-
const config = await ipcRenderer$
|
|
34471
|
+
const config = await ipcRenderer$h.invoke(
|
|
33922
34472
|
"widget:install-local",
|
|
33923
34473
|
widgetName,
|
|
33924
34474
|
localPath,
|
|
@@ -33949,7 +34499,7 @@ const widgetApi$2 = {
|
|
|
33949
34499
|
loadFolder: async (folderPath) => {
|
|
33950
34500
|
try {
|
|
33951
34501
|
console.log(`[WidgetApi] Loading widgets from folder: ${folderPath}`);
|
|
33952
|
-
const results = await ipcRenderer$
|
|
34502
|
+
const results = await ipcRenderer$h.invoke(
|
|
33953
34503
|
"widget:load-folder",
|
|
33954
34504
|
folderPath,
|
|
33955
34505
|
);
|
|
@@ -33973,7 +34523,7 @@ const widgetApi$2 = {
|
|
|
33973
34523
|
uninstall: async (widgetName) => {
|
|
33974
34524
|
try {
|
|
33975
34525
|
console.log(`[WidgetApi] Uninstalling widget: ${widgetName}`);
|
|
33976
|
-
const success = await ipcRenderer$
|
|
34526
|
+
const success = await ipcRenderer$h.invoke("widget:uninstall", widgetName);
|
|
33977
34527
|
if (success) {
|
|
33978
34528
|
console.log(`[WidgetApi] ✓ Widget ${widgetName} uninstalled`);
|
|
33979
34529
|
} else {
|
|
@@ -33996,7 +34546,7 @@ const widgetApi$2 = {
|
|
|
33996
34546
|
*/
|
|
33997
34547
|
getCachePath: async () => {
|
|
33998
34548
|
try {
|
|
33999
|
-
return await ipcRenderer$
|
|
34549
|
+
return await ipcRenderer$h.invoke("widget:cache-path");
|
|
34000
34550
|
} catch (error) {
|
|
34001
34551
|
console.error("[WidgetApi] Error getting cache path:", error);
|
|
34002
34552
|
throw error;
|
|
@@ -34010,7 +34560,7 @@ const widgetApi$2 = {
|
|
|
34010
34560
|
*/
|
|
34011
34561
|
getStoragePath: async () => {
|
|
34012
34562
|
try {
|
|
34013
|
-
return await ipcRenderer$
|
|
34563
|
+
return await ipcRenderer$h.invoke("widget:storage-path");
|
|
34014
34564
|
} catch (error) {
|
|
34015
34565
|
console.error("[WidgetApi] Error getting storage path:", error);
|
|
34016
34566
|
throw error;
|
|
@@ -34027,7 +34577,7 @@ const widgetApi$2 = {
|
|
|
34027
34577
|
setStoragePath: async (customPath) => {
|
|
34028
34578
|
try {
|
|
34029
34579
|
console.log(`[WidgetApi] Setting storage path to: ${customPath}`);
|
|
34030
|
-
const result = await ipcRenderer$
|
|
34580
|
+
const result = await ipcRenderer$h.invoke(
|
|
34031
34581
|
"widget:set-storage-path",
|
|
34032
34582
|
customPath,
|
|
34033
34583
|
);
|
|
@@ -34049,7 +34599,7 @@ const widgetApi$2 = {
|
|
|
34049
34599
|
*/
|
|
34050
34600
|
getComponentConfigs: async () => {
|
|
34051
34601
|
try {
|
|
34052
|
-
return await ipcRenderer$
|
|
34602
|
+
return await ipcRenderer$h.invoke("widget:get-component-configs");
|
|
34053
34603
|
} catch (error) {
|
|
34054
34604
|
console.error("[WidgetApi] Error getting component configs:", error);
|
|
34055
34605
|
return [];
|
|
@@ -34064,7 +34614,7 @@ const widgetApi$2 = {
|
|
|
34064
34614
|
*/
|
|
34065
34615
|
readBundle: async (widgetName) => {
|
|
34066
34616
|
try {
|
|
34067
|
-
return await ipcRenderer$
|
|
34617
|
+
return await ipcRenderer$h.invoke("widget:read-bundle", widgetName);
|
|
34068
34618
|
} catch (error) {
|
|
34069
34619
|
console.error(
|
|
34070
34620
|
`[WidgetApi] Error reading bundle for ${widgetName}:`,
|
|
@@ -34081,7 +34631,7 @@ const widgetApi$2 = {
|
|
|
34081
34631
|
*/
|
|
34082
34632
|
readAllBundles: async () => {
|
|
34083
34633
|
try {
|
|
34084
|
-
return await ipcRenderer$
|
|
34634
|
+
return await ipcRenderer$h.invoke("widget:read-all-bundles");
|
|
34085
34635
|
} catch (error) {
|
|
34086
34636
|
console.error("[WidgetApi] Error reading all bundles:", error);
|
|
34087
34637
|
return [];
|
|
@@ -34101,7 +34651,7 @@ const widgetApi$2 = {
|
|
|
34101
34651
|
* });
|
|
34102
34652
|
*/
|
|
34103
34653
|
onInstalled: (callback) => {
|
|
34104
|
-
ipcRenderer$
|
|
34654
|
+
ipcRenderer$h.on("widget:installed", (event, data) => {
|
|
34105
34655
|
callback(data);
|
|
34106
34656
|
});
|
|
34107
34657
|
},
|
|
@@ -34119,7 +34669,7 @@ const widgetApi$2 = {
|
|
|
34119
34669
|
* });
|
|
34120
34670
|
*/
|
|
34121
34671
|
onLoaded: (callback) => {
|
|
34122
|
-
ipcRenderer$
|
|
34672
|
+
ipcRenderer$h.on("widgets:loaded", (event, data) => {
|
|
34123
34673
|
callback(data);
|
|
34124
34674
|
});
|
|
34125
34675
|
},
|
|
@@ -34130,7 +34680,7 @@ const widgetApi$2 = {
|
|
|
34130
34680
|
* @param {Function} callback - The callback to remove
|
|
34131
34681
|
*/
|
|
34132
34682
|
removeInstalledListener: (callback) => {
|
|
34133
|
-
ipcRenderer$
|
|
34683
|
+
ipcRenderer$h.removeListener("widget:installed", callback);
|
|
34134
34684
|
},
|
|
34135
34685
|
|
|
34136
34686
|
/**
|
|
@@ -34139,7 +34689,7 @@ const widgetApi$2 = {
|
|
|
34139
34689
|
* @param {Function} callback - The callback to remove
|
|
34140
34690
|
*/
|
|
34141
34691
|
removeLoadedListener: (callback) => {
|
|
34142
|
-
ipcRenderer$
|
|
34692
|
+
ipcRenderer$h.removeListener("widgets:loaded", callback);
|
|
34143
34693
|
},
|
|
34144
34694
|
};
|
|
34145
34695
|
|
|
@@ -34152,7 +34702,7 @@ var widgetApi_1 = widgetApi$2;
|
|
|
34152
34702
|
* Communicates with main process via IPC to handle encryption and file storage
|
|
34153
34703
|
*/
|
|
34154
34704
|
|
|
34155
|
-
const { ipcRenderer: ipcRenderer$
|
|
34705
|
+
const { ipcRenderer: ipcRenderer$g } = require$$0$1;
|
|
34156
34706
|
const {
|
|
34157
34707
|
PROVIDER_SAVE,
|
|
34158
34708
|
PROVIDER_LIST,
|
|
@@ -34184,7 +34734,7 @@ const providerApi$2 = {
|
|
|
34184
34734
|
mcpConfig = null,
|
|
34185
34735
|
allowedTools = null,
|
|
34186
34736
|
) =>
|
|
34187
|
-
ipcRenderer$
|
|
34737
|
+
ipcRenderer$g.invoke(PROVIDER_SAVE, {
|
|
34188
34738
|
appId,
|
|
34189
34739
|
providerName,
|
|
34190
34740
|
providerType,
|
|
@@ -34202,7 +34752,7 @@ const providerApi$2 = {
|
|
|
34202
34752
|
* @param {String} appId - the appId specified in the dash initialization
|
|
34203
34753
|
* @returns {Promise<Array>} Array of provider objects with name, type, credentials
|
|
34204
34754
|
*/
|
|
34205
|
-
listProviders: (appId) => ipcRenderer$
|
|
34755
|
+
listProviders: (appId) => ipcRenderer$g.invoke(PROVIDER_LIST, { appId }),
|
|
34206
34756
|
|
|
34207
34757
|
/**
|
|
34208
34758
|
* getProvider
|
|
@@ -34214,7 +34764,7 @@ const providerApi$2 = {
|
|
|
34214
34764
|
* @returns {Promise<Object>} Provider object with name, type, credentials
|
|
34215
34765
|
*/
|
|
34216
34766
|
getProvider: (appId, providerName) =>
|
|
34217
|
-
ipcRenderer$
|
|
34767
|
+
ipcRenderer$g.invoke(PROVIDER_GET, { appId, providerName }),
|
|
34218
34768
|
|
|
34219
34769
|
/**
|
|
34220
34770
|
* deleteProvider
|
|
@@ -34226,7 +34776,7 @@ const providerApi$2 = {
|
|
|
34226
34776
|
* @returns {Promise}
|
|
34227
34777
|
*/
|
|
34228
34778
|
deleteProvider: (appId, providerName) =>
|
|
34229
|
-
ipcRenderer$
|
|
34779
|
+
ipcRenderer$g.invoke(PROVIDER_DELETE, { appId, providerName }),
|
|
34230
34780
|
|
|
34231
34781
|
/**
|
|
34232
34782
|
* listProvidersForApplication
|
|
@@ -34236,14 +34786,14 @@ const providerApi$2 = {
|
|
|
34236
34786
|
* @param {String} appId - the appId specified in the dash initialization
|
|
34237
34787
|
*/
|
|
34238
34788
|
listProvidersForApplication: (appId) => {
|
|
34239
|
-
ipcRenderer$
|
|
34789
|
+
ipcRenderer$g
|
|
34240
34790
|
.invoke(PROVIDER_LIST, { appId })
|
|
34241
34791
|
.then((result) => {
|
|
34242
34792
|
// Emit the event for ElectronDashboardApi to listen to
|
|
34243
|
-
ipcRenderer$
|
|
34793
|
+
ipcRenderer$g.send("PROVIDER_LIST_COMPLETE", result);
|
|
34244
34794
|
})
|
|
34245
34795
|
.catch((error) => {
|
|
34246
|
-
ipcRenderer$
|
|
34796
|
+
ipcRenderer$g.send("PROVIDER_LIST_ERROR", {
|
|
34247
34797
|
error: error.message,
|
|
34248
34798
|
});
|
|
34249
34799
|
});
|
|
@@ -34260,7 +34810,7 @@ const providerApi$2 = {
|
|
|
34260
34810
|
providerType,
|
|
34261
34811
|
credentials,
|
|
34262
34812
|
) => {
|
|
34263
|
-
ipcRenderer$
|
|
34813
|
+
ipcRenderer$g
|
|
34264
34814
|
.invoke(PROVIDER_SAVE, {
|
|
34265
34815
|
appId,
|
|
34266
34816
|
providerName,
|
|
@@ -34268,10 +34818,10 @@ const providerApi$2 = {
|
|
|
34268
34818
|
credentials,
|
|
34269
34819
|
})
|
|
34270
34820
|
.then((result) => {
|
|
34271
|
-
ipcRenderer$
|
|
34821
|
+
ipcRenderer$g.send("PROVIDER_SAVE_COMPLETE", result);
|
|
34272
34822
|
})
|
|
34273
34823
|
.catch((error) => {
|
|
34274
|
-
ipcRenderer$
|
|
34824
|
+
ipcRenderer$g.send("PROVIDER_SAVE_ERROR", {
|
|
34275
34825
|
error: error.message,
|
|
34276
34826
|
});
|
|
34277
34827
|
});
|
|
@@ -34283,13 +34833,13 @@ const providerApi$2 = {
|
|
|
34283
34833
|
* Event-listener-based version for use with ElectronDashboardApi
|
|
34284
34834
|
*/
|
|
34285
34835
|
getProviderForApplication: (appId, providerName) => {
|
|
34286
|
-
ipcRenderer$
|
|
34836
|
+
ipcRenderer$g
|
|
34287
34837
|
.invoke(PROVIDER_GET, { appId, providerName })
|
|
34288
34838
|
.then((result) => {
|
|
34289
|
-
ipcRenderer$
|
|
34839
|
+
ipcRenderer$g.send("PROVIDER_GET_COMPLETE", result);
|
|
34290
34840
|
})
|
|
34291
34841
|
.catch((error) => {
|
|
34292
|
-
ipcRenderer$
|
|
34842
|
+
ipcRenderer$g.send("PROVIDER_GET_ERROR", {
|
|
34293
34843
|
error: error.message,
|
|
34294
34844
|
});
|
|
34295
34845
|
});
|
|
@@ -34301,13 +34851,13 @@ const providerApi$2 = {
|
|
|
34301
34851
|
* Event-listener-based version for use with ElectronDashboardApi
|
|
34302
34852
|
*/
|
|
34303
34853
|
deleteProviderForApplication: (appId, providerName) => {
|
|
34304
|
-
ipcRenderer$
|
|
34854
|
+
ipcRenderer$g
|
|
34305
34855
|
.invoke(PROVIDER_DELETE, { appId, providerName })
|
|
34306
34856
|
.then((result) => {
|
|
34307
|
-
ipcRenderer$
|
|
34857
|
+
ipcRenderer$g.send("PROVIDER_DELETE_COMPLETE", result);
|
|
34308
34858
|
})
|
|
34309
34859
|
.catch((error) => {
|
|
34310
|
-
ipcRenderer$
|
|
34860
|
+
ipcRenderer$g.send("PROVIDER_DELETE_ERROR", {
|
|
34311
34861
|
error: error.message,
|
|
34312
34862
|
});
|
|
34313
34863
|
});
|
|
@@ -34323,7 +34873,7 @@ var providerApi_1 = providerApi$2;
|
|
|
34323
34873
|
* Communicates with main process via IPC to manage MCP server lifecycle.
|
|
34324
34874
|
*/
|
|
34325
34875
|
|
|
34326
|
-
const { ipcRenderer: ipcRenderer$
|
|
34876
|
+
const { ipcRenderer: ipcRenderer$f } = require$$0$1;
|
|
34327
34877
|
const {
|
|
34328
34878
|
MCP_START_SERVER,
|
|
34329
34879
|
MCP_STOP_SERVER,
|
|
@@ -34347,7 +34897,7 @@ const mcpApi$2 = {
|
|
|
34347
34897
|
* @returns {Promise<{ success, serverName, tools, status } | { error, message }>}
|
|
34348
34898
|
*/
|
|
34349
34899
|
startServer: (serverName, mcpConfig, credentials) =>
|
|
34350
|
-
ipcRenderer$
|
|
34900
|
+
ipcRenderer$f.invoke(MCP_START_SERVER, {
|
|
34351
34901
|
serverName,
|
|
34352
34902
|
mcpConfig,
|
|
34353
34903
|
credentials,
|
|
@@ -34361,7 +34911,7 @@ const mcpApi$2 = {
|
|
|
34361
34911
|
* @returns {Promise<{ success, serverName } | { error, message }>}
|
|
34362
34912
|
*/
|
|
34363
34913
|
stopServer: (serverName) =>
|
|
34364
|
-
ipcRenderer$
|
|
34914
|
+
ipcRenderer$f.invoke(MCP_STOP_SERVER, { serverName }),
|
|
34365
34915
|
|
|
34366
34916
|
/**
|
|
34367
34917
|
* listTools
|
|
@@ -34370,7 +34920,7 @@ const mcpApi$2 = {
|
|
|
34370
34920
|
* @param {string} serverName the server name
|
|
34371
34921
|
* @returns {Promise<{ tools } | { error, message }>}
|
|
34372
34922
|
*/
|
|
34373
|
-
listTools: (serverName) => ipcRenderer$
|
|
34923
|
+
listTools: (serverName) => ipcRenderer$f.invoke(MCP_LIST_TOOLS, { serverName }),
|
|
34374
34924
|
|
|
34375
34925
|
/**
|
|
34376
34926
|
* callTool
|
|
@@ -34383,7 +34933,7 @@ const mcpApi$2 = {
|
|
|
34383
34933
|
* @returns {Promise<{ result } | { error, message }>}
|
|
34384
34934
|
*/
|
|
34385
34935
|
callTool: (serverName, toolName, args, allowedTools = null) =>
|
|
34386
|
-
ipcRenderer$
|
|
34936
|
+
ipcRenderer$f.invoke(MCP_CALL_TOOL, {
|
|
34387
34937
|
serverName,
|
|
34388
34938
|
toolName,
|
|
34389
34939
|
args,
|
|
@@ -34398,7 +34948,7 @@ const mcpApi$2 = {
|
|
|
34398
34948
|
* @returns {Promise<{ resources } | { error, message }>}
|
|
34399
34949
|
*/
|
|
34400
34950
|
listResources: (serverName) =>
|
|
34401
|
-
ipcRenderer$
|
|
34951
|
+
ipcRenderer$f.invoke(MCP_LIST_RESOURCES, { serverName }),
|
|
34402
34952
|
|
|
34403
34953
|
/**
|
|
34404
34954
|
* readResource
|
|
@@ -34409,7 +34959,7 @@ const mcpApi$2 = {
|
|
|
34409
34959
|
* @returns {Promise<{ resource } | { error, message }>}
|
|
34410
34960
|
*/
|
|
34411
34961
|
readResource: (serverName, uri) =>
|
|
34412
|
-
ipcRenderer$
|
|
34962
|
+
ipcRenderer$f.invoke(MCP_READ_RESOURCE, { serverName, uri }),
|
|
34413
34963
|
|
|
34414
34964
|
/**
|
|
34415
34965
|
* getServerStatus
|
|
@@ -34419,7 +34969,7 @@ const mcpApi$2 = {
|
|
|
34419
34969
|
* @returns {Promise<{ status, tools, error }>}
|
|
34420
34970
|
*/
|
|
34421
34971
|
getServerStatus: (serverName) =>
|
|
34422
|
-
ipcRenderer$
|
|
34972
|
+
ipcRenderer$f.invoke(MCP_SERVER_STATUS, { serverName }),
|
|
34423
34973
|
|
|
34424
34974
|
/**
|
|
34425
34975
|
* getCatalog
|
|
@@ -34427,7 +34977,7 @@ const mcpApi$2 = {
|
|
|
34427
34977
|
*
|
|
34428
34978
|
* @returns {Promise<{ catalog } | { error, message }>}
|
|
34429
34979
|
*/
|
|
34430
|
-
getCatalog: () => ipcRenderer$
|
|
34980
|
+
getCatalog: () => ipcRenderer$f.invoke(MCP_GET_CATALOG),
|
|
34431
34981
|
|
|
34432
34982
|
/**
|
|
34433
34983
|
* runAuth
|
|
@@ -34439,7 +34989,7 @@ const mcpApi$2 = {
|
|
|
34439
34989
|
* @returns {Promise<{ success } | { error, message }>}
|
|
34440
34990
|
*/
|
|
34441
34991
|
runAuth: (mcpConfig, credentials, authCommand) =>
|
|
34442
|
-
ipcRenderer$
|
|
34992
|
+
ipcRenderer$f.invoke(MCP_RUN_AUTH, { mcpConfig, credentials, authCommand }),
|
|
34443
34993
|
};
|
|
34444
34994
|
|
|
34445
34995
|
var mcpApi_1 = mcpApi$2;
|
|
@@ -34457,7 +35007,7 @@ var mcpApi_1 = mcpApi$2;
|
|
|
34457
35007
|
* mainApi.registry.checkUpdates([{ name: "weather-widgets", version: "1.0.0" }])
|
|
34458
35008
|
*/
|
|
34459
35009
|
|
|
34460
|
-
const { ipcRenderer: ipcRenderer$
|
|
35010
|
+
const { ipcRenderer: ipcRenderer$e } = require$$0$1;
|
|
34461
35011
|
|
|
34462
35012
|
const registryApi$2 = {
|
|
34463
35013
|
/**
|
|
@@ -34467,7 +35017,7 @@ const registryApi$2 = {
|
|
|
34467
35017
|
*/
|
|
34468
35018
|
fetchIndex: async (forceRefresh = false) => {
|
|
34469
35019
|
try {
|
|
34470
|
-
return await ipcRenderer$
|
|
35020
|
+
return await ipcRenderer$e.invoke("registry:fetch-index", forceRefresh);
|
|
34471
35021
|
} catch (error) {
|
|
34472
35022
|
console.error("[RegistryApi] Error fetching index:", error);
|
|
34473
35023
|
throw error;
|
|
@@ -34482,7 +35032,7 @@ const registryApi$2 = {
|
|
|
34482
35032
|
*/
|
|
34483
35033
|
search: async (query = "", filters = {}) => {
|
|
34484
35034
|
try {
|
|
34485
|
-
return await ipcRenderer$
|
|
35035
|
+
return await ipcRenderer$e.invoke("registry:search", query, filters);
|
|
34486
35036
|
} catch (error) {
|
|
34487
35037
|
console.error("[RegistryApi] Error searching registry:", error);
|
|
34488
35038
|
throw error;
|
|
@@ -34496,7 +35046,7 @@ const registryApi$2 = {
|
|
|
34496
35046
|
*/
|
|
34497
35047
|
getPackage: async (packageName) => {
|
|
34498
35048
|
try {
|
|
34499
|
-
return await ipcRenderer$
|
|
35049
|
+
return await ipcRenderer$e.invoke("registry:get-package", packageName);
|
|
34500
35050
|
} catch (error) {
|
|
34501
35051
|
console.error(
|
|
34502
35052
|
`[RegistryApi] Error getting package ${packageName}:`,
|
|
@@ -34513,7 +35063,7 @@ const registryApi$2 = {
|
|
|
34513
35063
|
*/
|
|
34514
35064
|
checkUpdates: async (installedWidgets = []) => {
|
|
34515
35065
|
try {
|
|
34516
|
-
return await ipcRenderer$
|
|
35066
|
+
return await ipcRenderer$e.invoke(
|
|
34517
35067
|
"registry:check-updates",
|
|
34518
35068
|
installedWidgets,
|
|
34519
35069
|
);
|
|
@@ -34531,7 +35081,7 @@ const registryApi$2 = {
|
|
|
34531
35081
|
*/
|
|
34532
35082
|
searchDashboards: async (query = "", filters = {}) => {
|
|
34533
35083
|
try {
|
|
34534
|
-
return await ipcRenderer$
|
|
35084
|
+
return await ipcRenderer$e.invoke(
|
|
34535
35085
|
"registry:search-dashboards",
|
|
34536
35086
|
query,
|
|
34537
35087
|
filters,
|
|
@@ -34550,7 +35100,7 @@ const registryApi$2 = {
|
|
|
34550
35100
|
*/
|
|
34551
35101
|
searchThemes: async (query = "", filters = {}) => {
|
|
34552
35102
|
try {
|
|
34553
|
-
return await ipcRenderer$
|
|
35103
|
+
return await ipcRenderer$e.invoke("registry:search-themes", query, filters);
|
|
34554
35104
|
} catch (error) {
|
|
34555
35105
|
console.error("[RegistryApi] Error searching themes:", error);
|
|
34556
35106
|
throw error;
|
|
@@ -34566,7 +35116,7 @@ var registryApi_1 = registryApi$2;
|
|
|
34566
35116
|
* Handle the theme configuration file
|
|
34567
35117
|
*/
|
|
34568
35118
|
|
|
34569
|
-
const { ipcRenderer: ipcRenderer$
|
|
35119
|
+
const { ipcRenderer: ipcRenderer$d } = require$$0$1;
|
|
34570
35120
|
|
|
34571
35121
|
const {
|
|
34572
35122
|
THEME_LIST,
|
|
@@ -34579,17 +35129,17 @@ const {
|
|
|
34579
35129
|
|
|
34580
35130
|
const themeApi$2 = {
|
|
34581
35131
|
listThemesForApplication: (appId) =>
|
|
34582
|
-
ipcRenderer$
|
|
35132
|
+
ipcRenderer$d.invoke(THEME_LIST, { appId }),
|
|
34583
35133
|
saveThemeForApplication: (appId, themeName, themeObject) =>
|
|
34584
|
-
ipcRenderer$
|
|
35134
|
+
ipcRenderer$d.invoke(THEME_SAVE, { appId, themeName, themeObject }),
|
|
34585
35135
|
deleteThemeForApplication: (appId, themeKey) =>
|
|
34586
|
-
ipcRenderer$
|
|
35136
|
+
ipcRenderer$d.invoke(THEME_DELETE, { appId, themeKey }),
|
|
34587
35137
|
publishTheme: (appId, themeKey, options) =>
|
|
34588
|
-
ipcRenderer$
|
|
35138
|
+
ipcRenderer$d.invoke(THEME_PUBLISH, { appId, themeKey, options }),
|
|
34589
35139
|
installThemeFromRegistry: (appId, packageName) =>
|
|
34590
|
-
ipcRenderer$
|
|
35140
|
+
ipcRenderer$d.invoke(THEME_INSTALL_FROM_REGISTRY, { appId, packageName }),
|
|
34591
35141
|
getThemePublishPreview: (appId, themeKey) =>
|
|
34592
|
-
ipcRenderer$
|
|
35142
|
+
ipcRenderer$d.invoke(THEME_PUBLISH_PREVIEW, { appId, themeKey }),
|
|
34593
35143
|
};
|
|
34594
35144
|
|
|
34595
35145
|
var themeApi_1 = themeApi$2;
|
|
@@ -34601,7 +35151,7 @@ var themeApi_1 = themeApi$2;
|
|
|
34601
35151
|
*/
|
|
34602
35152
|
|
|
34603
35153
|
// ipcRenderer that must be used to invoke the events
|
|
34604
|
-
const { ipcRenderer: ipcRenderer$
|
|
35154
|
+
const { ipcRenderer: ipcRenderer$c } = require$$0$1;
|
|
34605
35155
|
|
|
34606
35156
|
const {
|
|
34607
35157
|
ALGOLIA_LIST_INDICES,
|
|
@@ -34615,10 +35165,10 @@ const {
|
|
|
34615
35165
|
|
|
34616
35166
|
const algoliaApi$2 = {
|
|
34617
35167
|
listIndices: (application) =>
|
|
34618
|
-
ipcRenderer$
|
|
35168
|
+
ipcRenderer$c.invoke(ALGOLIA_LIST_INDICES, application),
|
|
34619
35169
|
|
|
34620
35170
|
browseObjects: (appId, apiKey, indexName) => {
|
|
34621
|
-
ipcRenderer$
|
|
35171
|
+
ipcRenderer$c.invoke(ALGOLIA_BROWSE_OBJECTS, {
|
|
34622
35172
|
appId,
|
|
34623
35173
|
apiKey,
|
|
34624
35174
|
indexName,
|
|
@@ -34626,10 +35176,10 @@ const algoliaApi$2 = {
|
|
|
34626
35176
|
});
|
|
34627
35177
|
},
|
|
34628
35178
|
|
|
34629
|
-
saveSynonyms: () => ipcRenderer$
|
|
35179
|
+
saveSynonyms: () => ipcRenderer$c.invoke(ALGOLIA_SAVE_SYNONYMS, {}),
|
|
34630
35180
|
|
|
34631
35181
|
getAnalyticsForQuery: (application, indexName, query) =>
|
|
34632
|
-
ipcRenderer$
|
|
35182
|
+
ipcRenderer$c.invoke(ALGOLIA_ANALYTICS_FOR_QUERY, {
|
|
34633
35183
|
application,
|
|
34634
35184
|
indexName,
|
|
34635
35185
|
query,
|
|
@@ -34642,7 +35192,7 @@ const algoliaApi$2 = {
|
|
|
34642
35192
|
dir,
|
|
34643
35193
|
createIfNotExists = false,
|
|
34644
35194
|
) =>
|
|
34645
|
-
ipcRenderer$
|
|
35195
|
+
ipcRenderer$c.invoke(ALGOLIA_PARTIAL_UPDATE_OBJECTS, {
|
|
34646
35196
|
appId,
|
|
34647
35197
|
apiKey,
|
|
34648
35198
|
indexName,
|
|
@@ -34651,7 +35201,7 @@ const algoliaApi$2 = {
|
|
|
34651
35201
|
}),
|
|
34652
35202
|
|
|
34653
35203
|
createBatchesFromFile: (filepath, batchFilepath, batchSize) => {
|
|
34654
|
-
ipcRenderer$
|
|
35204
|
+
ipcRenderer$c.invoke(ALGOLIA_CREATE_BATCH, {
|
|
34655
35205
|
filepath,
|
|
34656
35206
|
batchFilepath,
|
|
34657
35207
|
batchSize,
|
|
@@ -34659,7 +35209,7 @@ const algoliaApi$2 = {
|
|
|
34659
35209
|
},
|
|
34660
35210
|
|
|
34661
35211
|
browseObjectsToFile: (appId, apiKey, indexName, toFilename, query = "") => {
|
|
34662
|
-
ipcRenderer$
|
|
35212
|
+
ipcRenderer$c.invoke(ALGOLIA_BROWSE_OBJECTS, {
|
|
34663
35213
|
appId,
|
|
34664
35214
|
apiKey,
|
|
34665
35215
|
indexName,
|
|
@@ -34669,7 +35219,7 @@ const algoliaApi$2 = {
|
|
|
34669
35219
|
},
|
|
34670
35220
|
|
|
34671
35221
|
search: (appId, apiKey, indexName, query = "", options = {}) =>
|
|
34672
|
-
ipcRenderer$
|
|
35222
|
+
ipcRenderer$c.invoke(ALGOLIA_SEARCH, {
|
|
34673
35223
|
appId,
|
|
34674
35224
|
apiKey,
|
|
34675
35225
|
indexName,
|
|
@@ -34684,14 +35234,14 @@ var algoliaApi_1 = algoliaApi$2;
|
|
|
34684
35234
|
* openAI
|
|
34685
35235
|
*/
|
|
34686
35236
|
|
|
34687
|
-
const { ipcRenderer: ipcRenderer$
|
|
35237
|
+
const { ipcRenderer: ipcRenderer$b } = require$$0$1;
|
|
34688
35238
|
|
|
34689
35239
|
const { OPENAI_DESCRIBE_IMAGE } = openaiEvents$1;
|
|
34690
35240
|
|
|
34691
35241
|
const openaiApi$2 = {
|
|
34692
35242
|
// convert a json array of objects to a csv string and save to file
|
|
34693
35243
|
describeImage: (imageUrl, apiKey, prompt = "What's in this image?") =>
|
|
34694
|
-
ipcRenderer$
|
|
35244
|
+
ipcRenderer$b.invoke(OPENAI_DESCRIBE_IMAGE, { imageUrl, apiKey, prompt }),
|
|
34695
35245
|
};
|
|
34696
35246
|
|
|
34697
35247
|
var openaiApi_1 = openaiApi$2;
|
|
@@ -34702,14 +35252,14 @@ var openaiApi_1 = openaiApi$2;
|
|
|
34702
35252
|
*/
|
|
34703
35253
|
|
|
34704
35254
|
// ipcRenderer that must be used to invoke the events
|
|
34705
|
-
const { ipcRenderer: ipcRenderer$
|
|
35255
|
+
const { ipcRenderer: ipcRenderer$a } = require$$0$1;
|
|
34706
35256
|
|
|
34707
35257
|
const { MENU_ITEMS_SAVE, MENU_ITEMS_LIST } = events$8;
|
|
34708
35258
|
|
|
34709
35259
|
const menuItemsApi$2 = {
|
|
34710
35260
|
saveMenuItem: (appId, menuItem) =>
|
|
34711
|
-
ipcRenderer$
|
|
34712
|
-
listMenuItems: (appId) => ipcRenderer$
|
|
35261
|
+
ipcRenderer$a.invoke(MENU_ITEMS_SAVE, { appId, menuItem }),
|
|
35262
|
+
listMenuItems: (appId) => ipcRenderer$a.invoke(MENU_ITEMS_LIST, { appId }),
|
|
34713
35263
|
};
|
|
34714
35264
|
|
|
34715
35265
|
var menuItemsApi_1 = menuItemsApi$2;
|
|
@@ -34721,12 +35271,12 @@ var menuItemsApi_1 = menuItemsApi$2;
|
|
|
34721
35271
|
*/
|
|
34722
35272
|
|
|
34723
35273
|
// ipcRenderer that must be used to invoke the events
|
|
34724
|
-
const { ipcRenderer: ipcRenderer$
|
|
35274
|
+
const { ipcRenderer: ipcRenderer$9 } = require$$0$1;
|
|
34725
35275
|
|
|
34726
35276
|
const pluginApi$2 = {
|
|
34727
35277
|
install: (packageName, filepath) =>
|
|
34728
|
-
ipcRenderer$
|
|
34729
|
-
uninstall: (filepath) => ipcRenderer$
|
|
35278
|
+
ipcRenderer$9.invoke("plugin-install", { packageName, filepath }),
|
|
35279
|
+
uninstall: (filepath) => ipcRenderer$9.invoke("plugin-uninstall", filepath),
|
|
34730
35280
|
};
|
|
34731
35281
|
|
|
34732
35282
|
var pluginApi_1 = pluginApi$2;
|
|
@@ -34739,7 +35289,7 @@ var pluginApi_1 = pluginApi$2;
|
|
|
34739
35289
|
* tool-use events, and request cancellation.
|
|
34740
35290
|
*/
|
|
34741
35291
|
|
|
34742
|
-
const { ipcRenderer: ipcRenderer$
|
|
35292
|
+
const { ipcRenderer: ipcRenderer$8 } = require$$0$1;
|
|
34743
35293
|
const {
|
|
34744
35294
|
LLM_SEND_MESSAGE,
|
|
34745
35295
|
LLM_ABORT_REQUEST,
|
|
@@ -34761,7 +35311,7 @@ const _listenerMap = new Map();
|
|
|
34761
35311
|
function _addListener(channel, callback) {
|
|
34762
35312
|
const id = String(++_nextListenerId);
|
|
34763
35313
|
const wrapped = (_event, data) => callback(data);
|
|
34764
|
-
ipcRenderer$
|
|
35314
|
+
ipcRenderer$8.on(channel, wrapped);
|
|
34765
35315
|
_listenerMap.set(id, { channel, wrapped });
|
|
34766
35316
|
return id;
|
|
34767
35317
|
}
|
|
@@ -34776,7 +35326,7 @@ const llmApi$2 = {
|
|
|
34776
35326
|
* @returns {Promise<void>}
|
|
34777
35327
|
*/
|
|
34778
35328
|
sendMessage: (requestId, params) =>
|
|
34779
|
-
ipcRenderer$
|
|
35329
|
+
ipcRenderer$8.invoke(LLM_SEND_MESSAGE, { requestId, ...params }),
|
|
34780
35330
|
|
|
34781
35331
|
/**
|
|
34782
35332
|
* abortRequest
|
|
@@ -34786,7 +35336,7 @@ const llmApi$2 = {
|
|
|
34786
35336
|
* @returns {Promise<{ success: boolean }>}
|
|
34787
35337
|
*/
|
|
34788
35338
|
abortRequest: (requestId) =>
|
|
34789
|
-
ipcRenderer$
|
|
35339
|
+
ipcRenderer$8.invoke(LLM_ABORT_REQUEST, { requestId }),
|
|
34790
35340
|
|
|
34791
35341
|
/**
|
|
34792
35342
|
* listConnectedTools
|
|
@@ -34794,7 +35344,7 @@ const llmApi$2 = {
|
|
|
34794
35344
|
*
|
|
34795
35345
|
* @returns {Promise<Array<{ serverName, tools, resources, status }>>}
|
|
34796
35346
|
*/
|
|
34797
|
-
listConnectedTools: () => ipcRenderer$
|
|
35347
|
+
listConnectedTools: () => ipcRenderer$8.invoke(LLM_LIST_CONNECTED_TOOLS),
|
|
34798
35348
|
|
|
34799
35349
|
/**
|
|
34800
35350
|
* checkCliAvailable
|
|
@@ -34802,7 +35352,7 @@ const llmApi$2 = {
|
|
|
34802
35352
|
*
|
|
34803
35353
|
* @returns {Promise<{ available: boolean, path?: string }>}
|
|
34804
35354
|
*/
|
|
34805
|
-
checkCliAvailable: () => ipcRenderer$
|
|
35355
|
+
checkCliAvailable: () => ipcRenderer$8.invoke(LLM_CHECK_CLI_AVAILABLE),
|
|
34806
35356
|
|
|
34807
35357
|
/**
|
|
34808
35358
|
* clearCliSession
|
|
@@ -34812,7 +35362,7 @@ const llmApi$2 = {
|
|
|
34812
35362
|
* @returns {Promise<{ success: boolean }>}
|
|
34813
35363
|
*/
|
|
34814
35364
|
clearCliSession: (widgetUuid) =>
|
|
34815
|
-
ipcRenderer$
|
|
35365
|
+
ipcRenderer$8.invoke(LLM_CLEAR_CLI_SESSION, { widgetUuid }),
|
|
34816
35366
|
|
|
34817
35367
|
/**
|
|
34818
35368
|
* getCliSessionStatus
|
|
@@ -34822,7 +35372,7 @@ const llmApi$2 = {
|
|
|
34822
35372
|
* @returns {Promise<{ hasSession: boolean, sessionId?: string, isProcessActive: boolean }>}
|
|
34823
35373
|
*/
|
|
34824
35374
|
getCliSessionStatus: (widgetUuid) =>
|
|
34825
|
-
ipcRenderer$
|
|
35375
|
+
ipcRenderer$8.invoke(LLM_CLI_SESSION_STATUS, { widgetUuid }),
|
|
34826
35376
|
|
|
34827
35377
|
/**
|
|
34828
35378
|
* endCliSession
|
|
@@ -34832,7 +35382,7 @@ const llmApi$2 = {
|
|
|
34832
35382
|
* @returns {Promise<{ success: boolean }>}
|
|
34833
35383
|
*/
|
|
34834
35384
|
endCliSession: (widgetUuid) =>
|
|
34835
|
-
ipcRenderer$
|
|
35385
|
+
ipcRenderer$8.invoke(LLM_CLI_END_SESSION, { widgetUuid }),
|
|
34836
35386
|
|
|
34837
35387
|
// --- Stream event listeners ---
|
|
34838
35388
|
// Each on* method returns an opaque string ID. Strings cross the
|
|
@@ -34866,7 +35416,7 @@ const llmApi$2 = {
|
|
|
34866
35416
|
const listenerId = id !== undefined ? String(id) : String(idOrChannel);
|
|
34867
35417
|
const entry = _listenerMap.get(listenerId);
|
|
34868
35418
|
if (entry) {
|
|
34869
|
-
ipcRenderer$
|
|
35419
|
+
ipcRenderer$8.removeListener(entry.channel, entry.wrapped);
|
|
34870
35420
|
_listenerMap.delete(listenerId);
|
|
34871
35421
|
}
|
|
34872
35422
|
},
|
|
@@ -34878,14 +35428,14 @@ const llmApi$2 = {
|
|
|
34878
35428
|
*/
|
|
34879
35429
|
removeAllStreamListeners: () => {
|
|
34880
35430
|
for (const [, entry] of _listenerMap) {
|
|
34881
|
-
ipcRenderer$
|
|
35431
|
+
ipcRenderer$8.removeListener(entry.channel, entry.wrapped);
|
|
34882
35432
|
}
|
|
34883
35433
|
_listenerMap.clear();
|
|
34884
|
-
ipcRenderer$
|
|
34885
|
-
ipcRenderer$
|
|
34886
|
-
ipcRenderer$
|
|
34887
|
-
ipcRenderer$
|
|
34888
|
-
ipcRenderer$
|
|
35434
|
+
ipcRenderer$8.removeAllListeners(LLM_STREAM_DELTA);
|
|
35435
|
+
ipcRenderer$8.removeAllListeners(LLM_STREAM_TOOL_CALL);
|
|
35436
|
+
ipcRenderer$8.removeAllListeners(LLM_STREAM_TOOL_RESULT);
|
|
35437
|
+
ipcRenderer$8.removeAllListeners(LLM_STREAM_COMPLETE);
|
|
35438
|
+
ipcRenderer$8.removeAllListeners(LLM_STREAM_ERROR);
|
|
34889
35439
|
},
|
|
34890
35440
|
};
|
|
34891
35441
|
|
|
@@ -34899,7 +35449,7 @@ var llmApi_1 = llmApi$2;
|
|
|
34899
35449
|
* and manage the response cache.
|
|
34900
35450
|
*/
|
|
34901
35451
|
|
|
34902
|
-
const { ipcRenderer: ipcRenderer$
|
|
35452
|
+
const { ipcRenderer: ipcRenderer$7 } = require$$0$1;
|
|
34903
35453
|
const {
|
|
34904
35454
|
CLIENT_CACHE_INVALIDATE,
|
|
34905
35455
|
CLIENT_CACHE_INVALIDATE_ALL,
|
|
@@ -34916,28 +35466,28 @@ const clientCacheApi$2 = {
|
|
|
34916
35466
|
* @returns {Promise<{success: boolean}>}
|
|
34917
35467
|
*/
|
|
34918
35468
|
invalidate: (appId, providerName) =>
|
|
34919
|
-
ipcRenderer$
|
|
35469
|
+
ipcRenderer$7.invoke(CLIENT_CACHE_INVALIDATE, { appId, providerName }),
|
|
34920
35470
|
|
|
34921
35471
|
/**
|
|
34922
35472
|
* Invalidate all cached clients.
|
|
34923
35473
|
*
|
|
34924
35474
|
* @returns {Promise<{success: boolean}>}
|
|
34925
35475
|
*/
|
|
34926
|
-
invalidateAll: () => ipcRenderer$
|
|
35476
|
+
invalidateAll: () => ipcRenderer$7.invoke(CLIENT_CACHE_INVALIDATE_ALL),
|
|
34927
35477
|
|
|
34928
35478
|
/**
|
|
34929
35479
|
* Clear the response cache.
|
|
34930
35480
|
*
|
|
34931
35481
|
* @returns {Promise<{success: boolean}>}
|
|
34932
35482
|
*/
|
|
34933
|
-
clearResponseCache: () => ipcRenderer$
|
|
35483
|
+
clearResponseCache: () => ipcRenderer$7.invoke(RESPONSE_CACHE_CLEAR),
|
|
34934
35484
|
|
|
34935
35485
|
/**
|
|
34936
35486
|
* Get response cache statistics.
|
|
34937
35487
|
*
|
|
34938
35488
|
* @returns {Promise<{entries: number, inflight: number, keys: string[]}>}
|
|
34939
35489
|
*/
|
|
34940
|
-
responseCacheStats: () => ipcRenderer$
|
|
35490
|
+
responseCacheStats: () => ipcRenderer$7.invoke(RESPONSE_CACHE_STATS),
|
|
34941
35491
|
};
|
|
34942
35492
|
|
|
34943
35493
|
var clientCacheApi_1 = clientCacheApi$2;
|
|
@@ -34949,7 +35499,7 @@ var clientCacheApi_1 = clientCacheApi$2;
|
|
|
34949
35499
|
* Exposed via contextBridge through mainApi.
|
|
34950
35500
|
*/
|
|
34951
35501
|
|
|
34952
|
-
const { ipcRenderer: ipcRenderer$
|
|
35502
|
+
const { ipcRenderer: ipcRenderer$6 } = require$$0$1;
|
|
34953
35503
|
const {
|
|
34954
35504
|
DASHBOARD_CONFIG_EXPORT,
|
|
34955
35505
|
DASHBOARD_CONFIG_SELECT_FILE,
|
|
@@ -34973,7 +35523,7 @@ const dashboardConfigApi$2 = {
|
|
|
34973
35523
|
* @returns {Promise<Object>} Result with success, filePath, and config
|
|
34974
35524
|
*/
|
|
34975
35525
|
exportDashboardConfig: (appId, workspaceId, options = {}) =>
|
|
34976
|
-
ipcRenderer$
|
|
35526
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_EXPORT, {
|
|
34977
35527
|
appId,
|
|
34978
35528
|
workspaceId,
|
|
34979
35529
|
options,
|
|
@@ -34986,7 +35536,7 @@ const dashboardConfigApi$2 = {
|
|
|
34986
35536
|
*
|
|
34987
35537
|
* @returns {Promise<Object>} Result with success, filePath, and dashboardConfig preview
|
|
34988
35538
|
*/
|
|
34989
|
-
selectDashboardFile: () => ipcRenderer$
|
|
35539
|
+
selectDashboardFile: () => ipcRenderer$6.invoke(DASHBOARD_CONFIG_SELECT_FILE),
|
|
34990
35540
|
|
|
34991
35541
|
/**
|
|
34992
35542
|
* Import a dashboard config from a ZIP file.
|
|
@@ -34998,7 +35548,7 @@ const dashboardConfigApi$2 = {
|
|
|
34998
35548
|
* @returns {Promise<Object>} Result with success, workspace, and summary
|
|
34999
35549
|
*/
|
|
35000
35550
|
importDashboardConfig: (appId, options = {}) =>
|
|
35001
|
-
ipcRenderer$
|
|
35551
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_IMPORT, { appId, ...options }),
|
|
35002
35552
|
|
|
35003
35553
|
/**
|
|
35004
35554
|
* Install a dashboard from the registry by package name.
|
|
@@ -35010,7 +35560,7 @@ const dashboardConfigApi$2 = {
|
|
|
35010
35560
|
* @returns {Promise<Object>} Result with success, workspace, and summary
|
|
35011
35561
|
*/
|
|
35012
35562
|
installDashboardFromRegistry: (appId, packageName) =>
|
|
35013
|
-
ipcRenderer$
|
|
35563
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_INSTALL, {
|
|
35014
35564
|
appId,
|
|
35015
35565
|
packageName,
|
|
35016
35566
|
}),
|
|
@@ -35023,7 +35573,7 @@ const dashboardConfigApi$2 = {
|
|
|
35023
35573
|
* @returns {Promise<Object>} Compatibility report with per-widget status
|
|
35024
35574
|
*/
|
|
35025
35575
|
checkDashboardCompatibility: (appId, dashboardWidgets) =>
|
|
35026
|
-
ipcRenderer$
|
|
35576
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_COMPATIBILITY, {
|
|
35027
35577
|
appId,
|
|
35028
35578
|
dashboardWidgets,
|
|
35029
35579
|
}),
|
|
@@ -35039,7 +35589,7 @@ const dashboardConfigApi$2 = {
|
|
|
35039
35589
|
* @returns {Promise<Object>} Result with success, manifest, filePath
|
|
35040
35590
|
*/
|
|
35041
35591
|
prepareDashboardForPublish: (appId, workspaceId, options = {}) =>
|
|
35042
|
-
ipcRenderer$
|
|
35592
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_PUBLISH, {
|
|
35043
35593
|
appId,
|
|
35044
35594
|
workspaceId,
|
|
35045
35595
|
options,
|
|
@@ -35053,7 +35603,7 @@ const dashboardConfigApi$2 = {
|
|
|
35053
35603
|
* @returns {Promise<Object>} Preview with metadata, widgets, wiring, compatibility
|
|
35054
35604
|
*/
|
|
35055
35605
|
getDashboardPreview: (packageName) =>
|
|
35056
|
-
ipcRenderer$
|
|
35606
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_PREVIEW, { packageName }),
|
|
35057
35607
|
|
|
35058
35608
|
/**
|
|
35059
35609
|
* Check installed dashboards for available updates.
|
|
@@ -35062,7 +35612,7 @@ const dashboardConfigApi$2 = {
|
|
|
35062
35612
|
* @returns {Promise<Object>} Result with updates array
|
|
35063
35613
|
*/
|
|
35064
35614
|
checkDashboardUpdates: (appId) =>
|
|
35065
|
-
ipcRenderer$
|
|
35615
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_CHECK_UPDATES, { appId }),
|
|
35066
35616
|
|
|
35067
35617
|
/**
|
|
35068
35618
|
* Get provider setup manifest for a dashboard's requirements.
|
|
@@ -35072,7 +35622,7 @@ const dashboardConfigApi$2 = {
|
|
|
35072
35622
|
* @returns {Promise<Object>} Setup manifest with per-provider status
|
|
35073
35623
|
*/
|
|
35074
35624
|
getProviderSetupManifest: (appId, requiredProviders) =>
|
|
35075
|
-
ipcRenderer$
|
|
35625
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_PROVIDER_SETUP, {
|
|
35076
35626
|
appId,
|
|
35077
35627
|
requiredProviders,
|
|
35078
35628
|
}),
|
|
@@ -35086,7 +35636,7 @@ const dashboardConfigApi$2 = {
|
|
|
35086
35636
|
* @returns {Promise<Object>} Preview with dashboardName, widgetCount, widgets, componentNames
|
|
35087
35637
|
*/
|
|
35088
35638
|
getPublishPreview: (appId, workspaceId) =>
|
|
35089
|
-
ipcRenderer$
|
|
35639
|
+
ipcRenderer$6.invoke(DASHBOARD_CONFIG_PUBLISH_PREVIEW, {
|
|
35090
35640
|
appId,
|
|
35091
35641
|
workspaceId,
|
|
35092
35642
|
}),
|
|
@@ -35101,7 +35651,7 @@ var dashboardConfigApi_1 = dashboardConfigApi$2;
|
|
|
35101
35651
|
* Exposed via contextBridge through mainApi.
|
|
35102
35652
|
*/
|
|
35103
35653
|
|
|
35104
|
-
const { ipcRenderer: ipcRenderer$
|
|
35654
|
+
const { ipcRenderer: ipcRenderer$5 } = require$$0$1;
|
|
35105
35655
|
const {
|
|
35106
35656
|
REGISTRY_AUTH_INITIATE_LOGIN,
|
|
35107
35657
|
REGISTRY_AUTH_POLL_TOKEN,
|
|
@@ -35122,7 +35672,7 @@ const registryAuthApi$2 = {
|
|
|
35122
35672
|
*
|
|
35123
35673
|
* @returns {Promise<Object>} { deviceCode, userCode, verificationUrl, verificationUrlComplete, expiresIn, interval }
|
|
35124
35674
|
*/
|
|
35125
|
-
initiateLogin: () => ipcRenderer$
|
|
35675
|
+
initiateLogin: () => ipcRenderer$5.invoke(REGISTRY_AUTH_INITIATE_LOGIN),
|
|
35126
35676
|
|
|
35127
35677
|
/**
|
|
35128
35678
|
* Poll for token after user completes browser auth.
|
|
@@ -35131,26 +35681,26 @@ const registryAuthApi$2 = {
|
|
|
35131
35681
|
* @returns {Promise<Object>} { status: 'pending' | 'authorized' | 'expired', token?, userId? }
|
|
35132
35682
|
*/
|
|
35133
35683
|
pollToken: (deviceCode) =>
|
|
35134
|
-
ipcRenderer$
|
|
35684
|
+
ipcRenderer$5.invoke(REGISTRY_AUTH_POLL_TOKEN, { deviceCode }),
|
|
35135
35685
|
|
|
35136
35686
|
/**
|
|
35137
35687
|
* Get current auth status.
|
|
35138
35688
|
*
|
|
35139
35689
|
* @returns {Promise<Object>} { authenticated: boolean, userId?: string }
|
|
35140
35690
|
*/
|
|
35141
|
-
getStatus: () => ipcRenderer$
|
|
35691
|
+
getStatus: () => ipcRenderer$5.invoke(REGISTRY_AUTH_GET_STATUS),
|
|
35142
35692
|
|
|
35143
35693
|
/**
|
|
35144
35694
|
* Get the authenticated user's registry profile.
|
|
35145
35695
|
*
|
|
35146
35696
|
* @returns {Promise<Object|null>} User profile or null
|
|
35147
35697
|
*/
|
|
35148
|
-
getProfile: () => ipcRenderer$
|
|
35698
|
+
getProfile: () => ipcRenderer$5.invoke(REGISTRY_AUTH_GET_PROFILE),
|
|
35149
35699
|
|
|
35150
35700
|
/**
|
|
35151
35701
|
* Logout from registry.
|
|
35152
35702
|
*/
|
|
35153
|
-
logout: () => ipcRenderer$
|
|
35703
|
+
logout: () => ipcRenderer$5.invoke(REGISTRY_AUTH_LOGOUT),
|
|
35154
35704
|
|
|
35155
35705
|
/**
|
|
35156
35706
|
* Publish a ZIP to the registry.
|
|
@@ -35160,7 +35710,7 @@ const registryAuthApi$2 = {
|
|
|
35160
35710
|
* @returns {Promise<Object>} { success, registryUrl, packageId, version, error? }
|
|
35161
35711
|
*/
|
|
35162
35712
|
publish: (zipPath, manifest) =>
|
|
35163
|
-
ipcRenderer$
|
|
35713
|
+
ipcRenderer$5.invoke(REGISTRY_AUTH_PUBLISH, { zipPath, manifest }),
|
|
35164
35714
|
|
|
35165
35715
|
/**
|
|
35166
35716
|
* Update the authenticated user's profile.
|
|
@@ -35169,14 +35719,14 @@ const registryAuthApi$2 = {
|
|
|
35169
35719
|
* @returns {Promise<Object|null>} Updated user or null
|
|
35170
35720
|
*/
|
|
35171
35721
|
updateProfile: (updates) =>
|
|
35172
|
-
ipcRenderer$
|
|
35722
|
+
ipcRenderer$5.invoke(REGISTRY_AUTH_UPDATE_PROFILE, updates),
|
|
35173
35723
|
|
|
35174
35724
|
/**
|
|
35175
35725
|
* Get the authenticated user's published packages.
|
|
35176
35726
|
*
|
|
35177
35727
|
* @returns {Promise<Object|null>} { packages: [...] } or null
|
|
35178
35728
|
*/
|
|
35179
|
-
getPackages: () => ipcRenderer$
|
|
35729
|
+
getPackages: () => ipcRenderer$5.invoke(REGISTRY_AUTH_GET_PACKAGES),
|
|
35180
35730
|
|
|
35181
35731
|
/**
|
|
35182
35732
|
* Update a published package's metadata.
|
|
@@ -35187,7 +35737,7 @@ const registryAuthApi$2 = {
|
|
|
35187
35737
|
* @returns {Promise<Object|null>} Updated package or null
|
|
35188
35738
|
*/
|
|
35189
35739
|
updatePackage: (scope, name, updates) =>
|
|
35190
|
-
ipcRenderer$
|
|
35740
|
+
ipcRenderer$5.invoke(REGISTRY_AUTH_UPDATE_PACKAGE, {
|
|
35191
35741
|
scope,
|
|
35192
35742
|
name,
|
|
35193
35743
|
updates,
|
|
@@ -35201,7 +35751,7 @@ const registryAuthApi$2 = {
|
|
|
35201
35751
|
* @returns {Promise<Object|null>} Response or null
|
|
35202
35752
|
*/
|
|
35203
35753
|
deletePackage: (scope, name) =>
|
|
35204
|
-
ipcRenderer$
|
|
35754
|
+
ipcRenderer$5.invoke(REGISTRY_AUTH_DELETE_PACKAGE, { scope, name }),
|
|
35205
35755
|
};
|
|
35206
35756
|
|
|
35207
35757
|
var registryAuthApi_1 = registryAuthApi$2;
|
|
@@ -35213,7 +35763,7 @@ var registryAuthApi_1 = registryAuthApi$2;
|
|
|
35213
35763
|
* Exposed to the renderer via mainApi.notifications.
|
|
35214
35764
|
*/
|
|
35215
35765
|
|
|
35216
|
-
const { ipcRenderer: ipcRenderer$
|
|
35766
|
+
const { ipcRenderer: ipcRenderer$4 } = require$$0$1;
|
|
35217
35767
|
const {
|
|
35218
35768
|
NOTIFICATION_SEND,
|
|
35219
35769
|
NOTIFICATION_GET_PREFERENCES,
|
|
@@ -35228,14 +35778,14 @@ const notificationApi$2 = {
|
|
|
35228
35778
|
* @param {Object} payload - { widgetName, widgetId, workspaceId, type, title, body, data?, silent?, urgency? }
|
|
35229
35779
|
* @returns {Promise<{ success: boolean, reason?: string }>}
|
|
35230
35780
|
*/
|
|
35231
|
-
send: (payload) => ipcRenderer$
|
|
35781
|
+
send: (payload) => ipcRenderer$4.invoke(NOTIFICATION_SEND, payload),
|
|
35232
35782
|
|
|
35233
35783
|
/**
|
|
35234
35784
|
* Get all notification preferences (global + per-instance).
|
|
35235
35785
|
*
|
|
35236
35786
|
* @returns {Promise<{ globalEnabled: boolean, doNotDisturb: boolean, instances: Object }>}
|
|
35237
35787
|
*/
|
|
35238
|
-
getPreferences: () => ipcRenderer$
|
|
35788
|
+
getPreferences: () => ipcRenderer$4.invoke(NOTIFICATION_GET_PREFERENCES),
|
|
35239
35789
|
|
|
35240
35790
|
/**
|
|
35241
35791
|
* Set per-widget-instance notification preferences.
|
|
@@ -35245,7 +35795,7 @@ const notificationApi$2 = {
|
|
|
35245
35795
|
* @returns {Promise<{ success: boolean }>}
|
|
35246
35796
|
*/
|
|
35247
35797
|
setPreferences: (widgetId, prefs) =>
|
|
35248
|
-
ipcRenderer$
|
|
35798
|
+
ipcRenderer$4.invoke(NOTIFICATION_SET_PREFERENCES, { widgetId, prefs }),
|
|
35249
35799
|
|
|
35250
35800
|
/**
|
|
35251
35801
|
* Set global notification settings (enabled, DND).
|
|
@@ -35254,7 +35804,7 @@ const notificationApi$2 = {
|
|
|
35254
35804
|
* @returns {Promise<{ success: boolean }>}
|
|
35255
35805
|
*/
|
|
35256
35806
|
setGlobal: (settings) =>
|
|
35257
|
-
ipcRenderer$
|
|
35807
|
+
ipcRenderer$4.invoke(NOTIFICATION_SET_GLOBAL, settings),
|
|
35258
35808
|
|
|
35259
35809
|
/**
|
|
35260
35810
|
* Listen for notification click events from the main process.
|
|
@@ -35264,8 +35814,8 @@ const notificationApi$2 = {
|
|
|
35264
35814
|
*/
|
|
35265
35815
|
onClicked: (callback) => {
|
|
35266
35816
|
const handler = (_event, data) => callback(data);
|
|
35267
|
-
ipcRenderer$
|
|
35268
|
-
return () => ipcRenderer$
|
|
35817
|
+
ipcRenderer$4.on("notification:clicked", handler);
|
|
35818
|
+
return () => ipcRenderer$4.removeListener("notification:clicked", handler);
|
|
35269
35819
|
},
|
|
35270
35820
|
|
|
35271
35821
|
/**
|
|
@@ -35276,14 +35826,118 @@ const notificationApi$2 = {
|
|
|
35276
35826
|
*/
|
|
35277
35827
|
onDndChanged: (callback) => {
|
|
35278
35828
|
const handler = (_event, dndEnabled) => callback(dndEnabled);
|
|
35279
|
-
ipcRenderer$
|
|
35829
|
+
ipcRenderer$4.on("notification:dnd-changed", handler);
|
|
35280
35830
|
return () =>
|
|
35281
|
-
ipcRenderer$
|
|
35831
|
+
ipcRenderer$4.removeListener("notification:dnd-changed", handler);
|
|
35282
35832
|
},
|
|
35283
35833
|
};
|
|
35284
35834
|
|
|
35285
35835
|
var notificationApi_1 = notificationApi$2;
|
|
35286
35836
|
|
|
35837
|
+
/**
|
|
35838
|
+
* schedulerApi.js
|
|
35839
|
+
*
|
|
35840
|
+
* Preload-side IPC bindings for the widget scheduled tasks system.
|
|
35841
|
+
* Exposed to the renderer via mainApi.scheduler.
|
|
35842
|
+
*/
|
|
35843
|
+
|
|
35844
|
+
const { ipcRenderer: ipcRenderer$3 } = require$$0$1;
|
|
35845
|
+
const {
|
|
35846
|
+
SCHEDULER_REGISTER_TASK,
|
|
35847
|
+
SCHEDULER_REMOVE_TASK,
|
|
35848
|
+
SCHEDULER_REMOVE_TASKS,
|
|
35849
|
+
SCHEDULER_GET_TASKS,
|
|
35850
|
+
SCHEDULER_UPDATE_TASK,
|
|
35851
|
+
SCHEDULER_ENABLE_TASK,
|
|
35852
|
+
SCHEDULER_DISABLE_TASK,
|
|
35853
|
+
SCHEDULER_GET_PENDING,
|
|
35854
|
+
SCHEDULER_TASK_FIRED,
|
|
35855
|
+
} = events$8;
|
|
35856
|
+
|
|
35857
|
+
const schedulerApi$2 = {
|
|
35858
|
+
/**
|
|
35859
|
+
* Register or update a scheduled task.
|
|
35860
|
+
*
|
|
35861
|
+
* @param {Object} payload - { widgetId, widgetName, workspaceId, taskKey, handler, displayName, scheduleType, intervalMs?, days?, time?, enabled? }
|
|
35862
|
+
* @returns {Promise<{ success: boolean, taskId?: string, error?: string }>}
|
|
35863
|
+
*/
|
|
35864
|
+
registerTask: (payload) =>
|
|
35865
|
+
ipcRenderer$3.invoke(SCHEDULER_REGISTER_TASK, payload),
|
|
35866
|
+
|
|
35867
|
+
/**
|
|
35868
|
+
* Remove a single task.
|
|
35869
|
+
*
|
|
35870
|
+
* @param {string} taskId - "widgetUuid:taskKey"
|
|
35871
|
+
* @returns {Promise<{ success: boolean }>}
|
|
35872
|
+
*/
|
|
35873
|
+
removeTask: (taskId) => ipcRenderer$3.invoke(SCHEDULER_REMOVE_TASK, taskId),
|
|
35874
|
+
|
|
35875
|
+
/**
|
|
35876
|
+
* Remove all tasks for a widget instance.
|
|
35877
|
+
*
|
|
35878
|
+
* @param {string} widgetId - widget instance UUID
|
|
35879
|
+
* @returns {Promise<{ success: boolean, count: number }>}
|
|
35880
|
+
*/
|
|
35881
|
+
removeTasks: (widgetId) =>
|
|
35882
|
+
ipcRenderer$3.invoke(SCHEDULER_REMOVE_TASKS, widgetId),
|
|
35883
|
+
|
|
35884
|
+
/**
|
|
35885
|
+
* Get all tasks for a widget instance.
|
|
35886
|
+
*
|
|
35887
|
+
* @param {string} widgetId - widget instance UUID
|
|
35888
|
+
* @returns {Promise<Object[]>}
|
|
35889
|
+
*/
|
|
35890
|
+
getTasks: (widgetId) => ipcRenderer$3.invoke(SCHEDULER_GET_TASKS, widgetId),
|
|
35891
|
+
|
|
35892
|
+
/**
|
|
35893
|
+
* Update a task's schedule configuration.
|
|
35894
|
+
*
|
|
35895
|
+
* @param {string} taskId - "widgetUuid:taskKey"
|
|
35896
|
+
* @param {Object} updates - { scheduleType?, intervalMs?, days?, time?, displayName?, enabled? }
|
|
35897
|
+
* @returns {Promise<{ success: boolean }>}
|
|
35898
|
+
*/
|
|
35899
|
+
updateTask: (taskId, updates) =>
|
|
35900
|
+
ipcRenderer$3.invoke(SCHEDULER_UPDATE_TASK, { taskId, updates }),
|
|
35901
|
+
|
|
35902
|
+
/**
|
|
35903
|
+
* Enable a task.
|
|
35904
|
+
*
|
|
35905
|
+
* @param {string} taskId - "widgetUuid:taskKey"
|
|
35906
|
+
* @returns {Promise<{ success: boolean }>}
|
|
35907
|
+
*/
|
|
35908
|
+
enableTask: (taskId) => ipcRenderer$3.invoke(SCHEDULER_ENABLE_TASK, taskId),
|
|
35909
|
+
|
|
35910
|
+
/**
|
|
35911
|
+
* Disable a task.
|
|
35912
|
+
*
|
|
35913
|
+
* @param {string} taskId - "widgetUuid:taskKey"
|
|
35914
|
+
* @returns {Promise<{ success: boolean }>}
|
|
35915
|
+
*/
|
|
35916
|
+
disableTask: (taskId) => ipcRenderer$3.invoke(SCHEDULER_DISABLE_TASK, taskId),
|
|
35917
|
+
|
|
35918
|
+
/**
|
|
35919
|
+
* Drain pending fire results for a widget.
|
|
35920
|
+
*
|
|
35921
|
+
* @param {string} widgetId - widget instance UUID
|
|
35922
|
+
* @returns {Promise<Object[]>}
|
|
35923
|
+
*/
|
|
35924
|
+
getPending: (widgetId) => ipcRenderer$3.invoke(SCHEDULER_GET_PENDING, widgetId),
|
|
35925
|
+
|
|
35926
|
+
/**
|
|
35927
|
+
* Listen for task-fired events from the main process.
|
|
35928
|
+
*
|
|
35929
|
+
* @param {Function} callback - ({ taskId, widgetId, taskKey, handler, firedAt }) => void
|
|
35930
|
+
* @returns {Function} removeListener function
|
|
35931
|
+
*/
|
|
35932
|
+
onTaskFired: (callback) => {
|
|
35933
|
+
const handler = (_event, data) => callback(data);
|
|
35934
|
+
ipcRenderer$3.on(SCHEDULER_TASK_FIRED, handler);
|
|
35935
|
+
return () => ipcRenderer$3.removeListener(SCHEDULER_TASK_FIRED, handler);
|
|
35936
|
+
},
|
|
35937
|
+
};
|
|
35938
|
+
|
|
35939
|
+
var schedulerApi_1 = schedulerApi$2;
|
|
35940
|
+
|
|
35287
35941
|
/**
|
|
35288
35942
|
* dashboardRatingsApi.js
|
|
35289
35943
|
*
|
|
@@ -35418,6 +36072,7 @@ const dashboardRatingsApi = dashboardRatingsApi_1;
|
|
|
35418
36072
|
const registryAuthApi$1 = registryAuthApi_1;
|
|
35419
36073
|
const sessionApi = sessionApi_1;
|
|
35420
36074
|
const notificationApi$1 = notificationApi_1;
|
|
36075
|
+
const schedulerApi$1 = schedulerApi_1;
|
|
35421
36076
|
|
|
35422
36077
|
// Events constants
|
|
35423
36078
|
const events$1 = events$8;
|
|
@@ -35494,6 +36149,7 @@ function createMainApi$1(extensions = {}) {
|
|
|
35494
36149
|
registryAuth: registryAuthApi$1,
|
|
35495
36150
|
session: sessionApi,
|
|
35496
36151
|
notifications: notificationApi$1,
|
|
36152
|
+
scheduler: schedulerApi$1,
|
|
35497
36153
|
|
|
35498
36154
|
widgetEvent: {
|
|
35499
36155
|
publish: (eventType, content) => {
|
|
@@ -35543,6 +36199,7 @@ const dashboardConfigController = dashboardConfigController$1;
|
|
|
35543
36199
|
const registryAuthController = registryAuthController$1;
|
|
35544
36200
|
const registryApiController = registryApiController$2;
|
|
35545
36201
|
const notificationController = notificationController_1;
|
|
36202
|
+
const schedulerController = schedulerController_1;
|
|
35546
36203
|
const themeRegistryController = themeRegistryController$1;
|
|
35547
36204
|
|
|
35548
36205
|
// --- Utils ---
|
|
@@ -35574,6 +36231,7 @@ const clientCacheApi = clientCacheApi_1;
|
|
|
35574
36231
|
const dashboardConfigApi = dashboardConfigApi_1;
|
|
35575
36232
|
const registryAuthApi = registryAuthApi_1;
|
|
35576
36233
|
const notificationApi = notificationApi_1;
|
|
36234
|
+
const schedulerApi = schedulerApi_1;
|
|
35577
36235
|
|
|
35578
36236
|
// --- Events ---
|
|
35579
36237
|
const events = events$8;
|
|
@@ -35612,6 +36270,7 @@ var electron = {
|
|
|
35612
36270
|
registryAuthController,
|
|
35613
36271
|
registryApiController,
|
|
35614
36272
|
notificationController,
|
|
36273
|
+
schedulerController,
|
|
35615
36274
|
themeRegistryController,
|
|
35616
36275
|
|
|
35617
36276
|
// Controller functions (flat) — spread for convenient destructuring
|
|
@@ -35638,6 +36297,7 @@ var electron = {
|
|
|
35638
36297
|
dashboardConfigApi,
|
|
35639
36298
|
registryAuthApi,
|
|
35640
36299
|
notificationApi,
|
|
36300
|
+
schedulerApi,
|
|
35641
36301
|
|
|
35642
36302
|
// Events
|
|
35643
36303
|
events,
|