@keystrokehq/cli 0.1.148 → 0.1.149

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,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import "./dist-C6adeAws.mjs";
3
- import { v as emitStoredRouteManifestForProject } from "./dist-BjwZD7UZ.mjs";
3
+ import { v as emitStoredRouteManifestForProject } from "./dist-DSkS8uEB.mjs";
4
4
  export { emitStoredRouteManifestForProject };
package/dist/index.mjs CHANGED
@@ -32,7 +32,15 @@ try {
32
32
  process.exitCode = 1;
33
33
  process.exit(1);
34
34
  }
35
- const { runCli } = await import("./program-DU1iPR-p.mjs");
35
+ const originalEmitWarning = process.emitWarning.bind(process);
36
+ process.emitWarning = ((warning, ...args) => {
37
+ const message = typeof warning === "string" ? warning : warning.message;
38
+ const typeArg = args[0];
39
+ const type = typeof typeArg === "string" ? typeArg : typeArg && typeof typeArg === "object" && "type" in typeArg ? String(typeArg.type ?? "") : typeof warning === "string" ? "" : warning.name;
40
+ if ((type === "ExperimentalWarning" || /ExperimentalWarning/i.test(type)) && /SQLite/i.test(message)) return;
41
+ return Reflect.apply(originalEmitWarning, process, [warning, ...args]);
42
+ });
43
+ const { runCli } = await import("./program-CyirDIA2.mjs");
36
44
  await runCli(process.argv);
37
45
  //#endregion
