agentlinkops 0.5.0 → 0.6.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.json +8 -0
- package/CHANGELOG.md +15 -1
- package/LICENSE +0 -0
- package/NOTICE +0 -0
- package/README.md +2 -1
- package/bin/agentlinkops.mjs +0 -0
- package/bin/linktrail.mjs +0 -0
- package/cli/adapters/csv.js +0 -0
- package/cli/adapters/sqlite-crm.js +0 -0
- package/cli/adapters/suppliers.js +0 -0
- package/cli/agent-setup.js +0 -0
- package/cli/agentlinkops.mjs +0 -0
- package/cli/args.js +0 -0
- package/cli/catalog.js +0 -0
- package/cli/check.js +0 -0
- package/cli/citation.js +124 -2
- package/cli/client.js +1 -1
- package/cli/commands.js +0 -0
- package/cli/config.js +0 -0
- package/cli/connection.js +0 -0
- package/cli/context-mcp.js +0 -0
- package/cli/context.js +0 -0
- package/cli/delivery.js +0 -0
- package/cli/doctor.js +19 -0
- package/cli/env.js +0 -0
- package/cli/fleet.js +0 -0
- package/cli/gsc-browser.js +0 -0
- package/cli/import.js +0 -0
- package/cli/ledger.js +0 -0
- package/cli/linktrail.mjs +0 -0
- package/cli/local-result.js +0 -0
- package/cli/main.js +0 -0
- package/cli/mirror.js +0 -0
- package/cli/mix.js +0 -0
- package/cli/platforms.js +0 -0
- package/cli/receipt-performance.js +0 -0
- package/cli/receipts.js +0 -0
- package/cli/report.js +0 -0
- package/cli/setup-plan.js +0 -0
- package/cli/skill.js +0 -0
- package/cli/state.js +0 -0
- package/cli/status.js +0 -0
- package/cli/sync.js +0 -0
- package/package.json +14 -3
- package/references/cli.md +0 -0
- package/references/disavow.md +0 -0
- package/references/reports.md +0 -0
- package/scripts/agentlinkops.py +0 -0
- package/scripts/disavow.py +0 -0
- package/scripts/linktrail.py +0 -0
- package/scripts/migrations/001_crm.sql +0 -0
- package/scripts/migrations/002_cloud_events.sql +0 -0
- package/scripts/migrations/003_disavow.sql +0 -0
- package/scripts/migrations/004_placement_costs.sql +0 -0
- package/scripts/report.py +0 -0
- package/shared/agent-clients.js +0 -0
- package/shared/observation-event.js +0 -0
- package/shared/response-contract.js +0 -0
- package/shared/search-connection-contract.js +0 -0
- package/skills/agentlinkops-assets/SKILL.md +0 -0
- package/skills/agentlinkops-assets/agents/openai.yaml +0 -0
- package/skills/agentlinkops-campaigns/SKILL.md +0 -0
- package/skills/agentlinkops-campaigns/agents/openai.yaml +0 -0
- package/skills/agentlinkops-connect/SKILL.md +0 -0
- package/skills/agentlinkops-connect/agents/openai.yaml +0 -0
- package/skills/agentlinkops-connect/references/agentlinkops.md +0 -0
- package/skills/agentlinkops-crm/SKILL.md +0 -0
- package/skills/agentlinkops-crm/agents/openai.yaml +0 -0
- package/skills/content-defingerprinting/SKILL.md +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/README.md +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/UPSTREAM.json +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/revendor.sh +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/LICENSE.upstream +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/clean_text.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/common.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/inspect_text.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/score_stylometry.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/vendor/text_unicode.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/verify-vendor.py +0 -0
- package/skills/content-defingerprinting/scripts/watermarks/wm-scan.py +0 -0
- package/skills/internal-linking-optimizer/SKILL.md +0 -0
- package/skills/internal-linking-optimizer/references/source-prompt.md +0 -0
- package/skills/pre-publish-review/SKILL.md +0 -0
- package/skills/source-cited-content-builder/SKILL.md +0 -0
- package/skills/source-cited-content-builder/references/source-prompt.md +0 -0
- package/skills/source-cited-humanizer/SKILL.md +0 -0
- package/src/citations/adapter.js +173 -0
- package/src/citations/alert.js +53 -0
- package/src/citations/browser/engine.js +267 -0
- package/src/citations/browser/gen/core/providers/_shared/google.js +4 -0
- package/src/citations/browser/gen/core/providers/_shared/rawSourcesDom.js +15 -0
- package/src/citations/browser/gen/core/providers/_shared/resetProviderPage.js +22 -0
- package/src/citations/browser/gen/core/providers/_shared/sourceUtils.js +8 -0
- package/src/citations/browser/gen/core/providers/ai-overview/index.js +70 -0
- package/src/citations/browser/gen/core/providers/ai-overview/lib/expand.js +59 -0
- package/src/citations/browser/gen/core/providers/ai-overview/lib/extractSources.js +60 -0
- package/src/citations/browser/gen/core/providers/ai-overview/lib/pageLifecycle.js +18 -0
- package/src/citations/browser/gen/core/providers/ai-overview/lib/session.js +62 -0
- package/src/citations/browser/gen/core/providers/chatgpt/index.js +28 -0
- package/src/citations/browser/gen/core/providers/chatgpt/lib/dismissAuthModal.js +39 -0
- package/src/citations/browser/gen/core/providers/chatgpt/lib/extractSources.js +66 -0
- package/src/citations/browser/gen/core/providers/chatgpt/lib/pageLifecycle.js +11 -0
- package/src/citations/browser/gen/core/providers/claude/index.js +16 -0
- package/src/citations/browser/gen/core/providers/claude/lib/extractSources.js +54 -0
- package/src/citations/browser/gen/core/providers/claude/lib/pageLifecycle.js +9 -0
- package/src/citations/browser/gen/core/providers/gemini/index.js +40 -0
- package/src/citations/browser/gen/core/providers/gemini/lib/extractSources.js +65 -0
- package/src/citations/browser/gen/core/providers/gemini/lib/pageLifecycle.js +14 -0
- package/src/citations/browser/gen/core/providers/gemini/lib/session.js +45 -0
- package/src/citations/browser/gen/core/providers/index.js +15 -0
- package/src/citations/browser/gen/core/providers/perplexity/index.js +31 -0
- package/src/citations/browser/gen/core/providers/perplexity/lib/extractSources.js +84 -0
- package/src/citations/browser/gen/core/providers/perplexity/lib/navigation.js +38 -0
- package/src/citations/browser/gen/core/providers/types.js +0 -0
- package/src/citations/browser/gen/lib/browser/camoufox.js +587 -0
- package/src/citations/browser/gen/lib/browser/display.js +147 -0
- package/src/citations/browser/gen/lib/browser/domOps.js +339 -0
- package/src/citations/browser/gen/lib/browser/humanBehavior.js +121 -0
- package/src/citations/browser/gen/lib/browser/navigate.js +46 -0
- package/src/citations/browser/gen/lib/browser/playwrightCompat.js +321 -0
- package/src/citations/browser/gen/lib/browser/proxy/forwarder.js +251 -0
- package/src/citations/browser/gen/lib/browser/runtimeTypes.js +0 -0
- package/src/citations/browser/gen/lib/extraction/sourceUtils.js +71 -0
- package/src/citations/browser/gen/lib/input/editor/assertNotBlocked.js +54 -0
- package/src/citations/browser/gen/lib/input/editor/clearInput.js +52 -0
- package/src/citations/browser/gen/lib/input/editor/findEditor.js +54 -0
- package/src/citations/browser/gen/lib/input/editor/findSendButton.js +21 -0
- package/src/citations/browser/gen/lib/input/editor/promptInput.js +117 -0
- package/src/citations/browser/gen/lib/input/markdown/converter.js +101 -0
- package/src/citations/browser/gen/lib/input/markdown/toMarkdown.js +14 -0
- package/src/citations/browser/gen/lib/input/response/detectBotPage.js +13 -0
- package/src/citations/browser/gen/lib/input/response/getText.js +10 -0
- package/src/citations/browser/gen/lib/input/response/isGenerating.js +59 -0
- package/src/citations/browser/gen/lib/input/response/waitForFinish.js +105 -0
- package/src/citations/browser/gen/lib/input/sources/findButton.js +41 -0
- package/src/citations/browser/gen/lib/input/sources/openPanel.js +11 -0
- package/src/citations/browser/gen/utils/agent-constants.js +87 -0
- package/src/citations/browser/providers.js +166 -0
- package/src/citations/browser/shims/errors.js +26 -0
- package/src/citations/browser/shims/types.js +6 -0
- package/src/citations/browser/shims/utils.js +32 -0
- package/src/citations/contract.js +19 -3
- package/src/citations/fixtures/dataforseo-aio.json +82 -0
- package/src/citations/match.js +0 -0
- package/src/citations/panel-builder.js +44 -0
- package/src/citations/report.js +165 -0
- package/src/citations/runner.js +43 -16
- package/src/citations/stats.js +63 -0
- package/src/citations/watch.js +85 -0
- package/src/competitors/contract.js +0 -0
- package/src/competitors/domain-mix.js +0 -0
- package/src/context/ga4.js +0 -0
- package/src/context/gsc.js +0 -0
- package/src/context/site-profile.js +0 -0
- package/src/context/util.js +0 -0
- package/src/context-tool-registry.js +0 -0
- package/src/corpus/acquire.js +0 -0
- package/src/corpus/seeds.js +0 -0
- package/src/discovery/contract.js +0 -0
- package/src/discovery/import.js +0 -0
- package/src/tool-views.js +0 -0
- package/src/verifier/fetch.js +0 -0
- package/src/verifier/index.js +0 -0
- package/src/verifier/observation-kind.js +0 -0
- package/src/verifier/parser.js +0 -0
- package/src/verifier/readiness.js +0 -0
- package/src/verifier/render-evidence.js +0 -0
- package/src/verifier/robots.js +0 -0
- package/src/verifier/transition.js +0 -0
- package/src/verifier/url.js +0 -0
- package/templates/SITE.template.md +0 -0
- package/templates/campaigns.v1.json +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canUseOsLevelInput,
|
|
3
|
+
pressKeyLikeUser
|
|
4
|
+
} from "../../../../lib/browser/humanBehavior.js";
|
|
5
|
+
import {
|
|
6
|
+
buildSources,
|
|
7
|
+
clickButtonViaDispatch
|
|
8
|
+
} from "../../_shared/sourceUtils.js";
|
|
9
|
+
const PERPLEXITY_RAW_SOURCES_DOM_EXTRACTOR = String.raw`(_helpers) => {
|
|
10
|
+
const results = [];
|
|
11
|
+
const panel = document.querySelector(
|
|
12
|
+
'[role="tabpanel"][aria-labelledby*="citations"]',
|
|
13
|
+
);
|
|
14
|
+
if (!panel) return results;
|
|
15
|
+
|
|
16
|
+
const getCleanTexts = (anchor) => {
|
|
17
|
+
const texts = [];
|
|
18
|
+
|
|
19
|
+
for (const el of anchor.querySelectorAll("*")) {
|
|
20
|
+
const text = (el.textContent || "").trim();
|
|
21
|
+
if (!text) continue;
|
|
22
|
+
|
|
23
|
+
if (
|
|
24
|
+
Array.from(el.children).some(
|
|
25
|
+
(child) => (child.textContent || "").trim().length > 0,
|
|
26
|
+
)
|
|
27
|
+
) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
texts.push(text);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return Array.from(new Set(texts));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
for (const anchor of Array.from(panel.querySelectorAll('a[href^="http"]'))) {
|
|
38
|
+
if (!(anchor instanceof HTMLAnchorElement)) continue;
|
|
39
|
+
|
|
40
|
+
const rawHref = anchor.href.replace(/#.*$/, "");
|
|
41
|
+
if (!rawHref) continue;
|
|
42
|
+
|
|
43
|
+
const texts = getCleanTexts(anchor);
|
|
44
|
+
if (texts.length === 0) continue;
|
|
45
|
+
|
|
46
|
+
const sorted = [...texts].sort((a, b) => a.length - b.length);
|
|
47
|
+
const citedText = sorted[sorted.length - 1] || "";
|
|
48
|
+
const title =
|
|
49
|
+
sorted.length >= 2 ? sorted[sorted.length - 2] || "" : sorted[0] || "";
|
|
50
|
+
|
|
51
|
+
results.push({
|
|
52
|
+
rawHref,
|
|
53
|
+
title,
|
|
54
|
+
citedText,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return results;
|
|
59
|
+
}`;
|
|
60
|
+
async function extractSourcesFromPerplexity(page, sourcesButton) {
|
|
61
|
+
const rawSources = await page.runDomOp("raw-sources", {
|
|
62
|
+
provider: "perplexity"
|
|
63
|
+
});
|
|
64
|
+
const clickedToClose = await clickButtonViaDispatch(page, sourcesButton).catch(
|
|
65
|
+
() => false
|
|
66
|
+
);
|
|
67
|
+
if (!clickedToClose) {
|
|
68
|
+
const escaped2 = await pressKeyLikeUser(page, "Escape").catch(() => false);
|
|
69
|
+
if (!escaped2 && canUseOsLevelInput(page)) {
|
|
70
|
+
return buildSources(rawSources, { provider: "perplexity" });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
await page.waitForTimeout(300);
|
|
74
|
+
const escaped = await pressKeyLikeUser(page, "Escape").catch(() => false);
|
|
75
|
+
if (!escaped && canUseOsLevelInput(page)) {
|
|
76
|
+
return buildSources(rawSources, { provider: "perplexity" });
|
|
77
|
+
}
|
|
78
|
+
await page.waitForTimeout(300);
|
|
79
|
+
return buildSources(rawSources, { provider: "perplexity" });
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
PERPLEXITY_RAW_SOURCES_DOM_EXTRACTOR,
|
|
83
|
+
extractSourcesFromPerplexity
|
|
84
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resetProviderPage } from "../../_shared/resetProviderPage.js";
|
|
2
|
+
const PERPLEXITY_URL = "https://www.perplexity.ai/";
|
|
3
|
+
function isPerplexitySearchUrl(rawUrl) {
|
|
4
|
+
try {
|
|
5
|
+
const url = new URL(rawUrl);
|
|
6
|
+
return url.hostname.endsWith("perplexity.ai") && url.pathname.startsWith("/search/") && url.pathname.length > "/search/".length;
|
|
7
|
+
} catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
async function waitForPerplexitySearchUrl(page, preSubmitUrl) {
|
|
12
|
+
if (isPerplexitySearchUrl(preSubmitUrl)) {
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
const deadline = Date.now() + 4e3;
|
|
16
|
+
while (Date.now() < deadline) {
|
|
17
|
+
if (isPerplexitySearchUrl(await page.getUrl().catch(() => page.url()))) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
await page.waitForTimeout(100);
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
async function perplexityPostNavigationHook(page) {
|
|
25
|
+
const delay = 1e3 + Math.floor(Math.random() * 1e3);
|
|
26
|
+
await page.waitForTimeout(delay);
|
|
27
|
+
}
|
|
28
|
+
async function resetPerplexityPage(page) {
|
|
29
|
+
await resetProviderPage(page, "perplexity", PERPLEXITY_URL, {
|
|
30
|
+
postNavigationHook: perplexityPostNavigationHook
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
PERPLEXITY_URL,
|
|
35
|
+
perplexityPostNavigationHook,
|
|
36
|
+
resetPerplexityPage,
|
|
37
|
+
waitForPerplexitySearchUrl
|
|
38
|
+
};
|
|
File without changes
|