@keystrokehq/cli 0.1.70 → 0.1.71

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/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { $ as CredentialConsumerListResponseSchema, $n as WorkflowRunInputsSchema, $t as PresignUserAvatarRequestSchema, A as ConfirmCheckoutResponseSchema, An as UpdateCredentialInstanceBodySchema, At as ListOrganizationInvitationsResponseSchema, B as CreateCreditsCheckoutRequestSchema, Bn as UploadProjectSourceManifestRequestSchema, Bt as McpDiscoverResponseSchema, C as ChannelAccountListResponseSchema, Cn as SubmitTeamRequestRequestSchema, Cr as resolveDocsMcpUrl, D as ChannelPlatformSchema, Dn as TriggerRunListResponseSchema, Dt as ListAppsResponseSchema, E as ChannelDirectoryListResponseSchema, En as TriggerRunDetailResponseSchema, Et as ListApiKeysResponseSchema, F as CreateApiKeyResponseSchema, Fn as UpdateOrganizationRequestSchema, Ft as ListProjectMembersResponseSchema, G as CreateProjectArtifactResponseSchema, Gn as UserPreferencesPatchSchema, Gt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, H as CreateCustomAppResponseSchema, Hn as UpsertGatewayAttachmentBodySchema, Ht as OrganizationSidebarBrandingPatchSchema, I as CreateBillingPortalRequestSchema, In as UpdateProjectMemberRequestSchema, It as ListProjectMetricsResponseSchema, J as CreateSubscriptionCheckoutRequestSchema, Jn as WorkflowCanvasRunSchema, Jt as PresignChatAttachmentResponseSchema, K as CreateProjectRequestSchema, Kn as UserPreferencesSchema, Kt as PollRunResponseSchema, L as CreateCredentialInstanceBodySchema, Ln as UpdateProjectMemberResponseSchema, Lt as ListProjectsResponseSchema, M as ConnectManagedServiceCredentialRequestSchema, Mn as UpdateManagedServiceCredentialRequestSchema, Mt as ListOrganizationsResponseSchema, N as ConnectProvidersResponseSchema, Nn as UpdateOrganizationMemberRequestSchema, Nt as ListProjectDeploymentsResponseSchema, O as CompleteProjectArtifactResponseSchema, On as UpdateAutoTopupRequestSchema, Ot as ListCredentialsResponseSchema, P as CreateApiKeyRequestSchema, Pn as UpdateOrganizationMemberResponseSchema, Pt as ListProjectFilesResponseSchema, Q as CredentialConsumerListQuerySchema, Qn as WorkflowRunInputsPutBodySchema, Qt as PresignProjectSourceResponseSchema, R as CreateCredentialsRequestSchema, Rn as UpdateProjectRequestSchema, Rt as ManagedServiceCredentialSchema, S as CatalogAppsPageResponseSchema, Sn as SubmitMarketingContactRequestSchema, Sr as resolveConnectAppSlug, St as InviteProjectMembersResponseSchema, T as ChannelConnectionSchema, Tn as TriggerListResponseSchema, Tr as slugifyAppName, Tt as ListAgentWorkspaceFilesResponseSchema, U as CreateOrganizationRequestSchema, Un as UserAvatarPatchSchema, Ut as OrganizationSidebarBrandingSchema, V as CreateCustomAppRequestSchema, Vn as UploadProjectSourceResponseSchema, Vt as OpenApiDiscoverResponseSchema, W as CreateOrganizationResponseSchema, Wn as UserAvatarSchema, Wt as PROJECT_PULL_STATE_RELATIVE_PATH, X as CredentialAssignmentListResponseSchema, Xn as WorkflowRunDetailResponseSchema, Xt as PresignOrgLogoResponseSchema, Y as CredentialAssignmentListQuerySchema, Yn as WorkflowCanvasSchema, Yt as PresignOrgLogoRequestSchema, Z as CredentialAssignmentRecordSchema, Zn as WorkflowRunHooksResponseSchema, Zt as PresignProjectSourceRequestSchema, _ as BillingUsageResponseSchema, _n as StartKeystrokeConnectionResultSchema, _t as HistoryRunListQuerySchema, a as AgentSessionDetailResponseSchema, an as ProjectSlugAvailabilityResponseSchema, ar as WorkspaceTriggerFileSchema, at as DeclineOrganizationInvitationResponseSchema, b as CatalogActionsPageResponseSchema, bn as StartOAuthConnectionInputSchema, bt as InviteOrganizationMembersResponseSchema, c as AgentSummaryListResponseSchema, cr as WorkspaceTriggerRunListResponseSchema, ct as ErrorResponseSchema, d as AssignCredentialBodySchema, dt as GetCredentialResponseSchema, en as PresignUserAvatarResponseSchema, er as WorkflowRunListResponseSchema, et as CredentialInstanceListResponseSchema, f as AutoTopupSummarySchema, fn as RecentResourceListResponseSchema, fr as deriveCustomAppDisplay, ft as GetCustomAppResponseSchema, g as BillingSummaryResponseSchema, gn as StartKeystrokeConnectionInputSchema, gt as HistoryRunDetailResponseSchema, h as BillingRedirectResponseSchema, hn as SlugAvailabilityResponseSchema, hr as listenPortFromPublicUrl, ht as HistoryRunCancelResponseSchema, i as AgentSessionChatStateResponseSchema, in as ProjectSettingsResponseSchema, ir as WorkspaceTriggerDetailSchema, it as DOCS_SEARCH_TOOL, j as ConnectAuthorizeUrlResponseSchema, jn as UpdateCredentialRequestSchema, jt as ListOrganizationMembersResponseSchema, k as ConfirmCheckoutRequestSchema, kn as UpdateChannelBindingBodySchema, kt as ListManagedServiceCredentialsResponseSchema, l as AgentTriggerSummaryListResponseSchema, ln as QueuedAgentPromptResponseSchema, lr as WorkspaceWorkflowOverviewSchema, lt as ExecuteKeystrokeToolRequestSchema, m as BillingInvoiceUrlResponseSchema, mn as SkillSummaryListResponseSchema, mr as isAcceptableInstallExit, mt as HealthResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as ProjectReachabilityResponseSchema, nr as WorkflowSummaryDetailResponseSchema, o as AgentSessionListResponseSchema, on as PromptInputSchema, or as WorkspaceTriggerListResponseSchema, ot as DownloadActiveProjectArtifactResponseSchema, p as BillingActivityResponseSchema, pn as SkillSummaryDetailResponseSchema, pr as detectProjectPackageManagerFromSnapshot, pt as GraphqlDiscoverResponseSchema, q as CreateProjectResponseSchema, qn as WorkflowCanvasCredentialBindingsSchema, qt as PresignChatAttachmentRequestSchema, r as ActiveOrganizationResponseSchema, rn as ProjectResponseSchema, rr as WorkflowSummaryListResponseSchema, rt as DOCS_QUERY_TOOL, s as AgentSummaryDetailResponseSchema, sn as PromptResponseSchema, sr as WorkspaceTriggerOverviewSchema, st as DownloadActiveProjectSourceResponseSchema, t as ACTIVE_ORG_HEADER, tn as ProjectPullStateSchema, tr as WorkflowRunResponseSchema, tt as CredentialInstanceRecordSchema, u as AppSlugAvailabilityResponseSchema, un as QueuedRunResponseSchema, ur as buildConnectDeeplink, ut as GatewayAttachmentRecordSchema, v as BindChannelBodySchema, vn as StartMcpOAuthConnectionInputSchema, vr as parseAppSlug, vt as HistoryRunListResponseSchema, w as ChannelConnectionListResponseSchema, wn as TriggerDetailResponseSchema, wr as resolvePublicPlatformOrigin, wt as ListAgentMemoryFilesResponseSchema, x as CatalogAppDetailResponseSchema, xn as StartOAuthConnectionResultSchema, xt as InviteProjectMembersRequestSchema, y as CatalogActionDetailResponseSchema, yn as StartMcpOAuthConnectionResultSchema, yr as parseErrorResponse, yt as InviteOrganizationMembersRequestSchema, z as CreateCredentialsResponseSchema, zn as UpdateProjectSettingsRequestSchema, zt as ManagedServiceKindSchema } from "./dist-Bzry3J_e.mjs";
3
3
  import { i as packProjectArtifact, n as withMcpReadClient, r as mergeFilteredArtifact, t as mapInParallelBatches } from "./dist-Dfp6ywxz.mjs";
