@geekmidas/cli 10.0.0-alpha.122 → 10.0.0-alpha.124
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/dist/{EndpointGenerator-BDa6pPgE.cjs → EndpointGenerator-B2MUa4M2.cjs} +2 -2
- package/dist/{EndpointGenerator-BDa6pPgE.cjs.map → EndpointGenerator-B2MUa4M2.cjs.map} +1 -1
- package/dist/{EndpointGenerator-CP_z_E3e.mjs → EndpointGenerator-Z_BUTocT.mjs} +2 -2
- package/dist/{EndpointGenerator-CP_z_E3e.mjs.map → EndpointGenerator-Z_BUTocT.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-BJ9j9mR7.cjs → GoDaddyProvider-0z5RAN1k.cjs} +3 -3
- package/dist/{GoDaddyProvider-BJ9j9mR7.cjs.map → GoDaddyProvider-0z5RAN1k.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-wIKYdm7V.mjs → GoDaddyProvider-55x4o-4z.mjs} +3 -3
- package/dist/{GoDaddyProvider-wIKYdm7V.mjs.map → GoDaddyProvider-55x4o-4z.mjs.map} +1 -1
- package/dist/{HostingerProvider-BNpS9aRJ.mjs → HostingerProvider-Cjh_2Ml6.mjs} +2 -2
- package/dist/{HostingerProvider-BNpS9aRJ.mjs.map → HostingerProvider-Cjh_2Ml6.mjs.map} +1 -1
- package/dist/{HostingerProvider-DR1iws1P.cjs → HostingerProvider-OdQmKXE3.cjs} +2 -2
- package/dist/{HostingerProvider-DR1iws1P.cjs.map → HostingerProvider-OdQmKXE3.cjs.map} +1 -1
- package/dist/{LegacyStateStore-CkXUJP7i.mjs → LegacyStateStore-C-vumKSN.mjs} +3 -3
- package/dist/{LegacyStateStore-CkXUJP7i.mjs.map → LegacyStateStore-C-vumKSN.mjs.map} +1 -1
- package/dist/{LegacyStateStore-D1S87I_B.cjs → LegacyStateStore-DRpB-yC5.cjs} +3 -3
- package/dist/{LegacyStateStore-D1S87I_B.cjs.map → LegacyStateStore-DRpB-yC5.cjs.map} +1 -1
- package/dist/{LocalStateStore-DmXfpvu4.cjs → LocalStateStore-C3ummuDT.cjs} +2 -2
- package/dist/{LocalStateStore-DmXfpvu4.cjs.map → LocalStateStore-C3ummuDT.cjs.map} +1 -1
- package/dist/{LocalStateStore-BWoWeSq0.mjs → LocalStateStore-CtOjpV1w.mjs} +2 -2
- package/dist/{LocalStateStore-BWoWeSq0.mjs.map → LocalStateStore-CtOjpV1w.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-CsrukCE-.mjs → OpenApiTsGenerator-MtnMQL_g.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-CsrukCE-.mjs.map → OpenApiTsGenerator-MtnMQL_g.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs → OpenApiTsGenerator-t3_E98Fi.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs.map → OpenApiTsGenerator-t3_E98Fi.cjs.map} +1 -1
- package/dist/{S3StateStore-D19JSGE9.mjs → S3StateStore-BC4Jm3Tw.mjs} +2 -2
- package/dist/{S3StateStore-D19JSGE9.mjs.map → S3StateStore-BC4Jm3Tw.mjs.map} +1 -1
- package/dist/{S3StateStore-BEdsjjP4.cjs → S3StateStore-BeArp0aF.cjs} +2 -2
- package/dist/{S3StateStore-BEdsjjP4.cjs.map → S3StateStore-BeArp0aF.cjs.map} +1 -1
- package/dist/{SSMStateStore-7xKw0Zz9.mjs → SSMStateStore-Crl76aYZ.mjs} +2 -2
- package/dist/{SSMStateStore-7xKw0Zz9.mjs.map → SSMStateStore-Crl76aYZ.mjs.map} +1 -1
- package/dist/{SSMStateStore--2bcxoiH.cjs → SSMStateStore-DcstR6cW.cjs} +2 -2
- package/dist/{SSMStateStore--2bcxoiH.cjs.map → SSMStateStore-DcstR6cW.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-C8CPxrCK.cjs → SubscriberGenerator-C3QTae-R.cjs} +237 -54
- package/dist/SubscriberGenerator-C3QTae-R.cjs.map +1 -0
- package/dist/{SubscriberGenerator-y3pncae_.mjs → SubscriberGenerator-COAVPgM-.mjs} +227 -56
- package/dist/SubscriberGenerator-COAVPgM-.mjs.map +1 -0
- package/dist/{add-DlFUKdjX.cjs → add-BFjb6mMq.cjs} +7 -7
- package/dist/{add-DlFUKdjX.cjs.map → add-BFjb6mMq.cjs.map} +1 -1
- package/dist/{add-Bu6FkaTn.mjs → add-CIjmgzkb.mjs} +6 -6
- package/dist/{add-Bu6FkaTn.mjs.map → add-CIjmgzkb.mjs.map} +1 -1
- package/dist/{bundler-Bg0lPDoi.cjs → bundler-CiUoIsku.cjs} +5 -5
- package/dist/{bundler-Bg0lPDoi.cjs.map → bundler-CiUoIsku.cjs.map} +1 -1
- package/dist/{bundler-CgE5XTyr.mjs → bundler-D6KFNpQk.mjs} +5 -5
- package/dist/{bundler-CgE5XTyr.mjs.map → bundler-D6KFNpQk.mjs.map} +1 -1
- package/dist/{cli-z5S3bHyK.mjs → cli-DNtSTtMc.mjs} +4 -4
- package/dist/{cli-z5S3bHyK.mjs.map → cli-DNtSTtMc.mjs.map} +1 -1
- package/dist/{cli-Cvjlnpon.cjs → cli-r4eUr98C.cjs} +4 -4
- package/dist/{cli-Cvjlnpon.cjs.map → cli-r4eUr98C.cjs.map} +1 -1
- package/dist/{compose-bKLAtHLj.cjs → compose-BfXXWJSp.cjs} +362 -59
- package/dist/compose-BfXXWJSp.cjs.map +1 -0
- package/dist/{compose-CgBPA44v.mjs → compose-DJvvmF3X.mjs} +336 -33
- package/dist/compose-DJvvmF3X.mjs.map +1 -0
- package/dist/{config-D48erO2j.d.mts → config-IgK6YaGp.d.cts} +3 -4
- package/dist/config-IgK6YaGp.d.cts.map +1 -0
- package/dist/{config-DHDtsQrB.d.cts → config-kE-p5hxq.d.mts} +3 -4
- package/dist/config-kE-p5hxq.d.mts.map +1 -0
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/{credentialSchemas-B67WJOOm.cjs → credentialSchemas-AhIBuQxQ.cjs} +2 -2
- package/dist/{credentialSchemas-B67WJOOm.cjs.map → credentialSchemas-AhIBuQxQ.cjs.map} +1 -1
- package/dist/{credentialSchemas-DDOLRCLF.mjs → credentialSchemas-DLKbxYBy.mjs} +2 -2
- package/dist/{credentialSchemas-DDOLRCLF.mjs.map → credentialSchemas-DLKbxYBy.mjs.map} +1 -1
- package/dist/{credentials-Zqr3QQYB.cjs → credentials-D7XJypNd.cjs} +173 -3
- package/dist/credentials-D7XJypNd.cjs.map +1 -0
- package/dist/{credentials-B5N5yKk6.mjs → credentials-DpfnUvIR.mjs} +132 -4
- package/dist/credentials-DpfnUvIR.mjs.map +1 -0
- package/dist/deploy/public.cjs +16 -17
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts +3 -5
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +3 -5
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +11 -12
- package/dist/deploy/public.mjs.map +1 -1
- package/dist/{deploy-CI85F6dr.cjs → deploy-BbI1UMh3.cjs} +477 -156
- package/dist/deploy-BbI1UMh3.cjs.map +1 -0
- package/dist/{deploy-Ddy8UBoE.mjs → deploy-CiRYwFmr.mjs} +456 -117
- package/dist/deploy-CiRYwFmr.mjs.map +1 -0
- package/dist/{discover-C5roJuc9.mjs → discover-BvJOVsYG.mjs} +66 -14
- package/dist/discover-BvJOVsYG.mjs.map +1 -0
- package/dist/{discover-DozUKs8f.cjs → discover-ojkcbxHw.cjs} +88 -12
- package/dist/discover-ojkcbxHw.cjs.map +1 -0
- package/dist/{dokploy-CiozgdKO.cjs → dokploy-C0aQrCgs.cjs} +2 -2
- package/dist/{dokploy-CiozgdKO.cjs.map → dokploy-C0aQrCgs.cjs.map} +1 -1
- package/dist/{dokploy-Boj1NSHV.mjs → dokploy-MM7c3IE0.mjs} +2 -2
- package/dist/{dokploy-Boj1NSHV.mjs.map → dokploy-MM7c3IE0.mjs.map} +1 -1
- package/dist/{drivers-DbjiYpW6.cjs → drivers-CQ32PB5w.cjs} +2 -2
- package/dist/{drivers-DbjiYpW6.cjs.map → drivers-CQ32PB5w.cjs.map} +1 -1
- package/dist/{drivers-BjGDYfnC.mjs → drivers-Chb5Akov.mjs} +2 -2
- package/dist/{drivers-BjGDYfnC.mjs.map → drivers-Chb5Akov.mjs.map} +1 -1
- package/dist/{eas-DCg41jKK.mjs → eas-1Ee6kql0.mjs} +2 -2
- package/dist/{eas-DCg41jKK.mjs.map → eas-1Ee6kql0.mjs.map} +1 -1
- package/dist/{eas-BmBjIFf_.cjs → eas-CJoys9yh.cjs} +2 -2
- package/dist/{eas-BmBjIFf_.cjs.map → eas-CJoys9yh.cjs.map} +1 -1
- package/dist/{emit-C1e8qD08.mjs → emit-CNpuV_6Q.mjs} +17 -1
- package/dist/emit-CNpuV_6Q.mjs.map +1 -0
- package/dist/{emit-Dmc1nvdS.cjs → emit-qvHxMV9b.cjs} +17 -1
- package/dist/emit-qvHxMV9b.cjs.map +1 -0
- package/dist/{encryption-QOQbGXgV.mjs → encryption-B8Bk1Mvu.mjs} +3 -3
- package/dist/{encryption-QOQbGXgV.mjs.map → encryption-B8Bk1Mvu.mjs.map} +1 -1
- package/dist/{encryption-CwLWV2ig.cjs → encryption-Bo9VlRnl.cjs} +3 -3
- package/dist/{encryption-CwLWV2ig.cjs.map → encryption-Bo9VlRnl.cjs.map} +1 -1
- package/dist/{engine-HVqo3mQu.mjs → engine-BuinpJfS.mjs} +7 -8
- package/dist/{engine-HVqo3mQu.mjs.map → engine-BuinpJfS.mjs.map} +1 -1
- package/dist/{engine-D7YNY3v7.cjs → engine-esxTxcIx.cjs} +10 -11
- package/dist/{engine-D7YNY3v7.cjs.map → engine-esxTxcIx.cjs.map} +1 -1
- package/dist/{github-CO8W9SDs.cjs → github-BEA4K3_X.cjs} +80 -47
- package/dist/github-BEA4K3_X.cjs.map +1 -0
- package/dist/{github-CQt3xc3o.mjs → github-BUlKJfOV.mjs} +78 -45
- package/dist/github-BUlKJfOV.mjs.map +1 -0
- package/dist/{googlePlay-Cfu17aEp.mjs → googlePlay-CK05QiTq.mjs} +4 -4
- package/dist/{googlePlay-Cfu17aEp.mjs.map → googlePlay-CK05QiTq.mjs.map} +1 -1
- package/dist/{googlePlay-DSuF6jbF.cjs → googlePlay-CiqAS2ma.cjs} +5 -5
- package/dist/{googlePlay-DSuF6jbF.cjs.map → googlePlay-CiqAS2ma.cjs.map} +1 -1
- package/dist/{index-8OfpOtSI.d.cts → index-4CO0HD27.d.cts} +2 -2
- package/dist/{index-8OfpOtSI.d.cts.map → index-4CO0HD27.d.cts.map} +1 -1
- package/dist/{index-Dpji6Bxq.d.mts → index-DhUf0B0m.d.mts} +2 -2
- package/dist/{index-Dpji6Bxq.d.mts.map → index-DhUf0B0m.d.mts.map} +1 -1
- package/dist/index.cjs +81 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +64 -65
- package/dist/index.mjs.map +1 -1
- package/dist/{local-BwC2v2Y8.mjs → local-B7Zv1NoA.mjs} +2 -2
- package/dist/{local-BwC2v2Y8.mjs.map → local-B7Zv1NoA.mjs.map} +1 -1
- package/dist/{local-DNhnkugT.cjs → local-OPC9BCZt.cjs} +3 -3
- package/dist/{local-DNhnkugT.cjs.map → local-OPC9BCZt.cjs.map} +1 -1
- package/dist/{migrate-CGkir5LM.mjs → migrate-BzCHT9qs.mjs} +3 -3
- package/dist/{migrate-CGkir5LM.mjs.map → migrate-BzCHT9qs.mjs.map} +1 -1
- package/dist/{migrate-CXsMaHbb.cjs → migrate-C-hmbjpG.cjs} +3 -3
- package/dist/{migrate-CXsMaHbb.cjs.map → migrate-C-hmbjpG.cjs.map} +1 -1
- package/dist/{migrate-Bkz8BGaZ.mjs → migrate-CnbvrVag.mjs} +4 -4
- package/dist/{migrate-Bkz8BGaZ.mjs.map → migrate-CnbvrVag.mjs.map} +1 -1
- package/dist/{migrate-dbAI2XF8.cjs → migrate-DeQJBexh.cjs} +4 -4
- package/dist/{migrate-dbAI2XF8.cjs.map → migrate-DeQJBexh.cjs.map} +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{publish-eUcWvSdP.mjs → publish-BISBrrqR.mjs} +2 -2
- package/dist/{publish-eUcWvSdP.mjs.map → publish-BISBrrqR.mjs.map} +1 -1
- package/dist/{publish-Bbd-2PI2.cjs → publish-DtSIB-hZ.cjs} +2 -2
- package/dist/{publish-Bbd-2PI2.cjs.map → publish-DtSIB-hZ.cjs.map} +1 -1
- package/dist/{ready-BOfogqzr.mjs → ready-DqsyadOs.mjs} +6 -6
- package/dist/{ready-BOfogqzr.mjs.map → ready-DqsyadOs.mjs.map} +1 -1
- package/dist/{ready-BFFP838V.cjs → ready-IVGu-q18.cjs} +6 -6
- package/dist/{ready-BFFP838V.cjs.map → ready-IVGu-q18.cjs.map} +1 -1
- package/dist/reconcile/public.cjs +2 -2
- package/dist/reconcile/public.d.cts +1 -2
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +1 -2
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +2 -2
- package/dist/{resolve-DSilYpzm.mjs → resolve-BT7fkPN5.mjs} +4 -4
- package/dist/{resolve-DSilYpzm.mjs.map → resolve-BT7fkPN5.mjs.map} +1 -1
- package/dist/{resolve-CyprRcQo.cjs → resolve-C7GKQcE4.cjs} +4 -4
- package/dist/{resolve-CyprRcQo.cjs.map → resolve-C7GKQcE4.cjs.map} +1 -1
- package/dist/{rollback-DfwsnwGO.cjs → rollback-BEiB-Pje.cjs} +7 -7
- package/dist/{rollback-DfwsnwGO.cjs.map → rollback-BEiB-Pje.cjs.map} +1 -1
- package/dist/{rollback-C4ri3h7i.mjs → rollback-DbP0KuDw.mjs} +7 -7
- package/dist/{rollback-C4ri3h7i.mjs.map → rollback-DbP0KuDw.mjs.map} +1 -1
- package/dist/{runtime-ACdfK59n.d.cts → runtime-BFJQNqwd.d.mts} +2 -2
- package/dist/{runtime-ACdfK59n.d.cts.map → runtime-BFJQNqwd.d.mts.map} +1 -1
- package/dist/{runtime-YyQuekxi.d.mts → runtime-BJO-FFef.d.cts} +2 -2
- package/dist/{runtime-YyQuekxi.d.mts.map → runtime-BJO-FFef.d.cts.map} +1 -1
- package/dist/{s3-DQXZdmCM.mjs → s3-B4FTQQkV.mjs} +2 -2
- package/dist/{s3-DQXZdmCM.mjs.map → s3-B4FTQQkV.mjs.map} +1 -1
- package/dist/{s3-CrPoA89T.cjs → s3-DwKLXwUT.cjs} +2 -2
- package/dist/{s3-CrPoA89T.cjs.map → s3-DwKLXwUT.cjs.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +2 -2
- package/dist/sandbox/credentials-worker.mjs +2 -2
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{seeds-CFG-f24B.cjs → seeds-DOfxmDRO.cjs} +362 -34
- package/dist/seeds-DOfxmDRO.cjs.map +1 -0
- package/dist/{seeds-oY0qDqui.mjs → seeds-rG-Evfz9.mjs} +341 -31
- package/dist/seeds-rG-Evfz9.mjs.map +1 -0
- package/dist/{serverSetup-CQZt0OT6.cjs → serverSetup-CWWVcU6Y.cjs} +6 -6
- package/dist/{serverSetup-CQZt0OT6.cjs.map → serverSetup-CWWVcU6Y.cjs.map} +1 -1
- package/dist/{serverSetup-D8nngcNL.mjs → serverSetup-xGw1fxuZ.mjs} +6 -6
- package/dist/{serverSetup-D8nngcNL.mjs.map → serverSetup-xGw1fxuZ.mjs.map} +1 -1
- package/dist/{sniffer-BAmtXzou.cjs → sniffer-C7O9Pna_.cjs} +9 -9
- package/dist/{sniffer-BAmtXzou.cjs.map → sniffer-C7O9Pna_.cjs.map} +1 -1
- package/dist/{sniffer-Cgx608Tl.mjs → sniffer-DVPgfyHr.mjs} +9 -9
- package/dist/{sniffer-Cgx608Tl.mjs.map → sniffer-DVPgfyHr.mjs.map} +1 -1
- package/dist/{dns-CfEZHt7r.cjs → snsSubscriptions-CSkteK2J.cjs} +520 -3
- package/dist/snsSubscriptions-CSkteK2J.cjs.map +1 -0
- package/dist/{dns-BgxvvcQa.mjs → snsSubscriptions-CvBIGGp0.mjs} +431 -6
- package/dist/snsSubscriptions-CvBIGGp0.mjs.map +1 -0
- package/dist/{sst-C1pxbFEd.mjs → sst-CTqZZl1_.mjs} +3 -4
- package/dist/{sst-C1pxbFEd.mjs.map → sst-CTqZZl1_.mjs.map} +1 -1
- package/dist/{sst-B-Uz4cvm.cjs → sst-lEkBwzGc.cjs} +4 -5
- package/dist/{sst-B-Uz4cvm.cjs.map → sst-lEkBwzGc.cjs.map} +1 -1
- package/dist/{stage-BKDdQm65.mjs → stage-2EKpzPQ1.mjs} +6 -6
- package/dist/{stage-BKDdQm65.mjs.map → stage-2EKpzPQ1.mjs.map} +1 -1
- package/dist/{stage-CJysBXWB.cjs → stage-fRfFtLwj.cjs} +7 -7
- package/dist/{stage-CJysBXWB.cjs.map → stage-fRfFtLwj.cjs.map} +1 -1
- package/dist/{stages-D4SnG5yl.cjs → stages-B7mCWI_R.cjs} +2 -2
- package/dist/{stages-D4SnG5yl.cjs.map → stages-B7mCWI_R.cjs.map} +1 -1
- package/dist/{stages-Cb9rqRbN.mjs → stages-DSltTW2d.mjs} +2 -2
- package/dist/{stages-Cb9rqRbN.mjs.map → stages-DSltTW2d.mjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-CW_dWeTe.mjs → terminal-BAVrDhhN.mjs} +3 -3
- package/dist/{terminal-CW_dWeTe.mjs.map → terminal-BAVrDhhN.mjs.map} +1 -1
- package/dist/{terminal-DJlqcW_U.cjs → terminal-D1aeTkgv.cjs} +3 -3
- package/dist/{terminal-DJlqcW_U.cjs.map → terminal-D1aeTkgv.cjs.map} +1 -1
- package/dist/{types-HqVPddRK.d.mts → types-CFU2uvrz.d.cts} +263 -4
- package/dist/types-CFU2uvrz.d.cts.map +1 -0
- package/dist/{types-B6UXlEkf.d.cts → types-D3BeGucy.d.mts} +262 -5
- package/dist/types-D3BeGucy.d.mts.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-BwqQnool.cjs → workspace-C82GLPnf.cjs} +8 -2
- package/dist/workspace-C82GLPnf.cjs.map +1 -0
- package/dist/{workspace-D1QbNd55.mjs → workspace-DUnnVjqC.mjs} +8 -2
- package/dist/workspace-DUnnVjqC.mjs.map +1 -0
- package/package.json +17 -16
- package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +0 -1
- package/dist/SubscriberGenerator-y3pncae_.mjs.map +0 -1
- package/dist/compose-CgBPA44v.mjs.map +0 -1
- package/dist/compose-bKLAtHLj.cjs.map +0 -1
- package/dist/config-D48erO2j.d.mts.map +0 -1
- package/dist/config-DHDtsQrB.d.cts.map +0 -1
- package/dist/credentials-B5N5yKk6.mjs.map +0 -1
- package/dist/credentials-Zqr3QQYB.cjs.map +0 -1
- package/dist/deploy-CI85F6dr.cjs.map +0 -1
- package/dist/deploy-Ddy8UBoE.mjs.map +0 -1
- package/dist/discover-C5roJuc9.mjs.map +0 -1
- package/dist/discover-CSW_BMWa.d.cts +0 -125
- package/dist/discover-CSW_BMWa.d.cts.map +0 -1
- package/dist/discover-DozUKs8f.cjs.map +0 -1
- package/dist/discover-xtT7fgWg.d.mts +0 -125
- package/dist/discover-xtT7fgWg.d.mts.map +0 -1
- package/dist/dns-BgxvvcQa.mjs.map +0 -1
- package/dist/dns-CfEZHt7r.cjs.map +0 -1
- package/dist/emit-C1e8qD08.mjs.map +0 -1
- package/dist/emit-Dmc1nvdS.cjs.map +0 -1
- package/dist/github-CO8W9SDs.cjs.map +0 -1
- package/dist/github-CQt3xc3o.mjs.map +0 -1
- package/dist/run-BJLIerMM.mjs +0 -133
- package/dist/run-BJLIerMM.mjs.map +0 -1
- package/dist/run-fVZ-rLnc.cjs +0 -174
- package/dist/run-fVZ-rLnc.cjs.map +0 -1
- package/dist/sandbox-C4g1eG31.d.mts +0 -104
- package/dist/sandbox-C4g1eG31.d.mts.map +0 -1
- package/dist/sandbox-CdKgQ3XU.d.cts +0 -104
- package/dist/sandbox-CdKgQ3XU.d.cts.map +0 -1
- package/dist/seeds-CFG-f24B.cjs.map +0 -1
- package/dist/seeds-oY0qDqui.mjs.map +0 -1
- package/dist/types-B6UXlEkf.d.cts.map +0 -1
- package/dist/types-HqVPddRK.d.mts.map +0 -1
- package/dist/workspace-BwqQnool.cjs.map +0 -1
- package/dist/workspace-D1QbNd55.mjs.map +0 -1
package/dist/run-BJLIerMM.mjs
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { join, resolve } from "node:path";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { spawn } from "node:child_process";
|
|
4
|
-
//#region src/home.ts
|
|
5
|
-
/**
|
|
6
|
-
* Where the CLI keeps what belongs to a person rather than a project: stage
|
|
7
|
-
* keys and stored provider credentials.
|
|
8
|
-
*
|
|
9
|
-
* `GKM_HOME` names it, so a CI job, a shared build runner or a test can give
|
|
10
|
-
* every run its own instead of reaching into whoever's home directory the
|
|
11
|
-
* process happens to have. Unset, it is `~/.gkm`, where it has always been.
|
|
12
|
-
*/
|
|
13
|
-
/** The environment variable that moves the CLI's home. */
|
|
14
|
-
const GKM_HOME_ENV = "GKM_HOME";
|
|
15
|
-
/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
|
|
16
|
-
function gkmHome(env = process.env) {
|
|
17
|
-
const configured = env[GKM_HOME_ENV];
|
|
18
|
-
return configured ? resolve(configured) : join(homedir(), ".gkm");
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/run.ts
|
|
22
|
-
/**
|
|
23
|
-
* Start a program with an argument array, never a shell string.
|
|
24
|
-
*
|
|
25
|
-
* `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the
|
|
26
|
-
* workspace — image refs, tags, build args, package names — to `docker` and
|
|
27
|
-
* `turbo`. Joined into a string and handed to a shell, a package named
|
|
28
|
-
* `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which
|
|
29
|
-
* matters most where the CLI builds a repository it didn't write: a CI job for a
|
|
30
|
-
* fork, a shared build runner. Here every value reaches the program as one
|
|
31
|
-
* `argv` element, whatever it contains.
|
|
32
|
-
*/
|
|
33
|
-
/** Long enough for a cold image build; short enough that a hung one ends. */
|
|
34
|
-
const DEFAULT_TIMEOUT_MS = 18e5;
|
|
35
|
-
/** How long a timed-out child has to exit on SIGTERM before it is killed. */
|
|
36
|
-
const KILL_GRACE_MS = 5e3;
|
|
37
|
-
/** The command line as a person would read it — for messages, never to run. */
|
|
38
|
-
function display(command, args) {
|
|
39
|
-
return [command, ...args].join(" ");
|
|
40
|
-
}
|
|
41
|
-
/** The program ran and exited unsuccessfully; its own output said why. */
|
|
42
|
-
var CommandFailed = class extends Error {
|
|
43
|
-
command;
|
|
44
|
-
args;
|
|
45
|
-
exitCode;
|
|
46
|
-
signal;
|
|
47
|
-
constructor(command, args, exitCode, signal) {
|
|
48
|
-
super(`\`${display(command, args)}\` ${exitCode === null ? `was stopped by ${signal ?? "a signal"}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`);
|
|
49
|
-
this.command = command;
|
|
50
|
-
this.args = args;
|
|
51
|
-
this.exitCode = exitCode;
|
|
52
|
-
this.signal = signal;
|
|
53
|
-
this.name = "CommandFailed";
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
/** The program ran past its timeout and was killed. */
|
|
57
|
-
var CommandTimedOut = class extends Error {
|
|
58
|
-
command;
|
|
59
|
-
args;
|
|
60
|
-
timeoutMs;
|
|
61
|
-
constructor(command, args, timeoutMs) {
|
|
62
|
-
super(`\`${display(command, args)}\` was still running after ${Math.round(timeoutMs / 1e3)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`);
|
|
63
|
-
this.command = command;
|
|
64
|
-
this.args = args;
|
|
65
|
-
this.timeoutMs = timeoutMs;
|
|
66
|
-
this.name = "CommandTimedOut";
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Run `command` with `args`, resolving when it exits 0.
|
|
71
|
-
*
|
|
72
|
-
* Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}
|
|
73
|
-
* once `timeoutMs` passes (after the child is gone), and with the spawn error
|
|
74
|
-
* itself when the program cannot be started at all — `ENOENT` already names it.
|
|
75
|
-
*/
|
|
76
|
-
async function run(command, args, options = {}) {
|
|
77
|
-
await spawnChild(command, args, options, false);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* {@link run}, resolving with what the program wrote to stdout — for a value
|
|
81
|
-
* the CLI reads back, such as the digest `docker inspect` reports. stderr still
|
|
82
|
-
* reaches the terminal, so a failure explains itself the same way.
|
|
83
|
-
*/
|
|
84
|
-
function runOutput(command, args, options = {}) {
|
|
85
|
-
return spawnChild(command, args, options, true);
|
|
86
|
-
}
|
|
87
|
-
function spawnChild(command, args, options, capture) {
|
|
88
|
-
const { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;
|
|
89
|
-
return new Promise((resolve, reject) => {
|
|
90
|
-
const child = spawn(command, [...args], {
|
|
91
|
-
stdio: "inherit",
|
|
92
|
-
...spawnOptions,
|
|
93
|
-
...capture ? { stdio: [
|
|
94
|
-
"ignore",
|
|
95
|
-
"pipe",
|
|
96
|
-
"inherit"
|
|
97
|
-
] } : {},
|
|
98
|
-
shell: false
|
|
99
|
-
});
|
|
100
|
-
let stdout = "";
|
|
101
|
-
child.stdout?.on("data", (chunk) => {
|
|
102
|
-
stdout += chunk.toString();
|
|
103
|
-
});
|
|
104
|
-
let timedOut = false;
|
|
105
|
-
let killer;
|
|
106
|
-
const timer = setTimeout(() => {
|
|
107
|
-
timedOut = true;
|
|
108
|
-
child.kill("SIGTERM");
|
|
109
|
-
killer = setTimeout(() => child.kill("SIGKILL"), KILL_GRACE_MS);
|
|
110
|
-
killer.unref?.();
|
|
111
|
-
}, timeoutMs);
|
|
112
|
-
timer.unref?.();
|
|
113
|
-
const settle = () => {
|
|
114
|
-
clearTimeout(timer);
|
|
115
|
-
if (killer) clearTimeout(killer);
|
|
116
|
-
};
|
|
117
|
-
child.on("error", (error) => {
|
|
118
|
-
settle();
|
|
119
|
-
reject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);
|
|
120
|
-
});
|
|
121
|
-
child.on("close", (code, signal) => {
|
|
122
|
-
settle();
|
|
123
|
-
if (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);
|
|
124
|
-
else if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));
|
|
125
|
-
else if (code === 0) resolve(stdout);
|
|
126
|
-
else reject(new CommandFailed(command, args, code, signal));
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
|
-
export { runOutput as a, run as i, CommandTimedOut as n, GKM_HOME_ENV as o, DEFAULT_TIMEOUT_MS as r, gkmHome as s, CommandFailed as t };
|
|
132
|
-
|
|
133
|
-
//# sourceMappingURL=run-BJLIerMM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-BJLIerMM.mjs","names":[],"sources":["../src/home.ts","../src/run.ts"],"sourcesContent":["/**\n * Where the CLI keeps what belongs to a person rather than a project: stage\n * keys and stored provider credentials.\n *\n * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give\n * every run its own instead of reaching into whoever's home directory the\n * process happens to have. Unset, it is `~/.gkm`, where it has always been.\n */\n\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/** The environment variable that moves the CLI's home. */\nexport const GKM_HOME_ENV = 'GKM_HOME';\n\n/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */\nexport function gkmHome(env: NodeJS.ProcessEnv = process.env): string {\n\tconst configured = env[GKM_HOME_ENV];\n\treturn configured ? resolve(configured) : join(homedir(), '.gkm');\n}\n","/**\n * Start a program with an argument array, never a shell string.\n *\n * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the\n * workspace — image refs, tags, build args, package names — to `docker` and\n * `turbo`. Joined into a string and handed to a shell, a package named\n * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which\n * matters most where the CLI builds a repository it didn't write: a CI job for a\n * fork, a shared build runner. Here every value reaches the program as one\n * `argv` element, whatever it contains.\n */\n\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\n/** Long enough for a cold image build; short enough that a hung one ends. */\nexport const DEFAULT_TIMEOUT_MS = 30 * 60_000;\n\n/** How long a timed-out child has to exit on SIGTERM before it is killed. */\nconst KILL_GRACE_MS = 5_000;\n\nexport interface RunOptions {\n\tcwd?: string;\n\tenv?: NodeJS.ProcessEnv;\n\tstdio?: SpawnOptions['stdio'];\n\t/** Kill the child after this long. Defaults to {@link DEFAULT_TIMEOUT_MS}. */\n\ttimeoutMs?: number;\n\t/**\n\t * Kills the child when aborted, and rejects with the signal's reason — the\n\t * same as a stopped deploy's other calls.\n\t */\n\tsignal?: AbortSignal;\n}\n\n/** The command line as a person would read it — for messages, never to run. */\nfunction display(command: string, args: readonly string[]): string {\n\treturn [command, ...args].join(' ');\n}\n\n/** The program ran and exited unsuccessfully; its own output said why. */\nexport class CommandFailed extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly exitCode: number | null,\n\t\treadonly signal: NodeJS.Signals | null,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` ${exitCode === null ? `was stopped by ${signal ?? 'a signal'}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`,\n\t\t);\n\t\tthis.name = 'CommandFailed';\n\t}\n}\n\n/** The program ran past its timeout and was killed. */\nexport class CommandTimedOut extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly timeoutMs: number,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` was still running after ${Math.round(timeoutMs / 1000)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`,\n\t\t);\n\t\tthis.name = 'CommandTimedOut';\n\t}\n}\n\n/**\n * Run `command` with `args`, resolving when it exits 0.\n *\n * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}\n * once `timeoutMs` passes (after the child is gone), and with the spawn error\n * itself when the program cannot be started at all — `ENOENT` already names it.\n */\nexport async function run(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions = {},\n): Promise<void> {\n\tawait spawnChild(command, args, options, false);\n}\n\n/**\n * {@link run}, resolving with what the program wrote to stdout — for a value\n * the CLI reads back, such as the digest `docker inspect` reports. stderr still\n * reaches the terminal, so a failure explains itself the same way.\n */\nexport function runOutput(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: Omit<RunOptions, 'stdio'> = {},\n): Promise<string> {\n\treturn spawnChild(command, args, options, true);\n}\n\nfunction spawnChild(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions,\n\tcapture: boolean,\n): Promise<string> {\n\tconst { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;\n\n\treturn new Promise<string>((resolve, reject) => {\n\t\tconst child = spawn(command, [...args], {\n\t\t\tstdio: 'inherit',\n\t\t\t...spawnOptions,\n\t\t\t...(capture ? { stdio: ['ignore', 'pipe', 'inherit'] } : {}),\n\t\t\tshell: false,\n\t\t});\n\n\t\tlet stdout = '';\n\t\tchild.stdout?.on('data', (chunk: Buffer) => {\n\t\t\tstdout += chunk.toString();\n\t\t});\n\n\t\tlet timedOut = false;\n\t\tlet killer: NodeJS.Timeout | undefined;\n\t\tconst timer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tchild.kill('SIGTERM');\n\t\t\t// A child that ignores SIGTERM would hold the deploy open forever.\n\t\t\tkiller = setTimeout(() => child.kill('SIGKILL'), KILL_GRACE_MS);\n\t\t\tkiller.unref?.();\n\t\t}, timeoutMs);\n\t\ttimer.unref?.();\n\n\t\tconst settle = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tif (killer) clearTimeout(killer);\n\t\t};\n\n\t\tchild.on('error', (error) => {\n\t\t\tsettle();\n\t\t\t// Node reports an abort as its own `AbortError`; the caller asked\n\t\t\t// with a reason, and that is what it should get back.\n\t\t\treject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);\n\t\t});\n\n\t\tchild.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n\t\t\tsettle();\n\t\t\tif (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);\n\t\t\telse if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));\n\t\t\telse if (code === 0) resolve(stdout);\n\t\t\telse reject(new CommandFailed(command, args, code, signal));\n\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,eAAe;;AAG5B,SAAgB,QAAQ,MAAyB,QAAQ,KAAa;CACrE,MAAM,aAAa,IAAI;CACvB,OAAO,aAAa,QAAQ,UAAU,IAAI,KAAK,QAAQ,GAAG,MAAM;AACjE;;;;;;;;;;;;;;;ACJA,MAAa,qBAAqB;;AAGlC,MAAM,gBAAgB;;AAgBtB,SAAS,QAAQ,SAAiB,MAAiC;CAClE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,GAAG;AACnC;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CAE9B;CACA;CACA;CACA;CAJV,YACC,SACA,MACA,UACA,QACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,KAAK,aAAa,OAAO,kBAAkB,UAAU,eAAe,oBAAoB,WAAW,6DAChI;EAPS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,WAAA;EACA,KAAA,SAAA;EAKT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,kBAAb,cAAqC,MAAM;CAEhC;CACA;CACA;CAHV,YACC,SACA,MACA,WACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,6BAA6B,KAAK,MAAM,YAAY,GAAI,EAAE,8GACvF;EANS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,YAAA;EAKT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,eAAsB,IACrB,SACA,MACA,UAAsB,CAAC,GACP;CAChB,MAAM,WAAW,SAAS,MAAM,SAAS,KAAK;AAC/C;;;;;;AAOA,SAAgB,UACf,SACA,MACA,UAAqC,CAAC,GACpB;CAClB,OAAO,WAAW,SAAS,MAAM,SAAS,IAAI;AAC/C;AAEA,SAAS,WACR,SACA,MACA,SACA,SACkB;CAClB,MAAM,EAAE,YAAY,oBAAoB,GAAG,iBAAiB;CAE5D,OAAO,IAAI,SAAiB,SAAS,WAAW;EAC/C,MAAM,QAAQ,MAAM,SAAS,CAAC,GAAG,IAAI,GAAG;GACvC,OAAO;GACP,GAAG;GACH,GAAI,UAAU,EAAE,OAAO;IAAC;IAAU;IAAQ;GAAS,EAAE,IAAI,CAAC;GAC1D,OAAO;EACR,CAAC;EAED,IAAI,SAAS;EACb,MAAM,QAAQ,GAAG,SAAS,UAAkB;GAC3C,UAAU,MAAM,SAAS;EAC1B,CAAC;EAED,IAAI,WAAW;EACf,IAAI;EACJ,MAAM,QAAQ,iBAAiB;GAC9B,WAAW;GACX,MAAM,KAAK,SAAS;GAEpB,SAAS,iBAAiB,MAAM,KAAK,SAAS,GAAG,aAAa;GAC9D,OAAO,QAAQ;EAChB,GAAG,SAAS;EACZ,MAAM,QAAQ;EAEd,MAAM,eAAe;GACpB,aAAa,KAAK;GAClB,IAAI,QAAQ,aAAa,MAAM;EAChC;EAEA,MAAM,GAAG,UAAU,UAAU;GAC5B,OAAO;GAGP,OAAO,aAAa,QAAQ,UAAU,aAAa,OAAO,SAAS,KAAK;EACzE,CAAC;EAED,MAAM,GAAG,UAAU,MAAqB,WAAkC;GACzE,OAAO;GACP,IAAI,aAAa,QAAQ,SAAS,OAAO,aAAa,OAAO,MAAM;QAC9D,IAAI,UAAU,OAAO,IAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;QAClE,IAAI,SAAS,GAAG,QAAQ,MAAM;QAC9B,OAAO,IAAI,cAAc,SAAS,MAAM,MAAM,MAAM,CAAC;EAC3D,CAAC;CACF,CAAC;AACF"}
|
package/dist/run-fVZ-rLnc.cjs
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
let node_path = require("node:path");
|
|
2
|
-
let node_os = require("node:os");
|
|
3
|
-
let node_child_process = require("node:child_process");
|
|
4
|
-
//#region src/home.ts
|
|
5
|
-
/**
|
|
6
|
-
* Where the CLI keeps what belongs to a person rather than a project: stage
|
|
7
|
-
* keys and stored provider credentials.
|
|
8
|
-
*
|
|
9
|
-
* `GKM_HOME` names it, so a CI job, a shared build runner or a test can give
|
|
10
|
-
* every run its own instead of reaching into whoever's home directory the
|
|
11
|
-
* process happens to have. Unset, it is `~/.gkm`, where it has always been.
|
|
12
|
-
*/
|
|
13
|
-
/** The environment variable that moves the CLI's home. */
|
|
14
|
-
const GKM_HOME_ENV = "GKM_HOME";
|
|
15
|
-
/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
|
|
16
|
-
function gkmHome(env = process.env) {
|
|
17
|
-
const configured = env[GKM_HOME_ENV];
|
|
18
|
-
return configured ? (0, node_path.resolve)(configured) : (0, node_path.join)((0, node_os.homedir)(), ".gkm");
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/run.ts
|
|
22
|
-
/**
|
|
23
|
-
* Start a program with an argument array, never a shell string.
|
|
24
|
-
*
|
|
25
|
-
* `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the
|
|
26
|
-
* workspace — image refs, tags, build args, package names — to `docker` and
|
|
27
|
-
* `turbo`. Joined into a string and handed to a shell, a package named
|
|
28
|
-
* `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which
|
|
29
|
-
* matters most where the CLI builds a repository it didn't write: a CI job for a
|
|
30
|
-
* fork, a shared build runner. Here every value reaches the program as one
|
|
31
|
-
* `argv` element, whatever it contains.
|
|
32
|
-
*/
|
|
33
|
-
/** Long enough for a cold image build; short enough that a hung one ends. */
|
|
34
|
-
const DEFAULT_TIMEOUT_MS = 18e5;
|
|
35
|
-
/** How long a timed-out child has to exit on SIGTERM before it is killed. */
|
|
36
|
-
const KILL_GRACE_MS = 5e3;
|
|
37
|
-
/** The command line as a person would read it — for messages, never to run. */
|
|
38
|
-
function display(command, args) {
|
|
39
|
-
return [command, ...args].join(" ");
|
|
40
|
-
}
|
|
41
|
-
/** The program ran and exited unsuccessfully; its own output said why. */
|
|
42
|
-
var CommandFailed = class extends Error {
|
|
43
|
-
command;
|
|
44
|
-
args;
|
|
45
|
-
exitCode;
|
|
46
|
-
signal;
|
|
47
|
-
constructor(command, args, exitCode, signal) {
|
|
48
|
-
super(`\`${display(command, args)}\` ${exitCode === null ? `was stopped by ${signal ?? "a signal"}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`);
|
|
49
|
-
this.command = command;
|
|
50
|
-
this.args = args;
|
|
51
|
-
this.exitCode = exitCode;
|
|
52
|
-
this.signal = signal;
|
|
53
|
-
this.name = "CommandFailed";
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
/** The program ran past its timeout and was killed. */
|
|
57
|
-
var CommandTimedOut = class extends Error {
|
|
58
|
-
command;
|
|
59
|
-
args;
|
|
60
|
-
timeoutMs;
|
|
61
|
-
constructor(command, args, timeoutMs) {
|
|
62
|
-
super(`\`${display(command, args)}\` was still running after ${Math.round(timeoutMs / 1e3)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`);
|
|
63
|
-
this.command = command;
|
|
64
|
-
this.args = args;
|
|
65
|
-
this.timeoutMs = timeoutMs;
|
|
66
|
-
this.name = "CommandTimedOut";
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Run `command` with `args`, resolving when it exits 0.
|
|
71
|
-
*
|
|
72
|
-
* Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}
|
|
73
|
-
* once `timeoutMs` passes (after the child is gone), and with the spawn error
|
|
74
|
-
* itself when the program cannot be started at all — `ENOENT` already names it.
|
|
75
|
-
*/
|
|
76
|
-
async function run(command, args, options = {}) {
|
|
77
|
-
await spawnChild(command, args, options, false);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* {@link run}, resolving with what the program wrote to stdout — for a value
|
|
81
|
-
* the CLI reads back, such as the digest `docker inspect` reports. stderr still
|
|
82
|
-
* reaches the terminal, so a failure explains itself the same way.
|
|
83
|
-
*/
|
|
84
|
-
function runOutput(command, args, options = {}) {
|
|
85
|
-
return spawnChild(command, args, options, true);
|
|
86
|
-
}
|
|
87
|
-
function spawnChild(command, args, options, capture) {
|
|
88
|
-
const { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;
|
|
89
|
-
return new Promise((resolve, reject) => {
|
|
90
|
-
const child = (0, node_child_process.spawn)(command, [...args], {
|
|
91
|
-
stdio: "inherit",
|
|
92
|
-
...spawnOptions,
|
|
93
|
-
...capture ? { stdio: [
|
|
94
|
-
"ignore",
|
|
95
|
-
"pipe",
|
|
96
|
-
"inherit"
|
|
97
|
-
] } : {},
|
|
98
|
-
shell: false
|
|
99
|
-
});
|
|
100
|
-
let stdout = "";
|
|
101
|
-
child.stdout?.on("data", (chunk) => {
|
|
102
|
-
stdout += chunk.toString();
|
|
103
|
-
});
|
|
104
|
-
let timedOut = false;
|
|
105
|
-
let killer;
|
|
106
|
-
const timer = setTimeout(() => {
|
|
107
|
-
timedOut = true;
|
|
108
|
-
child.kill("SIGTERM");
|
|
109
|
-
killer = setTimeout(() => child.kill("SIGKILL"), KILL_GRACE_MS);
|
|
110
|
-
killer.unref?.();
|
|
111
|
-
}, timeoutMs);
|
|
112
|
-
timer.unref?.();
|
|
113
|
-
const settle = () => {
|
|
114
|
-
clearTimeout(timer);
|
|
115
|
-
if (killer) clearTimeout(killer);
|
|
116
|
-
};
|
|
117
|
-
child.on("error", (error) => {
|
|
118
|
-
settle();
|
|
119
|
-
reject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);
|
|
120
|
-
});
|
|
121
|
-
child.on("close", (code, signal) => {
|
|
122
|
-
settle();
|
|
123
|
-
if (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);
|
|
124
|
-
else if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));
|
|
125
|
-
else if (code === 0) resolve(stdout);
|
|
126
|
-
else reject(new CommandFailed(command, args, code, signal));
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
|
-
Object.defineProperty(exports, "CommandFailed", {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
get: function() {
|
|
134
|
-
return CommandFailed;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(exports, "CommandTimedOut", {
|
|
138
|
-
enumerable: true,
|
|
139
|
-
get: function() {
|
|
140
|
-
return CommandTimedOut;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
Object.defineProperty(exports, "DEFAULT_TIMEOUT_MS", {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
get: function() {
|
|
146
|
-
return DEFAULT_TIMEOUT_MS;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
Object.defineProperty(exports, "GKM_HOME_ENV", {
|
|
150
|
-
enumerable: true,
|
|
151
|
-
get: function() {
|
|
152
|
-
return GKM_HOME_ENV;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
Object.defineProperty(exports, "gkmHome", {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
get: function() {
|
|
158
|
-
return gkmHome;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
Object.defineProperty(exports, "run", {
|
|
162
|
-
enumerable: true,
|
|
163
|
-
get: function() {
|
|
164
|
-
return run;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
Object.defineProperty(exports, "runOutput", {
|
|
168
|
-
enumerable: true,
|
|
169
|
-
get: function() {
|
|
170
|
-
return runOutput;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
//# sourceMappingURL=run-fVZ-rLnc.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-fVZ-rLnc.cjs","names":["resolve","join","homedir","spawn"],"sources":["../src/home.ts","../src/run.ts"],"sourcesContent":["/**\n * Where the CLI keeps what belongs to a person rather than a project: stage\n * keys and stored provider credentials.\n *\n * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give\n * every run its own instead of reaching into whoever's home directory the\n * process happens to have. Unset, it is `~/.gkm`, where it has always been.\n */\n\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/** The environment variable that moves the CLI's home. */\nexport const GKM_HOME_ENV = 'GKM_HOME';\n\n/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */\nexport function gkmHome(env: NodeJS.ProcessEnv = process.env): string {\n\tconst configured = env[GKM_HOME_ENV];\n\treturn configured ? resolve(configured) : join(homedir(), '.gkm');\n}\n","/**\n * Start a program with an argument array, never a shell string.\n *\n * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the\n * workspace — image refs, tags, build args, package names — to `docker` and\n * `turbo`. Joined into a string and handed to a shell, a package named\n * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which\n * matters most where the CLI builds a repository it didn't write: a CI job for a\n * fork, a shared build runner. Here every value reaches the program as one\n * `argv` element, whatever it contains.\n */\n\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\n/** Long enough for a cold image build; short enough that a hung one ends. */\nexport const DEFAULT_TIMEOUT_MS = 30 * 60_000;\n\n/** How long a timed-out child has to exit on SIGTERM before it is killed. */\nconst KILL_GRACE_MS = 5_000;\n\nexport interface RunOptions {\n\tcwd?: string;\n\tenv?: NodeJS.ProcessEnv;\n\tstdio?: SpawnOptions['stdio'];\n\t/** Kill the child after this long. Defaults to {@link DEFAULT_TIMEOUT_MS}. */\n\ttimeoutMs?: number;\n\t/**\n\t * Kills the child when aborted, and rejects with the signal's reason — the\n\t * same as a stopped deploy's other calls.\n\t */\n\tsignal?: AbortSignal;\n}\n\n/** The command line as a person would read it — for messages, never to run. */\nfunction display(command: string, args: readonly string[]): string {\n\treturn [command, ...args].join(' ');\n}\n\n/** The program ran and exited unsuccessfully; its own output said why. */\nexport class CommandFailed extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly exitCode: number | null,\n\t\treadonly signal: NodeJS.Signals | null,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` ${exitCode === null ? `was stopped by ${signal ?? 'a signal'}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`,\n\t\t);\n\t\tthis.name = 'CommandFailed';\n\t}\n}\n\n/** The program ran past its timeout and was killed. */\nexport class CommandTimedOut extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly timeoutMs: number,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` was still running after ${Math.round(timeoutMs / 1000)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`,\n\t\t);\n\t\tthis.name = 'CommandTimedOut';\n\t}\n}\n\n/**\n * Run `command` with `args`, resolving when it exits 0.\n *\n * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}\n * once `timeoutMs` passes (after the child is gone), and with the spawn error\n * itself when the program cannot be started at all — `ENOENT` already names it.\n */\nexport async function run(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions = {},\n): Promise<void> {\n\tawait spawnChild(command, args, options, false);\n}\n\n/**\n * {@link run}, resolving with what the program wrote to stdout — for a value\n * the CLI reads back, such as the digest `docker inspect` reports. stderr still\n * reaches the terminal, so a failure explains itself the same way.\n */\nexport function runOutput(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: Omit<RunOptions, 'stdio'> = {},\n): Promise<string> {\n\treturn spawnChild(command, args, options, true);\n}\n\nfunction spawnChild(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions,\n\tcapture: boolean,\n): Promise<string> {\n\tconst { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;\n\n\treturn new Promise<string>((resolve, reject) => {\n\t\tconst child = spawn(command, [...args], {\n\t\t\tstdio: 'inherit',\n\t\t\t...spawnOptions,\n\t\t\t...(capture ? { stdio: ['ignore', 'pipe', 'inherit'] } : {}),\n\t\t\tshell: false,\n\t\t});\n\n\t\tlet stdout = '';\n\t\tchild.stdout?.on('data', (chunk: Buffer) => {\n\t\t\tstdout += chunk.toString();\n\t\t});\n\n\t\tlet timedOut = false;\n\t\tlet killer: NodeJS.Timeout | undefined;\n\t\tconst timer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tchild.kill('SIGTERM');\n\t\t\t// A child that ignores SIGTERM would hold the deploy open forever.\n\t\t\tkiller = setTimeout(() => child.kill('SIGKILL'), KILL_GRACE_MS);\n\t\t\tkiller.unref?.();\n\t\t}, timeoutMs);\n\t\ttimer.unref?.();\n\n\t\tconst settle = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tif (killer) clearTimeout(killer);\n\t\t};\n\n\t\tchild.on('error', (error) => {\n\t\t\tsettle();\n\t\t\t// Node reports an abort as its own `AbortError`; the caller asked\n\t\t\t// with a reason, and that is what it should get back.\n\t\t\treject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);\n\t\t});\n\n\t\tchild.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n\t\t\tsettle();\n\t\t\tif (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);\n\t\t\telse if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));\n\t\t\telse if (code === 0) resolve(stdout);\n\t\t\telse reject(new CommandFailed(command, args, code, signal));\n\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,eAAe;;AAG5B,SAAgB,QAAQ,MAAyB,QAAQ,KAAa;CACrE,MAAM,aAAa,IAAI;CACvB,OAAO,cAAA,GAAaA,UAAAA,QAAAA,CAAQ,UAAU,KAAA,GAAIC,UAAAA,KAAAA,EAAAA,GAAKC,QAAAA,QAAAA,CAAQ,GAAG,MAAM;AACjE;;;;;;;;;;;;;;;ACJA,MAAa,qBAAqB;;AAGlC,MAAM,gBAAgB;;AAgBtB,SAAS,QAAQ,SAAiB,MAAiC;CAClE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,GAAG;AACnC;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CAE9B;CACA;CACA;CACA;CAJV,YACC,SACA,MACA,UACA,QACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,KAAK,aAAa,OAAO,kBAAkB,UAAU,eAAe,oBAAoB,WAAW,6DAChI;EAPS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,WAAA;EACA,KAAA,SAAA;EAKT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,kBAAb,cAAqC,MAAM;CAEhC;CACA;CACA;CAHV,YACC,SACA,MACA,WACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,6BAA6B,KAAK,MAAM,YAAY,GAAI,EAAE,8GACvF;EANS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,YAAA;EAKT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,eAAsB,IACrB,SACA,MACA,UAAsB,CAAC,GACP;CAChB,MAAM,WAAW,SAAS,MAAM,SAAS,KAAK;AAC/C;;;;;;AAOA,SAAgB,UACf,SACA,MACA,UAAqC,CAAC,GACpB;CAClB,OAAO,WAAW,SAAS,MAAM,SAAS,IAAI;AAC/C;AAEA,SAAS,WACR,SACA,MACA,SACA,SACkB;CAClB,MAAM,EAAE,YAAY,oBAAoB,GAAG,iBAAiB;CAE5D,OAAO,IAAI,SAAiB,SAAS,WAAW;EAC/C,MAAM,SAAA,GAAQC,mBAAAA,MAAAA,CAAM,SAAS,CAAC,GAAG,IAAI,GAAG;GACvC,OAAO;GACP,GAAG;GACH,GAAI,UAAU,EAAE,OAAO;IAAC;IAAU;IAAQ;GAAS,EAAE,IAAI,CAAC;GAC1D,OAAO;EACR,CAAC;EAED,IAAI,SAAS;EACb,MAAM,QAAQ,GAAG,SAAS,UAAkB;GAC3C,UAAU,MAAM,SAAS;EAC1B,CAAC;EAED,IAAI,WAAW;EACf,IAAI;EACJ,MAAM,QAAQ,iBAAiB;GAC9B,WAAW;GACX,MAAM,KAAK,SAAS;GAEpB,SAAS,iBAAiB,MAAM,KAAK,SAAS,GAAG,aAAa;GAC9D,OAAO,QAAQ;EAChB,GAAG,SAAS;EACZ,MAAM,QAAQ;EAEd,MAAM,eAAe;GACpB,aAAa,KAAK;GAClB,IAAI,QAAQ,aAAa,MAAM;EAChC;EAEA,MAAM,GAAG,UAAU,UAAU;GAC5B,OAAO;GAGP,OAAO,aAAa,QAAQ,UAAU,aAAa,OAAO,SAAS,KAAK;EACzE,CAAC;EAED,MAAM,GAAG,UAAU,MAAqB,WAAkC;GACzE,OAAO;GACP,IAAI,aAAa,QAAQ,SAAS,OAAO,aAAa,OAAO,MAAM;QAC9D,IAAI,UAAU,OAAO,IAAI,gBAAgB,SAAS,MAAM,SAAS,CAAC;QAClE,IAAI,SAAS,GAAG,QAAQ,MAAM;QAC9B,OAAO,IAAI,cAAc,SAAS,MAAM,MAAM,MAAM,CAAC;EAC3D,CAAC;CACF,CAAC;AACF"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jt as GkmError } from "./types-HqVPddRK.mjs";
|
|
2
|
-
//#region src/sandbox/sandbox.d.ts
|
|
3
|
-
/** Where a command's output goes. */
|
|
4
|
-
type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
|
|
5
|
-
interface SandboxExecOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Where the command runs: the project root or a directory below it, as an
|
|
8
|
-
* absolute path or relative to the root. Anywhere else is refused with
|
|
9
|
-
* {@link SandboxCwdEscape}.
|
|
10
|
-
*/
|
|
11
|
-
cwd: string;
|
|
12
|
-
/**
|
|
13
|
-
* The command's whole environment. Nothing of the host's is added to it:
|
|
14
|
-
* start from {@link Sandbox.env} and add what the step needs.
|
|
15
|
-
*/
|
|
16
|
-
env: Readonly<Record<string, string>>;
|
|
17
|
-
/**
|
|
18
|
-
* How long the command may run before it is killed. Required: a step that
|
|
19
|
-
* waits forever — a sniffed entry that opens a server, a build stuck on a
|
|
20
|
-
* prompt — would otherwise hold the deploy, and its lock, forever.
|
|
21
|
-
*/
|
|
22
|
-
timeoutMs: number;
|
|
23
|
-
/**
|
|
24
|
-
* Files the command can read, by name. Mounted in a directory of their own
|
|
25
|
-
* — named by `GKM_SECRETS_DIR` in the command's environment — and removed
|
|
26
|
-
* when it exits. Never set as variables, which every child inherits, a
|
|
27
|
-
* crash report prints and `/proc/<pid>/environ` shows.
|
|
28
|
-
*/
|
|
29
|
-
secrets?: Readonly<Record<string, string>>;
|
|
30
|
-
/**
|
|
31
|
-
* `capture` (the default) returns stdout and stderr in the result;
|
|
32
|
-
* `inherit` gives the command the host's terminal; `stderr` sends both
|
|
33
|
-
* streams to the host's stderr; `ignore` discards them.
|
|
34
|
-
*/
|
|
35
|
-
output?: SandboxOutput;
|
|
36
|
-
/** Kills the command when aborted; `exec` rejects with the signal's reason. */
|
|
37
|
-
signal?: AbortSignal;
|
|
38
|
-
}
|
|
39
|
-
/** How a command ended. A non-zero exit is a result, not an error. */
|
|
40
|
-
interface SandboxResult {
|
|
41
|
-
exitCode: number | null;
|
|
42
|
-
signal: string | null;
|
|
43
|
-
/** What it wrote to stdout, when its output was captured. */
|
|
44
|
-
stdout: string;
|
|
45
|
-
/** What it wrote to stderr, when its output was captured. */
|
|
46
|
-
stderr: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Runs a command against the project, and nothing else of the host's.
|
|
50
|
-
*
|
|
51
|
-
* `exec` resolves with the result however the command exited. It rejects
|
|
52
|
-
* with {@link CommandTimedOut} once the timeout passes — after the command is
|
|
53
|
-
* gone — with {@link SandboxCwdEscape} for a directory outside the project,
|
|
54
|
-
* with the signal's reason when aborted, and with the spawn error when the
|
|
55
|
-
* program cannot be started.
|
|
56
|
-
*/
|
|
57
|
-
interface Sandbox {
|
|
58
|
-
/** The project: the directory every command runs at or below. */
|
|
59
|
-
readonly root: string;
|
|
60
|
-
/**
|
|
61
|
-
* Whether the code it runs is kept from the host: its files, its
|
|
62
|
-
* processes, its memory.
|
|
63
|
-
*
|
|
64
|
-
* An isolating sandbox shares nothing but what crosses `exec`, so a config
|
|
65
|
-
* reaches the deploy as data — a live object in it (a custom state store,
|
|
66
|
-
* an inline target) cannot cross, and is refused with
|
|
67
|
-
* `ConfigObjectNotSerializable`. A non-isolating one, like
|
|
68
|
-
* {@link LocalSandbox}, runs on the host as the host's user; a project
|
|
69
|
-
* whose config holds live objects is then loaded in-process as before,
|
|
70
|
-
* because a project trusted to run there is trusted to do that.
|
|
71
|
-
*/
|
|
72
|
-
readonly isolating: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* The environment a command starts from: what any program needs to run
|
|
75
|
-
* here — `PATH`, `HOME`, the locale — and no credential.
|
|
76
|
-
*/
|
|
77
|
-
readonly env: Readonly<Record<string, string>>;
|
|
78
|
-
exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
|
|
79
|
-
}
|
|
80
|
-
/** The variable naming the directory a command's secrets are mounted in. */
|
|
81
|
-
declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
|
|
82
|
-
/** A command was asked to run outside the project. */
|
|
83
|
-
declare class SandboxCwdEscape extends GkmError {
|
|
84
|
-
readonly cwd: string;
|
|
85
|
-
readonly root: string;
|
|
86
|
-
constructor(cwd: string, root: string);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
|
|
90
|
-
*
|
|
91
|
-
* Symlinks are resolved on both sides first, so a link inside the project
|
|
92
|
-
* that points out of it is an escape, and a project reached through a link
|
|
93
|
-
* (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
|
|
94
|
-
* before it runs anything.
|
|
95
|
-
*/
|
|
96
|
-
declare function confineCwd(root: string, cwd: string): string;
|
|
97
|
-
/** A secret's file name: one path segment, so it cannot be written elsewhere. */
|
|
98
|
-
declare class SecretNameInvalid extends GkmError {
|
|
99
|
-
readonly secretName: string;
|
|
100
|
-
constructor(secretName: string);
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { SandboxOutput as a, confineCwd as c, SandboxExecOptions as i, Sandbox as n, SandboxResult as o, SandboxCwdEscape as r, SecretNameInvalid as s, SECRETS_DIR_ENV as t };
|
|
104
|
-
//# sourceMappingURL=sandbox-C4g1eG31.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-C4g1eG31.d.mts","names":[],"sources":["../src/sandbox/sandbox.ts"],"mappings":";;;KA8BY;UAEK;;;;;;EAMhB;;;;;EAKA,KAAK,SAAS;;;;;;EAMd;;;;;;;EAOA,UAAU,SAAS;;;;;;EAMnB,SAAS;;EAET,SAAS;;;UAIO;EAChB;EACA;;EAEA;;EAEA;;;;;;;;;;;UAYgB;;WAEP;;;;;;;;;;;;;WAaA;;;;;WAKA,KAAK,SAAS;EACvB,KACC,iBACA,yBACA,SAAS,qBACP,QAAQ;;;cAIC;;cAGA,yBAAyB;WAE3B;WACA;EAFV,YACU,aACA;;;;;;;;;;iBAwBK,WAAW,cAAc;;cAU5B,0BAA0B;WACjB;EAArB,YAAqB"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jt as GkmError } from "./types-B6UXlEkf.cjs";
|
|
2
|
-
//#region src/sandbox/sandbox.d.ts
|
|
3
|
-
/** Where a command's output goes. */
|
|
4
|
-
type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
|
|
5
|
-
interface SandboxExecOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Where the command runs: the project root or a directory below it, as an
|
|
8
|
-
* absolute path or relative to the root. Anywhere else is refused with
|
|
9
|
-
* {@link SandboxCwdEscape}.
|
|
10
|
-
*/
|
|
11
|
-
cwd: string;
|
|
12
|
-
/**
|
|
13
|
-
* The command's whole environment. Nothing of the host's is added to it:
|
|
14
|
-
* start from {@link Sandbox.env} and add what the step needs.
|
|
15
|
-
*/
|
|
16
|
-
env: Readonly<Record<string, string>>;
|
|
17
|
-
/**
|
|
18
|
-
* How long the command may run before it is killed. Required: a step that
|
|
19
|
-
* waits forever — a sniffed entry that opens a server, a build stuck on a
|
|
20
|
-
* prompt — would otherwise hold the deploy, and its lock, forever.
|
|
21
|
-
*/
|
|
22
|
-
timeoutMs: number;
|
|
23
|
-
/**
|
|
24
|
-
* Files the command can read, by name. Mounted in a directory of their own
|
|
25
|
-
* — named by `GKM_SECRETS_DIR` in the command's environment — and removed
|
|
26
|
-
* when it exits. Never set as variables, which every child inherits, a
|
|
27
|
-
* crash report prints and `/proc/<pid>/environ` shows.
|
|
28
|
-
*/
|
|
29
|
-
secrets?: Readonly<Record<string, string>>;
|
|
30
|
-
/**
|
|
31
|
-
* `capture` (the default) returns stdout and stderr in the result;
|
|
32
|
-
* `inherit` gives the command the host's terminal; `stderr` sends both
|
|
33
|
-
* streams to the host's stderr; `ignore` discards them.
|
|
34
|
-
*/
|
|
35
|
-
output?: SandboxOutput;
|
|
36
|
-
/** Kills the command when aborted; `exec` rejects with the signal's reason. */
|
|
37
|
-
signal?: AbortSignal;
|
|
38
|
-
}
|
|
39
|
-
/** How a command ended. A non-zero exit is a result, not an error. */
|
|
40
|
-
interface SandboxResult {
|
|
41
|
-
exitCode: number | null;
|
|
42
|
-
signal: string | null;
|
|
43
|
-
/** What it wrote to stdout, when its output was captured. */
|
|
44
|
-
stdout: string;
|
|
45
|
-
/** What it wrote to stderr, when its output was captured. */
|
|
46
|
-
stderr: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Runs a command against the project, and nothing else of the host's.
|
|
50
|
-
*
|
|
51
|
-
* `exec` resolves with the result however the command exited. It rejects
|
|
52
|
-
* with {@link CommandTimedOut} once the timeout passes — after the command is
|
|
53
|
-
* gone — with {@link SandboxCwdEscape} for a directory outside the project,
|
|
54
|
-
* with the signal's reason when aborted, and with the spawn error when the
|
|
55
|
-
* program cannot be started.
|
|
56
|
-
*/
|
|
57
|
-
interface Sandbox {
|
|
58
|
-
/** The project: the directory every command runs at or below. */
|
|
59
|
-
readonly root: string;
|
|
60
|
-
/**
|
|
61
|
-
* Whether the code it runs is kept from the host: its files, its
|
|
62
|
-
* processes, its memory.
|
|
63
|
-
*
|
|
64
|
-
* An isolating sandbox shares nothing but what crosses `exec`, so a config
|
|
65
|
-
* reaches the deploy as data — a live object in it (a custom state store,
|
|
66
|
-
* an inline target) cannot cross, and is refused with
|
|
67
|
-
* `ConfigObjectNotSerializable`. A non-isolating one, like
|
|
68
|
-
* {@link LocalSandbox}, runs on the host as the host's user; a project
|
|
69
|
-
* whose config holds live objects is then loaded in-process as before,
|
|
70
|
-
* because a project trusted to run there is trusted to do that.
|
|
71
|
-
*/
|
|
72
|
-
readonly isolating: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* The environment a command starts from: what any program needs to run
|
|
75
|
-
* here — `PATH`, `HOME`, the locale — and no credential.
|
|
76
|
-
*/
|
|
77
|
-
readonly env: Readonly<Record<string, string>>;
|
|
78
|
-
exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
|
|
79
|
-
}
|
|
80
|
-
/** The variable naming the directory a command's secrets are mounted in. */
|
|
81
|
-
declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
|
|
82
|
-
/** A command was asked to run outside the project. */
|
|
83
|
-
declare class SandboxCwdEscape extends GkmError {
|
|
84
|
-
readonly cwd: string;
|
|
85
|
-
readonly root: string;
|
|
86
|
-
constructor(cwd: string, root: string);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
|
|
90
|
-
*
|
|
91
|
-
* Symlinks are resolved on both sides first, so a link inside the project
|
|
92
|
-
* that points out of it is an escape, and a project reached through a link
|
|
93
|
-
* (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
|
|
94
|
-
* before it runs anything.
|
|
95
|
-
*/
|
|
96
|
-
declare function confineCwd(root: string, cwd: string): string;
|
|
97
|
-
/** A secret's file name: one path segment, so it cannot be written elsewhere. */
|
|
98
|
-
declare class SecretNameInvalid extends GkmError {
|
|
99
|
-
readonly secretName: string;
|
|
100
|
-
constructor(secretName: string);
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { SandboxOutput as a, confineCwd as c, SandboxExecOptions as i, Sandbox as n, SandboxResult as o, SandboxCwdEscape as r, SecretNameInvalid as s, SECRETS_DIR_ENV as t };
|
|
104
|
-
//# sourceMappingURL=sandbox-CdKgQ3XU.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-CdKgQ3XU.d.cts","names":[],"sources":["../src/sandbox/sandbox.ts"],"mappings":";;;KA8BY;UAEK;;;;;;EAMhB;;;;;EAKA,KAAK,SAAS;;;;;;EAMd;;;;;;;EAOA,UAAU,SAAS;;;;;;EAMnB,SAAS;;EAET,SAAS;;;UAIO;EAChB;EACA;;EAEA;;EAEA;;;;;;;;;;;UAYgB;;WAEP;;;;;;;;;;;;;WAaA;;;;;WAKA,KAAK,SAAS;EACvB,KACC,iBACA,yBACA,SAAS,qBACP,QAAQ;;;cAIC;;cAGA,yBAAyB;WAE3B;WACA;EAFV,YACU,aACA;;;;;;;;;;iBAwBK,WAAW,cAAc;;cAU5B,0BAA0B;WACjB;EAArB,YAAqB"}
|