@gadicc/loom 1.37.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 +113 -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 +35 -30
- 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 +9 -6
- package/esm/src/cli/migrationEnv.js.map +1 -0
- package/esm/src/cli/mod.d.ts +20 -7
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +2148 -730
- 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 +44 -21
- package/esm/src/cli/vercelBuildEnv.js.map +1 -0
- package/esm/src/cli/vercelEnvMask.d.ts +38 -0
- package/esm/src/cli/vercelEnvMask.d.ts.map +1 -0
- package/esm/src/cli/vercelEnvMask.js +140 -0
- 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 +47 -24
- package/esm/src/cli/vercelProjectRelease.js.map +1 -0
- package/esm/src/cli/vercelPulledEnv.d.ts +65 -0
- package/esm/src/cli/vercelPulledEnv.d.ts.map +1 -0
- package/esm/src/cli/vercelPulledEnv.js +133 -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/dependency-upgrades.md +4 -0
- package/skills/loom/references/esm-package.md +35 -0
- package/skills/loom/references/local-development.md +261 -29
- package/skills/loom/references/release-safety.md +10 -3
- package/skills/loom-auth/references/secrets-and-rotation.md +2 -1
- package/skills/loom-mail/SKILL.md +1 -0
- package/skills/loom-scaffold/references/greenfield-workflow.md +2 -1
- 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 -581
- package/script/src/cli/mod.d.ts.map +0 -1
- package/script/src/cli/mod.js +0 -16850
- 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 -401
- 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/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,52 @@
|
|
|
1
|
+
/** Shared mutation boundary for immutable generated development and source overlays. */
|
|
2
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
import { assertGeneratedStateParents } from "./generatedBuild.ts";
|
|
6
|
+
import { assertGeneratedInstallerIdle } from "./generatedInstall.ts";
|
|
7
|
+
import {
|
|
8
|
+
type LocalDevLockHandle,
|
|
9
|
+
type LocalDevLockOptions,
|
|
10
|
+
withLocalDevLock,
|
|
11
|
+
} from "./localDevLock.ts";
|
|
12
|
+
|
|
13
|
+
/** Cache/state discovery affects coordination only; unused generations never imply local activation. */
|
|
14
|
+
export async function hasGeneratedDevState(cwd: string) {
|
|
15
|
+
cwd = await realpath(cwd);
|
|
16
|
+
for (const name of [".loom/generated", ".loom/generated-install.json"]) {
|
|
17
|
+
const entry = await lstat(join(cwd, name)).catch((error: unknown) => {
|
|
18
|
+
if ((error as { code?: string }).code === "ENOENT") return null;
|
|
19
|
+
throw error;
|
|
20
|
+
});
|
|
21
|
+
if (entry) {
|
|
22
|
+
await assertGeneratedStateParents(cwd, join(cwd, ".loom"));
|
|
23
|
+
if (entry.isSymbolicLink())
|
|
24
|
+
throw new Error("Generated development state must not be redirected.");
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/** Serializes app mutations and refuses unproved installers even after their CLI parent exits. */
|
|
31
|
+
export async function withGeneratedDevLease<T>(
|
|
32
|
+
cwd: string,
|
|
33
|
+
run: (lease: LocalDevLockHandle) => Promise<T>,
|
|
34
|
+
options: LocalDevLockOptions & { allowInstallerRecovery?: boolean } = {},
|
|
35
|
+
) {
|
|
36
|
+
cwd = await realpath(cwd);
|
|
37
|
+
const generated = await hasGeneratedDevState(cwd);
|
|
38
|
+
if (generated && process.env.LOOM_DEV_SYNC_ACTIVE === "1")
|
|
39
|
+
throw new Error(
|
|
40
|
+
"Generated local/source/publication changes cannot run inside an active Loom sync.",
|
|
41
|
+
);
|
|
42
|
+
await assertGeneratedStateParents(cwd, join(cwd, ".loom"), true);
|
|
43
|
+
return await withLocalDevLock(
|
|
44
|
+
join(cwd, ".loom/dev-sync.lock"),
|
|
45
|
+
async (lease) => {
|
|
46
|
+
if (!options.allowInstallerRecovery)
|
|
47
|
+
await assertGeneratedInstallerIdle(cwd);
|
|
48
|
+
return await run(lease);
|
|
49
|
+
},
|
|
50
|
+
{ ...options, strict: options.strict || generated },
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
/** Durable, noninteractive install supervision. Workers never replace the current-operation head. */
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import {
|
|
5
|
+
link,
|
|
6
|
+
lstat,
|
|
7
|
+
mkdir,
|
|
8
|
+
readFile,
|
|
9
|
+
realpath,
|
|
10
|
+
unlink,
|
|
11
|
+
writeFile,
|
|
12
|
+
} from "node:fs/promises";
|
|
13
|
+
import { hostname } from "node:os";
|
|
14
|
+
import { join, resolve } from "node:path";
|
|
15
|
+
import process from "node:process";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
import {
|
|
18
|
+
assertGeneratedStateParents,
|
|
19
|
+
readGeneratedBuild,
|
|
20
|
+
} from "./generatedBuild.ts";
|
|
21
|
+
import { computePackageContentDigest } from "./localDevPackage.ts";
|
|
22
|
+
import {
|
|
23
|
+
currentProcessScope,
|
|
24
|
+
isProcessAlive,
|
|
25
|
+
isProcessGroupAlive,
|
|
26
|
+
} from "./processIdentity.ts";
|
|
27
|
+
|
|
28
|
+
const HEAD = ".loom/generated-install.json";
|
|
29
|
+
const OPERATIONS = ".loom/generated-installs";
|
|
30
|
+
const WORKER = "__loom_generated_install_worker__";
|
|
31
|
+
const UUID =
|
|
32
|
+
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
33
|
+
/** Immutable request; never contains inherited environment or subprocess output. */
|
|
34
|
+
interface InstallRequest {
|
|
35
|
+
version: 1;
|
|
36
|
+
projectRoot: string;
|
|
37
|
+
token: string;
|
|
38
|
+
target: string;
|
|
39
|
+
packageVersion: string;
|
|
40
|
+
packageDigest: string;
|
|
41
|
+
command: string;
|
|
42
|
+
args: string[];
|
|
43
|
+
}
|
|
44
|
+
interface WorkerClaim {
|
|
45
|
+
token: string;
|
|
46
|
+
projectRoot: string;
|
|
47
|
+
target: string;
|
|
48
|
+
packageDigest: string;
|
|
49
|
+
hostname: string;
|
|
50
|
+
scope: string | null;
|
|
51
|
+
workerPid: number;
|
|
52
|
+
}
|
|
53
|
+
interface Outcome {
|
|
54
|
+
token: string;
|
|
55
|
+
phase: "complete" | "blocked";
|
|
56
|
+
code: number;
|
|
57
|
+
signal?: string;
|
|
58
|
+
groupQuiescent: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface ManagerGroup {
|
|
61
|
+
token: string;
|
|
62
|
+
hostname: string;
|
|
63
|
+
scope: string | null;
|
|
64
|
+
pgid: number;
|
|
65
|
+
}
|
|
66
|
+
/** Read-only composed status. An immutable result permits re-inspection, never installed-package proof. */
|
|
67
|
+
export interface GeneratedInstallState extends InstallRequest {
|
|
68
|
+
phase: "launching" | "running" | "complete" | "blocked";
|
|
69
|
+
claim?: WorkerClaim;
|
|
70
|
+
outcome?: Outcome;
|
|
71
|
+
}
|
|
72
|
+
/** Output returns to the caller, never to the durable operation files. */
|
|
73
|
+
export interface GeneratedInstallResult {
|
|
74
|
+
code: number;
|
|
75
|
+
stdout: string;
|
|
76
|
+
stderr: string;
|
|
77
|
+
}
|
|
78
|
+
/** In-process boundary for focused tests; production always starts the guardian process. */
|
|
79
|
+
export type GeneratedInstallRunner = (
|
|
80
|
+
command: string,
|
|
81
|
+
args: string[],
|
|
82
|
+
options: {
|
|
83
|
+
cwd: string;
|
|
84
|
+
env?: Record<string, string | undefined>;
|
|
85
|
+
stdio?: "inherit" | "inherit-stderr" | "pipe";
|
|
86
|
+
},
|
|
87
|
+
) => Promise<GeneratedInstallResult>;
|
|
88
|
+
function allowed(command: string, args: readonly string[]) {
|
|
89
|
+
const expected: Record<string, readonly string[]> = {
|
|
90
|
+
bun: ["install", "--linker", "isolated"],
|
|
91
|
+
deno: ["install"],
|
|
92
|
+
pnpm: ["install", "--no-frozen-lockfile"],
|
|
93
|
+
};
|
|
94
|
+
return (
|
|
95
|
+
Object.hasOwn(expected, command) &&
|
|
96
|
+
JSON.stringify(args) === JSON.stringify(expected[command])
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function errorCode(error: unknown) {
|
|
100
|
+
return (error as { code?: string })?.code;
|
|
101
|
+
}
|
|
102
|
+
async function info(path: string) {
|
|
103
|
+
return await lstat(path).catch((error: unknown) => {
|
|
104
|
+
if (errorCode(error) === "ENOENT") return null;
|
|
105
|
+
throw error;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async function regularText(path: string): Promise<string | null> {
|
|
109
|
+
const entry = await info(path);
|
|
110
|
+
if (!entry) return null;
|
|
111
|
+
if (!entry.isFile() || entry.isSymbolicLink())
|
|
112
|
+
throw new Error(`Installer state is redirected or not a file: ${path}`);
|
|
113
|
+
return await readFile(path, "utf8");
|
|
114
|
+
}
|
|
115
|
+
function operation(state: InstallRequest) {
|
|
116
|
+
return join(state.projectRoot, OPERATIONS, state.token);
|
|
117
|
+
}
|
|
118
|
+
async function operationJson<T>(
|
|
119
|
+
state: InstallRequest,
|
|
120
|
+
name: string,
|
|
121
|
+
): Promise<T | null> {
|
|
122
|
+
const text = await regularText(join(operation(state), name));
|
|
123
|
+
return text === null ? null : (JSON.parse(text) as T);
|
|
124
|
+
}
|
|
125
|
+
async function requestAt(cwd: string): Promise<InstallRequest | null> {
|
|
126
|
+
cwd = await realpath(cwd);
|
|
127
|
+
if (!(await info(join(cwd, ".loom")))) return null;
|
|
128
|
+
await assertGeneratedStateParents(cwd, join(cwd, ".loom"));
|
|
129
|
+
const text = await regularText(join(cwd, HEAD));
|
|
130
|
+
if (text === null) return null;
|
|
131
|
+
const state = JSON.parse(text) as InstallRequest;
|
|
132
|
+
if (
|
|
133
|
+
state.version !== 1 ||
|
|
134
|
+
state.projectRoot !== cwd ||
|
|
135
|
+
!UUID.test(state.token) ||
|
|
136
|
+
!Array.isArray(state.args) ||
|
|
137
|
+
!allowed(state.command, state.args) ||
|
|
138
|
+
typeof state.target !== "string" ||
|
|
139
|
+
typeof state.packageVersion !== "string" ||
|
|
140
|
+
!state.packageDigest?.startsWith("sha256:")
|
|
141
|
+
)
|
|
142
|
+
throw new Error(
|
|
143
|
+
"Invalid generated installer request; explicit stopped recovery is required.",
|
|
144
|
+
);
|
|
145
|
+
await assertGeneratedStateParents(cwd, operation(state));
|
|
146
|
+
if ((await regularText(join(operation(state), "owner.json"))) !== text)
|
|
147
|
+
throw new Error(
|
|
148
|
+
"Installer request no longer matches its immutable operation owner.",
|
|
149
|
+
);
|
|
150
|
+
return state;
|
|
151
|
+
}
|
|
152
|
+
/** Reads only the current operation, never inactive generation/operation caches. */
|
|
153
|
+
export async function inspectGeneratedInstaller(
|
|
154
|
+
cwd: string,
|
|
155
|
+
): Promise<GeneratedInstallState | null> {
|
|
156
|
+
const state = await requestAt(cwd);
|
|
157
|
+
if (!state) return null;
|
|
158
|
+
const claim = await operationJson<WorkerClaim>(state, "claim.json");
|
|
159
|
+
if (
|
|
160
|
+
claim &&
|
|
161
|
+
(claim.token !== state.token ||
|
|
162
|
+
claim.projectRoot !== state.projectRoot ||
|
|
163
|
+
claim.target !== state.target ||
|
|
164
|
+
claim.packageDigest !== state.packageDigest ||
|
|
165
|
+
!Number.isSafeInteger(claim.workerPid) ||
|
|
166
|
+
claim.workerPid < 1 ||
|
|
167
|
+
typeof claim.hostname !== "string" ||
|
|
168
|
+
!(claim.scope === null || typeof claim.scope === "string"))
|
|
169
|
+
)
|
|
170
|
+
throw new Error("Invalid installer worker claim.");
|
|
171
|
+
const outcome = await operationJson<Outcome>(state, "result.json");
|
|
172
|
+
if (
|
|
173
|
+
outcome &&
|
|
174
|
+
(outcome.token !== state.token ||
|
|
175
|
+
!["complete", "blocked"].includes(outcome.phase) ||
|
|
176
|
+
!Number.isInteger(outcome.code) ||
|
|
177
|
+
(outcome.phase === "complete" &&
|
|
178
|
+
(outcome.code !== 0 ||
|
|
179
|
+
outcome.signal ||
|
|
180
|
+
outcome.groupQuiescent !== true)))
|
|
181
|
+
)
|
|
182
|
+
throw new Error("Invalid installer completion record.");
|
|
183
|
+
const revoked = await regularText(join(operation(state), "revoked.json"));
|
|
184
|
+
return {
|
|
185
|
+
...state,
|
|
186
|
+
phase: revoked
|
|
187
|
+
? "blocked"
|
|
188
|
+
: (outcome?.phase ?? (claim ? "running" : "launching")),
|
|
189
|
+
...(claim ? { claim } : {}),
|
|
190
|
+
...(outcome ? { outcome } : {}),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async function writeOnce(state: InstallRequest, name: string, value: unknown) {
|
|
194
|
+
await assertGeneratedStateParents(state.projectRoot, operation(state));
|
|
195
|
+
await writeFile(join(operation(state), name), JSON.stringify(value) + "\n", {
|
|
196
|
+
flag: "wx",
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async function assertCurrent(state: InstallRequest) {
|
|
200
|
+
if (
|
|
201
|
+
(await requestAt(state.projectRoot))?.token !== state.token ||
|
|
202
|
+
(await info(join(operation(state), "revoked.json")))
|
|
203
|
+
)
|
|
204
|
+
throw new Error("Generated installer ownership changed or was revoked.");
|
|
205
|
+
}
|
|
206
|
+
/** Excludes installers that can still mutate the app, including after their CLI parent dies. */
|
|
207
|
+
export async function assertGeneratedInstallerIdle(cwd: string) {
|
|
208
|
+
const state = await inspectGeneratedInstaller(cwd);
|
|
209
|
+
if (state && state.phase !== "complete")
|
|
210
|
+
throw new Error(
|
|
211
|
+
`A managed Loom installer is running or its completion is unproved (${join(cwd, HEAD)}). Stop all installer/lifecycle processes, then run \`loom dev recover-install --stopped\` and rerun sync. A dead parent PID alone is not proof that its installer stopped.`,
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
/** Normal/production diagnostics treat unknown state as pending, while unused caches are harmless. */
|
|
215
|
+
export async function generatedInstallerIssue(cwd: string) {
|
|
216
|
+
try {
|
|
217
|
+
await assertGeneratedInstallerIdle(cwd);
|
|
218
|
+
return null;
|
|
219
|
+
} catch (error) {
|
|
220
|
+
return `Managed Loom installer state requires recovery: ${(error as Error).message}`;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async function assertWorkerStopped(claim: WorkerClaim | undefined) {
|
|
224
|
+
if (!claim) return;
|
|
225
|
+
const scope = await currentProcessScope();
|
|
226
|
+
if (claim.hostname !== hostname() || claim.scope !== scope || !scope)
|
|
227
|
+
throw new Error(
|
|
228
|
+
"The installer worker belongs to an unknown process scope; recover from its original environment after stopping it.",
|
|
229
|
+
);
|
|
230
|
+
if (isProcessAlive(claim.workerPid))
|
|
231
|
+
throw new Error(
|
|
232
|
+
"The recorded installer worker is still running; stop it before recovery.",
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
/** Explicit quiescence acknowledgement revokes only operation state; config/packages stay for repair. */
|
|
236
|
+
export async function recoverGeneratedInstaller(
|
|
237
|
+
cwd: string,
|
|
238
|
+
stopped: boolean,
|
|
239
|
+
assertHeld: () => Promise<void>,
|
|
240
|
+
) {
|
|
241
|
+
cwd = await realpath(cwd);
|
|
242
|
+
const path = join(cwd, HEAD);
|
|
243
|
+
if (!(await info(path))) return false;
|
|
244
|
+
if (!stopped)
|
|
245
|
+
throw new Error(
|
|
246
|
+
"Confirm all installer and lifecycle processes have stopped with `loom dev recover-install --stopped`.",
|
|
247
|
+
);
|
|
248
|
+
await assertGeneratedStateParents(cwd, join(cwd, ".loom"));
|
|
249
|
+
const original = await regularText(path);
|
|
250
|
+
let state: InstallRequest | null;
|
|
251
|
+
try {
|
|
252
|
+
state = await requestAt(cwd);
|
|
253
|
+
} catch {
|
|
254
|
+
// A corrupt regular marker cannot identify a worker. The explicit human assertion is
|
|
255
|
+
// required; preserve its bytes for diagnosis and never touch paths encoded in it.
|
|
256
|
+
await assertHeld();
|
|
257
|
+
if ((await regularText(path)) !== original)
|
|
258
|
+
throw new Error("Installer state changed during recovery.");
|
|
259
|
+
await writeFile(
|
|
260
|
+
join(cwd, `.loom/generated-install-corrupt-${randomUUID()}.json`),
|
|
261
|
+
original!,
|
|
262
|
+
{ flag: "wx" },
|
|
263
|
+
);
|
|
264
|
+
await unlink(path);
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
if (!state) return false;
|
|
268
|
+
let claim = await operationJson<WorkerClaim>(state, "claim.json").catch(
|
|
269
|
+
() => null,
|
|
270
|
+
);
|
|
271
|
+
const grantText = await regularText(join(operation(state), "grant.json"));
|
|
272
|
+
if (!claim && grantText !== null) {
|
|
273
|
+
try {
|
|
274
|
+
claim = JSON.parse(grantText) as WorkerClaim;
|
|
275
|
+
} catch {
|
|
276
|
+
throw new Error(
|
|
277
|
+
"Installer grant/claim is corrupt; preserve the reservation and diagnose its worker before recovery.",
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (
|
|
282
|
+
claim &&
|
|
283
|
+
(claim.token !== state.token ||
|
|
284
|
+
claim.projectRoot !== state.projectRoot ||
|
|
285
|
+
claim.target !== state.target ||
|
|
286
|
+
claim.packageDigest !== state.packageDigest ||
|
|
287
|
+
!Number.isSafeInteger(claim.workerPid) ||
|
|
288
|
+
claim.workerPid < 1)
|
|
289
|
+
)
|
|
290
|
+
throw new Error(
|
|
291
|
+
"Installer worker identity is invalid; preserve its reservation.",
|
|
292
|
+
);
|
|
293
|
+
await assertWorkerStopped(claim ?? undefined);
|
|
294
|
+
const group = await groupAt(state).catch(() => null); // A partial group launch requires the explicit stopped acknowledgement.
|
|
295
|
+
if (group) {
|
|
296
|
+
await assertGroupScope(group);
|
|
297
|
+
if (isProcessGroupAlive(group.pgid))
|
|
298
|
+
throw new Error(
|
|
299
|
+
"The managed installer process group still exists; stop its installer/lifecycle processes before recovery.",
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
await assertHeld();
|
|
303
|
+
if ((await requestAt(cwd))?.token !== state.token)
|
|
304
|
+
throw new Error("Installer ownership changed during recovery.");
|
|
305
|
+
await writeOnce(state, "revoked.json", { token: state.token }).catch(
|
|
306
|
+
(error) => {
|
|
307
|
+
if (errorCode(error) !== "EEXIST") throw error;
|
|
308
|
+
},
|
|
309
|
+
);
|
|
310
|
+
// Workers only write nonce-owned sidecars. They can never resurrect/overwrite this head.
|
|
311
|
+
if ((await requestAt(cwd))?.token !== state.token)
|
|
312
|
+
throw new Error("Installer ownership changed during recovery.");
|
|
313
|
+
await unlink(path);
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
async function waitFor<T>(
|
|
317
|
+
read: () => Promise<T>,
|
|
318
|
+
accept: (value: T) => boolean,
|
|
319
|
+
timeoutMs = 15_000,
|
|
320
|
+
) {
|
|
321
|
+
const deadline = Date.now() + timeoutMs;
|
|
322
|
+
while (Date.now() < deadline) {
|
|
323
|
+
const value = await read();
|
|
324
|
+
if (accept(value)) return value;
|
|
325
|
+
await new Promise<void>((done) => setTimeout(done, 20));
|
|
326
|
+
}
|
|
327
|
+
throw new Error(
|
|
328
|
+
"Timed out waiting for the generated installer launch handshake; its reservation was kept.",
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
/** Managed installer quiescence currently requires the verified Linux process-group contract. */
|
|
332
|
+
export async function assertGeneratedInstallSupported() {
|
|
333
|
+
if (process.platform !== "linux" || !(await currentProcessScope()))
|
|
334
|
+
throw new Error(
|
|
335
|
+
"Managed per-app installs require Linux with verifiable process identity; keep the existing local workflow in this environment.",
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
async function groupAt(state: InstallRequest): Promise<ManagerGroup | null> {
|
|
339
|
+
const group = await operationJson<ManagerGroup>(state, "manager.json");
|
|
340
|
+
if (
|
|
341
|
+
group &&
|
|
342
|
+
(group.token !== state.token ||
|
|
343
|
+
!Number.isSafeInteger(group.pgid) ||
|
|
344
|
+
group.pgid < 1 ||
|
|
345
|
+
typeof group.hostname !== "string")
|
|
346
|
+
)
|
|
347
|
+
throw new Error("Invalid managed installer process group.");
|
|
348
|
+
return group;
|
|
349
|
+
}
|
|
350
|
+
async function assertGroupScope(group: ManagerGroup) {
|
|
351
|
+
const scope = await currentProcessScope();
|
|
352
|
+
if (!scope || group.scope !== scope || group.hostname !== hostname())
|
|
353
|
+
throw new Error(
|
|
354
|
+
"The installer group belongs to an unknown process scope; preserve its reservation.",
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
async function waitForGroupQuiescence(group: ManagerGroup) {
|
|
358
|
+
await assertGroupScope(group);
|
|
359
|
+
const deadline = Date.now() + 15_000;
|
|
360
|
+
while (isProcessGroupAlive(group.pgid)) {
|
|
361
|
+
if (Date.now() >= deadline) return false;
|
|
362
|
+
await new Promise<void>((done) => setTimeout(done, 25));
|
|
363
|
+
}
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** Selects one immutable package and grants its worker permission only after recording its PID. */
|
|
368
|
+
export async function runGeneratedInstall(
|
|
369
|
+
cwd: string,
|
|
370
|
+
target: string,
|
|
371
|
+
command: string,
|
|
372
|
+
args: string[],
|
|
373
|
+
options: {
|
|
374
|
+
env?: Record<string, string | undefined>;
|
|
375
|
+
stdio?: "inherit" | "inherit-stderr" | "pipe";
|
|
376
|
+
runner?: GeneratedInstallRunner;
|
|
377
|
+
assertHeld: () => Promise<void>;
|
|
378
|
+
},
|
|
379
|
+
): Promise<GeneratedInstallResult> {
|
|
380
|
+
cwd = await realpath(cwd);
|
|
381
|
+
if (!options.runner) await assertGeneratedInstallSupported();
|
|
382
|
+
await options.assertHeld();
|
|
383
|
+
await assertGeneratedInstallerIdle(cwd);
|
|
384
|
+
if (!allowed(command, args))
|
|
385
|
+
throw new Error("Unsupported generated installer command.");
|
|
386
|
+
const generation = await readGeneratedBuild(target, cwd);
|
|
387
|
+
if (
|
|
388
|
+
!generation ||
|
|
389
|
+
generation.owner.phase !== "ready" ||
|
|
390
|
+
generation.owner.packageDigest !==
|
|
391
|
+
(await computePackageContentDigest(generation.packageRoot))
|
|
392
|
+
)
|
|
393
|
+
throw new Error(
|
|
394
|
+
"The selected generated package is not ready or its content changed.",
|
|
395
|
+
);
|
|
396
|
+
const pkg = JSON.parse(
|
|
397
|
+
await readFile(join(generation.packageRoot, "package.json"), "utf8"),
|
|
398
|
+
) as { version: string };
|
|
399
|
+
const state: InstallRequest = {
|
|
400
|
+
version: 1,
|
|
401
|
+
projectRoot: cwd,
|
|
402
|
+
token: randomUUID(),
|
|
403
|
+
target: generation.packageRoot,
|
|
404
|
+
packageVersion: pkg.version,
|
|
405
|
+
packageDigest: generation.owner.packageDigest!,
|
|
406
|
+
command,
|
|
407
|
+
args: [...args],
|
|
408
|
+
};
|
|
409
|
+
await assertGeneratedStateParents(cwd, join(cwd, OPERATIONS), true);
|
|
410
|
+
await mkdir(operation(state));
|
|
411
|
+
const text = JSON.stringify(state) + "\n";
|
|
412
|
+
await writeFile(join(operation(state), "owner.json"), text, { flag: "wx" });
|
|
413
|
+
// Publish a complete head atomically and exclusively. A killed write leaves only unused scratch.
|
|
414
|
+
const prepared = join(operation(state), "head.json");
|
|
415
|
+
await writeFile(prepared, text, { flag: "wx" });
|
|
416
|
+
const previous = await requestAt(cwd);
|
|
417
|
+
if (previous) {
|
|
418
|
+
await options.assertHeld();
|
|
419
|
+
await unlink(join(cwd, HEAD));
|
|
420
|
+
}
|
|
421
|
+
await options.assertHeld();
|
|
422
|
+
await link(prepared, join(cwd, HEAD));
|
|
423
|
+
let result: GeneratedInstallResult;
|
|
424
|
+
if (options.runner) {
|
|
425
|
+
result = await options.runner(command, args, {
|
|
426
|
+
cwd,
|
|
427
|
+
env: options.env,
|
|
428
|
+
stdio: options.stdio,
|
|
429
|
+
});
|
|
430
|
+
await assertCurrent(state);
|
|
431
|
+
await writeOnce(state, "result.json", {
|
|
432
|
+
token: state.token,
|
|
433
|
+
phase: result.code === 0 ? "complete" : "blocked",
|
|
434
|
+
code: result.code,
|
|
435
|
+
groupQuiescent: true,
|
|
436
|
+
});
|
|
437
|
+
} else {
|
|
438
|
+
const path = fileURLToPath(import.meta.url),
|
|
439
|
+
pipe = options.stdio === "pipe";
|
|
440
|
+
const child = spawn(
|
|
441
|
+
"node",
|
|
442
|
+
[
|
|
443
|
+
...(path.endsWith(".ts") ? ["--experimental-strip-types"] : []),
|
|
444
|
+
path,
|
|
445
|
+
WORKER,
|
|
446
|
+
cwd,
|
|
447
|
+
state.token,
|
|
448
|
+
],
|
|
449
|
+
{
|
|
450
|
+
cwd,
|
|
451
|
+
env: options.env,
|
|
452
|
+
stdio: [
|
|
453
|
+
"ignore",
|
|
454
|
+
options.stdio === "inherit-stderr" ? 2 : pipe ? "pipe" : "inherit",
|
|
455
|
+
options.stdio === "inherit-stderr" ? 2 : pipe ? "pipe" : "inherit",
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
);
|
|
459
|
+
let stdout = "",
|
|
460
|
+
stderr = "";
|
|
461
|
+
child.stdout?.on("data", (chunk) => (stdout += chunk));
|
|
462
|
+
child.stderr?.on("data", (chunk) => (stderr += chunk));
|
|
463
|
+
let launchFailed = false;
|
|
464
|
+
let workerEnded = false;
|
|
465
|
+
const done = new Promise<GeneratedInstallResult>((finish) => {
|
|
466
|
+
child.once("error", (error) => {
|
|
467
|
+
launchFailed = true;
|
|
468
|
+
finish({ code: 1, stdout, stderr: stderr + (error as Error).message });
|
|
469
|
+
});
|
|
470
|
+
child.once("close", (code, signal) => {
|
|
471
|
+
workerEnded = true;
|
|
472
|
+
finish({ code: signal ? 1 : (code ?? 1), stdout, stderr });
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
const launchScope = await currentProcessScope();
|
|
476
|
+
const observedClaim = await waitFor(
|
|
477
|
+
async () => {
|
|
478
|
+
if (launchFailed || workerEnded)
|
|
479
|
+
throw new Error(
|
|
480
|
+
"Generated installer worker could not start; its reservation was kept.",
|
|
481
|
+
);
|
|
482
|
+
await assertCurrent(state);
|
|
483
|
+
// A claim write can be incomplete until its writer closes it; no grant has been issued yet.
|
|
484
|
+
return await operationJson<WorkerClaim>(state, "claim.json").catch(
|
|
485
|
+
() => null,
|
|
486
|
+
);
|
|
487
|
+
},
|
|
488
|
+
(claim) =>
|
|
489
|
+
Boolean(
|
|
490
|
+
claim &&
|
|
491
|
+
claim.workerPid === child.pid &&
|
|
492
|
+
claim.token === state.token &&
|
|
493
|
+
claim.projectRoot === state.projectRoot &&
|
|
494
|
+
claim.target === state.target &&
|
|
495
|
+
claim.packageDigest === state.packageDigest &&
|
|
496
|
+
claim.hostname === hostname() &&
|
|
497
|
+
claim.scope === launchScope,
|
|
498
|
+
),
|
|
499
|
+
);
|
|
500
|
+
await options.assertHeld();
|
|
501
|
+
await assertCurrent(state);
|
|
502
|
+
await writeOnce(state, "grant.json", observedClaim);
|
|
503
|
+
result = await done;
|
|
504
|
+
}
|
|
505
|
+
const final = await inspectGeneratedInstaller(cwd);
|
|
506
|
+
if (
|
|
507
|
+
!final ||
|
|
508
|
+
final.token !== state.token ||
|
|
509
|
+
final.phase !== "complete" ||
|
|
510
|
+
result.code !== 0
|
|
511
|
+
) {
|
|
512
|
+
if (options.runner && final?.token === state.token && result.code !== 0)
|
|
513
|
+
return result; // Test runners have no external descendants.
|
|
514
|
+
throw new Error(
|
|
515
|
+
`Managed Loom install did not prove an unsignaled successful finish. Its reservation is retained; stop all installer/lifecycle processes before \`loom dev recover-install --stopped\`. ${result.stderr}`,
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
async function executeWorker(cwd: string, token: string) {
|
|
521
|
+
const initial = await requestAt(cwd);
|
|
522
|
+
if (!initial || initial.token !== token)
|
|
523
|
+
throw new Error("Invalid generated installer launch reservation.");
|
|
524
|
+
const state = initial;
|
|
525
|
+
let interrupted = false;
|
|
526
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"] as const,
|
|
527
|
+
onSignal = () => {
|
|
528
|
+
interrupted = true;
|
|
529
|
+
};
|
|
530
|
+
for (const signal of signals) process.on(signal, onSignal);
|
|
531
|
+
try {
|
|
532
|
+
await assertCurrent(state);
|
|
533
|
+
await writeOnce(state, "claim.json", {
|
|
534
|
+
token,
|
|
535
|
+
projectRoot: state.projectRoot,
|
|
536
|
+
target: state.target,
|
|
537
|
+
packageDigest: state.packageDigest,
|
|
538
|
+
workerPid: process.pid,
|
|
539
|
+
hostname: hostname(),
|
|
540
|
+
scope: await currentProcessScope(),
|
|
541
|
+
});
|
|
542
|
+
await waitFor(
|
|
543
|
+
async () => {
|
|
544
|
+
await assertCurrent(state);
|
|
545
|
+
if (interrupted)
|
|
546
|
+
throw new Error("Installer worker was interrupted before grant.");
|
|
547
|
+
return await operationJson<WorkerClaim>(state, "grant.json").catch(
|
|
548
|
+
() => null,
|
|
549
|
+
);
|
|
550
|
+
},
|
|
551
|
+
(grant) =>
|
|
552
|
+
grant?.token === token &&
|
|
553
|
+
grant.projectRoot === state.projectRoot &&
|
|
554
|
+
grant.target === state.target &&
|
|
555
|
+
grant.packageDigest === state.packageDigest &&
|
|
556
|
+
grant.workerPid === process.pid &&
|
|
557
|
+
grant.hostname === hostname(),
|
|
558
|
+
);
|
|
559
|
+
await assertCurrent(state);
|
|
560
|
+
const generation = await readGeneratedBuild(state.target, cwd);
|
|
561
|
+
if (
|
|
562
|
+
!generation ||
|
|
563
|
+
generation.owner.phase !== "ready" ||
|
|
564
|
+
generation.owner.packageDigest !== state.packageDigest ||
|
|
565
|
+
state.packageDigest !== (await computePackageContentDigest(state.target))
|
|
566
|
+
)
|
|
567
|
+
throw new Error("Generated package changed before installer startup.");
|
|
568
|
+
let group: ManagerGroup | null = null;
|
|
569
|
+
await writeOnce(state, "manager-launching.json", {
|
|
570
|
+
token,
|
|
571
|
+
workerPid: process.pid,
|
|
572
|
+
scope: await currentProcessScope(),
|
|
573
|
+
});
|
|
574
|
+
const outcome = interrupted
|
|
575
|
+
? { code: 1, signal: "cancelled" }
|
|
576
|
+
: await (async () => {
|
|
577
|
+
// Noninteractive stdin permits a separate group without terminal input/job-control regressions.
|
|
578
|
+
const child = spawn(state.command, state.args, {
|
|
579
|
+
cwd,
|
|
580
|
+
env: process.env,
|
|
581
|
+
detached: true,
|
|
582
|
+
stdio: ["ignore", 1, 2],
|
|
583
|
+
});
|
|
584
|
+
const done = new Promise<{ code: number; signal?: string }>(
|
|
585
|
+
(finish) => {
|
|
586
|
+
child.once("error", () => finish({ code: 1 }));
|
|
587
|
+
child.once("close", (code, signal) =>
|
|
588
|
+
finish({ code: code ?? 1, ...(signal ? { signal } : {}) }),
|
|
589
|
+
);
|
|
590
|
+
},
|
|
591
|
+
);
|
|
592
|
+
if (child.pid) {
|
|
593
|
+
group = {
|
|
594
|
+
token,
|
|
595
|
+
hostname: hostname(),
|
|
596
|
+
scope: await currentProcessScope(),
|
|
597
|
+
pgid: child.pid,
|
|
598
|
+
};
|
|
599
|
+
await writeOnce(state, "manager.json", group);
|
|
600
|
+
}
|
|
601
|
+
return await done;
|
|
602
|
+
})();
|
|
603
|
+
const groupQuiescent = group ? await waitForGroupQuiescence(group) : false;
|
|
604
|
+
for (const signal of signals) process.off(signal, onSignal);
|
|
605
|
+
await assertCurrent(state);
|
|
606
|
+
await writeOnce(state, "result.json", {
|
|
607
|
+
token,
|
|
608
|
+
phase:
|
|
609
|
+
outcome.code === 0 && !outcome.signal && !interrupted && groupQuiescent
|
|
610
|
+
? "complete"
|
|
611
|
+
: "blocked",
|
|
612
|
+
...outcome,
|
|
613
|
+
groupQuiescent,
|
|
614
|
+
});
|
|
615
|
+
process.exitCode =
|
|
616
|
+
outcome.code === 0 && !interrupted && groupQuiescent ? 0 : 1;
|
|
617
|
+
// No file writes or completion callbacks follow the terminal record.
|
|
618
|
+
} finally {
|
|
619
|
+
for (const signal of signals) process.off(signal, onSignal);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (
|
|
623
|
+
process.argv[2] === WORKER &&
|
|
624
|
+
process.argv[1] &&
|
|
625
|
+
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
|
|
626
|
+
)
|
|
627
|
+
executeWorker(process.argv[3]!, process.argv[4]!).catch((error: unknown) => {
|
|
628
|
+
console.error((error as Error).message);
|
|
629
|
+
process.exitCode = 1;
|
|
630
|
+
});
|