@keystrokehq/cli 0.1.149 → 0.1.151

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
@@ -40,7 +40,7 @@ process.emitWarning = ((warning, ...args) => {
40
40
  if ((type === "ExperimentalWarning" || /ExperimentalWarning/i.test(type)) && /SQLite/i.test(message)) return;
41
41
  return Reflect.apply(originalEmitWarning, process, [warning, ...args]);
42
42
  });
43
- const { runCli } = await import("./program-CyirDIA2.mjs");
43
+ const { runCli } = await import("./program-Bv7Wv_O4.mjs");
44
44
  await runCli(process.argv);
45
45
  //#endregion
46
46
  export {};
@@ -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 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";
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-CtEL33PB.mjs";
5
+ import { a as buildApp, c as computeSafeFilteredDeploy, r as analyzeDeployableClosures, t as ANALYZER_CONTRACT_VERSION } from "./dist-DG8fjuMY.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import { Command } from "commander";
8
8
  import { homedir, platform, release, tmpdir } from "node:os";
@@ -7739,7 +7739,16 @@ function listActionsHint(app) {
7739
7739
  /** Hint when listing actions for a custom org app (no toolkit tools). */
7740
7740
  function listCustomAppActionsHint(app) {
7741
7741
  const bin = cliBinaryName();
7742
- return `\nCustom org apps have no catalog action list.\n Inspect app: ${bin} apps get ${app}\n Scaffold code: ${bin} apps sync ${app}\n Connect secret: ${bin} connect ${app}\n Author actions: defineApp({ slug: "${app}", ... }).action(...)\n`;
7742
+ return `\nCustom org apps have no catalog action list.\n Inspect app: ${bin} apps get ${app}\n Scaffold code: ${bin} apps sync ${app}\n Connect secret: ${bin} connect ${app}\n Author actions: defineApp({ slug: "${app}", ... }).action(...)\n Smoke-test: deploy a thin workflow that calls the action, then\n ${bin} workflows run <workflow-slug> --input '{...}' --wait\n (${bin} apps execute is catalog-only — not for custom app actions.)\n`;
7743
+ }
7744
+ /**
7745
+ * Error when `apps execute` is pointed at a custom org app (`{org}/{name}`).
7746
+ * Catalog toolkit execute cannot reach defineApp(...).action(...) project code.
7747
+ */
7748
+ function customAppExecuteError(app, options) {
7749
+ const bin = cliBinaryName();
7750
+ const mcpLine = options?.source === "mcp" ? ` Live MCP tools: ${bin} apps actions list ${app} (after connect)\n` : "";
7751
+ return `${bin} apps execute only runs built-in catalog toolkit actions.\n"${app}" is a custom org app — its actions live in project code as defineApp(...).action(...), not in the catalog.\n\nSmoke-test a custom app action by deploying a thin workflow that calls it, then:\n ${bin} workflows run <workflow-slug> --input '{...}' --wait\n\n Inspect app: ${bin} apps get ${app}\n Scaffold/author: ${bin} apps sync ${app}\n` + mcpLine;
7743
7752
  }
7744
7753
  /** Hint after listing live tools on a connected custom MCP app. */
7745
7754
  function listMcpAppActionsHint(app) {
@@ -7760,7 +7769,7 @@ function showActionHint(app, tool, inputParameters) {
7760
7769
  //#region src/commands/apps/run-app-catalog.ts
7761
7770
  const CUSTOM_APP_ACTIONS_MESSAGE = "Custom org apps do not expose catalog actions. Actions live in your project as defineApp(...).action(...). Use `keystroke apps get <slug>` for the credential template, or `keystroke apps sync <slug>` to scaffold the app module.";
7762
7771
  const MCP_CONNECT_HINT = "Connect this MCP app first (`keystroke connect <slug> --print-url`), then re-run `keystroke apps actions list <slug>`. Prefer `keystroke docs search` for Keystroke docs before inventing integration code.";
7763
- function isNotFoundError(error) {
7772
+ function isNotFoundError$1(error) {
7764
7773
  if (!(error instanceof PlatformError)) return false;
7765
7774
  if (error.status === 404) return true;
7766
7775
  return /not found/i.test(error.message);
@@ -7789,14 +7798,14 @@ async function runAppShow(client, slug) {
7789
7798
  app: await client.apps.getCatalogApp(trimmed)
7790
7799
  };
7791
7800
  } catch (error) {
7792
- if (!isNotFoundError(error)) throw error;
7801
+ if (!isNotFoundError$1(error)) throw error;
7793
7802
  try {
7794
7803
  return {
7795
7804
  kind: "custom",
7796
7805
  app: await client.apps.get(trimmed)
7797
7806
  };
7798
7807
  } catch (fallbackError) {
7799
- if (isNotFoundError(fallbackError)) throw error;
7808
+ if (isNotFoundError$1(fallbackError)) throw error;
7800
7809
  throw fallbackError;
7801
7810
  }
7802
7811
  }
@@ -8087,13 +8096,36 @@ function isNotConnectedError(error) {
8087
8096
  if (typeof body !== "object" || body === null || !("error" in body)) return false;
8088
8097
  return body.error === "not_found";
8089
8098
  }
8099
+ function isNotFoundError(error) {
8100
+ if (!(error instanceof PlatformError)) return false;
8101
+ if (error.status === 404) return true;
8102
+ return /not found/i.test(error.message);
8103
+ }
8090
8104
  async function runAppExecute(client, appSlug, toolSlug, options) {
8091
8105
  const app = appSlug.trim().toLowerCase();
8092
8106
  const tool = toolSlug.trim().toUpperCase();
8093
8107
  if (!app || !tool) throw new Error("App and tool slugs are required (e.g. github github_get_the_authenticated_user)");
8108
+ const parsed = parseAppSlug(app);
8109
+ if (parsed.kind === "org") {
8110
+ let source;
8111
+ try {
8112
+ const shown = await runAppShow(client, parsed.slug);
8113
+ if (shown.kind === "custom") source = shown.app.source;
8114
+ } catch {}
8115
+ throw new Error(customAppExecuteError(parsed.slug, { source }));
8116
+ }
8094
8117
  const credentialSlug = options.credentialSlug?.trim() || void 0;
8095
8118
  const projectSlug = options.projectSlug?.trim() || void 0;
8096
- const version = options.version?.trim() || (await client.apps.getCatalogAction(tool)).version?.trim() || void 0;
8119
+ let version = options.version?.trim() || void 0;
8120
+ if (!version) try {
8121
+ version = (await client.apps.getCatalogAction(tool)).version?.trim() || void 0;
8122
+ } catch (error) {
8123
+ if (isNotFoundError(error)) {
8124
+ const shown = await runAppShow(client, app).catch(() => null);
8125
+ if (shown?.kind === "custom") throw new Error(customAppExecuteError(shown.app.slug, { source: shown.app.source }));
8126
+ }
8127
+ throw error;
8128
+ }
8097
8129
  if (!version) throw new Error(`Catalog action "${tool}" has no pinned version. Pass --version explicitly.`);
8098
8130
  try {
8099
8131
  const { result } = await client.apps.executeTool({
@@ -8113,7 +8145,7 @@ async function runAppExecute(client, appSlug, toolSlug, options) {
8113
8145
  //#endregion
8114
8146
  //#region src/commands/apps/execute.ts
8115
8147
  function registerAppExecuteCommand(app) {
8116
- app.command("execute").description("Run a connected catalog action against the cloud (no local server)").argument("<app>", "App slug (e.g. github)").argument("<tool>", "Tool slug (e.g. github_get_the_authenticated_user)").option("--input <json>", "JSON arguments (defaults to {})", "{}").option("--version <version>", "Pinned toolkit version (defaults to the catalog value)").option("--credential <slug>", `Pin a specific credential by slug (see '${cliBinaryName()} credentials list'); overrides the default and is the only way to use a user credential`).addHelpText("after", `
8148
+ app.command("execute").description("Run a connected catalog toolkit action against the cloud (no local server). Custom org apps ({org}/{name}) are not supported — smoke-test those via workflows run.").argument("<app>", "Catalog app slug (e.g. github); not a custom {org}/{name} app").argument("<tool>", "Catalog tool slug (e.g. github_get_the_authenticated_user)").option("--input <json>", "JSON arguments (defaults to {})", "{}").option("--version <version>", "Pinned toolkit version (defaults to the catalog value)").option("--credential <slug>", `Pin a specific credential by slug (see '${cliBinaryName()} credentials list'); overrides the default and is the only way to use a user credential`).addHelpText("after", `
8117
8149
  Credential resolution matches the runtime: project default → org default. User credentials are
8118
8150
  never a default — reach one with --credential <slug>. Target a project with the global
8119
8151
  --project <slug> flag; without it, only org credentials resolve.
@@ -8934,7 +8966,7 @@ function registerBuildCommand(program) {
8934
8966
  try {
8935
8967
  const root = resolveProjectRoot(options.dir);
8936
8968
  await ensureSdkCurrent(root);
8937
- const { buildApp } = await import("./dist-BlsDG7kb.mjs");
8969
+ const { buildApp } = await import("./dist-CSUmvad5.mjs");
8938
8970
  await buildApp({ root });
8939
8971
  process.stdout.write(`Built ${root}\n`);
8940
8972
  } catch (error) {
@@ -14062,4 +14094,4 @@ async function runCli(argv) {
14062
14094
  //#endregion
14063
14095
  export { runCli };
14064
14096
 
14065
- //# sourceMappingURL=program-CyirDIA2.mjs.map
14097
+ //# sourceMappingURL=program-Bv7Wv_O4.mjs.map