agenttwin 0.3.45 → 0.3.46
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 +153 -56
- package/dist/dashboard/assets/next/static/chunks/app/_not-found/{page-90e7c4625d67caa3.js → page-ca2a678442778cc4.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/about/{page-7b6ab8f6081f5e77.js → page-f12d76165cc1cfdb.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/account/password/{page-037fec5f56012be1.js → page-c2ce3c796c817ca1.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/{auth/page-540d65d1057a7527.js → api-policy/page-dc4de82f3c8b5ee5.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/{compare/page-540d65d1057a7527.js → auth/page-dc4de82f3c8b5ee5.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/blog/{layout-1f35c9c8280d8e88.js → layout-52698c1f7512ab03.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/{contact/page-540d65d1057a7527.js → compare/page-dc4de82f3c8b5ee5.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/{api-policy/page-540d65d1057a7527.js → contact/page-dc4de82f3c8b5ee5.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-b5ef02cb8f06edca.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/{page-7ee71756cadd81da.js → page-e175e18f842b558f.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/demo/{page-fa467521a350a22e.js → page-4dc63755e0013e7c.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/developers/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/{page-2f02d1a4e3c44daa.js → page-ba0ec7ecc08eff9f.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/dpa/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/enterprise/page-4bc33047e4c9fe8e.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/guides/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/layout-cd911546738f01ed.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/login/page-d6d4276397724d29.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/not-found-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/{page-0ef60a890802e3ea.js → page-40532b5cef9a88c1.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/page-a8275b37886e34a8.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/{enterprise/page-5d3aa113786c4257.js → pricing/page-8f3a108c73f12071.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/privacy/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/sandbox/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/scoreboard/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/security/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-d6d4276397724d29.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/status/page-b39797a55d029518.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/subprocessors/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/terms/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-09d48e9ba6876ea1.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-031ee9c843b9c428.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-abbd9f3b8811f559.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-4f4a342a4c28f9de.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/{page-cb95f6e08d868cb9.js → page-efea46ea53572102.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-4c5b8b508cf0da4c.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-4f4a342a4c28f9de.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/what-is-agenttwin/page-dc4de82f3c8b5ee5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{main-app-09f87cf7a6813e7b.js → main-app-1ec13ceef4a34729.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{webpack-956fc59a9b8e1c9d.js → webpack-b34c6469f0501f3e.js} +1 -1
- package/dist/dashboard/index.html +2 -2
- package/dist/discover-worker.js +1 -1
- package/dist/engine.js +153 -56
- package/dist/gateway.js +153 -56
- package/dist/scan-worker.js +2 -1
- package/dist/worker.js +5 -0
- package/dist/world-host.js +5 -0
- package/package.json +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-0a7a4610c777d4ca.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/developers/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dpa/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/guides/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/layout-f1fad0b3adfa8650.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/login/page-0fcaa825ae57072e.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/not-found-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/page-02d88045d016e184.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/pricing/page-b20818439dc8daa3.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/privacy/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/sandbox/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/scoreboard/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/security/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-0fcaa825ae57072e.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/status/page-477b90a47b806b39.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/subprocessors/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/terms/page-540d65d1057a7527.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-f3b848d905696aa6.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-5114d5bc25cc925a.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-c5a3a914ad02b396.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-391350c8e39d35fe.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-ba5549311d95d01d.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-391350c8e39d35fe.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/what-is-agenttwin/page-540d65d1057a7527.js +0 -1
- /package/dist/dashboard/assets/next/static/{iCEc5bCzyYUPa74FKyLIp → pGgp6m8IvF1eEP2vBkhqX}/_buildManifest.js +0 -0
- /package/dist/dashboard/assets/next/static/{iCEc5bCzyYUPa74FKyLIp → pGgp6m8IvF1eEP2vBkhqX}/_ssgManifest.js +0 -0
package/dist/api.js
CHANGED
|
@@ -3489,6 +3489,10 @@ function installRetry(step, output2) {
|
|
|
3489
3489
|
const pm = step.command === "corepack" || step.command === "npx" ? step.args.find((a) => /^(npm|pnpm|yarn|bun)(@|$)/.test(a))?.split("@")[0] : step.command;
|
|
3490
3490
|
const tail = step.command === "corepack" ? step.args.slice(1) : step.command === "npx" ? step.args.slice(2) : step.args;
|
|
3491
3491
|
const pinned = step.command === "corepack" || step.command === "npx" ? step.args.find((a) => /^(npm|pnpm|yarn|bun)(@|$)/.test(a)) : pm;
|
|
3492
|
+
if (pm === "pnpm" && /Failed to switch pnpm|ERR_PNPM_BAD_PM_VERSION|manage-package-manager-versions/i.test(output2) && !step.args.some((a) => a.includes("manage-package-manager-versions")))
|
|
3493
|
+
return { why: "pnpm could not switch to the pinned version", step: { ...step, args: ["--config.manage-package-manager-versions=false", ...step.args] } };
|
|
3494
|
+
if (pm === "pnpm" && /ERR_PNPM_UNUSED_PATCH/.test(output2) && !step.args.some((a) => a.includes("allow-unused-patches")))
|
|
3495
|
+
return { why: "pnpm rejected an unused patch in the lockfile", step: { ...step, args: [...step.args, "--config.allow-unused-patches=true"] } };
|
|
3492
3496
|
if (pm === "pnpm" && /ERR_PNPM_(OUTDATED_LOCKFILE|LOCKFILE_CONFIG_MISMATCH|LOCKFILE_MISSING_DEPENDENCY)|frozen.lockfile|specifiers in the lockfile/i.test(output2))
|
|
3493
3497
|
return { why: "The lockfile is behind package.json, so a frozen install stops", step: { ...step, args: [...step.args, "--no-frozen-lockfile"] } };
|
|
3494
3498
|
const lockfile = pm === "pnpm" ? /lockfileVersion[\s│|]+of[\s│|]+(\d+)(?:\.(\d+))?[\s│|]+is[\s│|]+incompatible/i.exec(output2) : null;
|
|
@@ -3550,8 +3554,8 @@ async function runSetup(cwd, opts) {
|
|
|
3550
3554
|
const buildLimitMs = Number(process.env.AGENTTWIN_SETUP_BUILD_TIMEOUT_MS) || 20 * 6e4;
|
|
3551
3555
|
let timedOut = false;
|
|
3552
3556
|
let installedManager;
|
|
3553
|
-
const exec12 = (step) => new Promise((resolve27) => {
|
|
3554
|
-
const child = spawn2(step.command, step.args, { cwd: step.dir, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"], env: { ...BUILD_PLACEHOLDERS, ...process.env, CI: "1", COREPACK_ENABLE_DOWNLOAD_PROMPT: "0", ...shims ? { PATH: `${shims}${delimiter}${process.env.PATH ?? ""}` } : {} } });
|
|
3557
|
+
const exec12 = (step, extraEnv) => new Promise((resolve27) => {
|
|
3558
|
+
const child = spawn2(step.command, step.args, { cwd: step.dir, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"], env: { ...BUILD_PLACEHOLDERS, ...process.env, ...extraEnv ?? {}, CI: "1", COREPACK_ENABLE_DOWNLOAD_PROMPT: "0", ...shims ? { PATH: `${shims}${delimiter}${process.env.PATH ?? ""}` } : {} } });
|
|
3555
3559
|
let tail = "";
|
|
3556
3560
|
const keep = (c) => {
|
|
3557
3561
|
tail = (tail + c.toString()).slice(-4e3);
|
|
@@ -3587,12 +3591,12 @@ async function runSetup(cwd, opts) {
|
|
|
3587
3591
|
opts.log(` The build was still running after ${Math.round(buildLimitMs / 6e4)} min, so it was stopped. What it finished stays built: run npx agenttwin again to carry on, or run it from the folder of the one service you want to test so only its packages are built. (Set AGENTTWIN_SETUP_BUILD_TIMEOUT_MS to change the limit.)`);
|
|
3588
3592
|
return false;
|
|
3589
3593
|
}
|
|
3590
|
-
for (let current2 = step, tries = 0; code !== 0 && step.id === "install" && tries < 3; tries++) {
|
|
3594
|
+
for (let current2 = step, tries = 0; code !== 0 && (step.id === "install" || /Failed to switch pnpm|ERR_PNPM_BAD_PM_VERSION|manage-package-manager-versions/i.test(tail)) && tries < 3; tries++) {
|
|
3591
3595
|
const retry = installRetry(current2, tail);
|
|
3592
3596
|
if (!retry) break;
|
|
3593
3597
|
opts.log(` ${retry.why}; running ${show(retry.step)}\u2026`);
|
|
3594
3598
|
current2 = retry.step;
|
|
3595
|
-
({ code, tail } = await exec12(retry.step));
|
|
3599
|
+
({ code, tail } = await exec12(retry.step, retry.step.args.some((a) => a.includes("manage-package-manager-versions")) ? { npm_config_manage_package_manager_versions: "false", pnpm_config_manage_package_manager_versions: "false" } : void 0));
|
|
3596
3600
|
}
|
|
3597
3601
|
let left = code !== 0 && step.id === "build" && plan.unbuilt ? unbuiltWorkspacePackages(cwd, opts.appDir) : void 0;
|
|
3598
3602
|
if (left?.length) {
|
|
@@ -10608,6 +10612,11 @@ var init_http_world = __esm({
|
|
|
10608
10612
|
const target2 = aliasRequest(name, host, req.url ?? "/");
|
|
10609
10613
|
const model = compatibleModel(name, body2);
|
|
10610
10614
|
const r = await twin(new Request(`https://${target2.host}${target2.url}`, { method, headers, ...model.body ? { body: model.body } : {} }));
|
|
10615
|
+
if ((r.status === 501 || r.status === 404) && name === "ai-gateway" && method === "GET" && /^\/(?:v1\/)?models\/([^/]+\/[^/]+)\/endpoints$/.test(target2.url.split("?")[0])) {
|
|
10616
|
+
const id2 = /^\/(?:v1\/)?models\/([^/]+\/[^/]+)\/endpoints$/.exec(target2.url.split("?")[0])[1];
|
|
10617
|
+
const payload = Buffer.from(JSON.stringify({ data: { id: id2, name: id2, endpoints: [{ name: id2, provider: id2.split("/")[0] || "openai", context_length: 128e3, pricing: { prompt: "0", completion: "0" }, supported_parameters: ["tools", "temperature", "max_tokens"] }] } }));
|
|
10618
|
+
return { status: 200, headers: new Headers({ "content-type": "application/json" }), bytes: payload, actions: [] };
|
|
10619
|
+
}
|
|
10611
10620
|
return { status: r.status, headers: r.headers, bytes: model.restore(Buffer.from(await r.arrayBuffer())), actions: log.drain() };
|
|
10612
10621
|
};
|
|
10613
10622
|
if (workspace && method !== "GET") this.causing[service.name] = 1;
|
|
@@ -19675,7 +19684,7 @@ var init_state_seeding = __esm({
|
|
|
19675
19684
|
if (/name/.test(name)) return "AgentTwin Test";
|
|
19676
19685
|
return `agenttwin-${name}-${n}`;
|
|
19677
19686
|
};
|
|
19678
|
-
NOT_A_SERVICE = /(^|\.)(registry\.npmjs\.org|registry\.yarnpkg\.com|npmjs\.(?:com|org)|pypi\.org|files\.pythonhosted\.org|crates\.io|proxy\.golang\.org|rubygems\.org|
|
|
19687
|
+
NOT_A_SERVICE = /(^|\.)(registry\.npmjs\.org|registry\.yarnpkg\.com|npmjs\.(?:com|org)|pypi\.org|files\.pythonhosted\.org|crates\.io|proxy\.golang\.org|rubygems\.org|githubusercontent\.com|amazonaws\.com)$/;
|
|
19679
19688
|
}
|
|
19680
19689
|
});
|
|
19681
19690
|
|
|
@@ -19860,11 +19869,12 @@ function packRecordSample(pack, resource2, id2, depth = 0, read2 = /* @__PURE__
|
|
|
19860
19869
|
}
|
|
19861
19870
|
return record8;
|
|
19862
19871
|
}
|
|
19863
|
-
function sourcesNear(root2, file2) {
|
|
19872
|
+
function sourcesNear(root2, file2, opts) {
|
|
19864
19873
|
const out = [], seen = /* @__PURE__ */ new Set();
|
|
19865
19874
|
const visit2 = (path2, level) => {
|
|
19866
19875
|
if (seen.has(path2) || level > 1) return;
|
|
19867
19876
|
seen.add(path2);
|
|
19877
|
+
if (opts?.excludeEnvFiles && level > 0 && SHARED_ENV_FILE.test(path2)) return;
|
|
19868
19878
|
let text5 = "";
|
|
19869
19879
|
try {
|
|
19870
19880
|
text5 = readFileSync8(join46(root2, path2), "utf8");
|
|
@@ -19970,14 +19980,15 @@ function inferredSignature(root2, route, file2, settings) {
|
|
|
19970
19980
|
const text5 = source + "\n" + sourcesNear(root2, file2).join("\n");
|
|
19971
19981
|
const envOf = (expr) => /process\.env\.([A-Z][A-Z0-9_]*)|process\.env\[['"`]([A-Z][A-Z0-9_]*)['"`]\]|\benv\.([A-Z][A-Z0-9_]*)/.exec(expr)?.slice(1).find(Boolean);
|
|
19972
19982
|
const secretNames = [.../* @__PURE__ */ new Set([...settings, ...[...text5.matchAll(/\b([A-Z][A-Z0-9_]*(?:WEBHOOK|SIGNING)[A-Z0-9_]*)\b/g)].map((m) => m[1])])].filter((n) => SECRET_NAME.test(n) && /(SECRET|KEY|TOKEN)/.test(n) && /(WEBHOOK|SIGNING)/.test(n));
|
|
19973
|
-
if (/from\s+['"`](?:svix|standardwebhooks)['"`]|require\(\s*['"`](?:svix|standardwebhooks)['"`]\s*\)|@clerk\/[\w-]+\/webhooks|['"`](?:svix|webhook)-signature['"`]/.test(text5) && secretNames.length) {
|
|
19983
|
+
if (/from\s+['"`](?:svix|standardwebhooks)['"`]|require\(\s*['"`](?:svix|standardwebhooks)['"`]\s*\)|@clerk\/[\w-]+\/webhooks|['"`](?:svix|webhook)-signature['"`]|\.webhooks\.unwrap\s*\(/.test(text5) && secretNames.length) {
|
|
19974
19984
|
const literals2 = [...source.matchAll(/(?:case\s*|===?\s*|!==?\s*)['"`]([a-z][a-z0-9_]*(?:\.[a-z0-9_]+){1,3})['"`]/g)].map((m) => m[1]);
|
|
19975
19985
|
const type = literals2[0] ?? "test.event", resource2 = type.split(".")[0].replace(/\W/g, "_");
|
|
19986
|
+
const callId = /\.call_id\b/.test(source) ? { call_id: "call_agenttwin_1" } : {};
|
|
19976
19987
|
return {
|
|
19977
19988
|
scheme: { kind: "webhook-id", header: "webhook-signature" },
|
|
19978
19989
|
secret: `whsec_${randomBytes6(24).toString("base64")}`,
|
|
19979
19990
|
settings: secretNames,
|
|
19980
|
-
body: { type, timestamp: new Date(1762257600 * 1e3).toISOString(), data: { id: `${resource2}_agenttwin_1`, object: resource2 } },
|
|
19991
|
+
body: { id: `evt_agenttwin_1`, object: "event", type, created_at: 1762257600, timestamp: new Date(1762257600 * 1e3).toISOString(), data: { id: `${resource2}_agenttwin_1`, object: resource2, ...callId } },
|
|
19981
19992
|
how: "Standard Webhooks signature (webhook-id, webhook-timestamp, webhook-signature)"
|
|
19982
19993
|
};
|
|
19983
19994
|
}
|
|
@@ -19999,9 +20010,15 @@ function inferredSignature(root2, route, file2, settings) {
|
|
|
19999
20010
|
}
|
|
20000
20011
|
function signedUnlessKnown(root2, route, file2, settings) {
|
|
20001
20012
|
const signed = signedWebhook(root2, route, file2, settings);
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20013
|
+
if (!signed?.guessed) return signed;
|
|
20014
|
+
if (webhookEvent(route, settings)) return void 0;
|
|
20015
|
+
const segments = route.path.toLowerCase().split("/").filter((s) => s && !GENERIC_WEBHOOK_SEGMENTS.has(s) && !/^\[/.test(s) && !/^:/.test(s));
|
|
20016
|
+
const packTokens = /* @__PURE__ */ new Set([signed.pack.toLowerCase(), signed.vendor.toLowerCase()]);
|
|
20017
|
+
if (segments.some((s) => !packTokens.has(s))) return void 0;
|
|
20018
|
+
if (!webhookPack(route.path, sourcesNear(root2, file2, { excludeEnvFiles: true }).join("\n"))) return void 0;
|
|
20019
|
+
return signed;
|
|
20020
|
+
}
|
|
20021
|
+
var statIsDir, SHARED_ENV_FILE, GENERIC_WEBHOOK_SEGMENTS, SIGNING_DRIVER, SECRET_NAME;
|
|
20005
20022
|
var init_webhook_signing = __esm({
|
|
20006
20023
|
"src/flow/webhook-signing.ts"() {
|
|
20007
20024
|
"use strict";
|
|
@@ -20015,6 +20032,8 @@ var init_webhook_signing = __esm({
|
|
|
20015
20032
|
return false;
|
|
20016
20033
|
}
|
|
20017
20034
|
};
|
|
20035
|
+
SHARED_ENV_FILE = /(?:^|\/|\\)env(?:\.[cm]?[jt]sx?|\/(?:index|server|client|schema)\.[cm]?[jt]sx?)?$/i;
|
|
20036
|
+
GENERIC_WEBHOOK_SEGMENTS = /* @__PURE__ */ new Set(["api", "v1", "v2", "v3", "webhook", "webhooks", "hook", "hooks", "events", "event", "callback", "callbacks", "notify", "incoming", "route", "public", "internal"]);
|
|
20018
20037
|
SIGNING_DRIVER = String.raw`
|
|
20019
20038
|
// Sign with the secret the app was given: a twin pack can issue its own (STRIPE_WEBHOOK_SECRET), and the scenario's
|
|
20020
20039
|
// value only fills a setting nothing else set.
|
|
@@ -41720,14 +41739,14 @@ var init_input_formats = __esm({
|
|
|
41720
41739
|
function missingInputFields(stderr, stdout = "") {
|
|
41721
41740
|
const found = /* @__PURE__ */ new Map();
|
|
41722
41741
|
const bodies = [];
|
|
41723
|
-
for (const m of stderr.matchAll(/HTTP 4\d\d from \S+ \S
|
|
41724
|
-
|
|
41725
|
-
|
|
41726
|
-
|
|
41727
|
-
|
|
41728
|
-
|
|
41729
|
-
|
|
41730
|
-
bodies.push(
|
|
41742
|
+
for (const m of stderr.matchAll(/HTTP 4\d\d from \S+ \S+:(?=\s|\{)\s*(.+)$/gm)) {
|
|
41743
|
+
const raw2 = m[1].trim();
|
|
41744
|
+
if (raw2.startsWith("{")) {
|
|
41745
|
+
try {
|
|
41746
|
+
bodies.push(JSON.parse(raw2));
|
|
41747
|
+
} catch {
|
|
41748
|
+
}
|
|
41749
|
+
} else bodies.push({ error: raw2 });
|
|
41731
41750
|
}
|
|
41732
41751
|
for (const line of stdout.split("\n")) {
|
|
41733
41752
|
try {
|
|
@@ -41772,10 +41791,10 @@ function missingInputFields(stderr, stdout = "") {
|
|
|
41772
41791
|
found.set(name, { name, ...expected ? { expected } : {} });
|
|
41773
41792
|
}
|
|
41774
41793
|
for (const x of Object.values(o)) if (typeof x === "string") {
|
|
41775
|
-
const t = /^\s*['"`]?([A-Za-z_][\w-]{0,63})['"`]?(?:\s+(array|string|object|number|field|parameter|list))?\s+(
|
|
41794
|
+
const t = /^\s*['"`]?([A-Za-z_][\w-]{0,63})['"`]?(?:\s+(array|string|object|number|boolean|field|parameter|list))?\s+(is|are)\s+(?:required|missing)\b/i.exec(x);
|
|
41776
41795
|
if (t && safeField(t[1]) && !/^(?:it|this|that|body|request|input|value|fields?|parameters?)$/i.test(t[1])) {
|
|
41777
|
-
const name = t[1].charAt(0).toLowerCase() + t[1].slice(1), kind = t[2]?.toLowerCase();
|
|
41778
|
-
if (!found.has(name)) found.set(name, { name, ...kind === "array" || kind === "list" ? { expected: "array" } : kind === "number" ? { expected: "number" } : {} });
|
|
41796
|
+
const name = t[1].charAt(0).toLowerCase() + t[1].slice(1), kind = t[2]?.toLowerCase(), plural5 = t[3].toLowerCase() === "are";
|
|
41797
|
+
if (!found.has(name)) found.set(name, { name, ...kind === "array" || kind === "list" || !kind && plural5 ? { expected: "array" } : kind === "number" ? { expected: "number" } : kind === "boolean" ? { expected: "boolean" } : {} });
|
|
41779
41798
|
}
|
|
41780
41799
|
}
|
|
41781
41800
|
for (const x of Object.values(o)) if (x && typeof x === "object") visit2(x);
|
|
@@ -41790,9 +41809,10 @@ function testValueFor(field2) {
|
|
|
41790
41809
|
if (/^(?:prompt|message|question|query|input|text|content)$/i.test(field2.name) && field2.expected !== "array" && field2.expected !== "object" && field2.expected !== "record") return CHAT_TEXT;
|
|
41791
41810
|
if (field2.expected === "number" || field2.expected === "integer") return 1;
|
|
41792
41811
|
if (field2.expected === "boolean") return true;
|
|
41793
|
-
if (field2.expected === "array") return [];
|
|
41812
|
+
if (field2.expected === "array") return ["test"];
|
|
41794
41813
|
if (field2.expected === "object" || field2.expected === "record") return {};
|
|
41795
41814
|
const n = field2.name.toLowerCase();
|
|
41815
|
+
if (/^(?:accept|agree|allow|confirm|enabled|active|ok|verified)$/.test(n)) return true;
|
|
41796
41816
|
if (/email/.test(n)) return "ada@example.com";
|
|
41797
41817
|
if (/url|uri|redirect/.test(n)) return "https://example.com/";
|
|
41798
41818
|
if (/(^|_)(amount|count|quantity|qty|limit|page)$/.test(n)) return 1;
|
|
@@ -41876,7 +41896,7 @@ var init_package = __esm({
|
|
|
41876
41896
|
"package.json"() {
|
|
41877
41897
|
package_default = {
|
|
41878
41898
|
name: "agenttwin",
|
|
41879
|
-
version: "0.3.
|
|
41899
|
+
version: "0.3.46",
|
|
41880
41900
|
description: "AgentTwin builds digital twins for testing AI agents. The current CLI prepares supported Node.js workflows with synthetic services, failures, and outcome checks.",
|
|
41881
41901
|
mcpName: "io.github.AgentTwin/agenttwin",
|
|
41882
41902
|
keywords: [
|
|
@@ -45392,7 +45412,8 @@ async function analyzeWorkflows(root2, opts = {}) {
|
|
|
45392
45412
|
for (const [exportName, local] of f.exports) {
|
|
45393
45413
|
const { calls: reached, env, files: touched, channels } = closure(file2, local);
|
|
45394
45414
|
const calls = reached.filter((c) => !/^use[A-Z]/.test(c.operation));
|
|
45395
|
-
if ((/\.[jt]sx$/.test(file2) && /^[A-Z]/.test(exportName) || /^use[A-Z]/.test(exportName)) && !ROUTE_FILE.test(file2)) continue;
|
|
45415
|
+
if ((/\.[jt]sx$/.test(file2) && (/^[A-Z]/.test(exportName) || exportName === "default") || /^use[A-Z]/.test(exportName)) && !ROUTE_FILE.test(file2) && !PAGES_API_FILE.test(file2)) continue;
|
|
45416
|
+
if (/(?:^|\/)(?:instrumentation(?:\.client)?|test-utils)\.[cm]?[jt]s$/i.test(file2)) continue;
|
|
45396
45417
|
const verifiesWebhook = (ROUTE_FILE.test(file2) || PAGES_API_FILE.test(file2) || SVELTE_ROUTE_FILE.test(file2)) && /\.webhooks\.constructEvent(Async)?\(|verifyWebhook|webhooks?\.verify\(|new Webhook\(|validateRequest\(|stripe-signature|x-hub-signature|svix-signature|x-slack-signature/i.test(byFile.get(file2).text);
|
|
45397
45418
|
if (!calls.length && !opts.all && !verifiesWebhook && !f.trpcHandler) continue;
|
|
45398
45419
|
const fn = f.functions.get(local);
|
|
@@ -45767,6 +45788,17 @@ async function analyzeWorkflows(root2, opts = {}) {
|
|
|
45767
45788
|
const python = await analyzePythonWorkflows(root2);
|
|
45768
45789
|
return [...unique.values(), ...scripts, ...python].map((c) => ({ ...c, score: c.score + (c.triggers.length ? 2 : 0) })).sort((a, b) => b.score - a.score || a.id.localeCompare(b.id));
|
|
45769
45790
|
}
|
|
45791
|
+
function collapseCandidates(inventory, analyzed) {
|
|
45792
|
+
const absorbed = /* @__PURE__ */ new Map();
|
|
45793
|
+
for (const workflow of inventory) {
|
|
45794
|
+
const [file2, member] = (workflow.entrypoint ?? "").split("#");
|
|
45795
|
+
const routeMatch = /^route:([^:]+):(.+?)@(\d+)$/i.exec(member ?? "");
|
|
45796
|
+
const routeMethod = routeMatch?.[1]?.toUpperCase(), routeLine = routeMatch?.[3];
|
|
45797
|
+
const match = analyzed.find((c) => c.entrypoint === workflow.entrypoint || routeLine && c.triggers.some((t) => t.file === file2 && String(t.line) === routeLine) || routeMethod && c.file === file2 && (c.web?.method.toUpperCase() === routeMethod || c.serve?.method.toUpperCase() === routeMethod) || (workflow.evidence ?? []).some((e) => e.ref === `${c.file}:${c.calls[0]?.line}`));
|
|
45798
|
+
if (match) absorbed.set(workflow.id, match.id);
|
|
45799
|
+
}
|
|
45800
|
+
return absorbed;
|
|
45801
|
+
}
|
|
45770
45802
|
var WHOLE_INPUT, PROVIDER_MODULES, FETCH_HOSTS, KNOWN_PROVIDERS, escapeHost, packHosts, fetchHosts, READ_OPS, SOURCE, SKIP3, SETTINGS_MODULE_SIZE, SOURCE_FILE_LIMIT, ROUTE_FILE, SVELTE_ROUTE_FILE, FUNCTION_FILE, PAGES_API_FILE, REQUEST_TARGET_KEYS, chain2, literal3, objectLiteral, templateSql, ENTRY_NAME, nextApps, LazyFunctions;
|
|
45771
45803
|
var init_analyze = __esm({
|
|
45772
45804
|
"src/flow/analyze.ts"() {
|
|
@@ -53758,6 +53790,7 @@ async function prepareWorkflow(cwd, candidate, ask, log, discovered) {
|
|
|
53758
53790
|
const slack = signed.pack === "slack" ? scenario.services.find((sv) => sv.name === signed.pack || String(sv.adapter ?? "") === "pack:slack") : void 0;
|
|
53759
53791
|
if (slack && typeof about?.channel === "string" && typeof about.ts === "string") {
|
|
53760
53792
|
for (const c of slackEventSeed({ channel: about.channel, ts: about.ts, user: about.user, text: about.text })) {
|
|
53793
|
+
if (!String(slack.adapter ?? "").startsWith("pack:") && c.path === "/channel_members") continue;
|
|
53761
53794
|
const have = slack.collections.find((x) => x.path === c.path);
|
|
53762
53795
|
if (!have) slack.collections.push(c);
|
|
53763
53796
|
else for (const r of c.seed) if (!have.seed.some((x) => x.id === r.id)) have.seed.push(r);
|
|
@@ -54077,7 +54110,7 @@ try{
|
|
|
54077
54110
|
:v[${JSON.stringify(SLACK_CLIENT)}]?await slack()
|
|
54078
54111
|
:typeof v[${JSON.stringify(SAY)}]==='string'?(()=>{const channel=v[${JSON.stringify(SAY)}];return async m=>(await slack()).chat.postMessage(typeof m==='string'?{channel,text:m}:{channel,...m});})()
|
|
54079
54112
|
:Object.fromEntries(await Promise.all(Object.entries(v).map(async([k,x])=>[k,await hydrate(x)])))):v;
|
|
54080
|
-
for(const [index,raw] of calls.entries()){const args=await hydrate(raw);
|
|
54113
|
+
for(const [index,raw] of calls.entries()){const args=await hydrate(raw);let result=await fn(...args);if(result&&typeof result[Symbol.asyncIterator]==='function'){const chunks=[];for await(const chunk of result)chunks.push(chunk);result=chunks.every(c=>typeof c==='string')?chunks.join(''):chunks;}console.log(JSON.stringify({schema:'agenttwin/call-result-v1',call:index+1,result:result??null,...(invoked.length?{invoked:invoked.splice(0)}:{})}));}
|
|
54081
54114
|
}catch(error){console.error(error);process.exitCode=1;}
|
|
54082
54115
|
// Open pools and sockets would keep the process alive; exit once the calls have settled.
|
|
54083
54116
|
setTimeout(()=>process.exit(),1000).unref();
|
|
@@ -54331,7 +54364,7 @@ setTimeout(()=>process.exit(),1000).unref();
|
|
|
54331
54364
|
` : void 0;
|
|
54332
54365
|
const nextDriver = web && web.appDir !== void 0 ? `// Generated by AgentTwin: starts the Next.js app in ${web.appDir || "."} and sends ${web.method} ${web.path} to it on twins.
|
|
54333
54366
|
import {spawn,spawnSync} from 'node:child_process';
|
|
54334
|
-
import {existsSync,readFileSync} from 'node:fs';
|
|
54367
|
+
import {existsSync,readFileSync,realpathSync} from 'node:fs';
|
|
54335
54368
|
import {createRequire} from 'node:module';
|
|
54336
54369
|
import net from 'node:net';
|
|
54337
54370
|
const environment=${JSON.stringify(scenario.environment)},calls=${JSON.stringify(calls)},appDir=${JSON.stringify(join67(cwd, web.appDir))};
|
|
@@ -54368,16 +54401,38 @@ try{
|
|
|
54368
54401
|
spawnSync(process.execPath,[file],{cwd:appDir,env,stdio:['ignore','ignore','pipe'],timeout:120000});
|
|
54369
54402
|
}
|
|
54370
54403
|
}catch{/* the dev script is optional */}
|
|
54371
|
-
const
|
|
54372
|
-
|
|
54373
|
-
|
|
54374
|
-
|
|
54375
|
-
|
|
54376
|
-
|
|
54404
|
+
const nextReq=createRequire(appDir+'/package.json');
|
|
54405
|
+
const next=nextReq.resolve('next/dist/bin/next');
|
|
54406
|
+
let nextMajor=0,nextOutsideRepo=false;
|
|
54407
|
+
try{
|
|
54408
|
+
const nextPkg=nextReq.resolve('next/package.json');
|
|
54409
|
+
nextMajor=Number(String(JSON.parse(readFileSync(nextPkg,'utf8')).version??'0').split('.')[0])||0;
|
|
54410
|
+
const repoReal=realpathSync(${JSON.stringify(cwd)}),nextReal=realpathSync(nextPkg);
|
|
54411
|
+
nextOutsideRepo=!nextReal.startsWith(repoReal+'/')&&!nextReal.startsWith(repoReal+'\\\\');
|
|
54412
|
+
}catch{}
|
|
54413
|
+
const startServer=async webpack=>{
|
|
54414
|
+
output='';exited=null;
|
|
54415
|
+
const args=[next,'dev',...(webpack?['--webpack']:[]),'-p',String(port)];
|
|
54416
|
+
server=spawn(process.execPath,args,{cwd:appDir,env,stdio:['ignore','pipe','pipe'],detached:process.platform!=='win32'});
|
|
54417
|
+
const keep=chunk=>{const text=chunk.toString();output=(output+text).slice(-20000);lastOutput=Date.now();process.stderr.write(text);};
|
|
54418
|
+
server.stdout.on('data',keep);server.stderr.on('data',keep);server.once('exit',code=>{exited=code??1;});
|
|
54419
|
+
const deadline=Date.now()+90000;
|
|
54420
|
+
while(!(await open())){if(exited!==null)throw new Error('The Next.js server stopped while starting (exit '+exited+').');if(Date.now()>deadline)throw new Error('The Next.js server did not start listening within 90 seconds.');await new Promise(r=>setTimeout(r,150));}
|
|
54421
|
+
};
|
|
54422
|
+
let usingWebpack=nextMajor>=16&&nextOutsideRepo;
|
|
54423
|
+
if(usingWebpack)console.error('[agenttwin] Next.js '+nextMajor+' resolves outside the repo; starting with --webpack.');
|
|
54424
|
+
try{await startServer(usingWebpack);}catch(err){if(!usingWebpack&&nextMajor>=16&&/Could not find the Next\\.js package/i.test(output)){usingWebpack=true;console.error('[agenttwin] Next.js Turbopack could not resolve next/package.json; retrying with --webpack.');await startServer(true);}else throw err;}
|
|
54377
54425
|
// A sign-in that fails does not stop the workflow: many (webhooks, crons) need no user, and one that does answers
|
|
54378
54426
|
// 401, which the password sign-in below handles.
|
|
54379
54427
|
let signedIn=false;
|
|
54380
|
-
if(signIn){try{await signInThroughApp(signIn);signedIn=true;}catch(e){
|
|
54428
|
+
if(signIn){try{await signInThroughApp(signIn);signedIn=true;}catch(e){
|
|
54429
|
+
if(!usingWebpack&&nextMajor>=16&&/Could not find the Next\\.js package/i.test(output)){
|
|
54430
|
+
usingWebpack=true;stop();await new Promise(r=>setTimeout(r,300));
|
|
54431
|
+
console.error('[agenttwin] Next.js Turbopack failed during sign-in; restarting with --webpack.');
|
|
54432
|
+
await startServer(true);
|
|
54433
|
+
try{await signInThroughApp(signIn);signedIn=true;}catch(e2){console.error('[agenttwin] '+(e2&&e2.message||e2)+' Sending the workflow request without a signed-in user.');}
|
|
54434
|
+
}else console.error('[agenttwin] '+(e&&e.message||e)+' Sending the workflow request without a signed-in user.');
|
|
54435
|
+
}}
|
|
54381
54436
|
if(signedIn){
|
|
54382
54437
|
console.error('[agenttwin] '+signIn.email+' signed in through the app ('+signIn.provider+').');
|
|
54383
54438
|
// Records the app creates after sign-in (mailbox, defaults) are often written in the background.
|
|
@@ -54411,6 +54466,14 @@ try{
|
|
|
54411
54466
|
const bodyText=trpc||!qNames.size?payload:JSON.stringify(bodyArg??{});
|
|
54412
54467
|
const send=()=>call(${JSON.stringify(web.path)}+(trpc?.kind==='query'?'?input='+encodeURIComponent(payload):(qs?'?'+qs:${JSON.stringify(scenario.query ? "?" + scenario.query : "")})),{method:${JSON.stringify(web.method)},headers:{...(slackForm?{'content-type':'application/x-www-form-urlencoded'}:form?{}:{'content-type':'application/json'}),'idempotency-key':'agenttwin-'+[...payload].reduce((h,c)=>(h*31+c.charCodeAt(0))>>>0,7).toString(16),...signed},...(['GET','HEAD'].includes(${JSON.stringify(web.method)})?{}:{body:slackForm?payload:form?formBody(bodyArg):bodyText})});
|
|
54413
54468
|
let response=await send();
|
|
54469
|
+
if(response.status>=500&&!usingWebpack&&nextMajor>=16&&/Could not find the Next\\.js package/i.test(output)){
|
|
54470
|
+
await response.text().catch(()=>{});
|
|
54471
|
+
usingWebpack=true;stop();await new Promise(r=>setTimeout(r,300));
|
|
54472
|
+
console.error('[agenttwin] Next.js Turbopack failed on route; restarting with --webpack.');
|
|
54473
|
+
await startServer(true);
|
|
54474
|
+
if(signIn&&!signedIn){try{await signInThroughApp(signIn);signedIn=true;}catch{}}
|
|
54475
|
+
response=await send();
|
|
54476
|
+
}
|
|
54414
54477
|
// A redirect to a sign-in or guest-session page: follow it as a browser would (the jar keeps its cookie), then ask again.
|
|
54415
54478
|
// Still sent to sign-in: the workflow never ran, so the run is not a pass.
|
|
54416
54479
|
const signInPath=l=>/\\/(?:api\\/)?(?:auth|login|log-in|signin|sign-in|session|guest)(?:\\/|\\?|$)/i.test(String(l).replace(/^https?:\\/\\/[^/]+/,''));
|
|
@@ -64235,7 +64298,7 @@ function routeWeight(method, path2) {
|
|
|
64235
64298
|
if (/(^|\/)(webhooks?|callback|events?|inbound|incoming|notifications?|push|hooks?)(\/|$)/i.test(path2)) weight += 14;
|
|
64236
64299
|
if (/(^|\/)(cron|jobs?|queue|tasks?|scheduled?|process|sync|digest)(\/|$)/i.test(path2)) weight += 6;
|
|
64237
64300
|
if (path2.toLowerCase().split("/").some((segment) => twinnedVendors().has(segment))) weight += 5;
|
|
64238
|
-
if (/(^|\/)(admin|debug|health|test|e2e|dev|internal|_next|og|sitemap|docs?|documentation)(\/|$)/i.test(path2)) weight -= 10;
|
|
64301
|
+
if (/(^|\/)(admin|debug|health|ping|status|version|metrics|ready|live|conf|config|settings|trace|test|e2e|dev|internal|_next|og|sitemap|docs?|documentation)(\/|$)/i.test(path2) || path2 === "/") weight -= 10;
|
|
64239
64302
|
return weight;
|
|
64240
64303
|
}
|
|
64241
64304
|
function workflowKind(c) {
|
|
@@ -64243,7 +64306,8 @@ function workflowKind(c) {
|
|
|
64243
64306
|
if (c.boltApp) return WORKFLOW_KINDS[0];
|
|
64244
64307
|
if (!route) return WORKFLOW_KINDS[4];
|
|
64245
64308
|
if (signInCallback(route, c.file)) return WORKFLOW_KINDS[3];
|
|
64246
|
-
|
|
64309
|
+
const isBrowserHook = /(^|\/)browser(\/|$)/i.test(c.file ?? "") && /(^|\/)hooks\/(dialog|file-chooser)(\/|$)/i.test(route.path) && !c.calls?.length;
|
|
64310
|
+
if (route.method !== "GET" && WEBHOOK_PATH.test(route.path) && !isBrowserHook) return WORKFLOW_KINDS[0];
|
|
64247
64311
|
if (JOB_PATH.test(route.path)) return WORKFLOW_KINDS[2];
|
|
64248
64312
|
if (route.method !== "GET" && (c.calls ?? []).some((call2) => call2.write && !DATABASE.test(call2.provider) && MONEY_OR_SEND.test(call2.operation))) return WORKFLOW_KINDS[1];
|
|
64249
64313
|
return WORKFLOW_KINDS[3];
|
|
@@ -64264,7 +64328,10 @@ function moneyWeight(c) {
|
|
|
64264
64328
|
function rankWorkflows(list5) {
|
|
64265
64329
|
const kind = (c) => WORKFLOW_KINDS.indexOf(workflowKind(c));
|
|
64266
64330
|
const callback = (c) => signInCallback(c.web ?? c.serve, c.file) ? 1 : 0;
|
|
64267
|
-
|
|
64331
|
+
const emptyOtherRoute = (c) => kind(c) === 3 && !c.calls?.length ? 1 : 0;
|
|
64332
|
+
const nonHelperFn = (c) => kind(c) === 4 && (c.calls?.length ?? 0) > 0 && (!c.exportName || nameWeight(c.exportName) >= 0);
|
|
64333
|
+
const tier = (c) => nonHelperFn(c) ? 3 : kind(c);
|
|
64334
|
+
return list5.sort((a, b) => tier(a) - tier(b) || callback(a) - callback(b) || emptyOtherRoute(a) - emptyOtherRoute(b) || b.score + moneyWeight(b) - (a.score + moneyWeight(a)));
|
|
64268
64335
|
}
|
|
64269
64336
|
function twinnedVendors() {
|
|
64270
64337
|
if (vendors) return vendors;
|
|
@@ -64325,7 +64392,8 @@ async function runOneCommand(opts) {
|
|
|
64325
64392
|
const ask = opts.ask ?? terminalAsk(interactive, log, emit2, Boolean(opts.emit));
|
|
64326
64393
|
const seed = normalizeSeed(opts.seed ?? "42");
|
|
64327
64394
|
const startedAt = opts.startedAt ?? Date.now();
|
|
64328
|
-
const
|
|
64395
|
+
const effectiveDeadline = opts.deadline === void 0 ? void 0 : opts.deadline + setupSpentMs;
|
|
64396
|
+
const budgetLeft = (cap) => effectiveDeadline === void 0 ? cap : Math.min(cap, Math.max(0, effectiveDeadline - Date.now()));
|
|
64329
64397
|
const caseStatus = (r) => r.status === "passed" ? "passed" : r.status === "failed" ? "found" : r.status === "incomplete" ? "skipped" : "error";
|
|
64330
64398
|
const calls = (r) => r.events.filter((e) => isApplicationWrite(e) || e.operation === "fault").map((e) => ({ service: e.service, operation: e.operation, path: e.path, fault: e.operation === "fault", ...e.operation === "fault" && e.detail ? { detail: e.detail } : {} }));
|
|
64331
64399
|
if (!opts.skipSetup) {
|
|
@@ -64377,9 +64445,10 @@ async function runOneCommand(opts) {
|
|
|
64377
64445
|
const { inventoryWorkflows, tools, exports } = await scan;
|
|
64378
64446
|
if (reused) log(dim(` Repository map from this run's first scan: ${tools.size} services and ${inventoryWorkflows.length} workflows.`));
|
|
64379
64447
|
const projectDashboard = await integrations.connectProject(cwd, { interactive, ask, log });
|
|
64380
|
-
const byEntry = new Map(exports.map((c) => [c.entrypoint, c]));
|
|
64448
|
+
const byEntry = new Map(exports.map((c) => [c.entrypoint, c])), byId = new Map(exports.map((c) => [c.id, c]));
|
|
64449
|
+
const collapsed = collapseCandidates(inventoryWorkflows, exports);
|
|
64381
64450
|
const stepsOf = (w) => w.steps.map((step) => ({ ...tools.get(step.tool), operations: step.operations, title: tools.get(step.tool)?.title ?? step.tool })).filter((step) => step.category === "dependency");
|
|
64382
|
-
const invocable = (w) => byEntry.get(w.entrypoint ?? "") ?? inventoryWorkflows.filter((x) => x.coveredBy === w.id).map((x) => byEntry.get(x.entrypoint ?? "")).find(Boolean);
|
|
64451
|
+
const invocable = (w) => byEntry.get(w.entrypoint ?? "") ?? byId.get(collapsed.get(w.id) ?? "") ?? inventoryWorkflows.filter((x) => x.coveredBy === w.id).map((x) => byEntry.get(x.entrypoint ?? "") ?? byId.get(collapsed.get(x.id) ?? "")).find(Boolean);
|
|
64383
64452
|
const steps = /* @__PURE__ */ new Map(), candidates = [], notRunnable = [];
|
|
64384
64453
|
let merged = 0;
|
|
64385
64454
|
for (const w of inventoryWorkflows.filter((w2) => !w2.coveredBy && w2.entrypoint && w2.steps.length)) {
|
|
@@ -64506,7 +64575,7 @@ async function runOneCommand(opts) {
|
|
|
64506
64575
|
const ownLock = ["package-lock.json", "pnpm-lock.yaml", "yarn.lock", "bun.lock", "bun.lockb"].some((f) => existsSync21(join90(cwd, appDir, f)));
|
|
64507
64576
|
const outside = appDir !== "." && !workspaceDirs(cwd).has(appDir);
|
|
64508
64577
|
at("installing dependencies", candidate.title);
|
|
64509
|
-
if (appDir !== "." && !existsSync21(join90(cwd, appDir, "node_modules")) && (ownLock || outside
|
|
64578
|
+
if (appDir !== "." && !existsSync21(join90(cwd, appDir, "node_modules")) && (ownLock || outside)) await runSetup(join90(cwd, appDir), { ask, log: trackCommand(log), interactive, only: "install" });
|
|
64510
64579
|
at("building workspace packages", candidate.title);
|
|
64511
64580
|
{
|
|
64512
64581
|
const t0 = Date.now();
|
|
@@ -64565,18 +64634,44 @@ async function runOneCommand(opts) {
|
|
|
64565
64634
|
log(bold("3/7 Run") + dim(liveHosts.length ? " real workflow code against twins\u2026" : " real workflow code against twins (no production calls)\u2026"));
|
|
64566
64635
|
if (liveHosts.length) log(yellow(` Connected for real: ${liveHosts.join(", ")}. Every case, including faults and duplicate runs, calls these with your key; use a sandbox account. agenttwin disconnect <host> returns a host to its twin.`));
|
|
64567
64636
|
let clean;
|
|
64568
|
-
|
|
64569
|
-
|
|
64570
|
-
|
|
64571
|
-
|
|
64572
|
-
|
|
64573
|
-
|
|
64574
|
-
|
|
64575
|
-
|
|
64576
|
-
|
|
64577
|
-
|
|
64578
|
-
|
|
64579
|
-
|
|
64637
|
+
for (let blockedTry = 0; ; blockedTry++) {
|
|
64638
|
+
try {
|
|
64639
|
+
clean = await track(void 0);
|
|
64640
|
+
break;
|
|
64641
|
+
} catch (error62) {
|
|
64642
|
+
const msg2 = error62 instanceof Error ? error62.message : String(error62);
|
|
64643
|
+
const blockedMatch = /AgentTwin blocked .*? to ([^\s(;]+)/i.exec(msg2);
|
|
64644
|
+
if (blockedMatch && blockedTry < 3) {
|
|
64645
|
+
const host = blockedMatch[1].toLowerCase().replace(/:\d+$/, "");
|
|
64646
|
+
const adapter = deepTwinForHost(host), collections = adapter ? ADAPTER_COLLECTIONS[adapter] : void 0;
|
|
64647
|
+
let added = false;
|
|
64648
|
+
if (adapter && collections) {
|
|
64649
|
+
const name = adapter.replaceAll("-", "_");
|
|
64650
|
+
if (!prepared.scenario.twins.some((t) => t.name === name)) {
|
|
64651
|
+
const service = { name, adapter, collections: collections.map((path2) => ({ path: path2, seed: [] })) };
|
|
64652
|
+
prepared.scenario.services.push(service);
|
|
64653
|
+
prepared.world.services.push(service);
|
|
64654
|
+
prepared.scenario.twins.push({ tier: "deep", provider: "hand-written twin", name, title: PROVIDER_TITLES[adapter] ?? adapter, note: `${host} \u2192 found while running (the scan did not see it)`, service });
|
|
64655
|
+
log(dim(` Found ${host} while running (the scan missed it); using the ${PROVIDER_TITLES[adapter] ?? adapter} twin and rerunning.`));
|
|
64656
|
+
added = true;
|
|
64657
|
+
}
|
|
64658
|
+
} else if (!prepared.scenario.twins.some((t) => t.generic?.hosts?.includes(host))) {
|
|
64659
|
+
prepared.scenario.twins.push({ tier: "inferred", provider: "stateful REST twin inferred from calls", name: serviceName3(host), title: host, generic: { hosts: [host] }, note: `${host} \u2192 found while running (the scan did not see it): stateful REST twin, vendor-specific behavior is not modelled` });
|
|
64660
|
+
log(dim(` Found ${host} while running (the scan missed it); twinning it as a stateful REST service and rerunning.`));
|
|
64661
|
+
added = true;
|
|
64662
|
+
}
|
|
64663
|
+
if (added) continue;
|
|
64664
|
+
}
|
|
64665
|
+
const reason = msg2.split("\n")[0].slice(0, 240);
|
|
64666
|
+
const tried = [...opts.triedWorkflows ?? [], { id: candidate.id, title: candidate.title, reason }];
|
|
64667
|
+
const triedFiles = new Set(tried.map((t) => candidates.find((c) => c.id === t.id)?.file).filter(Boolean));
|
|
64668
|
+
const open6 = candidates.filter((c) => !c.suite && !tried.some((t) => t.id === c.id) && !(opts.testedWorkflows ?? []).includes(c.id));
|
|
64669
|
+
const next = !candidate.suite && (!opts.workflow || opts.autoPicked) && tried.length < WORKFLOW_ATTEMPTS && Date.now() - startedAt < budgetLeft(WORKFLOW_BUDGET_MS) ? open6.find((c) => !triedFiles.has(c.file)) ?? open6[0] : void 0;
|
|
64670
|
+
if (!next) throw error62;
|
|
64671
|
+
log(yellow(` ${candidate.title} could not run here: ${reason}`));
|
|
64672
|
+
log(dim(` Trying the next workflow the scan found: ${next.title}. Test this one later with npx agenttwin --workflow "${candidate.title}".`));
|
|
64673
|
+
return runOneCommand({ ...opts, workflow: next.id, autoPicked: true, triedWorkflows: tried, skipSuites: true, startedAt });
|
|
64674
|
+
}
|
|
64580
64675
|
}
|
|
64581
64676
|
if (pickedSuite && clean.exitCode === null && !((suiteFacts(candidate, clean.stdout).suite?.passed ?? 0) > 0)) {
|
|
64582
64677
|
const fallback = candidates.find((c) => !c.suite && !(opts.testedWorkflows ?? []).includes(c.id));
|
|
@@ -65268,7 +65363,9 @@ ${clean.stdout ?? ""}`) : void 0;
|
|
|
65268
65363
|
}
|
|
65269
65364
|
}
|
|
65270
65365
|
const cleanEvents = clean.events;
|
|
65271
|
-
const
|
|
65366
|
+
const LOCAL_ENGINES = /* @__PURE__ */ new Set(["postgres", "sqlite", "mysql", "redis", "mongodb", "clickhouse"]);
|
|
65367
|
+
const hasExternalCall = cleanCalls.length > 0 || cleanEvents.some((e) => !LOCAL_ENGINES.has(e.service));
|
|
65368
|
+
const idle = (clean.status === "passed" || !!candidate.suite && suiteRan()) && !cleanEvents.some(isApplicationWrite) && !cleanCalls.some((c) => c.isWrite && c.committed === true) && !clean.assertions.some((a) => a.service !== "none") && !hasExternalCall;
|
|
65272
65369
|
const emptyReads = [...new Set(cleanEvents.filter((e) => e.operation === "read" && /^SELECT 0$/.test(e.detail ?? "")).map((e) => (e.path ?? "").replace(/^\//, "")))].filter(Boolean);
|
|
65273
65370
|
const autoSuite = !opts.workflow || opts.triedSuites !== void 0;
|
|
65274
65371
|
const routeFallback = candidates.find((c) => !c.suite && !(opts.testedWorkflows ?? []).includes(c.id));
|
|
@@ -65306,7 +65403,7 @@ ${clean.stdout ?? ""}`) : void 0;
|
|
|
65306
65403
|
if (runnable.length < supportedFaults.length) log(dim(` ${faultConcurrency > 1 ? `${faultConcurrency} failure scenarios run at a time, a wave takes about ${Math.round(cleanMs / 1e3)} s` : `One run takes about ${Math.round(cleanMs / 1e3)} s here`}, so ${runnable.length} of ${supportedFaults.length} failure scenarios fit the time. The rest: npx agenttwin --workflow "${candidate.title}" with AGENTTWIN_WORKFLOW_BUDGET_MS set higher.`));
|
|
65307
65404
|
const deferred = [];
|
|
65308
65405
|
const runFault = async (fault, deferStartupFailure) => {
|
|
65309
|
-
if (opts.deadline !== void 0 && Date.now() > opts.deadline - 15e3) {
|
|
65406
|
+
if (opts.deadline !== void 0 && Date.now() > opts.deadline + setupSpentMs - 15e3) {
|
|
65310
65407
|
skippedFaults.push({ id: fault.id, title: fault.title, why: "time" });
|
|
65311
65408
|
emit2({ type: "case-end", id: fault.id, status: "skipped", calls: [] });
|
|
65312
65409
|
log(` ${yellow("SKIP ")} ${fault.title}${dim(" (the run budget ended first)")}`);
|
|
@@ -65395,7 +65492,7 @@ ${clean.stdout ?? ""}`) : void 0;
|
|
|
65395
65492
|
log(dim(` Campaign: ${slice.length} of ${campaignCases.length} derived fault scenario${campaignCases.length === 1 ? "" : "s"} (network, filesystem, crash, clock), one per model.`));
|
|
65396
65493
|
const campaignStart = Date.now();
|
|
65397
65494
|
for (const fault of slice) {
|
|
65398
|
-
if (opts.deadline !== void 0 && Date.now() > opts.deadline - 15e3 || Date.now() - campaignStart > CAMPAIGN_BUDGET_MS) {
|
|
65495
|
+
if (opts.deadline !== void 0 && Date.now() > opts.deadline + setupSpentMs - 15e3 || Date.now() - campaignStart > CAMPAIGN_BUDGET_MS) {
|
|
65399
65496
|
skippedFaults.push({ id: fault.id, title: fault.title, why: "time" });
|
|
65400
65497
|
log(` ${yellow("SKIP ")} ${fault.title}${dim(" (the run budget ended first)")}`);
|
|
65401
65498
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{3652:o=>{o.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{3652:o=>{o.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},8458:(o,_,e)=>{Promise.resolve().then(e.t.bind(e,3652,23))}},o=>{o.O(0,[4123,8441,1255,7358],()=>o(o.s=8458)),_N_E=o.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7220],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},3845:()=>{},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7220],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},3845:()=>{},5875:()=>{},6668:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3652,23)),Promise.resolve().then(n.bind(n,8765)),Promise.resolve().then(n.t.bind(n,3845,23)),Promise.resolve().then(n.t.bind(n,5875,23))},8765:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(5155),i=n(2115),r=n(1719);function o(){let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{t("light"===document.documentElement.dataset.siteTheme)},[]),(0,a.jsxs)("button",{className:"site-theme-toggle",type:"button","aria-label":e?"Switch to dark mode":"Switch to light mode",title:e?"Switch to dark mode":"Switch to light mode",onClick:()=>{let e="light"!==document.documentElement.dataset.siteTheme,n=e?"light":"dark";document.documentElement.dataset.siteTheme=n,t(e);try{localStorage.setItem("agenttwin-site-theme",n)}catch(e){}},children:[(0,a.jsx)(r.gLX,{className:"site-theme-sun",width:20,height:20,"aria-hidden":"true"}),(0,a.jsx)(r.rRK,{className:"site-theme-moon",width:20,height:20,"aria-hidden":"true"})]})}let s=[{href:"/what-is-agenttwin/",label:"Product"},{href:"/#how",label:"How it works"},{href:"/pricing/",label:"Pricing"},{href:"/about/",label:"About"},{href:"/docs/",label:"Docs"},{href:"/blog/",label:"Blog"}];function l(){let[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(null),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{var a,i;"Escape"===e.key&&(null==(a=r.current)?void 0:a.querySelector("#navlinks.is-open"))&&(t(!1),null==(i=n.current)||i.focus())},a=e=>{var n;(null==(n=r.current)?void 0:n.contains(e.target))||t(!1)},i=matchMedia("(min-width: 1024px)"),o=()=>t(!1);return document.addEventListener("keydown",e),document.addEventListener("click",a),i.addEventListener("change",o),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",a),i.removeEventListener("change",o)}},[]),(0,a.jsxs)("header",{className:"site-header",ref:r,children:[(0,a.jsxs)("a",{className:"brand",href:"/","aria-label":"AgentTwin home",children:[(0,a.jsx)("img",{src:"assets/logo/mark-twin-rings.svg?v=white-rings",alt:"","aria-hidden":"true",width:29,height:29}),"AgentTwin"]}),(0,a.jsxs)("nav",{className:"main-nav".concat(e?" is-open":""),id:"navlinks","aria-label":"Main navigation",children:[s.map(e=>(0,a.jsx)("a",{href:e.href,onClick:()=>t(!1),children:e.label},e.href)),(0,a.jsx)("a",{className:"nav-mobile-dashboard",href:"/dashboard/",onClick:()=>t(!1),children:"Open dashboard"})]}),(0,a.jsxs)("div",{className:"nav-actions",children:[(0,a.jsx)("a",{href:"/login/",children:"Sign in"}),(0,a.jsxs)("a",{className:"button button-white button-small",href:"/signup/",children:["Get started ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\xbb"})]})]}),(0,a.jsx)(o,{}),(0,a.jsxs)("button",{className:"menu-toggle",ref:n,type:"button","aria-label":e?"Close menu":"Open menu","aria-expanded":e,"aria-controls":"navlinks",onClick:()=>t(!e),children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]})}}},e=>{e.O(0,[4123,7502,9832,5105,8441,1255,7358],()=>e(e.s=6668)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9842],{3529:(e,a,s)=>{"use strict";s.d(a,{default:()=>o});var n=s(5155),t=s(2115),r=s(6787);function o(){let[e,a]=(0,t.useState)(null),[s,o]=(0,t.useState)(!0),[i,l]=(0,t.useState)(""),[d,c]=(0,t.useState)(""),[h,u]=(0,t.useState)(!1),[p,w]=(0,t.useState)(""),[g,m]=(0,t.useState)(!1),[f,y]=(0,t.useState)("/login/");async function j(e){if(e.preventDefault(),!h){if(w(""),i!==d)return void w("The passwords do not match.");u(!0);try{let e=await fetch(r.n+"/v1/auth/password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i}),signal:AbortSignal.timeout(2e4)}),s=await e.json();if(!e.ok)throw Error(s.error||"Could not create your password.");a(s.user),l(""),c(""),m(!0)}catch(e){w(e instanceof TypeError?"Could not connect to AgentTwin. Please try again.":e instanceof Error?e.message:"Could not create your password.")}finally{u(!1)}}}return(0,t.useEffect)(()=>{let e=new AbortController,s=["localhost","127.0.0.1"].includes(location.hostname)&&"https://api.agenttwin.si"===r.n;return s&&y("https://agenttwin.si/login/"),fetch(r.n+"/v1/auth/me",{credentials:"include",signal:e.signal,cache:"no-store"}).then(async e=>{var s;if(!e.ok)throw Error("Sign in with Google, then open Settings → Email and password.");let n=await e.json();if(!(null==(s=n.user)?void 0:s.email))throw Error("Could not load your account. Please sign in again.");a(n.user)}).catch(a=>{e.signal.aborted||w(a instanceof TypeError?s?"This local preview cannot connect to production sign-in. Open agenttwin.si to manage your password.":"Could not connect to AgentTwin. Please try again.":a instanceof Error?a.message:"Could not load your account.")}).finally(()=>{e.signal.aborted||o(!1)}),()=>e.abort()},[]),(0,n.jsxs)("main",{className:"auth-page auth-entry vercel-auth vercel-entry",children:[(0,n.jsxs)("header",{className:"auth-header",children:[(0,n.jsx)("a",{className:"auth-brand",href:"/","aria-label":"AgentTwin home",children:(0,n.jsx)("img",{src:"assets/logo/mark-twin-rings.svg",width:"26",height:"26",alt:""})}),(0,n.jsx)("a",{className:"auth-header-link",href:"/dashboard/#settings",children:"Back to settings"})]}),(0,n.jsxs)("section",{className:"auth-card auth-entry-card","aria-labelledby":"password-title",children:[(0,n.jsx)("h1",{id:"password-title",children:"Email and password"}),s&&(0,n.jsx)("p",{role:"status",children:"Loading your sign-in methods…"}),p&&(0,n.jsx)("p",{role:"alert",children:p}),g?(0,n.jsxs)("p",{role:"status",children:["Password created. You can now sign in with ",null==e?void 0:e.email," and your password, or continue with Google. Your workspace is the same."]}):(null==e?void 0:e.passwordEnabled)?(0,n.jsxs)("p",{children:["Email and password sign-in is already enabled for ",e.email,"."]}):(null==e?void 0:e.passwordSetupAllowed)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:["Create an AgentTwin password for ",e.email,". Google sign-in will keep working."]}),(0,n.jsx)("p",{children:"For security, sign in with Google within the last 10 minutes before saving."}),(0,n.jsxs)("form",{onSubmit:j,"aria-busy":h,children:[(0,n.jsx)("input",{type:"text",name:"username",autoComplete:"username",value:e.email,readOnly:!0,hidden:!0}),(0,n.jsxs)("label",{htmlFor:"new-password",children:["New password",(0,n.jsx)("input",{id:"new-password",type:"password",autoComplete:"new-password",minLength:12,maxLength:128,required:!0,value:i,onChange:e=>l(e.target.value),"aria-describedby":"password-guidance"})]}),(0,n.jsx)("small",{id:"password-guidance",children:"Use 12–128 characters. This is a new AgentTwin password, separate from your Google password."}),(0,n.jsxs)("label",{htmlFor:"confirm-password",children:["Confirm password",(0,n.jsx)("input",{id:"confirm-password",type:"password",autoComplete:"new-password",minLength:12,maxLength:128,required:!0,value:d,onChange:e=>c(e.target.value)})]}),(0,n.jsx)("button",{className:"auth-primary",type:"submit",disabled:h,children:h?"Saving…":"Create password"})]})]}):e&&(0,n.jsx)("p",{children:"Password setup is available for accounts created with Google."}),!s&&!g&&!(null==e?void 0:e.passwordEnabled)&&(0,n.jsx)("p",{children:(0,n.jsx)("a",{href:f,children:"Sign in with Google again →"})})]}),(0,n.jsx)("footer",{className:"auth-footer",children:(0,n.jsx)("a",{href:"/dashboard/#settings",children:"Back to settings"})})]})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9842],{3529:(e,a,s)=>{"use strict";s.d(a,{default:()=>o});var n=s(5155),t=s(2115),r=s(6787);function o(){let[e,a]=(0,t.useState)(null),[s,o]=(0,t.useState)(!0),[i,l]=(0,t.useState)(""),[d,c]=(0,t.useState)(""),[h,u]=(0,t.useState)(!1),[p,w]=(0,t.useState)(""),[g,m]=(0,t.useState)(!1),[f,y]=(0,t.useState)("/login/");async function j(e){if(e.preventDefault(),!h){if(w(""),i!==d)return void w("The passwords do not match.");u(!0);try{let e=await fetch(r.n+"/v1/auth/password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i}),signal:AbortSignal.timeout(2e4)}),s=await e.json();if(!e.ok)throw Error(s.error||"Could not create your password.");a(s.user),l(""),c(""),m(!0)}catch(e){w(e instanceof TypeError?"Could not connect to AgentTwin. Please try again.":e instanceof Error?e.message:"Could not create your password.")}finally{u(!1)}}}return(0,t.useEffect)(()=>{let e=new AbortController,s=["localhost","127.0.0.1"].includes(location.hostname)&&"https://api.agenttwin.si"===r.n;return s&&y("https://agenttwin.si/login/"),fetch(r.n+"/v1/auth/me",{credentials:"include",signal:e.signal,cache:"no-store"}).then(async e=>{var s;if(!e.ok)throw Error("Sign in with Google, then open Settings → Email and password.");let n=await e.json();if(!(null==(s=n.user)?void 0:s.email))throw Error("Could not load your account. Please sign in again.");a(n.user)}).catch(a=>{e.signal.aborted||w(a instanceof TypeError?s?"This local preview cannot connect to production sign-in. Open agenttwin.si to manage your password.":"Could not connect to AgentTwin. Please try again.":a instanceof Error?a.message:"Could not load your account.")}).finally(()=>{e.signal.aborted||o(!1)}),()=>e.abort()},[]),(0,n.jsxs)("main",{className:"auth-page auth-entry vercel-auth vercel-entry",children:[(0,n.jsxs)("header",{className:"auth-header",children:[(0,n.jsx)("a",{className:"auth-brand",href:"/","aria-label":"AgentTwin home",children:(0,n.jsx)("img",{src:"assets/logo/mark-twin-rings.svg",width:"26",height:"26",alt:""})}),(0,n.jsx)("a",{className:"auth-header-link",href:"/dashboard/#settings",children:"Back to settings"})]}),(0,n.jsxs)("section",{className:"auth-card auth-entry-card","aria-labelledby":"password-title",children:[(0,n.jsx)("h1",{id:"password-title",children:"Email and password"}),s&&(0,n.jsx)("p",{role:"status",children:"Loading your sign-in methods…"}),p&&(0,n.jsx)("p",{role:"alert",children:p}),g?(0,n.jsxs)("p",{role:"status",children:["Password created. You can now sign in with ",null==e?void 0:e.email," and your password, or continue with Google. Your workspace is the same."]}):(null==e?void 0:e.passwordEnabled)?(0,n.jsxs)("p",{children:["Email and password sign-in is already enabled for ",e.email,"."]}):(null==e?void 0:e.passwordSetupAllowed)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:["Create an AgentTwin password for ",e.email,". Google sign-in will keep working."]}),(0,n.jsx)("p",{children:"For security, sign in with Google within the last 10 minutes before saving."}),(0,n.jsxs)("form",{onSubmit:j,"aria-busy":h,children:[(0,n.jsx)("input",{type:"text",name:"username",autoComplete:"username",value:e.email,readOnly:!0,hidden:!0}),(0,n.jsxs)("label",{htmlFor:"new-password",children:["New password",(0,n.jsx)("input",{id:"new-password",type:"password",autoComplete:"new-password",minLength:12,maxLength:128,required:!0,value:i,onChange:e=>l(e.target.value),"aria-describedby":"password-guidance"})]}),(0,n.jsx)("small",{id:"password-guidance",children:"Use 12–128 characters. This is a new AgentTwin password, separate from your Google password."}),(0,n.jsxs)("label",{htmlFor:"confirm-password",children:["Confirm password",(0,n.jsx)("input",{id:"confirm-password",type:"password",autoComplete:"new-password",minLength:12,maxLength:128,required:!0,value:d,onChange:e=>c(e.target.value)})]}),(0,n.jsx)("button",{className:"auth-primary",type:"submit",disabled:h,children:h?"Saving…":"Create password"})]})]}):e&&(0,n.jsx)("p",{children:"Password setup is available for accounts created with Google."}),!s&&!g&&!(null==e?void 0:e.passwordEnabled)&&(0,n.jsx)("p",{children:(0,n.jsx)("a",{href:f,children:"Sign in with Google again →"})})]}),(0,n.jsx)("footer",{className:"auth-footer",children:(0,n.jsx)("a",{href:"/dashboard/#settings",children:"Back to settings"})})]})}},4079:(e,a,s)=>{Promise.resolve().then(s.bind(s,3529))}},e=>{e.O(0,[3935,6787,8441,1255,7358],()=>e(e.s=4079)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[977,990,1369,2481,2882,3232,4345,6226,6402,6990,7006,7066,8365,9366,9877],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[977,990,1369,2481,2882,3232,4345,6226,6402,6990,7006,7066,8365,9366,9877],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},5452:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3652,23)),Promise.resolve().then(n.bind(n,8765))},8765:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(5155),i=n(2115),r=n(1719);function o(){let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{t("light"===document.documentElement.dataset.siteTheme)},[]),(0,a.jsxs)("button",{className:"site-theme-toggle",type:"button","aria-label":e?"Switch to dark mode":"Switch to light mode",title:e?"Switch to dark mode":"Switch to light mode",onClick:()=>{let e="light"!==document.documentElement.dataset.siteTheme,n=e?"light":"dark";document.documentElement.dataset.siteTheme=n,t(e);try{localStorage.setItem("agenttwin-site-theme",n)}catch(e){}},children:[(0,a.jsx)(r.gLX,{className:"site-theme-sun",width:20,height:20,"aria-hidden":"true"}),(0,a.jsx)(r.rRK,{className:"site-theme-moon",width:20,height:20,"aria-hidden":"true"})]})}let s=[{href:"/what-is-agenttwin/",label:"Product"},{href:"/#how",label:"How it works"},{href:"/pricing/",label:"Pricing"},{href:"/about/",label:"About"},{href:"/docs/",label:"Docs"},{href:"/blog/",label:"Blog"}];function l(){let[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(null),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{var a,i;"Escape"===e.key&&(null==(a=r.current)?void 0:a.querySelector("#navlinks.is-open"))&&(t(!1),null==(i=n.current)||i.focus())},a=e=>{var n;(null==(n=r.current)?void 0:n.contains(e.target))||t(!1)},i=matchMedia("(min-width: 1024px)"),o=()=>t(!1);return document.addEventListener("keydown",e),document.addEventListener("click",a),i.addEventListener("change",o),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",a),i.removeEventListener("change",o)}},[]),(0,a.jsxs)("header",{className:"site-header",ref:r,children:[(0,a.jsxs)("a",{className:"brand",href:"/","aria-label":"AgentTwin home",children:[(0,a.jsx)("img",{src:"assets/logo/mark-twin-rings.svg?v=white-rings",alt:"","aria-hidden":"true",width:29,height:29}),"AgentTwin"]}),(0,a.jsxs)("nav",{className:"main-nav".concat(e?" is-open":""),id:"navlinks","aria-label":"Main navigation",children:[s.map(e=>(0,a.jsx)("a",{href:e.href,onClick:()=>t(!1),children:e.label},e.href)),(0,a.jsx)("a",{className:"nav-mobile-dashboard",href:"/dashboard/",onClick:()=>t(!1),children:"Open dashboard"})]}),(0,a.jsxs)("div",{className:"nav-actions",children:[(0,a.jsx)("a",{href:"/login/",children:"Sign in"}),(0,a.jsxs)("a",{className:"button button-white button-small",href:"/signup/",children:["Get started ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\xbb"})]})]}),(0,a.jsx)(o,{}),(0,a.jsxs)("button",{className:"menu-toggle",ref:n,type:"button","aria-label":e?"Close menu":"Open menu","aria-expanded":e,"aria-controls":"navlinks",onClick:()=>t(!e),children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]})}}},e=>{e.O(0,[4123,5105,8441,1255,7358],()=>e(e.s=5452)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[977,990,1369,2481,2882,3232,4345,6226,6402,6990,7006,7066,8365,9366,9877],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[977,990,1369,2481,2882,3232,4345,6226,6402,6990,7006,7066,8365,9366,9877],{3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},5452:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3652,23)),Promise.resolve().then(n.bind(n,8765))},8765:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(5155),i=n(2115),r=n(1719);function o(){let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{t("light"===document.documentElement.dataset.siteTheme)},[]),(0,a.jsxs)("button",{className:"site-theme-toggle",type:"button","aria-label":e?"Switch to dark mode":"Switch to light mode",title:e?"Switch to dark mode":"Switch to light mode",onClick:()=>{let e="light"!==document.documentElement.dataset.siteTheme,n=e?"light":"dark";document.documentElement.dataset.siteTheme=n,t(e);try{localStorage.setItem("agenttwin-site-theme",n)}catch(e){}},children:[(0,a.jsx)(r.gLX,{className:"site-theme-sun",width:20,height:20,"aria-hidden":"true"}),(0,a.jsx)(r.rRK,{className:"site-theme-moon",width:20,height:20,"aria-hidden":"true"})]})}let s=[{href:"/what-is-agenttwin/",label:"Product"},{href:"/#how",label:"How it works"},{href:"/pricing/",label:"Pricing"},{href:"/about/",label:"About"},{href:"/docs/",label:"Docs"},{href:"/blog/",label:"Blog"}];function l(){let[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(null),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{var a,i;"Escape"===e.key&&(null==(a=r.current)?void 0:a.querySelector("#navlinks.is-open"))&&(t(!1),null==(i=n.current)||i.focus())},a=e=>{var n;(null==(n=r.current)?void 0:n.contains(e.target))||t(!1)},i=matchMedia("(min-width: 1024px)"),o=()=>t(!1);return document.addEventListener("keydown",e),document.addEventListener("click",a),i.addEventListener("change",o),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",a),i.removeEventListener("change",o)}},[]),(0,a.jsxs)("header",{className:"site-header",ref:r,children:[(0,a.jsxs)("a",{className:"brand",href:"/","aria-label":"AgentTwin home",children:[(0,a.jsx)("img",{src:"assets/logo/mark-twin-rings.svg?v=white-rings",alt:"","aria-hidden":"true",width:29,height:29}),"AgentTwin"]}),(0,a.jsxs)("nav",{className:"main-nav".concat(e?" is-open":""),id:"navlinks","aria-label":"Main navigation",children:[s.map(e=>(0,a.jsx)("a",{href:e.href,onClick:()=>t(!1),children:e.label},e.href)),(0,a.jsx)("a",{className:"nav-mobile-dashboard",href:"/dashboard/",onClick:()=>t(!1),children:"Open dashboard"})]}),(0,a.jsxs)("div",{className:"nav-actions",children:[(0,a.jsx)("a",{href:"/login/",children:"Sign in"}),(0,a.jsxs)("a",{className:"button button-white button-small",href:"/signup/",children:["Get started ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\xbb"})]})]}),(0,a.jsx)(o,{}),(0,a.jsxs)("button",{className:"menu-toggle",ref:n,type:"button","aria-label":e?"Close menu":"Open menu","aria-expanded":e,"aria-controls":"navlinks",onClick:()=>t(!e),children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]})}}},e=>{e.O(0,[4123,5105,8441,1255,7358],()=>e(e.s=5452)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9584],{2418:()=>{},3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9584],{2418:()=>{},3652:e=>{e.exports={footer:"SiteFooter_footer__aUaTs",content:"SiteFooter_content__1J6Jy",wordmark:"SiteFooter_wordmark__B6_Tf",navigation:"SiteFooter_navigation__Zsq8o",main:"SiteFooter_main__EWvbi",brand:"SiteFooter_brand__HyIqL",groups:"SiteFooter_groups__tPgIM",group:"SiteFooter_group__FK9ik",more:"SiteFooter_more__LEh69",bottom:"SiteFooter_bottom__ADU2b",srOnly:"SiteFooter_srOnly__e7DbB"}},6101:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3652,23)),Promise.resolve().then(n.t.bind(n,2418,23)),Promise.resolve().then(n.bind(n,8765))},8765:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(5155),i=n(2115),r=n(1719);function o(){let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{t("light"===document.documentElement.dataset.siteTheme)},[]),(0,a.jsxs)("button",{className:"site-theme-toggle",type:"button","aria-label":e?"Switch to dark mode":"Switch to light mode",title:e?"Switch to dark mode":"Switch to light mode",onClick:()=>{let e="light"!==document.documentElement.dataset.siteTheme,n=e?"light":"dark";document.documentElement.dataset.siteTheme=n,t(e);try{localStorage.setItem("agenttwin-site-theme",n)}catch(e){}},children:[(0,a.jsx)(r.gLX,{className:"site-theme-sun",width:20,height:20,"aria-hidden":"true"}),(0,a.jsx)(r.rRK,{className:"site-theme-moon",width:20,height:20,"aria-hidden":"true"})]})}let s=[{href:"/what-is-agenttwin/",label:"Product"},{href:"/#how",label:"How it works"},{href:"/pricing/",label:"Pricing"},{href:"/about/",label:"About"},{href:"/docs/",label:"Docs"},{href:"/blog/",label:"Blog"}];function l(){let[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(null),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{var a,i;"Escape"===e.key&&(null==(a=r.current)?void 0:a.querySelector("#navlinks.is-open"))&&(t(!1),null==(i=n.current)||i.focus())},a=e=>{var n;(null==(n=r.current)?void 0:n.contains(e.target))||t(!1)},i=matchMedia("(min-width: 1024px)"),o=()=>t(!1);return document.addEventListener("keydown",e),document.addEventListener("click",a),i.addEventListener("change",o),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",a),i.removeEventListener("change",o)}},[]),(0,a.jsxs)("header",{className:"site-header",ref:r,children:[(0,a.jsxs)("a",{className:"brand",href:"/","aria-label":"AgentTwin home",children:[(0,a.jsx)("img",{src:"assets/logo/mark-twin-rings.svg?v=white-rings",alt:"","aria-hidden":"true",width:29,height:29}),"AgentTwin"]}),(0,a.jsxs)("nav",{className:"main-nav".concat(e?" is-open":""),id:"navlinks","aria-label":"Main navigation",children:[s.map(e=>(0,a.jsx)("a",{href:e.href,onClick:()=>t(!1),children:e.label},e.href)),(0,a.jsx)("a",{className:"nav-mobile-dashboard",href:"/dashboard/",onClick:()=>t(!1),children:"Open dashboard"})]}),(0,a.jsxs)("div",{className:"nav-actions",children:[(0,a.jsx)("a",{href:"/login/",children:"Sign in"}),(0,a.jsxs)("a",{className:"button button-white button-small",href:"/signup/",children:["Get started ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\xbb"})]})]}),(0,a.jsx)(o,{}),(0,a.jsxs)("button",{className:"menu-toggle",ref:n,type:"button","aria-label":e?"Close menu":"Open menu","aria-expanded":e,"aria-controls":"navlinks",onClick:()=>t(!e),children:[(0,a.jsx)("span",{}),(0,a.jsx)("span",{})]})]})}}},e=>{e.O(0,[4123,5097,5105,8441,1255,7358],()=>e(e.s=6101)),_N_E=e.O()}]);
|