agenttwin 0.3.43 → 0.3.44
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/api.js +26430 -4497
- package/dist/dashboard/assets/next/static/chunks/1937-6d51d4e124712da3.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{7772-f2d773cd3e94eea6.js → 3481-38a2a90084247ab1.js} +6 -6
- package/dist/dashboard/assets/next/static/chunks/6259-3689e5642b66d78c.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/8176-80d26c1ba3e96c09.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/_not-found/{page-cbf0a4f7672335b8.js → page-d3c4451763af3bb2.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/about/page-e8f70f456b3e001f.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/account/password/page-13d4d6cf28183f27.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/api-policy/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/auth/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/blog/{layout-89f2942330b48007.js → layout-47a0e404f3655e69.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/compare/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/contact/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-00f2a0cb3dd9dfcc.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/page-d2f69d996bda5b65.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/demo/{page-9e977d1d883f7386.js → page-0ebf741047bacc39.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/developers/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/{page-aea3b669bcb45491.js → page-f9e33ed2f89fd53d.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/dpa/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/enterprise/page-526ed9ed987ec1ab.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/guides/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/{layout-bc1ef1623bd1dca6.js → layout-8e8607ccec674a88.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/login/page-0fdb6c325a08152f.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/not-found-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-aa8315fd545cfcab.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/page-563661520c08bc87.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/{enterprise/page-ce47c76b4160b3c9.js → pricing/page-0d9e6abaa82f633b.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/privacy/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/sandbox/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/scoreboard/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/security/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-0fdb6c325a08152f.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/status/{page-d075703822281526.js → page-1dce1a7886e3e6f0.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/subprocessors/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/terms/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-eac4c37292388b51.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-d82d70f6caa12d7c.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-ece40a44e9fbe945.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-52b97f3b9b06f7f7.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-b5f3b1ecfef066bb.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-e63b0b6f3f0512e0.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-52b97f3b9b06f7f7.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/what-is-agenttwin/page-e6ac9852938ee195.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{main-app-85f4e8de9868bedc.js → main-app-8016af41043dfe3d.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{webpack-382af3529e0fbd25.js → webpack-5e3b77bcb344d4ed.js} +1 -1
- package/dist/dashboard/assets/next/static/css/481ca6c2928cd200.css +1 -0
- package/dist/dashboard/assets/next/static/css/9b2210225877b730.css +1 -0
- package/dist/dashboard/assets/next/static/css/{f55186d294d5c4d4.css → d9a8b84d1f38505a.css} +2 -2
- package/dist/dashboard/assets/next/static/css/{11f70fd04660da57.css → dbba4df791f6fafa.css} +1 -1
- package/dist/dashboard/assets/next/static/css/{41d14b615c51789f.css → f219b6480a7505ef.css} +1 -1
- package/dist/dashboard/index.html +2 -2
- package/dist/discover-worker.js +315 -36
- package/dist/engine.js +27081 -5120
- package/dist/gateway.js +26443 -4510
- package/dist/scan-worker.js +20755 -667
- package/dist/worker.js +1174 -445
- package/dist/world-host.js +1239 -467
- package/package.json +1 -1
- package/dist/dashboard/assets/next/static/chunks/1937-6c86fddc443de922.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/2960-520ffde27b062af4.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/5258-3d0060b41be9ad97.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/about/page-6e8e140ea96e4e5e.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/account/password/page-124ac1de3af2d687.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/api-policy/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/auth/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/compare/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/contact/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-0262e35e50882ab7.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/page-943e07dc51384546.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/developers/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dpa/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/guides/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/login/page-9a6e88fc56812fbb.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/not-found-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-9c1bd81087260f4f.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/page-7849ed5b53ffb2d1.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/pricing/page-2e2f53160e686d9e.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/privacy/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/sandbox/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/scoreboard/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/security/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-9a6e88fc56812fbb.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/subprocessors/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/terms/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-22d3ae1def1dd220.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-1b768bed2b8a2747.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-38b897124c7f6223.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-91f11cbfe46c4c25.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-64dd3f1b59afe38a.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-9191727c63b6ce2e.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-91f11cbfe46c4c25.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/what-is-agenttwin/page-35fd8f4fe3b2af15.js +0 -1
- package/dist/dashboard/assets/next/static/css/14ef6d1b7f922ef2.css +0 -1
- package/dist/dashboard/assets/next/static/css/39133c9a03c8edb8.css +0 -1
- package/dist/dashboard/assets/next/static/css/8f1b98de253e73ed.css +0 -1
- package/dist/dashboard/assets/next/static/css/c3d3b671693fb96d.css +0 -1
- package/dist/dashboard/assets/next/static/css/dd3fb06005e18149.css +0 -1
- package/dist/dashboard/assets/next/static/css/f14e187b236cb6fb.css +0 -1
- /package/dist/dashboard/assets/next/static/{sxtodXehxQTT0-7MaA4p7 → 485syozzbgr0SePb1vNxp}/_buildManifest.js +0 -0
- /package/dist/dashboard/assets/next/static/{sxtodXehxQTT0-7MaA4p7 → 485syozzbgr0SePb1vNxp}/_ssgManifest.js +0 -0
package/dist/discover-worker.js
CHANGED
|
@@ -906,9 +906,78 @@ var BASE_URL = /\b(?:baseURL|baseUrl|base_url)\s*[:=]\s*[`'"]https:\/\/([a-z0-9]
|
|
|
906
906
|
var API_HOST = /[`'"]https:\/\/(api\.[a-z0-9][a-z0-9.-]*\.[a-z]{2,})/gi;
|
|
907
907
|
var NOT_A_SERVICE = /(^|\.)(localhost|example\.(com|org|net)|[a-z0-9-]+\.(test|local|internal|invalid|example)|schema\.org|w3\.org|json-schema\.org|github\.com|githubusercontent\.com|npmjs\.(com|org)|unpkg\.com|jsdelivr\.net|cdnjs\.cloudflare\.com|fonts\.(googleapis|gstatic)\.com)$/i;
|
|
908
908
|
var MAX_HTTP_HOSTS = 40;
|
|
909
|
+
var URL_LITERAL = /https?:\/\/[a-z0-9][a-z0-9.-]*\.[a-z]{2,}/gi;
|
|
910
|
+
var SITE_URL_ASSIGN = /(?:baseUrl|baseURL|base_url|siteUrl|siteURL|site_url|appUrl|appURL|publicUrl|publicURL|canonicalUrl|homepage|website|origin)\s*[:=]\s*[`'"](https?:\/\/[^`'"\s]+)/gi;
|
|
911
|
+
function hostnameOf(url) {
|
|
912
|
+
try {
|
|
913
|
+
return new URL(url).hostname.toLowerCase();
|
|
914
|
+
} catch {
|
|
915
|
+
return void 0;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
function registrableDomain(host) {
|
|
919
|
+
const parts = host.toLowerCase().split(".").filter(Boolean);
|
|
920
|
+
return parts.slice(-2).join(".");
|
|
921
|
+
}
|
|
922
|
+
function registrableLabel(host) {
|
|
923
|
+
const parts = host.toLowerCase().split(".").filter(Boolean);
|
|
924
|
+
return (parts.length >= 2 ? parts[parts.length - 2] : parts[0]) ?? "";
|
|
925
|
+
}
|
|
926
|
+
function packageLabels(names) {
|
|
927
|
+
const labels = /* @__PURE__ */ new Set();
|
|
928
|
+
for (const name of names) {
|
|
929
|
+
const base = name.replace(/^@[^/]+\//, "").replace(/^@/, "");
|
|
930
|
+
const tokens = base.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter((token) => token && !["app", "apps", "web", "api", "core", "server", "client", "www", "ui", "site", "frontend", "backend"].includes(token));
|
|
931
|
+
const joined = tokens.join("");
|
|
932
|
+
if (joined.length >= 4) labels.add(joined);
|
|
933
|
+
}
|
|
934
|
+
return [...labels];
|
|
935
|
+
}
|
|
936
|
+
async function ownHostMatcher(ctx) {
|
|
937
|
+
const names = [];
|
|
938
|
+
const configFiles = await ctx.files.byName(
|
|
939
|
+
/(^|\/)(package\.json|next\.config\.[cm]?[jt]s|nuxt\.config\.[cm]?[jt]s|vite\.config\.[cm]?[jt]s|astro\.config\.[cm]?[jt]s|svelte\.config\.[cm]?[jt]s|env(?:\.[^/]*)?\.[cm]?[jt]s|\.env(?:\.[^/]+)?)$/i
|
|
940
|
+
);
|
|
941
|
+
for (const path of configFiles.slice(0, 50)) {
|
|
942
|
+
const text = await ctx.files.read(path, 1e6);
|
|
943
|
+
if (!text) continue;
|
|
944
|
+
if (/(^|\/)package\.json$/.test(path)) {
|
|
945
|
+
try {
|
|
946
|
+
const pkg = JSON.parse(text);
|
|
947
|
+
if (typeof pkg.name === "string") names.push(pkg.name);
|
|
948
|
+
if (typeof pkg.homepage === "string") {
|
|
949
|
+
const host = hostnameOf(pkg.homepage);
|
|
950
|
+
if (host) names.push(registrableLabel(host));
|
|
951
|
+
}
|
|
952
|
+
} catch {
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
const labels = packageLabels(names);
|
|
957
|
+
const domains = /* @__PURE__ */ new Set();
|
|
958
|
+
const matchesLabel = (host) => {
|
|
959
|
+
const label = registrableLabel(host).replace(/[^a-z0-9]/g, "");
|
|
960
|
+
return labels.some((l) => label === l || label === `get${l}` || label === `${l}hq` || label === `${l}app`);
|
|
961
|
+
};
|
|
962
|
+
for (const path of configFiles.slice(0, 50)) {
|
|
963
|
+
const text = await ctx.files.read(path, 1e6);
|
|
964
|
+
if (!text) continue;
|
|
965
|
+
for (const match of text.matchAll(URL_LITERAL)) {
|
|
966
|
+
const host = hostnameOf(match[0]);
|
|
967
|
+
if (host && matchesLabel(host)) domains.add(registrableDomain(host));
|
|
968
|
+
}
|
|
969
|
+
SITE_URL_ASSIGN.lastIndex = 0;
|
|
970
|
+
for (let match = SITE_URL_ASSIGN.exec(text); match; match = SITE_URL_ASSIGN.exec(text)) {
|
|
971
|
+
const host = hostnameOf(match[1]);
|
|
972
|
+
if (host) domains.add(registrableDomain(host));
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return (host) => domains.has(registrableDomain(host)) || matchesLabel(host);
|
|
976
|
+
}
|
|
909
977
|
async function scanHttpHosts(ctx, files) {
|
|
910
978
|
const known = ctx.providers.all().flatMap((p) => p.signatures.hosts ?? []);
|
|
911
979
|
const claimed = (host) => known.some((h) => host === h || host.endsWith("." + h));
|
|
980
|
+
const ownHost = await ownHostMatcher(ctx);
|
|
912
981
|
const hosts = /* @__PURE__ */ new Map();
|
|
913
982
|
for (const path of files) {
|
|
914
983
|
if (hosts.size >= MAX_HTTP_HOSTS) break;
|
|
@@ -918,7 +987,7 @@ async function scanHttpHosts(ctx, files) {
|
|
|
918
987
|
re.lastIndex = 0;
|
|
919
988
|
for (let m = re.exec(text); m; m = re.exec(text)) {
|
|
920
989
|
const host = m[1].toLowerCase().replace(/\.$/, "");
|
|
921
|
-
if (NOT_A_SERVICE.test(host) || claimed(host)) continue;
|
|
990
|
+
if (NOT_A_SERVICE.test(host) || claimed(host) || ownHost(host)) continue;
|
|
922
991
|
const evidence = hosts.get(host) ?? [];
|
|
923
992
|
if (evidence.length < MAX_EVIDENCE) evidence.push({ ref: `${path}:${lineOf(text, m[0])}`, pass: "static", signal: "host", detail: host });
|
|
924
993
|
hosts.set(host, evidence);
|
|
@@ -999,18 +1068,12 @@ var envVarDetector = {
|
|
|
999
1068
|
title: "Environment variables",
|
|
1000
1069
|
pass: "environment",
|
|
1001
1070
|
async detect(ctx) {
|
|
1002
|
-
const names = envNames();
|
|
1003
1071
|
const dotenv = await dotenvKeys(ctx.files);
|
|
1004
1072
|
const findings = [];
|
|
1005
1073
|
for (const provider of ctx.providers.all()) {
|
|
1006
1074
|
const prefixes = provider.signatures.envPrefixes ?? [];
|
|
1007
1075
|
if (prefixes.length === 0) continue;
|
|
1008
1076
|
const evidence = [];
|
|
1009
|
-
for (const name of names) {
|
|
1010
|
-
if (prefixes.some((p) => name.startsWith(p)) && (provider.id !== "github" || GITHUB_CONFIG_NAMES.has(name))) {
|
|
1011
|
-
evidence.push({ ref: `env:${name}`, pass: "environment", signal: "env" });
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
1077
|
for (const { ref, key: key2 } of dotenv) {
|
|
1015
1078
|
if (prefixes.some((p) => key2.startsWith(p)) && (provider.id !== "github" || GITHUB_CONFIG_NAMES.has(key2))) {
|
|
1016
1079
|
evidence.push({ ref, pass: "environment", signal: "env", detail: key2 });
|
|
@@ -1217,7 +1280,7 @@ var ENTERPRISE_OPTIONAL_COLLECTIONS = {
|
|
|
1217
1280
|
workday: ["/workers", "/timeOffRequests"],
|
|
1218
1281
|
sap: ["/A_BusinessPartner", "/A_SalesOrder"],
|
|
1219
1282
|
"microsoft-teams": ["/channels", "/chats", "/messages"],
|
|
1220
|
-
outlook: ["/messages"],
|
|
1283
|
+
outlook: ["/messages", "/mailFolders", "/subscriptions", "/tokens", "/grants"],
|
|
1221
1284
|
"entra-id": ["/users", "/groups", "/groupMembers"],
|
|
1222
1285
|
okta: ["/users", "/groups", "/groupMemberships"],
|
|
1223
1286
|
confluence: ["/pages", "/spaces", "/comments"],
|
|
@@ -1275,10 +1338,10 @@ var ENTERPRISE_CONTRACTS = {
|
|
|
1275
1338
|
limitations: ["No adaptive card rendering, mentions resolution, reactions, edits, deletes, meetings or change notifications"]
|
|
1276
1339
|
},
|
|
1277
1340
|
outlook: {
|
|
1278
|
-
version: "1.
|
|
1279
|
-
authentication: "Bearer run-scoped test token (Graph access token shape)",
|
|
1280
|
-
operations: [op("POST", "/v1.0/me/sendMail (or /users/<id>/sendMail)", "send mail (202); stored in sentitems", ["400 ErrorInvalidRecipients"]), op("GET", "/v1.0/me/messages, /me/mailFolders/<
|
|
1281
|
-
limitations: ["No attachments,
|
|
1341
|
+
version: "1.1.0",
|
|
1342
|
+
authentication: "Bearer run-scoped test token (Graph access token shape); OAuth token endpoint posts form-encoded client credentials",
|
|
1343
|
+
operations: [op("POST", "/v1.0/me/sendMail (or /users/<id>/sendMail)", "send mail (202); stored in sentitems", ["400 ErrorInvalidRecipients"]), op("GET", "/v1.0/me/messages, /me/mailFolders/<id>/messages, /users/<id>/messages", "list with $filter eq, $top, $select"), op("POST", "/v1.0/me/messages", "create a draft message (201)"), op("GET|PATCH", "/v1.0/me/messages/<id>", "read / update isRead, categories, importance, flag", ["404 ErrorItemNotFound"]), op("POST", "/v1.0/me/messages/<id>/{reply|replyAll|forward}", "reply, reply-all or forward (202)", ["400 ErrorInvalidRecipients"]), op("POST", "/v1.0/me/messages/<id>/move", "move to a recognized mail folder (201)", ["400 ErrorInvalidRequest"]), op("GET", "/v1.0/me/messages/delta, /me/mailFolders/<id>/messages/delta", "delta page with @odata.deltaLink; $deltaToken resumes after the messages already returned"), op("GET", "/v1.0/me/mailFolders[/<id>]", "list or read folders with computed totalItemCount/unreadItemCount"), op("GET|POST", "/v1.0/subscriptions", "list / create a change subscription (201)", ["400 BadRequest"]), op("GET|PATCH|DELETE", "/v1.0/subscriptions/<id>", "read / renew expirationDateTime / delete (204)", ["404 ErrorItemNotFound"]), op("POST", "/<tenant>/oauth2/v2.0/token", "client_credentials and refresh_token grants issue synthetic access tokens", ["400 invalid_grant", "400 unsupported_grant_type", "401 invalid_client"])],
|
|
1344
|
+
limitations: ["No attachments, calendar, rules or change-notification delivery; inbound mail exists only as seeded records", "Delta tokens are synthetic mailbox positions, not Graph change tracking; $filter supports eq/ne/ge/le/gt/lt, dotted paths and categories/any(c:c eq), with $top, $select and $orderby; $search, $expand and paging beyond $top are not modelled", "Tokens are synthetic and are not validated by the Graph routes"]
|
|
1282
1345
|
},
|
|
1283
1346
|
"entra-id": {
|
|
1284
1347
|
version: "1.0.0",
|
|
@@ -1509,6 +1572,16 @@ var CONTRACTS = {
|
|
|
1509
1572
|
{ method: "GET", endpoint: "/gmail/v1/users/me/labels", effect: "list seeded labels", parameters: [], errors: [] },
|
|
1510
1573
|
{ method: "POST", endpoint: "/gmail/v1/users/me/labels", effect: "create a user label", parameters: ["name", "labelListVisibility", "messageListVisibility", "color"], errors: ["400 invalid name", "409 name exists"] },
|
|
1511
1574
|
{ method: "POST", endpoint: "/gmail/v1/users/me/{messages|threads}/<id>/modify", effect: "add and remove labels on a message or every message of a thread; bumps the mailbox historyId", parameters: ["addLabelIds", "removeLabelIds"], errors: ["400 Invalid label", "404 not found"] },
|
|
1575
|
+
{ method: "POST", endpoint: "/gmail/v1/users/me/messages/batchModify", effect: "add and remove labels on up to 1000 message ids (204)", parameters: ["ids", "addLabelIds", "removeLabelIds"], errors: ["400 ids required", "400 Invalid label"] },
|
|
1576
|
+
{ method: "POST", endpoint: "/gmail/v1/users/me/{messages|threads}/<id>/trash", effect: "add TRASH and remove INBOX on a message or every message of a thread; returns the updated record", parameters: [], errors: ["404 not found"] },
|
|
1577
|
+
{ method: "POST", endpoint: "/gmail/v1/users/me/{messages|threads}/<id>/untrash", effect: "remove TRASH and add INBOX on a message or every message of a thread; returns the updated record", parameters: [], errors: ["404 not found"] },
|
|
1578
|
+
{ method: "GET", endpoint: "/gmail/v1/users/me/labels/<id>", effect: "retrieve one label", parameters: [], errors: ["404 not found"] },
|
|
1579
|
+
{ method: "PATCH/PUT", endpoint: "/gmail/v1/users/me/labels/<id>", effect: "update a user label (name, visibility, color); system labels are fixed", parameters: ["name", "labelListVisibility", "messageListVisibility", "color"], errors: ["400 Invalid label", "409 name exists"] },
|
|
1580
|
+
{ method: "DELETE", endpoint: "/gmail/v1/users/me/labels/<id>", effect: "delete a user label and remove it from every message (204)", parameters: [], errors: ["400 system label", "404 not found"] },
|
|
1581
|
+
{ method: "GET", endpoint: "/gmail/v1/users/me/messages/<id>/attachments/<attachmentId>", effect: "read the base64url data of an attachment a seeded message payload part names", parameters: [], errors: ["404 not found"] },
|
|
1582
|
+
{ method: "GET|POST", endpoint: "/gmail/v1/users/me/settings/filters", effect: "list filters / create one with criteria and action", parameters: ["criteria", "action"], errors: ["400 criteria and action required"] },
|
|
1583
|
+
{ method: "DELETE", endpoint: "/gmail/v1/users/me/settings/filters/<id>", effect: "delete a filter (204)", parameters: [], errors: ["404 not found"] },
|
|
1584
|
+
{ method: "GET", endpoint: "/gmail/v1/users/me/settings/forwardingAddresses", effect: "list seeded forwarding addresses", parameters: [], errors: [] },
|
|
1512
1585
|
{ method: "GET", endpoint: "/gmail/v1/users/me/threads", effect: "list threads, newest first, excluding SPAM/TRASH", parameters: ["q (from:/to: address terms, OR-joined)", "maxResults", "labelIds"], errors: ["400 validation"] },
|
|
1513
1586
|
{ method: "GET", endpoint: "/gmail/v1/users/me/threads/<id>", effect: "retrieve a thread with its messages, oldest first", parameters: ["format=full"], errors: ["404 NOT_FOUND"] },
|
|
1514
1587
|
{ method: "GET", endpoint: "/gmail/v1/users/me/history", effect: "messagesAdded records for messages whose historyId is after startHistoryId", parameters: ["startHistoryId", "historyTypes", "maxResults"], errors: ["400 validation"] },
|
|
@@ -1526,7 +1599,7 @@ var CONTRACTS = {
|
|
|
1526
1599
|
{ method: "POST", endpoint: "/gmail/v1/users/me/drafts/send", effect: "send a draft: its message becomes SENT in the same thread and the draft is removed", parameters: ["id", "message.raw", "message.threadId (same thread only)"], errors: ["400 missing id, invalid MIME or no recipient", "404 unknown draft"] },
|
|
1527
1600
|
{ method: "POST", endpoint: "/batch/gmail/v1", effect: "multipart batch of up to 100 body-less GET messages/<id> or threads/<id> requests", parameters: ["multipart/mixed body"], errors: ["400 malformed batch"] }
|
|
1528
1601
|
],
|
|
1529
|
-
limitations: ["Bounded Gmail v1 subset: send, messages list/get, labels, threads list/get, sendAs list, drafts create/list/get/update/delete/send (JSON and media upload), history list,
|
|
1602
|
+
limitations: ["Bounded Gmail v1 subset: send, messages list/get/modify/batchModify/trash/untrash/insert/attachments.get, labels list/get/create/update/delete, threads list/get/modify/trash/untrash, sendAs and forwardingAddresses list, settings.filters list/create/delete, drafts create/list/get/update/delete/send (JSON and media upload), history list, watch/stop with loopback Pub/Sub push and read-only batch", "Sends and drafts accept folded/UTF-8 encoded headers, quoted-printable/base64 bodies and text or multipart/alternative text+html, without attachments", "Search supports from:/to: address terms, rfc822msgid: and plain terms matched against the snippet and Subject/From/To headers; pageToken is a synthetic zero-based offset, and label changes appear in history as the changed message rather than separate labelsAdded/labelsRemoved records; Pub/Sub push is delivered once with no retry, ack deadline or ordering guarantees, and only to loopback endpoints", "Draft records add flat threadId, to, subject, inReplyTo and references evidence fields for assertions", "attachments.get serves attachment ids on seeded message payloads only: multipart/mixed MIME is still refused, so sent/inserted messages cannot carry attachments", "Unknown fields and operations return 501 and make coverage incomplete"]
|
|
1530
1603
|
},
|
|
1531
1604
|
"upstash-redis": {
|
|
1532
1605
|
version: "1.0.0",
|
|
@@ -1538,6 +1611,51 @@ var CONTRACTS = {
|
|
|
1538
1611
|
],
|
|
1539
1612
|
limitations: ["Commands run on AgentTwin's in-process Redis engine (strings, hashes, lists, sets, sorted sets, expiry), not Redis itself", "Keys are mirrored in /keys as {key, type, value, expireAt?} rows", "EVAL/EVALSHA/scripts, blocking pops, pub/sub subscriptions, MULTI/EXEC/WATCH inside a request and any engine-unknown command return 501", "Expiry uses the host clock; no replication, persistence, ACLs or read-your-writes sync tokens"]
|
|
1540
1613
|
},
|
|
1614
|
+
posthog: {
|
|
1615
|
+
version: "1.0.0",
|
|
1616
|
+
authentication: "Bearer run-scoped test token; the project api_key travels in the body",
|
|
1617
|
+
operations: [
|
|
1618
|
+
{ method: "POST", endpoint: "/capture, /e, /i/v0/e", effect: "append one event to /events and answer {status:1}", parameters: ["event", "distinct_id", "properties", "timestamp"], errors: ["400 event and distinct_id required"] },
|
|
1619
|
+
{ method: "POST", endpoint: "/batch", effect: "append every event in batch to /events", parameters: ["batch[].event", "batch[].distinct_id", "batch[].properties"], errors: ["400 batch must be a non-empty array", "400 entry missing event/distinct_id"] },
|
|
1620
|
+
{ method: "POST", endpoint: "/decide", effect: "feature flag values for a person, from seeded /feature_flags", parameters: ["api_key", "distinct_id", "groups"], errors: ["400 api_key required"] },
|
|
1621
|
+
{ method: "POST", endpoint: "/flags", effect: "flag detail map in the /flags response shape", parameters: ["api_key", "distinct_id"], errors: ["400 api_key required"] }
|
|
1622
|
+
],
|
|
1623
|
+
limitations: ["Events and flag definitions are world state; nothing is forwarded", "No person profiles, session recordings, cohorts, capture gzip decoding, export or query endpoints", "Feature flags evaluate seeded active/enabled flags only; no condition sets, variants or percentage rollout", "Unknown routes and fields return 501 and make coverage incomplete"]
|
|
1624
|
+
},
|
|
1625
|
+
tinybird: {
|
|
1626
|
+
version: "1.0.0",
|
|
1627
|
+
authentication: "Bearer run-scoped test token; an existing Tinybird token is accepted as the run token",
|
|
1628
|
+
operations: [
|
|
1629
|
+
{ method: "POST", endpoint: "/v0/events?name=<datasource>", effect: "append NDJSON or JSON events; answers successful_rows and quarantined_rows", parameters: ["name", "wait", "mode=append|replace"], errors: ["400 name required", "400 invalid NDJSON/JSON"] },
|
|
1630
|
+
{ method: "POST", endpoint: "/v0/datasources?name=<datasource>", effect: "append rows through the classic Data Sources API", parameters: ["name", "mode=append|replace", "data"], errors: ["400 name required", "400 invalid body"] },
|
|
1631
|
+
{ method: "GET", endpoint: "/v0/pipes/<pipe>.json", effect: "query stored events, or the seeded /pipe:<name> rows, with equality filters and limit", parameters: ["datasource", "limit", "offset"], errors: ["400 invalid limit"] },
|
|
1632
|
+
{ method: "GET", endpoint: "/v0/datasources, /v0/pipes", effect: "list datasources and pipes the twin holds", parameters: [], errors: [] }
|
|
1633
|
+
],
|
|
1634
|
+
limitations: ["Events are kept in world collections, not a ClickHouse-backed Tinybird workspace", "No pipe SQL, transforms, copies, jobs, tokens, workspaces or materialized views; CSV/TSV bodies are refused", "Pipe queries support equality filters and limit only; no aggregations or joins", "Unknown routes and parameters return 501 and make coverage incomplete"]
|
|
1635
|
+
},
|
|
1636
|
+
lemonsqueezy: {
|
|
1637
|
+
version: "1.0.0",
|
|
1638
|
+
authentication: "Bearer run-scoped test token; JSON:API bodies",
|
|
1639
|
+
operations: [
|
|
1640
|
+
{ method: "POST|GET", endpoint: "/v1/checkouts", effect: "create a checkout with a synthetic url, or list them", parameters: ["data.attributes.store_id", "data.attributes.variant_id"], errors: ["400 store_id/variant_id required", "404 not found"] },
|
|
1641
|
+
{ method: "GET", endpoint: "/v1/checkouts/<id>", effect: "retrieve a checkout", parameters: [], errors: ["404 Not Found"] },
|
|
1642
|
+
{ method: "POST|GET", endpoint: "/v1/subscriptions", effect: "record a subscription, or list them", parameters: ["data.attributes.store_id", "data.attributes.status"], errors: ["400 store_id required"] },
|
|
1643
|
+
{ method: "GET|PATCH", endpoint: "/v1/subscriptions/<id>", effect: "read / update status or cancelled", parameters: ["data.attributes.status", "data.attributes.cancelled"], errors: ["404 Not Found", "400 invalid status"] }
|
|
1644
|
+
],
|
|
1645
|
+
limitations: ["Checkouts and subscriptions only; licenses, orders, customers, stores, variants and discount endpoints are not modelled", "No webhook delivery to the application: lemonSqueezySignature() computes the X-Signature value for an envelope the test supplies", "JSON:API pagination links are synthetic; status transitions are not validated against Lemon Squeezy rules", "Unknown routes and fields return 501 and make coverage incomplete"]
|
|
1646
|
+
},
|
|
1647
|
+
qstash: {
|
|
1648
|
+
version: "1.0.0",
|
|
1649
|
+
authentication: "Bearer run-scoped test token (the QStash token header)",
|
|
1650
|
+
operations: [
|
|
1651
|
+
{ method: "POST", endpoint: "/v2/publish/<destination-url>", effect: "record a message with its forwarded headers and schedule options; answers {messageId}", parameters: ["Upstash-Forward-*", "Upstash-Retries", "Upstash-Delay", "Upstash-Not-Before", "Upstash-Cron", "Upstash-Callback"], errors: ["400 destination must be http(s)"] },
|
|
1652
|
+
{ method: "GET|DELETE", endpoint: "/v2/messages[/<id>]", effect: "list, read or cancel recorded messages", parameters: [], errors: ["404 message not found"] },
|
|
1653
|
+
{ method: "POST", endpoint: "/v2/schedules/<destination-url>", effect: "record a schedule; answers {scheduleId}", parameters: ["Upstash-Cron", "Upstash-Not-Before"], errors: ["400 destination must be http(s)", "400 invalid cron"] },
|
|
1654
|
+
{ method: "GET|DELETE", endpoint: "/v2/schedules[/<id>]", effect: "list, read or delete schedules", parameters: [], errors: ["404 schedule not found"] },
|
|
1655
|
+
{ method: "GET|POST", endpoint: "/v2/signing-keys", effect: "read or rotate the current/next signing keys", parameters: [], errors: [] }
|
|
1656
|
+
],
|
|
1657
|
+
limitations: ["Messages and schedules are recorded, not delivered to their destinations", "Signing keys are synthetic and not tied to a real QStash account; qstashSignature() computes the Upstash-Signature JWT for a receiver check", "No flow control, deduplication, callbacks invocation, DLQ or queue logs", "Unknown routes and fields return 501 and make coverage incomplete"]
|
|
1658
|
+
},
|
|
1541
1659
|
"google-calendar": {
|
|
1542
1660
|
version: "1.1.0",
|
|
1543
1661
|
authentication: "Bearer run-scoped test token; Google-style OAuth2 Bearer header",
|
|
@@ -1839,6 +1957,12 @@ function partialMerged(adapters) {
|
|
|
1839
1957
|
return { implemented: true, supported: adapters.flatMap((a) => CONTRACTS[a].operations.map((operation) => `${operation.method} ${operation.endpoint}`)), verified: [], unknown: [...adapters.flatMap((a) => [...CONTRACTS[a].limitations]), "Customer workflow coverage requires preparation and execution"] };
|
|
1840
1958
|
}
|
|
1841
1959
|
var NO_TWIN = ["all behavior (no twin implemented)"];
|
|
1960
|
+
function compatible(title) {
|
|
1961
|
+
return { implemented: true, supported: [`OpenAI-compatible chat completions served by the OpenAI twin (${title})`], verified: [], unknown: [`${title}'s non-OpenAI endpoints are not modelled`, "Customer workflow coverage requires preparation and execution"] };
|
|
1962
|
+
}
|
|
1963
|
+
function packTwin(pack) {
|
|
1964
|
+
return { implemented: true, supported: [`Vendor twin pack: ${pack}`], verified: [], unknown: ["Pack coverage requires preparation and execution"] };
|
|
1965
|
+
}
|
|
1842
1966
|
var PROVIDERS2 = [
|
|
1843
1967
|
{
|
|
1844
1968
|
id: "betterstack",
|
|
@@ -2288,6 +2412,71 @@ var PROVIDERS2 = [
|
|
|
2288
2412
|
category: "observability",
|
|
2289
2413
|
twin: partial("pagerduty"),
|
|
2290
2414
|
signatures: { packages: { node: ["@pagerduty/pdjs", "node-pagerduty"], python: ["pdpyras", "pagerduty"], go: ["github.com/PagerDuty/go-pagerduty"] }, imports: ["@pagerduty/pdjs", "pdpyras", "go-pagerduty"], hosts: ["api.pagerduty.com", "events.pagerduty.com"], envPrefixes: ["PAGERDUTY_", "PD_API_"] }
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
id: "posthog",
|
|
2418
|
+
title: "PostHog",
|
|
2419
|
+
category: "observability",
|
|
2420
|
+
twin: partial("posthog"),
|
|
2421
|
+
signatures: { packages: { node: ["posthog-node", "posthog-js", "@posthog/react"], python: ["posthog"], go: ["github.com/posthog/posthog-go"], ruby: ["posthog-ruby"] }, imports: ["posthog-node", "posthog-js", "posthog"], hosts: ["us.i.posthog.com", "eu.i.posthog.com", "app.posthog.com", "us.posthog.com", "eu.posthog.com"], envPrefixes: ["POSTHOG_", "NEXT_PUBLIC_POSTHOG_"] },
|
|
2422
|
+
docs: "https://posthog.com/docs/api"
|
|
2423
|
+
},
|
|
2424
|
+
{
|
|
2425
|
+
id: "tinybird",
|
|
2426
|
+
title: "Tinybird",
|
|
2427
|
+
category: "analytics",
|
|
2428
|
+
twin: partial("tinybird"),
|
|
2429
|
+
signatures: { packages: { node: ["@tinybirdco/sdk", "@tinybirdco/flock.js"], python: ["tinybird", "tinybird-cli"], go: ["github.com/tinybirdco/tinybird-go-sdk"] }, imports: ["@tinybirdco/sdk", "tinybird", "tinybird-go-sdk"], hosts: ["api.tinybird.co", "cloud.tinybird.co", "tinybird.co"], envPrefixes: ["TINYBIRD_"] },
|
|
2430
|
+
docs: "https://www.tinybird.co/docs/api-reference"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
id: "lemonsqueezy",
|
|
2434
|
+
title: "Lemon Squeezy",
|
|
2435
|
+
category: "payments",
|
|
2436
|
+
twin: partial("lemonsqueezy"),
|
|
2437
|
+
signatures: { packages: { node: ["@lemonsqueezy/lemonsqueezy.js"], python: ["lemonsqueezy"], go: ["github.com/lemonsqueezy/lemonsqueezy-go"] }, imports: ["@lemonsqueezy/lemonsqueezy.js", "lemonsqueezy"], hosts: ["api.lemonsqueezy.com"], envPrefixes: ["LEMONSQUEEZY_", "LEMON_SQUEEZY_"], webhookPaths: ["/webhooks/lemon-squeezy", "/webhooks/lemonsqueezy", "/api/webhooks/lemon-squeezy"] }
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
id: "qstash",
|
|
2441
|
+
title: "Upstash QStash",
|
|
2442
|
+
category: "queue",
|
|
2443
|
+
twin: partial("qstash"),
|
|
2444
|
+
signatures: { packages: { node: ["@upstash/qstash"], python: ["qstash"], go: ["github.com/upstash/qstash-go"] }, imports: ["@upstash/qstash", "qstash"], hosts: ["qstash.upstash.io", "qstash-us-east-1.upstash.io", "qstash-eu-central-1.upstash.io", "qstash-us-west-1.upstash.io"], envPrefixes: ["QSTASH_"] },
|
|
2445
|
+
docs: "https://upstash.com/docs/qstash/api"
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
id: "cerebras",
|
|
2449
|
+
title: "Cerebras",
|
|
2450
|
+
category: "ai",
|
|
2451
|
+
twin: compatible("Cerebras"),
|
|
2452
|
+
signatures: { packages: { node: ["@cerebras/cerebras_cloud_sdk", "@ai-sdk/cerebras"], python: ["cerebras-cloud-sdk"] }, imports: ["@cerebras/cerebras_cloud_sdk", "@ai-sdk/cerebras", "cerebras"], hosts: ["api.cerebras.ai"], envPrefixes: ["CEREBRAS_"] }
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
// Azure OpenAI (and the Azure SDK's other resource endpoints). The bundled `azure` pack already models
|
|
2456
|
+
// *.openai.azure.com; without this descriptor the analyzer saw @azure/openai but had no provider to
|
|
2457
|
+
// resolve, so the pack was never reached.
|
|
2458
|
+
id: "azure",
|
|
2459
|
+
title: "Azure OpenAI",
|
|
2460
|
+
category: "ai",
|
|
2461
|
+
twin: packTwin("azure"),
|
|
2462
|
+
signatures: { packages: { node: ["@azure/openai", "@azure-rest/ai-inference", "@ai-sdk/azure", "@azure/storage-blob"], python: ["azure-ai-inference", "azure-storage-blob"], dotnet: ["Azure.AI.OpenAI"] }, imports: ["@azure/openai", "@azure-rest/ai-inference", "@ai-sdk/azure", "AzureOpenAI"], hosts: ["openai.azure.com", "cognitiveservices.azure.com", "blob.core.windows.net"], envPrefixes: ["AZURE_OPENAI_", "AZURE_"] },
|
|
2463
|
+
docs: "https://learn.microsoft.com/azure/ai-services/openai/"
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
id: "braintrust",
|
|
2467
|
+
title: "Braintrust",
|
|
2468
|
+
category: "observability",
|
|
2469
|
+
twin: planned(NO_TWIN),
|
|
2470
|
+
signatures: { packages: { node: ["braintrust", "@braintrust/sdk"], python: ["braintrust"], go: ["github.com/braintrustdata/braintrust-sdk-go"] }, imports: ["braintrust", "@braintrust/"], hosts: ["api.braintrust.dev", "api.braintrustdata.com"], envPrefixes: ["BRAINTRUST_"] },
|
|
2471
|
+
docs: "https://www.braintrust.dev/docs"
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
id: "appstore",
|
|
2475
|
+
title: "App Store Server API",
|
|
2476
|
+
category: "payments",
|
|
2477
|
+
twin: planned(NO_TWIN),
|
|
2478
|
+
signatures: { packages: { node: ["@apple/app-store-server-library"], python: ["app-store-server-library"], go: ["github.com/apple/app-store-server-library-go"] }, imports: ["@apple/app-store-server-library", "app_store_server_library"], hosts: ["api.storekit.itunes.apple.com", "api.storekit-sandbox.itunes.apple.com", "appstoreconnect.apple.com"], envPrefixes: ["APPLE_", "APPSTORE_", "APP_STORE_"], webhookPaths: ["/api/apple/webhook", "/webhooks/apple", "/api/webhooks/apple"] },
|
|
2479
|
+
docs: "https://developer.apple.com/documentation/appstoreserverapi"
|
|
2291
2480
|
}
|
|
2292
2481
|
];
|
|
2293
2482
|
for (const [id, title, category, node, python, hosts] of [
|
|
@@ -3002,7 +3191,7 @@ var packRecord = (name) => {
|
|
|
3002
3191
|
};
|
|
3003
3192
|
|
|
3004
3193
|
// src/inventory/service-coverage.ts
|
|
3005
|
-
var TWIN_ADAPTERS = ["openai", "anthropic", "stripe", "slack", "github", "linear", "notion", "hubspot", "shopify", "datadog", "gmail", "google-calendar", "gitlab", "jira", "discord", "twilio", "zendesk", "google-oauth", "composio", ...ENTERPRISE_ADAPTERS];
|
|
3194
|
+
var TWIN_ADAPTERS = ["openai", "anthropic", "stripe", "slack", "github", "linear", "notion", "hubspot", "shopify", "datadog", "gmail", "google-calendar", "gitlab", "jira", "discord", "twilio", "zendesk", "google-oauth", "composio", "posthog", "tinybird", "lemonsqueezy", "qstash", ...ENTERPRISE_ADAPTERS];
|
|
3006
3195
|
var PACK_STRIPE_OPERATIONS = /* @__PURE__ */ new Set([
|
|
3007
3196
|
"accounts.create",
|
|
3008
3197
|
"accountLinks.create",
|
|
@@ -3325,6 +3514,18 @@ var TOOL_PACKAGES = /^(ai|@openai\/agents(-core)?|@langchain\/core\/tools|langch
|
|
|
3325
3514
|
var TOOL_FACTORIES = /^(tool|betaZodTool|betaTool|createTool|dynamicTool|FunctionTool|DynamicStructuredTool|DynamicTool|StructuredTool)$/;
|
|
3326
3515
|
var BOLT_LISTENERS = /^(event|message|command|action|shortcut|view|options|function)$/;
|
|
3327
3516
|
var FN = /^(FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
|
|
3517
|
+
var wrappedRouteHandler = (init) => {
|
|
3518
|
+
const call = unwrap(init);
|
|
3519
|
+
if (call?.type !== "CallExpression") return;
|
|
3520
|
+
for (const argument of [...call.arguments ?? []].reverse()) {
|
|
3521
|
+
if (argument.type === "ArrowFunctionExpression" || argument.type === "FunctionExpression") return argument;
|
|
3522
|
+
}
|
|
3523
|
+
};
|
|
3524
|
+
var wrappedRouteName = (init) => {
|
|
3525
|
+
const call = unwrap(init);
|
|
3526
|
+
if (call?.type !== "CallExpression") return;
|
|
3527
|
+
for (const argument of [...call.arguments ?? []].reverse()) if (argument.type === "Identifier") return argument.name;
|
|
3528
|
+
};
|
|
3328
3529
|
function routeFilePath(path) {
|
|
3329
3530
|
const app = /(?:^|\/)app\/((?:.*\/)?)route\.[cm]?[jt]sx?$/.exec(path);
|
|
3330
3531
|
if (app) return { kind: "app", path: "/" + app[1].split("/").filter((s) => s && !/^\(.*\)$/.test(s) && !s.startsWith("@")).join("/") };
|
|
@@ -3361,6 +3562,8 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3361
3562
|
const call = unwrap(init);
|
|
3362
3563
|
return call?.type === "CallExpression" && call.callee.type === "Identifier" && call.callee.name === "require" && call.arguments[0]?.type === "StringLiteral" ? call.arguments[0].value : void 0;
|
|
3363
3564
|
};
|
|
3565
|
+
const route = routeFilePath(path);
|
|
3566
|
+
const wrappedCalls = [];
|
|
3364
3567
|
for (const item of ast.program.body) {
|
|
3365
3568
|
if (item.type === "ImportDeclaration" && item.importKind !== "type") {
|
|
3366
3569
|
const target = resolve2(path, item.source.value);
|
|
@@ -3428,7 +3631,17 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3428
3631
|
continue;
|
|
3429
3632
|
}
|
|
3430
3633
|
if (fn && ["ArrowFunctionExpression", "FunctionExpression"].includes(fn.type)) addFunction(variable.id.name, fn, exported);
|
|
3431
|
-
else if (
|
|
3634
|
+
else if (exported && route) {
|
|
3635
|
+
const handler = wrappedRouteHandler(variable.init);
|
|
3636
|
+
if (handler) addFunction(variable.id.name, handler, true);
|
|
3637
|
+
else {
|
|
3638
|
+
const callee = wrappedRouteName(variable.init);
|
|
3639
|
+
if (callee) wrappedCalls.push({ name: variable.id.name, callee, line: variable.loc?.start.line ?? variable.init.loc?.start.line ?? 1 });
|
|
3640
|
+
else if (fn && variable.init.loc) mod.values.set(variable.id.name, { ...unit(variable.id.name, variable.init, exported), value: true });
|
|
3641
|
+
}
|
|
3642
|
+
} else if (exported && !/^use[A-Z]/.test(variable.id.name) && wrappedHandler(variable.init)) {
|
|
3643
|
+
addFunction(variable.id.name, wrappedHandler(variable.init), true);
|
|
3644
|
+
} else if (fn && variable.init.loc) {
|
|
3432
3645
|
mod.values.set(variable.id.name, { ...unit(variable.id.name, variable.init, exported), value: true });
|
|
3433
3646
|
const literal = (n) => {
|
|
3434
3647
|
const v = unwrap(n);
|
|
@@ -3474,7 +3687,17 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3474
3687
|
if (node.type === "AssignmentExpression") bind(node.left.type === "Identifier" ? node.left.name : node.left.type === "MemberExpression" && node.left.object.type === "ThisExpression" ? "this." + propertyName(node.left.property) : void 0, node.right);
|
|
3475
3688
|
if (node.type === "ClassProperty" && node.value) bind("this." + propertyName(node.key), node.value);
|
|
3476
3689
|
});
|
|
3477
|
-
const
|
|
3690
|
+
for (const wrapped of wrappedCalls) {
|
|
3691
|
+
mod.functions.set(wrapped.name, {
|
|
3692
|
+
path,
|
|
3693
|
+
name: wrapped.name,
|
|
3694
|
+
exported: true,
|
|
3695
|
+
trigger: false,
|
|
3696
|
+
node: { type: "CallExpression", callee: { type: "Identifier", name: wrapped.callee }, arguments: [] },
|
|
3697
|
+
startLine: wrapped.line,
|
|
3698
|
+
endLine: wrapped.line
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3478
3701
|
if (route) for (const [name, fn] of mod.functions) {
|
|
3479
3702
|
if (!fn.exported) continue;
|
|
3480
3703
|
const method = HTTP_METHODS.includes(name) ? name : name === "default" && route.kind !== "app" ? "HTTP" : void 0;
|
|
@@ -3555,7 +3778,19 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3555
3778
|
if ((node.type === "CallExpression" || node.type === "NewExpression") && node.callee.type === "Identifier" && TOOL_FACTORIES.test(node.callee.name) && TOOL_PACKAGES.test(mod.packages.get(node.callee.name) ?? "")) {
|
|
3556
3779
|
const config = node.arguments.find((a) => a.type === "ObjectExpression");
|
|
3557
3780
|
const named = config?.properties.find((p) => ["name", "id"].includes(propertyName(p.key) ?? ""));
|
|
3558
|
-
const
|
|
3781
|
+
const telemetry = (() => {
|
|
3782
|
+
let found;
|
|
3783
|
+
walk2(node, (part) => {
|
|
3784
|
+
if (found || part.type !== "ObjectProperty" || part.computed) return;
|
|
3785
|
+
const key2 = propertyName(part.key);
|
|
3786
|
+
if (!["tool", "toolName"].includes(key2 ?? "")) return;
|
|
3787
|
+
const value = unwrap(part.value);
|
|
3788
|
+
if (value?.type === "StringLiteral" && /^[A-Za-z][\w.-]{1,64}$/.test(value.value)) found = value.value;
|
|
3789
|
+
});
|
|
3790
|
+
return found;
|
|
3791
|
+
})();
|
|
3792
|
+
const enclosing = [...mod.functions.values()].filter((fn) => fn.startLine <= node.loc.start.line && fn.endLine >= node.loc.end.line).sort((a, b) => a.endLine - a.startLine - (b.endLine - b.startLine))[0];
|
|
3793
|
+
const name = literalText(named?.value) ?? node.arguments.map((a) => a.type === "ObjectExpression" ? literalText(a.properties.find((p) => propertyName(p.key) === "name")?.value) : void 0).find(Boolean) ?? telemetry ?? toolNames.get(node) ?? enclosing?.name ?? path.split("/").pop().replace(/\.[^.]+$/, "");
|
|
3559
3794
|
mod.routes.push({ ...unit(`tool:${name}@${node.loc.start.line}`, node, false, true) });
|
|
3560
3795
|
return;
|
|
3561
3796
|
}
|
|
@@ -3694,8 +3929,13 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3694
3929
|
httpOperation(path, mod, node, node.arguments[index], fetchMethod(node.arguments[index + 1]), node.arguments[index + 1]);
|
|
3695
3930
|
});
|
|
3696
3931
|
const adjacency = /* @__PURE__ */ new Map();
|
|
3697
|
-
const resolveCalls = (entry) => {
|
|
3698
|
-
|
|
3932
|
+
const resolveCalls = (entry, valueDepth) => {
|
|
3933
|
+
let depths = adjacency.get(entry);
|
|
3934
|
+
if (!depths) {
|
|
3935
|
+
depths = /* @__PURE__ */ new Map();
|
|
3936
|
+
adjacency.set(entry, depths);
|
|
3937
|
+
}
|
|
3938
|
+
const cached2 = depths.get(valueDepth);
|
|
3699
3939
|
if (cached2) return cached2;
|
|
3700
3940
|
const found = /* @__PURE__ */ new Set();
|
|
3701
3941
|
const mod = modules.get(entry.path);
|
|
@@ -3707,12 +3947,16 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3707
3947
|
return names;
|
|
3708
3948
|
};
|
|
3709
3949
|
const byName = (name, calls) => {
|
|
3710
|
-
const local = mod.functions.get(name)
|
|
3950
|
+
const local = mod.functions.get(name);
|
|
3711
3951
|
if (local) return local;
|
|
3952
|
+
const value = mod.values.get(name);
|
|
3953
|
+
if (value) return calls || valueDepth === 0 ? value : void 0;
|
|
3712
3954
|
const imported = mod.imports.get(name);
|
|
3713
3955
|
const target = imported ? lookupExport(imported.path, imported.name) : void 0;
|
|
3714
|
-
if (target && (target.exported || imported?.name === "default"))
|
|
3715
|
-
|
|
3956
|
+
if (target && (target.exported || imported?.name === "default")) {
|
|
3957
|
+
if (!calls && target.value && valueDepth > 0) return void 0;
|
|
3958
|
+
return target;
|
|
3959
|
+
}
|
|
3716
3960
|
};
|
|
3717
3961
|
const scan = (node, shadowed, parent, key2) => {
|
|
3718
3962
|
if (!node || typeof node !== "object") return;
|
|
@@ -3772,7 +4016,7 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3772
4016
|
};
|
|
3773
4017
|
scan(entry.node, boundNames(entry.parameters ?? []));
|
|
3774
4018
|
const result = [...found];
|
|
3775
|
-
|
|
4019
|
+
depths.set(valueDepth, result);
|
|
3776
4020
|
return result;
|
|
3777
4021
|
};
|
|
3778
4022
|
const byPath = /* @__PURE__ */ new Map();
|
|
@@ -3814,7 +4058,7 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3814
4058
|
const containsTrigger = (unit) => [...triggers].some((t) => t !== unit && registration(t) && t.path === unit.path && t.startLine >= unit.startLine && t.endLine <= unit.endLine);
|
|
3815
4059
|
const uiOnly = (unit) => !unit.trigger && (/(^|\/)(components?|hooks|ui)\//.test(unit.path) || /\.(tsx|jsx)$/.test(unit.path) && /^[A-Z]/.test(unit.name) || /^use[A-Z]/.test(unit.name) || /(^|\/)(page|layout)\.[jt]sx?$/.test(unit.path));
|
|
3816
4060
|
const lineCache = /* @__PURE__ */ new Map();
|
|
3817
|
-
const orderedEffects = (entry,
|
|
4061
|
+
const orderedEffects = (entry, depths) => {
|
|
3818
4062
|
const lines = lineCache.get(entry.path) ?? (sources.get(entry.path) ?? "").split("\n");
|
|
3819
4063
|
lineCache.set(entry.path, lines);
|
|
3820
4064
|
const inEntry = (line) => entry.ranges ? entry.ranges.some(([a, b]) => line >= a && line <= b) : line >= entry.startLine && line <= entry.endLine;
|
|
@@ -3830,13 +4074,13 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3830
4074
|
const queue = [entry];
|
|
3831
4075
|
while (queue.length) {
|
|
3832
4076
|
const current = queue.shift();
|
|
3833
|
-
for (const child of resolveCalls(current)) {
|
|
3834
|
-
if (position.has(child)
|
|
4077
|
+
for (const child of resolveCalls(current, depths.get(current) ?? 0)) {
|
|
4078
|
+
if (position.has(child)) continue;
|
|
3835
4079
|
position.set(child, current === entry ? callSite(child) ?? Number.MAX_SAFE_INTEGER : position.get(current));
|
|
3836
4080
|
queue.push(child);
|
|
3837
4081
|
}
|
|
3838
4082
|
}
|
|
3839
|
-
const keyed = [...
|
|
4083
|
+
const keyed = [...depths.keys()].flatMap((unit) => effects(unit).map((op2) => ({ op: op2, key: unit === entry ? op2.line : position.get(unit) ?? Number.MAX_SAFE_INTEGER })));
|
|
3840
4084
|
keyed.sort((x, y) => x.key - y.key || (x.op.path === y.op.path ? x.op.line - y.op.line : 0));
|
|
3841
4085
|
return [...new Set(keyed.map((k) => k.op))];
|
|
3842
4086
|
};
|
|
@@ -3846,16 +4090,21 @@ function workflowGraph(sources, operations, tools, options = {}) {
|
|
|
3846
4090
|
if (!entry.exported && !entry.trigger) continue;
|
|
3847
4091
|
if (uiOnly(entry)) continue;
|
|
3848
4092
|
if (!entry.trigger && mod.routes.some((route) => route.startLine >= entry.startLine && route.endLine <= entry.endLine)) continue;
|
|
3849
|
-
const
|
|
4093
|
+
const depths = /* @__PURE__ */ new Map([[entry, 0]]);
|
|
3850
4094
|
const pending = [entry];
|
|
3851
4095
|
while (pending.length) {
|
|
3852
|
-
const current = pending.
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
4096
|
+
const current = pending.shift();
|
|
4097
|
+
const depth = depths.get(current) ?? 0;
|
|
4098
|
+
for (const child of resolveCalls(current, depth)) {
|
|
4099
|
+
const next = child.value ? depth + 1 : depth;
|
|
4100
|
+
if ((depths.get(child) ?? Number.POSITIVE_INFINITY) <= next) continue;
|
|
4101
|
+
depths.set(child, next);
|
|
4102
|
+
pending.push(child);
|
|
4103
|
+
}
|
|
3856
4104
|
}
|
|
4105
|
+
const visited = new Set(depths.keys());
|
|
3857
4106
|
if ((entry.name.startsWith("script:") || !entry.trigger) && [...visited].some((u) => u !== entry && (triggers.has(u) && registration(u) || containsTrigger(u)))) continue;
|
|
3858
|
-
const calls = orderedEffects(entry,
|
|
4107
|
+
const calls = orderedEffects(entry, depths);
|
|
3859
4108
|
if (!entry.trigger && !calls.some((call) => call.kind === "writes" || call.kind === "emits")) continue;
|
|
3860
4109
|
if (entry.name.startsWith("script:") && !calls.length) continue;
|
|
3861
4110
|
entries.push({ ...entry, unit: entry, calls, reach: visited, evidence: [...visited].map((u) => ({ source: "static", ref: `${u.path}:${u.startLine}` })) });
|
|
@@ -5226,6 +5475,15 @@ function toolFromInspection(finding, result) {
|
|
|
5226
5475
|
};
|
|
5227
5476
|
}
|
|
5228
5477
|
var SERVICEISH = /(_URL|_URI|_ENDPOINT|_HOST|_DSN|_API_KEY|_API|_KEY|_TOKEN|_BUCKET|_QUEUE|_TOPIC)$/i;
|
|
5478
|
+
var HOST_EVIDENCE = /^(?:command:|credential:|docker:ps$|env:)/;
|
|
5479
|
+
var CI_CONFIG = /(^|\/)(?:\.github\/workflows\/|\.gitlab-ci\.ya?ml$|\.circleci\/|\.buildkite\/|Jenkinsfile$|azure-pipelines\.ya?ml$)/i;
|
|
5480
|
+
function metadataOnly(tool) {
|
|
5481
|
+
const refs = tool.facts.flatMap((fact) => fact.evidence.map((e) => e.ref));
|
|
5482
|
+
return refs.length > 0 && refs.every((ref) => HOST_EVIDENCE.test(ref) || CI_CONFIG.test(ref));
|
|
5483
|
+
}
|
|
5484
|
+
function repositoryFacts(tool) {
|
|
5485
|
+
return tool.facts.map((fact) => ({ ...fact, evidence: fact.evidence.filter((e) => !HOST_EVIDENCE.test(e.ref)) })).filter((fact) => fact.evidence.length > 0);
|
|
5486
|
+
}
|
|
5229
5487
|
var TOOL_KINDS = /* @__PURE__ */ new Set([
|
|
5230
5488
|
"external-api",
|
|
5231
5489
|
"database",
|
|
@@ -5276,7 +5534,6 @@ function collectUnclassified(manifest, dotenv) {
|
|
|
5276
5534
|
reason: "service-shaped environment variable with no matching provider signature"
|
|
5277
5535
|
});
|
|
5278
5536
|
};
|
|
5279
|
-
for (const name of envNames()) consider(name, `env:${name}`);
|
|
5280
5537
|
for (const { ref, key: key2 } of dotenv) consider(key2, ref);
|
|
5281
5538
|
for (const endpoint of manifest.endpoints) {
|
|
5282
5539
|
if (!endpoint.providerId) {
|
|
@@ -5360,7 +5617,28 @@ async function buildInventory({
|
|
|
5360
5617
|
});
|
|
5361
5618
|
}
|
|
5362
5619
|
const excluded = new Set(decisions.filter((d) => d.kind === "exclude_tool").map((d) => d.target));
|
|
5363
|
-
const
|
|
5620
|
+
const repository = {
|
|
5621
|
+
languages: [...new Set(manifest.findings.filter((f) => f.kind === "language").map((f) => f.title))].sort(),
|
|
5622
|
+
ci: [...new Set(manifest.findings.filter((f) => f.kind === "ci").map((f) => f.title))].sort(),
|
|
5623
|
+
vcs: []
|
|
5624
|
+
};
|
|
5625
|
+
const vcs = /* @__PURE__ */ new Map();
|
|
5626
|
+
const vcsKey = (value) => value.toLowerCase().replace(/^www\./, "").split(".")[0].replace(/[^a-z0-9]/g, "");
|
|
5627
|
+
const addVcs = (title, providerId) => {
|
|
5628
|
+
const provider = PROVIDERS2.find((p) => p.id === providerId || p.category === "vcs" && vcsKey(p.title) === vcsKey(title));
|
|
5629
|
+
const display = provider?.title ?? title;
|
|
5630
|
+
vcs.set(vcsKey(display), display);
|
|
5631
|
+
};
|
|
5632
|
+
const toolList = [...tools.values()].filter((t) => !excluded.has(t.id) && !t.aliases.some((a) => excluded.has(a))).flatMap((tool) => {
|
|
5633
|
+
if (tool.kind === "vcs" && metadataOnly(tool)) {
|
|
5634
|
+
addVcs(tool.title, tool.providerId);
|
|
5635
|
+
return [];
|
|
5636
|
+
}
|
|
5637
|
+
if (tool.kind === "runtime") return [];
|
|
5638
|
+
const facts = repositoryFacts(tool);
|
|
5639
|
+
return facts.length > 0 ? [{ ...tool, facts }] : [];
|
|
5640
|
+
}).sort((a, b) => a.id.localeCompare(b.id));
|
|
5641
|
+
repository.vcs = [...vcs.values()].sort();
|
|
5364
5642
|
const apps = await detectApps(files);
|
|
5365
5643
|
const services = apps.map((app) => ({ id: app.id, title: app.title, frameworks: app.frameworks })).sort((a, b) => a.id.localeCompare(b.id));
|
|
5366
5644
|
const { relationships, workflows: staticWorkflows, gaps, uncertainOperations } = await buildRelationships(
|
|
@@ -5417,6 +5695,7 @@ async function buildInventory({
|
|
|
5417
5695
|
cwd: manifest.cwd,
|
|
5418
5696
|
roots,
|
|
5419
5697
|
tools: toolList,
|
|
5698
|
+
repository,
|
|
5420
5699
|
services,
|
|
5421
5700
|
relationships,
|
|
5422
5701
|
workflows,
|
|
@@ -5734,7 +6013,7 @@ import { join as join7 } from "path";
|
|
|
5734
6013
|
// package.json
|
|
5735
6014
|
var package_default = {
|
|
5736
6015
|
name: "agenttwin",
|
|
5737
|
-
version: "0.3.
|
|
6016
|
+
version: "0.3.44",
|
|
5738
6017
|
description: "AgentTwin builds digital twins for testing AI agents. The current CLI prepares supported Node.js workflows with synthetic services, failures, and outcome checks.",
|
|
5739
6018
|
mcpName: "io.github.AgentTwin/agenttwin",
|
|
5740
6019
|
keywords: [
|