@keystrokehq/cli 0.0.161 → 0.0.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, Qt as originFromPublicUrl, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-C12M6Kul.mjs";
3
- import { t as walkProject } from "./walk-project-171B4cvO-DJy3qZKd.mjs";
4
- import { a as installPlaygroundDependencies, i as installDependencies, n as buildPlaygroundWorkspace, o as resolvePackageManager, s as resolveCliRoot, t as readCliVersion } from "./version-DESgLEkE.mjs";
2
+ import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-VxvEaDUL.mjs";
3
+ import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, h as DEFAULT_PLATFORM_URL, i as installDependencies, l as getCliConfigDir, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getServerUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-MB0r46Z4.mjs";
4
+ import { t as walkProject } from "./walk-project-171B4cvO-DKtupJ6Z.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import { Command } from "commander";
7
- import Conf from "conf";
8
- import { homedir, platform, tmpdir } from "node:os";
7
+ import { platform, tmpdir } from "node:os";
9
8
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
10
9
  import { Entry } from "@napi-rs/keyring";
11
10
  import { confirm, input, select } from "@inquirer/prompts";
@@ -13,82 +12,6 @@ import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, rmSync, un
13
12
  import { spawn, spawnSync } from "node:child_process";
14
13
  import { access, copyFile, cp, lstat, mkdir, readFile, readdir, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
15
14
  import { pathToFileURL } from "node:url";
16
- //#region src/resolve-platform-url.ts
17
- const DEFAULT_WEB_URL = "https://app.keystroke.ai";
18
- const DEFAULT_PLATFORM_URL = "https://api.keystroke.ai";
19
- const LOCAL_PLATFORM_URL = "http://localhost:3002";
20
- function webOriginFromUrl(webUrl) {
21
- return originFromPublicUrl(webUrl, webUrl.replace(/\/+$/, ""));
22
- }
23
- /** Known web origins with a fixed platform API — undefined for custom/staging URLs. */
24
- function knownPlatformUrlForWebUrl(webUrl) {
25
- const webOrigin = webOriginFromUrl(webUrl);
26
- if (webOrigin === "http://localhost:3000" || webOrigin === "http://127.0.0.1:3000") return LOCAL_PLATFORM_URL;
27
- if (webOrigin === "https://app.keystroke.ai") return DEFAULT_PLATFORM_URL;
28
- }
29
- function resolvePlatformUrlForWebUrl(webUrl, options = {}) {
30
- const explicit = options.platformUrl?.trim();
31
- if (explicit) return explicit.replace(/\/+$/, "");
32
- const known = knownPlatformUrlForWebUrl(webUrl);
33
- if (known) return known;
34
- return (options.fallback?.trim() || "https://api.keystroke.ai").replace(/\/+$/, "");
35
- }
36
- //#endregion
37
- //#region src/config.ts
38
- function getCliConfigDir(cwd = join(homedir(), ".keystroke")) {
39
- return cwd;
40
- }
41
- function getConfigDir(config) {
42
- return dirname(config.path);
43
- }
44
- function getEffectiveApiTarget(config) {
45
- const explicit = config.get("apiTarget");
46
- if (explicit === "local" || explicit === "platform") return explicit;
47
- return "local";
48
- }
49
- function syncPlatformUrlWithWebUrl(config) {
50
- const known = knownPlatformUrlForWebUrl(config.get("webUrl"));
51
- if (!known) return;
52
- if (config.get("platformUrl") !== known) config.set("platformUrl", known);
53
- }
54
- function createCliConfig(cwd = getCliConfigDir()) {
55
- const config = new Conf({
56
- projectName: "keystroke",
57
- cwd,
58
- schema: {
59
- serverUrl: {
60
- type: "string",
61
- default: "http://localhost:3001"
62
- },
63
- webUrl: {
64
- type: "string",
65
- default: DEFAULT_WEB_URL
66
- },
67
- platformUrl: {
68
- type: "string",
69
- default: DEFAULT_PLATFORM_URL
70
- },
71
- activeOrganizationId: { type: "string" },
72
- activeProjectId: { type: "string" },
73
- apiTarget: {
74
- type: "string",
75
- enum: ["local", "platform"]
76
- }
77
- }
78
- });
79
- syncPlatformUrlWithWebUrl(config);
80
- return config;
81
- }
82
- function getServerUrl(config) {
83
- return config.get("serverUrl");
84
- }
85
- function getWebUrl(config) {
86
- return config.get("webUrl");
87
- }
88
- function getPlatformUrl(config) {
89
- return resolvePlatformUrlForWebUrl(getWebUrl(config), { fallback: config.get("platformUrl") });
90
- }
91
- //#endregion
92
15
  //#region ../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/KyError.js
93
16
  /**
94
17
  Base class for all Ky-specific errors. `HTTPError`, `NetworkError`, `TimeoutError`, and `ForceRetryError` extend this class.
@@ -5534,7 +5457,7 @@ function registerBuildCommand(program) {
5534
5457
  program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
5535
5458
  try {
5536
5459
  const root = resolveProjectRoot(options.dir);
5537
- const { buildApp } = await import("./dist-BtAPGWUl.mjs");
5460
+ const { buildApp } = await import("./dist-DaxU7U68.mjs");
5538
5461
  await buildApp({ root });
5539
5462
  process.stdout.write(`Built ${root}\n`);
5540
5463
  } catch (error) {
@@ -5631,7 +5554,7 @@ async function runDeploy(options) {
5631
5554
  const client = createCliPlatformClient(config);
5632
5555
  let source;
5633
5556
  if (!options.skipBuild) {
5634
- const { buildApp } = await import("./dist-BtAPGWUl.mjs");
5557
+ const { buildApp } = await import("./dist-DaxU7U68.mjs");
5635
5558
  source = { files: (await buildApp({
5636
5559
  root,
5637
5560
  collectSources: true,
@@ -5731,7 +5654,7 @@ function runtimeChildEnv(parentEnv, overrides) {
5731
5654
  //#region src/project/bootstrap-run.ts
5732
5655
  /** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
5733
5656
  async function resolveBootstrapRun(options) {
5734
- const { resolveRuntimeBuildArtifact } = await import("./dist-BtAPGWUl.mjs");
5657
+ const { resolveRuntimeBuildArtifact } = await import("./dist-DaxU7U68.mjs");
5735
5658
  const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
5736
5659
  const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/bootstrap.mjs");
5737
5660
  const args = [`--import=${loader}`];
@@ -5881,7 +5804,7 @@ async function runDev(options) {
5881
5804
  process.on("SIGINT", shutdown);
5882
5805
  process.on("SIGTERM", shutdown);
5883
5806
  try {
5884
- const { watchApp } = await import("./dist-BtAPGWUl.mjs");
5807
+ const { watchApp } = await import("./dist-DaxU7U68.mjs");
5885
5808
  await watchApp({
5886
5809
  root,
5887
5810
  clean: false,
@@ -6709,7 +6632,7 @@ async function runStart(options) {
6709
6632
  const apiPort = Number(new URL(serverUrl).port || 80);
6710
6633
  const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
6711
6634
  ensureNativeDeps(runtimeNodeModules);
6712
- const { buildApp } = await import("./dist-BtAPGWUl.mjs");
6635
+ const { buildApp } = await import("./dist-DaxU7U68.mjs");
6713
6636
  await buildApp({
6714
6637
  root,
6715
6638
  clean: false
@@ -7245,7 +7168,7 @@ function createProgram() {
7245
7168
  return program;
7246
7169
  }
7247
7170
  async function runCli(argv) {
7248
- const { maybeAutoUpdate } = await import("./maybe-auto-update-DCsPT080.mjs");
7171
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-0abXnfw7.mjs");
7249
7172
  await maybeAutoUpdate(argv);
7250
7173
  createProgram().parse(argv);
7251
7174
  }