@dev.sail.money/sailor 1.1.0-60 → 1.1.0-62
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/package.json +1 -1
- package/packages/cli/dist/index.cjs +171 -27
- package/packages/cli/dist/server.cjs +20 -3
- package/packages/sdk/dist/intelligence.d.ts +1 -1
- package/packages/sdk/dist/intelligence.js +1 -1
- package/packages/ui/dist/assets/{add-BkkqrYWB.js → add-C-dsfxDo.js} +1 -1
- package/packages/ui/dist/assets/{all-wallets-DkOBJCgx.js → all-wallets-CnIqhv43.js} +1 -1
- package/packages/ui/dist/assets/{app-store-COmofKYQ.js → app-store-ChQtg1vX.js} +1 -1
- package/packages/ui/dist/assets/{apple-C74TaioJ.js → apple-BjgF3Q4D.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-CrMrxCkH.js → arrow-bottom-B6a-dLkm.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-circle-RBTLtzcR.js → arrow-bottom-circle-iFIsQg-8.js} +1 -1
- package/packages/ui/dist/assets/{arrow-left-C4b71cmS.js → arrow-left-CZGr-Z6-.js} +1 -1
- package/packages/ui/dist/assets/{arrow-right-D5clzuwD.js → arrow-right-BHkO-l6J.js} +1 -1
- package/packages/ui/dist/assets/{arrow-top-C2TbLIrV.js → arrow-top-CSAHnpAG.js} +1 -1
- package/packages/ui/dist/assets/{bank-CdrDcIo1.js → bank-CBmII1x8.js} +1 -1
- package/packages/ui/dist/assets/{basic-DC_nce86.js → basic-z0IGeGoe.js} +1 -1
- package/packages/ui/dist/assets/{browser-Bds2ajCA.js → browser-C63FxwgG.js} +1 -1
- package/packages/ui/dist/assets/{card-BBbe5M7a.js → card-B6aMu64l.js} +1 -1
- package/packages/ui/dist/assets/{ccip-Cd-Us0eQ.js → ccip-DpFAdEcw.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-Bu8wk6S3.js → checkmark-CXN3abIo.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-bold-D_We1fZp.js → checkmark-bold-CnE9PClq.js} +1 -1
- package/packages/ui/dist/assets/{chevron-bottom-0NdO8szM.js → chevron-bottom-BycxXH48.js} +1 -1
- package/packages/ui/dist/assets/{chevron-left-ByFZqD-8.js → chevron-left-RCx9bqyC.js} +1 -1
- package/packages/ui/dist/assets/{chevron-right-BnIkNb00.js → chevron-right-B1DFs8_e.js} +1 -1
- package/packages/ui/dist/assets/{chevron-top-DU8ubJaU.js → chevron-top-Dqq8VaiR.js} +1 -1
- package/packages/ui/dist/assets/{chrome-store-D4y5tSBu.js → chrome-store-N1IilO-E.js} +1 -1
- package/packages/ui/dist/assets/{clock-CftWr0z5.js → clock-8pQLsWRy.js} +1 -1
- package/packages/ui/dist/assets/{close-I0yiZodl.js → close-LHyV89kq.js} +1 -1
- package/packages/ui/dist/assets/{coinPlaceholder-D0OAREKG.js → coinPlaceholder-5bT2NQld.js} +1 -1
- package/packages/ui/dist/assets/{compass-dvpQeqSx.js → compass-CLhzgv54.js} +1 -1
- package/packages/ui/dist/assets/{copy-BugJ4WFr.js → copy-DJ6auzXs.js} +1 -1
- package/packages/ui/dist/assets/{core-BzIB7-vh.js → core-Cp3xGXA6.js} +3 -3
- package/packages/ui/dist/assets/cursor-CIbOGu5K.js +3 -0
- package/packages/ui/dist/assets/{cursor-transparent-BPb-3Hyk.js → cursor-transparent-CohavsEh.js} +1 -1
- package/packages/ui/dist/assets/{desktop-CeDRdIIG.js → desktop-n28VeLf1.js} +1 -1
- package/packages/ui/dist/assets/{disconnect-IwpWvrKA.js → disconnect-BytBq3zd.js} +1 -1
- package/packages/ui/dist/assets/{discord-XhqhcqiG.js → discord-DHkapJMS.js} +1 -1
- package/packages/ui/dist/assets/{etherscan-tWzMxtji.js → etherscan-C43zbGve.js} +1 -1
- package/packages/ui/dist/assets/{events-jqbAbVlK.js → events-BRxyYKwO.js} +1 -1
- package/packages/ui/dist/assets/{exclamation-triangle-DEvePQkx.js → exclamation-triangle-lpLpOiUn.js} +1 -1
- package/packages/ui/dist/assets/{extension-Dode6JDE.js → extension-BAcEl3l1.js} +1 -1
- package/packages/ui/dist/assets/{external-link-DyarUzCV.js → external-link-Bi2lQaCr.js} +1 -1
- package/packages/ui/dist/assets/{facebook-DqKLKTw4.js → facebook-CYLNHpDr.js} +1 -1
- package/packages/ui/dist/assets/{fallback-CLs3NgaE.js → fallback-DAe2x1wz.js} +1 -1
- package/packages/ui/dist/assets/{farcaster-BVbjfPad.js → farcaster-CpbuoD-A.js} +1 -1
- package/packages/ui/dist/assets/{filters-BqCfeyWr.js → filters-2SeCLkqg.js} +1 -1
- package/packages/ui/dist/assets/{github-8QpZFu7F.js → github-CXGuiWnN.js} +1 -1
- package/packages/ui/dist/assets/{google-CVk0kyBN.js → google-u86NQc9o.js} +1 -1
- package/packages/ui/dist/assets/{help-circle-fKcWeR5p.js → help-circle-VXfl2gxH.js} +1 -1
- package/packages/ui/dist/assets/{id-Ci8t7CBc.js → id--tXCaijO.js} +1 -1
- package/packages/ui/dist/assets/{image-BlGujsvY.js → image-fGZdyWSE.js} +1 -1
- package/packages/ui/dist/assets/{index-iL8gxnJZ.js → index-B7HoHWiW.js} +1 -1
- package/packages/ui/dist/assets/{index-DsOOZoQ6.js → index-BbxcsrfK.js} +1 -1
- package/packages/ui/dist/assets/index-CBGxOWky.css +1 -0
- package/packages/ui/dist/assets/{index-DFLVuZGD.js → index-CQAVTqzM.js} +1 -1
- package/packages/ui/dist/assets/{index-CHdC1RP1.js → index-C_eqUkeY.js} +3 -3
- package/packages/ui/dist/assets/{index-26mk1_O0.js → index-PxeN2I9s.js} +1 -1
- package/packages/ui/dist/assets/{index-H2WA2taB.js → index-vPyTb3MD.js} +79 -78
- package/packages/ui/dist/assets/{index.es-Bhx_uNt5.js → index.es-r4dwiXlA.js} +4 -4
- package/packages/ui/dist/assets/{info-BDqeqntk.js → info-C_QVyvKM.js} +1 -1
- package/packages/ui/dist/assets/{info-circle-CrFxScTA.js → info-circle-BQ6SUcsG.js} +1 -1
- package/packages/ui/dist/assets/{lightbulb-BxSygEig.js → lightbulb-DiDGGbfa.js} +1 -1
- package/packages/ui/dist/assets/{mail-4GDY-ze2.js → mail-A6VjvryF.js} +1 -1
- package/packages/ui/dist/assets/{metamask-sdk-DPCbwaIS.js → metamask-sdk-wtBcTydn.js} +1 -1
- package/packages/ui/dist/assets/{mobile-BUUviKTv.js → mobile-pGU4EH2u.js} +1 -1
- package/packages/ui/dist/assets/{more-DhnT17wk.js → more-DcCpyKKY.js} +1 -1
- package/packages/ui/dist/assets/{network-placeholder-TsxqT2gD.js → network-placeholder-CuG8kjRQ.js} +1 -1
- package/packages/ui/dist/assets/{nftPlaceholder-jgTe8P1g.js → nftPlaceholder-CR04xCSJ.js} +1 -1
- package/packages/ui/dist/assets/{off-DcHkZT5o.js → off-B0iV5ojg.js} +1 -1
- package/packages/ui/dist/assets/{parseSignature-B8Lpw1L2.js → parseSignature-5Cmk56ft.js} +1 -1
- package/packages/ui/dist/assets/{play-store-CJstT7y7.js → play-store-DihUKb7H.js} +1 -1
- package/packages/ui/dist/assets/{plus-MYc63_GS.js → plus-CsIbMkij.js} +1 -1
- package/packages/ui/dist/assets/{qr-code-d-0KT0T0.js → qr-code-Dqbt_uUa.js} +1 -1
- package/packages/ui/dist/assets/{recycle-horizontal-DTip0Vh-.js → recycle-horizontal-DAgZ0s3B.js} +1 -1
- package/packages/ui/dist/assets/{refresh-Bvbjnc5_.js → refresh-BckmchSk.js} +1 -1
- package/packages/ui/dist/assets/{reown-logo-CyEiIKwt.js → reown-logo-Ck_DLLhR.js} +1 -1
- package/packages/ui/dist/assets/{search-CvaM9X5d.js → search-DvTEXRW7.js} +1 -1
- package/packages/ui/dist/assets/{secp256k1-DcETRhg-.js → secp256k1-C98H2goB.js} +1 -1
- package/packages/ui/dist/assets/{send-DeX0yj_h.js → send-BIKg5OD7.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontal-BhIMtg47.js → swapHorizontal-7TJPm-09.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalBold-Bcff8r01.js → swapHorizontalBold-OPBCTkZ8.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalMedium-D6exybM7.js → swapHorizontalMedium-BiR-wXTk.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalRoundedBold-E7S191SI.js → swapHorizontalRoundedBold-CjZW0yXV.js} +1 -1
- package/packages/ui/dist/assets/{swapVertical-DnaSU8Vj.js → swapVertical-BvJSfTbs.js} +1 -1
- package/packages/ui/dist/assets/{telegram-BhfatdcJ.js → telegram-BIvNqVBz.js} +1 -1
- package/packages/ui/dist/assets/{three-dots-BTpm_nUE.js → three-dots-ohueHxZy.js} +1 -1
- package/packages/ui/dist/assets/{twitch-BDRYcsTl.js → twitch-BqrnP162.js} +1 -1
- package/packages/ui/dist/assets/{twitterIcon-3FzeZC95.js → twitterIcon-Dw0kNY9c.js} +1 -1
- package/packages/ui/dist/assets/{verify-CUzf_uJD.js → verify-DRBQ8AnL.js} +1 -1
- package/packages/ui/dist/assets/{verify-filled-BbsqfxaJ.js → verify-filled-9og8tsf9.js} +1 -1
- package/packages/ui/dist/assets/{w3m-modal-BqaDz6_Y.js → w3m-modal-rIMTDhot.js} +1 -1
- package/packages/ui/dist/assets/{wallet-DP0T4ID6.js → wallet-X2eNWOim.js} +1 -1
- package/packages/ui/dist/assets/{wallet-placeholder-D6lN9LWp.js → wallet-placeholder-BrLMYsyb.js} +1 -1
- package/packages/ui/dist/assets/{walletconnect-TbWRXzdf.js → walletconnect-C4JQX1g7.js} +1 -1
- package/packages/ui/dist/assets/{warning-circle-Cu3F_XOK.js → warning-circle-obEvu57J.js} +1 -1
- package/packages/ui/dist/assets/{x-BmIFFXMW.js → x-BkGddY7Q.js} +1 -1
- package/packages/ui/dist/index.html +2 -2
- package/templates/default/.github/workflows/agent-tick.yml +29 -2
- package/packages/ui/dist/assets/cursor-T9CAl8CQ.js +0 -3
- package/packages/ui/dist/assets/index-ZMTNJl7U.css +0 -1
package/package.json
CHANGED
|
@@ -38333,10 +38333,15 @@ function readJsonFile(filePath) {
|
|
|
38333
38333
|
return null;
|
|
38334
38334
|
}
|
|
38335
38335
|
}
|
|
38336
|
-
function writeJsonFile(filePath, data) {
|
|
38336
|
+
function writeJsonFile(filePath, data, mode) {
|
|
38337
38337
|
import_node_fs2.default.mkdirSync(import_node_path.default.dirname(filePath), { recursive: true });
|
|
38338
|
-
import_node_fs2.default.writeFileSync(
|
|
38339
|
-
|
|
38338
|
+
import_node_fs2.default.writeFileSync(
|
|
38339
|
+
filePath,
|
|
38340
|
+
`${JSON.stringify(data, null, 2)}
|
|
38341
|
+
`,
|
|
38342
|
+
mode !== void 0 ? { mode } : void 0
|
|
38343
|
+
);
|
|
38344
|
+
if (mode !== void 0) import_node_fs2.default.chmodSync(filePath, mode);
|
|
38340
38345
|
}
|
|
38341
38346
|
function fileExists(filePath) {
|
|
38342
38347
|
return import_node_fs2.default.existsSync(filePath);
|
|
@@ -38377,6 +38382,18 @@ function parseEnvFile(filePath) {
|
|
|
38377
38382
|
}
|
|
38378
38383
|
return out;
|
|
38379
38384
|
}
|
|
38385
|
+
function persistPassphrase(envPath, passphrase) {
|
|
38386
|
+
let content = "";
|
|
38387
|
+
if (import_node_fs2.default.existsSync(envPath)) {
|
|
38388
|
+
content = import_node_fs2.default.readFileSync(envPath, "utf-8").replace(/^SAIL_PASSPHRASE=.*\n?/m, "");
|
|
38389
|
+
}
|
|
38390
|
+
const trimmed = content.trimEnd();
|
|
38391
|
+
content = `${trimmed}${trimmed.length > 0 ? "\n" : ""}SAIL_PASSPHRASE=${passphrase}
|
|
38392
|
+
`;
|
|
38393
|
+
import_node_fs2.default.mkdirSync(import_node_path.default.dirname(envPath), { recursive: true });
|
|
38394
|
+
import_node_fs2.default.writeFileSync(envPath, content, { mode: 384 });
|
|
38395
|
+
import_node_fs2.default.chmodSync(envPath, 384);
|
|
38396
|
+
}
|
|
38380
38397
|
function checksum4(address) {
|
|
38381
38398
|
return getAddress(address);
|
|
38382
38399
|
}
|
|
@@ -39701,7 +39718,18 @@ async function loadManagerSigner(safe) {
|
|
|
39701
39718
|
'No agent wallet found.\nRun "sailor keys generate" and choose "agent wallet".'
|
|
39702
39719
|
);
|
|
39703
39720
|
}
|
|
39704
|
-
|
|
39721
|
+
try {
|
|
39722
|
+
return await LocalKeyring.fromKeystore(keystore, passphrase);
|
|
39723
|
+
} catch {
|
|
39724
|
+
throw new Error(
|
|
39725
|
+
"SAIL_PASSPHRASE does not match this keystore.\nCheck the value in .sail/.env.local (or the SAIL_PASSPHRASE CI secret) \u2014 it must be the passphrase the agent wallet was encrypted with."
|
|
39726
|
+
);
|
|
39727
|
+
}
|
|
39728
|
+
}
|
|
39729
|
+
if (process.stdin.isTTY !== true && keyExists("manager", safe)) {
|
|
39730
|
+
throw new Error(
|
|
39731
|
+
'Agent keystore found but SAIL_PASSPHRASE is not set.\nIf you created the key in the dashboard, add SAIL_PASSPHRASE to .sail/.env.local, or run "sailor keys generate".\nFor CI, set the SAIL_PASSPHRASE GitHub Actions secret.'
|
|
39732
|
+
);
|
|
39705
39733
|
}
|
|
39706
39734
|
return loadKeyring("manager", safe);
|
|
39707
39735
|
}
|
|
@@ -40174,6 +40202,9 @@ async function doctor(options = {}) {
|
|
|
40174
40202
|
} catch {
|
|
40175
40203
|
}
|
|
40176
40204
|
const chainIdMatches = chainIdOnChain === null ? null : chainIdOnChain === chainId;
|
|
40205
|
+
const managerKeystorePresent = keyExists("manager", stored?.safe);
|
|
40206
|
+
const passphraseSet = Boolean(process.env.SAIL_PASSPHRASE);
|
|
40207
|
+
const passphraseGap = managerKeystorePresent && !passphraseSet;
|
|
40177
40208
|
let ownerBal = null;
|
|
40178
40209
|
let managerBal = null;
|
|
40179
40210
|
try {
|
|
@@ -40195,6 +40226,7 @@ async function doctor(options = {}) {
|
|
|
40195
40226
|
owner: ownerAddr ? { address: ownerAddr, ...ownerBal ?? {} } : null,
|
|
40196
40227
|
manager: managerAddr ? { address: managerAddr, ...managerBal ?? {} } : null
|
|
40197
40228
|
},
|
|
40229
|
+
passphrase: { keystorePresent: managerKeystorePresent, envSet: passphraseSet },
|
|
40198
40230
|
account: safe,
|
|
40199
40231
|
saltNonce: stored?.saltNonce ?? null,
|
|
40200
40232
|
permissions,
|
|
@@ -40256,6 +40288,11 @@ async function doctor(options = {}) {
|
|
|
40256
40288
|
' \u2192 The manager (agent) pays gas. Fund it before "sailor run" or dispatches fail.'
|
|
40257
40289
|
);
|
|
40258
40290
|
}
|
|
40291
|
+
if (passphraseGap) {
|
|
40292
|
+
console.log(
|
|
40293
|
+
' \u26A0 SAIL_PASSPHRASE is not set, but an agent keystore exists.\n "sailor run" will prompt interactively; CI and the scheduled cron will fail to unlock it.\n Add SAIL_PASSPHRASE to .sail/.env.local (the dashboard does this automatically when it creates the key).'
|
|
40294
|
+
);
|
|
40295
|
+
}
|
|
40259
40296
|
if (!safe) {
|
|
40260
40297
|
console.log('\nAccount: none found. Run "sailor onboard --new-sma", or pass --account <addr>.');
|
|
40261
40298
|
console.log("Skipping permission checks.");
|
|
@@ -40565,6 +40602,7 @@ function writeIfMissing2(file, content) {
|
|
|
40565
40602
|
if (!import_node_fs8.default.existsSync(file)) import_node_fs8.default.writeFileSync(file, content, "utf-8");
|
|
40566
40603
|
}
|
|
40567
40604
|
var CANONICAL_PKG = "@sail.money/sailor";
|
|
40605
|
+
var DEV_PKG = "@dev.sail.money/sailor";
|
|
40568
40606
|
function cliPackageInfo() {
|
|
40569
40607
|
try {
|
|
40570
40608
|
const pkg = JSON.parse(
|
|
@@ -40707,7 +40745,7 @@ run from the repo root.` : ` Available: ${available}`;
|
|
|
40707
40745
|
pkg.name = name;
|
|
40708
40746
|
const devDeps = pkg.devDependencies ?? {};
|
|
40709
40747
|
const { name: cliName, version: cliVer } = cliPackageInfo();
|
|
40710
|
-
devDeps[CANONICAL_PKG] = cliName ===
|
|
40748
|
+
devDeps[CANONICAL_PKG] = cliName === DEV_PKG ? `npm:${DEV_PKG}@^${cliVer}` : `^${cliVer}`;
|
|
40711
40749
|
pkg.devDependencies = devDeps;
|
|
40712
40750
|
import_node_fs8.default.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}
|
|
40713
40751
|
`);
|
|
@@ -40868,7 +40906,7 @@ async function keysGenerate() {
|
|
|
40868
40906
|
}
|
|
40869
40907
|
const keyring = LocalKeyring.generate();
|
|
40870
40908
|
const keystore = await keyring.exportKeystore(password);
|
|
40871
|
-
writeJsonFile(keyPath(role), keystore);
|
|
40909
|
+
writeJsonFile(keyPath(role), keystore, 384);
|
|
40872
40910
|
const label = role === "manager" ? "Agent wallet" : "Mandate signer";
|
|
40873
40911
|
console.log(`
|
|
40874
40912
|
${label} key saved. Address: ${checksum4(keyring.address)}`);
|
|
@@ -40878,16 +40916,7 @@ ${label} key saved. Address: ${checksum4(keyring.address)}`);
|
|
|
40878
40916
|
"\nSave passphrase to .sail/.env.local for non-interactive use? (required for CI/GitHub Actions)"
|
|
40879
40917
|
);
|
|
40880
40918
|
if (save) {
|
|
40881
|
-
|
|
40882
|
-
let content = "";
|
|
40883
|
-
if (import_node_fs9.default.existsSync(envPath)) {
|
|
40884
|
-
content = import_node_fs9.default.readFileSync(envPath, "utf-8");
|
|
40885
|
-
content = content.replace(/^SAIL_PASSPHRASE=.*\n?/m, "");
|
|
40886
|
-
}
|
|
40887
|
-
content = content.trimEnd() + (content.length > 0 ? "\n" : "") + `SAIL_PASSPHRASE=${password}
|
|
40888
|
-
`;
|
|
40889
|
-
import_node_fs9.default.mkdirSync(import_node_path8.default.dirname(envPath), { recursive: true });
|
|
40890
|
-
import_node_fs9.default.writeFileSync(envPath, content, { mode: 384 });
|
|
40919
|
+
persistPassphrase(sailPath(".env.local"), password);
|
|
40891
40920
|
console.log("\u2713 SAIL_PASSPHRASE saved to .sail/.env.local (mode 0600)");
|
|
40892
40921
|
console.log(" sailor run will now work non-interactively.");
|
|
40893
40922
|
} else {
|
|
@@ -43291,15 +43320,15 @@ ensure the agent that signs dispatches holds this key.`
|
|
|
43291
43320
|
if (fileExists(target)) {
|
|
43292
43321
|
const backup = `${target}.${Date.now()}.bak`;
|
|
43293
43322
|
const existing = readJsonFile(target);
|
|
43294
|
-
if (existing) writeJsonFile(backup, existing);
|
|
43323
|
+
if (existing) writeJsonFile(backup, existing, 384);
|
|
43295
43324
|
say(() => console.log(` Backed up the old agent keystore \u2192 ${backup}`));
|
|
43296
43325
|
}
|
|
43297
43326
|
const keyring = LocalKeyring.generate();
|
|
43298
43327
|
const keystore = await keyring.exportKeystore(password);
|
|
43299
|
-
writeJsonFile(target, keystore);
|
|
43328
|
+
writeJsonFile(target, keystore, 384);
|
|
43300
43329
|
const perManagerPath = managerKeystorePath(keyring.address);
|
|
43301
43330
|
(0, import_node_fs13.mkdirSync)(sailPath("keys", "managers"), { recursive: true });
|
|
43302
|
-
writeJsonFile(perManagerPath, keystore);
|
|
43331
|
+
writeJsonFile(perManagerPath, keystore, 384);
|
|
43303
43332
|
say(
|
|
43304
43333
|
() => console.log(
|
|
43305
43334
|
` New agent wallet: ${checksum4(keyring.address)} (keystore at .sail/keys/manager.json)`
|
|
@@ -43315,11 +43344,11 @@ function promoteManagerKeystore(newManager, say) {
|
|
|
43315
43344
|
const displaced = readJsonFile(activeTarget);
|
|
43316
43345
|
if (displaced?.address) {
|
|
43317
43346
|
const snapshotPath = managerKeystorePath(displaced.address);
|
|
43318
|
-
if (readJsonFile(snapshotPath) === null) writeJsonFile(snapshotPath, displaced);
|
|
43347
|
+
if (readJsonFile(snapshotPath) === null) writeJsonFile(snapshotPath, displaced, 384);
|
|
43319
43348
|
} else if (displaced) {
|
|
43320
|
-
writeJsonFile(`${activeTarget}.${Date.now()}.bak`, displaced);
|
|
43349
|
+
writeJsonFile(`${activeTarget}.${Date.now()}.bak`, displaced, 384);
|
|
43321
43350
|
}
|
|
43322
|
-
writeJsonFile(activeTarget, stored);
|
|
43351
|
+
writeJsonFile(activeTarget, stored, 384);
|
|
43323
43352
|
say(
|
|
43324
43353
|
() => console.log(` Agent wallet keystore for ${newManager} is now active (.sail/keys/manager.json).`)
|
|
43325
43354
|
);
|
|
@@ -43575,6 +43604,7 @@ async function runCommand(opts) {
|
|
|
43575
43604
|
for (const [k, v] of Object.entries(env)) {
|
|
43576
43605
|
if (v && !process.env[k]) process.env[k] = v;
|
|
43577
43606
|
}
|
|
43607
|
+
const runReason = opts.reason ?? process.env.SAIL_RUN_REASON ?? "manual";
|
|
43578
43608
|
const configChainId = readJsonFile(sailPath("config.json"))?.chainId;
|
|
43579
43609
|
const chainIdRaw = opts.chain != null ? String(opts.chain) : process.env.CHAIN_ID ?? env.CHAIN_ID ?? (configChainId != null ? String(configChainId) : void 0);
|
|
43580
43610
|
if (!chainIdRaw) {
|
|
@@ -43704,7 +43734,7 @@ Configure the chain in the SDK chain registry or set KERNEL_ADDRESS in .sail/.en
|
|
|
43704
43734
|
return d;
|
|
43705
43735
|
};
|
|
43706
43736
|
async function runTick() {
|
|
43707
|
-
appendActivity({ ts: nowIso(), actor: "agent", type: "tick_start", chainId });
|
|
43737
|
+
appendActivity({ ts: nowIso(), actor: "agent", type: "tick_start", chainId, reason: runReason });
|
|
43708
43738
|
let blockInfo = { number: 0n, timestamp: 0n };
|
|
43709
43739
|
try {
|
|
43710
43740
|
const block = await publicClient.getBlock();
|
|
@@ -43867,6 +43897,7 @@ Configure the chain in the SDK chain registry or set KERNEL_ADDRESS in .sail/.en
|
|
|
43867
43897
|
console.log(`Account: ${accountAddr}`);
|
|
43868
43898
|
console.log(`Chain: ${chainName2} (${chainId})`);
|
|
43869
43899
|
console.log(once ? "Mode: single tick (--once)" : `Interval: ${intervalSec}s`);
|
|
43900
|
+
console.log(`Reason: ${runReason}`);
|
|
43870
43901
|
console.log("Press Ctrl+C to stop");
|
|
43871
43902
|
console.log("");
|
|
43872
43903
|
writeAgentPid(chainId);
|
|
@@ -44013,6 +44044,110 @@ async function scan(options) {
|
|
|
44013
44044
|
);
|
|
44014
44045
|
}
|
|
44015
44046
|
|
|
44047
|
+
// src/commands/trigger.ts
|
|
44048
|
+
var import_node_child_process2 = require("node:child_process");
|
|
44049
|
+
var GH_API = "https://api.github.com";
|
|
44050
|
+
function parseRepoFromRemoteUrl(url) {
|
|
44051
|
+
const trimmed = url.trim().replace(/\.git$/, "");
|
|
44052
|
+
const m = trimmed.match(/github\.com[/:]([^/]+)\/([^/]+?)$/);
|
|
44053
|
+
return m ? `${m[1]}/${m[2]}` : null;
|
|
44054
|
+
}
|
|
44055
|
+
function resolveRepo(explicit) {
|
|
44056
|
+
if (explicit) {
|
|
44057
|
+
if (!/^[^/\s]+\/[^/\s]+$/.test(explicit)) {
|
|
44058
|
+
throw new Error(`--repo must be in "owner/repo" form \u2014 got: "${explicit}"`);
|
|
44059
|
+
}
|
|
44060
|
+
return explicit;
|
|
44061
|
+
}
|
|
44062
|
+
let url;
|
|
44063
|
+
try {
|
|
44064
|
+
url = (0, import_node_child_process2.execFileSync)("git", ["remote", "get-url", "origin"], {
|
|
44065
|
+
encoding: "utf-8",
|
|
44066
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
44067
|
+
}).trim();
|
|
44068
|
+
} catch {
|
|
44069
|
+
throw new Error(
|
|
44070
|
+
'Could not read the git remote "origin".\nPass --repo <owner/repo> explicitly.'
|
|
44071
|
+
);
|
|
44072
|
+
}
|
|
44073
|
+
const repo = parseRepoFromRemoteUrl(url);
|
|
44074
|
+
if (!repo) {
|
|
44075
|
+
throw new Error(
|
|
44076
|
+
`Could not parse a GitHub owner/repo from the origin remote (${url}).
|
|
44077
|
+
Pass --repo <owner/repo>.`
|
|
44078
|
+
);
|
|
44079
|
+
}
|
|
44080
|
+
return repo;
|
|
44081
|
+
}
|
|
44082
|
+
function resolveToken() {
|
|
44083
|
+
const token = process.env.SAIL_GH_TOKEN ?? process.env.GITHUB_TOKEN;
|
|
44084
|
+
if (!token) {
|
|
44085
|
+
throw new Error(
|
|
44086
|
+
"No GitHub token found. Set SAIL_GH_TOKEN (or GITHUB_TOKEN) in your environment.\nIt needs the `actions: write` permission on the repo (a fine-grained PAT or a GitHub App token).\nThe token is read from the environment only \u2014 it is never passed as an argument or stored."
|
|
44087
|
+
);
|
|
44088
|
+
}
|
|
44089
|
+
return token;
|
|
44090
|
+
}
|
|
44091
|
+
function buildDispatchRequest(args) {
|
|
44092
|
+
return {
|
|
44093
|
+
url: `${GH_API}/repos/${args.repo}/actions/workflows/${encodeURIComponent(args.workflow)}/dispatches`,
|
|
44094
|
+
method: "POST",
|
|
44095
|
+
headers: {
|
|
44096
|
+
Authorization: `Bearer ${args.token}`,
|
|
44097
|
+
Accept: "application/vnd.github+json",
|
|
44098
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
44099
|
+
"User-Agent": "sailor-cli",
|
|
44100
|
+
"Content-Type": "application/json"
|
|
44101
|
+
},
|
|
44102
|
+
body: JSON.stringify({ ref: args.ref, inputs: { reason: args.reason } })
|
|
44103
|
+
};
|
|
44104
|
+
}
|
|
44105
|
+
async function triggerGithub(options = {}) {
|
|
44106
|
+
const workflow = options.workflow ?? "agent-tick.yml";
|
|
44107
|
+
const ref = options.ref ?? "main";
|
|
44108
|
+
const reason = options.reason ?? "manual";
|
|
44109
|
+
const repo = resolveRepo(options.repo);
|
|
44110
|
+
const token = resolveToken();
|
|
44111
|
+
const req = buildDispatchRequest({ repo, workflow, ref, reason, token });
|
|
44112
|
+
let res;
|
|
44113
|
+
try {
|
|
44114
|
+
res = await fetch(req.url, { method: req.method, headers: req.headers, body: req.body });
|
|
44115
|
+
} catch (err) {
|
|
44116
|
+
throw new Error(`Could not reach GitHub to fire workflow_dispatch: ${err.message}`);
|
|
44117
|
+
}
|
|
44118
|
+
if (res.status === 204) {
|
|
44119
|
+
emit(
|
|
44120
|
+
options.json,
|
|
44121
|
+
() => {
|
|
44122
|
+
console.log(`\u2713 Triggered ${workflow} on ${repo}@${ref}`);
|
|
44123
|
+
console.log(` reason: ${reason}`);
|
|
44124
|
+
console.log(` runs: https://github.com/${repo}/actions/workflows/${workflow}`);
|
|
44125
|
+
},
|
|
44126
|
+
{ status: "ok", repo, workflow, ref, reason }
|
|
44127
|
+
);
|
|
44128
|
+
return;
|
|
44129
|
+
}
|
|
44130
|
+
let detail = "";
|
|
44131
|
+
try {
|
|
44132
|
+
detail = await res.text();
|
|
44133
|
+
} catch {
|
|
44134
|
+
}
|
|
44135
|
+
let message = `GitHub returned ${res.status}`;
|
|
44136
|
+
if (res.status === 401) message += " \u2014 bad or expired token";
|
|
44137
|
+
else if (res.status === 403) message += " \u2014 token lacks `actions: write` on this repo";
|
|
44138
|
+
else if (res.status === 404)
|
|
44139
|
+
message += ` \u2014 workflow "${workflow}" or repo "${repo}" not found (or the token can't see it)`;
|
|
44140
|
+
if (detail) {
|
|
44141
|
+
try {
|
|
44142
|
+
const parsed = JSON.parse(detail);
|
|
44143
|
+
if (parsed.message) message += `: ${parsed.message}`;
|
|
44144
|
+
} catch {
|
|
44145
|
+
message += `: ${detail.slice(0, 200)}`;
|
|
44146
|
+
}
|
|
44147
|
+
}
|
|
44148
|
+
throw new Error(message);
|
|
44149
|
+
}
|
|
44150
|
+
|
|
44016
44151
|
// src/commands/session.ts
|
|
44017
44152
|
function requireAccount() {
|
|
44018
44153
|
const account2 = readJsonFile(sailPath("account.json"));
|
|
@@ -44212,7 +44347,7 @@ async function status() {
|
|
|
44212
44347
|
}
|
|
44213
44348
|
|
|
44214
44349
|
// src/commands/ui.ts
|
|
44215
|
-
var
|
|
44350
|
+
var import_node_child_process3 = require("node:child_process");
|
|
44216
44351
|
var import_node_fs17 = __toESM(require("node:fs"), 1);
|
|
44217
44352
|
var import_node_net2 = __toESM(require("node:net"), 1);
|
|
44218
44353
|
var import_node_path13 = __toESM(require("node:path"), 1);
|
|
@@ -44282,7 +44417,7 @@ async function uiCommand() {
|
|
|
44282
44417
|
import_node_fs17.default.mkdirSync(runtimeDir, { recursive: true });
|
|
44283
44418
|
const logFile = import_node_path13.default.join(runtimeDir, "ui.log");
|
|
44284
44419
|
const logFd = import_node_fs17.default.openSync(logFile, "a");
|
|
44285
|
-
const child = (0,
|
|
44420
|
+
const child = (0, import_node_child_process3.spawn)(process.execPath, [serverBundle], {
|
|
44286
44421
|
detached: true,
|
|
44287
44422
|
stdio: ["ignore", logFd, logFd],
|
|
44288
44423
|
env: { ...process.env, SAIL_DIR: sailDir2, SERVE_DIST: "1", PORT: String(port), SAILOR_UI_DIST: uiDistDir }
|
|
@@ -44433,9 +44568,16 @@ owner.command("connect").description("Open the signing station, wait for your wa
|
|
|
44433
44568
|
owner.command("show").description("Show the saved project owner").option("--json", "Emit machine-readable JSON").action(actionWith(ownerShow));
|
|
44434
44569
|
program2.command("scan").description("Discover the owner's SMAs, their permissions, and local keys; save to context.json").option("--owner <address>", "Owner address to scan (defaults to the saved project owner)").option("--json", "Emit machine-readable JSON").action(actionWith(scan));
|
|
44435
44570
|
program2.command("status").description("Show current account, permission, and session status").action(action(status));
|
|
44436
|
-
program2.command("run").description("Run the agent execution loop (use --once for a single tick)").option("--once", "Run a single tick then exit").option("--chain <chainId>", "Chain ID to run on (overrides CHAIN_ID env and .env.local)").
|
|
44571
|
+
program2.command("run").description("Run the agent execution loop (use --once for a single tick)").option("--once", "Run a single tick then exit").option("--chain <chainId>", "Chain ID to run on (overrides CHAIN_ID env and .env.local)").option(
|
|
44572
|
+
"--reason <text>",
|
|
44573
|
+
"Label why this run fired (observability only; also read from SAIL_RUN_REASON)"
|
|
44574
|
+
).action(async (opts) => {
|
|
44437
44575
|
try {
|
|
44438
|
-
await runCommand({
|
|
44576
|
+
await runCommand({
|
|
44577
|
+
once: opts.once,
|
|
44578
|
+
chain: opts.chain ? Number(opts.chain) : void 0,
|
|
44579
|
+
reason: opts.reason
|
|
44580
|
+
});
|
|
44439
44581
|
} catch (err) {
|
|
44440
44582
|
console.error(`Error: ${err.message}`);
|
|
44441
44583
|
closePrompts();
|
|
@@ -44443,6 +44585,8 @@ program2.command("run").description("Run the agent execution loop (use --once fo
|
|
|
44443
44585
|
}
|
|
44444
44586
|
closePrompts();
|
|
44445
44587
|
});
|
|
44588
|
+
var trigger = program2.command("trigger").description("Wake the agent on demand from an external system");
|
|
44589
|
+
trigger.command("github").description("Fire the agent's GitHub Actions workflow_dispatch (the same job the cron runs)").option("--workflow <file>", "Workflow file to dispatch", "agent-tick.yml").option("--ref <branch>", "Git ref to run the workflow on", "main").option("--reason <text>", "Why this run fired \u2014 recorded as the workflow's reason input").option("--repo <owner/repo>", "Override the repository (default: from the git origin remote)").option("--json", "Emit machine-readable JSON").action(actionWith(triggerGithub));
|
|
44446
44590
|
var session = program2.command("session").description("Control the agent session");
|
|
44447
44591
|
session.command("pause").description("Pause the agent session (revoke dispatch rights)").action(action(sessionPause));
|
|
44448
44592
|
session.command("resume").description("Resume a paused session").action(action(sessionResume));
|
|
@@ -48753,6 +48753,18 @@ function parseEnvFile(file) {
|
|
|
48753
48753
|
}
|
|
48754
48754
|
return out;
|
|
48755
48755
|
}
|
|
48756
|
+
function persistPassphrase(envPath, passphrase) {
|
|
48757
|
+
let content = "";
|
|
48758
|
+
if (import_node_fs2.default.existsSync(envPath)) {
|
|
48759
|
+
content = import_node_fs2.default.readFileSync(envPath, "utf-8").replace(/^SAIL_PASSPHRASE=.*\n?/m, "");
|
|
48760
|
+
}
|
|
48761
|
+
const trimmed = content.trimEnd();
|
|
48762
|
+
content = `${trimmed}${trimmed.length > 0 ? "\n" : ""}SAIL_PASSPHRASE=${passphrase}
|
|
48763
|
+
`;
|
|
48764
|
+
import_node_fs2.default.mkdirSync(import_node_path.default.dirname(envPath), { recursive: true });
|
|
48765
|
+
import_node_fs2.default.writeFileSync(envPath, content, { mode: 384 });
|
|
48766
|
+
import_node_fs2.default.chmodSync(envPath, 384);
|
|
48767
|
+
}
|
|
48756
48768
|
var CHAIN_NAMES = {
|
|
48757
48769
|
1: "ethereum",
|
|
48758
48770
|
10: "optimism",
|
|
@@ -49137,7 +49149,9 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49137
49149
|
const keystore = await keyring.exportKeystore(password);
|
|
49138
49150
|
import_node_fs2.default.mkdirSync(at("keys"), { recursive: true });
|
|
49139
49151
|
import_node_fs2.default.writeFileSync(managerKeyPath(safe), `${JSON.stringify(keystore, null, 2)}
|
|
49140
|
-
|
|
49152
|
+
`, { mode: 384 });
|
|
49153
|
+
import_node_fs2.default.chmodSync(managerKeyPath(safe), 384);
|
|
49154
|
+
persistPassphrase(at(".env.local"), password);
|
|
49141
49155
|
try {
|
|
49142
49156
|
const ev = { ts: (/* @__PURE__ */ new Date()).toISOString(), actor: "owner", type: "signer_created", method, address: keyring.address, safe };
|
|
49143
49157
|
import_node_fs2.default.appendFileSync(at("activity.jsonl"), `${JSON.stringify(ev)}
|
|
@@ -49574,7 +49588,8 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49574
49588
|
if (chainId) existing.CHAIN_ID = String(chainId);
|
|
49575
49589
|
const content = Object.entries(existing).map(([k, v]) => `${k}=${v}`).join("\n") + "\n";
|
|
49576
49590
|
import_node_fs2.default.mkdirSync(sailDir, { recursive: true });
|
|
49577
|
-
import_node_fs2.default.writeFileSync(envPath, content);
|
|
49591
|
+
import_node_fs2.default.writeFileSync(envPath, content, { mode: 384 });
|
|
49592
|
+
import_node_fs2.default.chmodSync(envPath, 384);
|
|
49578
49593
|
res.json({ ok: true });
|
|
49579
49594
|
} catch (err) {
|
|
49580
49595
|
res.status(500).json({ error: String(err) });
|
|
@@ -49597,7 +49612,9 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49597
49612
|
const keystore = await keyring.exportKeystore(passphrase);
|
|
49598
49613
|
import_node_fs2.default.mkdirSync(at("keys"), { recursive: true });
|
|
49599
49614
|
import_node_fs2.default.writeFileSync(managerKeyPath2, `${JSON.stringify(keystore, null, 2)}
|
|
49600
|
-
|
|
49615
|
+
`, { mode: 384 });
|
|
49616
|
+
import_node_fs2.default.chmodSync(managerKeyPath2, 384);
|
|
49617
|
+
persistPassphrase(at(".env.local"), passphrase);
|
|
49601
49618
|
res.json({ address: keyring.address, existed: false });
|
|
49602
49619
|
} catch (err) {
|
|
49603
49620
|
res.status(500).json({ error: String(err) });
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Do not edit manually — run `pnpm build` to regenerate.
|
|
6
6
|
*
|
|
7
7
|
* Spec version : 1.2.0
|
|
8
|
-
* Generated at : 2026-06-15T17:
|
|
8
|
+
* Generated at : 2026-06-15T17:43:57.156Z
|
|
9
9
|
*/
|
|
10
10
|
export declare const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
|
|
11
11
|
export declare const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Do not edit manually — run `pnpm build` to regenerate.
|
|
6
6
|
*
|
|
7
7
|
* Spec version : 1.2.0
|
|
8
|
-
* Generated at : 2026-06-15T17:
|
|
8
|
+
* Generated at : 2026-06-15T17:43:57.156Z
|
|
9
9
|
*/
|
|
10
10
|
export const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
|
|
11
11
|
export const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const d=o`<svg
|
|
2
2
|
width="14"
|
|
3
3
|
height="14"
|
|
4
4
|
viewBox="0 0 14 14"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 24 24">
|
|
2
2
|
<path
|
|
3
3
|
style="fill: var(--wui-color-accent-100);"
|
|
4
4
|
d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as t}from"./core-
|
|
1
|
+
import{F as t}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const e=t`
|
|
2
2
|
<svg width="36" height="36">
|
|
3
3
|
<path
|
|
4
4
|
d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as i}from"./core-
|
|
1
|
+
import{F as i}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const h=i`<svg fill="none" viewBox="0 0 40 40">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<g clip-path="url(#b)">
|
|
4
4
|
<circle cx="20" cy="19.89" r="20" fill="#000" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
package/packages/ui/dist/assets/{arrow-bottom-circle-RBTLtzcR.js → arrow-bottom-circle-iFIsQg-8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const t=o`<svg
|
|
2
2
|
fill="none"
|
|
3
3
|
viewBox="0 0 21 20"
|
|
4
4
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const a=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const t=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const H=o`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as P,s as M,y as A,v as I,p as c,g as L,c as T,O as Y,l as E,m as J,R as O,h as ke,e as D,f as S,o as ft,j as Hi,W as gt,C as jt,d as si,T as kt,n as Qe,M as vi,k as yi,F as Ae,A as li,q as Ki}from"./core-
|
|
1
|
+
import{u as P,s as M,y as A,v as I,p as c,g as L,c as T,O as Y,l as E,m as J,R as O,h as ke,e as D,f as S,o as ft,j as Hi,W as gt,C as jt,d as si,T as kt,n as Qe,M as vi,k as yi,F as Ae,A as li,q as Ki}from"./core-Cp3xGXA6.js";import{n as u,c as C,o as y,r as v,U as se,e as Gi,f as Yi,a as Ji}from"./index-C_eqUkeY.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const Qi=P`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
background-color: var(--wui-color-gray-glass-002);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as l}from"./core-
|
|
1
|
+
import{F as l}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const i=l`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as C}from"./core-
|
|
1
|
+
import{F as C}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const l=C`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as u,cY as p,fP as k,c0 as x,de as M,dl as S,dk as $,bK as A,bR as T,cd as C,cJ as w,dc as E,a0 as b,dg as G}from"./index-
|
|
1
|
+
import{B as u,cY as p,fP as k,c0 as x,de as M,dl as S,dk as $,bK as A,bR as T,cd as C,cJ as w,dc as E,a0 as b,dg as G}from"./index-vPyTb3MD.js";class D extends u{constructor({callbackSelector:a,cause:t,data:f,extraData:e,sender:d,urls:i}){var o;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(o=t.metaMessages)!=null&&o.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(n=>` ${p(n)}`)],` Sender: ${d}`,` Data: ${f}`,` Callback selector: ${a}`,` Extra data: ${e}`].flat(),name:"OffchainLookupError"})}}class P extends u{constructor({result:a,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${p(t)}`,`Response: ${k(a)}`],name:"OffchainLookupResponseMalformedError"})}}class B extends u{constructor({sender:a,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}const H="0x556f1830",U={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function J(c,{blockNumber:a,blockTag:t,data:f,requestOptions:e,to:d}){var s;const{args:i}=x({data:f,abi:[U]}),[o,n,l,g,y]=i,{ccipRead:h}=c,r=h&&typeof(h==null?void 0:h.request)=="function"?h.request:j;try{if(!M(d,o))throw new B({sender:o,to:d});const m=n.includes(S)?await $({data:l,ccipRequest:R=>r({...R,requestOptions:e})}):await r({data:l,requestOptions:e,sender:o,urls:n}),{data:L}=await A(c,{blockNumber:a,blockTag:t,data:T([g,C([{type:"bytes"},{type:"bytes"}],[m,y])]),requestOptions:e,to:d});return L}catch(m){throw(s=e==null?void 0:e.signal)!=null&&s.aborted?w(e.signal):E(m)?m:new D({callbackSelector:g,cause:m,data:f,extraData:y,sender:o,urls:n})}}async function j({data:c,requestOptions:a,sender:t,urls:f}){var d,i,o;let e=new Error("An unknown error occurred.");for(let n=0;n<f.length;n++){if((d=a==null?void 0:a.signal)!=null&&d.aborted)throw w(a.signal);const l=f[n],g=l.includes("{data}")?"GET":"POST",y=g==="POST"?{data:c,sender:t}:void 0,h=g==="POST"?{"Content-Type":"application/json"}:{};try{const r=await fetch(l.replace("{sender}",t.toLowerCase()).replace("{data}",c),{body:JSON.stringify(y),headers:h,method:g,...a!=null&&a.signal?{signal:a.signal}:{}});let s;if((i=r.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await r.json()).data:s=await r.text(),!r.ok){e=new b({body:y,details:s!=null&&s.error?k(s.error):r.statusText,headers:r.headers,status:r.status,url:l});continue}if(!G(s)){e=new P({result:s,url:l});continue}return s}catch(r){if((o=a==null?void 0:a.signal)!=null&&o.aborted)throw w(a.signal);if(E(r))throw r;e=new b({body:y,details:r.message,url:l})}}throw e}export{j as ccipRequest,J as offchainLookup,U as offchainLookupAbiItem,H as offchainLookupSignature};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg
|
|
2
2
|
width="28"
|
|
3
3
|
height="28"
|
|
4
4
|
viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 14 14">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const t=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as t}from"./core-
|
|
1
|
+
import{F as t}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const l=t`<svg width="36" height="36" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill="#fff"
|
|
4
4
|
fill-opacity=".05"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const t=o`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill-rule="evenodd"
|
|
4
4
|
clip-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-Cp3xGXA6.js";import"./index-vPyTb3MD.js";import"./events-BRxyYKwO.js";import"./index.es-r4dwiXlA.js";import"./fallback-DAe2x1wz.js";const m=o`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|