run402-mcp 4.97.0 → 4.98.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 +26 -246
- package/core/dist/binding-file.d.ts +14 -0
- package/core/dist/binding-file.d.ts.map +1 -1
- package/core/dist/binding-file.js +28 -1
- package/core/dist/binding-file.js.map +1 -1
- package/core/dist/wallet.js +3 -3
- package/dist/docs/llms-sdk.txt +3026 -0
- package/dist/docs/run.md +98 -0
- package/dist/errors.js +7 -7
- package/dist/errors.js.map +1 -1
- package/dist/index.js +34 -515
- package/dist/index.js.map +1 -1
- package/dist/sandbox-proxy.d.ts +81 -0
- package/dist/sandbox-proxy.d.ts.map +1 -0
- package/dist/sandbox-proxy.js +504 -0
- package/dist/sandbox-proxy.js.map +1 -0
- package/dist/sandbox.d.ts +119 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +646 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/sdk.d.ts +13 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +24 -4
- package/dist/sdk.js.map +1 -1
- package/dist/tools/deploy.d.ts +17 -17
- package/dist/tools/docs.d.ts +39 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +221 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/doctor.d.ts +23 -0
- package/dist/tools/doctor.d.ts.map +1 -0
- package/dist/tools/doctor.js +29 -0
- package/dist/tools/doctor.js.map +1 -0
- package/dist/tools/run.d.ts +85 -0
- package/dist/tools/run.d.ts.map +1 -0
- package/dist/tools/run.js +251 -0
- package/dist/tools/run.js.map +1 -0
- package/dist/tools/status.d.ts +11 -3
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +22 -95
- package/dist/tools/status.js.map +1 -1
- package/dist/tools/whoami.d.ts +20 -0
- package/dist/tools/whoami.d.ts.map +1 -0
- package/dist/tools/whoami.js +35 -0
- package/dist/tools/whoami.js.map +1 -0
- package/dist/wallet-auth.d.ts.map +1 -1
- package/dist/wallet-auth.js +3 -7
- package/dist/wallet-auth.js.map +1 -1
- package/package.json +7 -5
- package/sdk/README.md +2 -2
- package/sdk/core-dist/binding-file.d.ts +14 -0
- package/sdk/core-dist/binding-file.js +28 -1
- package/sdk/core-dist/wallet.js +3 -3
- package/sdk/dist/errors.d.ts +24 -2
- package/sdk/dist/errors.d.ts.map +1 -1
- package/sdk/dist/errors.js +44 -2
- package/sdk/dist/errors.js.map +1 -1
- package/sdk/dist/index.d.ts +18 -3
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +12 -1
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/kernel.d.ts +34 -0
- package/sdk/dist/kernel.d.ts.map +1 -1
- package/sdk/dist/kernel.js +15 -1
- package/sdk/dist/kernel.js.map +1 -1
- package/sdk/dist/namespaces/admin.d.ts.map +1 -1
- package/sdk/dist/namespaces/admin.js +8 -0
- package/sdk/dist/namespaces/admin.js.map +1 -1
- package/sdk/dist/namespaces/agent.d.ts +2 -2
- package/sdk/dist/namespaces/agent.d.ts.map +1 -1
- package/sdk/dist/namespaces/agent.js +4 -0
- package/sdk/dist/namespaces/agent.js.map +1 -1
- package/sdk/dist/namespaces/agent.types.d.ts +5 -0
- package/sdk/dist/namespaces/agent.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/apps.d.ts.map +1 -1
- package/sdk/dist/namespaces/apps.js +2 -0
- package/sdk/dist/namespaces/apps.js.map +1 -1
- package/sdk/dist/namespaces/auth.d.ts.map +1 -1
- package/sdk/dist/namespaces/auth.js +9 -0
- package/sdk/dist/namespaces/auth.js.map +1 -1
- package/sdk/dist/namespaces/branches.d.ts.map +1 -1
- package/sdk/dist/namespaces/branches.js +2 -0
- package/sdk/dist/namespaces/branches.js.map +1 -1
- package/sdk/dist/namespaces/ci.d.ts.map +1 -1
- package/sdk/dist/namespaces/ci.js +2 -0
- package/sdk/dist/namespaces/ci.js.map +1 -1
- package/sdk/dist/namespaces/credentials.d.ts +0 -23
- package/sdk/dist/namespaces/credentials.d.ts.map +1 -1
- package/sdk/dist/namespaces/credentials.js +29 -0
- package/sdk/dist/namespaces/credentials.js.map +1 -1
- package/sdk/dist/namespaces/escalations.d.ts.map +1 -1
- package/sdk/dist/namespaces/escalations.js +2 -0
- package/sdk/dist/namespaces/escalations.js.map +1 -1
- package/sdk/dist/namespaces/grants.d.ts.map +1 -1
- package/sdk/dist/namespaces/grants.js +4 -0
- package/sdk/dist/namespaces/grants.js.map +1 -1
- package/sdk/dist/namespaces/live.d.ts +0 -16
- package/sdk/dist/namespaces/live.d.ts.map +1 -1
- package/sdk/dist/namespaces/live.js +19 -0
- package/sdk/dist/namespaces/live.js.map +1 -1
- package/sdk/dist/namespaces/me.d.ts.map +1 -1
- package/sdk/dist/namespaces/me.js +3 -0
- package/sdk/dist/namespaces/me.js.map +1 -1
- package/sdk/dist/namespaces/org.d.ts.map +1 -1
- package/sdk/dist/namespaces/org.js +3 -0
- package/sdk/dist/namespaces/org.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts.map +1 -1
- package/sdk/dist/namespaces/projects.js +5 -0
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/repos.d.ts.map +1 -1
- package/sdk/dist/namespaces/repos.js +5 -0
- package/sdk/dist/namespaces/repos.js.map +1 -1
- package/sdk/dist/namespaces/rooms.d.ts.map +1 -1
- package/sdk/dist/namespaces/rooms.js +3 -0
- package/sdk/dist/namespaces/rooms.js.map +1 -1
- package/sdk/dist/namespaces/session.d.ts.map +1 -1
- package/sdk/dist/namespaces/session.js +18 -0
- package/sdk/dist/namespaces/session.js.map +1 -1
- package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
- package/sdk/dist/namespaces/transfers.js +3 -0
- package/sdk/dist/namespaces/transfers.js.map +1 -1
- package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
- package/sdk/dist/namespaces/wallets.js +2 -0
- package/sdk/dist/namespaces/wallets.js.map +1 -1
- package/sdk/dist/namespaces/write-approval.d.ts.map +1 -1
- package/sdk/dist/namespaces/write-approval.js +3 -0
- package/sdk/dist/namespaces/write-approval.js.map +1 -1
- package/sdk/dist/node/actions-node.d.ts.map +1 -1
- package/sdk/dist/node/actions-node.js +3 -0
- package/sdk/dist/node/actions-node.js.map +1 -1
- package/sdk/dist/node/buzz-doctor-contract.d.ts +155 -0
- package/sdk/dist/node/buzz-doctor-contract.d.ts.map +1 -0
- package/sdk/dist/node/buzz-doctor-contract.js +385 -0
- package/sdk/dist/node/buzz-doctor-contract.js.map +1 -0
- package/sdk/dist/node/buzz-doctor.d.ts +155 -0
- package/sdk/dist/node/buzz-doctor.d.ts.map +1 -0
- package/sdk/dist/node/buzz-doctor.js +810 -0
- package/sdk/dist/node/buzz-doctor.js.map +1 -0
- package/sdk/dist/node/credentials.d.ts +9 -4
- package/sdk/dist/node/credentials.d.ts.map +1 -1
- package/sdk/dist/node/credentials.js +1 -1
- package/sdk/dist/node/credentials.js.map +1 -1
- package/sdk/dist/node/diagnostics.d.ts +45 -0
- package/sdk/dist/node/diagnostics.d.ts.map +1 -0
- package/sdk/dist/node/diagnostics.js +67 -0
- package/sdk/dist/node/diagnostics.js.map +1 -0
- package/sdk/dist/node/doctor.d.ts +101 -0
- package/sdk/dist/node/doctor.d.ts.map +1 -0
- package/sdk/dist/node/doctor.js +618 -0
- package/sdk/dist/node/doctor.js.map +1 -0
- package/sdk/dist/node/index.d.ts +57 -5
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +36 -1
- package/sdk/dist/node/index.js.map +1 -1
- package/sdk/dist/node/init.d.ts +137 -0
- package/sdk/dist/node/init.d.ts.map +1 -0
- package/sdk/dist/node/init.js +507 -0
- package/sdk/dist/node/init.js.map +1 -0
- package/sdk/dist/node/lightning-wallet.d.ts +61 -0
- package/sdk/dist/node/lightning-wallet.d.ts.map +1 -0
- package/sdk/dist/node/lightning-wallet.js +126 -0
- package/sdk/dist/node/lightning-wallet.js.map +1 -0
- package/sdk/dist/node/local-actions.d.ts +23 -0
- package/sdk/dist/node/local-actions.d.ts.map +1 -0
- package/sdk/dist/node/local-actions.js +38 -0
- package/sdk/dist/node/local-actions.js.map +1 -0
- package/sdk/dist/node/org-context.d.ts +169 -0
- package/sdk/dist/node/org-context.d.ts.map +1 -0
- package/sdk/dist/node/org-context.js +403 -0
- package/sdk/dist/node/org-context.js.map +1 -0
- package/sdk/dist/node/status.d.ts +62 -0
- package/sdk/dist/node/status.d.ts.map +1 -0
- package/sdk/dist/node/status.js +132 -0
- package/sdk/dist/node/status.js.map +1 -0
- package/sdk/dist/node/vault-target.d.ts +49 -0
- package/sdk/dist/node/vault-target.d.ts.map +1 -0
- package/sdk/dist/node/vault-target.js +109 -0
- package/sdk/dist/node/vault-target.js.map +1 -0
- package/sdk/dist/node/wallets.d.ts +242 -0
- package/sdk/dist/node/wallets.d.ts.map +1 -0
- package/sdk/dist/node/wallets.js +484 -0
- package/sdk/dist/node/wallets.js.map +1 -0
- package/sdk/dist/secret-gate.d.ts +377 -0
- package/sdk/dist/secret-gate.d.ts.map +1 -0
- package/sdk/dist/secret-gate.js +273 -0
- package/sdk/dist/secret-gate.js.map +1 -0
- package/dist/active-project.d.ts +0 -3
- package/dist/active-project.d.ts.map +0 -1
- package/dist/active-project.js +0 -36
- package/dist/active-project.js.map +0 -1
- package/dist/format-bytes.d.ts +0 -2
- package/dist/format-bytes.d.ts.map +0 -1
- package/dist/format-bytes.js +0 -24
- package/dist/format-bytes.js.map +0 -1
- package/dist/harness-context.d.ts +0 -126
- package/dist/harness-context.d.ts.map +0 -1
- package/dist/harness-context.js +0 -283
- package/dist/harness-context.js.map +0 -1
- package/dist/tool-profiles.d.ts +0 -52
- package/dist/tool-profiles.d.ts.map +0 -1
- package/dist/tool-profiles.js +0 -77
- package/dist/tool-profiles.js.map +0 -1
- package/dist/tools/ack-room-message.d.ts +0 -22
- package/dist/tools/ack-room-message.d.ts.map +0 -1
- package/dist/tools/ack-room-message.js +0 -29
- package/dist/tools/ack-room-message.js.map +0 -1
- package/dist/tools/admin-archive-project.d.ts +0 -16
- package/dist/tools/admin-archive-project.d.ts.map +0 -1
- package/dist/tools/admin-archive-project.js +0 -41
- package/dist/tools/admin-archive-project.js.map +0 -1
- package/dist/tools/admin-reactivate-project.d.ts +0 -14
- package/dist/tools/admin-reactivate-project.d.ts.map +0 -1
- package/dist/tools/admin-reactivate-project.js +0 -35
- package/dist/tools/admin-reactivate-project.js.map +0 -1
- package/dist/tools/admin-set-lease-perpetual.d.ts +0 -16
- package/dist/tools/admin-set-lease-perpetual.d.ts.map +0 -1
- package/dist/tools/admin-set-lease-perpetual.js +0 -34
- package/dist/tools/admin-set-lease-perpetual.js.map +0 -1
- package/dist/tools/ai-moderate.d.ts +0 -16
- package/dist/tools/ai-moderate.d.ts.map +0 -1
- package/dist/tools/ai-moderate.js +0 -29
- package/dist/tools/ai-moderate.js.map +0 -1
- package/dist/tools/ai-translate.d.ts +0 -22
- package/dist/tools/ai-translate.d.ts.map +0 -1
- package/dist/tools/ai-translate.js +0 -50
- package/dist/tools/ai-translate.js.map +0 -1
- package/dist/tools/ai-usage.d.ts +0 -14
- package/dist/tools/ai-usage.d.ts.map +0 -1
- package/dist/tools/ai-usage.js +0 -33
- package/dist/tools/ai-usage.js.map +0 -1
- package/dist/tools/apply-expose.d.ts +0 -135
- package/dist/tools/apply-expose.d.ts.map +0 -1
- package/dist/tools/apply-expose.js +0 -73
- package/dist/tools/apply-expose.js.map +0 -1
- package/dist/tools/assets-diagnose.d.ts +0 -30
- package/dist/tools/assets-diagnose.d.ts.map +0 -1
- package/dist/tools/assets-diagnose.js +0 -65
- package/dist/tools/assets-diagnose.js.map +0 -1
- package/dist/tools/assets-get.d.ts +0 -20
- package/dist/tools/assets-get.d.ts.map +0 -1
- package/dist/tools/assets-get.js +0 -44
- package/dist/tools/assets-get.js.map +0 -1
- package/dist/tools/assets-ls.d.ts +0 -54
- package/dist/tools/assets-ls.d.ts.map +0 -1
- package/dist/tools/assets-ls.js +0 -81
- package/dist/tools/assets-ls.js.map +0 -1
- package/dist/tools/assets-put.d.ts +0 -32
- package/dist/tools/assets-put.d.ts.map +0 -1
- package/dist/tools/assets-put.js +0 -117
- package/dist/tools/assets-put.js.map +0 -1
- package/dist/tools/assets-rm.d.ts +0 -18
- package/dist/tools/assets-rm.d.ts.map +0 -1
- package/dist/tools/assets-rm.js +0 -17
- package/dist/tools/assets-rm.js.map +0 -1
- package/dist/tools/assets-sign.d.ts +0 -20
- package/dist/tools/assets-sign.d.ts.map +0 -1
- package/dist/tools/assets-sign.js +0 -25
- package/dist/tools/assets-sign.js.map +0 -1
- package/dist/tools/assets-wait-fresh.d.ts +0 -30
- package/dist/tools/assets-wait-fresh.d.ts.map +0 -1
- package/dist/tools/assets-wait-fresh.js +0 -51
- package/dist/tools/assets-wait-fresh.js.map +0 -1
- package/dist/tools/auth-settings.d.ts +0 -24
- package/dist/tools/auth-settings.d.ts.map +0 -1
- package/dist/tools/auth-settings.js +0 -42
- package/dist/tools/auth-settings.js.map +0 -1
- package/dist/tools/auth-users.d.ts +0 -40
- package/dist/tools/auth-users.d.ts.map +0 -1
- package/dist/tools/auth-users.js +0 -77
- package/dist/tools/auth-users.js.map +0 -1
- package/dist/tools/billing-history.d.ts +0 -16
- package/dist/tools/billing-history.d.ts.map +0 -1
- package/dist/tools/billing-history.js +0 -34
- package/dist/tools/billing-history.js.map +0 -1
- package/dist/tools/browse-apps.d.ts +0 -14
- package/dist/tools/browse-apps.d.ts.map +0 -1
- package/dist/tools/browse-apps.js +0 -37
- package/dist/tools/browse-apps.js.map +0 -1
- package/dist/tools/buzz-route-deliveries.d.ts +0 -27
- package/dist/tools/buzz-route-deliveries.d.ts.map +0 -1
- package/dist/tools/buzz-route-deliveries.js +0 -68
- package/dist/tools/buzz-route-deliveries.js.map +0 -1
- package/dist/tools/check-balance.d.ts +0 -14
- package/dist/tools/check-balance.d.ts.map +0 -1
- package/dist/tools/check-balance.js +0 -31
- package/dist/tools/check-balance.js.map +0 -1
- package/dist/tools/ci.d.ts +0 -52
- package/dist/tools/ci.d.ts.map +0 -1
- package/dist/tools/ci.js +0 -150
- package/dist/tools/ci.js.map +0 -1
- package/dist/tools/claim-room-resource.d.ts +0 -28
- package/dist/tools/claim-room-resource.d.ts.map +0 -1
- package/dist/tools/claim-room-resource.js +0 -36
- package/dist/tools/claim-room-resource.js.map +0 -1
- package/dist/tools/contract-call.d.ts +0 -30
- package/dist/tools/contract-call.d.ts.map +0 -1
- package/dist/tools/contract-call.js +0 -33
- package/dist/tools/contract-call.js.map +0 -1
- package/dist/tools/contract-deploy.d.ts +0 -24
- package/dist/tools/contract-deploy.d.ts.map +0 -1
- package/dist/tools/contract-deploy.js +0 -36
- package/dist/tools/contract-deploy.js.map +0 -1
- package/dist/tools/contract-read.d.ts +0 -22
- package/dist/tools/contract-read.d.ts.map +0 -1
- package/dist/tools/contract-read.js +0 -26
- package/dist/tools/contract-read.js.map +0 -1
- package/dist/tools/create-checkout.d.ts +0 -24
- package/dist/tools/create-checkout.d.ts.map +0 -1
- package/dist/tools/create-checkout.js +0 -58
- package/dist/tools/create-checkout.js.map +0 -1
- package/dist/tools/create-email-organization.d.ts +0 -14
- package/dist/tools/create-email-organization.d.ts.map +0 -1
- package/dist/tools/create-email-organization.js +0 -21
- package/dist/tools/create-email-organization.js.map +0 -1
- package/dist/tools/create-mailbox.d.ts +0 -16
- package/dist/tools/create-mailbox.d.ts.map +0 -1
- package/dist/tools/create-mailbox.js +0 -61
- package/dist/tools/create-mailbox.js.map +0 -1
- package/dist/tools/create-notification-rule.d.ts +0 -22
- package/dist/tools/create-notification-rule.d.ts.map +0 -1
- package/dist/tools/create-notification-rule.js +0 -41
- package/dist/tools/create-notification-rule.js.map +0 -1
- package/dist/tools/delete-function.d.ts +0 -16
- package/dist/tools/delete-function.d.ts.map +0 -1
- package/dist/tools/delete-function.js +0 -24
- package/dist/tools/delete-function.js.map +0 -1
- package/dist/tools/delete-mailbox-webhook.d.ts +0 -18
- package/dist/tools/delete-mailbox-webhook.d.ts.map +0 -1
- package/dist/tools/delete-mailbox-webhook.js +0 -25
- package/dist/tools/delete-mailbox-webhook.js.map +0 -1
- package/dist/tools/delete-mailbox.d.ts +0 -18
- package/dist/tools/delete-mailbox.d.ts.map +0 -1
- package/dist/tools/delete-mailbox.js +0 -41
- package/dist/tools/delete-mailbox.js.map +0 -1
- package/dist/tools/delete-notification-rule.d.ts +0 -14
- package/dist/tools/delete-notification-rule.d.ts.map +0 -1
- package/dist/tools/delete-notification-rule.js +0 -20
- package/dist/tools/delete-notification-rule.js.map +0 -1
- package/dist/tools/delete-project.d.ts +0 -14
- package/dist/tools/delete-project.d.ts.map +0 -1
- package/dist/tools/delete-project.js +0 -25
- package/dist/tools/delete-project.js.map +0 -1
- package/dist/tools/delete-secret.d.ts +0 -16
- package/dist/tools/delete-secret.d.ts.map +0 -1
- package/dist/tools/delete-secret.js +0 -24
- package/dist/tools/delete-secret.js.map +0 -1
- package/dist/tools/delete-signer.d.ts +0 -16
- package/dist/tools/delete-signer.d.ts.map +0 -1
- package/dist/tools/delete-signer.js +0 -17
- package/dist/tools/delete-signer.js.map +0 -1
- package/dist/tools/delete-version.d.ts +0 -16
- package/dist/tools/delete-version.d.ts.map +0 -1
- package/dist/tools/delete-version.js +0 -17
- package/dist/tools/delete-version.js.map +0 -1
- package/dist/tools/demote-user.d.ts +0 -16
- package/dist/tools/demote-user.d.ts.map +0 -1
- package/dist/tools/demote-user.js +0 -24
- package/dist/tools/demote-user.js.map +0 -1
- package/dist/tools/deploy-events.d.ts +0 -25
- package/dist/tools/deploy-events.d.ts.map +0 -1
- package/dist/tools/deploy-events.js +0 -69
- package/dist/tools/deploy-events.js.map +0 -1
- package/dist/tools/deploy-function.d.ts +0 -36
- package/dist/tools/deploy-function.d.ts.map +0 -1
- package/dist/tools/deploy-function.js +0 -91
- package/dist/tools/deploy-function.js.map +0 -1
- package/dist/tools/deploy-list.d.ts +0 -25
- package/dist/tools/deploy-list.d.ts.map +0 -1
- package/dist/tools/deploy-list.js +0 -71
- package/dist/tools/deploy-list.js.map +0 -1
- package/dist/tools/deploy-rehearse.d.ts +0 -22
- package/dist/tools/deploy-rehearse.d.ts.map +0 -1
- package/dist/tools/deploy-rehearse.js +0 -76
- package/dist/tools/deploy-rehearse.js.map +0 -1
- package/dist/tools/deploy-releases.d.ts +0 -55
- package/dist/tools/deploy-releases.d.ts.map +0 -1
- package/dist/tools/deploy-releases.js +0 -168
- package/dist/tools/deploy-releases.js.map +0 -1
- package/dist/tools/deploy-resolve.d.ts +0 -27
- package/dist/tools/deploy-resolve.d.ts.map +0 -1
- package/dist/tools/deploy-resolve.js +0 -129
- package/dist/tools/deploy-resolve.js.map +0 -1
- package/dist/tools/deploy-resume.d.ts +0 -22
- package/dist/tools/deploy-resume.d.ts.map +0 -1
- package/dist/tools/deploy-resume.js +0 -80
- package/dist/tools/deploy-resume.js.map +0 -1
- package/dist/tools/deploy-site-dir.d.ts +0 -16
- package/dist/tools/deploy-site-dir.d.ts.map +0 -1
- package/dist/tools/deploy-site-dir.js +0 -77
- package/dist/tools/deploy-site-dir.js.map +0 -1
- package/dist/tools/deploy-site.d.ts +0 -32
- package/dist/tools/deploy-site.d.ts.map +0 -1
- package/dist/tools/deploy-site.js +0 -65
- package/dist/tools/deploy-site.js.map +0 -1
- package/dist/tools/deploy-verify-edge.d.ts +0 -24
- package/dist/tools/deploy-verify-edge.d.ts.map +0 -1
- package/dist/tools/deploy-verify-edge.js +0 -120
- package/dist/tools/deploy-verify-edge.js.map +0 -1
- package/dist/tools/domains.d.ts +0 -84
- package/dist/tools/domains.d.ts.map +0 -1
- package/dist/tools/domains.js +0 -134
- package/dist/tools/domains.js.map +0 -1
- package/dist/tools/drain-signer.d.ts +0 -18
- package/dist/tools/drain-signer.d.ts.map +0 -1
- package/dist/tools/drain-signer.js +0 -18
- package/dist/tools/drain-signer.js.map +0 -1
- package/dist/tools/errors-list.d.ts +0 -43
- package/dist/tools/errors-list.d.ts.map +0 -1
- package/dist/tools/errors-list.js +0 -79
- package/dist/tools/errors-list.js.map +0 -1
- package/dist/tools/escalations-shared.d.ts +0 -13
- package/dist/tools/escalations-shared.d.ts.map +0 -1
- package/dist/tools/escalations-shared.js +0 -32
- package/dist/tools/escalations-shared.js.map +0 -1
- package/dist/tools/fork-app.d.ts +0 -18
- package/dist/tools/fork-app.d.ts.map +0 -1
- package/dist/tools/fork-app.js +0 -45
- package/dist/tools/fork-app.js.map +0 -1
- package/dist/tools/function-runs.d.ts +0 -172
- package/dist/tools/function-runs.d.ts.map +0 -1
- package/dist/tools/function-runs.js +0 -243
- package/dist/tools/function-runs.js.map +0 -1
- package/dist/tools/functions-rebuild.d.ts +0 -16
- package/dist/tools/functions-rebuild.d.ts.map +0 -1
- package/dist/tools/functions-rebuild.js +0 -75
- package/dist/tools/functions-rebuild.js.map +0 -1
- package/dist/tools/generate-image.d.ts +0 -20
- package/dist/tools/generate-image.d.ts.map +0 -1
- package/dist/tools/generate-image.js +0 -113
- package/dist/tools/generate-image.js.map +0 -1
- package/dist/tools/get-agent-contact-status.d.ts +0 -9
- package/dist/tools/get-agent-contact-status.d.ts.map +0 -1
- package/dist/tools/get-agent-contact-status.js +0 -18
- package/dist/tools/get-agent-contact-status.js.map +0 -1
- package/dist/tools/get-app.d.ts +0 -14
- package/dist/tools/get-app.d.ts.map +0 -1
- package/dist/tools/get-app.js +0 -42
- package/dist/tools/get-app.js.map +0 -1
- package/dist/tools/get-buzz-route.d.ts +0 -26
- package/dist/tools/get-buzz-route.d.ts.map +0 -1
- package/dist/tools/get-buzz-route.js +0 -100
- package/dist/tools/get-buzz-route.js.map +0 -1
- package/dist/tools/get-contract-call-status.d.ts +0 -16
- package/dist/tools/get-contract-call-status.d.ts.map +0 -1
- package/dist/tools/get-contract-call-status.js +0 -17
- package/dist/tools/get-contract-call-status.js.map +0 -1
- package/dist/tools/get-email-raw.d.ts +0 -29
- package/dist/tools/get-email-raw.d.ts.map +0 -1
- package/dist/tools/get-email-raw.js +0 -54
- package/dist/tools/get-email-raw.js.map +0 -1
- package/dist/tools/get-email.d.ts +0 -18
- package/dist/tools/get-email.d.ts.map +0 -1
- package/dist/tools/get-email.js +0 -43
- package/dist/tools/get-email.js.map +0 -1
- package/dist/tools/get-escalation.d.ts +0 -25
- package/dist/tools/get-escalation.d.ts.map +0 -1
- package/dist/tools/get-escalation.js +0 -74
- package/dist/tools/get-escalation.js.map +0 -1
- package/dist/tools/get-expose.d.ts +0 -14
- package/dist/tools/get-expose.d.ts.map +0 -1
- package/dist/tools/get-expose.js +0 -36
- package/dist/tools/get-expose.js.map +0 -1
- package/dist/tools/get-function-logs.d.ts +0 -25
- package/dist/tools/get-function-logs.d.ts.map +0 -1
- package/dist/tools/get-function-logs.js +0 -143
- package/dist/tools/get-function-logs.js.map +0 -1
- package/dist/tools/get-mailbox-webhook.d.ts +0 -18
- package/dist/tools/get-mailbox-webhook.d.ts.map +0 -1
- package/dist/tools/get-mailbox-webhook.js +0 -30
- package/dist/tools/get-mailbox-webhook.js.map +0 -1
- package/dist/tools/get-mailbox.d.ts +0 -16
- package/dist/tools/get-mailbox.d.ts.map +0 -1
- package/dist/tools/get-mailbox.js +0 -65
- package/dist/tools/get-mailbox.js.map +0 -1
- package/dist/tools/get-notification-preferences.d.ts +0 -9
- package/dist/tools/get-notification-preferences.d.ts.map +0 -1
- package/dist/tools/get-notification-preferences.js +0 -17
- package/dist/tools/get-notification-preferences.js.map +0 -1
- package/dist/tools/get-quote.d.ts +0 -9
- package/dist/tools/get-quote.d.ts.map +0 -1
- package/dist/tools/get-quote.js +0 -24
- package/dist/tools/get-quote.js.map +0 -1
- package/dist/tools/get-room.d.ts +0 -20
- package/dist/tools/get-room.d.ts.map +0 -1
- package/dist/tools/get-room.js +0 -25
- package/dist/tools/get-room.js.map +0 -1
- package/dist/tools/get-schema.d.ts +0 -14
- package/dist/tools/get-schema.d.ts.map +0 -1
- package/dist/tools/get-schema.js +0 -72
- package/dist/tools/get-schema.js.map +0 -1
- package/dist/tools/get-signer.d.ts +0 -16
- package/dist/tools/get-signer.d.ts.map +0 -1
- package/dist/tools/get-signer.js +0 -17
- package/dist/tools/get-signer.js.map +0 -1
- package/dist/tools/get-usage.d.ts +0 -14
- package/dist/tools/get-usage.d.ts.map +0 -1
- package/dist/tools/get-usage.js +0 -41
- package/dist/tools/get-usage.js.map +0 -1
- package/dist/tools/grants.d.ts +0 -56
- package/dist/tools/grants.d.ts.map +0 -1
- package/dist/tools/grants.js +0 -99
- package/dist/tools/grants.js.map +0 -1
- package/dist/tools/init.d.ts +0 -16
- package/dist/tools/init.d.ts.map +0 -1
- package/dist/tools/init.js +0 -186
- package/dist/tools/init.js.map +0 -1
- package/dist/tools/invoke-function.d.ts +0 -30
- package/dist/tools/invoke-function.d.ts.map +0 -1
- package/dist/tools/invoke-function.js +0 -77
- package/dist/tools/invoke-function.js.map +0 -1
- package/dist/tools/jobs.d.ts +0 -124
- package/dist/tools/jobs.d.ts.map +0 -1
- package/dist/tools/jobs.js +0 -160
- package/dist/tools/jobs.js.map +0 -1
- package/dist/tools/join-room.d.ts +0 -24
- package/dist/tools/join-room.d.ts.map +0 -1
- package/dist/tools/join-room.js +0 -59
- package/dist/tools/join-room.js.map +0 -1
- package/dist/tools/leave-room.d.ts +0 -22
- package/dist/tools/leave-room.d.ts.map +0 -1
- package/dist/tools/leave-room.js +0 -40
- package/dist/tools/leave-room.js.map +0 -1
- package/dist/tools/lightning-topup.d.ts +0 -28
- package/dist/tools/lightning-topup.d.ts.map +0 -1
- package/dist/tools/lightning-topup.js +0 -57
- package/dist/tools/lightning-topup.js.map +0 -1
- package/dist/tools/lightning-wallet.d.ts +0 -21
- package/dist/tools/lightning-wallet.d.ts.map +0 -1
- package/dist/tools/lightning-wallet.js +0 -91
- package/dist/tools/lightning-wallet.js.map +0 -1
- package/dist/tools/link-wallet-to-organization.d.ts +0 -16
- package/dist/tools/link-wallet-to-organization.d.ts.map +0 -1
- package/dist/tools/link-wallet-to-organization.js +0 -41
- package/dist/tools/link-wallet-to-organization.js.map +0 -1
- package/dist/tools/list-emails.d.ts +0 -22
- package/dist/tools/list-emails.d.ts.map +0 -1
- package/dist/tools/list-emails.js +0 -54
- package/dist/tools/list-emails.js.map +0 -1
- package/dist/tools/list-functions.d.ts +0 -14
- package/dist/tools/list-functions.d.ts.map +0 -1
- package/dist/tools/list-functions.js +0 -115
- package/dist/tools/list-functions.js.map +0 -1
- package/dist/tools/list-mailbox-webhook-deliveries.d.ts +0 -22
- package/dist/tools/list-mailbox-webhook-deliveries.d.ts.map +0 -1
- package/dist/tools/list-mailbox-webhook-deliveries.js +0 -52
- package/dist/tools/list-mailbox-webhook-deliveries.js.map +0 -1
- package/dist/tools/list-mailbox-webhooks.d.ts +0 -16
- package/dist/tools/list-mailbox-webhooks.d.ts.map +0 -1
- package/dist/tools/list-mailbox-webhooks.js +0 -28
- package/dist/tools/list-mailbox-webhooks.js.map +0 -1
- package/dist/tools/list-mailboxes.d.ts +0 -14
- package/dist/tools/list-mailboxes.d.ts.map +0 -1
- package/dist/tools/list-mailboxes.js +0 -58
- package/dist/tools/list-mailboxes.js.map +0 -1
- package/dist/tools/list-notification-channels.d.ts +0 -9
- package/dist/tools/list-notification-channels.d.ts.map +0 -1
- package/dist/tools/list-notification-channels.js +0 -17
- package/dist/tools/list-notification-channels.js.map +0 -1
- package/dist/tools/list-notification-rules.d.ts +0 -9
- package/dist/tools/list-notification-rules.d.ts.map +0 -1
- package/dist/tools/list-notification-rules.js +0 -17
- package/dist/tools/list-notification-rules.js.map +0 -1
- package/dist/tools/list-notifications.d.ts +0 -20
- package/dist/tools/list-notifications.d.ts.map +0 -1
- package/dist/tools/list-notifications.js +0 -23
- package/dist/tools/list-notifications.js.map +0 -1
- package/dist/tools/list-project-events.d.ts +0 -47
- package/dist/tools/list-project-events.d.ts.map +0 -1
- package/dist/tools/list-project-events.js +0 -65
- package/dist/tools/list-project-events.js.map +0 -1
- package/dist/tools/list-projects.d.ts +0 -20
- package/dist/tools/list-projects.d.ts.map +0 -1
- package/dist/tools/list-projects.js +0 -70
- package/dist/tools/list-projects.js.map +0 -1
- package/dist/tools/list-rooms.d.ts +0 -18
- package/dist/tools/list-rooms.d.ts.map +0 -1
- package/dist/tools/list-rooms.js +0 -28
- package/dist/tools/list-rooms.js.map +0 -1
- package/dist/tools/list-secrets.d.ts +0 -14
- package/dist/tools/list-secrets.d.ts.map +0 -1
- package/dist/tools/list-secrets.js +0 -35
- package/dist/tools/list-secrets.js.map +0 -1
- package/dist/tools/list-signers.d.ts +0 -14
- package/dist/tools/list-signers.d.ts.map +0 -1
- package/dist/tools/list-signers.js +0 -16
- package/dist/tools/list-signers.js.map +0 -1
- package/dist/tools/list-subdomains.d.ts +0 -14
- package/dist/tools/list-subdomains.d.ts.map +0 -1
- package/dist/tools/list-subdomains.js +0 -35
- package/dist/tools/list-subdomains.js.map +0 -1
- package/dist/tools/list-tenant-payments.d.ts +0 -22
- package/dist/tools/list-tenant-payments.d.ts.map +0 -1
- package/dist/tools/list-tenant-payments.js +0 -47
- package/dist/tools/list-tenant-payments.js.map +0 -1
- package/dist/tools/list-versions.d.ts +0 -14
- package/dist/tools/list-versions.d.ts.map +0 -1
- package/dist/tools/list-versions.js +0 -36
- package/dist/tools/list-versions.js.map +0 -1
- package/dist/tools/orgs.d.ts +0 -93
- package/dist/tools/orgs.d.ts.map +0 -1
- package/dist/tools/orgs.js +0 -323
- package/dist/tools/orgs.js.map +0 -1
- package/dist/tools/passkeys.d.ts +0 -72
- package/dist/tools/passkeys.d.ts.map +0 -1
- package/dist/tools/passkeys.js +0 -156
- package/dist/tools/passkeys.js.map +0 -1
- package/dist/tools/pay-url.d.ts +0 -39
- package/dist/tools/pay-url.d.ts.map +0 -1
- package/dist/tools/pay-url.js +0 -106
- package/dist/tools/pay-url.js.map +0 -1
- package/dist/tools/project-archives.d.ts +0 -62
- package/dist/tools/project-archives.d.ts.map +0 -1
- package/dist/tools/project-archives.js +0 -127
- package/dist/tools/project-archives.js.map +0 -1
- package/dist/tools/project-branches.d.ts +0 -50
- package/dist/tools/project-branches.d.ts.map +0 -1
- package/dist/tools/project-branches.js +0 -84
- package/dist/tools/project-branches.js.map +0 -1
- package/dist/tools/project-get.d.ts +0 -16
- package/dist/tools/project-get.d.ts.map +0 -1
- package/dist/tools/project-get.js +0 -46
- package/dist/tools/project-get.js.map +0 -1
- package/dist/tools/project-key-cache-export.d.ts +0 -18
- package/dist/tools/project-key-cache-export.d.ts.map +0 -1
- package/dist/tools/project-key-cache-export.js +0 -29
- package/dist/tools/project-key-cache-export.js.map +0 -1
- package/dist/tools/project-key-cache-status.d.ts +0 -16
- package/dist/tools/project-key-cache-status.d.ts.map +0 -1
- package/dist/tools/project-key-cache-status.js +0 -34
- package/dist/tools/project-key-cache-status.js.map +0 -1
- package/dist/tools/project-snapshots.d.ts +0 -56
- package/dist/tools/project-snapshots.d.ts.map +0 -1
- package/dist/tools/project-snapshots.js +0 -100
- package/dist/tools/project-snapshots.js.map +0 -1
- package/dist/tools/project-use.d.ts +0 -16
- package/dist/tools/project-use.d.ts.map +0 -1
- package/dist/tools/project-use.js +0 -23
- package/dist/tools/project-use.js.map +0 -1
- package/dist/tools/promote-user.d.ts +0 -16
- package/dist/tools/promote-user.d.ts.map +0 -1
- package/dist/tools/promote-user.js +0 -24
- package/dist/tools/promote-user.js.map +0 -1
- package/dist/tools/provision-signer.d.ts +0 -18
- package/dist/tools/provision-signer.d.ts.map +0 -1
- package/dist/tools/provision-signer.js +0 -21
- package/dist/tools/provision-signer.js.map +0 -1
- package/dist/tools/provision.d.ts +0 -18
- package/dist/tools/provision.d.ts.map +0 -1
- package/dist/tools/provision.js +0 -73
- package/dist/tools/provision.js.map +0 -1
- package/dist/tools/publish-app.d.ts +0 -22
- package/dist/tools/publish-app.d.ts.map +0 -1
- package/dist/tools/publish-app.js +0 -47
- package/dist/tools/publish-app.js.map +0 -1
- package/dist/tools/raise-escalation.d.ts +0 -31
- package/dist/tools/raise-escalation.d.ts.map +0 -1
- package/dist/tools/raise-escalation.js +0 -69
- package/dist/tools/raise-escalation.js.map +0 -1
- package/dist/tools/read-room-messages.d.ts +0 -32
- package/dist/tools/read-room-messages.d.ts.map +0 -1
- package/dist/tools/read-room-messages.js +0 -46
- package/dist/tools/read-room-messages.js.map +0 -1
- package/dist/tools/redeem-voucher.d.ts +0 -14
- package/dist/tools/redeem-voucher.d.ts.map +0 -1
- package/dist/tools/redeem-voucher.js +0 -41
- package/dist/tools/redeem-voucher.js.map +0 -1
- package/dist/tools/redrive-mailbox-webhook-delivery.d.ts +0 -18
- package/dist/tools/redrive-mailbox-webhook-delivery.d.ts.map +0 -1
- package/dist/tools/redrive-mailbox-webhook-delivery.js +0 -34
- package/dist/tools/redrive-mailbox-webhook-delivery.js.map +0 -1
- package/dist/tools/register-mailbox-webhook.d.ts +0 -20
- package/dist/tools/register-mailbox-webhook.d.ts.map +0 -1
- package/dist/tools/register-mailbox-webhook.js +0 -35
- package/dist/tools/register-mailbox-webhook.js.map +0 -1
- package/dist/tools/release-room-claim.d.ts +0 -22
- package/dist/tools/release-room-claim.d.ts.map +0 -1
- package/dist/tools/release-room-claim.js +0 -26
- package/dist/tools/release-room-claim.js.map +0 -1
- package/dist/tools/rename-project.d.ts +0 -16
- package/dist/tools/rename-project.d.ts.map +0 -1
- package/dist/tools/rename-project.js +0 -26
- package/dist/tools/rename-project.js.map +0 -1
- package/dist/tools/repos.d.ts +0 -70
- package/dist/tools/repos.d.ts.map +0 -1
- package/dist/tools/repos.js +0 -263
- package/dist/tools/repos.js.map +0 -1
- package/dist/tools/request-faucet.d.ts +0 -14
- package/dist/tools/request-faucet.d.ts.map +0 -1
- package/dist/tools/request-faucet.js +0 -50
- package/dist/tools/request-faucet.js.map +0 -1
- package/dist/tools/request-magic-link.d.ts +0 -24
- package/dist/tools/request-magic-link.d.ts.map +0 -1
- package/dist/tools/request-magic-link.js +0 -60
- package/dist/tools/request-magic-link.js.map +0 -1
- package/dist/tools/rest-query.d.ts +0 -24
- package/dist/tools/rest-query.d.ts.map +0 -1
- package/dist/tools/rest-query.js +0 -61
- package/dist/tools/rest-query.js.map +0 -1
- package/dist/tools/rooms-shared.d.ts +0 -39
- package/dist/tools/rooms-shared.d.ts.map +0 -1
- package/dist/tools/rooms-shared.js +0 -194
- package/dist/tools/rooms-shared.js.map +0 -1
- package/dist/tools/rotate-webhook-secret.d.ts +0 -9
- package/dist/tools/rotate-webhook-secret.d.ts.map +0 -1
- package/dist/tools/rotate-webhook-secret.js +0 -26
- package/dist/tools/rotate-webhook-secret.js.map +0 -1
- package/dist/tools/run-sql.d.ts +0 -18
- package/dist/tools/run-sql.d.ts.map +0 -1
- package/dist/tools/run-sql.js +0 -68
- package/dist/tools/run-sql.js.map +0 -1
- package/dist/tools/scaffold-roles.d.ts +0 -22
- package/dist/tools/scaffold-roles.d.ts.map +0 -1
- package/dist/tools/scaffold-roles.js +0 -88
- package/dist/tools/scaffold-roles.js.map +0 -1
- package/dist/tools/send-email.d.ts +0 -50
- package/dist/tools/send-email.d.ts.map +0 -1
- package/dist/tools/send-email.js +0 -84
- package/dist/tools/send-email.js.map +0 -1
- package/dist/tools/send-feedback.d.ts +0 -18
- package/dist/tools/send-feedback.d.ts.map +0 -1
- package/dist/tools/send-feedback.js +0 -36
- package/dist/tools/send-feedback.js.map +0 -1
- package/dist/tools/send-room-message.d.ts +0 -38
- package/dist/tools/send-room-message.d.ts.map +0 -1
- package/dist/tools/send-room-message.js +0 -54
- package/dist/tools/send-room-message.js.map +0 -1
- package/dist/tools/service-health.d.ts +0 -11
- package/dist/tools/service-health.d.ts.map +0 -1
- package/dist/tools/service-health.js +0 -42
- package/dist/tools/service-health.js.map +0 -1
- package/dist/tools/service-status.d.ts +0 -11
- package/dist/tools/service-status.d.ts.map +0 -1
- package/dist/tools/service-status.js +0 -46
- package/dist/tools/service-status.js.map +0 -1
- package/dist/tools/set-agent-contact.d.ts +0 -33
- package/dist/tools/set-agent-contact.d.ts.map +0 -1
- package/dist/tools/set-agent-contact.js +0 -52
- package/dist/tools/set-agent-contact.js.map +0 -1
- package/dist/tools/set-auto-recharge.d.ts +0 -18
- package/dist/tools/set-auto-recharge.d.ts.map +0 -1
- package/dist/tools/set-auto-recharge.js +0 -27
- package/dist/tools/set-auto-recharge.js.map +0 -1
- package/dist/tools/set-low-balance-alert.d.ts +0 -18
- package/dist/tools/set-low-balance-alert.d.ts.map +0 -1
- package/dist/tools/set-low-balance-alert.js +0 -18
- package/dist/tools/set-low-balance-alert.js.map +0 -1
- package/dist/tools/set-mailbox-defaults.d.ts +0 -18
- package/dist/tools/set-mailbox-defaults.d.ts.map +0 -1
- package/dist/tools/set-mailbox-defaults.js +0 -43
- package/dist/tools/set-mailbox-defaults.js.map +0 -1
- package/dist/tools/set-notification-preferences.d.ts +0 -28
- package/dist/tools/set-notification-preferences.d.ts.map +0 -1
- package/dist/tools/set-notification-preferences.js +0 -52
- package/dist/tools/set-notification-preferences.js.map +0 -1
- package/dist/tools/set-recovery-address.d.ts +0 -18
- package/dist/tools/set-recovery-address.d.ts.map +0 -1
- package/dist/tools/set-recovery-address.js +0 -18
- package/dist/tools/set-recovery-address.js.map +0 -1
- package/dist/tools/set-secret.d.ts +0 -18
- package/dist/tools/set-secret.d.ts.map +0 -1
- package/dist/tools/set-secret.js +0 -29
- package/dist/tools/set-secret.js.map +0 -1
- package/dist/tools/set-user-password.d.ts +0 -20
- package/dist/tools/set-user-password.d.ts.map +0 -1
- package/dist/tools/set-user-password.js +0 -31
- package/dist/tools/set-user-password.js.map +0 -1
- package/dist/tools/start-contact-passkey-enrollment.d.ts +0 -9
- package/dist/tools/start-contact-passkey-enrollment.d.ts.map +0 -1
- package/dist/tools/start-contact-passkey-enrollment.js +0 -18
- package/dist/tools/start-contact-passkey-enrollment.js.map +0 -1
- package/dist/tools/subdomain.d.ts +0 -34
- package/dist/tools/subdomain.d.ts.map +0 -1
- package/dist/tools/subdomain.js +0 -67
- package/dist/tools/subdomain.js.map +0 -1
- package/dist/tools/test-notification.d.ts +0 -16
- package/dist/tools/test-notification.d.ts.map +0 -1
- package/dist/tools/test-notification.js +0 -27
- package/dist/tools/test-notification.js.map +0 -1
- package/dist/tools/tier-set.d.ts +0 -14
- package/dist/tools/tier-set.d.ts.map +0 -1
- package/dist/tools/tier-set.js +0 -62
- package/dist/tools/tier-set.js.map +0 -1
- package/dist/tools/tier-status.d.ts +0 -9
- package/dist/tools/tier-status.d.ts.map +0 -1
- package/dist/tools/tier-status.js +0 -57
- package/dist/tools/tier-status.js.map +0 -1
- package/dist/tools/transfers.d.ts +0 -79
- package/dist/tools/transfers.d.ts.map +0 -1
- package/dist/tools/transfers.js +0 -332
- package/dist/tools/transfers.js.map +0 -1
- package/dist/tools/update-function.d.ts +0 -22
- package/dist/tools/update-function.d.ts.map +0 -1
- package/dist/tools/update-function.js +0 -64
- package/dist/tools/update-function.js.map +0 -1
- package/dist/tools/update-mailbox-webhook.d.ts +0 -22
- package/dist/tools/update-mailbox-webhook.d.ts.map +0 -1
- package/dist/tools/update-mailbox-webhook.js +0 -39
- package/dist/tools/update-mailbox-webhook.js.map +0 -1
- package/dist/tools/update-mailbox.d.ts +0 -18
- package/dist/tools/update-mailbox.d.ts.map +0 -1
- package/dist/tools/update-mailbox.js +0 -36
- package/dist/tools/update-mailbox.js.map +0 -1
- package/dist/tools/update-version.d.ts +0 -24
- package/dist/tools/update-version.d.ts.map +0 -1
- package/dist/tools/update-version.js +0 -26
- package/dist/tools/update-version.js.map +0 -1
- package/dist/tools/validate-manifest.d.ts +0 -19
- package/dist/tools/validate-manifest.d.ts.map +0 -1
- package/dist/tools/validate-manifest.js +0 -40
- package/dist/tools/validate-manifest.js.map +0 -1
- package/dist/tools/verify-agent-contact-email.d.ts +0 -9
- package/dist/tools/verify-agent-contact-email.d.ts.map +0 -1
- package/dist/tools/verify-agent-contact-email.js +0 -18
- package/dist/tools/verify-agent-contact-email.js.map +0 -1
- package/dist/tools/verify-magic-link.d.ts +0 -20
- package/dist/tools/verify-magic-link.d.ts.map +0 -1
- package/dist/tools/verify-magic-link.js +0 -40
- package/dist/tools/verify-magic-link.js.map +0 -1
- package/dist/tools/wallet-create.d.ts +0 -9
- package/dist/tools/wallet-create.d.ts.map +0 -1
- package/dist/tools/wallet-create.js +0 -36
- package/dist/tools/wallet-create.js.map +0 -1
- package/dist/tools/wallet-export.d.ts +0 -9
- package/dist/tools/wallet-export.d.ts.map +0 -1
- package/dist/tools/wallet-export.js +0 -21
- package/dist/tools/wallet-export.js.map +0 -1
- package/dist/tools/wallet-status.d.ts +0 -9
- package/dist/tools/wallet-status.d.ts.map +0 -1
- package/dist/tools/wallet-status.js +0 -33
- package/dist/tools/wallet-status.js.map +0 -1
package/dist/sandbox.js
ADDED
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `run` sandbox: a TypeScript snippet executes inside QuickJS compiled to
|
|
3
|
+
* WebAssembly (the asyncify build of `quickjs-emscripten`), never inside Node.
|
|
4
|
+
*
|
|
5
|
+
* A QuickJS runtime can touch the host only through functions the host binds
|
|
6
|
+
* into it, so `require`, `process`, `fetch`, `import()`, timers, and every Node
|
|
7
|
+
* builtin are absent by construction: there is nothing to deny. What the
|
|
8
|
+
* snippet does see is the global inventory below (`SANDBOX_GLOBALS`, pinned by
|
|
9
|
+
* `sandbox.test.ts`): the ECMAScript builtins QuickJS ships, the web builtins
|
|
10
|
+
* this module adds in plain JavaScript (`URL`, `TextEncoder`, `TextDecoder`,
|
|
11
|
+
* `structuredClone`, `crypto.randomUUID`), a captured `console`, and whatever
|
|
12
|
+
* an extension installs (the `r` recorder from `./sandbox-proxy.ts`).
|
|
13
|
+
*
|
|
14
|
+
* Each run gets its own WebAssembly module instance, runtime, and context, so
|
|
15
|
+
* nothing survives from one run to the next and a run that ends badly cannot
|
|
16
|
+
* poison another. Bounds: a memory limit on the runtime, a stack limit, and a
|
|
17
|
+
* deadline enforced two ways — the interrupt handler stops JavaScript that is
|
|
18
|
+
* running past it, and the event loop stops waiting on the host past it. An
|
|
19
|
+
* async host call already in flight at the deadline is allowed to settle
|
|
20
|
+
* before the run returns, because its side effect is real either way.
|
|
21
|
+
*
|
|
22
|
+
* The source is TypeScript or JavaScript. It is wrapped as the body of an
|
|
23
|
+
* async function (so top-level `await` and `return` both work), types are
|
|
24
|
+
* stripped on the host with `node:module`'s `stripTypeScriptTypes` (strip-only:
|
|
25
|
+
* `enum` and parameter properties are syntax errors, as in Node), the result is
|
|
26
|
+
* parsed, and when the body ends in an expression statement that statement is
|
|
27
|
+
* rewritten into a `return` from the parse tree, never by string search.
|
|
28
|
+
*/
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
30
|
+
import { stripTypeScriptTypes } from "node:module";
|
|
31
|
+
import { parse as parseJs } from "acorn";
|
|
32
|
+
import { newQuickJSAsyncWASMModule, } from "quickjs-emscripten";
|
|
33
|
+
/** 64 MB: the runtime's allocation ceiling. */
|
|
34
|
+
export const SANDBOX_MEMORY_LIMIT_BYTES = 64 * 1024 * 1024;
|
|
35
|
+
/** The interpreter's own stack ceiling, well inside the WebAssembly stack. */
|
|
36
|
+
export const SANDBOX_STACK_LIMIT_BYTES = 256 * 1024;
|
|
37
|
+
/** The serialized (compact JSON) value a run may return. */
|
|
38
|
+
export const SANDBOX_MAX_VALUE_BYTES = 4 * 1024 * 1024;
|
|
39
|
+
/** Console lines retained per run. */
|
|
40
|
+
export const SANDBOX_MAX_LOG_LINES = 500;
|
|
41
|
+
/** Characters retained per console line. */
|
|
42
|
+
export const SANDBOX_MAX_LOG_LINE_CHARS = 2048;
|
|
43
|
+
/** The file name QuickJS reports in stack traces. */
|
|
44
|
+
const SNIPPET_FILE = "snippet.ts";
|
|
45
|
+
/** The wrapper's head sits on line 1, so line numbers match the source and only line 1's columns shift. */
|
|
46
|
+
const WRAP_HEAD = "(async function () {";
|
|
47
|
+
const WRAP_TAIL = "\n})";
|
|
48
|
+
/**
|
|
49
|
+
* The snippet's global inventory, sorted. `r` is present when the chain proxy
|
|
50
|
+
* is installed (always, in the `run` tool). A new global is a deliberate diff
|
|
51
|
+
* of this list and of the snapshot test.
|
|
52
|
+
*/
|
|
53
|
+
export const SANDBOX_GLOBALS = [
|
|
54
|
+
"AggregateError", "Array", "ArrayBuffer", "BigInt", "BigInt64Array", "BigUint64Array", "Boolean",
|
|
55
|
+
"DataView", "Date", "Error", "EvalError", "FinalizationRegistry", "Float16Array", "Float32Array",
|
|
56
|
+
"Float64Array", "Function", "Infinity", "Int16Array", "Int32Array", "Int8Array", "InternalError",
|
|
57
|
+
"Iterator", "JSON", "Map", "Math", "NaN", "Number", "Object", "Promise", "Proxy", "RangeError",
|
|
58
|
+
"ReferenceError", "Reflect", "RegExp", "Set", "SharedArrayBuffer", "String", "Symbol", "SyntaxError",
|
|
59
|
+
"TextDecoder", "TextEncoder", "TypeError", "URIError", "URL", "Uint16Array", "Uint32Array", "Uint8Array",
|
|
60
|
+
"Uint8ClampedArray", "WeakMap", "WeakRef", "WeakSet", "console", "crypto", "decodeURI",
|
|
61
|
+
"decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "globalThis", "isFinite",
|
|
62
|
+
"isNaN", "parseFloat", "parseInt", "r", "structuredClone", "undefined", "unescape",
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Wrap, strip types, parse, and rewrite the final expression statement into a
|
|
66
|
+
* `return`. The result is the source of one async function expression.
|
|
67
|
+
*/
|
|
68
|
+
export function prepareSnippet(code) {
|
|
69
|
+
const wrapped = `${WRAP_HEAD}${code}${WRAP_TAIL}`;
|
|
70
|
+
let stripped;
|
|
71
|
+
try {
|
|
72
|
+
stripped = stripTypeScriptTypes(wrapped, { mode: "strip" });
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
return { ok: false, error: syntaxErrorFromStrip(err) };
|
|
76
|
+
}
|
|
77
|
+
let program;
|
|
78
|
+
try {
|
|
79
|
+
program = parseJs(stripped, { ecmaVersion: "latest", sourceType: "script", locations: true });
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
return { ok: false, error: syntaxErrorFromAcorn(err) };
|
|
83
|
+
}
|
|
84
|
+
// The whole source must be exactly the wrapper expression: a snippet that
|
|
85
|
+
// closes the wrapper's brace early is a syntax error, not a second program.
|
|
86
|
+
const only = program.body.length === 1 ? program.body[0] : null;
|
|
87
|
+
const fn = only?.type === "ExpressionStatement" ? only.expression : null;
|
|
88
|
+
if (!fn || fn.type !== "FunctionExpression" || !fn.async || fn.start !== 1) {
|
|
89
|
+
return {
|
|
90
|
+
ok: false,
|
|
91
|
+
error: { code: "RUN_SYNTAX_ERROR", message: "Unbalanced braces: the snippet closes a block it did not open.", line: 1, column: 1 },
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const statements = fn.body.body;
|
|
95
|
+
const last = statements.length > 0 ? statements[statements.length - 1] : null;
|
|
96
|
+
if (!last || last.type !== "ExpressionStatement" || !last.expression || last.directive !== undefined) {
|
|
97
|
+
return { ok: true, source: stripped };
|
|
98
|
+
}
|
|
99
|
+
const expr = last.expression;
|
|
100
|
+
const source = stripped.slice(0, last.start) +
|
|
101
|
+
"return (" + stripped.slice(expr.start, expr.end) + ");" +
|
|
102
|
+
stripped.slice(last.end);
|
|
103
|
+
return { ok: true, source };
|
|
104
|
+
}
|
|
105
|
+
function shiftColumn(line, column) {
|
|
106
|
+
return line === 1 ? Math.max(1, column - WRAP_HEAD.length) : column;
|
|
107
|
+
}
|
|
108
|
+
function syntaxErrorFromStrip(err) {
|
|
109
|
+
const e = err;
|
|
110
|
+
const message = typeof e?.message === "string" ? e.message : String(err);
|
|
111
|
+
const stack = typeof e?.stack === "string" ? e.stack.split("\n") : [];
|
|
112
|
+
// Node's type-stripping error stack is `:<line>`, the source line(s), then a caret line.
|
|
113
|
+
const lineMatch = /^[^\n]*:(\d+)$/.exec(stack[0] ?? "");
|
|
114
|
+
const line = lineMatch ? Number(lineMatch[1]) : 1;
|
|
115
|
+
const caret = stack.slice(1, 6).find((l) => /^\s*\^+\s*$/.test(l));
|
|
116
|
+
const column = caret ? caret.indexOf("^") + 1 : 1;
|
|
117
|
+
return { code: "RUN_SYNTAX_ERROR", message, line, column: shiftColumn(line, column) };
|
|
118
|
+
}
|
|
119
|
+
function syntaxErrorFromAcorn(err) {
|
|
120
|
+
const e = err;
|
|
121
|
+
const raw = typeof e?.message === "string" ? e.message : String(err);
|
|
122
|
+
const line = typeof e?.loc?.line === "number" ? e.loc.line : 1;
|
|
123
|
+
const column = typeof e?.loc?.column === "number" ? e.loc.column + 1 : 1;
|
|
124
|
+
const message = raw.replace(/\s*\(\d+:\d+\)$/, "");
|
|
125
|
+
return { code: "RUN_SYNTAX_ERROR", message, line, column: shiftColumn(line, column) };
|
|
126
|
+
}
|
|
127
|
+
/** The first `snippet.ts:<line>:<column>` frame of a QuickJS stack, mapped back to the source. */
|
|
128
|
+
function locationFromStack(stack) {
|
|
129
|
+
if (typeof stack !== "string")
|
|
130
|
+
return {};
|
|
131
|
+
const m = new RegExp(`${SNIPPET_FILE.replace(".", "\\.")}:(\\d+)(?::(\\d+))?`).exec(stack);
|
|
132
|
+
if (!m)
|
|
133
|
+
return {};
|
|
134
|
+
const line = Number(m[1]);
|
|
135
|
+
return m[2] ? { line, column: shiftColumn(line, Number(m[2])) } : { line };
|
|
136
|
+
}
|
|
137
|
+
// ─── the in-sandbox base: console, web builtins, the driver ──────────────────
|
|
138
|
+
/**
|
|
139
|
+
* Evaluated inside the sandbox and called with the base host object
|
|
140
|
+
* `{ log, settle, uuid, url }`. Defines `console`, `crypto`, `URL`,
|
|
141
|
+
* `TextEncoder`, `TextDecoder`, `structuredClone`, and returns the driver that
|
|
142
|
+
* runs the snippet function and reports how it settled.
|
|
143
|
+
*/
|
|
144
|
+
const BASE_INSTALL = String.raw `(function (host) {
|
|
145
|
+
"use strict";
|
|
146
|
+
const g = globalThis;
|
|
147
|
+
const stringify = JSON.stringify;
|
|
148
|
+
const define = (name, value) =>
|
|
149
|
+
Object.defineProperty(g, name, { value, writable: true, configurable: true, enumerable: false });
|
|
150
|
+
|
|
151
|
+
const format = (v) => {
|
|
152
|
+
if (typeof v === "string") return v;
|
|
153
|
+
if (v instanceof Error) return (v.name || "Error") + ": " + v.message;
|
|
154
|
+
if ((typeof v === "object" && v !== null) || typeof v === "function") {
|
|
155
|
+
try { const s = stringify(v); if (s !== undefined) return s; } catch (e) { /* fall through */ }
|
|
156
|
+
}
|
|
157
|
+
try { return String(v); } catch (e) { return Object.prototype.toString.call(v); }
|
|
158
|
+
};
|
|
159
|
+
const makeLevel = (level) => (...args) => { host.log(level, args.map(format).join(" ")); };
|
|
160
|
+
define("console", { log: makeLevel("log"), info: makeLevel("info"), warn: makeLevel("warn"), error: makeLevel("error") });
|
|
161
|
+
|
|
162
|
+
define("crypto", { randomUUID: () => host.uuid() });
|
|
163
|
+
|
|
164
|
+
const parseUrl = (input, base) => {
|
|
165
|
+
const raw = base === undefined ? host.url(String(input)) : host.url(String(input), String(base));
|
|
166
|
+
return raw ? JSON.parse(raw) : null;
|
|
167
|
+
};
|
|
168
|
+
class URL {
|
|
169
|
+
#p;
|
|
170
|
+
constructor(input, base) {
|
|
171
|
+
const p = parseUrl(input, base);
|
|
172
|
+
if (!p) throw new TypeError("Invalid URL: " + String(input));
|
|
173
|
+
this.#p = p;
|
|
174
|
+
}
|
|
175
|
+
static canParse(input, base) { return parseUrl(input, base) !== null; }
|
|
176
|
+
get href() { return this.#p.href; }
|
|
177
|
+
get origin() { return this.#p.origin; }
|
|
178
|
+
get protocol() { return this.#p.protocol; }
|
|
179
|
+
get username() { return this.#p.username; }
|
|
180
|
+
get password() { return this.#p.password; }
|
|
181
|
+
get host() { return this.#p.host; }
|
|
182
|
+
get hostname() { return this.#p.hostname; }
|
|
183
|
+
get port() { return this.#p.port; }
|
|
184
|
+
get pathname() { return this.#p.pathname; }
|
|
185
|
+
get search() { return this.#p.search; }
|
|
186
|
+
get hash() { return this.#p.hash; }
|
|
187
|
+
toString() { return this.#p.href; }
|
|
188
|
+
toJSON() { return this.#p.href; }
|
|
189
|
+
}
|
|
190
|
+
define("URL", URL);
|
|
191
|
+
|
|
192
|
+
class TextEncoder {
|
|
193
|
+
get encoding() { return "utf-8"; }
|
|
194
|
+
encode(input = "") {
|
|
195
|
+
const s = String(input);
|
|
196
|
+
const out = [];
|
|
197
|
+
for (let i = 0; i < s.length; i++) {
|
|
198
|
+
let c = s.charCodeAt(i);
|
|
199
|
+
if (c >= 0xd800 && c <= 0xdbff && i + 1 < s.length) {
|
|
200
|
+
const d = s.charCodeAt(i + 1);
|
|
201
|
+
if (d >= 0xdc00 && d <= 0xdfff) { c = 0x10000 + ((c - 0xd800) << 10) + (d - 0xdc00); i++; } else c = 0xfffd;
|
|
202
|
+
} else if (c >= 0xd800 && c <= 0xdfff) c = 0xfffd;
|
|
203
|
+
if (c < 0x80) out.push(c);
|
|
204
|
+
else if (c < 0x800) out.push(0xc0 | (c >> 6), 0x80 | (c & 63));
|
|
205
|
+
else if (c < 0x10000) out.push(0xe0 | (c >> 12), 0x80 | ((c >> 6) & 63), 0x80 | (c & 63));
|
|
206
|
+
else out.push(0xf0 | (c >> 18), 0x80 | ((c >> 12) & 63), 0x80 | ((c >> 6) & 63), 0x80 | (c & 63));
|
|
207
|
+
}
|
|
208
|
+
return new Uint8Array(out);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
define("TextEncoder", TextEncoder);
|
|
212
|
+
|
|
213
|
+
class TextDecoder {
|
|
214
|
+
constructor(label = "utf-8") {
|
|
215
|
+
const l = String(label).trim().toLowerCase();
|
|
216
|
+
if (l !== "utf-8" && l !== "utf8" && l !== "unicode-1-1-utf-8") throw new RangeError('The "' + label + '" encoding is not supported');
|
|
217
|
+
}
|
|
218
|
+
get encoding() { return "utf-8"; }
|
|
219
|
+
decode(input) {
|
|
220
|
+
if (input === undefined) return "";
|
|
221
|
+
const b = input instanceof Uint8Array ? input
|
|
222
|
+
: ArrayBuffer.isView(input) ? new Uint8Array(input.buffer, input.byteOffset, input.byteLength)
|
|
223
|
+
: new Uint8Array(input);
|
|
224
|
+
const cont = (k) => k < b.length && (b[k] & 0xc0) === 0x80;
|
|
225
|
+
let out = "";
|
|
226
|
+
let chunk = [];
|
|
227
|
+
for (let i = 0; i < b.length;) {
|
|
228
|
+
const x = b[i];
|
|
229
|
+
let cp = 0xfffd, n = 1;
|
|
230
|
+
if (x < 0x80) cp = x;
|
|
231
|
+
else if (x >= 0xc2 && x < 0xe0 && cont(i + 1)) { cp = ((x & 31) << 6) | (b[i + 1] & 63); n = 2; }
|
|
232
|
+
else if (x >= 0xe0 && x < 0xf0 && cont(i + 1) && cont(i + 2)) {
|
|
233
|
+
const v = ((x & 15) << 12) | ((b[i + 1] & 63) << 6) | (b[i + 2] & 63);
|
|
234
|
+
if (v >= 0x800 && (v < 0xd800 || v > 0xdfff)) { cp = v; n = 3; }
|
|
235
|
+
} else if (x >= 0xf0 && x < 0xf5 && cont(i + 1) && cont(i + 2) && cont(i + 3)) {
|
|
236
|
+
const v = ((x & 7) << 18) | ((b[i + 1] & 63) << 12) | ((b[i + 2] & 63) << 6) | (b[i + 3] & 63);
|
|
237
|
+
if (v >= 0x10000 && v <= 0x10ffff) { cp = v; n = 4; }
|
|
238
|
+
}
|
|
239
|
+
if (!(i === 0 && cp === 0xfeff)) chunk.push(cp);
|
|
240
|
+
i += n;
|
|
241
|
+
if (chunk.length >= 4096) { out += String.fromCodePoint(...chunk); chunk = []; }
|
|
242
|
+
}
|
|
243
|
+
return out + String.fromCodePoint(...chunk);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
define("TextDecoder", TextDecoder);
|
|
247
|
+
|
|
248
|
+
const cloneError = (what) => {
|
|
249
|
+
const e = new Error(what + " could not be cloned.");
|
|
250
|
+
e.name = "DataCloneError";
|
|
251
|
+
return e;
|
|
252
|
+
};
|
|
253
|
+
define("structuredClone", function structuredClone(value) {
|
|
254
|
+
const seen = new Map();
|
|
255
|
+
const walk = (v) => {
|
|
256
|
+
if (typeof v === "symbol") throw cloneError("Symbol()");
|
|
257
|
+
if (typeof v === "function") throw cloneError("A function");
|
|
258
|
+
if (v === null || typeof v !== "object") return v;
|
|
259
|
+
if (seen.has(v)) return seen.get(v);
|
|
260
|
+
let out;
|
|
261
|
+
if (Array.isArray(v)) {
|
|
262
|
+
out = [];
|
|
263
|
+
seen.set(v, out);
|
|
264
|
+
for (let i = 0; i < v.length; i++) out[i] = walk(v[i]);
|
|
265
|
+
return out;
|
|
266
|
+
}
|
|
267
|
+
if (v instanceof Date) { out = new Date(v.getTime()); seen.set(v, out); return out; }
|
|
268
|
+
if (v instanceof RegExp) { out = new RegExp(v.source, v.flags); seen.set(v, out); return out; }
|
|
269
|
+
if (v instanceof Map) { out = new Map(); seen.set(v, out); for (const [k, x] of v) out.set(walk(k), walk(x)); return out; }
|
|
270
|
+
if (v instanceof Set) { out = new Set(); seen.set(v, out); for (const x of v) out.add(walk(x)); return out; }
|
|
271
|
+
if (v instanceof ArrayBuffer) { out = v.slice(0); seen.set(v, out); return out; }
|
|
272
|
+
if (ArrayBuffer.isView(v)) {
|
|
273
|
+
const buffer = walk(v.buffer);
|
|
274
|
+
out = v instanceof DataView ? new DataView(buffer, v.byteOffset, v.byteLength) : new v.constructor(buffer, v.byteOffset, v.length);
|
|
275
|
+
seen.set(v, out);
|
|
276
|
+
return out;
|
|
277
|
+
}
|
|
278
|
+
if (v instanceof Error) {
|
|
279
|
+
out = new Error(String(v.message));
|
|
280
|
+
out.name = String(v.name);
|
|
281
|
+
seen.set(v, out);
|
|
282
|
+
return out;
|
|
283
|
+
}
|
|
284
|
+
out = {};
|
|
285
|
+
seen.set(v, out);
|
|
286
|
+
for (const k of Object.keys(v)) out[k] = walk(v[k]);
|
|
287
|
+
return out;
|
|
288
|
+
};
|
|
289
|
+
return walk(value);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
const describe = (e) => {
|
|
293
|
+
if (e !== null && (typeof e === "object" || typeof e === "function")) {
|
|
294
|
+
const d = { name: "Error", message: "", stack: "" };
|
|
295
|
+
try { d.name = String(e.name === undefined ? "Error" : e.name); } catch (x) { /* keep default */ }
|
|
296
|
+
try { d.message = String(e.message === undefined ? "" : e.message); } catch (x) { /* keep default */ }
|
|
297
|
+
try { if (typeof e.stack === "string") d.stack = e.stack; } catch (x) { /* keep default */ }
|
|
298
|
+
try { if (typeof e.code === "string") d.code = e.code; } catch (x) { /* keep default */ }
|
|
299
|
+
try { if (typeof e.error_ref === "string") d.error_ref = e.error_ref; } catch (x) { /* keep default */ }
|
|
300
|
+
return d;
|
|
301
|
+
}
|
|
302
|
+
let message;
|
|
303
|
+
try { message = String(e); } catch (x) { message = typeof e; }
|
|
304
|
+
return { name: "Error", message, stack: "" };
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
return function start(fn) {
|
|
308
|
+
let p;
|
|
309
|
+
try { p = fn(); } catch (e) { p = Promise.reject(e); }
|
|
310
|
+
p.then(
|
|
311
|
+
(v) => {
|
|
312
|
+
if (v === undefined) { host.settle("undefined", ""); return; }
|
|
313
|
+
let json;
|
|
314
|
+
try { json = stringify(v); } catch (e) { host.settle("not_serializable", String(e && e.message ? e.message : e)); return; }
|
|
315
|
+
if (json === undefined) {
|
|
316
|
+
host.settle("not_serializable", "The value is " + (typeof v === "function" ? "a function or an r handle" : "a " + typeof v) + ", which is not JSON.");
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
host.settle("ok", json);
|
|
320
|
+
},
|
|
321
|
+
(e) => {
|
|
322
|
+
let d;
|
|
323
|
+
try { d = stringify(describe(e)); } catch (x) { d = stringify({ name: "Error", message: "The snippet threw a value that could not be described.", stack: "" }); }
|
|
324
|
+
host.settle("error", d);
|
|
325
|
+
},
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
})`;
|
|
329
|
+
/** Run one snippet to completion (or to its bound) and describe how it ended. */
|
|
330
|
+
export async function runInSandbox(opts) {
|
|
331
|
+
const started = Date.now();
|
|
332
|
+
const deadline = started + opts.timeoutMs;
|
|
333
|
+
const maxValueBytes = opts.maxValueBytes ?? SANDBOX_MAX_VALUE_BYTES;
|
|
334
|
+
const logs = [];
|
|
335
|
+
let logsDropped = 0;
|
|
336
|
+
let interrupted = false;
|
|
337
|
+
let settled = null;
|
|
338
|
+
const finish = (fields) => ({
|
|
339
|
+
logs,
|
|
340
|
+
logs_dropped: logsDropped,
|
|
341
|
+
timed_out: interrupted,
|
|
342
|
+
duration_ms: Date.now() - started,
|
|
343
|
+
...fields,
|
|
344
|
+
});
|
|
345
|
+
const prepared = prepareSnippet(opts.code);
|
|
346
|
+
if (!prepared.ok)
|
|
347
|
+
return finish({ status: "error", error: prepared.error });
|
|
348
|
+
const module = await newQuickJSAsyncWASMModule();
|
|
349
|
+
const runtime = module.newRuntime();
|
|
350
|
+
runtime.setMemoryLimit(opts.memoryLimitBytes ?? SANDBOX_MEMORY_LIMIT_BYTES);
|
|
351
|
+
runtime.setMaxStackSize(SANDBOX_STACK_LIMIT_BYTES);
|
|
352
|
+
runtime.setInterruptHandler(() => {
|
|
353
|
+
if (Date.now() > deadline)
|
|
354
|
+
interrupted = true;
|
|
355
|
+
return interrupted;
|
|
356
|
+
});
|
|
357
|
+
const ctx = runtime.newContext();
|
|
358
|
+
// Async host calls in flight; the loop waits on them and never past them.
|
|
359
|
+
const inflight = new Set();
|
|
360
|
+
let wake = null;
|
|
361
|
+
const notify = () => {
|
|
362
|
+
const w = wake;
|
|
363
|
+
wake = null;
|
|
364
|
+
w?.();
|
|
365
|
+
};
|
|
366
|
+
let alive = true;
|
|
367
|
+
const baseHost = {
|
|
368
|
+
sync: {
|
|
369
|
+
log: (level, line) => {
|
|
370
|
+
if (logs.length >= SANDBOX_MAX_LOG_LINES) {
|
|
371
|
+
logsDropped++;
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
const text = line ?? "";
|
|
375
|
+
logs.push({
|
|
376
|
+
level: (level === "info" || level === "warn" || level === "error" ? level : "log"),
|
|
377
|
+
line: text.length > SANDBOX_MAX_LOG_LINE_CHARS ? `${text.slice(0, SANDBOX_MAX_LOG_LINE_CHARS)}…` : text,
|
|
378
|
+
});
|
|
379
|
+
return undefined;
|
|
380
|
+
},
|
|
381
|
+
settle: (kind, payload) => {
|
|
382
|
+
if (settled)
|
|
383
|
+
return undefined;
|
|
384
|
+
if (kind === "ok")
|
|
385
|
+
settled = { kind: "ok", json: payload ?? "null" };
|
|
386
|
+
else if (kind === "undefined")
|
|
387
|
+
settled = { kind: "undefined" };
|
|
388
|
+
else if (kind === "not_serializable")
|
|
389
|
+
settled = { kind: "not_serializable", message: payload ?? "" };
|
|
390
|
+
else {
|
|
391
|
+
let thrown;
|
|
392
|
+
try {
|
|
393
|
+
thrown = JSON.parse(payload ?? "{}");
|
|
394
|
+
}
|
|
395
|
+
catch {
|
|
396
|
+
thrown = { name: "Error", message: "The snippet threw a value that could not be described." };
|
|
397
|
+
}
|
|
398
|
+
settled = { kind: "error", thrown };
|
|
399
|
+
}
|
|
400
|
+
return undefined;
|
|
401
|
+
},
|
|
402
|
+
uuid: () => randomUUID(),
|
|
403
|
+
url: (input, base) => {
|
|
404
|
+
try {
|
|
405
|
+
const u = base === undefined ? new URL(input ?? "") : new URL(input ?? "", base);
|
|
406
|
+
return JSON.stringify({
|
|
407
|
+
href: u.href, origin: u.origin, protocol: u.protocol, username: u.username, password: u.password,
|
|
408
|
+
host: u.host, hostname: u.hostname, port: u.port, pathname: u.pathname, search: u.search, hash: u.hash,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
return "";
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
};
|
|
417
|
+
const hostObject = (ext) => {
|
|
418
|
+
const obj = ctx.newObject();
|
|
419
|
+
for (const [name, impl] of Object.entries(ext.sync ?? {})) {
|
|
420
|
+
const fn = ctx.newFunction(name, (...args) => {
|
|
421
|
+
const out = impl(...args.map((h) => readString(ctx, h)));
|
|
422
|
+
return out === undefined ? undefined : ctx.newString(out);
|
|
423
|
+
});
|
|
424
|
+
ctx.setProp(obj, name, fn);
|
|
425
|
+
fn.dispose();
|
|
426
|
+
}
|
|
427
|
+
for (const [name, impl] of Object.entries(ext.async ?? {})) {
|
|
428
|
+
const fn = ctx.newFunction(name, (...args) => {
|
|
429
|
+
const strings = args.map((h) => readString(ctx, h));
|
|
430
|
+
const deferred = ctx.newPromise();
|
|
431
|
+
const call = Promise.resolve()
|
|
432
|
+
.then(() => impl(...strings))
|
|
433
|
+
.then((value) => {
|
|
434
|
+
if (!alive)
|
|
435
|
+
return;
|
|
436
|
+
const h = ctx.newString(value);
|
|
437
|
+
deferred.resolve(h);
|
|
438
|
+
h.dispose();
|
|
439
|
+
}, (err) => {
|
|
440
|
+
if (!alive)
|
|
441
|
+
return;
|
|
442
|
+
const h = ctx.newError(err instanceof Error ? err.message : String(err));
|
|
443
|
+
deferred.reject(h);
|
|
444
|
+
h.dispose();
|
|
445
|
+
})
|
|
446
|
+
.finally(() => {
|
|
447
|
+
deferred.dispose();
|
|
448
|
+
inflight.delete(call);
|
|
449
|
+
notify();
|
|
450
|
+
});
|
|
451
|
+
inflight.add(call);
|
|
452
|
+
return deferred.handle;
|
|
453
|
+
});
|
|
454
|
+
ctx.setProp(obj, name, fn);
|
|
455
|
+
fn.dispose();
|
|
456
|
+
}
|
|
457
|
+
return obj;
|
|
458
|
+
};
|
|
459
|
+
/** Evaluate an install function and call it with its host object. Returns the call's result handle. */
|
|
460
|
+
const install = (source, ext) => {
|
|
461
|
+
const fnHandle = ctx.unwrapResult(ctx.evalCode(source, "run402-sandbox-install.js"));
|
|
462
|
+
const hostHandle = hostObject(ext);
|
|
463
|
+
try {
|
|
464
|
+
return ctx.unwrapResult(ctx.callFunction(fnHandle, ctx.undefined, hostHandle));
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
hostHandle.dispose();
|
|
468
|
+
fnHandle.dispose();
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
let outcome;
|
|
472
|
+
// A host-level failure inside the WebAssembly module (its native stack
|
|
473
|
+
// overflowing under deep async recursion, say) leaves the module unusable;
|
|
474
|
+
// it is private to this run, so it is dropped rather than disposed.
|
|
475
|
+
let poisoned = false;
|
|
476
|
+
try {
|
|
477
|
+
const start = install(BASE_INSTALL, baseHost);
|
|
478
|
+
for (const ext of opts.extensions ?? [])
|
|
479
|
+
install(ext.install, ext).dispose();
|
|
480
|
+
const compiled = ctx.evalCode(prepared.source, SNIPPET_FILE);
|
|
481
|
+
if (compiled.error) {
|
|
482
|
+
const dumped = dumpError(ctx, compiled.error);
|
|
483
|
+
compiled.error.dispose();
|
|
484
|
+
start.dispose();
|
|
485
|
+
outcome = finish({
|
|
486
|
+
status: "error",
|
|
487
|
+
error: classify(dumped, { interrupted, phase: "compile" }),
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
const called = ctx.callFunction(start, ctx.undefined, compiled.value);
|
|
492
|
+
compiled.value.dispose();
|
|
493
|
+
start.dispose();
|
|
494
|
+
let loopError = null;
|
|
495
|
+
if (called.error) {
|
|
496
|
+
loopError = classify(dumpError(ctx, called.error), { interrupted, phase: "run" });
|
|
497
|
+
called.error.dispose();
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
called.value.dispose();
|
|
501
|
+
}
|
|
502
|
+
// The event loop: run jobs, then wait for the next host call to settle.
|
|
503
|
+
while (!loopError && !settled) {
|
|
504
|
+
const jobs = runtime.executePendingJobs();
|
|
505
|
+
if (jobs.error) {
|
|
506
|
+
loopError = classify(dumpError(ctx, jobs.error), { interrupted, phase: "run" });
|
|
507
|
+
jobs.error.dispose();
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
if (settled || interrupted)
|
|
511
|
+
break;
|
|
512
|
+
if (Date.now() > deadline) {
|
|
513
|
+
interrupted = true;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
if (runtime.hasPendingJob())
|
|
517
|
+
continue;
|
|
518
|
+
if (inflight.size === 0) {
|
|
519
|
+
loopError = {
|
|
520
|
+
code: "RUN_EXCEPTION",
|
|
521
|
+
message: "The snippet is waiting on a promise that nothing can settle: the sandbox has no timers or I/O of its own, only awaited r calls settle.",
|
|
522
|
+
};
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
await new Promise((resolve) => {
|
|
526
|
+
const timer = setTimeout(resolve, Math.max(0, deadline - Date.now()) + 1);
|
|
527
|
+
wake = () => {
|
|
528
|
+
clearTimeout(timer);
|
|
529
|
+
resolve();
|
|
530
|
+
};
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
// A host call in flight at the deadline completes or fails on its own;
|
|
534
|
+
// its side effect is real, so the run reports only after it settles.
|
|
535
|
+
if (interrupted)
|
|
536
|
+
await Promise.allSettled([...inflight]);
|
|
537
|
+
outcome = settle(settled, loopError, interrupted, maxValueBytes, finish);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
catch (err) {
|
|
541
|
+
poisoned = true;
|
|
542
|
+
if (interrupted)
|
|
543
|
+
await Promise.allSettled([...inflight]);
|
|
544
|
+
const overflow = err instanceof RangeError && /call stack/i.test(err.message);
|
|
545
|
+
outcome = settle(null, {
|
|
546
|
+
code: "RUN_EXCEPTION",
|
|
547
|
+
message: overflow
|
|
548
|
+
? "InternalError: stack overflow (the recursion is too deep for the sandbox)."
|
|
549
|
+
: `The sandbox stopped: ${err instanceof Error ? err.message : String(err)}`,
|
|
550
|
+
}, interrupted, maxValueBytes, finish);
|
|
551
|
+
}
|
|
552
|
+
finally {
|
|
553
|
+
alive = false;
|
|
554
|
+
if (!poisoned) {
|
|
555
|
+
try {
|
|
556
|
+
ctx.dispose();
|
|
557
|
+
runtime.dispose();
|
|
558
|
+
}
|
|
559
|
+
catch {
|
|
560
|
+
// The module instance is private to this run and is dropped either way.
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return outcome;
|
|
565
|
+
}
|
|
566
|
+
function settle(settled, loopError, interrupted, maxValueBytes, finish) {
|
|
567
|
+
if (interrupted) {
|
|
568
|
+
return finish({
|
|
569
|
+
status: "error",
|
|
570
|
+
error: { code: "RUN_TIMEOUT", message: "The run passed its deadline. Calls that completed before it are listed in calls[]; their side effects happened." },
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
if (loopError)
|
|
574
|
+
return finish({ status: "error", error: loopError });
|
|
575
|
+
if (!settled) {
|
|
576
|
+
return finish({ status: "error", error: { code: "RUN_EXCEPTION", message: "The snippet ended without settling." } });
|
|
577
|
+
}
|
|
578
|
+
switch (settled.kind) {
|
|
579
|
+
case "undefined":
|
|
580
|
+
return finish({ status: "ok", value_kind: "undefined" });
|
|
581
|
+
case "not_serializable":
|
|
582
|
+
return finish({ status: "error", error: { code: "RUN_VALUE_NOT_SERIALIZABLE", message: `The result is not JSON: ${settled.message}` } });
|
|
583
|
+
case "ok": {
|
|
584
|
+
const bytes = Buffer.byteLength(settled.json, "utf8");
|
|
585
|
+
if (bytes > maxValueBytes) {
|
|
586
|
+
return finish({
|
|
587
|
+
status: "error",
|
|
588
|
+
error: {
|
|
589
|
+
code: "RUN_VALUE_TOO_LARGE",
|
|
590
|
+
message: `The result serializes to ${bytes} bytes, over the ${maxValueBytes}-byte cap. Narrow the selection in the snippet (filter, map to the fields you need, or slice).`,
|
|
591
|
+
},
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
return finish({ status: "ok", value_json: settled.json });
|
|
595
|
+
}
|
|
596
|
+
case "error":
|
|
597
|
+
return finish({ status: "error", error: classify(settled.thrown, { interrupted, phase: "run" }) });
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function classify(e, ctx) {
|
|
601
|
+
const location = locationFromStack(e.stack);
|
|
602
|
+
if (ctx.interrupted) {
|
|
603
|
+
return { code: "RUN_TIMEOUT", message: "The run passed its deadline." };
|
|
604
|
+
}
|
|
605
|
+
if (/out of memory/i.test(e.message)) {
|
|
606
|
+
return { code: "RUN_MEMORY_EXCEEDED", message: `The sandbox reached its ${SANDBOX_MEMORY_LIMIT_BYTES / (1024 * 1024)} MB memory limit.` };
|
|
607
|
+
}
|
|
608
|
+
if (ctx.phase === "compile" && e.name === "SyntaxError") {
|
|
609
|
+
return { code: "RUN_SYNTAX_ERROR", message: e.message, line: location.line ?? 1, column: location.column ?? 1 };
|
|
610
|
+
}
|
|
611
|
+
const thrown = { name: e.name, message: e.message };
|
|
612
|
+
if (e.code)
|
|
613
|
+
thrown.code = e.code;
|
|
614
|
+
if (e.error_ref)
|
|
615
|
+
thrown.error_ref = e.error_ref;
|
|
616
|
+
return {
|
|
617
|
+
code: "RUN_EXCEPTION",
|
|
618
|
+
message: e.name && e.name !== "Error" ? `${e.name}: ${e.message}` : e.message,
|
|
619
|
+
...location,
|
|
620
|
+
thrown,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
function dumpError(ctx, handle) {
|
|
624
|
+
let dumped;
|
|
625
|
+
try {
|
|
626
|
+
dumped = ctx.dump(handle);
|
|
627
|
+
}
|
|
628
|
+
catch {
|
|
629
|
+
dumped = null;
|
|
630
|
+
}
|
|
631
|
+
if (dumped && typeof dumped === "object") {
|
|
632
|
+
const d = dumped;
|
|
633
|
+
return {
|
|
634
|
+
name: typeof d.name === "string" ? d.name : "Error",
|
|
635
|
+
message: typeof d.message === "string" ? d.message : String(d.message ?? ""),
|
|
636
|
+
...(typeof d.stack === "string" ? { stack: d.stack } : {}),
|
|
637
|
+
...(typeof d.code === "string" ? { code: d.code } : {}),
|
|
638
|
+
...(typeof d.error_ref === "string" ? { error_ref: d.error_ref } : {}),
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
return { name: "Error", message: dumped === null || dumped === undefined ? "out of memory" : String(dumped) };
|
|
642
|
+
}
|
|
643
|
+
function readString(ctx, h) {
|
|
644
|
+
return ctx.typeof(h) === "undefined" ? undefined : ctx.getString(h);
|
|
645
|
+
}
|
|
646
|
+
//# sourceMappingURL=sandbox.js.map
|