/** * `@run402/sdk/node` — zero-config Node entry point. * * Wires the isomorphic SDK kernel with: * - default API base from `RUN402_API_BASE` (via core/config) * - {@link NodeCredentialsProvider} backed by the local keystore + allowance * - an x402-wrapped fetch built lazily on first request * - {@link NodeSites}: the `sites` namespace enriched with `deployDir(dir)` * * Usage: * ```ts * import { run402 } from "@run402/sdk/node"; * const r = run402(); * const project = await r.projects.provision({ tier: "prototype" }); * await r.sites.deployDir({ project: project.project_id, dir: "./my-site" }); * ``` * * `deployDir` is a thin wrapper over `r.project(id).apply` — bytes ride through * the unified CAS substrate, so only files the gateway doesn't already have * are uploaded. Re-deploying an unchanged tree issues no S3 PUTs. */ export { fundingRecovery, fundingBlocksBootstrap, type FundingRecovery } from "./funding-recovery.js"; import { Run402, type PayExecutor } from "../index.js"; import type { CredentialsProvider } from "../credentials.js"; import type { Run402ClientMetadata } from "../kernel.js"; import type { AuthMode, CredentialSurface } from "./credentials.js"; import { type EvmPaymentSignerProvider, type PaymentPayerProvenance } from "./paid-fetch.js"; import { NodeSites } from "./sites-node.js"; import { NodeAssets } from "./assets-node.js"; import { NodeArchives } from "./archives-node.js"; import { NodeActions } from "./actions-node.js"; export interface NodeRun402Options { /** Override the API base URL. Defaults to `getApiBase()` (env var or production URL). */ apiBase?: string; /** Override the local project-key cache path. Defaults to credentials/project-keys.v1.json. */ keystorePath?: string; /** Override the non-secret profile state path. Defaults to state.json. */ profileStatePath?: string; /** Override the allowance file path. Defaults to the standard location. */ allowancePath?: string; /** Override the credentials provider. Defaults to the local Node keystore + allowance provider. */ credentials?: CredentialsProvider; /** * A delegate bearer minted by a project owner (`run402 delegates create`). * When set — here or via `RUN402_DELEGATE_TOKEN` — it becomes the sole * credential class, so a process with no wallet and no cached project keys * can still deploy. See `../delegate-credentials.ts`. */ delegateToken?: string; /** * Explicit async x402 signer (for example KMS/HSM backed). The provider * exposes only a public address plus signing operations, never a raw key. * Mutually exclusive with `allowancePath`. Auth still comes from * `credentials`, so the authenticated principal and payer may differ. */ paymentSigner?: EvmPaymentSignerProvider; /** * Which surface is constructing the client — selects the default credential * mode. `"cli"` opts into `auto` (wallet, else operator-approval); `"mcp"` / * `"sdk"` stay `wallet`-only so a human's approval never leaks into agent * tool calls. Ignored when `credentials` is supplied. */ surface?: CredentialSurface; /** Explicit credential mode override (otherwise derived from `surface`). */ authMode?: AuthMode; /** * Skip x402 payment wrapping and use `globalThis.fetch` directly. Useful in * tests or when the caller pre-wraps fetch with a custom scheme. */ disablePaidFetch?: boolean; /** Fully custom fetch implementation. Takes precedence over `disablePaidFetch`. */ fetch?: typeof globalThis.fetch; /** Override the arbitrary-URL x402 buyer used by `pay.fetch`. */ payExecutor?: PayExecutor; /** Override or disable the bounded Run402-Client metadata header. */ clientMetadata?: Run402ClientMetadata | false; /** Client package version to report; defaults to the SDK package version. */ clientVersion?: string; /** SDK package version to report; defaults to the SDK package version. */ sdkVersion?: string; } /** Run402 instance with Node-only helpers wired in: `sites.deployDir` * (v1.34 unified-deploy convenience) and `assets.uploadDir` / * `assets.syncDir` / `assets.prepareDir` / `assets.putMany` * (v1.48 unified-apply ergonomics). */ export type NodeRun402 = Omit & { sites: NodeSites; assets: NodeAssets; archives: NodeArchives; actions: NodeActions; up: NodeActions["up"]; /** Public address/source selected for automatic payment; never includes keys or signed proofs. */ paymentPayer(): Promise; }; /** * Construct a Run402 client wired with Node defaults. * * Behavior matches today's `run402-mcp` / `run402` CLI: reads keystore and * allowance from disk, signs SIWX headers, and retries 402 responses via * `@x402/fetch` when the allowance wallet has USDC balance. * * The returned instance's `sites` namespace is a {@link NodeSites}, which * exposes the `deployDir({ dir })` helper. */ export declare function run402(opts?: NodeRun402Options): NodeRun402; export { NodeSites } from "./sites-node.js"; export type { DeployDirOptions, DeployEvent as DeployDirEvent, } from "./sites-node.js"; export { fileSetFromDir, normalizeRelPath } from "./files.js"; export type { FileSetFromDirOptions } from "./files.js"; export { NodeAssets, dir, PruneConfirmationRequired } from "./assets-node.js"; export type { AssetManifest, AssetManifestEntry, AssetManifestTotals, DirOptions, LocalDirRef, PutManyItem, UploadDirOptions, SyncDirOptions, PrepareDirOptions, } from "./assets-node.js"; export { assertLocalFileReferencesExist, collectLocalFileReferences, findMissingLocalFileReferences, loadDeployManifest, loadExecutableDeployConfig, manifestFileMissingError, manifestNotFoundError, normalizeDeployManifest, } from "./deploy-manifest.js"; export { defineConfig, emailTrigger, file, nodeFunction, scheduleTrigger, sqlFile, } from "../config.js"; export type { Run402ConfigContext, Run402DirConfigOptions, Run402EmailTriggerOptions, Run402ExecutableConfigExport, Run402ExecutionMode, Run402FileConfigOptions, Run402FileConfigSource, Run402NodeFunctionConfigOptions, Run402ReleaseConfig, Run402ReviewedPlanRequirement, Run402ScheduleTriggerOptions, Run402SqlFileConfigMigration, Run402SqlFileConfigOptions, } from "../config.js"; export type { DeployManifestDatabaseSpec, DeployManifestFileEntry, DeployManifestFileSet, DeployManifestFunctionsSpec, DeployManifestFunctionSpec, DeployManifestInput, DeployManifestMigrationSpec, DeployManifestSiteSpec, DeployManifestVerifyHttpCheck, DeployManifestVerifySpec, LoadDeployManifestOptions, LocalFileReference, LocalFileReferenceKind, MissingLocalFileReference, NormalizedDeployManifest, NormalizedDeployManifestVerify, NormalizeDeployManifestOptions, } from "./deploy-manifest.js"; export { resolveRun402TargetProfile } from "./target-profile.js"; export type { ResolveRun402TargetProfileOptions, Run402TargetKind, Run402TargetProfile, Run402TargetProfileEnvAliases, Run402TargetProfileSources, Run402TargetRequirement, } from "./target-profile.js"; export { GitvaultKeystore, getGitvaultKeystoreRoot, readFileNoFollow, writeFileAtomic0600, } from "./gitvault-keystore.js"; export type { GitvaultAuditEntry, GitvaultAuditEvent, GitvaultHeadPin, GitvaultIdentityFile, GitvaultKeystoreOptions, GitvaultKeystoreState, GitvaultLockOptions, GitvaultPermissionFinding, GitvaultRepoFile, } from "./gitvault-keystore.js"; export { GITVAULT_CREATION_STAGES, GitvaultCreation, createGitvault, findResumableGitvaultJournal, findResumablePushToCreateJournal, gitvaultDoctorRecoveryText, gitvaultJournalPath, listIncompleteGitvaultJournals, readGitvaultJournal, } from "./gitvault-creation-journal.js"; export type { GitvaultAdmitGenesisRequest, GitvaultAdmitGenesisResult, GitvaultAllocateRequest, GitvaultCreationJournal, GitvaultCreationOptions, GitvaultCreationResult, GitvaultCreationStage, GitvaultCreationTransport, GitvaultDoctorRecoveryText, GitvaultJournaledObject, GitvaultObjectReceipt, GitvaultPushToCreateAddress, GitvaultPutObjectRequest, } from "./gitvault-creation-journal.js"; export { GITVAULT_DEPLOY_REF, GITVAULT_HANDOFF_SENSITIVE_DENYLIST, GITVAULT_MAX_GIT_OBJECT_BYTES, GITVAULT_MIN_GIT_VERSION, HARDENED_GIT_ARGV_PREFIX, captureHandoffSnapshot, captureSnapshot, capturedSetDigest, capturedSetUnchanged, deriveCapturedSet, detectActiveFilters, diffCapturedSets, discoverGlobalExcludes, findOversizeObjects, gitvaultCommitLine, globMatchesGitPath, hardenedGit, hardenedGitEnv, run402PassthroughEnv, hasObject, inspectRepository, isAncestor, isHandoffSensitivePath, materializeSnapshot, parseGitConfigAsData, probeGitVersion, resolveGitInvocationRepo, snapshotCommitment, } from "./gitvault-snapshot.js"; export type { GitConfigDiscoveryEnv, GitInvocationRepo, GitvaultCapturedFile, GitvaultCapturedSetDrift, GitvaultHandoffCaptureOptions, GitvaultHandoffCaptureStats, GitvaultHandoffSnapshot, GitvaultRepositoryInspection, GitvaultRepositoryRefusalCode, GitvaultSnapshot, GitvaultSnapshotOptions, GitvaultSnapshotRefusalPath, GlobalExcludesDiscovery, GlobalExcludesRefusal, HardenedGitOptions, HardenedGitResult, ParsedGitConfigEntry, } from "./gitvault-snapshot.js"; export { GITVAULT_INLINE_UPLOAD_MAX_OBJECT_BYTES, GITVAULT_INLINE_UPLOAD_MAX_REQUEST_BYTES, GITVAULT_MAX_CANONICAL_REFS, GITVAULT_MAX_CHECKPOINT_PACKS, GITVAULT_MAX_CHECKPOINT_TOTAL_STORED_BYTES, GITVAULT_MAX_HEADS_PER_LISTING_PAGE, GITVAULT_MAX_REF_STATE_OBJECT_BYTES, GITVAULT_MAX_REF_UPDATES_PER_TRANSACTION, GITVAULT_MAX_REPAIR_ADDED_ROOTS, GITVAULT_MAX_RETENTION_ROOT_ENTRIES, GITVAULT_MAX_WAL_RECEIPTS_PER_HEAD, GITVAULT_MULTI_OBJECT_PACK_TARGET_BYTES, GITVAULT_PUSH_CONFLICT_RETRIES, GITVAULT_R402_REF_NAMESPACE, GITVAULT_RETAIN_REF_PREFIX, GITVAULT_RETENTION_MIN_DAYS, GITVAULT_VERIFICATION_BUDGET_HEADS, GitvaultVault, assertNoTransition, assertRefMapCardinality, bigIntToGeneration, captureBinding, checkChainLink, checkClaimSetEquality, checkGenerationRegression, checkOpenBinding, compareRoots, createGitvaultHttpTransport, deployRefTransaction, effectiveAdmittedAt, evaluateRefTransaction, evolveRetentionRoots, generationToBigInt, gitvaultInlineUploadEligible, gitvaultPaths, gitvaultRetainedRefName, isRootEligibleForRemoval, nextGeneration, nextListingRequest, gitvaultLedgerId, gitvaultManifestEntry, gitvaultWireRefForPath, openBindingDigest, reconcileRetainedTipRefs, validateHeadsListingRequest, verifyHeadsListingPage, readGitvaultRestoreMarker, GITVAULT_AUTO_GC_GENERATIONS_DEFAULT, readGitvaultAutoGcThreshold, writeGitvaultAutoGcThreshold, } from "./gitvault-publication.js"; export type { GitvaultAdmitHeadRequest, GitvaultAdmitHeadResult, GitvaultBuiltCheckpoint, GitvaultChainLinkInput, GitvaultCutoffOptions, GitvaultDroppedTip, GitvaultEvaluateRefTransactionOptions, GitvaultEvolveRootsOptions, GitvaultHttpTransportOptions, GitvaultListingProgress, GitvaultMaintenanceLease, GitvaultMaintenanceLeaseRequest, GitvaultObjectReadRequest, GitvaultResourceBinding, GitvaultVaultRecord, GitvaultVaultState, GitvaultWireRef, GitvaultMaterializedState, GitvaultOpenBindingRecord, GitvaultPublishResult, GitvaultPushOptions, GitvaultPushPlan, GitvaultRefMap, GitvaultRefTransactionEvaluation, GitvaultRefUpdateFailure, GitvaultRestoreMarker, GitvaultRetainedRefsReconcileResult, GitvaultRetentionCutoffIssued, GitvaultTransport, GitvaultUploadObject, GitvaultUploadReceipt, GitvaultVaultOptions, GitvaultVerifiedState, GitvaultCompactionGrant, } from "./gitvault-publication.js"; export { GITVAULT_DEPLOY_OUTCOMES, SNAPSHOT_MOVED_DURING_DEPLOY, checkActivationTokenBinding, checkAuthorizationEpoch, drainOverrideJournals, listPendingOverrideJournals, matchCaptureReceipt, overrideJournalDir, overrideJournalPath, readOverrideJournal, runGitvaultDeploy, writeOverrideJournal, } from "./gitvault-deploy.js"; export type { GitvaultCaptureReceiptMatch, GitvaultDeployError, GitvaultDeployLane, GitvaultDeployLaneCommitInput, GitvaultDeployLanePlan, GitvaultDeployLanePlanInput, GitvaultDeployNextAction, GitvaultDeployOptions, GitvaultDeployOutcome, GitvaultDeployResult, GitvaultOverrideDrainReport, GitvaultOverrideJournal, GitvaultSnapshotMovedDetails, } from "./gitvault-deploy.js"; export { HANDOFF_ENVELOPE_KIND, HANDOFF_KEY_PREFIXES, HANDOFF_ENVELOPE_V2_KIND, INVITE_ENVELOPE_V2_KIND, assembleHandoffKey, assembleInviteKey, assertHandoffNoteHasNoSecret, assertInviteNoteHasNoSecret, deriveHandoffSecrets, deriveInviteSecrets, isKygitHandoffNote, isKygitInviteNote, openHandoffEnvelope, openHandoffEnvelopeV2, openInviteEnvelope, parseClaimKey, parseHandoffKey, parseInviteKey, scanHandoffNoteForSecrets, scanInviteNoteForSecrets, sealHandoffEnvelope, sealHandoffEnvelopeV2, sealInviteEnvelope, uuidToBytes, } from "./gitvault-handoff.js"; export { assembleRoomInviteKey, computeRoomInviteAuthHash, deriveRoomInviteAuthSecret, parseRoomInviteKey, randomClaimId, } from "./bearer-claim-key.js"; export type { RoomInviteKeyParts } from "./bearer-claim-key.js"; export type { ClaimKeyParts, ClaimKind, HandoffEnvelopePayload, HandoffEnvelopePayloadV2, HandoffKeyParts, HandoffKeyPrefixEntry, HandoffNoteSecretFinding, HandoffSecrets, InviteEnvelopePayloadV2, InviteKeyParts, KygitHandoffNote, KygitHandoffNoteCapture, KygitInviteNote, } from "./gitvault-handoff.js"; export { HANDOFF_WRITER_ACCEPT_DOMAIN, buildWriterAcceptance, buildWriterAdmissionGrant, deriveClaimWriterAdmissionSeed, deriveInviteWriterAdmissionSeed, deriveWriterAdmissionSeed, verifyWriterAcceptance, verifyWriterAdmissionGrant, } from "./gitvault-handoff.js"; export type { BuildWriterAcceptanceInput, BuildWriterAdmissionGrantInput, GitvaultWriterMintedRole, HandoffWriterAcceptStatement, WriterAcceptance, WriterAdmissionGrant, } from "./gitvault-handoff.js"; export { MAX_VAULT_WRITERS, ORG_ROLE_RANK, WRITER_ELIGIBLE_ROLE_RANK, applyAddWriterKey, applyWriterSetUpdate, buildAddWriterKeyActivationPayload, buildWriterDoorAddWriterKeyPayload, initialWriterState, meetsWriterEligibleRole, predictMintedRole, replayWriterState, resolveActiveWriter, validateAddWriterKeyPayload, validateWriterSetUpdate, writerKeyIdOf, writerSetSha256, } from "./gitvault-writer-state.js"; export type { AddWriterKeyPayload, AdmittedWriterTransition, WriterChainState, WriterKeyEntry, WriterSetUpdatePayload, WriterStateRefusalCode, WriterStateVerdict, } from "./gitvault-writer-state.js"; export { applyHandoffCheckpoint, cloneGitvaultRemote, excludeMessagingCacheFromGit, isMessagingCacheExcludedFromGit, readGitCommitMessage, resolveResumeTargetDir } from "./gitvault-restore.js"; export type { GitvaultHandoffRestoreOptions, GitvaultHandoffRestoreResult } from "./gitvault-restore.js"; export { openOrCreateGitvault } from "./gitvault-open-or-create.js"; export type { OpenOrCreateGitvaultOptions, OpenOrCreateGitvaultResult } from "./gitvault-open-or-create.js"; export { pushToCreateGitvault } from "./gitvault-push-to-create.js"; export type { PushToCreateGitvaultOptions, PushToCreateGitvaultResult } from "./gitvault-push-to-create.js"; export { readPinnedGitvaultRepo, pinGitvaultRepo, resolveGitvaultAddress, pinRoomBinding, readPinnedRoomBinding } from "./gitvault-address.js"; export type { GitvaultPinnedRepo, GitvaultAddressResolution, ResolveGitvaultAddressOptions } from "./gitvault-address.js"; export { prewarmGitvaultConnection, predialGitvaultObjectStore } from "./gitvault-prewarm.js"; export { findLocalProfilesHoldingGitvaultRepo, crossProfileGitvaultHint } from "./gitvault-profile-scan.js"; export { applyWithGitvault, createApplyDeployLane } from "./gitvault-apply.js"; export type { ApplyDeployLane, ApplyDeployLaneOptions, ApplyWithGitvaultOptions, ApplyWithGitvaultResult, GitvaultApplyMode, } from "./gitvault-apply.js"; export * from "../namespaces/gitvault.crypto.js"; export { signCiDelegation } from "./ci.js"; export type { SignCiDelegationOptions } from "./ci.js"; export { signWalletOrgClaim, claimWalletOrg } from "./operator-claim.js"; export type { SignWalletOrgClaimOptions, ClaimWalletOrgOptions } from "./operator-claim.js"; export { importArchiveToCore, inspectArchive, NodeArchives, readEnvFile, verifyArchive, } from "./archives-node.js"; export { NodeCredentialsProvider } from "./credentials.js"; export { NodeActions, resolveDeploymentTarget } from "./actions-node.js"; export type { NodeActionTargetKind, NodeActionsOptions } from "./actions-node.js"; export { setupPaidFetch, createLazyPaidFetch, X402BalanceError } from "./paid-fetch.js"; export type { EvmPaymentSigner, EvmPaymentSignerProvider, ConfiguredPaidFetch, LazyPaidFetch, PaidFetchOptions, PaymentPayerProvenance, PaymentPayerSource, PaymentPublicClient, X402BalanceErrorCode, X402PaymentNetwork, } from "./paid-fetch.js"; export { listPaymentAttempts, readPaymentAttempt, PAYMENT_ATTEMPT_HEADER, } from "./payment-attempts.js"; export type { PaymentAttemptJournalState, PaymentAttemptRecord, } from "./payment-attempts.js"; export { Run402Action } from "../actions.js"; export * from "../app-up.js"; export type * from "../index.js"; export { Run402, Run402Error, PaymentRequired, ProjectCredentialNotFound, ProjectNotFound, Unauthorized, NotAuthorizedError, StepUpRequiredError, ApiError, NetworkError, PaymentAttemptError, PaymentBuyerError, PaymentPolicyError, X402_COMMERCE_RESULT_SCHEMA_VERSION, X402_EVIDENCE_STATUSES, X402_GATEWAY_AVAILABILITY_ERROR_CODE, X402_MUTATION_STATES, X402_PAYMENT_POLICY_ERROR_CODES, X402_RECOVERY_ACTIONS, LocalError, Run402DeployError, EMPTY_STATIC_MANIFEST_METADATA, ROUTE_HTTP_METHODS, Ci, Deploy, CI_SESSION_CREDENTIALS, Orgs, ScopedOrg, Grants, PROJECT_CREDENTIAL_ERROR_CODES, PROJECT_OPERATION_AUTH_CLASSIFICATIONS, files, CI_AUDIENCE, CI_GITHUB_ACTIONS_ISSUER, CI_GITHUB_ACTIONS_PROVIDER, DEFAULT_CI_DELEGATION_CHAIN_ID, V1_CI_ALLOWED_ACTIONS, V1_CI_ALLOWED_EVENTS_DEFAULT, assertCiDeployableSpec, buildCiDelegationResourceUri, buildCiDelegationStatement, buildDeployResolveSummary, createCiSessionCredentials, githubActionsCredentials, isRun402Error, isPaymentRequired, isProjectCredentialError, isProjectCredentialExpired, isProjectCredentialInvalid, isProjectCredentialNotFound, isProjectCredentialProjectMismatch, isProjectNotFound, isUnauthorized, isNotAuthorized, isStepUpRequired, isOperatorApprovalRequired, isApiError, isNetworkError, isPaymentAttemptError, isPaymentBuyerError, isPaymentPolicyError, isLocalError, isDeployError, isRetryableRun402Error, isCiSessionCredentials, isDelegateCredentials, delegateTokenFromEnv, DELEGATE_TOKEN_ENV, projectOperationAuthClassification, isDeployResolveRouteHit, isDeployResolveStaticHit, normalizeCiRouteScopes, normalizeCiDelegationValues, normalizeDeployResolveRequest, normalizeStaticManifestMetadata, summarizeDeployResult, validateCiNonce, validateCiRouteScope, validateCiSubjectMatch, withRetry, } from "../index.js"; export { NwcWallet, NwcError, closeNwcConnections, parseNwcUri } from "./nwc.js"; export type { NwcConnection } from "./nwc.js"; export { createLightningFetch, readLightningChallenge, isLightningChargedRequest, LightningPaymentError, RUN402_MPP_LIGHTNING_PROFILE, LIGHTNING_MAX_DEBIT_SATS, } from "./lightning-paid-fetch.js"; export type { LightningFetchOptions, LightningWalletLike } from "./lightning-paid-fetch.js"; export { scanFileContent, scanSourceTree, scanSourceFiles, resolveScanRoot, readDeclaredCapabilities, SCAN_SEVERITY, _testOnly_hallucinatedNames, _testOnly_authProperties } from "./source-scan.js"; export { resolveApplicationScope, loadApplicationScanInput } from "./app-scope.js"; export { scanDeploymentSources } from "./source-scan.js"; export { describeLocalPreflight } from "./preflight.js"; export { serializeDeployManifest } from "./manifest-export.js"; export { prepareWorkflowOutput } from "./workflow-output.js"; export { readRemoteStatus } from "./remote-status.js"; //# sourceMappingURL=index.d.ts.map