@geekmidas/cli 10.0.0-alpha.84 → 10.0.0-alpha.86
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/{HostingerProvider-dxkwynSs.cjs → HostingerProvider-BCB1QJj1.cjs} +2 -2
- package/dist/{HostingerProvider-dxkwynSs.cjs.map → HostingerProvider-BCB1QJj1.cjs.map} +1 -1
- package/dist/{HostingerProvider-D85ayzTi.mjs → HostingerProvider-CVc3rLPB.mjs} +2 -2
- package/dist/{HostingerProvider-D85ayzTi.mjs.map → HostingerProvider-CVc3rLPB.mjs.map} +1 -1
- package/dist/{LegacyStateStore-CTsUFLNQ.mjs → LegacyStateStore-B0R4LlX_.mjs} +2 -2
- package/dist/{LegacyStateStore-CTsUFLNQ.mjs.map → LegacyStateStore-B0R4LlX_.mjs.map} +1 -1
- package/dist/{LegacyStateStore-EDT2TUSe.cjs → LegacyStateStore-CWG_HVC0.cjs} +7 -7
- package/dist/{LegacyStateStore-EDT2TUSe.cjs.map → LegacyStateStore-CWG_HVC0.cjs.map} +1 -1
- package/dist/{LocalStateStore-CdpzTvPn.cjs → LocalStateStore-CLwa2DpK.cjs} +16 -14
- package/dist/LocalStateStore-CLwa2DpK.cjs.map +1 -0
- package/dist/{LocalStateStore-D1VfxRuK.mjs → LocalStateStore-Q4vXg2ua.mjs} +12 -10
- package/dist/LocalStateStore-Q4vXg2ua.mjs.map +1 -0
- package/dist/{S3StateStore-BPM74zwv.cjs → S3StateStore-Cea9_5gF.cjs} +5 -5
- package/dist/{S3StateStore-BPM74zwv.cjs.map → S3StateStore-Cea9_5gF.cjs.map} +1 -1
- package/dist/{S3StateStore-DVZ1YuGJ.mjs → S3StateStore-CksKYKRa.mjs} +2 -2
- package/dist/{S3StateStore-DVZ1YuGJ.mjs.map → S3StateStore-CksKYKRa.mjs.map} +1 -1
- package/dist/{SSMStateStore-DLvnGyyl.mjs → SSMStateStore-BszSCAS2.mjs} +2 -2
- package/dist/{SSMStateStore-DLvnGyyl.mjs.map → SSMStateStore-BszSCAS2.mjs.map} +1 -1
- package/dist/{SSMStateStore-qerm5c36.cjs → SSMStateStore-aBOTF018.cjs} +9 -9
- package/dist/{SSMStateStore-qerm5c36.cjs.map → SSMStateStore-aBOTF018.cjs.map} +1 -1
- package/dist/{add-BQ8v1ZII.cjs → add-5MZAXybv.cjs} +8 -5
- package/dist/add-5MZAXybv.cjs.map +1 -0
- package/dist/{add-DbnzC7Kl.mjs → add-D_jNqnfZ.mjs} +8 -5
- package/dist/add-D_jNqnfZ.mjs.map +1 -0
- package/dist/{bundler-DjrRffko.cjs → bundler-1REMhKps.cjs} +5 -5
- package/dist/{bundler-DjrRffko.cjs.map → bundler-1REMhKps.cjs.map} +1 -1
- package/dist/{bundler-D4030Afw.mjs → bundler-BMo-JP5s.mjs} +5 -5
- package/dist/{bundler-D4030Afw.mjs.map → bundler-BMo-JP5s.mjs.map} +1 -1
- package/dist/{cli-DwTa9d_8.mjs → cli-7edNFwGk.mjs} +5 -13
- package/dist/cli-7edNFwGk.mjs.map +1 -0
- package/dist/{cli-D8YQAYUX.cjs → cli-BL8ZHsLQ.cjs} +5 -13
- package/dist/cli-BL8ZHsLQ.cjs.map +1 -0
- package/dist/{compose-C5wz8mf9.mjs → compose-DbJhRQlh.mjs} +46 -15
- package/dist/compose-DbJhRQlh.mjs.map +1 -0
- package/dist/{compose-DqWh1TaO.cjs → compose-xw86kVYi.cjs} +55 -24
- package/dist/compose-xw86kVYi.cjs.map +1 -0
- package/dist/{config-BzIfP8a-.d.cts → config-CpjsVxru.d.cts} +3 -3
- package/dist/{config-BzIfP8a-.d.cts.map → config-CpjsVxru.d.cts.map} +1 -1
- package/dist/{config-DhdzmndX.d.mts → config-DrCAyoH5.d.mts} +3 -3
- package/dist/{config-DhdzmndX.d.mts.map → config-DrCAyoH5.d.mts.map} +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/{credentials-pAtB70k3.mjs → credentials-BgJ5mS_d.mjs} +91 -181
- package/dist/credentials-BgJ5mS_d.mjs.map +1 -0
- package/dist/{credentials-BVs7mrtw.cjs → credentials-tr26-KML.cjs} +122 -188
- package/dist/credentials-tr26-KML.cjs.map +1 -0
- package/dist/deploy/public.cjs +24 -20
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts +95 -13
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +95 -13
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +11 -10
- package/dist/deploy/public.mjs.map +1 -1
- package/dist/{deploy-BwIKGxWH.mjs → deploy-BTfmXd3g.mjs} +9 -9
- package/dist/deploy-BTfmXd3g.mjs.map +1 -0
- package/dist/{deploy-C8sWg81_.cjs → deploy-CtbZj4zN.cjs} +13 -13
- package/dist/deploy-CtbZj4zN.cjs.map +1 -0
- package/dist/{dokploy-BkRxJbfi.cjs → dokploy-TGk3oPwr.cjs} +2 -2
- package/dist/{dokploy-BkRxJbfi.cjs.map → dokploy-TGk3oPwr.cjs.map} +1 -1
- package/dist/{dokploy-ijjms1-h.mjs → dokploy-r69yZaIt.mjs} +2 -2
- package/dist/{dokploy-ijjms1-h.mjs.map → dokploy-r69yZaIt.mjs.map} +1 -1
- package/dist/{encryption-BRcBAmjL.mjs → encryption-C-8Tt5Hh.mjs} +3 -3
- package/dist/{encryption-BRcBAmjL.mjs.map → encryption-C-8Tt5Hh.mjs.map} +1 -1
- package/dist/{encryption-g6PzwwfL.cjs → encryption-CDn7BH5O.cjs} +3 -3
- package/dist/{encryption-g6PzwwfL.cjs.map → encryption-CDn7BH5O.cjs.map} +1 -1
- package/dist/{engine-DLEJsZ3i.cjs → engine-Bt5k_UMq.cjs} +33 -23
- package/dist/engine-Bt5k_UMq.cjs.map +1 -0
- package/dist/{engine-BP0CZ5fh.mjs → engine-jAINgiOB.mjs} +28 -18
- package/dist/engine-jAINgiOB.mjs.map +1 -0
- package/dist/{github-Zs-dVJbR.mjs → github-CZHAtwPT.mjs} +3 -3
- package/dist/{github-Zs-dVJbR.mjs.map → github-CZHAtwPT.mjs.map} +1 -1
- package/dist/{github-B8YjwdLK.cjs → github-DFhuJQlp.cjs} +3 -3
- package/dist/{github-B8YjwdLK.cjs.map → github-DFhuJQlp.cjs.map} +1 -1
- package/dist/{index-f77HdqN5.d.mts → index-MnUJuUlj.d.mts} +2 -2
- package/dist/{index-D1ODeM9s.d.cts.map → index-MnUJuUlj.d.mts.map} +1 -1
- package/dist/{index-D1ODeM9s.d.cts → index-elsLJTUv.d.cts} +2 -2
- package/dist/{index-f77HdqN5.d.mts.map → index-elsLJTUv.d.cts.map} +1 -1
- package/dist/index.cjs +105 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +99 -61
- package/dist/index.mjs.map +1 -1
- package/dist/local-Ciq-bTPr.mjs +224 -0
- package/dist/local-Ciq-bTPr.mjs.map +1 -0
- package/dist/local-Cq8qdgNX.cjs +241 -0
- package/dist/local-Cq8qdgNX.cjs.map +1 -0
- package/dist/{migrate-FoL_mZIz.cjs → migrate-B16qgYTn.cjs} +3 -3
- package/dist/{migrate-FoL_mZIz.cjs.map → migrate-B16qgYTn.cjs.map} +1 -1
- package/dist/{migrate-BfZN1S32.cjs → migrate-B1rVlwj1.cjs} +3 -3
- package/dist/{migrate-BfZN1S32.cjs.map → migrate-B1rVlwj1.cjs.map} +1 -1
- package/dist/{migrate-DOMU4uKe.mjs → migrate-Dn7nK6sh.mjs} +3 -3
- package/dist/{migrate-DOMU4uKe.mjs.map → migrate-Dn7nK6sh.mjs.map} +1 -1
- package/dist/{migrate-CdXcX0XR.mjs → migrate-ggkPVJRC.mjs} +3 -3
- package/dist/{migrate-CdXcX0XR.mjs.map → migrate-ggkPVJRC.mjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-r7PAs6ng.mjs → resolve-BSke45k6.mjs} +4 -4
- package/dist/{resolve-r7PAs6ng.mjs.map → resolve-BSke45k6.mjs.map} +1 -1
- package/dist/{resolve-T2I-5FcT.cjs → resolve-BXeXzpmU.cjs} +4 -4
- package/dist/{resolve-T2I-5FcT.cjs.map → resolve-BXeXzpmU.cjs.map} +1 -1
- package/dist/{rollback-BSdxnW3X.mjs → rollback-CEE6dse4.mjs} +6 -6
- package/dist/{rollback-BSdxnW3X.mjs.map → rollback-CEE6dse4.mjs.map} +1 -1
- package/dist/{rollback-CPSDjGse.cjs → rollback-DFMiBWf0.cjs} +8 -8
- package/dist/{rollback-CPSDjGse.cjs.map → rollback-DFMiBWf0.cjs.map} +1 -1
- package/dist/{runtime-CNu2C2hB.d.mts → runtime-D48ZKk8_.d.cts} +2 -2
- package/dist/{runtime-CNu2C2hB.d.mts.map → runtime-D48ZKk8_.d.cts.map} +1 -1
- package/dist/{runtime-DMLgL26v.d.cts → runtime-HabiNBtJ.d.mts} +2 -2
- package/dist/{runtime-DMLgL26v.d.cts.map → runtime-HabiNBtJ.d.mts.map} +1 -1
- package/dist/{seeds-BK8caVMm.mjs → seeds-BYdrtZsC.mjs} +1554 -54
- package/dist/seeds-BYdrtZsC.mjs.map +1 -0
- package/dist/{seeds-DQ0FG57Z.cjs → seeds-CsI0A_Ef.cjs} +1656 -65
- package/dist/seeds-CsI0A_Ef.cjs.map +1 -0
- package/dist/{sniffer-CqE_KTTp.mjs → sniffer-B0EU73bj.mjs} +5 -360
- package/dist/sniffer-B0EU73bj.mjs.map +1 -0
- package/dist/{sniffer-hSf5mRgV.cjs → sniffer-DJYupBeK.cjs} +4 -413
- package/dist/sniffer-DJYupBeK.cjs.map +1 -0
- package/dist/{sst-DRi3H5TB.mjs → sst-D1Qj4sIs.mjs} +3 -3
- package/dist/{sst-DRi3H5TB.mjs.map → sst-D1Qj4sIs.mjs.map} +1 -1
- package/dist/{sst-hBrKouBy.cjs → sst-DAqUoZKG.cjs} +5 -5
- package/dist/{sst-hBrKouBy.cjs.map → sst-DAqUoZKG.cjs.map} +1 -1
- package/dist/{stages-CS1sjcRb.cjs → stages-Brn3vcdy.cjs} +2 -2
- package/dist/{stages-CS1sjcRb.cjs.map → stages-Brn3vcdy.cjs.map} +1 -1
- package/dist/{stages-CSXt7N2b.mjs → stages-DoHHz6pS.mjs} +2 -2
- package/dist/{stages-CSXt7N2b.mjs.map → stages-DoHHz6pS.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-BdvrmkaC.mjs → terminal-BTbZlrFV.mjs} +2 -2
- package/dist/{terminal-BdvrmkaC.mjs.map → terminal-BTbZlrFV.mjs.map} +1 -1
- package/dist/{terminal-BL5E0xbR.cjs → terminal-COv23heb.cjs} +2 -2
- package/dist/{terminal-BL5E0xbR.cjs.map → terminal-COv23heb.cjs.map} +1 -1
- package/dist/{types-BZn-8ssD.d.mts → types-0oAyFOfR.d.cts} +48 -49
- package/dist/types-0oAyFOfR.d.cts.map +1 -0
- package/dist/{types-DiZj6hqp.d.cts → types-BZ01tZs-.d.mts} +47 -50
- package/dist/types-BZ01tZs-.d.mts.map +1 -0
- 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-Bic_R3tz.cjs → workspace-CT0JM3Y8.cjs} +333 -1
- package/dist/workspace-CT0JM3Y8.cjs.map +1 -0
- package/dist/{workspace-Drz4jsvy.mjs → workspace-D2CYLMCW.mjs} +250 -2
- package/dist/workspace-D2CYLMCW.mjs.map +1 -0
- package/package.json +15 -15
- package/dist/LocalStateStore-CdpzTvPn.cjs.map +0 -1
- package/dist/LocalStateStore-D1VfxRuK.mjs.map +0 -1
- package/dist/add-BQ8v1ZII.cjs.map +0 -1
- package/dist/add-DbnzC7Kl.mjs.map +0 -1
- package/dist/cli-D8YQAYUX.cjs.map +0 -1
- package/dist/cli-DwTa9d_8.mjs.map +0 -1
- package/dist/compose-C5wz8mf9.mjs.map +0 -1
- package/dist/compose-DqWh1TaO.cjs.map +0 -1
- package/dist/credentials-BVs7mrtw.cjs.map +0 -1
- package/dist/credentials-pAtB70k3.mjs.map +0 -1
- package/dist/deploy-BwIKGxWH.mjs.map +0 -1
- package/dist/deploy-C8sWg81_.cjs.map +0 -1
- package/dist/engine-BP0CZ5fh.mjs.map +0 -1
- package/dist/engine-DLEJsZ3i.cjs.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/seeds-BK8caVMm.mjs.map +0 -1
- package/dist/seeds-DQ0FG57Z.cjs.map +0 -1
- package/dist/sniffer-CqE_KTTp.mjs.map +0 -1
- package/dist/sniffer-hSf5mRgV.cjs.map +0 -1
- package/dist/types-BZn-8ssD.d.mts.map +0 -1
- package/dist/types-DiZj6hqp.d.cts.map +0 -1
- package/dist/workspace-Bic_R3tz.cjs.map +0 -1
- package/dist/workspace-Drz4jsvy.mjs.map +0 -1
package/dist/config.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as WorkspaceConfig, m as DevConfig, r as GkmConfig, v as LoadedConfig } from "./types-
|
|
2
|
-
import { s as defineWorkspace } from "./index-
|
|
3
|
-
import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-
|
|
1
|
+
import { D as WorkspaceConfig, m as DevConfig, r as GkmConfig, v as LoadedConfig } from "./types-0oAyFOfR.cjs";
|
|
2
|
+
import { s as defineWorkspace } from "./index-elsLJTUv.cjs";
|
|
3
|
+
import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-CpjsVxru.cjs";
|
|
4
4
|
export { AppConfigResult, type AppStatus, CONFIG_LOAD_TIMEOUT_MS, ConfigDiscoveryResult, ConfigLoadFailed, ConfigNotFound, ConfigObjectNotSerializable, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, LoadConfigOptions, type LoadedConfig, NotABackendApp, NotInAnApp, ParsedModuleConfig, WorkspaceAppInfo, type WorkspaceConfig, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, findWorkspaceRoot, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as WorkspaceConfig, m as DevConfig, r as GkmConfig, v as LoadedConfig } from "./types-
|
|
2
|
-
import { s as defineWorkspace } from "./index-
|
|
3
|
-
import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-
|
|
1
|
+
import { D as WorkspaceConfig, m as DevConfig, r as GkmConfig, v as LoadedConfig } from "./types-BZ01tZs-.mjs";
|
|
2
|
+
import { s as defineWorkspace } from "./index-MnUJuUlj.mjs";
|
|
3
|
+
import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-DrCAyoH5.mjs";
|
|
4
4
|
export { AppConfigResult, type AppStatus, CONFIG_LOAD_TIMEOUT_MS, ConfigDiscoveryResult, ConfigLoadFailed, ConfigNotFound, ConfigObjectNotSerializable, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, LoadConfigOptions, type LoadedConfig, NotABackendApp, NotInAnApp, ParsedModuleConfig, WorkspaceAppInfo, type WorkspaceConfig, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, findWorkspaceRoot, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { a as discriminatedUnion, d as record, f as string, h as unknown, n as a
|
|
|
2
2
|
import { c as runWorker, d as output, r as discover } from "./discover-BPelzeGW.mjs";
|
|
3
3
|
import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
|
|
4
4
|
import { n as derivedApps } from "./derive-B4vDpzgP.mjs";
|
|
5
|
-
import { f as processConfig, l as getAppGkmConfig, r as allConstructGlobs, s as defineWorkspace, v as isWorkspaceConfig } from "./workspace-
|
|
5
|
+
import { f as processConfig, l as getAppGkmConfig, r as allConstructGlobs, s as defineWorkspace, v as isWorkspaceConfig } from "./workspace-D2CYLMCW.mjs";
|
|
6
6
|
import { dirname, join, parse, resolve, sep } from "node:path";
|
|
7
7
|
import { existsSync, realpathSync } from "node:fs";
|
|
8
8
|
//#region src/config.ts
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
import { n as CommandTimedOut, s as gkmHome } from "./run-BJLIerMM.mjs";
|
|
2
|
-
import { a as assertSecretNames, o as confineCwd, t as SECRETS_DIR_ENV } from "./sandbox-Dm247NGx.mjs";
|
|
3
1
|
import { join, resolve } from "node:path";
|
|
4
2
|
import { existsSync, mkdirSync } from "node:fs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
7
5
|
import { spawn } from "node:child_process";
|
|
6
|
+
//#region src/home.ts
|
|
7
|
+
/**
|
|
8
|
+
* Where the CLI keeps what belongs to a person rather than a project: stage
|
|
9
|
+
* keys and stored provider credentials.
|
|
10
|
+
*
|
|
11
|
+
* `GKM_HOME` names it, so a CI job, a shared build runner or a test can give
|
|
12
|
+
* every run its own instead of reaching into whoever's home directory the
|
|
13
|
+
* process happens to have. Unset, it is `~/.gkm`, where it has always been.
|
|
14
|
+
*/
|
|
15
|
+
/** The environment variable that moves the CLI's home. */
|
|
16
|
+
const GKM_HOME_ENV = "GKM_HOME";
|
|
17
|
+
/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
|
|
18
|
+
function gkmHome(env = process.env) {
|
|
19
|
+
const configured = env[GKM_HOME_ENV];
|
|
20
|
+
return configured ? resolve(configured) : join(homedir(), ".gkm");
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
8
23
|
//#region src/auth/credentials.ts
|
|
9
24
|
/**
|
|
10
25
|
* Get the path to the credentials directory
|
|
@@ -127,190 +142,89 @@ async function getHostingerToken(options) {
|
|
|
127
142
|
return (await readCredentials(options)).hostinger?.token ?? null;
|
|
128
143
|
}
|
|
129
144
|
//#endregion
|
|
130
|
-
//#region src/
|
|
145
|
+
//#region src/run.ts
|
|
131
146
|
/**
|
|
132
|
-
*
|
|
147
|
+
* Start a program with an argument array, never a shell string.
|
|
133
148
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
149
|
+
* `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the
|
|
150
|
+
* workspace — image refs, tags, build args, package names — to `docker` and
|
|
151
|
+
* `turbo`. Joined into a string and handed to a shell, a package named
|
|
152
|
+
* `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which
|
|
153
|
+
* matters most where the CLI builds a repository it didn't write: a CI job for a
|
|
154
|
+
* fork, a shared build runner. Here every value reaches the program as one
|
|
155
|
+
* `argv` element, whatever it contains.
|
|
138
156
|
*/
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
* process, and CI often holds `--import tsx` there. A step that needs a
|
|
147
|
-
* loader passes its own.
|
|
148
|
-
* - `NODE_AUTH_TOKEN`, `NPM_TOKEN`, `npm_config_*`: registry tokens
|
|
149
|
-
* (`actions/setup-node` writes `NODE_AUTH_TOKEN`), which is why there is no
|
|
150
|
-
* `NODE_*` wildcard.
|
|
151
|
-
* - `AWS_*`, `DOCKER_*`, `DOKPLOY_*`, `GITHUB_TOKEN`, `TURBO_TOKEN`, `GKM_*`:
|
|
152
|
-
* credentials, or where the deploy keeps them.
|
|
153
|
-
* - `SHELL`, `EDITOR` and the rest of a login session: nothing here starts a
|
|
154
|
-
* shell.
|
|
155
|
-
*
|
|
156
|
-
* Proxies are passed: behind one, nothing installs or builds without it. A
|
|
157
|
-
* proxy URL with a password in it reaches the command too — a host that keeps
|
|
158
|
-
* one there and builds code it does not trust should pass a sandbox of its
|
|
159
|
-
* own.
|
|
160
|
-
*/
|
|
161
|
-
const SANDBOX_ENV_ALLOWLIST = [
|
|
162
|
-
"PATH",
|
|
163
|
-
"HOME",
|
|
164
|
-
"USER",
|
|
165
|
-
"LOGNAME",
|
|
166
|
-
"TMPDIR",
|
|
167
|
-
"TMP",
|
|
168
|
-
"TEMP",
|
|
169
|
-
"LANG",
|
|
170
|
-
"LANGUAGE",
|
|
171
|
-
"TZ",
|
|
172
|
-
/^LC_[A-Z]+$/,
|
|
173
|
-
"TERM",
|
|
174
|
-
"COLORTERM",
|
|
175
|
-
"NO_COLOR",
|
|
176
|
-
"FORCE_COLOR",
|
|
177
|
-
"CI",
|
|
178
|
-
"NODE_ENV",
|
|
179
|
-
"NODE_EXTRA_CA_CERTS",
|
|
180
|
-
"COREPACK_HOME",
|
|
181
|
-
"PNPM_HOME",
|
|
182
|
-
"XDG_CACHE_HOME",
|
|
183
|
-
"XDG_DATA_HOME",
|
|
184
|
-
"HTTP_PROXY",
|
|
185
|
-
"HTTPS_PROXY",
|
|
186
|
-
"NO_PROXY",
|
|
187
|
-
"http_proxy",
|
|
188
|
-
"https_proxy",
|
|
189
|
-
"no_proxy",
|
|
190
|
-
"SystemRoot",
|
|
191
|
-
"SYSTEMROOT",
|
|
192
|
-
"windir",
|
|
193
|
-
"WINDIR",
|
|
194
|
-
"ComSpec",
|
|
195
|
-
"COMSPEC",
|
|
196
|
-
"PATHEXT",
|
|
197
|
-
"USERPROFILE",
|
|
198
|
-
"APPDATA",
|
|
199
|
-
"LOCALAPPDATA"
|
|
200
|
-
];
|
|
201
|
-
function allowed(name) {
|
|
202
|
-
return SANDBOX_ENV_ALLOWLIST.some((entry) => typeof entry === "string" ? entry === name : entry.test(name));
|
|
157
|
+
/** Long enough for a cold image build; short enough that a hung one ends. */
|
|
158
|
+
const DEFAULT_TIMEOUT_MS = 18e5;
|
|
159
|
+
/** How long a timed-out child has to exit on SIGTERM before it is killed. */
|
|
160
|
+
const KILL_GRACE_MS = 5e3;
|
|
161
|
+
/** The command line as a person would read it — for messages, never to run. */
|
|
162
|
+
function display(command, args) {
|
|
163
|
+
return [command, ...args].join(" ");
|
|
203
164
|
}
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
165
|
+
/** The program ran and exited unsuccessfully; its own output said why. */
|
|
166
|
+
var CommandFailed = class extends Error {
|
|
167
|
+
command;
|
|
168
|
+
args;
|
|
169
|
+
exitCode;
|
|
170
|
+
signal;
|
|
171
|
+
constructor(command, args, exitCode, signal) {
|
|
172
|
+
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.`);
|
|
173
|
+
this.command = command;
|
|
174
|
+
this.args = args;
|
|
175
|
+
this.exitCode = exitCode;
|
|
176
|
+
this.signal = signal;
|
|
177
|
+
this.name = "CommandFailed";
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
/** The program ran past its timeout and was killed. */
|
|
181
|
+
var CommandTimedOut = class extends Error {
|
|
182
|
+
command;
|
|
183
|
+
args;
|
|
184
|
+
timeoutMs;
|
|
185
|
+
constructor(command, args, timeoutMs) {
|
|
186
|
+
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.`);
|
|
187
|
+
this.command = command;
|
|
188
|
+
this.args = args;
|
|
189
|
+
this.timeoutMs = timeoutMs;
|
|
190
|
+
this.name = "CommandTimedOut";
|
|
213
191
|
}
|
|
214
|
-
return env;
|
|
215
|
-
}
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/sandbox/local.ts
|
|
218
|
-
/** How long a timed-out command has to exit on SIGTERM before SIGKILL. */
|
|
219
|
-
const KILL_GRACE_MS = 5e3;
|
|
220
|
-
/** Where `output` sends a child's streams. */
|
|
221
|
-
const STDIO = {
|
|
222
|
-
capture: [
|
|
223
|
-
"ignore",
|
|
224
|
-
"pipe",
|
|
225
|
-
"pipe"
|
|
226
|
-
],
|
|
227
|
-
inherit: "inherit",
|
|
228
|
-
stderr: [
|
|
229
|
-
"ignore",
|
|
230
|
-
2,
|
|
231
|
-
2
|
|
232
|
-
],
|
|
233
|
-
ignore: "ignore"
|
|
234
192
|
};
|
|
235
193
|
/**
|
|
236
|
-
*
|
|
237
|
-
* environment.
|
|
238
|
-
*
|
|
239
|
-
* What it withholds from the command: the host's environment beyond
|
|
240
|
-
* {@link SANDBOX_ENV_ALLOWLIST}, a shell, a working directory outside the
|
|
241
|
-
* project, and any time past the timeout. What it does not: the host's
|
|
242
|
-
* filesystem, which the command can read and write as the user running the
|
|
243
|
-
* deploy. So it is not `isolating`, and it is the default for projects the
|
|
244
|
-
* host already trusts — the developer's own, a team's own CI. Code nobody
|
|
245
|
-
* vetted belongs in a sandbox that is.
|
|
194
|
+
* Run `command` with `args`, resolving when it exits 0.
|
|
246
195
|
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
196
|
+
* Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}
|
|
197
|
+
* once `timeoutMs` passes (after the child is gone), and with the spawn error
|
|
198
|
+
* itself when the program cannot be started at all — `ENOENT` already names it.
|
|
249
199
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
env;
|
|
254
|
-
constructor(options) {
|
|
255
|
-
this.root = resolve(options.root);
|
|
256
|
-
this.env = {
|
|
257
|
-
...allowlistedEnv(options.hostEnv ?? process.env, options.passEnv),
|
|
258
|
-
...options.home ? {
|
|
259
|
-
HOME: options.home,
|
|
260
|
-
USERPROFILE: options.home
|
|
261
|
-
} : {}
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
async exec(command, args, options) {
|
|
265
|
-
const cwd = confineCwd(this.root, options.cwd);
|
|
266
|
-
assertSecretNames(options.secrets);
|
|
267
|
-
options.signal?.throwIfAborted();
|
|
268
|
-
const secretsDir = await mountSecrets(options.secrets);
|
|
269
|
-
try {
|
|
270
|
-
return await spawnConfined(command, args, {
|
|
271
|
-
...options,
|
|
272
|
-
cwd,
|
|
273
|
-
env: secretsDir ? {
|
|
274
|
-
...options.env,
|
|
275
|
-
[SECRETS_DIR_ENV]: secretsDir
|
|
276
|
-
} : options.env
|
|
277
|
-
});
|
|
278
|
-
} finally {
|
|
279
|
-
if (secretsDir) await rm(secretsDir, {
|
|
280
|
-
recursive: true,
|
|
281
|
-
force: true
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
};
|
|
200
|
+
async function run(command, args, options = {}) {
|
|
201
|
+
await spawnChild(command, args, options, false);
|
|
202
|
+
}
|
|
286
203
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
204
|
+
* {@link run}, resolving with what the program wrote to stdout — for a value
|
|
205
|
+
* the CLI reads back, such as the digest `docker inspect` reports. stderr still
|
|
206
|
+
* reaches the terminal, so a failure explains itself the same way.
|
|
289
207
|
*/
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const dir = await mkdtemp(join(tmpdir(), "gkm-secrets-"));
|
|
293
|
-
for (const [name, value] of Object.entries(secrets)) await writeFile(join(dir, name), value, { mode: 384 });
|
|
294
|
-
return dir;
|
|
208
|
+
function runOutput(command, args, options = {}) {
|
|
209
|
+
return spawnChild(command, args, options, true);
|
|
295
210
|
}
|
|
296
|
-
function
|
|
297
|
-
const {
|
|
298
|
-
return new Promise((
|
|
211
|
+
function spawnChild(command, args, options, capture) {
|
|
212
|
+
const { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;
|
|
213
|
+
return new Promise((resolve, reject) => {
|
|
299
214
|
const child = spawn(command, [...args], {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
stdio:
|
|
303
|
-
|
|
304
|
-
|
|
215
|
+
stdio: "inherit",
|
|
216
|
+
...spawnOptions,
|
|
217
|
+
...capture ? { stdio: [
|
|
218
|
+
"ignore",
|
|
219
|
+
"pipe",
|
|
220
|
+
"inherit"
|
|
221
|
+
] } : {},
|
|
222
|
+
shell: false
|
|
305
223
|
});
|
|
306
224
|
let stdout = "";
|
|
307
|
-
let stderr = "";
|
|
308
225
|
child.stdout?.on("data", (chunk) => {
|
|
309
226
|
stdout += chunk.toString();
|
|
310
227
|
});
|
|
311
|
-
child.stderr?.on("data", (chunk) => {
|
|
312
|
-
stderr += chunk.toString();
|
|
313
|
-
});
|
|
314
228
|
let timedOut = false;
|
|
315
229
|
let killer;
|
|
316
230
|
const timer = setTimeout(() => {
|
|
@@ -326,18 +240,14 @@ function spawnConfined(command, args, options) {
|
|
|
326
240
|
};
|
|
327
241
|
child.on("error", (error) => {
|
|
328
242
|
settle();
|
|
329
|
-
reject(signal?.aborted ? signal.reason : error);
|
|
243
|
+
reject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);
|
|
330
244
|
});
|
|
331
|
-
child.on("close", (code,
|
|
245
|
+
child.on("close", (code, signal) => {
|
|
332
246
|
settle();
|
|
333
|
-
if (signal?.aborted) reject(signal.reason);
|
|
247
|
+
if (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);
|
|
334
248
|
else if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));
|
|
335
|
-
else
|
|
336
|
-
|
|
337
|
-
signal: killedBy ?? null,
|
|
338
|
-
stdout,
|
|
339
|
-
stderr
|
|
340
|
-
});
|
|
249
|
+
else if (code === 0) resolve(stdout);
|
|
250
|
+
else reject(new CommandFailed(command, args, code, signal));
|
|
341
251
|
});
|
|
342
252
|
});
|
|
343
253
|
}
|
|
@@ -446,6 +356,6 @@ function storedCredentials(options = {}) {
|
|
|
446
356
|
} };
|
|
447
357
|
}
|
|
448
358
|
//#endregion
|
|
449
|
-
export {
|
|
359
|
+
export { GKM_HOME_ENV as _, CommandTimedOut as a, runOutput as c, getDokployRegistryId as d, getDokployToken as f, storeHostingerToken as g, storeDokployCredentials as h, CommandFailed as i, getCredentialsPath as l, removeDokployCredentials as m, chainCredentials as n, DEFAULT_TIMEOUT_MS as o, getHostingerToken as p, storedCredentials as r, run as s, MissingCredential as t, getDokployCredentials as u, gkmHome as v };
|
|
450
360
|
|
|
451
|
-
//# sourceMappingURL=credentials-
|
|
361
|
+
//# sourceMappingURL=credentials-BgJ5mS_d.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-BgJ5mS_d.mjs","names":[],"sources":["../src/home.ts","../src/auth/credentials.ts","../src/run.ts","../src/deploy/credentials.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","import { existsSync, mkdirSync } from 'node:fs';\nimport { readFile, unlink, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { gkmHome } from '../home';\n\n/**\n * Stored credentials for various services\n */\nexport interface StoredCredentials {\n\tdokploy?: {\n\t\t/** API token */\n\t\ttoken: string;\n\t\t/** Dokploy endpoint URL */\n\t\tendpoint: string;\n\t\t/** Registry ID in Dokploy (for Docker image pulls) */\n\t\tregistryId?: string;\n\t\t/** When the credentials were stored */\n\t\tstoredAt: string;\n\t};\n\thostinger?: {\n\t\t/** API token from hpanel.hostinger.com/profile/api */\n\t\ttoken: string;\n\t\t/** When the credentials were stored */\n\t\tstoredAt: string;\n\t};\n}\n\n/**\n * Options for credential operations\n */\nexport interface CredentialOptions {\n\t/**\n\t * A directory whose `.gkm` holds the credentials. Default: the CLI's home\n\t * (`GKM_HOME`, else `~/.gkm`).\n\t */\n\troot?: string;\n\t/** The CLI's home itself, holding `credentials.json`. Wins over `root`. */\n\thome?: string;\n}\n\n/**\n * Get the path to the credentials directory\n */\nexport function getCredentialsDir(options?: CredentialOptions): string {\n\tif (options?.home) return options.home;\n\treturn options?.root ? join(options.root, '.gkm') : gkmHome();\n}\n\n/**\n * Get the path to the credentials file\n */\nexport function getCredentialsPath(options?: CredentialOptions): string {\n\treturn join(getCredentialsDir(options), 'credentials.json');\n}\n\n/**\n * Ensure the credentials directory exists\n */\nfunction ensureCredentialsDir(options?: CredentialOptions): void {\n\tconst dir = getCredentialsDir(options);\n\tif (!existsSync(dir)) {\n\t\tmkdirSync(dir, { recursive: true, mode: 0o700 });\n\t}\n}\n\n/**\n * Read stored credentials from disk\n */\nexport async function readCredentials(\n\toptions?: CredentialOptions,\n): Promise<StoredCredentials> {\n\tconst path = getCredentialsPath(options);\n\n\tif (!existsSync(path)) {\n\t\treturn {};\n\t}\n\n\ttry {\n\t\tconst content = await readFile(path, 'utf-8');\n\t\treturn JSON.parse(content) as StoredCredentials;\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/**\n * Write credentials to disk\n */\nexport async function writeCredentials(\n\tcredentials: StoredCredentials,\n\toptions?: CredentialOptions,\n): Promise<void> {\n\tensureCredentialsDir(options);\n\tconst path = getCredentialsPath(options);\n\n\tawait writeFile(path, JSON.stringify(credentials, null, 2), {\n\t\tmode: 0o600, // Owner read/write only\n\t});\n}\n\n/**\n * Store Dokploy credentials\n */\nexport async function storeDokployCredentials(\n\ttoken: string,\n\tendpoint: string,\n\toptions?: CredentialOptions,\n): Promise<void> {\n\tconst credentials = await readCredentials(options);\n\n\tcredentials.dokploy = {\n\t\ttoken,\n\t\tendpoint,\n\t\tstoredAt: new Date().toISOString(),\n\t};\n\n\tawait writeCredentials(credentials, options);\n}\n\n/**\n * Get stored Dokploy credentials\n */\nexport async function getDokployCredentials(\n\toptions?: CredentialOptions,\n): Promise<{\n\ttoken: string;\n\tendpoint: string;\n\tregistryId?: string;\n} | null> {\n\tconst credentials = await readCredentials(options);\n\n\t// The environment first, and each half independently.\n\t//\n\t// `getDokployToken` has always read `DOKPLOY_API_TOKEN` while this — the\n\t// function the deploy path actually calls — read only the file. So a CI job\n\t// given the token as a secret had a token and nowhere to send it, and the\n\t// only way through was committing a credentials file or running an\n\t// interactive login on the runner.\n\t//\n\t// Read separately rather than as a pair because they arrive separately: a\n\t// token is a secret and belongs in the environment, while an endpoint is\n\t// configuration and usually belongs in `deploy.dokploy.endpoint`. Requiring\n\t// both from the same place is what made either one useless alone.\n\tconst token = process.env.DOKPLOY_API_TOKEN ?? credentials.dokploy?.token;\n\tconst endpoint =\n\t\tprocess.env.DOKPLOY_ENDPOINT ?? credentials.dokploy?.endpoint;\n\n\tif (!token || !endpoint) return null;\n\n\treturn {\n\t\ttoken,\n\t\tendpoint: endpoint.replace(/\\/$/, ''),\n\t\t...(credentials.dokploy?.registryId\n\t\t\t? { registryId: credentials.dokploy.registryId }\n\t\t\t: {}),\n\t};\n}\n\n/**\n * Remove Dokploy credentials\n */\nexport async function removeDokployCredentials(\n\toptions?: CredentialOptions,\n): Promise<boolean> {\n\tconst credentials = await readCredentials(options);\n\n\tif (!credentials.dokploy) {\n\t\treturn false;\n\t}\n\n\tdelete credentials.dokploy;\n\tawait writeCredentials(credentials, options);\n\treturn true;\n}\n\n/**\n * Remove all stored credentials\n */\nexport async function removeAllCredentials(\n\toptions?: CredentialOptions,\n): Promise<void> {\n\tconst path = getCredentialsPath(options);\n\n\tif (existsSync(path)) {\n\t\tawait unlink(path);\n\t}\n}\n\n/**\n * Get Dokploy API token, checking stored credentials first, then environment\n */\nexport async function getDokployToken(\n\toptions?: CredentialOptions,\n): Promise<string | null> {\n\t// First check environment variable (takes precedence)\n\tconst envToken = process.env.DOKPLOY_API_TOKEN;\n\tif (envToken) {\n\t\treturn envToken;\n\t}\n\n\t// Then check stored credentials\n\tconst stored = await getDokployCredentials(options);\n\tif (stored) {\n\t\treturn stored.token;\n\t}\n\n\treturn null;\n}\n\n/**\n * Get Dokploy endpoint from stored credentials\n */\nexport async function getDokployEndpoint(\n\toptions?: CredentialOptions,\n): Promise<string | null> {\n\tconst stored = await getDokployCredentials(options);\n\treturn stored?.endpoint ?? null;\n}\n\n/**\n * Store Dokploy registry ID\n */\nexport async function storeDokployRegistryId(\n\tregistryId: string,\n\toptions?: CredentialOptions,\n): Promise<void> {\n\tconst credentials = await readCredentials(options);\n\n\tif (!credentials.dokploy) {\n\t\tthrow new Error(\n\t\t\t'Dokploy credentials not found. Run \"gkm login --service dokploy\" first.',\n\t\t);\n\t}\n\n\tcredentials.dokploy.registryId = registryId;\n\tawait writeCredentials(credentials, options);\n}\n\n/**\n * Get Dokploy registry ID from stored credentials\n */\nexport async function getDokployRegistryId(\n\toptions?: CredentialOptions,\n): Promise<string | undefined> {\n\tconst stored = await getDokployCredentials(options);\n\treturn stored?.registryId ?? undefined;\n}\n\n// ============================================\n// Hostinger credentials\n// ============================================\n\n/**\n * Store Hostinger API token\n *\n * @param token - API token from hpanel.hostinger.com/profile/api\n */\nexport async function storeHostingerToken(\n\ttoken: string,\n\toptions?: CredentialOptions,\n): Promise<void> {\n\tconst credentials = await readCredentials(options);\n\n\tcredentials.hostinger = {\n\t\ttoken,\n\t\tstoredAt: new Date().toISOString(),\n\t};\n\n\tawait writeCredentials(credentials, options);\n}\n\n/**\n * Get stored Hostinger API token\n *\n * Checks environment variable first (HOSTINGER_API_TOKEN),\n * then falls back to stored credentials.\n */\nexport async function getHostingerToken(\n\toptions?: CredentialOptions,\n): Promise<string | null> {\n\t// First check environment variable (takes precedence)\n\tconst envToken = process.env.HOSTINGER_API_TOKEN;\n\tif (envToken) {\n\t\treturn envToken;\n\t}\n\n\t// Then check stored credentials\n\tconst credentials = await readCredentials(options);\n\treturn credentials.hostinger?.token ?? null;\n}\n\n/**\n * Remove Hostinger credentials\n */\nexport async function removeHostingerCredentials(\n\toptions?: CredentialOptions,\n): Promise<boolean> {\n\tconst credentials = await readCredentials(options);\n\n\tif (!credentials.hostinger) {\n\t\treturn false;\n\t}\n\n\tdelete credentials.hostinger;\n\tawait writeCredentials(credentials, options);\n\treturn true;\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","/**\n * How a deploy gets the credentials it acts with.\n *\n * `deploy()` never prompts and never reads a terminal: it asks a\n * `CredentialProvider` and, when the provider has nothing, stops with\n * `MissingCredential` naming what it needed and how to supply it. Whether to\n * ask a person, read a vault or fail is the caller's decision — `gkm deploy`\n * prompts at a terminal and stores what was typed; a CI job sets the\n * environment; a host passes its own provider.\n */\n\nimport { readCredentials } from '../auth/credentials';\n\n/**\n * What each kind of credential is asked for with, and what it is.\n *\n * A target that needs a kind the CLI does not know declares it by augmenting\n * this interface, and lists it in its `credentials`:\n *\n * ```ts\n * declare module '@geekmidas/cli/target' {\n * interface CredentialKinds {\n * fly: { request: { org: string }; value: { token: string } };\n * }\n * }\n * ```\n */\nexport interface CredentialKinds {\n\t/** The Dokploy API a stage deploys through. */\n\tdokploy: {\n\t\t/** `deploy.dokploy.endpoint`, when the config names one. */\n\t\trequest: { endpoint?: string };\n\t\tvalue: { endpoint: string; token: string };\n\t};\n\t/**\n\t * A container registry login, for Dokploy to pull with. Asked for only when\n\t * Dokploy has no registry for `deploy.registry` and one has to be\n\t * created.\n\t */\n\tregistry: {\n\t\t/** `deploy.registry`. */\n\t\trequest: { url: string };\n\t\tvalue: { username: string; password: string };\n\t};\n\t/**\n\t * The AWS account a stage deploys to, for the SST target's `sst deploy`.\n\t * Handed to that one command's environment and to nothing else.\n\t */\n\taws: {\n\t\t/** The stage, for a provider that keeps one account per stage. */\n\t\trequest: { stage: string };\n\t\tvalue: AwsCredential;\n\t};\n}\n\n/**\n * Who to act as on AWS: a named profile, or keys.\n *\n * Never both. Given both, every AWS SDK takes the keys and ignores the\n * profile, so `--profile prod` with staging's keys still exported would deploy\n * production's stack into staging's account — the reason `secretsStoreFor`\n * resolves a named profile on its own, and why this cannot express the mix.\n */\nexport type AwsCredential =\n\t| {\n\t\t\t/** A profile in `~/.aws/config` — keys, SSO, an assumed role. */\n\t\t\tprofile: string;\n\t\t\tregion?: string;\n\t }\n\t| {\n\t\t\taccessKeyId: string;\n\t\t\tsecretAccessKey: string;\n\t\t\t/** Present for temporary keys: an assumed role, GitHub's OIDC. */\n\t\t\tsessionToken?: string;\n\t\t\tregion?: string;\n\t };\n\nexport type CredentialKind = keyof CredentialKinds;\n\n/** What a deploy asks a provider for. */\nexport type CredentialRequest<K extends CredentialKind = CredentialKind> = {\n\t[P in K]: { kind: P } & CredentialKinds[P]['request'];\n}[K];\n\n/** What a provider answers with. */\nexport type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];\n\nexport interface CredentialProvider {\n\t/**\n\t * The credential `request` asks for, or `undefined` when this provider has\n\t * none — the deploy then raises {@link MissingCredential}.\n\t */\n\tget<K extends CredentialKind>(\n\t\trequest: CredentialRequest<K>,\n\t\toptions?: { signal?: AbortSignal },\n\t): Promise<Credential<K> | undefined>;\n}\n\n/**\n * How to supply each kind the CLI knows, for the error that says it is\n * missing. A target's own kinds are its to explain.\n */\nconst HOW_TO_PROVIDE: Partial<Record<CredentialKind, string>> = {\n\tdokploy:\n\t\t\"Set DOKPLOY_API_TOKEN (and DOKPLOY_ENDPOINT, or deploy.dokploy.endpoint in gkm.config.ts), run `gkm login --provider dokploy`, or pass them through the deploy's CredentialProvider.\",\n\tregistry:\n\t\t'Add the registry in Dokploy (Settings → Docker Registry) and set deploy.dokploy.registryId, set DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD, or run `gkm deploy` at a terminal to be asked for them.',\n\taws: \"Set AWS_PROFILE to the stage account's profile, or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (and AWS_SESSION_TOKEN) — in CI, the keys aws-actions/configure-aws-credentials exports — or pass them through the deploy's CredentialProvider.\",\n};\n\n/** A deploy needed a credential, and its provider had none. */\nexport class MissingCredential extends Error {\n\tconstructor(\n\t\treadonly kind: CredentialKind,\n\t\t/** What it was for: the Dokploy endpoint or the registry URL. */\n\t\treadonly target: string | undefined,\n\t\t/** How to supply it. */\n\t\treadonly howToProvide: string = HOW_TO_PROVIDE[kind] ??\n\t\t\t\"Pass it through the deploy's CredentialProvider.\",\n\t) {\n\t\tconst what =\n\t\t\tkind === 'dokploy'\n\t\t\t\t? `No Dokploy credentials${target ? ` for ${target}` : ''}.`\n\t\t\t\t: kind === 'registry'\n\t\t\t\t\t? `Dokploy has no registry for ${target ?? 'the configured registry'}, and there are no credentials to create one with.`\n\t\t\t\t\t: kind === 'aws'\n\t\t\t\t\t\t? `No AWS credentials${target ? ` for the \"${target}\" stage` : ''}.`\n\t\t\t\t\t\t: `No \"${String(kind)}\" credentials${target ? ` for ${target}` : ''}.`;\n\t\tsuper(`${what} ${howToProvide}`);\n\t\tthis.name = 'MissingCredential';\n\t}\n}\n\n/** Whatever was asked for, from the first provider that has it. */\nexport function chainCredentials(\n\t...providers: CredentialProvider[]\n): CredentialProvider {\n\treturn {\n\t\tasync get(request, options) {\n\t\t\tfor (const provider of providers) {\n\t\t\t\tconst found = await provider.get(request, options);\n\t\t\t\tif (found) return found;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t};\n}\n\nexport interface StoredCredentialsOptions {\n\t/** Where to read the variables from. Defaults to `process.env`. */\n\tenv?: NodeJS.ProcessEnv;\n\t/**\n\t * The CLI's home, whose `credentials.json` holds stored logins. Defaults\n\t * to `GKM_HOME`, else `~/.gkm`.\n\t */\n\thome?: string;\n}\n\n/**\n * Credentials from the environment, then from what `gkm login` stored. What\n * `deploy()` uses when it is handed no provider.\n *\n * - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to\n * the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.\n * Each half is read on its own: a token is a secret and belongs in the\n * environment, an endpoint is configuration and belongs in the config.\n * - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.\n * - AWS: `AWS_PROFILE` when it is set, and then nothing else; otherwise\n * `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`. The\n * profile winning is `secretsStoreFor`'s rule: a profile is a choice of\n * account someone made, exported keys may be left over from another.\n * Read here, by name, and handed only to the command that deploys — the\n * sandbox every other step runs in passes no `AWS_*` on.\n */\nexport function storedCredentials(\n\toptions: StoredCredentialsOptions = {},\n): CredentialProvider {\n\tconst env = options.env ?? process.env;\n\n\treturn {\n\t\tasync get(asked) {\n\t\t\t// The union, so a switch on `kind` narrows it: `K` itself never is.\n\t\t\tconst request = asked as CredentialRequest;\n\t\t\tswitch (request.kind) {\n\t\t\t\tcase 'dokploy': {\n\t\t\t\t\tconst stored = (\n\t\t\t\t\t\tawait readCredentials(\n\t\t\t\t\t\t\toptions.home ? { home: options.home } : undefined,\n\t\t\t\t\t\t)\n\t\t\t\t\t).dokploy;\n\t\t\t\t\tconst token = env.DOKPLOY_API_TOKEN ?? stored?.token;\n\t\t\t\t\tconst endpoint =\n\t\t\t\t\t\tenv.DOKPLOY_ENDPOINT ?? stored?.endpoint ?? request.endpoint;\n\t\t\t\t\tif (!token || !endpoint) return undefined;\n\t\t\t\t\treturn { endpoint: endpoint.replace(/\\/$/, ''), token } as never;\n\t\t\t\t}\n\t\t\t\tcase 'registry': {\n\t\t\t\t\tconst username = env.DOCKER_REGISTRY_USERNAME;\n\t\t\t\t\tconst password = env.DOCKER_REGISTRY_PASSWORD;\n\t\t\t\t\tif (!username || !password) return undefined;\n\t\t\t\t\treturn { username, password } as never;\n\t\t\t\t}\n\t\t\t\tcase 'aws': {\n\t\t\t\t\tconst region = env.AWS_REGION ?? env.AWS_DEFAULT_REGION;\n\t\t\t\t\tconst where = region ? { region } : {};\n\t\t\t\t\tif (env.AWS_PROFILE) {\n\t\t\t\t\t\treturn { profile: env.AWS_PROFILE, ...where } as never;\n\t\t\t\t\t}\n\t\t\t\t\tconst accessKeyId = env.AWS_ACCESS_KEY_ID;\n\t\t\t\t\tconst secretAccessKey = env.AWS_SECRET_ACCESS_KEY;\n\t\t\t\t\tif (!accessKeyId || !secretAccessKey) return undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\taccessKeyId,\n\t\t\t\t\t\tsecretAccessKey,\n\t\t\t\t\t\t...(env.AWS_SESSION_TOKEN\n\t\t\t\t\t\t\t? { sessionToken: env.AWS_SESSION_TOKEN }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t...where,\n\t\t\t\t\t} as never;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// A kind a target declared: nothing stored here can answer it.\n\t\t\treturn undefined;\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;;;;;;ACwBA,SAAgB,kBAAkB,SAAqC;CACtE,IAAI,SAAS,MAAM,OAAO,QAAQ;CAClC,OAAO,SAAS,OAAO,KAAK,QAAQ,MAAM,MAAM,IAAI,QAAQ;AAC7D;;;;AAKA,SAAgB,mBAAmB,SAAqC;CACvE,OAAO,KAAK,kBAAkB,OAAO,GAAG,kBAAkB;AAC3D;;;;AAKA,SAAS,qBAAqB,SAAmC;CAChE,MAAM,MAAM,kBAAkB,OAAO;CACrC,IAAI,CAAC,WAAW,GAAG,GAClB,UAAU,KAAK;EAAE,WAAW;EAAM,MAAM;CAAM,CAAC;AAEjD;;;;AAKA,eAAsB,gBACrB,SAC6B;CAC7B,MAAM,OAAO,mBAAmB,OAAO;CAEvC,IAAI,CAAC,WAAW,IAAI,GACnB,OAAO,CAAC;CAGT,IAAI;EACH,MAAM,UAAU,MAAM,SAAS,MAAM,OAAO;EAC5C,OAAO,KAAK,MAAM,OAAO;CAC1B,QAAQ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