@lobu/cli 7.1.0 → 7.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.
Files changed (32) hide show
  1. package/dist/commands/context.d.ts +7 -0
  2. package/dist/commands/context.d.ts.map +1 -1
  3. package/dist/commands/context.js +19 -2
  4. package/dist/commands/context.js.map +1 -1
  5. package/dist/connectors/chrome.ts +351 -0
  6. package/dist/connectors/chrome_bookmarks.ts +79 -0
  7. package/dist/connectors/chrome_downloads.ts +80 -0
  8. package/dist/connectors/chrome_history.ts +80 -0
  9. package/dist/connectors/index.ts +14 -8
  10. package/dist/db/migrations/20260518020000_runs_heartbeat_inflight_narrow.sql +36 -0
  11. package/dist/db/migrations/20260518040000_agent_transcript_snapshot.sql +54 -0
  12. package/dist/db/migrations/20260518050000_runs_denormalize_agent_conversation.sql +36 -0
  13. package/dist/db/migrations/20260518060000_revert_runs_denormalize.sql +29 -0
  14. package/dist/db/migrations/20260518070000_runs_heartbeat_inflight_widen.sql +33 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +37 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/internal/context.d.ts +4 -1
  19. package/dist/internal/context.d.ts.map +1 -1
  20. package/dist/internal/context.js +43 -3
  21. package/dist/internal/context.js.map +1 -1
  22. package/dist/internal/index.d.ts +1 -1
  23. package/dist/internal/index.d.ts.map +1 -1
  24. package/dist/internal/index.js +1 -1
  25. package/dist/internal/index.js.map +1 -1
  26. package/dist/server.bundle.mjs +1520 -568
  27. package/dist/start-local.bundle.mjs +1556 -570
  28. package/package.json +6 -6
  29. package/dist/connectors/browser/evaluate.ts +0 -120
  30. package/dist/connectors/browser/fill_form.ts +0 -107
  31. package/dist/connectors/browser/page_text.ts +0 -108
  32. package/dist/connectors/chrome_tabs.ts +0 -74
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/cli",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "CLI for deploying and managing AI agents on Lobu",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -41,11 +41,11 @@
41
41
  "@hono/node-server": "^1.13.7",
42
42
  "@hono/zod-openapi": "^1.2.1",
43
43
  "@inquirer/prompts": "^7.10.1",
44
- "@lobu/connector-sdk": "7.1.0",
45
- "@lobu/connector-worker": "7.1.0",
46
- "@lobu/core": "7.1.0",
47
- "@lobu/embeddings": "7.1.0",
48
- "@lobu/worker": "7.1.0",
44
+ "@lobu/connector-sdk": "7.2.0",
45
+ "@lobu/connector-worker": "7.2.0",
46
+ "@lobu/core": "7.2.0",
47
+ "@lobu/embeddings": "7.2.0",
48
+ "@lobu/worker": "7.2.0",
49
49
  "@mariozechner/pi-ai": "^0.51.6",
50
50
  "@modelcontextprotocol/sdk": "^1.27.1",
51
51
  "@opentelemetry/api": "^1.9.0",
