@keystrokehq/cli 1.0.10 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { M as entryIdFromFile, N as readKeystrokeIgnoreDirective, P as shouldSkipKeystrokeModuleFile, i as buildStoredRouteManifestForProject, k as packAssetDirs } from "./dist-BBwM8ovO.mjs";
2
+ import { A as packAssetDirs, F as shouldSkipKeystrokeModuleFile, N as entryIdFromFile, P as readKeystrokeIgnoreDirective, i as buildStoredRouteManifestForProject } from "./dist-CkZVZjrB.mjs";
3
3
  import { isBuiltin } from "node:module";
4
4
  import { dirname, join, relative, resolve, sep } from "node:path";
5
5
  import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -538,7 +538,7 @@ async function buildApp(options = {}) {
538
538
  ignoredFiles: walked.ignoredFiles
539
539
  }));
540
540
  if (emitManifest) {
541
- const { emitStoredRouteManifestForProject } = await import("./dist-DAk65OyX.mjs");
541
+ const { emitStoredRouteManifestForProject } = await import("./dist-CB-gBQLB.mjs");
542
542
  await emitStoredRouteManifestForProject(root);
543
543
  }
544
544
  } finally {
@@ -563,4 +563,4 @@ async function watchApp(options = {}) {
563
563
  //#endregion
564
564
  export { buildApp, buildFilteredApp, resolveRuntimeBuildArtifact, watchApp };
565
565
 
566
- //# sourceMappingURL=dist-Dq8E-oHm.mjs.map
566
+ //# sourceMappingURL=dist-D3CcImHe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-Dq8E-oHm.mjs","names":["toPosix"],"sources":["../../../packages/build/dist/walk-project-eZ95LOUW.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { readFileSync, readdirSync, realpathSync, statSync } from \"node:fs\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { entryIdFromFile, readKeystrokeIgnoreDirective, shouldSkipKeystrokeModuleFile } from \"@keystrokehq/manifest/discovery\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/ignore-guard-plugin.ts\nfunction toPosix$1(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction projectRelativePath(root, filePath) {\n\treturn toPosix$1(relative(root, normalizeBuildFilePath(filePath)));\n}\n/** Normalize paths so /var and /private/var compare equal on macOS. */\nfunction normalizeBuildFilePath(filePath) {\n\tconst absolute = resolve(filePath);\n\ttry {\n\t\treturn realpathSync.native(absolute);\n\t} catch {\n\t\treturn absolute;\n\t}\n}\nfunction normalizeModuleId(id, root) {\n\tif (id.startsWith(\"\\0\")) return null;\n\tconst normalized = normalizeBuildFilePath(id.startsWith(\"file://\") ? fileURLToPath(id) : id);\n\tif (!normalized.startsWith(normalizeBuildFilePath(root))) return null;\n\treturn normalized;\n}\nfunction formatImportGuardError(root, ignoredPath, importer) {\n\tconst ignored = projectRelativePath(root, ignoredPath);\n\tif (importer) return `Cannot import \"${ignored}\" (@keystroke ignore) from \"${projectRelativePath(root, importer)}\". Remove the directive or stop importing it from a shipped module.`;\n\treturn `Cannot import \"${ignored}\" (@keystroke ignore). Remove the directive or stop importing it from a shipped module.`;\n}\n/** Throw when a built module imports a `@keystroke ignore` source file. */\nfunction keystrokeIgnoreGuardPlugin(options) {\n\tconst root = normalizeBuildFilePath(options.root);\n\tconst ignoredFiles = new Set(options.ignoredFiles.map((filePath) => normalizeBuildFilePath(filePath)));\n\tfunction assertNotIgnored(filePath, importer) {\n\t\tconst normalized = normalizeBuildFilePath(filePath);\n\t\tif (!ignoredFiles.has(normalized)) return;\n\t\tthrow new Error(formatImportGuardError(root, normalized, importer));\n\t}\n\treturn {\n\t\tname: \"keystroke-ignore-guard\",\n\t\tasync resolveId(source, importer, resolveOptions) {\n\t\t\tif (resolveOptions?.isEntry || !importer) return null;\n\t\t\tconst resolved = await this.resolve(source, importer, {\n\t\t\t\t...resolveOptions,\n\t\t\t\tskipSelf: true\n\t\t\t});\n\t\t\tif (!resolved) return null;\n\t\t\tassertNotIgnored(typeof resolved === \"string\" ? resolved : resolved.id, importer);\n\t\t\treturn null;\n\t\t},\n\t\tload(id) {\n\t\t\tconst normalized = normalizeModuleId(id, root);\n\t\t\tif (!normalized) return null;\n\t\t\tassertNotIgnored(normalized);\n\t\t\treturn null;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/walk-project.ts\nconst IGNORED_DIRS = new Set([\n\t\"node_modules\",\n\t\"dist\",\n\t\".git\",\n\t\".turbo\",\n\t\"build\",\n\t\"coverage\",\n\t\".keystroke\",\n\t\".cache\",\n\t\"tmp\"\n]);\nconst IGNORED_ENV_FILE = /\\.env/;\nconst IGNORED_LOG_FILE = /\\.log$/;\nfunction isIgnoredFile(name) {\n\treturn IGNORED_ENV_FILE.test(name) || IGNORED_LOG_FILE.test(name);\n}\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction isProbablyBinary(buffer) {\n\tconst sampleLength = Math.min(buffer.length, 8e3);\n\tfor (let index = 0; index < sampleLength; index += 1) if (buffer[index] === 0) return true;\n\treturn false;\n}\nfunction classifyBuildEntry(root, srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(root, filePath));\n\tconst agentsPrefix = `${toPosix(relative(root, join(srcRoot, \"agents\")))}/`;\n\tconst workflowsPrefix = `${toPosix(relative(root, join(srcRoot, \"workflows\")))}/`;\n\tconst triggersPrefix = `${toPosix(relative(root, join(srcRoot, \"triggers\")))}/`;\n\tif (relativePath.startsWith(agentsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"agents\"), filePath, { nestedEntry: \"agent\" });\n\t\treturn id ? {\n\t\t\tentryKey: `agents/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(workflowsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"workflows\"), filePath, { nestedEntry: \"workflow\" });\n\t\treturn id ? {\n\t\t\tentryKey: `workflows/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(triggersPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"triggers\"), filePath, { nestedEntry: \"trigger\" });\n\t\treturn id ? {\n\t\t\tentryKey: `triggers/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\treturn null;\n}\nfunction shouldSkipIgnoredModule(filePath, phase) {\n\treturn shouldSkipKeystrokeModuleFile(readKeystrokeIgnoreDirective(filePath), phase);\n}\nfunction isSrcTypeScriptFile(srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(srcRoot, filePath));\n\tif (relativePath.startsWith(\"..\")) return false;\n\treturn /\\.(ts|mts)$/.test(relativePath);\n}\nfunction walkTree(root, dir, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals) {\n\tfor (const name of readdirSync(dir).sort()) {\n\t\tif (collectSources && (sourceFiles.length >= 2e3 || totals.bytes >= 8388608)) return;\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (IGNORED_DIRS.has(name)) continue;\n\t\t\twalkTree(root, absolute, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stats.isFile()) continue;\n\t\tconst isUnderSrc = isSrcTypeScriptFile(srcRoot, absolute);\n\t\tconst skipIgnored = isUnderSrc ? shouldSkipIgnoredModule(absolute, phase) : false;\n\t\tif (isUnderSrc && skipIgnored) ignoredFiles.push(normalizeBuildFilePath(absolute));\n\t\tconst buildEntry = classifyBuildEntry(root, srcRoot, absolute);\n\t\tif (buildEntry && !skipIgnored) buildEntries[buildEntry.entryKey] = buildEntry.entryPath;\n\t\tif (!collectSources) continue;\n\t\tif (stats.size > 262144 || isIgnoredFile(name)) continue;\n\t\tconst buffer = readFileSync(absolute);\n\t\tif (isProbablyBinary(buffer)) continue;\n\t\ttotals.bytes += buffer.byteLength;\n\t\tsourceFiles.push({\n\t\t\tpath: toPosix(relative(root, absolute)),\n\t\t\tcontents: buffer.toString(\"utf8\"),\n\t\t\thash: createHash(\"sha256\").update(buffer).digest(\"hex\")\n\t\t});\n\t}\n}\n/**\n* One full-tree walk of the project: classifies tsdown entries and optionally\n* collects deploy source files (path + contents + hash) under snapshot limits.\n*/\nfunction walkProject(root, srcDirOrOptions = \"src\", maybeOptions) {\n\tconst srcDir = typeof srcDirOrOptions === \"string\" ? srcDirOrOptions : srcDirOrOptions.srcDir ?? \"src\";\n\tconst options = typeof srcDirOrOptions === \"string\" ? maybeOptions ?? {} : srcDirOrOptions;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst sourceFiles = [];\n\tconst buildEntries = {};\n\tconst ignoredFiles = [];\n\twalkTree(root, root, join(root, srcDir), phase, collectSources, sourceFiles, buildEntries, ignoredFiles, { bytes: 0 });\n\treturn {\n\t\tsourceFiles,\n\t\tbuildEntries,\n\t\tignoredFiles\n\t};\n}\n//#endregion\nexport { keystrokeIgnoreGuardPlugin as n, walkProject as t };\n\n//# sourceMappingURL=walk-project-eZ95LOUW.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/**\n * Framework/runtime `@keystrokehq/*` shipped in the project-server image, so user-app builds\n * keep them external and resolve them from the runtime at boot. Everything else under the scope\n * (Composio catalog integrations like `@keystrokehq/posthog`, …) is bundled into the artifact.\n *\n * This set MUST equal the `@keystrokehq/*` dependency closure of `@keystrokehq/project-runtime`\n * (the deploy image) — `deps.test.ts` enforces it. To change what stays external, change what the\n * runtime image depends on; do not edit this list by hand. `exa` is the only integration\n * package the framework imports directly (web search); `gateway` ships Slack and other channel\n * adapters in the runtime image.\n */\nexport const RUNTIME_KEYSTROKE_PACKAGES = new Set([\n \"access-control\",\n \"action\",\n \"agent\",\n \"app\",\n \"auth\",\n \"build\",\n \"config\",\n \"credentials\",\n \"database\",\n \"exa\",\n \"gateway\",\n \"hosting\",\n \"http\",\n \"keystroke\",\n \"manifest\",\n \"mcp\",\n \"memory\",\n \"oauth\",\n \"platform-database\",\n \"project-runtime\",\n \"projects\",\n \"runtime\",\n \"sandbox\",\n \"scheduler\",\n \"sdk\",\n \"secrets\",\n \"shared\",\n \"storage\",\n \"tracing\",\n \"trigger\",\n \"tsdown-config\",\n \"web-search\",\n \"worker\",\n \"workflow\",\n]);\n\n/** Matches framework/runtime `@keystrokehq/*` kept external during user-app builds. */\nexport const FRAMEWORK_KEYSTROKE_EXTERNAL = new RegExp(\n `^@keystrokehq\\\\/(?:${[...RUNTIME_KEYSTROKE_PACKAGES].sort().join(\"|\")})(?:\\\\/|$)`,\n);\n\nfunction keystrokePackageName(name) {\n if (!name.startsWith(\"@keystrokehq/\")) {\n return null;\n }\n\n return name.slice(\"@keystrokehq/\".length).split(\"/\")[0] ?? null;\n}\n\nfunction isRuntimeKeystrokePackage(name) {\n const pkg = keystrokePackageName(name);\n return pkg !== null && RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\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 isRuntimeKeystrokePackage(name);\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, FRAMEWORK_KEYSTROKE_EXTERNAL, ...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 { n as keystrokeIgnoreGuardPlugin, t as walkProject } from \"./walk-project-eZ95LOUW.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\nimport { buildStoredRouteManifestForProject } from \"@keystrokehq/manifest\";\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/resolve-build-filter.ts\n/** Resolve exact build-entry keys for a filtered deploy build. */\nfunction resolveBuildFilter(filter, buildEntries) {\n\tif (filter.length === 0) throw new Error(\"At least one --filter entry is required\");\n\tconst matched = {};\n\tfor (const key of [...new Set(filter)]) {\n\t\tconst entryPath = buildEntries[key];\n\t\tif (!entryPath) throw new Error(`Unknown build entry \"${key}\". Use keys like agents/foo or workflows/bar from walkProject.`);\n\t\tmatched[key] = entryPath;\n\t}\n\treturn matched;\n}\n//#endregion\n//#region src/build-filtered.ts\nfunction toPosix(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction distRelativePath(entryKey) {\n\treturn `${entryKey}.mjs`;\n}\nasync function buildSingleEntry(root, entryKey, entryPath, ignoredFiles) {\n\tmkdirSync(join(root, \".keystroke\"), { recursive: true });\n\tconst scratchRoot = mkdtempSync(join(root, \".keystroke\", \"filter-build-\"));\n\tconst outDir = join(scratchRoot, \"dist\");\n\tconst relativePath = distRelativePath(entryKey);\n\tawait build(mergeConfig(baseTsdownConfig, {\n\t\tentry: { [entryKey]: entryPath },\n\t\tformat: [\"esm\"],\n\t\toutDir,\n\t\tclean: true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t})]\n\t}));\n\treturn {\n\t\tscratchRoot,\n\t\trelativePath\n\t};\n}\nasync function manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap) {\n\tconst moduleFile = toPosix(relative(root, entryPath));\n\tconst distPath = join(root, \"dist\", relativePath);\n\tconst distMapPath = `${distPath}.map`;\n\tconst previousDist = existsSync(distPath) ? readFileSync(distPath) : void 0;\n\tconst hadMap = existsSync(distMapPath);\n\tconst previousMap = hadMap ? readFileSync(distMapPath) : void 0;\n\tmkdirSync(dirname(distPath), { recursive: true });\n\twriteFileSync(distPath, contents);\n\tif (sourceMap) writeFileSync(distMapPath, sourceMap);\n\ttry {\n\t\treturn (await buildStoredRouteManifestForProject(root, { reloadModules: true })).entries.filter((entry) => \"moduleFile\" in entry && entry.moduleFile === moduleFile);\n\t} finally {\n\t\tif (previousDist) writeFileSync(distPath, previousDist);\n\t\telse rmSync(distPath, { force: true });\n\t\tif (previousMap) writeFileSync(distMapPath, previousMap);\n\t\telse if (sourceMap || hadMap) rmSync(distMapPath, { force: true });\n\t}\n}\n/** Build selected modules in isolation for a filtered deploy merge. */\nasync function buildFilteredApp(options) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst phase = options.phase ?? \"deploy\";\n\tconst collectSources = options.collectSources ?? false;\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\n\tconst matched = resolveBuildFilter(options.filter, walked.buildEntries);\n\tconst files = [];\n\tconst manifestEntries = [];\n\ttry {\n\t\tprocess.chdir(root);\n\t\tfor (const [entryKey, entryPath] of Object.entries(matched)) {\n\t\t\tconst { scratchRoot, relativePath } = await buildSingleEntry(root, entryKey, entryPath, walked.ignoredFiles);\n\t\t\ttry {\n\t\t\t\tconst builtPath = join(scratchRoot, \"dist\", relativePath);\n\t\t\t\tconst mapPath = `${builtPath}.map`;\n\t\t\t\tconst contents = readFileSync(builtPath);\n\t\t\t\tconst sourceMap = existsSync(mapPath) ? readFileSync(mapPath) : void 0;\n\t\t\t\tfiles.push({\n\t\t\t\t\tentryKey,\n\t\t\t\t\trelativePath,\n\t\t\t\t\tcontents,\n\t\t\t\t\tsourceMap\n\t\t\t\t});\n\t\t\t\tmanifestEntries.push(...await manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap));\n\t\t\t} finally {\n\t\t\t\trmSync(scratchRoot, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tforce: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn {\n\t\tfiles,\n\t\tmanifestEntries,\n\t\tsourceFiles: walked.sourceFiles\n\t};\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\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 = {}, walked) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\tconst walkedResult = walked ?? walkProject(root, {\n\t\tsrcDir,\n\t\tphase: options.phase\n\t});\n\tconst discovered = walkedResult.buildEntries;\n\tconst ignoredFiles = walkedResult.ignoredFiles;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discovered\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: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t}), 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 srcDir = options.srcDir ?? \"src\";\n\tconst emitManifest = options.emitManifest ?? true;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\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\t\tbuildEntries: walked.buildEntries,\n\t\t\tignoredFiles: walked.ignoredFiles\n\t\t}));\n\t\tif (emitManifest) {\n\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn { sourceFiles: walked.sourceFiles };\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((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, buildFilteredApp, createAppBuildConfig, resolveBuildFilter, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AAMA,SAAS,UAAU,MAAM;CACxB,OAAO,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG;AAChC;AACA,SAAS,oBAAoB,MAAM,UAAU;CAC5C,OAAO,UAAU,SAAS,MAAM,uBAAuB,QAAQ,CAAC,CAAC;AAClE;;AAEA,SAAS,uBAAuB,UAAU;CACzC,MAAM,WAAW,QAAQ,QAAQ;CACjC,IAAI;EACH,OAA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file":"dist-D3CcImHe.mjs","names":["toPosix"],"sources":["../../../packages/build/dist/walk-project-eZ95LOUW.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { readFileSync, readdirSync, realpathSync, statSync } from \"node:fs\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { entryIdFromFile, readKeystrokeIgnoreDirective, shouldSkipKeystrokeModuleFile } from \"@keystrokehq/manifest/discovery\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/ignore-guard-plugin.ts\nfunction toPosix$1(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction projectRelativePath(root, filePath) {\n\treturn toPosix$1(relative(root, normalizeBuildFilePath(filePath)));\n}\n/** Normalize paths so /var and /private/var compare equal on macOS. */\nfunction normalizeBuildFilePath(filePath) {\n\tconst absolute = resolve(filePath);\n\ttry {\n\t\treturn realpathSync.native(absolute);\n\t} catch {\n\t\treturn absolute;\n\t}\n}\nfunction normalizeModuleId(id, root) {\n\tif (id.startsWith(\"\\0\")) return null;\n\tconst normalized = normalizeBuildFilePath(id.startsWith(\"file://\") ? fileURLToPath(id) : id);\n\tif (!normalized.startsWith(normalizeBuildFilePath(root))) return null;\n\treturn normalized;\n}\nfunction formatImportGuardError(root, ignoredPath, importer) {\n\tconst ignored = projectRelativePath(root, ignoredPath);\n\tif (importer) return `Cannot import \"${ignored}\" (@keystroke ignore) from \"${projectRelativePath(root, importer)}\". Remove the directive or stop importing it from a shipped module.`;\n\treturn `Cannot import \"${ignored}\" (@keystroke ignore). Remove the directive or stop importing it from a shipped module.`;\n}\n/** Throw when a built module imports a `@keystroke ignore` source file. */\nfunction keystrokeIgnoreGuardPlugin(options) {\n\tconst root = normalizeBuildFilePath(options.root);\n\tconst ignoredFiles = new Set(options.ignoredFiles.map((filePath) => normalizeBuildFilePath(filePath)));\n\tfunction assertNotIgnored(filePath, importer) {\n\t\tconst normalized = normalizeBuildFilePath(filePath);\n\t\tif (!ignoredFiles.has(normalized)) return;\n\t\tthrow new Error(formatImportGuardError(root, normalized, importer));\n\t}\n\treturn {\n\t\tname: \"keystroke-ignore-guard\",\n\t\tasync resolveId(source, importer, resolveOptions) {\n\t\t\tif (resolveOptions?.isEntry || !importer) return null;\n\t\t\tconst resolved = await this.resolve(source, importer, {\n\t\t\t\t...resolveOptions,\n\t\t\t\tskipSelf: true\n\t\t\t});\n\t\t\tif (!resolved) return null;\n\t\t\tassertNotIgnored(typeof resolved === \"string\" ? resolved : resolved.id, importer);\n\t\t\treturn null;\n\t\t},\n\t\tload(id) {\n\t\t\tconst normalized = normalizeModuleId(id, root);\n\t\t\tif (!normalized) return null;\n\t\t\tassertNotIgnored(normalized);\n\t\t\treturn null;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/walk-project.ts\nconst IGNORED_DIRS = new Set([\n\t\"node_modules\",\n\t\"dist\",\n\t\".git\",\n\t\".turbo\",\n\t\"build\",\n\t\"coverage\",\n\t\".keystroke\",\n\t\".cache\",\n\t\"tmp\"\n]);\nconst IGNORED_ENV_FILE = /\\.env/;\nconst IGNORED_LOG_FILE = /\\.log$/;\nfunction isIgnoredFile(name) {\n\treturn IGNORED_ENV_FILE.test(name) || IGNORED_LOG_FILE.test(name);\n}\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction isProbablyBinary(buffer) {\n\tconst sampleLength = Math.min(buffer.length, 8e3);\n\tfor (let index = 0; index < sampleLength; index += 1) if (buffer[index] === 0) return true;\n\treturn false;\n}\nfunction classifyBuildEntry(root, srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(root, filePath));\n\tconst agentsPrefix = `${toPosix(relative(root, join(srcRoot, \"agents\")))}/`;\n\tconst workflowsPrefix = `${toPosix(relative(root, join(srcRoot, \"workflows\")))}/`;\n\tconst triggersPrefix = `${toPosix(relative(root, join(srcRoot, \"triggers\")))}/`;\n\tif (relativePath.startsWith(agentsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"agents\"), filePath, { nestedEntry: \"agent\" });\n\t\treturn id ? {\n\t\t\tentryKey: `agents/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(workflowsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"workflows\"), filePath, { nestedEntry: \"workflow\" });\n\t\treturn id ? {\n\t\t\tentryKey: `workflows/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(triggersPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"triggers\"), filePath, { nestedEntry: \"trigger\" });\n\t\treturn id ? {\n\t\t\tentryKey: `triggers/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\treturn null;\n}\nfunction shouldSkipIgnoredModule(filePath, phase) {\n\treturn shouldSkipKeystrokeModuleFile(readKeystrokeIgnoreDirective(filePath), phase);\n}\nfunction isSrcTypeScriptFile(srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(srcRoot, filePath));\n\tif (relativePath.startsWith(\"..\")) return false;\n\treturn /\\.(ts|mts)$/.test(relativePath);\n}\nfunction walkTree(root, dir, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals) {\n\tfor (const name of readdirSync(dir).sort()) {\n\t\tif (collectSources && (sourceFiles.length >= 2e3 || totals.bytes >= 8388608)) return;\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (IGNORED_DIRS.has(name)) continue;\n\t\t\twalkTree(root, absolute, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stats.isFile()) continue;\n\t\tconst isUnderSrc = isSrcTypeScriptFile(srcRoot, absolute);\n\t\tconst skipIgnored = isUnderSrc ? shouldSkipIgnoredModule(absolute, phase) : false;\n\t\tif (isUnderSrc && skipIgnored) ignoredFiles.push(normalizeBuildFilePath(absolute));\n\t\tconst buildEntry = classifyBuildEntry(root, srcRoot, absolute);\n\t\tif (buildEntry && !skipIgnored) buildEntries[buildEntry.entryKey] = buildEntry.entryPath;\n\t\tif (!collectSources) continue;\n\t\tif (stats.size > 262144 || isIgnoredFile(name)) continue;\n\t\tconst buffer = readFileSync(absolute);\n\t\tif (isProbablyBinary(buffer)) continue;\n\t\ttotals.bytes += buffer.byteLength;\n\t\tsourceFiles.push({\n\t\t\tpath: toPosix(relative(root, absolute)),\n\t\t\tcontents: buffer.toString(\"utf8\"),\n\t\t\thash: createHash(\"sha256\").update(buffer).digest(\"hex\")\n\t\t});\n\t}\n}\n/**\n* One full-tree walk of the project: classifies tsdown entries and optionally\n* collects deploy source files (path + contents + hash) under snapshot limits.\n*/\nfunction walkProject(root, srcDirOrOptions = \"src\", maybeOptions) {\n\tconst srcDir = typeof srcDirOrOptions === \"string\" ? srcDirOrOptions : srcDirOrOptions.srcDir ?? \"src\";\n\tconst options = typeof srcDirOrOptions === \"string\" ? maybeOptions ?? {} : srcDirOrOptions;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst sourceFiles = [];\n\tconst buildEntries = {};\n\tconst ignoredFiles = [];\n\twalkTree(root, root, join(root, srcDir), phase, collectSources, sourceFiles, buildEntries, ignoredFiles, { bytes: 0 });\n\treturn {\n\t\tsourceFiles,\n\t\tbuildEntries,\n\t\tignoredFiles\n\t};\n}\n//#endregion\nexport { keystrokeIgnoreGuardPlugin as n, walkProject as t };\n\n//# sourceMappingURL=walk-project-eZ95LOUW.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/**\n * Framework/runtime `@keystrokehq/*` shipped in the project-server image, so user-app builds\n * keep them external and resolve them from the runtime at boot. Everything else under the scope\n * (Composio catalog integrations like `@keystrokehq/posthog`, …) is bundled into the artifact.\n *\n * This set MUST equal the `@keystrokehq/*` dependency closure of `@keystrokehq/project-runtime`\n * (the deploy image) — `deps.test.ts` enforces it. To change what stays external, change what the\n * runtime image depends on; do not edit this list by hand. `exa` is the only integration\n * package the framework imports directly (web search); `gateway` ships Slack and other channel\n * adapters in the runtime image.\n */\nexport const RUNTIME_KEYSTROKE_PACKAGES = new Set([\n \"access-control\",\n \"action\",\n \"agent\",\n \"app\",\n \"auth\",\n \"build\",\n \"config\",\n \"credentials\",\n \"database\",\n \"exa\",\n \"gateway\",\n \"hosting\",\n \"http\",\n \"keystroke\",\n \"manifest\",\n \"mcp\",\n \"memory\",\n \"oauth\",\n \"platform-database\",\n \"project-runtime\",\n \"projects\",\n \"runtime\",\n \"sandbox\",\n \"scheduler\",\n \"sdk\",\n \"secrets\",\n \"shared\",\n \"storage\",\n \"tracing\",\n \"trigger\",\n \"tsdown-config\",\n \"web-search\",\n \"worker\",\n \"workflow\",\n]);\n\n/** Matches framework/runtime `@keystrokehq/*` kept external during user-app builds. */\nexport const FRAMEWORK_KEYSTROKE_EXTERNAL = new RegExp(\n `^@keystrokehq\\\\/(?:${[...RUNTIME_KEYSTROKE_PACKAGES].sort().join(\"|\")})(?:\\\\/|$)`,\n);\n\nfunction keystrokePackageName(name) {\n if (!name.startsWith(\"@keystrokehq/\")) {\n return null;\n }\n\n return name.slice(\"@keystrokehq/\".length).split(\"/\")[0] ?? null;\n}\n\nfunction isRuntimeKeystrokePackage(name) {\n const pkg = keystrokePackageName(name);\n return pkg !== null && RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\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 isRuntimeKeystrokePackage(name);\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, FRAMEWORK_KEYSTROKE_EXTERNAL, ...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 { n as keystrokeIgnoreGuardPlugin, t as walkProject } from \"./walk-project-eZ95LOUW.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\nimport { buildStoredRouteManifestForProject } from \"@keystrokehq/manifest\";\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/resolve-build-filter.ts\n/** Resolve exact build-entry keys for a filtered deploy build. */\nfunction resolveBuildFilter(filter, buildEntries) {\n\tif (filter.length === 0) throw new Error(\"At least one --filter entry is required\");\n\tconst matched = {};\n\tfor (const key of [...new Set(filter)]) {\n\t\tconst entryPath = buildEntries[key];\n\t\tif (!entryPath) throw new Error(`Unknown build entry \"${key}\". Use keys like agents/foo or workflows/bar from walkProject.`);\n\t\tmatched[key] = entryPath;\n\t}\n\treturn matched;\n}\n//#endregion\n//#region src/build-filtered.ts\nfunction toPosix(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction distRelativePath(entryKey) {\n\treturn `${entryKey}.mjs`;\n}\nasync function buildSingleEntry(root, entryKey, entryPath, ignoredFiles) {\n\tmkdirSync(join(root, \".keystroke\"), { recursive: true });\n\tconst scratchRoot = mkdtempSync(join(root, \".keystroke\", \"filter-build-\"));\n\tconst outDir = join(scratchRoot, \"dist\");\n\tconst relativePath = distRelativePath(entryKey);\n\tawait build(mergeConfig(baseTsdownConfig, {\n\t\tentry: { [entryKey]: entryPath },\n\t\tformat: [\"esm\"],\n\t\toutDir,\n\t\tclean: true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t})]\n\t}));\n\treturn {\n\t\tscratchRoot,\n\t\trelativePath\n\t};\n}\nasync function manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap) {\n\tconst moduleFile = toPosix(relative(root, entryPath));\n\tconst distPath = join(root, \"dist\", relativePath);\n\tconst distMapPath = `${distPath}.map`;\n\tconst previousDist = existsSync(distPath) ? readFileSync(distPath) : void 0;\n\tconst hadMap = existsSync(distMapPath);\n\tconst previousMap = hadMap ? readFileSync(distMapPath) : void 0;\n\tmkdirSync(dirname(distPath), { recursive: true });\n\twriteFileSync(distPath, contents);\n\tif (sourceMap) writeFileSync(distMapPath, sourceMap);\n\ttry {\n\t\treturn (await buildStoredRouteManifestForProject(root, { reloadModules: true })).entries.filter((entry) => \"moduleFile\" in entry && entry.moduleFile === moduleFile);\n\t} finally {\n\t\tif (previousDist) writeFileSync(distPath, previousDist);\n\t\telse rmSync(distPath, { force: true });\n\t\tif (previousMap) writeFileSync(distMapPath, previousMap);\n\t\telse if (sourceMap || hadMap) rmSync(distMapPath, { force: true });\n\t}\n}\n/** Build selected modules in isolation for a filtered deploy merge. */\nasync function buildFilteredApp(options) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst phase = options.phase ?? \"deploy\";\n\tconst collectSources = options.collectSources ?? false;\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\n\tconst matched = resolveBuildFilter(options.filter, walked.buildEntries);\n\tconst files = [];\n\tconst manifestEntries = [];\n\ttry {\n\t\tprocess.chdir(root);\n\t\tfor (const [entryKey, entryPath] of Object.entries(matched)) {\n\t\t\tconst { scratchRoot, relativePath } = await buildSingleEntry(root, entryKey, entryPath, walked.ignoredFiles);\n\t\t\ttry {\n\t\t\t\tconst builtPath = join(scratchRoot, \"dist\", relativePath);\n\t\t\t\tconst mapPath = `${builtPath}.map`;\n\t\t\t\tconst contents = readFileSync(builtPath);\n\t\t\t\tconst sourceMap = existsSync(mapPath) ? readFileSync(mapPath) : void 0;\n\t\t\t\tfiles.push({\n\t\t\t\t\tentryKey,\n\t\t\t\t\trelativePath,\n\t\t\t\t\tcontents,\n\t\t\t\t\tsourceMap\n\t\t\t\t});\n\t\t\t\tmanifestEntries.push(...await manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap));\n\t\t\t} finally {\n\t\t\t\trmSync(scratchRoot, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tforce: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn {\n\t\tfiles,\n\t\tmanifestEntries,\n\t\tsourceFiles: walked.sourceFiles\n\t};\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\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 = {}, walked) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\tconst walkedResult = walked ?? walkProject(root, {\n\t\tsrcDir,\n\t\tphase: options.phase\n\t});\n\tconst discovered = walkedResult.buildEntries;\n\tconst ignoredFiles = walkedResult.ignoredFiles;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discovered\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: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t}), 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 srcDir = options.srcDir ?? \"src\";\n\tconst emitManifest = options.emitManifest ?? true;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\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\t\tbuildEntries: walked.buildEntries,\n\t\t\tignoredFiles: walked.ignoredFiles\n\t\t}));\n\t\tif (emitManifest) {\n\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn { sourceFiles: walked.sourceFiles };\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((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, buildFilteredApp, createAppBuildConfig, resolveBuildFilter, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AAMA,SAAS,UAAU,MAAM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AO,EAAE,aAAa,OAAO,YAAY;AAC1C;;;;;;;AAOA,eAAe,SAAS,UAAU,CAAC,GAAG;CACrC,MAAM,EAAE,gBAAgB,MAAM,OAAO;CACrC,MAAM,aAAa,iBAAiB,SAAS;EAC5C,GAAG;EACH,cAAc;EACd,gBAAgB;CACjB,CAAC,GAAG,OAAO;AACZ"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { $ as ListAgentMemoryFilesResponseSchema, $t as UpdateProjectRequestSchema, A as CreateCustomAppResponseSchema, At as RecentResourceListResponseSchema, B as ErrorResponseSchema, Bt as SubmitTeamRequestRequestSchema, C as ConnectProvidersResponseSchema, Ct as ProjectSettingsResponseSchema, D as CreateCredentialsRequestSchema, Dt as QueuedAgentPromptResponseSchema, E as CreateCredentialInstanceBodySchema, Et as PromptResponseSchema, F as CreateProjectResponseSchema, Ft as StartKeystrokeConnectionResultSchema, G as HistoryRunCancelResponseSchema, Gt as UpdateChannelBindingBodySchema, H as GetCredentialResponseSchema, Ht as TriggerListResponseSchema, I as CredentialInstanceListResponseSchema, It as StartOAuthConnectionInputSchema, J as HistoryRunListResponseSchema, Jt as UpdateOrganizationMemberRequestSchema, K as HistoryRunDetailResponseSchema, Kt as UpdateCredentialInstanceBodySchema, L as CredentialInstanceRecordSchema, Lt as StartOAuthConnectionResultSchema, M as CreateOrganizationResponseSchema, Mt as SkillSummaryListResponseSchema, N as CreateProjectArtifactResponseSchema, Nt as SlugAvailabilityResponseSchema, O as CreateCredentialsResponseSchema, Ot as QueuedRunResponseSchema, P as CreateProjectRequestSchema, Pt as StartKeystrokeConnectionInputSchema, Q as InviteProjectMembersResponseSchema, Qt as UpdateProjectMemberResponseSchema, R as DeclineOrganizationInvitationResponseSchema, Rt as StoredRouteManifestSchema, S as ConnectAuthorizeUrlResponseSchema, St as ProjectResponseSchema, T as CreateApiKeyResponseSchema, Tt as PromptInputSchema, U as GetCustomAppResponseSchema, Ut as TriggerRunDetailResponseSchema, V as GatewayAttachmentRecordSchema, Vt as TriggerDetailResponseSchema, W as HealthResponseSchema, Wt as TriggerRunListResponseSchema, X as InviteOrganizationMembersResponseSchema, Xt as UpdateOrganizationRequestSchema, Y as InviteOrganizationMembersRequestSchema, Yt as UpdateOrganizationMemberResponseSchema, Z as InviteProjectMembersRequestSchema, Zt as UpdateProjectMemberRequestSchema, _ as ChannelConnectionListResponseSchema, _n as slugifyAppName, _t as PresignProjectSourceRequestSchema, a as AgentSessionDetailResponseSchema, an as UserAvatarSchema, at as ListOrganizationsResponseSchema, b as ChannelPlatformSchema, bt as PresignUserAvatarResponseSchema, c as AgentSummaryListResponseSchema, cn as WorkflowRunDetailResponseSchema, ct as ListProjectMembersResponseSchema, d as BindChannelBodySchema, dn as WorkflowSummaryListResponseSchema, dt as OrganizationSidebarBrandingPatchSchema, en as UpdateProjectSettingsRequestSchema, et as ListApiKeysResponseSchema, f as CatalogActionDetailResponseSchema, fn as listenPortFromPublicUrl, ft as OrganizationSidebarBrandingSchema, g as ChannelAccountListResponseSchema, gn as parseErrorResponse, gt as PresignOrgLogoResponseSchema, h as CatalogAppsPageResponseSchema, hn as parseAppSlug, ht as PresignOrgLogoRequestSchema, i as AgentSessionChatStateResponseSchema, in as UserAvatarPatchSchema, it as ListOrganizationMembersResponseSchema, j as CreateOrganizationRequestSchema, jt as SkillSummaryDetailResponseSchema, k as CreateCustomAppRequestSchema, kt as ROUTE_MANIFEST_REL_PATH, l as AgentTriggerSummaryListResponseSchema, ln as WorkflowRunListResponseSchema, lt as ListProjectMetricsResponseSchema, m as CatalogAppDetailResponseSchema, mt as PollRunResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as UploadProjectSourceResponseSchema, nt as ListCredentialsResponseSchema, o as AgentSessionListResponseSchema, on as UserPreferencesPatchSchema, ot as ListProjectDeploymentsResponseSchema, p as CatalogActionsPageResponseSchema, pt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, q as HistoryRunListQuerySchema, qt as UpdateCredentialRequestSchema, r as ActiveOrganizationResponseSchema, rn as UpsertGatewayAttachmentBodySchema, rt as ListOrganizationInvitationsResponseSchema, s as AgentSummaryDetailResponseSchema, sn as UserPreferencesSchema, st as ListProjectFilesResponseSchema, t as ACTIVE_ORG_HEADER, tn as UploadProjectSourceManifestRequestSchema, tt as ListAppsResponseSchema, u as AppSlugAvailabilityResponseSchema, un as WorkflowSummaryDetailResponseSchema, ut as ListProjectsResponseSchema, v as ChannelConnectionSchema, vt as PresignProjectSourceResponseSchema, w as CreateApiKeyRequestSchema, wt as ProjectSlugAvailabilityResponseSchema, x as CompleteProjectArtifactResponseSchema, xt as ProjectReachabilityResponseSchema, y as ChannelDirectoryListResponseSchema, yt as PresignUserAvatarRequestSchema, z as DownloadActiveProjectArtifactResponseSchema, zt as SubmitMarketingContactRequestSchema } from "./dist-CtHP_Lct.mjs";
3
- import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, h as DEFAULT_PLATFORM_URL, i as installDependencies, l as getCliConfigDir, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getServerUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-DCrWhVju.mjs";
2
+ import { $ as HistoryRunListQuerySchema, $t as UpdateCredentialRequestSchema, A as CreateCustomAppRequestSchema, At as ProjectSlugAvailabilityResponseSchema, B as CredentialConsumerListQuerySchema, Bt as StartKeystrokeConnectionInputSchema, C as ConnectAuthorizeUrlResponseSchema, Cn as slugifyAppName, Ct as PresignProjectSourceRequestSchema, D as CreateCredentialInstanceBodySchema, Dt as ProjectReachabilityResponseSchema, E as CreateApiKeyResponseSchema, Et as PresignUserAvatarResponseSchema, F as CreateProjectRequestSchema, Ft as ROUTE_MANIFEST_REL_PATH, G as DownloadActiveProjectArtifactResponseSchema, Gt as SubmitMarketingContactRequestSchema, H as CredentialInstanceListResponseSchema, Ht as StartOAuthConnectionInputSchema, I as CreateProjectResponseSchema, It as RecentResourceListResponseSchema, J as GetCredentialResponseSchema, Jt as TriggerListResponseSchema, K as ErrorResponseSchema, Kt as SubmitTeamRequestRequestSchema, L as CredentialAssignmentListQuerySchema, Lt as SkillSummaryDetailResponseSchema, M as CreateOrganizationRequestSchema, Mt as PromptResponseSchema, N as CreateOrganizationResponseSchema, Nt as QueuedAgentPromptResponseSchema, O as CreateCredentialsRequestSchema, Ot as ProjectResponseSchema, P as CreateProjectArtifactResponseSchema, Pt as QueuedRunResponseSchema, Q as HistoryRunDetailResponseSchema, Qt as UpdateCredentialInstanceBodySchema, R as CredentialAssignmentListResponseSchema, Rt as SkillSummaryListResponseSchema, S as CompleteProjectArtifactResponseSchema, Sn as parseErrorResponse, St as PresignOrgLogoResponseSchema, T as CreateApiKeyRequestSchema, Tt as PresignUserAvatarRequestSchema, U as CredentialInstanceRecordSchema, Ut as StartOAuthConnectionResultSchema, V as CredentialConsumerListResponseSchema, Vt as StartKeystrokeConnectionResultSchema, W as DeclineOrganizationInvitationResponseSchema, Wt as StoredRouteManifestSchema, X as HealthResponseSchema, Xt as TriggerRunListResponseSchema, Y as GetCustomAppResponseSchema, Yt as TriggerRunDetailResponseSchema, Z as HistoryRunCancelResponseSchema, Zt as UpdateChannelBindingBodySchema, _ as ChannelAccountListResponseSchema, _n as WorkflowSummaryListResponseSchema, _t as OrganizationSidebarBrandingPatchSchema, a as AgentSessionDetailResponseSchema, an as UpdateProjectRequestSchema, at as ListAgentMemoryFilesResponseSchema, b as ChannelDirectoryListResponseSchema, bt as PollRunResponseSchema, c as AgentSummaryListResponseSchema, cn as UploadProjectSourceResponseSchema, ct as ListCredentialsResponseSchema, d as AssignCredentialBodySchema, dn as UserAvatarSchema, dt as ListOrganizationsResponseSchema, en as UpdateOrganizationMemberRequestSchema, et as HistoryRunListResponseSchema, f as BindChannelBodySchema, fn as UserPreferencesPatchSchema, ft as ListProjectDeploymentsResponseSchema, g as CatalogAppsPageResponseSchema, gn as WorkflowSummaryDetailResponseSchema, gt as ListProjectsResponseSchema, h as CatalogAppDetailResponseSchema, hn as WorkflowRunListResponseSchema, ht as ListProjectMetricsResponseSchema, i as AgentSessionChatStateResponseSchema, in as UpdateProjectMemberResponseSchema, it as InviteProjectMembersResponseSchema, j as CreateCustomAppResponseSchema, jt as PromptInputSchema, k as CreateCredentialsResponseSchema, kt as ProjectSettingsResponseSchema, l as AgentTriggerSummaryListResponseSchema, ln as UpsertGatewayAttachmentBodySchema, lt as ListOrganizationInvitationsResponseSchema, m as CatalogActionsPageResponseSchema, mn as WorkflowRunDetailResponseSchema, mt as ListProjectMembersResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nn as UpdateOrganizationRequestSchema, nt as InviteOrganizationMembersResponseSchema, o as AgentSessionListResponseSchema, on as UpdateProjectSettingsRequestSchema, ot as ListApiKeysResponseSchema, p as CatalogActionDetailResponseSchema, pn as UserPreferencesSchema, pt as ListProjectFilesResponseSchema, q as GatewayAttachmentRecordSchema, qt as TriggerDetailResponseSchema, r as ActiveOrganizationResponseSchema, rn as UpdateProjectMemberRequestSchema, rt as InviteProjectMembersRequestSchema, s as AgentSummaryDetailResponseSchema, sn as UploadProjectSourceManifestRequestSchema, st as ListAppsResponseSchema, t as ACTIVE_ORG_HEADER, tn as UpdateOrganizationMemberResponseSchema, tt as InviteOrganizationMembersRequestSchema, u as AppSlugAvailabilityResponseSchema, un as UserAvatarPatchSchema, ut as ListOrganizationMembersResponseSchema, v as ChannelConnectionListResponseSchema, vn as listenPortFromPublicUrl, vt as OrganizationSidebarBrandingSchema, w as ConnectProvidersResponseSchema, wt as PresignProjectSourceResponseSchema, x as ChannelPlatformSchema, xn as parseAppSlug, xt as PresignOrgLogoRequestSchema, y as ChannelConnectionSchema, yt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, z as CredentialAssignmentRecordSchema, zt as SlugAvailabilityResponseSchema } from "./dist-BCJ2M6AP.mjs";
3
+ import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, h as DEFAULT_PLATFORM_URL, i as installDependencies, l as getCliConfigDir, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getServerUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-BCmCJixt.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { Command } from "commander";
6
6
  import { platform, tmpdir } from "node:os";
@@ -1433,6 +1433,40 @@ function createCredentialsResource$1(http) {
1433
1433
  } catch (error) {
1434
1434
  throw await toKeystrokeError(error);
1435
1435
  }
1436
+ },
1437
+ async listAssignments(query) {
1438
+ try {
1439
+ const params = CredentialAssignmentListQuerySchema.parse(query);
1440
+ const data = await http.get("credentials/assignments", { searchParams: params }).json();
1441
+ return CredentialAssignmentListResponseSchema.parse(data);
1442
+ } catch (error) {
1443
+ throw await toKeystrokeError(error);
1444
+ }
1445
+ },
1446
+ async assignCredential(body) {
1447
+ try {
1448
+ const payload = AssignCredentialBodySchema.parse(body);
1449
+ const data = await http.put("credentials/assignments", { json: payload }).json();
1450
+ return CredentialAssignmentRecordSchema.parse(data);
1451
+ } catch (error) {
1452
+ throw await toKeystrokeError(error);
1453
+ }
1454
+ },
1455
+ async unassignCredential(id) {
1456
+ try {
1457
+ await http.delete(`credentials/assignments/${id}`);
1458
+ } catch (error) {
1459
+ throw await toKeystrokeError(error);
1460
+ }
1461
+ },
1462
+ async listConsumers(query) {
1463
+ try {
1464
+ const params = CredentialConsumerListQuerySchema.parse(query);
1465
+ const data = await http.get("credentials/consumers", { searchParams: params }).json();
1466
+ return CredentialConsumerListResponseSchema.parse(data);
1467
+ } catch (error) {
1468
+ throw await toKeystrokeError(error);
1469
+ }
1436
1470
  }
1437
1471
  };
