@keystrokehq/cli 0.1.10 → 0.1.12
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-HoBmjMMW.mjs → dist-6SGC3_sP.mjs} +3 -3
- package/dist/{dist-HoBmjMMW.mjs.map → dist-6SGC3_sP.mjs.map} +1 -1
- package/dist/{pack-artifact-DVnIKrsg-BtNTTQcz.mjs → dist-B5J-6H3s.mjs} +18 -3
- package/dist/dist-B5J-6H3s.mjs.map +1 -0
- package/dist/dist-Cqw_hGsn.mjs +3 -0
- package/dist/{dist-BZ7i1Hoi.mjs → dist-DcfYnVPO.mjs} +3 -6
- package/dist/dist-DcfYnVPO.mjs.map +1 -0
- package/dist/{dist-YV-kApfg.mjs → dist-_Yd8KWRF.mjs} +82 -2
- package/dist/{dist-YV-kApfg.mjs.map → dist-_Yd8KWRF.mjs.map} +1 -1
- package/dist/index.mjs +95 -27
- package/dist/index.mjs.map +1 -1
- package/dist/{maybe-auto-update-BiR_kXZX.mjs → maybe-auto-update-CbwO4TTH.mjs} +2 -2
- package/dist/{maybe-auto-update-BiR_kXZX.mjs.map → maybe-auto-update-CbwO4TTH.mjs.map} +1 -1
- package/dist/skills-bundle/_AGENTS.mcp.md +70 -0
- package/dist/{version-BGuC7Cpu.mjs → version-DM_9LxFn.mjs} +2 -2
- package/dist/{version-BGuC7Cpu.mjs.map → version-DM_9LxFn.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/dist-BZ7i1Hoi.mjs.map +0 -1
- package/dist/dist-BkRNDWxd.mjs +0 -3
- package/dist/pack-artifact-DVnIKrsg-BtNTTQcz.mjs.map +0 -1
|
@@ -6160,6 +6160,69 @@ function buildConnectDeeplink(options) {
|
|
|
6160
6160
|
const params = new URLSearchParams({ connect: options.appSlug });
|
|
6161
6161
|
return `${base}/${options.orgSlug}/apps?${params.toString()}`;
|
|
6162
6162
|
}
|
|
6163
|
+
function resolveConnectAppSlug(slug, apps) {
|
|
6164
|
+
const trimmed = slug.trim();
|
|
6165
|
+
if (!trimmed) throw new Error("App slug is required");
|
|
6166
|
+
try {
|
|
6167
|
+
parseAppSlug(trimmed);
|
|
6168
|
+
} catch {
|
|
6169
|
+
throw new Error(`Invalid app slug: ${slug}`);
|
|
6170
|
+
}
|
|
6171
|
+
const match = apps.find((app) => app.id === trimmed);
|
|
6172
|
+
if (!match) {
|
|
6173
|
+
const available = apps.map((app) => app.id).join(", ") || "(none)";
|
|
6174
|
+
throw new Error(`Unknown app "${trimmed}". Available: ${available}`);
|
|
6175
|
+
}
|
|
6176
|
+
return match;
|
|
6177
|
+
}
|
|
6178
|
+
const LOCKFILE_MANAGERS = [
|
|
6179
|
+
["pnpm-lock.yaml", "pnpm"],
|
|
6180
|
+
["yarn.lock", "yarn"],
|
|
6181
|
+
["bun.lockb", "bun"],
|
|
6182
|
+
["package-lock.json", "npm"]
|
|
6183
|
+
];
|
|
6184
|
+
function parsePackageManagerField(raw) {
|
|
6185
|
+
const manager = raw.split("@")[0]?.trim().toLowerCase();
|
|
6186
|
+
if (manager === "npm" || manager === "pnpm" || manager === "yarn" || manager === "bun") return manager;
|
|
6187
|
+
}
|
|
6188
|
+
function detectFromPackageJsonContents(packageJson) {
|
|
6189
|
+
if (!packageJson) return;
|
|
6190
|
+
try {
|
|
6191
|
+
const parsed = JSON.parse(packageJson);
|
|
6192
|
+
if (typeof parsed.packageManager === "string") return parsePackageManagerField(parsed.packageManager);
|
|
6193
|
+
} catch {
|
|
6194
|
+
return;
|
|
6195
|
+
}
|
|
6196
|
+
}
|
|
6197
|
+
function detectFromLockfileNames(paths) {
|
|
6198
|
+
for (const [lockfile, manager] of LOCKFILE_MANAGERS) if (paths.has(lockfile)) return manager;
|
|
6199
|
+
}
|
|
6200
|
+
/**
|
|
6201
|
+
* Infer the package manager from an in-memory set of project files (e.g. a
|
|
6202
|
+
* deploy source snapshot). Pure and browser-safe — no filesystem access, so it
|
|
6203
|
+
* is safe to expose from `@keystrokehq/shared` (bundled by the web app).
|
|
6204
|
+
* Prefers `package.json`'s `packageManager`, then a lockfile; defaults to npm.
|
|
6205
|
+
*/
|
|
6206
|
+
function detectProjectPackageManagerFromSnapshot(files) {
|
|
6207
|
+
const paths = new Set(files.map((file) => file.path));
|
|
6208
|
+
const packageJson = files.find((file) => file.path === "package.json")?.contents;
|
|
6209
|
+
const fromField = detectFromPackageJsonContents(packageJson);
|
|
6210
|
+
if (fromField) return fromField;
|
|
6211
|
+
return detectFromLockfileNames(paths) ?? "npm";
|
|
6212
|
+
}
|
|
6213
|
+
/**
|
|
6214
|
+
* Whether a package-manager install exit should be treated as success.
|
|
6215
|
+
*
|
|
6216
|
+
* pnpm 10+ exits non-zero with `ERR_PNPM_IGNORED_BUILDS` when a dependency's
|
|
6217
|
+
* build script is not approved (e.g. native modules like better-sqlite3). The
|
|
6218
|
+
* dependencies are still fully installed — only the optional build script was
|
|
6219
|
+
* skipped — so this is not a real install failure for our purposes.
|
|
6220
|
+
*/
|
|
6221
|
+
function isAcceptableInstallExit(manager, exitCode, output) {
|
|
6222
|
+
if (exitCode === 0) return true;
|
|
6223
|
+
if (manager === "pnpm" && output.includes("ERR_PNPM_IGNORED_BUILDS")) return true;
|
|
6224
|
+
return false;
|
|
6225
|
+
}
|
|
6163
6226
|
/** How a credential instance is stored (`credential_instances.auth_kind`). */
|
|
6164
6227
|
const CredentialAuthKindSchema = _enum([
|
|
6165
6228
|
"api_key",
|
|
@@ -7604,6 +7667,23 @@ object({
|
|
|
7604
7667
|
})),
|
|
7605
7668
|
generatedAt: isoDateTime
|
|
7606
7669
|
});
|
|
7670
|
+
/** A single source file returned by the bulk active-source download endpoint. */
|
|
7671
|
+
const DownloadActiveProjectSourceFileSchema = object({
|
|
7672
|
+
path: string().min(1),
|
|
7673
|
+
contents: string()
|
|
7674
|
+
});
|
|
7675
|
+
/** Response for downloading all source files from a project's active deploy. */
|
|
7676
|
+
const DownloadActiveProjectSourceResponseSchema = object({
|
|
7677
|
+
artifactId: string(),
|
|
7678
|
+
files: array(DownloadActiveProjectSourceFileSchema)
|
|
7679
|
+
});
|
|
7680
|
+
/** Relative path written after a local pull or MCP workspace hydration. */
|
|
7681
|
+
const PROJECT_PULL_STATE_RELATIVE_PATH = ".keystroke/pull-state.json";
|
|
7682
|
+
const ProjectPullStateSchema = object({
|
|
7683
|
+
projectId: string(),
|
|
7684
|
+
artifactId: string(),
|
|
7685
|
+
pulledAt: string().datetime()
|
|
7686
|
+
});
|
|
7607
7687
|
const ListAgentMemoryFilesResponseSchema = object({ files: array(object({
|
|
7608
7688
|
id: string(),
|
|
7609
7689
|
path: string().min(1)
|
|
@@ -7613,6 +7693,6 @@ const ListAgentWorkspaceFilesResponseSchema = object({ files: array(object({
|
|
|
7613
7693
|
path: string().min(1)
|
|
7614
7694
|
})) });
|
|
7615
7695
|
//#endregion
|
|
7616
|
-
export {
|
|
7696
|
+
export { HistoryRunCancelResponseSchema as $, custom as $n, StartOAuthConnectionResultSchema as $t, CreateCustomAppRequestSchema as A, WorkspaceTriggerOverviewSchema as An, PresignProjectSourceRequestSchema as At, CredentialConsumerListQuerySchema as B, parseErrorResponse as Bn, PromptResponseSchema as Bt, ConnectAuthorizeUrlResponseSchema as C, WorkflowRunDetailResponseSchema as Cn, OrganizationSidebarBrandingPatchSchema as Ct, CreateCredentialInstanceBodySchema as D, WorkspaceTriggerDetailSchema as Dn, PollRunResponseSchema as Dt, CreateApiKeyResponseSchema as E, WorkflowSummaryListResponseSchema as En, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as Et, CreateProjectRequestSchema as F, isAcceptableInstallExit as Fn, ProjectReachabilityResponseSchema as Ft, DownloadActiveProjectArtifactResponseSchema as G, number as Gn, SkillSummaryDetailResponseSchema as Gt, CredentialInstanceListResponseSchema as H, resolveConnectAppSlug as Hn, QueuedRunResponseSchema as Ht, CreateProjectResponseSchema as I, listenPortFromPublicUrl as In, ProjectResponseSchema as It, GatewayAttachmentRecordSchema as J, _function as Jn, StartKeystrokeConnectionInputSchema as Jt, DownloadActiveProjectSourceResponseSchema as K, ZodType as Kn, SkillSummaryListResponseSchema as Kt, CredentialAssignmentListQuerySchema as L, normalizeCredentialList as Ln, ProjectSettingsResponseSchema as Lt, CreateOrganizationRequestSchema as M, buildConnectDeeplink as Mn, PresignUserAvatarRequestSchema as Mt, CreateOrganizationResponseSchema as N, credentialInputSchema as Nn, PresignUserAvatarResponseSchema as Nt, CreateCredentialsRequestSchema as O, WorkspaceTriggerFileSchema as On, PresignOrgLogoRequestSchema as Ot, CreateProjectArtifactResponseSchema as P, detectProjectPackageManagerFromSnapshot as Pn, ProjectPullStateSchema as Pt, HealthResponseSchema as Q, boolean as Qn, StartOAuthConnectionInputSchema as Qt, CredentialAssignmentListResponseSchema as R, originFromPublicUrl as Rn, ProjectSlugAvailabilityResponseSchema as Rt, CompleteProjectArtifactResponseSchema as S, UserPreferencesSchema as Sn, OpenApiDiscoverResponseSchema as St, CreateApiKeyRequestSchema as T, WorkflowSummaryDetailResponseSchema as Tn, PROJECT_PULL_STATE_RELATIVE_PATH as Tt, CredentialInstanceRecordSchema as U, resolvePublicPlatformOrigin as Un, ROUTE_MANIFEST_REL_PATH as Ut, CredentialConsumerListResponseSchema as V, parseStoredRouteManifest as Vn, QueuedAgentPromptResponseSchema as Vt, DeclineOrganizationInvitationResponseSchema as W, slugifyAppName as Wn, RecentResourceListResponseSchema as Wt, GetCustomAppResponseSchema as X, any as Xn, StartMcpOAuthConnectionInputSchema as Xt, GetCredentialResponseSchema as Y, _null as Yn, StartKeystrokeConnectionResultSchema as Yt, GraphqlDiscoverResponseSchema as Z, array as Zn, StartMcpOAuthConnectionResultSchema as Zt, ChannelAccountListResponseSchema as _, UploadProjectSourceResponseSchema as _n, ListProjectFilesResponseSchema as _t, AgentSessionDetailResponseSchema as a, TriggerRunListResponseSchema as an, object as ar, InviteProjectMembersRequestSchema as at, ChannelDirectoryListResponseSchema as b, UserAvatarSchema as bn, ListProjectsResponseSchema as bt, AgentSummaryListResponseSchema as c, UpdateCredentialRequestSchema as cn, record as cr, ListAgentMemoryFilesResponseSchema as ct, AssignCredentialBodySchema as d, UpdateOrganizationRequestSchema as dn, unknown as dr, ListAppsResponseSchema as dt, SubmitMarketingContactRequestSchema as en, discriminatedUnion as er, HistoryRunDetailResponseSchema as et, BindChannelBodySchema as f, UpdateProjectMemberRequestSchema as fn, url as fr, ListCredentialsResponseSchema as ft, CatalogAppsPageResponseSchema as g, UploadProjectSourceManifestRequestSchema as gn, ListProjectDeploymentsResponseSchema as gt, CatalogAppDetailResponseSchema as h, UpdateProjectSettingsRequestSchema as hn, NEVER as hr, ListOrganizationsResponseSchema as ht, AgentSessionChatStateResponseSchema as i, TriggerRunDetailResponseSchema as in, number$1 as ir, InviteOrganizationMembersResponseSchema as it, CreateCustomAppResponseSchema as j, WorkspaceTriggerRunListResponseSchema as jn, PresignProjectSourceResponseSchema as jt, CreateCredentialsResponseSchema as k, WorkspaceTriggerListResponseSchema as kn, PresignOrgLogoResponseSchema as kt, AgentTriggerSummaryListResponseSchema as l, UpdateOrganizationMemberRequestSchema as ln, string as lr, ListAgentWorkspaceFilesResponseSchema as lt, CatalogActionsPageResponseSchema as m, UpdateProjectRequestSchema as mn, toJSONSchema as mr, ListOrganizationMembersResponseSchema as mt, AcceptOrganizationInvitationResponseSchema as n, TriggerDetailResponseSchema as nn, literal as nr, HistoryRunListResponseSchema as nt, AgentSessionListResponseSchema as o, UpdateChannelBindingBodySchema as on, optional as or, InviteProjectMembersResponseSchema as ot, CatalogActionDetailResponseSchema as p, UpdateProjectMemberResponseSchema as pn, datetime as pr, ListOrganizationInvitationsResponseSchema as pt, ErrorResponseSchema as q, _enum as qn, SlugAvailabilityResponseSchema as qt, ActiveOrganizationResponseSchema as r, TriggerListResponseSchema as rn, looseObject as rr, InviteOrganizationMembersRequestSchema as rt, AgentSummaryDetailResponseSchema as s, UpdateCredentialInstanceBodySchema as sn, preprocess as sr, LOCAL_PLATFORM_ORIGIN as st, ACTIVE_ORG_HEADER as t, SubmitTeamRequestRequestSchema as tn, intersection as tr, HistoryRunListQuerySchema as tt, AppSlugAvailabilityResponseSchema as u, UpdateOrganizationMemberResponseSchema as un, union as ur, ListApiKeysResponseSchema as ut, ChannelConnectionListResponseSchema as v, UpsertGatewayAttachmentBodySchema as vn, ListProjectMembersResponseSchema as vt, ConnectProvidersResponseSchema as w, WorkflowRunListResponseSchema as wn, OrganizationSidebarBrandingSchema as wt, ChannelPlatformSchema as x, UserPreferencesPatchSchema as xn, McpDiscoverResponseSchema as xt, ChannelConnectionSchema as y, UserAvatarPatchSchema as yn, ListProjectMetricsResponseSchema as yt, CredentialAssignmentRecordSchema as z, parseAppSlug as zn, PromptInputSchema as zt };
|
|
7617
7697
|
|
|
7618
|
-
//# sourceMappingURL=dist-
|
|
7698
|
+
//# sourceMappingURL=dist-_Yd8KWRF.mjs.map
|