@keystrokehq/cli 0.1.151 → 0.1.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{dist-CtEL33PB.mjs → dist-B-JAtmwj.mjs} +2 -2
- package/dist/{dist-CtEL33PB.mjs.map → dist-B-JAtmwj.mjs.map} +1 -1
- package/dist/{dist-DG8fjuMY.mjs → dist-B9mGozH5.mjs} +4 -4
- package/dist/{dist-DG8fjuMY.mjs.map → dist-B9mGozH5.mjs.map} +1 -1
- package/dist/dist-Bi2mo88o.mjs +3 -0
- package/dist/{dist-C6adeAws.mjs → dist-DFHP_wlQ.mjs} +2 -1
- package/dist/{dist-C6adeAws.mjs.map → dist-DFHP_wlQ.mjs.map} +1 -1
- package/dist/dist-jssdiDkg.mjs +4 -0
- package/dist/index.mjs +1 -1
- package/dist/{maybe-auto-update-dzy8lzxn.mjs → maybe-auto-update-DHweUGnX.mjs} +2 -2
- package/dist/{maybe-auto-update-dzy8lzxn.mjs.map → maybe-auto-update-DHweUGnX.mjs.map} +1 -1
- package/dist/{program-Bv7Wv_O4.mjs → program-BSoShr2M.mjs} +7 -7
- package/dist/{program-Bv7Wv_O4.mjs.map → program-BSoShr2M.mjs.map} +1 -1
- package/dist/{run-package-manager-update-C4uA6xWB.mjs → run-package-manager-update-BzJQZYt9.mjs} +2 -2
- package/dist/{run-package-manager-update-C4uA6xWB.mjs.map → run-package-manager-update-BzJQZYt9.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-CSUmvad5.mjs +0 -3
- package/dist/dist-CYcxzKHH.mjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-DG8fjuMY.mjs","names":["toPosix"],"sources":["../../../packages/build/dist/walk-project-CLy8GqGX.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 { PROJECT_SOURCE_IGNORED_DIRS, PROJECT_SOURCE_MAX_FILES, PROJECT_SOURCE_MAX_FILE_BYTES, PROJECT_SOURCE_MAX_TOTAL_BYTES, isIgnoredProjectSourceFileName, isProbablyBinaryProjectSource } from \"@keystrokehq/shared\";\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 MAX_FILE_BYTES = PROJECT_SOURCE_MAX_FILE_BYTES;\nconst MAX_TOTAL_BYTES = PROJECT_SOURCE_MAX_TOTAL_BYTES;\nconst MAX_FILES = PROJECT_SOURCE_MAX_FILES;\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\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\tconst actionsPrefix = `${toPosix(relative(root, join(srcRoot, \"actions\")))}/`;\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(actionsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"actions\"), filePath, { nestedEntry: \"action\" });\n\t\treturn id ? {\n\t\t\tentryKey: `actions/${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 >= MAX_FILES || totals.bytes >= MAX_TOTAL_BYTES)) return;\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (PROJECT_SOURCE_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 > MAX_FILE_BYTES || isIgnoredProjectSourceFileName(name)) continue;\n\t\tconst buffer = readFileSync(absolute);\n\t\tif (isProbablyBinaryProjectSource(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, normalizeBuildFilePath as r, walkProject as t };\n\n//# sourceMappingURL=walk-project-CLy8GqGX.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 \"telemetry\",\n \"tracing\",\n \"trigger\",\n \"tsdown-config\",\n \"web-search\",\n \"worker\",\n \"workflow\",\n \"workflow-canvas\",\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/**\n * Kept external so .d.ts emission does not inline internal/inferred types.\n *\n * `typescript` is external because the TS compiler cannot be cleanly bundled into\n * ESM — it mixes `require()`/`__filename` with top-level await, which Node rejects\n * with `ERR_AMBIGUOUS_MODULE_SYNTAX` on load. Packages that use the compiler\n * (`workflow-canvas`, `manifest`, `build`) declare it as a dependency, so it\n * resolves from `node_modules` at runtime instead of being inlined.\n */\nexport const LIBRARY_EXTERNAL_DEPS = [\n \"better-auth\",\n /^@better-auth\\//,\n /^better-auth\\//,\n \"typescript\",\n];\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\n/** Zod ships in the project-runtime image; keep one copy out of user-app artifacts. */\nexport function isRuntimeSharedNpmDep(id) {\n const name = packageName(id);\n return name === \"zod\";\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (isRuntimeSharedNpmDep(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/*, zod, 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: [\n ...NATIVE_RUNTIME_DEPS,\n FRAMEWORK_KEYSTROKE_EXTERNAL,\n /^zod(?:\\/|$)/,\n ...LIBRARY_EXTERNAL_DEPS,\n ],\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 *\n * `@keystrokehq/keystroke` uses workspace:>=0.0.0 ranges so private primitive\n * patches do not cascade-publish the facade; CLI/platform keep workspace:*.\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/**\n * Natives the published CLI must not leave as bare imports. The CLI no longer ships a\n * local SQLite server; auth/build still pull platform-database which references\n * better-sqlite3 — stub those modules at bundle time instead of externalizing them.\n */\nexport const CLI_STUBBED_NATIVE_DEPS = [\"better-sqlite3\", \"@parcel/watcher\"];\n\n/** CLI: inline better-auth/client; keep server adapters external. */\nexport function cliBundledEntryDepsConfig() {\n const neverBundleNatives = BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS.filter(\n (dep) => typeof dep !== \"string\" || !CLI_STUBBED_NATIVE_DEPS.includes(dep),\n );\n // platform-database (pulled via auth) needs drizzle inlined; do not leave it external.\n const neverBundleAuth = BETTER_AUTH_CLI_EXTERNAL_PATTERNS.filter((dep) => dep !== \"drizzle-orm\");\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...neverBundleNatives,\n ...neverBundleAuth,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n // The TS compiler cannot be inlined into ESM (`require`/`__filename` + top-level\n // await → `__filename is not defined` / `ERR_AMBIGUOUS_MODULE_SYNTAX` on load).\n // The CLI inlines the @keystrokehq/* packages that use it (build, manifest,\n // workflow-canvas), so `typescript` must resolve from the CLI's own node_modules —\n // hence it is also a runtime dependency of @keystrokehq/cli.\n \"typescript\",\n ],\n onlyBundle: false,\n };\n}\n\n/** Rolldown plugin: replace CLI-stubbed natives with throw-on-use shims. */\nexport function cliStubNativeDepsPlugin() {\n const stubPrefix = \"\\0cli-stub-native:\";\n return {\n name: \"cli-stub-native-deps\",\n resolveId(id) {\n const name = CLI_STUBBED_NATIVE_DEPS.find((dep) => id === dep || id.startsWith(`${dep}/`));\n if (!name) {\n return null;\n }\n return `${stubPrefix}${id}`;\n },\n load(id) {\n if (!id.startsWith(stubPrefix)) {\n return null;\n }\n const spec = id.slice(stubPrefix.length);\n const message = JSON.stringify(`${spec} is not available in the Keystroke CLI`);\n return `function unavailable() {\\n throw new Error(${message});\\n}\\nexport default new Proxy(unavailable, { get: () => unavailable });\\nexport const subscribe = unavailable;\\n`;\n },\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n cliStubNativeDepsPlugin,\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, r as normalizeBuildFilePath, t as walkProject } from \"./walk-project-CLy8GqGX.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { createRequire } from \"node:module\";\nimport { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, relative, sep } from \"node:path\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\nimport { createHash } from \"node:crypto\";\nimport { PROJECT_MANIFEST_REL_PATH } from \"@keystrokehq/shared\";\nimport { fileURLToPath } from \"node:url\";\nimport { classifyCall, computeCallSiteIds, diagnoseWorkflowSource, locateWorkflow } from \"@keystrokehq/workflow-canvas\";\nimport ts from \"typescript\";\nimport { packAssetDirs, packDirFromDisk } from \"@keystrokehq/sandbox/files\";\nimport { RUNTIME_KEYSTROKE_PACKAGES } from \"@keystrokehq/tsdown-config/deps\";\nimport { buildStoredRouteManifestForProject, persistModularRouteManifest, readRouteManifest } from \"@keystrokehq/manifest\";\nimport { tmpdir } from \"node:os\";\nimport { extractProjectArtifact, mergeStoredRouteManifest, packDistTree } from \"@keystrokehq/storage\";\n//#region src/inject-call-site-ids.ts\n/**\n* Build-time injection of the deterministic structural `callSiteId` into every\n* durable step call in a workflow source file, so the runtime emits\n* `step:<callSiteId>#<occurrence>` correlation ids (and `step:<callSiteId>`\n* credential consumer ids) that line up 1:1 with the canvas graph nodes the\n* deploy-time producer mints from the same source. There is no user-authored\n* step id — identity is entirely internal and injected here.\n*\n* Injection shape by kind (the `callSiteId` is the same id `computeCallSiteIds`\n* returns, which equals the producer's step-node id):\n* - action/sub-workflow `x.run(i)` → `x.run(i).__site(\"<id>\")` (builder method)\n* - agent `a.prompt(i, opts?)` → `__site` merged into the prompt options\n* - llm `promptLlm(i, opts?)` → `__site` merged into the options\n* - hook `ctx.hook(opts?)` → `__site` merged into the options\n* - sleep `ctx.sleep(d, opts?)` → `__site` merged into a second options arg\n*/\nfunction injectCallSiteIds(code, fileName) {\n\tconst sourceFile = ts.createSourceFile(fileName, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n\tconst located = locateWorkflow(sourceFile);\n\tif (!located) return code;\n\tconst ids = computeCallSiteIds(sourceFile);\n\tif (ids.size === 0) return code;\n\tconst edits = [];\n\tfor (const [node, id] of ids) {\n\t\tconst info = classifyCall(node, located.ctxParamName);\n\t\tif (!info) continue;\n\t\tif (info.callKind === \"workflow-step\") {\n\t\t\tedits.push({\n\t\t\t\tpos: node.getEnd(),\n\t\t\t\ttext: `.__site(${JSON.stringify(id)})`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"agent\" || info.callKind === \"llm\") {\n\t\t\tpushOptionsEdit(edits, node, id);\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"hook\") {\n\t\t\tpushHookOptionsEdit(edits, node, id);\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"wait\") pushSleepOptionsEdit(edits, node, id);\n\t}\n\tif (edits.length === 0) return code;\n\tedits.sort((a, b) => b.pos - a.pos);\n\tlet out = code;\n\tfor (const edit of edits) out = out.slice(0, edit.pos) + edit.text + out.slice(edit.pos);\n\treturn out;\n}\n/**\n* Merge `__site: \"<id>\"` into a call's options argument (agents / promptLlm).\n* - no 2nd arg → append `, { __site: \"id\" }`\n* - 2nd arg object literal → insert `__site: \"id\", ` after its `{`\n* - 2nd arg anything else → wrap as `{ ...orig, __site: \"id\" }`\n*/\nfunction pushOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst optionsArg = call.arguments[1];\n\tif (!optionsArg) {\n\t\tconst firstArg = call.arguments[0];\n\t\tconst insertAt = firstArg ? firstArg.getEnd() : call.getEnd() - 1;\n\t\tedits.push({\n\t\t\tpos: insertAt,\n\t\t\ttext: `, { __site: ${literal} }`\n\t\t});\n\t\treturn;\n\t}\n\tif (ts.isObjectLiteralExpression(optionsArg)) {\n\t\tedits.push({\n\t\t\tpos: optionsArg.getStart() + 1,\n\t\t\ttext: ` __site: ${literal},`\n\t\t});\n\t\treturn;\n\t}\n\tedits.push({\n\t\tpos: optionsArg.getStart(),\n\t\ttext: \"{ ...\"\n\t});\n\tedits.push({\n\t\tpos: optionsArg.getEnd(),\n\t\ttext: `, __site: ${literal} }`\n\t});\n}\n/** Merge `__site` into `ctx.hook(opts?)` — options are the first (only) argument. */\nfunction pushHookOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst optionsArg = call.arguments[0];\n\tif (!optionsArg) {\n\t\tedits.push({\n\t\t\tpos: call.getEnd() - 1,\n\t\t\ttext: `{ __site: ${literal} }`\n\t\t});\n\t\treturn;\n\t}\n\tif (ts.isObjectLiteralExpression(optionsArg)) {\n\t\tedits.push({\n\t\t\tpos: optionsArg.getStart() + 1,\n\t\t\ttext: ` __site: ${literal},`\n\t\t});\n\t\treturn;\n\t}\n\tedits.push({\n\t\tpos: optionsArg.getStart(),\n\t\ttext: \"{ ...\"\n\t});\n\tedits.push({\n\t\tpos: optionsArg.getEnd(),\n\t\ttext: `, __site: ${literal} }`\n\t});\n}\n/** Append `{ __site }` as the second arg to `ctx.sleep(duration)`. */\nfunction pushSleepOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst durationArg = call.arguments[0];\n\tconst insertAt = durationArg ? durationArg.getEnd() : call.getEnd() - 1;\n\tedits.push({\n\t\tpos: insertAt,\n\t\ttext: `, { __site: ${literal} }`\n\t});\n}\nfunction toPosix$5(path) {\n\treturn path.split(sep).join(\"/\");\n}\n/**\n* Rolldown plugin that runs {@link injectCallSiteIds} over workflow source files\n* (and their same-file helpers) before transpile. Scoped to `src/workflows/` so\n* non-workflow modules are untouched; cross-file helpers stay unkeyed by design.\n*/\nfunction callSiteIdInjectionPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst workflowsPrefix = toPosix$5(`${options.root}/${srcDir}/workflows/`);\n\treturn {\n\t\tname: \"keystroke-call-site-ids\",\n\t\ttransform(code, id) {\n\t\t\tconst normalized = toPosix$5(id);\n\t\t\tif (!normalized.startsWith(workflowsPrefix) || !normalized.endsWith(\".ts\")) return null;\n\t\t\tconst transformed = injectCallSiteIds(code, normalized);\n\t\t\treturn transformed === code ? null : {\n\t\t\t\tcode: transformed,\n\t\t\t\tmap: null\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\n//#region src/workflow-diagnostics.ts\nconst TEST_FILE = /\\.(test|int\\.test|spec)\\.ts$/;\nfunction toPosix$4(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction collectTsFiles(dir, out) {\n\tlet entries;\n\ttry {\n\t\tentries = readdirSync(dir);\n\t} catch {\n\t\treturn;\n\t}\n\tfor (const entry of entries) {\n\t\tif (entry === \"node_modules\" || entry.startsWith(\".\")) continue;\n\t\tconst full = join(dir, entry);\n\t\tif (statSync(full).isDirectory()) {\n\t\t\tcollectTsFiles(full, out);\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.endsWith(\".ts\") && !TEST_FILE.test(entry)) out.push(full);\n\t}\n}\n/**\n* Run the workflow-canvas reliability checks over every `src/**` module. Errors\n* (steps outside a workflow, steps nested as call arguments) block the build;\n* warnings (opaque code-blocks, dropped spread inputs) explain each degraded\n* construct. Best-effort per-file: an unparseable file is skipped, never fatal.\n*/\nfunction collectWorkflowDiagnostics(root, srcDir = \"src\") {\n\tconst srcRoot = join(root, srcDir);\n\tif (!existsSync(srcRoot)) return [];\n\tconst files = [];\n\tcollectTsFiles(srcRoot, files);\n\tconst diagnostics = [];\n\tfor (const file of files) {\n\t\tconst rel = toPosix$4(relative(root, file));\n\t\ttry {\n\t\t\tconst source = readFileSync(file, \"utf8\");\n\t\t\tdiagnostics.push(...diagnoseWorkflowSource(source, rel));\n\t\t} catch {}\n\t}\n\treturn diagnostics;\n}\nfunction formatDiagnostic(diagnostic) {\n\treturn ` ${diagnostic.line !== void 0 ? `${diagnostic.fileName}:${diagnostic.line}:${diagnostic.column ?? 1}` : diagnostic.fileName}\\n ${diagnostic.message}`;\n}\n/** Throw when any blocking (error-severity) diagnostic is found. */\nfunction assertWorkflowDiagnosticErrorsFrom(diagnostics) {\n\tconst errors = diagnostics.filter((d) => d.severity === \"error\");\n\tif (errors.length > 0) throw new Error(`Workflow canvas: ${errors.length} unsupported construct(s) must be fixed before deploy:\\n${errors.map(formatDiagnostic).join(\"\\n\")}\\n`);\n}\n/** Print soft (warning-severity) diagnostics after a successful build. */\nfunction warnWorkflowDiagnosticsFrom(diagnostics) {\n\tconst warnings = diagnostics.filter((d) => d.severity === \"warning\");\n\tif (warnings.length > 0) console.warn(`\\n⚠ Workflow canvas: ${warnings.length} construct(s) will render as a degraded (opaque) canvas:\\n${warnings.map(formatDiagnostic).join(\"\\n\")}\\n`);\n}\n/** Throw when any blocking (error-severity) diagnostic is found. Run before building. */\nfunction assertWorkflowDiagnosticErrors(root, srcDir = \"src\") {\n\tassertWorkflowDiagnosticErrorsFrom(collectWorkflowDiagnostics(root, srcDir));\n}\n/** Print soft (warning-severity) diagnostics after a successful build. */\nfunction warnWorkflowDiagnostics(root, srcDir = \"src\") {\n\twarnWorkflowDiagnosticsFrom(collectWorkflowDiagnostics(root, srcDir));\n}\n/**\n* Collect diagnostics, print warnings, and throw a formatted error when any\n* blocking (error-severity) diagnostic is found.\n*\n* @deprecated Prefer {@link assertWorkflowDiagnosticErrors} before build and\n* {@link warnWorkflowDiagnostics} after build so warnings appear below build logs.\n*/\nfunction assertWorkflowDiagnostics(root, srcDir = \"src\") {\n\tconst diagnostics = collectWorkflowDiagnostics(root, srcDir);\n\tassertWorkflowDiagnosticErrorsFrom(diagnostics);\n\twarnWorkflowDiagnosticsFrom(diagnostics);\n}\n//#endregion\n//#region src/route-manifest-cache.ts\nconst CACHE_DIR = \".keystroke/cache\";\nconst CACHE_KEY_FILE = \"route-manifest.key\";\nconst CACHE_MANIFEST_DIR = \"manifest\";\nfunction cachePaths(projectRoot) {\n\tconst dir = join(projectRoot, CACHE_DIR);\n\treturn {\n\t\tkeyPath: join(dir, CACHE_KEY_FILE),\n\t\tmanifestDir: join(dir, CACHE_MANIFEST_DIR)\n\t};\n}\n/** Fingerprint of integration package versions resolved from the project. */\nfunction integrationPackagesFingerprint(projectRoot) {\n\tconst hash = createHash(\"sha256\");\n\tconst packageJsonPath = join(projectRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return hash.digest(\"hex\");\n\tconst raw = readFileSync(packageJsonPath, \"utf8\");\n\thash.update(raw);\n\tlet dependencies = {};\n\ttry {\n\t\tdependencies = JSON.parse(raw).dependencies ?? {};\n\t} catch {\n\t\treturn hash.digest(\"hex\");\n\t}\n\tconst require = createRequire(packageJsonPath);\n\tfor (const name of Object.keys(dependencies).sort()) {\n\t\tif (!name.startsWith(\"@keystrokehq/\")) continue;\n\t\ttry {\n\t\t\tconst resolved = require.resolve(`${name}/package.json`);\n\t\t\thash.update(name);\n\t\t\thash.update(\"\\0\");\n\t\t\thash.update(readFileSync(resolved, \"utf8\"));\n\t\t\thash.update(\"\\0\");\n\t\t} catch {\n\t\t\thash.update(name);\n\t\t\thash.update(\"\\0missing\\0\");\n\t\t}\n\t}\n\treturn hash.digest(\"hex\");\n}\n/**\n* Content-addressed key for the deploy route-manifest. Invalidates when project\n* sources, build entries, ignore set, phase, or integration package versions change.\n*/\nfunction computeRouteManifestCacheKey(input) {\n\tconst hash = createHash(\"sha256\");\n\thash.update(input.phase);\n\thash.update(\"\\0\");\n\thash.update(input.integrationFingerprint);\n\thash.update(\"\\0\");\n\tfor (const key of [...input.buildEntryKeys].sort()) {\n\t\thash.update(key);\n\t\thash.update(\"\\0\");\n\t}\n\tfor (const file of [...input.ignoredFiles].sort()) {\n\t\thash.update(file);\n\t\thash.update(\"\\0\");\n\t}\n\tfor (const file of [...input.sourceFiles].sort((a, b) => a.path.localeCompare(b.path))) {\n\t\thash.update(file.path);\n\t\thash.update(\"\\0\");\n\t\thash.update(file.hash);\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\n/** True when `.keystroke/cache/route-manifest.key` matches `cacheKey`. */\nfunction isRouteManifestCacheHit(projectRoot, cacheKey) {\n\tconst { keyPath, manifestDir } = cachePaths(projectRoot);\n\tif (!existsSync(keyPath) || !existsSync(join(manifestDir, \"manifest.json\"))) return false;\n\treturn readFileSync(keyPath, \"utf8\").trim() === cacheKey;\n}\n/** Restore cached modular manifest into `dist/.keystroke/` when the key matches. */\nfunction tryRestoreCachedRouteManifest(projectRoot, cacheKey) {\n\tif (!isRouteManifestCacheHit(projectRoot, cacheKey)) return false;\n\tconst { manifestDir } = cachePaths(projectRoot);\n\tconst dest = join(projectRoot, \"dist\", \".keystroke\");\n\tmkdirSync(dest, { recursive: true });\n\tfor (const name of [\n\t\t\"manifest.json\",\n\t\t\"modules\",\n\t\t\"catalogs\",\n\t\t\"assets\",\n\t\t\"build-index.json\"\n\t]) {\n\t\tconst from = join(manifestDir, name);\n\t\tif (!existsSync(from)) continue;\n\t\tcpSync(from, join(dest, name), { recursive: true });\n\t}\n\tconst assetsModule = join(manifestDir, \"assets.mjs\");\n\tif (existsSync(assetsModule)) cpSync(assetsModule, join(dest, \"assets.mjs\"));\n\treturn existsSync(join(projectRoot, PROJECT_MANIFEST_REL_PATH));\n}\n/** Persist the just-emitted modular manifest into the deploy cache. */\nfunction storeCachedRouteManifest(projectRoot, cacheKey) {\n\tconst sourceMeta = join(projectRoot, \"dist\", \".keystroke\");\n\tif (!existsSync(join(sourceMeta, \"manifest.json\"))) return;\n\tconst { keyPath, manifestDir } = cachePaths(projectRoot);\n\trmSync(manifestDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tmkdirSync(manifestDir, { recursive: true });\n\tfor (const name of [\n\t\t\"manifest.json\",\n\t\t\"modules\",\n\t\t\"catalogs\",\n\t\t\"assets\",\n\t\t\"assets.mjs\",\n\t\t\"build-index.json\"\n\t]) {\n\t\tconst from = join(sourceMeta, name);\n\t\tif (!existsSync(from)) continue;\n\t\tcpSync(from, join(manifestDir, name), { recursive: true });\n\t}\n\tmkdirSync(dirname(keyPath), { recursive: true });\n\twriteFileSync(keyPath, `${cacheKey}\\n`);\n}\n//#endregion\n//#region src/dist-deploy-outputs.ts\n/**\n* True when a prior deploy `dist/` still has the compiled outputs for every\n* build entry (so we can skip tsdown when the content-hash cache hits).\n*/\nfunction distDeployOutputsPresent(projectRoot, buildEntries) {\n\tconst distRoot = join(projectRoot, \"dist\");\n\tif (!existsSync(distRoot)) return false;\n\tfor (const entryKey of Object.keys(buildEntries)) if (!existsSync(join(distRoot, entryKey === \"config\" ? \"config.mjs\" : `${entryKey}.mjs`))) return false;\n\tif (!existsSync(join(distRoot, \".keystroke\", \"assets.mjs\"))) return false;\n\treturn true;\n}\n//#endregion\n//#region src/modular-assets.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\n/** Content hash of every file under a skill/files pack directory. */\nfunction hashAssetPackDir(dirPath) {\n\tconst hash = createHash(\"sha256\");\n\tconst walk = (current) => {\n\t\tfor (const name of readdirSync(current).sort()) {\n\t\t\tif (SKIP_DIRS.has(name)) continue;\n\t\t\tconst abs = join(current, name);\n\t\t\tconst st = statSync(abs);\n\t\t\tif (st.isDirectory()) {\n\t\t\t\twalk(abs);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!st.isFile()) continue;\n\t\t\thash.update(relative(dirPath, abs).replace(/\\\\/g, \"/\"));\n\t\t\thash.update(\"\\0\");\n\t\t\thash.update(readFileSync(abs));\n\t\t\thash.update(\"\\0\");\n\t\t}\n\t};\n\tif (!statSync(dirPath, { throwIfNoEntry: false })?.isDirectory()) return hash.digest(\"hex\");\n\twalk(dirPath);\n\treturn hash.digest(\"hex\");\n}\nfunction listPackIds(rootPath) {\n\tif (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return [];\n\treturn readdirSync(rootPath).filter((name) => !SKIP_DIRS.has(name)).filter((name) => statSync(join(rootPath, name)).isDirectory()).sort();\n}\nfunction shardRelPath(kind, id) {\n\treturn `${kind}/${id}.json`;\n}\nfunction readIndex(assetsRoot) {\n\tconst path = join(assetsRoot, \"index.json\");\n\tif (!existsSync(path)) return;\n\ttry {\n\t\treturn JSON.parse(readFileSync(path, \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction loadShard(assetsRoot, rel) {\n\tconst abs = join(assetsRoot, rel);\n\tif (!existsSync(abs)) return;\n\ttry {\n\t\treturn JSON.parse(readFileSync(abs, \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction renderAssetModule$3(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\nfunction packKind(input) {\n\tconst kindRoot = join(input.projectRoot, input.srcDir, input.kind);\n\tconst prevById = new Map((input.kind === \"skills\" ? input.previous?.skills : input.previous?.files)?.map((ref) => [ref.id, ref]) ?? []);\n\tconst packs = {};\n\tconst refs = [];\n\tconst wrote = [];\n\tconst skipped = [];\n\tfor (const id of listPackIds(kindRoot)) {\n\t\tconst packDir = join(kindRoot, id);\n\t\tconst contentHash = hashAssetPackDir(packDir);\n\t\tconst path = shardRelPath(input.kind, id);\n\t\tconst existing = prevById.get(id)?.contentHash === contentHash ? loadShard(input.assetsRoot, path) : void 0;\n\t\tlet packed;\n\t\tif (existing) {\n\t\t\tpacked = existing;\n\t\t\tskipped.push(path);\n\t\t} else {\n\t\t\tpacked = packDirFromDisk(packDir);\n\t\t\tconst abs = join(input.assetsRoot, path);\n\t\t\tmkdirSync(dirname(abs), { recursive: true });\n\t\t\twriteFileSync(abs, `${JSON.stringify(packed)}\\n`);\n\t\t\twrote.push(path);\n\t\t}\n\t\tpacks[id] = packed;\n\t\trefs.push({\n\t\t\tid,\n\t\t\tpath,\n\t\t\tcontentHash\n\t\t});\n\t}\n\treturn {\n\t\tpacks,\n\t\trefs,\n\t\twrote,\n\t\tskipped\n\t};\n}\nfunction removeOrphanShards(assetsRoot, kind, keep) {\n\tconst kindDir = join(assetsRoot, kind);\n\tif (!existsSync(kindDir)) return;\n\tfor (const name of readdirSync(kindDir)) {\n\t\tif (!name.endsWith(\".json\")) continue;\n\t\tconst rel = `${kind}/${name}`;\n\t\tif (!keep.has(rel)) rmSync(join(kindDir, name), { force: true });\n\t}\n}\n/**\n* Pack `src/skills` + `src/files` into per-pack shards with content-hash skip.\n* Composes `dist/.keystroke/assets.mjs` only when at least one shard changed\n* (or the composed module is missing) so the runtime loader stays unchanged.\n*/\nfunction packModularProjectAssets(input) {\n\tconst srcDir = input.srcDir ?? \"src\";\n\tconst outDir = input.outDir ?? \"dist\";\n\tconst keystrokeDir = join(input.projectRoot, outDir, \".keystroke\");\n\tconst assetsRoot = join(keystrokeDir, \"assets\");\n\tmkdirSync(assetsRoot, { recursive: true });\n\tconst previous = readIndex(assetsRoot);\n\tconst skills = packKind({\n\t\tprojectRoot: input.projectRoot,\n\t\tsrcDir,\n\t\tkind: \"skills\",\n\t\tassetsRoot,\n\t\tprevious\n\t});\n\tconst files = packKind({\n\t\tprojectRoot: input.projectRoot,\n\t\tsrcDir,\n\t\tkind: \"files\",\n\t\tassetsRoot,\n\t\tprevious\n\t});\n\tremoveOrphanShards(assetsRoot, \"skills\", new Set(skills.refs.map((ref) => ref.path)));\n\tremoveOrphanShards(assetsRoot, \"files\", new Set(files.refs.map((ref) => ref.path)));\n\tconst index = {\n\t\tversion: 1,\n\t\tskills: skills.refs,\n\t\tfiles: files.refs\n\t};\n\twriteFileSync(join(assetsRoot, \"index.json\"), `${JSON.stringify(index)}\\n`);\n\tconst manifest = {\n\t\tskills: skills.packs,\n\t\tfiles: files.packs\n\t};\n\tconst assetsModulePath = join(keystrokeDir, \"assets.mjs\");\n\tconst wroteShards = [...skills.wrote, ...files.wrote];\n\tconst skippedShards = [...skills.skipped, ...files.skipped];\n\tconst prevSkillIds = (previous?.skills ?? []).map((r) => r.id).join(\"\\0\");\n\tconst nextSkillIds = skills.refs.map((r) => r.id).join(\"\\0\");\n\tconst prevFileIds = (previous?.files ?? []).map((r) => r.id).join(\"\\0\");\n\tconst nextFileIds = files.refs.map((r) => r.id).join(\"\\0\");\n\tconst membershipChanged = prevSkillIds !== nextSkillIds || prevFileIds !== nextFileIds;\n\tconst anyDirty = wroteShards.length > 0 || !existsSync(assetsModulePath) || membershipChanged;\n\tlet wroteAssetsModule = false;\n\tif (anyDirty) {\n\t\twriteFileSync(assetsModulePath, renderAssetModule$3(manifest));\n\t\twroteAssetsModule = true;\n\t}\n\treturn {\n\t\tmanifest,\n\t\tindex,\n\t\twroteShards,\n\t\tskippedShards,\n\t\twroteAssetsModule\n\t};\n}\n//#endregion\n//#region src/build-index.ts\n/** Relative path under project root. */\nconst BUILD_INDEX_REL_PATH = \"dist/.keystroke/build-index.json\";\nfunction toPosix$3(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction sha256Bytes(data) {\n\treturn createHash(\"sha256\").update(data).digest(\"hex\");\n}\nfunction compactJson(value) {\n\treturn `${JSON.stringify(value)}\\n`;\n}\n/** sha256 over sorted (path, file bytes) for project-relative inputs. */\nfunction hashSourceInputs(projectRoot, inputs) {\n\tconst hash = createHash(\"sha256\");\n\tfor (const rel of [...inputs].sort()) {\n\t\thash.update(rel);\n\t\thash.update(\"\\0\");\n\t\tconst abs = join(projectRoot, rel);\n\t\tif (existsSync(abs) && statSync(abs).isFile()) hash.update(readFileSync(abs));\n\t\telse hash.update(\"missing\");\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\n/** Fingerprint bundled package.json files (version bumps dirty consumers). */\nfunction hashBundledPackages(projectRoot, packages) {\n\tconst hash = createHash(\"sha256\");\n\tconst packageJsonPath = join(projectRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return hash.digest(\"hex\");\n\tconst require = createRequire(packageJsonPath);\n\tfor (const name of [...packages].sort()) {\n\t\thash.update(name);\n\t\thash.update(\"\\0\");\n\t\ttry {\n\t\t\tconst resolved = require.resolve(`${name}/package.json`);\n\t\t\thash.update(readFileSync(resolved, \"utf8\"));\n\t\t} catch {\n\t\t\thash.update(\"missing\");\n\t\t}\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\nfunction buildIndexPath(projectRoot) {\n\treturn join(projectRoot, BUILD_INDEX_REL_PATH);\n}\nfunction tryReadBuildIndex(projectRoot) {\n\tconst path = buildIndexPath(projectRoot);\n\tif (!existsSync(path)) return;\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(path, \"utf8\"));\n\t\tif (parsed.version !== 1 || typeof parsed.entries !== \"object\") return;\n\t\treturn parsed;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction writeBuildIndex(projectRoot, index) {\n\tconst path = buildIndexPath(projectRoot);\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, compactJson(index));\n}\n/** Invert inputs → entry keys (action/shared file → consumers). */\nfunction consumersOf(projectRoot, sourcePath) {\n\tconst index = tryReadBuildIndex(projectRoot);\n\tif (!index) return [];\n\tconst needle = toPosix$3(sourcePath).replace(/^\\.\\//, \"\");\n\tconst owners = [];\n\tfor (const [key, entry] of Object.entries(index.entries)) if (entry.inputs.includes(needle)) owners.push(key);\n\treturn owners.sort();\n}\n/**\n* Compare on-disk build-index to current sources / bundled package fingerprints.\n* Does not run the bundler.\n*/\nfunction listDirtyEntries(projectRoot, currentEntryKeys) {\n\tconst index = tryReadBuildIndex(projectRoot);\n\tconst expected = [...currentEntryKeys].filter((key) => key !== \"config\").sort();\n\tif (!index) return {\n\t\tdirty: expected,\n\t\tforceFull: true,\n\t\treason: \"missing build-index\"\n\t};\n\tconst indexed = Object.keys(index.entries).sort();\n\tif (indexed.length !== expected.length || indexed.some((key, i) => key !== expected[i])) return {\n\t\tdirty: expected,\n\t\tforceFull: true,\n\t\treason: \"entry membership changed\"\n\t};\n\tconst dirty = [];\n\tfor (const key of expected) {\n\t\tconst entry = index.entries[key];\n\t\tif (!existsSync(join(projectRoot, \"dist\", entry.artifactPath))) {\n\t\t\tdirty.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\tif (hashSourceInputs(projectRoot, entry.inputs) !== entry.sourceHash) {\n\t\t\tdirty.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\tif (hashBundledPackages(projectRoot, entry.packages) !== entry.packagesHash) dirty.push(key);\n\t}\n\treturn {\n\t\tdirty,\n\t\tforceFull: false\n\t};\n}\n/** Default manifest shard paths for an entry key (best-effort). */\nfunction defaultManifestPathsForEntry(entryKey) {\n\tconst [kind, ...rest] = entryKey.split(\"/\");\n\tconst id = rest.join(\"/\");\n\tif (!kind || !id) return [];\n\tif (kind === \"agents\") return [`modules/agents/${id}.json`];\n\tif (kind === \"workflows\") return [`modules/workflows/${id}.json`, `modules/workflows/${id}.flow.json`];\n\tif (kind === \"triggers\") return [`modules/triggers/${id}.json`];\n\tif (kind === \"actions\") return [\"catalogs/actions.json\"];\n\treturn [];\n}\nfunction entryArtifact(projectRoot, entryKey) {\n\tconst entry = tryReadBuildIndex(projectRoot)?.entries[entryKey];\n\tif (!entry) return;\n\treturn {\n\t\tartifactPath: entry.artifactPath,\n\t\tartifactHash: entry.artifactHash\n\t};\n}\n/** Build a BuildIndexEntry from closure facts + emitted artifact bytes. */\nfunction makeBuildIndexEntry(input) {\n\treturn {\n\t\tsourceHash: hashSourceInputs(input.projectRoot, input.inputs),\n\t\tartifactHash: sha256Bytes(input.artifactBytes),\n\t\tartifactPath: toPosix$3(input.artifactPath),\n\t\tinputs: [...input.inputs].sort(),\n\t\tpackages: [...input.packages].sort(),\n\t\tpackagesHash: hashBundledPackages(input.projectRoot, input.packages),\n\t\tmanifestPaths: defaultManifestPathsForEntry(input.entryKey)\n\t};\n}\n/** True when every current entry is clean and artifacts exist. */\nfunction isBuildIndexClean(projectRoot, currentEntryKeys) {\n\tconst { dirty, forceFull } = listDirtyEntries(projectRoot, currentEntryKeys);\n\treturn !forceFull && dirty.length === 0;\n}\n//#endregion\n//#region src/entry-closure-plugin.ts\nfunction toPosix$2(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction projectRelativeModuleId$1(root, id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\tif (!isAbsolute(absolute) && !absolute.startsWith(\".\")) return null;\n\tconst normalizedRoot = normalizeBuildFilePath(root);\n\tlet normalizedAbsolute;\n\ttry {\n\t\tnormalizedAbsolute = normalizeBuildFilePath(absolute);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst relativePath = toPosix$2(relative(normalizedRoot, normalizedAbsolute));\n\tif (!relativePath || relativePath.startsWith(\"..\") || relativePath.includes(\"node_modules/\") || relativePath.startsWith(\"node_modules/\")) return null;\n\treturn relativePath;\n}\nfunction packageNameFromModuleId$1(id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\ttry {\n\t\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst normalized = absolute.replace(/\\\\/g, \"/\");\n\tconst index = normalized.lastIndexOf(\"/node_modules/\");\n\tif (index < 0) return null;\n\tconst rest = normalized.slice(index + 14);\n\tif (!rest || rest.startsWith(\".\")) return null;\n\tif (rest.startsWith(\"@\")) {\n\t\tconst parts = rest.split(\"/\");\n\t\tif (parts.length < 2 || !parts[0] || !parts[1]) return null;\n\t\treturn `${parts[0]}/${parts[1]}`;\n\t}\n\treturn rest.split(\"/\")[0] || null;\n}\nfunction isFrameworkExternalPackage(name) {\n\tif (!name.startsWith(\"@keystrokehq/\")) return false;\n\tconst pkg = name.slice(13).split(\"/\")[0] ?? \"\";\n\treturn RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\n/**\n* Collect per-entry source inputs + bundled packages from the emit graph.\n* Used to write `build-index.json` after tsdown.\n*/\nfunction entryClosurePlugin(options) {\n\tconst root = normalizeBuildFilePath(options.root);\n\treturn {\n\t\tname: \"keystroke-entry-closure\",\n\t\tgenerateBundle(_outputOptions, bundle) {\n\t\t\tconst closures = /* @__PURE__ */ new Map();\n\t\t\tfor (const output of Object.values(bundle)) {\n\t\t\t\tif (output.type !== \"chunk\" || !output.isEntry) continue;\n\t\t\t\tconst entryKey = output.name.replace(/\\\\/g, \"/\");\n\t\t\t\tif (entryKey === \"config\" || entryKey.includes(\"\\0\")) continue;\n\t\t\t\tif (!entryKey.startsWith(\"agents/\") && !entryKey.startsWith(\"actions/\") && !entryKey.startsWith(\"workflows/\") && !entryKey.startsWith(\"triggers/\")) continue;\n\t\t\t\tconst inputs = /* @__PURE__ */ new Set();\n\t\t\t\tconst packages = /* @__PURE__ */ new Set();\n\t\t\t\tconst moduleIds = \"moduleIds\" in output && Array.isArray(output.moduleIds) ? output.moduleIds : Object.keys(output.modules ?? {});\n\t\t\t\tfor (const moduleId of moduleIds) {\n\t\t\t\t\tconst rel = projectRelativeModuleId$1(root, moduleId);\n\t\t\t\t\tif (rel) inputs.add(rel);\n\t\t\t\t\tconst pkg = packageNameFromModuleId$1(moduleId);\n\t\t\t\t\tif (pkg && !isFrameworkExternalPackage(pkg) && pkg !== \"zod\") packages.add(pkg);\n\t\t\t\t}\n\t\t\t\tif (output.facadeModuleId) {\n\t\t\t\t\tconst entryRel = projectRelativeModuleId$1(root, output.facadeModuleId);\n\t\t\t\t\tif (entryRel) inputs.add(entryRel);\n\t\t\t\t}\n\t\t\t\tclosures.set(entryKey, {\n\t\t\t\t\tinputs: [...inputs].sort(),\n\t\t\t\t\tpackages: [...packages].sort()\n\t\t\t\t});\n\t\t\t}\n\t\t\toptions.onClosures(closures);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/build-self-contained.ts\nconst ASSETS_MODULE$2 = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX$1 = `\\0${ASSETS_MODULE$2}:`;\nfunction renderAssetModule$2(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Resolve `@keystrokehq/assets` without re-packing on every entry. */\nfunction agentAssetsResolvePlugin(manifest) {\n\treturn {\n\t\tname: \"keystroke-assets-resolve\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$2) return null;\n\t\t\treturn `${VIRTUAL_PREFIX$1}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX$1}manifest`) return null;\n\t\t\treturn renderAssetModule$2(manifest);\n\t\t}\n\t};\n}\n/**\n* Build each entry in isolation so local imports are inlined (self-contained\n* `.mjs`) and closures include transitive project sources — same contract as\n* `buildFilteredApp`.\n*/\nasync function buildSelfContainedEntries(options) {\n\tconst root = options.root;\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst phase = options.phase ?? \"build\";\n\tconst distRoot = join(root, outDir);\n\tconst clean = options.clean ?? true;\n\tconst allEntries = {\n\t\t...options.configEntry ? { config: options.configEntry } : {},\n\t\t...options.buildEntries\n\t};\n\tconst entryKeys = Object.keys(allEntries).sort();\n\tif (entryKeys.length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\tconst dirtySet = new Set(options.dirtyKeys && options.dirtyKeys.length > 0 ? options.dirtyKeys : entryKeys.filter((key) => key !== \"config\").concat(options.configEntry ? [\"config\"] : []));\n\tif (options.configEntry && (clean || dirtySet.size > 0)) dirtySet.add(\"config\");\n\tif (clean && existsSync(distRoot)) rmSync(distRoot, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tconst packed = packModularProjectAssets({\n\t\tprojectRoot: root,\n\t\tsrcDir,\n\t\toutDir\n\t});\n\tconst closures = /* @__PURE__ */ new Map();\n\tconst previous = tryReadBuildIndex(root);\n\tfor (const entryKey of [...dirtySet].sort()) {\n\t\tconst entryPath = allEntries[entryKey];\n\t\tif (!entryPath) continue;\n\t\tconst plugins = [\n\t\t\tkeystrokeIgnoreGuardPlugin({\n\t\t\t\troot,\n\t\t\t\tignoredFiles: options.ignoredFiles\n\t\t\t}),\n\t\t\tagentAssetsResolvePlugin(packed.manifest),\n\t\t\tentryClosurePlugin({\n\t\t\t\troot,\n\t\t\t\tonClosures: (next) => {\n\t\t\t\t\tfor (const [key, value] of next) closures.set(key, value);\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t\tif (entryKey.startsWith(\"workflows/\")) plugins.splice(1, 0, callSiteIdInjectionPlugin({\n\t\t\troot,\n\t\t\tsrcDir\n\t\t}));\n\t\tawait build(mergeConfig(baseTsdownConfig, {\n\t\t\tentry: { [entryKey]: entryPath },\n\t\t\tformat: [\"esm\"],\n\t\t\toutDir: distRoot,\n\t\t\tclean: false,\n\t\t\tdts: false,\n\t\t\tsourcemap: phase === \"deploy\" ? false : true,\n\t\t\t...phase === \"deploy\" ? { logLevel: \"error\" } : {},\n\t\t\tloader: { \".md\": \"text\" },\n\t\t\tdeps: userAppBuildDepsConfig(),\n\t\t\tplugins\n\t\t}));\n\t}\n\tconst entries = {};\n\tfor (const key of Object.keys(options.buildEntries).sort()) {\n\t\tif (closures.has(key)) {\n\t\t\tconst closure = closures.get(key);\n\t\t\tconst artifactPath = `${key}.mjs`;\n\t\t\tconst abs = join(distRoot, artifactPath);\n\t\t\tif (!existsSync(abs)) continue;\n\t\t\tentries[key] = makeBuildIndexEntry({\n\t\t\t\tprojectRoot: root,\n\t\t\t\tentryKey: key,\n\t\t\t\tinputs: closure.inputs,\n\t\t\t\tpackages: closure.packages,\n\t\t\t\tartifactPath,\n\t\t\t\tartifactBytes: readFileSync(abs)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (previous?.entries[key]) entries[key] = previous.entries[key];\n\t}\n\tconst index = {\n\t\tversion: 1,\n\t\tintegrationFingerprint: integrationPackagesFingerprint(root),\n\t\tentries\n\t};\n\twriteBuildIndex(root, index);\n\treturn {\n\t\tclosures,\n\t\tindex\n\t};\n}\n//#endregion\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$1(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction distRelativePath(entryKey) {\n\treturn `${entryKey}.mjs`;\n}\nfunction renderAssetModule$1(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\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\tsourcemap: false,\n\t\tlogLevel: \"error\",\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$1(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 workflowDiagnostics = collectWorkflowDiagnostics(root, srcDir);\n\tassertWorkflowDiagnosticErrorsFrom(workflowDiagnostics);\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\tconst assetsManifest = packAssetDirs(root, srcDir);\n\t\tfiles.push({\n\t\t\tentryKey: \".keystroke/assets\",\n\t\t\trelativePath: \".keystroke/assets.mjs\",\n\t\t\tcontents: Buffer.from(renderAssetModule$1(assetsManifest), \"utf8\")\n\t\t});\n\t} finally {\n\t\twarnWorkflowDiagnosticsFrom(workflowDiagnostics);\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/merge-filtered-artifact.ts\n/**\n* Merge a filtered rebuild into a previously packed `dist/` artifact.\n* Dual-reads modular or legacy base manifests and re-emits modular shards.\n*/\nasync function mergeFilteredArtifact(input) {\n\tconst mergeRoot = mkdtempSync(join(tmpdir(), \"keystroke-artifact-merge-\"));\n\ttry {\n\t\textractProjectArtifact(input.baseArchive, mergeRoot);\n\t\tpersistModularRouteManifest(mergeRoot, mergeStoredRouteManifest(readRouteManifest(mergeRoot), input.filtered.manifestEntries));\n\t\tfor (const file of input.filtered.files) {\n\t\t\tconst destination = join(mergeRoot, \"dist\", file.relativePath);\n\t\t\tmkdirSync(dirname(destination), { recursive: true });\n\t\t\twriteFileSync(destination, file.contents);\n\t\t\tif (file.sourceMap) writeFileSync(`${destination}.map`, file.sourceMap);\n\t\t}\n\t\treturn packDistTree(mergeRoot);\n\t} finally {\n\t\trmSync(mergeRoot, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n}\n//#endregion\n//#region src/safe-filtered-deploy.ts\n/** Analyzer stdout / plan digest contract version for Modal Precise Deploy. */\nconst ANALYZER_CONTRACT_VERSION = \"safe-filtered-deploy-v3\";\nconst PACKAGE_MANIFEST_FILES = new Set([\"package.json\"]);\nconst LOCKFILE_NAMES = new Set([\n\t\"package-lock.json\",\n\t\"pnpm-lock.yaml\",\n\t\"yarn.lock\",\n\t\"bun.lock\",\n\t\"bun.lockb\",\n\t\"npm-shrinkwrap.json\"\n]);\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction requireFull(code, reason) {\n\treturn {\n\t\trequireFull: true,\n\t\tcode,\n\t\treason\n\t};\n}\nfunction isDeployableResourceKey(key) {\n\treturn key.startsWith(\"agents/\") || key.startsWith(\"workflows/\");\n}\nfunction kindFromResourceKey(key) {\n\tif (key.startsWith(\"agents/\")) return \"agent\";\n\tif (key.startsWith(\"workflows/\")) return \"workflow\";\n\treturn null;\n}\n/** Normalize caller paths to project-relative posix form. */\nfunction normalizeProjectRelativePath(root, path) {\n\tconst withoutDot = path.trim().replace(/\\\\/g, \"/\").replace(/^\\.\\//, \"\");\n\tconst absolute = isAbsolute(withoutDot) ? withoutDot : join(normalizeBuildFilePath(root), withoutDot);\n\tconst relativePath = toPosix(relative(normalizeBuildFilePath(root), normalizeBuildFilePath(absolute)));\n\tif (!relativePath || relativePath === \".\" || relativePath.startsWith(\"..\")) throw new Error(`Path \"${path}\" is outside project root`);\n\treturn relativePath;\n}\nfunction basenamePosix(path) {\n\tconst parts = path.split(\"/\");\n\treturn parts[parts.length - 1] ?? path;\n}\nfunction isPackageManifestPath(path) {\n\treturn PACKAGE_MANIFEST_FILES.has(basenamePosix(path));\n}\nfunction isLockfilePath(path) {\n\treturn LOCKFILE_NAMES.has(basenamePosix(path));\n}\nfunction normalizeChanges(root, changedPaths) {\n\tconst byPath = /* @__PURE__ */ new Map();\n\tfor (const change of changedPaths) {\n\t\tconst raw = typeof change === \"string\" ? {\n\t\t\tpath: change,\n\t\t\tkind: \"modified\"\n\t\t} : change;\n\t\tlet path;\n\t\ttry {\n\t\t\tpath = normalizeProjectRelativePath(root, raw.path);\n\t\t} catch {\n\t\t\treturn requireFull(\"unproven_safe\", `Changed path \"${raw.path}\" cannot be normalized to a project-relative source path`);\n\t\t}\n\t\tlet previousPath;\n\t\tif (raw.previousPath) try {\n\t\t\tpreviousPath = normalizeProjectRelativePath(root, raw.previousPath);\n\t\t} catch {\n\t\t\treturn requireFull(\"unproven_safe\", `Rename previous path \"${raw.previousPath}\" cannot be normalized`);\n\t\t}\n\t\tconst normalized = {\n\t\t\tpath,\n\t\t\tkind: raw.kind,\n\t\t\t...previousPath ? { previousPath } : {}\n\t\t};\n\t\tconst existing = byPath.get(path);\n\t\tif (existing && existing.kind !== normalized.kind) return requireFull(\"ambiguous_ownership\", `Changed path \"${path}\" has ambiguous change kinds (${existing.kind} vs ${normalized.kind})`);\n\t\tbyPath.set(path, normalized);\n\t}\n\treturn [...byPath.values()];\n}\nfunction projectRelativeModuleId(root, id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\tif (!isAbsolute(absolute) && !absolute.startsWith(\".\")) return null;\n\tconst normalizedRoot = normalizeBuildFilePath(root);\n\tlet normalizedAbsolute;\n\ttry {\n\t\tnormalizedAbsolute = normalizeBuildFilePath(absolute);\n\t} catch {\n\t\treturn null;\n\t}\n\tif (!normalizedAbsolute.startsWith(normalizedRoot + sep) && normalizedAbsolute !== normalizedRoot) {\n\t\tconst rel = toPosix(relative(normalizedRoot, normalizedAbsolute));\n\t\tif (!rel || rel.startsWith(\"..\") || rel.includes(\"node_modules/\")) return null;\n\t}\n\tconst relativePath = toPosix(relative(normalizedRoot, normalizedAbsolute));\n\tif (!relativePath || relativePath.startsWith(\"..\") || relativePath.includes(\"node_modules/\") || relativePath.startsWith(\"node_modules/\")) return null;\n\treturn relativePath;\n}\n/** Extract a package name from a resolved module id under node_modules. */\nfunction packageNameFromModuleId(id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\ttry {\n\t\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst normalized = absolute.replace(/\\\\/g, \"/\");\n\tconst index = normalized.lastIndexOf(\"/node_modules/\");\n\tif (index < 0) return null;\n\tconst rest = normalized.slice(index + 14);\n\tif (!rest || rest.startsWith(\".\")) return null;\n\tif (rest.startsWith(\"@\")) {\n\t\tconst parts = rest.split(\"/\");\n\t\tif (parts.length < 2 || !parts[0] || !parts[1]) return null;\n\t\treturn `${parts[0]}/${parts[1]}`;\n\t}\n\treturn rest.split(\"/\")[0] || null;\n}\nfunction isRuntimeExternalPackage(name) {\n\tif (!name.startsWith(\"@keystrokehq/\")) return false;\n\tconst pkg = name.slice(13).split(\"/\")[0] ?? \"\";\n\treturn RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\nfunction readDependencyMap(packageJsonContents) {\n\ttry {\n\t\tconst parsed = JSON.parse(packageJsonContents);\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tfor (const field of [\n\t\t\t\"dependencies\",\n\t\t\t\"devDependencies\",\n\t\t\t\"optionalDependencies\",\n\t\t\t\"peerDependencies\"\n\t\t]) {\n\t\t\tconst value = parsed[field];\n\t\t\tif (!value || typeof value !== \"object\" || Array.isArray(value)) continue;\n\t\t\tfor (const [name, version] of Object.entries(value)) if (typeof version === \"string\") map.set(name, version);\n\t\t}\n\t\treturn map;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction changedDependencyNames(base, draft) {\n\tconst names = new Set([...base.keys(), ...draft.keys()]);\n\tconst changed = [];\n\tfor (const name of names) if ((base.get(name) ?? null) !== (draft.get(name) ?? null)) changed.push(name);\n\treturn changed.sort();\n}\nfunction collectModuleGraphPlugin(graph) {\n\treturn {\n\t\tname: \"keystroke-collect-module-graph\",\n\t\tasync resolveId(source, importer, resolveOptions) {\n\t\t\tif (!importer || resolveOptions?.isEntry) return null;\n\t\t\tif (!await this.resolve(source, importer, {\n\t\t\t\t...resolveOptions,\n\t\t\t\tskipSelf: true\n\t\t\t})) {\n\t\t\t\tconst existing = graph.unresolvedByImporter.get(importer) ?? [];\n\t\t\t\texisting.push(source);\n\t\t\t\tgraph.unresolvedByImporter.set(importer, existing);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tbuildEnd() {\n\t\t\tfor (const id of this.getModuleIds()) {\n\t\t\t\tconst info = this.getModuleInfo(id);\n\t\t\t\tif (!info) continue;\n\t\t\t\tgraph.byId.set(id, {\n\t\t\t\t\timportedIds: [...info.importedIds],\n\t\t\t\t\tdynamicallyImportedIds: [...info.dynamicallyImportedIds]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\nfunction closureFromGraph(root, resourceKey, entryAbsolute, graph) {\n\tconst kind = kindFromResourceKey(resourceKey);\n\tif (!kind) throw new Error(`Not a deployable workflow/agent key: ${resourceKey}`);\n\tconst entryNormalized = normalizeBuildFilePath(entryAbsolute);\n\tconst queue = [];\n\tfor (const id of graph.byId.keys()) try {\n\t\tif (normalizeBuildFilePath(id.startsWith(\"file://\") ? fileURLToPath(id) : id) === entryNormalized) {\n\t\t\tqueue.push(id);\n\t\t\tbreak;\n\t\t}\n\t} catch {}\n\tif (queue.length === 0) {\n\t\tconst entryRel = toPosix(relative(normalizeBuildFilePath(root), entryNormalized));\n\t\tfor (const id of graph.byId.keys()) if (projectRelativeModuleId(root, id) === entryRel) {\n\t\t\tqueue.push(id);\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst inputs = /* @__PURE__ */ new Set();\n\tconst packages = /* @__PURE__ */ new Set();\n\tlet hasDynamicImports = false;\n\tconst unresolvedImports = /* @__PURE__ */ new Set();\n\twhile (queue.length > 0) {\n\t\tconst id = queue.pop();\n\t\tif (seen.has(id)) continue;\n\t\tseen.add(id);\n\t\tconst relativePath = projectRelativeModuleId(root, id);\n\t\tif (relativePath) inputs.add(relativePath);\n\t\tconst packageName = packageNameFromModuleId(id);\n\t\tif (packageName && !isRuntimeExternalPackage(packageName)) packages.add(packageName);\n\t\tfor (const unresolved of graph.unresolvedByImporter.get(id) ?? []) unresolvedImports.add(unresolved);\n\t\tconst node = graph.byId.get(id);\n\t\tif (!node) continue;\n\t\tif (node.dynamicallyImportedIds.length > 0) hasDynamicImports = true;\n\t\tfor (const imported of node.importedIds) queue.push(imported);\n\t\tfor (const imported of node.dynamicallyImportedIds) queue.push(imported);\n\t}\n\tconst entryPath = projectRelativeModuleId(root, entryAbsolute) ?? toPosix(relative(normalizeBuildFilePath(root), entryNormalized));\n\tinputs.add(entryPath);\n\treturn {\n\t\tresourceKey,\n\t\tkind,\n\t\tentryPath,\n\t\tinputs: [...inputs].sort(),\n\t\tpackages: [...packages].sort(),\n\t\thasDynamicImports,\n\t\tunresolvedImports: [...unresolvedImports].sort()\n\t};\n}\n/**\n* Analyze bundler input closures for every deployable workflow and agent entry.\n*\n* Uses the same tsdown/rolldown resolver settings as artifact builds so aliases,\n* package exports, TS resolution, and externals match production.\n*/\nasync function analyzeDeployableClosures(options = {}) {\n\tconst root = normalizeBuildFilePath(options.root ?? process.cwd());\n\tconst walked = walkProject(root, {\n\t\tsrcDir: options.srcDir ?? \"src\",\n\t\tphase: options.phase ?? \"deploy\"\n\t});\n\tconst entries = {};\n\tfor (const [key, absolute] of Object.entries(walked.buildEntries)) if (isDeployableResourceKey(key)) entries[key] = absolute;\n\tconst entryList = Object.entries(entries).sort(([a], [b]) => a.localeCompare(b));\n\tif (entryList.length === 0) return {\n\t\tclosures: [],\n\t\tfailures: []\n\t};\n\tmkdirSync(join(root, \".keystroke\"), { recursive: true });\n\tconst scratchRoot = mkdtempSync(join(root, \".keystroke\", \"closure-analyze-\"));\n\tconst previous = process.cwd();\n\tconst closures = [];\n\tconst failures = [];\n\ttry {\n\t\tprocess.chdir(root);\n\t\tfor (const [resourceKey, entryPath] of entryList) {\n\t\t\tconst graph = {\n\t\t\t\tbyId: /* @__PURE__ */ new Map(),\n\t\t\t\tunresolvedByImporter: /* @__PURE__ */ new Map()\n\t\t\t};\n\t\t\tconst outDir = join(scratchRoot, \"dist\", resourceKey.replaceAll(\"/\", \"__\"));\n\t\t\ttry {\n\t\t\t\tawait build(mergeConfig(baseTsdownConfig, {\n\t\t\t\t\tentry: { [resourceKey]: entryPath },\n\t\t\t\t\tformat: [\"esm\"],\n\t\t\t\t\toutDir,\n\t\t\t\t\tclean: true,\n\t\t\t\t\tdts: false,\n\t\t\t\t\tsourcemap: false,\n\t\t\t\t\tlogLevel: \"error\",\n\t\t\t\t\tloader: { \".md\": \"text\" },\n\t\t\t\t\tdeps: userAppBuildDepsConfig(),\n\t\t\t\t\tplugins: [collectModuleGraphPlugin(graph)]\n\t\t\t\t}));\n\t\t\t\tconst closure = closureFromGraph(root, resourceKey, entryPath, graph);\n\t\t\t\tclosures.push(closure);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tfailures.push({\n\t\t\t\t\tresourceKey,\n\t\t\t\t\treason: message\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t\trmSync(scratchRoot, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n\treturn {\n\t\tclosures,\n\t\tfailures\n\t};\n}\nfunction ownershipIndex(closures) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const closure of closures) for (const input of closure.inputs) {\n\t\tconst owners = index.get(input) ?? [];\n\t\towners.push(closure.resourceKey);\n\t\tindex.set(input, owners);\n\t}\n\tfor (const [path, owners] of index) index.set(path, [...new Set(owners)].sort());\n\treturn index;\n}\nfunction packageOwnershipIndex(closures) {\n\tconst packageOwners = /* @__PURE__ */ new Map();\n\tfor (const closure of closures) for (const packageName of closure.packages) {\n\t\tconst owners = packageOwners.get(packageName) ?? [];\n\t\towners.push(closure.resourceKey);\n\t\tpackageOwners.set(packageName, owners);\n\t}\n\tfor (const [packageName, owners] of packageOwners) packageOwners.set(packageName, [...new Set(owners)].sort());\n\treturn packageOwners;\n}\nfunction unionOwners(...lists) {\n\treturn [...new Set(lists.flatMap((list) => list ?? []))].sort();\n}\nfunction intersectsRequested(owners, requested) {\n\treturn owners.some((owner) => requested.has(owner));\n}\nfunction sortCandidateOps(ops) {\n\treturn [...ops].sort((a, b) => {\n\t\tconst byPath = a.path.localeCompare(b.path);\n\t\tif (byPath !== 0) return byPath;\n\t\treturn a.op.localeCompare(b.op);\n\t});\n}\n/**\n* Transition ownership for a changed path:\n* - added → D0 owners\n* - deleted → M0 owners\n* - modified → M0 ∪ D0 owners\n* - renamed → previousPath M0 ∪ new path D0 (promote both ops when either side matches)\n*/\nfunction transitionAttribution(change, draftOwnersByPath, mainOwnersByPath) {\n\tif (change.kind === \"renamed\") {\n\t\tif (!change.previousPath) return requireFull(\"ambiguous_ownership\", `Renamed path \"${change.path}\" is missing previousPath; filtered deploy cannot attribute ownership`);\n\t\treturn {\n\t\t\towners: unionOwners(mainOwnersByPath.get(change.previousPath), draftOwnersByPath.get(change.path)),\n\t\t\tops: [{\n\t\t\t\tpath: change.previousPath,\n\t\t\t\top: \"delete\"\n\t\t\t}, {\n\t\t\t\tpath: change.path,\n\t\t\t\top: \"upsert\"\n\t\t\t}]\n\t\t};\n\t}\n\tif (change.kind === \"added\") return {\n\t\towners: draftOwnersByPath.get(change.path) ?? [],\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"upsert\"\n\t\t}]\n\t};\n\tif (change.kind === \"deleted\") return {\n\t\towners: mainOwnersByPath.get(change.path) ?? [],\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"delete\"\n\t\t}]\n\t};\n\treturn {\n\t\towners: unionOwners(mainOwnersByPath.get(change.path), draftOwnersByPath.get(change.path)),\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"upsert\"\n\t\t}]\n\t};\n}\nfunction filteredSuccess(input) {\n\treturn {\n\t\trequireFull: false,\n\t\tresourceKeys: [...input.resourceKeys].sort(),\n\t\timpactedResourceKeys: [...input.impactedResourceKeys].sort(),\n\t\texpansions: [...input.expansions].sort((a, b) => a.resourceKey.localeCompare(b.resourceKey)),\n\t\tsourceDelta: [...input.sourceDelta].sort(),\n\t\tcandidateOps: sortCandidateOps(input.candidateOps),\n\t\timpactCompleteness: input.impactCompleteness,\n\t\twarnings: [...input.warnings]\n\t};\n}\n/**\n* Compute the smallest safe filtered resource set + source delta for a draft delta.\n*\n* Dual-graph (M0/D0) transition ownership promotes only paths attributable to\n* the requested resources. Impacts are M0 consumers of promoted paths (candidate\n* = M0 + sourceDelta). Incomplete main-impact enumeration is soft-unknown, not\n* a hard block.\n*/\nasync function computeSafeFilteredDeploy(options) {\n\tconst root = normalizeBuildFilePath(options.root ?? process.cwd());\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst phase = options.phase ?? \"deploy\";\n\tconst normalized = normalizeChanges(root, options.changedPaths);\n\tif (\"requireFull\" in normalized && normalized.requireFull) return normalized;\n\tconst changes = normalized;\n\tconst packageManifestChanges = [];\n\tconst lockfileChanges = [];\n\tconst sourceLikeChanges = [];\n\tfor (const change of changes) {\n\t\tif (isPackageManifestPath(change.path)) {\n\t\t\tpackageManifestChanges.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tif (isLockfilePath(change.path)) {\n\t\t\tlockfileChanges.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tsourceLikeChanges.push(change);\n\t}\n\tconst selected = [...new Set(options.selectedResourceKeys)];\n\tif (selected.length === 0) return requireFull(\"unknown_selected_key\", \"At least one selected resource key is required\");\n\tconst draftAnalysis = options.closures !== void 0 ? {\n\t\tclosures: options.closures,\n\t\tfailures: options.failures ?? []\n\t} : await analyzeDeployableClosures({\n\t\troot,\n\t\tsrcDir,\n\t\tphase\n\t});\n\tconst draftClosures = draftAnalysis.closures;\n\tconst draftFailures = draftAnalysis.failures;\n\tconst draftByKey = new Map(draftClosures.map((closure) => [closure.resourceKey, closure]));\n\tconst draftFailedKeys = new Set(draftFailures.map((failure) => failure.resourceKey));\n\tconst mainClosures = options.mainClosures ?? draftClosures;\n\tconst mainFailures = options.mainClosures !== void 0 ? options.mainFailures ?? [] : draftFailures;\n\tconst mainByKey = new Map(mainClosures.map((closure) => [closure.resourceKey, closure]));\n\tconst mainFailedKeys = new Set(mainFailures.map((failure) => failure.resourceKey));\n\tfor (const key of selected) {\n\t\tif (draftFailedKeys.has(key)) {\n\t\t\tconst failure = draftFailures.find((item) => item.resourceKey === key);\n\t\t\treturn requireFull(\"unproven_safe\", `Selected resource \"${key}\" failed bundler analysis; filtered deploy cannot prove a complete closure` + (failure ? `: ${failure.reason}` : \"\"));\n\t\t}\n\t\tif (!draftByKey.has(key)) return requireFull(\"unknown_selected_key\", `Unknown selected resource key \"${key}\". Use keys like agents/foo or workflows/bar`);\n\t}\n\tfor (const key of selected) {\n\t\tconst closure = draftByKey.get(key);\n\t\tif (closure.hasDynamicImports || closure.unresolvedImports.length > 0) return requireFull(\"dynamic_or_unresolved_import\", `Selected resource \"${key}\" has dynamic or unresolved imports; filtered deploy cannot prove a complete closure`);\n\t}\n\tconst draftOwnersByPath = ownershipIndex(draftClosures);\n\tconst mainOwnersByPath = ownershipIndex(mainClosures);\n\tconst mainPackageOwners = packageOwnershipIndex(mainClosures);\n\tconst requestedSet = new Set(selected);\n\tconst sourceDelta = /* @__PURE__ */ new Set();\n\tconst candidateOpsByKey = /* @__PURE__ */ new Map();\n\tconst expansions = /* @__PURE__ */ new Map();\n\tconst impactedSet = /* @__PURE__ */ new Set();\n\tconst warnings = [];\n\tlet impactCompleteness = \"complete\";\n\tconst markUnknown = (warning) => {\n\t\timpactCompleteness = \"unknown\";\n\t\tif (!warnings.includes(warning)) warnings.push(warning);\n\t};\n\tconst addCandidateOp = (op) => {\n\t\tconst key = `${op.op}:${op.path}`;\n\t\tcandidateOpsByKey.set(key, op);\n\t\tsourceDelta.add(op.path);\n\t};\n\tconst markImpact = (resourceKey, sharedInputs, reason) => {\n\t\tif (requestedSet.has(resourceKey)) return;\n\t\timpactedSet.add(resourceKey);\n\t\tconst existing = expansions.get(resourceKey);\n\t\tconst mergedInputs = existing ? [...new Set([...existing.sharedInputs, ...sharedInputs])].sort() : [...sharedInputs].sort();\n\t\texpansions.set(resourceKey, {\n\t\t\tresourceKey,\n\t\t\treason: existing ? `${existing.reason}; ${reason}` : reason,\n\t\t\tsharedInputs: mergedInputs\n\t\t});\n\t};\n\tconst selectedEntryPaths = new Set(selected.map((key) => draftByKey.get(key)?.entryPath).filter((path) => Boolean(path)));\n\tfor (const change of sourceLikeChanges) {\n\t\tconst attribution = transitionAttribution(change, draftOwnersByPath, mainOwnersByPath);\n\t\tif (\"requireFull\" in attribution) return attribution;\n\t\tconst { owners, ops } = attribution;\n\t\tif ((selectedEntryPaths.has(change.path) || change.previousPath != null && selectedEntryPaths.has(change.previousPath) || selected.some((key) => {\n\t\t\tconst mainEntry = mainByKey.get(key)?.entryPath;\n\t\t\treturn mainEntry === change.path || mainEntry === change.previousPath;\n\t\t})) && !intersectsRequested(owners, requestedSet)) return requireFull(\"missing_ownership\", `Changed path \"${change.path}\" must be included for the selected resource(s) but selected ownership cannot be proven`);\n\t\tif (!intersectsRequested(owners, requestedSet)) continue;\n\t\tfor (const op of ops) addCandidateOp(op);\n\t\tfor (const op of ops) {\n\t\t\tconst mainOwners = mainOwnersByPath.get(op.path) ?? [];\n\t\t\tfor (const owner of mainOwners) {\n\t\t\t\tif (requestedSet.has(owner)) continue;\n\t\t\t\tconst mainClosure = mainByKey.get(owner);\n\t\t\t\tif (!mainClosure) {\n\t\t\t\t\tif (mainFailedKeys.has(owner)) {\n\t\t\t\t\t\tmarkUnknown(`Main-tip analysis failed for \"${owner}\"; additional owners of promoted path \"${op.path}\" may be hidden`);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tmarkUnknown(`Promoted path \"${op.path}\" lists main owner \"${owner}\" without an analyzable main closure`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (mainClosure.hasDynamicImports || mainClosure.unresolvedImports.length > 0) markUnknown(`Impacted main resource \"${owner}\" has dynamic or unresolved imports; additional impacts may be hidden`);\n\t\t\t\tmarkImpact(owner, [op.path], `Shared input ${`\"${op.path}\"`} also used by requested resource(s) on main`);\n\t\t\t}\n\t\t}\n\t}\n\tif (packageManifestChanges.length > 0 || lockfileChanges.length > 0) {\n\t\tconst packageResult = attributePackageChanges({\n\t\t\troot,\n\t\t\tpackageManifestChanges,\n\t\t\tlockfileChanges,\n\t\t\tbaseManifestFiles: options.baseManifestFiles ?? [],\n\t\t\tmainClosures,\n\t\t\tdraftClosures,\n\t\t\trequestedSet,\n\t\t\tmainPackageOwners\n\t\t});\n\t\tif (packageResult.include) {\n\t\t\tfor (const path of packageResult.manifestDelta) addCandidateOp({\n\t\t\t\tpath,\n\t\t\t\top: \"upsert\"\n\t\t\t});\n\t\t\tfor (const expansion of packageResult.expansions) markImpact(expansion.resourceKey, expansion.sharedInputs, expansion.reason);\n\t\t\tif (packageResult.unknownCompleteness) for (const warning of packageResult.warnings) markUnknown(warning);\n\t\t}\n\t}\n\tif (mainFailures.length > 0 && sourceDelta.size > 0) {\n\t\tconst failedList = [...mainFailedKeys].sort().join(\", \");\n\t\tif (![...sourceDelta].every((path) => selectedEntryPaths.has(path))) markUnknown(`Main-tip bundler analysis failed for deployable resource(s) ${failedList}; additional owners of promoted shared paths may be hidden`);\n\t}\n\tif (sourceDelta.size === 0) return filteredSuccess({\n\t\tresourceKeys: selected,\n\t\timpactedResourceKeys: [],\n\t\texpansions: [],\n\t\tsourceDelta: [],\n\t\tcandidateOps: [],\n\t\timpactCompleteness: \"complete\",\n\t\twarnings: []\n\t});\n\treturn filteredSuccess({\n\t\tresourceKeys: [...requestedSet, ...impactedSet],\n\t\timpactedResourceKeys: [...impactedSet],\n\t\texpansions: [...expansions.values()],\n\t\tsourceDelta: [...sourceDelta],\n\t\tcandidateOps: [...candidateOpsByKey.values()],\n\t\timpactCompleteness,\n\t\twarnings\n\t});\n}\nfunction attributePackageChanges(input) {\n\tif (input.packageManifestChanges.length === 0) return { include: false };\n\tif (input.baseManifestFiles.length === 0) return { include: false };\n\tconst draftPackageJsonPath = join(input.root, \"package.json\");\n\tlet draftPackageJson;\n\ttry {\n\t\tdraftPackageJson = readFileSync(draftPackageJsonPath, \"utf8\");\n\t} catch {\n\t\treturn { include: false };\n\t}\n\tconst basePackageJson = new Map(input.baseManifestFiles.map((file) => [file.path.replace(/\\\\/g, \"/\"), file.contents])).get(\"package.json\");\n\tif (basePackageJson == null) return { include: false };\n\tconst baseDeps = readDependencyMap(basePackageJson);\n\tconst draftDeps = readDependencyMap(draftPackageJson);\n\tif (!baseDeps || !draftDeps) return { include: false };\n\tconst changedPackages = changedDependencyNames(baseDeps, draftDeps);\n\tif (changedPackages.length === 0) return { include: false };\n\tconst runtimeChanged = changedPackages.filter((name) => isRuntimeExternalPackage(name));\n\tconst bundledChanged = changedPackages.filter((name) => !isRuntimeExternalPackage(name));\n\tconst selectedConsumesBundled = [...input.requestedSet].some((key) => {\n\t\tconst draft = input.draftClosures.find((item) => item.resourceKey === key);\n\t\tconst main = input.mainClosures.find((item) => item.resourceKey === key);\n\t\tconst packages = new Set([...draft?.packages ?? [], ...main?.packages ?? []]);\n\t\treturn bundledChanged.some((name) => packages.has(name));\n\t});\n\tif (runtimeChanged.length === 0 && !selectedConsumesBundled) return { include: false };\n\tconst expansions = /* @__PURE__ */ new Map();\n\tconst markImpact = (resourceKey, reason, sharedInputs) => {\n\t\tif (input.requestedSet.has(resourceKey)) return;\n\t\tconst existing = expansions.get(resourceKey);\n\t\texpansions.set(resourceKey, {\n\t\t\tresourceKey,\n\t\t\treason: existing ? `${existing.reason}; ${reason}` : reason,\n\t\t\tsharedInputs: [...new Set([...existing?.sharedInputs ?? [], ...sharedInputs])].sort()\n\t\t});\n\t};\n\tif (runtimeChanged.length > 0) for (const closure of input.mainClosures) markImpact(closure.resourceKey, `Runtime package update (${runtimeChanged.map((name) => `\"${name}\"`).join(\", \")}) requires rebuilding all resources from main`, runtimeChanged);\n\tfor (const packageName of bundledChanged) {\n\t\tif (!selectedConsumesBundled) continue;\n\t\tconst owners = input.mainPackageOwners.get(packageName) ?? [];\n\t\tfor (const owner of owners) markImpact(owner, `Bundled package \"${packageName}\" changed and is imported by this resource`, [packageName]);\n\t}\n\tconst manifestDelta = [...input.packageManifestChanges.map((change) => change.path), ...input.lockfileChanges.map((change) => change.path)].sort();\n\tconst warnings = [];\n\tlet unknownCompleteness = false;\n\tif (input.lockfileChanges.length > 0) {\n\t\tunknownCompleteness = true;\n\t\twarnings.push(\"Lockfile included with selected package change; lockfile resolution may hide additional package consumers\");\n\t}\n\treturn {\n\t\tinclude: true,\n\t\tmanifestDelta,\n\t\texpansions: [...expansions.values()],\n\t\tunknownCompleteness,\n\t\twarnings\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/**\n* Rolldown plugin: pack src/skills + src/files with per-pack hash skip, expose\n* `@keystrokehq/assets`, and write modular shards + composed `assets.mjs`.\n*/\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 = packModularProjectAssets({\n\t\t\t\tprojectRoot: options.root,\n\t\t\t\tsrcDir,\n\t\t\t\toutDir: options.outDir ?? \"dist\"\n\t\t\t}).manifest;\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};\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\tsourcemap: options.phase === \"deploy\" ? false : true,\n\t\t...options.phase === \"deploy\" ? { logLevel: \"error\" } : {},\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [\n\t\t\tkeystrokeIgnoreGuardPlugin({\n\t\t\t\troot,\n\t\t\t\tignoredFiles\n\t\t\t}),\n\t\t\tcallSiteIdInjectionPlugin({\n\t\t\t\troot,\n\t\t\t\tsrcDir\n\t\t\t}),\n\t\t\tagentAssetsPlugin({\n\t\t\t\troot,\n\t\t\t\tsrcDir,\n\t\t\t\toutDir\n\t\t\t})\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\tconst timings = {\n\t\tbundleMs: 0,\n\t\tmanifestMs: 0,\n\t\tmanifestCacheHit: false,\n\t\tbundleSkipped: false\n\t};\n\tconst cacheKey = phase === \"deploy\" && collectSources && walked.sourceFiles.length > 0 ? computeRouteManifestCacheKey({\n\t\tphase,\n\t\tsourceFiles: walked.sourceFiles,\n\t\tbuildEntryKeys: Object.keys(walked.buildEntries),\n\t\tignoredFiles: walked.ignoredFiles,\n\t\tintegrationFingerprint: integrationPackagesFingerprint(root)\n\t}) : null;\n\ttry {\n\t\tprocess.chdir(root);\n\t\tif (cacheKey && emitManifest && isRouteManifestCacheHit(root, cacheKey) && distDeployOutputsPresent(root, walked.buildEntries)) {\n\t\t\tconst manifestStarted = Date.now();\n\t\t\ttryRestoreCachedRouteManifest(root, cacheKey);\n\t\t\ttimings.manifestCacheHit = true;\n\t\t\ttimings.bundleSkipped = true;\n\t\t\ttimings.manifestMs = Date.now() - manifestStarted;\n\t\t\treturn {\n\t\t\t\tsourceFiles: walked.sourceFiles,\n\t\t\t\ttimings\n\t\t\t};\n\t\t}\n\t\tconst dirtyResult = listDirtyEntries(root, Object.keys(walked.buildEntries));\n\t\tconst skipBundle = !dirtyResult.forceFull && dirtyResult.dirty.length === 0 && distDeployOutputsPresent(root, walked.buildEntries);\n\t\tconst workflowDiagnostics = collectWorkflowDiagnostics(root, srcDir);\n\t\tassertWorkflowDiagnosticErrorsFrom(workflowDiagnostics);\n\t\ttry {\n\t\t\tif (skipBundle) {\n\t\t\t\tpackModularProjectAssets({\n\t\t\t\t\tprojectRoot: root,\n\t\t\t\t\tsrcDir,\n\t\t\t\t\toutDir: options.outDir ?? \"dist\"\n\t\t\t\t});\n\t\t\t\ttimings.bundleSkipped = true;\n\t\t\t} else {\n\t\t\t\tconst bundleStarted = Date.now();\n\t\t\t\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\t\t\t\tawait buildSelfContainedEntries({\n\t\t\t\t\troot,\n\t\t\t\t\tsrcDir,\n\t\t\t\t\toutDir: options.outDir ?? \"dist\",\n\t\t\t\t\tphase,\n\t\t\t\t\tclean: dirtyResult.forceFull && (options.clean ?? true),\n\t\t\t\t\tbuildEntries: walked.buildEntries,\n\t\t\t\t\tignoredFiles: walked.ignoredFiles,\n\t\t\t\t\tdirtyKeys: dirtyResult.forceFull ? void 0 : dirtyResult.dirty,\n\t\t\t\t\tconfigEntry\n\t\t\t\t});\n\t\t\t\ttimings.bundleMs = Date.now() - bundleStarted;\n\t\t\t}\n\t\t} finally {\n\t\t\twarnWorkflowDiagnosticsFrom(workflowDiagnostics);\n\t\t}\n\t\tif (emitManifest) {\n\t\t\tconst manifestStarted = Date.now();\n\t\t\tif (cacheKey && tryRestoreCachedRouteManifest(root, cacheKey)) timings.manifestCacheHit = true;\n\t\t\telse {\n\t\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t\t\tif (cacheKey) storeCachedRouteManifest(root, cacheKey);\n\t\t\t}\n\t\t\ttimings.manifestMs = Date.now() - manifestStarted;\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn {\n\t\tsourceFiles: walked.sourceFiles,\n\t\ttimings\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((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { ANALYZER_CONTRACT_VERSION, BUILD_INDEX_REL_PATH, agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, analyzeDeployableClosures, assertWorkflowDiagnosticErrors, assertWorkflowDiagnosticErrorsFrom, assertWorkflowDiagnostics, buildApp, buildFilteredApp, callSiteIdInjectionPlugin, collectWorkflowDiagnostics, computeSafeFilteredDeploy, consumersOf, createAppBuildConfig, entryArtifact, injectCallSiteIds, isBuildIndexClean, listDirtyEntries, mergeFilteredArtifact, normalizeProjectRelativePath, resolveBuildFilter, resolveModuleDirs, resolveRuntimeBuildArtifact, tryReadBuildIndex, warnWorkflowDiagnostics, warnWorkflowDiagnosticsFrom, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAOA,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,OAAO,aAAa,OAAO,QAAQ;CACpC,QAAQ;EACP,OAAO;CACR;AACD;AACA,SAAS,kBAAkB,IAAI,MAAM;CACpC,IAAI,GAAG,WAAW,IAAI,GAAG,OAAO;CAChC,MAAM,aAAa,uBAAuB,GAAG,WAAW,SAAS,IAAI,cAAc,EAAE,IAAI,EAAE;CAC3F,IAAI,CAAC,WAAW,WAAW,uBAAuB,IAAI,CAAC,GAAG,OAAO;CACjE,OAAO;AACR;AACA,SAAS,uBAAuB,MAAM,aAAa,UAAU;CAC5D,MAAM,UAAU,oBAAoB,MAAM,WAAW;CACrD,IAAI,UAAU,OAAO,kBAAkB,QAAQ,8BAA8B,oBAAoB,MAAM,QAAQ,EAAE;CACjH,OAAO,kBAAkB,QAAQ;AAClC;;AAEA,SAAS,2BAA2B,SAAS;CAC5C,MAAM,OAAO,uBAAuB,QAAQ,IAAI;CAChD,MAAM,eAAe,IAAI,IAAI,QAAQ,aAAa,KAAK,aAAa,uBAAuB,QAAQ,CAAC,CAAC;CACrG,SAAS,iBAAiB,UAAU,UAAU;EAC7C,MAAM,aAAa,uBAAuB,QAAQ;EAClD,IAAI,CAAC,aAAa,I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AAM,cAAc,WAAW,KAAK,MAAM,qBAAqB,CAAC,IAAI,KAAK,MAAM,qBAAqB,IAAI,KAAK;IAC7G,MAAM,0BAA0B;KAC/B;KACA;KACA,QAAQ,QAAQ,UAAU;KAC1B;KACA,OAAO,YAAY,cAAc,QAAQ,SAAS;KAClD,cAAc,OAAO;KACrB,cAAc,OAAO;KACrB,WAAW,YAAY,YAAY,KAAK,IAAI,YAAY;KACxD;IACD,CAAC;IACD,QAAQ,WAAW,KAAK,IAAI,IAAI;GACjC;EACD,UAAU;GACT,4BAA4B,mBAAmB;EAChD;EACA,IAAI,cAAc;GACjB,MAAM,kBAAkB,KAAK,IAAI;GACjC,IAAI,YAAY,8BAA8B,MAAM,QAAQ,GAAG,QAAQ,mBAAmB;QACrF;IACJ,MAAM,EAAE,sCAAsC,MAAM,OAAO;IAC3D,MAAM,kCAAkC,IAAI;IAC5C,IAAI,UAAU,yBAAyB,MAAM,QAAQ;GACtD;GACA,QAAQ,aAAa,KAAK,IAAI,IAAI;EACnC;CACD,UAAU;EACT,QAAQ,MAAM,QAAQ;CACvB;CACA,OAAO;EACN,aAAa,OAAO;EACpB;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"dist-B9mGozH5.mjs","names":["toPosix"],"sources":["../../../packages/build/dist/walk-project-CLy8GqGX.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 { PROJECT_SOURCE_IGNORED_DIRS, PROJECT_SOURCE_MAX_FILES, PROJECT_SOURCE_MAX_FILE_BYTES, PROJECT_SOURCE_MAX_TOTAL_BYTES, isIgnoredProjectSourceFileName, isProbablyBinaryProjectSource } from \"@keystrokehq/shared\";\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 MAX_FILE_BYTES = PROJECT_SOURCE_MAX_FILE_BYTES;\nconst MAX_TOTAL_BYTES = PROJECT_SOURCE_MAX_TOTAL_BYTES;\nconst MAX_FILES = PROJECT_SOURCE_MAX_FILES;\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\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\tconst actionsPrefix = `${toPosix(relative(root, join(srcRoot, \"actions\")))}/`;\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(actionsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"actions\"), filePath, { nestedEntry: \"action\" });\n\t\treturn id ? {\n\t\t\tentryKey: `actions/${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 >= MAX_FILES || totals.bytes >= MAX_TOTAL_BYTES)) return;\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (PROJECT_SOURCE_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 > MAX_FILE_BYTES || isIgnoredProjectSourceFileName(name)) continue;\n\t\tconst buffer = readFileSync(absolute);\n\t\tif (isProbablyBinaryProjectSource(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, normalizeBuildFilePath as r, walkProject as t };\n\n//# sourceMappingURL=walk-project-CLy8GqGX.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 \"telemetry\",\n \"tracing\",\n \"trigger\",\n \"tsdown-config\",\n \"web-search\",\n \"worker\",\n \"workflow\",\n \"workflow-canvas\",\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/**\n * Kept external so .d.ts emission does not inline internal/inferred types.\n *\n * `typescript` is external because the TS compiler cannot be cleanly bundled into\n * ESM — it mixes `require()`/`__filename` with top-level await, which Node rejects\n * with `ERR_AMBIGUOUS_MODULE_SYNTAX` on load. Packages that use the compiler\n * (`workflow-canvas`, `manifest`, `build`) declare it as a dependency, so it\n * resolves from `node_modules` at runtime instead of being inlined.\n */\nexport const LIBRARY_EXTERNAL_DEPS = [\n \"better-auth\",\n /^@better-auth\\//,\n /^better-auth\\//,\n \"typescript\",\n];\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\n/** Zod ships in the project-runtime image; keep one copy out of user-app artifacts. */\nexport function isRuntimeSharedNpmDep(id) {\n const name = packageName(id);\n return name === \"zod\";\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (isRuntimeSharedNpmDep(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/*, zod, 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: [\n ...NATIVE_RUNTIME_DEPS,\n FRAMEWORK_KEYSTROKE_EXTERNAL,\n /^zod(?:\\/|$)/,\n ...LIBRARY_EXTERNAL_DEPS,\n ],\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 *\n * `@keystrokehq/keystroke` uses workspace:>=0.0.0 ranges so private primitive\n * patches do not cascade-publish the facade; CLI/platform keep workspace:*.\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/**\n * Natives the published CLI must not leave as bare imports. The CLI no longer ships a\n * local SQLite server; auth/build still pull platform-database which references\n * better-sqlite3 — stub those modules at bundle time instead of externalizing them.\n */\nexport const CLI_STUBBED_NATIVE_DEPS = [\"better-sqlite3\", \"@parcel/watcher\"];\n\n/** CLI: inline better-auth/client; keep server adapters external. */\nexport function cliBundledEntryDepsConfig() {\n const neverBundleNatives = BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS.filter(\n (dep) => typeof dep !== \"string\" || !CLI_STUBBED_NATIVE_DEPS.includes(dep),\n );\n // platform-database (pulled via auth) needs drizzle inlined; do not leave it external.\n const neverBundleAuth = BETTER_AUTH_CLI_EXTERNAL_PATTERNS.filter((dep) => dep !== \"drizzle-orm\");\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...neverBundleNatives,\n ...neverBundleAuth,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n // The TS compiler cannot be inlined into ESM (`require`/`__filename` + top-level\n // await → `__filename is not defined` / `ERR_AMBIGUOUS_MODULE_SYNTAX` on load).\n // The CLI inlines the @keystrokehq/* packages that use it (build, manifest,\n // workflow-canvas), so `typescript` must resolve from the CLI's own node_modules —\n // hence it is also a runtime dependency of @keystrokehq/cli.\n \"typescript\",\n ],\n onlyBundle: false,\n };\n}\n\n/** Rolldown plugin: replace CLI-stubbed natives with throw-on-use shims. */\nexport function cliStubNativeDepsPlugin() {\n const stubPrefix = \"\\0cli-stub-native:\";\n return {\n name: \"cli-stub-native-deps\",\n resolveId(id) {\n const name = CLI_STUBBED_NATIVE_DEPS.find((dep) => id === dep || id.startsWith(`${dep}/`));\n if (!name) {\n return null;\n }\n return `${stubPrefix}${id}`;\n },\n load(id) {\n if (!id.startsWith(stubPrefix)) {\n return null;\n }\n const spec = id.slice(stubPrefix.length);\n const message = JSON.stringify(`${spec} is not available in the Keystroke CLI`);\n return `function unavailable() {\\n throw new Error(${message});\\n}\\nexport default new Proxy(unavailable, { get: () => unavailable });\\nexport const subscribe = unavailable;\\n`;\n },\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n cliStubNativeDepsPlugin,\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, r as normalizeBuildFilePath, t as walkProject } from \"./walk-project-CLy8GqGX.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { createRequire } from \"node:module\";\nimport { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, relative, sep } from \"node:path\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\nimport { createHash } from \"node:crypto\";\nimport { PROJECT_MANIFEST_REL_PATH } from \"@keystrokehq/shared\";\nimport { fileURLToPath } from \"node:url\";\nimport { classifyCall, computeCallSiteIds, diagnoseWorkflowSource, locateWorkflow } from \"@keystrokehq/workflow-canvas\";\nimport ts from \"typescript\";\nimport { packAssetDirs, packDirFromDisk } from \"@keystrokehq/sandbox/files\";\nimport { RUNTIME_KEYSTROKE_PACKAGES } from \"@keystrokehq/tsdown-config/deps\";\nimport { buildStoredRouteManifestForProject, persistModularRouteManifest, readRouteManifest } from \"@keystrokehq/manifest\";\nimport { tmpdir } from \"node:os\";\nimport { extractProjectArtifact, mergeStoredRouteManifest, packDistTree } from \"@keystrokehq/storage\";\n//#region src/inject-call-site-ids.ts\n/**\n* Build-time injection of the deterministic structural `callSiteId` into every\n* durable step call in a workflow source file, so the runtime emits\n* `step:<callSiteId>#<occurrence>` correlation ids (and `step:<callSiteId>`\n* credential consumer ids) that line up 1:1 with the canvas graph nodes the\n* deploy-time producer mints from the same source. There is no user-authored\n* step id — identity is entirely internal and injected here.\n*\n* Injection shape by kind (the `callSiteId` is the same id `computeCallSiteIds`\n* returns, which equals the producer's step-node id):\n* - action/sub-workflow `x.run(i)` → `x.run(i).__site(\"<id>\")` (builder method)\n* - agent `a.prompt(i, opts?)` → `__site` merged into the prompt options\n* - llm `promptLlm(i, opts?)` → `__site` merged into the options\n* - hook `ctx.hook(opts?)` → `__site` merged into the options\n* - sleep `ctx.sleep(d, opts?)` → `__site` merged into a second options arg\n*/\nfunction injectCallSiteIds(code, fileName) {\n\tconst sourceFile = ts.createSourceFile(fileName, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n\tconst located = locateWorkflow(sourceFile);\n\tif (!located) return code;\n\tconst ids = computeCallSiteIds(sourceFile);\n\tif (ids.size === 0) return code;\n\tconst edits = [];\n\tfor (const [node, id] of ids) {\n\t\tconst info = classifyCall(node, located.ctxParamName);\n\t\tif (!info) continue;\n\t\tif (info.callKind === \"workflow-step\") {\n\t\t\tedits.push({\n\t\t\t\tpos: node.getEnd(),\n\t\t\t\ttext: `.__site(${JSON.stringify(id)})`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"agent\" || info.callKind === \"llm\") {\n\t\t\tpushOptionsEdit(edits, node, id);\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"hook\") {\n\t\t\tpushHookOptionsEdit(edits, node, id);\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.callKind === \"wait\") pushSleepOptionsEdit(edits, node, id);\n\t}\n\tif (edits.length === 0) return code;\n\tedits.sort((a, b) => b.pos - a.pos);\n\tlet out = code;\n\tfor (const edit of edits) out = out.slice(0, edit.pos) + edit.text + out.slice(edit.pos);\n\treturn out;\n}\n/**\n* Merge `__site: \"<id>\"` into a call's options argument (agents / promptLlm).\n* - no 2nd arg → append `, { __site: \"id\" }`\n* - 2nd arg object literal → insert `__site: \"id\", ` after its `{`\n* - 2nd arg anything else → wrap as `{ ...orig, __site: \"id\" }`\n*/\nfunction pushOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst optionsArg = call.arguments[1];\n\tif (!optionsArg) {\n\t\tconst firstArg = call.arguments[0];\n\t\tconst insertAt = firstArg ? firstArg.getEnd() : call.getEnd() - 1;\n\t\tedits.push({\n\t\t\tpos: insertAt,\n\t\t\ttext: `, { __site: ${literal} }`\n\t\t});\n\t\treturn;\n\t}\n\tif (ts.isObjectLiteralExpression(optionsArg)) {\n\t\tedits.push({\n\t\t\tpos: optionsArg.getStart() + 1,\n\t\t\ttext: ` __site: ${literal},`\n\t\t});\n\t\treturn;\n\t}\n\tedits.push({\n\t\tpos: optionsArg.getStart(),\n\t\ttext: \"{ ...\"\n\t});\n\tedits.push({\n\t\tpos: optionsArg.getEnd(),\n\t\ttext: `, __site: ${literal} }`\n\t});\n}\n/** Merge `__site` into `ctx.hook(opts?)` — options are the first (only) argument. */\nfunction pushHookOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst optionsArg = call.arguments[0];\n\tif (!optionsArg) {\n\t\tedits.push({\n\t\t\tpos: call.getEnd() - 1,\n\t\t\ttext: `{ __site: ${literal} }`\n\t\t});\n\t\treturn;\n\t}\n\tif (ts.isObjectLiteralExpression(optionsArg)) {\n\t\tedits.push({\n\t\t\tpos: optionsArg.getStart() + 1,\n\t\t\ttext: ` __site: ${literal},`\n\t\t});\n\t\treturn;\n\t}\n\tedits.push({\n\t\tpos: optionsArg.getStart(),\n\t\ttext: \"{ ...\"\n\t});\n\tedits.push({\n\t\tpos: optionsArg.getEnd(),\n\t\ttext: `, __site: ${literal} }`\n\t});\n}\n/** Append `{ __site }` as the second arg to `ctx.sleep(duration)`. */\nfunction pushSleepOptionsEdit(edits, call, id) {\n\tconst literal = JSON.stringify(id);\n\tconst durationArg = call.arguments[0];\n\tconst insertAt = durationArg ? durationArg.getEnd() : call.getEnd() - 1;\n\tedits.push({\n\t\tpos: insertAt,\n\t\ttext: `, { __site: ${literal} }`\n\t});\n}\nfunction toPosix$5(path) {\n\treturn path.split(sep).join(\"/\");\n}\n/**\n* Rolldown plugin that runs {@link injectCallSiteIds} over workflow source files\n* (and their same-file helpers) before transpile. Scoped to `src/workflows/` so\n* non-workflow modules are untouched; cross-file helpers stay unkeyed by design.\n*/\nfunction callSiteIdInjectionPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst workflowsPrefix = toPosix$5(`${options.root}/${srcDir}/workflows/`);\n\treturn {\n\t\tname: \"keystroke-call-site-ids\",\n\t\ttransform(code, id) {\n\t\t\tconst normalized = toPosix$5(id);\n\t\t\tif (!normalized.startsWith(workflowsPrefix) || !normalized.endsWith(\".ts\")) return null;\n\t\t\tconst transformed = injectCallSiteIds(code, normalized);\n\t\t\treturn transformed === code ? null : {\n\t\t\t\tcode: transformed,\n\t\t\t\tmap: null\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\n//#region src/workflow-diagnostics.ts\nconst TEST_FILE = /\\.(test|int\\.test|spec)\\.ts$/;\nfunction toPosix$4(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction collectTsFiles(dir, out) {\n\tlet entries;\n\ttry {\n\t\tentries = readdirSync(dir);\n\t} catch {\n\t\treturn;\n\t}\n\tfor (const entry of entries) {\n\t\tif (entry === \"node_modules\" || entry.startsWith(\".\")) continue;\n\t\tconst full = join(dir, entry);\n\t\tif (statSync(full).isDirectory()) {\n\t\t\tcollectTsFiles(full, out);\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.endsWith(\".ts\") && !TEST_FILE.test(entry)) out.push(full);\n\t}\n}\n/**\n* Run the workflow-canvas reliability checks over every `src/**` module. Errors\n* (steps outside a workflow, steps nested as call arguments) block the build;\n* warnings (opaque code-blocks, dropped spread inputs) explain each degraded\n* construct. Best-effort per-file: an unparseable file is skipped, never fatal.\n*/\nfunction collectWorkflowDiagnostics(root, srcDir = \"src\") {\n\tconst srcRoot = join(root, srcDir);\n\tif (!existsSync(srcRoot)) return [];\n\tconst files = [];\n\tcollectTsFiles(srcRoot, files);\n\tconst diagnostics = [];\n\tfor (const file of files) {\n\t\tconst rel = toPosix$4(relative(root, file));\n\t\ttry {\n\t\t\tconst source = readFileSync(file, \"utf8\");\n\t\t\tdiagnostics.push(...diagnoseWorkflowSource(source, rel));\n\t\t} catch {}\n\t}\n\treturn diagnostics;\n}\nfunction formatDiagnostic(diagnostic) {\n\treturn ` ${diagnostic.line !== void 0 ? `${diagnostic.fileName}:${diagnostic.line}:${diagnostic.column ?? 1}` : diagnostic.fileName}\\n ${diagnostic.message}`;\n}\n/** Throw when any blocking (error-severity) diagnostic is found. */\nfunction assertWorkflowDiagnosticErrorsFrom(diagnostics) {\n\tconst errors = diagnostics.filter((d) => d.severity === \"error\");\n\tif (errors.length > 0) throw new Error(`Workflow canvas: ${errors.length} unsupported construct(s) must be fixed before deploy:\\n${errors.map(formatDiagnostic).join(\"\\n\")}\\n`);\n}\n/** Print soft (warning-severity) diagnostics after a successful build. */\nfunction warnWorkflowDiagnosticsFrom(diagnostics) {\n\tconst warnings = diagnostics.filter((d) => d.severity === \"warning\");\n\tif (warnings.length > 0) console.warn(`\\n⚠ Workflow canvas: ${warnings.length} construct(s) will render as a degraded (opaque) canvas:\\n${warnings.map(formatDiagnostic).join(\"\\n\")}\\n`);\n}\n/** Throw when any blocking (error-severity) diagnostic is found. Run before building. */\nfunction assertWorkflowDiagnosticErrors(root, srcDir = \"src\") {\n\tassertWorkflowDiagnosticErrorsFrom(collectWorkflowDiagnostics(root, srcDir));\n}\n/** Print soft (warning-severity) diagnostics after a successful build. */\nfunction warnWorkflowDiagnostics(root, srcDir = \"src\") {\n\twarnWorkflowDiagnosticsFrom(collectWorkflowDiagnostics(root, srcDir));\n}\n/**\n* Collect diagnostics, print warnings, and throw a formatted error when any\n* blocking (error-severity) diagnostic is found.\n*\n* @deprecated Prefer {@link assertWorkflowDiagnosticErrors} before build and\n* {@link warnWorkflowDiagnostics} after build so warnings appear below build logs.\n*/\nfunction assertWorkflowDiagnostics(root, srcDir = \"src\") {\n\tconst diagnostics = collectWorkflowDiagnostics(root, srcDir);\n\tassertWorkflowDiagnosticErrorsFrom(diagnostics);\n\twarnWorkflowDiagnosticsFrom(diagnostics);\n}\n//#endregion\n//#region src/route-manifest-cache.ts\nconst CACHE_DIR = \".keystroke/cache\";\nconst CACHE_KEY_FILE = \"route-manifest.key\";\nconst CACHE_MANIFEST_DIR = \"manifest\";\nfunction cachePaths(projectRoot) {\n\tconst dir = join(projectRoot, CACHE_DIR);\n\treturn {\n\t\tkeyPath: join(dir, CACHE_KEY_FILE),\n\t\tmanifestDir: join(dir, CACHE_MANIFEST_DIR)\n\t};\n}\n/** Fingerprint of integration package versions resolved from the project. */\nfunction integrationPackagesFingerprint(projectRoot) {\n\tconst hash = createHash(\"sha256\");\n\tconst packageJsonPath = join(projectRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return hash.digest(\"hex\");\n\tconst raw = readFileSync(packageJsonPath, \"utf8\");\n\thash.update(raw);\n\tlet dependencies = {};\n\ttry {\n\t\tdependencies = JSON.parse(raw).dependencies ?? {};\n\t} catch {\n\t\treturn hash.digest(\"hex\");\n\t}\n\tconst require = createRequire(packageJsonPath);\n\tfor (const name of Object.keys(dependencies).sort()) {\n\t\tif (!name.startsWith(\"@keystrokehq/\")) continue;\n\t\ttry {\n\t\t\tconst resolved = require.resolve(`${name}/package.json`);\n\t\t\thash.update(name);\n\t\t\thash.update(\"\\0\");\n\t\t\thash.update(readFileSync(resolved, \"utf8\"));\n\t\t\thash.update(\"\\0\");\n\t\t} catch {\n\t\t\thash.update(name);\n\t\t\thash.update(\"\\0missing\\0\");\n\t\t}\n\t}\n\treturn hash.digest(\"hex\");\n}\n/**\n* Content-addressed key for the deploy route-manifest. Invalidates when project\n* sources, build entries, ignore set, phase, or integration package versions change.\n*/\nfunction computeRouteManifestCacheKey(input) {\n\tconst hash = createHash(\"sha256\");\n\thash.update(input.phase);\n\thash.update(\"\\0\");\n\thash.update(input.integrationFingerprint);\n\thash.update(\"\\0\");\n\tfor (const key of [...input.buildEntryKeys].sort()) {\n\t\thash.update(key);\n\t\thash.update(\"\\0\");\n\t}\n\tfor (const file of [...input.ignoredFiles].sort()) {\n\t\thash.update(file);\n\t\thash.update(\"\\0\");\n\t}\n\tfor (const file of [...input.sourceFiles].sort((a, b) => a.path.localeCompare(b.path))) {\n\t\thash.update(file.path);\n\t\thash.update(\"\\0\");\n\t\thash.update(file.hash);\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\n/** True when `.keystroke/cache/route-manifest.key` matches `cacheKey`. */\nfunction isRouteManifestCacheHit(projectRoot, cacheKey) {\n\tconst { keyPath, manifestDir } = cachePaths(projectRoot);\n\tif (!existsSync(keyPath) || !existsSync(join(manifestDir, \"manifest.json\"))) return false;\n\treturn readFileSync(keyPath, \"utf8\").trim() === cacheKey;\n}\n/** Restore cached modular manifest into `dist/.keystroke/` when the key matches. */\nfunction tryRestoreCachedRouteManifest(projectRoot, cacheKey) {\n\tif (!isRouteManifestCacheHit(projectRoot, cacheKey)) return false;\n\tconst { manifestDir } = cachePaths(projectRoot);\n\tconst dest = join(projectRoot, \"dist\", \".keystroke\");\n\tmkdirSync(dest, { recursive: true });\n\tfor (const name of [\n\t\t\"manifest.json\",\n\t\t\"modules\",\n\t\t\"catalogs\",\n\t\t\"assets\",\n\t\t\"build-index.json\"\n\t]) {\n\t\tconst from = join(manifestDir, name);\n\t\tif (!existsSync(from)) continue;\n\t\tcpSync(from, join(dest, name), { recursive: true });\n\t}\n\tconst assetsModule = join(manifestDir, \"assets.mjs\");\n\tif (existsSync(assetsModule)) cpSync(assetsModule, join(dest, \"assets.mjs\"));\n\treturn existsSync(join(projectRoot, PROJECT_MANIFEST_REL_PATH));\n}\n/** Persist the just-emitted modular manifest into the deploy cache. */\nfunction storeCachedRouteManifest(projectRoot, cacheKey) {\n\tconst sourceMeta = join(projectRoot, \"dist\", \".keystroke\");\n\tif (!existsSync(join(sourceMeta, \"manifest.json\"))) return;\n\tconst { keyPath, manifestDir } = cachePaths(projectRoot);\n\trmSync(manifestDir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tmkdirSync(manifestDir, { recursive: true });\n\tfor (const name of [\n\t\t\"manifest.json\",\n\t\t\"modules\",\n\t\t\"catalogs\",\n\t\t\"assets\",\n\t\t\"assets.mjs\",\n\t\t\"build-index.json\"\n\t]) {\n\t\tconst from = join(sourceMeta, name);\n\t\tif (!existsSync(from)) continue;\n\t\tcpSync(from, join(manifestDir, name), { recursive: true });\n\t}\n\tmkdirSync(dirname(keyPath), { recursive: true });\n\twriteFileSync(keyPath, `${cacheKey}\\n`);\n}\n//#endregion\n//#region src/dist-deploy-outputs.ts\n/**\n* True when a prior deploy `dist/` still has the compiled outputs for every\n* build entry (so we can skip tsdown when the content-hash cache hits).\n*/\nfunction distDeployOutputsPresent(projectRoot, buildEntries) {\n\tconst distRoot = join(projectRoot, \"dist\");\n\tif (!existsSync(distRoot)) return false;\n\tfor (const entryKey of Object.keys(buildEntries)) if (!existsSync(join(distRoot, entryKey === \"config\" ? \"config.mjs\" : `${entryKey}.mjs`))) return false;\n\tif (!existsSync(join(distRoot, \".keystroke\", \"assets.mjs\"))) return false;\n\treturn true;\n}\n//#endregion\n//#region src/modular-assets.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\n/** Content hash of every file under a skill/files pack directory. */\nfunction hashAssetPackDir(dirPath) {\n\tconst hash = createHash(\"sha256\");\n\tconst walk = (current) => {\n\t\tfor (const name of readdirSync(current).sort()) {\n\t\t\tif (SKIP_DIRS.has(name)) continue;\n\t\t\tconst abs = join(current, name);\n\t\t\tconst st = statSync(abs);\n\t\t\tif (st.isDirectory()) {\n\t\t\t\twalk(abs);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!st.isFile()) continue;\n\t\t\thash.update(relative(dirPath, abs).replace(/\\\\/g, \"/\"));\n\t\t\thash.update(\"\\0\");\n\t\t\thash.update(readFileSync(abs));\n\t\t\thash.update(\"\\0\");\n\t\t}\n\t};\n\tif (!statSync(dirPath, { throwIfNoEntry: false })?.isDirectory()) return hash.digest(\"hex\");\n\twalk(dirPath);\n\treturn hash.digest(\"hex\");\n}\nfunction listPackIds(rootPath) {\n\tif (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return [];\n\treturn readdirSync(rootPath).filter((name) => !SKIP_DIRS.has(name)).filter((name) => statSync(join(rootPath, name)).isDirectory()).sort();\n}\nfunction shardRelPath(kind, id) {\n\treturn `${kind}/${id}.json`;\n}\nfunction readIndex(assetsRoot) {\n\tconst path = join(assetsRoot, \"index.json\");\n\tif (!existsSync(path)) return;\n\ttry {\n\t\treturn JSON.parse(readFileSync(path, \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction loadShard(assetsRoot, rel) {\n\tconst abs = join(assetsRoot, rel);\n\tif (!existsSync(abs)) return;\n\ttry {\n\t\treturn JSON.parse(readFileSync(abs, \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction renderAssetModule$3(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\nfunction packKind(input) {\n\tconst kindRoot = join(input.projectRoot, input.srcDir, input.kind);\n\tconst prevById = new Map((input.kind === \"skills\" ? input.previous?.skills : input.previous?.files)?.map((ref) => [ref.id, ref]) ?? []);\n\tconst packs = {};\n\tconst refs = [];\n\tconst wrote = [];\n\tconst skipped = [];\n\tfor (const id of listPackIds(kindRoot)) {\n\t\tconst packDir = join(kindRoot, id);\n\t\tconst contentHash = hashAssetPackDir(packDir);\n\t\tconst path = shardRelPath(input.kind, id);\n\t\tconst existing = prevById.get(id)?.contentHash === contentHash ? loadShard(input.assetsRoot, path) : void 0;\n\t\tlet packed;\n\t\tif (existing) {\n\t\t\tpacked = existing;\n\t\t\tskipped.push(path);\n\t\t} else {\n\t\t\tpacked = packDirFromDisk(packDir);\n\t\t\tconst abs = join(input.assetsRoot, path);\n\t\t\tmkdirSync(dirname(abs), { recursive: true });\n\t\t\twriteFileSync(abs, `${JSON.stringify(packed)}\\n`);\n\t\t\twrote.push(path);\n\t\t}\n\t\tpacks[id] = packed;\n\t\trefs.push({\n\t\t\tid,\n\t\t\tpath,\n\t\t\tcontentHash\n\t\t});\n\t}\n\treturn {\n\t\tpacks,\n\t\trefs,\n\t\twrote,\n\t\tskipped\n\t};\n}\nfunction removeOrphanShards(assetsRoot, kind, keep) {\n\tconst kindDir = join(assetsRoot, kind);\n\tif (!existsSync(kindDir)) return;\n\tfor (const name of readdirSync(kindDir)) {\n\t\tif (!name.endsWith(\".json\")) continue;\n\t\tconst rel = `${kind}/${name}`;\n\t\tif (!keep.has(rel)) rmSync(join(kindDir, name), { force: true });\n\t}\n}\n/**\n* Pack `src/skills` + `src/files` into per-pack shards with content-hash skip.\n* Composes `dist/.keystroke/assets.mjs` only when at least one shard changed\n* (or the composed module is missing) so the runtime loader stays unchanged.\n*/\nfunction packModularProjectAssets(input) {\n\tconst srcDir = input.srcDir ?? \"src\";\n\tconst outDir = input.outDir ?? \"dist\";\n\tconst keystrokeDir = join(input.projectRoot, outDir, \".keystroke\");\n\tconst assetsRoot = join(keystrokeDir, \"assets\");\n\tmkdirSync(assetsRoot, { recursive: true });\n\tconst previous = readIndex(assetsRoot);\n\tconst skills = packKind({\n\t\tprojectRoot: input.projectRoot,\n\t\tsrcDir,\n\t\tkind: \"skills\",\n\t\tassetsRoot,\n\t\tprevious\n\t});\n\tconst files = packKind({\n\t\tprojectRoot: input.projectRoot,\n\t\tsrcDir,\n\t\tkind: \"files\",\n\t\tassetsRoot,\n\t\tprevious\n\t});\n\tremoveOrphanShards(assetsRoot, \"skills\", new Set(skills.refs.map((ref) => ref.path)));\n\tremoveOrphanShards(assetsRoot, \"files\", new Set(files.refs.map((ref) => ref.path)));\n\tconst index = {\n\t\tversion: 1,\n\t\tskills: skills.refs,\n\t\tfiles: files.refs\n\t};\n\twriteFileSync(join(assetsRoot, \"index.json\"), `${JSON.stringify(index)}\\n`);\n\tconst manifest = {\n\t\tskills: skills.packs,\n\t\tfiles: files.packs\n\t};\n\tconst assetsModulePath = join(keystrokeDir, \"assets.mjs\");\n\tconst wroteShards = [...skills.wrote, ...files.wrote];\n\tconst skippedShards = [...skills.skipped, ...files.skipped];\n\tconst prevSkillIds = (previous?.skills ?? []).map((r) => r.id).join(\"\\0\");\n\tconst nextSkillIds = skills.refs.map((r) => r.id).join(\"\\0\");\n\tconst prevFileIds = (previous?.files ?? []).map((r) => r.id).join(\"\\0\");\n\tconst nextFileIds = files.refs.map((r) => r.id).join(\"\\0\");\n\tconst membershipChanged = prevSkillIds !== nextSkillIds || prevFileIds !== nextFileIds;\n\tconst anyDirty = wroteShards.length > 0 || !existsSync(assetsModulePath) || membershipChanged;\n\tlet wroteAssetsModule = false;\n\tif (anyDirty) {\n\t\twriteFileSync(assetsModulePath, renderAssetModule$3(manifest));\n\t\twroteAssetsModule = true;\n\t}\n\treturn {\n\t\tmanifest,\n\t\tindex,\n\t\twroteShards,\n\t\tskippedShards,\n\t\twroteAssetsModule\n\t};\n}\n//#endregion\n//#region src/build-index.ts\n/** Relative path under project root. */\nconst BUILD_INDEX_REL_PATH = \"dist/.keystroke/build-index.json\";\nfunction toPosix$3(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction sha256Bytes(data) {\n\treturn createHash(\"sha256\").update(data).digest(\"hex\");\n}\nfunction compactJson(value) {\n\treturn `${JSON.stringify(value)}\\n`;\n}\n/** sha256 over sorted (path, file bytes) for project-relative inputs. */\nfunction hashSourceInputs(projectRoot, inputs) {\n\tconst hash = createHash(\"sha256\");\n\tfor (const rel of [...inputs].sort()) {\n\t\thash.update(rel);\n\t\thash.update(\"\\0\");\n\t\tconst abs = join(projectRoot, rel);\n\t\tif (existsSync(abs) && statSync(abs).isFile()) hash.update(readFileSync(abs));\n\t\telse hash.update(\"missing\");\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\n/** Fingerprint bundled package.json files (version bumps dirty consumers). */\nfunction hashBundledPackages(projectRoot, packages) {\n\tconst hash = createHash(\"sha256\");\n\tconst packageJsonPath = join(projectRoot, \"package.json\");\n\tif (!existsSync(packageJsonPath)) return hash.digest(\"hex\");\n\tconst require = createRequire(packageJsonPath);\n\tfor (const name of [...packages].sort()) {\n\t\thash.update(name);\n\t\thash.update(\"\\0\");\n\t\ttry {\n\t\t\tconst resolved = require.resolve(`${name}/package.json`);\n\t\t\thash.update(readFileSync(resolved, \"utf8\"));\n\t\t} catch {\n\t\t\thash.update(\"missing\");\n\t\t}\n\t\thash.update(\"\\0\");\n\t}\n\treturn hash.digest(\"hex\");\n}\nfunction buildIndexPath(projectRoot) {\n\treturn join(projectRoot, BUILD_INDEX_REL_PATH);\n}\nfunction tryReadBuildIndex(projectRoot) {\n\tconst path = buildIndexPath(projectRoot);\n\tif (!existsSync(path)) return;\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(path, \"utf8\"));\n\t\tif (parsed.version !== 1 || typeof parsed.entries !== \"object\") return;\n\t\treturn parsed;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction writeBuildIndex(projectRoot, index) {\n\tconst path = buildIndexPath(projectRoot);\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, compactJson(index));\n}\n/** Invert inputs → entry keys (action/shared file → consumers). */\nfunction consumersOf(projectRoot, sourcePath) {\n\tconst index = tryReadBuildIndex(projectRoot);\n\tif (!index) return [];\n\tconst needle = toPosix$3(sourcePath).replace(/^\\.\\//, \"\");\n\tconst owners = [];\n\tfor (const [key, entry] of Object.entries(index.entries)) if (entry.inputs.includes(needle)) owners.push(key);\n\treturn owners.sort();\n}\n/**\n* Compare on-disk build-index to current sources / bundled package fingerprints.\n* Does not run the bundler.\n*/\nfunction listDirtyEntries(projectRoot, currentEntryKeys) {\n\tconst index = tryReadBuildIndex(projectRoot);\n\tconst expected = [...currentEntryKeys].filter((key) => key !== \"config\").sort();\n\tif (!index) return {\n\t\tdirty: expected,\n\t\tforceFull: true,\n\t\treason: \"missing build-index\"\n\t};\n\tconst indexed = Object.keys(index.entries).sort();\n\tif (indexed.length !== expected.length || indexed.some((key, i) => key !== expected[i])) return {\n\t\tdirty: expected,\n\t\tforceFull: true,\n\t\treason: \"entry membership changed\"\n\t};\n\tconst dirty = [];\n\tfor (const key of expected) {\n\t\tconst entry = index.entries[key];\n\t\tif (!existsSync(join(projectRoot, \"dist\", entry.artifactPath))) {\n\t\t\tdirty.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\tif (hashSourceInputs(projectRoot, entry.inputs) !== entry.sourceHash) {\n\t\t\tdirty.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\tif (hashBundledPackages(projectRoot, entry.packages) !== entry.packagesHash) dirty.push(key);\n\t}\n\treturn {\n\t\tdirty,\n\t\tforceFull: false\n\t};\n}\n/** Default manifest shard paths for an entry key (best-effort). */\nfunction defaultManifestPathsForEntry(entryKey) {\n\tconst [kind, ...rest] = entryKey.split(\"/\");\n\tconst id = rest.join(\"/\");\n\tif (!kind || !id) return [];\n\tif (kind === \"agents\") return [`modules/agents/${id}.json`];\n\tif (kind === \"workflows\") return [`modules/workflows/${id}.json`, `modules/workflows/${id}.flow.json`];\n\tif (kind === \"triggers\") return [`modules/triggers/${id}.json`];\n\tif (kind === \"actions\") return [\"catalogs/actions.json\"];\n\treturn [];\n}\nfunction entryArtifact(projectRoot, entryKey) {\n\tconst entry = tryReadBuildIndex(projectRoot)?.entries[entryKey];\n\tif (!entry) return;\n\treturn {\n\t\tartifactPath: entry.artifactPath,\n\t\tartifactHash: entry.artifactHash\n\t};\n}\n/** Build a BuildIndexEntry from closure facts + emitted artifact bytes. */\nfunction makeBuildIndexEntry(input) {\n\treturn {\n\t\tsourceHash: hashSourceInputs(input.projectRoot, input.inputs),\n\t\tartifactHash: sha256Bytes(input.artifactBytes),\n\t\tartifactPath: toPosix$3(input.artifactPath),\n\t\tinputs: [...input.inputs].sort(),\n\t\tpackages: [...input.packages].sort(),\n\t\tpackagesHash: hashBundledPackages(input.projectRoot, input.packages),\n\t\tmanifestPaths: defaultManifestPathsForEntry(input.entryKey)\n\t};\n}\n/** True when every current entry is clean and artifacts exist. */\nfunction isBuildIndexClean(projectRoot, currentEntryKeys) {\n\tconst { dirty, forceFull } = listDirtyEntries(projectRoot, currentEntryKeys);\n\treturn !forceFull && dirty.length === 0;\n}\n//#endregion\n//#region src/entry-closure-plugin.ts\nfunction toPosix$2(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction projectRelativeModuleId$1(root, id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\tif (!isAbsolute(absolute) && !absolute.startsWith(\".\")) return null;\n\tconst normalizedRoot = normalizeBuildFilePath(root);\n\tlet normalizedAbsolute;\n\ttry {\n\t\tnormalizedAbsolute = normalizeBuildFilePath(absolute);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst relativePath = toPosix$2(relative(normalizedRoot, normalizedAbsolute));\n\tif (!relativePath || relativePath.startsWith(\"..\") || relativePath.includes(\"node_modules/\") || relativePath.startsWith(\"node_modules/\")) return null;\n\treturn relativePath;\n}\nfunction packageNameFromModuleId$1(id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\ttry {\n\t\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst normalized = absolute.replace(/\\\\/g, \"/\");\n\tconst index = normalized.lastIndexOf(\"/node_modules/\");\n\tif (index < 0) return null;\n\tconst rest = normalized.slice(index + 14);\n\tif (!rest || rest.startsWith(\".\")) return null;\n\tif (rest.startsWith(\"@\")) {\n\t\tconst parts = rest.split(\"/\");\n\t\tif (parts.length < 2 || !parts[0] || !parts[1]) return null;\n\t\treturn `${parts[0]}/${parts[1]}`;\n\t}\n\treturn rest.split(\"/\")[0] || null;\n}\nfunction isFrameworkExternalPackage(name) {\n\tif (!name.startsWith(\"@keystrokehq/\")) return false;\n\tconst pkg = name.slice(13).split(\"/\")[0] ?? \"\";\n\treturn RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\n/**\n* Collect per-entry source inputs + bundled packages from the emit graph.\n* Used to write `build-index.json` after tsdown.\n*/\nfunction entryClosurePlugin(options) {\n\tconst root = normalizeBuildFilePath(options.root);\n\treturn {\n\t\tname: \"keystroke-entry-closure\",\n\t\tgenerateBundle(_outputOptions, bundle) {\n\t\t\tconst closures = /* @__PURE__ */ new Map();\n\t\t\tfor (const output of Object.values(bundle)) {\n\t\t\t\tif (output.type !== \"chunk\" || !output.isEntry) continue;\n\t\t\t\tconst entryKey = output.name.replace(/\\\\/g, \"/\");\n\t\t\t\tif (entryKey === \"config\" || entryKey.includes(\"\\0\")) continue;\n\t\t\t\tif (!entryKey.startsWith(\"agents/\") && !entryKey.startsWith(\"actions/\") && !entryKey.startsWith(\"workflows/\") && !entryKey.startsWith(\"triggers/\")) continue;\n\t\t\t\tconst inputs = /* @__PURE__ */ new Set();\n\t\t\t\tconst packages = /* @__PURE__ */ new Set();\n\t\t\t\tconst moduleIds = \"moduleIds\" in output && Array.isArray(output.moduleIds) ? output.moduleIds : Object.keys(output.modules ?? {});\n\t\t\t\tfor (const moduleId of moduleIds) {\n\t\t\t\t\tconst rel = projectRelativeModuleId$1(root, moduleId);\n\t\t\t\t\tif (rel) inputs.add(rel);\n\t\t\t\t\tconst pkg = packageNameFromModuleId$1(moduleId);\n\t\t\t\t\tif (pkg && !isFrameworkExternalPackage(pkg) && pkg !== \"zod\") packages.add(pkg);\n\t\t\t\t}\n\t\t\t\tif (output.facadeModuleId) {\n\t\t\t\t\tconst entryRel = projectRelativeModuleId$1(root, output.facadeModuleId);\n\t\t\t\t\tif (entryRel) inputs.add(entryRel);\n\t\t\t\t}\n\t\t\t\tclosures.set(entryKey, {\n\t\t\t\t\tinputs: [...inputs].sort(),\n\t\t\t\t\tpackages: [...packages].sort()\n\t\t\t\t});\n\t\t\t}\n\t\t\toptions.onClosures(closures);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/build-self-contained.ts\nconst ASSETS_MODULE$2 = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX$1 = `\\0${ASSETS_MODULE$2}:`;\nfunction renderAssetModule$2(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Resolve `@keystrokehq/assets` without re-packing on every entry. */\nfunction agentAssetsResolvePlugin(manifest) {\n\treturn {\n\t\tname: \"keystroke-assets-resolve\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$2) return null;\n\t\t\treturn `${VIRTUAL_PREFIX$1}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX$1}manifest`) return null;\n\t\t\treturn renderAssetModule$2(manifest);\n\t\t}\n\t};\n}\n/**\n* Build each entry in isolation so local imports are inlined (self-contained\n* `.mjs`) and closures include transitive project sources — same contract as\n* `buildFilteredApp`.\n*/\nasync function buildSelfContainedEntries(options) {\n\tconst root = options.root;\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst phase = options.phase ?? \"build\";\n\tconst distRoot = join(root, outDir);\n\tconst clean = options.clean ?? true;\n\tconst allEntries = {\n\t\t...options.configEntry ? { config: options.configEntry } : {},\n\t\t...options.buildEntries\n\t};\n\tconst entryKeys = Object.keys(allEntries).sort();\n\tif (entryKeys.length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\tconst dirtySet = new Set(options.dirtyKeys && options.dirtyKeys.length > 0 ? options.dirtyKeys : entryKeys.filter((key) => key !== \"config\").concat(options.configEntry ? [\"config\"] : []));\n\tif (options.configEntry && (clean || dirtySet.size > 0)) dirtySet.add(\"config\");\n\tif (clean && existsSync(distRoot)) rmSync(distRoot, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tconst packed = packModularProjectAssets({\n\t\tprojectRoot: root,\n\t\tsrcDir,\n\t\toutDir\n\t});\n\tconst closures = /* @__PURE__ */ new Map();\n\tconst previous = tryReadBuildIndex(root);\n\tfor (const entryKey of [...dirtySet].sort()) {\n\t\tconst entryPath = allEntries[entryKey];\n\t\tif (!entryPath) continue;\n\t\tconst plugins = [\n\t\t\tkeystrokeIgnoreGuardPlugin({\n\t\t\t\troot,\n\t\t\t\tignoredFiles: options.ignoredFiles\n\t\t\t}),\n\t\t\tagentAssetsResolvePlugin(packed.manifest),\n\t\t\tentryClosurePlugin({\n\t\t\t\troot,\n\t\t\t\tonClosures: (next) => {\n\t\t\t\t\tfor (const [key, value] of next) closures.set(key, value);\n\t\t\t\t}\n\t\t\t})\n\t\t];\n\t\tif (entryKey.startsWith(\"workflows/\")) plugins.splice(1, 0, callSiteIdInjectionPlugin({\n\t\t\troot,\n\t\t\tsrcDir\n\t\t}));\n\t\tawait build(mergeConfig(baseTsdownConfig, {\n\t\t\tentry: { [entryKey]: entryPath },\n\t\t\tformat: [\"esm\"],\n\t\t\toutDir: distRoot,\n\t\t\tclean: false,\n\t\t\tdts: false,\n\t\t\tsourcemap: phase === \"deploy\" ? false : true,\n\t\t\t...phase === \"deploy\" ? { logLevel: \"error\" } : {},\n\t\t\tloader: { \".md\": \"text\" },\n\t\t\tdeps: userAppBuildDepsConfig(),\n\t\t\tplugins\n\t\t}));\n\t}\n\tconst entries = {};\n\tfor (const key of Object.keys(options.buildEntries).sort()) {\n\t\tif (closures.has(key)) {\n\t\t\tconst closure = closures.get(key);\n\t\t\tconst artifactPath = `${key}.mjs`;\n\t\t\tconst abs = join(distRoot, artifactPath);\n\t\t\tif (!existsSync(abs)) continue;\n\t\t\tentries[key] = makeBuildIndexEntry({\n\t\t\t\tprojectRoot: root,\n\t\t\t\tentryKey: key,\n\t\t\t\tinputs: closure.inputs,\n\t\t\t\tpackages: closure.packages,\n\t\t\t\tartifactPath,\n\t\t\t\tartifactBytes: readFileSync(abs)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (previous?.entries[key]) entries[key] = previous.entries[key];\n\t}\n\tconst index = {\n\t\tversion: 1,\n\t\tintegrationFingerprint: integrationPackagesFingerprint(root),\n\t\tentries\n\t};\n\twriteBuildIndex(root, index);\n\treturn {\n\t\tclosures,\n\t\tindex\n\t};\n}\n//#endregion\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$1(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction distRelativePath(entryKey) {\n\treturn `${entryKey}.mjs`;\n}\nfunction renderAssetModule$1(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\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\tsourcemap: false,\n\t\tlogLevel: \"error\",\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$1(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 workflowDiagnostics = collectWorkflowDiagnostics(root, srcDir);\n\tassertWorkflowDiagnosticErrorsFrom(workflowDiagnostics);\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\tconst assetsManifest = packAssetDirs(root, srcDir);\n\t\tfiles.push({\n\t\t\tentryKey: \".keystroke/assets\",\n\t\t\trelativePath: \".keystroke/assets.mjs\",\n\t\t\tcontents: Buffer.from(renderAssetModule$1(assetsManifest), \"utf8\")\n\t\t});\n\t} finally {\n\t\twarnWorkflowDiagnosticsFrom(workflowDiagnostics);\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/merge-filtered-artifact.ts\n/**\n* Merge a filtered rebuild into a previously packed `dist/` artifact.\n* Dual-reads modular or legacy base manifests and re-emits modular shards.\n*/\nasync function mergeFilteredArtifact(input) {\n\tconst mergeRoot = mkdtempSync(join(tmpdir(), \"keystroke-artifact-merge-\"));\n\ttry {\n\t\textractProjectArtifact(input.baseArchive, mergeRoot);\n\t\tpersistModularRouteManifest(mergeRoot, mergeStoredRouteManifest(readRouteManifest(mergeRoot), input.filtered.manifestEntries));\n\t\tfor (const file of input.filtered.files) {\n\t\t\tconst destination = join(mergeRoot, \"dist\", file.relativePath);\n\t\t\tmkdirSync(dirname(destination), { recursive: true });\n\t\t\twriteFileSync(destination, file.contents);\n\t\t\tif (file.sourceMap) writeFileSync(`${destination}.map`, file.sourceMap);\n\t\t}\n\t\treturn packDistTree(mergeRoot);\n\t} finally {\n\t\trmSync(mergeRoot, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n}\n//#endregion\n//#region src/safe-filtered-deploy.ts\n/** Analyzer stdout / plan digest contract version for Modal Precise Deploy. */\nconst ANALYZER_CONTRACT_VERSION = \"safe-filtered-deploy-v3\";\nconst PACKAGE_MANIFEST_FILES = new Set([\"package.json\"]);\nconst LOCKFILE_NAMES = new Set([\n\t\"package-lock.json\",\n\t\"pnpm-lock.yaml\",\n\t\"yarn.lock\",\n\t\"bun.lock\",\n\t\"bun.lockb\",\n\t\"npm-shrinkwrap.json\"\n]);\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction requireFull(code, reason) {\n\treturn {\n\t\trequireFull: true,\n\t\tcode,\n\t\treason\n\t};\n}\nfunction isDeployableResourceKey(key) {\n\treturn key.startsWith(\"agents/\") || key.startsWith(\"workflows/\");\n}\nfunction kindFromResourceKey(key) {\n\tif (key.startsWith(\"agents/\")) return \"agent\";\n\tif (key.startsWith(\"workflows/\")) return \"workflow\";\n\treturn null;\n}\n/** Normalize caller paths to project-relative posix form. */\nfunction normalizeProjectRelativePath(root, path) {\n\tconst withoutDot = path.trim().replace(/\\\\/g, \"/\").replace(/^\\.\\//, \"\");\n\tconst absolute = isAbsolute(withoutDot) ? withoutDot : join(normalizeBuildFilePath(root), withoutDot);\n\tconst relativePath = toPosix(relative(normalizeBuildFilePath(root), normalizeBuildFilePath(absolute)));\n\tif (!relativePath || relativePath === \".\" || relativePath.startsWith(\"..\")) throw new Error(`Path \"${path}\" is outside project root`);\n\treturn relativePath;\n}\nfunction basenamePosix(path) {\n\tconst parts = path.split(\"/\");\n\treturn parts[parts.length - 1] ?? path;\n}\nfunction isPackageManifestPath(path) {\n\treturn PACKAGE_MANIFEST_FILES.has(basenamePosix(path));\n}\nfunction isLockfilePath(path) {\n\treturn LOCKFILE_NAMES.has(basenamePosix(path));\n}\nfunction normalizeChanges(root, changedPaths) {\n\tconst byPath = /* @__PURE__ */ new Map();\n\tfor (const change of changedPaths) {\n\t\tconst raw = typeof change === \"string\" ? {\n\t\t\tpath: change,\n\t\t\tkind: \"modified\"\n\t\t} : change;\n\t\tlet path;\n\t\ttry {\n\t\t\tpath = normalizeProjectRelativePath(root, raw.path);\n\t\t} catch {\n\t\t\treturn requireFull(\"unproven_safe\", `Changed path \"${raw.path}\" cannot be normalized to a project-relative source path`);\n\t\t}\n\t\tlet previousPath;\n\t\tif (raw.previousPath) try {\n\t\t\tpreviousPath = normalizeProjectRelativePath(root, raw.previousPath);\n\t\t} catch {\n\t\t\treturn requireFull(\"unproven_safe\", `Rename previous path \"${raw.previousPath}\" cannot be normalized`);\n\t\t}\n\t\tconst normalized = {\n\t\t\tpath,\n\t\t\tkind: raw.kind,\n\t\t\t...previousPath ? { previousPath } : {}\n\t\t};\n\t\tconst existing = byPath.get(path);\n\t\tif (existing && existing.kind !== normalized.kind) return requireFull(\"ambiguous_ownership\", `Changed path \"${path}\" has ambiguous change kinds (${existing.kind} vs ${normalized.kind})`);\n\t\tbyPath.set(path, normalized);\n\t}\n\treturn [...byPath.values()];\n}\nfunction projectRelativeModuleId(root, id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\tif (!isAbsolute(absolute) && !absolute.startsWith(\".\")) return null;\n\tconst normalizedRoot = normalizeBuildFilePath(root);\n\tlet normalizedAbsolute;\n\ttry {\n\t\tnormalizedAbsolute = normalizeBuildFilePath(absolute);\n\t} catch {\n\t\treturn null;\n\t}\n\tif (!normalizedAbsolute.startsWith(normalizedRoot + sep) && normalizedAbsolute !== normalizedRoot) {\n\t\tconst rel = toPosix(relative(normalizedRoot, normalizedAbsolute));\n\t\tif (!rel || rel.startsWith(\"..\") || rel.includes(\"node_modules/\")) return null;\n\t}\n\tconst relativePath = toPosix(relative(normalizedRoot, normalizedAbsolute));\n\tif (!relativePath || relativePath.startsWith(\"..\") || relativePath.includes(\"node_modules/\") || relativePath.startsWith(\"node_modules/\")) return null;\n\treturn relativePath;\n}\n/** Extract a package name from a resolved module id under node_modules. */\nfunction packageNameFromModuleId(id) {\n\tif (id.startsWith(\"\\0\") || id.includes(\"\\0\") || id.startsWith(\"node:\")) return null;\n\tlet absolute = id;\n\ttry {\n\t\tif (id.startsWith(\"file://\")) absolute = fileURLToPath(id);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst normalized = absolute.replace(/\\\\/g, \"/\");\n\tconst index = normalized.lastIndexOf(\"/node_modules/\");\n\tif (index < 0) return null;\n\tconst rest = normalized.slice(index + 14);\n\tif (!rest || rest.startsWith(\".\")) return null;\n\tif (rest.startsWith(\"@\")) {\n\t\tconst parts = rest.split(\"/\");\n\t\tif (parts.length < 2 || !parts[0] || !parts[1]) return null;\n\t\treturn `${parts[0]}/${parts[1]}`;\n\t}\n\treturn rest.split(\"/\")[0] || null;\n}\nfunction isRuntimeExternalPackage(name) {\n\tif (!name.startsWith(\"@keystrokehq/\")) return false;\n\tconst pkg = name.slice(13).split(\"/\")[0] ?? \"\";\n\treturn RUNTIME_KEYSTROKE_PACKAGES.has(pkg);\n}\nfunction readDependencyMap(packageJsonContents) {\n\ttry {\n\t\tconst parsed = JSON.parse(packageJsonContents);\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tfor (const field of [\n\t\t\t\"dependencies\",\n\t\t\t\"devDependencies\",\n\t\t\t\"optionalDependencies\",\n\t\t\t\"peerDependencies\"\n\t\t]) {\n\t\t\tconst value = parsed[field];\n\t\t\tif (!value || typeof value !== \"object\" || Array.isArray(value)) continue;\n\t\t\tfor (const [name, version] of Object.entries(value)) if (typeof version === \"string\") map.set(name, version);\n\t\t}\n\t\treturn map;\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction changedDependencyNames(base, draft) {\n\tconst names = new Set([...base.keys(), ...draft.keys()]);\n\tconst changed = [];\n\tfor (const name of names) if ((base.get(name) ?? null) !== (draft.get(name) ?? null)) changed.push(name);\n\treturn changed.sort();\n}\nfunction collectModuleGraphPlugin(graph) {\n\treturn {\n\t\tname: \"keystroke-collect-module-graph\",\n\t\tasync resolveId(source, importer, resolveOptions) {\n\t\t\tif (!importer || resolveOptions?.isEntry) return null;\n\t\t\tif (!await this.resolve(source, importer, {\n\t\t\t\t...resolveOptions,\n\t\t\t\tskipSelf: true\n\t\t\t})) {\n\t\t\t\tconst existing = graph.unresolvedByImporter.get(importer) ?? [];\n\t\t\t\texisting.push(source);\n\t\t\t\tgraph.unresolvedByImporter.set(importer, existing);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tbuildEnd() {\n\t\t\tfor (const id of this.getModuleIds()) {\n\t\t\t\tconst info = this.getModuleInfo(id);\n\t\t\t\tif (!info) continue;\n\t\t\t\tgraph.byId.set(id, {\n\t\t\t\t\timportedIds: [...info.importedIds],\n\t\t\t\t\tdynamicallyImportedIds: [...info.dynamicallyImportedIds]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\nfunction closureFromGraph(root, resourceKey, entryAbsolute, graph) {\n\tconst kind = kindFromResourceKey(resourceKey);\n\tif (!kind) throw new Error(`Not a deployable workflow/agent key: ${resourceKey}`);\n\tconst entryNormalized = normalizeBuildFilePath(entryAbsolute);\n\tconst queue = [];\n\tfor (const id of graph.byId.keys()) try {\n\t\tif (normalizeBuildFilePath(id.startsWith(\"file://\") ? fileURLToPath(id) : id) === entryNormalized) {\n\t\t\tqueue.push(id);\n\t\t\tbreak;\n\t\t}\n\t} catch {}\n\tif (queue.length === 0) {\n\t\tconst entryRel = toPosix(relative(normalizeBuildFilePath(root), entryNormalized));\n\t\tfor (const id of graph.byId.keys()) if (projectRelativeModuleId(root, id) === entryRel) {\n\t\t\tqueue.push(id);\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst inputs = /* @__PURE__ */ new Set();\n\tconst packages = /* @__PURE__ */ new Set();\n\tlet hasDynamicImports = false;\n\tconst unresolvedImports = /* @__PURE__ */ new Set();\n\twhile (queue.length > 0) {\n\t\tconst id = queue.pop();\n\t\tif (seen.has(id)) continue;\n\t\tseen.add(id);\n\t\tconst relativePath = projectRelativeModuleId(root, id);\n\t\tif (relativePath) inputs.add(relativePath);\n\t\tconst packageName = packageNameFromModuleId(id);\n\t\tif (packageName && !isRuntimeExternalPackage(packageName)) packages.add(packageName);\n\t\tfor (const unresolved of graph.unresolvedByImporter.get(id) ?? []) unresolvedImports.add(unresolved);\n\t\tconst node = graph.byId.get(id);\n\t\tif (!node) continue;\n\t\tif (node.dynamicallyImportedIds.length > 0) hasDynamicImports = true;\n\t\tfor (const imported of node.importedIds) queue.push(imported);\n\t\tfor (const imported of node.dynamicallyImportedIds) queue.push(imported);\n\t}\n\tconst entryPath = projectRelativeModuleId(root, entryAbsolute) ?? toPosix(relative(normalizeBuildFilePath(root), entryNormalized));\n\tinputs.add(entryPath);\n\treturn {\n\t\tresourceKey,\n\t\tkind,\n\t\tentryPath,\n\t\tinputs: [...inputs].sort(),\n\t\tpackages: [...packages].sort(),\n\t\thasDynamicImports,\n\t\tunresolvedImports: [...unresolvedImports].sort()\n\t};\n}\n/**\n* Analyze bundler input closures for every deployable workflow and agent entry.\n*\n* Uses the same tsdown/rolldown resolver settings as artifact builds so aliases,\n* package exports, TS resolution, and externals match production.\n*/\nasync function analyzeDeployableClosures(options = {}) {\n\tconst root = normalizeBuildFilePath(options.root ?? process.cwd());\n\tconst walked = walkProject(root, {\n\t\tsrcDir: options.srcDir ?? \"src\",\n\t\tphase: options.phase ?? \"deploy\"\n\t});\n\tconst entries = {};\n\tfor (const [key, absolute] of Object.entries(walked.buildEntries)) if (isDeployableResourceKey(key)) entries[key] = absolute;\n\tconst entryList = Object.entries(entries).sort(([a], [b]) => a.localeCompare(b));\n\tif (entryList.length === 0) return {\n\t\tclosures: [],\n\t\tfailures: []\n\t};\n\tmkdirSync(join(root, \".keystroke\"), { recursive: true });\n\tconst scratchRoot = mkdtempSync(join(root, \".keystroke\", \"closure-analyze-\"));\n\tconst previous = process.cwd();\n\tconst closures = [];\n\tconst failures = [];\n\ttry {\n\t\tprocess.chdir(root);\n\t\tfor (const [resourceKey, entryPath] of entryList) {\n\t\t\tconst graph = {\n\t\t\t\tbyId: /* @__PURE__ */ new Map(),\n\t\t\t\tunresolvedByImporter: /* @__PURE__ */ new Map()\n\t\t\t};\n\t\t\tconst outDir = join(scratchRoot, \"dist\", resourceKey.replaceAll(\"/\", \"__\"));\n\t\t\ttry {\n\t\t\t\tawait build(mergeConfig(baseTsdownConfig, {\n\t\t\t\t\tentry: { [resourceKey]: entryPath },\n\t\t\t\t\tformat: [\"esm\"],\n\t\t\t\t\toutDir,\n\t\t\t\t\tclean: true,\n\t\t\t\t\tdts: false,\n\t\t\t\t\tsourcemap: false,\n\t\t\t\t\tlogLevel: \"error\",\n\t\t\t\t\tloader: { \".md\": \"text\" },\n\t\t\t\t\tdeps: userAppBuildDepsConfig(),\n\t\t\t\t\tplugins: [collectModuleGraphPlugin(graph)]\n\t\t\t\t}));\n\t\t\t\tconst closure = closureFromGraph(root, resourceKey, entryPath, graph);\n\t\t\t\tclosures.push(closure);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tfailures.push({\n\t\t\t\t\tresourceKey,\n\t\t\t\t\treason: message\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t\trmSync(scratchRoot, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n\treturn {\n\t\tclosures,\n\t\tfailures\n\t};\n}\nfunction ownershipIndex(closures) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const closure of closures) for (const input of closure.inputs) {\n\t\tconst owners = index.get(input) ?? [];\n\t\towners.push(closure.resourceKey);\n\t\tindex.set(input, owners);\n\t}\n\tfor (const [path, owners] of index) index.set(path, [...new Set(owners)].sort());\n\treturn index;\n}\nfunction packageOwnershipIndex(closures) {\n\tconst packageOwners = /* @__PURE__ */ new Map();\n\tfor (const closure of closures) for (const packageName of closure.packages) {\n\t\tconst owners = packageOwners.get(packageName) ?? [];\n\t\towners.push(closure.resourceKey);\n\t\tpackageOwners.set(packageName, owners);\n\t}\n\tfor (const [packageName, owners] of packageOwners) packageOwners.set(packageName, [...new Set(owners)].sort());\n\treturn packageOwners;\n}\nfunction unionOwners(...lists) {\n\treturn [...new Set(lists.flatMap((list) => list ?? []))].sort();\n}\nfunction intersectsRequested(owners, requested) {\n\treturn owners.some((owner) => requested.has(owner));\n}\nfunction sortCandidateOps(ops) {\n\treturn [...ops].sort((a, b) => {\n\t\tconst byPath = a.path.localeCompare(b.path);\n\t\tif (byPath !== 0) return byPath;\n\t\treturn a.op.localeCompare(b.op);\n\t});\n}\n/**\n* Transition ownership for a changed path:\n* - added → D0 owners\n* - deleted → M0 owners\n* - modified → M0 ∪ D0 owners\n* - renamed → previousPath M0 ∪ new path D0 (promote both ops when either side matches)\n*/\nfunction transitionAttribution(change, draftOwnersByPath, mainOwnersByPath) {\n\tif (change.kind === \"renamed\") {\n\t\tif (!change.previousPath) return requireFull(\"ambiguous_ownership\", `Renamed path \"${change.path}\" is missing previousPath; filtered deploy cannot attribute ownership`);\n\t\treturn {\n\t\t\towners: unionOwners(mainOwnersByPath.get(change.previousPath), draftOwnersByPath.get(change.path)),\n\t\t\tops: [{\n\t\t\t\tpath: change.previousPath,\n\t\t\t\top: \"delete\"\n\t\t\t}, {\n\t\t\t\tpath: change.path,\n\t\t\t\top: \"upsert\"\n\t\t\t}]\n\t\t};\n\t}\n\tif (change.kind === \"added\") return {\n\t\towners: draftOwnersByPath.get(change.path) ?? [],\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"upsert\"\n\t\t}]\n\t};\n\tif (change.kind === \"deleted\") return {\n\t\towners: mainOwnersByPath.get(change.path) ?? [],\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"delete\"\n\t\t}]\n\t};\n\treturn {\n\t\towners: unionOwners(mainOwnersByPath.get(change.path), draftOwnersByPath.get(change.path)),\n\t\tops: [{\n\t\t\tpath: change.path,\n\t\t\top: \"upsert\"\n\t\t}]\n\t};\n}\nfunction filteredSuccess(input) {\n\treturn {\n\t\trequireFull: false,\n\t\tresourceKeys: [...input.resourceKeys].sort(),\n\t\timpactedResourceKeys: [...input.impactedResourceKeys].sort(),\n\t\texpansions: [...input.expansions].sort((a, b) => a.resourceKey.localeCompare(b.resourceKey)),\n\t\tsourceDelta: [...input.sourceDelta].sort(),\n\t\tcandidateOps: sortCandidateOps(input.candidateOps),\n\t\timpactCompleteness: input.impactCompleteness,\n\t\twarnings: [...input.warnings]\n\t};\n}\n/**\n* Compute the smallest safe filtered resource set + source delta for a draft delta.\n*\n* Dual-graph (M0/D0) transition ownership promotes only paths attributable to\n* the requested resources. Impacts are M0 consumers of promoted paths (candidate\n* = M0 + sourceDelta). Incomplete main-impact enumeration is soft-unknown, not\n* a hard block.\n*/\nasync function computeSafeFilteredDeploy(options) {\n\tconst root = normalizeBuildFilePath(options.root ?? process.cwd());\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst phase = options.phase ?? \"deploy\";\n\tconst normalized = normalizeChanges(root, options.changedPaths);\n\tif (\"requireFull\" in normalized && normalized.requireFull) return normalized;\n\tconst changes = normalized;\n\tconst packageManifestChanges = [];\n\tconst lockfileChanges = [];\n\tconst sourceLikeChanges = [];\n\tfor (const change of changes) {\n\t\tif (isPackageManifestPath(change.path)) {\n\t\t\tpackageManifestChanges.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tif (isLockfilePath(change.path)) {\n\t\t\tlockfileChanges.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tsourceLikeChanges.push(change);\n\t}\n\tconst selected = [...new Set(options.selectedResourceKeys)];\n\tif (selected.length === 0) return requireFull(\"unknown_selected_key\", \"At least one selected resource key is required\");\n\tconst draftAnalysis = options.closures !== void 0 ? {\n\t\tclosures: options.closures,\n\t\tfailures: options.failures ?? []\n\t} : await analyzeDeployableClosures({\n\t\troot,\n\t\tsrcDir,\n\t\tphase\n\t});\n\tconst draftClosures = draftAnalysis.closures;\n\tconst draftFailures = draftAnalysis.failures;\n\tconst draftByKey = new Map(draftClosures.map((closure) => [closure.resourceKey, closure]));\n\tconst draftFailedKeys = new Set(draftFailures.map((failure) => failure.resourceKey));\n\tconst mainClosures = options.mainClosures ?? draftClosures;\n\tconst mainFailures = options.mainClosures !== void 0 ? options.mainFailures ?? [] : draftFailures;\n\tconst mainByKey = new Map(mainClosures.map((closure) => [closure.resourceKey, closure]));\n\tconst mainFailedKeys = new Set(mainFailures.map((failure) => failure.resourceKey));\n\tfor (const key of selected) {\n\t\tif (draftFailedKeys.has(key)) {\n\t\t\tconst failure = draftFailures.find((item) => item.resourceKey === key);\n\t\t\treturn requireFull(\"unproven_safe\", `Selected resource \"${key}\" failed bundler analysis; filtered deploy cannot prove a complete closure` + (failure ? `: ${failure.reason}` : \"\"));\n\t\t}\n\t\tif (!draftByKey.has(key)) return requireFull(\"unknown_selected_key\", `Unknown selected resource key \"${key}\". Use keys like agents/foo or workflows/bar`);\n\t}\n\tfor (const key of selected) {\n\t\tconst closure = draftByKey.get(key);\n\t\tif (closure.hasDynamicImports || closure.unresolvedImports.length > 0) return requireFull(\"dynamic_or_unresolved_import\", `Selected resource \"${key}\" has dynamic or unresolved imports; filtered deploy cannot prove a complete closure`);\n\t}\n\tconst draftOwnersByPath = ownershipIndex(draftClosures);\n\tconst mainOwnersByPath = ownershipIndex(mainClosures);\n\tconst mainPackageOwners = packageOwnershipIndex(mainClosures);\n\tconst requestedSet = new Set(selected);\n\tconst sourceDelta = /* @__PURE__ */ new Set();\n\tconst candidateOpsByKey = /* @__PURE__ */ new Map();\n\tconst expansions = /* @__PURE__ */ new Map();\n\tconst impactedSet = /* @__PURE__ */ new Set();\n\tconst warnings = [];\n\tlet impactCompleteness = \"complete\";\n\tconst markUnknown = (warning) => {\n\t\timpactCompleteness = \"unknown\";\n\t\tif (!warnings.includes(warning)) warnings.push(warning);\n\t};\n\tconst addCandidateOp = (op) => {\n\t\tconst key = `${op.op}:${op.path}`;\n\t\tcandidateOpsByKey.set(key, op);\n\t\tsourceDelta.add(op.path);\n\t};\n\tconst markImpact = (resourceKey, sharedInputs, reason) => {\n\t\tif (requestedSet.has(resourceKey)) return;\n\t\timpactedSet.add(resourceKey);\n\t\tconst existing = expansions.get(resourceKey);\n\t\tconst mergedInputs = existing ? [...new Set([...existing.sharedInputs, ...sharedInputs])].sort() : [...sharedInputs].sort();\n\t\texpansions.set(resourceKey, {\n\t\t\tresourceKey,\n\t\t\treason: existing ? `${existing.reason}; ${reason}` : reason,\n\t\t\tsharedInputs: mergedInputs\n\t\t});\n\t};\n\tconst selectedEntryPaths = new Set(selected.map((key) => draftByKey.get(key)?.entryPath).filter((path) => Boolean(path)));\n\tfor (const change of sourceLikeChanges) {\n\t\tconst attribution = transitionAttribution(change, draftOwnersByPath, mainOwnersByPath);\n\t\tif (\"requireFull\" in attribution) return attribution;\n\t\tconst { owners, ops } = attribution;\n\t\tif ((selectedEntryPaths.has(change.path) || change.previousPath != null && selectedEntryPaths.has(change.previousPath) || selected.some((key) => {\n\t\t\tconst mainEntry = mainByKey.get(key)?.entryPath;\n\t\t\treturn mainEntry === change.path || mainEntry === change.previousPath;\n\t\t})) && !intersectsRequested(owners, requestedSet)) return requireFull(\"missing_ownership\", `Changed path \"${change.path}\" must be included for the selected resource(s) but selected ownership cannot be proven`);\n\t\tif (!intersectsRequested(owners, requestedSet)) continue;\n\t\tfor (const op of ops) addCandidateOp(op);\n\t\tfor (const op of ops) {\n\t\t\tconst mainOwners = mainOwnersByPath.get(op.path) ?? [];\n\t\t\tfor (const owner of mainOwners) {\n\t\t\t\tif (requestedSet.has(owner)) continue;\n\t\t\t\tconst mainClosure = mainByKey.get(owner);\n\t\t\t\tif (!mainClosure) {\n\t\t\t\t\tif (mainFailedKeys.has(owner)) {\n\t\t\t\t\t\tmarkUnknown(`Main-tip analysis failed for \"${owner}\"; additional owners of promoted path \"${op.path}\" may be hidden`);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tmarkUnknown(`Promoted path \"${op.path}\" lists main owner \"${owner}\" without an analyzable main closure`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (mainClosure.hasDynamicImports || mainClosure.unresolvedImports.length > 0) markUnknown(`Impacted main resource \"${owner}\" has dynamic or unresolved imports; additional impacts may be hidden`);\n\t\t\t\tmarkImpact(owner, [op.path], `Shared input ${`\"${op.path}\"`} also used by requested resource(s) on main`);\n\t\t\t}\n\t\t}\n\t}\n\tif (packageManifestChanges.length > 0 || lockfileChanges.length > 0) {\n\t\tconst packageResult = attributePackageChanges({\n\t\t\troot,\n\t\t\tpackageManifestChanges,\n\t\t\tlockfileChanges,\n\t\t\tbaseManifestFiles: options.baseManifestFiles ?? [],\n\t\t\tmainClosures,\n\t\t\tdraftClosures,\n\t\t\trequestedSet,\n\t\t\tmainPackageOwners\n\t\t});\n\t\tif (packageResult.include) {\n\t\t\tfor (const path of packageResult.manifestDelta) addCandidateOp({\n\t\t\t\tpath,\n\t\t\t\top: \"upsert\"\n\t\t\t});\n\t\t\tfor (const expansion of packageResult.expansions) markImpact(expansion.resourceKey, expansion.sharedInputs, expansion.reason);\n\t\t\tif (packageResult.unknownCompleteness) for (const warning of packageResult.warnings) markUnknown(warning);\n\t\t}\n\t}\n\tif (mainFailures.length > 0 && sourceDelta.size > 0) {\n\t\tconst failedList = [...mainFailedKeys].sort().join(\", \");\n\t\tif (![...sourceDelta].every((path) => selectedEntryPaths.has(path))) markUnknown(`Main-tip bundler analysis failed for deployable resource(s) ${failedList}; additional owners of promoted shared paths may be hidden`);\n\t}\n\tif (sourceDelta.size === 0) return filteredSuccess({\n\t\tresourceKeys: selected,\n\t\timpactedResourceKeys: [],\n\t\texpansions: [],\n\t\tsourceDelta: [],\n\t\tcandidateOps: [],\n\t\timpactCompleteness: \"complete\",\n\t\twarnings: []\n\t});\n\treturn filteredSuccess({\n\t\tresourceKeys: [...requestedSet, ...impactedSet],\n\t\timpactedResourceKeys: [...impactedSet],\n\t\texpansions: [...expansions.values()],\n\t\tsourceDelta: [...sourceDelta],\n\t\tcandidateOps: [...candidateOpsByKey.values()],\n\t\timpactCompleteness,\n\t\twarnings\n\t});\n}\nfunction attributePackageChanges(input) {\n\tif (input.packageManifestChanges.length === 0) return { include: false };\n\tif (input.baseManifestFiles.length === 0) return { include: false };\n\tconst draftPackageJsonPath = join(input.root, \"package.json\");\n\tlet draftPackageJson;\n\ttry {\n\t\tdraftPackageJson = readFileSync(draftPackageJsonPath, \"utf8\");\n\t} catch {\n\t\treturn { include: false };\n\t}\n\tconst basePackageJson = new Map(input.baseManifestFiles.map((file) => [file.path.replace(/\\\\/g, \"/\"), file.contents])).get(\"package.json\");\n\tif (basePackageJson == null) return { include: false };\n\tconst baseDeps = readDependencyMap(basePackageJson);\n\tconst draftDeps = readDependencyMap(draftPackageJson);\n\tif (!baseDeps || !draftDeps) return { include: false };\n\tconst changedPackages = changedDependencyNames(baseDeps, draftDeps);\n\tif (changedPackages.length === 0) return { include: false };\n\tconst runtimeChanged = changedPackages.filter((name) => isRuntimeExternalPackage(name));\n\tconst bundledChanged = changedPackages.filter((name) => !isRuntimeExternalPackage(name));\n\tconst selectedConsumesBundled = [...input.requestedSet].some((key) => {\n\t\tconst draft = input.draftClosures.find((item) => item.resourceKey === key);\n\t\tconst main = input.mainClosures.find((item) => item.resourceKey === key);\n\t\tconst packages = new Set([...draft?.packages ?? [], ...main?.packages ?? []]);\n\t\treturn bundledChanged.some((name) => packages.has(name));\n\t});\n\tif (runtimeChanged.length === 0 && !selectedConsumesBundled) return { include: false };\n\tconst expansions = /* @__PURE__ */ new Map();\n\tconst markImpact = (resourceKey, reason, sharedInputs) => {\n\t\tif (input.requestedSet.has(resourceKey)) return;\n\t\tconst existing = expansions.get(resourceKey);\n\t\texpansions.set(resourceKey, {\n\t\t\tresourceKey,\n\t\t\treason: existing ? `${existing.reason}; ${reason}` : reason,\n\t\t\tsharedInputs: [...new Set([...existing?.sharedInputs ?? [], ...sharedInputs])].sort()\n\t\t});\n\t};\n\tif (runtimeChanged.length > 0) for (const closure of input.mainClosures) markImpact(closure.resourceKey, `Runtime package update (${runtimeChanged.map((name) => `\"${name}\"`).join(\", \")}) requires rebuilding all resources from main`, runtimeChanged);\n\tfor (const packageName of bundledChanged) {\n\t\tif (!selectedConsumesBundled) continue;\n\t\tconst owners = input.mainPackageOwners.get(packageName) ?? [];\n\t\tfor (const owner of owners) markImpact(owner, `Bundled package \"${packageName}\" changed and is imported by this resource`, [packageName]);\n\t}\n\tconst manifestDelta = [...input.packageManifestChanges.map((change) => change.path), ...input.lockfileChanges.map((change) => change.path)].sort();\n\tconst warnings = [];\n\tlet unknownCompleteness = false;\n\tif (input.lockfileChanges.length > 0) {\n\t\tunknownCompleteness = true;\n\t\twarnings.push(\"Lockfile included with selected package change; lockfile resolution may hide additional package consumers\");\n\t}\n\treturn {\n\t\tinclude: true,\n\t\tmanifestDelta,\n\t\texpansions: [...expansions.values()],\n\t\tunknownCompleteness,\n\t\twarnings\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/**\n* Rolldown plugin: pack src/skills + src/files with per-pack hash skip, expose\n* `@keystrokehq/assets`, and write modular shards + composed `assets.mjs`.\n*/\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 = packModularProjectAssets({\n\t\t\t\tprojectRoot: options.root,\n\t\t\t\tsrcDir,\n\t\t\t\toutDir: options.outDir ?? \"dist\"\n\t\t\t}).manifest;\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};\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\tsourcemap: options.phase === \"deploy\" ? false : true,\n\t\t...options.phase === \"deploy\" ? { logLevel: \"error\" } : {},\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [\n\t\t\tkeystrokeIgnoreGuardPlugin({\n\t\t\t\troot,\n\t\t\t\tignoredFiles\n\t\t\t}),\n\t\t\tcallSiteIdInjectionPlugin({\n\t\t\t\troot,\n\t\t\t\tsrcDir\n\t\t\t}),\n\t\t\tagentAssetsPlugin({\n\t\t\t\troot,\n\t\t\t\tsrcDir,\n\t\t\t\toutDir\n\t\t\t})\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\tconst timings = {\n\t\tbundleMs: 0,\n\t\tmanifestMs: 0,\n\t\tmanifestCacheHit: false,\n\t\tbundleSkipped: false\n\t};\n\tconst cacheKey = phase === \"deploy\" && collectSources && walked.sourceFiles.length > 0 ? computeRouteManifestCacheKey({\n\t\tphase,\n\t\tsourceFiles: walked.sourceFiles,\n\t\tbuildEntryKeys: Object.keys(walked.buildEntries),\n\t\tignoredFiles: walked.ignoredFiles,\n\t\tintegrationFingerprint: integrationPackagesFingerprint(root)\n\t}) : null;\n\ttry {\n\t\tprocess.chdir(root);\n\t\tif (cacheKey && emitManifest && isRouteManifestCacheHit(root, cacheKey) && distDeployOutputsPresent(root, walked.buildEntries)) {\n\t\t\tconst manifestStarted = Date.now();\n\t\t\ttryRestoreCachedRouteManifest(root, cacheKey);\n\t\t\ttimings.manifestCacheHit = true;\n\t\t\ttimings.bundleSkipped = true;\n\t\t\ttimings.manifestMs = Date.now() - manifestStarted;\n\t\t\treturn {\n\t\t\t\tsourceFiles: walked.sourceFiles,\n\t\t\t\ttimings\n\t\t\t};\n\t\t}\n\t\tconst dirtyResult = listDirtyEntries(root, Object.keys(walked.buildEntries));\n\t\tconst skipBundle = !dirtyResult.forceFull && dirtyResult.dirty.length === 0 && distDeployOutputsPresent(root, walked.buildEntries);\n\t\tconst workflowDiagnostics = collectWorkflowDiagnostics(root, srcDir);\n\t\tassertWorkflowDiagnosticErrorsFrom(workflowDiagnostics);\n\t\ttry {\n\t\t\tif (skipBundle) {\n\t\t\t\tpackModularProjectAssets({\n\t\t\t\t\tprojectRoot: root,\n\t\t\t\t\tsrcDir,\n\t\t\t\t\toutDir: options.outDir ?? \"dist\"\n\t\t\t\t});\n\t\t\t\ttimings.bundleSkipped = true;\n\t\t\t} else {\n\t\t\t\tconst bundleStarted = Date.now();\n\t\t\t\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\t\t\t\tawait buildSelfContainedEntries({\n\t\t\t\t\troot,\n\t\t\t\t\tsrcDir,\n\t\t\t\t\toutDir: options.outDir ?? \"dist\",\n\t\t\t\t\tphase,\n\t\t\t\t\tclean: dirtyResult.forceFull && (options.clean ?? true),\n\t\t\t\t\tbuildEntries: walked.buildEntries,\n\t\t\t\t\tignoredFiles: walked.ignoredFiles,\n\t\t\t\t\tdirtyKeys: dirtyResult.forceFull ? void 0 : dirtyResult.dirty,\n\t\t\t\t\tconfigEntry\n\t\t\t\t});\n\t\t\t\ttimings.bundleMs = Date.now() - bundleStarted;\n\t\t\t}\n\t\t} finally {\n\t\t\twarnWorkflowDiagnosticsFrom(workflowDiagnostics);\n\t\t}\n\t\tif (emitManifest) {\n\t\t\tconst manifestStarted = Date.now();\n\t\t\tif (cacheKey && tryRestoreCachedRouteManifest(root, cacheKey)) timings.manifestCacheHit = true;\n\t\t\telse {\n\t\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t\t\tif (cacheKey) storeCachedRouteManifest(root, cacheKey);\n\t\t\t}\n\t\t\ttimings.manifestMs = Date.now() - manifestStarted;\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn {\n\t\tsourceFiles: walked.sourceFiles,\n\t\ttimings\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((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { ANALYZER_CONTRACT_VERSION, BUILD_INDEX_REL_PATH, agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, analyzeDeployableClosures, assertWorkflowDiagnosticErrors, assertWorkflowDiagnosticErrorsFrom, assertWorkflowDiagnostics, buildApp, buildFilteredApp, callSiteIdInjectionPlugin, collectWorkflowDiagnostics, computeSafeFilteredDeploy, consumersOf, createAppBuildConfig, entryArtifact, injectCallSiteIds, isBuildIndexClean, listDirtyEntries, mergeFilteredArtifact, normalizeProjectRelativePath, resolveBuildFilter, resolveModuleDirs, resolveRuntimeBuildArtifact, tryReadBuildIndex, warnWorkflowDiagnostics, warnWorkflowDiagnosticsFrom, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAOA,SAAS,UAAU,MAAM;CACxB,OAAO,KA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