@lobu/runtime-device 24.1.1 → 24.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component.json +1 -1
- package/dist/dependencies.bun.lock +26 -28
- package/npm-shrinkwrap.json +155 -172
- package/package.json +1 -1
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +14 -5
- package/vendor/cli/dist/chrome-extension/accessibility-tree.js +834 -0
- package/vendor/cli/dist/chrome-extension/ambient-context.js +53 -0
- package/vendor/cli/dist/chrome-extension/auth-refresh.js +167 -0
- package/vendor/cli/dist/chrome-extension/automation-run.js +13 -0
- package/vendor/cli/dist/chrome-extension/background.js +1155 -0
- package/vendor/cli/dist/chrome-extension/bridge.js +140 -0
- package/vendor/cli/dist/chrome-extension/browser-origin-policy.js +62 -0
- package/vendor/cli/dist/chrome-extension/browser-recovery.js +260 -0
- package/vendor/cli/dist/chrome-extension/browser-url-sanitizer.js +284 -0
- package/vendor/cli/dist/chrome-extension/completion-response.js +12 -0
- package/vendor/cli/dist/chrome-extension/config.js +144 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome.json +1516 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_bookmarks.json +84 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_downloads.json +86 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests/chrome_history.json +78 -0
- package/vendor/cli/dist/chrome-extension/connector-manifests.js +1767 -0
- package/vendor/cli/dist/chrome-extension/console-capture.js +627 -0
- package/vendor/cli/dist/chrome-extension/control-activity.js +70 -0
- package/vendor/cli/dist/chrome-extension/debugger-lease.js +439 -0
- package/vendor/cli/dist/chrome-extension/feed-listener.js +488 -0
- package/vendor/cli/dist/chrome-extension/feed-transaction.js +48 -0
- package/vendor/cli/dist/chrome-extension/feeds.js +632 -0
- package/vendor/cli/dist/chrome-extension/focus-tab.js +25 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-mono-latin-500-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-sans-latin-400-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/fonts/dm-sans-latin-600-normal.woff2 +0 -0
- package/vendor/cli/dist/chrome-extension/heartbeat.js +140 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-128-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-128.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-16-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-16.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-32-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-32.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-48-rec.png +0 -0
- package/vendor/cli/dist/chrome-extension/icons/icon-48.png +0 -0
- package/vendor/cli/dist/chrome-extension/lens-page.js +135 -0
- package/vendor/cli/dist/chrome-extension/lens-target.js +20 -0
- package/vendor/cli/dist/chrome-extension/manifest.json +76 -0
- package/vendor/cli/dist/chrome-extension/network-intercept.js +657 -0
- package/vendor/cli/dist/chrome-extension/page-activation.js +120 -0
- package/vendor/cli/dist/chrome-extension/page-dialogs.js +125 -0
- package/vendor/cli/dist/chrome-extension/page-url.js +11 -0
- package/vendor/cli/dist/chrome-extension/panel-session.js +184 -0
- package/vendor/cli/dist/chrome-extension/poll-auth.js +85 -0
- package/vendor/cli/dist/chrome-extension/poll-backoff.js +22 -0
- package/vendor/cli/dist/chrome-extension/run-fence.js +117 -0
- package/vendor/cli/dist/chrome-extension/setup-status.js +71 -0
- package/vendor/cli/dist/chrome-extension/side-panel-action-click.js +65 -0
- package/vendor/cli/dist/chrome-extension/sidepanel-context.js +50 -0
- package/vendor/cli/dist/chrome-extension/sidepanel.html +680 -0
- package/vendor/cli/dist/chrome-extension/sidepanel.js +1643 -0
- package/vendor/cli/dist/chrome-extension/tab-labels.js +233 -0
- package/vendor/cli/dist/chrome-extension/tools.js +3354 -0
- package/vendor/cli/dist/chrome-extension/watch-observer.js +354 -0
- package/vendor/cli/dist/chrome-extension/watch-redact.js +96 -0
- package/vendor/cli/dist/chrome-extension/watch.js +348 -0
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +6 -4
- package/vendor/cli/dist/commands/_lib/apply/desired-state.js +5 -3
- package/vendor/cli/dist/commands/_lib/apply/diff.js +4 -3
- package/vendor/cli/dist/commands/_lib/chrome-for-testing.d.ts +13 -0
- package/vendor/cli/dist/commands/_lib/chrome-for-testing.js +226 -0
- package/vendor/cli/dist/commands/_lib/device-credential.d.ts +34 -0
- package/vendor/cli/dist/commands/_lib/device-credential.js +157 -0
- package/vendor/cli/dist/commands/_lib/device-wizard.d.ts +17 -0
- package/vendor/cli/dist/commands/_lib/device-wizard.js +11 -2
- package/vendor/cli/dist/commands/_lib/native-messaging.d.ts +7 -0
- package/vendor/cli/dist/commands/_lib/native-messaging.js +40 -0
- package/vendor/cli/dist/commands/browser.d.ts +23 -0
- package/vendor/cli/dist/commands/browser.js +492 -0
- package/vendor/cli/dist/commands/call.d.ts +12 -0
- package/vendor/cli/dist/commands/call.js +48 -26
- package/vendor/cli/dist/commands/context.d.ts +3 -1
- package/vendor/cli/dist/commands/context.js +13 -2
- package/vendor/cli/dist/commands/daemon.js +2 -152
- package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +4 -1
- package/vendor/cli/dist/commands/memory/_lib/errors.js +9 -1
- package/vendor/cli/dist/commands/memory/_lib/mcp.d.ts +0 -9
- package/vendor/cli/dist/commands/memory/_lib/mcp.js +1 -23
- package/vendor/cli/dist/commands/memory/_lib/memory-auth.d.ts +20 -4
- package/vendor/cli/dist/commands/memory/_lib/memory-auth.js +21 -17
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +6 -17
- package/vendor/cli/dist/commands/memory/run.js +4 -25
- package/vendor/cli/dist/connectors/google_gmail.ts +70 -41
- package/vendor/cli/dist/connectors/google_gmail_references.ts +406 -0
- package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +107 -36
- package/vendor/cli/dist/connectors/linkedin-inbox.ts +13 -0
- package/vendor/cli/dist/connectors/linkedin.ts +1 -1
- package/vendor/cli/dist/connectors/postgres.ts +5 -3
- package/vendor/cli/dist/connectors/reddit.ts +171 -5
- package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +147 -61
- package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +6 -2
- package/vendor/cli/dist/connectors/whatsapp_web.ts +48 -17
- package/vendor/cli/dist/connectors/x-dm-adapter.js +252 -35
- package/vendor/cli/dist/connectors/x.ts +189 -13
- package/vendor/cli/dist/index.js +46 -6
- package/vendor/cli/dist/internal/device-state.d.ts +2 -0
- package/vendor/cli/dist/internal/device-state.js +4 -0
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/dist/templates/AGENTS.md.tmpl +3 -1
- package/vendor/cli/dist/templates/TESTING.md.tmpl +8 -8
- package/vendor/cli/package.json +1 -1
- package/vendor/connector-sdk/dist/browser-requirement.js +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +5 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/agent-turn/gateway-tools.d.ts +9 -0
- package/vendor/connector-worker/dist/agent-turn/gateway-tools.js +23 -2
- package/vendor/connector-worker/dist/agent-turn/guest-entry.js +14 -6
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +62 -25
- package/vendor/connector-worker/dist/agent-turn/media-tools.d.ts +1 -0
- package/vendor/connector-worker/dist/agent-turn/media-tools.js +5 -2
- package/vendor/connector-worker/dist/bin.js +2 -0
- package/vendor/connector-worker/dist/daemon/agent-turn.js +52 -17
- package/vendor/connector-worker/dist/daemon/automation.js +2 -12
- package/vendor/connector-worker/dist/daemon/client.d.ts +8 -2
- package/vendor/connector-worker/dist/daemon/client.js +8 -1
- package/vendor/connector-worker/dist/daemon/interactive-session.js +29 -6
- package/vendor/connector-worker/dist/daemon/poll-loop.js +23 -1
- package/vendor/connector-worker/dist/daemon/terminal-delivery.d.ts +5 -10
- package/vendor/connector-worker/dist/daemon/terminal-delivery.js +55 -23
- package/vendor/connector-worker/dist/daemon/terminal-failure.js +2 -2
- package/vendor/connector-worker/dist/executor/isolate.js +3 -0
- package/vendor/connector-worker/package.json +1 -1
- package/vendor/core/dist/agent-tooling.d.ts +8 -0
- package/vendor/core/dist/agent-tooling.js +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +5 -0
- package/vendor/core/dist/contracts/entity-reference.d.ts +3 -0
- package/vendor/core/dist/contracts/entity-reference.js +31 -0
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +113 -34
- package/vendor/core/dist/contracts/tools/manage-entity.js +41 -14
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
- package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
- package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
- package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
- package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
- package/vendor/core/dist/contracts/worker/protocol.js +20 -0
- package/vendor/core/dist/reserved.d.ts +6 -3
- package/vendor/core/dist/reserved.js +6 -3
- package/vendor/core/dist/worker/auth.d.ts +3 -2
- package/vendor/core/package.json +6 -1
- package/vendor/postgres/cf/src/query.js +3 -1
- package/vendor/postgres/cjs/src/query.js +3 -1
- package/vendor/postgres/src/query.js +3 -1
- /package/vendor/postgres/{.bun-tag-2f292c6554a8475e → .bun-tag-22d644c2873790db} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { normalizeGatewayBase, STORAGE_KEY_GATEWAY_URL } from "./config.js";
|
|
2
|
+
|
|
3
|
+
// A page may use this as an onboarding hint, never as authentication.
|
|
4
|
+
// Keep this response deliberately separate from extension storage/diagnostics.
|
|
5
|
+
export async function readSetupStatus(chromeApi, sender, now = Date.now()) {
|
|
6
|
+
let origin;
|
|
7
|
+
try {
|
|
8
|
+
origin = new URL(sender?.url).origin;
|
|
9
|
+
} catch {
|
|
10
|
+
/* reject below */
|
|
11
|
+
}
|
|
12
|
+
if (
|
|
13
|
+
sender?.id !== chromeApi.runtime.id ||
|
|
14
|
+
!sender?.tab ||
|
|
15
|
+
sender.frameId !== 0 ||
|
|
16
|
+
!["https://lobu.ai", "https://app.lobu.ai"].includes(origin)
|
|
17
|
+
)
|
|
18
|
+
throw new Error("Setup status is only available to approved Lobu pages.");
|
|
19
|
+
|
|
20
|
+
const stored = await chromeApi.storage.local.get([
|
|
21
|
+
STORAGE_KEY_GATEWAY_URL,
|
|
22
|
+
"owletto.workerId",
|
|
23
|
+
"owletto.accessToken",
|
|
24
|
+
"owletto.pairedAt",
|
|
25
|
+
"owletto.health",
|
|
26
|
+
]);
|
|
27
|
+
const instanceUrl = normalizeGatewayBase(stored[STORAGE_KEY_GATEWAY_URL]);
|
|
28
|
+
const paired =
|
|
29
|
+
instanceUrl &&
|
|
30
|
+
typeof stored["owletto.workerId"] === "string" &&
|
|
31
|
+
stored["owletto.workerId"].length > 0 &&
|
|
32
|
+
typeof stored["owletto.accessToken"] === "string" &&
|
|
33
|
+
stored["owletto.accessToken"].length > 0;
|
|
34
|
+
let state = paired ? "unknown" : "unpaired";
|
|
35
|
+
const health = stored["owletto.health"] ?? {};
|
|
36
|
+
const pairedAt = stored["owletto.pairedAt"];
|
|
37
|
+
// A recently updated diagnostic is not proof of a recent successful poll.
|
|
38
|
+
// Also reject health retained from a previous server or pairing session.
|
|
39
|
+
const fresh = (at) =>
|
|
40
|
+
Number.isFinite(at) &&
|
|
41
|
+
Number.isFinite(pairedAt) &&
|
|
42
|
+
at >= pairedAt &&
|
|
43
|
+
at <= now &&
|
|
44
|
+
now - at <= 120_000;
|
|
45
|
+
if (
|
|
46
|
+
paired &&
|
|
47
|
+
health.host === new URL(instanceUrl).host &&
|
|
48
|
+
fresh(health.updatedAt)
|
|
49
|
+
) {
|
|
50
|
+
if (
|
|
51
|
+
health.connected === true &&
|
|
52
|
+
health.reason === "ok" &&
|
|
53
|
+
fresh(health.lastSyncOkAt)
|
|
54
|
+
)
|
|
55
|
+
state = "connected";
|
|
56
|
+
else if (health.connected === false) {
|
|
57
|
+
state =
|
|
58
|
+
health.reason === "needs-permission"
|
|
59
|
+
? "needs-permission"
|
|
60
|
+
: health.reason === "reconnecting"
|
|
61
|
+
? "reconnecting"
|
|
62
|
+
: "disconnected";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
protocolVersion: 1,
|
|
67
|
+
extensionVersion: chromeApi.runtime.getManifest().version,
|
|
68
|
+
instanceUrl,
|
|
69
|
+
state,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Toolbar-icon → side panel wiring.
|
|
2
|
+
//
|
|
3
|
+
// Chrome opens the side panel on action click only when the extension asks it
|
|
4
|
+
// to. `openPanelOnActionClick` is a per-extension setting Chrome persists on
|
|
5
|
+
// first call and defaults to false, and this extension declares no
|
|
6
|
+
// `action.default_popup` — so if this call is missed the toolbar icon is inert
|
|
7
|
+
// on every profile where the setting was never written, which is every fresh
|
|
8
|
+
// install. `installActionClickFallback` below is the second line of defence.
|
|
9
|
+
//
|
|
10
|
+
// `setPanelBehavior` is Chrome's name, not ours: it is exempted by name in the
|
|
11
|
+
// canonical-vocabulary gate (scripts/check-exposed-surface-naming.ts in the
|
|
12
|
+
// Lobu repo), because the gate's retired-term ban is what made #863 rename it
|
|
13
|
+
// to `setPanelAutomation` — a name no Chrome build ships. A later `typeof`
|
|
14
|
+
// guard swallowed the resulting TypeError, so the icon stayed dead and silent
|
|
15
|
+
// for two weeks. Everything this module owns is named after what it does, not
|
|
16
|
+
// after Chrome's option bag. See chrome-api-surface.test.js.
|
|
17
|
+
export const ACTION_CLICK_OPENS_PANEL = { openPanelOnActionClick: true };
|
|
18
|
+
|
|
19
|
+
export function installActionClickOpensPanel(chrome) {
|
|
20
|
+
if (typeof chrome.sidePanel?.setPanelBehavior !== "function") {
|
|
21
|
+
// Loud, never silent: the only symptom of losing this API is "clicking
|
|
22
|
+
// the icon does nothing", which reads as a broken install.
|
|
23
|
+
console.error(
|
|
24
|
+
"[owletto] chrome.sidePanel.setPanelBehavior unavailable — the toolbar icon will not open the side panel",
|
|
25
|
+
);
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
void chrome.sidePanel
|
|
29
|
+
.setPanelBehavior(ACTION_CLICK_OPENS_PANEL)
|
|
30
|
+
.catch((err) => {
|
|
31
|
+
console.error("[owletto] setPanelBehavior failed", err);
|
|
32
|
+
});
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Second line of defence for the same click.
|
|
37
|
+
//
|
|
38
|
+
// Chrome dispatches `action.onClicked` only when the click did NOT open the
|
|
39
|
+
// side panel, so this listener and the setting above are mutually exclusive by
|
|
40
|
+
// construction — the icon can never open two panels, and this runs exactly
|
|
41
|
+
// when the setting failed to take. `sidePanel.open` needs a user gesture,
|
|
42
|
+
// which an `onClicked` dispatch is.
|
|
43
|
+
//
|
|
44
|
+
// The point is that no single call is load-bearing for the icon any more.
|
|
45
|
+
// Losing one path costs a console error, not a dead toolbar button.
|
|
46
|
+
export function installActionClickFallback(chrome) {
|
|
47
|
+
if (
|
|
48
|
+
typeof chrome.action?.onClicked?.addListener !== "function" ||
|
|
49
|
+
typeof chrome.sidePanel?.open !== "function"
|
|
50
|
+
) {
|
|
51
|
+
console.error(
|
|
52
|
+
"[owletto] no action-click fallback available — the toolbar icon depends entirely on setPanelBehavior",
|
|
53
|
+
);
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
chrome.action.onClicked.addListener((tab) => {
|
|
57
|
+
// windowId is what `open` wants; a tab without one is not a real click
|
|
58
|
+
// target, so there is nothing to open against.
|
|
59
|
+
if (typeof tab?.windowId !== "number") return;
|
|
60
|
+
void chrome.sidePanel.open({ windowId: tab.windowId }).catch((err) => {
|
|
61
|
+
console.error("[owletto] side panel open from action click failed", err);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { normalizeLensTarget } from "./lens-target.js";
|
|
2
|
+
|
|
3
|
+
// Keep page context in the browser UI; the native ambient bridge stays origin-only.
|
|
4
|
+
export function contextForTab(tab) {
|
|
5
|
+
return {
|
|
6
|
+
kind: "browser",
|
|
7
|
+
url: tab?.incognito ? null : normalizeLensTarget(tab?.url),
|
|
8
|
+
title: null,
|
|
9
|
+
applicationName: "Chrome",
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createContextPublisher({ queryTabs, getTarget }) {
|
|
14
|
+
let sequence = 0;
|
|
15
|
+
return async () => {
|
|
16
|
+
const current = ++sequence;
|
|
17
|
+
const target = getTarget();
|
|
18
|
+
if (!target) return;
|
|
19
|
+
let tabs;
|
|
20
|
+
try {
|
|
21
|
+
tabs = await queryTabs({ active: true, currentWindow: true });
|
|
22
|
+
} catch {
|
|
23
|
+
tabs = [];
|
|
24
|
+
}
|
|
25
|
+
const latest = getTarget();
|
|
26
|
+
if (
|
|
27
|
+
current !== sequence ||
|
|
28
|
+
latest?.origin !== target.origin ||
|
|
29
|
+
latest?.window !== target.window
|
|
30
|
+
)
|
|
31
|
+
return;
|
|
32
|
+
target.window.postMessage(
|
|
33
|
+
{ owletto: "ambient-context", context: contextForTab(tabs?.[0]) },
|
|
34
|
+
target.origin,
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Resolve the live reply target for an iframe↔service-worker bridge response,
|
|
40
|
+
// reusing the same getTarget() the ambient-context publisher uses. Returns the
|
|
41
|
+
// target only while the frame is still the live gateway document that sent the
|
|
42
|
+
// request; null once it has been blanked, hidden, or remounted. A stale reply
|
|
43
|
+
// must be dropped, not posted — postMessage with a gateway target origin
|
|
44
|
+
// against a frame now on another origin (e.g. about:blank after teardown)
|
|
45
|
+
// throws.
|
|
46
|
+
export function resolveBridgeReplyTarget({ getTarget, source }) {
|
|
47
|
+
const target = getTarget();
|
|
48
|
+
if (!target || !source || target.window !== source) return null;
|
|
49
|
+
return target;
|
|
50
|
+
}
|