@run402/sdk 4.91.0 → 4.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/namespaces/deploy.d.ts +1 -0
- package/dist/namespaces/deploy.d.ts.map +1 -1
- package/dist/namespaces/deploy.js +1 -1
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/node/actions-node.d.ts.map +1 -1
- package/dist/node/actions-node.js +10 -7
- package/dist/node/actions-node.js.map +1 -1
- package/dist/node/deploy-manifest.d.ts +7 -0
- package/dist/node/deploy-manifest.d.ts.map +1 -1
- package/dist/node/deploy-manifest.js +24 -7
- package/dist/node/deploy-manifest.js.map +1 -1
- package/dist/node/funded-payment.d.ts +9 -0
- package/dist/node/funded-payment.d.ts.map +1 -0
- package/dist/node/funded-payment.js +27 -0
- package/dist/node/funded-payment.js.map +1 -0
- package/dist/node/paid-fetch.d.ts.map +1 -1
- package/dist/node/paid-fetch.js +9 -0
- package/dist/node/paid-fetch.js.map +1 -1
- package/dist/node/preflight.d.ts +13 -0
- package/dist/node/preflight.d.ts.map +1 -1
- package/dist/node/preflight.js +30 -1
- package/dist/node/preflight.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-node.d.ts","sourceRoot":"","sources":["../../src/node/actions-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions-node.d.ts","sourceRoot":"","sources":["../../src/node/actions-node.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAIV,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EAGb,kCAAkC,EAClC,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EAGf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAaL,KAAK,qBAAqB,EAG3B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,MA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CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAU3G;AA6jBD,mGAAmG;AACnG,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACtH,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC/F,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,CAAA;CAAE,CAAC,CAmBpJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { serializeDeployManifest, manifestExportUnsupported } from "./manifest-export.js";
|
|
2
2
|
import { prototypeBalance } from "./prototype-balance.js";
|
|
3
|
+
import { afterFaucet } from "./funded-payment.js";
|
|
3
4
|
import { describeLocalPreflight } from "./preflight.js";
|
|
4
5
|
import { resolveApplicationScope, materializeTemplates } from "./app-scope.js";
|
|
5
6
|
import { scanDeploymentSources } from "./source-scan.js";
|
|
@@ -1727,7 +1728,7 @@ export class NodeActions {
|
|
|
1727
1728
|
details: { address: status.address, path: status.path ?? null },
|
|
1728
1729
|
});
|
|
1729
1730
|
if (!opts.fund)
|
|
1730
|
-
return;
|
|
1731
|
+
return false;
|
|
1731
1732
|
const balance = await prototypeBalance(status.address);
|
|
1732
1733
|
if (balance > 0n) {
|
|
1733
1734
|
run.skipStep({
|
|
@@ -1737,7 +1738,7 @@ export class NodeActions {
|
|
|
1737
1738
|
auto: true,
|
|
1738
1739
|
details: { address: status.address, balance_usd_micros: balance.toString() },
|
|
1739
1740
|
});
|
|
1740
|
-
return;
|
|
1741
|
+
return false;
|
|
1741
1742
|
}
|
|
1742
1743
|
}
|
|
1743
1744
|
else {
|
|
@@ -1750,7 +1751,7 @@ export class NodeActions {
|
|
|
1750
1751
|
await run.approve(createStep, ["allowance.create"], "Create a local allowance wallet.");
|
|
1751
1752
|
if (run.dryRun) {
|
|
1752
1753
|
run.setState(createStep, "planned");
|
|
1753
|
-
return;
|
|
1754
|
+
return false;
|
|
1754
1755
|
}
|
|
1755
1756
|
run.setState(createStep, "running");
|
|
1756
1757
|
const created = await this.sdk.allowance.create();
|
|
@@ -1759,7 +1760,7 @@ export class NodeActions {
|
|
|
1759
1760
|
path: created.path ?? null,
|
|
1760
1761
|
});
|
|
1761
1762
|
if (!opts.fund)
|
|
1762
|
-
return;
|
|
1763
|
+
return false;
|
|
1763
1764
|
}
|
|
1764
1765
|
const faucetStep = run.addStep({
|
|
1765
1766
|
action: "allowance.faucet",
|
|
@@ -1771,7 +1772,7 @@ export class NodeActions {
|
|
|
1771
1772
|
await run.approve(faucetStep, ["allowance.faucet"], "Request testnet USDC for the local allowance.");
|
|
1772
1773
|
if (run.dryRun) {
|
|
1773
1774
|
run.setState(faucetStep, "planned");
|
|
1774
|
-
return;
|
|
1775
|
+
return false;
|
|
1775
1776
|
}
|
|
1776
1777
|
run.setState(faucetStep, "running");
|
|
1777
1778
|
const faucet = await this.sdk.allowance.faucet({
|
|
@@ -1782,6 +1783,7 @@ export class NodeActions {
|
|
|
1782
1783
|
amount: faucet.amount,
|
|
1783
1784
|
network: faucet.network,
|
|
1784
1785
|
});
|
|
1786
|
+
return true;
|
|
1785
1787
|
}
|
|
1786
1788
|
async #ensureCloudTier(run, desiredTier) {
|
|
1787
1789
|
await this.#ensureAllowance(run, { fund: false });
|
|
@@ -1838,7 +1840,7 @@ export class NodeActions {
|
|
|
1838
1840
|
return;
|
|
1839
1841
|
}
|
|
1840
1842
|
const idempotencyKey = run.childKey("tier.set");
|
|
1841
|
-
await this.#ensureAllowance(run, { fund: true });
|
|
1843
|
+
const justFunded = await this.#ensureAllowance(run, { fund: true });
|
|
1842
1844
|
const step = run.addStep({
|
|
1843
1845
|
action: Run402Action.TierSet,
|
|
1844
1846
|
description: `Ensure active ${desiredTier} tier`,
|
|
@@ -1853,7 +1855,8 @@ export class NodeActions {
|
|
|
1853
1855
|
});
|
|
1854
1856
|
await run.approve(step, ["tier.set"], `Subscribe, renew, or upgrade to ${desiredTier}.`);
|
|
1855
1857
|
run.setState(step, "running");
|
|
1856
|
-
const
|
|
1858
|
+
const pay = () => this.sdk.tier.set(desiredTier, { idempotencyKey });
|
|
1859
|
+
const result = await (justFunded ? afterFaucet(pay) : pay());
|
|
1857
1860
|
run.setState(step, "succeeded", { tier: result.tier, action: result.action });
|
|
1858
1861
|
}
|
|
1859
1862
|
async #resolveProject(input, manifest, workspaceDir, run) {
|