@canonry/canonry 7.51.5 → 7.52.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/assets/agent-workspace/skills/canonry/references/canonry-cli.md +8 -0
- package/assets/assets/{AccessControls-B5TqDgeq.js → AccessControls-CteIuEGI.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-DgxiizOW.js → AuditHistoryPanel-DqJGiLsf.js} +1 -1
- package/assets/assets/{BacklinksPage-Ay6pdphx.js → BacklinksPage-DotWEPQt.js} +1 -1
- package/assets/assets/{HistoryPage-B11eFH21.js → HistoryPage-aOd198dT.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-CuaKVK8x.js +4 -0
- package/assets/assets/{ProjectPage-DoY0hftd.js → ProjectPage-O9oufMgi.js} +4 -4
- package/assets/assets/{RunsPage-BPBmuQAS.js → RunsPage-DIXMrc-N.js} +1 -1
- package/assets/assets/{SettingsPage-ClKnP8xy.js → SettingsPage-BuGb6AGa.js} +1 -1
- package/assets/assets/SiteHealthSection-CweaKjCo.js +2 -0
- package/assets/assets/TrafficPage-B7MaQalp.js +40 -0
- package/assets/assets/{TrafficSourceDetailPage-DQu0YNt2.js → TrafficSourceDetailPage-BPtjnF9s.js} +1 -1
- package/assets/assets/{card-DYMyvhB9.js → card-DoV-8Txo.js} +1 -1
- package/assets/assets/{extract-error-message-BRM1I_3L.js → extract-error-message-DKQJJlZ-.js} +1 -1
- package/assets/assets/{format-helpers-DrkFERj3.js → format-helpers-BWnMmkiO.js} +1 -1
- package/assets/assets/index-Z63c4PeO.js +39 -0
- package/assets/assets/{query-client-gRFnU4VF.js → query-client-vB35tVTz.js} +1 -1
- package/assets/assets/{react-query-lH82FULK.js → react-query-BI0567qs.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-D09H4byP.js → react-sigma_core.esm.min-hGyOC4V_.js} +1 -1
- package/assets/assets/{service-Cx0HSnE9.js → service-c4YvpVKX.js} +1 -1
- package/assets/index.html +6 -6
- package/dist/ads-MREK2AGL.js +544 -0
- package/dist/agent-4RUZ3MC4.js +70 -0
- package/dist/agent-ask-YLTYBEYH.js +139 -0
- package/dist/agent-conversations-QA6IKDGR.js +52 -0
- package/dist/agent-memory-MEQAJOB3.js +92 -0
- package/dist/agent-providers-AXYPDJHL.js +55 -0
- package/dist/agent-transcript-SMNQNYCD.js +77 -0
- package/dist/analytics-4OR64IGV.js +240 -0
- package/dist/apply-CQXCFXAH.js +175 -0
- package/dist/backfill-TMXCNVOB.js +41 -0
- package/dist/backlinks-6KFAQGYV.js +303 -0
- package/dist/bing-HFCACTAC.js +418 -0
- package/dist/bootstrap-SQVQXOJC.js +326 -0
- package/dist/cdp-IACL7EXU.js +162 -0
- package/dist/chunk-4MJYGB56.js +124 -0
- package/dist/chunk-5N6245R7.js +1160 -0
- package/dist/chunk-6BPZHNDC.js +617 -0
- package/dist/chunk-6GO5VVAC.js +15 -0
- package/dist/chunk-7244X3K6.js +609 -0
- package/dist/chunk-7XE2IRBG.js +204 -0
- package/dist/chunk-AOJU5LKX.js +8 -0
- package/dist/chunk-AWCWIQAU.js +2686 -0
- package/dist/{chunk-JBZZEIM2.js → chunk-BBOHY2DQ.js} +2 -13
- package/dist/{chunk-AZFPA7JV.js → chunk-BU3VAG5J.js} +6 -4
- package/dist/{chunk-4YCGZGA3.js → chunk-BYOK6Z4F.js} +2 -2
- package/dist/chunk-DSNSD5J3.js +971 -0
- package/dist/chunk-EGIZNSDA.js +94 -0
- package/dist/chunk-ELCLGWUT.js +83 -0
- package/dist/chunk-FC4XND45.js +38 -0
- package/dist/chunk-GNKOBKPW.js +58 -0
- package/dist/chunk-HEGXGCGL.js +524 -0
- package/dist/chunk-I6KNMZ77.js +232 -0
- package/dist/{chunk-HLVEB5TB.js → chunk-IIOEAJTV.js} +7 -5
- package/dist/chunk-ILDT4LPB.js +1273 -0
- package/dist/chunk-JY3RLZGB.js +30 -0
- package/dist/{chunk-PLYJX67A.js → chunk-K5I45PZI.js} +8084 -13939
- package/dist/chunk-KXAOMTXN.js +1034 -0
- package/dist/chunk-LK2BG6EX.js +145 -0
- package/dist/chunk-MJNUSPO4.js +15 -0
- package/dist/chunk-MKAC7HKH.js +9178 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-SFMWHPMX.js → chunk-O4RMPA6H.js} +13765 -13737
- package/dist/chunk-O77IBNVO.js +8264 -0
- package/dist/chunk-OFL4PTYU.js +644 -0
- package/dist/chunk-QLPLENDT.js +133 -0
- package/dist/chunk-R2J4SNKF.js +78 -0
- package/dist/{chunk-KEATAHXH.js → chunk-RVUCY4ZV.js} +358 -581
- package/dist/chunk-SNFBJKAW.js +530 -0
- package/dist/chunk-TALC5DX5.js +420 -0
- package/dist/chunk-TSENU4GG.js +18 -0
- package/dist/{chunk-HAHXPJQ5.js → chunk-V5D4XNWV.js} +16 -1684
- package/dist/chunk-VJWDBFSL.js +69 -0
- package/dist/chunk-XEBKF4N5.js +8 -0
- package/dist/chunk-Y4GK7GCV.js +15376 -0
- package/dist/{chunk-A3WSAAQS.js → chunk-YSEC6TIB.js} +7917 -33199
- package/dist/chunk-Z7IUAJOF.js +13 -0
- package/dist/citations-NSBBWRZ4.js +106 -0
- package/dist/{cli-catalog-MO6Z2CIZ.js → cli-catalog-OFWJMNMD.js} +5 -3
- package/dist/cli-commands-WVBL337U.js +19 -0
- package/dist/cli.js +35 -29
- package/dist/competitor-V4OHORBC.js +561 -0
- package/dist/content-RUXRI5IC.js +257 -0
- package/dist/dashboard-JXB2YAQJ.js +71 -0
- package/dist/demo-55ZNUOXU.js +75 -0
- package/dist/{demo-server-GIWDJGJX.js → demo-server-XO7PHM4I.js} +22 -9
- package/dist/discover-JJQ564HS.js +372 -0
- package/dist/discover-eval-KLEKZ6U4.js +282 -0
- package/dist/doctor-JAMQZCMZ.js +152 -0
- package/dist/evidence-YRSB7GFE.js +57 -0
- package/dist/export-cmd-MHML4OYU.js +49 -0
- package/dist/ga-LSXPE2MN.js +911 -0
- package/dist/gbp-RMKMLOC7.js +370 -0
- package/dist/google-JQ4T6JTQ.js +946 -0
- package/dist/google-marketing-J6SEODYC.js +403 -0
- package/dist/health-cmd-MV2JM2C3.js +64 -0
- package/dist/history-SRRH7A2E.js +90 -0
- package/dist/index.d.ts +43 -4
- package/dist/index.js +29 -6
- package/dist/init-ZJZFUERV.js +432 -0
- package/dist/insights-PMMGNWZH.js +63 -0
- package/dist/intelligence-service-KCSU6ZUJ.js +15 -0
- package/dist/keys-TS7NZANS.js +116 -0
- package/dist/keyword-VNCKDUGC.js +164 -0
- package/dist/logs-VH3WOTZJ.js +30 -0
- package/dist/mcp-DG2RROB3.js +14 -0
- package/dist/mcp.js +14 -5
- package/dist/measurement-plan-4T35TUGG.js +42 -0
- package/dist/notify-BWHUSKL7.js +125 -0
- package/dist/organic-evidence-QX4SXXJP.js +53 -0
- package/dist/overview-7IHUTKUV.js +213 -0
- package/dist/project-JXLSWDE2.js +460 -0
- package/dist/query-S75EL25H.js +211 -0
- package/dist/research-KFTV3IP4.js +200 -0
- package/dist/results-export-GTKVBU34.js +27 -0
- package/dist/run-26HDIRHF.js +31 -0
- package/dist/schedule-N6G4SVHQ.js +177 -0
- package/dist/search-MI32EPYM.js +42 -0
- package/dist/serve-XLGE42AG.js +598 -0
- package/dist/session-W5DXWIYM.js +47 -0
- package/dist/settings-T7WI2UVE.js +107 -0
- package/dist/skills-F3WPKPTK.js +33 -0
- package/dist/snapshot-PD3EAVEX.js +538 -0
- package/dist/src-XDUXMJC3.js +316 -0
- package/dist/status-PUH7JFZ4.js +126 -0
- package/dist/support-ARF4HER7.js +24 -0
- package/dist/technical-aeo-AUFWWJIP.js +625 -0
- package/dist/telemetry-XBYT7G2K.js +118 -0
- package/dist/tools-GVHIRWSN.js +41 -0
- package/dist/traffic-B3HW2ZWG.js +1295 -0
- package/dist/users-M5HNQZYI.js +170 -0
- package/dist/visibility-stats-Y7GJKMHN.js +241 -0
- package/dist/wordpress-GCIURYPN.js +600 -0
- package/package.json +1 -1
- package/assets/assets/MeasurementPropertyPage-1UYI7mzP.js +0 -4
- package/assets/assets/SiteHealthSection-PWjKMmEn.js +0 -2
- package/assets/assets/TrafficPage-DkfGiJXR.js +0 -40
- package/assets/assets/index-CG1Jox52.js +0 -39
- package/dist/chunk-4QQYYRHV.js +0 -23082
- package/dist/cli-commands-FOJR3HHU.js +0 -15
- package/dist/intelligence-service-XQCNWAPL.js +0 -9
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bucketCliCommandDuration,
|
|
3
|
+
isTelemetryEnabled,
|
|
4
|
+
trackEvent
|
|
5
|
+
} from "./chunk-7244X3K6.js";
|
|
6
|
+
import {
|
|
7
|
+
getConfigDir
|
|
8
|
+
} from "./chunk-OFL4PTYU.js";
|
|
9
|
+
import {
|
|
10
|
+
currentOutcomeAttribution
|
|
11
|
+
} from "./chunk-QLPLENDT.js";
|
|
12
|
+
import {
|
|
13
|
+
AGENT_NONE,
|
|
14
|
+
OutcomeSurfaces,
|
|
15
|
+
bucketDuration,
|
|
16
|
+
classifyOutcomeError,
|
|
17
|
+
featureCompletedPropertiesSchema,
|
|
18
|
+
installStatePropertiesSchema,
|
|
19
|
+
integrationConnectionPropertiesSchema,
|
|
20
|
+
normalizeAgentSlug,
|
|
21
|
+
usageSurfaceSchema
|
|
22
|
+
} from "./chunk-O4RMPA6H.js";
|
|
23
|
+
|
|
24
|
+
// src/outcome-telemetry.ts
|
|
25
|
+
import fs from "fs";
|
|
26
|
+
import path from "path";
|
|
27
|
+
|
|
28
|
+
// src/usage-telemetry.ts
|
|
29
|
+
var API_REQUEST_BUCKET_CAPACITY = 20;
|
|
30
|
+
var API_REQUEST_REFILL_PER_MS = 1 / 1e4;
|
|
31
|
+
var MAX_TRACKED_MCP_SESSIONS = 2e3;
|
|
32
|
+
var MAX_ROUTE_LENGTH = 200;
|
|
33
|
+
var SKIPPED_ROUTE_PATTERN = /(?:^|\/)(?:health|openapi\.json|telemetry|traffic\/cloudflare\/ingest)(?:\/|$)/;
|
|
34
|
+
var MCP_CALL_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
35
|
+
var MCP_TOOL_PATTERN = /^[a-z][a-z0-9_]{0,79}$/;
|
|
36
|
+
function classifyUsageSurface(info) {
|
|
37
|
+
const labelled = usageSurfaceSchema.safeParse(info.usageLabels.surface);
|
|
38
|
+
if (labelled.success) return labelled.data;
|
|
39
|
+
const ua = info.userAgent ?? "";
|
|
40
|
+
if (ua.startsWith("canonry-cli")) return "cli";
|
|
41
|
+
if (ua.startsWith("canonry-mcp/")) return "mcp-http";
|
|
42
|
+
if (ua === "canonry-mcp") return "mcp-stdio";
|
|
43
|
+
if (ua.startsWith("Mozilla/")) return "dashboard";
|
|
44
|
+
return "api";
|
|
45
|
+
}
|
|
46
|
+
function statusClass(statusCode) {
|
|
47
|
+
if (statusCode >= 500) return "5xx";
|
|
48
|
+
if (statusCode >= 400) return "4xx";
|
|
49
|
+
if (statusCode >= 300) return "3xx";
|
|
50
|
+
return "2xx";
|
|
51
|
+
}
|
|
52
|
+
function createApiUsageTelemetry(options = {}) {
|
|
53
|
+
const emit = options.emit ?? trackEvent;
|
|
54
|
+
const now = options.now ?? Date.now;
|
|
55
|
+
const buckets = {
|
|
56
|
+
ok: { tokens: API_REQUEST_BUCKET_CAPACITY, refilledAt: now(), droppedBefore: 0 },
|
|
57
|
+
error: { tokens: API_REQUEST_BUCKET_CAPACITY, refilledAt: now(), droppedBefore: 0 }
|
|
58
|
+
};
|
|
59
|
+
const seenSessions = /* @__PURE__ */ new Set();
|
|
60
|
+
const takeToken = (bucket) => {
|
|
61
|
+
const at = now();
|
|
62
|
+
bucket.tokens = Math.min(API_REQUEST_BUCKET_CAPACITY, bucket.tokens + (at - bucket.refilledAt) * API_REQUEST_REFILL_PER_MS);
|
|
63
|
+
bucket.refilledAt = at;
|
|
64
|
+
if (bucket.tokens < 1) return false;
|
|
65
|
+
bucket.tokens -= 1;
|
|
66
|
+
return true;
|
|
67
|
+
};
|
|
68
|
+
return (info) => {
|
|
69
|
+
if (info.method === "OPTIONS" || info.method === "HEAD") return;
|
|
70
|
+
if (SKIPPED_ROUTE_PATTERN.test(info.route)) return;
|
|
71
|
+
const surface = classifyUsageSurface(info);
|
|
72
|
+
if (surface === "cli" || surface === "dashboard") return;
|
|
73
|
+
const labels = info.usageLabels;
|
|
74
|
+
const mcpClient = normalizeAgentSlug(labels.mcpClient);
|
|
75
|
+
const detected = normalizeAgentSlug(labels.agent);
|
|
76
|
+
const agent = detected && detected !== AGENT_NONE ? detected : mcpClient ?? detected ?? AGENT_NONE;
|
|
77
|
+
const mcpTool = labels.mcpTool && MCP_TOOL_PATTERN.test(labels.mcpTool) ? labels.mcpTool : void 0;
|
|
78
|
+
const mcpCallId = labels.mcpCall && MCP_CALL_ID_PATTERN.test(labels.mcpCall) ? labels.mcpCall.toLowerCase() : void 0;
|
|
79
|
+
const isMcp = surface === "mcp-stdio" || surface === "mcp-http";
|
|
80
|
+
if (isMcp && mcpTool && info.actorSession && !seenSessions.has(info.actorSession)) {
|
|
81
|
+
if (seenSessions.size >= MAX_TRACKED_MCP_SESSIONS) {
|
|
82
|
+
const oldest = seenSessions.values().next().value;
|
|
83
|
+
if (oldest !== void 0) seenSessions.delete(oldest);
|
|
84
|
+
}
|
|
85
|
+
seenSessions.add(info.actorSession);
|
|
86
|
+
emit("mcp.session.started", { surface, agent, ...mcpClient ? { mcpClient } : {} }, { source: "cli-server" });
|
|
87
|
+
}
|
|
88
|
+
const failed = info.statusCode >= 400;
|
|
89
|
+
const bucket = failed ? buckets.error : buckets.ok;
|
|
90
|
+
if (!takeToken(bucket)) {
|
|
91
|
+
bucket.droppedBefore += 1;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const droppedBefore = bucket.droppedBefore;
|
|
95
|
+
const properties = {
|
|
96
|
+
surface,
|
|
97
|
+
agent,
|
|
98
|
+
method: info.method,
|
|
99
|
+
route: info.route.slice(0, MAX_ROUTE_LENGTH),
|
|
100
|
+
statusClass: statusClass(info.statusCode),
|
|
101
|
+
durationBucket: bucketCliCommandDuration(info.durationMs),
|
|
102
|
+
...mcpClient ? { mcpClient } : {},
|
|
103
|
+
...mcpTool ? { mcpTool } : {},
|
|
104
|
+
...mcpCallId ? { mcpCallId } : {},
|
|
105
|
+
...droppedBefore > 0 ? { droppedBefore } : {}
|
|
106
|
+
};
|
|
107
|
+
bucket.droppedBefore = 0;
|
|
108
|
+
emit("api.request", properties, {
|
|
109
|
+
source: "cli-server",
|
|
110
|
+
...failed && info.errorCode ? { errorCode: info.errorCode } : {}
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/outcome-telemetry.ts
|
|
116
|
+
var STRICT = Boolean(process.env.VITEST);
|
|
117
|
+
function withoutUndefined(value) {
|
|
118
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
119
|
+
}
|
|
120
|
+
function send(event, schema, properties, errorCode) {
|
|
121
|
+
const parsed = schema.safeParse(withoutUndefined(properties));
|
|
122
|
+
if (!parsed.success) {
|
|
123
|
+
if (STRICT) throw new Error(`invalid ${event} telemetry: ${JSON.stringify(parsed.error)}`);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
trackEvent(event, parsed.data, errorCode ? { errorCode } : void 0);
|
|
127
|
+
}
|
|
128
|
+
function outcomeAttribution(attribution) {
|
|
129
|
+
if (!attribution || attribution.surfaceLabel === OutcomeSurfaces.system) return { surface: OutcomeSurfaces.system };
|
|
130
|
+
const surface = classifyUsageSurface({ userAgent: attribution.userAgent, usageLabels: { surface: attribution.surfaceLabel } });
|
|
131
|
+
const agent = normalizeAgentSlug(attribution.agentLabel) ?? void 0;
|
|
132
|
+
return agent ? { surface, agent } : { surface };
|
|
133
|
+
}
|
|
134
|
+
var MILESTONES_DIR = "telemetry-milestones";
|
|
135
|
+
var claimed = /* @__PURE__ */ new Set();
|
|
136
|
+
function isFirstSuccess(key) {
|
|
137
|
+
try {
|
|
138
|
+
if (!isTelemetryEnabled() || claimed.has(key)) return false;
|
|
139
|
+
const dir = path.join(getConfigDir(), MILESTONES_DIR);
|
|
140
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
141
|
+
const name = key.replace(/[^\w.-]/g, (c) => `~${c.charCodeAt(0).toString(16)}`);
|
|
142
|
+
claimed.add(key);
|
|
143
|
+
fs.closeSync(fs.openSync(path.join(dir, name), "wx"));
|
|
144
|
+
return true;
|
|
145
|
+
} catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function trackIntegrationConnection(properties, options = {}) {
|
|
150
|
+
const succeeded = properties.status === "succeeded" && (properties.action === "connect" || properties.action === "reauth");
|
|
151
|
+
const key = `connection:${properties.integration}${properties.provider ? `:${properties.provider}` : ""}`;
|
|
152
|
+
const first = succeeded && isFirstSuccess(key);
|
|
153
|
+
send("integration.connection", integrationConnectionPropertiesSchema, first ? { ...properties, first: true } : properties, options.errorCode ?? properties.reasonCode);
|
|
154
|
+
}
|
|
155
|
+
function trackFeatureCompleted(properties, options = {}) {
|
|
156
|
+
const first = properties.status === "succeeded" && isFirstSuccess(`feature:${properties.feature}.${properties.operation}`);
|
|
157
|
+
send("feature.completed", featureCompletedPropertiesSchema, first ? { ...properties, first: true } : properties, options.errorCode ?? properties.reasonCode);
|
|
158
|
+
}
|
|
159
|
+
function trackInstallState(properties) {
|
|
160
|
+
send("install.state", installStatePropertiesSchema, properties);
|
|
161
|
+
}
|
|
162
|
+
function handleRouteOutcome(event) {
|
|
163
|
+
const attributed = outcomeAttribution(event.attribution);
|
|
164
|
+
const properties = {
|
|
165
|
+
...event.properties,
|
|
166
|
+
surface: event.properties.surface ?? attributed.surface,
|
|
167
|
+
...event.properties.agent ?? attributed.agent ? { agent: event.properties.agent ?? attributed.agent } : {}
|
|
168
|
+
};
|
|
169
|
+
if (event.event === "integration.connection") {
|
|
170
|
+
trackIntegrationConnection(properties, { errorCode: event.errorCode });
|
|
171
|
+
} else {
|
|
172
|
+
const trigger = event.properties.trigger ?? (event.attribution ? outcomeTriggerFor(event.attribution) : void 0);
|
|
173
|
+
trackFeatureCompleted({ ...properties, ...trigger ? { trigger } : {} }, { errorCode: event.errorCode });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function outcomeTriggerFor(attribution) {
|
|
177
|
+
if (attribution.surfaceLabel === OutcomeSurfaces.system) return "scheduled";
|
|
178
|
+
const { surface } = outcomeAttribution(attribution);
|
|
179
|
+
const agentSurface = surface === OutcomeSurfaces["mcp-stdio"] || surface === OutcomeSurfaces["mcp-http"] || surface === OutcomeSurfaces.aero;
|
|
180
|
+
return agentSurface ? "agent" : "manual";
|
|
181
|
+
}
|
|
182
|
+
function currentOutcomeOrigin() {
|
|
183
|
+
try {
|
|
184
|
+
const attribution = currentOutcomeAttribution();
|
|
185
|
+
return attribution ? { trigger: outcomeTriggerFor(attribution), ...outcomeAttribution(attribution) } : void 0;
|
|
186
|
+
} catch {
|
|
187
|
+
return void 0;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function outcomeFailure(err, reasonCode) {
|
|
191
|
+
const classified = classifyOutcomeError(err);
|
|
192
|
+
return reasonCode ? { ...classified, reasonCode } : classified;
|
|
193
|
+
}
|
|
194
|
+
function startOutcomeTimer(now = Date.now) {
|
|
195
|
+
const started = now();
|
|
196
|
+
return () => bucketDuration(now() - started);
|
|
197
|
+
}
|
|
198
|
+
function createOutcomeSampler(options = {}) {
|
|
199
|
+
const burst = options.burst ?? 20;
|
|
200
|
+
const refillMs = options.refillMs ?? 1e4;
|
|
201
|
+
const now = options.now ?? Date.now;
|
|
202
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
203
|
+
return (key) => {
|
|
204
|
+
const t = now();
|
|
205
|
+
const bucket = buckets.get(key) ?? { tokens: burst, at: t, dropped: 0 };
|
|
206
|
+
bucket.tokens = Math.min(burst, bucket.tokens + (t - bucket.at) / refillMs);
|
|
207
|
+
bucket.at = t;
|
|
208
|
+
buckets.set(key, bucket);
|
|
209
|
+
if (bucket.tokens < 1) {
|
|
210
|
+
bucket.dropped += 1;
|
|
211
|
+
return { send: false };
|
|
212
|
+
}
|
|
213
|
+
bucket.tokens -= 1;
|
|
214
|
+
const droppedBefore = bucket.dropped;
|
|
215
|
+
bucket.dropped = 0;
|
|
216
|
+
return droppedBefore > 0 ? { send: true, droppedBefore } : { send: true };
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export {
|
|
221
|
+
classifyUsageSurface,
|
|
222
|
+
createApiUsageTelemetry,
|
|
223
|
+
outcomeAttribution,
|
|
224
|
+
trackIntegrationConnection,
|
|
225
|
+
trackFeatureCompleted,
|
|
226
|
+
trackInstallState,
|
|
227
|
+
handleRouteOutcome,
|
|
228
|
+
currentOutcomeOrigin,
|
|
229
|
+
outcomeFailure,
|
|
230
|
+
startOutcomeTimer,
|
|
231
|
+
createOutcomeSampler
|
|
232
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BUNDLED_SKILL_NAMES,
|
|
3
2
|
configExists,
|
|
4
|
-
installSkills,
|
|
5
3
|
loadConfigRaw,
|
|
6
4
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OFL4PTYU.js";
|
|
6
|
+
import {
|
|
7
|
+
BUNDLED_SKILL_NAMES,
|
|
8
|
+
installSkills
|
|
9
|
+
} from "./chunk-TALC5DX5.js";
|
|
8
10
|
import {
|
|
9
11
|
PACKAGE_VERSION
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AOJU5LKX.js";
|
|
11
13
|
import {
|
|
12
14
|
SKILL_MANIFEST_FILENAME,
|
|
13
15
|
SkillsClients
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-O4RMPA6H.js";
|
|
15
17
|
|
|
16
18
|
// src/skills-autosync.ts
|
|
17
19
|
import fs from "fs";
|