1438
1472
  }
@@ -4623,13 +4657,30 @@ function readDevSession(configDir = getCliConfigDir()) {
4623
4657
  }
4624
4658
  //#endregion
4625
4659
  //#region src/resolve-api-target.ts
4660
+ /** Standalone local server default project id — keep in sync with @keystrokehq/database. */
4661
+ const DEFAULT_LOCAL_PROJECT_ID = "default";
4626
4662
  const projectScopedTarget = { projectScoped: true };
4627
- function resolveLocalTarget(config) {
4663
+ function resolveLocalTargetFromOrigin(origin, options = {}) {
4664
+ const base = origin.replace(/\/+$/, "");
4665
+ if (!options.projectScoped) return {
4666
+ baseUrl: base,
4667
+ mode: "local"
4668
+ };
4669
+ const projectPathMatch = base.match(/^(.*\/api\/projects\/([^/]+))$/);
4670
+ if (projectPathMatch) return {
4671
+ baseUrl: projectPathMatch[1],
4672
+ projectId: projectPathMatch[2],
4673
+ mode: "local"
4674
+ };
4628
4675
  return {
4629
- baseUrl: getServerUrl(config),
4676
+ baseUrl: `${base}/api/projects/${DEFAULT_LOCAL_PROJECT_ID}`,
4677
+ projectId: DEFAULT_LOCAL_PROJECT_ID,
4630
4678
  mode: "local"
4631
4679
  };
4632
4680
  }
4681
+ function resolveLocalTarget(config, options = {}) {
4682
+ return resolveLocalTargetFromOrigin(getServerUrl(config), options);
4683
+ }
4633
4684
  function resolveOrgPlatformTarget(config) {
4634
4685
  return {
4635
4686
  baseUrl: `${getPlatformUrl(config).replace(/\/+$/, "")}/api`,
@@ -4653,18 +4704,15 @@ async function resolvePlatformTarget(config, projectRef) {
4653
4704
  };
4654
4705
  }
4655
4706
  async function resolveApiTarget(config, options = {}) {
4656
- if (options.local) return resolveLocalTarget(config);
4707
+ if (options.local) return resolveLocalTarget(config, options);
4657
4708
  const devSession = readDevSession(getConfigDir(config));
4658
- if (devSession && getEffectiveApiTarget(config) !== "platform") return {
4659
- baseUrl: devSession.serverUrl,
4660
- mode: "local"
4661
- };
4709
+ if (devSession && getEffectiveApiTarget(config) !== "platform") return resolveLocalTargetFromOrigin(devSession.serverUrl, options);
4662
4710
  if (options.orgScoped || options.projectScoped === false) {
4663
- if (getEffectiveApiTarget(config) === "local") return resolveLocalTarget(config);
4711
+ if (getEffectiveApiTarget(config) === "local") return resolveLocalTarget(config, options);
4664
4712
  return resolveOrgPlatformTarget(config);
4665
4713
  }
4666
4714
  if (options.projectId) return resolvePlatformTarget(config, options.projectId);
4667
- if (getEffectiveApiTarget(config) === "local") return resolveLocalTarget(config);
4715
+ if (getEffectiveApiTarget(config) === "local") return resolveLocalTarget(config, options);
4668
4716
  if (!options.projectScoped) return resolveOrgPlatformTarget(config);
4669
4717
  const projectRef = options.projectId ?? config.get("activeProjectId");
4670
4718
  if (!projectRef) throw new Error("No project selected. Pass `--project <slug>` or run `keystroke config use project <slug>`.");
@@ -5344,6 +5392,90 @@ function registerConnectCommand(program) {
5344
5392
  }, void 0, { orgScoped: true }));
5345
5393
  }