4
- import { _ as getPlatformUrl, c as detectPackageManager, d as resolveGithubPackagesToken, f as resolvePackageManager, g as getEffectiveApiTarget, h as getConfigDir, i as isReleaseAgeBlock, l as installDependencies$1, m as getCliConfigDir, n as resolveCliRoot, o as detectManagerFromLockfile, p as createCliConfig, s as buildPlaygroundWorkspace, t as readCliVersion, u as installPlaygroundDependencies, v as getWebUrl, x as resolvePlatformUrlForWebUrl, y as DEFAULT_PLATFORM_URL } from "./version-D4niTLnU.mjs";
4
+ import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as isNewerVersion, d as getConfigDir, f as getEffectiveApiTarget, h as DEFAULT_PLATFORM_URL, i as installDependencies$1, l as createCliConfig, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getPlatformUrl, s as resolveCliRoot, t as readCliVersion, u as getCliConfigDir } from "./version-DEkbd-OE.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import { Command } from "commander";
7
7
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -1743,7 +1743,7 @@ function createJwtTokenCache(mint) {
1743
1743
  };
1744
1744
  }
1745
1745
  //#endregion
1746
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/version.mjs
1746
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/version.mjs
1747
1747
  const PACKAGE_VERSION = "1.6.11";
1748
1748
  //#endregion
