@keystrokehq/cli 0.1.163 → 0.1.165

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.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import "./dist-DeuNAZM1.mjs";
3
+ import { _ as emitStoredRouteManifestForProject } from "./dist-CVNEZzw5.mjs";
4
+ export { emitStoredRouteManifestForProject };
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-CKQqD-RE.mjs");
43
+ const { runCli } = await import("./program-zSW0qI2G.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-D_nLqg4e.mjs";
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-oRHYV8-i.mjs.map
144
+ //# sourceMappingURL=maybe-auto-update-BoJ046ks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-auto-update-oRHYV8-i.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,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AChB;CAEA,IAAI,OAAO,IAAI;EACb,sBAAsB;EACtB;CACF;CAEA,IAAI,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
+ {"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,UA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,QAAQ,eAAe,MAChH;CAEA,MAAM,SAAS,wBAAwB,SAAS,OAAO;CACvD,MAAM,mBAAmB,eAAe;CAExC,IAAI,iBAAiB,KAAK,MAAM,eAAe,KAAK,GAAG;EACrD,sBAAsB;EACtB,QAAQ,OAAO,MAAM,4BAA4B,eAAe,MAAM,iBAAiB,IAAI;EAC3F,UAAU,IAAI;CAChB;CAEA,IAAI,OAAO,IAAI;EACb,sBAAsB;EACtB;CACF;CAEA,IAAI,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-D_nLqg4e.mjs";
3
- import { $ as DownloadActiveProjectArtifactResponseSchema, $i as CreateBillingPortalRequestSchema, $n as SkillSummaryDetailResponseSchema, $r as WorkflowSummaryDetailResponseSchema, $t as OpenApiDiscoverResponseSchema, A as CreateApiKeyResponseSchema, Ai as CredentialAssignmentRecordSchema, An as ProjectGitStatusResponseSchema, Ar as UpdateOrganizationRequestSchema, At as ListApiKeysResponseSchema, B as CreateProjectArtifactRequestSchema, Bi as ACTIVE_ORG_HEADER, Bn as PublicFormSubmitResponseSchema, Br as UserPreferencesPatchSchema, Bt as ListOrganizationMembersPageResponseSchema, C as CompleteManagedDeployArtifactResponseSchema, Ci as resolveConnectAppSlug, Cn as PresignProjectSourceRequestSchema, Cr as TriggerRunListResponseSchema, Ct as HistoryRunListResponseSchema, D as ConnectManagedServiceCredentialRequestSchema, Di as AssignCredentialBodySchema, Dr as UpdateManagedServiceCredentialRequestSchema, Dt as InviteProjectMembersResponseSchema, E as ConnectAuthorizeUrlResponseSchema, En as PresignUserAvatarResponseSchema, Er as UpdateCredentialRequestSchema, Et as InviteProjectMembersRequestSchema, F as CreateCustomAppResponseSchema, Fn as ProjectSlugAvailabilityResponseSchema, Fr as UploadProjectSourceManifestRequestSchema, Ft as ListDraftFilesResponseSchema, G as CreateSlackAppResponseSchema, Gi as AutoTopupSummarySchema, Gn as QueuedAgentPromptResponseSchema, Gr as WorkflowFormResponseSchema, Gt as ListProjectMetricsResponseSchema, H as CreateProjectRequestSchema, Hi as PresignChatAttachmentRequestSchema, Hn as PublishManagedDeployCandidateResponseSchema, Hr as WorkflowCanvasCredentialBindingsSchema, Ht as ListProjectDeploymentsResponseSchema, I as CreateDraftCommitRequestSchema, In as PromptInputSchema, Ir as UploadProjectSourceResponseSchema, It as ListManagedServiceCredentialsResponseSchema, J as CredentialInstanceListResponseSchema, Ji as BillingRedirectResponseSchema, Jn as RenewManagedDeployUploadRequestSchema, Jr as WorkflowRunHooksResponseSchema, Jt as MANAGED_DEPLOY_REQUEST_TIMEOUT_MS, K as CreateSlackChannelBodySchema, Ki as BillingActivityResponseSchema, Kn as QueuedRunResponseSchema, Kr as WorkflowFormUpsertBodySchema, Kt as ListProjectsResponseSchema, L as CreateDraftDiffCommitRequestSchema, Ln as PromptResponseSchema, Lr as UpsertGatewayAttachmentBodySchema, Lt as ListMcpAppToolsResponseSchema, M as CreateCredentialsRequestSchema, Mi as CredentialConsumerListResponseSchema, Mn as ProjectReachabilityResponseSchema, Mr as UpdateProjectMemberResponseSchema, Mt as ListChannelPlatformsResponseSchema, N as CreateCredentialsResponseSchema, Ni as ExecuteKeystrokeToolRequestSchema, Nn as ProjectResponseSchema, Nr as UpdateProjectRequestSchema, Nt as ListCredentialsPageQuerySchema, O as ConnectProvidersResponseSchema, Oi as CredentialAssignmentListQuerySchema, On as ProjectGitRemoteRequestSchema, Or as UpdateOrganizationMemberRequestSchema, Ot as ListAgentMemoryFilesResponseSchema, P as CreateCustomAppRequestSchema, Pn as ProjectSettingsResponseSchema, Pr as UpdateProjectSettingsRequestSchema, Pt as ListCredentialsPageResponseSchema, Q as DeclineOrganizationInvitationResponseSchema, Qi as ConfirmCheckoutResponseSchema, Qr as WorkflowRunResponseSchema, Qt as McpDiscoverResponseSchema, R as CreateOrganizationRequestSchema, Rn as PublicFormMetadataSchema, Rr as UserAvatarPatchSchema, Rt as ListOrganizationInvitationsResponseSchema, S as CompleteManagedDeployArtifactRequestSchema, Sn as PresignOrgLogoResponseSchema, Sr as TriggerRunDetailResponseSchema, St as HistoryRunListQuerySchema, T as CompleteProjectArtifactResponseSchema, Ti as slugifyAppName, Tn as PresignUserAvatarRequestSchema, Tr as UpdateCredentialInstanceBodySchema, Tt as InviteOrganizationMembersResponseSchema, U as CreateProjectResponseSchema, Ui as PresignChatAttachmentResponseSchema, Un as PublishedFormListResponseSchema, Ur as WorkflowCanvasRunSchema, Ut as ListProjectFilesResponseSchema, V as CreateProjectArtifactResponseSchema, Vi as CLIENT_CHANNEL_HEADER, Vn as PublishManagedDeployCandidateRequestSchema, Vr as UserPreferencesSchema, Vt as ListOrganizationsResponseSchema, W as CreateSlackAppRequestSchema, Wn as PublishedFormSchema, Wr as WorkflowCanvasSchema, Wt as ListProjectMembersResponseSchema, X as DOCS_QUERY_TOOL, Xi as BillingUsageResponseSchema, Xr as WorkflowRunInputsSchema, Xt as ManagedServiceCredentialSchema, Y as CredentialInstanceRecordSchema, Yi as BillingSummaryResponseSchema, Yn as RenewManagedDeployUploadResponseSchema, Yr as WorkflowRunInputsPutBodySchema, Yt as ManagedDeployResourceKeySchema, Z as DOCS_SEARCH_TOOL, Zi as ConfirmCheckoutRequestSchema, Zn as SLACK_PERSONAL_APP_SLUG, Zr as WorkflowRunListResponseSchema, Zt as ManagedServiceKindSchema, _ as CatalogAppsPageResponseSchema, _n as PrepareManagedDeployRequestSchema, _r as TemplateFilesResponseSchema, _t as HealthResponseSchema, a as AgentSessionListResponseSchema, ai as WorkspaceTriggerRunListResponseSchema, ar as SlackAppManifestResponseSchema, at as DraftUpdateEventSchema, b as ChannelConnectionSchema, bn as PresignCustomAppLogoResponseSchema, br as TriggerInvokeResponseSchema, bt as HistoryRunCancelResponseSchema, c as AgentTriggerSummaryListResponseSchema, ci as buildConnectDeeplink, cr as StartKeystrokeConnectionInputSchema, ct as FinalizeCustomAppLogoRequestSchema, d as BindChannelBodySchema, di as gitPorcelainLineTouchesManagedDraftPublishPath, dr as StartMcpOAuthConnectionResultSchema, dt as GatewayAttachmentRecordSchema, ea as CreateCreditsCheckoutRequestSchema, ei as WorkflowSummaryListResponseSchema, en as OrganizationSidebarBrandingPatchSchema, er as SkillSummaryListResponseSchema, et as DownloadActiveProjectSourceResponseSchema, f as CancelManagedDeployRequestSchema, fi as isAcceptableInstallExit, fn as PlatformAgentCancelResponseSchema, fr as StartOAuthConnectionInputSchema, ft as GetAppCatalogEntryResponseSchema, g as CatalogAppDetailResponseSchema, gi as normalizeDocsSearchPaths, gn as PlatformAgentSessionListResponseSchema, gr as SubmitTeamRequestRequestSchema, gt as GraphqlDiscoverResponseSchema, h as CatalogActionsPageResponseSchema, hn as PlatformAgentSessionDetailResponseSchema, hr as SubmitMarketingContactRequestSchema, ht as GetTemplateResponseSchema, i as AgentSessionDetailResponseSchema, ii as WorkspaceTriggerOverviewSchema, in as PROJECT_DRAFT_DIFF_MAX_BYTES, ir as SlackAppManifestRequestSchema, it as DraftRevisionResponseSchema, j as CreateCredentialInstanceBodySchema, ji as CredentialConsumerListQuerySchema, jn as ProjectPullStateSchema, jr as UpdateProjectMemberRequestSchema, jt as ListAppsResponseSchema, k as CreateApiKeyRequestSchema, ki as CredentialAssignmentListResponseSchema, kn as ProjectGitRemoteResponseSchema, kr as UpdateOrganizationMemberResponseSchema, kt as ListAgentWorkspaceFilesResponseSchema, l as AppSlugAvailabilityResponseSchema, li as deriveCustomAppDisplay, lr as StartKeystrokeConnectionResultSchema, lt as FinalizeCustomAppLogoResponseSchema, m as CatalogActionDetailResponseSchema, mi as isIgnoredProjectSourcePath, mn as PlatformAgentPromptResponseSchema, mr as SubmitAgentFeedbackRequestSchema, mt as GetCustomAppResponseSchema, n as ActiveOrganizationResponseSchema, na as UpdateAutoTopupRequestSchema, ni as WorkspaceTriggerFileSchema, nn as PNPM_FROZEN_INSTALL_ARGS, nr as SlackAppInstallStartResponseSchema, nt as DraftConflictResponseSchema, o as AgentSummaryDetailResponseSchema, oi as WorkspaceWorkflowOverviewSchema, on as PROJECT_PULL_STATE_RELATIVE_PATH, or as SlackMembershipChannelBodySchema, ot as DuplicateCredentialRequestSchema, p as CancelManagedDeployResponseSchema, pn as PlatformAgentPromptInputSchema, pr as StartOAuthConnectionResultSchema, pt as GetCredentialResponseSchema, q as CreateSlackChannelResponseSchema, qi as BillingInvoiceUrlResponseSchema, qn as RecentResourceListResponseSchema, qr as WorkflowRunDetailResponseSchema, qt as ListTemplatesResponseSchema, r as ActiveProjectSourceRevisionSchema, ri as WorkspaceTriggerListResponseSchema, rn as PROJECT_DRAFT_COMMIT_REQUEST_TIMEOUT_MS, rr as SlackAppListResponseSchema, rt as DraftFileContentResponseSchema, s as AgentSummaryListResponseSchema, si as buildAgentSlackDeeplink, sn as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, sr as SlugAvailabilityResponseSchema, st as DuplicateCredentialsResponseSchema, t as AcceptOrganizationInvitationResponseSchema, ta as CreateSubscriptionCheckoutRequestSchema, ti as WorkspaceTriggerDetailSchema, tn as OrganizationSidebarBrandingSchema, tr as SlackAgentMembershipsResponseSchema, tt as DraftCommitResponseSchema, u as BindAgentSlackAppBodySchema, ui as detectProjectPackageManagerFromSnapshot, ur as StartMcpOAuthConnectionInputSchema, ut as FormFieldConfigSchema, v as ChannelAccountListResponseSchema, vi as parseAppSlug, vn as PrepareManagedDeployResponseSchema, vr as TriggerDetailResponseSchema, vt as HeartbeatManagedDeployRequestSchema, w as CompleteProjectArtifactRequestSchema, wi as resolveDocsMcpUrl, wn as PresignProjectSourceResponseSchema, wr as UpdateChannelBindingBodySchema, wt as InviteOrganizationMembersRequestSchema, x as ChannelDirectoryListResponseSchema, xi as parseSlackConnectFlow, xn as PresignOrgLogoRequestSchema, xr as TriggerListResponseSchema, xt as HistoryRunDetailResponseSchema, y as ChannelConnectionListResponseSchema, yi as parseErrorResponse, yn as PresignCustomAppLogoRequestSchema, yr as TriggerInvokeInputsSchema, yt as HeartbeatManagedDeployResponseSchema, z as CreateOrganizationResponseSchema, zn as PublicFormSubmitBodySchema, zr as UserAvatarSchema, zt as ListOrganizationMembersPageQuerySchema } from "./dist-BgPOKEEt.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-fy1jz-eq.mjs";
5
- import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-v54rjb2O.mjs";
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-CVNEZzw5.mjs";
5
+ import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-DcpFx-Ew.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import { Command } from "commander";
8
8
  import { homedir, platform, release, tmpdir } from "node:os";
@@ -4804,6 +4804,14 @@ function createAgentsResource(http) {
4804
4804
  throw await toPlatformError(error);
4805
4805
  }
4806
4806
  },
4807
+ async snapshotEnvImage(projectId, agentSlug) {
4808
+ try {
4809
+ const data = await (await http.post(`api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentSlug)}/env-image`)).json();
4810
+ return AgentEnvImageSnapshotResponseSchema.parse(data);
4811
+ } catch (error) {
4812
+ throw await toPlatformError(error);
4813
+ }
4814
+ },
4807
4815
  /** Deletes an agent-owned ephemeral trigger; throws if it is not deletable (404). */
4808
4816
  async deleteTrigger(projectId, agentSlug, triggerId) {
4809
4817
  try {
@@ -7529,12 +7537,36 @@ Examples:
7529
7537
  });
7530
7538
  }
