@quanta-intellect/vessel-browser 0.1.53 → 0.1.56
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/README.md +7 -2
- package/out/main/index.js +1856 -840
- package/out/preload/chunks/channels-Dfv8z3Ui.js +123 -0
- package/out/preload/content-script.js +111 -0
- package/out/preload/index.js +132 -226
- package/out/renderer/assets/{index-hRUKGdgt.js → index-DRVDsSQe.js} +664 -129
- package/out/renderer/assets/{index-eS3ccAls.css → index-DRj77a_O.css} +224 -0
- package/out/renderer/index.html +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Channels = {
|
|
3
|
+
// Tab management
|
|
4
|
+
TAB_CREATE: "tab:create",
|
|
5
|
+
TAB_CLOSE: "tab:close",
|
|
6
|
+
TAB_SWITCH: "tab:switch",
|
|
7
|
+
TAB_NAVIGATE: "tab:navigate",
|
|
8
|
+
TAB_BACK: "tab:back",
|
|
9
|
+
TAB_FORWARD: "tab:forward",
|
|
10
|
+
TAB_RELOAD: "tab:reload",
|
|
11
|
+
TAB_STATE_UPDATE: "tab:state-update",
|
|
12
|
+
// AI
|
|
13
|
+
AI_QUERY: "ai:query",
|
|
14
|
+
AI_STREAM_START: "ai:stream-start",
|
|
15
|
+
AI_STREAM_CHUNK: "ai:stream-chunk",
|
|
16
|
+
AI_STREAM_END: "ai:stream-end",
|
|
17
|
+
AI_STREAM_IDLE: "ai:stream-idle",
|
|
18
|
+
AUTOMATION_ACTIVITY_START: "automation:activity-start",
|
|
19
|
+
AUTOMATION_ACTIVITY_CHUNK: "automation:activity-chunk",
|
|
20
|
+
AUTOMATION_ACTIVITY_END: "automation:activity-end",
|
|
21
|
+
AI_CANCEL: "ai:cancel",
|
|
22
|
+
AI_FETCH_MODELS: "ai:fetch-models",
|
|
23
|
+
AGENT_RUNTIME_GET: "agent-runtime:get",
|
|
24
|
+
AGENT_RUNTIME_UPDATE: "agent-runtime:update",
|
|
25
|
+
AGENT_PAUSE: "agent:pause",
|
|
26
|
+
AGENT_RESUME: "agent:resume",
|
|
27
|
+
AGENT_SET_APPROVAL_MODE: "agent:set-approval-mode",
|
|
28
|
+
AGENT_APPROVAL_RESOLVE: "agent:approval-resolve",
|
|
29
|
+
AGENT_CHECKPOINT_CREATE: "agent:checkpoint-create",
|
|
30
|
+
AGENT_CHECKPOINT_RESTORE: "agent:checkpoint-restore",
|
|
31
|
+
AGENT_SESSION_CAPTURE: "agent:session-capture",
|
|
32
|
+
AGENT_SESSION_RESTORE: "agent:session-restore",
|
|
33
|
+
// Content
|
|
34
|
+
CONTENT_EXTRACT: "content:extract",
|
|
35
|
+
READER_MODE_TOGGLE: "reader:toggle",
|
|
36
|
+
// UI state
|
|
37
|
+
SIDEBAR_TOGGLE: "ui:sidebar-toggle",
|
|
38
|
+
SIDEBAR_RESIZE: "ui:sidebar-resize",
|
|
39
|
+
SIDEBAR_RESIZE_START: "ui:sidebar-resize-start",
|
|
40
|
+
SIDEBAR_RESIZE_COMMIT: "ui:sidebar-resize-commit",
|
|
41
|
+
SIDEBAR_CONTEXT_MENU: "ui:sidebar-context-menu",
|
|
42
|
+
FOCUS_MODE_TOGGLE: "ui:focus-mode-toggle",
|
|
43
|
+
SETTINGS_VISIBILITY: "ui:settings-visibility",
|
|
44
|
+
// Settings
|
|
45
|
+
SETTINGS_GET: "settings:get",
|
|
46
|
+
SETTINGS_SET: "settings:set",
|
|
47
|
+
SETTINGS_UPDATE: "settings:update",
|
|
48
|
+
SETTINGS_HEALTH_GET: "settings:health:get",
|
|
49
|
+
SETTINGS_HEALTH_UPDATE: "settings:health:update",
|
|
50
|
+
// Bookmarks
|
|
51
|
+
BOOKMARKS_GET: "bookmarks:get",
|
|
52
|
+
BOOKMARKS_UPDATE: "bookmarks:update",
|
|
53
|
+
BOOKMARK_SAVE: "bookmarks:save",
|
|
54
|
+
BOOKMARK_REMOVE: "bookmarks:remove",
|
|
55
|
+
BOOKMARK_ADD_CONTEXT_TO_CHAT: "bookmarks:add-context-to-chat",
|
|
56
|
+
FOLDER_CREATE: "bookmarks:folder-create",
|
|
57
|
+
FOLDER_REMOVE: "bookmarks:folder-remove",
|
|
58
|
+
FOLDER_RENAME: "bookmarks:folder-rename",
|
|
59
|
+
// Highlights
|
|
60
|
+
HIGHLIGHT_CAPTURE: "highlights:capture",
|
|
61
|
+
HIGHLIGHT_CAPTURE_RESULT: "highlights:capture-result",
|
|
62
|
+
HIGHLIGHT_NAV_COUNT: "highlights:nav-count",
|
|
63
|
+
HIGHLIGHT_COUNT_UPDATE: "highlights:count-update",
|
|
64
|
+
HIGHLIGHT_NAV_SCROLL: "highlights:nav-scroll",
|
|
65
|
+
HIGHLIGHT_NAV_REMOVE: "highlights:nav-remove",
|
|
66
|
+
HIGHLIGHT_NAV_CLEAR: "highlights:nav-clear",
|
|
67
|
+
SIDEBAR_HIGHLIGHT_ACTION: "highlights:sidebar-action",
|
|
68
|
+
// DevTools panel
|
|
69
|
+
DEVTOOLS_PANEL_TOGGLE: "devtools-panel:toggle",
|
|
70
|
+
DEVTOOLS_PANEL_STATE: "devtools-panel:state",
|
|
71
|
+
DEVTOOLS_PANEL_RESIZE: "devtools-panel:resize",
|
|
72
|
+
// Find in page
|
|
73
|
+
FIND_IN_PAGE_START: "find:start",
|
|
74
|
+
FIND_IN_PAGE_NEXT: "find:next",
|
|
75
|
+
FIND_IN_PAGE_STOP: "find:stop",
|
|
76
|
+
FIND_IN_PAGE_RESULT: "find:result",
|
|
77
|
+
// Browsing history
|
|
78
|
+
HISTORY_GET: "history:get",
|
|
79
|
+
HISTORY_SEARCH: "history:search",
|
|
80
|
+
HISTORY_CLEAR: "history:clear",
|
|
81
|
+
HISTORY_UPDATE: "history:update",
|
|
82
|
+
// Premium
|
|
83
|
+
PREMIUM_GET_STATE: "premium:get-state",
|
|
84
|
+
PREMIUM_ACTIVATION_START: "premium:activation-start",
|
|
85
|
+
PREMIUM_ACTIVATION_VERIFY: "premium:activation-verify",
|
|
86
|
+
PREMIUM_CHECKOUT: "premium:checkout",
|
|
87
|
+
PREMIUM_PORTAL: "premium:portal",
|
|
88
|
+
PREMIUM_RESET: "premium:reset",
|
|
89
|
+
PREMIUM_TRACK_CONTEXT: "premium:track-context",
|
|
90
|
+
PREMIUM_UPDATE: "premium:update",
|
|
91
|
+
// Agent Credential Vault
|
|
92
|
+
VAULT_LIST: "vault:list",
|
|
93
|
+
VAULT_ADD: "vault:add",
|
|
94
|
+
VAULT_UPDATE: "vault:update",
|
|
95
|
+
VAULT_REMOVE: "vault:remove",
|
|
96
|
+
VAULT_AUDIT_LOG: "vault:audit-log",
|
|
97
|
+
// Automation kits
|
|
98
|
+
AUTOMATION_GET_INSTALLED: "automation:get-installed",
|
|
99
|
+
AUTOMATION_INSTALL_FROM_FILE: "automation:install-from-file",
|
|
100
|
+
AUTOMATION_UNINSTALL: "automation:uninstall",
|
|
101
|
+
// Scheduled jobs
|
|
102
|
+
SCHEDULE_GET_ALL: "schedule:get-all",
|
|
103
|
+
SCHEDULE_CREATE: "schedule:create",
|
|
104
|
+
SCHEDULE_UPDATE: "schedule:update",
|
|
105
|
+
SCHEDULE_DELETE: "schedule:delete",
|
|
106
|
+
SCHEDULE_JOBS_UPDATE: "schedule:jobs-update",
|
|
107
|
+
// Window controls
|
|
108
|
+
WINDOW_MINIMIZE: "window:minimize",
|
|
109
|
+
WINDOW_MAXIMIZE: "window:maximize",
|
|
110
|
+
WINDOW_CLOSE: "window:close",
|
|
111
|
+
// Autofill
|
|
112
|
+
AUTOFILL_LIST: "autofill:list",
|
|
113
|
+
AUTOFILL_ADD: "autofill:add",
|
|
114
|
+
AUTOFILL_UPDATE: "autofill:update",
|
|
115
|
+
AUTOFILL_DELETE: "autofill:delete",
|
|
116
|
+
AUTOFILL_FILL: "autofill:fill",
|
|
117
|
+
// Page snapshots / What Changed
|
|
118
|
+
PAGE_DIFF_ACTIVITY: "page:diff-activity",
|
|
119
|
+
PAGE_CHANGED: "page:changed",
|
|
120
|
+
PAGE_DIFF_GET: "page:diff-get",
|
|
121
|
+
PAGE_DIFF_DIRTY: "page:diff-dirty"
|
|
122
|
+
};
|
|
123
|
+
exports.Channels = Channels;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const electron = require("electron");
|
|
3
|
+
const channels = require("./chunks/channels-Dfv8z3Ui.js");
|
|
3
4
|
var Readability = { exports: {} };
|
|
4
5
|
var hasRequiredReadability$1;
|
|
5
6
|
function requireReadability$1() {
|
|
@@ -2143,6 +2144,105 @@ const elementSelectors = {};
|
|
|
2143
2144
|
let indexedElements = /* @__PURE__ */ new WeakMap();
|
|
2144
2145
|
const indexedElementRefs = {};
|
|
2145
2146
|
let activeOverlays = [];
|
|
2147
|
+
let pageDiffMutationTimer = null;
|
|
2148
|
+
let pageDiffActivityThrottleTimer = null;
|
|
2149
|
+
let lastPageDiffSignature = "";
|
|
2150
|
+
const PAGE_DIFF_ACTIVITY_THROTTLE_MS = 350;
|
|
2151
|
+
const PAGE_DIFF_MUTATION_DEBOUNCE_MS = 1200;
|
|
2152
|
+
function normalizeSignatureText(value) {
|
|
2153
|
+
return (value || "").replace(/\s+/g, " ").trim();
|
|
2154
|
+
}
|
|
2155
|
+
function getPageDiffSignature() {
|
|
2156
|
+
const title = normalizeSignatureText(document.title);
|
|
2157
|
+
const headings = Array.from(document.querySelectorAll("h1, h2, h3")).slice(0, 8).map((el) => normalizeSignatureText(el.textContent)).filter(Boolean).join(" | ");
|
|
2158
|
+
const mainRoot = document.querySelector("main, article, [role='main']") || document.body;
|
|
2159
|
+
const visibleText = normalizeSignatureText(
|
|
2160
|
+
mainRoot instanceof HTMLElement ? mainRoot.innerText : document.body?.innerText || ""
|
|
2161
|
+
).slice(0, 1200);
|
|
2162
|
+
return [window.location.href, title, headings, visibleText].join("\n");
|
|
2163
|
+
}
|
|
2164
|
+
function asElement(node) {
|
|
2165
|
+
if (node instanceof Element) return node;
|
|
2166
|
+
return node?.parentElement || null;
|
|
2167
|
+
}
|
|
2168
|
+
function isVesselOwnedNode(node) {
|
|
2169
|
+
const el = asElement(node);
|
|
2170
|
+
return !!el?.closest?.("[data-vessel-highlight], .__vessel-highlight-label");
|
|
2171
|
+
}
|
|
2172
|
+
function shouldIgnorePageDiffMutation(mutation) {
|
|
2173
|
+
if (mutation.type === "attributes") {
|
|
2174
|
+
return isVesselOwnedNode(mutation.target);
|
|
2175
|
+
}
|
|
2176
|
+
if (mutation.type === "characterData") {
|
|
2177
|
+
return isVesselOwnedNode(mutation.target);
|
|
2178
|
+
}
|
|
2179
|
+
if (mutation.type === "childList") {
|
|
2180
|
+
const added = Array.from(mutation.addedNodes);
|
|
2181
|
+
const removed = Array.from(mutation.removedNodes);
|
|
2182
|
+
return [...added, ...removed].every((node) => isVesselOwnedNode(node));
|
|
2183
|
+
}
|
|
2184
|
+
return false;
|
|
2185
|
+
}
|
|
2186
|
+
function emitPageDiffDirty() {
|
|
2187
|
+
const nextSignature = getPageDiffSignature();
|
|
2188
|
+
if (!nextSignature || nextSignature === lastPageDiffSignature) return;
|
|
2189
|
+
lastPageDiffSignature = nextSignature;
|
|
2190
|
+
electron.ipcRenderer.send(channels.Channels.PAGE_DIFF_DIRTY);
|
|
2191
|
+
}
|
|
2192
|
+
function notifyPageDiffActivity() {
|
|
2193
|
+
if (pageDiffActivityThrottleTimer) return;
|
|
2194
|
+
electron.ipcRenderer.send(channels.Channels.PAGE_DIFF_ACTIVITY);
|
|
2195
|
+
pageDiffActivityThrottleTimer = setTimeout(() => {
|
|
2196
|
+
pageDiffActivityThrottleTimer = null;
|
|
2197
|
+
}, PAGE_DIFF_ACTIVITY_THROTTLE_MS);
|
|
2198
|
+
}
|
|
2199
|
+
function startPageDiffObserver() {
|
|
2200
|
+
if (typeof MutationObserver === "undefined") return;
|
|
2201
|
+
if (!document.documentElement) return;
|
|
2202
|
+
lastPageDiffSignature = getPageDiffSignature();
|
|
2203
|
+
const observer = new MutationObserver((mutations) => {
|
|
2204
|
+
if (mutations.every((mutation) => shouldIgnorePageDiffMutation(mutation))) {
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
notifyPageDiffActivity();
|
|
2208
|
+
if (pageDiffMutationTimer) {
|
|
2209
|
+
clearTimeout(pageDiffMutationTimer);
|
|
2210
|
+
}
|
|
2211
|
+
pageDiffMutationTimer = setTimeout(() => {
|
|
2212
|
+
pageDiffMutationTimer = null;
|
|
2213
|
+
emitPageDiffDirty();
|
|
2214
|
+
}, PAGE_DIFF_MUTATION_DEBOUNCE_MS);
|
|
2215
|
+
});
|
|
2216
|
+
observer.observe(document.documentElement, {
|
|
2217
|
+
subtree: true,
|
|
2218
|
+
childList: true,
|
|
2219
|
+
characterData: true,
|
|
2220
|
+
attributes: true,
|
|
2221
|
+
attributeFilter: [
|
|
2222
|
+
"class",
|
|
2223
|
+
"style",
|
|
2224
|
+
"hidden",
|
|
2225
|
+
"aria-hidden",
|
|
2226
|
+
"aria-expanded",
|
|
2227
|
+
"aria-selected",
|
|
2228
|
+
"aria-checked",
|
|
2229
|
+
"aria-label",
|
|
2230
|
+
"title",
|
|
2231
|
+
"open"
|
|
2232
|
+
]
|
|
2233
|
+
});
|
|
2234
|
+
window.addEventListener("beforeunload", () => {
|
|
2235
|
+
observer.disconnect();
|
|
2236
|
+
if (pageDiffActivityThrottleTimer) {
|
|
2237
|
+
clearTimeout(pageDiffActivityThrottleTimer);
|
|
2238
|
+
pageDiffActivityThrottleTimer = null;
|
|
2239
|
+
}
|
|
2240
|
+
if (pageDiffMutationTimer) {
|
|
2241
|
+
clearTimeout(pageDiffMutationTimer);
|
|
2242
|
+
pageDiffMutationTimer = null;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2146
2246
|
const MAX_SHADOW_HOSTS = 150;
|
|
2147
2247
|
const MAX_SHADOW_DEPTH = 5;
|
|
2148
2248
|
const MAX_WALK_ELEMENTS = 1e4;
|
|
@@ -3288,3 +3388,14 @@ electron.contextBridge.exposeInMainWorld("__vessel", {
|
|
|
3288
3388
|
}
|
|
3289
3389
|
}
|
|
3290
3390
|
});
|
|
3391
|
+
if (document.readyState === "loading") {
|
|
3392
|
+
window.addEventListener(
|
|
3393
|
+
"DOMContentLoaded",
|
|
3394
|
+
() => {
|
|
3395
|
+
startPageDiffObserver();
|
|
3396
|
+
},
|
|
3397
|
+
{ once: true }
|
|
3398
|
+
);
|
|
3399
|
+
} else {
|
|
3400
|
+
startPageDiffObserver();
|
|
3401
|
+
}
|