@keystrokehq/cli 0.1.17 → 0.1.18
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-E9nHDRnf.mjs → dist-BaOUOcKY.mjs} +3 -3
- package/dist/{dist-E9nHDRnf.mjs.map → dist-BaOUOcKY.mjs.map} +1 -1
- package/dist/{dist-BRA_tOTT.mjs → dist-CNZVjlhC.mjs} +23 -2
- package/dist/{dist-BRA_tOTT.mjs.map → dist-CNZVjlhC.mjs.map} +1 -1
- package/dist/{dist-C6KqfgGN.mjs → dist-DR8DYUc4.mjs} +3 -3
- package/dist/{dist-C6KqfgGN.mjs.map → dist-DR8DYUc4.mjs.map} +1 -1
- package/dist/{dist-DeRE4uJW.mjs → dist-RRjysgkw.mjs} +2 -2
- package/dist/{dist-DeRE4uJW.mjs.map → dist-RRjysgkw.mjs.map} +1 -1
- package/dist/dist-Wchlpwl7.mjs +3 -0
- package/dist/index.mjs +109 -17
- package/dist/index.mjs.map +1 -1
- package/dist/{maybe-auto-update-douMZFWJ.mjs → maybe-auto-update-BNvizwom.mjs} +2 -2
- package/dist/{maybe-auto-update-douMZFWJ.mjs.map → maybe-auto-update-BNvizwom.mjs.map} +1 -1
- package/dist/skills-bundle/skills/keystroke-apps/SKILL.md +5 -0
- package/dist/skills-bundle/skills/keystroke-apps/references/cli-and-catalog.md +9 -2
- package/dist/{version-CJd1mEoq.mjs → version-Dv-7vfQn.mjs} +2 -2
- package/dist/{version-CJd1mEoq.mjs.map → version-Dv-7vfQn.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/dist-BZBvPUyu.mjs +0 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as HistoryRunCancelResponseSchema, $t as StartMcpOAuthConnectionResultSchema, A as CreateCustomAppRequestSchema, An as WorkspaceTriggerDetailSchema, At as PresignOrgLogoRequestSchema, B as CredentialConsumerListQuerySchema, Bt as ProjectSlugAvailabilityResponseSchema, C as ConnectAuthorizeUrlResponseSchema, Cn as UserPreferencesPatchSchema, Ct as OrganizationSidebarBrandingPatchSchema, D as CreateCredentialInstanceBodySchema, Dn as WorkflowRunListResponseSchema, Dt as PollRunResponseSchema, E as CreateApiKeyResponseSchema, En as WorkflowRunHooksResponseSchema, Et as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, F as CreateProjectRequestSchema, Fn as buildConnectDeeplink, Ft as PresignUserAvatarResponseSchema, G as DownloadActiveProjectArtifactResponseSchema,
|
|
3
|
-
import { a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, g as resolvePlatformUrlForWebUrl, i as installDependencies$1, 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 mergeFilteredArtifact, r as packProjectArtifact, t as mapInParallelBatches } from "./dist-
|
|
2
|
+
import { $ as HistoryRunCancelResponseSchema, $t as StartMcpOAuthConnectionResultSchema, A as CreateCustomAppRequestSchema, An as WorkspaceTriggerDetailSchema, At as PresignOrgLogoRequestSchema, B as CredentialConsumerListQuerySchema, Bn as listenPortFromPublicUrl, Bt as ProjectSlugAvailabilityResponseSchema, C as ConnectAuthorizeUrlResponseSchema, Cn as UserPreferencesPatchSchema, Ct as OrganizationSidebarBrandingPatchSchema, D as CreateCredentialInstanceBodySchema, Dn as WorkflowRunListResponseSchema, Dt as PollRunResponseSchema, E as CreateApiKeyResponseSchema, En as WorkflowRunHooksResponseSchema, Et as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, F as CreateProjectRequestSchema, Fn as buildConnectDeeplink, Ft as PresignUserAvatarResponseSchema, G as DownloadActiveProjectArtifactResponseSchema, H as CredentialInstanceListResponseSchema, Ht as PromptResponseSchema, I as CreateProjectResponseSchema, It as ProjectPullStateSchema, J as GatewayAttachmentRecordSchema, Jn as slugifyAppName, Jt as SkillSummaryListResponseSchema, K as DownloadActiveProjectSourceResponseSchema, Kn as resolveConnectAppSlug, Kt as RecentResourceListResponseSchema, L as CredentialAssignmentListQuerySchema, Ln as deriveCustomAppDisplay, Lt as ProjectReachabilityResponseSchema, M as CreateOrganizationRequestSchema, Mn as WorkspaceTriggerListResponseSchema, Mt as PresignProjectSourceRequestSchema, N as CreateOrganizationResponseSchema, Nn as WorkspaceTriggerOverviewSchema, Nt as PresignProjectSourceResponseSchema, O as CreateCredentialsRequestSchema, On as WorkflowSummaryDetailResponseSchema, Ot as PresignChatAttachmentRequestSchema, P as CreateProjectArtifactResponseSchema, Pn as WorkspaceTriggerRunListResponseSchema, Pt as PresignUserAvatarRequestSchema, Q as HealthResponseSchema, Qt as StartMcpOAuthConnectionInputSchema, R as CredentialAssignmentListResponseSchema, Rn as detectProjectPackageManagerFromSnapshot, Rt as ProjectResponseSchema, S as CompleteProjectArtifactResponseSchema, Sn as UserAvatarSchema, St as OpenApiDiscoverResponseSchema, T as CreateApiKeyRequestSchema, Tn as WorkflowRunDetailResponseSchema, Tt as PROJECT_PULL_STATE_RELATIVE_PATH, U as CredentialInstanceRecordSchema, Un as parseAppSlug, Ut as QueuedAgentPromptResponseSchema, V as CredentialConsumerListResponseSchema, Vt as PromptInputSchema, W as DeclineOrganizationInvitationResponseSchema, Wn as parseErrorResponse, Wt as QueuedRunResponseSchema, X as GetCustomAppResponseSchema, Xt as StartKeystrokeConnectionInputSchema, Y as GetCredentialResponseSchema, Yt as SlugAvailabilityResponseSchema, Z as GraphqlDiscoverResponseSchema, Zt as StartKeystrokeConnectionResultSchema, _ as ChannelAccountListResponseSchema, _n as UpdateProjectSettingsRequestSchema, _t as ListProjectFilesResponseSchema, a as AgentSessionDetailResponseSchema, an as TriggerListResponseSchema, at as InviteProjectMembersRequestSchema, b as ChannelDirectoryListResponseSchema, bn as UpsertGatewayAttachmentBodySchema, bt as ListProjectsResponseSchema, c as AgentSummaryListResponseSchema, cn as UpdateChannelBindingBodySchema, ct as ListAgentMemoryFilesResponseSchema, d as AssignCredentialBodySchema, dn as UpdateOrganizationMemberRequestSchema, dt as ListAppsResponseSchema, en as StartOAuthConnectionInputSchema, et as HistoryRunDetailResponseSchema, f as BindChannelBodySchema, fn as UpdateOrganizationMemberResponseSchema, ft as ListCredentialsResponseSchema, g as CatalogAppsPageResponseSchema, gn as UpdateProjectRequestSchema, gt as ListProjectDeploymentsResponseSchema, h as CatalogAppDetailResponseSchema, hn as UpdateProjectMemberResponseSchema, ht as ListOrganizationsResponseSchema, i as AgentSessionChatStateResponseSchema, in as TriggerDetailResponseSchema, it as InviteOrganizationMembersResponseSchema, j as CreateCustomAppResponseSchema, jn as WorkspaceTriggerFileSchema, jt as PresignOrgLogoResponseSchema, k as CreateCredentialsResponseSchema, kn as WorkflowSummaryListResponseSchema, kt as PresignChatAttachmentResponseSchema, l as AgentTriggerSummaryListResponseSchema, ln as UpdateCredentialInstanceBodySchema, lt as ListAgentWorkspaceFilesResponseSchema, m as CatalogActionsPageResponseSchema, mn as UpdateProjectMemberRequestSchema, mt as ListOrganizationMembersResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as SubmitMarketingContactRequestSchema, nt as HistoryRunListResponseSchema, o as AgentSessionListResponseSchema, on as TriggerRunDetailResponseSchema, ot as InviteProjectMembersResponseSchema, p as CatalogActionDetailResponseSchema, pn as UpdateOrganizationRequestSchema, pt as ListOrganizationInvitationsResponseSchema, q as ErrorResponseSchema, qn as resolvePublicPlatformOrigin, qt as SkillSummaryDetailResponseSchema, r as ActiveOrganizationResponseSchema, rn as SubmitTeamRequestRequestSchema, rt as InviteOrganizationMembersRequestSchema, s as AgentSummaryDetailResponseSchema, sn as TriggerRunListResponseSchema, t as ACTIVE_ORG_HEADER, tn as StartOAuthConnectionResultSchema, tt as HistoryRunListQuerySchema, u as AppSlugAvailabilityResponseSchema, un as UpdateCredentialRequestSchema, ut as ListApiKeysResponseSchema, v as ChannelConnectionListResponseSchema, vn as UploadProjectSourceManifestRequestSchema, vt as ListProjectMembersResponseSchema, w as ConnectProvidersResponseSchema, wn as UserPreferencesSchema, wt as OrganizationSidebarBrandingSchema, x as ChannelPlatformSchema, xn as UserAvatarPatchSchema, xt as McpDiscoverResponseSchema, y as ChannelConnectionSchema, yn as UploadProjectSourceResponseSchema, yt as ListProjectMetricsResponseSchema, z as CredentialAssignmentRecordSchema, zn as isAcceptableInstallExit, zt as ProjectSettingsResponseSchema } from "./dist-CNZVjlhC.mjs";
|
|
3
|
+
import { a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, g as resolvePlatformUrlForWebUrl, i as installDependencies$1, 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-Dv-7vfQn.mjs";
|
|
4
|
+
import { n as mergeFilteredArtifact, r as packProjectArtifact, t as mapInParallelBatches } from "./dist-RRjysgkw.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { platform } from "node:os";
|
|
@@ -5375,25 +5375,117 @@ function collectValues$1(value, previous) {
|
|
|
5375
5375
|
}
|
|
5376
5376
|
//#endregion
|
|
5377
5377
|
//#region src/commands/app/run-app-create.ts
|
|
5378
|
-
async function runAppCreate(client, input) {
|
|
5378
|
+
async function runAppCreate(client, input, options) {
|
|
5379
|
+
if (options?.preview) return {
|
|
5380
|
+
preview: true,
|
|
5381
|
+
request: input,
|
|
5382
|
+
slug: await client.apps.checkSlug(input.slug)
|
|
5383
|
+
};
|
|
5379
5384
|
return client.apps.create(input);
|
|
5380
5385
|
}
|
|
5381
5386
|
//#endregion
|
|
5387
|
+
//#region src/commands/app/run-app-create-from-url.ts
|
|
5388
|
+
async function discoverApp(client, source, url) {
|
|
5389
|
+
switch (source) {
|
|
5390
|
+
case "mcp": return client.apps.discoverMcp({ url });
|
|
5391
|
+
case "openapi": return client.apps.discoverOpenApi({ url });
|
|
5392
|
+
case "graphql": return client.apps.discoverGraphql({ url });
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
function buildCreateRequest(input, template) {
|
|
5396
|
+
const derived = deriveCustomAppDisplay(template, {
|
|
5397
|
+
url: input.url,
|
|
5398
|
+
mcp: input.source === "mcp"
|
|
5399
|
+
});
|
|
5400
|
+
const name = input.name?.trim() || derived.name;
|
|
5401
|
+
const description = input.description?.trim() || derived.description;
|
|
5402
|
+
const slug = input.slug?.trim() || slugifyAppName(name);
|
|
5403
|
+
const authKind = input.authKind ?? template.authKind;
|
|
5404
|
+
return {
|
|
5405
|
+
name,
|
|
5406
|
+
slug,
|
|
5407
|
+
description,
|
|
5408
|
+
source: input.source,
|
|
5409
|
+
url: input.url,
|
|
5410
|
+
authKind,
|
|
5411
|
+
...input.fields ? { fields: input.fields } : template.credentialFields ? { fields: template.credentialFields } : {},
|
|
5412
|
+
...template.credentialScheme ? { credentialScheme: template.credentialScheme } : {},
|
|
5413
|
+
...authKind === "oauth" && template.oauthScopes.length > 0 ? { oauthScopes: template.oauthScopes } : {}
|
|
5414
|
+
};
|
|
5415
|
+
}
|
|
5416
|
+
async function runAppCreateFromUrl(client, input) {
|
|
5417
|
+
if (input.authKind && input.source !== "mcp") throw new Error("--auth is only supported with --mcp");
|
|
5418
|
+
const discovery = await discoverApp(client, input.source, input.url);
|
|
5419
|
+
if (!discovery.detected) throw new Error(input.source === "mcp" ? "Couldn't reach this MCP server. Check the URL and try again." : input.source === "openapi" ? "Couldn't read this OpenAPI spec. Check the URL and try again." : "Couldn't introspect this GraphQL endpoint. Check the URL and try again.");
|
|
5420
|
+
const request = buildCreateRequest(input, discovery.template);
|
|
5421
|
+
if (input.preview) return {
|
|
5422
|
+
preview: true,
|
|
5423
|
+
detected: true,
|
|
5424
|
+
request,
|
|
5425
|
+
slug: await client.apps.checkSlug(request.slug)
|
|
5426
|
+
};
|
|
5427
|
+
return client.apps.create(request);
|
|
5428
|
+
}
|
|
5429
|
+
//#endregion
|
|
5382
5430
|
//#region src/commands/app/create.ts
|
|
5431
|
+
function resolveDiscoverSource(options) {
|
|
5432
|
+
const sources = [
|
|
5433
|
+
options.mcp ? {
|
|
5434
|
+
source: "mcp",
|
|
5435
|
+
url: options.mcp
|
|
5436
|
+
} : null,
|
|
5437
|
+
options.openapi ? {
|
|
5438
|
+
source: "openapi",
|
|
5439
|
+
url: options.openapi
|
|
5440
|
+
} : null,
|
|
5441
|
+
options.graphql ? {
|
|
5442
|
+
source: "graphql",
|
|
5443
|
+
url: options.graphql
|
|
5444
|
+
} : null
|
|
5445
|
+
].filter((entry) => entry !== null);
|
|
5446
|
+
if (sources.length > 1) throw new Error("Use only one of --mcp, --openapi, or --graphql");
|
|
5447
|
+
return sources[0] ?? null;
|
|
5448
|
+
}
|
|
5449
|
+
function parseAuthKind(value) {
|
|
5450
|
+
if (!value) return;
|
|
5451
|
+
if (value === "oauth" || value === "api_key") return value;
|
|
5452
|
+
throw new Error("--auth must be oauth or api_key");
|
|
5453
|
+
}
|
|
5454
|
+
function parseFieldOverrides(flags) {
|
|
5455
|
+
if (flags.length === 0) return;
|
|
5456
|
+
return parseCustomAppFields(flags);
|
|
5457
|
+
}
|
|
5383
5458
|
function registerAppCreateCommand(app) {
|
|
5384
|
-
app.command("create").description("Create a custom org
|
|
5459
|
+
app.command("create").description("Create a custom org app").option("--name <name>", "App display name").option("--slug <slug>", "App slug segment (defaults from name)").option("--description <description>", "App description").option("--field <field>", "Credential field as key, key:secret, key:optional, or key:secret:optional (repeatable)", collectValues$1, []).option("--mcp <url>", "Create from an MCP server URL (auto-detect auth)").option("--openapi <url>", "Create from an OpenAPI spec URL (auto-detect auth)").option("--graphql <url>", "Create from a GraphQL endpoint URL (auto-detect auth)").option("--auth <kind>", "Override detected auth: oauth or api_key (MCP only)").option("--preview", "Show the request that would be created without creating").action((options) => runCliCommand("Create app failed", async () => {
|
|
5385
5460
|
const config = createCliConfig();
|
|
5386
5461
|
const client = createCliPlatformClient(config);
|
|
5387
5462
|
await ensureActiveOrganization(config);
|
|
5463
|
+
const discovery = resolveDiscoverSource(options);
|
|
5464
|
+
if (discovery) {
|
|
5465
|
+
const result = await runAppCreateFromUrl(client, {
|
|
5466
|
+
source: discovery.source,
|
|
5467
|
+
url: discovery.url.trim(),
|
|
5468
|
+
name: options.name,
|
|
5469
|
+
slug: options.slug,
|
|
5470
|
+
description: options.description,
|
|
5471
|
+
authKind: parseAuthKind(options.auth),
|
|
5472
|
+
fields: parseFieldOverrides(options.field),
|
|
5473
|
+
preview: options.preview ?? false
|
|
5474
|
+
});
|
|
5475
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
5476
|
+
return;
|
|
5477
|
+
}
|
|
5478
|
+
if (!options.name?.trim()) throw new Error("--name is required for custom apps");
|
|
5479
|
+
if (!options.description?.trim()) throw new Error("--description is required for custom apps");
|
|
5388
5480
|
const slug = options.slug?.trim() || slugifyAppName(options.name);
|
|
5389
|
-
const
|
|
5481
|
+
const result = await runAppCreate(client, {
|
|
5390
5482
|
name: options.name.trim(),
|
|
5391
5483
|
slug,
|
|
5392
|
-
description: options.description,
|
|
5484
|
+
description: options.description.trim(),
|
|
5393
5485
|
source: "custom",
|
|
5394
5486
|
fields: parseCustomAppFields(options.field)
|
|
5395
|
-
});
|
|
5396
|
-
process.stdout.write(`${JSON.stringify(
|
|
5487
|
+
}, { preview: options.preview ?? false });
|
|
5488
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
5397
5489
|
}, void 0, { orgScoped: true }));
|
|
5398
5490
|
}
|
|
5399
5491
|
//#endregion
|
|
@@ -6114,7 +6206,7 @@ function registerBuildCommand(program) {
|
|
|
6114
6206
|
program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
|
|
6115
6207
|
try {
|
|
6116
6208
|
const root = resolveProjectRoot(options.dir);
|
|
6117
|
-
const { buildApp } = await import("./dist-
|
|
6209
|
+
const { buildApp } = await import("./dist-DR8DYUc4.mjs");
|
|
6118
6210
|
await buildApp({ root });
|
|
6119
6211
|
process.stdout.write(`Built ${root}\n`);
|
|
6120
6212
|
} catch (error) {
|
|
@@ -6168,7 +6260,7 @@ async function sleep(ms) {
|
|
|
6168
6260
|
}
|
|
6169
6261
|
async function buildDeployArchive(client, root, projectId, filter) {
|
|
6170
6262
|
if (filter?.length) {
|
|
6171
|
-
const { buildFilteredApp } = await import("./dist-
|
|
6263
|
+
const { buildFilteredApp } = await import("./dist-DR8DYUc4.mjs");
|
|
6172
6264
|
const filtered = await buildFilteredApp({
|
|
6173
6265
|
root,
|
|
6174
6266
|
filter,
|
|
@@ -6190,7 +6282,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
|
|
|
6190
6282
|
sourceFiles: filtered.sourceFiles
|
|
6191
6283
|
};
|
|
6192
6284
|
}
|
|
6193
|
-
const { buildApp } = await import("./dist-
|
|
6285
|
+
const { buildApp } = await import("./dist-DR8DYUc4.mjs");
|
|
6194
6286
|
const { sourceFiles } = await buildApp({
|
|
6195
6287
|
root,
|
|
6196
6288
|
collectSources: true,
|
|
@@ -6309,7 +6401,7 @@ function runtimeChildEnv(parentEnv, overrides) {
|
|
|
6309
6401
|
//#region src/project/bootstrap-run.ts
|
|
6310
6402
|
/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
|
|
6311
6403
|
async function resolveBootstrapRun(options) {
|
|
6312
|
-
const { resolveRuntimeBuildArtifact } = await import("./dist-
|
|
6404
|
+
const { resolveRuntimeBuildArtifact } = await import("./dist-DR8DYUc4.mjs");
|
|
6313
6405
|
const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
|
|
6314
6406
|
const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/standalone-bootstrap.mjs");
|
|
6315
6407
|
const args = [`--import=${loader}`];
|
|
@@ -6458,7 +6550,7 @@ async function runDev(options) {
|
|
|
6458
6550
|
process.on("SIGINT", shutdown);
|
|
6459
6551
|
process.on("SIGTERM", shutdown);
|
|
6460
6552
|
try {
|
|
6461
|
-
const { watchApp } = await import("./dist-
|
|
6553
|
+
const { watchApp } = await import("./dist-DR8DYUc4.mjs");
|
|
6462
6554
|
await watchApp({
|
|
6463
6555
|
root,
|
|
6464
6556
|
clean: false,
|
|
@@ -6608,7 +6700,7 @@ const INIT_CATALOG_VERSIONS = {
|
|
|
6608
6700
|
vitest: "^4.1.7",
|
|
6609
6701
|
"@types/node": "^25.9.1"
|
|
6610
6702
|
};
|
|
6611
|
-
const INIT_KEYSTROKE_VERSION = "^0.1.
|
|
6703
|
+
const INIT_KEYSTROKE_VERSION = "^0.1.16";
|
|
6612
6704
|
//#endregion
|
|
6613
6705
|
//#region src/init/copy-template.ts
|
|
6614
6706
|
function renderTemplate(content, variables) {
|
|
@@ -7393,7 +7485,7 @@ async function runStart(options) {
|
|
|
7393
7485
|
const apiPort = Number(new URL(serverUrl).port || 80);
|
|
7394
7486
|
const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
|
|
7395
7487
|
ensureNativeDeps(runtimeNodeModules);
|
|
7396
|
-
const { buildApp } = await import("./dist-
|
|
7488
|
+
const { buildApp } = await import("./dist-DR8DYUc4.mjs");
|
|
7397
7489
|
await buildApp({
|
|
7398
7490
|
root,
|
|
7399
7491
|
clean: false
|
|
@@ -7977,7 +8069,7 @@ function createProgram() {
|
|
|
7977
8069
|
return program;
|
|
7978
8070
|
}
|
|
7979
8071
|
async function runCli(argv) {
|
|
7980
|
-
const { maybeAutoUpdate } = await import("./maybe-auto-update-
|
|
8072
|
+
const { maybeAutoUpdate } = await import("./maybe-auto-update-BNvizwom.mjs");
|
|
7981
8073
|
await maybeAutoUpdate(argv);
|
|
7982
8074
|
createProgram().parse(argv);
|
|
7983
8075
|
}
|