@gadicc/loom 1.38.0 → 2.0.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/.loom-source-manifest.json +97 -0
- package/README.md +103 -31
- package/db/databaseTls.js +6 -3
- package/db/databaseUrl.js +3 -2
- package/db/drizzle-config.js +14 -16
- package/db/fixtures.d.ts +1 -3
- package/db/fixtures.js +4 -7
- package/esm/bin/loom.d.ts +2 -1
- package/esm/bin/loom.d.ts.map +1 -1
- package/esm/bin/loom.js +37 -10
- package/esm/bin/loom.js.map +1 -0
- package/esm/mod.d.ts +0 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/mod.js.map +1 -0
- package/esm/src/apiKeys/authorize.d.ts.map +1 -1
- package/esm/src/apiKeys/authorize.js +15 -14
- package/esm/src/apiKeys/authorize.js.map +1 -0
- package/esm/src/apiKeys/betterAuth.d.ts.map +1 -1
- package/esm/src/apiKeys/betterAuth.js +1 -0
- package/esm/src/apiKeys/betterAuth.js.map +1 -0
- package/esm/src/apiKeys/country.d.ts.map +1 -1
- package/esm/src/apiKeys/country.js +1 -0
- package/esm/src/apiKeys/country.js.map +1 -0
- package/esm/src/apiKeys/credentials.d.ts.map +1 -1
- package/esm/src/apiKeys/credentials.js +3 -1
- package/esm/src/apiKeys/credentials.js.map +1 -0
- package/esm/src/apiKeys/fingerprint.d.ts.map +1 -1
- package/esm/src/apiKeys/fingerprint.js +1 -0
- package/esm/src/apiKeys/fingerprint.js.map +1 -0
- package/esm/src/apiKeys/lifecycle.d.ts.map +1 -1
- package/esm/src/apiKeys/lifecycle.js +1 -0
- package/esm/src/apiKeys/lifecycle.js.map +1 -0
- package/esm/src/apiKeys/limits.d.ts.map +1 -1
- package/esm/src/apiKeys/limits.js +10 -10
- package/esm/src/apiKeys/limits.js.map +1 -0
- package/esm/src/apiKeys/mod.d.ts +0 -1
- package/esm/src/apiKeys/mod.d.ts.map +1 -1
- package/esm/src/apiKeys/mod.js +1 -1
- package/esm/src/apiKeys/mod.js.map +1 -0
- package/esm/src/apiKeys/permissions.d.ts.map +1 -1
- package/esm/src/apiKeys/permissions.js +1 -0
- package/esm/src/apiKeys/permissions.js.map +1 -0
- package/esm/src/apiKeys/policy.d.ts.map +1 -1
- package/esm/src/apiKeys/policy.js +1 -0
- package/esm/src/apiKeys/policy.js.map +1 -0
- package/esm/src/apiKeys/retention.d.ts.map +1 -1
- package/esm/src/apiKeys/retention.js +1 -0
- package/esm/src/apiKeys/retention.js.map +1 -0
- package/esm/src/apiKeys/types.d.ts.map +1 -1
- package/esm/src/apiKeys/types.js +1 -0
- package/esm/src/apiKeys/types.js.map +1 -0
- package/esm/src/cli/atomicText.d.ts +3 -0
- package/esm/src/cli/atomicText.d.ts.map +1 -0
- package/esm/src/cli/atomicText.js +33 -0
- package/esm/src/cli/atomicText.js.map +1 -0
- package/esm/src/cli/bunLocalDev.d.ts +65 -0
- package/esm/src/cli/bunLocalDev.d.ts.map +1 -0
- package/esm/src/cli/bunLocalDev.js +459 -0
- package/esm/src/cli/bunLocalDev.js.map +1 -0
- package/esm/src/cli/bunProject.d.ts +30 -0
- package/esm/src/cli/bunProject.d.ts.map +1 -0
- package/esm/src/cli/bunProject.js +309 -0
- package/esm/src/cli/bunProject.js.map +1 -0
- package/esm/src/cli/cliBootstrap.d.ts +83 -0
- package/esm/src/cli/cliBootstrap.d.ts.map +1 -0
- package/esm/src/cli/cliBootstrap.js +186 -0
- package/esm/src/cli/cliBootstrap.js.map +1 -0
- package/esm/src/cli/externalSkills.d.ts.map +1 -1
- package/esm/src/cli/externalSkills.js +9 -5
- package/esm/src/cli/externalSkills.js.map +1 -0
- package/esm/src/cli/filesR2Policy.d.ts.map +1 -1
- package/esm/src/cli/filesR2Policy.js +18 -11
- package/esm/src/cli/filesR2Policy.js.map +1 -0
- package/esm/src/cli/generatedBuild.d.ts +42 -0
- package/esm/src/cli/generatedBuild.d.ts.map +1 -0
- package/esm/src/cli/generatedBuild.js +259 -0
- package/esm/src/cli/generatedBuild.js.map +1 -0
- package/esm/src/cli/generatedCleanup.d.ts +7 -0
- package/esm/src/cli/generatedCleanup.d.ts.map +1 -0
- package/esm/src/cli/generatedCleanup.js +67 -0
- package/esm/src/cli/generatedCleanup.js.map +1 -0
- package/esm/src/cli/generatedDevLease.d.ts +8 -0
- package/esm/src/cli/generatedDevLease.d.ts.map +1 -0
- package/esm/src/cli/generatedDevLease.js +39 -0
- package/esm/src/cli/generatedDevLease.js.map +1 -0
- package/esm/src/cli/generatedInstall.d.ts +64 -0
- package/esm/src/cli/generatedInstall.d.ts.map +1 -0
- package/esm/src/cli/generatedInstall.js +466 -0
- package/esm/src/cli/generatedInstall.js.map +1 -0
- package/esm/src/cli/generatedWorkflow.d.ts +34 -0
- package/esm/src/cli/generatedWorkflow.d.ts.map +1 -0
- package/esm/src/cli/generatedWorkflow.js +85 -0
- package/esm/src/cli/generatedWorkflow.js.map +1 -0
- package/esm/src/cli/legacyManagedOutputs.d.ts.map +1 -1
- package/esm/src/cli/legacyManagedOutputs.js +1 -0
- package/esm/src/cli/legacyManagedOutputs.js.map +1 -0
- package/esm/src/cli/localDb.d.ts.map +1 -1
- package/esm/src/cli/localDb.js +33 -28
- package/esm/src/cli/localDb.js.map +1 -0
- package/esm/src/cli/localDevLock.d.ts +9 -0
- package/esm/src/cli/localDevLock.d.ts.map +1 -1
- package/esm/src/cli/localDevLock.js +54 -13
- package/esm/src/cli/localDevLock.js.map +1 -0
- package/esm/src/cli/localDevPackage.d.ts +6 -11
- package/esm/src/cli/localDevPackage.d.ts.map +1 -1
- package/esm/src/cli/localDevPackage.js +51 -48
- package/esm/src/cli/localDevPackage.js.map +1 -0
- package/esm/src/cli/managedFiles.d.ts.map +1 -1
- package/esm/src/cli/managedFiles.js +34 -18
- package/esm/src/cli/managedFiles.js.map +1 -0
- package/esm/src/cli/migrationEnv.d.ts +16 -3
- package/esm/src/cli/migrationEnv.d.ts.map +1 -1
- package/esm/src/cli/migrationEnv.js +7 -4
- package/esm/src/cli/migrationEnv.js.map +1 -0
- package/esm/src/cli/mod.d.ts +19 -7
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +2000 -742
- package/esm/src/cli/mod.js.map +1 -0
- package/esm/src/cli/packageTreeSignature.d.ts +8 -0
- package/esm/src/cli/packageTreeSignature.d.ts.map +1 -0
- package/esm/src/cli/packageTreeSignature.js +60 -0
- package/esm/src/cli/packageTreeSignature.js.map +1 -0
- package/esm/src/cli/processIdentity.d.ts +7 -0
- package/esm/src/cli/processIdentity.d.ts.map +1 -0
- package/esm/src/cli/processIdentity.js +39 -0
- package/esm/src/cli/processIdentity.js.map +1 -0
- package/esm/src/cli/projectSkills.d.ts +1 -1
- package/esm/src/cli/projectSkills.d.ts.map +1 -1
- package/esm/src/cli/projectSkills.js +31 -23
- package/esm/src/cli/projectSkills.js.map +1 -0
- package/esm/src/cli/projectTooling.d.ts +6 -3
- package/esm/src/cli/projectTooling.d.ts.map +1 -1
- package/esm/src/cli/projectTooling.js +86 -41
- package/esm/src/cli/projectTooling.js.map +1 -0
- package/esm/src/cli/releaseConfig.d.ts.map +1 -1
- package/esm/src/cli/releaseConfig.js +5 -3
- package/esm/src/cli/releaseConfig.js.map +1 -0
- package/esm/src/cli/releaseCredentials.d.ts.map +1 -1
- package/esm/src/cli/releaseCredentials.js +19 -31
- package/esm/src/cli/releaseCredentials.js.map +1 -0
- package/esm/src/cli/releaseTrust.d.ts.map +1 -1
- package/esm/src/cli/releaseTrust.js +11 -4
- package/esm/src/cli/releaseTrust.js.map +1 -0
- package/esm/src/cli/releaseTrustCommand.d.ts.map +1 -1
- package/esm/src/cli/releaseTrustCommand.js +6 -4
- package/esm/src/cli/releaseTrustCommand.js.map +1 -0
- package/esm/src/cli/sourceConfig.d.ts +3 -0
- package/esm/src/cli/sourceConfig.d.ts.map +1 -0
- package/esm/src/cli/sourceConfig.js +91 -0
- package/esm/src/cli/sourceConfig.js.map +1 -0
- package/esm/src/cli/sourceDev.d.ts +77 -0
- package/esm/src/cli/sourceDev.d.ts.map +1 -0
- package/esm/src/cli/sourceDev.js +974 -0
- package/esm/src/cli/sourceDev.js.map +1 -0
- package/esm/src/cli/vercelBuildEnv.d.ts.map +1 -1
- package/esm/src/cli/vercelBuildEnv.js +21 -15
- package/esm/src/cli/vercelBuildEnv.js.map +1 -0
- package/esm/src/cli/vercelEnvMask.d.ts +2 -2
- package/esm/src/cli/vercelEnvMask.d.ts.map +1 -1
- package/esm/src/cli/vercelEnvMask.js +8 -4
- package/esm/src/cli/vercelEnvMask.js.map +1 -0
- package/esm/src/cli/vercelProjectRelease.d.ts.map +1 -1
- package/esm/src/cli/vercelProjectRelease.js +45 -22
- package/esm/src/cli/vercelProjectRelease.js.map +1 -0
- package/esm/src/cli/vercelPulledEnv.d.ts +1 -1
- package/esm/src/cli/vercelPulledEnv.d.ts.map +1 -1
- package/esm/src/cli/vercelPulledEnv.js +1 -0
- package/esm/src/cli/vercelPulledEnv.js.map +1 -0
- package/esm/src/clientData/identity.d.ts.map +1 -1
- package/esm/src/clientData/identity.js +1 -0
- package/esm/src/clientData/identity.js.map +1 -0
- package/esm/src/clientData/mod.d.ts +0 -1
- package/esm/src/clientData/mod.d.ts.map +1 -1
- package/esm/src/clientData/mod.js +1 -0
- package/esm/src/clientData/mod.js.map +1 -0
- package/esm/src/files/client.d.ts +1 -1
- package/esm/src/files/client.d.ts.map +1 -1
- package/esm/src/files/client.js +3 -4
- package/esm/src/files/client.js.map +1 -0
- package/esm/src/files/errors.d.ts.map +1 -1
- package/esm/src/files/errors.js +3 -12
- package/esm/src/files/errors.js.map +1 -0
- package/esm/src/files/hash.d.ts +1 -1
- package/esm/src/files/hash.d.ts.map +1 -1
- package/esm/src/files/hash.js +1 -0
- package/esm/src/files/hash.js.map +1 -0
- package/esm/src/files/memory.d.ts.map +1 -1
- package/esm/src/files/memory.js +2 -1
- package/esm/src/files/memory.js.map +1 -0
- package/esm/src/files/metadata.d.ts.map +1 -1
- package/esm/src/files/metadata.js +11 -18
- package/esm/src/files/metadata.js.map +1 -0
- package/esm/src/files/mod.d.ts +0 -1
- package/esm/src/files/mod.d.ts.map +1 -1
- package/esm/src/files/mod.js +1 -1
- package/esm/src/files/mod.js.map +1 -0
- package/esm/src/files/s3.d.ts.map +1 -1
- package/esm/src/files/s3.js +6 -4
- package/esm/src/files/s3.js.map +1 -0
- package/esm/src/files/service.d.ts.map +1 -1
- package/esm/src/files/service.js +3 -4
- package/esm/src/files/service.js.map +1 -0
- package/esm/src/files/types.d.ts.map +1 -1
- package/esm/src/files/types.js +1 -0
- package/esm/src/files/types.js.map +1 -0
- package/esm/src/jobs/catalog.d.ts.map +1 -1
- package/esm/src/jobs/catalog.js +5 -1
- package/esm/src/jobs/catalog.js.map +1 -0
- package/esm/src/jobs/controller.d.ts +1 -1
- package/esm/src/jobs/controller.d.ts.map +1 -1
- package/esm/src/jobs/controller.js +11 -55
- package/esm/src/jobs/controller.js.map +1 -0
- package/esm/src/jobs/direct.d.ts.map +1 -1
- package/esm/src/jobs/direct.js +3 -3
- package/esm/src/jobs/direct.js.map +1 -0
- package/esm/src/jobs/events.d.ts.map +1 -1
- package/esm/src/jobs/events.js +1 -0
- package/esm/src/jobs/events.js.map +1 -0
- package/esm/src/jobs/format.d.ts +5 -5
- package/esm/src/jobs/format.d.ts.map +1 -1
- package/esm/src/jobs/format.js +2 -1
- package/esm/src/jobs/format.js.map +1 -0
- package/esm/src/jobs/http.d.ts +3 -3
- package/esm/src/jobs/http.d.ts.map +1 -1
- package/esm/src/jobs/http.js +1 -0
- package/esm/src/jobs/http.js.map +1 -0
- package/esm/src/jobs/log.d.ts.map +1 -1
- package/esm/src/jobs/log.js +1 -0
- package/esm/src/jobs/log.js.map +1 -0
- package/esm/src/jobs/mod.d.ts.map +1 -1
- package/esm/src/jobs/mod.js +1 -0
- package/esm/src/jobs/mod.js.map +1 -0
- package/esm/src/jobs/run.d.ts.map +1 -1
- package/esm/src/jobs/run.js +1 -0
- package/esm/src/jobs/run.js.map +1 -0
- package/esm/src/jobs/sanitize.d.ts.map +1 -1
- package/esm/src/jobs/sanitize.js +1 -0
- package/esm/src/jobs/sanitize.js.map +1 -0
- package/esm/src/jobs/types.d.ts +1 -0
- package/esm/src/jobs/types.d.ts.map +1 -1
- package/esm/src/jobs/types.js +1 -0
- package/esm/src/jobs/types.js.map +1 -0
- package/esm/src/mail/errors.d.ts.map +1 -1
- package/esm/src/mail/errors.js +8 -42
- package/esm/src/mail/errors.js.map +1 -0
- package/esm/src/mail/memory.d.ts +1 -1
- package/esm/src/mail/memory.d.ts.map +1 -1
- package/esm/src/mail/memory.js +10 -14
- package/esm/src/mail/memory.js.map +1 -0
- package/esm/src/mail/mod.d.ts +0 -1
- package/esm/src/mail/mod.d.ts.map +1 -1
- package/esm/src/mail/mod.js +1 -1
- package/esm/src/mail/mod.js.map +1 -0
- package/esm/src/mail/postal.d.ts +1 -2
- package/esm/src/mail/postal.d.ts.map +1 -1
- package/esm/src/mail/postal.js +22 -18
- package/esm/src/mail/postal.js.map +1 -0
- package/esm/src/mail/retry.d.ts.map +1 -1
- package/esm/src/mail/retry.js +1 -0
- package/esm/src/mail/retry.js.map +1 -0
- package/esm/src/mail/sender.d.ts.map +1 -1
- package/esm/src/mail/sender.js +1 -0
- package/esm/src/mail/sender.js.map +1 -0
- package/esm/src/mail/service.d.ts.map +1 -1
- package/esm/src/mail/service.js +6 -7
- package/esm/src/mail/service.js.map +1 -0
- package/esm/src/mail/types.d.ts.map +1 -1
- package/esm/src/mail/types.js +1 -0
- package/esm/src/mail/types.js.map +1 -0
- package/esm/src/mui/apiKeys.d.ts +10 -11
- package/esm/src/mui/apiKeys.d.ts.map +1 -1
- package/esm/src/mui/apiKeys.js +83 -214
- package/esm/src/mui/apiKeys.js.map +1 -0
- package/esm/src/mui/apiKeysView.d.ts +1 -1
- package/esm/src/mui/apiKeysView.d.ts.map +1 -1
- package/esm/src/mui/apiKeysView.js +11 -9
- package/esm/src/mui/apiKeysView.js.map +1 -0
- package/esm/src/mui/confirm.d.ts +2 -2
- package/esm/src/mui/confirm.d.ts.map +1 -1
- package/esm/src/mui/confirm.js +3 -7
- package/esm/src/mui/confirm.js.map +1 -0
- package/esm/src/mui/mail.d.ts +4 -4
- package/esm/src/mui/mail.d.ts.map +1 -1
- package/esm/src/mui/mail.js +11 -71
- package/esm/src/mui/mail.js.map +1 -0
- package/esm/src/mui/mailView.d.ts +1 -1
- package/esm/src/mui/mailView.d.ts.map +1 -1
- package/esm/src/mui/mailView.js +1 -0
- package/esm/src/mui/mailView.js.map +1 -0
- package/esm/src/mui/mod.d.ts +0 -1
- package/esm/src/mui/mod.d.ts.map +1 -1
- package/esm/src/mui/mod.js +1 -0
- package/esm/src/mui/mod.js.map +1 -0
- package/esm/src/next/apiKeys/mod.d.ts +2 -3
- package/esm/src/next/apiKeys/mod.d.ts.map +1 -1
- package/esm/src/next/apiKeys/mod.js +6 -5
- package/esm/src/next/apiKeys/mod.js.map +1 -0
- package/esm/src/next/auth/client.d.ts +0 -1
- package/esm/src/next/auth/client.d.ts.map +1 -1
- package/esm/src/next/auth/client.js +1 -0
- package/esm/src/next/auth/client.js.map +1 -0
- package/esm/src/next/auth/config.d.ts.map +1 -1
- package/esm/src/next/auth/config.js +11 -17
- package/esm/src/next/auth/config.js.map +1 -0
- package/esm/src/next/auth/localTestLogin.d.ts.map +1 -1
- package/esm/src/next/auth/localTestLogin.js +13 -9
- package/esm/src/next/auth/localTestLogin.js.map +1 -0
- package/esm/src/next/auth/mod.d.ts.map +1 -1
- package/esm/src/next/auth/mod.js +1 -0
- package/esm/src/next/auth/mod.js.map +1 -0
- package/esm/src/next/auth/server.d.ts +2 -2
- package/esm/src/next/auth/server.d.ts.map +1 -1
- package/esm/src/next/auth/server.js +1 -0
- package/esm/src/next/auth/server.js.map +1 -0
- package/esm/src/next/files/mod.d.ts +0 -1
- package/esm/src/next/files/mod.d.ts.map +1 -1
- package/esm/src/next/files/mod.js +1 -1
- package/esm/src/next/files/mod.js.map +1 -0
- package/esm/src/next/files/route.d.ts +1 -1
- package/esm/src/next/files/route.d.ts.map +1 -1
- package/esm/src/next/files/route.js +11 -11
- package/esm/src/next/files/route.js.map +1 -0
- package/esm/src/next/jobs/list.d.ts +5 -5
- package/esm/src/next/jobs/list.d.ts.map +1 -1
- package/esm/src/next/jobs/list.js +15 -19
- package/esm/src/next/jobs/list.js.map +1 -0
- package/esm/src/next/jobs/mod.d.ts.map +1 -1
- package/esm/src/next/jobs/mod.js +1 -0
- package/esm/src/next/jobs/mod.js.map +1 -0
- package/esm/src/next/jobs/paths.d.ts +2 -2
- package/esm/src/next/jobs/paths.d.ts.map +1 -1
- package/esm/src/next/jobs/paths.js +1 -0
- package/esm/src/next/jobs/paths.js.map +1 -0
- package/esm/src/next/jobs/route.d.ts +2 -2
- package/esm/src/next/jobs/route.d.ts.map +1 -1
- package/esm/src/next/jobs/route.js +4 -4
- package/esm/src/next/jobs/route.js.map +1 -0
- package/esm/src/next/jobs/run.d.ts +2 -2
- package/esm/src/next/jobs/run.d.ts.map +1 -1
- package/esm/src/next/jobs/run.js +68 -132
- package/esm/src/next/jobs/run.js.map +1 -0
- package/esm/src/next/jobs/runRequest.d.ts +1 -1
- package/esm/src/next/jobs/runRequest.d.ts.map +1 -1
- package/esm/src/next/jobs/runRequest.js +3 -4
- package/esm/src/next/jobs/runRequest.js.map +1 -0
- package/esm/src/next/jobs/stream.d.ts.map +1 -1
- package/esm/src/next/jobs/stream.js +1 -0
- package/esm/src/next/jobs/stream.js.map +1 -0
- package/esm/src/next/mail/mod.d.ts +0 -1
- package/esm/src/next/mail/mod.d.ts.map +1 -1
- package/esm/src/next/mail/mod.js +1 -1
- package/esm/src/next/mail/mod.js.map +1 -0
- package/esm/src/next/mail/route.d.ts +2 -2
- package/esm/src/next/mail/route.d.ts.map +1 -1
- package/esm/src/next/mail/route.js +1 -0
- package/esm/src/next/mail/route.js.map +1 -0
- package/esm/src/next/pwa/mod.d.ts +0 -4
- package/esm/src/next/pwa/mod.d.ts.map +1 -1
- package/esm/src/next/pwa/mod.js +32 -16
- package/esm/src/next/pwa/mod.js.map +1 -0
- package/esm/src/next/pwa/worker.d.ts +0 -1
- package/esm/src/next/pwa/worker.d.ts.map +1 -1
- package/esm/src/next/pwa/worker.js +1 -0
- package/esm/src/next/pwa/worker.js.map +1 -0
- package/esm/src/next/secrets/constants.d.ts +3 -0
- package/esm/src/next/secrets/constants.d.ts.map +1 -0
- package/esm/src/next/secrets/constants.js +3 -0
- package/esm/src/next/secrets/constants.js.map +1 -0
- package/esm/src/next/secrets/mod.d.ts +1 -3
- package/esm/src/next/secrets/mod.d.ts.map +1 -1
- package/esm/src/next/secrets/mod.js +6 -7
- package/esm/src/next/secrets/mod.js.map +1 -0
- package/esm/src/next/sourceDev.d.ts +6 -0
- package/esm/src/next/sourceDev.d.ts.map +1 -0
- package/esm/src/next/sourceDev.js +41 -0
- package/esm/src/next/sourceDev.js.map +1 -0
- package/esm/src/secrets/encoding.d.ts.map +1 -1
- package/esm/src/secrets/encoding.js +1 -0
- package/esm/src/secrets/encoding.js.map +1 -0
- package/esm/src/secrets/errors.d.ts.map +1 -1
- package/esm/src/secrets/errors.js +3 -7
- package/esm/src/secrets/errors.js.map +1 -0
- package/esm/src/secrets/fingerprint.d.ts.map +1 -1
- package/esm/src/secrets/fingerprint.js +1 -0
- package/esm/src/secrets/fingerprint.js.map +1 -0
- package/esm/src/secrets/frame.d.ts.map +1 -1
- package/esm/src/secrets/frame.js +4 -3
- package/esm/src/secrets/frame.js.map +1 -0
- package/esm/src/secrets/keyring.d.ts.map +1 -1
- package/esm/src/secrets/keyring.js +6 -6
- package/esm/src/secrets/keyring.js.map +1 -0
- package/esm/src/secrets/legacy.d.ts +0 -1
- package/esm/src/secrets/legacy.d.ts.map +1 -1
- package/esm/src/secrets/legacy.js +13 -10
- package/esm/src/secrets/legacy.js.map +1 -0
- package/esm/src/secrets/maintenance.d.ts +0 -1
- package/esm/src/secrets/maintenance.d.ts.map +1 -1
- package/esm/src/secrets/maintenance.js +9 -24
- package/esm/src/secrets/maintenance.js.map +1 -0
- package/esm/src/secrets/mod.d.ts +0 -1
- package/esm/src/secrets/mod.d.ts.map +1 -1
- package/esm/src/secrets/mod.js +1 -1
- package/esm/src/secrets/mod.js.map +1 -0
- package/esm/src/secrets/secrets.d.ts.map +1 -1
- package/esm/src/secrets/secrets.js +38 -30
- package/esm/src/secrets/secrets.js.map +1 -0
- package/package.json +111 -135
- package/skills/loom/SKILL.md +40 -5
- package/skills/loom/references/esm-package.md +35 -0
- package/skills/loom/references/local-development.md +261 -29
- package/skills/loom-mail/SKILL.md +1 -0
- package/skills/upgrade-deps/SKILL.md +4 -2
- package/source/bin/loom.ts +50 -0
- package/source/mod.ts +10 -0
- package/source/src/apiKeys/authorize.ts +294 -0
- package/source/src/apiKeys/betterAuth.ts +253 -0
- package/source/src/apiKeys/country.ts +7 -0
- package/source/src/apiKeys/credentials.ts +171 -0
- package/source/src/apiKeys/fingerprint.ts +10 -0
- package/{script/src/apiKeys/lifecycle.d.ts → source/src/apiKeys/lifecycle.ts} +21 -23
- package/source/src/apiKeys/limits.ts +372 -0
- package/source/src/apiKeys/mod.ts +11 -0
- package/source/src/apiKeys/permissions.ts +153 -0
- package/source/src/apiKeys/policy.ts +189 -0
- package/source/src/apiKeys/retention.ts +136 -0
- package/source/src/apiKeys/types.ts +288 -0
- package/source/src/cli/atomicText.ts +38 -0
- package/source/src/cli/bunLocalDev.ts +646 -0
- package/source/src/cli/bunProject.ts +433 -0
- package/source/src/cli/cliBootstrap.ts +313 -0
- package/source/src/cli/externalSkills.ts +315 -0
- package/source/src/cli/filesR2Policy.ts +212 -0
- package/source/src/cli/generatedBuild.ts +380 -0
- package/source/src/cli/generatedCleanup.ts +87 -0
- package/source/src/cli/generatedDevLease.ts +52 -0
- package/source/src/cli/generatedInstall.ts +630 -0
- package/source/src/cli/generatedWorkflow.ts +135 -0
- package/{script/src/cli/legacyManagedOutputs.js → source/src/cli/legacyManagedOutputs.ts} +36 -30
- package/source/src/cli/localDb.ts +548 -0
- package/source/src/cli/localDevLock.ts +462 -0
- package/source/src/cli/localDevPackage.ts +754 -0
- package/source/src/cli/managedFiles.ts +688 -0
- package/source/src/cli/migrationEnv.ts +267 -0
- package/source/src/cli/mod.ts +26788 -0
- package/source/src/cli/packageTreeSignature.ts +65 -0
- package/source/src/cli/processIdentity.ts +38 -0
- package/source/src/cli/projectSkills.ts +1102 -0
- package/source/src/cli/projectTooling.ts +1140 -0
- package/source/src/cli/releaseConfig.ts +36 -0
- package/source/src/cli/releaseCredentials.ts +642 -0
- package/source/src/cli/releaseTrust.ts +194 -0
- package/source/src/cli/releaseTrustCommand.ts +210 -0
- package/source/src/cli/sourceConfig.ts +106 -0
- package/source/src/cli/sourceDev.ts +1279 -0
- package/source/src/cli/vercelBuildEnv.ts +714 -0
- package/source/src/cli/vercelEnvMask.ts +182 -0
- package/source/src/cli/vercelProjectRelease.ts +807 -0
- package/source/src/cli/vercelPulledEnv.ts +174 -0
- package/source/src/clientData/identity.ts +229 -0
- package/source/src/clientData/mod.ts +1 -0
- package/source/src/files/client.ts +75 -0
- package/source/src/files/errors.ts +69 -0
- package/source/src/files/hash.ts +109 -0
- package/source/src/files/memory.ts +158 -0
- package/source/src/files/metadata.ts +251 -0
- package/source/src/files/mod.ts +8 -0
- package/source/src/files/s3.ts +182 -0
- package/source/src/files/service.ts +210 -0
- package/source/src/files/types.ts +171 -0
- package/source/src/jobs/catalog.ts +303 -0
- package/source/src/jobs/controller.ts +156 -0
- package/source/src/jobs/direct.ts +177 -0
- package/source/src/jobs/events.ts +74 -0
- package/source/src/jobs/format.ts +233 -0
- package/source/src/jobs/http.ts +83 -0
- package/source/src/jobs/log.ts +10 -0
- package/source/src/jobs/mod.ts +10 -0
- package/source/src/jobs/run.ts +141 -0
- package/source/src/jobs/sanitize.ts +142 -0
- package/source/src/jobs/types.ts +43 -0
- package/source/src/mail/errors.ts +77 -0
- package/source/src/mail/memory.ts +451 -0
- package/source/src/mail/mod.ts +5 -0
- package/source/src/mail/postal.ts +363 -0
- package/source/src/mail/retry.ts +30 -0
- package/source/src/mail/sender.ts +57 -0
- package/source/src/mail/service.ts +252 -0
- package/source/src/mail/types.ts +229 -0
- package/source/src/mui/apiKeys.tsx +1044 -0
- package/source/src/mui/apiKeysView.ts +535 -0
- package/source/src/mui/confirm.tsx +138 -0
- package/source/src/mui/mail.tsx +279 -0
- package/source/src/mui/mailView.ts +50 -0
- package/source/src/mui/mod.ts +3 -0
- package/source/src/next/apiKeys/mod.ts +393 -0
- package/{script/src/next/auth/client.d.ts → source/src/next/auth/client.ts} +19 -5
- package/source/src/next/auth/config.ts +207 -0
- package/source/src/next/auth/localTestLogin.ts +412 -0
- package/source/src/next/auth/mod.ts +3 -0
- package/source/src/next/auth/server.ts +94 -0
- package/source/src/next/files/mod.ts +1 -0
- package/source/src/next/files/route.ts +621 -0
- package/source/src/next/jobs/list.tsx +90 -0
- package/source/src/next/jobs/mod.ts +5 -0
- package/source/src/next/jobs/paths.ts +70 -0
- package/source/src/next/jobs/route.ts +207 -0
- package/source/src/next/jobs/run.tsx +888 -0
- package/source/src/next/jobs/runRequest.ts +92 -0
- package/source/src/next/jobs/stream.ts +33 -0
- package/source/src/next/mail/mod.ts +1 -0
- package/source/src/next/mail/route.ts +75 -0
- package/source/src/next/pwa/mod.tsx +453 -0
- package/source/src/next/pwa/worker.ts +59 -0
- package/source/src/next/secrets/constants.ts +2 -0
- package/source/src/next/secrets/mod.ts +319 -0
- package/source/src/next/sourceDev.ts +50 -0
- package/source/src/secrets/encoding.ts +102 -0
- package/source/src/secrets/errors.ts +58 -0
- package/source/src/secrets/fingerprint.ts +132 -0
- package/source/src/secrets/frame.ts +119 -0
- package/source/src/secrets/keyring.ts +225 -0
- package/source/src/secrets/legacy.ts +244 -0
- package/source/src/secrets/maintenance.ts +517 -0
- package/source/src/secrets/mod.ts +38 -0
- package/source/src/secrets/secrets.ts +926 -0
- package/db/databaseTls.test.ts +0 -171
- package/db/databaseUrl.test.ts +0 -72
- package/db/neonEndpoint.test.ts +0 -51
- package/db/testing.test.ts +0 -28
- package/deno.json +0 -3
- package/esm/_dnt.polyfills.d.ts +0 -166
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -177
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/package.json +0 -3
- package/script/_dnt.polyfills.d.ts +0 -166
- package/script/_dnt.polyfills.d.ts.map +0 -1
- package/script/_dnt.polyfills.js +0 -180
- package/script/_dnt.shims.d.ts +0 -2
- package/script/_dnt.shims.d.ts.map +0 -1
- package/script/_dnt.shims.js +0 -60
- package/script/bin/loom.d.ts +0 -2
- package/script/bin/loom.d.ts.map +0 -1
- package/script/bin/loom.js +0 -17
- package/script/mod.d.ts +0 -12
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -27
- package/script/package.json +0 -3
- package/script/src/apiKeys/authorize.d.ts +0 -4
- package/script/src/apiKeys/authorize.d.ts.map +0 -1
- package/script/src/apiKeys/authorize.js +0 -258
- package/script/src/apiKeys/betterAuth.d.ts +0 -123
- package/script/src/apiKeys/betterAuth.d.ts.map +0 -1
- package/script/src/apiKeys/betterAuth.js +0 -169
- package/script/src/apiKeys/country.d.ts +0 -3
- package/script/src/apiKeys/country.d.ts.map +0 -1
- package/script/src/apiKeys/country.js +0 -10
- package/script/src/apiKeys/credentials.d.ts +0 -39
- package/script/src/apiKeys/credentials.d.ts.map +0 -1
- package/script/src/apiKeys/credentials.js +0 -121
- package/script/src/apiKeys/fingerprint.d.ts +0 -3
- package/script/src/apiKeys/fingerprint.d.ts.map +0 -1
- package/script/src/apiKeys/fingerprint.js +0 -8
- package/script/src/apiKeys/lifecycle.d.ts.map +0 -1
- package/script/src/apiKeys/lifecycle.js +0 -7
- package/script/src/apiKeys/limits.d.ts +0 -132
- package/script/src/apiKeys/limits.d.ts.map +0 -1
- package/script/src/apiKeys/limits.js +0 -254
- package/script/src/apiKeys/mod.d.ts +0 -13
- package/script/src/apiKeys/mod.d.ts.map +0 -1
- package/script/src/apiKeys/mod.js +0 -28
- package/script/src/apiKeys/permissions.d.ts +0 -56
- package/script/src/apiKeys/permissions.d.ts.map +0 -1
- package/script/src/apiKeys/permissions.js +0 -136
- package/script/src/apiKeys/policy.d.ts +0 -61
- package/script/src/apiKeys/policy.d.ts.map +0 -1
- package/script/src/apiKeys/policy.js +0 -94
- package/script/src/apiKeys/retention.d.ts +0 -55
- package/script/src/apiKeys/retention.d.ts.map +0 -1
- package/script/src/apiKeys/retention.js +0 -70
- package/script/src/apiKeys/types.d.ts +0 -242
- package/script/src/apiKeys/types.d.ts.map +0 -1
- package/script/src/apiKeys/types.js +0 -2
- package/script/src/cli/externalSkills.d.ts +0 -39
- package/script/src/cli/externalSkills.d.ts.map +0 -1
- package/script/src/cli/externalSkills.js +0 -204
- package/script/src/cli/filesR2Policy.d.ts +0 -33
- package/script/src/cli/filesR2Policy.d.ts.map +0 -1
- package/script/src/cli/filesR2Policy.js +0 -135
- package/script/src/cli/legacyManagedOutputs.d.ts +0 -33
- package/script/src/cli/legacyManagedOutputs.d.ts.map +0 -1
- package/script/src/cli/localDb.d.ts +0 -28
- package/script/src/cli/localDb.d.ts.map +0 -1
- package/script/src/cli/localDb.js +0 -370
- package/script/src/cli/localDevLock.d.ts +0 -97
- package/script/src/cli/localDevLock.d.ts.map +0 -1
- package/script/src/cli/localDevLock.js +0 -320
- package/script/src/cli/localDevPackage.d.ts +0 -172
- package/script/src/cli/localDevPackage.d.ts.map +0 -1
- package/script/src/cli/localDevPackage.js +0 -635
- package/script/src/cli/managedFiles.d.ts +0 -131
- package/script/src/cli/managedFiles.d.ts.map +0 -1
- package/script/src/cli/managedFiles.js +0 -536
- package/script/src/cli/migrationEnv.d.ts +0 -63
- package/script/src/cli/migrationEnv.d.ts.map +0 -1
- package/script/src/cli/migrationEnv.js +0 -217
- package/script/src/cli/mod.d.ts +0 -582
- package/script/src/cli/mod.d.ts.map +0 -1
- package/script/src/cli/mod.js +0 -17010
- package/script/src/cli/projectSkills.d.ts +0 -109
- package/script/src/cli/projectSkills.d.ts.map +0 -1
- package/script/src/cli/projectSkills.js +0 -749
- package/script/src/cli/projectTooling.d.ts +0 -164
- package/script/src/cli/projectTooling.d.ts.map +0 -1
- package/script/src/cli/projectTooling.js +0 -847
- package/script/src/cli/releaseConfig.d.ts +0 -10
- package/script/src/cli/releaseConfig.d.ts.map +0 -1
- package/script/src/cli/releaseConfig.js +0 -26
- package/script/src/cli/releaseCredentials.d.ts +0 -32
- package/script/src/cli/releaseCredentials.d.ts.map +0 -1
- package/script/src/cli/releaseCredentials.js +0 -392
- package/script/src/cli/releaseTrust.d.ts +0 -39
- package/script/src/cli/releaseTrust.d.ts.map +0 -1
- package/script/src/cli/releaseTrust.js +0 -130
- package/script/src/cli/releaseTrustCommand.d.ts +0 -18
- package/script/src/cli/releaseTrustCommand.d.ts.map +0 -1
- package/script/src/cli/releaseTrustCommand.js +0 -145
- package/script/src/cli/vercelBuildEnv.d.ts +0 -62
- package/script/src/cli/vercelBuildEnv.d.ts.map +0 -1
- package/script/src/cli/vercelBuildEnv.js +0 -418
- package/script/src/cli/vercelEnvMask.d.ts +0 -38
- package/script/src/cli/vercelEnvMask.d.ts.map +0 -1
- package/script/src/cli/vercelEnvMask.js +0 -142
- package/script/src/cli/vercelProjectRelease.d.ts +0 -38
- package/script/src/cli/vercelProjectRelease.d.ts.map +0 -1
- package/script/src/cli/vercelProjectRelease.js +0 -607
- package/script/src/cli/vercelPulledEnv.d.ts +0 -65
- package/script/src/cli/vercelPulledEnv.d.ts.map +0 -1
- package/script/src/cli/vercelPulledEnv.js +0 -138
- package/script/src/clientData/identity.d.ts +0 -89
- package/script/src/clientData/identity.d.ts.map +0 -1
- package/script/src/clientData/identity.js +0 -134
- package/script/src/clientData/mod.d.ts +0 -3
- package/script/src/clientData/mod.d.ts.map +0 -1
- package/script/src/clientData/mod.js +0 -18
- package/script/src/files/client.d.ts +0 -29
- package/script/src/files/client.d.ts.map +0 -1
- package/script/src/files/client.js +0 -45
- package/script/src/files/errors.d.ts +0 -37
- package/script/src/files/errors.d.ts.map +0 -1
- package/script/src/files/errors.js +0 -76
- package/script/src/files/hash.d.ts +0 -15
- package/script/src/files/hash.d.ts.map +0 -1
- package/script/src/files/hash.js +0 -89
- package/script/src/files/memory.d.ts +0 -29
- package/script/src/files/memory.d.ts.map +0 -1
- package/script/src/files/memory.js +0 -113
- package/script/src/files/metadata.d.ts +0 -10
- package/script/src/files/metadata.d.ts.map +0 -1
- package/script/src/files/metadata.js +0 -189
- package/script/src/files/mod.d.ts +0 -10
- package/script/src/files/mod.d.ts.map +0 -1
- package/script/src/files/mod.js +0 -25
- package/script/src/files/s3.d.ts +0 -29
- package/script/src/files/s3.d.ts.map +0 -1
- package/script/src/files/s3.js +0 -110
- package/script/src/files/service.d.ts +0 -27
- package/script/src/files/service.d.ts.map +0 -1
- package/script/src/files/service.js +0 -139
- package/script/src/files/types.d.ts +0 -134
- package/script/src/files/types.d.ts.map +0 -1
- package/script/src/files/types.js +0 -2
- package/script/src/jobs/catalog.d.ts +0 -32
- package/script/src/jobs/catalog.d.ts.map +0 -1
- package/script/src/jobs/catalog.js +0 -223
- package/script/src/jobs/controller.d.ts +0 -41
- package/script/src/jobs/controller.d.ts.map +0 -1
- package/script/src/jobs/controller.js +0 -151
- package/script/src/jobs/direct.d.ts +0 -36
- package/script/src/jobs/direct.d.ts.map +0 -1
- package/script/src/jobs/direct.js +0 -128
- package/script/src/jobs/events.d.ts +0 -23
- package/script/src/jobs/events.d.ts.map +0 -1
- package/script/src/jobs/events.js +0 -50
- package/script/src/jobs/format.d.ts +0 -16
- package/script/src/jobs/format.d.ts.map +0 -1
- package/script/src/jobs/format.js +0 -193
- package/script/src/jobs/http.d.ts +0 -22
- package/script/src/jobs/http.d.ts.map +0 -1
- package/script/src/jobs/http.js +0 -50
- package/script/src/jobs/log.d.ts +0 -2
- package/script/src/jobs/log.d.ts.map +0 -1
- package/script/src/jobs/log.js +0 -13
- package/script/src/jobs/mod.d.ts +0 -11
- package/script/src/jobs/mod.d.ts.map +0 -1
- package/script/src/jobs/mod.js +0 -26
- package/script/src/jobs/run.d.ts +0 -39
- package/script/src/jobs/run.d.ts.map +0 -1
- package/script/src/jobs/run.js +0 -86
- package/script/src/jobs/sanitize.d.ts +0 -30
- package/script/src/jobs/sanitize.d.ts.map +0 -1
- package/script/src/jobs/sanitize.js +0 -97
- package/script/src/jobs/types.d.ts +0 -31
- package/script/src/jobs/types.d.ts.map +0 -1
- package/script/src/jobs/types.js +0 -2
- package/script/src/mail/errors.d.ts +0 -33
- package/script/src/mail/errors.d.ts.map +0 -1
- package/script/src/mail/errors.js +0 -97
- package/script/src/mail/memory.d.ts +0 -30
- package/script/src/mail/memory.d.ts.map +0 -1
- package/script/src/mail/memory.js +0 -345
- package/script/src/mail/mod.d.ts +0 -7
- package/script/src/mail/mod.d.ts.map +0 -1
- package/script/src/mail/mod.js +0 -22
- package/script/src/mail/postal.d.ts +0 -57
- package/script/src/mail/postal.d.ts.map +0 -1
- package/script/src/mail/postal.js +0 -251
- package/script/src/mail/retry.d.ts +0 -9
- package/script/src/mail/retry.d.ts.map +0 -1
- package/script/src/mail/retry.js +0 -22
- package/script/src/mail/sender.d.ts +0 -5
- package/script/src/mail/sender.d.ts.map +0 -1
- package/script/src/mail/sender.js +0 -52
- package/script/src/mail/service.d.ts +0 -23
- package/script/src/mail/service.d.ts.map +0 -1
- package/script/src/mail/service.js +0 -191
- package/script/src/mail/types.d.ts +0 -176
- package/script/src/mail/types.d.ts.map +0 -1
- package/script/src/mail/types.js +0 -2
- package/script/src/mui/apiKeys.d.ts +0 -171
- package/script/src/mui/apiKeys.d.ts.map +0 -1
- package/script/src/mui/apiKeys.js +0 -470
- package/script/src/mui/apiKeysView.d.ts +0 -193
- package/script/src/mui/apiKeysView.d.ts.map +0 -1
- package/script/src/mui/apiKeysView.js +0 -331
- package/script/src/mui/confirm.d.ts +0 -12
- package/script/src/mui/confirm.d.ts.map +0 -1
- package/script/src/mui/confirm.js +0 -85
- package/script/src/mui/mail.d.ts +0 -29
- package/script/src/mui/mail.d.ts.map +0 -1
- package/script/src/mui/mail.js +0 -159
- package/script/src/mui/mailView.d.ts +0 -20
- package/script/src/mui/mailView.d.ts.map +0 -1
- package/script/src/mui/mailView.js +0 -32
- package/script/src/mui/mod.d.ts +0 -5
- package/script/src/mui/mod.d.ts.map +0 -1
- package/script/src/mui/mod.js +0 -20
- package/script/src/next/apiKeys/mod.d.ts +0 -71
- package/script/src/next/apiKeys/mod.d.ts.map +0 -1
- package/script/src/next/apiKeys/mod.js +0 -227
- package/script/src/next/auth/client.d.ts.map +0 -1
- package/script/src/next/auth/client.js +0 -39
- package/script/src/next/auth/config.d.ts +0 -62
- package/script/src/next/auth/config.d.ts.map +0 -1
- package/script/src/next/auth/config.js +0 -178
- package/script/src/next/auth/localTestLogin.d.ts +0 -75
- package/script/src/next/auth/localTestLogin.d.ts.map +0 -1
- package/script/src/next/auth/localTestLogin.js +0 -291
- package/script/src/next/auth/mod.d.ts +0 -4
- package/script/src/next/auth/mod.d.ts.map +0 -1
- package/script/src/next/auth/mod.js +0 -19
- package/script/src/next/auth/server.d.ts +0 -44
- package/script/src/next/auth/server.d.ts.map +0 -1
- package/script/src/next/auth/server.js +0 -39
- package/script/src/next/files/mod.d.ts +0 -3
- package/script/src/next/files/mod.d.ts.map +0 -1
- package/script/src/next/files/mod.js +0 -18
- package/script/src/next/files/route.d.ts +0 -99
- package/script/src/next/files/route.d.ts.map +0 -1
- package/script/src/next/files/route.js +0 -353
- package/script/src/next/jobs/list.d.ts +0 -25
- package/script/src/next/jobs/list.d.ts.map +0 -1
- package/script/src/next/jobs/list.js +0 -48
- package/script/src/next/jobs/mod.d.ts +0 -6
- package/script/src/next/jobs/mod.d.ts.map +0 -1
- package/script/src/next/jobs/mod.js +0 -21
- package/script/src/next/jobs/paths.d.ts +0 -14
- package/script/src/next/jobs/paths.d.ts.map +0 -1
- package/script/src/next/jobs/paths.js +0 -47
- package/script/src/next/jobs/route.d.ts +0 -48
- package/script/src/next/jobs/route.d.ts.map +0 -1
- package/script/src/next/jobs/route.js +0 -105
- package/script/src/next/jobs/run.d.ts +0 -58
- package/script/src/next/jobs/run.d.ts.map +0 -1
- package/script/src/next/jobs/run.js +0 -592
- package/script/src/next/jobs/runRequest.d.ts +0 -19
- package/script/src/next/jobs/runRequest.d.ts.map +0 -1
- package/script/src/next/jobs/runRequest.js +0 -81
- package/script/src/next/jobs/stream.d.ts +0 -3
- package/script/src/next/jobs/stream.d.ts.map +0 -1
- package/script/src/next/jobs/stream.js +0 -28
- package/script/src/next/mail/mod.d.ts +0 -3
- package/script/src/next/mail/mod.d.ts.map +0 -1
- package/script/src/next/mail/mod.js +0 -18
- package/script/src/next/mail/route.d.ts +0 -12
- package/script/src/next/mail/route.d.ts.map +0 -1
- package/script/src/next/mail/route.js +0 -46
- package/script/src/next/pwa/mod.d.ts +0 -112
- package/script/src/next/pwa/mod.d.ts.map +0 -1
- package/script/src/next/pwa/mod.js +0 -303
- package/script/src/next/pwa/worker.d.ts +0 -27
- package/script/src/next/pwa/worker.d.ts.map +0 -1
- package/script/src/next/pwa/worker.js +0 -33
- package/script/src/next/secrets/mod.d.ts +0 -108
- package/script/src/next/secrets/mod.d.ts.map +0 -1
- package/script/src/next/secrets/mod.js +0 -218
- package/script/src/secrets/encoding.d.ts +0 -32
- package/script/src/secrets/encoding.d.ts.map +0 -1
- package/script/src/secrets/encoding.js +0 -95
- package/script/src/secrets/errors.d.ts +0 -45
- package/script/src/secrets/errors.d.ts.map +0 -1
- package/script/src/secrets/errors.js +0 -45
- package/script/src/secrets/fingerprint.d.ts +0 -43
- package/script/src/secrets/fingerprint.d.ts.map +0 -1
- package/script/src/secrets/fingerprint.js +0 -92
- package/script/src/secrets/frame.d.ts +0 -34
- package/script/src/secrets/frame.d.ts.map +0 -1
- package/script/src/secrets/frame.js +0 -91
- package/script/src/secrets/keyring.d.ts +0 -62
- package/script/src/secrets/keyring.d.ts.map +0 -1
- package/script/src/secrets/keyring.js +0 -202
- package/script/src/secrets/legacy.d.ts +0 -60
- package/script/src/secrets/legacy.d.ts.map +0 -1
- package/script/src/secrets/legacy.js +0 -186
- package/script/src/secrets/maintenance.d.ts +0 -173
- package/script/src/secrets/maintenance.d.ts.map +0 -1
- package/script/src/secrets/maintenance.js +0 -323
- package/script/src/secrets/mod.d.ts +0 -6
- package/script/src/secrets/mod.d.ts.map +0 -1
- package/script/src/secrets/mod.js +0 -24
- package/script/src/secrets/secrets.d.ts +0 -192
- package/script/src/secrets/secrets.d.ts.map +0 -1
- package/script/src/secrets/secrets.js +0 -532
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { readFileSync, unlinkSync } from "node:fs";
|
|
3
|
+
import {
|
|
4
|
+
lstat,
|
|
5
|
+
mkdir,
|
|
6
|
+
open,
|
|
7
|
+
readFile,
|
|
8
|
+
stat,
|
|
9
|
+
unlink,
|
|
10
|
+
utimes,
|
|
11
|
+
} from "node:fs/promises";
|
|
12
|
+
import { hostname as osHostname } from "node:os";
|
|
13
|
+
import { dirname } from "node:path";
|
|
14
|
+
import process from "node:process";
|
|
15
|
+
|
|
16
|
+
import { currentProcessScope } from "./processIdentity.ts";
|
|
17
|
+
|
|
18
|
+
/** Who holds a local-dev sync lock, as recorded in the lock file. */
|
|
19
|
+
export type LocalDevLockHolder = {
|
|
20
|
+
hostname: string;
|
|
21
|
+
/** Namespace/boot identity for strict locks; absent in older records. */
|
|
22
|
+
scope?: string | null;
|
|
23
|
+
/** Strict holders cannot be replaced just because they stopped refreshing. */
|
|
24
|
+
strict?: boolean;
|
|
25
|
+
pid: number;
|
|
26
|
+
/** ISO timestamp of when the holder acquired the lock. */
|
|
27
|
+
startedAt: string;
|
|
28
|
+
/** Distinguishes holders that share a PID, such as two syncs in one process. */
|
|
29
|
+
token: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** What a lock holder's work receives from {@link withLocalDevLock}. */
|
|
33
|
+
export type LocalDevLockHandle = {
|
|
34
|
+
/**
|
|
35
|
+
* Throws if this process no longer owns the lock, for example because it
|
|
36
|
+
* was paused long enough for a waiter to judge the lock abandoned. Call it
|
|
37
|
+
* before each step that changes files or packages; `changesMade` says
|
|
38
|
+
* whether earlier steps already changed something, which the message then
|
|
39
|
+
* owns up to. Read errors other than a missing lock are retried and then
|
|
40
|
+
* reported as themselves, not as a lost lock.
|
|
41
|
+
*/
|
|
42
|
+
assertHeld(changesMade?: boolean): Promise<void>;
|
|
43
|
+
/** Whether this process waited for another holder before acquiring. */
|
|
44
|
+
waited: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** The process-signal surface the lock uses to release itself on exit. */
|
|
48
|
+
export type LocalDevLockSignalTarget = {
|
|
49
|
+
kill(pid: number, signal: string): unknown;
|
|
50
|
+
off(signal: string, listener: (signal: string) => void): unknown;
|
|
51
|
+
on(signal: string, listener: (signal: string) => void): unknown;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Tuning and test seams for {@link withLocalDevLock}. */
|
|
55
|
+
export type LocalDevLockOptions = {
|
|
56
|
+
/**
|
|
57
|
+
* Test seam: runs while this process holds the break lock, after it
|
|
58
|
+
* confirmed the stale lock and before removing it.
|
|
59
|
+
*/
|
|
60
|
+
beforeBreak?: () => Promise<void>;
|
|
61
|
+
/** Never replace live/unknown holders; recover only a dead PID in this exact process scope. */
|
|
62
|
+
strict?: boolean;
|
|
63
|
+
/** Test seam for boot/PID namespace identity. */
|
|
64
|
+
processScope?: string | null;
|
|
65
|
+
/** How often the holder refreshes the lock's modification time. */
|
|
66
|
+
heartbeatMs?: number;
|
|
67
|
+
hostname?: string;
|
|
68
|
+
/** Reports whether a process on this host is still running. */
|
|
69
|
+
isProcessAlive?: (pid: number) => boolean;
|
|
70
|
+
now?: () => number;
|
|
71
|
+
/** Called once when another holder makes this process wait. */
|
|
72
|
+
onWait?: (holder: LocalDevLockHolder | null) => void;
|
|
73
|
+
pollMs?: number;
|
|
74
|
+
/** Signals that release the lock before the process exits. */
|
|
75
|
+
signals?: readonly string[];
|
|
76
|
+
/** Test seam replacing `process` for signal handling. */
|
|
77
|
+
signalTarget?: LocalDevLockSignalTarget;
|
|
78
|
+
sleep?: (ms: number) => Promise<void>;
|
|
79
|
+
/** How long a lock may go unrefreshed before any waiter breaks it. */
|
|
80
|
+
staleAfterMs?: number;
|
|
81
|
+
/** How long to wait for another holder before failing. */
|
|
82
|
+
timeoutMs?: number;
|
|
83
|
+
/** Test seam for the heartbeat's refresh of the lock file. */
|
|
84
|
+
touch?: (path: string) => Promise<void>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** Holders refresh the lock this often while they run. */
|
|
88
|
+
export const LOCAL_DEV_LOCK_HEARTBEAT_MS = 5_000;
|
|
89
|
+
/**
|
|
90
|
+
* A lock nobody refreshed for this long is stale whatever its host or PID:
|
|
91
|
+
* its holder crashed, was killed, or is on a machine that went away.
|
|
92
|
+
*/
|
|
93
|
+
export const LOCAL_DEV_LOCK_STALE_AFTER_MS = 60_000;
|
|
94
|
+
/**
|
|
95
|
+
* A holder on this host whose process still exists (paused with Ctrl-Z or
|
|
96
|
+
* stopped in a debugger, say) keeps its lock this long without refreshing.
|
|
97
|
+
*/
|
|
98
|
+
export const LOCAL_DEV_LOCK_LIVE_HOLDER_STALE_AFTER_MS = 5 * 60_000;
|
|
99
|
+
/** Default wait for another sync; well beyond the stale thresholds. */
|
|
100
|
+
export const LOCAL_DEV_LOCK_TIMEOUT_MS = 10 * 60_000;
|
|
101
|
+
/**
|
|
102
|
+
* Before breaking a lock, a waiter must itself see it unrefreshed for this
|
|
103
|
+
* long, which spans two heartbeats. That protects live holders after a
|
|
104
|
+
* suspend/resume, under clock skew, and in another PID namespace.
|
|
105
|
+
*/
|
|
106
|
+
const MIN_UNREFRESHED_OBSERVATION_MS = 12_000;
|
|
107
|
+
// A longer gap between polls means this process was suspended, so earlier
|
|
108
|
+
// observations say nothing about the holder.
|
|
109
|
+
const MAX_POLL_GAP_MS = 10_000;
|
|
110
|
+
// Breaking a lock takes milliseconds; an older break lock is from a crash.
|
|
111
|
+
const BREAK_LOCK_STALE_AFTER_MS = 10_000;
|
|
112
|
+
const DEFAULT_SIGNALS = ["SIGHUP", "SIGINT", "SIGTERM"] as const;
|
|
113
|
+
|
|
114
|
+
function errorCode(error: unknown) {
|
|
115
|
+
return (error as { code?: unknown } | null)?.code;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function defaultIsProcessAlive(pid: number) {
|
|
119
|
+
if (pid === process.pid) return true;
|
|
120
|
+
try {
|
|
121
|
+
process.kill(pid, 0);
|
|
122
|
+
return true;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
// Only ESRCH proves the process is gone. EPERM means it belongs to
|
|
125
|
+
// someone else, and a sandbox may refuse the probe.
|
|
126
|
+
return errorCode(error) !== "ESRCH";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function parseHolder(text: string): LocalDevLockHolder | null {
|
|
131
|
+
try {
|
|
132
|
+
const value = JSON.parse(text) as Partial<LocalDevLockHolder>;
|
|
133
|
+
return typeof value.pid === "number" &&
|
|
134
|
+
typeof value.hostname === "string" &&
|
|
135
|
+
typeof value.startedAt === "string" &&
|
|
136
|
+
typeof value.token === "string"
|
|
137
|
+
? (value as LocalDevLockHolder)
|
|
138
|
+
: null;
|
|
139
|
+
} catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function readLock(lockPath: string, strict = false) {
|
|
145
|
+
try {
|
|
146
|
+
if (strict) {
|
|
147
|
+
const entry = await lstat(lockPath);
|
|
148
|
+
if (!entry.isFile() || entry.isSymbolicLink())
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Strict Loom lock is redirected or not a regular file: ${lockPath}`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
const [text, lockStat] = await Promise.all([
|
|
154
|
+
readFile(lockPath, "utf8"),
|
|
155
|
+
stat(lockPath),
|
|
156
|
+
]);
|
|
157
|
+
return { holder: parseHolder(text), mtimeMs: lockStat.mtimeMs, text };
|
|
158
|
+
} catch (error) {
|
|
159
|
+
if (errorCode(error) === "ENOENT") return null;
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Removes the lock only if it still has the content this process read. */
|
|
165
|
+
async function unlinkIfUnchanged(lockPath: string, text: string) {
|
|
166
|
+
try {
|
|
167
|
+
if ((await readFile(lockPath, "utf8")) === text) await unlink(lockPath);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
if (errorCode(error) !== "ENOENT") throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Creates a file exclusively with `text`, or returns false if it exists. */
|
|
174
|
+
async function createExclusive(path: string, text: string) {
|
|
175
|
+
const handle = await open(path, "wx").catch((error) => {
|
|
176
|
+
if (errorCode(error) === "EEXIST") return null;
|
|
177
|
+
throw error;
|
|
178
|
+
});
|
|
179
|
+
if (!handle) return false;
|
|
180
|
+
try {
|
|
181
|
+
await handle.writeFile(text, "utf8");
|
|
182
|
+
await handle.close();
|
|
183
|
+
} catch (error) {
|
|
184
|
+
await handle.close().catch(() => {});
|
|
185
|
+
await unlink(path).catch(() => {});
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Removes a stale lock while holding `<lock>.break`, so that waiters break
|
|
193
|
+
* a crashed lock one at a time. Each breaker re-reads the lock under the
|
|
194
|
+
* break lock and removes it only if it still has the stale content, so a
|
|
195
|
+
* later breaker can never remove the fresh lock a previous waiter created.
|
|
196
|
+
* Returns false when another process is breaking it; the caller re-checks.
|
|
197
|
+
*/
|
|
198
|
+
export async function breakStaleLock(
|
|
199
|
+
lockPath: string,
|
|
200
|
+
staleText: string,
|
|
201
|
+
options: {
|
|
202
|
+
beforeBreak?: () => Promise<void>;
|
|
203
|
+
now: () => number;
|
|
204
|
+
strict?: boolean;
|
|
205
|
+
},
|
|
206
|
+
) {
|
|
207
|
+
const breakPath = `${lockPath}.break`;
|
|
208
|
+
const breakText = options.strict
|
|
209
|
+
? `${JSON.stringify({ strict: true, token: randomUUID() })}\n`
|
|
210
|
+
: `${randomUUID()}\n`;
|
|
211
|
+
if (!(await createExclusive(breakPath, breakText))) {
|
|
212
|
+
if (options.strict) return false;
|
|
213
|
+
const breakLock = await readLock(breakPath);
|
|
214
|
+
if (
|
|
215
|
+
breakLock &&
|
|
216
|
+
!isStrictRecovery(breakLock.text) &&
|
|
217
|
+
options.now() - breakLock.mtimeMs > BREAK_LOCK_STALE_AFTER_MS
|
|
218
|
+
) {
|
|
219
|
+
await unlinkIfUnchanged(breakPath, breakLock.text);
|
|
220
|
+
}
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const current = await readFile(lockPath, "utf8").catch((error) => {
|
|
225
|
+
if (errorCode(error) === "ENOENT") return null;
|
|
226
|
+
throw error;
|
|
227
|
+
});
|
|
228
|
+
if (current === staleText) {
|
|
229
|
+
await options.beforeBreak?.();
|
|
230
|
+
await unlinkIfUnchanged(lockPath, staleText);
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
} finally {
|
|
234
|
+
await unlinkIfUnchanged(breakPath, breakText);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function isStrictRecovery(text: string) {
|
|
239
|
+
try {
|
|
240
|
+
return (JSON.parse(text) as { strict?: unknown })?.strict === true;
|
|
241
|
+
} catch {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function describeHolder(holder: LocalDevLockHolder | null) {
|
|
247
|
+
return holder
|
|
248
|
+
? `process ${holder.pid} on ${holder.hostname}, started ${holder.startedAt}`
|
|
249
|
+
: "a process whose lock record is unreadable";
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Runs `run` while holding an exclusive lock file, so concurrent Loom
|
|
254
|
+
* commands in one project do not rebuild and reinstall the linked package at
|
|
255
|
+
* the same time. A waiting process runs `run` after the holder finishes, so
|
|
256
|
+
* it re-checks freshness instead of repeating the work.
|
|
257
|
+
*
|
|
258
|
+
* The holder refreshes the lock's modification time every `heartbeatMs` and
|
|
259
|
+
* removes it on SIGHUP/SIGINT/SIGTERM. A waiter breaks a lock it has seen
|
|
260
|
+
* unrefreshed for `staleAfterMs`, whatever its host or PID, or sooner (after
|
|
261
|
+
* two missed heartbeats) when the lock is already older than that or its
|
|
262
|
+
* process is gone on this host. Waiting longer than `timeoutMs` fails with a
|
|
263
|
+
* message naming the holder and the lock file.
|
|
264
|
+
*/
|
|
265
|
+
export async function withLocalDevLock<T>(
|
|
266
|
+
lockPath: string,
|
|
267
|
+
run: (lock: LocalDevLockHandle) => Promise<T>,
|
|
268
|
+
options: LocalDevLockOptions = {},
|
|
269
|
+
): Promise<T> {
|
|
270
|
+
const now = options.now ?? Date.now;
|
|
271
|
+
const sleep =
|
|
272
|
+
options.sleep ??
|
|
273
|
+
((ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)));
|
|
274
|
+
const hostname = options.hostname ?? osHostname();
|
|
275
|
+
const isProcessAlive = options.isProcessAlive ?? defaultIsProcessAlive;
|
|
276
|
+
const timeoutMs = options.timeoutMs ?? LOCAL_DEV_LOCK_TIMEOUT_MS;
|
|
277
|
+
const staleAfterMs = options.staleAfterMs ?? LOCAL_DEV_LOCK_STALE_AFTER_MS;
|
|
278
|
+
const pollMs = options.pollMs ?? 250;
|
|
279
|
+
const deadline = now() + timeoutMs;
|
|
280
|
+
const own: LocalDevLockHolder = {
|
|
281
|
+
hostname,
|
|
282
|
+
scope:
|
|
283
|
+
options.processScope === undefined
|
|
284
|
+
? await currentProcessScope()
|
|
285
|
+
: options.processScope,
|
|
286
|
+
...(options.strict ? { strict: true } : {}),
|
|
287
|
+
pid: process.pid,
|
|
288
|
+
startedAt: "",
|
|
289
|
+
token: randomUUID(),
|
|
290
|
+
};
|
|
291
|
+
let ownText = "";
|
|
292
|
+
let waited = false;
|
|
293
|
+
// What this waiter has seen of the current lock, by its own clock.
|
|
294
|
+
let observed: { lastPoll: number; signature: string; since: number } | null =
|
|
295
|
+
null;
|
|
296
|
+
|
|
297
|
+
await mkdir(dirname(lockPath), { recursive: true });
|
|
298
|
+
while (true) {
|
|
299
|
+
own.startedAt = new Date(now()).toISOString();
|
|
300
|
+
ownText = `${JSON.stringify(own)}\n`;
|
|
301
|
+
const recovery = await readLock(`${lockPath}.break`, options.strict);
|
|
302
|
+
if (recovery && (options.strict || isStrictRecovery(recovery.text))) {
|
|
303
|
+
if (!waited) {
|
|
304
|
+
waited = true;
|
|
305
|
+
options.onWait?.(null);
|
|
306
|
+
}
|
|
307
|
+
if (now() >= deadline)
|
|
308
|
+
throw new Error(
|
|
309
|
+
`Timed out waiting for strict Loom lock recovery (${lockPath}.break). Its owner is unknown; verify all commands/installers stopped before manual recovery.`,
|
|
310
|
+
);
|
|
311
|
+
await sleep(pollMs);
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (await createExclusive(lockPath, ownText)) break;
|
|
315
|
+
|
|
316
|
+
const lock = await readLock(lockPath, options.strict);
|
|
317
|
+
if (!lock) continue;
|
|
318
|
+
const holder = lock.holder;
|
|
319
|
+
const time = now();
|
|
320
|
+
const signature = `${lock.mtimeMs}:${lock.text}`;
|
|
321
|
+
if (
|
|
322
|
+
!observed ||
|
|
323
|
+
observed.signature !== signature ||
|
|
324
|
+
time - observed.lastPoll > MAX_POLL_GAP_MS
|
|
325
|
+
) {
|
|
326
|
+
observed = { lastPoll: time, signature, since: time };
|
|
327
|
+
}
|
|
328
|
+
observed.lastPoll = time;
|
|
329
|
+
const unrefreshedFor = time - observed.since;
|
|
330
|
+
const onThisHost = holder !== null && holder.hostname === hostname;
|
|
331
|
+
const aliveHere = onThisHost && isProcessAlive(holder.pid);
|
|
332
|
+
const deadHere = onThisHost && !aliveHere;
|
|
333
|
+
// A process that still exists here is probably paused, not gone.
|
|
334
|
+
const unrefreshedLimit = aliveHere
|
|
335
|
+
? Math.max(staleAfterMs, LOCAL_DEV_LOCK_LIVE_HOLDER_STALE_AFTER_MS)
|
|
336
|
+
: staleAfterMs;
|
|
337
|
+
const strict = options.strict === true || holder?.strict === true;
|
|
338
|
+
const stale = strict
|
|
339
|
+
? Boolean(
|
|
340
|
+
deadHere &&
|
|
341
|
+
own.scope &&
|
|
342
|
+
holder?.scope === own.scope &&
|
|
343
|
+
unrefreshedFor >= MIN_UNREFRESHED_OBSERVATION_MS,
|
|
344
|
+
)
|
|
345
|
+
: unrefreshedFor >= unrefreshedLimit ||
|
|
346
|
+
(unrefreshedFor >= MIN_UNREFRESHED_OBSERVATION_MS &&
|
|
347
|
+
(deadHere || (!aliveHere && time - lock.mtimeMs >= staleAfterMs)));
|
|
348
|
+
if (stale) {
|
|
349
|
+
if (
|
|
350
|
+
await breakStaleLock(lockPath, lock.text, {
|
|
351
|
+
beforeBreak: options.beforeBreak,
|
|
352
|
+
now,
|
|
353
|
+
strict,
|
|
354
|
+
})
|
|
355
|
+
) {
|
|
356
|
+
observed = null;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
} else if (!waited) {
|
|
360
|
+
waited = true;
|
|
361
|
+
options.onWait?.(holder);
|
|
362
|
+
}
|
|
363
|
+
if (now() >= deadline) {
|
|
364
|
+
throw new Error(
|
|
365
|
+
`Timed out after ${Math.round(
|
|
366
|
+
timeoutMs / 1000,
|
|
367
|
+
)}s waiting for another Loom dev sync (${describeHolder(
|
|
368
|
+
holder,
|
|
369
|
+
)}) that holds ${lockPath}. If no Loom command is running in this project, delete that file and rerun.`,
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
await sleep(pollMs);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
let lost = false;
|
|
376
|
+
const heartbeat = setInterval(() => {
|
|
377
|
+
readFile(lockPath, "utf8")
|
|
378
|
+
.then((text) => {
|
|
379
|
+
if (text !== ownText) {
|
|
380
|
+
lost = true;
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (options.touch) return options.touch(lockPath);
|
|
384
|
+
const time = new Date();
|
|
385
|
+
return utimes(lockPath, time, time);
|
|
386
|
+
})
|
|
387
|
+
.catch(() => {});
|
|
388
|
+
}, options.heartbeatMs ?? LOCAL_DEV_LOCK_HEARTBEAT_MS);
|
|
389
|
+
const handle: LocalDevLockHandle = {
|
|
390
|
+
waited,
|
|
391
|
+
assertHeld: async (changesMade = false) => {
|
|
392
|
+
let text: string | null = null;
|
|
393
|
+
for (let attempt = 1; ; attempt += 1) {
|
|
394
|
+
try {
|
|
395
|
+
text = await readFile(lockPath, "utf8");
|
|
396
|
+
break;
|
|
397
|
+
} catch (error) {
|
|
398
|
+
if (errorCode(error) === "ENOENT") break;
|
|
399
|
+
if (attempt >= 3) {
|
|
400
|
+
throw new Error(
|
|
401
|
+
`Could not read the dev sync lock ${lockPath}: ${
|
|
402
|
+
(error as Error).message
|
|
403
|
+
}`,
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
await sleep(50 * attempt);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (text !== ownText) lost = true;
|
|
410
|
+
if (lost) {
|
|
411
|
+
throw new Error(
|
|
412
|
+
`This Loom command lost the dev sync lock (${lockPath}): it stopped refreshing it, for example while paused, and another Loom command took over. ${
|
|
413
|
+
changesMade
|
|
414
|
+
? "It had already changed the project (an override, build, or install) and stopped there; run `loom dev sync` to bring the local Loom package up to date."
|
|
415
|
+
: "It stopped before making changes; rerun it."
|
|
416
|
+
}`,
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
// The heartbeat must never keep a finished command alive.
|
|
422
|
+
(heartbeat as { unref?: () => void }).unref?.();
|
|
423
|
+
|
|
424
|
+
const signalTarget: LocalDevLockSignalTarget =
|
|
425
|
+
options.signalTarget ?? (process as unknown as LocalDevLockSignalTarget);
|
|
426
|
+
const signals = options.signals ?? DEFAULT_SIGNALS;
|
|
427
|
+
const handledSignals: string[] = [];
|
|
428
|
+
const removeSignalHandlers = () => {
|
|
429
|
+
for (const signal of handledSignals.splice(0)) {
|
|
430
|
+
signalTarget.off(signal, onSignal);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
// Release synchronously, then re-raise so the default action still ends
|
|
434
|
+
// the process with the usual signal status.
|
|
435
|
+
function onSignal(signal: string) {
|
|
436
|
+
clearInterval(heartbeat);
|
|
437
|
+
try {
|
|
438
|
+
if (readFileSync(lockPath, "utf8") === ownText) unlinkSync(lockPath);
|
|
439
|
+
} catch {
|
|
440
|
+
// Gone already, or unreadable: nothing to release.
|
|
441
|
+
}
|
|
442
|
+
removeSignalHandlers();
|
|
443
|
+
signalTarget.kill(process.pid, signal);
|
|
444
|
+
}
|
|
445
|
+
for (const signal of signals) {
|
|
446
|
+
try {
|
|
447
|
+
signalTarget.on(signal, onSignal);
|
|
448
|
+
handledSignals.push(signal);
|
|
449
|
+
} catch {
|
|
450
|
+
// Some runtimes cannot listen for every signal (Deno on Windows).
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
try {
|
|
455
|
+
return await run(handle);
|
|
456
|
+
} finally {
|
|
457
|
+
clearInterval(heartbeat);
|
|
458
|
+
removeSignalHandlers();
|
|
459
|
+
// Never remove a lock another process took over after judging ours stale.
|
|
460
|
+
await unlinkIfUnchanged(lockPath, ownText);
|
|
461
|
+
}
|
|
462
|
+
}
|