1749
1749
  //#region ../../node_modules/.pnpm/better-call@1.3.5_zod@4.4.3/node_modules/better-call/dist/error.mjs
@@ -1868,7 +1868,7 @@ var BetterAuthError = class extends Error {
1868
1868
  }
1869
1869
  };
1870
1870
  //#endregion
1871
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
1871
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
1872
1872
  const deviceAuthorizationClient = () => {
1873
1873
  return {
1874
1874
  id: "device-authorization",
@@ -2013,7 +2013,7 @@ let onMount = ($store, initialize) => {
2013
2013
  });
2014
2014
  };
2015
2015
  //#endregion
2016
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/query.mjs
2016
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/query.mjs
2017
2017
  const isServer = () => typeof window === "undefined";
2018
2018
  const useAuthQuery = (initializedAtom, path, $fetch, options) => {
2019
2019
  const value = /* @__PURE__ */ atom({
@@ -2107,7 +2107,7 @@ const useAuthQuery = (initializedAtom, path, $fetch, options) => {
2107
2107
  return value;
2108
2108
  };
2109
2109
  //#endregion
2110
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/broadcast-channel.mjs
2110
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/broadcast-channel.mjs
2111
2111
  const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
2112
2112
  const now$1 = () => Math.floor(Date.now() / 1e3);
2113
2113
  var WindowBroadcastChannel = class {
@@ -2150,7 +2150,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
2150
2150
  return globalThis[kBroadcastChannel];
2151
2151
  }
2152
2152
  //#endregion
2153
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/focus-manager.mjs
2153
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/focus-manager.mjs
2154
2154
  const kFocusManager = Symbol.for("better-auth:focus-manager");
2155
2155
  var WindowFocusManager = class {
2156
2156
  listeners = /* @__PURE__ */ new Set();
@@ -2179,7 +2179,7 @@ function getGlobalFocusManager() {
2179
2179
  return globalThis[kFocusManager];
2180
2180
  }
2181
2181
  //#endregion
2182
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/online-manager.mjs
2182
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/online-manager.mjs
2183
2183
  const kOnlineManager = Symbol.for("better-auth:online-manager");
2184
2184
  var WindowOnlineManager = class {
2185
2185
  listeners = /* @__PURE__ */ new Set();
@@ -2211,7 +2211,7 @@ function getGlobalOnlineManager() {
2211
2211
  return globalThis[kOnlineManager];
2212
2212
  }
2213
2213
  //#endregion
2214
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/parser.mjs
2214
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/parser.mjs
2215
2215
  const PROTO_POLLUTION_PATTERNS = {
2216
2216
  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*:/,
2217
2217
  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*:/,
@@ -2281,7 +2281,7 @@ function parseJSON(value, options = { strict: true }) {
2281
2281
  return betterJSONParse(value, options);
2282
2282
  }
2283
2283
  //#endregion
2284
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/session-refresh.mjs
2284
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/session-refresh.mjs
2285
2285
  const now = () => Math.floor(Date.now() / 1e3);
2286
2286
  /**
2287
2287
  * Normalize $fetch response: `throw: true` returns data directly, otherwise `{ data, error }`.
@@ -2479,7 +2479,7 @@ Object.freeze({
2479
2479
  }
2480
2480
  });
2481
2481
  //#endregion
2482
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/utils/url.mjs
2482
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/utils/url.mjs
2483
2483
  function checkHasPath(url) {
2484
2484
  try {
2485
2485
  return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
@@ -2551,7 +2551,7 @@ function getOrigin(url) {
2551
2551
  }
2552
2552
  }
2553
2553
  //#endregion
2554
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/fetch-plugins.mjs
2554
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/fetch-plugins.mjs
2555
2555
  const redirectPlugin = {
2556
2556
  id: "redirect",
2557
2557
  name: "Redirect",
@@ -2566,7 +2566,7 @@ const redirectPlugin = {
2566
2566
  } }
2567
2567
  };
2568
2568
  //#endregion
2569
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/session-atom.mjs
2569
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/session-atom.mjs
2570
2570
  function getSessionAtom($fetch, options) {
2571
2571
  const $signal = /* @__PURE__ */ atom(false);
2572
2572
  const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
@@ -3053,7 +3053,7 @@ var betterFetch = async (url, options) => {
3053
3053
  };
3054
3054
  };
3055
3055
  //#endregion
3056
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/config.mjs
3056
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/config.mjs
3057
3057
  const resolvePublicAuthUrl = (basePath) => {
3058
3058
  if (typeof process === "undefined") return void 0;
3059
3059
  const path = basePath ?? "/api/auth";
@@ -3151,12 +3151,12 @@ const getClientConfig = (options, loadEnv) => {
3151
3151
  };
3152
3152
  };
3153
3153
  //#endregion
3154
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/utils/is-atom.mjs
3154
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/utils/is-atom.mjs
3155
3155
  function isAtom(value) {
3156
3156
  return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
3157
3157
  }
3158
3158
  //#endregion
3159
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/proxy.mjs
3159
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/proxy.mjs
3160
3160
  function getMethod(path, knownPathMethods, args) {
3161
3161
  const method = knownPathMethods[path];
3162
3162
  const { fetchOptions, query: _query, ...body } = args || {};
@@ -3236,7 +3236,7 @@ function capitalizeFirstLetter(str) {
3236
3236
  return str.charAt(0).toUpperCase() + str.slice(1);
3237
3237
  }
3238
3238
  //#endregion
3239
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._44333ccf96bb3c43fae673bd9e25a436/node_modules/better-auth/dist/client/vanilla.mjs
3239
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._122a35b1d4615e80ac3ce156f3d09434/node_modules/better-auth/dist/client/vanilla.mjs
3240
3240
  function createAuthClient(options) {
3241
3241
  const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
3242
3242
  const resolvedHooks = {};
@@ -5242,7 +5242,7 @@ function unreachableTarget(context) {
5242
5242
  return context?.serverUrl ?? context?.webUrl;
5243
5243
  }
5244
5244
  function unreachableServerMessage(targetUrl) {
5245
- return `Could not reach ${targetUrl ?? "the keystroke server"}. Is the server running? (keystroke dev or keystroke start)`;
5245
+ return `Could not reach ${targetUrl ?? "the keystroke server"}.`;
5246
5246
  }
5247
5247
  function authApiOrigin(context) {
5248
5248
  if (context?.platformUrl) return context.platformUrl;
@@ -6678,6 +6678,7 @@ function registerAuthCommand(program) {
6678
6678
  //#endregion
6679
6679
  //#region src/update/ensure-sdk-current.ts
6680
6680
  const KEYSTROKE_SCOPE = "@keystrokehq/";
6681
+ const REGISTRY_TIMEOUT_MS = 3e3;
6681
6682
  function shouldSkip() {
6682
6683
  return Boolean(process.env.KEYSTROKE_SKIP_UPDATE || process.env.CI === "true" || process.env.CI === "1");
6683
6684
  }
@@ -6690,78 +6691,79 @@ function readPackageJson(root) {
6690
6691
  return;
6691
6692
  }
6692
6693
  }
6693
- /** Local/workspace specs are left alone; everything else (ranges and exact pins) updates to latest. */
6694
+ /** Local/workspace specs are left alone; everything else (ranges and exact pins) must stay current. */
6694
6695
  function isLocalSdkSpec(spec) {
6695
6696
  if (!spec) return true;
6696
6697
  const trimmed = spec.trim();
6697
6698
  return trimmed.startsWith("workspace:") || trimmed.startsWith("link:") || trimmed.startsWith("file:");
6698
6699
  }
6699
- function listUpdatableKeystrokePackages(root) {
6700
+ function listManagedKeystrokePackages(root) {
6700
6701
  const pkg = readPackageJson(root);
6701
6702
  if (!pkg) return [];
6702
6703
  const packages = [];
6703
- for (const [name, spec] of Object.entries(pkg.dependencies ?? {})) if (name.startsWith(KEYSTROKE_SCOPE) && !isLocalSdkSpec(spec)) packages.push({
6704
- name,
6705
- dev: false
6706
- });
6707
- for (const [name, spec] of Object.entries(pkg.devDependencies ?? {})) if (name.startsWith(KEYSTROKE_SCOPE) && !isLocalSdkSpec(spec)) packages.push({
6708
- name,
6709
- dev: true
6710
- });
6704
+ for (const [name, spec] of Object.entries({
6705
+ ...pkg.dependencies,
6706
+ ...pkg.devDependencies
6707
+ })) if (name.startsWith(KEYSTROKE_SCOPE) && !isLocalSdkSpec(spec)) packages.push({ name });
6711
6708
  return packages;
6712
6709
  }
6713
- function updateCommand(manager, packageName, dev) {
6714
- const spec = `${packageName}@latest`;
6715
- if (manager === "npm") return {
6716
- command: "npm",
6717
- args: dev ? [
6718
- "install",
6719
- "-D",
6720
- spec
6721
- ] : ["install", spec]
6722
- };
6723
- return {
6724
- command: manager,
6725
- args: dev ? [
6726
- "add",
6727
- "-D",
6728
- spec
6729
- ] : ["add", spec]
6730
- };
6710
+ function readInstalledVersion(root, packageName) {
6711
+ const path = join(root, "node_modules", ...packageName.split("/"), "package.json");
6712
+ if (!existsSync(path)) return;
6713
+ try {
6714
+ return JSON.parse(readFileSync(path, "utf8")).version?.trim() || void 0;
6715
+ } catch {
6716
+ return;
6717
+ }
6718
+ }
6719
+ async function fetchLatestPackageVersion(packageName) {
6720
+ const controller = new AbortController();
6721
+ const timeout = setTimeout(() => controller.abort(), REGISTRY_TIMEOUT_MS);
6722
+ try {
6723
+ const response = await fetch(`https://registry.npmjs.org/${encodeURIComponent(packageName)}`, {
6724
+ signal: controller.signal,
6725
+ headers: { Accept: "application/json" }
6726
+ });
6727
+ if (!response.ok) return;
6728
+ return (await response.json())["dist-tags"]?.latest?.trim() || void 0;
6729
+ } catch {
6730
+ return;
6731
+ } finally {
6732
+ clearTimeout(timeout);
6733
+ }
6731
6734
  }
6732
- function warnReleaseAgeBlock(packageName) {
6733
- process.stderr.write(`Warning: ${packageName}@latest is held back by your minimum-release-age setting; continuing with the currently installed version.\n`);
6735
+ function formatOutdatedLine(pkg) {
6736
+ if (pkg.installed && pkg.latest) return `- ${pkg.name} (${pkg.installed} ${pkg.latest})`;
6737
+ if (pkg.latest) return `- ${pkg.name} (not installed → ${pkg.latest})`;
6738
+ return `- ${pkg.name}`;
6739
+ }
6740
+ async function packagesNeedingUpdate(root, packages) {
6741
+ return (await Promise.all(packages.map(async (pkg) => {
6742
+ const installed = readInstalledVersion(root, pkg.name);
6743
+ const latest = await fetchLatestPackageVersion(pkg.name);
6744
+ if (!latest) return installed ? void 0 : {
6745
+ name: pkg.name,
6746
+ installed
6747
+ };
6748
+ if (!installed || isNewerVersion(latest, installed)) return {
6749
+ name: pkg.name,
6750
+ installed,
6751
+ latest
6752
+ };
6753
+ }))).flatMap((pkg) => pkg ? [pkg] : []);
6734
6754
  }
6735
6755
  /**
6736
- * Keep @keystrokehq/* project dependencies on latest before build/deploy.
6737
- * The package manager no-ops when already current; minimum-release-age failures warn only.
6756
+ * Require @keystrokehq/* project dependencies to be on latest before build/deploy.
6757
+ * Checks the registry concurrently; throws instead of auto-installing (safe for CI).
6738
6758
  */
6739
- function ensureSdkCurrent(root) {
6759
+ async function ensureSdkCurrent(root) {
6740
6760
  if (shouldSkip()) return;
6741
- const packages = listUpdatableKeystrokePackages(root);
6761
+ const packages = listManagedKeystrokePackages(root);
6742
6762
  if (packages.length === 0) return;
6743
- const manager = detectManagerFromLockfile(root) ?? detectPackageManager();
6744
- const token = resolveGithubPackagesToken();
6745
- const env = token ? {
6746
- ...process.env,
6747
- NODE_AUTH_TOKEN: token
6748
- } : process.env;
6749
- for (const pkg of packages) {
6750
- const { command, args } = updateCommand(manager, pkg.name, pkg.dev);
6751
- process.stderr.write(`Ensuring ${pkg.name} is up to date...\n`);
6752
- const result = spawnSync(command, args, {
6753
- cwd: root,
6754
- env,
6755
- encoding: "utf8"
6756
- });
6757
- if (result.status === 0) continue;
6758
- const output = `${result.stdout ?? ""}${result.stderr ?? ""}`;
6759
- if (isReleaseAgeBlock(output)) {
6760
- warnReleaseAgeBlock(pkg.name);
6761
- continue;
6762
- }
6763
- process.stderr.write(`Warning: failed to update ${pkg.name}; continuing.\n${output}`);
6764
- }
6763
+ const outdated = await packagesNeedingUpdate(root, packages);
6764
+ if (outdated.length === 0) return;
6765
+ const lines = outdated.map(formatOutdatedLine).join("\n");
6766
+ throw new Error(`Outdated @keystrokehq packages:\n${lines}\n\nPlease update your versions before continuing.`);
6765
6767
  }
6766
6768
  //#endregion
6767
6769
  //#region src/commands/build.ts
@@ -6769,7 +6771,7 @@ function registerBuildCommand(program) {
6769
6771
  program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
6770
6772
  try {
6771
6773
  const root = resolveProjectRoot(options.dir);
6772
- ensureSdkCurrent(root);
6774
+ await ensureSdkCurrent(root);
6773
6775
  const { buildApp } = await import("./dist-B8-vsCpf.mjs");
6774
6776
  await buildApp({ root });
6775
6777
  process.stdout.write(`Built ${root}\n`);
@@ -6929,7 +6931,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
6929
6931
  }
6930
6932
  async function runDeploy(options) {
6931
6933
  const root = resolveProjectRoot(options.dir);
6932
- ensureSdkCurrent(root);
6934
+ await ensureSdkCurrent(root);
6933
6935
  if (await runLint(root) !== 0) throw new Error("lint failed");
6934
6936
  if (await runTypecheck(root) !== 0) throw new Error("typecheck failed");
6935
6937
  const config = createCliConfig();
@@ -7691,8 +7693,14 @@ function registerInitCommand(program) {
7691
7693
  //#region src/commands/lint.ts
7692
7694
  function registerLintCommand(program) {
7693
7695
  program.command("lint").description("Lint the project with the bundled oxlint").option("--dir <path>", "Project directory", process.cwd()).allowUnknownOption(true).argument("[args...]", "Extra arguments forwarded to oxlint").action(async (args, options) => {
7694
- const root = resolveProjectRoot(options.dir);
7695
- process.exitCode = await runLint(root, args.length > 0 ? args : void 0);
7696
+ try {
7697
+ const root = resolveProjectRoot(options.dir);
7698
+ await ensureSdkCurrent(root);
7699
+ process.exitCode = await runLint(root, args.length > 0 ? args : void 0);
7700
+ } catch (error) {
7701
+ process.stderr.write(`${formatCliError(error, "lint failed")}\n`);
7702
+ process.exitCode = 1;
7703
+ }
7696
7704
  });
7697
7705
  }
7698
7706
  //#endregion
@@ -7720,8 +7728,14 @@ function registerTestCommand(program) {
7720
7728
  //#region src/commands/typecheck.ts
7721
7729
  function registerTypecheckCommand(program) {
7722
7730
  program.command("typecheck").description("Type-check the project with the bundled TypeScript").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
7723
- const root = resolveProjectRoot(options.dir);
7724
- process.exitCode = await runTypecheck(root);
7731
+ try {
7732
+ const root = resolveProjectRoot(options.dir);
7733
+ await ensureSdkCurrent(root);
7734
+ process.exitCode = await runTypecheck(root);
7735
+ } catch (error) {
7736
+ process.stderr.write(`${formatCliError(error, "typecheck failed")}\n`);
7737
+ process.exitCode = 1;
7738
+ }
7725
7739
  });
7726
7740
  }
7727
7741
  //#endregion
@@ -8813,7 +8827,7 @@ function createProgram() {
8813
8827
  return program;
8814
8828
  }
8815
8829
  async function runCli(argv) {
8816
- const { maybeAutoUpdate } = await import("./maybe-auto-update-B2QRoCE7.mjs");
8830
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-Du4nv2q8.mjs");
8817
8831
  await maybeAutoUpdate(argv);
8818
8832
  createProgram().parse(argv);
8819
8833
  }