7531
7539
  //#endregion
7540
+ //#region src/commands/channels/resolve-channel-project.ts
7541
+ async function resolveChannelProjectId(config) {
7542
+ await resolveActiveOrganization(config);
7543
+ const platform = createCliPlatformClient(config);
7544
+ const ref = resolveActiveProjectRef();
7545
+ if (!ref) throw missingProjectRefError();
7546
+ return (await resolveProjectRef(platform, ref)).id;
7547
+ }
7548
+ //#endregion
7549
+ //#region src/commands/agents/snapshot.ts
7550
+ function registerAgentSnapshotCommand(agent) {
7551
+ agent.command("snapshot").description("Build (or reuse) an org-scoped Modal env Image from the agent's defineSandbox({ setup })").argument("<agent>", "Agent slug").addHelpText("after", `
7552
+ Examples:
7553
+ keystroke agents snapshot support
7554
+ `).action((agentSlug) => runCliCommand("Agent env snapshot failed", async () => {
7555
+ const config = createCliConfig();
7556
+ await resolveActiveOrganization(config);
7557
+ const projectId = await resolveChannelProjectId(config);
7558
+ const result = await createCliPlatformClient(config).agents.snapshotEnvImage(projectId, agentSlug);
7559
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
7560
+ }, void 0, { orgScoped: true }));
7561
+ }
7562
+ //#endregion
7532
7563
  //#region src/commands/agents/index.ts
