@keystrokehq/cli 0.1.22 → 0.1.24
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-UdbUy9DM.mjs → dist-BOhrc_Nv.mjs} +20 -2
- package/dist/{dist-UdbUy9DM.mjs.map → dist-BOhrc_Nv.mjs.map} +1 -1
- package/dist/{dist-Bwn5tAiT.mjs → dist-C1QOfWMM.mjs} +206 -8545
- package/dist/dist-C1QOfWMM.mjs.map +1 -0
- package/dist/{dist-BdewSOMb.mjs → dist-CUEVu120.mjs} +3 -3
- package/dist/{dist-BdewSOMb.mjs.map → dist-CUEVu120.mjs.map} +1 -1
- package/dist/dist-DsdMtFME.mjs +3 -0
- package/dist/dist-Re6HHSqz.mjs +11561 -0
- package/dist/dist-Re6HHSqz.mjs.map +1 -0
- package/dist/index.mjs +86 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{maybe-auto-update-BK4A8nTA.mjs → maybe-auto-update-q5MthdI8.mjs} +2 -2
- package/dist/{maybe-auto-update-BK4A8nTA.mjs.map → maybe-auto-update-q5MthdI8.mjs.map} +1 -1
- package/dist/skills-bundle/_AGENTS.mcp.md +101 -38
- package/dist/skills-bundle/_AGENTS.md +128 -49
- package/dist/skills-bundle/skills/keystroke-agents/SKILL.md +1 -1
- package/dist/skills-bundle/skills/keystroke-agents/references/tools-mcp-codemode.md +23 -11
- package/dist/skills-bundle/skills/keystroke-workflows/SKILL.md +2 -2
- package/dist/skills-bundle/skills/keystroke-workflows/references/authoring.md +1 -1
- package/dist/{version-CUTRAMa8.mjs → version-DcR3O1UD.mjs} +2 -2
- package/dist/{version-CUTRAMa8.mjs.map → version-DcR3O1UD.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-Bwn5tAiT.mjs.map +0 -1
- package/dist/dist-D8wvycYm.mjs +0 -127
- package/dist/dist-D8wvycYm.mjs.map +0 -1
- package/dist/dist-Dms4EW-W.mjs +0 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
2
|
+
import { $ as GetCustomAppResponseSchema, $n as slugifyAppName, $t as SlugAvailabilityResponseSchema, A as CreateCustomAppRequestSchema, An as WorkflowRunHooksResponseSchema, At as PollRunResponseSchema, B as CredentialConsumerListQuerySchema, Bt as ProjectReachabilityResponseSchema, C as ConnectAuthorizeUrlResponseSchema, Cn as UploadProjectSourceResponseSchema, Ct as ListProjectsResponseSchema, D as CreateCredentialInstanceBodySchema, Dn as UserPreferencesPatchSchema, Dt as OrganizationSidebarBrandingSchema, E as CreateApiKeyResponseSchema, En as UserAvatarSchema, Et as OrganizationSidebarBrandingPatchSchema, F as CreateProjectRequestSchema, Fn as WorkspaceTriggerFileSchema, Ft as PresignProjectSourceRequestSchema, G as DOCS_QUERY_TOOL, Gt as PromptResponseSchema, H as CredentialInstanceListResponseSchema, Hn as detectProjectPackageManagerFromSnapshot, Ht as ProjectSettingsResponseSchema, I as CreateProjectResponseSchema, In as WorkspaceTriggerListResponseSchema, It as PresignProjectSourceResponseSchema, J as DownloadActiveProjectArtifactResponseSchema, Jn as parseErrorResponse, Jt as QueuedRunResponseSchema, K as DOCS_SEARCH_TOOL, L as CredentialAssignmentListQuerySchema, Ln as WorkspaceTriggerOverviewSchema, Lt as PresignUserAvatarRequestSchema, M as CreateOrganizationRequestSchema, Mn as WorkflowSummaryDetailResponseSchema, Mt as PresignChatAttachmentResponseSchema, N as CreateOrganizationResponseSchema, Nn as WorkflowSummaryListResponseSchema, Nt as PresignOrgLogoRequestSchema, O as CreateCredentialsRequestSchema, On as UserPreferencesSchema, Ot as PROJECT_PULL_STATE_RELATIVE_PATH, P as CreateProjectArtifactResponseSchema, Pn as WorkspaceTriggerDetailSchema, Pt as PresignOrgLogoResponseSchema, Q as GetCredentialResponseSchema, Qn as resolvePublicPlatformOrigin, Qt as SkillSummaryListResponseSchema, R as CredentialAssignmentListResponseSchema, Rn as WorkspaceTriggerRunListResponseSchema, Rt as PresignUserAvatarResponseSchema, S as CompleteProjectArtifactResponseSchema, Sn as UploadProjectSourceManifestRequestSchema, St as ListProjectMetricsResponseSchema, T as CreateApiKeyRequestSchema, Tn as UserAvatarPatchSchema, Tt as OpenApiDiscoverResponseSchema, U as CredentialInstanceRecordSchema, Un as isAcceptableInstallExit, Ut as ProjectSlugAvailabilityResponseSchema, V as CredentialConsumerListResponseSchema, Vn as deriveCustomAppDisplay, Vt as ProjectResponseSchema, Wn as listenPortFromPublicUrl, Wt as PromptInputSchema, X as ErrorResponseSchema, Xn as resolveConnectAppSlug, Xt as RecentResourceListResponseSchema, Y as DownloadActiveProjectSourceResponseSchema, Z as GatewayAttachmentRecordSchema, Zn as resolveDocsMcpUrl, Zt as SkillSummaryDetailResponseSchema, _ as ChannelAccountListResponseSchema, _n as UpdateOrganizationRequestSchema, _t as ListOrganizationMembersResponseSchema, a as AgentSessionDetailResponseSchema, an as StartOAuthConnectionResultSchema, at as HistoryRunListResponseSchema, b as ChannelDirectoryListResponseSchema, bn as UpdateProjectRequestSchema, bt as ListProjectFilesResponseSchema, c as AgentSummaryListResponseSchema, cn as TriggerDetailResponseSchema, ct as InviteProjectMembersRequestSchema, d as AssignCredentialBodySchema, dn as TriggerRunListResponseSchema, dt as ListAgentMemoryFilesResponseSchema, en as StartKeystrokeConnectionInputSchema, et as GraphqlDiscoverResponseSchema, f as BindChannelBodySchema, fn as UpdateChannelBindingBodySchema, ft as ListAgentWorkspaceFilesResponseSchema, g as CatalogAppsPageResponseSchema, gn as UpdateOrganizationMemberResponseSchema, gt as ListOrganizationInvitationsResponseSchema, h as CatalogAppDetailResponseSchema, hn as UpdateOrganizationMemberRequestSchema, ht as ListCredentialsResponseSchema, i as AgentSessionChatStateResponseSchema, in as StartOAuthConnectionInputSchema, it as HistoryRunListQuerySchema, j as CreateCustomAppResponseSchema, jn as WorkflowRunListResponseSchema, jt as PresignChatAttachmentRequestSchema, k as CreateCredentialsResponseSchema, kn as WorkflowRunDetailResponseSchema, kt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, l as AgentTriggerSummaryListResponseSchema, ln as TriggerListResponseSchema, lt as InviteProjectMembersResponseSchema, m as CatalogActionsPageResponseSchema, mn as UpdateCredentialRequestSchema, mt as ListAppsResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as StartMcpOAuthConnectionInputSchema, nt as HistoryRunCancelResponseSchema, o as AgentSessionListResponseSchema, on as SubmitMarketingContactRequestSchema, ot as InviteOrganizationMembersRequestSchema, p as CatalogActionDetailResponseSchema, pn as UpdateCredentialInstanceBodySchema, pt as ListApiKeysResponseSchema, q as DeclineOrganizationInvitationResponseSchema, qn as parseAppSlug, qt as QueuedAgentPromptResponseSchema, r as ActiveOrganizationResponseSchema, rn as StartMcpOAuthConnectionResultSchema, rt as HistoryRunDetailResponseSchema, s as AgentSummaryDetailResponseSchema, sn as SubmitTeamRequestRequestSchema, st as InviteOrganizationMembersResponseSchema, t as ACTIVE_ORG_HEADER, tn as StartKeystrokeConnectionResultSchema, tt as HealthResponseSchema, u as AppSlugAvailabilityResponseSchema, un as TriggerRunDetailResponseSchema, v as ChannelConnectionListResponseSchema, vn as UpdateProjectMemberRequestSchema, vt as ListOrganizationsResponseSchema, w as ConnectProvidersResponseSchema, wn as UpsertGatewayAttachmentBodySchema, wt as McpDiscoverResponseSchema, x as ChannelPlatformSchema, xn as UpdateProjectSettingsRequestSchema, xt as ListProjectMembersResponseSchema, y as ChannelConnectionSchema, yn as UpdateProjectMemberResponseSchema, yt as ListProjectDeploymentsResponseSchema, z as CredentialAssignmentRecordSchema, zn as buildConnectDeeplink, zt as ProjectPullStateSchema } from "./dist-BOhrc_Nv.mjs";
|
|
3
|
+
import { i as packProjectArtifact, n as withMcpReadClient, r as mergeFilteredArtifact, t as mapInParallelBatches } from "./dist-Re6HHSqz.mjs";
|
|
4
|
+
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-DcR3O1UD.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { platform } from "node:os";
|
|
@@ -5012,6 +5012,23 @@ function formatCliError(error, fallback, context) {
|
|
|
5012
5012
|
}
|
|
5013
5013
|
//#endregion
|
|
5014
5014
|
//#region src/errors/run-command.ts
|
|
5015
|
+
/**
|
|
5016
|
+
* Run a command that needs no project/org target or auth (e.g. public docs).
|
|
5017
|
+
* Builds config and formats errors, but skips `resolveApiTarget` / `ensureActiveOrganization`,
|
|
5018
|
+
* so it works logged-out from any directory.
|
|
5019
|
+
*/
|
|
5020
|
+
async function runStandaloneCliCommand(fallback, fn, errorContext) {
|
|
5021
|
+
const config = createCliConfig();
|
|
5022
|
+
try {
|
|
5023
|
+
await fn({ config });
|
|
5024
|
+
} catch (error) {
|
|
5025
|
+
process.stderr.write(`${formatCliError(error, fallback, {
|
|
5026
|
+
...errorContext,
|
|
5027
|
+
webUrl: getWebUrl(config)
|
|
5028
|
+
})}\n`);
|
|
5029
|
+
process.exitCode = 1;
|
|
5030
|
+
}
|
|
5031
|
+
}
|
|
5015
5032
|
async function runProjectCliCommand(fallback, fn, errorContext, targetOptions = {}) {
|
|
5016
5033
|
return runCliCommand(fallback, fn, errorContext, {
|
|
5017
5034
|
...projectScopedTarget,
|
|
@@ -6206,7 +6223,7 @@ function registerBuildCommand(program) {
|
|
|
6206
6223
|
program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
|
|
6207
6224
|
try {
|
|
6208
6225
|
const root = resolveProjectRoot(options.dir);
|
|
6209
|
-
const { buildApp } = await import("./dist-
|
|
6226
|
+
const { buildApp } = await import("./dist-CUEVu120.mjs");
|
|
6210
6227
|
await buildApp({ root });
|
|
6211
6228
|
process.stdout.write(`Built ${root}\n`);
|
|
6212
6229
|
} catch (error) {
|
|
@@ -6260,7 +6277,7 @@ async function sleep(ms) {
|
|
|
6260
6277
|
}
|
|
6261
6278
|
async function buildDeployArchive(client, root, projectId, filter) {
|
|
6262
6279
|
if (filter?.length) {
|
|
6263
|
-
const { buildFilteredApp } = await import("./dist-
|
|
6280
|
+
const { buildFilteredApp } = await import("./dist-CUEVu120.mjs");
|
|
6264
6281
|
const filtered = await buildFilteredApp({
|
|
6265
6282
|
root,
|
|
6266
6283
|
filter,
|
|
@@ -6282,7 +6299,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
|
|
|
6282
6299
|
sourceFiles: filtered.sourceFiles
|
|
6283
6300
|
};
|
|
6284
6301
|
}
|
|
6285
|
-
const { buildApp } = await import("./dist-
|
|
6302
|
+
const { buildApp } = await import("./dist-CUEVu120.mjs");
|
|
6286
6303
|
const { sourceFiles } = await buildApp({
|
|
6287
6304
|
root,
|
|
6288
6305
|
collectSources: true,
|
|
@@ -6401,7 +6418,7 @@ function runtimeChildEnv(parentEnv, overrides) {
|
|
|
6401
6418
|
//#region src/project/bootstrap-run.ts
|
|
6402
6419
|
/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
|
|
6403
6420
|
async function resolveBootstrapRun(options) {
|
|
6404
|
-
const { resolveRuntimeBuildArtifact } = await import("./dist-
|
|
6421
|
+
const { resolveRuntimeBuildArtifact } = await import("./dist-CUEVu120.mjs");
|
|
6405
6422
|
const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
|
|
6406
6423
|
const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/standalone-bootstrap.mjs");
|
|
6407
6424
|
const args = [`--import=${loader}`];
|
|
@@ -6550,7 +6567,7 @@ async function runDev(options) {
|
|
|
6550
6567
|
process.on("SIGINT", shutdown);
|
|
6551
6568
|
process.on("SIGTERM", shutdown);
|
|
6552
6569
|
try {
|
|
6553
|
-
const { watchApp } = await import("./dist-
|
|
6570
|
+
const { watchApp } = await import("./dist-CUEVu120.mjs");
|
|
6554
6571
|
await watchApp({
|
|
6555
6572
|
root,
|
|
6556
6573
|
clean: false,
|
|
@@ -6578,6 +6595,63 @@ function registerDevCommand(program) {
|
|
|
6578
6595
|
});
|
|
6579
6596
|
}
|
|
6580
6597
|
//#endregion
|
|
6598
|
+
//#region src/commands/docs/run-docs.ts
|
|
6599
|
+
/**
|
|
6600
|
+
* Render an MCP tool result for the terminal. The docs tools return text/markdown
|
|
6601
|
+
* blocks (search hits, file contents, sandbox stdout/stderr), so we pass them through
|
|
6602
|
+
* verbatim and only fall back to JSON when a result carries no text.
|
|
6603
|
+
*/
|
|
6604
|
+
function renderToolResult(result) {
|
|
6605
|
+
const blocks = result?.content;
|
|
6606
|
+
if (Array.isArray(blocks)) {
|
|
6607
|
+
const text = blocks.filter((block) => block?.type === "text" && typeof block.text === "string").map((block) => block.text).join("\n");
|
|
6608
|
+
if (text.length > 0) return text;
|
|
6609
|
+
}
|
|
6610
|
+
return JSON.stringify(result, null, 2);
|
|
6611
|
+
}
|
|
6612
|
+
/** Call a docs MCP tool and render its result as text. */
|
|
6613
|
+
async function callDocsTool(client, name, args) {
|
|
6614
|
+
return renderToolResult(await client.callTool({
|
|
6615
|
+
name,
|
|
6616
|
+
arguments: args
|
|
6617
|
+
}));
|
|
6618
|
+
}
|
|
6619
|
+
//#endregion
|
|
6620
|
+
//#region src/commands/docs/docs-mcp-url.ts
|
|
6621
|
+
/**
|
|
6622
|
+
* Public Keystroke docs MCP endpoint (Mintlify-hosted, no auth).
|
|
6623
|
+
* Derived from the configured web URL; `KEYSTROKE_DOCS_MCP_URL` overrides for dev/testing.
|
|
6624
|
+
*/
|
|
6625
|
+
function getDocsMcpUrl(config) {
|
|
6626
|
+
return resolveDocsMcpUrl({
|
|
6627
|
+
webUrl: getWebUrl(config),
|
|
6628
|
+
override: process.env.KEYSTROKE_DOCS_MCP_URL
|
|
6629
|
+
});
|
|
6630
|
+
}
|
|
6631
|
+
//#endregion
|
|
6632
|
+
//#region src/commands/docs/query.ts
|
|
6633
|
+
function registerDocsQueryCommand(docs) {
|
|
6634
|
+
docs.command("query").description("Read the Keystroke docs filesystem with a shell-style command (cat, rg, ls, tree)").argument("<command>", "Read-only command, e.g. \"cat /quickstart.mdx\" or \"rg -il auth /\"").action((command) => runStandaloneCliCommand("Docs query failed", async ({ config }) => {
|
|
6635
|
+
const output = await withMcpReadClient(getDocsMcpUrl(config), (client) => callDocsTool(client, DOCS_QUERY_TOOL, { command }));
|
|
6636
|
+
process.stdout.write(`${output}\n`);
|
|
6637
|
+
}));
|
|
6638
|
+
}
|
|
6639
|
+
//#endregion
|
|
6640
|
+
//#region src/commands/docs/search.ts
|
|
6641
|
+
function registerDocsSearchCommand(docs) {
|
|
6642
|
+
docs.command("search").description("Search the Keystroke documentation for relevant pages and examples").argument("<query>", "Search query").action((query) => runStandaloneCliCommand("Docs search failed", async ({ config }) => {
|
|
6643
|
+
const output = await withMcpReadClient(getDocsMcpUrl(config), (client) => callDocsTool(client, DOCS_SEARCH_TOOL, { query }));
|
|
6644
|
+
process.stdout.write(`${output}\n`);
|
|
6645
|
+
}));
|
|
6646
|
+
}
|
|
6647
|
+
//#endregion
|
|
6648
|
+
//#region src/commands/docs/index.ts
|
|
6649
|
+
function registerDocsCommand(program) {
|
|
6650
|
+
const docs = program.command("docs").description("Search and read the Keystroke documentation");
|
|
6651
|
+
registerDocsSearchCommand(docs);
|
|
6652
|
+
registerDocsQueryCommand(docs);
|
|
6653
|
+
}
|
|
6654
|
+
//#endregion
|
|
6581
6655
|
//#region src/commands/history/run-history.ts
|
|
6582
6656
|
async function runHistoryList(config, filters) {
|
|
6583
6657
|
if (filters?.admin) await requireAdminRole(config);
|
|
@@ -6700,7 +6774,7 @@ const INIT_CATALOG_VERSIONS = {
|
|
|
6700
6774
|
vitest: "^4.1.7",
|
|
6701
6775
|
"@types/node": "^25.9.1"
|
|
6702
6776
|
};
|
|
6703
|
-
const INIT_KEYSTROKE_VERSION = "^0.1.
|
|
6777
|
+
const INIT_KEYSTROKE_VERSION = "^0.1.22";
|
|
6704
6778
|
//#endregion
|
|
6705
6779
|
//#region src/init/copy-template.ts
|
|
6706
6780
|
function renderTemplate(content, variables) {
|
|
@@ -7485,7 +7559,7 @@ async function runStart(options) {
|
|
|
7485
7559
|
const apiPort = Number(new URL(serverUrl).port || 80);
|
|
7486
7560
|
const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
|
|
7487
7561
|
ensureNativeDeps(runtimeNodeModules);
|
|
7488
|
-
const { buildApp } = await import("./dist-
|
|
7562
|
+
const { buildApp } = await import("./dist-CUEVu120.mjs");
|
|
7489
7563
|
await buildApp({
|
|
7490
7564
|
root,
|
|
7491
7565
|
clean: false
|
|
@@ -8053,6 +8127,7 @@ function createProgram() {
|
|
|
8053
8127
|
registerHistoryCommand(program);
|
|
8054
8128
|
registerCredentialsCommand(program);
|
|
8055
8129
|
registerHealthCommand(program);
|
|
8130
|
+
registerDocsCommand(program);
|
|
8056
8131
|
registerInitCommand(program);
|
|
8057
8132
|
registerSkillsCommand(program);
|
|
8058
8133
|
registerSkillCommand(program);
|
|
@@ -8069,7 +8144,7 @@ function createProgram() {
|
|
|
8069
8144
|
return program;
|
|
8070
8145
|
}
|
|
8071
8146
|
async function runCli(argv) {
|
|
8072
|
-
const { maybeAutoUpdate } = await import("./maybe-auto-update-
|
|
8147
|
+
const { maybeAutoUpdate } = await import("./maybe-auto-update-q5MthdI8.mjs");
|
|
8073
8148
|
await maybeAutoUpdate(argv);
|
|
8074
8149
|
createProgram().parse(argv);
|
|
8075
8150
|
}
|