@keystrokehq/cli 0.0.110 → 0.0.112
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/{schemas-DwAYtN9C.mjs → discovery-XqwkB9H_-CQLSzR72.mjs} +20 -2
- package/dist/discovery-XqwkB9H_-CQLSzR72.mjs.map +1 -0
- package/dist/{dist-D1ip549D.mjs → dist-IKyaKHgU.mjs} +3 -20
- package/dist/dist-IKyaKHgU.mjs.map +1 -0
- package/dist/index.mjs +271 -166
- package/dist/index.mjs.map +1 -1
- package/dist/skills-bundle/_AGENTS.md +9 -0
- package/dist/skills-bundle/skills/keystroke-agents/SKILL.md +1 -1
- package/dist/skills-bundle/skills/keystroke-agents/references/models.md +15 -8
- package/dist/skills-bundle/skills/keystroke-credentials/SKILL.md +59 -21
- package/dist/skills-bundle/skills/keystroke-credentials/references/cli-and-oauth.md +23 -9
- package/dist/templates/hello-world/src/agents/hello.ts +1 -1
- package/package.json +1 -1
- package/dist/dist-D1ip549D.mjs.map +0 -1
- package/dist/schemas-DwAYtN9C.mjs.map +0 -1
|
@@ -68,6 +68,15 @@ Default-export each module — the server discovers files under `src/`.
|
|
|
68
68
|
|
|
69
69
|
**Actions are leaf units.** An action never calls another action (including integration actions like `postMessage`). Compose actions in a workflow, or attach an integration action directly as a workflow step / agent tool. An action may call an agent.
|
|
70
70
|
|
|
71
|
+
## Working habits
|
|
72
|
+
|
|
73
|
+
A few things that are easy to skip and cause common failures:
|
|
74
|
+
|
|
75
|
+
- **Research real APIs before mirroring them** — web search and fetch the actual reference & explore relevant docs; don't guess endpoints or payload shapes.
|
|
76
|
+
- **Run before you depend or deploy** — run the workflow/agent locally and read the real output (`keystroke workflow runs get <key> <run-id> --include steps,trace`) before wiring dependent steps.
|
|
77
|
+
- **Cover obvious edge cases** and write simple tests as needed (null field, empty array, a step that throws) — see [workflows skill](.agents/skills/keystroke-workflows/SKILL.md).
|
|
78
|
+
- **Cloud creds aren't in `.env`** — `keystroke deploy` never uploads `.env`; credentials that run in the cloud must be set against the cloud target. See [credentials skill](.agents/skills/keystroke-credentials/SKILL.md).
|
|
79
|
+
|
|
71
80
|
## Audit & debug (CLI)
|
|
72
81
|
|
|
73
82
|
Use the CLI against the correct target — do not call HTTP directly.
|
|
@@ -20,7 +20,7 @@ import { exaSearch, exaAnswer } from "@keystrokehq/exa/actions";
|
|
|
20
20
|
export default defineAgent(
|
|
21
21
|
{
|
|
22
22
|
systemPrompt: "Research signups with Exa. Stay concise; cite sources.",
|
|
23
|
-
model:
|
|
23
|
+
model: "anthropic/claude-sonnet-4-6",
|
|
24
24
|
tools: [exaSearch, exaAnswer],
|
|
25
25
|
},
|
|
26
26
|
{ key: "signup-researcher", module: import.meta.url },
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
# Models
|
|
2
2
|
|
|
3
3
|
```ts
|
|
4
|
-
model:
|
|
5
|
-
thinkingLevel: "high" // optional — defaults to "medium"; use "off" to disable reasoning
|
|
4
|
+
model: "google/gemini-2.5-flash"; // vendor/model-id — any pi-ai or gateway catalog id
|
|
5
|
+
thinkingLevel: "high"; // optional — defaults to "medium"; use "off" to disable reasoning
|
|
6
6
|
```
|
|
7
7
|
|
|
8
8
|
Per-prompt override via API: `{ "message": "...", "thinkingLevel": "low" }`.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Local dev (direct)** — set the provider key for each vendor you use (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, …). Only models in the pi-ai direct registry resolve without gateway.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
12
|
+
**Optional gateway** — set `AI_GATEWAY_API_KEY` to route all agents through Vercel AI Gateway with the same model string. Unlocks gateway-only ids (e.g. `moonshotai/kimi-k2`, `deepseek/deepseek-v3`, `zai/glm-4.5`).
|
|
13
|
+
|
|
14
|
+
**Cloud** — hosted workers use the platform LLM proxy automatically; no provider keys in the container.
|
|
15
|
+
|
|
16
|
+
| Vendor | Example id | Direct key |
|
|
17
|
+
| --------- | ----------------------------- | ------------------- |
|
|
18
|
+
| Anthropic | `anthropic/claude-sonnet-4.5` | `ANTHROPIC_API_KEY` |
|
|
19
|
+
| OpenAI | `openai/gpt-5.5` | gateway only |
|
|
20
|
+
| Google | `google/gemini-3.5-flash` | gateway only |
|
|
21
|
+
| DeepSeek | `deepseek/deepseek-v3` | gateway only |
|
|
22
|
+
| Moonshot | `moonshotai/kimi-k2.5` | gateway only |
|
|
23
|
+
| Zhipu GLM | `zai/glm-4.5` | gateway only |
|
|
17
24
|
|
|
18
25
|
After changing model, smoke-test: `keystroke agent prompt <key> --message "Hi"`.
|
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keystroke-credentials
|
|
3
|
-
description: Manage keystroke credentials — vault
|
|
3
|
+
description: Manage keystroke credentials — vault API keys and OAuth via keystroke credentials / keystroke connect, scopes, and getting creds into the cloud. Use when wiring Exa, Google, Slack, or custom API keys, and when a deployed run fails with missing credentials.
|
|
4
4
|
metadata:
|
|
5
5
|
keystroke-domain: credentials
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Credentials
|
|
9
9
|
|
|
10
|
-
Secrets live in
|
|
10
|
+
Secrets live in a **credential store** (vault for API keys, OAuth stores for tokens) — never in source.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
There are **two separate stores**: your **local** keystroke server and the **cloud** platform. `keystroke deploy` uploads your built code only — it never copies `.env` or local credentials. Provision creds for **every target you run on**.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
// keystroke.config.ts
|
|
16
|
-
import { defineConfig } from "@keystrokehq/config";
|
|
17
|
-
import { googleManaged } from "@keystrokehq/google";
|
|
18
|
-
import { slackManaged } from "@keystrokehq/slack";
|
|
14
|
+
## `.env` vs the credential store
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
| Holds | `.env` | Credential store |
|
|
17
|
+
| ----------------------------------------------------------------------------------------------------------------- | --------------------- | ----------------------- |
|
|
18
|
+
| Model keys (`ANTHROPIC_API_KEY`), DB URL, OAuth **app** config (`SLACK_CLIENT_ID`, `GOOGLE_*`, `SLACK_BOT_TOKEN`) | yes — local boot only | — |
|
|
19
|
+
| API-key + OAuth credential **instances** resolved by actions at runtime | — | yes |
|
|
20
|
+
| Reaches the cloud? | no | yes, when set vs. cloud |
|
|
21
|
+
|
|
22
|
+
The local server reads `.env` at boot; OAuth **app** env auto-seeds the local OAuth app so you can `connect`. **API-key credentials (Exa, custom) are not read from `.env`** — create them with `keystroke credentials set`.
|
|
23
|
+
|
|
24
|
+
## Scopes — default to `project`
|
|
25
|
+
|
|
26
|
+
A credential is stored at one scope:
|
|
27
|
+
|
|
28
|
+
| Scope | CLI | Means |
|
|
29
|
+
| --------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
30
|
+
| **project** (default) | `--scope project --project-id <id>` | Tied to one project. **Use this unless told otherwise** — you're provisioning the project you're working in. |
|
|
31
|
+
| **org** | `--scope org` | Shared by **every user and project in the org**. Only set org scope when the user explicitly asks for it. |
|
|
32
|
+
| **user** | `--scope user` | A single user's personal credential — a different use case, not project/deploy setup. |
|
|
33
|
+
|
|
34
|
+
`--scope` is required (there is no implicit default), so always pass it — pick `project` by default. Get the active project id from `keystroke config show`.
|
|
35
|
+
|
|
36
|
+
At runtime an action resolves a credential by checking the **org** scope first, then the **project** scope.
|
|
37
|
+
|
|
38
|
+
## Set an API key
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# default: scope to the project you're deploying; read the value from your shell / .env
|
|
42
|
+
keystroke credentials set exa --scope project --project-id <id> --set apiKey=@env:EXA_API_KEY
|
|
43
|
+
|
|
44
|
+
# or paste the value directly
|
|
45
|
+
keystroke credentials set exa --scope project --project-id <id> --set apiKey=sk-...
|
|
23
46
|
```
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
- The field name (`apiKey`) comes from the integration's `defineCredential`.
|
|
49
|
+
- `@env:VAR` reads from your shell or project `.env`.
|
|
50
|
+
- `set` always creates a **new** instance. To change an existing one: `keystroke credentials update <id>`. A second instance in the same scope needs `--label <name>` (and `--default` to pick the one to resolve).
|
|
26
51
|
|
|
27
|
-
## OAuth
|
|
52
|
+
## Connect OAuth (Google, Slack, etc)
|
|
28
53
|
|
|
29
54
|
```bash
|
|
30
55
|
keystroke auth login
|
|
@@ -32,13 +57,26 @@ keystroke connect google
|
|
|
32
57
|
keystroke connect slack
|
|
33
58
|
```
|
|
34
59
|
|
|
35
|
-
|
|
60
|
+
`connect` completes the browser flow and stores the OAuth token in the active target's store, ready for any action that uses that integration. Run it against each target you deploy to.
|
|
61
|
+
|
|
62
|
+
## Targets: local vs cloud
|
|
63
|
+
|
|
64
|
+
`keystroke credentials` and `keystroke connect` follow the active runtime, exactly like other commands: **local** while `keystroke dev` runs or after `config use local`; the **deployed project** after `config use cloud` or with `--project`. A credential set locally does not exist in the cloud, and vice versa. See [cli skill](.agents/skills/keystroke-cli/SKILL.md).
|
|
65
|
+
|
|
66
|
+
## Before deploy: provision the cloud
|
|
67
|
+
|
|
68
|
+
The cloud store starts **empty**. After the first deploy:
|
|
36
69
|
|
|
37
70
|
```bash
|
|
38
|
-
keystroke
|
|
39
|
-
keystroke
|
|
71
|
+
keystroke deploy --project <id> # uploads code only — no creds, no .env
|
|
72
|
+
keystroke config use cloud # target the deployed project
|
|
73
|
+
keystroke connect google # OAuth against cloud
|
|
74
|
+
keystroke credentials set exa --scope project --project-id <id> --set apiKey=@env:EXA_API_KEY
|
|
75
|
+
keystroke credentials list # verify against the active (cloud) target
|
|
40
76
|
```
|
|
41
77
|
|
|
78
|
+
A missing-credential error on a deployed run almost always means a credential set locally was never set in the cloud.
|
|
79
|
+
|
|
42
80
|
## Use in actions
|
|
43
81
|
|
|
44
82
|
```ts
|
|
@@ -53,18 +91,18 @@ export const notify = defineAction({
|
|
|
53
91
|
});
|
|
54
92
|
```
|
|
55
93
|
|
|
56
|
-
Integration actions (Exa search, Gmail send, Slack post) resolve credentials automatically when the plugin is configured.
|
|
94
|
+
Integration actions (Exa search, Gmail send, Slack post) resolve credentials automatically from the active target's store when the plugin is configured.
|
|
57
95
|
|
|
58
96
|
## Audit
|
|
59
97
|
|
|
60
98
|
```bash
|
|
61
|
-
keystroke credentials list
|
|
99
|
+
keystroke credentials list # instances for the active target
|
|
62
100
|
```
|
|
63
101
|
|
|
64
|
-
Failed integration
|
|
102
|
+
Failed integration call → confirm you are on the right target (`keystroke config show`), the credential exists **for that target and scope**, OAuth was completed, and the action declares the right credential key.
|
|
65
103
|
|
|
66
104
|
## Next references
|
|
67
105
|
|
|
68
|
-
- [cli-and-oauth.md](references/cli-and-oauth.md) — auth, connect,
|
|
106
|
+
- [cli-and-oauth.md](references/cli-and-oauth.md) — auth, connect, local vs cloud stores
|
|
69
107
|
|
|
70
|
-
Related: [actions](.agents/skills/keystroke-actions/SKILL.md), [gateways](.agents/skills/keystroke-gateways/SKILL.md).
|
|
108
|
+
Related: [cli](.agents/skills/keystroke-cli/SKILL.md), [actions](.agents/skills/keystroke-actions/SKILL.md), [gateways](.agents/skills/keystroke-gateways/SKILL.md).
|
|
@@ -16,22 +16,36 @@ keystroke connect google
|
|
|
16
16
|
keystroke connect slack
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Complete the browser flow once per provider.
|
|
19
|
+
Complete the browser flow once per provider. The token is stored server-side in the active target's store, ready for actions that use the integration. Run `connect` against each target you deploy to.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Set an API key
|
|
22
22
|
|
|
23
|
-
For API keys that are not OAuth (e.g. Exa)
|
|
23
|
+
For API keys that are not OAuth (e.g. Exa). The field name (`apiKey`) comes from the integration's `defineCredential`:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
# default to project scope — provision the project you're working in
|
|
27
|
+
keystroke credentials set exa --scope project --project-id <id> --set apiKey=@env:EXA_API_KEY
|
|
27
28
|
keystroke credentials list
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
`--scope` is required; there is no implicit default, so always pass it:
|
|
31
32
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
33
|
+
| Scope | When |
|
|
34
|
+
| ------------------- | ---------------------------------------------------------------------------- |
|
|
35
|
+
| `project` (default) | Tie the credential to one project — use this unless told otherwise. |
|
|
36
|
+
| `org` | Share with **every user and project** in the org — only on explicit request. |
|
|
37
|
+
| `user` | A single user's personal credential — different use case. |
|
|
38
|
+
|
|
39
|
+
`set` always creates a new instance; use `keystroke credentials update <id>` to change one, and `--label <name>` to add a second in the same scope. At runtime a credential resolves **org first, then project**.
|
|
40
|
+
|
|
41
|
+
## `.env` vs the credential store
|
|
42
|
+
|
|
43
|
+
| Holds | `.env` | Credential store |
|
|
44
|
+
| ---------------------------------------------------------------------------------------------- | --------------------- | ----------------------- |
|
|
45
|
+
| Model keys (`ANTHROPIC_API_KEY`), DB URL, OAuth **app** config (`SLACK_CLIENT_ID`, `GOOGLE_*`) | yes — local boot only | — |
|
|
46
|
+
| API-key + OAuth credential instances resolved at runtime | — | yes |
|
|
47
|
+
| Reaches the cloud? | no | yes, when set vs. cloud |
|
|
48
|
+
|
|
49
|
+
API-key credentials are **not** read from `.env` — create them with `keystroke credentials set`. `keystroke credentials` / `keystroke connect` target the **active** runtime (local while `keystroke dev` runs or after `config use local`; cloud after deploy / `config use cloud` / `--project`). The stores are independent; `keystroke deploy` never copies `.env` or local credentials, so re-provision against the cloud target after deploy.
|
|
36
50
|
|
|
37
51
|
Dashboard at `:3000` can also manage credentials and gateway attachments.
|
|
@@ -3,7 +3,7 @@ import { defineAgent } from "@keystrokehq/keystroke/agent";
|
|
|
3
3
|
export default defineAgent(
|
|
4
4
|
{
|
|
5
5
|
systemPrompt: "You are a friendly hello-world agent. Keep replies short.",
|
|
6
|
-
model:
|
|
6
|
+
model: "anthropic/claude-sonnet-4-6",
|
|
7
7
|
},
|
|
8
8
|
{ key: "hello", module: import.meta.url },
|
|
9
9
|
);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-D1ip549D.mjs","names":["z.object","z.string","z.array"],"sources":["../../../packages/server/dist/discovery-XqwkB9H_.mjs","../../../packages/sandbox/dist/files-B0H9_dP4.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { relative, sep } from \"node:path\";\n//#region src/discovery/entry-from-file.ts\nconst SOURCE_EXT = /\\.(ts|mts|mjs|js)$/;\nconst DECLARATION_FILE = /\\.d\\.(ts|mts|cts)$/;\nfunction entryIdFromFile(rootDir, filePath, options) {\n\tif (DECLARATION_FILE.test(filePath)) return null;\n\tconst baseName = filePath.split(sep).at(-1) ?? \"\";\n\tif (/\\.(int\\.)?test\\.(ts|mts)$/.test(baseName)) return null;\n\tconst segments = relative(rootDir, filePath).replace(SOURCE_EXT, \"\").split(sep).filter((segment) => segment.length > 0);\n\tif (segments.length === 1) return segments[0] ?? null;\n\tconst last = segments.at(-1);\n\tconst entryNames = new Set([options.nestedEntry]);\n\tif (options.allowIndex !== false) entryNames.add(\"index\");\n\tif (!last || !entryNames.has(last)) return null;\n\tconst id = segments.slice(0, -1).join(\"/\");\n\treturn id.length > 0 ? id : null;\n}\n//#endregion\nexport { entryIdFromFile as t };\n\n//# sourceMappingURL=discovery-XqwkB9H_.mjs.map","import { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { access, mkdir, writeFile } from \"node:fs/promises\";\nimport { z } from \"zod\";\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/sandbox-dirs.ts\nfunction resolveSandboxRoot(workspacesRoot, scope) {\n\tif (scope.type === \"agent\") return join(workspacesRoot, scope.agentId);\n\treturn join(workspacesRoot, \"runs\", scope.runId);\n}\nasync function ensureWorkspaceDir(workspaceRoot) {\n\tawait mkdir(workspaceRoot, { recursive: true });\n}\n//#endregion\n//#region src/files/schemas.ts\nconst SandboxFileContentSchema = z.object({\n\tpath: z.string(),\n\tfile: z.string()\n});\n/** Destination path under `/workspace`. For `dir`, used as a prefix. */\nconst SandboxFileSchema = z.object({\n\tpath: z.string(),\n\t/** Single file body — typically from a build-time import (`import doc from \"./doc.md\"`). */\n\tfile: z.string().optional(),\n\t/** Directory contents — each path is relative to `path`. */\n\tdir: z.array(SandboxFileContentSchema).optional()\n});\nconst SandboxDefinitionSchema = z.object({\n\tkey: z.string().optional(),\n\tfiles: z.array(SandboxFileSchema).optional()\n});\n//#endregion\n//#region src/files/define-sandbox.ts\n/** Define a reusable sandbox file layout. */\nfunction defineSandbox(def) {\n\treturn def;\n}\n//#endregion\n//#region src/files/flatten-sandbox-files.ts\n/** Expand directory entries into flat `{ path, file }` records under `/workspace`. */\nfunction flattenSandboxFiles(files) {\n\tif (!files?.length) return [];\n\tconst flattened = [];\n\tfor (const entry of files) {\n\t\tif (entry.dir !== void 0) {\n\t\t\tconst prefix = entry.path.replace(/\\/+$/, \"\");\n\t\t\tfor (const child of entry.dir) flattened.push({\n\t\t\t\tpath: prefix ? `${prefix}/${child.path}` : child.path,\n\t\t\t\tfile: child.file\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.file === void 0) continue;\n\t\tflattened.push({\n\t\t\tpath: entry.path,\n\t\t\tfile: entry.file\n\t\t});\n\t}\n\treturn flattened;\n}\n//#endregion\n//#region src/files/materialize-sandbox.ts\nasync function materializeSandbox(options) {\n\tconst root = resolveSandboxRoot(options.workspacesRoot, options.scope);\n\tawait ensureWorkspaceDir(root);\n\tconst files = flattenSandboxFiles(options.definition?.files);\n\tif (files.length) await applySandboxFiles(root, files, options.scope);\n\treturn {\n\t\troot,\n\t\tscope: options.scope,\n\t\t...options.definition !== void 0 ? { definition: options.definition } : {}\n\t};\n}\nasync function applySandboxFiles(root, files, scope) {\n\tfor (const entry of files) {\n\t\tconst hostPath = resolve(root, entry.path);\n\t\tif (scope.type === \"agent\") try {\n\t\t\tawait access(hostPath);\n\t\t\tcontinue;\n\t\t} catch {}\n\t\tawait mkdir(dirname(hostPath), { recursive: true });\n\t\tawait writeFile(hostPath, entry.file);\n\t}\n}\n//#endregion\n//#region src/files/pack-dir.ts\nconst SKIP_DIRS$1 = new Set([\".git\", \"node_modules\"]);\n/** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */\nfunction packDirFromDisk(rootPath) {\n\tconst stat = statSync(rootPath);\n\tif (stat.isFile()) return [{\n\t\tpath: basename(rootPath),\n\t\tfile: readFileSync(rootPath, \"utf8\")\n\t}];\n\tif (!stat.isDirectory()) throw new Error(`Expected a file or directory at ${rootPath}`);\n\tconst files = [];\n\twalkDir(rootPath, rootPath, files);\n\treturn files;\n}\nfunction walkDir(rootPath, currentPath, files) {\n\tfor (const name of readdirSync(currentPath)) {\n\t\tif (SKIP_DIRS$1.has(name)) continue;\n\t\tconst entryPath = join(currentPath, name);\n\t\tconst stat = statSync(entryPath);\n\t\tif (stat.isDirectory()) {\n\t\t\twalkDir(rootPath, entryPath, files);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stat.isFile()) continue;\n\t\tfiles.push({\n\t\t\tpath: relative(rootPath, entryPath),\n\t\t\tfile: readFileSync(entryPath, \"utf8\")\n\t\t});\n\t}\n}\n//#endregion\n//#region src/files/pack-asset-dirs.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\n/** Pack every subdir under `src/skills/` and `src/files/` into an asset manifest. */\nfunction packAssetDirs(appRoot, srcDir = \"src\") {\n\treturn {\n\t\tskills: packAssetRoot(join(appRoot, srcDir, \"skills\")),\n\t\tfiles: packAssetRoot(join(appRoot, srcDir, \"files\"))\n\t};\n}\nfunction packAssetRoot(rootPath) {\n\tif (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return {};\n\tconst manifest = {};\n\tfor (const name of readdirSync(rootPath)) {\n\t\tif (SKIP_DIRS.has(name)) continue;\n\t\tconst entryPath = join(rootPath, name);\n\t\tif (!statSync(entryPath).isDirectory()) continue;\n\t\tmanifest[name] = packDirFromDisk(entryPath);\n\t}\n\treturn manifest;\n}\n//#endregion\n//#region src/files/resolve-app-root.ts\n/** Walk upward from a module file to find the user app root (`src/agents`, `src/skills`, etc.). */\nfunction resolveAppRoot(fromPath) {\n\tlet dir = statSync(fromPath).isDirectory() ? fromPath : dirname(fromPath);\n\twhile (dir !== dirname(dir)) {\n\t\tif (hasAppLayout(dir)) return dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn process.env.KEYSTROKE_ROOT ?? process.cwd();\n}\n/** Resolve app root from an agent (or other) module URL. */\nfunction resolveAppRootFromModule(moduleUrl) {\n\treturn resolveAppRoot(fileURLToPath(moduleUrl));\n}\nfunction hasAppLayout(dir) {\n\tconst src = join(dir, \"src\");\n\tconst dist = join(dir, \"dist\");\n\treturn existsSync(join(src, \"agents\")) || existsSync(join(src, \"skills\")) || existsSync(join(src, \"files\")) || existsSync(join(dist, \"agents\")) || existsSync(join(dist, \".keystroke\", \"assets.mjs\"));\n}\n//#endregion\nexport { materializeSandbox as a, SandboxDefinitionSchema as c, ensureWorkspaceDir as d, resolveSandboxRoot as f, packDirFromDisk as i, SandboxFileContentSchema as l, resolveAppRootFromModule as n, flattenSandboxFiles as o, packAssetDirs as r, defineSandbox as s, resolveAppRoot as t, SandboxFileSchema as u };\n\n//# sourceMappingURL=files-B0H9_dP4.mjs.map","import { isBuiltin } from \"node:module\";\n\n/** Native addons kept external — resolved from the CLI runtime at app start. */\nexport const NATIVE_RUNTIME_DEPS = [\"pg\", \"better-sqlite3\", \"@parcel/watcher\"];\n\n/** Kept external so .d.ts emission does not inline internal/inferred types. */\nexport const LIBRARY_EXTERNAL_DEPS = [\"better-auth\", /^@better-auth\\//, /^better-auth\\//];\n\n/** Non-auth runtime deps kept external for published entry bundles (platform, etc.). */\nexport const BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS = [\n ...NATIVE_RUNTIME_DEPS,\n \"dockerode\",\n \"ssh2\",\n \"cpu-features\",\n \"microsandbox\",\n /^@aws-sdk\\//,\n /^@napi-rs\\//,\n \"hono\",\n /^@hono\\//,\n \"undici\",\n];\n\n/** Kept external when bundling published entry points (cli, keystroke, platform). */\nexport const BUNDLED_ENTRY_EXTERNAL_DEPS = [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...LIBRARY_EXTERNAL_DEPS,\n];\n\n/** Bundle into CLI — device login uses Better Auth client only. */\nexport const BETTER_AUTH_CLIENT_BUNDLE_PATTERNS = [\n /^better-auth\\/client$/,\n /^better-auth\\/client\\//,\n];\n\n/** Server adapters and root entry — must not ship in the CLI bundle. */\nexport const BETTER_AUTH_SERVER_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^@better-auth\\//,\n /^better-auth\\/(?!client(\\/|$)).+/,\n];\n\nexport function isNativeRuntimeDep(id) {\n return NATIVE_RUNTIME_DEPS.some((dep) => id === dep || id.startsWith(`${dep}/`));\n}\n\nfunction packageName(id) {\n if (id.startsWith(\"@\")) {\n const [scope, name] = id.split(\"/\");\n return name ? `${scope}/${name}` : id;\n }\n\n return id.split(\"/\")[0] ?? id;\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (name.startsWith(\"@keystrokehq/\")) {\n return true;\n }\n\n if (name === \"better-auth\" || name.startsWith(\"@better-auth/\")) {\n return true;\n }\n\n return false;\n}\n\n/** Library packages resolve npm deps from node_modules at runtime. */\nexport function libraryBuildDepsConfig() {\n return {\n alwaysBundle: (_id) => null,\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Bundle npm deps into dist; resolve @keystrokehq/* and natives from the runtime. */\nexport function userAppBuildDepsConfig() {\n return {\n alwaysBundle: (id, _importer) => {\n if (id.startsWith(\".\") || id.startsWith(\"/\") || isBuiltin(id)) {\n return null;\n }\n\n return isRuntimeExternal(id) ? null : true;\n },\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/**\n * Published entry packages (cli, keystroke, platform): declare bundled @keystrokehq/*\n * in dependencies (changesets release graph ignores devDependencies). Inlining is\n * driven by alwaysBundle below, not by dep kind. Runtime npm deps stay external.\n */\nexport function bundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//],\n neverBundle: [...BUNDLED_ENTRY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Published CLI: inline better-auth client + @better-auth/*; keep server adapters external. */\nexport const BETTER_AUTH_CLI_BUNDLE_PATTERNS = [\n ...BETTER_AUTH_CLIENT_BUNDLE_PATTERNS,\n /^@better-auth\\//,\n];\n\nexport const BETTER_AUTH_CLI_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^better-auth\\/(?!client(\\/|$)).+/,\n /^@better-auth\\/drizzle-adapter/,\n \"drizzle-orm\",\n];\n\n/** Rolldown/tsdown — native bindings; stay in CLI node_modules at runtime. */\nexport const CLI_BUILD_TOOL_EXTERNAL_PATTERNS = [\"tsdown\", \"rolldown\", /^@rolldown\\//, \"tsx\"];\n\n/** CLI: inline better-auth/client; keep server + drizzle adapters external. */\nexport function cliBundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...BETTER_AUTH_CLI_EXTERNAL_PATTERNS,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n ],\n onlyBundle: false,\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig, userAppBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n libraryBuildDepsConfig,\n userAppBuildDepsConfig,\n} from \"./deps.js\";\n\nexport const baseTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: libraryBuildDepsConfig(),\n};\n\n/** tsdown config for published bundles (cli, keystroke, platform). */\nexport const bundledEntryTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: bundledEntryDepsConfig(),\n};\n","import { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, readdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { entryIdFromFile } from \"@keystrokehq/server/discovery\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\n//#region src/resolve-runtime-artifact.ts\nfunction packageRoot(nodeModules, scope, name) {\n\tconst direct = scope ? join(nodeModules, scope, name) : join(nodeModules, name);\n\tif (existsSync(join(direct, \"package.json\"))) return direct;\n\tconst pnpmDir = join(nodeModules, \".pnpm\");\n\tif (!existsSync(pnpmDir)) return null;\n\tfor (const entry of readdirSync(pnpmDir)) {\n\t\tconst candidate = scope ? join(pnpmDir, entry, \"node_modules\", scope, name) : join(pnpmDir, entry, \"node_modules\", name);\n\t\tif (existsSync(join(candidate, \"package.json\"))) return candidate;\n\t}\n\treturn null;\n}\n/** Resolve a file shipped with `@keystrokehq/build` inside the CLI runtime. */\nfunction resolveRuntimeBuildArtifact(runtimeNodeModules, relativePath) {\n\tconst pkgRoot = packageRoot(runtimeNodeModules, \"@keystrokehq\", \"build\");\n\tif (!pkgRoot) throw new Error(\"Keystroke runtime is missing @keystrokehq/build\");\n\tconst artifact = join(pkgRoot, relativePath);\n\tif (!existsSync(artifact)) throw new Error(`Keystroke runtime artifact not found: ${relativePath}`);\n\treturn artifact;\n}\n//#endregion\n//#region src/vitest-plugin.ts\nconst ASSETS_MODULE$1 = \"@keystrokehq/assets\";\nconst virtualPrefix = `\\0${ASSETS_MODULE$1}:`;\n/** Vitest plugin resolving `@keystrokehq/assets` from disk. */\nfunction agentAssetsVitestPlugin(appRoot = process.cwd()) {\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$1) return null;\n\t\t\treturn `${virtualPrefix}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${virtualPrefix}manifest`) return null;\n\t\t\tmanifest ??= packAssetDirs(appRoot);\n\t\t\treturn `export default ${JSON.stringify(manifest)};`;\n\t\t}\n\t};\n}\nfunction findAppRootFromConfig(configFile) {\n\tif (!configFile) return process.cwd();\n\treturn dirname(configFile);\n}\nfunction agentAssetsVitestPluginFromConfig(configFile) {\n\treturn agentAssetsVitestPlugin(findAppRootFromConfig(configFile));\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\nfunction walkTypeScriptSources(dir) {\n\tif (!existsSync(dir)) return [];\n\tconst files = [];\n\tfor (const name of readdirSync(dir)) {\n\t\tconst path = join(dir, name);\n\t\tif (statSync(path).isDirectory()) files.push(...walkTypeScriptSources(path));\n\t\telse if (/\\.(ts|mts)$/.test(name) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(name)) files.push(path);\n\t}\n\treturn files;\n}\nfunction discoveredEntries(dir, nestedEntry, prefix) {\n\tconst entries = {};\n\tfor (const filePath of walkTypeScriptSources(dir)) {\n\t\tconst id = entryIdFromFile(dir, filePath, { nestedEntry });\n\t\tif (!id) continue;\n\t\tentries[`${prefix}/${id}`] = filePath;\n\t}\n\treturn entries;\n}\nfunction renderAssetModule(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Rolldown plugin: pack src/skills + src/files and expose `@keystrokehq/assets`. */\nfunction agentAssetsPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tbuildStart() {\n\t\t\tmanifest = packAssetDirs(options.root, srcDir);\n\t\t},\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE) return null;\n\t\t\treturn `${VIRTUAL_PREFIX}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX}manifest` || !manifest) return null;\n\t\t\treturn renderAssetModule(manifest);\n\t\t},\n\t\tbuildEnd() {\n\t\t\tif (!manifest) return;\n\t\t\tconst outDir = join(options.root, options.outDir ?? \"dist\", \".keystroke\");\n\t\t\tmkdirSync(outDir, { recursive: true });\n\t\t\twriteFileSync(join(outDir, \"assets.mjs\"), renderAssetModule(manifest));\n\t\t}\n\t};\n}\n/** Full tsdown config for user keystroke apps (config + discovered modules only). */\nfunction createAppBuildConfig(options = {}) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst srcRoot = join(root, srcDir);\n\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discoveredEntries(join(srcRoot, \"agents\"), \"agent\", \"agents\"),\n\t\t...discoveredEntries(join(srcRoot, \"workflows\"), \"workflow\", \"workflows\"),\n\t\t...discoveredEntries(join(srcRoot, \"triggers\"), \"trigger\", \"triggers\")\n\t};\n\tif (Object.keys(entries).length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\treturn mergeConfig(baseTsdownConfig, {\n\t\tentry: entries,\n\t\tformat: [\"esm\"],\n\t\toutDir: join(root, outDir),\n\t\tclean: options.clean ?? true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [agentAssetsPlugin({\n\t\t\troot,\n\t\t\tsrcDir,\n\t\t\toutDir\n\t\t})]\n\t});\n}\n/** Build user agents, workflows, triggers, and config to `dist/`. */\nasync function buildApp(options = {}) {\n\tconst root = options.root ?? process.cwd();\n\tconst previous = process.cwd();\n\ttry {\n\t\tprocess.chdir(root);\n\t\tawait build(createAppBuildConfig({\n\t\t\t...options,\n\t\t\troot\n\t\t}));\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n}\n/**\n* Watch `src/` and rebuild `dist/` on change.\n*\n* NOT true hot reload — each change runs a full tsdown rebuild. Callers should\n* restart the API server in `onRebuild` so discovery picks up new/changed modules.\n*/\nasync function watchApp(options = {}) {\n\tconst { runWatchApp } = await import(\"./watch-app-DTIeKrbl.mjs\");\n\tawait runWatchApp(buildApp, options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, createAppBuildConfig, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AAEA,MAAM,aAAa;AACnB,MAAM,mBAAmB;AACzB,SAAS,gBAAgB,SAAS,UAAU,SAAS;CACpD,IAAI,iBAAiB,KAAK,QAAQ,GAAG,OAAO;CAC5C,MAAM,WAAW,SAAS,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK;CAC/C,IAAI,4BAA4B,KAAK,QAAQ,GAAG,OAAO;CACvD,MAAM,WAAW,SAAS,SAAS,QAAQ,EAAE,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,EAAE,QAAQ,YAAY,QAAQ,SAAS,CAAC;CACtH,IAAI,SAAS,WAAW,GAAG,OAAO,SAAS,MAAM;CACjD,M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