5346
5394
  //#endregion
5395
+ //#region src/commands/credentials/parse-assignment-target.ts
5396
+ function parseAssignmentTarget(options) {
5397
+ const agent = options.agent?.trim();
5398
+ const workflow = options.workflow?.trim();
5399
+ if (agent && workflow) throw new Error("Exactly one of --agent or --workflow is required");
5400
+ if (agent) return {
5401
+ targetType: "agent",
5402
+ targetKey: agent
5403
+ };
5404
+ if (workflow) return {
5405
+ targetType: "workflow",
5406
+ targetKey: workflow
5407
+ };
5408
+ throw new Error("Exactly one of --agent or --workflow is required");
5409
+ }
5410
+ //#endregion
5411
+ //#region src/commands/credentials/assignments/assign.ts
5412
+ function registerCredentialsAssignmentsAssignCommand(assignments) {
5413
+ assignments.command("assign").description("Assign a credential instance to a workflow step or agent tool").option("--agent <key>", "Agent slug").option("--workflow <key>", "Workflow slug").requiredOption("--credential <slug>", "Credential instance slug (e.g. work, org/work, linear/work)").option("--consumer <id>", "Consumer id (step correlation id or tool slug); omit for wildcard (*)").addHelpText("after", `
5414
+ Examples:
5415
+ ${cliBinaryName()} credentials assignments assign --workflow sync --credential work
5416
+ ${cliBinaryName()} credentials assignments assign --workflow sync --credential org/work --consumer step:fetch-gmail#0
5417
+ ${cliBinaryName()} credentials assignments assign --agent support --credential vault-prod --consumer vault-lookup
5418
+ ${cliBinaryName()} credentials assignments assign --agent pm --credential linear/work
5419
+ `).action((options) => runProjectCliCommand("Assign credential failed", async ({ client }) => {
5420
+ const target = parseAssignmentTarget(options);
5421
+ const assignment = await client.credentials.assignCredential({
5422
+ targetType: target.targetType,
5423
+ targetKey: target.targetKey,
5424
+ credential: options.credential,
5425
+ ...options.consumer ? { consumerId: options.consumer } : {}
5426
+ });
5427
+ process.stdout.write(`${JSON.stringify(assignment, null, 2)}\n`);
5428
+ }));
5429
+ }
5430
+ //#endregion
5431
+ //#region src/commands/credentials/assignments/list.ts
5432
+ function registerCredentialsAssignmentsListCommand(assignments) {
5433
+ assignments.command("list").description("List credential assignments for a workflow or agent").option("--agent <key>", "Agent slug").option("--workflow <key>", "Workflow slug").action((options) => runProjectCliCommand("List credential assignments failed", async ({ client }) => {
5434
+ const target = parseAssignmentTarget(options);
5435
+ const result = await client.credentials.listAssignments({
5436
+ targetType: target.targetType,
5437
+ targetKey: target.targetKey
5438
+ });
5439
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
5440
+ }));
5441
+ }
5442
+ //#endregion
5443
+ //#region src/commands/credentials/assignments/unassign.ts
5444
+ function registerCredentialsAssignmentsUnassignCommand(assignments) {
5445
+ assignments.command("unassign").description("Remove a credential assignment by id").argument("<id>", "Credential assignment id").action((id) => runProjectCliCommand("Unassign credential failed", async ({ client }) => {
5446
+ await client.credentials.unassignCredential(id);
5447
+ }));
5448
+ }
5449
+ //#endregion
5450
+ //#region src/commands/credentials/assignments/index.ts
5451
+ function registerCredentialsAssignmentsCommands(credentials) {
5452
+ const assignments = credentials.command("assignments").description("Assign credential instances to workflow steps or agent tools");
5453
+ registerCredentialsAssignmentsListCommand(assignments);
5454
+ registerCredentialsAssignmentsAssignCommand(assignments);
5455
+ registerCredentialsAssignmentsUnassignCommand(assignments);
5456
+ }
5457
+ //#endregion
5458
+ //#region src/commands/credentials/consumers/list.ts
5459
+ function registerCredentialsConsumersListCommand(consumers) {
5460
+ consumers.command("list").description("List bindable consumers for a workflow or agent").option("--agent <key>", "Agent slug").option("--workflow <key>", "Workflow slug").addHelpText("after", `
5461
+ Workflow consumers come from recent step_completed events (e.g. step:fetch-gmail#0).
5462
+ Agent consumers include known tool slugs when available, plus any from existing assignments.
5463
+ Use consumer id "*" (wildcard) or omit --consumer on assignments assign to bind all consumers.
5464
+ `).action((options) => runProjectCliCommand("List credential consumers failed", async ({ client }) => {
5465
+ const target = parseAssignmentTarget(options);
5466
+ const result = await client.credentials.listConsumers({
5467
+ targetType: target.targetType,
5468
+ targetKey: target.targetKey
5469
+ });
5470
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
5471
+ }));
5472
+ }
5473
+ //#endregion
5474
+ //#region src/commands/credentials/consumers/index.ts
5475
+ function registerCredentialsConsumersCommands(credentials) {
5476
+ registerCredentialsConsumersListCommand(credentials.command("consumers").description("Discover workflow step and agent tool consumer ids for assignment"));
5477
+ }
5478
+ //#endregion
5347
5479
  //#region src/commands/credentials/target-options.ts
