@keystrokehq/cli 0.1.44 → 0.1.46

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/README.md CHANGED
@@ -15,7 +15,7 @@ Keep the CLI small and boring.
15
15
  - **Agent-first** — commands should be predictable, scriptable, and easy for AI agents to invoke
16
16
  - **Split concerns** — non-secret config in one place, secrets in the OS keychain
17
17
 
18
- Right now the CLI exposes `init`, `build`, `dev`, `start`, `health`, `auth`, `--help`, and `--version`.
18
+ Right now the CLI exposes `init`, `build`, `dev`, `start`, `lint`, `typecheck`, `test`, `deploy`, `health`, `auth`, `--help`, and `--version`.
19
19
 
20
20
  ### `auth`
21
21
 
@@ -96,6 +96,36 @@ keystroke init --name my-app --dir ./my-app --yes --skip-install
96
96
  | `--skip-install` | Don't run package manager install |
97
97
  | `--pm` | Force npm, pnpm, yarn, or bun |
98
98
 
99
+ Scaffolded projects include a committed `tsconfig.json` (extends `@keystrokehq/cli/tsconfig.json`) and `package.json` scripts for `lint`, `typecheck`, and `test`. Dev tooling (oxlint, TypeScript, vitest, `@types/node`) ships in the CLI — not in project devDependencies.
100
+
101
+ ### `lint`
102
+
103
+ Lint `src/` with bundled oxlint. Config lives in the CLI bundle (`dist/configs/oxlintrc.json`), not in the project.
104
+
105
+ ```bash
106
+ keystroke lint
107
+ keystroke lint --dir ./my-app
108
+ ```
109
+
110
+ ### `typecheck`
111
+
112
+ Type-check with bundled TypeScript using the project's `tsconfig.json`.
113
+
114
+ ```bash
115
+ keystroke typecheck
116
+ keystroke typecheck --dir ./my-app
117
+ ```
118
+
119
+ ### `test`
120
+
121
+ Run tests with bundled vitest. Config lives in the CLI bundle (`dist/configs/vitest.config.mjs`).
122
+
123
+ ```bash
124
+ keystroke test
125
+ keystroke test --project unit
126
+ keystroke test --project integration
127
+ ```
128
+
99
129
  ### `build`
100
130
 
101
131
  Build the project to `dist/` using the framework bootstrap (no user `server.ts` required).
@@ -107,7 +137,7 @@ keystroke build --dir ./my-app
107
137
 
108
138
  ### `deploy`
109
139
 
110
- Build, upload, and promote a project artifact on the platform. Requires `keystroke auth login` and `--project <slug>`.
140
+ Lint, typecheck, build, upload, and promote a project artifact on the platform. Requires `keystroke auth login` and a linked project (or `--project <slug>`).
111
141
 
112
142
  ```bash
113
143
  keystroke deploy
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "esModuleInterop": true,
6
+ "skipLibCheck": true,
7
+ "isolatedModules": true,
8
+ "moduleDetection": "force",
9
+ "verbatimModuleSyntax": true,
10
+ "noUncheckedIndexedAccess": true,
11
+ "moduleResolution": "bundler",
12
+ "module": "ESNext",
13
+ "target": "ES2022",
14
+ "lib": ["ES2022"],
15
+ "noEmit": true,
16
+ "types": ["node"],
17
+ "typeRoots": ["../../node_modules/@types", "../../../../node_modules/@types"],
18
+ "paths": {
19
+ "vitest": ["../../node_modules/vitest", "../../../../node_modules/vitest"],
20
+ "vitest/*": ["../../node_modules/vitest/*", "../../../../node_modules/vitest/*"]
21
+ }
22
+ }
23
+ }
@@ -1,8 +1,15 @@
1
+ import { dirname, join } from "node:path";
2
+ import { fileURLToPath } from "node:url";
1
3
  import { defineConfig } from "vitest/config";
2
4
 
5
+ // Bundled with the CLI and passed to vitest via `--config`; `--root` points it at
6
+ // the user's project so `include` globs resolve against their src/. The setup file
7
+ // lives beside this config, so reference it by absolute path.
8
+ const configDir = dirname(fileURLToPath(import.meta.url));
9
+
3
10
  const shared = {
4
11
  globals: true,
5
- environment: "node" as const,
12
+ environment: "node",
6
13
  };
7
14
 
8
15
  export default defineConfig({
@@ -23,7 +30,7 @@ export default defineConfig({
23
30
  test: {
24
31
  name: "integration",
25
32
  include: ["src/**/*.int.test.ts"],
26
- setupFiles: ["vitest.setup.integration.ts"],
33
+ setupFiles: [join(configDir, "vitest.setup.integration.mjs")],
27
34
  envDir: ".",
28
35
  hookTimeout: 120_000,
29
36
  testTimeout: 60_000,
@@ -1,7 +1,9 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
 
4
- function loadEnvFile(path: string): void {
4
+ // Load the project's .env for integration tests. cwd is the project root because
5
+ // `keystroke test` spawns vitest with `--root <projectRoot>`.
6
+ function loadEnvFile(path) {
5
7
  if (!existsSync(path)) {
6
8
  return;
7
9
  }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { g as emitStoredRouteManifestForProject } from "./dist-BmO-d0ms.mjs";
3
+ export { emitStoredRouteManifestForProject };
@@ -2639,6 +2639,16 @@ Object.freeze({
2639
2639
  option is given.`]]