7533
7564
  function registerAgentsCommand(program) {
7534
7565
  const agents = program.command("agents").description("Invoke and inspect agents");
7535
7566
  registerAgentListCommand(agents);
7536
7567
  registerAgentPromptCommand(agents);
7537
7568
  registerAgentSessionsCommand(agents);
7569
+ registerAgentSnapshotCommand(agents);
7538
7570
  }
7539
7571
  //#endregion
7540
7572
  //#region src/commands/api-key/run-api-key.ts
@@ -8411,15 +8443,6 @@ function registerTemplatesCommand(program) {
8411
8443
  registerTemplatesApplyCommand(templates);
8412
8444
  }
8413
8445
  //#endregion
8414
- //#region src/commands/channels/resolve-channel-project.ts
8415
- async function resolveChannelProjectId(config) {
8416
- await resolveActiveOrganization(config);
8417
- const platform = createCliPlatformClient(config);
8418
- const ref = resolveActiveProjectRef();
8419
- if (!ref) throw missingProjectRefError();
8420
- return (await resolveProjectRef(platform, ref)).id;
8421
- }
8422
- //#endregion
8423
8446
  //#region src/auth/open-url.ts
8424
8447
  function openUrl(url) {
8425
8448
  const platform = process.platform;
@@ -8976,7 +8999,7 @@ function registerBuildCommand(program) {
8976
8999
  try {
8977
9000
  const root = resolveProjectRoot(options.dir);
8978
9001
  await ensureSdkCurrent(root);
8979
- const { buildApp } = await import("./dist-Co-J5D_c.mjs");
9002
+ const { buildApp } = await import("./dist-BKbs8X8F.mjs");
8980
9003
  await buildApp({ root });
8981
9004
  process.stdout.write(`Built ${root}\n`);
8982
9005
  } catch (error) {
@@ -8988,12 +9011,17 @@ function registerBuildCommand(program) {
8988
9011
  }
8989
9012
  //#endregion
8990
9013
  //#region src/deploy/assert-portable-dependencies.ts
9014
+ const LINK_SPEC = /^link:/i;
8991
9015
  const NONPORTABLE_SPEC = /^(?:link:|workspace:|file:(?:\.\.?(?:\/|$)|\/|[A-Za-z]:\\|~))/i;
8992
9016
  /**
8993
9017
  * Reject tracked dependency specs that cannot resolve in disposable/server
8994
9018
  * checkouts (absolute/local link:, external file:, unresolved workspace:).
9019
+ *
9020
+ * `KEYSTROKE_ALLOW_NONPORTABLE_DEPS=1` (local packs / soak deploys) permits
9021
+ * `link:` only — `file:` and unresolved `workspace:` still fail the gate.
8995
9022
  */
8996
9023
  async function assertPortableProjectDependencies(projectRoot) {
9024
+ const allowLinkDeps = process.env.KEYSTROKE_ALLOW_NONPORTABLE_DEPS === "1";
8997
9025
  const packageJsonPath = join(projectRoot, "package.json");
8998
9026
  let raw;
8999
9027
  try {
@@ -9021,7 +9049,9 @@ async function assertPortableProjectDependencies(projectRoot) {
9021
9049
  if (!deps || typeof deps !== "object") continue;
9022
9050
  for (const [name, spec] of Object.entries(deps)) {
9023
9051
  if (typeof spec !== "string") continue;
9024
- if (NONPORTABLE_SPEC.test(spec.trim())) offenders.push(`${name}@${spec}`);
9052
+ const trimmed = spec.trim();
9053
+ if (allowLinkDeps && LINK_SPEC.test(trimmed)) continue;
9054
+ if (NONPORTABLE_SPEC.test(trimmed)) offenders.push(`${name}@${spec}`);
9025
9055
  }
9026
9056
  }
9027
9057
  if (offenders.length === 0) return;
@@ -14210,7 +14240,7 @@ function createProgram() {
14210
14240
  async function runCli(argv) {
14211
14241
  initCliTelemetry();
14212
14242
  try {
14213
- const { maybeAutoUpdate } = await import("./maybe-auto-update-oRHYV8-i.mjs");
14243
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-BoJ046ks.mjs");
14214
14244
  await maybeAutoUpdate(argv);
14215
14245
  await createProgram().parseAsync(argv);
14216
14246
  } finally {
@@ -14220,4 +14250,4 @@ async function runCli(argv) {
14220
14250
  //#endregion
14221
14251
  export { runCli };
14222
14252
 
14223
- //# sourceMappingURL=program-CKQqD-RE.mjs.map
14253
+ //# sourceMappingURL=program-zSW0qI2G.mjs.map