@@ -1,120 +0,0 @@
1
- /**
2
- * Browser Evaluate Connector — Owletto for Chrome only.
3
- *
4
- * Runs on the Owletto Chrome extension, which advertises capability
5
- * `browser.debugger`. The extension attaches `chrome.debugger` to a tab,
6
- * optionally navigates + waits for a selector, runs the supplied JS via
7
- * `Runtime.evaluate`, and emits one event with the JSON-serialised result.
8
- *
9
- * This is the generic "agent runs JS in a user's signed-in Chrome" primitive
10
- * — most bridge connectors (Revolut feed, banking, sites that fingerprint
11
- * a managed Chromium) compose on top of `browser.evaluate` rather than
12
- * shipping their own connector. The trust boundary is `config.script`: only
13
- * the gateway-side connector author should mint it. The extension defaults
14
- * to opening a fresh background tab so a compromised gateway / leaked token
15
- * can't drive the tab a user is actively using; see executor.js in
16
- * owletto-web for the full threat model.
17
- *
18
- * Cloud-side `sync()` / `execute()` throw — actual work happens in the
19
- * extension's service worker (lobu-ai/owletto: apps/chrome/executor.js).
20
- */
21
-
22
- import {
23
- type ActionResult,
24
- type ConnectorDefinition,
25
- ConnectorRuntime,
26
- type SyncContext,
27
- type SyncResult,
28
- } from '@lobu/connector-sdk';
29
-
30
- const BRIDGE_ONLY =
31
- 'browser.evaluate runs only on a worker advertising capability "browser.debugger" (Owletto for Chrome).';
32
-
33
- export default class BrowserEvaluateConnector extends ConnectorRuntime {
34
- readonly definition: ConnectorDefinition = {
35
- key: 'browser.evaluate',
36
- name: 'Browser Evaluate',
37
- description:
38
- 'Runs a JS snippet in a page via chrome.debugger and emits the result. The primitive most bridge connectors build on.',
39
- version: '0.1.0',
40
- faviconDomain: 'google.com',
41
- requiredCapability: 'browser.debugger',
42
- runtime: { platforms: ['chrome-extension'] },
43
- authSchema: { methods: [{ type: 'none' }] },
44
- feeds: {
45
- evaluate: {
46
- key: 'evaluate',
47
- name: 'Evaluate JS',
48
- description:
49
- 'Executes a JS expression in the page and emits one event with the JSON-serialised return value.',
50
- // `script` is required and gateway-author-supplied. Auto-wire would
51
- // insert a feed row with config=NULL and produce a runs-but-fails
52
- // loop. Bridge connectors (Revolut, banking, etc.) compose by
53
- // creating explicit feed instances per call site.
54
- userManaged: true,
55
- configSchema: {
56
- type: 'object',
57
- required: ['script'],
58
- properties: {
59
- url: {
60
- type: 'string',
61
- format: 'uri',
62
- description: 'If set, navigate the tab here before evaluating.',
63
- },
64
- script: {
65
- type: 'string',
66
- description:
67
- 'JS expression evaluated with Runtime.evaluate(awaitPromise: true). Return value is JSON-serialised — keep it small.',
68
- },
69
- wait_for_selector: {
70
- type: 'string',
71
- description:
72
- 'CSS selector to wait for before evaluating (polled every 200ms via Runtime.evaluate).',
73
- },
74
- wait_timeout_ms: {
75
- type: 'integer',
76
- minimum: 100,
77
- maximum: 60_000,
78
- description: 'Timeout for wait_for_selector. Default 10000.',
79
- },
80
- open_in_new_tab: {
81
- type: 'boolean',
82
- description:
83
- 'Open a fresh background tab instead of driving the active tab. DEFAULT TRUE — opt out only when you specifically need the user-active tab.',
84
- },
85
- close_tab_after: {
86
- type: 'boolean',
87
- description:
88
- 'Close the tab when the run completes. Defaults to true when open_in_new_tab is true.',
89
- },
90
- },
91
- },
92
- eventKinds: {
93
- browser_evaluate: {
94
- description:
95
- 'One event per run with the JSON-serialised Runtime.evaluate result.',
96
- metadataSchema: {
97
- type: 'object',
98
- required: ['source', 'origin_id'],
99
- properties: {
100
- source: { type: 'string', const: 'browser_evaluate' },
101
- origin_id: { type: 'string' },
102
- url: { type: 'string' },
103
- title: { type: 'string' },
104
- tab_id: { type: 'integer' },
105
- },
106
- },
107
- },
108
- },
109
- },
110
- },
111
- };
112
-
113
- async sync(_ctx: SyncContext): Promise<SyncResult> {
114
- throw new Error(BRIDGE_ONLY);
115
- }
116
-
117
- async execute(): Promise<ActionResult> {
118
- throw new Error(BRIDGE_ONLY);
119
- }
120
- }
@@ -1,107 +0,0 @@
1
- /**
2
- * Browser Fill Form Connector — Owletto for Chrome only.
3
- *
4
- * Thin wrapper around browser.evaluate that bakes in a "fill these inputs
5
- * by selector and dispatch the right input/change events" script.
6
- *
7
- * The extension's executor branch for `browser.fill_form` substitutes the
8
- * canonical fill-form script when this connector_key is dispatched. The
9
- * server-side definition just exposes the URL + fields config to the
10
- * admin UI.
11
- *
12
- * Cloud-side `sync()` / `execute()` throw — actual work happens in the
13
- * extension's service worker (lobu-ai/owletto: apps/chrome/executor.js).
14
- */
15
-
16
- import {
17
- type ActionResult,
18
- type ConnectorDefinition,
19
- ConnectorRuntime,
20
- type SyncContext,
21
- type SyncResult,
22
- } from '@lobu/connector-sdk';
23
-
24
- const BRIDGE_ONLY =
25
- 'browser.fill_form runs only on a worker advertising capability "browser.debugger" (Owletto for Chrome).';
26
-
27
- export default class BrowserFillFormConnector extends ConnectorRuntime {
28
- readonly definition: ConnectorDefinition = {
29
- key: 'browser.fill_form',
30
- name: 'Browser Fill Form',
31
- description:
32
- 'Fills inputs on a page by CSS selector and dispatches input/change events. Returns the filled field count.',
33
- version: '0.1.0',
34
- faviconDomain: 'google.com',
35
- requiredCapability: 'browser.debugger',
36
- runtime: { platforms: ['chrome-extension'] },
37
- authSchema: { methods: [{ type: 'none' }] },
38
- feeds: {
39
- fill: {
40
- key: 'fill',
41
- name: 'Fill form',
42
- description:
43
- 'Sets values on input/textarea/select elements matched by CSS selector.',
44
- // Required url + fields; instances are minted by composing bridge
45
- // connectors, not auto-wired by device-reconcile.
46
- userManaged: true,
47
- configSchema: {
48
- type: 'object',
49
- required: ['url', 'fields'],
50
- properties: {
51
- url: {
52
- type: 'string',
53
- format: 'uri',
54
- description: 'Page to load before filling.',
55
- },
56
- fields: {
57
- type: 'object',
58
- description:
59
- 'Map of CSS selector → value to set. e.g. { "#email": "x@y.com", "#submit": "click" } — the literal string "click" triggers a click instead of a value set.',
60
- additionalProperties: { type: 'string' },
61
- },
62
- wait_for_selector: {
63
- type: 'string',
64
- description:
65
- 'CSS selector to wait for before filling (defaults to the first key of fields).',
66
- },
67
- wait_timeout_ms: {
68
- type: 'integer',
69
- minimum: 100,
70
- maximum: 60_000,
71
- },
72
- submit_selector: {
73
- type: 'string',
74
- description:
75
- 'Optional selector to click after filling all fields (e.g. "button[type=submit]").',
76
- },
77
- },
78
- },
79
- eventKinds: {
80
- form_filled: {
81
- description:
82
- 'One event per run with the count of fields filled + whether submit was clicked.',
83
- metadataSchema: {
84
- type: 'object',
85
- required: ['source', 'origin_id', 'url', 'filled_count'],
86
- properties: {
87
- source: { type: 'string', const: 'browser_fill_form' },
88
- origin_id: { type: 'string' },
89
- url: { type: 'string', format: 'uri' },
90
- filled_count: { type: 'integer' },
91
- submitted: { type: 'boolean' },
92
- },
93
- },
94
- },
95
- },
96
- },
97
- },
98
- };
99
-
100
- async sync(_ctx: SyncContext): Promise<SyncResult> {
101
- throw new Error(BRIDGE_ONLY);
102
- }
103
-
104
- async execute(): Promise<ActionResult> {
105
- throw new Error(BRIDGE_ONLY);
106
- }
107
- }
@@ -1,108 +0,0 @@
1
- /**
2
- * Browser Page Text Connector — Owletto for Chrome only.
3
- *
4
- * Thin wrapper around browser.evaluate that bakes in a "return cleaned-up
5
- * page text" script. Saves the connector author from re-deriving the
6
- * text-extraction recipe for every page-scrape feed.
7
- *
8
- * The extension's executor branch for `browser.page_text` is responsible
9
- * for substituting the canonical script when this connector_key is
10
- * dispatched — gateway-side this connector definition just exposes the
11
- * URL + selector-scope config to the admin UI.
12
- *
13
- * Cloud-side `sync()` / `execute()` throw — actual work happens in the
14
- * extension's service worker (lobu-ai/owletto: apps/chrome/executor.js).
15
- */
16
-
17
- import {
18
- type ActionResult,
19
- type ConnectorDefinition,
20
- ConnectorRuntime,
21
- type SyncContext,
22
- type SyncResult,
23
- } from '@lobu/connector-sdk';
24
-
25
- const BRIDGE_ONLY =
26
- 'browser.page_text runs only on a worker advertising capability "browser.debugger" (Owletto for Chrome).';
27
-
28
- export default class BrowserPageTextConnector extends ConnectorRuntime {
29
- readonly definition: ConnectorDefinition = {
30
- key: 'browser.page_text',
31
- name: 'Browser Page Text',
32
- description:
33
- 'Fetches a page in the paired Chrome and returns its readable text content. Wraps browser.evaluate with a canonical text-extraction script.',
34
- version: '0.1.0',
35
- faviconDomain: 'google.com',
36
- requiredCapability: 'browser.debugger',
37
- runtime: { platforms: ['chrome-extension'] },
38
- authSchema: { methods: [{ type: 'none' }] },
39
- feeds: {
40
- page: {
41
- key: 'page',
42
- name: 'Page text',
43
- description: 'Snapshot of the text content of a single page.',
44
- // Required url; instances are minted by composing bridge connectors,
45
- // not auto-wired by device-reconcile.
46
- userManaged: true,
47
- configSchema: {
48
- type: 'object',
49
- required: ['url'],
50
- properties: {
51
- url: {
52
- type: 'string',
53
- format: 'uri',
54
- description: 'Page to load and read text from.',
55
- },
56
- selector: {
57
- type: 'string',
58
- description:
59
- 'CSS selector to scope the extraction to (defaults to body.innerText).',
60
- },
61
- wait_for_selector: {
62
- type: 'string',
63
- description:
64
- 'CSS selector to wait for before reading (defaults to body).',
65
- },
66
- wait_timeout_ms: {
67
- type: 'integer',
68
- minimum: 100,
69
- maximum: 60_000,
70
- },
71
- max_chars: {
72
- type: 'integer',
73
- minimum: 100,
74
- maximum: 1_000_000,
75
- description: 'Truncate output past this length. Default 200000.',
76
- },
77
- },
78
- },
79
- eventKinds: {
80
- page_text: {
81
- description:
82
- 'One event per run containing the page text (truncated to max_chars).',
83
- metadataSchema: {
84
- type: 'object',
85
- required: ['source', 'origin_id', 'url'],
86
- properties: {
87
- source: { type: 'string', const: 'browser_page_text' },
88
- origin_id: { type: 'string' },
89
- url: { type: 'string', format: 'uri' },
90
- title: { type: 'string' },
91
- char_count: { type: 'integer' },
92
- truncated: { type: 'boolean' },
93
- },
94
- },
95
- },
96
- },
97
- },
98
- },
99
- };
100
-
101
- async sync(_ctx: SyncContext): Promise<SyncResult> {
102
- throw new Error(BRIDGE_ONLY);
103
- }
104
-
105
- async execute(): Promise<ActionResult> {
106
- throw new Error(BRIDGE_ONLY);
107
- }
108
- }
@@ -1,74 +0,0 @@
1
- /**
2
- * Chrome Tabs Connector — Owletto for Chrome only.
3
- *
4
- * Runs on the Owletto Chrome extension, which advertises capability
5
- * `browser.tabs`. The extension uses `chrome.tabs.query()` to list the tabs
6
- * currently open in the user's paired Chrome profile. No persistent backfill
7
- * — each sync returns the live tab list at that moment.
8
- *
9
- * This connector is the smallest end-to-end demo of the Chrome-extension
10
- * device protocol: it proves a connector definition can declare a browser
11
- * capability, get auto-wired into the user's personal org when a
12
- * `chrome-extension` device polls, and route runs to it.
13
- *
14
- * The cloud-side `sync()` / `execute()` throw — actual work happens in the
15
- * extension's service worker (lobu-ai/owletto: apps/chrome/background.js).
16
- */
17
-
18
- import {
19
- type ActionResult,
20
- type ConnectorDefinition,
21
- ConnectorRuntime,
22
- type SyncContext,
23
- type SyncResult,
24
- } from '@lobu/connector-sdk';
25
-
26
- const BRIDGE_ONLY =
27
- 'Chrome Tabs runs only on a worker advertising capability "browser.tabs" (Owletto for Chrome).';
28
-
29
- export default class ChromeTabsConnector extends ConnectorRuntime {
30
- readonly definition: ConnectorDefinition = {
31
- key: 'chrome.tabs',
32
- name: 'Chrome Tabs',
33
- description:
34
- 'Lists the tabs currently open in the paired Chrome profile. Read-only; no history or content.',
35
- version: '0.1.0',
36
- faviconDomain: 'google.com',
37
- requiredCapability: 'browser.tabs',
38
- runtime: { platforms: ['chrome-extension'] },
39
- authSchema: { methods: [{ type: 'none' }] },
40
- feeds: {
41
- open_tabs: {
42
- key: 'open_tabs',
43
- name: 'Open tabs',
44
- description: 'Snapshot of the tabs currently open in this Chrome profile.',
45
- configSchema: { type: 'object', properties: {} },
46
- eventKinds: {
47
- tab_snapshot: {
48
- description: 'One row per tab observed in the active poll cycle.',
49
- metadataSchema: {
50
- type: 'object',
51
- required: ['source', 'origin_id', 'url'],
52
- properties: {
53
- source: { type: 'string', const: 'chrome_tabs' },
54
- origin_id: { type: 'string' },
55
- url: { type: 'string', format: 'uri' },
56
- title: { type: 'string' },
57
- window_id: { type: 'integer' },
58
- active: { type: 'boolean' },
59
- },
60
- },
61
- },
62
- },
63
- },
64
- },
65
- };
66
-
67
- async sync(_ctx: SyncContext): Promise<SyncResult> {
68
- throw new Error(BRIDGE_ONLY);
69
- }
70
-
71
- async execute(): Promise<ActionResult> {
72
- throw new Error(BRIDGE_ONLY);
73
- }
74
- }