38
46
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/runtime/assert-node-version.ts","../src/index.ts"],"sourcesContent":["/**\n * Dependency-free Node engine gate. Keep in sync with root `package.json` engines.node —\n * `assert-node-version.test.ts` and `scripts/check-node-engines.mjs` enforce that.\n */\nexport const SUPPORTED_NODE_RANGE = \"^22.18.0 || >=24.0.0\";\nexport const NODE_VERSION_DOCS_URL = \"https://docs.keystroke.ai/cli\";\n\nexport function isSupportedNodeVersion(version: string): boolean {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)/.exec(version.trim());\n if (!match) {\n return false;\n }\n\n const major = Number(match[1]);\n const minor = Number(match[2]);\n const patch = Number(match[3]);\n\n // ^22.18.0 → >=22.18.0 <23.0.0; Node 23 excluded (tsdown); >=24 allowed.\n if (major === 22) {\n return minor > 18 || (minor === 18 && patch >= 0);\n }\n\n return major >= 24;\n}\n\nexport function unsupportedNodeVersionMessage(version: string): string {\n return (\n `Node.js ${version} is not supported. Keystroke requires Node ${SUPPORTED_NODE_RANGE} ` +\n `(detected ${version}). See ${NODE_VERSION_DOCS_URL}`\n );\n}\n\nexport function assertSupportedNodeVersion(version: string = process.version): void {\n if (isSupportedNodeVersion(version)) {\n return;\n }\n\n throw new Error(unsupportedNodeVersionMessage(version));\n}\n","import {\n assertSupportedNodeVersion,\n unsupportedNodeVersionMessage,\n} from \"./runtime/assert-node-version\";\n\ntry {\n assertSupportedNodeVersion();\n} catch (error) {\n const message =\n error instanceof Error ? error.message : unsupportedNodeVersionMessage(process.version);\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n // Avoid loading the rest of the CLI (and deps like node:sqlite) on unsupported Node.\n process.exit(1);\n}\n\nconst { runCli } = await import(\"./program\");\nawait runCli(process.argv);\n"],"mappings":";;;;;;AAIA,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AAErC,SAAgB,uBAAuB,SAA0B;CAC/D,MAAM,QAAQ,yBAAyB,KAAK,QAAQ,KAAK,CAAC;CAC1D,IAAI,CAAC,OACH,OAAO;CAGT,MAAM,QAAQ,OAAO,MAAM,EAAE;CAC7B,MAAM,QAAQ,OAAO,MAAM,EAAE;CAC7B,MAAM,QAAQ,OAAO,MAAM,EAAE;CAG7B,IAAI,UAAU,IACZ,OAAO,QAAQ,MAAO,UAAU,MAAM,SAAS;CAGjD,OAAO,SAAS;AAClB;AAEA,SAAgB,8BAA8B,SAAyB;CACrE,OACE,WAAW,QAAQ,6CAA6C,qBAAqB,aACxE,QAAQ,SAAS;AAElC;AAEA,SAAgB,2BAA2B,UAAkB,QAAQ,SAAe;CAClF,IAAI,uBAAuB,OAAO,GAChC;CAGF,MAAM,IAAI,MAAM,8BAA8B,OAAO,CAAC;AACxD;;;ACjCA,IAAI;CACF,2BAA2B;AAC7B,SAAS,OAAO;CACd,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,8BAA8B,QAAQ,OAAO;CACxF,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,QAAQ,WAAW;CAEnB,QAAQ,KAAK,CAAC;AAChB;AAEA,MAAM,EAAE,WAAW,MAAM,OAAO;AAChC,MAAM,OAAO,QAAQ,IAAI"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/runtime/assert-node-version.ts","../src/index.ts"],"sourcesContent":["/**\n * Dependency-free Node engine gate. Keep in sync with root `package.json` engines.node —\n * `assert-node-version.test.ts` and `scripts/check-node-engines.mjs` enforce that.\n */\nexport const SUPPORTED_NODE_RANGE = \"^22.18.0 || >=24.0.0\";\nexport const NODE_VERSION_DOCS_URL = \"https://docs.keystroke.ai/cli\";\n\nexport function isSupportedNodeVersion(version: string): boolean {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)/.exec(version.trim());\n if (!match) {\n return false;\n }\n\n const major = Number(match[1]);\n const minor = Number(match[2]);\n const patch = Number(match[3]);\n\n // ^22.18.0 → >=22.18.0 <23.0.0; Node 23 excluded (tsdown); >=24 allowed.\n if (major === 22) {\n return minor > 18 || (minor === 18 && patch >= 0);\n }\n\n return major >= 24;\n}\n\nexport function unsupportedNodeVersionMessage(version: string): string {\n return (\n `Node.js ${version} is not supported. Keystroke requires Node ${SUPPORTED_NODE_RANGE} ` +\n `(detected ${version}). See ${NODE_VERSION_DOCS_URL}`\n );\n}\n\nexport function assertSupportedNodeVersion(version: string = process.version): void {\n if (isSupportedNodeVersion(version)) {\n return;\n }\n\n throw new Error(unsupportedNodeVersionMessage(version));\n}\n","import {\n assertSupportedNodeVersion,\n unsupportedNodeVersionMessage,\n} from \"./runtime/assert-node-version\";\n\ntry {\n assertSupportedNodeVersion();\n} catch (error) {\n const message =\n error instanceof Error ? error.message : unsupportedNodeVersionMessage(process.version);\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n // Avoid loading the rest of the CLI (and deps like node:sqlite) on unsupported Node.\n process.exit(1);\n}\n\n// node:sqlite is still experimental; suppress the startup warning on every command.\nconst originalEmitWarning = process.emitWarning.bind(process);\nprocess.emitWarning = ((warning: string | Error, ...args: unknown[]) => {\n const message = typeof warning === \"string\" ? warning : warning.message;\n const typeArg = args[0];\n const type =\n typeof typeArg === \"string\"\n ? typeArg\n : typeArg && typeof typeArg === \"object\" && \"type\" in typeArg\n ? String((typeArg as { type?: unknown }).type ?? \"\")\n : typeof warning === \"string\"\n ? \"\"\n : warning.name;\n if (\n (type === \"ExperimentalWarning\" || /ExperimentalWarning/i.test(type)) &&\n /SQLite/i.test(message)\n ) {\n return;\n }\n return Reflect.apply(originalEmitWarning, process, [warning, ...args]);\n}) as typeof process.emitWarning;\n\nconst { runCli } = await import(\"./program\");\nawait runCli(process.argv);\n"],"mappings":";;;;;;AAIA,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AAErC,SAAgB,uBAAuB,SAA0B;CAC/D,MAAM,QAAQ,yBAAyB,KAAK,QAAQ,KAAK,CAAC;CAC1D,IAAI,CAAC,OACH,OAAO;CAGT,MAAM,QAAQ,OAAO,MAAM,EAAE;CAC7B,MAAM,QAAQ,OAAO,MAAM,EAAE;CAC7B,MAAM,QAAQ,OAAO,MAAM,EAAE;CAG7B,IAAI,UAAU,IACZ,OAAO,QAAQ,MAAO,UAAU,MAAM,SAAS;CAGjD,OAAO,SAAS;AAClB;AAEA,SAAgB,8BAA8B,SAAyB;CACrE,OACE,WAAW,QAAQ,6CAA6C,qBAAqB,aACxE,QAAQ,SAAS;AAElC;AAEA,SAAgB,2BAA2B,UAAkB,QAAQ,SAAe;CAClF,IAAI,uBAAuB,OAAO,GAChC;CAGF,MAAM,IAAI,MAAM,8BAA8B,OAAO,CAAC;AACxD;;;ACjCA,IAAI;CACF,2BAA2B;AAC7B,SAAS,OAAO;CACd,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,8BAA8B,QAAQ,OAAO;CACxF,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,QAAQ,WAAW;CAEnB,QAAQ,KAAK,CAAC;AAChB;AAGA,MAAM,sBAAsB,QAAQ,YAAY,KAAK,OAAO;AAC5D,QAAQ,gBAAgB,SAAyB,GAAG,SAAoB;CACtE,MAAM,UAAU,OAAO,YAAY,WAAW,UAAU,QAAQ;CAChE,MAAM,UAAU,KAAK;CACrB,MAAM,OACJ,OAAO,YAAY,WACf,UACA,WAAW,OAAO,YAAY,YAAY,UAAU,UAClD,OAAQ,QAA+B,QAAQ,EAAE,IACjD,OAAO,YAAY,WACjB,KACA,QAAQ;CAClB,KACG,SAAS,yBAAyB,uBAAuB,KAAK,IAAI,MACnE,UAAU,KAAK,OAAO,GAEtB;CAEF,OAAO,QAAQ,MAAM,qBAAqB,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;AACvE;AAEA,MAAM,EAAE,WAAW,MAAM,OAAO;AAChC,MAAM,OAAO,QAAQ,IAAI"}
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
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-C4uA6xWB.mjs";
3
3
  import { $ as DownloadActiveProjectArtifactResponseSchema, $i as CreateCreditsCheckoutRequestSchema, $n as SkillSummaryDetailResponseSchema, $r as WorkflowSummaryDetailResponseSchema, $t as OpenApiDiscoverResponseSchema, A as CreateApiKeyResponseSchema, Ai as CredentialConsumerListQuerySchema, An as ProjectGitStatusResponseSchema, Ar as UpdateOrganizationRequestSchema, At as ListApiKeysResponseSchema, B as CreateProjectArtifactRequestSchema, Bi as CLIENT_CHANNEL_HEADER, Bn as PublicFormSubmitResponseSchema, Br as UserPreferencesPatchSchema, Bt as ListOrganizationMembersPageResponseSchema, C as CompleteManagedDeployArtifactResponseSchema, Ci as resolveDocsMcpUrl, Cn as PresignProjectSourceRequestSchema, Cr as TriggerRunListResponseSchema, Ct as HistoryRunListResponseSchema, D as ConnectManagedServiceCredentialRequestSchema, Di as CredentialAssignmentListQuerySchema, Dr as UpdateManagedServiceCredentialRequestSchema, Dt as InviteProjectMembersResponseSchema, E as ConnectAuthorizeUrlResponseSchema, Ei as AssignCredentialBodySchema, 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 BillingActivityResponseSchema, Gn as QueuedAgentPromptResponseSchema, Gr as WorkflowFormResponseSchema, Gt as ListProjectMetricsResponseSchema, H as CreateProjectRequestSchema, Hi as PresignChatAttachmentResponseSchema, 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 BillingSummaryResponseSchema, Jn as RenewManagedDeployUploadRequestSchema, Jr as WorkflowRunHooksResponseSchema, Jt as MANAGED_DEPLOY_REQUEST_TIMEOUT_MS, K as CreateSlackChannelBodySchema, Ki as BillingInvoiceUrlResponseSchema, 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 ExecuteKeystrokeToolRequestSchema, Mn as ProjectReachabilityResponseSchema, Mr as UpdateProjectMemberResponseSchema, Mt as ListChannelPlatformsResponseSchema, N as CreateCredentialsResponseSchema, Nn as ProjectResponseSchema, Nr as UpdateProjectRequestSchema, Nt as ListCredentialsPageQuerySchema, O as ConnectProvidersResponseSchema, Oi as CredentialAssignmentListResponseSchema, 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 CreateBillingPortalRequestSchema, Qr as WorkflowRunResponseSchema, Qt as McpDiscoverResponseSchema, R as CreateOrganizationRequestSchema, Rn as PublicFormMetadataSchema, Rr as UserAvatarPatchSchema, Rt as ListOrganizationInvitationsResponseSchema, S as CompleteManagedDeployArtifactRequestSchema, Si as resolveConnectAppSlug, Sn as PresignOrgLogoResponseSchema, Sr as TriggerRunDetailResponseSchema, St as HistoryRunListQuerySchema, T as CompleteProjectArtifactResponseSchema, Tn as PresignUserAvatarRequestSchema, Tr as UpdateCredentialInstanceBodySchema, Tt as InviteOrganizationMembersResponseSchema, U as CreateProjectResponseSchema, Un as PublishedFormListResponseSchema, Ur as WorkflowCanvasRunSchema, Ut as ListProjectFilesResponseSchema, V as CreateProjectArtifactResponseSchema, Vi as PresignChatAttachmentRequestSchema, Vn as PublishManagedDeployCandidateRequestSchema, Vr as UserPreferencesSchema, Vt as ListOrganizationsResponseSchema, W as CreateSlackAppRequestSchema, Wi as AutoTopupSummarySchema, Wn as PublishedFormSchema, Wr as WorkflowCanvasSchema, Wt as ListProjectMembersResponseSchema, X as DOCS_QUERY_TOOL, Xi as ConfirmCheckoutRequestSchema, Xr as WorkflowRunInputsSchema, Xt as ManagedServiceCredentialSchema, Y as CredentialInstanceRecordSchema, Yi as BillingUsageResponseSchema, Yn as RenewManagedDeployUploadResponseSchema, Yr as WorkflowRunInputsPutBodySchema, Yt as ManagedDeployResourceKeySchema, Z as DOCS_SEARCH_TOOL, Zi as ConfirmCheckoutResponseSchema, Zn as SLACK_PERSONAL_APP_SLUG, Zr as WorkflowRunListResponseSchema, Zt as ManagedServiceKindSchema, _ as CatalogAppsPageResponseSchema, _i as parseAppSlug, _n as PrepareManagedDeployRequestSchema, _r as TemplateFilesResponseSchema, _t as HealthResponseSchema, a as AgentSessionListResponseSchema, ai as WorkspaceTriggerRunListResponseSchema, ar as SlackAppManifestResponseSchema, at as DraftUpdateEventSchema, b as ChannelConnectionSchema, bi as parseSlackConnectFlow, 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 isAcceptableInstallExit, dr as StartMcpOAuthConnectionResultSchema, dt as GatewayAttachmentRecordSchema, ea as CreateSubscriptionCheckoutRequestSchema, ei as WorkflowSummaryListResponseSchema, en as OrganizationSidebarBrandingPatchSchema, er as SkillSummaryListResponseSchema, et as DownloadActiveProjectSourceResponseSchema, f as CancelManagedDeployRequestSchema, fn as PlatformAgentCancelResponseSchema, fr as StartOAuthConnectionInputSchema, ft as GetAppCatalogEntryResponseSchema, g as CatalogAppDetailResponseSchema, gn as PlatformAgentSessionListResponseSchema, gr as SubmitTeamRequestRequestSchema, gt as GraphqlDiscoverResponseSchema, h as CatalogActionsPageResponseSchema, hi as normalizeDocsSearchPaths, 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 CredentialConsumerListResponseSchema, jn as ProjectPullStateSchema, jr as UpdateProjectMemberRequestSchema, jt as ListAppsResponseSchema, k as CreateApiKeyRequestSchema, ki as CredentialAssignmentRecordSchema, kn as ProjectGitRemoteResponseSchema, kr as UpdateOrganizationMemberResponseSchema, kt as ListAgentWorkspaceFilesResponseSchema, l as AppSlugAvailabilityResponseSchema, li as deriveCustomAppDisplay, lr as StartKeystrokeConnectionResultSchema, lt as FinalizeCustomAppLogoResponseSchema, m as CatalogActionDetailResponseSchema, mn as PlatformAgentPromptResponseSchema, mr as SubmitAgentFeedbackRequestSchema, mt as GetCustomAppResponseSchema, n as ActiveOrganizationResponseSchema, 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, pi as isIgnoredProjectSourcePath, pn as PlatformAgentPromptInputSchema, pr as StartOAuthConnectionResultSchema, pt as GetCredentialResponseSchema, q as CreateSlackChannelResponseSchema, qi as BillingRedirectResponseSchema, 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 UpdateAutoTopupRequestSchema, 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 parseErrorResponse, vn as PrepareManagedDeployResponseSchema, vr as TriggerDetailResponseSchema, vt as HeartbeatManagedDeployRequestSchema, w as CompleteProjectArtifactRequestSchema, wi as slugifyAppName, wn as PresignProjectSourceResponseSchema, wr as UpdateChannelBindingBodySchema, wt as InviteOrganizationMembersRequestSchema, x as ChannelDirectoryListResponseSchema, xn as PresignOrgLogoRequestSchema, xr as TriggerListResponseSchema, xt as HistoryRunDetailResponseSchema, y as ChannelConnectionListResponseSchema, yn as PresignCustomAppLogoRequestSchema, yr as TriggerInvokeInputsSchema, yt as HeartbeatManagedDeployResponseSchema, z as CreateOrganizationResponseSchema, zi as ACTIVE_ORG_HEADER, zn as PublicFormSubmitBodySchema, zr as UserAvatarSchema, zt as ListOrganizationMembersPageQuerySchema } from "./dist-C6adeAws.mjs";