2640
2640
  ]).keys()].sort();
2641
2641
  new TextDecoder("utf-8", { fatal: !0 });
2642
+ JSON.stringify({
2643
+ messages: [],
2644
+ results: [],
2645
+ items: [],
2646
+ data: {
2647
+ messages: [],
2648
+ items: [],
2649
+ results: []
2650
+ }
2651
+ });
2642
2652
  new AsyncLocalStorage();
2643
2653
  new AsyncLocalStorage();
2644
2654
  new AsyncLocalStorage();
@@ -20572,7 +20582,6 @@ registerWorkflowRunGetter(() => {
20572
20582
  };
20573
20583
  });
20574
20584
  new AsyncLocalStorage();
20575
- object({ title: string().max(120).describe("A short, clear chat title in title case; specific, no quotes or emojis") });
20576
20585
  [
20577
20586
  "You are an expert chat title generator.",
20578
20587
  "",
@@ -20587,16 +20596,19 @@ object({ title: string().max(120).describe("A short, clear chat title in title c
20587
20596
  "- Keep it under 120 characters when possible",
20588
20597
  "- Do not use quotes or emojis",
20589
20598
  "",
20599
+ "CRITICAL: Respond with ONLY the title text and nothing else. No reasoning, no explanation,",
20600
+ "no preamble, no labels, no quotes — just the raw title on a single line.",
20601
+ "",
20590
20602
  "Examples:",
20591
20603
  "",
20592
20604
  "User: How do I set up a new Next.js project with TypeScript?",
20593
- "Title: Setting Up Next.js Project with TypeScript",
20605
+ "Setting Up Next.js Project with TypeScript",
20594
20606
  "",
20595
20607
  "User: Help me debug this React hook that's causing infinite re-renders. Here's the code...",
20596
- "Title: Debugging Infinite Re-render in React Hook",
20608
+ "Debugging Infinite Re-render in React Hook",
20597
20609
  "",
20598
20610
  "User: Write a cold email sequence for fundraising from YC alums",
20599
- "Title: YC Alumni Fundraising Cold Email Sequence"
20611
+ "YC Alumni Fundraising Cold Email Sequence"
20600
20612
  ].join("\n");
20601
20613
  object({ message: string().describe("Task or question for the subagent") });
20602
20614
  const STATIC_MODEL_IDS = new Set([
@@ -30733,4 +30745,4 @@ async function emitStoredRouteManifestForProject(projectRoot) {
30733
30745
  //#endregion
30734
30746
  export { validatePollGroups as A, attachmentSlugFromRecord as B, pollRouteFromSourceSlug as C, validateAttachmentTargets as D, toStoredRouteManifest as E, webhookManifestAttachmentSchemasFromBindings as F, packAssetDirs as G, computeCallSiteIds as H, webhookMatchSchemaForBindings as I, entryIdFromFile as J, discoverEntries as K, webhookRouteFromEndpoint as L, validateTriggerAttachments as M, validateUniqueAttachmentSlugs as N, validateImportedTriggerAttachment as O, validateUniqueTriggerSourceSlugs as P, walkTypeScriptFiles as Q, workflowKeyForAttachment as R, pollGroupRouteFromId as S, serializeRouteManifest as T, diagnoseWorkflowSource as U, classifyCall as V, locateWorkflow as W, shouldSkipKeystrokeModuleFile as X, readKeystrokeIgnoreDirective as Y, validateUniqueModuleKeys as Z, importAgentDefinition as _, buildStoredRouteManifestForProject as a, persistStoredRouteManifest as b, collectAgentAppSlugs as c, discoverAgentEntries as d, discoverSkillManifestEntries as f, emitStoredRouteManifestForProject as g, discoverWorkflows as h, buildPollGroups as i, validateProjectModules as j, validateImportedWorkflowDefinition as k, collectAgentToolSlugs as l, discoverWorkflowEntries as m, agentManifestEntry as n, buildStoredRouteManifestFromContext as o, discoverTriggerAttachments as p, discoverModuleFileEntries as q, agentRouteFromKey as r, buildWebhookBindingsByRoute as s, agentKeyForAttachment as t, countAgentCredentials as u, importTriggerAttachments as v, schemaToJson as w, pollGroupId as x, importWorkflowDefinition as y, workflowRouteFromKey as z };
30735
30747
 
30736
- //# sourceMappingURL=dist-8dMGGwLh.mjs.map
30748
+ //# sourceMappingURL=dist-BmO-d0ms.mjs.map