@keystrokehq/cli 0.1.170 → 0.1.172

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.
@@ -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-5Us7eEJy.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-DaFb2eM_.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-DE0Y6ctP.mjs";
5
- import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-DGYjDQkx.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-CcJWW5xj.mjs";
3
+ import { $ as DeclineOrganizationInvitationResponseSchema, $i as ConfirmCheckoutResponseSchema, $r as WorkflowRunResponseSchema, $t as McpDiscoverResponseSchema, A as CreateApiKeyRequestSchema, Ai as CredentialAssignmentListResponseSchema, An as ProjectGitRemoteResponseSchema, Ar as UpdateOrganizationMemberResponseSchema, At as ListAgentWorkspaceFilesResponseSchema, B as CreateOrganizationResponseSchema, Bn as PublicFormSubmitBodySchema, Br as UserAvatarSchema, Bt as ListOrganizationMembersPageQuerySchema, C as CompleteManagedDeployArtifactRequestSchema, Cn as PresignOrgLogoResponseSchema, Cr as TriggerRunDetailResponseSchema, Ct as HistoryRunListQuerySchema, D as ConnectAuthorizeUrlResponseSchema, Dn as PresignUserAvatarResponseSchema, Dr as UpdateCredentialRequestSchema, Dt as InviteProjectMembersRequestSchema, E as CompleteProjectArtifactResponseSchema, Ei as slugifyAppName, En as PresignUserAvatarRequestSchema, Er as UpdateCredentialInstanceBodySchema, Et as InviteOrganizationMembersResponseSchema, F as CreateCustomAppRequestSchema, Fn as ProjectSettingsResponseSchema, Fr as UpdateProjectSettingsRequestSchema, Ft as ListCredentialsPageResponseSchema, G as CreateSlackAppRequestSchema, Gn as PublishedFormSchema, Gr as WorkflowCanvasSchema, Gt as ListProjectMembersResponseSchema, H as CreateProjectArtifactResponseSchema, Hi as CLIENT_CHANNEL_HEADER, Hn as PublishManagedDeployCandidateRequestSchema, Hr as UserPreferencesSchema, Ht as ListOrganizationsResponseSchema, I as CreateCustomAppResponseSchema, In as ProjectSlugAvailabilityResponseSchema, Ir as UploadProjectSourceManifestRequestSchema, It as ListDraftFilesResponseSchema, J as CreateSlackChannelResponseSchema, Ji as BillingInvoiceUrlResponseSchema, Jn as RecentResourceListResponseSchema, Jr as WorkflowRunDetailResponseSchema, Jt as ListTemplatesResponseSchema, K as CreateSlackAppResponseSchema, Ki as AutoTopupSummarySchema, Kn as QueuedAgentPromptResponseSchema, Kr as WorkflowFormResponseSchema, Kt as ListProjectMetricsResponseSchema, L as CreateDraftCommitRequestSchema, Ln as PromptInputSchema, Lr as UploadProjectSourceResponseSchema, Lt as ListManagedServiceCredentialsResponseSchema, M as CreateCredentialInstanceBodySchema, Mi as CredentialConsumerListQuerySchema, Mn as ProjectPullStateSchema, Mr as UpdateProjectMemberRequestSchema, Mt as ListAppsResponseSchema, N as CreateCredentialsRequestSchema, Ni as CredentialConsumerListResponseSchema, Nn as ProjectReachabilityResponseSchema, Nr as UpdateProjectMemberResponseSchema, Nt as ListChannelPlatformsResponseSchema, O as ConnectManagedServiceCredentialRequestSchema, Oi as AssignCredentialBodySchema, Or as UpdateManagedServiceCredentialRequestSchema, Ot as InviteProjectMembersResponseSchema, P as CreateCredentialsResponseSchema, Pi as ExecuteKeystrokeToolRequestSchema, Pn as ProjectResponseSchema, Pr as UpdateProjectRequestSchema, Pt as ListCredentialsPageQuerySchema, Q as DOCS_SEARCH_TOOL, Qi as ConfirmCheckoutRequestSchema, Qn as SLACK_PERSONAL_APP_SLUG, Qr as WorkflowRunListResponseSchema, Qt as ManagedServiceKindSchema, R as CreateDraftDiffCommitRequestSchema, Rn as PromptResponseSchema, Rr as UpsertGatewayAttachmentBodySchema, Rt as ListMcpAppToolsResponseSchema, S as ChannelDirectoryListResponseSchema, Si as parseSlackConnectFlow, Sn as PresignOrgLogoRequestSchema, Sr as TriggerListResponseSchema, St as HistoryRunDetailResponseSchema, T as CompleteProjectArtifactRequestSchema, Ti as resolveDocsMcpUrl, Tn as PresignProjectSourceResponseSchema, Tr as UpdateChannelBindingBodySchema, Tt as InviteOrganizationMembersRequestSchema, U as CreateProjectRequestSchema, Ui as PresignChatAttachmentRequestSchema, Un as PublishManagedDeployCandidateResponseSchema, Ur as WorkflowCanvasCredentialBindingsSchema, Ut as ListProjectDeploymentsResponseSchema, V as CreateProjectArtifactRequestSchema, Vi as ACTIVE_ORG_HEADER, Vn as PublicFormSubmitResponseSchema, Vr as UserPreferencesPatchSchema, Vt as ListOrganizationMembersPageResponseSchema, W as CreateProjectResponseSchema, Wi as PresignChatAttachmentResponseSchema, Wn as PublishedFormListResponseSchema, Wr as WorkflowCanvasRunSchema, Wt as ListProjectFilesResponseSchema, X as CredentialInstanceRecordSchema, Xi as BillingSummaryResponseSchema, Xn as RenewManagedDeployUploadResponseSchema, Xr as WorkflowRunInputsPutBodySchema, Xt as ManagedDeployResourceKeySchema, Y as CredentialInstanceListResponseSchema, Yi as BillingRedirectResponseSchema, Yn as RenewManagedDeployUploadRequestSchema, Yr as WorkflowRunHooksResponseSchema, Yt as MANAGED_DEPLOY_REQUEST_TIMEOUT_MS, Z as DOCS_QUERY_TOOL, Zi as BillingUsageResponseSchema, Zr as WorkflowRunInputsSchema, Zt as ManagedServiceCredentialSchema, _ as CatalogAppDetailResponseSchema, _i as normalizeDocsSearchPaths, _n as PlatformAgentSessionListResponseSchema, _r as SubmitTeamRequestRequestSchema, _t as GraphqlDiscoverResponseSchema, a as AgentSessionDetailResponseSchema, ai as WorkspaceTriggerOverviewSchema, an as PROJECT_DRAFT_DIFF_MAX_BYTES, ar as SlackAppManifestRequestSchema, at as DraftRevisionResponseSchema, b as ChannelConnectionListResponseSchema, bi as parseErrorResponse, bn as PresignCustomAppLogoRequestSchema, br as TriggerInvokeInputsSchema, bt as HeartbeatManagedDeployResponseSchema, c as AgentSummaryListResponseSchema, ci as buildAgentSlackDeeplink, cn as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, cr as SlugAvailabilityResponseSchema, ct as DuplicateCredentialsResponseSchema, d as BindAgentSlackAppBodySchema, di as detectProjectPackageManagerFromSnapshot, dr as StartMcpOAuthConnectionInputSchema, dt as FormFieldConfigSchema, ea as CreateBillingPortalRequestSchema, ei as WorkflowSummaryDetailResponseSchema, en as OpenApiDiscoverResponseSchema, er as SkillSummaryDetailResponseSchema, et as DownloadActiveProjectArtifactResponseSchema, f as BindChannelBodySchema, fi as gitPorcelainLineTouchesManagedDraftPublishPath, fr as StartMcpOAuthConnectionResultSchema, ft as GatewayAttachmentRecordSchema, g as CatalogActionsPageResponseSchema, gn as PlatformAgentSessionDetailResponseSchema, gr as SubmitMarketingContactRequestSchema, gt as GetTemplateResponseSchema, h as CatalogActionDetailResponseSchema, hi as isIgnoredProjectSourcePath, hn as PlatformAgentPromptResponseSchema, hr as SubmitAgentFeedbackRequestSchema, ht as GetCustomAppResponseSchema, i as AgentEnvImageSnapshotResponseSchema, ii as WorkspaceTriggerListResponseSchema, in as PROJECT_DRAFT_COMMIT_REQUEST_TIMEOUT_MS, ir as SlackAppListResponseSchema, it as DraftFileContentResponseSchema, j as CreateApiKeyResponseSchema, ji as CredentialAssignmentRecordSchema, jn as ProjectGitStatusResponseSchema, jr as UpdateOrganizationRequestSchema, jt as ListApiKeysResponseSchema, k as ConnectProvidersResponseSchema, ki as CredentialAssignmentListQuerySchema, kn as ProjectGitRemoteRequestSchema, kr as UpdateOrganizationMemberRequestSchema, kt as ListAgentMemoryFilesResponseSchema, l as AgentTriggerSummaryListResponseSchema, li as buildConnectDeeplink, lr as StartKeystrokeConnectionInputSchema, lt as FinalizeCustomAppLogoRequestSchema, m as CancelManagedDeployResponseSchema, mn as PlatformAgentPromptInputSchema, mr as StartOAuthConnectionResultSchema, mt as GetCredentialResponseSchema, n as ActiveOrganizationResponseSchema, na as CreateSubscriptionCheckoutRequestSchema, ni as WorkspaceTriggerDetailSchema, nn as OrganizationSidebarBrandingSchema, nr as SlackAgentMembershipsResponseSchema, nt as DraftCommitResponseSchema, o as AgentSessionListResponseSchema, oi as WorkspaceTriggerRunListResponseSchema, or as SlackAppManifestResponseSchema, ot as DraftUpdateEventSchema, p as CancelManagedDeployRequestSchema, pi as isAcceptableInstallExit, pn as PlatformAgentCancelResponseSchema, pr as StartOAuthConnectionInputSchema, pt as GetAppCatalogEntryResponseSchema, q as CreateSlackChannelBodySchema, qi as BillingActivityResponseSchema, qn as QueuedRunResponseSchema, qr as WorkflowFormUpsertBodySchema, qt as ListProjectsResponseSchema, r as ActiveProjectSourceRevisionSchema, ra as UpdateAutoTopupRequestSchema, ri as WorkspaceTriggerFileSchema, rn as PNPM_FROZEN_INSTALL_ARGS, rr as SlackAppInstallStartResponseSchema, rt as DraftConflictResponseSchema, s as AgentSummaryDetailResponseSchema, si as WorkspaceWorkflowOverviewSchema, sn as PROJECT_PULL_STATE_RELATIVE_PATH, sr as SlackMembershipChannelBodySchema, st as DuplicateCredentialRequestSchema, t as AcceptOrganizationInvitationResponseSchema, ta as CreateCreditsCheckoutRequestSchema, ti as WorkflowSummaryListResponseSchema, tn as OrganizationSidebarBrandingPatchSchema, tr as SkillSummaryListResponseSchema, tt as DownloadActiveProjectSourceResponseSchema, u as AppSlugAvailabilityResponseSchema, ui as deriveCustomAppDisplay, ur as StartKeystrokeConnectionResultSchema, ut as FinalizeCustomAppLogoResponseSchema, v as CatalogAppsPageResponseSchema, vn as PrepareManagedDeployRequestSchema, vr as TemplateFilesResponseSchema, vt as HealthResponseSchema, w as CompleteManagedDeployArtifactResponseSchema, wi as resolveConnectAppSlug, wn as PresignProjectSourceRequestSchema, wr as TriggerRunListResponseSchema, wt as HistoryRunListResponseSchema, x as ChannelConnectionSchema, xn as PresignCustomAppLogoResponseSchema, xr as TriggerInvokeResponseSchema, xt as HistoryRunCancelResponseSchema, y as ChannelAccountListResponseSchema, yi as parseAppSlug, yn as PrepareManagedDeployResponseSchema, yr as TriggerDetailResponseSchema, yt as HeartbeatManagedDeployRequestSchema, z as CreateOrganizationRequestSchema, zn as PublicFormMetadataSchema, zr as UserAvatarPatchSchema, zt as ListOrganizationInvitationsResponseSchema } from "./dist-CnddVrzY.mjs";
4
+ import { $ as withMcpReadClient, Q as assertPublicHttpUrl, Z as PublicHttpUrlError, _t as captureException, bt as flushTelemetry, et as artifactIndexFromModules, gt as alias, nt as mapInParallelBatches, rt as moduleBlobRefsFromModules, tt as collectArtifactModules, vt as configureTelemetry, xt as shutdownTelemetry, yt as event } from "./dist-B8ZXKNXj.mjs";
5
+ import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-C5ooQsTQ.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import { Command } from "commander";
8
8
  import { homedir, platform, release, tmpdir } from "node:os";
