@keystrokehq/cli 1.0.31 → 1.0.33
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/dist-CvnH5UO5.mjs +3 -0
- package/dist/{dist-BIWbmT4y.mjs → dist-DMTzqeKF.mjs} +6621 -8
- package/dist/dist-DMTzqeKF.mjs.map +1 -0
- package/dist/{dist-CRP2joPp.mjs → dist-DpvOEjMA.mjs} +3 -3
- package/dist/{dist-CRP2joPp.mjs.map → dist-DpvOEjMA.mjs.map} +1 -1
- package/dist/{dist-BUK3crkq.mjs → dist-M3vmU-M6.mjs} +130 -8
- package/dist/{dist-BUK3crkq.mjs.map → dist-M3vmU-M6.mjs.map} +1 -1
- package/dist/index.mjs +46 -12
- package/dist/index.mjs.map +1 -1
- package/dist/{maybe-auto-update-HA7HooH4.mjs → maybe-auto-update-CVR31Kbj.mjs} +2 -2
- package/dist/{maybe-auto-update-HA7HooH4.mjs.map → maybe-auto-update-CVR31Kbj.mjs.map} +1 -1
- package/dist/{pack-artifact-DVnIKrsg-CZTT2aF_.mjs → pack-artifact-DVnIKrsg-eIiQQrre.mjs} +2 -2
- package/dist/{pack-artifact-DVnIKrsg-CZTT2aF_.mjs.map → pack-artifact-DVnIKrsg-eIiQQrre.mjs.map} +1 -1
- package/dist/{version-CQ7xeQi9.mjs → version-BD-HVk5p.mjs} +3 -2
- package/dist/version-BD-HVk5p.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/dist-BIWbmT4y.mjs.map +0 -1
- package/dist/dist-Bacq9ds5.mjs +0 -3
- package/dist/version-CQ7xeQi9.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as HistoryRunListQuerySchema, $t as
|
|
3
|
-
import { a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, g as resolvePlatformUrlForWebUrl, i as installDependencies, l as getCliConfigDir, m as DEFAULT_PLATFORM_URL, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getWebUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-
|
|
4
|
-
import { n as packProjectArtifact, t as mergeFilteredArtifact } from "./pack-artifact-DVnIKrsg-
|
|
2
|
+
import { $ as HistoryRunListQuerySchema, $t as TriggerListResponseSchema, A as CreateCustomAppRequestSchema, An as listenPortFromPublicUrl, At as PresignUserAvatarResponseSchema, B as CredentialConsumerListQuerySchema, Bt as RecentResourceListResponseSchema, C as ConnectAuthorizeUrlResponseSchema, Cn as WorkspaceTriggerDetailSchema, Ct as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, D as CreateCredentialInstanceBodySchema, Dn as WorkspaceTriggerRunListResponseSchema, Dt as PresignProjectSourceRequestSchema, E as CreateApiKeyResponseSchema, En as WorkspaceTriggerOverviewSchema, Et as PresignOrgLogoResponseSchema, F as CreateProjectRequestSchema, Ft as PromptInputSchema, G as DownloadActiveProjectArtifactResponseSchema, Gt as StartKeystrokeConnectionResultSchema, H as CredentialInstanceListResponseSchema, Ht as SkillSummaryListResponseSchema, I as CreateProjectResponseSchema, In as resolvePublicPlatformOrigin, It as PromptResponseSchema, J as GetCredentialResponseSchema, Jt as StartOAuthConnectionInputSchema, K as ErrorResponseSchema, Kt as StartMcpOAuthConnectionInputSchema, L as CredentialAssignmentListQuerySchema, Ln as slugifyAppName, Lt as QueuedAgentPromptResponseSchema, M as CreateOrganizationRequestSchema, Mt as ProjectResponseSchema, N as CreateOrganizationResponseSchema, Nn as parseAppSlug, Nt as ProjectSettingsResponseSchema, O as CreateCredentialsRequestSchema, On as buildConnectDeeplink, Ot as PresignProjectSourceResponseSchema, P as CreateProjectArtifactResponseSchema, Pn as parseErrorResponse, Pt as ProjectSlugAvailabilityResponseSchema, Q as HistoryRunDetailResponseSchema, Qt as TriggerDetailResponseSchema, R as CredentialAssignmentListResponseSchema, Rt as QueuedRunResponseSchema, S as CompleteProjectArtifactResponseSchema, Sn as WorkflowSummaryListResponseSchema, St as OrganizationSidebarBrandingSchema, T as CreateApiKeyRequestSchema, Tn as WorkspaceTriggerListResponseSchema, Tt as PresignOrgLogoRequestSchema, U as CredentialInstanceRecordSchema, Ut as SlugAvailabilityResponseSchema, V as CredentialConsumerListResponseSchema, Vt as SkillSummaryDetailResponseSchema, W as DeclineOrganizationInvitationResponseSchema, Wt as StartKeystrokeConnectionInputSchema, X as HealthResponseSchema, Xt as SubmitMarketingContactRequestSchema, Y as GetCustomAppResponseSchema, Yt as StartOAuthConnectionResultSchema, Z as HistoryRunCancelResponseSchema, Zt as SubmitTeamRequestRequestSchema, _ as ChannelAccountListResponseSchema, _n as UserPreferencesPatchSchema, _t as ListProjectMetricsResponseSchema, a as AgentSessionDetailResponseSchema, an as UpdateOrganizationMemberRequestSchema, b as ChannelDirectoryListResponseSchema, bn as WorkflowRunListResponseSchema, bt as OpenApiDiscoverResponseSchema, c as AgentSummaryListResponseSchema, cn as UpdateProjectMemberRequestSchema, ct as ListApiKeysResponseSchema, d as AssignCredentialBodySchema, dn as UpdateProjectSettingsRequestSchema, dt as ListOrganizationInvitationsResponseSchema, en as TriggerRunDetailResponseSchema, et as HistoryRunListResponseSchema, f as BindChannelBodySchema, fn as UploadProjectSourceManifestRequestSchema, ft as ListOrganizationMembersResponseSchema, g as CatalogAppsPageResponseSchema, gn as UserAvatarSchema, gt as ListProjectMembersResponseSchema, h as CatalogAppDetailResponseSchema, hn as UserAvatarPatchSchema, ht as ListProjectFilesResponseSchema, i as AgentSessionChatStateResponseSchema, in as UpdateCredentialRequestSchema, it as InviteProjectMembersResponseSchema, j as CreateCustomAppResponseSchema, jt as ProjectReachabilityResponseSchema, k as CreateCredentialsResponseSchema, kt as PresignUserAvatarRequestSchema, l as AgentTriggerSummaryListResponseSchema, ln as UpdateProjectMemberResponseSchema, lt as ListAppsResponseSchema, m as CatalogActionsPageResponseSchema, mn as UpsertGatewayAttachmentBodySchema, mt as ListProjectDeploymentsResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as UpdateChannelBindingBodySchema, nt as InviteOrganizationMembersResponseSchema, o as AgentSessionListResponseSchema, on as UpdateOrganizationMemberResponseSchema, ot as ListAgentMemoryFilesResponseSchema, p as CatalogActionDetailResponseSchema, pn as UploadProjectSourceResponseSchema, pt as ListOrganizationsResponseSchema, q as GatewayAttachmentRecordSchema, qt as StartMcpOAuthConnectionResultSchema, r as ActiveOrganizationResponseSchema, rn as UpdateCredentialInstanceBodySchema, rt as InviteProjectMembersRequestSchema, s as AgentSummaryDetailResponseSchema, sn as UpdateOrganizationRequestSchema, st as ListAgentWorkspaceFilesResponseSchema, t as ACTIVE_ORG_HEADER, tn as TriggerRunListResponseSchema, tt as InviteOrganizationMembersRequestSchema, u as AppSlugAvailabilityResponseSchema, un as UpdateProjectRequestSchema, ut as ListCredentialsResponseSchema, v as ChannelConnectionListResponseSchema, vn as UserPreferencesSchema, vt as ListProjectsResponseSchema, w as ConnectProvidersResponseSchema, wn as WorkspaceTriggerFileSchema, wt as PollRunResponseSchema, x as ChannelPlatformSchema, xn as WorkflowSummaryDetailResponseSchema, xt as OrganizationSidebarBrandingPatchSchema, y as ChannelConnectionSchema, yn as WorkflowRunDetailResponseSchema, yt as McpDiscoverResponseSchema, z as CredentialAssignmentRecordSchema } from "./dist-M3vmU-M6.mjs";
|
|
3
|
+
import { a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, g as resolvePlatformUrlForWebUrl, i as installDependencies, l as getCliConfigDir, m as DEFAULT_PLATFORM_URL, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getWebUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-BD-HVk5p.mjs";
|
|
4
|
+
import { n as packProjectArtifact, t as mergeFilteredArtifact } from "./pack-artifact-DVnIKrsg-eIiQQrre.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { platform } from "node:os";
|
|
@@ -3338,8 +3338,13 @@ async function getCliJwt(platformUrl, force = false) {
|
|
|
3338
3338
|
}
|
|
3339
3339
|
//#endregion
|
|
3340
3340
|
//#region src/auth/resolve-cli-auth.ts
|
|
3341
|
-
/** Returns JWT bearer
|
|
3341
|
+
/** Returns API key, JWT bearer, or none auth for platform requests. */
|
|
3342
3342
|
function resolveCliAuth(config) {
|
|
3343
|
+
const apiKey = process.env.KEYSTROKE_API_KEY?.trim();
|
|
3344
|
+
if (apiKey) return {
|
|
3345
|
+
type: "apiKey",
|
|
3346
|
+
getKey: () => apiKey
|
|
3347
|
+
};
|
|
3343
3348
|
const platformUrl = getPlatformUrl(config);
|
|
3344
3349
|
if (!getAccessToken(platformUrl)) return { type: "none" };
|
|
3345
3350
|
return {
|
|
@@ -4099,6 +4104,34 @@ function createAppsResource(http) {
|
|
|
4099
4104
|
} catch (error) {
|
|
4100
4105
|
throw await toPlatformError(error);
|
|
4101
4106
|
}
|
|
4107
|
+
},
|
|
4108
|
+
async discoverMcp(input) {
|
|
4109
|
+
try {
|
|
4110
|
+
const data = await http.post("/api/apps/discover", { json: input }).json();
|
|
4111
|
+
return McpDiscoverResponseSchema.parse(data);
|
|
4112
|
+
} catch (error) {
|
|
4113
|
+
throw await toPlatformError(error);
|
|
4114
|
+
}
|
|
4115
|
+
},
|
|
4116
|
+
async discoverOpenApi(input) {
|
|
4117
|
+
try {
|
|
4118
|
+
const data = await http.post("/api/apps/discover-openapi", { json: input }).json();
|
|
4119
|
+
return OpenApiDiscoverResponseSchema.parse(data);
|
|
4120
|
+
} catch (error) {
|
|
4121
|
+
throw await toPlatformError(error);
|
|
4122
|
+
}
|
|
4123
|
+
},
|
|
4124
|
+
async startMcpOAuthConnection(slug, input) {
|
|
4125
|
+
try {
|
|
4126
|
+
const body = StartMcpOAuthConnectionInputSchema.parse({
|
|
4127
|
+
...input,
|
|
4128
|
+
appSlug: slug
|
|
4129
|
+
});
|
|
4130
|
+
const data = await http.post(`/api/apps/${encodeURIComponent(slug)}/mcp/oauth/connections`, { json: body }).json();
|
|
4131
|
+
return StartMcpOAuthConnectionResultSchema.parse(data);
|
|
4132
|
+
} catch (error) {
|
|
4133
|
+
throw await toPlatformError(error);
|
|
4134
|
+
}
|
|
4102
4135
|
}
|
|
4103
4136
|
};
|
|
4104
4137
|
}
|
|
@@ -5315,6 +5348,7 @@ function registerAppCreateCommand(app) {
|
|
|
5315
5348
|
name: options.name.trim(),
|
|
5316
5349
|
slug,
|
|
5317
5350
|
description: options.description,
|
|
5351
|
+
source: "custom",
|
|
5318
5352
|
fields: parseCustomAppFields(options.field)
|
|
5319
5353
|
});
|
|
5320
5354
|
process.stdout.write(`${JSON.stringify(created, null, 2)}\n`);
|
|
@@ -5388,7 +5422,7 @@ function resolveSyncedAppDirName(slug) {
|
|
|
5388
5422
|
}
|
|
5389
5423
|
function generateAppStub(app) {
|
|
5390
5424
|
const exportName = resolveSyncedAppExportName(app.slug);
|
|
5391
|
-
const credentialLines = Object.entries(app.credentialFields).map(([key, field]) => {
|
|
5425
|
+
const credentialLines = Object.entries(app.credentialFields ?? {}).map(([key, field]) => {
|
|
5392
5426
|
return ` ${key}: ${field.optional ? "z.string().optional()" : "z.string()"},`;
|
|
5393
5427
|
}).join("\n");
|
|
5394
5428
|
return `import { defineApp } from "@keystrokehq/keystroke/app";
|
|
@@ -6053,7 +6087,7 @@ function registerBuildCommand(program) {
|
|
|
6053
6087
|
program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
|
|
6054
6088
|
try {
|
|
6055
6089
|
const root = resolveProjectRoot(options.dir);
|
|
6056
|
-
const { buildApp } = await import("./dist-
|
|
6090
|
+
const { buildApp } = await import("./dist-DpvOEjMA.mjs");
|
|
6057
6091
|
await buildApp({ root });
|
|
6058
6092
|
process.stdout.write(`Built ${root}\n`);
|
|
6059
6093
|
} catch (error) {
|
|
@@ -6107,7 +6141,7 @@ async function sleep(ms) {
|
|
|
6107
6141
|
}
|
|
6108
6142
|
async function buildDeployArchive(client, root, projectId, filter) {
|
|
6109
6143
|
if (filter?.length) {
|
|
6110
|
-
const { buildFilteredApp } = await import("./dist-
|
|
6144
|
+
const { buildFilteredApp } = await import("./dist-DpvOEjMA.mjs");
|
|
6111
6145
|
const filtered = await buildFilteredApp({
|
|
6112
6146
|
root,
|
|
6113
6147
|
filter,
|
|
@@ -6129,7 +6163,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
|
|
|
6129
6163
|
sourceFiles: filtered.sourceFiles
|
|
6130
6164
|
};
|
|
6131
6165
|
}
|
|
6132
|
-
const { buildApp } = await import("./dist-
|
|
6166
|
+
const { buildApp } = await import("./dist-DpvOEjMA.mjs");
|
|
6133
6167
|
const { sourceFiles } = await buildApp({
|
|
6134
6168
|
root,
|
|
6135
6169
|
collectSources: true,
|
|
@@ -6248,7 +6282,7 @@ function runtimeChildEnv(parentEnv, overrides) {
|
|
|
6248
6282
|
//#region src/project/bootstrap-run.ts
|
|
6249
6283
|
/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
|
|
6250
6284
|
async function resolveBootstrapRun(options) {
|
|
6251
|
-
const { resolveRuntimeBuildArtifact } = await import("./dist-
|
|
6285
|
+
const { resolveRuntimeBuildArtifact } = await import("./dist-DpvOEjMA.mjs");
|
|
6252
6286
|
const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
|
|
6253
6287
|
const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/standalone-bootstrap.mjs");
|
|
6254
6288
|
const args = [`--import=${loader}`];
|
|
@@ -6397,7 +6431,7 @@ async function runDev(options) {
|
|
|
6397
6431
|
process.on("SIGINT", shutdown);
|
|
6398
6432
|
process.on("SIGTERM", shutdown);
|
|
6399
6433
|
try {
|
|
6400
|
-
const { watchApp } = await import("./dist-
|
|
6434
|
+
const { watchApp } = await import("./dist-DpvOEjMA.mjs");
|
|
6401
6435
|
await watchApp({
|
|
6402
6436
|
root,
|
|
6403
6437
|
clean: false,
|
|
@@ -7223,7 +7257,7 @@ async function runStart(options) {
|
|
|
7223
7257
|
const apiPort = Number(new URL(serverUrl).port || 80);
|
|
7224
7258
|
const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
|
|
7225
7259
|
ensureNativeDeps(runtimeNodeModules);
|
|
7226
|
-
const { buildApp } = await import("./dist-
|
|
7260
|
+
const { buildApp } = await import("./dist-DpvOEjMA.mjs");
|
|
7227
7261
|
await buildApp({
|
|
7228
7262
|
root,
|
|
7229
7263
|
clean: false
|
|
@@ -7746,7 +7780,7 @@ function createProgram() {
|
|
|
7746
7780
|
return program;
|
|
7747
7781
|
}
|
|
7748
7782
|
async function runCli(argv) {
|
|
7749
|
-
const { maybeAutoUpdate } = await import("./maybe-auto-update-
|
|
7783
|
+
const { maybeAutoUpdate } = await import("./maybe-auto-update-CVR31Kbj.mjs");
|
|
7750
7784
|
await maybeAutoUpdate(argv);
|
|
7751
7785
|
createProgram().parse(argv);
|
|
7752
7786
|
}
|