@run402/sdk 4.93.2 → 4.95.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/README.md +40 -38
- package/core-dist/config.d.ts +16 -2
- package/core-dist/config.js +52 -18
- package/core-dist/control-plane-session.d.ts +29 -14
- package/core-dist/control-plane-session.js +31 -6
- package/core-dist/keystore.js +7 -7
- package/core-dist/profiles.d.ts +3 -3
- package/core-dist/profiles.js +9 -7
- package/core-dist/{allowance-auth.d.ts → wallet-auth.d.ts} +6 -6
- package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
- package/core-dist/wallet.d.ts +22 -0
- package/core-dist/{allowance.js → wallet.js} +20 -20
- package/core-dist/{write-auth-session.d.ts → write-approvals.d.ts} +28 -26
- package/core-dist/{write-auth-session.js → write-approvals.js} +19 -19
- package/dist/actions.d.ts +4 -4
- package/dist/actions.d.ts.map +1 -1
- package/dist/app-up.d.ts +2 -2
- package/dist/app-up.d.ts.map +1 -1
- package/dist/config.d.ts +1 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/control-plane-credentials.d.ts +8 -8
- package/dist/control-plane-credentials.js +7 -7
- package/dist/credentials.d.ts +20 -20
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +1 -1
- package/dist/errors.d.ts +26 -28
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +35 -38
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +29 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -17
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +10 -9
- package/dist/kernel.js.map +1 -1
- package/dist/namespaces/admin.d.ts +52 -121
- package/dist/namespaces/admin.d.ts.map +1 -1
- package/dist/namespaces/admin.js +41 -45
- package/dist/namespaces/admin.js.map +1 -1
- package/dist/namespaces/agent.d.ts +2 -2
- package/dist/namespaces/agent.d.ts.map +1 -1
- package/dist/namespaces/agent.js +2 -2
- package/dist/namespaces/agent.js.map +1 -1
- package/dist/namespaces/ai.d.ts +2 -2
- package/dist/namespaces/ai.js +3 -3
- package/dist/namespaces/ai.js.map +1 -1
- package/dist/namespaces/assets.js +1 -1
- package/dist/namespaces/assets.js.map +1 -1
- package/dist/namespaces/billing.d.ts +6 -3
- package/dist/namespaces/billing.d.ts.map +1 -1
- package/dist/namespaces/billing.js.map +1 -1
- package/dist/namespaces/buzz-notifications.types.d.ts +1 -1
- package/dist/namespaces/buzz.d.ts +2 -2
- package/dist/namespaces/buzz.d.ts.map +1 -1
- package/dist/namespaces/buzz.js +2 -2
- package/dist/namespaces/buzz.js.map +1 -1
- package/dist/namespaces/buzz.types.d.ts +2 -2
- package/dist/namespaces/buzz.types.d.ts.map +1 -1
- package/dist/namespaces/ci.js +3 -3
- package/dist/namespaces/ci.js.map +1 -1
- package/dist/namespaces/credentials.types.d.ts +1 -1
- package/dist/namespaces/deploy.d.ts +1 -1
- package/dist/namespaces/deploy.d.ts.map +1 -1
- package/dist/namespaces/deploy.js +31 -32
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/namespaces/deploy.types.d.ts +6 -6
- package/dist/namespaces/deploy.types.d.ts.map +1 -1
- package/dist/namespaces/domains.d.ts +10 -2
- package/dist/namespaces/domains.d.ts.map +1 -1
- package/dist/namespaces/domains.js +10 -5
- package/dist/namespaces/domains.js.map +1 -1
- package/dist/namespaces/errors.js +1 -1
- package/dist/namespaces/escalations.d.ts +1 -1
- package/dist/namespaces/escalations.js +1 -1
- package/dist/namespaces/escalations.types.d.ts +2 -2
- package/dist/namespaces/escalations.types.d.ts.map +1 -1
- package/dist/namespaces/events.types.d.ts +1 -1
- package/dist/namespaces/functions.d.ts +1 -1
- package/dist/namespaces/functions.js +2 -2
- package/dist/namespaces/functions.js.map +1 -1
- package/dist/namespaces/gitvault.crypto.d.ts +1 -1
- package/dist/namespaces/gitvault.d.ts +26 -26
- package/dist/namespaces/gitvault.d.ts.map +1 -1
- package/dist/namespaces/gitvault.js +113 -113
- package/dist/namespaces/gitvault.js.map +1 -1
- package/dist/namespaces/me.d.ts +120 -0
- package/dist/namespaces/me.d.ts.map +1 -0
- package/dist/namespaces/me.js +34 -0
- package/dist/namespaces/me.js.map +1 -0
- package/dist/namespaces/org.d.ts +108 -6
- package/dist/namespaces/org.d.ts.map +1 -1
- package/dist/namespaces/org.js +63 -7
- package/dist/namespaces/org.js.map +1 -1
- package/dist/namespaces/org.types.d.ts +29 -9
- package/dist/namespaces/org.types.d.ts.map +1 -1
- package/dist/namespaces/pay.js +3 -3
- package/dist/namespaces/pay.js.map +1 -1
- package/dist/namespaces/projects.d.ts +9 -9
- package/dist/namespaces/projects.js +15 -15
- package/dist/namespaces/projects.js.map +1 -1
- package/dist/namespaces/projects.types.d.ts +28 -12
- package/dist/namespaces/projects.types.d.ts.map +1 -1
- package/dist/namespaces/rooms.d.ts +7 -7
- package/dist/namespaces/rooms.js +17 -17
- package/dist/namespaces/rooms.js.map +1 -1
- package/dist/namespaces/rooms.types.d.ts +9 -9
- package/dist/namespaces/rooms.types.d.ts.map +1 -1
- package/dist/namespaces/service.d.ts +1 -1
- package/dist/namespaces/service.js +1 -1
- package/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
- package/dist/namespaces/session.d.ts.map +1 -0
- package/dist/namespaces/{operator-session.js → session.js} +118 -30
- package/dist/namespaces/session.js.map +1 -0
- package/dist/namespaces/subdomains.d.ts +5 -5
- package/dist/namespaces/subdomains.d.ts.map +1 -1
- package/dist/namespaces/subdomains.js +6 -6
- package/dist/namespaces/subdomains.js.map +1 -1
- package/dist/namespaces/tier.d.ts +44 -21
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/tier.js +7 -7
- package/dist/namespaces/tier.js.map +1 -1
- package/dist/namespaces/transfers.d.ts +119 -85
- package/dist/namespaces/transfers.d.ts.map +1 -1
- package/dist/namespaces/transfers.js +31 -38
- package/dist/namespaces/transfers.js.map +1 -1
- package/dist/namespaces/vouchers.d.ts +9 -10
- package/dist/namespaces/vouchers.d.ts.map +1 -1
- package/dist/namespaces/vouchers.js +4 -5
- package/dist/namespaces/vouchers.js.map +1 -1
- package/dist/namespaces/wallets.d.ts +72 -3
- package/dist/namespaces/wallets.d.ts.map +1 -1
- package/dist/namespaces/wallets.js +141 -3
- package/dist/namespaces/wallets.js.map +1 -1
- package/dist/namespaces/write-approval.d.ts +101 -0
- package/dist/namespaces/write-approval.d.ts.map +1 -0
- package/dist/namespaces/write-approval.js +62 -0
- package/dist/namespaces/write-approval.js.map +1 -0
- package/dist/node/actions-node.d.ts +3 -3
- package/dist/node/actions-node.d.ts.map +1 -1
- package/dist/node/actions-node.js +44 -44
- package/dist/node/actions-node.js.map +1 -1
- package/dist/node/assets-node.js +6 -6
- package/dist/node/assets-node.js.map +1 -1
- package/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
- package/dist/node/bearer-redeem-key.d.ts.map +1 -0
- package/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
- package/dist/node/bearer-redeem-key.js.map +1 -0
- package/dist/node/ci.d.ts +1 -1
- package/dist/node/ci.d.ts.map +1 -1
- package/dist/node/ci.js +6 -6
- package/dist/node/ci.js.map +1 -1
- package/dist/node/credentials.d.ts +18 -17
- package/dist/node/credentials.d.ts.map +1 -1
- package/dist/node/credentials.js +29 -28
- package/dist/node/credentials.js.map +1 -1
- package/dist/node/deploy-manifest.d.ts +3 -5
- package/dist/node/deploy-manifest.d.ts.map +1 -1
- package/dist/node/deploy-manifest.js +3 -12
- package/dist/node/deploy-manifest.js.map +1 -1
- package/dist/node/funding-recovery.d.ts +1 -1
- package/dist/node/funding-recovery.d.ts.map +1 -1
- package/dist/node/funding-recovery.js +1 -1
- package/dist/node/funding-recovery.js.map +1 -1
- package/dist/node/gitvault-apply.d.ts +1 -1
- package/dist/node/gitvault-apply.d.ts.map +1 -1
- package/dist/node/gitvault-apply.js +1 -1
- package/dist/node/gitvault-apply.js.map +1 -1
- package/dist/node/gitvault-handoff.d.ts +22 -22
- package/dist/node/gitvault-handoff.d.ts.map +1 -1
- package/dist/node/gitvault-handoff.js +45 -45
- package/dist/node/gitvault-handoff.js.map +1 -1
- package/dist/node/gitvault-prewarm.js +7 -7
- package/dist/node/gitvault-prewarm.js.map +1 -1
- package/dist/node/gitvault-restore.d.ts +1 -1
- package/dist/node/gitvault-restore.js +1 -1
- package/dist/node/index.d.ts +16 -16
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +15 -15
- package/dist/node/index.js.map +1 -1
- package/dist/node/manifest-export.js +2 -2
- package/dist/node/manifest-export.js.map +1 -1
- package/dist/node/org-adopt.d.ts +49 -0
- package/dist/node/org-adopt.d.ts.map +1 -0
- package/dist/node/org-adopt.js +77 -0
- package/dist/node/org-adopt.js.map +1 -0
- package/dist/node/paid-fetch.d.ts +7 -7
- package/dist/node/paid-fetch.d.ts.map +1 -1
- package/dist/node/paid-fetch.js +54 -54
- package/dist/node/paid-fetch.js.map +1 -1
- package/dist/node/preflight.d.ts +1 -1
- package/dist/node/preflight.d.ts.map +1 -1
- package/dist/node/preflight.js +1 -1
- package/dist/node/preflight.js.map +1 -1
- package/dist/node/sites-node.js +1 -1
- package/dist/node/sites-node.js.map +1 -1
- package/dist/node/source-scan.d.ts +1 -1
- package/dist/node/source-scan.js +2 -2
- package/dist/node/source-scan.js.map +1 -1
- package/dist/scoped.d.ts +11 -11
- package/dist/scoped.d.ts.map +1 -1
- package/dist/scoped.js +5 -5
- package/dist/scoped.js.map +1 -1
- package/package.json +1 -1
- package/core-dist/allowance.d.ts +0 -22
- package/core-dist/operator-session.d.ts +0 -80
- package/core-dist/operator-session.js +0 -154
- package/dist/namespaces/allowance.d.ts +0 -79
- package/dist/namespaces/allowance.d.ts.map +0 -1
- package/dist/namespaces/allowance.js +0 -149
- package/dist/namespaces/allowance.js.map +0 -1
- package/dist/namespaces/operator-session.d.ts.map +0 -1
- package/dist/namespaces/operator-session.js.map +0 -1
- package/dist/namespaces/operator.d.ts +0 -359
- package/dist/namespaces/operator.d.ts.map +0 -1
- package/dist/namespaces/operator.js +0 -272
- package/dist/namespaces/operator.js.map +0 -1
- package/dist/node/bearer-claim-key.d.ts.map +0 -1
- package/dist/node/bearer-claim-key.js.map +0 -1
- package/dist/node/operator-claim.d.ts +0 -49
- package/dist/node/operator-claim.d.ts.map +0 -1
- package/dist/node/operator-claim.js +0 -77
- package/dist/node/operator-claim.js.map +0 -1
|
@@ -157,10 +157,10 @@ export class NodeActions {
|
|
|
157
157
|
}
|
|
158
158
|
async #runTierSet(input, run) {
|
|
159
159
|
if (this.#targetKind() === "core") {
|
|
160
|
-
throw run.error("Tier
|
|
160
|
+
throw run.error("Tier leases are a Run402 Cloud capability and are skipped on Run402 Core targets.", "RUN402_CLOUD_ACTION_UNAVAILABLE", { action: input.type, target: this.#targetKind() });
|
|
161
161
|
}
|
|
162
162
|
if (run.autoPrerequisites) {
|
|
163
|
-
await this.#
|
|
163
|
+
await this.#ensureWallet(run);
|
|
164
164
|
}
|
|
165
165
|
const idempotencyKey = input.idempotencyKey ?? run.rootIdempotencyKey;
|
|
166
166
|
const step = run.addStep({
|
|
@@ -170,7 +170,7 @@ export class NodeActions {
|
|
|
170
170
|
auto: false,
|
|
171
171
|
details: { tier: input.tier, idempotency_key: idempotencyKey ?? null },
|
|
172
172
|
});
|
|
173
|
-
await run.approve(step, ["tier.set"], `
|
|
173
|
+
await run.approve(step, ["tier.set"], `Set the ${input.tier} tier (start, renew, or upgrade).`);
|
|
174
174
|
if (run.dryRun) {
|
|
175
175
|
run.setState(step, "planned");
|
|
176
176
|
return run.result({});
|
|
@@ -190,7 +190,7 @@ export class NodeActions {
|
|
|
190
190
|
// exactly this purpose and NOTHING read it, so every `run402 up <git-url>`
|
|
191
191
|
// left its full checkout in the OS temp dir — silently, on success and on
|
|
192
192
|
// failure alike. An agent looping deploys (CI, retries) grows /tmp without
|
|
193
|
-
// bound, and on a fixed-
|
|
193
|
+
// bound, and on a fixed-wallet container that eventually fails writes
|
|
194
194
|
// with no hint at the cause.
|
|
195
195
|
// Local-directory sources set no cleanupDir and are never touched here.
|
|
196
196
|
try {
|
|
@@ -264,7 +264,7 @@ export class NodeActions {
|
|
|
264
264
|
manifest_path: manifest.manifestPath,
|
|
265
265
|
preflight: describeLocalPreflight({ appRoot: workspaceDir, manifestPath: manifest.manifestPath, target: target, authoring: manifest.loaded?.manifest, spec: manifest.releaseSpec, apiBase: this.sdk.apiBase, profile: this.opts.profile }),
|
|
266
266
|
...(run.executionMode === "printManifest" ? { manifest: serializeDeployManifest(manifest.loaded, workspaceDir, input.projectId) } : {}),
|
|
267
|
-
...(run.executionMode === "printSpec" ? { spec: { ...manifest.releaseSpec,
|
|
267
|
+
...(run.executionMode === "printSpec" ? { spec: { ...manifest.releaseSpec, project_id: target?.project_id ?? undefined } } : {}),
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
if (run.executionMode === "plan") {
|
|
@@ -282,7 +282,7 @@ export class NodeActions {
|
|
|
282
282
|
else {
|
|
283
283
|
run.skipStep({
|
|
284
284
|
action: Run402Action.TierSet,
|
|
285
|
-
description: "Skip Cloud
|
|
285
|
+
description: "Skip Cloud wallet and tier prerequisites for Run402 Core",
|
|
286
286
|
mutation: false,
|
|
287
287
|
auto: true,
|
|
288
288
|
details: { target: this.#targetKind() },
|
|
@@ -499,7 +499,7 @@ export class NodeActions {
|
|
|
499
499
|
}
|
|
500
500
|
run.skipStep({
|
|
501
501
|
action: "identity.name.set",
|
|
502
|
-
description: "No display name is known for this principal; nothing was written (set RUN402_AGENT_NAME=<name>, RUN402_CLIENT=<client>, or run `run402
|
|
502
|
+
description: "No display name is known for this principal; nothing was written (set RUN402_AGENT_NAME=<name>, RUN402_CLIENT=<client>, or run `run402 whoami --set-name <name>`)",
|
|
503
503
|
mutation: false,
|
|
504
504
|
auto: true,
|
|
505
505
|
details: { source: "undetected", detected: null },
|
|
@@ -514,7 +514,7 @@ export class NodeActions {
|
|
|
514
514
|
auto: true,
|
|
515
515
|
details: { display_name: desired, source, detected: detectedName },
|
|
516
516
|
});
|
|
517
|
-
await run.approve(step, ["identity.name.set"], `Name this principal "${desired}" (promotion credit and room presence use it; change any time with run402
|
|
517
|
+
await run.approve(step, ["identity.name.set"], `Name this principal "${desired}" (promotion credit and room presence use it; change any time with run402 whoami --set-name).`);
|
|
518
518
|
run.setState(step, "running");
|
|
519
519
|
try {
|
|
520
520
|
const updated = await this.sdk.orgs.setDisplayName(desired);
|
|
@@ -531,7 +531,7 @@ export class NodeActions {
|
|
|
531
531
|
// so, write nothing (an existing name is never overwritten by a guess).
|
|
532
532
|
run.skipStep({
|
|
533
533
|
action: "identity.name.set",
|
|
534
|
-
description: `Detected client "${detectedName}" but the principal is already named "${displayName}"; nothing written — set RUN402_AGENT_NAME=<name> or run \`run402
|
|
534
|
+
description: `Detected client "${detectedName}" but the principal is already named "${displayName}"; nothing written — set RUN402_AGENT_NAME=<name> or run \`run402 whoami --set-name <name>\` to rename`,
|
|
535
535
|
mutation: false,
|
|
536
536
|
auto: true,
|
|
537
537
|
details: { source: "existing", display_name: displayName, detected: detectedName, reason: "name_already_set" },
|
|
@@ -760,7 +760,7 @@ export class NodeActions {
|
|
|
760
760
|
run.setState(step, "succeeded", {
|
|
761
761
|
manifest_kind: "release",
|
|
762
762
|
manifest_path: manifestPath,
|
|
763
|
-
project_id: loaded.spec.
|
|
763
|
+
project_id: loaded.spec.project_id === "prj_up_preflight_placeholder" ? null : loaded.spec.project_id,
|
|
764
764
|
idempotency_key: loaded.idempotencyKey ?? null,
|
|
765
765
|
});
|
|
766
766
|
return {
|
|
@@ -769,9 +769,9 @@ export class NodeActions {
|
|
|
769
769
|
releaseSpec: loaded.spec,
|
|
770
770
|
loaded,
|
|
771
771
|
idempotencyKey: loaded.idempotencyKey,
|
|
772
|
-
manifestProjectId: loaded.spec.
|
|
772
|
+
manifestProjectId: loaded.spec.project_id === "prj_up_preflight_placeholder"
|
|
773
773
|
? undefined
|
|
774
|
-
: loaded.spec.
|
|
774
|
+
: loaded.spec.project_id,
|
|
775
775
|
...(loaded.verify ? { verify: loaded.verify } : {}),
|
|
776
776
|
};
|
|
777
777
|
}
|
|
@@ -1583,7 +1583,7 @@ export class NodeActions {
|
|
|
1583
1583
|
diagnostic: {
|
|
1584
1584
|
error: "missing_public_origin",
|
|
1585
1585
|
message,
|
|
1586
|
-
hint: "Path checks resolve against the project's public origin. Use an absolute `url` in the check, or deploy/
|
|
1586
|
+
hint: "Path checks resolve against the project's public origin. Use an absolute `url` in the check, or deploy/add a subdomain so the project has a site URL.",
|
|
1587
1587
|
},
|
|
1588
1588
|
});
|
|
1589
1589
|
diagnostics.push({
|
|
@@ -1592,7 +1592,7 @@ export class NodeActions {
|
|
|
1592
1592
|
node_id: `verify.http.${check.id}`,
|
|
1593
1593
|
message,
|
|
1594
1594
|
});
|
|
1595
|
-
nextAction ??=
|
|
1595
|
+
nextAction ??= addSubdomainNextAction(context.projectName ?? null, check.id);
|
|
1596
1596
|
continue;
|
|
1597
1597
|
}
|
|
1598
1598
|
const retries = Math.max(1, check.retries ?? 1);
|
|
@@ -1717,12 +1717,12 @@ export class NodeActions {
|
|
|
1717
1717
|
propagationWaitMs,
|
|
1718
1718
|
};
|
|
1719
1719
|
}
|
|
1720
|
-
async #
|
|
1721
|
-
const status = await this.sdk.
|
|
1720
|
+
async #ensureWallet(run, opts = { fund: false }) {
|
|
1721
|
+
const status = await this.sdk.wallets.status();
|
|
1722
1722
|
if (status.configured) {
|
|
1723
1723
|
run.skipStep({
|
|
1724
|
-
action: "
|
|
1725
|
-
description: "Local
|
|
1724
|
+
action: "wallets.create",
|
|
1725
|
+
description: "Local wallet already exists",
|
|
1726
1726
|
mutation: false,
|
|
1727
1727
|
auto: true,
|
|
1728
1728
|
details: { address: status.address, path: status.path ?? null },
|
|
@@ -1732,8 +1732,8 @@ export class NodeActions {
|
|
|
1732
1732
|
const balance = await prototypeBalance(status.address);
|
|
1733
1733
|
if (balance > 0n) {
|
|
1734
1734
|
run.skipStep({
|
|
1735
|
-
action: "
|
|
1736
|
-
description: "
|
|
1735
|
+
action: "wallets.faucet",
|
|
1736
|
+
description: "Wallet already has Base Sepolia USDC",
|
|
1737
1737
|
mutation: false,
|
|
1738
1738
|
auto: true,
|
|
1739
1739
|
details: { address: status.address, balance_usd_micros: balance.toString() },
|
|
@@ -1743,18 +1743,18 @@ export class NodeActions {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
else {
|
|
1745
1745
|
const createStep = run.addStep({
|
|
1746
|
-
action: "
|
|
1747
|
-
description: "Create local
|
|
1746
|
+
action: "wallets.create",
|
|
1747
|
+
description: "Create local wallet",
|
|
1748
1748
|
mutation: true,
|
|
1749
1749
|
auto: true,
|
|
1750
1750
|
});
|
|
1751
|
-
await run.approve(createStep, ["
|
|
1751
|
+
await run.approve(createStep, ["wallets.create"], "Create a local wallet.");
|
|
1752
1752
|
if (run.dryRun) {
|
|
1753
1753
|
run.setState(createStep, "planned");
|
|
1754
1754
|
return false;
|
|
1755
1755
|
}
|
|
1756
1756
|
run.setState(createStep, "running");
|
|
1757
|
-
const created = await this.sdk.
|
|
1757
|
+
const created = await this.sdk.wallets.create();
|
|
1758
1758
|
run.setState(createStep, "succeeded", {
|
|
1759
1759
|
address: created.address,
|
|
1760
1760
|
path: created.path ?? null,
|
|
@@ -1763,20 +1763,20 @@ export class NodeActions {
|
|
|
1763
1763
|
return false;
|
|
1764
1764
|
}
|
|
1765
1765
|
const faucetStep = run.addStep({
|
|
1766
|
-
action: "
|
|
1767
|
-
description: "Request testnet faucet funds for
|
|
1766
|
+
action: "wallets.faucet",
|
|
1767
|
+
description: "Request testnet faucet funds for wallet",
|
|
1768
1768
|
mutation: true,
|
|
1769
1769
|
auto: true,
|
|
1770
|
-
details: { idempotency_key: run.childKey("
|
|
1770
|
+
details: { idempotency_key: run.childKey("wallets.faucet") },
|
|
1771
1771
|
});
|
|
1772
|
-
await run.approve(faucetStep, ["
|
|
1772
|
+
await run.approve(faucetStep, ["wallets.faucet"], "Request testnet USDC for the local wallet.");
|
|
1773
1773
|
if (run.dryRun) {
|
|
1774
1774
|
run.setState(faucetStep, "planned");
|
|
1775
1775
|
return false;
|
|
1776
1776
|
}
|
|
1777
1777
|
run.setState(faucetStep, "running");
|
|
1778
|
-
const faucet = await this.sdk.
|
|
1779
|
-
idempotencyKey: run.childKey("
|
|
1778
|
+
const faucet = await this.sdk.wallets.faucet({
|
|
1779
|
+
idempotencyKey: run.childKey("wallets.faucet"),
|
|
1780
1780
|
});
|
|
1781
1781
|
run.setState(faucetStep, "succeeded", {
|
|
1782
1782
|
transaction_hash: faucet.transactionHash,
|
|
@@ -1786,15 +1786,15 @@ export class NodeActions {
|
|
|
1786
1786
|
return true;
|
|
1787
1787
|
}
|
|
1788
1788
|
async #ensureCloudTier(run, desiredTier) {
|
|
1789
|
-
await this.#
|
|
1789
|
+
await this.#ensureWallet(run, { fund: false });
|
|
1790
1790
|
if (run.dryRun) {
|
|
1791
1791
|
const faucetStep = run.addStep({
|
|
1792
|
-
action: "
|
|
1792
|
+
action: "wallets.faucet",
|
|
1793
1793
|
description: "Request testnet faucet funds if tier payment is needed",
|
|
1794
1794
|
mutation: true,
|
|
1795
1795
|
auto: true,
|
|
1796
1796
|
});
|
|
1797
|
-
await run.approve(faucetStep, ["
|
|
1797
|
+
await run.approve(faucetStep, ["wallets.faucet"], "Request testnet USDC if tier bootstrap needs payment.");
|
|
1798
1798
|
run.setState(faucetStep, "planned");
|
|
1799
1799
|
const step = run.addStep({
|
|
1800
1800
|
action: Run402Action.TierSet,
|
|
@@ -1807,7 +1807,7 @@ export class NodeActions {
|
|
|
1807
1807
|
reason: "dry_run",
|
|
1808
1808
|
},
|
|
1809
1809
|
});
|
|
1810
|
-
await run.approve(step, ["tier.set"], `
|
|
1810
|
+
await run.approve(step, ["tier.set"], `Set the ${desiredTier} tier if no active tier exists.`);
|
|
1811
1811
|
run.setState(step, "planned");
|
|
1812
1812
|
return;
|
|
1813
1813
|
}
|
|
@@ -1840,7 +1840,7 @@ export class NodeActions {
|
|
|
1840
1840
|
return;
|
|
1841
1841
|
}
|
|
1842
1842
|
const idempotencyKey = run.childKey("tier.set");
|
|
1843
|
-
const justFunded = await this.#
|
|
1843
|
+
const justFunded = await this.#ensureWallet(run, { fund: true });
|
|
1844
1844
|
const step = run.addStep({
|
|
1845
1845
|
action: Run402Action.TierSet,
|
|
1846
1846
|
description: `Ensure active ${desiredTier} tier`,
|
|
@@ -1853,7 +1853,7 @@ export class NodeActions {
|
|
|
1853
1853
|
idempotency_key: idempotencyKey,
|
|
1854
1854
|
},
|
|
1855
1855
|
});
|
|
1856
|
-
await run.approve(step, ["tier.set"], `
|
|
1856
|
+
await run.approve(step, ["tier.set"], `Set the ${desiredTier} tier (start, renew, or upgrade).`);
|
|
1857
1857
|
run.setState(step, "running");
|
|
1858
1858
|
const pay = () => this.sdk.tier.set(desiredTier, { idempotencyKey });
|
|
1859
1859
|
const result = await (justFunded ? afterFaucet(pay) : pay());
|
|
@@ -2469,7 +2469,7 @@ function propagationWarning(checkId, url, classification, remainingMs) {
|
|
|
2469
2469
|
};
|
|
2470
2470
|
}
|
|
2471
2471
|
/**
|
|
2472
|
-
* Slug a human project name into
|
|
2472
|
+
* Slug a human project name into an addable `<name>.run402.com` label
|
|
2473
2473
|
* (3-63 chars, lowercase alphanumeric + hyphens), or null when it cannot be.
|
|
2474
2474
|
*/
|
|
2475
2475
|
export function subdomainSlugFromProjectName(name) {
|
|
@@ -2487,18 +2487,18 @@ export function subdomainSlugFromProjectName(name) {
|
|
|
2487
2487
|
/**
|
|
2488
2488
|
* The `missing_public_origin` remedy: a path check cannot resolve without a
|
|
2489
2489
|
* public origin, and the fix is to bind a subdomain — either right now via
|
|
2490
|
-
* `run402 subdomains
|
|
2490
|
+
* `run402 subdomains add <name>` (which binds the live release with no
|
|
2491
2491
|
* further flags) or declaratively in the manifest's `subdomains.set`.
|
|
2492
2492
|
*/
|
|
2493
|
-
export function
|
|
2493
|
+
export function addSubdomainNextAction(projectName, checkId) {
|
|
2494
2494
|
const name = subdomainSlugFromProjectName(projectName) ?? "<name>";
|
|
2495
2495
|
return {
|
|
2496
|
-
type: "
|
|
2496
|
+
type: "add_subdomain",
|
|
2497
2497
|
code: "VERIFY_FAILED",
|
|
2498
2498
|
node_id: `verify.http.${checkId}`,
|
|
2499
|
-
message: `The project has no public origin, so path checks cannot resolve. Claim a subdomain with \`run402 subdomains
|
|
2500
|
-
command: `run402 subdomains
|
|
2501
|
-
argv: ["run402", "subdomains", "
|
|
2499
|
+
message: `The project has no public origin, so path checks cannot resolve. Claim a subdomain with \`run402 subdomains add ${name}\` (binds the live release), or add \`"subdomains": { "set": ["${name}"] }\` to the deploy manifest and redeploy; then rerun \`run402 up verify\`.`,
|
|
2500
|
+
command: `run402 subdomains add ${name}`,
|
|
2501
|
+
argv: ["run402", "subdomains", "add", name],
|
|
2502
2502
|
};
|
|
2503
2503
|
}
|
|
2504
2504
|
function verifyNextAction() {
|
|
@@ -3055,7 +3055,7 @@ async function nearbyBinding(manifestPath) {
|
|
|
3055
3055
|
try {
|
|
3056
3056
|
const manifest = JSON.parse(await readFile(manifestPath, "utf-8"));
|
|
3057
3057
|
const link = await readWorkspaceProjectLink(join(dirname(manifestPath), ".run402", "project.json"));
|
|
3058
|
-
return { app_name: manifest.app?.name ?? manifest.app?.id ?? null, manifest_project_id:
|
|
3058
|
+
return { app_name: manifest.app?.name ?? manifest.app?.id ?? null, manifest_project_id: manifest.project_id ?? manifest.project?.id ?? null, linked_project_id: link?.project_id ?? null, target: link?.target ?? null };
|
|
3059
3059
|
}
|
|
3060
3060
|
catch {
|
|
3061
3061
|
return { status: "unknown", reason: "Local binding could not be read; select the application and run its check." };
|