@canonry/canonry 7.51.2 → 7.51.4
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/{chunk-W43I4JKI.js → chunk-6GNV6VF4.js} +1 -1
- package/dist/{chunk-JREQHDRK.js → chunk-EQTVQIM2.js} +5 -5
- package/dist/{chunk-3YL5TEZQ.js → chunk-HHRM3H3L.js} +193 -159
- package/dist/{chunk-QQP7OQTW.js → chunk-KUS7M65J.js} +24 -6
- package/dist/{cli-commands-NALOZN72.js → cli-commands-5ZODWR4I.js} +4 -4
- package/dist/cli.js +4 -4
- package/dist/{demo-server-AKJZISIL.js → demo-server-26UUDUM7.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{intelligence-service-7BOU7ZAR.js → intelligence-service-ZGDBVFDE.js} +1 -1
- package/package.json +14 -14
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
trackFeatureCompleted,
|
|
32
32
|
trackIntegrationConnection,
|
|
33
33
|
waitForServerRuntimeStartup
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-HHRM3H3L.js";
|
|
35
35
|
import {
|
|
36
36
|
clearDashboardPassword,
|
|
37
37
|
configExists,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
rawEventSamples,
|
|
123
123
|
readMarketCompetitorNames,
|
|
124
124
|
runs
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-KUS7M65J.js";
|
|
126
126
|
import {
|
|
127
127
|
AdsDeliverySnapshotStatuses,
|
|
128
128
|
AdsHistoricalCampaignRollupStatuses,
|
|
@@ -586,7 +586,7 @@ function parseDemoTrustedProxies(values) {
|
|
|
586
586
|
async function demoCommand(options) {
|
|
587
587
|
const { host, port } = parseDemoListenOptions(options);
|
|
588
588
|
const trustProxy = parseDemoTrustedProxies(options.trustProxy);
|
|
589
|
-
const { createDemoServer } = await import("./demo-server-
|
|
589
|
+
const { createDemoServer } = await import("./demo-server-26UUDUM7.js");
|
|
590
590
|
const app = await createDemoServer({ trustProxy });
|
|
591
591
|
let stopping = false;
|
|
592
592
|
const stop = () => {
|
|
@@ -1000,7 +1000,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
async function backfillInsightsCommand(project2, opts) {
|
|
1003
|
-
const { IntelligenceService } = await import("./intelligence-service-
|
|
1003
|
+
const { IntelligenceService } = await import("./intelligence-service-ZGDBVFDE.js");
|
|
1004
1004
|
const config = loadConfig();
|
|
1005
1005
|
const db = createClient(config.database);
|
|
1006
1006
|
migrate(db);
|
|
@@ -19445,7 +19445,7 @@ var SYSTEM_CLI_COMMANDS = [
|
|
|
19445
19445
|
options: { access: stringOption() },
|
|
19446
19446
|
run: async (input) => {
|
|
19447
19447
|
if (input.positionals.length > 1) throw usageError("Expected at most one command group");
|
|
19448
|
-
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-KTQ6BHEU.js"), import("./cli-commands-
|
|
19448
|
+
const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-KTQ6BHEU.js"), import("./cli-commands-5ZODWR4I.js")]);
|
|
19449
19449
|
printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
|
|
19450
19450
|
}
|
|
19451
19451
|
},
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
persistSiteCrawlGraphLayout,
|
|
30
30
|
prepareSiteCrawlGraphLayout,
|
|
31
31
|
recordedSharePct
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-6GNV6VF4.js";
|
|
33
33
|
import {
|
|
34
34
|
CanonryMcpToolNames,
|
|
35
35
|
PACKAGE_VERSION,
|
|
@@ -241,7 +241,7 @@ import {
|
|
|
241
241
|
webhookResponseReason,
|
|
242
242
|
webhookTargetRefusalReason,
|
|
243
243
|
writeAuditLog
|
|
244
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-KUS7M65J.js";
|
|
245
245
|
import {
|
|
246
246
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
247
247
|
AGENT_NONE,
|
|
@@ -698,7 +698,9 @@ function getServerUpdateStatus(opts) {
|
|
|
698
698
|
|
|
699
699
|
// src/telemetry.ts
|
|
700
700
|
import crypto from "crypto";
|
|
701
|
+
import fs3 from "fs";
|
|
701
702
|
import os2 from "os";
|
|
703
|
+
import path2 from "path";
|
|
702
704
|
|
|
703
705
|
// src/telemetry-environment.ts
|
|
704
706
|
import fs2 from "fs";
|
|
@@ -908,9 +910,38 @@ function hostDerivedId(prefix) {
|
|
|
908
910
|
}
|
|
909
911
|
var machineId;
|
|
910
912
|
function getMachineId() {
|
|
911
|
-
machineId ??= {
|
|
913
|
+
machineId ??= {
|
|
914
|
+
value: resolveMachineId({
|
|
915
|
+
filePath: path2.join(os2.homedir(), ".canonry", "machine-id"),
|
|
916
|
+
inContainer: telemetryEnvironment().includes("container"),
|
|
917
|
+
derive: () => hostDerivedId("canonry-machine")
|
|
918
|
+
})
|
|
919
|
+
};
|
|
912
920
|
return machineId.value;
|
|
913
921
|
}
|
|
922
|
+
function resolveMachineId(opts) {
|
|
923
|
+
if (opts.inContainer) return void 0;
|
|
924
|
+
const saved = readMachineIdFile(opts.filePath);
|
|
925
|
+
if (saved) return saved;
|
|
926
|
+
const derived = opts.derive();
|
|
927
|
+
if (!derived) return void 0;
|
|
928
|
+
try {
|
|
929
|
+
fs3.mkdirSync(path2.dirname(opts.filePath), { recursive: true });
|
|
930
|
+
fs3.writeFileSync(opts.filePath, `${derived}
|
|
931
|
+
`, { flag: "wx" });
|
|
932
|
+
return derived;
|
|
933
|
+
} catch {
|
|
934
|
+
return readMachineIdFile(opts.filePath) ?? derived;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function readMachineIdFile(filePath) {
|
|
938
|
+
try {
|
|
939
|
+
const value = fs3.readFileSync(filePath, "utf8").trim().toLowerCase();
|
|
940
|
+
return ANON_ID_PATTERN.test(value) ? value : void 0;
|
|
941
|
+
} catch {
|
|
942
|
+
return void 0;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
914
945
|
function firstNonInternalMac() {
|
|
915
946
|
try {
|
|
916
947
|
const interfaces = os2.networkInterfaces();
|
|
@@ -1718,12 +1749,12 @@ var GoogleAdsClient = class {
|
|
|
1718
1749
|
}
|
|
1719
1750
|
};
|
|
1720
1751
|
}
|
|
1721
|
-
async #requestJson(operation,
|
|
1752
|
+
async #requestJson(operation, path12, init, includeLoginCustomerId) {
|
|
1722
1753
|
const maxRetries = this.#retry.maxRetries ?? GOOGLE_ADS_MAX_RETRIES;
|
|
1723
1754
|
const baseDelayMs = this.#retry.baseDelayMs ?? GOOGLE_ADS_RETRY_BASE_DELAY_MS;
|
|
1724
1755
|
const maxDelayMs = this.#retry.maxDelayMs ?? GOOGLE_ADS_RETRY_MAX_DELAY_MS;
|
|
1725
1756
|
return withRetry(
|
|
1726
|
-
() => this.#requestJsonOnce(operation,
|
|
1757
|
+
() => this.#requestJsonOnce(operation, path12, init, includeLoginCustomerId),
|
|
1727
1758
|
{
|
|
1728
1759
|
maxRetries,
|
|
1729
1760
|
baseDelayMs,
|
|
@@ -1735,7 +1766,7 @@ var GoogleAdsClient = class {
|
|
|
1735
1766
|
}
|
|
1736
1767
|
);
|
|
1737
1768
|
}
|
|
1738
|
-
async #requestJsonOnce(operation,
|
|
1769
|
+
async #requestJsonOnce(operation, path12, init, includeLoginCustomerId) {
|
|
1739
1770
|
const headers = {
|
|
1740
1771
|
Authorization: `Bearer ${this.#accessToken}`,
|
|
1741
1772
|
"Content-Type": "application/json",
|
|
@@ -1744,7 +1775,7 @@ var GoogleAdsClient = class {
|
|
|
1744
1775
|
if (includeLoginCustomerId && this.#loginCustomerId) {
|
|
1745
1776
|
headers["login-customer-id"] = this.#loginCustomerId;
|
|
1746
1777
|
}
|
|
1747
|
-
const url = `${GOOGLE_ADS_API_BASE}${
|
|
1778
|
+
const url = `${GOOGLE_ADS_API_BASE}${path12}`;
|
|
1748
1779
|
let response;
|
|
1749
1780
|
try {
|
|
1750
1781
|
response = await this.#fetch(url, {
|
|
@@ -2137,24 +2168,24 @@ function assertAccessToken(accessToken) {
|
|
|
2137
2168
|
throw new GtmApiError("OAuth access token is required", 400, { reason: "INVALID_ACCESS_TOKEN" });
|
|
2138
2169
|
}
|
|
2139
2170
|
}
|
|
2140
|
-
function assertPath(
|
|
2141
|
-
if (!PATH_PATTERNS[kind].test(
|
|
2171
|
+
function assertPath(path12, kind) {
|
|
2172
|
+
if (!PATH_PATTERNS[kind].test(path12)) {
|
|
2142
2173
|
throw new GtmApiError(`Invalid Tag Manager ${kind} resource path`, 400, {
|
|
2143
2174
|
reason: "INVALID_RESOURCE_PATH"
|
|
2144
2175
|
});
|
|
2145
2176
|
}
|
|
2146
2177
|
}
|
|
2147
|
-
function apiUrl(
|
|
2148
|
-
const url = new URL(`${GTM_API_BASE}/${
|
|
2178
|
+
function apiUrl(path12, pageToken) {
|
|
2179
|
+
const url = new URL(`${GTM_API_BASE}/${path12}`);
|
|
2149
2180
|
if (pageToken !== void 0) url.searchParams.set("pageToken", pageToken);
|
|
2150
2181
|
return url.toString();
|
|
2151
2182
|
}
|
|
2152
|
-
async function listCollection(accessToken,
|
|
2183
|
+
async function listCollection(accessToken, path12, responseKey, options) {
|
|
2153
2184
|
const collected = [];
|
|
2154
2185
|
const seenTokens = /* @__PURE__ */ new Set();
|
|
2155
2186
|
let pageToken;
|
|
2156
2187
|
for (let page = 0; page < GTM_MAX_PAGES; page++) {
|
|
2157
|
-
const response = await gtmFetchGet(apiUrl(
|
|
2188
|
+
const response = await gtmFetchGet(apiUrl(path12, pageToken), accessToken, options);
|
|
2158
2189
|
const values = response[responseKey];
|
|
2159
2190
|
if (values !== void 0 && !Array.isArray(values)) {
|
|
2160
2191
|
throw new GtmApiError(`Tag Manager returned an invalid ${responseKey} list`, 502, {
|
|
@@ -2449,8 +2480,8 @@ function required(value, label) {
|
|
|
2449
2480
|
}
|
|
2450
2481
|
return value;
|
|
2451
2482
|
}
|
|
2452
|
-
function finalPathSegment(
|
|
2453
|
-
return
|
|
2483
|
+
function finalPathSegment(path12) {
|
|
2484
|
+
return path12?.split("/").filter(Boolean).at(-1);
|
|
2454
2485
|
}
|
|
2455
2486
|
function uniqueStrings(values) {
|
|
2456
2487
|
return [...new Set(values.filter((value) => typeof value === "string"))].sort();
|
|
@@ -3708,8 +3739,8 @@ function createGoogleMarketingRuntime(options) {
|
|
|
3708
3739
|
// src/server.ts
|
|
3709
3740
|
import { createRequire as createRequire4 } from "module";
|
|
3710
3741
|
import crypto29 from "crypto";
|
|
3711
|
-
import
|
|
3712
|
-
import
|
|
3742
|
+
import fs12 from "fs";
|
|
3743
|
+
import path11 from "path";
|
|
3713
3744
|
import { isIP } from "net";
|
|
3714
3745
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3715
3746
|
import { setImmediate as yieldToEventLoop4 } from "timers/promises";
|
|
@@ -3928,8 +3959,8 @@ import { createHash as createHash3, randomUUID } from "crypto";
|
|
|
3928
3959
|
import { and, asc, eq, gt } from "drizzle-orm";
|
|
3929
3960
|
|
|
3930
3961
|
// src/outcome-telemetry.ts
|
|
3931
|
-
import
|
|
3932
|
-
import
|
|
3962
|
+
import fs4 from "fs";
|
|
3963
|
+
import path3 from "path";
|
|
3933
3964
|
|
|
3934
3965
|
// src/usage-telemetry.ts
|
|
3935
3966
|
var API_REQUEST_BUCKET_CAPACITY = 20;
|
|
@@ -4042,11 +4073,11 @@ var claimed = /* @__PURE__ */ new Set();
|
|
|
4042
4073
|
function isFirstSuccess(key) {
|
|
4043
4074
|
try {
|
|
4044
4075
|
if (!isTelemetryEnabled() || claimed.has(key)) return false;
|
|
4045
|
-
const dir =
|
|
4046
|
-
|
|
4076
|
+
const dir = path3.join(getConfigDir(), MILESTONES_DIR);
|
|
4077
|
+
fs4.mkdirSync(dir, { recursive: true });
|
|
4047
4078
|
const name = key.replace(/[^\w.-]/g, (c) => `~${c.charCodeAt(0).toString(16)}`);
|
|
4048
4079
|
claimed.add(key);
|
|
4049
|
-
|
|
4080
|
+
fs4.closeSync(fs4.openSync(path3.join(dir, name), "wx"));
|
|
4050
4081
|
return true;
|
|
4051
4082
|
} catch {
|
|
4052
4083
|
return false;
|
|
@@ -4390,11 +4421,11 @@ function createSentimentPoller(tick, onError, schedule = setImmediate) {
|
|
|
4390
4421
|
}
|
|
4391
4422
|
|
|
4392
4423
|
// src/sentiment-config.ts
|
|
4393
|
-
import
|
|
4424
|
+
import fs5 from "fs";
|
|
4394
4425
|
import { parse } from "yaml";
|
|
4395
4426
|
function loadSentimentInstallConfig() {
|
|
4396
4427
|
try {
|
|
4397
|
-
const document = parse(
|
|
4428
|
+
const document = parse(fs5.readFileSync(getConfigPath(), "utf8"));
|
|
4398
4429
|
const sentiment = isRecord(document) ? document.sentiment : void 0;
|
|
4399
4430
|
if (!isRecord(document) || sentiment != null && !isRecord(sentiment)) return invalidSentimentInstallConfig();
|
|
4400
4431
|
return resolveSentimentInstallConfig(process.env, sentiment ?? void 0);
|
|
@@ -6439,7 +6470,7 @@ var localAdapter = {
|
|
|
6439
6470
|
};
|
|
6440
6471
|
|
|
6441
6472
|
// ../provider-cdp/src/adapter.ts
|
|
6442
|
-
import
|
|
6473
|
+
import path5 from "path";
|
|
6443
6474
|
import os3 from "os";
|
|
6444
6475
|
|
|
6445
6476
|
// ../provider-cdp/src/connection.ts
|
|
@@ -6810,12 +6841,12 @@ function sleep2(ms) {
|
|
|
6810
6841
|
}
|
|
6811
6842
|
|
|
6812
6843
|
// ../provider-cdp/src/screenshot.ts
|
|
6813
|
-
import
|
|
6814
|
-
import
|
|
6844
|
+
import fs6 from "fs";
|
|
6845
|
+
import path4 from "path";
|
|
6815
6846
|
async function captureElementScreenshot(client, selector, outputPath) {
|
|
6816
|
-
const dir =
|
|
6817
|
-
if (!
|
|
6818
|
-
|
|
6847
|
+
const dir = path4.dirname(outputPath);
|
|
6848
|
+
if (!fs6.existsSync(dir)) {
|
|
6849
|
+
fs6.mkdirSync(dir, { recursive: true });
|
|
6819
6850
|
}
|
|
6820
6851
|
let clip;
|
|
6821
6852
|
try {
|
|
@@ -6849,7 +6880,7 @@ async function captureElementScreenshot(client, selector, outputPath) {
|
|
|
6849
6880
|
}
|
|
6850
6881
|
const { data } = await client.Page.captureScreenshot(screenshotParams);
|
|
6851
6882
|
const buffer = Buffer.from(data, "base64");
|
|
6852
|
-
|
|
6883
|
+
fs6.writeFileSync(outputPath, buffer);
|
|
6853
6884
|
return outputPath;
|
|
6854
6885
|
}
|
|
6855
6886
|
|
|
@@ -6905,7 +6936,7 @@ function getConnection(config) {
|
|
|
6905
6936
|
return conn;
|
|
6906
6937
|
}
|
|
6907
6938
|
function getScreenshotDir() {
|
|
6908
|
-
return
|
|
6939
|
+
return path5.join(os3.homedir(), ".canonry", "screenshots");
|
|
6909
6940
|
}
|
|
6910
6941
|
var cdpChatgptAdapter = {
|
|
6911
6942
|
name: "cdp:chatgpt",
|
|
@@ -6972,7 +7003,7 @@ var cdpChatgptAdapter = {
|
|
|
6972
7003
|
const answerText = await target.extractAnswer(client);
|
|
6973
7004
|
const groundingSources = await target.extractCitations(client);
|
|
6974
7005
|
const screenshotId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
6975
|
-
const screenshotPath =
|
|
7006
|
+
const screenshotPath = path5.join(getScreenshotDir(), `${screenshotId}.png`);
|
|
6976
7007
|
let capturedScreenshotPath;
|
|
6977
7008
|
try {
|
|
6978
7009
|
capturedScreenshotPath = await captureElementScreenshot(
|
|
@@ -8625,7 +8656,7 @@ function nonBlank(value) {
|
|
|
8625
8656
|
return trimmed ? trimmed : void 0;
|
|
8626
8657
|
}
|
|
8627
8658
|
function resolveBuildCommit(env = process.env) {
|
|
8628
|
-
const embedded = true ? "
|
|
8659
|
+
const embedded = true ? "84cfd30ddb3e7f6bad53baa986bab845144e497f" : void 0;
|
|
8629
8660
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
8630
8661
|
}
|
|
8631
8662
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -8637,8 +8668,8 @@ function resolveInstanceIdentity(env = process.env) {
|
|
|
8637
8668
|
|
|
8638
8669
|
// src/job-runner.ts
|
|
8639
8670
|
import crypto7 from "crypto";
|
|
8640
|
-
import
|
|
8641
|
-
import
|
|
8671
|
+
import fs7 from "fs";
|
|
8672
|
+
import path6 from "path";
|
|
8642
8673
|
import os4 from "os";
|
|
8643
8674
|
import { setImmediate as yieldToEventLoop } from "timers/promises";
|
|
8644
8675
|
import { and as and3, asc as asc2, count, desc, eq as eq3, inArray, isNotNull, isNull, lt, ne, sql as sql2 } from "drizzle-orm";
|
|
@@ -9542,12 +9573,12 @@ var JobRunner = class {
|
|
|
9542
9573
|
);
|
|
9543
9574
|
const answerLocation = runLocation && isSearchLocationIgnored(providerName, normalized.retrievalStatus) ? { location: null, requestedContext: runLocation, supportedContext: { status: "ignored" } } : { location: runLocation?.label ?? null };
|
|
9544
9575
|
let screenshotRelPath = null;
|
|
9545
|
-
if (raw.screenshotPath &&
|
|
9576
|
+
if (raw.screenshotPath && fs7.existsSync(raw.screenshotPath)) {
|
|
9546
9577
|
const snapshotId = crypto7.randomUUID();
|
|
9547
|
-
const screenshotDir =
|
|
9548
|
-
if (!
|
|
9549
|
-
const destPath =
|
|
9550
|
-
|
|
9578
|
+
const screenshotDir = path6.join(os4.homedir(), ".canonry", "screenshots", runId);
|
|
9579
|
+
if (!fs7.existsSync(screenshotDir)) fs7.mkdirSync(screenshotDir, { recursive: true });
|
|
9580
|
+
const destPath = path6.join(screenshotDir, `${snapshotId}.png`);
|
|
9581
|
+
fs7.renameSync(raw.screenshotPath, destPath);
|
|
9551
9582
|
screenshotRelPath = `${runId}/${snapshotId}.png`;
|
|
9552
9583
|
this.db.insert(querySnapshots).values({
|
|
9553
9584
|
id: snapshotId,
|
|
@@ -10896,11 +10927,11 @@ var JobRunner = class {
|
|
|
10896
10927
|
const answerContext = supportedContext && isSearchLocationIgnored(providerName, normalized.retrievalStatus) ? { status: "ignored" } : supportedContext;
|
|
10897
10928
|
const snapshotId = crypto7.randomUUID();
|
|
10898
10929
|
let screenshotRelPath = null;
|
|
10899
|
-
if (raw.screenshotPath &&
|
|
10900
|
-
const screenshotDir =
|
|
10901
|
-
if (!
|
|
10902
|
-
const destPath =
|
|
10903
|
-
|
|
10930
|
+
if (raw.screenshotPath && fs7.existsSync(raw.screenshotPath)) {
|
|
10931
|
+
const screenshotDir = path6.join(os4.homedir(), ".canonry", "screenshots", ctx.runId);
|
|
10932
|
+
if (!fs7.existsSync(screenshotDir)) fs7.mkdirSync(screenshotDir, { recursive: true });
|
|
10933
|
+
const destPath = path6.join(screenshotDir, `${snapshotId}.png`);
|
|
10934
|
+
fs7.renameSync(raw.screenshotPath, destPath);
|
|
10904
10935
|
screenshotRelPath = `${ctx.runId}/${snapshotId}.png`;
|
|
10905
10936
|
}
|
|
10906
10937
|
const snapshot = {
|
|
@@ -12388,12 +12419,12 @@ function adsClientLog(level, action, ctx) {
|
|
|
12388
12419
|
const stream = level === "error" ? process.stderr : process.stdout;
|
|
12389
12420
|
stream.write(JSON.stringify(entry) + "\n");
|
|
12390
12421
|
}
|
|
12391
|
-
function buildUrl(
|
|
12422
|
+
function buildUrl(path12, queryPairs) {
|
|
12392
12423
|
const qs = queryPairs.join("&");
|
|
12393
|
-
return qs ? `${OPENAI_ADS_API_BASE}/${
|
|
12424
|
+
return qs ? `${OPENAI_ADS_API_BASE}/${path12}?${qs}` : `${OPENAI_ADS_API_BASE}/${path12}`;
|
|
12394
12425
|
}
|
|
12395
|
-
async function adsFetch(apiKey,
|
|
12396
|
-
const url = buildUrl(
|
|
12426
|
+
async function adsFetch(apiKey, path12, queryPairs = [], method = "GET", body) {
|
|
12427
|
+
const url = buildUrl(path12, queryPairs);
|
|
12397
12428
|
let res;
|
|
12398
12429
|
try {
|
|
12399
12430
|
res = await fetch(url, {
|
|
@@ -12410,18 +12441,18 @@ async function adsFetch(apiKey, path11, queryPairs = [], method = "GET", body) {
|
|
|
12410
12441
|
}
|
|
12411
12442
|
if (res.status === 401 || res.status === 403) {
|
|
12412
12443
|
const { code } = parseErrorEnvelope(await res.text());
|
|
12413
|
-
adsClientLog("error", "http.auth-failed", { path:
|
|
12444
|
+
adsClientLog("error", "http.auth-failed", { path: path12, httpStatus: res.status, code });
|
|
12414
12445
|
throw new OpenAiAdsApiError("OpenAI Ads API key is invalid or unauthorized", res.status, code);
|
|
12415
12446
|
}
|
|
12416
12447
|
if (res.status === 429) {
|
|
12417
12448
|
const { code } = parseErrorEnvelope(await res.text());
|
|
12418
|
-
adsClientLog("error", "http.rate-limited", { path:
|
|
12449
|
+
adsClientLog("error", "http.rate-limited", { path: path12, httpStatus: 429, code });
|
|
12419
12450
|
throw new OpenAiAdsApiError("OpenAI Ads API rate limit exceeded", 429, code);
|
|
12420
12451
|
}
|
|
12421
12452
|
if (!res.ok) {
|
|
12422
12453
|
const body2 = await res.text();
|
|
12423
12454
|
const { message, code } = parseErrorEnvelope(body2);
|
|
12424
|
-
adsClientLog("error", "http.error", { path:
|
|
12455
|
+
adsClientLog("error", "http.error", { path: path12, httpStatus: res.status, code });
|
|
12425
12456
|
const detail = message ?? (body2.length <= 500 ? body2 : `${body2.slice(0, 500)}... [truncated]`);
|
|
12426
12457
|
throw new OpenAiAdsApiError(`OpenAI Ads API error (${res.status}): ${detail}`, res.status, code);
|
|
12427
12458
|
}
|
|
@@ -12432,12 +12463,12 @@ async function adsFetch(apiKey, path11, queryPairs = [], method = "GET", body) {
|
|
|
12432
12463
|
throw new OpenAiAdsApiError("OpenAI Ads API returned invalid JSON", 502);
|
|
12433
12464
|
}
|
|
12434
12465
|
}
|
|
12435
|
-
async function fetchAllPages(apiKey,
|
|
12466
|
+
async function fetchAllPages(apiKey, path12, queryPairs, maxPages = OPENAI_ADS_MAX_PAGES) {
|
|
12436
12467
|
const items = [];
|
|
12437
12468
|
let after = null;
|
|
12438
12469
|
for (let page = 0; page < maxPages; page++) {
|
|
12439
12470
|
const pairs = after ? [...queryPairs, `after=${encodeURIComponent(after)}`] : [...queryPairs];
|
|
12440
|
-
const response = await adsFetch(apiKey,
|
|
12471
|
+
const response = await adsFetch(apiKey, path12, pairs);
|
|
12441
12472
|
items.push(...response.data);
|
|
12442
12473
|
if (!response.has_more || !response.last_id) {
|
|
12443
12474
|
return items;
|
|
@@ -12445,7 +12476,7 @@ async function fetchAllPages(apiKey, path11, queryPairs, maxPages = OPENAI_ADS_M
|
|
|
12445
12476
|
after = response.last_id;
|
|
12446
12477
|
}
|
|
12447
12478
|
if (maxPages < OPENAI_ADS_MAX_PAGES) return items;
|
|
12448
|
-
adsClientLog("error", "pagination.cap-reached", { path:
|
|
12479
|
+
adsClientLog("error", "pagination.cap-reached", { path: path12, pages: OPENAI_ADS_MAX_PAGES, items: items.length });
|
|
12449
12480
|
throw new OpenAiAdsApiError(
|
|
12450
12481
|
`OpenAI Ads API collection remained incomplete after the ${OPENAI_ADS_MAX_PAGES}-page safety cap`,
|
|
12451
12482
|
502,
|
|
@@ -13643,7 +13674,7 @@ async function maybeRefreshGscCoverage(db, config, projectId, deps = defaultDeps
|
|
|
13643
13674
|
|
|
13644
13675
|
// src/commoncrawl-sync.ts
|
|
13645
13676
|
import crypto17 from "crypto";
|
|
13646
|
-
import
|
|
13677
|
+
import path7 from "path";
|
|
13647
13678
|
import { and as and10, eq as eq13, sql as sql5 } from "drizzle-orm";
|
|
13648
13679
|
var log11 = createLogger("CommonCrawlSync");
|
|
13649
13680
|
var INSERT_CHUNK_SIZE = 1e4;
|
|
@@ -13671,6 +13702,7 @@ async function executeReleaseSync(db, syncId, opts) {
|
|
|
13671
13702
|
invalidRelease = true;
|
|
13672
13703
|
throw new Error(`Invalid release id: ${release}`);
|
|
13673
13704
|
}
|
|
13705
|
+
if (db.select({ id: projects.id }).from(projects).limit(1).get()) deps.loadDuckdb();
|
|
13674
13706
|
const downloadStartedAt = deps.now().toISOString();
|
|
13675
13707
|
db.update(ccReleaseSyncs).set({
|
|
13676
13708
|
status: CcReleaseSyncStatuses.downloading,
|
|
@@ -13680,9 +13712,9 @@ async function executeReleaseSync(db, syncId, opts) {
|
|
|
13680
13712
|
error: null
|
|
13681
13713
|
}).where(eq13(ccReleaseSyncs.id, syncId)).run();
|
|
13682
13714
|
const paths = ccReleasePaths(release);
|
|
13683
|
-
const releaseCacheDir =
|
|
13684
|
-
const vertexPath =
|
|
13685
|
-
const edgesPath =
|
|
13715
|
+
const releaseCacheDir = path7.join(deps.cacheDir, release);
|
|
13716
|
+
const vertexPath = path7.join(releaseCacheDir, paths.vertexFilename);
|
|
13717
|
+
const edgesPath = path7.join(releaseCacheDir, paths.edgesFilename);
|
|
13686
13718
|
const [vertex, edges] = await Promise.all([
|
|
13687
13719
|
deps.downloadFile({ url: paths.vertexUrl, destPath: vertexPath }),
|
|
13688
13720
|
deps.downloadFile({ url: paths.edgesUrl, destPath: edgesPath })
|
|
@@ -13820,11 +13852,14 @@ async function executeReleaseSync(db, syncId, opts) {
|
|
|
13820
13852
|
...outcome,
|
|
13821
13853
|
status: OutcomeStatuses.failed,
|
|
13822
13854
|
durationBucket: elapsed(),
|
|
13823
|
-
...outcomeFailure(err, invalidRelease ? OutcomeReasonCodes.VALIDATION : void 0)
|
|
13855
|
+
...outcomeFailure(err, invalidRelease ? OutcomeReasonCodes.VALIDATION : isMissingDependency(err) ? OutcomeReasonCodes.NOT_CONNECTED : void 0)
|
|
13824
13856
|
});
|
|
13825
13857
|
throw err;
|
|
13826
13858
|
}
|
|
13827
13859
|
}
|
|
13860
|
+
function isMissingDependency(err) {
|
|
13861
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === "MISSING_DEPENDENCY";
|
|
13862
|
+
}
|
|
13828
13863
|
async function syncLatestReleaseOnSchedule(projectName, deps) {
|
|
13829
13864
|
const elapsed = startOutcomeTimer();
|
|
13830
13865
|
const report = (outcome) => trackFeatureCompleted({
|
|
@@ -13855,8 +13890,7 @@ async function syncLatestReleaseOnSchedule(projectName, deps) {
|
|
|
13855
13890
|
await deps.requestSync(probed.release);
|
|
13856
13891
|
} catch (err) {
|
|
13857
13892
|
deps.log.error({ projectName, release: probed.release, err: describeError(err) }, "Scheduled backlinks sync failed");
|
|
13858
|
-
|
|
13859
|
-
report({ status: OutcomeStatuses.failed, ...outcomeFailure(err, missingPlugin ? OutcomeReasonCodes.NOT_CONNECTED : void 0) });
|
|
13893
|
+
report({ status: OutcomeStatuses.failed, ...outcomeFailure(err, isMissingDependency(err) ? OutcomeReasonCodes.NOT_CONNECTED : void 0) });
|
|
13860
13894
|
} finally {
|
|
13861
13895
|
deps.scheduledReleases.delete(probed.release);
|
|
13862
13896
|
}
|
|
@@ -13877,7 +13911,7 @@ function groupByProject(rows, projectsByDomain) {
|
|
|
13877
13911
|
|
|
13878
13912
|
// src/backlink-extract.ts
|
|
13879
13913
|
import crypto18 from "crypto";
|
|
13880
|
-
import
|
|
13914
|
+
import fs8 from "fs";
|
|
13881
13915
|
import { and as and11, desc as desc7, eq as eq14 } from "drizzle-orm";
|
|
13882
13916
|
var log12 = createLogger("BacklinkExtract");
|
|
13883
13917
|
function defaultDeps3() {
|
|
@@ -13910,7 +13944,7 @@ async function executeBacklinkExtract(db, runId, projectId, opts = {}) {
|
|
|
13910
13944
|
if (!sync.vertexPath || !sync.edgesPath) {
|
|
13911
13945
|
throw new Error(`Release ${sync.release} is missing cached file paths`);
|
|
13912
13946
|
}
|
|
13913
|
-
if (!
|
|
13947
|
+
if (!fs8.existsSync(sync.vertexPath) || !fs8.existsSync(sync.edgesPath)) {
|
|
13914
13948
|
throw new Error(
|
|
13915
13949
|
`Cache for release ${sync.release} is missing from disk (expected at ${sync.vertexPath}). The sync record exists in the database, but the ~16 GB dump was deleted or never present on this machine. Re-sync this release from the Backlinks admin page to restore the cache.`
|
|
13916
13950
|
);
|
|
@@ -14777,9 +14811,9 @@ function pagePath(page) {
|
|
|
14777
14811
|
}
|
|
14778
14812
|
}
|
|
14779
14813
|
function parentPath(page) {
|
|
14780
|
-
const
|
|
14781
|
-
if (
|
|
14782
|
-
const trimmed =
|
|
14814
|
+
const path12 = pagePath(page);
|
|
14815
|
+
if (path12 === "/") return "/";
|
|
14816
|
+
const trimmed = path12.endsWith("/") ? path12.slice(0, -1) : path12;
|
|
14783
14817
|
const slash = trimmed.lastIndexOf("/");
|
|
14784
14818
|
return slash <= 0 ? "/" : trimmed.slice(0, slash) || "/";
|
|
14785
14819
|
}
|
|
@@ -15683,31 +15717,31 @@ function recordLlmUsageEvent(args) {
|
|
|
15683
15717
|
}
|
|
15684
15718
|
|
|
15685
15719
|
// src/agent/session.ts
|
|
15686
|
-
import
|
|
15687
|
-
import
|
|
15720
|
+
import fs11 from "fs";
|
|
15721
|
+
import path10 from "path";
|
|
15688
15722
|
import { Agent } from "@earendil-works/pi-agent-core";
|
|
15689
15723
|
|
|
15690
15724
|
// src/agent/skill-paths.ts
|
|
15691
|
-
import
|
|
15692
|
-
import
|
|
15725
|
+
import fs9 from "fs";
|
|
15726
|
+
import path8 from "path";
|
|
15693
15727
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
15694
15728
|
function resolveAeroSkillDir(pkgDir) {
|
|
15695
|
-
const here = pkgDir ??
|
|
15729
|
+
const here = pkgDir ?? path8.dirname(fileURLToPath2(import.meta.url));
|
|
15696
15730
|
const candidates = [
|
|
15697
|
-
|
|
15698
|
-
|
|
15699
|
-
|
|
15731
|
+
path8.join(here, "../assets/agent-workspace/skills/aero"),
|
|
15732
|
+
path8.join(here, "../../assets/agent-workspace/skills/aero"),
|
|
15733
|
+
path8.join(here, "../../../../skills/aero")
|
|
15700
15734
|
];
|
|
15701
15735
|
for (const candidate of candidates) {
|
|
15702
|
-
if (
|
|
15736
|
+
if (fs9.existsSync(path8.join(candidate, "SKILL.md"))) return candidate;
|
|
15703
15737
|
}
|
|
15704
15738
|
throw new Error(`Aero skill not found. Searched:
|
|
15705
15739
|
${candidates.join("\n ")}`);
|
|
15706
15740
|
}
|
|
15707
15741
|
|
|
15708
15742
|
// src/agent/skill-tools.ts
|
|
15709
|
-
import
|
|
15710
|
-
import
|
|
15743
|
+
import fs10 from "fs";
|
|
15744
|
+
import path9 from "path";
|
|
15711
15745
|
import { Type } from "@earendil-works/pi-ai";
|
|
15712
15746
|
var MAX_DOC_CHARS = 2e4;
|
|
15713
15747
|
function textResult(details) {
|
|
@@ -15728,13 +15762,13 @@ function parseDescription(body) {
|
|
|
15728
15762
|
return "(no description)";
|
|
15729
15763
|
}
|
|
15730
15764
|
function scanSkillDocs(skillDir) {
|
|
15731
|
-
const refsDir =
|
|
15732
|
-
if (!
|
|
15765
|
+
const refsDir = path9.join(skillDir ?? resolveAeroSkillDir(), "references");
|
|
15766
|
+
if (!fs10.existsSync(refsDir)) return [];
|
|
15733
15767
|
const entries = [];
|
|
15734
|
-
for (const file of
|
|
15768
|
+
for (const file of fs10.readdirSync(refsDir)) {
|
|
15735
15769
|
if (!file.endsWith(".md")) continue;
|
|
15736
|
-
const filePath =
|
|
15737
|
-
const body =
|
|
15770
|
+
const filePath = path9.join(refsDir, file);
|
|
15771
|
+
const body = fs10.readFileSync(filePath, "utf-8");
|
|
15738
15772
|
entries.push({
|
|
15739
15773
|
slug: file.replace(/\.md$/, ""),
|
|
15740
15774
|
description: parseDescription(body),
|
|
@@ -15777,8 +15811,8 @@ function buildReadSkillDocTool() {
|
|
|
15777
15811
|
availableSlugs: docs.map((d) => d.slug)
|
|
15778
15812
|
});
|
|
15779
15813
|
}
|
|
15780
|
-
const filePath =
|
|
15781
|
-
const content =
|
|
15814
|
+
const filePath = path9.join(skillDir, "references", `${match.slug}.md`);
|
|
15815
|
+
const content = fs10.readFileSync(filePath, "utf-8");
|
|
15782
15816
|
if (content.length > MAX_DOC_CHARS) {
|
|
15783
15817
|
return textResult({
|
|
15784
15818
|
slug: match.slug,
|
|
@@ -15923,10 +15957,10 @@ function isRecord8(value) {
|
|
|
15923
15957
|
}
|
|
15924
15958
|
function keptSummary(counts, cursors = {}) {
|
|
15925
15959
|
const summary = { droppedKeys: [], keptItems: {} };
|
|
15926
|
-
for (const [
|
|
15960
|
+
for (const [path12, { kept, total }] of counts) {
|
|
15927
15961
|
if (kept >= total) continue;
|
|
15928
|
-
if (kept === 0) summary.droppedKeys.push(
|
|
15929
|
-
summary.keptItems[
|
|
15962
|
+
if (kept === 0) summary.droppedKeys.push(path12);
|
|
15963
|
+
summary.keptItems[path12] = `${kept} of ${total}`;
|
|
15930
15964
|
}
|
|
15931
15965
|
if (Object.keys(cursors).length > 0) summary.cursors = cursors;
|
|
15932
15966
|
return summary;
|
|
@@ -15989,7 +16023,7 @@ function bareTotal(numbers) {
|
|
|
15989
16023
|
}
|
|
15990
16024
|
function partialLists(root) {
|
|
15991
16025
|
const notes = [];
|
|
15992
|
-
const visit = (object,
|
|
16026
|
+
const visit = (object, path12, depth) => {
|
|
15993
16027
|
const lists = [];
|
|
15994
16028
|
const numbers = [];
|
|
15995
16029
|
for (const [key, value] of Object.entries(object)) {
|
|
@@ -15999,16 +16033,16 @@ function partialLists(root) {
|
|
|
15999
16033
|
}
|
|
16000
16034
|
let noted = false;
|
|
16001
16035
|
if (lists.length <= MAX_SUMMARY_KEYS) {
|
|
16002
|
-
const counts = lists.map(([key]) => ownListTotal(numbers, key) ?? cursorForList(object,
|
|
16036
|
+
const counts = lists.map(([key]) => ownListTotal(numbers, key) ?? cursorForList(object, path12, key, root)?.total);
|
|
16003
16037
|
const uncounted = counts.flatMap((count4, index) => count4 ? [] : [index]);
|
|
16004
16038
|
if (uncounted.length === 1) {
|
|
16005
16039
|
const index = uncounted[0];
|
|
16006
16040
|
const key = lists[index][0];
|
|
16007
|
-
const paged = object === root || cursorForList(object,
|
|
16041
|
+
const paged = object === root || cursorForList(object, path12, key, root) || typeof object.truncated === "boolean" || typeof object[`${key}Truncated`] === "boolean" || ["items", "rows", "results"].includes(key);
|
|
16008
16042
|
if (paged) counts[index] = bareTotal(numbers);
|
|
16009
16043
|
}
|
|
16010
16044
|
for (const [index, [key, rows]] of lists.entries()) {
|
|
16011
|
-
const label =
|
|
16045
|
+
const label = path12 ? `${path12}.${key}` : key;
|
|
16012
16046
|
const count4 = counts[index];
|
|
16013
16047
|
const ownFlag = object[`${key}Truncated`];
|
|
16014
16048
|
if (count4) {
|
|
@@ -16021,10 +16055,10 @@ function partialLists(root) {
|
|
|
16021
16055
|
}
|
|
16022
16056
|
}
|
|
16023
16057
|
}
|
|
16024
|
-
if (object.truncated === true && !noted) notes.push([
|
|
16058
|
+
if (object.truncated === true && !noted) notes.push([path12 || "(root)", "the tool cut the lists here"]);
|
|
16025
16059
|
if (depth >= MAX_PARTIAL_DEPTH || notes.length >= MAX_PARTIAL_NOTES) return;
|
|
16026
16060
|
for (const [key, value] of Object.entries(object)) {
|
|
16027
|
-
if (!key.startsWith("__") && isRecord8(value)) visit(value,
|
|
16061
|
+
if (!key.startsWith("__") && isRecord8(value)) visit(value, path12 ? `${path12}.${key}` : key, depth + 1);
|
|
16028
16062
|
}
|
|
16029
16063
|
};
|
|
16030
16064
|
visit(root, "", 1);
|
|
@@ -16036,19 +16070,19 @@ function withPartialLists(value) {
|
|
|
16036
16070
|
const notes = partialLists(value);
|
|
16037
16071
|
if (!notes && !hadNote && value.nextAttemptCursor == null && !CURSOR_KEYS.some((key) => value[key] !== void 0 && value[key] !== null) && !Object.values(value).some((child) => isRecord8(child) && CURSOR_KEYS.some((key) => child[key] !== void 0 && child[key] !== null))) return value;
|
|
16038
16072
|
const pagination = {};
|
|
16039
|
-
const visit = (owner,
|
|
16073
|
+
const visit = (owner, path12, depth) => {
|
|
16040
16074
|
const lists = Object.entries(owner).filter((entry) => Array.isArray(entry[1]));
|
|
16041
16075
|
const numbers = Object.entries(owner).filter((entry) => typeof entry[1] === "number");
|
|
16042
16076
|
for (const [key, rows] of lists) {
|
|
16043
|
-
const cursor = cursorForList(owner,
|
|
16077
|
+
const cursor = cursorForList(owner, path12, key, value);
|
|
16044
16078
|
if (!cursor || key.startsWith("__") || Object.keys(pagination).length >= MAX_PARTIAL_NOTES) continue;
|
|
16045
|
-
const label =
|
|
16079
|
+
const label = path12 ? `${path12}.${key}` : key;
|
|
16046
16080
|
const total = cursor.total ?? ownListTotal(numbers, key) ?? (lists.length === 1 ? bareTotal(numbers) : void 0);
|
|
16047
16081
|
const incomplete = owner.__truncated === true || isRecord8(owner.__omittedRowsByField) && typeof owner.__omittedRowsByField[key] === "number";
|
|
16048
16082
|
pagination[label] = `showing ${rows.length}${total ? ` of ${total.text}` : " rows"}; ${incomplete ? `incomplete page: re-request the original cursor with a smaller ${cursor.limit}; the next cursor skips omitted rows` : `pass ${cursor.parameter} ${JSON.stringify(cursor.value)}`}`;
|
|
16049
16083
|
}
|
|
16050
16084
|
if (depth >= MAX_PARTIAL_DEPTH) return;
|
|
16051
|
-
for (const [key, child] of Object.entries(owner)) if (!key.startsWith("__") && isRecord8(child)) visit(child,
|
|
16085
|
+
for (const [key, child] of Object.entries(owner)) if (!key.startsWith("__") && isRecord8(child)) visit(child, path12 ? `${path12}.${key}` : key, depth + 1);
|
|
16052
16086
|
};
|
|
16053
16087
|
visit(value, "", 1);
|
|
16054
16088
|
const { [PARTIAL_LISTS_KEY]: _previous, __pagination: _pagination, ...rest } = value;
|
|
@@ -16130,10 +16164,10 @@ function listTrimmer(lists) {
|
|
|
16130
16164
|
}
|
|
16131
16165
|
function collectCollections(root) {
|
|
16132
16166
|
const found = [];
|
|
16133
|
-
const visit = (object,
|
|
16167
|
+
const visit = (object, path12, nested) => {
|
|
16134
16168
|
for (const [key, value] of Object.entries(object)) {
|
|
16135
16169
|
if (object === root && (key === TRUNCATION_SUMMARY_KEY || key === PARTIAL_LISTS_KEY)) continue;
|
|
16136
|
-
const valuePath =
|
|
16170
|
+
const valuePath = path12 ? `${path12}.${key}` : key;
|
|
16137
16171
|
if (Array.isArray(value)) {
|
|
16138
16172
|
let records = false;
|
|
16139
16173
|
for (const row of value) {
|
|
@@ -16165,11 +16199,11 @@ var TRIM_STAGES = [
|
|
|
16165
16199
|
function currentSummary(root, owned) {
|
|
16166
16200
|
const counts = /* @__PURE__ */ new Map();
|
|
16167
16201
|
const cursors = {};
|
|
16168
|
-
const visit = (object,
|
|
16202
|
+
const visit = (object, path12) => {
|
|
16169
16203
|
const lists = owned.get(object);
|
|
16170
16204
|
for (const [key, value] of Object.entries(object)) {
|
|
16171
16205
|
if (object === root && (key === TRUNCATION_SUMMARY_KEY || key === PARTIAL_LISTS_KEY)) continue;
|
|
16172
|
-
const valuePath =
|
|
16206
|
+
const valuePath = path12 ? `${path12}.${key}` : key;
|
|
16173
16207
|
if (Array.isArray(value)) {
|
|
16174
16208
|
const list = lists?.get(key);
|
|
16175
16209
|
if (list) {
|
|
@@ -16177,7 +16211,7 @@ function currentSummary(root, owned) {
|
|
|
16177
16211
|
count4.kept += value.length;
|
|
16178
16212
|
count4.total += list.rows.length;
|
|
16179
16213
|
counts.set(list.path, count4);
|
|
16180
|
-
noteCursor(object,
|
|
16214
|
+
noteCursor(object, path12, list.path, value.length, list.rows.length, cursors, root);
|
|
16181
16215
|
}
|
|
16182
16216
|
for (const row of value) if (isRecord8(row)) visit(row, `${valuePath}[]`);
|
|
16183
16217
|
} else if (isRecord8(value)) {
|
|
@@ -16280,10 +16314,10 @@ function hasOtherLists(value, primary) {
|
|
|
16280
16314
|
}
|
|
16281
16315
|
return isRecord8(value) && Object.values(value).some((child) => hasOtherLists(child, primary));
|
|
16282
16316
|
}
|
|
16283
|
-
function projectionPath(
|
|
16284
|
-
if (
|
|
16285
|
-
const digest = createHash5("sha256").update(
|
|
16286
|
-
return `${truncateUtf16(
|
|
16317
|
+
function projectionPath(path12) {
|
|
16318
|
+
if (path12.length <= MAX_SUMMARY_PATH_CHARS) return path12;
|
|
16319
|
+
const digest = createHash5("sha256").update(path12).digest("hex").slice(0, 12);
|
|
16320
|
+
return `${truncateUtf16(path12, 48)}...#${digest}${path12.slice(-24)}`;
|
|
16287
16321
|
}
|
|
16288
16322
|
function boundedProjection(full, partialRows, reserve = 0) {
|
|
16289
16323
|
const value = JSON.parse(full);
|
|
@@ -16295,12 +16329,12 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16295
16329
|
const skippedMetadata = () => {
|
|
16296
16330
|
summary.moreMetadataEntries = (summary.moreMetadataEntries ?? 0) + 1;
|
|
16297
16331
|
};
|
|
16298
|
-
const record2 = (entries,
|
|
16332
|
+
const record2 = (entries, path12, value2) => {
|
|
16299
16333
|
if (Object.keys(entries).length >= MAX_SUMMARY_KEYS) {
|
|
16300
16334
|
skippedMetadata();
|
|
16301
16335
|
return false;
|
|
16302
16336
|
}
|
|
16303
|
-
const key = projectionPath(
|
|
16337
|
+
const key = projectionPath(path12);
|
|
16304
16338
|
entries[key] = value2;
|
|
16305
16339
|
if (serializeResult(summary).length <= PROJECTION_METADATA_CHARS) return true;
|
|
16306
16340
|
delete entries[key];
|
|
@@ -16308,16 +16342,16 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16308
16342
|
return false;
|
|
16309
16343
|
};
|
|
16310
16344
|
let dropped = 0;
|
|
16311
|
-
const omit = (
|
|
16345
|
+
const omit = (path12) => {
|
|
16312
16346
|
dropped++;
|
|
16313
16347
|
if (summary.droppedKeys.length < MAX_SUMMARY_KEYS) {
|
|
16314
|
-
summary.droppedKeys.push(projectionPath(
|
|
16348
|
+
summary.droppedKeys.push(projectionPath(path12));
|
|
16315
16349
|
if (serializeResult(summary).length > PROJECTION_METADATA_CHARS) summary.droppedKeys.pop();
|
|
16316
16350
|
}
|
|
16317
16351
|
if (dropped > summary.droppedKeys.length) summary.moreDroppedKeys = dropped - summary.droppedKeys.length;
|
|
16318
16352
|
};
|
|
16319
16353
|
const cutOwners = /* @__PURE__ */ new Set();
|
|
16320
|
-
const project = (input, budget,
|
|
16354
|
+
const project = (input, budget, path12, owner, ownerPath = "") => {
|
|
16321
16355
|
if (Array.isArray(input)) {
|
|
16322
16356
|
const rows = [];
|
|
16323
16357
|
let used2 = 2;
|
|
@@ -16331,9 +16365,9 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16331
16365
|
}
|
|
16332
16366
|
if (partialRows && (rows.length === 0 || text.length > MAX_TOOL_RESULT_CHARS)) {
|
|
16333
16367
|
const before = { summary: serializeResult(summary), dropped };
|
|
16334
|
-
const partial = project(row, budget - used2 - (rows.length > 0 ? 1 : 0), `${
|
|
16368
|
+
const partial = project(row, budget - used2 - (rows.length > 0 ? 1 : 0), `${path12 || "items"}[${rows.length}]`);
|
|
16335
16369
|
if (partial !== void 0 && partial !== "{}" && partial !== "[]") {
|
|
16336
|
-
partialRows.set(
|
|
16370
|
+
partialRows.set(path12 || "items", rows.length);
|
|
16337
16371
|
rows.push(partial);
|
|
16338
16372
|
} else {
|
|
16339
16373
|
summary = JSON.parse(before.summary);
|
|
@@ -16344,13 +16378,13 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16344
16378
|
}
|
|
16345
16379
|
if (rows.length < input.length) {
|
|
16346
16380
|
if (partialRows && owner) cutOwners.add(owner);
|
|
16347
|
-
record2(summary.keptItems,
|
|
16348
|
-
if (rows.length === 0) omit(
|
|
16381
|
+
record2(summary.keptItems, path12 || "items", `${rows.length} of ${input.length}`);
|
|
16382
|
+
if (rows.length === 0) omit(path12 || "items");
|
|
16349
16383
|
if (owner) {
|
|
16350
16384
|
const cursors = {};
|
|
16351
|
-
noteCursor(owner, ownerPath,
|
|
16385
|
+
noteCursor(owner, ownerPath, path12, rows.length, input.length, cursors, isRecord8(value) ? value : owner);
|
|
16352
16386
|
for (const [cursor, note] of Object.entries(cursors)) {
|
|
16353
|
-
record2(summary.cursors ??= {}, cursor, note.replace(
|
|
16387
|
+
record2(summary.cursors ??= {}, cursor, note.replace(path12, projectionPath(path12)));
|
|
16354
16388
|
}
|
|
16355
16389
|
}
|
|
16356
16390
|
}
|
|
@@ -16362,9 +16396,9 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16362
16396
|
if (typeof input === "string" && budget > 2) {
|
|
16363
16397
|
const kept = largestFitting(Math.min(input.length, budget - 2), (length) => serializeResult(truncateUtf16(input, length)).length <= budget);
|
|
16364
16398
|
const prefix = truncateUtf16(input, kept);
|
|
16365
|
-
if (prefix.length > 0 && record2(summary.slicedKeys ??= {},
|
|
16399
|
+
if (prefix.length > 0 && record2(summary.slicedKeys ??= {}, path12 || "(root)", { keptChars: prefix.length, totalChars: input.length })) return serializeResult(prefix);
|
|
16366
16400
|
}
|
|
16367
|
-
omit(
|
|
16401
|
+
omit(path12 || "(root)");
|
|
16368
16402
|
return void 0;
|
|
16369
16403
|
}
|
|
16370
16404
|
const priority = ([key, child]) => key === "queryPage" && isRecord8(child) ? 0 : typeof child === "string" && child.length > budget ? 2 : typeof child !== "object" || child === null ? 0 : partialRows && serializeResult(child).length > budget ? 2 : 1;
|
|
@@ -16372,19 +16406,19 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16372
16406
|
const shown2 = [];
|
|
16373
16407
|
let used = 2;
|
|
16374
16408
|
for (const [key, child] of fields) {
|
|
16375
|
-
const childPath =
|
|
16409
|
+
const childPath = path12 ? `${path12}.${key}` : key;
|
|
16376
16410
|
const prefix = `${JSON.stringify(key)}:`;
|
|
16377
16411
|
const allowance = budget - used - prefix.length - (shown2.length > 0 ? 1 : 0);
|
|
16378
16412
|
if (allowance < 2) {
|
|
16379
16413
|
omit(childPath);
|
|
16380
16414
|
continue;
|
|
16381
16415
|
}
|
|
16382
|
-
const text = project(child, allowance, childPath, input,
|
|
16416
|
+
const text = project(child, allowance, childPath, input, path12);
|
|
16383
16417
|
if (text === void 0) continue;
|
|
16384
16418
|
shown2.push(prefix + text);
|
|
16385
16419
|
used += prefix.length + text.length + (shown2.length > 1 ? 1 : 0);
|
|
16386
16420
|
}
|
|
16387
|
-
if (
|
|
16421
|
+
if (path12 && cutOwners.has(input)) shown2.push('"__truncated":true');
|
|
16388
16422
|
return `{${shown2.join(",")}}`;
|
|
16389
16423
|
};
|
|
16390
16424
|
const projected = project(value, MAX_TOOL_RESULT_CHARS - PROJECTION_SUMMARY_CHARS - reserve, "");
|
|
@@ -16393,9 +16427,9 @@ function boundedProjection(full, partialRows, reserve = 0) {
|
|
|
16393
16427
|
const result2 = { ...output, __truncated: true, [TRUNCATION_SUMMARY_KEY]: summary };
|
|
16394
16428
|
return serializeResult(partialRows ? withPartialLists(result2) : result2);
|
|
16395
16429
|
}
|
|
16396
|
-
function rowsShown(cut,
|
|
16397
|
-
if (
|
|
16398
|
-
const list =
|
|
16430
|
+
function rowsShown(cut, path12) {
|
|
16431
|
+
if (path12.includes("[")) return Infinity;
|
|
16432
|
+
const list = path12.split(".").reduce((owner, key) => isRecord8(owner) ? owner[key] : void 0, cut);
|
|
16399
16433
|
return Array.isArray(list) ? list.length : 0;
|
|
16400
16434
|
}
|
|
16401
16435
|
function withPartialRows(full, whole2) {
|
|
@@ -16408,7 +16442,7 @@ function withPartialRows(full, whole2) {
|
|
|
16408
16442
|
}
|
|
16409
16443
|
if (!fitsCap(partial)) return whole2;
|
|
16410
16444
|
const cut = JSON.parse(whole2);
|
|
16411
|
-
return [...rescued].some(([
|
|
16445
|
+
return [...rescued].some(([path12, index]) => rowsShown(cut, path12) <= index) ? partial : whole2;
|
|
16412
16446
|
}
|
|
16413
16447
|
function truncateToolResult(details, options = {}) {
|
|
16414
16448
|
const annotated = withPartialLists(details);
|
|
@@ -17048,9 +17082,9 @@ function resolvePageReferences(runtime, tool, params) {
|
|
|
17048
17082
|
}
|
|
17049
17083
|
return resolved;
|
|
17050
17084
|
}
|
|
17051
|
-
function pageOwner(value,
|
|
17085
|
+
function pageOwner(value, path12) {
|
|
17052
17086
|
let owner = value;
|
|
17053
|
-
for (const key of
|
|
17087
|
+
for (const key of path12) {
|
|
17054
17088
|
if (owner === null || typeof owner !== "object" || Array.isArray(owner)) return void 0;
|
|
17055
17089
|
owner = owner[key];
|
|
17056
17090
|
}
|
|
@@ -17085,8 +17119,8 @@ function referencePages(runtime, tool, params, value) {
|
|
|
17085
17119
|
});
|
|
17086
17120
|
owner[cursor.key] = reference;
|
|
17087
17121
|
const pagination = pageOwner(root.__pagination, []);
|
|
17088
|
-
for (const [
|
|
17089
|
-
if (typeof note === "string") pagination[
|
|
17122
|
+
for (const [path12, note] of Object.entries(pagination ?? {})) {
|
|
17123
|
+
if (typeof note === "string") pagination[path12] = note.split(token).join(reference);
|
|
17090
17124
|
}
|
|
17091
17125
|
changed = true;
|
|
17092
17126
|
}
|
|
@@ -17584,9 +17618,9 @@ function ensureBuiltinsRegistered() {
|
|
|
17584
17618
|
}
|
|
17585
17619
|
function loadAeroSystemPrompt(pkgDir, opts = {}) {
|
|
17586
17620
|
const skillDir = resolveAeroSkillDir(pkgDir);
|
|
17587
|
-
const skillBody =
|
|
17588
|
-
const soulPath =
|
|
17589
|
-
const base =
|
|
17621
|
+
const skillBody = fs11.readFileSync(path10.join(skillDir, "SKILL.md"), "utf-8");
|
|
17622
|
+
const soulPath = path10.join(skillDir, "soul.md");
|
|
17623
|
+
const base = fs11.existsSync(soulPath) ? `${fs11.readFileSync(soulPath, "utf-8").trimEnd()}
|
|
17590
17624
|
|
|
17591
17625
|
---
|
|
17592
17626
|
|
|
@@ -17599,7 +17633,7 @@ function appendSystemPromptExtras(base, env = process.env) {
|
|
|
17599
17633
|
const filePath = env.AERO_SYSTEM_PROMPT_FILE?.trim();
|
|
17600
17634
|
if (filePath) {
|
|
17601
17635
|
try {
|
|
17602
|
-
fileBody =
|
|
17636
|
+
fileBody = fs11.readFileSync(filePath, "utf-8").trim();
|
|
17603
17637
|
} catch {
|
|
17604
17638
|
fileBody = "";
|
|
17605
17639
|
}
|
|
@@ -21484,7 +21518,7 @@ function mcpTransportPaths() {
|
|
|
21484
21518
|
}
|
|
21485
21519
|
function mcpHttpHealth(app, apiPrefix) {
|
|
21486
21520
|
const available = mcpTransportPaths().every(
|
|
21487
|
-
(
|
|
21521
|
+
(path12) => ["POST", "GET", "DELETE"].every((method) => app.hasRoute({ method, url: `${apiPrefix}${path12}` }))
|
|
21488
21522
|
);
|
|
21489
21523
|
return { status: available ? "available" : "unavailable" };
|
|
21490
21524
|
}
|
|
@@ -22192,13 +22226,13 @@ var USER_AGENT2 = "Canonry/1.0 (site-analysis)";
|
|
|
22192
22226
|
function fetchWithPinnedAddress(target) {
|
|
22193
22227
|
return new Promise((resolve2) => {
|
|
22194
22228
|
const port = target.url.port ? Number(target.url.port) : 443;
|
|
22195
|
-
const
|
|
22229
|
+
const path12 = target.url.pathname + target.url.search;
|
|
22196
22230
|
const req = https2.request(
|
|
22197
22231
|
{
|
|
22198
22232
|
hostname: target.address,
|
|
22199
22233
|
family: target.family,
|
|
22200
22234
|
port,
|
|
22201
|
-
path:
|
|
22235
|
+
path: path12,
|
|
22202
22236
|
method: "GET",
|
|
22203
22237
|
timeout: FETCH_TIMEOUT_MS2,
|
|
22204
22238
|
servername: target.url.hostname,
|
|
@@ -23394,13 +23428,13 @@ function providerSummaries(registry, config, includeBrowser = false) {
|
|
|
23394
23428
|
}
|
|
23395
23429
|
function runtimePathIdentity(runtimePath) {
|
|
23396
23430
|
if (runtimePath === ":memory:") return runtimePath;
|
|
23397
|
-
const resolved =
|
|
23398
|
-
let directory =
|
|
23431
|
+
const resolved = path11.resolve(runtimePath);
|
|
23432
|
+
let directory = path11.dirname(resolved);
|
|
23399
23433
|
try {
|
|
23400
|
-
directory =
|
|
23434
|
+
directory = fs12.realpathSync(directory);
|
|
23401
23435
|
} catch {
|
|
23402
23436
|
}
|
|
23403
|
-
return
|
|
23437
|
+
return path11.join(directory, path11.basename(resolved));
|
|
23404
23438
|
}
|
|
23405
23439
|
var DASHBOARD_SCRYPT_KEYLEN = 64;
|
|
23406
23440
|
var DASHBOARD_SCRYPT_COST = 1 << 15;
|
|
@@ -23712,7 +23746,7 @@ function createGoogleMarketingConfigCredentialStore(input) {
|
|
|
23712
23746
|
};
|
|
23713
23747
|
}
|
|
23714
23748
|
async function createServer(opts) {
|
|
23715
|
-
const runtimeConfigPath =
|
|
23749
|
+
const runtimeConfigPath = path11.resolve(getConfigPath());
|
|
23716
23750
|
const runtimeConfigIdentity = runtimePathIdentity(runtimeConfigPath);
|
|
23717
23751
|
const runtimeDatabasePath = opts.config.database;
|
|
23718
23752
|
const runtimeDatabaseIdentity = runtimePathIdentity(runtimeDatabasePath);
|
|
@@ -23960,8 +23994,8 @@ async function createServer(opts) {
|
|
|
23960
23994
|
app.log.error({ runId, projectId }, "GTM sync failed");
|
|
23961
23995
|
});
|
|
23962
23996
|
};
|
|
23963
|
-
const orphanedOpenClawDir =
|
|
23964
|
-
if (
|
|
23997
|
+
const orphanedOpenClawDir = path11.join(os5.homedir(), ".openclaw-aero");
|
|
23998
|
+
if (fs12.existsSync(orphanedOpenClawDir)) {
|
|
23965
23999
|
app.log.warn(
|
|
23966
24000
|
{ path: orphanedOpenClawDir },
|
|
23967
24001
|
"OpenClaw gateway is no longer used. Remove ~/.openclaw-aero/ manually to reclaim the directory."
|
|
@@ -24794,7 +24828,7 @@ async function createServer(opts) {
|
|
|
24794
24828
|
});
|
|
24795
24829
|
}
|
|
24796
24830
|
if (verification.needsRehash) {
|
|
24797
|
-
if (
|
|
24831
|
+
if (fs12.existsSync(getConfigPath()) && (!onDisk || typeof onDisk !== "object" || Array.isArray(onDisk) || !onDisk.apiUrl || !onDisk.database || !onDisk.apiKey)) {
|
|
24798
24832
|
throw new Error("Cannot migrate dashboard password: config.yaml is unreadable or invalid");
|
|
24799
24833
|
}
|
|
24800
24834
|
const migratedHash = hashDashboardPassword(password);
|
|
@@ -25085,7 +25119,7 @@ async function createServer(opts) {
|
|
|
25085
25119
|
// a config and shouldn't get 503s from a stub-missing file.
|
|
25086
25120
|
runtimeStatePaths: {
|
|
25087
25121
|
databasePath: runtimeDatabasePath,
|
|
25088
|
-
configPath:
|
|
25122
|
+
configPath: fs12.existsSync(runtimeConfigPath) ? runtimeConfigPath : null
|
|
25089
25123
|
},
|
|
25090
25124
|
// Snapshot the bundled skill trees (version + file hashes) so the
|
|
25091
25125
|
// `agent.skills.current` doctor check can flag a `~/.claude/skills/` install
|
|
@@ -25492,7 +25526,7 @@ async function createServer(opts) {
|
|
|
25492
25526
|
...existing?.pricing ? { pricing: existing.pricing } : {}
|
|
25493
25527
|
};
|
|
25494
25528
|
try {
|
|
25495
|
-
saveConfigPatch(
|
|
25529
|
+
saveConfigPatch(fs12.existsSync(runtimeConfigPath) ? { providers: { [name]: opts.config.providers[name] } } : opts.config);
|
|
25496
25530
|
} catch (err) {
|
|
25497
25531
|
app.log.error({ err }, "Failed to save config");
|
|
25498
25532
|
return null;
|
|
@@ -25649,10 +25683,10 @@ async function createServer(opts) {
|
|
|
25649
25683
|
return snapshotService.createReport(input);
|
|
25650
25684
|
}
|
|
25651
25685
|
});
|
|
25652
|
-
const dirname =
|
|
25653
|
-
const assetsDir = opts.assetsDir ??
|
|
25654
|
-
if (
|
|
25655
|
-
const indexPath =
|
|
25686
|
+
const dirname = path11.dirname(fileURLToPath3(import.meta.url));
|
|
25687
|
+
const assetsDir = opts.assetsDir ?? path11.join(dirname, "..", "assets");
|
|
25688
|
+
if (fs12.existsSync(assetsDir)) {
|
|
25689
|
+
const indexPath = path11.join(assetsDir, "index.html");
|
|
25656
25690
|
const injectConfig = (html, projectTabsOverride, themeOverride, renderTokenOverride) => {
|
|
25657
25691
|
const clientConfig = {};
|
|
25658
25692
|
if (basePath) clientConfig.basePath = basePath;
|
|
@@ -25721,8 +25755,8 @@ async function createServer(opts) {
|
|
|
25721
25755
|
// Without this, the browser hits the server for every JS chunk on
|
|
25722
25756
|
// every page load, defeating most of the dashboard's first-paint
|
|
25723
25757
|
// budget.
|
|
25724
|
-
setHeaders: (res,
|
|
25725
|
-
if (
|
|
25758
|
+
setHeaders: (res, path12) => {
|
|
25759
|
+
if (path12.endsWith(".html")) {
|
|
25726
25760
|
res.setHeader("Cache-Control", "no-cache, must-revalidate");
|
|
25727
25761
|
} else {
|
|
25728
25762
|
res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
|
|
@@ -25730,8 +25764,8 @@ async function createServer(opts) {
|
|
|
25730
25764
|
}
|
|
25731
25765
|
});
|
|
25732
25766
|
const serveIndex = (_request, reply) => {
|
|
25733
|
-
if (
|
|
25734
|
-
const html =
|
|
25767
|
+
if (fs12.existsSync(indexPath)) {
|
|
25768
|
+
const html = fs12.readFileSync(indexPath, "utf-8");
|
|
25735
25769
|
return sendSpaDocument(reply, html);
|
|
25736
25770
|
}
|
|
25737
25771
|
return reply.status(404).send({ error: "Dashboard not built" });
|
|
@@ -25762,8 +25796,8 @@ async function createServer(opts) {
|
|
|
25762
25796
|
if (basePath && !url.startsWith(basePath)) {
|
|
25763
25797
|
return reply.status(404).send({ error: "Not found", path: request.url });
|
|
25764
25798
|
}
|
|
25765
|
-
if (
|
|
25766
|
-
const html =
|
|
25799
|
+
if (fs12.existsSync(indexPath)) {
|
|
25800
|
+
const html = fs12.readFileSync(indexPath, "utf-8");
|
|
25767
25801
|
return sendSpaDocument(reply, html);
|
|
25768
25802
|
}
|
|
25769
25803
|
return reply.status(404).send({ error: "Not found" });
|
|
@@ -64991,10 +64991,11 @@ function loadDuckdb(opts = {}) {
|
|
|
64991
64991
|
try {
|
|
64992
64992
|
const pluginRequire = createRequire(duckdbPkg);
|
|
64993
64993
|
return pluginRequire("@duckdb/node-api");
|
|
64994
|
-
} catch {
|
|
64994
|
+
} catch (err) {
|
|
64995
|
+
const cause = (err instanceof Error ? err.message : String(err)).split("\n")[0].slice(0, 300);
|
|
64995
64996
|
throw missingDependency(
|
|
64996
|
-
|
|
64997
|
-
{ pluginDir }
|
|
64997
|
+
`@duckdb/node-api is installed but failed to load (${cause}). Re-run \`canonry backlinks install\`.`,
|
|
64998
|
+
{ pluginDir, cause }
|
|
64998
64999
|
);
|
|
64999
65000
|
}
|
|
65000
65001
|
}
|
|
@@ -65024,16 +65025,28 @@ async function installDuckdb(opts = {}) {
|
|
|
65024
65025
|
const pkgManager = opts.packageManager ?? "npm";
|
|
65025
65026
|
await ensurePluginDir(pluginDir, pluginPkgJson);
|
|
65026
65027
|
if (isDuckdbInstalled({ pluginPkgJson })) {
|
|
65027
|
-
|
|
65028
|
-
|
|
65028
|
+
if (loads(pluginPkgJson)) {
|
|
65029
|
+
const version2 = readInstalledVersion({ pluginPkgJson }) ?? "unknown";
|
|
65030
|
+
return { alreadyPresent: true, version: version2, path: pluginDir };
|
|
65031
|
+
}
|
|
65032
|
+
await fs4.rm(path5.join(pluginDir, "node_modules", "@duckdb"), { recursive: true, force: true });
|
|
65029
65033
|
}
|
|
65030
65034
|
await runInstall(pkgManager, spec, pluginDir, opts.onLog);
|
|
65031
65035
|
if (!isDuckdbInstalled({ pluginPkgJson })) {
|
|
65032
65036
|
throw new Error(`${pkgManager} install completed but @duckdb/node-api still cannot be resolved from ${pluginDir}`);
|
|
65033
65037
|
}
|
|
65038
|
+
loadDuckdb({ pluginPkgJson });
|
|
65034
65039
|
const version = readInstalledVersion({ pluginPkgJson }) ?? "unknown";
|
|
65035
65040
|
return { alreadyPresent: false, version, path: pluginDir };
|
|
65036
65041
|
}
|
|
65042
|
+
function loads(pluginPkgJson) {
|
|
65043
|
+
try {
|
|
65044
|
+
loadDuckdb({ pluginPkgJson });
|
|
65045
|
+
return true;
|
|
65046
|
+
} catch {
|
|
65047
|
+
return false;
|
|
65048
|
+
}
|
|
65049
|
+
}
|
|
65037
65050
|
async function ensurePluginDir(pluginDir, pluginPkgJson) {
|
|
65038
65051
|
await fs4.mkdir(pluginDir, { recursive: true });
|
|
65039
65052
|
try {
|
|
@@ -65064,7 +65077,12 @@ async function runInstall(pkgManager, spec, pluginDir, onLog) {
|
|
|
65064
65077
|
}
|
|
65065
65078
|
});
|
|
65066
65079
|
}
|
|
65067
|
-
child.on("error",
|
|
65080
|
+
child.on("error", (err) => {
|
|
65081
|
+
reject(err.code === "ENOENT" && process.platform !== "win32" ? missingDependency(
|
|
65082
|
+
`${pkgManager} was not found, so @duckdb/node-api cannot be installed here. The canonry Docker image ships without ${pkgManager}.`,
|
|
65083
|
+
{ pluginDir }
|
|
65084
|
+
) : err);
|
|
65085
|
+
});
|
|
65068
65086
|
child.on("exit", (code) => {
|
|
65069
65087
|
if (code === 0) resolve();
|
|
65070
65088
|
else reject(new Error(`${pkgManager} install exited with code ${code}`));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTERED_CLI_COMMANDS
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EQTVQIM2.js";
|
|
4
|
+
import "./chunk-HHRM3H3L.js";
|
|
5
5
|
import "./chunk-GZPJ7TSE.js";
|
|
6
6
|
import "./chunk-KU4TPVZV.js";
|
|
7
7
|
import "./chunk-RB2F4D3Z.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-6GNV6VF4.js";
|
|
9
9
|
import "./chunk-RUWELF3K.js";
|
|
10
10
|
import "./chunk-HGMYEDAQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KUS7M65J.js";
|
|
12
12
|
import "./chunk-YOGHHIGE.js";
|
|
13
13
|
export {
|
|
14
14
|
REGISTERED_CLI_COMMANDS
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
buildSetupState,
|
|
14
14
|
consumePendingServeHandoff,
|
|
15
15
|
serveCommand
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EQTVQIM2.js";
|
|
17
17
|
import {
|
|
18
18
|
checkLatestVersionForCli,
|
|
19
19
|
cliRuntimeContext,
|
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
showFirstRunNotice,
|
|
28
28
|
trackCliCommandFinished,
|
|
29
29
|
trackEvent
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-HHRM3H3L.js";
|
|
31
31
|
import "./chunk-GZPJ7TSE.js";
|
|
32
32
|
import {
|
|
33
33
|
resolveCliAccess
|
|
34
34
|
} from "./chunk-KU4TPVZV.js";
|
|
35
35
|
import "./chunk-RB2F4D3Z.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-6GNV6VF4.js";
|
|
37
37
|
import "./chunk-RUWELF3K.js";
|
|
38
38
|
import {
|
|
39
39
|
CliError,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
printCliError,
|
|
43
43
|
usageError
|
|
44
44
|
} from "./chunk-HGMYEDAQ.js";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-KUS7M65J.js";
|
|
46
46
|
import {
|
|
47
47
|
OperationAccesses
|
|
48
48
|
} from "./chunk-YOGHHIGE.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
computeFactorAverages,
|
|
6
6
|
layoutSiteCrawlGraphInput,
|
|
7
7
|
persistSiteCrawlGraphLayout
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6GNV6VF4.js";
|
|
9
9
|
import {
|
|
10
10
|
PACKAGE_VERSION,
|
|
11
11
|
canonryMcpTools
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
siteCrawlPages,
|
|
88
88
|
siteCrawlSnapshots,
|
|
89
89
|
trafficSources
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-KUS7M65J.js";
|
|
91
91
|
import {
|
|
92
92
|
AI_ENGINE_DOMAINS,
|
|
93
93
|
RunKinds,
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
createGoogleMarketingCredentialStore,
|
|
4
4
|
createGoogleMarketingRuntime,
|
|
5
5
|
createServer
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HHRM3H3L.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
9
|
} from "./chunk-GZPJ7TSE.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-6GNV6VF4.js";
|
|
11
11
|
import "./chunk-RUWELF3K.js";
|
|
12
12
|
import "./chunk-HGMYEDAQ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-KUS7M65J.js";
|
|
14
14
|
import "./chunk-YOGHHIGE.js";
|
|
15
15
|
export {
|
|
16
16
|
GoogleMarketingRuntimeError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonry/canonry",
|
|
3
|
-
"version": "7.51.
|
|
3
|
+
"version": "7.51.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -85,34 +85,34 @@
|
|
|
85
85
|
"@types/node-cron": "^3.0.11",
|
|
86
86
|
"tsup": "^8.5.1",
|
|
87
87
|
"tsx": "^4.19.0",
|
|
88
|
+
"@canonry/canonry-web": "0.0.0",
|
|
89
|
+
"@canonry/canonry-api-client": "0.0.0",
|
|
88
90
|
"@canonry/canonry-api-routes": "0.0.0",
|
|
89
91
|
"@canonry/canonry-config": "0.0.0",
|
|
90
|
-
"@canonry/canonry-web": "0.0.0",
|
|
91
92
|
"@canonry/canonry-contracts": "0.0.0",
|
|
92
93
|
"@canonry/canonry-db": "0.0.0",
|
|
93
|
-
"@canonry/canonry-api-client": "0.0.0",
|
|
94
94
|
"@canonry/canonry-integration-bing": "0.0.0",
|
|
95
|
-
"@canonry/canonry-integration-
|
|
96
|
-
"@canonry/canonry-integration-commoncrawl": "0.0.0",
|
|
97
|
-
"@canonry/canonry-integration-cloudflare-worker": "0.0.0",
|
|
95
|
+
"@canonry/canonry-integration-cloud-run": "0.0.0",
|
|
98
96
|
"@canonry/canonry-integration-google": "0.0.0",
|
|
97
|
+
"@canonry/canonry-integration-cloudflare-worker": "0.0.0",
|
|
98
|
+
"@canonry/canonry-integration-google-ads": "0.0.0",
|
|
99
99
|
"@canonry/canonry-integration-google-business-profile": "0.0.0",
|
|
100
|
-
"@canonry/canonry-integration-cloud-run": "0.0.0",
|
|
101
100
|
"@canonry/canonry-integration-google-places": "0.0.0",
|
|
102
|
-
"@canonry/canonry-integration-google-ads": "0.0.0",
|
|
103
101
|
"@canonry/canonry-integration-google-tag-manager": "0.0.0",
|
|
104
|
-
"@canonry/canonry-integration-
|
|
102
|
+
"@canonry/canonry-integration-cloudflare-queue": "0.0.0",
|
|
103
|
+
"@canonry/canonry-integration-commoncrawl": "0.0.0",
|
|
105
104
|
"@canonry/canonry-integration-openai-ads": "0.0.0",
|
|
105
|
+
"@canonry/canonry-integration-traffic": "0.0.0",
|
|
106
|
+
"@canonry/canonry-intelligence": "0.0.0",
|
|
107
|
+
"@canonry/canonry-provider-cdp": "0.0.0",
|
|
106
108
|
"@canonry/canonry-integration-wordpress": "0.0.0",
|
|
107
109
|
"@canonry/canonry-provider-claude": "0.0.0",
|
|
108
|
-
"@canonry/canonry-intelligence": "0.0.0",
|
|
109
110
|
"@canonry/canonry-provider-gemini": "0.0.0",
|
|
110
|
-
"@canonry/canonry-provider-cdp": "0.0.0",
|
|
111
|
-
"@canonry/canonry-provider-local": "0.0.0",
|
|
112
111
|
"@canonry/canonry-provider-muse": "0.0.0",
|
|
112
|
+
"@canonry/canonry-provider-local": "0.0.0",
|
|
113
113
|
"@canonry/canonry-provider-openai": "0.0.0",
|
|
114
|
-
"@canonry/canonry-
|
|
115
|
-
"@canonry/canonry-
|
|
114
|
+
"@canonry/canonry-provider-perplexity": "0.0.0",
|
|
115
|
+
"@canonry/canonry-integration-typesafe": "0.0.0"
|
|
116
116
|
},
|
|
117
117
|
"scripts": {
|
|
118
118
|
"build": "pnpm run build:cli && pnpm run build:web",
|