@@ -1628,6 +1628,7 @@ function createWorkflowsResource$1(http) {
1628
1628
  }
1629
1629
  };
1630
1630
  }
1631
+ const AUTH_RETRY_HEADER = "x-keystroke-auth-retry";
1631
1632
  function createKeystrokeClient(options) {
1632
1633
  const auth = options.auth ?? { type: "none" };
1633
1634
  const base = normalizeBaseUrl$1(options.baseUrl);
@@ -1635,10 +1636,21 @@ function createKeystrokeClient(options) {
1635
1636
  const http = ky.create({
1636
1637
  prefix: base === "" ? void 0 : `${base}/`,
1637
1638
  credentials: "omit",
1638
- hooks: { beforeRequest: [({ request }) => {
1639
- applyActiveOrganizationHeader$1(request, getActiveOrganizationId?.());
1640
- return applyAuthHeaders$1(request, auth);
1641
- }] },
1639
+ hooks: {
1640
+ beforeRequest: [({ request }) => {
1641
+ applyActiveOrganizationHeader$1(request, getActiveOrganizationId?.());
1642
+ return applyAuthHeaders$1(request, auth);
1643
+ }],
1644
+ afterResponse: [({ request, response, retryCount }) => {
1645
+ if (!options.retryUnauthorizedOnce || response.status !== 401 || retryCount > 0 || request.headers.get(AUTH_RETRY_HEADER) === "1") return;
1646
+ const headers = new Headers(request.headers);
1647
+ headers.set(AUTH_RETRY_HEADER, "1");
1648
+ return ky.retry({
1649
+ request: new Request(request, { headers }),
1650
+ code: "AUTH_RETRY"
1651
+ });
1652
+ }]
1653
+ },
1642
1654
  ...options.ky
1643
1655
  });
1644
1656
  return {
@@ -2045,7 +2057,7 @@ function createJwtTokenCache(mint) {
2045
2057
  };
2046
2058
  }
2047
2059
  //#endregion
2048
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/version.mjs
2060
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/version.mjs
2049
2061
  const PACKAGE_VERSION = "1.6.23";
2050
2062
  //#endregion
2051
2063
  //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.4.3/node_modules/better-call/dist/error.mjs
@@ -2170,7 +2182,7 @@ var BetterAuthError = class extends Error {
2170
2182
  }
2171
2183
  };
2172
2184
  //#endregion
2173
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
2185
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
2174
2186
  const deviceAuthorizationClient = () => {
2175
2187
  return {
2176
2188
  id: "device-authorization",
@@ -2246,7 +2258,7 @@ Object.freeze({
2246
2258
  }
2247
2259
  });
2248
2260
  //#endregion
2249
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/utils/url.mjs
2261
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/utils/url.mjs
2250
2262
  const SLASH_CHAR_CODE = "/".charCodeAt(0);
2251
2263
  function trimTrailingSlashes(value) {
2252
2264
  let end = value.length;
@@ -2519,7 +2531,7 @@ let onMount = ($store, initialize) => {
2519
2531
  });
2520
2532
  };
2521
2533
  //#endregion
2522
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/equality.mjs
2534
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/equality.mjs
2523
2535
  function isPlainObject$1(value) {
2524
2536
  if (typeof value !== "object" || value === null) return false;
2525
2537
  const prototype = Object.getPrototypeOf(value);
@@ -2559,7 +2571,7 @@ function withEquality(store, isEqual) {
2559
2571
  });
2560
2572
  }
