@jackwener/opencli 1.5.7 → 1.5.9
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/CHANGELOG.md +29 -0
- package/README.md +17 -1
- package/README.zh-CN.md +17 -1
- package/dist/browser/base-page.d.ts +48 -0
- package/dist/browser/base-page.js +160 -0
- package/dist/browser/cdp.js +4 -106
- package/dist/browser/daemon-client.d.ts +1 -7
- package/dist/browser/daemon-client.js +2 -9
- package/dist/browser/discover.d.ts +1 -4
- package/dist/browser/discover.js +1 -4
- package/dist/browser/errors.d.ts +4 -0
- package/dist/browser/errors.js +20 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/page.d.ts +6 -35
- package/dist/browser/page.js +10 -189
- package/dist/browser/tabs.js +5 -5
- package/dist/browser.test.js +15 -15
- package/dist/cli-manifest.json +294 -22
- package/dist/clis/amazon/bestsellers.d.ts +21 -0
- package/dist/clis/amazon/bestsellers.js +130 -0
- package/dist/clis/amazon/bestsellers.test.js +20 -0
- package/dist/clis/amazon/discussion.d.ts +20 -0
- package/dist/clis/amazon/discussion.js +91 -0
- package/dist/clis/amazon/discussion.test.js +36 -0
- package/dist/clis/amazon/offer.d.ts +23 -0
- package/dist/clis/amazon/offer.js +140 -0
- package/dist/clis/amazon/offer.test.d.ts +1 -0
- package/dist/clis/amazon/offer.test.js +29 -0
- package/dist/clis/amazon/product.d.ts +18 -0
- package/dist/clis/amazon/product.js +92 -0
- package/dist/clis/amazon/product.test.d.ts +1 -0
- package/dist/clis/amazon/product.test.js +24 -0
- package/dist/clis/amazon/search.d.ts +18 -0
- package/dist/clis/amazon/search.js +87 -0
- package/dist/clis/amazon/search.test.d.ts +1 -0
- package/dist/clis/amazon/search.test.js +22 -0
- package/dist/clis/amazon/shared.d.ts +64 -0
- package/dist/clis/amazon/shared.js +255 -0
- package/dist/clis/amazon/shared.test.d.ts +1 -0
- package/dist/clis/amazon/shared.test.js +33 -0
- package/dist/clis/gemini/ask.d.ts +1 -0
- package/dist/clis/gemini/ask.js +40 -0
- package/dist/clis/gemini/image.d.ts +1 -0
- package/dist/clis/gemini/image.js +105 -0
- package/dist/clis/gemini/new.d.ts +1 -0
- package/dist/clis/gemini/new.js +20 -0
- package/dist/clis/gemini/utils.d.ts +34 -0
- package/dist/clis/gemini/utils.js +463 -0
- package/dist/clis/gemini/utils.test.d.ts +1 -0
- package/dist/clis/gemini/utils.test.js +31 -0
- package/dist/clis/notebooklm/compat.test.d.ts +1 -1
- package/dist/clis/notebooklm/compat.test.js +3 -3
- package/dist/clis/notebooklm/current.js +2 -3
- package/dist/clis/notebooklm/get.js +2 -3
- package/dist/clis/notebooklm/history.js +2 -3
- package/dist/clis/notebooklm/note-list.js +2 -3
- package/dist/clis/notebooklm/notes-get.js +2 -3
- package/dist/clis/notebooklm/open.d.ts +1 -0
- package/dist/clis/notebooklm/open.js +41 -0
- package/dist/clis/notebooklm/open.test.d.ts +1 -0
- package/dist/clis/notebooklm/open.test.js +63 -0
- package/dist/clis/notebooklm/source-fulltext.js +2 -3
- package/dist/clis/notebooklm/source-get.js +2 -3
- package/dist/clis/notebooklm/source-guide.js +2 -3
- package/dist/clis/notebooklm/source-list.js +2 -3
- package/dist/clis/notebooklm/status.js +1 -2
- package/dist/clis/notebooklm/summary.js +2 -3
- package/dist/clis/notebooklm/utils.d.ts +2 -1
- package/dist/clis/notebooklm/utils.js +20 -21
- package/dist/clis/xiaohongshu/creator-note-detail.test.js +11 -11
- package/dist/clis/xiaohongshu/creator-notes-summary.test.js +6 -6
- package/dist/clis/xiaohongshu/creator-notes.test.js +22 -22
- package/dist/commanderAdapter.js +6 -3
- package/dist/commanderAdapter.test.js +33 -0
- package/dist/commands/daemon.js +1 -1
- package/dist/commands/daemon.test.js +1 -1
- package/dist/doctor.d.ts +1 -2
- package/dist/doctor.js +7 -8
- package/dist/explore.js +1 -1
- package/dist/extension-manifest-regression.test.js +1 -0
- package/dist/output.js +28 -0
- package/dist/output.test.js +15 -0
- package/dist/pipeline/executor.js +2 -7
- package/dist/pipeline/steps/browser.js +1 -1
- package/dist/pipeline/template.js +25 -3
- package/dist/record.d.ts +50 -0
- package/dist/record.js +298 -57
- package/dist/record.test.d.ts +1 -0
- package/dist/record.test.js +293 -0
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +1 -0
- package/dist/registry.test.js +10 -0
- package/dist/runtime.js +3 -3
- package/dist/snapshotFormatter.d.ts +1 -1
- package/dist/snapshotFormatter.js +4 -4
- package/dist/snapshotFormatter.test.d.ts +1 -1
- package/dist/snapshotFormatter.test.js +2 -2
- package/dist/types.d.ts +3 -1
- package/dist/types.js +1 -1
- package/docs/.vitepress/config.mts +2 -0
- package/docs/adapters/browser/amazon.md +53 -0
- package/docs/adapters/browser/gemini.md +72 -0
- package/docs/adapters/browser/notebooklm.md +5 -5
- package/docs/adapters/index.md +3 -1
- package/extension/dist/background.js +614 -794
- package/extension/manifest.json +2 -1
- package/extension/src/background.test.ts +7 -163
- package/extension/src/background.ts +7 -156
- package/extension/src/cdp.test.ts +75 -0
- package/extension/src/cdp.ts +77 -3
- package/extension/src/protocol.ts +1 -5
- package/package.json +1 -1
- package/skills/opencli-explorer/SKILL.md +847 -0
- package/skills/opencli-oneshot/SKILL.md +216 -0
- package/skills/opencli-usage/SKILL.md +71 -0
- package/skills/opencli-usage/browser.md +429 -0
- package/skills/opencli-usage/desktop.md +118 -0
- package/skills/opencli-usage/plugins.md +82 -0
- package/skills/opencli-usage/public-api.md +149 -0
- package/src/browser/base-page.ts +197 -0
- package/src/browser/cdp.ts +7 -131
- package/src/browser/daemon-client.ts +3 -14
- package/src/browser/discover.ts +1 -4
- package/src/browser/errors.ts +22 -0
- package/src/browser/index.ts +1 -1
- package/src/browser/page.ts +13 -212
- package/src/browser/tabs.ts +5 -5
- package/src/browser.test.ts +15 -15
- package/src/clis/amazon/bestsellers.test.ts +22 -0
- package/src/clis/amazon/bestsellers.ts +180 -0
- package/src/clis/amazon/discussion.test.ts +38 -0
- package/src/clis/amazon/discussion.ts +131 -0
- package/src/clis/amazon/offer.test.ts +35 -0
- package/src/clis/amazon/offer.ts +185 -0
- package/src/clis/amazon/product.test.ts +26 -0
- package/src/clis/amazon/product.ts +131 -0
- package/src/clis/amazon/search.test.ts +24 -0
- package/src/clis/amazon/search.ts +128 -0
- package/src/clis/amazon/shared.test.ts +37 -0
- package/src/clis/amazon/shared.ts +316 -0
- package/src/clis/gemini/ask.ts +46 -0
- package/src/clis/gemini/image.ts +115 -0
- package/src/clis/gemini/new.ts +22 -0
- package/src/clis/gemini/utils.test.ts +36 -0
- package/src/clis/gemini/utils.ts +523 -0
- package/src/clis/notebooklm/compat.test.ts +3 -3
- package/src/clis/notebooklm/current.ts +2 -3
- package/src/clis/notebooklm/get.ts +1 -3
- package/src/clis/notebooklm/history.ts +1 -3
- package/src/clis/notebooklm/note-list.ts +1 -3
- package/src/clis/notebooklm/notes-get.ts +1 -3
- package/src/clis/notebooklm/open.test.ts +78 -0
- package/src/clis/notebooklm/open.ts +61 -0
- package/src/clis/notebooklm/source-fulltext.ts +1 -3
- package/src/clis/notebooklm/source-get.ts +1 -3
- package/src/clis/notebooklm/source-guide.ts +1 -3
- package/src/clis/notebooklm/source-list.ts +1 -3
- package/src/clis/notebooklm/status.ts +1 -2
- package/src/clis/notebooklm/summary.ts +1 -3
- package/src/clis/notebooklm/utils.ts +29 -20
- package/src/clis/xiaohongshu/creator-note-detail.test.ts +11 -11
- package/src/clis/xiaohongshu/creator-notes-summary.test.ts +6 -6
- package/src/clis/xiaohongshu/creator-notes.test.ts +22 -22
- package/src/commanderAdapter.test.ts +47 -0
- package/src/commanderAdapter.ts +7 -3
- package/src/commands/daemon.test.ts +1 -1
- package/src/commands/daemon.ts +1 -1
- package/src/doctor.ts +7 -8
- package/src/explore.ts +1 -1
- package/src/extension-manifest-regression.test.ts +1 -0
- package/src/output.test.ts +17 -0
- package/src/output.ts +27 -0
- package/src/pipeline/executor.ts +2 -7
- package/src/pipeline/steps/browser.ts +1 -1
- package/src/pipeline/template.ts +27 -4
- package/src/record.test.ts +362 -0
- package/src/record.ts +341 -62
- package/src/registry.test.ts +12 -0
- package/src/registry.ts +3 -0
- package/src/runtime.ts +3 -3
- package/src/snapshotFormatter.test.ts +2 -2
- package/src/snapshotFormatter.ts +4 -4
- package/src/types.ts +3 -1
- package/.agents/skills/cross-project-adapter-migration/SKILL.md +0 -249
- package/.agents/workflows/cross-project-adapter-migration.md +0 -54
- package/SKILL.md +0 -879
- package/dist/clis/notebooklm/bind-current.js +0 -29
- package/dist/clis/notebooklm/bind-current.test.d.ts +0 -1
- package/dist/clis/notebooklm/bind-current.test.js +0 -35
- package/dist/clis/notebooklm/binding.test.js +0 -44
- package/src/clis/notebooklm/bind-current.test.ts +0 -43
- package/src/clis/notebooklm/bind-current.ts +0 -36
- package/src/clis/notebooklm/binding.test.ts +0 -53
- /package/dist/browser/{mcp.d.ts → bridge.d.ts} +0 -0
- /package/dist/browser/{mcp.js → bridge.js} +0 -0
- /package/dist/clis/{notebooklm/bind-current.d.ts → amazon/bestsellers.test.d.ts} +0 -0
- /package/dist/clis/{notebooklm/binding.test.d.ts → amazon/discussion.test.d.ts} +0 -0
- /package/src/browser/{mcp.ts → bridge.ts} +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { cli, Strategy } from '../../registry.js';
|
|
2
|
-
import { bindCurrentTab } from '../../browser/daemon-client.js';
|
|
3
|
-
import { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';
|
|
4
|
-
import { parseNotebooklmIdFromUrl } from './utils.js';
|
|
5
|
-
cli({
|
|
6
|
-
site: NOTEBOOKLM_SITE,
|
|
7
|
-
name: 'bind-current',
|
|
8
|
-
aliases: ['use'],
|
|
9
|
-
description: 'Bind the current active NotebookLM notebook tab into the site:notebooklm workspace',
|
|
10
|
-
domain: NOTEBOOKLM_DOMAIN,
|
|
11
|
-
strategy: Strategy.COOKIE,
|
|
12
|
-
browser: true,
|
|
13
|
-
navigateBefore: false,
|
|
14
|
-
args: [],
|
|
15
|
-
columns: ['workspace', 'tab_id', 'notebook_id', 'title', 'url'],
|
|
16
|
-
func: async () => {
|
|
17
|
-
const result = await bindCurrentTab(`site:${NOTEBOOKLM_SITE}`, {
|
|
18
|
-
matchDomain: NOTEBOOKLM_DOMAIN,
|
|
19
|
-
matchPathPrefix: '/notebook/',
|
|
20
|
-
});
|
|
21
|
-
return [{
|
|
22
|
-
workspace: result.workspace ?? `site:${NOTEBOOKLM_SITE}`,
|
|
23
|
-
tab_id: result.tabId ?? null,
|
|
24
|
-
notebook_id: result.url ? parseNotebooklmIdFromUrl(result.url) : '',
|
|
25
|
-
title: result.title ?? '',
|
|
26
|
-
url: result.url ?? '',
|
|
27
|
-
}];
|
|
28
|
-
},
|
|
29
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './bind-current.js';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
const { mockBindCurrentTab } = vi.hoisted(() => ({
|
|
3
|
-
mockBindCurrentTab: vi.fn(),
|
|
4
|
-
}));
|
|
5
|
-
vi.mock('../../browser/daemon-client.js', () => ({
|
|
6
|
-
bindCurrentTab: mockBindCurrentTab,
|
|
7
|
-
}));
|
|
8
|
-
import { getRegistry } from '../../registry.js';
|
|
9
|
-
import './bind-current.js';
|
|
10
|
-
describe('notebooklm bind-current', () => {
|
|
11
|
-
const command = getRegistry().get('notebooklm/bind-current');
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
mockBindCurrentTab.mockReset();
|
|
14
|
-
});
|
|
15
|
-
it('binds the current notebook tab into site:notebooklm', async () => {
|
|
16
|
-
mockBindCurrentTab.mockResolvedValue({
|
|
17
|
-
workspace: 'site:notebooklm',
|
|
18
|
-
tabId: 123,
|
|
19
|
-
title: 'Bound Notebook',
|
|
20
|
-
url: 'https://notebooklm.google.com/notebook/nb-live',
|
|
21
|
-
});
|
|
22
|
-
const result = await command.func({}, {});
|
|
23
|
-
expect(mockBindCurrentTab).toHaveBeenCalledWith('site:notebooklm', {
|
|
24
|
-
matchDomain: 'notebooklm.google.com',
|
|
25
|
-
matchPathPrefix: '/notebook/',
|
|
26
|
-
});
|
|
27
|
-
expect(result).toEqual([{
|
|
28
|
-
workspace: 'site:notebooklm',
|
|
29
|
-
tab_id: 123,
|
|
30
|
-
notebook_id: 'nb-live',
|
|
31
|
-
title: 'Bound Notebook',
|
|
32
|
-
url: 'https://notebooklm.google.com/notebook/nb-live',
|
|
33
|
-
}]);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
const { mockBindCurrentTab } = vi.hoisted(() => ({
|
|
3
|
-
mockBindCurrentTab: vi.fn(),
|
|
4
|
-
}));
|
|
5
|
-
vi.mock('../../browser/daemon-client.js', () => ({
|
|
6
|
-
bindCurrentTab: mockBindCurrentTab,
|
|
7
|
-
}));
|
|
8
|
-
import { ensureNotebooklmNotebookBinding } from './utils.js';
|
|
9
|
-
describe('notebooklm automatic binding', () => {
|
|
10
|
-
const originalEndpoint = process.env.OPENCLI_CDP_ENDPOINT;
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
mockBindCurrentTab.mockReset();
|
|
13
|
-
if (originalEndpoint === undefined)
|
|
14
|
-
delete process.env.OPENCLI_CDP_ENDPOINT;
|
|
15
|
-
else
|
|
16
|
-
process.env.OPENCLI_CDP_ENDPOINT = originalEndpoint;
|
|
17
|
-
});
|
|
18
|
-
it('does nothing when the current page is already a notebook page', async () => {
|
|
19
|
-
const page = {
|
|
20
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/notebook/nb-demo',
|
|
21
|
-
};
|
|
22
|
-
await expect(ensureNotebooklmNotebookBinding(page)).resolves.toBe(false);
|
|
23
|
-
expect(mockBindCurrentTab).not.toHaveBeenCalled();
|
|
24
|
-
});
|
|
25
|
-
it('best-effort binds a notebook page through the browser bridge when currently on home', async () => {
|
|
26
|
-
const page = {
|
|
27
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/',
|
|
28
|
-
};
|
|
29
|
-
mockBindCurrentTab.mockResolvedValue({});
|
|
30
|
-
await expect(ensureNotebooklmNotebookBinding(page)).resolves.toBe(true);
|
|
31
|
-
expect(mockBindCurrentTab).toHaveBeenCalledWith('site:notebooklm', {
|
|
32
|
-
matchDomain: 'notebooklm.google.com',
|
|
33
|
-
matchPathPrefix: '/notebook/',
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
it('skips daemon binding in direct CDP mode', async () => {
|
|
37
|
-
process.env.OPENCLI_CDP_ENDPOINT = 'ws://127.0.0.1:9222/devtools/page/1';
|
|
38
|
-
const page = {
|
|
39
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/',
|
|
40
|
-
};
|
|
41
|
-
await expect(ensureNotebooklmNotebookBinding(page)).resolves.toBe(false);
|
|
42
|
-
expect(mockBindCurrentTab).not.toHaveBeenCalled();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
const { mockBindCurrentTab } = vi.hoisted(() => ({
|
|
4
|
-
mockBindCurrentTab: vi.fn(),
|
|
5
|
-
}));
|
|
6
|
-
|
|
7
|
-
vi.mock('../../browser/daemon-client.js', () => ({
|
|
8
|
-
bindCurrentTab: mockBindCurrentTab,
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
import { getRegistry } from '../../registry.js';
|
|
12
|
-
import './bind-current.js';
|
|
13
|
-
|
|
14
|
-
describe('notebooklm bind-current', () => {
|
|
15
|
-
const command = getRegistry().get('notebooklm/bind-current');
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
mockBindCurrentTab.mockReset();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('binds the current notebook tab into site:notebooklm', async () => {
|
|
22
|
-
mockBindCurrentTab.mockResolvedValue({
|
|
23
|
-
workspace: 'site:notebooklm',
|
|
24
|
-
tabId: 123,
|
|
25
|
-
title: 'Bound Notebook',
|
|
26
|
-
url: 'https://notebooklm.google.com/notebook/nb-live',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const result = await command!.func!({} as any, {});
|
|
30
|
-
|
|
31
|
-
expect(mockBindCurrentTab).toHaveBeenCalledWith('site:notebooklm', {
|
|
32
|
-
matchDomain: 'notebooklm.google.com',
|
|
33
|
-
matchPathPrefix: '/notebook/',
|
|
34
|
-
});
|
|
35
|
-
expect(result).toEqual([{
|
|
36
|
-
workspace: 'site:notebooklm',
|
|
37
|
-
tab_id: 123,
|
|
38
|
-
notebook_id: 'nb-live',
|
|
39
|
-
title: 'Bound Notebook',
|
|
40
|
-
url: 'https://notebooklm.google.com/notebook/nb-live',
|
|
41
|
-
}]);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { cli, Strategy } from '../../registry.js';
|
|
2
|
-
import { bindCurrentTab } from '../../browser/daemon-client.js';
|
|
3
|
-
import { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';
|
|
4
|
-
import { parseNotebooklmIdFromUrl } from './utils.js';
|
|
5
|
-
|
|
6
|
-
cli({
|
|
7
|
-
site: NOTEBOOKLM_SITE,
|
|
8
|
-
name: 'bind-current',
|
|
9
|
-
aliases: ['use'],
|
|
10
|
-
description: 'Bind the current active NotebookLM notebook tab into the site:notebooklm workspace',
|
|
11
|
-
domain: NOTEBOOKLM_DOMAIN,
|
|
12
|
-
strategy: Strategy.COOKIE,
|
|
13
|
-
browser: true,
|
|
14
|
-
navigateBefore: false,
|
|
15
|
-
args: [],
|
|
16
|
-
columns: ['workspace', 'tab_id', 'notebook_id', 'title', 'url'],
|
|
17
|
-
func: async () => {
|
|
18
|
-
const result = await bindCurrentTab(`site:${NOTEBOOKLM_SITE}`, {
|
|
19
|
-
matchDomain: NOTEBOOKLM_DOMAIN,
|
|
20
|
-
matchPathPrefix: '/notebook/',
|
|
21
|
-
}) as {
|
|
22
|
-
tabId?: number;
|
|
23
|
-
workspace?: string;
|
|
24
|
-
title?: string;
|
|
25
|
-
url?: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return [{
|
|
29
|
-
workspace: result.workspace ?? `site:${NOTEBOOKLM_SITE}`,
|
|
30
|
-
tab_id: result.tabId ?? null,
|
|
31
|
-
notebook_id: result.url ? parseNotebooklmIdFromUrl(result.url) : '',
|
|
32
|
-
title: result.title ?? '',
|
|
33
|
-
url: result.url ?? '',
|
|
34
|
-
}];
|
|
35
|
-
},
|
|
36
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
const { mockBindCurrentTab } = vi.hoisted(() => ({
|
|
4
|
-
mockBindCurrentTab: vi.fn(),
|
|
5
|
-
}));
|
|
6
|
-
|
|
7
|
-
vi.mock('../../browser/daemon-client.js', () => ({
|
|
8
|
-
bindCurrentTab: mockBindCurrentTab,
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
import { ensureNotebooklmNotebookBinding } from './utils.js';
|
|
12
|
-
|
|
13
|
-
describe('notebooklm automatic binding', () => {
|
|
14
|
-
const originalEndpoint = process.env.OPENCLI_CDP_ENDPOINT;
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
mockBindCurrentTab.mockReset();
|
|
18
|
-
if (originalEndpoint === undefined) delete process.env.OPENCLI_CDP_ENDPOINT;
|
|
19
|
-
else process.env.OPENCLI_CDP_ENDPOINT = originalEndpoint;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does nothing when the current page is already a notebook page', async () => {
|
|
23
|
-
const page = {
|
|
24
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/notebook/nb-demo',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
await expect(ensureNotebooklmNotebookBinding(page as any)).resolves.toBe(false);
|
|
28
|
-
expect(mockBindCurrentTab).not.toHaveBeenCalled();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('best-effort binds a notebook page through the browser bridge when currently on home', async () => {
|
|
32
|
-
const page = {
|
|
33
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
mockBindCurrentTab.mockResolvedValue({});
|
|
37
|
-
await expect(ensureNotebooklmNotebookBinding(page as any)).resolves.toBe(true);
|
|
38
|
-
expect(mockBindCurrentTab).toHaveBeenCalledWith('site:notebooklm', {
|
|
39
|
-
matchDomain: 'notebooklm.google.com',
|
|
40
|
-
matchPathPrefix: '/notebook/',
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('skips daemon binding in direct CDP mode', async () => {
|
|
45
|
-
process.env.OPENCLI_CDP_ENDPOINT = 'ws://127.0.0.1:9222/devtools/page/1';
|
|
46
|
-
const page = {
|
|
47
|
-
getCurrentUrl: async () => 'https://notebooklm.google.com/',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
await expect(ensureNotebooklmNotebookBinding(page as any)).resolves.toBe(false);
|
|
51
|
-
expect(mockBindCurrentTab).not.toHaveBeenCalled();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|