5348
5480
  function resolveCredentialsTargetOptions(options = {}) {
5349
5481
  if (options.scopeType === "project") return {
@@ -5420,13 +5552,13 @@ function buildPlatformUpdatePatch(args) {
5420
5552
  //#endregion
5421
5553
  //#region src/commands/credentials/delete.ts
5422
5554
  function registerCredentialsDeleteCommand(credentials) {
5423
- credentials.command("delete").description("Delete a credential instance").argument("<id>", "Credential instance id").action((id) => runCredentialsCommand("Delete credential failed", async ({ platform, local }) => {
5555
+ credentials.command("delete").description("Delete a credential instance").argument("<ref>", "Credential slug or id").action((ref) => runCredentialsCommand("Delete credential failed", async ({ platform, local }) => {
5424
5556
  if (local) {
5425
5557
  const { client } = await createLocalCredentialsClient();
5426
- await client.credentials.deleteInstance(id);
5558
+ await client.credentials.deleteInstance(ref);
5427
5559
  return;
5428
5560
  }
5429
- await platform.credentials.delete(id);
5561
+ await platform.credentials.delete(ref);
5430
5562
  }));
5431
5563
  }
5432
5564
  //#endregion
@@ -5556,8 +5688,7 @@ function collectSetValues$2(value, previous) {
5556
5688
  //#region src/commands/credentials/format-set-conflict-error.ts
5557
5689
  function describeInstance(instance) {
5558
5690
  const defaultStatus = instance.isDefault ? "default" : "not default";
5559
- const labelStatus = instance.label ? `label: ${instance.label}` : "no label";
5560
- return `id: ${instance.id}, ${defaultStatus}, ${labelStatus}`;
5691
+ return `${instance.name ? `name: ${instance.name}` : `slug: ${instance.slug}`}, ${defaultStatus}`;
5561
5692
  }
5562
5693
  function formatSetFields(setFields) {
5563
5694
  return setFields.map((field) => `--set ${field}`).join(" ");
@@ -5566,10 +5697,10 @@ function formatSetConflictError(args) {
5566
5697
  const binary = cliBinaryName();
5567
5698
  const setArgs = formatSetFields(args.setFields);
5568
5699
  const listCmd = `${binary} credentials list --key ${args.key}`;
5569
- const addSecondCmd = `${binary} credentials set ${args.key} --scope ${args.scope} --label <name> ${setArgs}`;
5700
+ const addSecondCmd = `${binary} credentials set ${args.key} --scope ${args.scope} --slug <slug> ${setArgs}`;
5570
5701
  if (args.matching.length === 1) {
5571
5702
  const instance = args.matching[0];
5572
- const updateCmd = `${binary} credentials update ${instance.id} ${setArgs}`;
5703
+ const updateCmd = `${binary} credentials update ${instance.slug} ${setArgs}`;
5573
5704
  return [
5574
5705
  `An ${args.key} credential already exists in ${args.scope} scope (${describeInstance(instance)}).`,
5575
5706
  "credentials set creates a new instance — it does not update an existing one.",
@@ -5582,7 +5713,7 @@ function formatSetConflictError(args) {
5582
5713
  }
5583
5714
  const instanceLines = args.matching.map((instance) => ` • ${describeInstance(instance)}`);
5584
5715
  return [
5585
- `Multiple ${args.key} credentials already exist in ${args.scope} scope. --label is required to add another:`,
5716
+ `Multiple ${args.key} credentials already exist in ${args.scope} scope. Pass --slug to add another:`,
5586
5717
  ...instanceLines,
5587
5718
  "To add another credential in the same scope:",
5588
5719
  ` ${addSecondCmd}`,
@@ -5590,7 +5721,7 @@ function formatSetConflictError(args) {
5590
5721
  ].join("\n");
5591
5722
  }
5592
5723
  async function assertNoSetConflict(client, args) {
5593
- if (args.label) return;
5724
+ if (args.slug) return;
5594
5725
  const { instances } = await client.credentials.listInstances({ key: args.key });
5595
5726
  const matching = instances.filter((instance) => instance.scopeType === args.scopeType && (args.scopeType !== "project" || instance.scopeId === args.projectId));
5596
5727
  if (matching.length === 0) return;
@@ -5626,7 +5757,7 @@ function parseCredentialSetScopes(scopes, projectSlugs) {
5626
5757
  //#endregion
5627
5758
  //#region src/commands/credentials/set.ts
5628
5759
  function registerCredentialsSetCommand(credentials) {
5629
- credentials.command("set").description("Create a new api_key credential instance").argument("<key>", "Credential key or app id, e.g. exa").option("--scope <scope>", "org, user, or project (repeatable)", collectValues, []).option("--project-slug <slug>", "Project slug when scope includes project (repeatable)", collectValues, []).option("--label <label>", "Human-readable label within the scope").option("--default", "Mark as default for this scope").option("--set <field>", "Credential field as key=value or key=@env:VAR (falls back to project .env when unset in shell)", collectSetValues$1, []).action((key, options) => runCredentialsCommand("Set credential failed", async ({ platform, local }) => {
5760
+ credentials.command("set").description("Create a new api_key credential instance").argument("<key>", "Credential key or app id, e.g. exa").option("--scope <scope>", "org, user, or project (repeatable)", collectValues, []).option("--project-slug <slug>", "Project slug when scope includes project (repeatable)", collectValues, []).option("--slug <slug>", "Friendly credential slug within the scope").option("--name <name>", "Display name (used to derive slug when --slug is omitted)").option("--label <label>", "Alias for --name").option("--default", "Mark as default for this scope").option("--set <field>", "Credential field as key=value or key=@env:VAR (falls back to project .env when unset in shell)", collectSetValues$1, []).action((key, options) => runCredentialsCommand("Set credential failed", async ({ platform, local }) => {
5630
5761
  const value = parseCredentialValueFields(options.set);
5631
5762
  const parsedScopes = parseCredentialSetScopes(options.scope, options.projectSlug);
5632
5763
  if (local) {
@@ -5634,19 +5765,21 @@ function registerCredentialsSetCommand(credentials) {
5634
5765
  const targets = expandLocalCredentialTargets(parsedScopes);
5635
5766
  const instances = [];
5636
5767
  for (const target of targets) {
5768
+ const displayName = options.name ?? options.label;
5637
5769
  await assertNoSetConflict(client, {
5638
5770
  key,
5639
5771
  scope: target.scope,
5640
5772
  scopeType: target.scopeType,
5641
5773
  projectId: target.projectSlug,
5642
- label: options.label,
5774
+ slug: options.slug,
5643
5775
  setFields: options.set
5644
5776
  });
5645
5777
  instances.push(await client.credentials.createInstance({
5646
5778
  key,
5647
5779
  scopeType: target.scopeType,
5648
5780
  scopeId: target.projectSlug,
5649
- label: options.label,
5781
+ ...options.slug !== void 0 ? { slug: options.slug } : {},
5782
+ ...displayName !== void 0 ? { name: displayName } : {},
5650
5783
  isDefault: options.default,
5651
5784
  value
5652
5785
  }));
@@ -5702,12 +5835,14 @@ function expandLocalCredentialTargets(targets) {
5702
5835
  //#endregion
5703
5836
  //#region src/commands/credentials/update.ts
5704
5837
  function registerCredentialsUpdateCommand(credentials) {
5705
- credentials.command("update").description("Update a credential instance").argument("<id>", "Credential instance id").option("--label <label>", "Human-readable label within the scope").option("--default", "Mark as default for this scope").option("--set <field>", "Credential field as key=value or key=@env:VAR", collectSetValues, []).action((id, options) => runCredentialsCommand("Update credential failed", async ({ platform, local }) => {
5838
+ credentials.command("update").description("Update a credential instance").argument("<ref>", "Credential slug or id").option("--slug <slug>", "Update friendly slug").option("--name <name>", "Update display name").option("--label <label>", "Alias for --name").option("--default", "Mark as default for this scope").option("--set <field>", "Credential field as key=value or key=@env:VAR", collectSetValues, []).action((ref, options) => runCredentialsCommand("Update credential failed", async ({ platform, local }) => {
5706
5839
  const value = options.set.length > 0 ? parseCredentialValueFields(options.set) : void 0;
5840
+ const displayName = options.name ?? options.label;
5707
5841
  if (local) {
5708
5842
  const { client } = await createLocalCredentialsClient();
5709
- const result = await client.credentials.updateInstance(id, {
5710
- ...options.label !== void 0 ? { label: options.label } : {},
5843
+ const result = await client.credentials.updateInstance(ref, {
5844
+ ...options.slug !== void 0 ? { slug: options.slug } : {},
5845
+ ...displayName !== void 0 ? { name: displayName } : {},
5711
5846
  ...options.default !== void 0 ? { isDefault: options.default } : {},
5712
5847
  ...value ? { value } : {}
5713
5848
  });
@@ -5715,11 +5850,11 @@ function registerCredentialsUpdateCommand(credentials) {
5715
5850
  return;
5716
5851
  }
5717
5852
  const patch = buildPlatformUpdatePatch({
5718
- ...options.label !== void 0 ? { label: options.label } : {},
5853
+ ...displayName !== void 0 ? { label: displayName } : {},
5719
5854
  ...options.default !== void 0 ? { isDefault: options.default } : {},
5720
5855
  ...value ? { value } : {}
5721
5856
  });
5722
- const credential = await platform.credentials.update(id, patch);
5857
+ const credential = await platform.credentials.update(ref, patch);
5723
5858
  process.stdout.write(`${JSON.stringify({ credential }, null, 2)}\n`);
5724
5859
  }));
5725
5860
  }
@@ -5736,6 +5871,8 @@ function registerCredentialsCommand(program) {
5736
5871
  registerCredentialsUpdateCommand(credentials);
5737
5872
  registerCredentialsRotateKeyCommand(credentials);
5738
5873
  registerCredentialsDeleteCommand(credentials);
5874
+ registerCredentialsAssignmentsCommands(credentials);
5875
+ registerCredentialsConsumersCommands(credentials);
5739
5876
  }
5740
5877
  //#endregion
5741
5878
  //#region src/auth/resolve-login-targets.ts
@@ -5847,7 +5984,7 @@ function registerBuildCommand(program) {
5847
5984
  program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
5848
5985
  try {
5849
5986
  const root = resolveProjectRoot(options.dir);
5850
- const { buildApp } = await import("./dist-Dq8E-oHm.mjs");
5987
+ const { buildApp } = await import("./dist-D3CcImHe.mjs");
5851
5988
  await buildApp({ root });
5852
5989
  process.stdout.write(`Built ${root}\n`);
5853
5990
  } catch (error) {
@@ -6004,7 +6141,7 @@ async function sleep(ms) {
6004
6141
  }
6005
6142
  async function buildDeployArchive(client, root, projectId, filter) {
6006
6143
  if (filter?.length) {
6007
- const { buildFilteredApp } = await import("./dist-Dq8E-oHm.mjs");
6144
+ const { buildFilteredApp } = await import("./dist-D3CcImHe.mjs");
6008
6145
  const filtered = await buildFilteredApp({
6009
6146
  root,
6010
6147
  filter,
@@ -6026,7 +6163,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
6026
6163
  sourceFiles: filtered.sourceFiles
6027
6164
  };
6028
6165
  }
6029
- const { buildApp } = await import("./dist-Dq8E-oHm.mjs");
6166
+ const { buildApp } = await import("./dist-D3CcImHe.mjs");
6030
6167
  const { sourceFiles } = await buildApp({
6031
6168
  root,
6032
6169
  collectSources: true,
@@ -6138,7 +6275,7 @@ function runtimeChildEnv(parentEnv, overrides) {
6138
6275
  //#region src/project/bootstrap-run.ts
6139
6276
  /** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
6140
6277
  async function resolveBootstrapRun(options) {
6141
- const { resolveRuntimeBuildArtifact } = await import("./dist-Dq8E-oHm.mjs");
6278
+ const { resolveRuntimeBuildArtifact } = await import("./dist-D3CcImHe.mjs");
6142
6279
  const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
6143
6280
  const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/standalone-bootstrap.mjs");
6144
6281
  const args = [`--import=${loader}`];
@@ -6288,7 +6425,7 @@ async function runDev(options) {
6288
6425
  process.on("SIGINT", shutdown);
6289
6426
  process.on("SIGTERM", shutdown);
6290
6427
  try {
6291
- const { watchApp } = await import("./dist-Dq8E-oHm.mjs");
6428
+ const { watchApp } = await import("./dist-D3CcImHe.mjs");
6292
6429
  await watchApp({
6293
6430
  root,
6294
6431
  clean: false,
@@ -7114,7 +7251,7 @@ async function runStart(options) {
7114
7251
  const apiPort = Number(new URL(serverUrl).port || 80);
7115
7252
  const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
7116
7253
  ensureNativeDeps(runtimeNodeModules);
7117
- const { buildApp } = await import("./dist-Dq8E-oHm.mjs");
7254
+ const { buildApp } = await import("./dist-D3CcImHe.mjs");
7118
7255
  await buildApp({
7119
7256
  root,
7120
7257
  clean: false
@@ -7637,7 +7774,7 @@ function createProgram() {
7637
7774
  return program;
7638
7775
  }
7639
7776
  async function runCli(argv) {
7640
- const { maybeAutoUpdate } = await import("./maybe-auto-update-BO0T4n4K.mjs");
7777
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-Cir__-VX.mjs");
7641
7778
  await maybeAutoUpdate(argv);
7642
7779
  createProgram().parse(argv);
7643
7780
  }