@keystrokehq/cli 0.1.168 → 0.1.171
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/{dist-DS8gbyzx.mjs → dist-B8ZXKNXj.mjs} +18 -6
- package/dist/dist-B8ZXKNXj.mjs.map +1 -0
- package/dist/dist-Brtmx-yx.mjs +3 -0
- package/dist/{dist-DoHPZzrH.mjs → dist-C5ooQsTQ.mjs} +4 -4
- package/dist/{dist-DoHPZzrH.mjs.map → dist-C5ooQsTQ.mjs.map} +1 -1
- package/dist/dist-CPGQbDRC.mjs +4 -0
- package/dist/{dist-DeuNAZM1.mjs → dist-CnddVrzY.mjs} +50 -44
- package/dist/dist-CnddVrzY.mjs.map +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{maybe-auto-update-BoJ046ks.mjs → maybe-auto-update-28IpqxhP.mjs} +2 -2
- package/dist/{maybe-auto-update-BoJ046ks.mjs.map → maybe-auto-update-28IpqxhP.mjs.map} +1 -1
- package/dist/{program-CHp0-LoQ.mjs → program-Ckl_ELbL.mjs} +120 -55
- package/dist/program-Ckl_ELbL.mjs.map +1 -0
- package/dist/{run-package-manager-update-CCvRXvyl.mjs → run-package-manager-update-CcJWW5xj.mjs} +2 -2
- package/dist/{run-package-manager-update-CCvRXvyl.mjs.map → run-package-manager-update-CcJWW5xj.mjs.map} +1 -1
- package/dist/skills-bundle/_AGENTS.md +2 -2
- package/package.json +2 -2
- package/dist/dist-BFgNzWan.mjs +0 -3
- package/dist/dist-DS8gbyzx.mjs.map +0 -1
- package/dist/dist-D_jn7u5p.mjs +0 -4
- package/dist/dist-DeuNAZM1.mjs.map +0 -1
- package/dist/program-CHp0-LoQ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -40,7 +40,7 @@ process.emitWarning = ((warning, ...args) => {
|
|
|
40
40
|
if ((type === "ExperimentalWarning" || /ExperimentalWarning/i.test(type)) && /SQLite/i.test(message)) return;
|
|
41
41
|
return Reflect.apply(originalEmitWarning, process, [warning, ...args]);
|
|
42
42
|
});
|
|
43
|
-
const { runCli } = await import("./program-
|
|
43
|
+
const { runCli } = await import("./program-Ckl_ELbL.mjs");
|
|
44
44
|
await runCli(process.argv);
|
|
45
45
|
//#endregion
|
|
46
46
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { S as resolveCliRoot, a as formatReleaseAgeBlockMessage, b as shouldUpdateCliVersion, i as readPnpmMinimumReleaseAgeMinutes, o as isReleaseAgeBlock, r as computeReleaseAgeRetryAfter, s as detectCliInstall, t as runPackageManagerUpdate, v as fetchLatestCliRelease, w as getCliConfigDir, x as readCliVersion, y as resolveCliDistTag } from "./run-package-manager-update-
|
|
2
|
+
import { S as resolveCliRoot, a as formatReleaseAgeBlockMessage, b as shouldUpdateCliVersion, i as readPnpmMinimumReleaseAgeMinutes, o as isReleaseAgeBlock, r as computeReleaseAgeRetryAfter, s as detectCliInstall, t as runPackageManagerUpdate, v as fetchLatestCliRelease, w as getCliConfigDir, x as readCliVersion, y as resolveCliDistTag } from "./run-package-manager-update-CcJWW5xj.mjs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { spawnSync } from "node:child_process";
|
|
@@ -141,4 +141,4 @@ async function maybeAutoUpdate(argv) {
|
|
|
141
141
|
//#endregion
|
|
142
142
|
export { maybeAutoUpdate };
|
|
143
143
|
|
|
144
|
-
//# sourceMappingURL=maybe-auto-update-
|
|
144
|
+
//# sourceMappingURL=maybe-auto-update-28IpqxhP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-auto-update-BoJ046ks.mjs","names":[],"sources":["../src/update/update-block-cache.ts","../src/update/maybe-auto-update.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { getCliConfigDir } from \"../config\";\n\nexport type UpdateBlockCache = {\n registryLatest?: string;\n blockedUntil?: string;\n lastFailedAt?: string;\n};\n\nconst CACHE_FILE = \"update-check.json\";\nconst GENERIC_RETRY_MS = 24 * 60 * 60 * 1000;\n\nfunction cachePath(configDir = getCliConfigDir()): string {\n return join(configDir, CACHE_FILE);\n}\n\nexport function readUpdateBlockCache(configDir?: string): UpdateBlockCache {\n const path = cachePath(configDir);\n if (!existsSync(path)) {\n return {};\n }\n\n try {\n return JSON.parse(readFileSync(path, \"utf8\")) as UpdateBlockCache;\n } catch {\n return {};\n }\n}\n\nexport function writeUpdateBlockCache(cache: UpdateBlockCache, configDir?: string): void {\n const dir = configDir ?? getCliConfigDir();\n mkdirSync(dir, { recursive: true });\n writeFileSync(cachePath(dir), `${JSON.stringify(cache, null, 2)}\\n`, \"utf8\");\n}\n\nexport function shouldSkipCachedUpdate(\n cache: UpdateBlockCache,\n registryLatest: string,\n now = Date.now(),\n): boolean {\n if (cache.registryLatest !== registryLatest) {\n return false;\n }\n\n if (cache.blockedUntil) {\n const blockedUntilMs = Date.parse(cache.blockedUntil);\n if (Number.isFinite(blockedUntilMs) && blockedUntilMs > now) {\n return true;\n }\n }\n\n if (cache.lastFailedAt) {\n const lastFailedMs = Date.parse(cache.lastFailedAt);\n if (Number.isFinite(lastFailedMs) && now - lastFailedMs < GENERIC_RETRY_MS) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function clearUpdateBlockCache(configDir?: string): void {\n writeUpdateBlockCache({}, configDir);\n}\n\nexport function recordReleaseAgeBlock(options: {\n registryLatest: string;\n retryAfter?: Date;\n configDir?: string;\n}): void {\n writeUpdateBlockCache(\n {\n registryLatest: options.registryLatest,\n blockedUntil: options.retryAfter?.toISOString(),\n },\n options.configDir,\n );\n}\n\nexport function recordGenericUpdateFailure(registryLatest: string, configDir?: string): void {\n writeUpdateBlockCache(\n {\n registryLatest,\n lastFailedAt: new Date().toISOString(),\n },\n configDir,\n );\n}\n","import { spawnSync } from \"node:child_process\";\n\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { readCliVersion } from \"../version\";\nimport { shouldUpdateCliVersion } from \"./compare-version\";\nimport { detectCliInstall } from \"./detect-cli-install\";\nimport { formatReleaseAgeBlockMessage, isReleaseAgeBlock } from \"./detect-release-age-block\";\nimport { fetchLatestCliRelease } from \"./fetch-latest-version\";\nimport {\n computeReleaseAgeRetryAfter,\n readPnpmMinimumReleaseAgeMinutes,\n} from \"./read-pnpm-release-age-minutes\";\nimport { resolveCliDistTag } from \"./resolve-cli-dist-tag\";\nimport { runPackageManagerUpdate } from \"./run-package-manager-update\";\nimport {\n clearUpdateBlockCache,\n readUpdateBlockCache,\n recordGenericUpdateFailure,\n recordReleaseAgeBlock,\n shouldSkipCachedUpdate,\n} from \"./update-block-cache\";\n\nfunction isTopLevelUpdateCommand(args: string[]): boolean {\n const valueFlags = new Set([\"--project\", \"--organization\", \"--dir\"]);\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === undefined) {\n return false;\n }\n\n if (arg === \"--\") {\n return args[i + 1] === \"update\";\n }\n\n if (arg.startsWith(\"-\")) {\n if (\n arg === \"-h\" ||\n arg === \"--help\" ||\n arg === \"-V\" ||\n arg === \"--version\" ||\n arg.startsWith(\"-V\")\n ) {\n continue;\n }\n\n if (arg.includes(\"=\")) {\n continue;\n }\n\n if (valueFlags.has(arg) || arg.startsWith(\"--\")) {\n i++;\n }\n continue;\n }\n\n return arg === \"update\";\n }\n\n return false;\n}\n\nfunction shouldSkipAutoUpdate(argv: string[]): boolean {\n if (\n process.env.KEYSTROKE_DEV ||\n process.env.KEYSTROKE_SKIP_UPDATE ||\n process.env.KEYSTROKE_UPDATING\n ) {\n return true;\n }\n\n if (process.env.CI === \"true\" || process.env.CI === \"1\") {\n return true;\n }\n\n const args = argv.slice(2);\n if (args.length === 0) {\n return false;\n }\n\n // Explicit `keystroke update` owns CLI + project package updates.\n if (isTopLevelUpdateCommand(args)) {\n return true;\n }\n\n return args.every(\n (arg) =>\n arg === \"-V\" ||\n arg === \"--version\" ||\n arg === \"-h\" ||\n arg === \"--help\" ||\n arg.startsWith(\"-V\"),\n );\n}\n\nfunction reexecCli(argv: string[]): never {\n const result = spawnSync(process.execPath, argv.slice(1), {\n stdio: \"inherit\",\n env: {\n ...process.env,\n KEYSTROKE_UPDATING: \"1\",\n },\n });\n\n process.exit(result.status ?? 1);\n}\n\nfunction releaseAgeRetryAfter(\n install: NonNullable<ReturnType<typeof detectCliInstall>>,\n publishedAt: string | undefined,\n): Date | undefined {\n if (install.packageManager !== \"pnpm\") {\n return undefined;\n }\n\n return computeReleaseAgeRetryAfter(publishedAt, readPnpmMinimumReleaseAgeMinutes());\n}\n\nexport async function maybeAutoUpdate(argv: string[]): Promise<void> {\n if (shouldSkipAutoUpdate(argv)) {\n return;\n }\n\n const install = detectCliInstall(resolveCliRoot(import.meta.url));\n if (!install || (install.kind === \"local\" && !install.projectRoot)) {\n return;\n }\n\n const currentVersion = readCliVersion();\n const distTag = resolveCliDistTag();\n const release = await fetchLatestCliRelease(distTag);\n\n if (\n !release ||\n !shouldUpdateCliVersion({\n registryVersion: release.version,\n currentVersion,\n distTag,\n })\n ) {\n clearUpdateBlockCache();\n return;\n }\n\n const cache = readUpdateBlockCache();\n if (shouldSkipCachedUpdate(cache, release.version)) {\n return;\n }\n\n process.stderr.write(\n `Updating @keystrokehq/cli ${currentVersion} -> ${release.version} (@${distTag}) via ${install.packageManager}...\\n`,\n );\n\n const result = runPackageManagerUpdate(install, distTag);\n const installedVersion = readCliVersion();\n\n if (installedVersion.trim() !== currentVersion.trim()) {\n clearUpdateBlockCache();\n process.stderr.write(`Updated @keystrokehq/cli ${currentVersion} -> ${installedVersion}.\\n`);\n reexecCli(argv);\n }\n\n if (result.ok) {\n clearUpdateBlockCache();\n return;\n }\n\n if (isReleaseAgeBlock(result.output)) {\n const retryAfter = releaseAgeRetryAfter(install, release.publishedAt);\n recordReleaseAgeBlock({\n registryLatest: release.version,\n retryAfter,\n });\n process.stderr.write(\n `${formatReleaseAgeBlockMessage({\n currentVersion,\n availableVersion: release.version,\n retryAfter,\n })}\\n`,\n );\n return;\n }\n\n recordGenericUpdateFailure(release.version);\n process.stderr.write(\"Auto-update failed; continuing with the current version.\\n\");\n}\n"],"mappings":";;;;;;AAWA,MAAM,aAAa;AACnB,MAAM,mBAAmB,OAAU,KAAK;AAExC,SAAS,UAAU,YAAY,gBAAgB,GAAW;CACxD,OAAO,KAAK,WAAW,UAAU;AACnC;AAEA,SAAgB,qBAAqB,WAAsC;CACzE,MAAM,OAAO,UAAU,SAAS;CAChC,IAAI,CAAC,WAAW,IAAI,GAClB,OAAO,CAAC;CAGV,IAAI;EACF,OAAO,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;CAC9C,QAAQ;EACN,OAAO,CAAC;CACV;AACF;AAEA,SAAgB,sBAAsB,OAAyB,WAA0B;CACvF,MAAM,MAAM,aAAa,gBAAgB;CACzC,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;CAClC,cAAc,UAAU,GAAG,GAAG,GAAG,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE,KAAK,MAAM;AAC7E;AAEA,SAAgB,uBACd,OACA,gBACA,MAAM,KAAK,IAAI,GACN;CACT,IAAI,MAAM,mBAAmB,gBAC3B,OAAO;CAGT,IAAI,MAAM,cAAc;EACtB,MAAM,iBAAiB,KAAK,MAAM,MAAM,YAAY;EACpD,IAAI,OAAO,SAAS,cAAc,KAAK,iBAAiB,KACtD,OAAO;CAEX;CAEA,IAAI,MAAM,cAAc;EACtB,MAAM,eAAe,KAAK,MAAM,MAAM,YAAY;EAClD,IAAI,OAAO,SAAS,YAAY,KAAK,MAAM,eAAe,kBACxD,OAAO;CAEX;CAEA,OAAO;AACT;AAEA,SAAgB,sBAAsB,WAA0B;CAC9D,sBAAsB,CAAC,GAAG,SAAS;AACrC;AAEA,SAAgB,sBAAsB,SAI7B;CACP,sBACE;EACE,gB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2B,QAAQ,OAAO;CAC1C,QAAQ,OAAO,MAAM,4DAA4D;AACnF"}
|
|
1
|
+
{"version":3,"file":"maybe-auto-update-28IpqxhP.mjs","names":[],"sources":["../src/update/update-block-cache.ts","../src/update/maybe-auto-update.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { getCliConfigDir } from \"../config\";\n\nexport type UpdateBlockCache = {\n registryLatest?: string;\n blockedUntil?: string;\n lastFailedAt?: string;\n};\n\nconst CACHE_FILE = \"update-check.json\";\nconst GENERIC_RETRY_MS = 24 * 60 * 60 * 1000;\n\nfunction cachePath(configDir = getCliConfigDir()): string {\n return join(configDir, CACHE_FILE);\n}\n\nexport function readUpdateBlockCache(configDir?: string): UpdateBlockCache {\n const path = cachePath(configDir);\n if (!existsSync(path)) {\n return {};\n }\n\n try {\n return JSON.parse(readFileSync(path, \"utf8\")) as UpdateBlockCache;\n } catch {\n return {};\n }\n}\n\nexport function writeUpdateBlockCache(cache: UpdateBlockCache, configDir?: string): void {\n const dir = configDir ?? getCliConfigDir();\n mkdirSync(dir, { recursive: true });\n writeFileSync(cachePath(dir), `${JSON.stringify(cache, null, 2)}\\n`, \"utf8\");\n}\n\nexport function shouldSkipCachedUpdate(\n cache: UpdateBlockCache,\n registryLatest: string,\n now = Date.now(),\n): boolean {\n if (cache.registryLatest !== registryLatest) {\n return false;\n }\n\n if (cache.blockedUntil) {\n const blockedUntilMs = Date.parse(cache.blockedUntil);\n if (Number.isFinite(blockedUntilMs) && blockedUntilMs > now) {\n return true;\n }\n }\n\n if (cache.lastFailedAt) {\n const lastFailedMs = Date.parse(cache.lastFailedAt);\n if (Number.isFinite(lastFailedMs) && now - lastFailedMs < GENERIC_RETRY_MS) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function clearUpdateBlockCache(configDir?: string): void {\n writeUpdateBlockCache({}, configDir);\n}\n\nexport function recordReleaseAgeBlock(options: {\n registryLatest: string;\n retryAfter?: Date;\n configDir?: string;\n}): void {\n writeUpdateBlockCache(\n {\n registryLatest: options.registryLatest,\n blockedUntil: options.retryAfter?.toISOString(),\n },\n options.configDir,\n );\n}\n\nexport function recordGenericUpdateFailure(registryLatest: string, configDir?: string): void {\n writeUpdateBlockCache(\n {\n registryLatest,\n lastFailedAt: new Date().toISOString(),\n },\n configDir,\n );\n}\n","import { spawnSync } from \"node:child_process\";\n\nimport { resolveCliRoot } from \"../project/resolve-cli-root\";\nimport { readCliVersion } from \"../version\";\nimport { shouldUpdateCliVersion } from \"./compare-version\";\nimport { detectCliInstall } from \"./detect-cli-install\";\nimport { formatReleaseAgeBlockMessage, isReleaseAgeBlock } from \"./detect-release-age-block\";\nimport { fetchLatestCliRelease } from \"./fetch-latest-version\";\nimport {\n computeReleaseAgeRetryAfter,\n readPnpmMinimumReleaseAgeMinutes,\n} from \"./read-pnpm-release-age-minutes\";\nimport { resolveCliDistTag } from \"./resolve-cli-dist-tag\";\nimport { runPackageManagerUpdate } from \"./run-package-manager-update\";\nimport {\n clearUpdateBlockCache,\n readUpdateBlockCache,\n recordGenericUpdateFailure,\n recordReleaseAgeBlock,\n shouldSkipCachedUpdate,\n} from \"./update-block-cache\";\n\nfunction isTopLevelUpdateCommand(args: string[]): boolean {\n const valueFlags = new Set([\"--project\", \"--organization\", \"--dir\"]);\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === undefined) {\n return false;\n }\n\n if (arg === \"--\") {\n return args[i + 1] === \"update\";\n }\n\n if (arg.startsWith(\"-\")) {\n if (\n arg === \"-h\" ||\n arg === \"--help\" ||\n arg === \"-V\" ||\n arg === \"--version\" ||\n arg.startsWith(\"-V\")\n ) {\n continue;\n }\n\n if (arg.includes(\"=\")) {\n continue;\n }\n\n if (valueFlags.has(arg) || arg.startsWith(\"--\")) {\n i++;\n }\n continue;\n }\n\n return arg === \"update\";\n }\n\n return false;\n}\n\nfunction shouldSkipAutoUpdate(argv: string[]): boolean {\n if (\n process.env.KEYSTROKE_DEV ||\n process.env.KEYSTROKE_SKIP_UPDATE ||\n process.env.KEYSTROKE_UPDATING\n ) {\n return true;\n }\n\n if (process.env.CI === \"true\" || process.env.CI === \"1\") {\n return true;\n }\n\n const args = argv.slice(2);\n if (args.length === 0) {\n return false;\n }\n\n // Explicit `keystroke update` owns CLI + project package updates.\n if (isTopLevelUpdateCommand(args)) {\n return true;\n }\n\n return args.every(\n (arg) =>\n arg === \"-V\" ||\n arg === \"--version\" ||\n arg === \"-h\" ||\n arg === \"--help\" ||\n arg.startsWith(\"-V\"),\n );\n}\n\nfunction reexecCli(argv: string[]): never {\n const result = spawnSync(process.execPath, argv.slice(1), {\n stdio: \"inherit\",\n env: {\n ...process.env,\n KEYSTROKE_UPDATING: \"1\",\n },\n });\n\n process.exit(result.status ?? 1);\n}\n\nfunction releaseAgeRetryAfter(\n install: NonNullable<ReturnType<typeof detectCliInstall>>,\n publishedAt: string | undefined,\n): Date | undefined {\n if (install.packageManager !== \"pnpm\") {\n return undefined;\n }\n\n return computeReleaseAgeRetryAfter(publishedAt, readPnpmMinimumReleaseAgeMinutes());\n}\n\nexport async function maybeAutoUpdate(argv: string[]): Promise<void> {\n if (shouldSkipAutoUpdate(argv)) {\n return;\n }\n\n const install = detectCliInstall(resolveCliRoot(import.meta.url));\n if (!install || (install.kind === \"local\" && !install.projectRoot)) {\n return;\n }\n\n const currentVersion = readCliVersion();\n const distTag = resolveCliDistTag();\n const release = await fetchLatestCliRelease(distTag);\n\n if (\n !release ||\n !shouldUpdateCliVersion({\n registryVersion: release.version,\n currentVersion,\n distTag,\n })\n ) {\n clearUpdateBlockCache();\n return;\n }\n\n const cache = readUpdateBlockCache();\n if (shouldSkipCachedUpdate(cache, release.version)) {\n return;\n }\n\n process.stderr.write(\n `Updating @keystrokehq/cli ${currentVersion} -> ${release.version} (@${distTag}) via ${install.packageManager}...\\n`,\n );\n\n const result = runPackageManagerUpdate(install, distTag);\n const installedVersion = readCliVersion();\n\n if (installedVersion.trim() !== currentVersion.trim()) {\n clearUpdateBlockCache();\n process.stderr.write(`Updated @keystrokehq/cli ${currentVersion} -> ${installedVersion}.\\n`);\n reexecCli(argv);\n }\n\n if (result.ok) {\n clearUpdateBlockCache();\n return;\n }\n\n if (isReleaseAgeBlock(result.output)) {\n const retryAfter = releaseAgeRetryAfter(install, release.publishedAt);\n recordReleaseAgeBlock({\n registryLatest: release.version,\n retryAfter,\n });\n process.stderr.write(\n `${formatReleaseAgeBlockMessage({\n currentVersion,\n availableVersion: release.version,\n retryAfter,\n })}\\n`,\n );\n return;\n }\n\n recordGenericUpdateFailure(release.version);\n process.stderr.write(\"Auto-update failed; continuing with the current version.\\n\");\n}\n"],"mappings":";;;;;;AAWA,MAAM,aAAa;AACnB,MAAM,mBAAmB,OAAU,KAAK;AAExC,SAAS,UAAU,YAAY,gBAAgB,GAAW;CACxD,OAAO,KAAK,WAAW,UAAU;AACnC;AAEA,SAAgB,qBAAqB,WAAsC;CACzE,MAAM,OAAO,UAAU,SAAS;CAChC,IAAI,CAAC,WAAW,IAAI,GAClB,OAAO,CAAC;CAGV,IAAI;EACF,OAAO,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;CAC9C,QAAQ;EACN,OAAO,CAAC;CACV;AACF;AAEA,SAAgB,sBAAsB,OAAyB,WAA0B;CACvF,MAAM,MAAM,aAAa,gBAAgB;CACzC,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;CAClC,cAAc,UAAU,GAAG,GAAG,GAAG,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE,KAAK,MAAM;AAC7E;AAEA,SAAgB,uBACd,OACA,gBACA,MAAM,KAAK,IAAI,GACN;CACT,IAAI,MAAM,mBAAmB,gBAC3B,OAAO;CAGT,IAAI,MAAM,cAAc;EACtB,MAAM,iBAAiB,KAAK,MAAM,MAAM,YAAY;EACpD,IAAI,OAAO,SAAS,cAAc,KAAK,iBAAiB,KACtD,OAAO;CAEX;CAEA,IAAI,MAAM,cAAc;EAC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kBAAkB,OAAO,MAAM,GAAG;EACpC,MAAM,aAAa,qBAAqB,SAAS,QAAQ,WAAW;EACpE,sBAAsB;GACpB,gBAAgB,QAAQ;GACxB;EACF,CAAC;EACD,QAAQ,OAAO,MACb,GAAG,6BAA6B;GAC9B;GACA,kBAAkB,QAAQ;GAC1B;EACF,CAAC,EAAE,GACL;EACA;CACF;CAEA,2BAA2B,QAAQ,OAAO;CAC1C,QAAQ,OAAO,MAAM,4DAA4D;AACnF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as resolvePlatformUrlForWebUrl, C as createCliConfig, D as getWebUrl, E as getPlatformUrl, M as ExpectedCliError, N as isExpectedCliError, O as DEFAULT_PLATFORM_URL, S as resolveCliRoot, T as getCredentialStorage, _ as isLocalSdkSpec, a as formatReleaseAgeBlockMessage, b as shouldUpdateCliVersion, c as detectManagerFromLockfile, d as installDependencies$1, f as installPlaygroundDependencies, g as ensureSdkCurrent, i as readPnpmMinimumReleaseAgeMinutes, j as parseCredentialStorage, l as buildPlaygroundWorkspace, m as resolvePackageManager, n as ensureMinimumReleaseAgeExclude, o as isReleaseAgeBlock, p as resolveGithubPackagesToken, r as computeReleaseAgeRetryAfter, s as detectCliInstall, t as runPackageManagerUpdate, u as detectPackageManager$2, v as fetchLatestCliRelease, w as getCliConfigDir, x as readCliVersion, y as resolveCliDistTag } from "./run-package-manager-update-
|
|
3
|
-
import { $ as DeclineOrganizationInvitationResponseSchema, $i as ConfirmCheckoutResponseSchema, $r as WorkflowRunResponseSchema, $t as McpDiscoverResponseSchema, A as CreateApiKeyRequestSchema, Ai as CredentialAssignmentListResponseSchema, An as ProjectGitRemoteResponseSchema, Ar as UpdateOrganizationMemberResponseSchema, At as ListAgentWorkspaceFilesResponseSchema, B as CreateOrganizationResponseSchema, Bn as PublicFormSubmitBodySchema, Br as UserAvatarSchema, Bt as ListOrganizationMembersPageQuerySchema, C as CompleteManagedDeployArtifactRequestSchema, Cn as PresignOrgLogoResponseSchema, Cr as TriggerRunDetailResponseSchema, Ct as HistoryRunListQuerySchema, D as ConnectAuthorizeUrlResponseSchema, Dn as PresignUserAvatarResponseSchema, Dr as UpdateCredentialRequestSchema, Dt as InviteProjectMembersRequestSchema, E as CompleteProjectArtifactResponseSchema, Ei as slugifyAppName, En as PresignUserAvatarRequestSchema, Er as UpdateCredentialInstanceBodySchema, Et as InviteOrganizationMembersResponseSchema, F as CreateCustomAppRequestSchema, Fn as ProjectSettingsResponseSchema, Fr as UpdateProjectSettingsRequestSchema, Ft as ListCredentialsPageResponseSchema, G as CreateSlackAppRequestSchema, Gn as PublishedFormSchema, Gr as WorkflowCanvasSchema, Gt as ListProjectMembersResponseSchema, H as CreateProjectArtifactResponseSchema, Hi as CLIENT_CHANNEL_HEADER, Hn as PublishManagedDeployCandidateRequestSchema, Hr as UserPreferencesSchema, Ht as ListOrganizationsResponseSchema, I as CreateCustomAppResponseSchema, In as ProjectSlugAvailabilityResponseSchema, Ir as UploadProjectSourceManifestRequestSchema, It as ListDraftFilesResponseSchema, J as CreateSlackChannelResponseSchema, Ji as BillingInvoiceUrlResponseSchema, Jn as RecentResourceListResponseSchema, Jr as WorkflowRunDetailResponseSchema, Jt as ListTemplatesResponseSchema, K as CreateSlackAppResponseSchema, Ki as AutoTopupSummarySchema, Kn as QueuedAgentPromptResponseSchema, Kr as WorkflowFormResponseSchema, Kt as ListProjectMetricsResponseSchema, L as CreateDraftCommitRequestSchema, Ln as PromptInputSchema, Lr as UploadProjectSourceResponseSchema, Lt as ListManagedServiceCredentialsResponseSchema, M as CreateCredentialInstanceBodySchema, Mi as CredentialConsumerListQuerySchema, Mn as ProjectPullStateSchema, Mr as UpdateProjectMemberRequestSchema, Mt as ListAppsResponseSchema, N as CreateCredentialsRequestSchema, Ni as CredentialConsumerListResponseSchema, Nn as ProjectReachabilityResponseSchema, Nr as UpdateProjectMemberResponseSchema, Nt as ListChannelPlatformsResponseSchema, O as ConnectManagedServiceCredentialRequestSchema, Oi as AssignCredentialBodySchema, Or as UpdateManagedServiceCredentialRequestSchema, Ot as InviteProjectMembersResponseSchema, P as CreateCredentialsResponseSchema, Pi as ExecuteKeystrokeToolRequestSchema, Pn as ProjectResponseSchema, Pr as UpdateProjectRequestSchema, Pt as ListCredentialsPageQuerySchema, Q as DOCS_SEARCH_TOOL, Qi as ConfirmCheckoutRequestSchema, Qn as SLACK_PERSONAL_APP_SLUG, Qr as WorkflowRunListResponseSchema, Qt as ManagedServiceKindSchema, R as CreateDraftDiffCommitRequestSchema, Rn as PromptResponseSchema, Rr as UpsertGatewayAttachmentBodySchema, Rt as ListMcpAppToolsResponseSchema, S as ChannelDirectoryListResponseSchema, Si as parseSlackConnectFlow, Sn as PresignOrgLogoRequestSchema, Sr as TriggerListResponseSchema, St as HistoryRunDetailResponseSchema, T as CompleteProjectArtifactRequestSchema, Ti as resolveDocsMcpUrl, Tn as PresignProjectSourceResponseSchema, Tr as UpdateChannelBindingBodySchema, Tt as InviteOrganizationMembersRequestSchema, U as CreateProjectRequestSchema, Ui as PresignChatAttachmentRequestSchema, Un as PublishManagedDeployCandidateResponseSchema, Ur as WorkflowCanvasCredentialBindingsSchema, Ut as ListProjectDeploymentsResponseSchema, V as CreateProjectArtifactRequestSchema, Vi as ACTIVE_ORG_HEADER, Vn as PublicFormSubmitResponseSchema, Vr as UserPreferencesPatchSchema, Vt as ListOrganizationMembersPageResponseSchema, W as CreateProjectResponseSchema, Wi as PresignChatAttachmentResponseSchema, Wn as PublishedFormListResponseSchema, Wr as WorkflowCanvasRunSchema, Wt as ListProjectFilesResponseSchema, X as CredentialInstanceRecordSchema, Xi as BillingSummaryResponseSchema, Xn as RenewManagedDeployUploadResponseSchema, Xr as WorkflowRunInputsPutBodySchema, Xt as ManagedDeployResourceKeySchema, Y as CredentialInstanceListResponseSchema, Yi as BillingRedirectResponseSchema, Yn as RenewManagedDeployUploadRequestSchema, Yr as WorkflowRunHooksResponseSchema, Yt as MANAGED_DEPLOY_REQUEST_TIMEOUT_MS, Z as DOCS_QUERY_TOOL, Zi as BillingUsageResponseSchema, Zr as WorkflowRunInputsSchema, Zt as ManagedServiceCredentialSchema, _ as CatalogAppDetailResponseSchema, _i as normalizeDocsSearchPaths, _n as PlatformAgentSessionListResponseSchema, _r as SubmitTeamRequestRequestSchema, _t as GraphqlDiscoverResponseSchema, a as AgentSessionDetailResponseSchema, ai as WorkspaceTriggerOverviewSchema, an as PROJECT_DRAFT_DIFF_MAX_BYTES, ar as SlackAppManifestRequestSchema, at as DraftRevisionResponseSchema, b as ChannelConnectionListResponseSchema, bi as parseErrorResponse, bn as PresignCustomAppLogoRequestSchema, br as TriggerInvokeInputsSchema, bt as HeartbeatManagedDeployResponseSchema, c as AgentSummaryListResponseSchema, ci as buildAgentSlackDeeplink, cn as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, cr as SlugAvailabilityResponseSchema, ct as DuplicateCredentialsResponseSchema, d as BindAgentSlackAppBodySchema, di as detectProjectPackageManagerFromSnapshot, dr as StartMcpOAuthConnectionInputSchema, dt as FormFieldConfigSchema, ea as CreateBillingPortalRequestSchema, ei as WorkflowSummaryDetailResponseSchema, en as OpenApiDiscoverResponseSchema, er as SkillSummaryDetailResponseSchema, et as DownloadActiveProjectArtifactResponseSchema, f as BindChannelBodySchema, fi as gitPorcelainLineTouchesManagedDraftPublishPath, fr as StartMcpOAuthConnectionResultSchema, ft as GatewayAttachmentRecordSchema, g as CatalogActionsPageResponseSchema, gn as PlatformAgentSessionDetailResponseSchema, gr as SubmitMarketingContactRequestSchema, gt as GetTemplateResponseSchema, h as CatalogActionDetailResponseSchema, hi as isIgnoredProjectSourcePath, hn as PlatformAgentPromptResponseSchema, hr as SubmitAgentFeedbackRequestSchema, ht as GetCustomAppResponseSchema, i as AgentEnvImageSnapshotResponseSchema, ii as WorkspaceTriggerListResponseSchema, in as PROJECT_DRAFT_COMMIT_REQUEST_TIMEOUT_MS, ir as SlackAppListResponseSchema, it as DraftFileContentResponseSchema, j as CreateApiKeyResponseSchema, ji as CredentialAssignmentRecordSchema, jn as ProjectGitStatusResponseSchema, jr as UpdateOrganizationRequestSchema, jt as ListApiKeysResponseSchema, k as ConnectProvidersResponseSchema, ki as CredentialAssignmentListQuerySchema, kn as ProjectGitRemoteRequestSchema, kr as UpdateOrganizationMemberRequestSchema, kt as ListAgentMemoryFilesResponseSchema, l as AgentTriggerSummaryListResponseSchema, li as buildConnectDeeplink, lr as StartKeystrokeConnectionInputSchema, lt as FinalizeCustomAppLogoRequestSchema, m as CancelManagedDeployResponseSchema, mn as PlatformAgentPromptInputSchema, mr as StartOAuthConnectionResultSchema, mt as GetCredentialResponseSchema, n as ActiveOrganizationResponseSchema, na as CreateSubscriptionCheckoutRequestSchema, ni as WorkspaceTriggerDetailSchema, nn as OrganizationSidebarBrandingSchema, nr as SlackAgentMembershipsResponseSchema, nt as DraftCommitResponseSchema, o as AgentSessionListResponseSchema, oi as WorkspaceTriggerRunListResponseSchema, or as SlackAppManifestResponseSchema, ot as DraftUpdateEventSchema, p as CancelManagedDeployRequestSchema, pi as isAcceptableInstallExit, pn as PlatformAgentCancelResponseSchema, pr as StartOAuthConnectionInputSchema, pt as GetAppCatalogEntryResponseSchema, q as CreateSlackChannelBodySchema, qi as BillingActivityResponseSchema, qn as QueuedRunResponseSchema, qr as WorkflowFormUpsertBodySchema, qt as ListProjectsResponseSchema, r as ActiveProjectSourceRevisionSchema, ra as UpdateAutoTopupRequestSchema, ri as WorkspaceTriggerFileSchema, rn as PNPM_FROZEN_INSTALL_ARGS, rr as SlackAppInstallStartResponseSchema, rt as DraftConflictResponseSchema, s as AgentSummaryDetailResponseSchema, si as WorkspaceWorkflowOverviewSchema, sn as PROJECT_PULL_STATE_RELATIVE_PATH, sr as SlackMembershipChannelBodySchema, st as DuplicateCredentialRequestSchema, t as AcceptOrganizationInvitationResponseSchema, ta as CreateCreditsCheckoutRequestSchema, ti as WorkflowSummaryListResponseSchema, tn as OrganizationSidebarBrandingPatchSchema, tr as SkillSummaryListResponseSchema, tt as DownloadActiveProjectSourceResponseSchema, u as AppSlugAvailabilityResponseSchema, ui as deriveCustomAppDisplay, ur as StartKeystrokeConnectionResultSchema, ut as FinalizeCustomAppLogoResponseSchema, v as CatalogAppsPageResponseSchema, vn as PrepareManagedDeployRequestSchema, vr as TemplateFilesResponseSchema, vt as HealthResponseSchema, w as CompleteManagedDeployArtifactResponseSchema, wi as resolveConnectAppSlug, wn as PresignProjectSourceRequestSchema, wr as TriggerRunListResponseSchema, wt as HistoryRunListResponseSchema, x as ChannelConnectionSchema, xn as PresignCustomAppLogoResponseSchema, xr as TriggerInvokeResponseSchema, xt as HistoryRunCancelResponseSchema, y as ChannelAccountListResponseSchema, yi as parseAppSlug, yn as PrepareManagedDeployResponseSchema, yr as TriggerDetailResponseSchema, yt as HeartbeatManagedDeployRequestSchema, z as CreateOrganizationRequestSchema, zn as PublicFormMetadataSchema, zr as UserAvatarPatchSchema, zt as ListOrganizationInvitationsResponseSchema } from "./dist-
|
|
4
|
-
import { $ as
|
|
5
|
-
import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-
|
|
2
|
+
import { A as resolvePlatformUrlForWebUrl, C as createCliConfig, D as getWebUrl, E as getPlatformUrl, M as ExpectedCliError, N as isExpectedCliError, O as DEFAULT_PLATFORM_URL, S as resolveCliRoot, T as getCredentialStorage, _ as isLocalSdkSpec, a as formatReleaseAgeBlockMessage, b as shouldUpdateCliVersion, c as detectManagerFromLockfile, d as installDependencies$1, f as installPlaygroundDependencies, g as ensureSdkCurrent, i as readPnpmMinimumReleaseAgeMinutes, j as parseCredentialStorage, l as buildPlaygroundWorkspace, m as resolvePackageManager, n as ensureMinimumReleaseAgeExclude, o as isReleaseAgeBlock, p as resolveGithubPackagesToken, r as computeReleaseAgeRetryAfter, s as detectCliInstall, t as runPackageManagerUpdate, u as detectPackageManager$2, v as fetchLatestCliRelease, w as getCliConfigDir, x as readCliVersion, y as resolveCliDistTag } from "./run-package-manager-update-CcJWW5xj.mjs";
|
|
3
|
+
import { $ as DeclineOrganizationInvitationResponseSchema, $i as ConfirmCheckoutResponseSchema, $r as WorkflowRunResponseSchema, $t as McpDiscoverResponseSchema, A as CreateApiKeyRequestSchema, Ai as CredentialAssignmentListResponseSchema, An as ProjectGitRemoteResponseSchema, Ar as UpdateOrganizationMemberResponseSchema, At as ListAgentWorkspaceFilesResponseSchema, B as CreateOrganizationResponseSchema, Bn as PublicFormSubmitBodySchema, Br as UserAvatarSchema, Bt as ListOrganizationMembersPageQuerySchema, C as CompleteManagedDeployArtifactRequestSchema, Cn as PresignOrgLogoResponseSchema, Cr as TriggerRunDetailResponseSchema, Ct as HistoryRunListQuerySchema, D as ConnectAuthorizeUrlResponseSchema, Dn as PresignUserAvatarResponseSchema, Dr as UpdateCredentialRequestSchema, Dt as InviteProjectMembersRequestSchema, E as CompleteProjectArtifactResponseSchema, Ei as slugifyAppName, En as PresignUserAvatarRequestSchema, Er as UpdateCredentialInstanceBodySchema, Et as InviteOrganizationMembersResponseSchema, F as CreateCustomAppRequestSchema, Fn as ProjectSettingsResponseSchema, Fr as UpdateProjectSettingsRequestSchema, Ft as ListCredentialsPageResponseSchema, G as CreateSlackAppRequestSchema, Gn as PublishedFormSchema, Gr as WorkflowCanvasSchema, Gt as ListProjectMembersResponseSchema, H as CreateProjectArtifactResponseSchema, Hi as CLIENT_CHANNEL_HEADER, Hn as PublishManagedDeployCandidateRequestSchema, Hr as UserPreferencesSchema, Ht as ListOrganizationsResponseSchema, I as CreateCustomAppResponseSchema, In as ProjectSlugAvailabilityResponseSchema, Ir as UploadProjectSourceManifestRequestSchema, It as ListDraftFilesResponseSchema, J as CreateSlackChannelResponseSchema, Ji as BillingInvoiceUrlResponseSchema, Jn as RecentResourceListResponseSchema, Jr as WorkflowRunDetailResponseSchema, Jt as ListTemplatesResponseSchema, K as CreateSlackAppResponseSchema, Ki as AutoTopupSummarySchema, Kn as QueuedAgentPromptResponseSchema, Kr as WorkflowFormResponseSchema, Kt as ListProjectMetricsResponseSchema, L as CreateDraftCommitRequestSchema, Ln as PromptInputSchema, Lr as UploadProjectSourceResponseSchema, Lt as ListManagedServiceCredentialsResponseSchema, M as CreateCredentialInstanceBodySchema, Mi as CredentialConsumerListQuerySchema, Mn as ProjectPullStateSchema, Mr as UpdateProjectMemberRequestSchema, Mt as ListAppsResponseSchema, N as CreateCredentialsRequestSchema, Ni as CredentialConsumerListResponseSchema, Nn as ProjectReachabilityResponseSchema, Nr as UpdateProjectMemberResponseSchema, Nt as ListChannelPlatformsResponseSchema, O as ConnectManagedServiceCredentialRequestSchema, Oi as AssignCredentialBodySchema, Or as UpdateManagedServiceCredentialRequestSchema, Ot as InviteProjectMembersResponseSchema, P as CreateCredentialsResponseSchema, Pi as ExecuteKeystrokeToolRequestSchema, Pn as ProjectResponseSchema, Pr as UpdateProjectRequestSchema, Pt as ListCredentialsPageQuerySchema, Q as DOCS_SEARCH_TOOL, Qi as ConfirmCheckoutRequestSchema, Qn as SLACK_PERSONAL_APP_SLUG, Qr as WorkflowRunListResponseSchema, Qt as ManagedServiceKindSchema, R as CreateDraftDiffCommitRequestSchema, Rn as PromptResponseSchema, Rr as UpsertGatewayAttachmentBodySchema, Rt as ListMcpAppToolsResponseSchema, S as ChannelDirectoryListResponseSchema, Si as parseSlackConnectFlow, Sn as PresignOrgLogoRequestSchema, Sr as TriggerListResponseSchema, St as HistoryRunDetailResponseSchema, T as CompleteProjectArtifactRequestSchema, Ti as resolveDocsMcpUrl, Tn as PresignProjectSourceResponseSchema, Tr as UpdateChannelBindingBodySchema, Tt as InviteOrganizationMembersRequestSchema, U as CreateProjectRequestSchema, Ui as PresignChatAttachmentRequestSchema, Un as PublishManagedDeployCandidateResponseSchema, Ur as WorkflowCanvasCredentialBindingsSchema, Ut as ListProjectDeploymentsResponseSchema, V as CreateProjectArtifactRequestSchema, Vi as ACTIVE_ORG_HEADER, Vn as PublicFormSubmitResponseSchema, Vr as UserPreferencesPatchSchema, Vt as ListOrganizationMembersPageResponseSchema, W as CreateProjectResponseSchema, Wi as PresignChatAttachmentResponseSchema, Wn as PublishedFormListResponseSchema, Wr as WorkflowCanvasRunSchema, Wt as ListProjectFilesResponseSchema, X as CredentialInstanceRecordSchema, Xi as BillingSummaryResponseSchema, Xn as RenewManagedDeployUploadResponseSchema, Xr as WorkflowRunInputsPutBodySchema, Xt as ManagedDeployResourceKeySchema, Y as CredentialInstanceListResponseSchema, Yi as BillingRedirectResponseSchema, Yn as RenewManagedDeployUploadRequestSchema, Yr as WorkflowRunHooksResponseSchema, Yt as MANAGED_DEPLOY_REQUEST_TIMEOUT_MS, Z as DOCS_QUERY_TOOL, Zi as BillingUsageResponseSchema, Zr as WorkflowRunInputsSchema, Zt as ManagedServiceCredentialSchema, _ as CatalogAppDetailResponseSchema, _i as normalizeDocsSearchPaths, _n as PlatformAgentSessionListResponseSchema, _r as SubmitTeamRequestRequestSchema, _t as GraphqlDiscoverResponseSchema, a as AgentSessionDetailResponseSchema, ai as WorkspaceTriggerOverviewSchema, an as PROJECT_DRAFT_DIFF_MAX_BYTES, ar as SlackAppManifestRequestSchema, at as DraftRevisionResponseSchema, b as ChannelConnectionListResponseSchema, bi as parseErrorResponse, bn as PresignCustomAppLogoRequestSchema, br as TriggerInvokeInputsSchema, bt as HeartbeatManagedDeployResponseSchema, c as AgentSummaryListResponseSchema, ci as buildAgentSlackDeeplink, cn as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, cr as SlugAvailabilityResponseSchema, ct as DuplicateCredentialsResponseSchema, d as BindAgentSlackAppBodySchema, di as detectProjectPackageManagerFromSnapshot, dr as StartMcpOAuthConnectionInputSchema, dt as FormFieldConfigSchema, ea as CreateBillingPortalRequestSchema, ei as WorkflowSummaryDetailResponseSchema, en as OpenApiDiscoverResponseSchema, er as SkillSummaryDetailResponseSchema, et as DownloadActiveProjectArtifactResponseSchema, f as BindChannelBodySchema, fi as gitPorcelainLineTouchesManagedDraftPublishPath, fr as StartMcpOAuthConnectionResultSchema, ft as GatewayAttachmentRecordSchema, g as CatalogActionsPageResponseSchema, gn as PlatformAgentSessionDetailResponseSchema, gr as SubmitMarketingContactRequestSchema, gt as GetTemplateResponseSchema, h as CatalogActionDetailResponseSchema, hi as isIgnoredProjectSourcePath, hn as PlatformAgentPromptResponseSchema, hr as SubmitAgentFeedbackRequestSchema, ht as GetCustomAppResponseSchema, i as AgentEnvImageSnapshotResponseSchema, ii as WorkspaceTriggerListResponseSchema, in as PROJECT_DRAFT_COMMIT_REQUEST_TIMEOUT_MS, ir as SlackAppListResponseSchema, it as DraftFileContentResponseSchema, j as CreateApiKeyResponseSchema, ji as CredentialAssignmentRecordSchema, jn as ProjectGitStatusResponseSchema, jr as UpdateOrganizationRequestSchema, jt as ListApiKeysResponseSchema, k as ConnectProvidersResponseSchema, ki as CredentialAssignmentListQuerySchema, kn as ProjectGitRemoteRequestSchema, kr as UpdateOrganizationMemberRequestSchema, kt as ListAgentMemoryFilesResponseSchema, l as AgentTriggerSummaryListResponseSchema, li as buildConnectDeeplink, lr as StartKeystrokeConnectionInputSchema, lt as FinalizeCustomAppLogoRequestSchema, m as CancelManagedDeployResponseSchema, mn as PlatformAgentPromptInputSchema, mr as StartOAuthConnectionResultSchema, mt as GetCredentialResponseSchema, n as ActiveOrganizationResponseSchema, na as CreateSubscriptionCheckoutRequestSchema, ni as WorkspaceTriggerDetailSchema, nn as OrganizationSidebarBrandingSchema, nr as SlackAgentMembershipsResponseSchema, nt as DraftCommitResponseSchema, o as AgentSessionListResponseSchema, oi as WorkspaceTriggerRunListResponseSchema, or as SlackAppManifestResponseSchema, ot as DraftUpdateEventSchema, p as CancelManagedDeployRequestSchema, pi as isAcceptableInstallExit, pn as PlatformAgentCancelResponseSchema, pr as StartOAuthConnectionInputSchema, pt as GetAppCatalogEntryResponseSchema, q as CreateSlackChannelBodySchema, qi as BillingActivityResponseSchema, qn as QueuedRunResponseSchema, qr as WorkflowFormUpsertBodySchema, qt as ListProjectsResponseSchema, r as ActiveProjectSourceRevisionSchema, ra as UpdateAutoTopupRequestSchema, ri as WorkspaceTriggerFileSchema, rn as PNPM_FROZEN_INSTALL_ARGS, rr as SlackAppInstallStartResponseSchema, rt as DraftConflictResponseSchema, s as AgentSummaryDetailResponseSchema, si as WorkspaceWorkflowOverviewSchema, sn as PROJECT_PULL_STATE_RELATIVE_PATH, sr as SlackMembershipChannelBodySchema, st as DuplicateCredentialRequestSchema, t as AcceptOrganizationInvitationResponseSchema, ta as CreateCreditsCheckoutRequestSchema, ti as WorkflowSummaryListResponseSchema, tn as OrganizationSidebarBrandingPatchSchema, tr as SkillSummaryListResponseSchema, tt as DownloadActiveProjectSourceResponseSchema, u as AppSlugAvailabilityResponseSchema, ui as deriveCustomAppDisplay, ur as StartKeystrokeConnectionResultSchema, ut as FinalizeCustomAppLogoResponseSchema, v as CatalogAppsPageResponseSchema, vn as PrepareManagedDeployRequestSchema, vr as TemplateFilesResponseSchema, vt as HealthResponseSchema, w as CompleteManagedDeployArtifactResponseSchema, wi as resolveConnectAppSlug, wn as PresignProjectSourceRequestSchema, wr as TriggerRunListResponseSchema, wt as HistoryRunListResponseSchema, x as ChannelConnectionSchema, xn as PresignCustomAppLogoResponseSchema, xr as TriggerInvokeResponseSchema, xt as HistoryRunCancelResponseSchema, y as ChannelAccountListResponseSchema, yi as parseAppSlug, yn as PrepareManagedDeployResponseSchema, yr as TriggerDetailResponseSchema, yt as HeartbeatManagedDeployRequestSchema, z as CreateOrganizationRequestSchema, zn as PublicFormMetadataSchema, zr as UserAvatarPatchSchema, zt as ListOrganizationInvitationsResponseSchema } from "./dist-CnddVrzY.mjs";
|
|
4
|
+
import { $ as withMcpReadClient, Q as assertPublicHttpUrl, Z as PublicHttpUrlError, _t as captureException, bt as flushTelemetry, et as artifactIndexFromModules, gt as alias, nt as mapInParallelBatches, rt as moduleBlobRefsFromModules, tt as collectArtifactModules, vt as configureTelemetry, xt as shutdownTelemetry, yt as event } from "./dist-B8ZXKNXj.mjs";
|
|
5
|
+
import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-C5ooQsTQ.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { homedir, platform, release, tmpdir } from "node:os";
|
|
@@ -1628,6 +1628,7 @@ function createWorkflowsResource$1(http) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
1631
|
+
const AUTH_RETRY_HEADER = "x-keystroke-auth-retry";
|
|
1631
1632
|
function createKeystrokeClient(options) {
|
|
1632
1633
|
const auth = options.auth ?? { type: "none" };
|
|
1633
1634
|
const base = normalizeBaseUrl$1(options.baseUrl);
|
|
@@ -1635,10 +1636,21 @@ function createKeystrokeClient(options) {
|
|
|
1635
1636
|
const http = ky.create({
|
|
1636
1637
|
prefix: base === "" ? void 0 : `${base}/`,
|
|
1637
1638
|
credentials: "omit",
|
|
1638
|
-
hooks: {
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1639
|
+
hooks: {
|
|
1640
|
+
beforeRequest: [({ request }) => {
|
|
1641
|
+
applyActiveOrganizationHeader$1(request, getActiveOrganizationId?.());
|
|
1642
|
+
return applyAuthHeaders$1(request, auth);
|
|
1643
|
+
}],
|
|
1644
|
+
afterResponse: [({ request, response, retryCount }) => {
|
|
1645
|
+
if (!options.retryUnauthorizedOnce || response.status !== 401 || retryCount > 0 || request.headers.get(AUTH_RETRY_HEADER) === "1") return;
|
|
1646
|
+
const headers = new Headers(request.headers);
|
|
1647
|
+
headers.set(AUTH_RETRY_HEADER, "1");
|
|
1648
|
+
return ky.retry({
|
|
1649
|
+
request: new Request(request, { headers }),
|
|
1650
|
+
code: "AUTH_RETRY"
|
|
1651
|
+
});
|
|
1652
|
+
}]
|
|
1653
|
+
},
|
|
1642
1654
|
...options.ky
|
|
1643
1655
|
});
|
|
1644
1656
|
return {
|
|
@@ -2045,7 +2057,7 @@ function createJwtTokenCache(mint) {
|
|
|
2045
2057
|
};
|
|
2046
2058
|
}
|
|
2047
2059
|
//#endregion
|
|
2048
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2060
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/version.mjs
|
|
2049
2061
|
const PACKAGE_VERSION = "1.6.23";
|
|
2050
2062
|
//#endregion
|
|
2051
2063
|
//#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.4.3/node_modules/better-call/dist/error.mjs
|
|
@@ -2170,7 +2182,7 @@ var BetterAuthError = class extends Error {
|
|
|
2170
2182
|
}
|
|
2171
2183
|
};
|
|
2172
2184
|
//#endregion
|
|
2173
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2185
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
|
|
2174
2186
|
const deviceAuthorizationClient = () => {
|
|
2175
2187
|
return {
|
|
2176
2188
|
id: "device-authorization",
|
|
@@ -2246,7 +2258,7 @@ Object.freeze({
|
|
|
2246
2258
|
}
|
|
2247
2259
|
});
|
|
2248
2260
|
//#endregion
|
|
2249
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2261
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/utils/url.mjs
|
|
2250
2262
|
const SLASH_CHAR_CODE = "/".charCodeAt(0);
|
|
2251
2263
|
function trimTrailingSlashes(value) {
|
|
2252
2264
|
let end = value.length;
|
|
@@ -2519,7 +2531,7 @@ let onMount = ($store, initialize) => {
|
|
|
2519
2531
|
});
|
|
2520
2532
|
};
|
|
2521
2533
|
//#endregion
|
|
2522
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2534
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/equality.mjs
|
|
2523
2535
|
function isPlainObject$1(value) {
|
|
2524
2536
|
if (typeof value !== "object" || value === null) return false;
|
|
2525
2537
|
const prototype = Object.getPrototypeOf(value);
|
|
@@ -2559,7 +2571,7 @@ function withEquality(store, isEqual) {
|
|
|
2559
2571
|
});
|
|
2560
2572
|
}
|
|
2561
2573
|
//#endregion
|
|
2562
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2574
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
2563
2575
|
const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
2564
2576
|
const now$1 = () => Math.floor(Date.now() / 1e3);
|
|
2565
2577
|
var WindowBroadcastChannel = class {
|
|
@@ -2602,7 +2614,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
|
2602
2614
|
return globalThis[kBroadcastChannel];
|
|
2603
2615
|
}
|
|
2604
2616
|
//#endregion
|
|
2605
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2617
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
2606
2618
|
const kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
2607
2619
|
var WindowFocusManager = class {
|
|
2608
2620
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -2631,7 +2643,7 @@ function getGlobalFocusManager() {
|
|
|
2631
2643
|
return globalThis[kFocusManager];
|
|
2632
2644
|
}
|
|
2633
2645
|
//#endregion
|
|
2634
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2646
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/online-manager.mjs
|
|
2635
2647
|
const kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
2636
2648
|
var WindowOnlineManager = class {
|
|
2637
2649
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -2663,7 +2675,7 @@ function getGlobalOnlineManager() {
|
|
|
2663
2675
|
return globalThis[kOnlineManager];
|
|
2664
2676
|
}
|
|
2665
2677
|
//#endregion
|
|
2666
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2678
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/parser.mjs
|
|
2667
2679
|
const PROTO_POLLUTION_PATTERNS = {
|
|
2668
2680
|
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
2669
2681
|
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
@@ -2732,7 +2744,7 @@ function parseJSON(value, options = { strict: true }) {
|
|
|
2732
2744
|
return betterJSONParse(value, options);
|
|
2733
2745
|
}
|
|
2734
2746
|
//#endregion
|
|
2735
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2747
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
2736
2748
|
const now = () => Math.floor(Date.now() / 1e3);
|
|
2737
2749
|
/**
|
|
2738
2750
|
* Rate limit: don't refetch on focus if a session request was made within this many seconds
|
|
@@ -2859,7 +2871,7 @@ function createSessionRefreshManager(opts) {
|
|
|
2859
2871
|
};
|
|
2860
2872
|
}
|
|
2861
2873
|
//#endregion
|
|
2862
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2874
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
2863
2875
|
const redirectPlugin = {
|
|
2864
2876
|
id: "redirect",
|
|
2865
2877
|
name: "Redirect",
|
|
@@ -2874,7 +2886,7 @@ const redirectPlugin = {
|
|
|
2874
2886
|
} }
|
|
2875
2887
|
};
|
|
2876
2888
|
//#endregion
|
|
2877
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
2889
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/session-atom.mjs
|
|
2878
2890
|
const isServer = () => typeof window === "undefined";
|
|
2879
2891
|
/**
|
|
2880
2892
|
* Normalize $fetch response: `throw: true` returns data directly,
|
|
@@ -3526,7 +3538,7 @@ var betterFetch = async (url, options) => {
|
|
|
3526
3538
|
};
|
|
3527
3539
|
};
|
|
3528
3540
|
//#endregion
|
|
3529
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
3541
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/config.mjs
|
|
3530
3542
|
const resolvePublicAuthUrl = (basePath) => {
|
|
3531
3543
|
if (typeof process === "undefined") return void 0;
|
|
3532
3544
|
const path = basePath ?? "/api/auth";
|
|
@@ -3624,7 +3636,7 @@ const getClientConfig = (options, loadEnv) => {
|
|
|
3624
3636
|
};
|
|
3625
3637
|
};
|
|
3626
3638
|
//#endregion
|
|
3627
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
3639
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
3628
3640
|
function isAtom(value) {
|
|
3629
3641
|
return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
|
|
3630
3642
|
}
|
|
@@ -3642,7 +3654,7 @@ function toKebabCase(input) {
|
|
|
3642
3654
|
return splitWords(input).map((word) => word.toLowerCase()).join("-");
|
|
3643
3655
|
}
|
|
3644
3656
|
//#endregion
|
|
3645
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
3657
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/proxy.mjs
|
|
3646
3658
|
function getMethod(path, knownPathMethods, args) {
|
|
3647
3659
|
const method = knownPathMethods[path];
|
|
3648
3660
|
const { fetchOptions, query: _query, ...body } = args || {};
|
|
@@ -3717,7 +3729,7 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
|
|
|
3717
3729
|
return createProxy();
|
|
3718
3730
|
}
|
|
3719
3731
|
//#endregion
|
|
3720
|
-
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.
|
|
3732
|
+
//#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/vanilla.mjs
|
|
3721
3733
|
function createAuthClient(options) {
|
|
3722
3734
|
const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
|
|
3723
3735
|
const resolvedHooks = {};
|
|
@@ -3874,10 +3886,12 @@ function getResolvedOrganizationId() {
|
|
|
3874
3886
|
//#endregion
|
|
3875
3887
|
//#region src/client.ts
|
|
3876
3888
|
function createCliClient(config, options) {
|
|
3889
|
+
const auth = resolveCliAuth(config);
|
|
3877
3890
|
return createKeystrokeClient({
|
|
3878
3891
|
baseUrl: options.baseUrl,
|
|
3879
|
-
auth
|
|
3892
|
+
auth,
|
|
3880
3893
|
getActiveOrganizationId: options.platform ? () => options.organizationId ?? getResolvedOrganizationId() ?? null : void 0,
|
|
3894
|
+
retryUnauthorizedOnce: auth.type === "apiKey",
|
|
3881
3895
|
ky: { headers: { [CLIENT_CHANNEL_HEADER]: "cli" } }
|
|
3882
3896
|
});
|
|
3883
3897
|
}
|
|
@@ -6425,10 +6439,12 @@ function toPlatformAuth(auth) {
|
|
|
6425
6439
|
function createCliPlatformClient(config, options = {}) {
|
|
6426
6440
|
const platformUrl = getPlatformUrl(config);
|
|
6427
6441
|
const storage = getCredentialStorage(config);
|
|
6442
|
+
const auth = resolveCliAuth(config);
|
|
6443
|
+
const refreshBearerToken = auth.type === "apiKey" ? async () => auth.getKey() : auth.type === "bearer" ? () => getCliJwt(platformUrl, true, storage) : void 0;
|
|
6428
6444
|
return createPlatformClient({
|
|
6429
6445
|
baseUrl: platformUrl,
|
|
6430
|
-
auth: toPlatformAuth(
|
|
6431
|
-
refreshBearerToken
|
|
6446
|
+
auth: toPlatformAuth(auth),
|
|
6447
|
+
...refreshBearerToken ? { refreshBearerToken } : {},
|
|
6432
6448
|
getActiveOrganizationId: () => options.organizationId === void 0 ? getResolvedOrganizationId() ?? null : options.organizationId,
|
|
6433
6449
|
getExtraHeaders: () => ({ [CLIENT_CHANNEL_HEADER]: "cli" })
|
|
6434
6450
|
});
|
|
@@ -6776,6 +6792,7 @@ function unreachableServerMessage(targetUrl) {
|
|
|
6776
6792
|
function formatHttpClientError(error, context) {
|
|
6777
6793
|
if (error.status === 401) {
|
|
6778
6794
|
if (context?.hasCredentials === false) return "Not logged in. Run `keystroke auth login` first.";
|
|
6795
|
+
if (context?.credentialSource === "api-key") return "Authentication failed for `KEYSTROKE_API_KEY`. Check the key and retry the command.";
|
|
6779
6796
|
return "Authentication failed. Run `keystroke auth login` again.";
|
|
6780
6797
|
}
|
|
6781
6798
|
if (error.status === 403) {
|
|
@@ -7050,35 +7067,41 @@ async function runProjectCliCommand(fallback, fn, errorContext, targetOptions =
|
|
|
7050
7067
|
}
|
|
7051
7068
|
async function runCliCommand(fallback, fn, errorContext, targetOptions = {}) {
|
|
7052
7069
|
const config = createCliConfig();
|
|
7053
|
-
const
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
const organizationId = (await resolveActiveOrganization(config)).organization.id;
|
|
7058
|
-
const ctx = {
|
|
7059
|
-
config,
|
|
7060
|
-
client: createCliClient(config, {
|
|
7061
|
-
baseUrl: target.baseUrl,
|
|
7062
|
-
platform: true,
|
|
7063
|
-
organizationId
|
|
7064
|
-
}),
|
|
7065
|
-
serverUrl: target.baseUrl,
|
|
7066
|
-
webUrl: getWebUrl(config),
|
|
7067
|
-
apiTarget: target
|
|
7068
|
-
};
|
|
7070
|
+
const webUrl = getWebUrl(config);
|
|
7071
|
+
let organizationId;
|
|
7072
|
+
let projectId;
|
|
7073
|
+
let serverUrl;
|
|
7069
7074
|
try {
|
|
7070
|
-
await
|
|
7075
|
+
const target = await resolveApiTarget(config, {
|
|
7076
|
+
...getCliTargetOptions(),
|
|
7077
|
+
...targetOptions
|
|
7078
|
+
});
|
|
7079
|
+
serverUrl = target.baseUrl;
|
|
7080
|
+
projectId = target.projectId;
|
|
7081
|
+
organizationId = getResolvedOrganizationId() ?? (await resolveActiveOrganization(config)).organization.id;
|
|
7082
|
+
await fn({
|
|
7083
|
+
config,
|
|
7084
|
+
client: createCliClient(config, {
|
|
7085
|
+
baseUrl: target.baseUrl,
|
|
7086
|
+
platform: true,
|
|
7087
|
+
organizationId
|
|
7088
|
+
}),
|
|
7089
|
+
serverUrl: target.baseUrl,
|
|
7090
|
+
webUrl,
|
|
7091
|
+
apiTarget: target
|
|
7092
|
+
});
|
|
7071
7093
|
} catch (error) {
|
|
7072
7094
|
await reportCliException(error, {
|
|
7073
7095
|
command: fallback,
|
|
7074
7096
|
operation: "cli.command",
|
|
7075
7097
|
organizationId,
|
|
7076
|
-
projectId
|
|
7098
|
+
projectId
|
|
7077
7099
|
});
|
|
7078
7100
|
process.stderr.write(`${formatCliError(error, fallback, {
|
|
7079
7101
|
...errorContext,
|
|
7080
|
-
serverUrl
|
|
7081
|
-
webUrl
|
|
7102
|
+
serverUrl,
|
|
7103
|
+
webUrl,
|
|
7104
|
+
credentialSource: process.env.KEYSTROKE_API_KEY?.trim() ? "api-key" : "session"
|
|
7082
7105
|
})}\n`);
|
|
7083
7106
|
process.exitCode = 1;
|
|
7084
7107
|
}
|
|
@@ -9025,7 +9048,7 @@ function registerBuildCommand(program) {
|
|
|
9025
9048
|
try {
|
|
9026
9049
|
const root = resolveProjectRoot(options.dir);
|
|
9027
9050
|
await ensureSdkCurrent(root);
|
|
9028
|
-
const { buildApp } = await import("./dist-
|
|
9051
|
+
const { buildApp } = await import("./dist-Brtmx-yx.mjs");
|
|
9029
9052
|
await buildApp({ root });
|
|
9030
9053
|
process.stdout.write(`Built ${root}\n`);
|
|
9031
9054
|
} catch (error) {
|
|
@@ -11279,16 +11302,51 @@ async function assertDeployableCheckout(projectRoot, env = checkoutGitEnv()) {
|
|
|
11279
11302
|
* Optionally verify HEAD against a server-pinned draft SHA.
|
|
11280
11303
|
*/
|
|
11281
11304
|
async function assertHostedCheckoutDeployable(projectRoot, options = {}) {
|
|
11282
|
-
const
|
|
11305
|
+
const env = options.env ?? checkoutGitEnv();
|
|
11306
|
+
const inspection = await assertDeployableCheckout(projectRoot, env);
|
|
11283
11307
|
if (inspection.branch !== "ks/draft") throw new ExpectedCliError(`Hosted deploy requires branch \`${HOSTED_DRAFT_BRANCH}\` (current: ${inspection.branch ?? "detached"}).`);
|
|
11284
|
-
if (options.expectedDraftSha) assertCheckoutMatchesDraft(inspection, options.expectedDraftSha);
|
|
11308
|
+
if (options.expectedDraftSha) await assertCheckoutMatchesDraft(inspection, options.expectedDraftSha, env);
|
|
11285
11309
|
return inspection;
|
|
11286
11310
|
}
|
|
11287
|
-
function
|
|
11311
|
+
async function resolveCheckoutDraftRelation(inspection, expectedDraftSha, env) {
|
|
11312
|
+
const head = inspection.headSha;
|
|
11313
|
+
if (!head) return "unknown";
|
|
11314
|
+
const expectedIsAncestor = await runGit([
|
|
11315
|
+
"merge-base",
|
|
11316
|
+
"--is-ancestor",
|
|
11317
|
+
expectedDraftSha,
|
|
11318
|
+
head
|
|
11319
|
+
], {
|
|
11320
|
+
cwd: inspection.gitRoot,
|
|
11321
|
+
env,
|
|
11322
|
+
reject: false
|
|
11323
|
+
});
|
|
11324
|
+
if (expectedIsAncestor.code === 0) return "ahead";
|
|
11325
|
+
if (expectedIsAncestor.code !== 1) return "unknown";
|
|
11326
|
+
const headIsAncestor = await runGit([
|
|
11327
|
+
"merge-base",
|
|
11328
|
+
"--is-ancestor",
|
|
11329
|
+
head,
|
|
11330
|
+
expectedDraftSha
|
|
11331
|
+
], {
|
|
11332
|
+
cwd: inspection.gitRoot,
|
|
11333
|
+
env,
|
|
11334
|
+
reject: false
|
|
11335
|
+
});
|
|
11336
|
+
if (headIsAncestor.code === 0) return "behind";
|
|
11337
|
+
return headIsAncestor.code === 1 ? "diverged" : "unknown";
|
|
11338
|
+
}
|
|
11339
|
+
async function assertCheckoutMatchesDraft(inspection, expectedDraftSha, env = checkoutGitEnv()) {
|
|
11288
11340
|
const head = inspection.headSha?.toLowerCase() ?? "";
|
|
11289
11341
|
const expected = expectedDraftSha.toLowerCase();
|
|
11290
11342
|
if (!/^[0-9a-f]{40}$/.test(expected)) throw new ExpectedCliError(`Invalid draft SHA: ${expectedDraftSha}`);
|
|
11291
|
-
if (head
|
|
11343
|
+
if (head === expected) return;
|
|
11344
|
+
const mismatch = `Hosted checkout HEAD (${head || "unknown"}) does not match draft tip ${expected}. `;
|
|
11345
|
+
const relation = await resolveCheckoutDraftRelation(inspection, expected, env);
|
|
11346
|
+
if (relation === "ahead") throw new ExpectedCliError(mismatch + "HEAD has unpublished commits. Run exactly `git push origin HEAD:ks/draft` as a separate command, then retry `keystroke deploy`.");
|
|
11347
|
+
if (relation === "behind") throw new ExpectedCliError(mismatch + "HEAD is behind the shared draft. Run `git fetch origin`, then `git rebase origin/ks/draft` as separate commands, then retry `keystroke deploy`.");
|
|
11348
|
+
if (relation === "diverged") throw new ExpectedCliError(mismatch + "HEAD and the shared draft have diverged. Run `git fetch origin`, `git rebase origin/ks/draft`, and `git push origin HEAD:ks/draft` as separate commands, then retry `keystroke deploy`.");
|
|
11349
|
+
throw new ExpectedCliError(mismatch + "Run `git fetch origin`, `git rebase origin/ks/draft`, and `git push origin HEAD:ks/draft` as separate commands, then retry `keystroke deploy`.");
|
|
11292
11350
|
}
|
|
11293
11351
|
//#endregion
|
|
11294
11352
|
//#region src/commands/deploy-output.ts
|
|
@@ -11481,7 +11539,7 @@ async function runManagedDeploy(client, config, options) {
|
|
|
11481
11539
|
}) : Promise.resolve();
|
|
11482
11540
|
const remotePromise = client.projectGit.getRemote(options.projectId);
|
|
11483
11541
|
const draftStarted = Date.now();
|
|
11484
|
-
|
|
11542
|
+
let draftSha = await resolveManagedDeployDraftSha({
|
|
11485
11543
|
client,
|
|
11486
11544
|
projectId: options.projectId,
|
|
11487
11545
|
root,
|
|
@@ -11745,6 +11803,13 @@ async function runManagedDeploy(client, config, options) {
|
|
|
11745
11803
|
} catch (error) {
|
|
11746
11804
|
if (!isStaleDeployPlanError(error)) throw error;
|
|
11747
11805
|
process.stdout.write("Deploy pins moved — recomputing local preflight once…\n");
|
|
11806
|
+
draftSha = await resolveManagedDeployDraftSha({
|
|
11807
|
+
client,
|
|
11808
|
+
projectId: options.projectId,
|
|
11809
|
+
root,
|
|
11810
|
+
gitContext,
|
|
11811
|
+
verbose
|
|
11812
|
+
});
|
|
11748
11813
|
plan = await resolveManagedDeployPreflight({
|
|
11749
11814
|
cwd: root,
|
|
11750
11815
|
draftSha,
|
|
@@ -11787,7 +11852,7 @@ async function resolveManagedDeployDraftSha(input) {
|
|
|
11787
11852
|
})).commitSha;
|
|
11788
11853
|
const inspection = await assertHostedCheckoutDeployable(input.root, { env: input.gitContext.env });
|
|
11789
11854
|
const revision = await input.client.projectDraft.getRevision(input.projectId);
|
|
11790
|
-
assertCheckoutMatchesDraft(inspection, revision.commitSha);
|
|
11855
|
+
await assertCheckoutMatchesDraft(inspection, revision.commitSha, input.gitContext.env);
|
|
11791
11856
|
if (input.verbose) process.stdout.write(`Hosted checkout ready (${revision.commitSha.slice(0, 12)} on ks/draft).\n`);
|
|
11792
11857
|
return revision.commitSha.toLowerCase();
|
|
11793
11858
|
}
|
|
@@ -14266,7 +14331,7 @@ function createProgram() {
|
|
|
14266
14331
|
async function runCli(argv) {
|
|
14267
14332
|
initCliTelemetry();
|
|
14268
14333
|
try {
|
|
14269
|
-
const { maybeAutoUpdate } = await import("./maybe-auto-update-
|
|
14334
|
+
const { maybeAutoUpdate } = await import("./maybe-auto-update-28IpqxhP.mjs");
|
|
14270
14335
|
await maybeAutoUpdate(argv);
|
|
14271
14336
|
await createProgram().parseAsync(argv);
|
|
14272
14337
|
} finally {
|
|
@@ -14276,4 +14341,4 @@ async function runCli(argv) {
|
|
|
14276
14341
|
//#endregion
|
|
14277
14342
|
export { runCli };
|
|
14278
14343
|
|
|
14279
|
-
//# sourceMappingURL=program-
|
|
14344
|
+
//# sourceMappingURL=program-Ckl_ELbL.mjs.map
|