@keystrokehq/cli 0.1.164 → 0.1.166
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/README.md +1 -0
- package/dist/dist-BFgNzWan.mjs +3 -0
- package/dist/{dist-CGeyFdzI.mjs → dist-DS8gbyzx.mjs} +7 -3
- package/dist/dist-DS8gbyzx.mjs.map +1 -0
- package/dist/dist-D_jn7u5p.mjs +4 -0
- package/dist/{dist-neAmdOvZ.mjs → dist-DeuNAZM1.mjs} +13 -1
- package/dist/{dist-neAmdOvZ.mjs.map → dist-DeuNAZM1.mjs.map} +1 -1
- package/dist/{dist-DesBaiNo.mjs → dist-DoHPZzrH.mjs} +4 -4
- package/dist/{dist-DesBaiNo.mjs.map → dist-DoHPZzrH.mjs.map} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{maybe-auto-update-B-zGDplJ.mjs → maybe-auto-update-BoJ046ks.mjs} +2 -2
- package/dist/{maybe-auto-update-B-zGDplJ.mjs.map → maybe-auto-update-BoJ046ks.mjs.map} +1 -1
- package/dist/{program-Ct4qJuBN.mjs → program-CHp0-LoQ.mjs} +33 -7
- package/dist/program-CHp0-LoQ.mjs.map +1 -0
- package/dist/{run-package-manager-update-D6cBQMsZ.mjs → run-package-manager-update-CCvRXvyl.mjs} +2 -2
- package/dist/{run-package-manager-update-D6cBQMsZ.mjs.map → run-package-manager-update-CCvRXvyl.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-CGeyFdzI.mjs.map +0 -1
- package/dist/dist-CI6ZB7F4.mjs +0 -3
- package/dist/dist-Dw_AbB-4.mjs +0 -4
- package/dist/program-Ct4qJuBN.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-CHp0-LoQ.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-CCvRXvyl.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-BoJ046ks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-auto-update-B-zGDplJ.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,gBAAgB,QAAQ;EACxB,cAAc,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AAQ,OAAO,MAAM,4DAA4D;AACnF"}
|
|
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,MAA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;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 artifactIndexFromModules, Q as withMcpReadClient, X as PublicHttpUrlError, Z as assertPublicHttpUrl, _t as configureTelemetry, bt as shutdownTelemetry, et as collectArtifactModules, gt as captureException, ht as alias, nt as moduleBlobRefsFromModules, tt as mapInParallelBatches, vt as event, yt as flushTelemetry } from "./dist-
|
|
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-CCvRXvyl.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-DeuNAZM1.mjs";
|
|
4
|
+
import { $ as artifactIndexFromModules, Q as withMcpReadClient, X as PublicHttpUrlError, Z as assertPublicHttpUrl, _t as configureTelemetry, bt as shutdownTelemetry, et as collectArtifactModules, gt as captureException, ht as alias, nt as moduleBlobRefsFromModules, tt as mapInParallelBatches, vt as event, yt as flushTelemetry } from "./dist-DS8gbyzx.mjs";
|
|
5
|
+
import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-DoHPZzrH.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { homedir, platform, release, tmpdir } from "node:os";
|
|
@@ -8736,6 +8736,31 @@ function registerCredentialsListCommand(credentials) {
|
|
|
8736
8736
|
}));
|
|
8737
8737
|
}
|
|
8738
8738
|
//#endregion
|
|
8739
|
+
//#region src/commands/credentials/reconnect.ts
|
|
8740
|
+
function registerCredentialsReconnectCommand(credentials) {
|
|
8741
|
+
credentials.command("reconnect").description("Reconnect an existing credential in the web app").argument("<id>", "Credential id").option("--print-url", "Print the reconnect URL without opening the browser").action((credentialId, options) => runCliCommand("Reconnect credential failed", async () => {
|
|
8742
|
+
const config = createCliConfig();
|
|
8743
|
+
const membership = await resolveActiveOrganization(config);
|
|
8744
|
+
runCredentialReconnect({
|
|
8745
|
+
webUrl: getWebUrl(config),
|
|
8746
|
+
organizationSlug: membership.organization.slug,
|
|
8747
|
+
credentialId,
|
|
8748
|
+
printUrl: options.printUrl
|
|
8749
|
+
});
|
|
8750
|
+
}, void 0, { orgScoped: true }));
|
|
8751
|
+
}
|
|
8752
|
+
function runCredentialReconnect(options) {
|
|
8753
|
+
const base = options.webUrl.replace(/\/+$/, "");
|
|
8754
|
+
const credentialId = encodeURIComponent(options.credentialId);
|
|
8755
|
+
const url = `${base}/${options.organizationSlug}/apps/${credentialId}?reconnect=true`;
|
|
8756
|
+
if (options.printUrl) {
|
|
8757
|
+
process.stdout.write(`${url}\n`);
|
|
8758
|
+
return;
|
|
8759
|
+
}
|
|
8760
|
+
openUrl(url);
|
|
8761
|
+
process.stdout.write("Opening credential reconnect flow in your browser.\n");
|
|
8762
|
+
}
|
|
8763
|
+
//#endregion
|
|
8739
8764
|
//#region src/project/env-ref.ts
|
|
8740
8765
|
const ENV_REF_PREFIX = "@env:";
|
|
8741
8766
|
function isEnvRef(raw) {
|
|
@@ -8856,6 +8881,7 @@ function registerCredentialsCommand(program) {
|
|
|
8856
8881
|
const credentials = program.command("credentials").description("Manage platform app credentials");
|
|
8857
8882
|
registerCredentialsListCommand(credentials);
|
|
8858
8883
|
registerCredentialsGetCommand(credentials);
|
|
8884
|
+
registerCredentialsReconnectCommand(credentials);
|
|
8859
8885
|
registerCredentialsCreateCommand(credentials);
|
|
8860
8886
|
registerCredentialsUpdateCommand(credentials);
|
|
8861
8887
|
registerCredentialsDuplicateCommand(credentials);
|
|
@@ -8999,7 +9025,7 @@ function registerBuildCommand(program) {
|
|
|
8999
9025
|
try {
|
|
9000
9026
|
const root = resolveProjectRoot(options.dir);
|
|
9001
9027
|
await ensureSdkCurrent(root);
|
|
9002
|
-
const { buildApp } = await import("./dist-
|
|
9028
|
+
const { buildApp } = await import("./dist-BFgNzWan.mjs");
|
|
9003
9029
|
await buildApp({ root });
|
|
9004
9030
|
process.stdout.write(`Built ${root}\n`);
|
|
9005
9031
|
} catch (error) {
|
|
@@ -14240,7 +14266,7 @@ function createProgram() {
|
|
|
14240
14266
|
async function runCli(argv) {
|
|
14241
14267
|
initCliTelemetry();
|
|
14242
14268
|
try {
|
|
14243
|
-
const { maybeAutoUpdate } = await import("./maybe-auto-update-
|
|
14269
|
+
const { maybeAutoUpdate } = await import("./maybe-auto-update-BoJ046ks.mjs");
|
|
14244
14270
|
await maybeAutoUpdate(argv);
|
|
14245
14271
|
await createProgram().parseAsync(argv);
|
|
14246
14272
|
} finally {
|
|
@@ -14250,4 +14276,4 @@ async function runCli(argv) {
|
|
|
14250
14276
|
//#endregion
|
|
14251
14277
|
export { runCli };
|
|
14252
14278
|
|
|
14253
|
-
//# sourceMappingURL=program-
|
|
14279
|
+
//# sourceMappingURL=program-CHp0-LoQ.mjs.map
|