4
- import { $ as collectArtifactModules, Q as artifactIndexFromModules, Z as withMcpReadClient, _t as event, et as mapInParallelBatches, gt as configureTelemetry, ht as captureException, mt as alias, tt as moduleBlobRefsFromModules, vt as flushTelemetry, yt as shutdownTelemetry } from "./dist-BjwZD7UZ.mjs";
5
- import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-xLTJXuWY.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-DSkS8uEB.mjs";
5
+ import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-DJQnugPi.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import { Command } from "commander";
8
8
  import { homedir, platform, release, tmpdir } from "node:os";
@@ -8934,7 +8934,7 @@ function registerBuildCommand(program) {
8934
8934
  try {
8935
8935
  const root = resolveProjectRoot(options.dir);
8936
8936
  await ensureSdkCurrent(root);
8937
- const { buildApp } = await import("./dist-CgDJj_3M.mjs");
8937
+ const { buildApp } = await import("./dist-BlsDG7kb.mjs");
8938
8938
  await buildApp({ root });
8939
8939
  process.stdout.write(`Built ${root}\n`);
8940
8940
  } catch (error) {
@@ -11094,6 +11094,64 @@ function assertCheckoutMatchesDraft(inspection, expectedDraftSha) {
11094
11094
  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.`);
11095
11095
  }
11096
11096
  //#endregion
11097
+ //#region src/commands/deploy-output.ts
11098
+ /** Format elapsed deploy wall time for the success line. */
11099
+ function formatDeployDuration(ms) {
11100
+ return `${(Math.max(0, ms) / 1e3).toFixed(1)}s`;
11101
+ }
11102
+ /**
11103
+ * True for hosts that are not useful on CLI stdout (private / loopback / link-local).
11104
+ * Reuses the MCP SSRF host classifier so deploy URL filtering stays in sync.
11105
+ */
11106
+ function isPrivateDeployBaseUrl(baseUrl) {
11107
+ try {
11108
+ assertPublicHttpUrl(baseUrl);
11109
+ return false;
11110
+ } catch (error) {
11111
+ if (error instanceof PublicHttpUrlError) return true;
11112
+ throw error;
11113
+ }
11114
+ }
11115
+ /** Short default progress line after local preflight. */
11116
+ function formatPlanProgress(plan) {
11117
+ const fileCount = plan.changedPaths.length;
11118
+ const files = fileCount === 1 ? "1 file changed" : `${fileCount} files changed`;
11119
+ const lines = [`Deploying (${plan.mode}) — ${files}`];
11120
+ if (plan.mode === "filtered") {
11121
+ if (plan.requestedResourceKeys.length > 0) lines.push(` Requested: ${plan.requestedResourceKeys.join(", ")}`);
11122
+ if (plan.impactedResourceKeys.length > 0) lines.push(` Also rebuilding from main: ${plan.impactedResourceKeys.sort().join(", ")}`);
11123
+ if (plan.impactCompleteness === "unknown") lines.push(" Impact completeness: unknown (additional resources may be affected)");
11124
+ for (const warning of plan.warnings) lines.push(` Warning: ${warning}`);
11125
+ }
11126
+ return `${lines.join("\n")}\n`;
11127
+ }
11128
+ /** Full plan dump for `--verbose` (pins, paths, expansions). */
11129
+ function formatPlanSummary(plan) {
11130
+ const lines = [
11131
+ `Pinned main (M0): ${plan.mainSha}`,
11132
+ `Pinned draft (D0): ${plan.draftSha}`,
11133
+ `Mode: ${plan.mode}`
11134
+ ];
11135
+ if ("requestedResourceKeys" in plan && plan.requestedResourceKeys.length > 0) lines.push(`Requested: ${plan.requestedResourceKeys.join(", ")}`);
11136
+ if ("impactedResourceKeys" in plan && plan.impactedResourceKeys.length > 0) lines.push(`Impacted (rebuild from main): ${plan.impactedResourceKeys.join(", ")}`);
11137
+ if ("resourceKeys" in plan && plan.resourceKeys.length > 0) lines.push(`Rebuild set: ${plan.resourceKeys.join(", ")}`);
11138
+ if ("impactCompleteness" in plan && plan.impactCompleteness === "unknown") lines.push("Impact completeness: unknown (additional resources may be affected)");
11139
+ if ("warnings" in plan && plan.warnings.length > 0) {
11140
+ lines.push("Warnings:");
11141
+ for (const warning of plan.warnings) lines.push(` - ${warning}`);
11142
+ }
11143
+ if ("expansions" in plan && plan.expansions.length > 0) {
11144
+ lines.push("Impacts:");
11145
+ for (const expansion of plan.expansions) lines.push(` - ${expansion.resourceKey}: ${expansion.reason}` + (expansion.sharedInputs.length ? ` (${expansion.sharedInputs.slice(0, 3).join(", ")}${expansion.sharedInputs.length > 3 ? ", …" : ""})` : ""));
11146
+ }
11147
+ if (plan.mode === "blocked") lines.push(`Blocked (${plan.requireFull?.code ?? "unknown"}): ${plan.requireFull?.reason ?? "filtered deploy not safe"}`);
11148
+ if (plan.changedPaths.length > 0) {
11149
+ const preview = plan.changedPaths.slice(0, 8).join(", ");
11150
+ lines.push(`Changed paths (${plan.changedPaths.length}): ${preview}${plan.changedPaths.length > 8 ? ", …" : ""}`);
11151
+ }
11152
+ return `${lines.join("\n")}\n`;
11153
+ }
11154
+ //#endregion
11097
11155
  //#region src/commands/deploy.ts
11098
11156
  /**
11099
11157
  * Poll aggressively at first — sticky loads often finish in well under 2s.
@@ -11149,31 +11207,6 @@ function parseManagedFilter(filter) {
11149
11207
  }
11150
11208
  return keys;
11151
11209
  }
11152
- function formatPlanSummary(plan) {
11153
- const lines = [
11154
- `Pinned main (M0): ${plan.mainSha}`,
11155
- `Pinned draft (D0): ${plan.draftSha}`,
11156
- `Mode: ${plan.mode}`
11157
- ];
11158
- if ("requestedResourceKeys" in plan && plan.requestedResourceKeys.length > 0) lines.push(`Requested: ${plan.requestedResourceKeys.join(", ")}`);
11159
- if ("impactedResourceKeys" in plan && plan.impactedResourceKeys.length > 0) lines.push(`Impacted (rebuild from main): ${plan.impactedResourceKeys.join(", ")}`);
11160
- if ("resourceKeys" in plan && plan.resourceKeys.length > 0) lines.push(`Rebuild set: ${plan.resourceKeys.join(", ")}`);
11161
- if ("impactCompleteness" in plan && plan.impactCompleteness === "unknown") lines.push("Impact completeness: unknown (additional resources may be affected)");
11162
- if ("warnings" in plan && plan.warnings.length > 0) {
11163
- lines.push("Warnings:");
11164
- for (const warning of plan.warnings) lines.push(` - ${warning}`);
11165
- }
11166
- if ("expansions" in plan && plan.expansions.length > 0) {
11167
- lines.push("Impacts:");
11168
- for (const expansion of plan.expansions) lines.push(` - ${expansion.resourceKey}: ${expansion.reason}` + (expansion.sharedInputs.length ? ` (${expansion.sharedInputs.slice(0, 3).join(", ")}${expansion.sharedInputs.length > 3 ? ", …" : ""})` : ""));
11169
- }
11170
- if (plan.mode === "blocked") lines.push(`Blocked (${plan.requireFull?.code ?? "unknown"}): ${plan.requireFull?.reason ?? "filtered deploy not safe"}`);
11171
- if (plan.changedPaths.length > 0) {
11172
- const preview = plan.changedPaths.slice(0, 8).join(", ");
11173
- lines.push(`Changed paths (${plan.changedPaths.length}): ${preview}${plan.changedPaths.length > 8 ? ", …" : ""}`);
11174
- }
11175
- return `${lines.join("\n")}\n`;
11176
- }
11177
11210
  function confirmationMessage(plan) {
11178
11211
  if (plan.impactCompleteness === "unknown") return "Deploy impact may be incomplete — additional resources could be affected.\nProceed with this managed deploy?";
11179
11212
  if (plan.impactedResourceKeys.length > 0 || plan.expansions.length > 0) {
@@ -11211,8 +11244,8 @@ async function pollProjectActive(client, projectId, options = {}) {
11211
11244
  throw new Error(`${lastError}${unpackHint}`);
11212
11245
  }
11213
11246
  if (current.status === "active" && (!requestedArtifactId || current.activeArtifactId === requestedArtifactId)) {
11214
- process.stdout.write(`Project active${current.baseUrl ? `: ${current.baseUrl}` : ""}\n`);
11215
- return;
11247
+ if (options.verbose) process.stdout.write(`Project active${current.baseUrl ? `: ${current.baseUrl}` : ""}\n`);
11248
+ return { baseUrl: current.baseUrl };
11216
11249
  }
11217
11250
  await sleep(POLL_INTERVAL_MS);
11218
11251
  }
@@ -11223,9 +11256,18 @@ async function runManagedDeploy(client, config, options) {
11223
11256
  const deployStarted = Date.now();
11224
11257
  const root = resolveProjectRoot(options.dir);
11225
11258
  await assertPortableProjectDependencies(root);
11259
+ const verbose = options.verbose === true;
11226
11260
  const phase = (label, started) => {
11261
+ if (!verbose) return;
11227
11262
  process.stdout.write(` ${label}: ${Date.now() - started}ms\n`);
11228
11263
  };
11264
+ const writePlan = (activePlan) => {
11265
+ if (verbose) {
11266
+ process.stdout.write(formatPlanSummary(activePlan));
11267
+ return;
11268
+ }
11269
+ if (activePlan.mode === "full" || activePlan.mode === "filtered") process.stdout.write(formatPlanProgress(activePlan));
11270
+ };
11229
11271
  const gitContext = await resolveDeployGitContext(root);
11230
11272
  const gatesStarted = Date.now();
11231
11273
  let gatesMs = 0;
@@ -11241,7 +11283,8 @@ async function runManagedDeploy(client, config, options) {
11241
11283
  client,
11242
11284
  projectId: options.projectId,
11243
11285
  root,
11244
- gitContext
11286
+ gitContext,
11287
+ verbose
11245
11288
  });
11246
11289
  phase("draft sync", draftStarted);
11247
11290
  const filter = parseManagedFilter(options.filter);
@@ -11261,7 +11304,7 @@ async function runManagedDeploy(client, config, options) {
11261
11304
  ...filter ? { filter } : {}
11262
11305
  });
11263
11306
  phase("plan", planStarted);
11264
- process.stdout.write(formatPlanSummary(plan));
11307
+ writePlan(plan);
11265
11308
  if (plan.mode === "no_op") {
11266
11309
  earlyGatesPromise.catch(() => void 0);
11267
11310
  process.stdout.write("Nothing to deploy — draft matches main.\n");
@@ -11336,6 +11379,7 @@ async function runManagedDeploy(client, config, options) {
11336
11379
  const gatesPromise = verifyOutside && !hostedCheckout ? earlyGatesPromise : Promise.resolve().then(() => {
11337
11380
  gatesMs = 0;
11338
11381
  });
11382
+ if (!verbose) process.stdout.write("Building…\n");
11339
11383
  const publishStarted = Date.now();
11340
11384
  const publishPromise = (async () => {
11341
11385
  if (prepared.publishMode === "git_push") {
@@ -11422,8 +11466,10 @@ async function runManagedDeploy(client, config, options) {
11422
11466
  ]);
11423
11467
  throw error;
11424
11468
  }
11425
- process.stdout.write(` publish candidate: ${publishMs}ms\n`);
11426
- if (gatesMs > 0) process.stdout.write(` gates: ${gatesMs}ms\n`);
11469
+ if (verbose) {
11470
+ process.stdout.write(` publish candidate: ${publishMs}ms\n`);
11471
+ if (gatesMs > 0) process.stdout.write(` gates: ${gatesMs}ms\n`);
11472
+ }
11427
11473
  let built = await buildPromise;
11428
11474
  if (publishedCandidateSha.toLowerCase() !== composed.candidateSha.toLowerCase()) {
11429
11475
  if (await resolveCommitTreeSha({
@@ -11443,8 +11489,9 @@ async function runManagedDeploy(client, config, options) {
11443
11489
  buildMs += Date.now() - rebuildStarted;
11444
11490
  }
11445
11491
  }
11446
- process.stdout.write(` build: ${buildMs}ms\n`);
11492
+ if (verbose) process.stdout.write(` build: ${buildMs}ms\n`);
11447
11493
  assertLease();
11494
+ if (!verbose) process.stdout.write("Uploading…\n");
11448
11495
  const uploadStarted = Date.now();
11449
11496
  const renewed = await client.projectGit.renewDeployUpload(options.projectId, {
11450
11497
  artifactId: prepared.artifact.id,
@@ -11469,7 +11516,7 @@ async function runManagedDeploy(client, config, options) {
11469
11516
  index: built.index
11470
11517
  });
11471
11518
  phase("complete", completeStarted);
11472
- process.stdout.write(`Deploy ${completed.artifact.id} started (${completed.mode})\n`);
11519
+ if (verbose) process.stdout.write(`Deploy ${completed.artifact.id} started (${completed.mode})\n`);
11473
11520
  return completed.artifact.id;
11474
11521
  }
11475
11522
  });
@@ -11491,7 +11538,7 @@ async function runManagedDeploy(client, config, options) {
11491
11538
  env: gitContext.env,
11492
11539
  ...filter ? { filter } : {}
11493
11540
  });
11494
- process.stdout.write(formatPlanSummary(plan));
11541
+ writePlan(plan);
11495
11542
  if (plan.mode === "no_op") {
11496
11543
  process.stdout.write("Nothing to deploy — draft matches main.\n");
11497
11544
  return;
@@ -11504,10 +11551,18 @@ async function runManagedDeploy(client, config, options) {
11504
11551
  });
11505
11552
  artifactId = await runTrusted(plan);
11506
11553
  }
11554
+ if (!verbose) process.stdout.write("Activating…\n");
11507
11555
  const healthStarted = Date.now();
11508
- await pollProjectActive(client, options.projectId, { artifactId });
11556
+ const active = await pollProjectActive(client, options.projectId, {
11557
+ artifactId,
11558
+ verbose
11559
+ });
11509
11560
  phase("health/promotion", healthStarted);
11510
- process.stdout.write(`CLI→active: ${Date.now() - deployStarted}ms\n`);
11561
+ if (verbose) process.stdout.write(`CLI→active: ${Date.now() - deployStarted}ms\n`);
11562
+ else {
11563
+ process.stdout.write(`Deployed in ${formatDeployDuration(Date.now() - deployStarted)}\n`);
11564
+ if (active.baseUrl && !isPrivateDeployBaseUrl(active.baseUrl)) process.stdout.write(`${active.baseUrl}\n`);
11565
+ }
11511
11566
  }
11512
11567
  /** @internal Exported for unit tests. */
11513
11568
  async function resolveManagedDeployDraftSha(input) {
@@ -11519,7 +11574,7 @@ async function resolveManagedDeployDraftSha(input) {
11519
11574
  const inspection = await assertHostedCheckoutDeployable(input.root, { env: input.gitContext.env });
11520
11575
  const revision = await input.client.projectDraft.getRevision(input.projectId);
11521
11576
  assertCheckoutMatchesDraft(inspection, revision.commitSha);
11522
- process.stdout.write(`Hosted checkout ready (${revision.commitSha.slice(0, 12)} on ks/draft).\n`);
11577
+ if (input.verbose) process.stdout.write(`Hosted checkout ready (${revision.commitSha.slice(0, 12)} on ks/draft).\n`);
11523
11578
  return revision.commitSha.toLowerCase();
11524
11579
  }
11525
11580
  /** @internal Exported for unit tests. */
@@ -11545,7 +11600,7 @@ async function runDeploy(options) {
11545
11600
  await runManagedDeploy(client, config, options);
11546
11601
  }
11547
11602
  function registerDeployCommand(program) {
11548
- 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)").action(async (options) => {
11603
+ 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) => {
11549
11604
  let config;
11550
11605
  try {
11551
11606
  config = createCliConfig();
@@ -11556,7 +11611,8 @@ function registerDeployCommand(program) {
11556
11611
  dir: options.dir,
11557
11612
  projectId,
11558
11613
  filter: options.filter.length > 0 ? options.filter : void 0,
11559
- acceptImpact: options.acceptImpact === true
11614
+ acceptImpact: options.acceptImpact === true,
11615
+ verbose: options.verbose === true
11560
11616
  });
11561
11617
  await trackCliEvent("cli:deploy", { projectId });
11562
11618
  } catch (error) {
@@ -14006,4 +14062,4 @@ async function runCli(argv) {
14006
14062
  //#endregion
14007
14063
  export { runCli };
14008
14064
 
14009
- //# sourceMappingURL=program-DU1iPR-p.mjs.map
14065
+ //# sourceMappingURL=program-CyirDIA2.mjs.map