2561
2573
  //#endregion
2562
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/broadcast-channel.mjs
2574
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/broadcast-channel.mjs
2563
2575
  const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
2564
2576
  const now$1 = () => Math.floor(Date.now() / 1e3);
2565
2577
  var WindowBroadcastChannel = class {
@@ -2602,7 +2614,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
2602
2614
  return globalThis[kBroadcastChannel];
2603
2615
  }
2604
2616
  //#endregion
2605
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/focus-manager.mjs
2617
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/focus-manager.mjs
2606
2618
  const kFocusManager = Symbol.for("better-auth:focus-manager");
2607
2619
  var WindowFocusManager = class {
2608
2620
  listeners = /* @__PURE__ */ new Set();
@@ -2631,7 +2643,7 @@ function getGlobalFocusManager() {
2631
2643
  return globalThis[kFocusManager];
2632
2644
  }
2633
2645
  //#endregion
2634
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/online-manager.mjs
2646
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/online-manager.mjs
2635
2647
  const kOnlineManager = Symbol.for("better-auth:online-manager");
2636
2648
  var WindowOnlineManager = class {
2637
2649
  listeners = /* @__PURE__ */ new Set();
@@ -2663,7 +2675,7 @@ function getGlobalOnlineManager() {
2663
2675
  return globalThis[kOnlineManager];
2664
2676
  }
2665
2677
  //#endregion
2666
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/parser.mjs
2678
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/parser.mjs
2667
2679
  const PROTO_POLLUTION_PATTERNS = {
2668
2680
  proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
2669
2681
  constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
@@ -2732,7 +2744,7 @@ function parseJSON(value, options = { strict: true }) {
2732
2744
  return betterJSONParse(value, options);
2733
2745
  }
2734
2746
  //#endregion
2735
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/session-refresh.mjs
2747
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/session-refresh.mjs
2736
2748
  const now = () => Math.floor(Date.now() / 1e3);
2737
2749
  /**
2738
2750
  * Rate limit: don't refetch on focus if a session request was made within this many seconds
@@ -2859,7 +2871,7 @@ function createSessionRefreshManager(opts) {
2859
2871
  };
2860
2872
  }
2861
2873
  //#endregion
2862
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/fetch-plugins.mjs
2874
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/fetch-plugins.mjs
2863
2875
  const redirectPlugin = {
2864
2876
  id: "redirect",
2865
2877
  name: "Redirect",
@@ -2874,7 +2886,7 @@ const redirectPlugin = {
2874
2886
  } }
2875
2887
  };
2876
2888
  //#endregion
2877
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/session-atom.mjs
2889
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/session-atom.mjs
2878
2890
  const isServer = () => typeof window === "undefined";
2879
2891
  /**
2880
2892
  * Normalize $fetch response: `throw: true` returns data directly,
@@ -3526,7 +3538,7 @@ var betterFetch = async (url, options) => {
3526
3538
  };
3527
3539
  };
3528
3540
  //#endregion
3529
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/config.mjs
3541
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/config.mjs
3530
3542
  const resolvePublicAuthUrl = (basePath) => {
3531
3543
  if (typeof process === "undefined") return void 0;
3532
3544
  const path = basePath ?? "/api/auth";
@@ -3624,7 +3636,7 @@ const getClientConfig = (options, loadEnv) => {
3624
3636
  };
3625
3637
  };
3626
3638
  //#endregion
3627
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/utils/is-atom.mjs
3639
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/utils/is-atom.mjs
3628
3640
  function isAtom(value) {
3629
3641
  return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
3630
3642
  }
@@ -3642,7 +3654,7 @@ function toKebabCase(input) {
3642
3654
  return splitWords(input).map((word) => word.toLowerCase()).join("-");
3643
3655
  }
3644
3656
  //#endregion
3645
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/proxy.mjs
3657
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/proxy.mjs
3646
3658
  function getMethod(path, knownPathMethods, args) {
3647
3659
  const method = knownPathMethods[path];
3648
3660
  const { fetchOptions, query: _query, ...body } = args || {};
@@ -3717,7 +3729,7 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
3717
3729
  return createProxy();
3718
3730
  }
3719
3731
  //#endregion
3720
- //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._c472a772c8203e3e5cd8f6066a81eb33/node_modules/better-auth/dist/client/vanilla.mjs
3732
+ //#region ../../node_modules/.pnpm/better-auth@1.6.23_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.34_crossws@0.4._7ea36d5e08bcd78deb7bdb150330d5fb/node_modules/better-auth/dist/client/vanilla.mjs
3721
3733
  function createAuthClient(options) {
3722
3734
  const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
3723
3735
  const resolvedHooks = {};
@@ -3874,10 +3886,12 @@ function getResolvedOrganizationId() {
3874
3886
  //#endregion
3875
3887
  //#region src/client.ts
3876
3888
  function createCliClient(config, options) {
3889
+ const auth = resolveCliAuth(config);
3877
3890
  return createKeystrokeClient({
3878
3891
  baseUrl: options.baseUrl,
3879
- auth: resolveCliAuth(config),
3892
+ auth,
3880
3893
  getActiveOrganizationId: options.platform ? () => options.organizationId ?? getResolvedOrganizationId() ?? null : void 0,
3894
+ retryUnauthorizedOnce: auth.type === "apiKey",
3881
3895
  ky: { headers: { [CLIENT_CHANNEL_HEADER]: "cli" } }
3882
3896
  });
3883
3897
  }
@@ -6425,10 +6439,12 @@ function toPlatformAuth(auth) {
6425
6439
  function createCliPlatformClient(config, options = {}) {
6426
6440
  const platformUrl = getPlatformUrl(config);
6427
6441
  const storage = getCredentialStorage(config);
6442
+ const auth = resolveCliAuth(config);
6443
+ const refreshBearerToken = auth.type === "apiKey" ? async () => auth.getKey() : auth.type === "bearer" ? () => getCliJwt(platformUrl, true, storage) : void 0;
6428
6444
  return createPlatformClient({
6429
6445
  baseUrl: platformUrl,
6430
- auth: toPlatformAuth(resolveCliAuth(config)),
6431
- refreshBearerToken: () => getCliJwt(platformUrl, true, storage),
6446
+ auth: toPlatformAuth(auth),
6447
+ ...refreshBearerToken ? { refreshBearerToken } : {},
6432
6448
  getActiveOrganizationId: () => options.organizationId === void 0 ? getResolvedOrganizationId() ?? null : options.organizationId,
6433
6449
  getExtraHeaders: () => ({ [CLIENT_CHANNEL_HEADER]: "cli" })
6434
6450
  });
@@ -6776,6 +6792,7 @@ function unreachableServerMessage(targetUrl) {
6776
6792
  function formatHttpClientError(error, context) {
6777
6793
  if (error.status === 401) {
6778
6794
  if (context?.hasCredentials === false) return "Not logged in. Run `keystroke auth login` first.";
6795
+ if (context?.credentialSource === "api-key") return "Authentication failed for `KEYSTROKE_API_KEY`. Check the key and retry the command.";
6779
6796
  return "Authentication failed. Run `keystroke auth login` again.";
6780
6797
  }
6781
6798
  if (error.status === 403) {
@@ -7050,35 +7067,41 @@ async function runProjectCliCommand(fallback, fn, errorContext, targetOptions =
7050
7067
  }
7051
7068
  async function runCliCommand(fallback, fn, errorContext, targetOptions = {}) {
7052
7069
  const config = createCliConfig();
7053
- const target = await resolveApiTarget(config, {
7054
- ...getCliTargetOptions(),
7055
- ...targetOptions
7056
- });
7057
- const organizationId = (await resolveActiveOrganization(config)).organization.id;
7058
- const ctx = {
7059
- config,
7060
- client: createCliClient(config, {
7061
- baseUrl: target.baseUrl,
7062
- platform: true,
7063
- organizationId
7064
- }),
7065
- serverUrl: target.baseUrl,
7066
- webUrl: getWebUrl(config),
7067
- apiTarget: target
7068
- };
7070
+ const webUrl = getWebUrl(config);
7071
+ let organizationId;
7072
+ let projectId;
7073
+ let serverUrl;
7069
7074
  try {
7070
- await fn(ctx);
7075
+ const target = await resolveApiTarget(config, {
7076
+ ...getCliTargetOptions(),
7077
+ ...targetOptions
7078
+ });
7079
+ serverUrl = target.baseUrl;
7080
+ projectId = target.projectId;
7081
+ organizationId = getResolvedOrganizationId() ?? (await resolveActiveOrganization(config)).organization.id;
7082
+ await fn({
7083
+ config,
7084
+ client: createCliClient(config, {
7085
+ baseUrl: target.baseUrl,
7086
+ platform: true,
7087
+ organizationId
7088
+ }),
7089
+ serverUrl: target.baseUrl,
7090
+ webUrl,
7091
+ apiTarget: target
7092
+ });
7071
7093
  } catch (error) {
7072
7094
  await reportCliException(error, {
7073
7095
  command: fallback,
7074
7096
  operation: "cli.command",
7075
7097
  organizationId,
7076
- projectId: target.projectId
7098
+ projectId
7077
7099
  });
7078
7100
  process.stderr.write(`${formatCliError(error, fallback, {
7079
7101
  ...errorContext,
7080
- serverUrl: ctx.serverUrl,
7081
- webUrl: ctx.webUrl
7102
+ serverUrl,
7103
+ webUrl,
7104
+ credentialSource: process.env.KEYSTROKE_API_KEY?.trim() ? "api-key" : "session"
7082
7105
  })}\n`);
7083
7106
  process.exitCode = 1;
7084
7107
  }
@@ -9025,7 +9048,7 @@ function registerBuildCommand(program) {
9025
9048
  try {
9026
9049
  const root = resolveProjectRoot(options.dir);
9027
9050
  await ensureSdkCurrent(root);
9028
- const { buildApp } = await import("./dist-C1SO9rxP.mjs");
9051
+ const { buildApp } = await import("./dist-Brtmx-yx.mjs");
9029
9052
  await buildApp({ root });
9030
9053
  process.stdout.write(`Built ${root}\n`);
9031
9054
  } catch (error) {
@@ -9038,15 +9061,18 @@ function registerBuildCommand(program) {
9038
9061
  //#endregion
9039
9062
  //#region src/deploy/assert-portable-dependencies.ts
9040
9063
  const LINK_SPEC = /^link:/i;
9064
+ const WORKSPACE_SPEC = /^workspace:/i;
9065
+ const FILE_SPEC = /^file:(?:\.\.?(?:\/|$)|\/|[A-Za-z]:\\|~)/i;
9041
9066
  const NONPORTABLE_SPEC = /^(?:link:|workspace:|file:(?:\.\.?(?:\/|$)|\/|[A-Za-z]:\\|~))/i;
9042
9067
  /**
9043
9068
  * Reject tracked dependency specs that cannot resolve in disposable/server
9044
9069
  * checkouts (absolute/local link:, external file:, unresolved workspace:).
9045
9070
  *
9046
9071
  * `KEYSTROKE_ALLOW_NONPORTABLE_DEPS=1` (local packs / soak deploys) permits
9047
- * `link:` only `file:` and unresolved `workspace:` still fail the gate.
9072
+ * `link:` only. Explicit options allow `workspace:`, `link:`, and local `file:`
9073
+ * specs when deploy deliberately builds from the current checkout.
9048
9074
  */
9049
- async function assertPortableProjectDependencies(projectRoot) {
9075
+ async function assertPortableProjectDependencies(projectRoot, options = {}) {
9050
9076
  const allowLinkDeps = process.env.KEYSTROKE_ALLOW_NONPORTABLE_DEPS === "1";
9051
9077
  const packageJsonPath = join(projectRoot, "package.json");
9052
9078
  let raw;
@@ -9076,7 +9102,7 @@ async function assertPortableProjectDependencies(projectRoot) {
9076
9102
  for (const [name, spec] of Object.entries(deps)) {
9077
9103
  if (typeof spec !== "string") continue;
9078
9104
  const trimmed = spec.trim();
9079
- if (allowLinkDeps && LINK_SPEC.test(trimmed)) continue;
9105
+ if ((allowLinkDeps || options.allowLink) && LINK_SPEC.test(trimmed) || options.allowWorkspace && WORKSPACE_SPEC.test(trimmed) || options.allowFile && FILE_SPEC.test(trimmed)) continue;
9080
9106
  if (NONPORTABLE_SPEC.test(trimmed)) offenders.push(`${name}@${spec}`);
9081
9107
  }
9082
9108
  }
@@ -10996,6 +11022,25 @@ async function buildExactCandidate(input) {
10996
11022
  const depsRoot = input.depsRoot ?? input.cwd;
10997
11023
  const cleanEnv = worktreeGitEnv();
10998
11024
  const skipVerify = input.skipVerify === true;
11025
+ if (input.buildFromWorkspace) {
11026
+ await rm(join(input.cwd, "dist"), {
11027
+ recursive: true,
11028
+ force: true
11029
+ });
11030
+ await buildInRoot({
11031
+ buildRoot: input.cwd,
11032
+ env: cleanEnv,
11033
+ skipVerify,
11034
+ manager: await detectPackageManager(input.cwd),
11035
+ needInstall: false
11036
+ });
11037
+ const modules = collectArtifactModules(input.cwd);
11038
+ return {
11039
+ modules,
11040
+ index: artifactIndexFromModules(modules),
11041
+ blobs: moduleBlobRefsFromModules(modules)
11042
+ };
11043
+ }
10999
11044
  if (input.allowInPlace) {
11000
11045
  const head = await runGit(["rev-parse", "HEAD"], {
11001
11046
  cwd: input.cwd,
@@ -11279,16 +11324,51 @@ async function assertDeployableCheckout(projectRoot, env = checkoutGitEnv()) {
11279
11324
  * Optionally verify HEAD against a server-pinned draft SHA.
11280
11325
  */
11281
11326
  async function assertHostedCheckoutDeployable(projectRoot, options = {}) {
11282
- const inspection = await assertDeployableCheckout(projectRoot, options.env ?? checkoutGitEnv());
11327
+ const env = options.env ?? checkoutGitEnv();
11328
+ const inspection = await assertDeployableCheckout(projectRoot, env);
11283
11329
  if (inspection.branch !== "ks/draft") throw new ExpectedCliError(`Hosted deploy requires branch \`${HOSTED_DRAFT_BRANCH}\` (current: ${inspection.branch ?? "detached"}).`);
11284
- if (options.expectedDraftSha) assertCheckoutMatchesDraft(inspection, options.expectedDraftSha);
11330
+ if (options.expectedDraftSha) await assertCheckoutMatchesDraft(inspection, options.expectedDraftSha, env);
11285
11331
  return inspection;
11286
11332
  }
11287
- function assertCheckoutMatchesDraft(inspection, expectedDraftSha) {
11333
+ async function resolveCheckoutDraftRelation(inspection, expectedDraftSha, env) {
11334
+ const head = inspection.headSha;
11335
+ if (!head) return "unknown";
11336
+ const expectedIsAncestor = await runGit([
11337
+ "merge-base",
11338
+ "--is-ancestor",
11339
+ expectedDraftSha,
11340
+ head
11341
+ ], {
11342
+ cwd: inspection.gitRoot,
11343
+ env,
11344
+ reject: false
11345
+ });
11346
+ if (expectedIsAncestor.code === 0) return "ahead";
11347
+ if (expectedIsAncestor.code !== 1) return "unknown";
11348
+ const headIsAncestor = await runGit([
11349
+ "merge-base",
11350
+ "--is-ancestor",
11351
+ head,
11352
+ expectedDraftSha
11353
+ ], {
11354
+ cwd: inspection.gitRoot,
11355
+ env,
11356
+ reject: false
11357
+ });
11358
+ if (headIsAncestor.code === 0) return "behind";
11359
+ return headIsAncestor.code === 1 ? "diverged" : "unknown";
11360
+ }
11361
+ async function assertCheckoutMatchesDraft(inspection, expectedDraftSha, env = checkoutGitEnv()) {
11288
11362
  const head = inspection.headSha?.toLowerCase() ?? "";
11289
11363
  const expected = expectedDraftSha.toLowerCase();
11290
11364
  if (!/^[0-9a-f]{40}$/.test(expected)) throw new ExpectedCliError(`Invalid draft SHA: ${expectedDraftSha}`);
11291
- if (head !== expected) throw new ExpectedCliError(`Hosted checkout HEAD (${head || "unknown"}) does not match draft tip ${expected}. Sync the session workspace to ks/draft and retry.`);
11365
+ if (head === expected) return;
11366
+ const mismatch = `Hosted checkout HEAD (${head || "unknown"}) does not match draft tip ${expected}. `;
11367
+ const relation = await resolveCheckoutDraftRelation(inspection, expected, env);
11368
+ if (relation === "ahead") throw new ExpectedCliError(mismatch + "HEAD has unpublished commits. Run exactly `git push origin HEAD:ks/draft` as a separate command, then retry `keystroke deploy`.");
11369
+ if (relation === "behind") throw new ExpectedCliError(mismatch + "HEAD is behind the shared draft. Run `git fetch origin`, then `git rebase origin/ks/draft` as separate commands, then retry `keystroke deploy`.");
11370
+ if (relation === "diverged") throw new ExpectedCliError(mismatch + "HEAD and the shared draft have diverged. Run `git fetch origin`, `git rebase origin/ks/draft`, and `git push origin HEAD:ks/draft` as separate commands, then retry `keystroke deploy`.");
11371
+ throw new ExpectedCliError(mismatch + "Run `git fetch origin`, `git rebase origin/ks/draft`, and `git push origin HEAD:ks/draft` as separate commands, then retry `keystroke deploy`.");
11292
11372
  }
11293
11373
  //#endregion
11294
11374
  //#region src/commands/deploy-output.ts
@@ -11457,7 +11537,13 @@ async function pollProjectActive(client, projectId, options = {}) {
11457
11537
  async function runManagedDeploy(client, config, options) {
11458
11538
  const deployStarted = Date.now();
11459
11539
  const root = resolveProjectRoot(options.dir);
11460
- await assertPortableProjectDependencies(root);
11540
+ if (options.buildFromWorkspace && process.env["KEYSTROKE_DEPLOY_GIT_MODE"] === "checkout") throw new ExpectedCliError("--build-from-workspace is only available from a local monorepo checkout");
11541
+ await assertPortableProjectDependencies(root, {
11542
+ allowWorkspace: options.buildFromWorkspace === true,
11543
+ allowFile: options.buildFromWorkspace === true,
11544
+ allowLink: options.buildFromWorkspace === true
11545
+ });
11546
+ if (options.buildFromWorkspace) process.stderr.write("Warning: --build-from-workspace builds with local workspace dependencies that are not captured in Keystroke's managed source. Use published dependencies for reproducible deploys.\n");
11461
11547
  const verbose = options.verbose === true;
11462
11548
  const phase = (label, started) => {
11463
11549
  if (!verbose) return;
@@ -11481,7 +11567,7 @@ async function runManagedDeploy(client, config, options) {
11481
11567
  }) : Promise.resolve();
11482
11568
  const remotePromise = client.projectGit.getRemote(options.projectId);
11483
11569
  const draftStarted = Date.now();
11484
- const draftSha = await resolveManagedDeployDraftSha({
11570
+ let draftSha = await resolveManagedDeployDraftSha({
11485
11571
  client,
11486
11572
  projectId: options.projectId,
11487
11573
  root,
@@ -11505,6 +11591,10 @@ async function runManagedDeploy(client, config, options) {
11505
11591
  env: gitContext.env,
11506
11592
  ...filter ? { filter } : {}
11507
11593
  });
11594
+ if (options.buildFromWorkspace && plan.mode === "no_op") plan = {
11595
+ ...plan,
11596
+ mode: "full"
11597
+ };
11508
11598
  phase("plan", planStarted);
11509
11599
  writePlan(plan);
11510
11600
  if (plan.mode === "no_op") {
@@ -11649,7 +11739,8 @@ async function runManagedDeploy(client, config, options) {
11649
11739
  candidateSha: composed.candidateSha,
11650
11740
  depsRoot: root,
11651
11741
  skipVerify: verifyOutside,
11652
- allowInPlace: hostedCheckout && prepared.mode === "full"
11742
+ allowInPlace: hostedCheckout && prepared.mode === "full",
11743
+ buildFromWorkspace: options.buildFromWorkspace === true
11653
11744
  });
11654
11745
  buildMs = Date.now() - buildStarted;
11655
11746
  return result;
@@ -11686,7 +11777,8 @@ async function runManagedDeploy(client, config, options) {
11686
11777
  candidateSha: publishedCandidateSha,
11687
11778
  depsRoot: root,
11688
11779
  skipVerify: verifyOutside,
11689
- allowInPlace: false
11780
+ allowInPlace: false,
11781
+ buildFromWorkspace: options.buildFromWorkspace === true
11690
11782
  });
11691
11783
  buildMs += Date.now() - rebuildStarted;
11692
11784
  }
@@ -11745,6 +11837,13 @@ async function runManagedDeploy(client, config, options) {
11745
11837
  } catch (error) {
11746
11838
  if (!isStaleDeployPlanError(error)) throw error;
11747
11839
  process.stdout.write("Deploy pins moved — recomputing local preflight once…\n");
11840
+ draftSha = await resolveManagedDeployDraftSha({
11841
+ client,
11842
+ projectId: options.projectId,
11843
+ root,
11844
+ gitContext,
11845
+ verbose
11846
+ });
11748
11847
  plan = await resolveManagedDeployPreflight({
11749
11848
  cwd: root,
11750
11849
  draftSha,
@@ -11752,6 +11851,10 @@ async function runManagedDeploy(client, config, options) {
11752
11851
  env: gitContext.env,
11753
11852
  ...filter ? { filter } : {}
11754
11853
  });
11854
+ if (options.buildFromWorkspace && plan.mode === "no_op") plan = {
11855
+ ...plan,
11856
+ mode: "full"
11857
+ };
11755
11858
  writePlan(plan);
11756
11859
  if (plan.mode === "no_op") {
11757
11860
  process.stdout.write("Nothing to deploy — draft matches main.\n");
@@ -11787,7 +11890,7 @@ async function resolveManagedDeployDraftSha(input) {
11787
11890
  })).commitSha;
11788
11891
  const inspection = await assertHostedCheckoutDeployable(input.root, { env: input.gitContext.env });
11789
11892
  const revision = await input.client.projectDraft.getRevision(input.projectId);
11790
- assertCheckoutMatchesDraft(inspection, revision.commitSha);
11893
+ await assertCheckoutMatchesDraft(inspection, revision.commitSha, input.gitContext.env);
11791
11894
  if (input.verbose) process.stdout.write(`Hosted checkout ready (${revision.commitSha.slice(0, 12)} on ks/draft).\n`);
11792
11895
  return revision.commitSha.toLowerCase();
11793
11896
  }
@@ -11805,6 +11908,7 @@ async function resolveTrustedDeployGitEnv(input) {
11805
11908
  }
11806
11909
  async function runDeploy(options) {
11807
11910
  if (options.acceptImpact && !options.filter?.length) throw new ExpectedCliError("--accept-impact requires at least one --filter");
11911
+ if (options.buildFromWorkspace && options.filter?.length) throw new ExpectedCliError("--build-from-workspace cannot be combined with --filter");
11808
11912
  const root = resolveProjectRoot(options.dir);
11809
11913
  await ensureSdkCurrent(root);
11810
11914
  const config = createCliConfig();
@@ -11814,7 +11918,7 @@ async function runDeploy(options) {
11814
11918
  await runManagedDeploy(client, config, options);
11815
11919
  }
11816
11920
  function registerDeployCommand(program) {
11817
- program.command("deploy").description("Deploy the project via managed Git (draft sync, local analyze/build, cutover)").option("--dir <path>", "Project directory", process.cwd()).option("--filter <entry>", "Deploy only matching workflow/agent keys (repeatable; e.g. workflows/ping)", (value, previous) => [...previous, value], []).option("--accept-impact", "Accept the current filtered deploy impact (required for non-TTY expansion)").option("--verbose", "Show phase timings, pin SHAs, and deploy detail").action(async (options) => {
11921
+ program.command("deploy").description("Deploy the project via managed Git (draft sync, local analyze/build, cutover)").option("--dir <path>", "Project directory", process.cwd()).option("--filter <entry>", "Deploy only matching workflow/agent keys (repeatable; e.g. workflows/ping)", (value, previous) => [...previous, value], []).option("--accept-impact", "Accept the current filtered deploy impact (required for non-TTY expansion)").option("--build-from-workspace", "Build from the current monorepo checkout (full deploys only; non-reproducible)").option("--verbose", "Show phase timings, pin SHAs, and deploy detail").action(async (options) => {
11818
11922
  let config;
11819
11923
  try {
11820
11924
  config = createCliConfig();
@@ -11826,6 +11930,7 @@ function registerDeployCommand(program) {
11826
11930
  projectId,
11827
11931
  filter: options.filter.length > 0 ? options.filter : void 0,
11828
11932
  acceptImpact: options.acceptImpact === true,
11933
+ buildFromWorkspace: options.buildFromWorkspace === true,
11829
11934
  verbose: options.verbose === true
11830
11935
  });
11831
11936
  await trackCliEvent("cli:deploy", { projectId });
@@ -14266,7 +14371,7 @@ function createProgram() {
14266
14371
  async function runCli(argv) {
14267
14372
  initCliTelemetry();
14268
14373
  try {
14269
- const { maybeAutoUpdate } = await import("./maybe-auto-update-B2T950BL.mjs");
14374
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-28IpqxhP.mjs");
14270
14375
  await maybeAutoUpdate(argv);
14271
14376
  await createProgram().parseAsync(argv);
14272
14377
  } finally {
@@ -14276,4 +14381,4 @@ async function runCli(argv) {
14276
14381
  //#endregion
14277
14382
  export { runCli };
14278
14383
 
14279
- //# sourceMappingURL=program-D15UmszI.mjs.map
14384
+ //# sourceMappingURL=program-BfapxNQ4.mjs.map