@keystrokehq/cli 0.0.160 → 0.0.161
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-Bux5mRKJ.mjs → dist-BtAPGWUl.mjs} +2 -2
- package/dist/{dist-Bux5mRKJ.mjs.map → dist-BtAPGWUl.mjs.map} +1 -1
- package/dist/{dist-Dk0phE6_.mjs → dist-C12M6Kul.mjs} +3 -1
- package/dist/dist-C12M6Kul.mjs.map +1 -0
- package/dist/{dist-D4vZsmLQ.mjs → dist-QTvT7Ltb.mjs} +2 -2
- package/dist/{dist-D4vZsmLQ.mjs.map → dist-QTvT7Ltb.mjs.map} +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +4 -4
- package/dist/dist-Dk0phE6_.mjs.map +0 -1
|
@@ -265,7 +265,7 @@ async function buildApp(options = {}) {
|
|
|
265
265
|
root
|
|
266
266
|
}, walked.buildEntries));
|
|
267
267
|
if (emitManifest) {
|
|
268
|
-
const { emitStoredRouteManifestForProject } = await import("./dist-
|
|
268
|
+
const { emitStoredRouteManifestForProject } = await import("./dist-QTvT7Ltb.mjs");
|
|
269
269
|
await emitStoredRouteManifestForProject(root);
|
|
270
270
|
}
|
|
271
271
|
} finally {
|
|
@@ -290,4 +290,4 @@ async function watchApp(options = {}) {
|
|
|
290
290
|
//#endregion
|
|
291
291
|
export { buildApp, resolveRuntimeBuildArtifact, watchApp };
|
|
292
292
|
|
|
293
|
-
//# sourceMappingURL=dist-
|
|
293
|
+
//# sourceMappingURL=dist-BtAPGWUl.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-Bux5mRKJ.mjs","names":["z.object","z.string","z.array"],"sources":["../../../packages/sandbox/dist/files-B0H9_dP4.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { access, mkdir, writeFile } from \"node:fs/promises\";\nimport { z } from \"zod\";\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/sandbox-dirs.ts\nfunction resolveSandboxRoot(workspacesRoot, scope) {\n\tif (scope.type === \"agent\") return join(workspacesRoot, scope.agentId);\n\treturn join(workspacesRoot, \"runs\", scope.runId);\n}\nasync function ensureWorkspaceDir(workspaceRoot) {\n\tawait mkdir(workspaceRoot, { recursive: true });\n}\n//#endregion\n//#region src/files/schemas.ts\nconst SandboxFileContentSchema = z.object({\n\tpath: z.string(),\n\tfile: z.string()\n});\n/** Destination path under `/workspace`. For `dir`, used as a prefix. */\nconst SandboxFileSchema = z.object({\n\tpath: z.string(),\n\t/** Single file body — typically from a build-time import (`import doc from \"./doc.md\"`). */\n\tfile: z.string().optional(),\n\t/** Directory contents — each path is relative to `path`. */\n\tdir: z.array(SandboxFileContentSchema).optional()\n});\nconst SandboxDefinitionSchema = z.object({\n\tkey: z.string().optional(),\n\tfiles: z.array(SandboxFileSchema).optional()\n});\n//#endregion\n//#region src/files/define-sandbox.ts\n/** Define a reusable sandbox file layout. */\nfunction defineSandbox(def) {\n\treturn def;\n}\n//#endregion\n//#region src/files/flatten-sandbox-files.ts\n/** Expand directory entries into flat `{ path, file }` records under `/workspace`. */\nfunction flattenSandboxFiles(files) {\n\tif (!files?.length) return [];\n\tconst flattened = [];\n\tfor (const entry of files) {\n\t\tif (entry.dir !== void 0) {\n\t\t\tconst prefix = entry.path.replace(/\\/+$/, \"\");\n\t\t\tfor (const child of entry.dir) flattened.push({\n\t\t\t\tpath: prefix ? `${prefix}/${child.path}` : child.path,\n\t\t\t\tfile: child.file\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.file === void 0) continue;\n\t\tflattened.push({\n\t\t\tpath: entry.path,\n\t\t\tfile: entry.file\n\t\t});\n\t}\n\treturn flattened;\n}\n//#endregion\n//#region src/files/materialize-sandbox.ts\nasync function materializeSandbox(options) {\n\tconst root = resolveSandboxRoot(options.workspacesRoot, options.scope);\n\tawait ensureWorkspaceDir(root);\n\tconst files = flattenSandboxFiles(options.definition?.files);\n\tif (files.length) await applySandboxFiles(root, files, options.scope);\n\treturn {\n\t\troot,\n\t\tscope: options.scope,\n\t\t...options.definition !== void 0 ? { definition: options.definition } : {}\n\t};\n}\nasync function applySandboxFiles(root, files, scope) {\n\tfor (const entry of files) {\n\t\tconst hostPath = resolve(root, entry.path);\n\t\tif (scope.type === \"agent\") try {\n\t\t\tawait access(hostPath);\n\t\t\tcontinue;\n\t\t} catch {}\n\t\tawait mkdir(dirname(hostPath), { recursive: true });\n\t\tawait writeFile(hostPath, entry.file);\n\t}\n}\n//#endregion\n//#region src/files/pack-dir.ts\nconst SKIP_DIRS$1 = new Set([\".git\", \"node_modules\"]);\n/** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */\nfunction packDirFromDisk(rootPath) {\n\tconst stat = statSync(rootPath);\n\tif (stat.isFile()) return [{\n\t\tpath: basename(rootPath),\n\t\tfile: readFileSync(rootPath, \"utf8\")\n\t}];\n\tif (!stat.isDirectory()) throw new Error(`Expected a file or directory at ${rootPath}`);\n\tconst files = [];\n\twalkDir(rootPath, rootPath, files);\n\treturn files;\n}\nfunction walkDir(rootPath, currentPath, files) {\n\tfor (const name of readdirSync(currentPath)) {\n\t\tif (SKIP_DIRS$1.has(name)) continue;\n\t\tconst entryPath = join(currentPath, name);\n\t\tconst stat = statSync(entryPath);\n\t\tif (stat.isDirectory()) {\n\t\t\twalkDir(rootPath, entryPath, files);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stat.isFile()) continue;\n\t\tfiles.push({\n\t\t\tpath: relative(rootPath, entryPath),\n\t\t\tfile: readFileSync(entryPath, \"utf8\")\n\t\t});\n\t}\n}\n//#endregion\n//#region src/files/pack-asset-dirs.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\n/** Pack every subdir under `src/skills/` and `src/files/` into an asset manifest. */\nfunction packAssetDirs(appRoot, srcDir = \"src\") {\n\treturn {\n\t\tskills: packAssetRoot(join(appRoot, srcDir, \"skills\")),\n\t\tfiles: packAssetRoot(join(appRoot, srcDir, \"files\"))\n\t};\n}\nfunction packAssetRoot(rootPath) {\n\tif (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return {};\n\tconst manifest = {};\n\tfor (const name of readdirSync(rootPath)) {\n\t\tif (SKIP_DIRS.has(name)) continue;\n\t\tconst entryPath = join(rootPath, name);\n\t\tif (!statSync(entryPath).isDirectory()) continue;\n\t\tmanifest[name] = packDirFromDisk(entryPath);\n\t}\n\treturn manifest;\n}\n//#endregion\n//#region src/files/resolve-app-root.ts\n/** Walk upward from a module file to find the user app root (`src/agents`, `src/skills`, etc.). */\nfunction resolveAppRoot(fromPath) {\n\tlet dir = statSync(fromPath).isDirectory() ? fromPath : dirname(fromPath);\n\twhile (dir !== dirname(dir)) {\n\t\tif (hasAppLayout(dir)) return dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn process.env.KEYSTROKE_ROOT ?? process.cwd();\n}\n/** Resolve app root from an agent (or other) module URL. */\nfunction resolveAppRootFromModule(moduleUrl) {\n\treturn resolveAppRoot(fileURLToPath(moduleUrl));\n}\nfunction hasAppLayout(dir) {\n\tconst src = join(dir, \"src\");\n\tconst dist = join(dir, \"dist\");\n\treturn existsSync(join(src, \"agents\")) || existsSync(join(src, \"skills\")) || existsSync(join(src, \"files\")) || existsSync(join(dist, \"agents\")) || existsSync(join(dist, \".keystroke\", \"assets.mjs\"));\n}\n//#endregion\nexport { materializeSandbox as a, SandboxDefinitionSchema as c, ensureWorkspaceDir as d, resolveSandboxRoot as f, packDirFromDisk as i, SandboxFileContentSchema as l, resolveAppRootFromModule as n, flattenSandboxFiles as o, packAssetDirs as r, defineSandbox as s, resolveAppRoot as t, SandboxFileSchema as u };\n\n//# sourceMappingURL=files-B0H9_dP4.mjs.map","import { isBuiltin } from \"node:module\";\n\n/** Native addons kept external — resolved from the CLI runtime at app start. */\nexport const NATIVE_RUNTIME_DEPS = [\"pg\", \"better-sqlite3\", \"@parcel/watcher\"];\n\n/** Kept external so .d.ts emission does not inline internal/inferred types. */\nexport const LIBRARY_EXTERNAL_DEPS = [\"better-auth\", /^@better-auth\\//, /^better-auth\\//];\n\n/** Non-auth runtime deps kept external for published entry bundles (platform, etc.). */\nexport const BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS = [\n ...NATIVE_RUNTIME_DEPS,\n \"dockerode\",\n \"ssh2\",\n \"cpu-features\",\n \"microsandbox\",\n /^@aws-sdk\\//,\n /^@napi-rs\\//,\n \"hono\",\n /^@hono\\//,\n \"undici\",\n];\n\n/** Kept external when bundling published entry points (cli, keystroke, platform). */\nexport const BUNDLED_ENTRY_EXTERNAL_DEPS = [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...LIBRARY_EXTERNAL_DEPS,\n];\n\n/** Bundle into CLI — device login uses Better Auth client only. */\nexport const BETTER_AUTH_CLIENT_BUNDLE_PATTERNS = [\n /^better-auth\\/client$/,\n /^better-auth\\/client\\//,\n];\n\n/** Server adapters and root entry — must not ship in the CLI bundle. */\nexport const BETTER_AUTH_SERVER_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^@better-auth\\//,\n /^better-auth\\/(?!client(\\/|$)).+/,\n];\n\nexport function isNativeRuntimeDep(id) {\n return NATIVE_RUNTIME_DEPS.some((dep) => id === dep || id.startsWith(`${dep}/`));\n}\n\nfunction packageName(id) {\n if (id.startsWith(\"@\")) {\n const [scope, name] = id.split(\"/\");\n return name ? `${scope}/${name}` : id;\n }\n\n return id.split(\"/\")[0] ?? id;\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (name.startsWith(\"@keystrokehq/\")) {\n return true;\n }\n\n if (name === \"better-auth\" || name.startsWith(\"@better-auth/\")) {\n return true;\n }\n\n return false;\n}\n\n/** Library packages resolve npm deps from node_modules at runtime. */\nexport function libraryBuildDepsConfig() {\n return {\n alwaysBundle: (_id) => null,\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Bundle npm deps into dist; resolve @keystrokehq/* and natives from the runtime. */\nexport function userAppBuildDepsConfig() {\n return {\n alwaysBundle: (id, _importer) => {\n if (id.startsWith(\".\") || id.startsWith(\"/\") || isBuiltin(id)) {\n return null;\n }\n\n return isRuntimeExternal(id) ? null : true;\n },\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/**\n * Published entry packages (cli, keystroke, platform): declare bundled @keystrokehq/*\n * in dependencies (changesets release graph ignores devDependencies). Inlining is\n * driven by alwaysBundle below, not by dep kind. Runtime npm deps stay external.\n */\nexport function bundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//],\n neverBundle: [...BUNDLED_ENTRY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Published CLI: inline better-auth client + @better-auth/*; keep server adapters external. */\nexport const BETTER_AUTH_CLI_BUNDLE_PATTERNS = [\n ...BETTER_AUTH_CLIENT_BUNDLE_PATTERNS,\n /^@better-auth\\//,\n];\n\nexport const BETTER_AUTH_CLI_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^better-auth\\/(?!client(\\/|$)).+/,\n /^@better-auth\\/drizzle-adapter/,\n \"drizzle-orm\",\n];\n\n/** Rolldown/tsdown — native bindings; stay in CLI node_modules at runtime. */\nexport const CLI_BUILD_TOOL_EXTERNAL_PATTERNS = [\"tsdown\", \"rolldown\", /^@rolldown\\//, \"tsx\"];\n\n/** CLI: inline better-auth/client; keep server + drizzle adapters external. */\nexport function cliBundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...BETTER_AUTH_CLI_EXTERNAL_PATTERNS,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n ],\n onlyBundle: false,\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig, userAppBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n libraryBuildDepsConfig,\n userAppBuildDepsConfig,\n} from \"./deps.js\";\n\nexport const baseTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: libraryBuildDepsConfig(),\n};\n\n/** tsdown config for published bundles (cli, keystroke, platform). */\nexport const bundledEntryTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: bundledEntryDepsConfig(),\n};\n","import { t as walkProject } from \"./walk-project-171B4cvO.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, readdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\n//#region src/resolve-runtime-artifact.ts\nfunction packageRoot(nodeModules, scope, name) {\n\tconst direct = scope ? join(nodeModules, scope, name) : join(nodeModules, name);\n\tif (existsSync(join(direct, \"package.json\"))) return direct;\n\tconst pnpmDir = join(nodeModules, \".pnpm\");\n\tif (!existsSync(pnpmDir)) return null;\n\tfor (const entry of readdirSync(pnpmDir)) {\n\t\tconst candidate = scope ? join(pnpmDir, entry, \"node_modules\", scope, name) : join(pnpmDir, entry, \"node_modules\", name);\n\t\tif (existsSync(join(candidate, \"package.json\"))) return candidate;\n\t}\n\treturn null;\n}\n/** Resolve a file shipped with `@keystrokehq/build` inside the CLI runtime. */\nfunction resolveRuntimeBuildArtifact(runtimeNodeModules, relativePath) {\n\tconst pkgRoot = packageRoot(runtimeNodeModules, \"@keystrokehq\", \"build\");\n\tif (!pkgRoot) throw new Error(\"Keystroke runtime is missing @keystrokehq/build\");\n\tconst artifact = join(pkgRoot, relativePath);\n\tif (!existsSync(artifact)) throw new Error(`Keystroke runtime artifact not found: ${relativePath}`);\n\treturn artifact;\n}\n//#endregion\n//#region src/vitest-plugin.ts\nconst ASSETS_MODULE$1 = \"@keystrokehq/assets\";\nconst virtualPrefix = `\\0${ASSETS_MODULE$1}:`;\n/** Vitest plugin resolving `@keystrokehq/assets` from disk. */\nfunction agentAssetsVitestPlugin(appRoot = process.cwd()) {\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$1) return null;\n\t\t\treturn `${virtualPrefix}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${virtualPrefix}manifest`) return null;\n\t\t\tmanifest ??= packAssetDirs(appRoot);\n\t\t\treturn `export default ${JSON.stringify(manifest)};`;\n\t\t}\n\t};\n}\nfunction findAppRootFromConfig(configFile) {\n\tif (!configFile) return process.cwd();\n\treturn dirname(configFile);\n}\nfunction agentAssetsVitestPluginFromConfig(configFile) {\n\treturn agentAssetsVitestPlugin(findAppRootFromConfig(configFile));\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\nfunction renderAssetModule(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Rolldown plugin: pack src/skills + src/files and expose `@keystrokehq/assets`. */\nfunction agentAssetsPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tbuildStart() {\n\t\t\tmanifest = packAssetDirs(options.root, srcDir);\n\t\t},\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE) return null;\n\t\t\treturn `${VIRTUAL_PREFIX}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX}manifest` || !manifest) return null;\n\t\t\treturn renderAssetModule(manifest);\n\t\t},\n\t\tbuildEnd() {\n\t\t\tif (!manifest) return;\n\t\t\tconst outDir = join(options.root, options.outDir ?? \"dist\", \".keystroke\");\n\t\t\tmkdirSync(outDir, { recursive: true });\n\t\t\twriteFileSync(join(outDir, \"assets.mjs\"), renderAssetModule(manifest));\n\t\t}\n\t};\n}\n/** Full tsdown config for user keystroke apps (config + discovered modules only). */\nfunction createAppBuildConfig(options = {}, buildEntries) {\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 discovered = buildEntries ?? walkProject(root, srcDir).buildEntries;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discovered\n\t};\n\tif (Object.keys(entries).length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\treturn mergeConfig(baseTsdownConfig, {\n\t\tentry: entries,\n\t\tformat: [\"esm\"],\n\t\toutDir: join(root, outDir),\n\t\tclean: options.clean ?? true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [agentAssetsPlugin({\n\t\t\troot,\n\t\t\tsrcDir,\n\t\t\toutDir\n\t\t})]\n\t});\n}\n/** Build user agents, workflows, triggers, and config to `dist/`. */\nasync function buildApp(options = {}) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst emitManifest = options.emitManifest ?? true;\n\tconst collectSources = options.collectSources ?? false;\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources\n\t});\n\ttry {\n\t\tprocess.chdir(root);\n\t\tawait build(createAppBuildConfig({\n\t\t\t...options,\n\t\t\troot\n\t\t}, walked.buildEntries));\n\t\tif (emitManifest) {\n\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn { sourceFiles: walked.sourceFiles };\n}\n/**\n* Watch `src/` and rebuild `dist/` on change.\n*\n* NOT true hot reload — each change runs a full tsdown rebuild. Callers should\n* restart the API server in `onRebuild` so discovery picks up new/changed modules.\n*/\nasync function watchApp(options = {}) {\n\tconst { runWatchApp } = await import(\"./watch-app-DTIeKrbl.mjs\");\n\tawait runWatchApp((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, createAppBuildConfig, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;AAeA,MAAM,2BAA2BA,OAAS;CACzC,MAAMC,OAAS;CACf,MAAMA,OAAS;AAChB,CAAC;;AAED,MAAM,oBAAoBD,OAAS;CAClC,MAAMC,OAAS;;CAEf,MAAMA,OAAS,EAAE,SAAS;;CAE1B,KAAKC,MAAQ,wBAAwB,EAAE,SAAS;AACjD,CAAC;AAC+BF,OAAS;CACxC,KAAKC,OAAS,EAAE,SAAS;CACzB,OAAOC,MAAQ,iBAAiB,EAAE,SAAS;AAC5C,CAAC;AAwDD,MAAM,cAAc,IAAI,IAAI,CAAC,QAAQ,cAAc,CAAC;;AAEpD,SAAS,gBAAgB,UAAU;CAClC,M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AM,SAAS,QAAQ,UAAU;CACjC,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,MAAM,iBAAiB,QAAQ,kBAAkB;CACjD,MAAM,WAAW,QAAQ,IAAI;CAC7B,MAAM,SAAS,YAAY,MAAM;EAChC;EACA;CACD,CAAC;CACD,IAAI;EACH,QAAQ,MAAM,IAAI;EAClB,MAAM,MAAM,qBAAqB;GAChC,GAAG;GACH;EACD,GAAG,OAAO,YAAY,CAAC;EACvB,IAAI,cAAc;GACjB,MAAM,EAAE,sCAAsC,MAAM,OAAO;GAC3D,MAAM,kCAAkC,IAAI;EAC7C;CACD,UAAU;EACT,QAAQ,MAAM,QAAQ;CACvB;CACA,OAAO,EAAE,aAAa,OAAO,YAAY;AAC1C;;;;;;;AAOA,eAAe,SAAS,UAAU,CAAC,GAAG;CACrC,MAAM,EAAE,gBAAgB,MAAM,OAAO;CACrC,MAAM,aAAa,iBAAiB,SAAS;EAC5C,GAAG;EACH,cAAc;EACd,gBAAgB;CACjB,CAAC,GAAG,OAAO;AACZ"}
|
|
1
|
+
{"version":3,"file":"dist-BtAPGWUl.mjs","names":["z.object","z.string","z.array"],"sources":["../../../packages/sandbox/dist/files-B0H9_dP4.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { access, mkdir, writeFile } from \"node:fs/promises\";\nimport { z } from \"zod\";\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/sandbox-dirs.ts\nfunction resolveSandboxRoot(workspacesRoot, scope) {\n\tif (scope.type === \"agent\") return join(workspacesRoot, scope.agentId);\n\treturn join(workspacesRoot, \"runs\", scope.runId);\n}\nasync function ensureWorkspaceDir(workspaceRoot) {\n\tawait mkdir(workspaceRoot, { recursive: true });\n}\n//#endregion\n//#region src/files/schemas.ts\nconst SandboxFileContentSchema = z.object({\n\tpath: z.string(),\n\tfile: z.string()\n});\n/** Destination path under `/workspace`. For `dir`, used as a prefix. */\nconst SandboxFileSchema = z.object({\n\tpath: z.string(),\n\t/** Single file body — typically from a build-time import (`import doc from \"./doc.md\"`). */\n\tfile: z.string().optional(),\n\t/** Directory contents — each path is relative to `path`. */\n\tdir: z.array(SandboxFileContentSchema).optional()\n});\nconst SandboxDefinitionSchema = z.object({\n\tkey: z.string().optional(),\n\tfiles: z.array(SandboxFileSchema).optional()\n});\n//#endregion\n//#region src/files/define-sandbox.ts\n/** Define a reusable sandbox file layout. */\nfunction defineSandbox(def) {\n\treturn def;\n}\n//#endregion\n//#region src/files/flatten-sandbox-files.ts\n/** Expand directory entries into flat `{ path, file }` records under `/workspace`. */\nfunction flattenSandboxFiles(files) {\n\tif (!files?.length) return [];\n\tconst flattened = [];\n\tfor (const entry of files) {\n\t\tif (entry.dir !== void 0) {\n\t\t\tconst prefix = entry.path.replace(/\\/+$/, \"\");\n\t\t\tfor (const child of entry.dir) flattened.push({\n\t\t\t\tpath: prefix ? `${prefix}/${child.path}` : child.path,\n\t\t\t\tfile: child.file\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.file === void 0) continue;\n\t\tflattened.push({\n\t\t\tpath: entry.path,\n\t\t\tfile: entry.file\n\t\t});\n\t}\n\treturn flattened;\n}\n//#endregion\n//#region src/files/materialize-sandbox.ts\nasync function materializeSandbox(options) {\n\tconst root = resolveSandboxRoot(options.workspacesRoot, options.scope);\n\tawait ensureWorkspaceDir(root);\n\tconst files = flattenSandboxFiles(options.definition?.files);\n\tif (files.length) await applySandboxFiles(root, files, options.scope);\n\treturn {\n\t\troot,\n\t\tscope: options.scope,\n\t\t...options.definition !== void 0 ? { definition: options.definition } : {}\n\t};\n}\nasync function applySandboxFiles(root, files, scope) {\n\tfor (const entry of files) {\n\t\tconst hostPath = resolve(root, entry.path);\n\t\tif (scope.type === \"agent\") try {\n\t\t\tawait access(hostPath);\n\t\t\tcontinue;\n\t\t} catch {}\n\t\tawait mkdir(dirname(hostPath), { recursive: true });\n\t\tawait writeFile(hostPath, entry.file);\n\t}\n}\n//#endregion\n//#region src/files/pack-dir.ts\nconst SKIP_DIRS$1 = new Set([\".git\", \"node_modules\"]);\n/** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */\nfunction packDirFromDisk(rootPath) {\n\tconst stat = statSync(rootPath);\n\tif (stat.isFile()) return [{\n\t\tpath: basename(rootPath),\n\t\tfile: readFileSync(rootPath, \"utf8\")\n\t}];\n\tif (!stat.isDirectory()) throw new Error(`Expected a file or directory at ${rootPath}`);\n\tconst files = [];\n\twalkDir(rootPath, rootPath, files);\n\treturn files;\n}\nfunction walkDir(rootPath, currentPath, files) {\n\tfor (const name of readdirSync(currentPath)) {\n\t\tif (SKIP_DIRS$1.has(name)) continue;\n\t\tconst entryPath = join(currentPath, name);\n\t\tconst stat = statSync(entryPath);\n\t\tif (stat.isDirectory()) {\n\t\t\twalkDir(rootPath, entryPath, files);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stat.isFile()) continue;\n\t\tfiles.push({\n\t\t\tpath: relative(rootPath, entryPath),\n\t\t\tfile: readFileSync(entryPath, \"utf8\")\n\t\t});\n\t}\n}\n//#endregion\n//#region src/files/pack-asset-dirs.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\n/** Pack every subdir under `src/skills/` and `src/files/` into an asset manifest. */\nfunction packAssetDirs(appRoot, srcDir = \"src\") {\n\treturn {\n\t\tskills: packAssetRoot(join(appRoot, srcDir, \"skills\")),\n\t\tfiles: packAssetRoot(join(appRoot, srcDir, \"files\"))\n\t};\n}\nfunction packAssetRoot(rootPath) {\n\tif (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return {};\n\tconst manifest = {};\n\tfor (const name of readdirSync(rootPath)) {\n\t\tif (SKIP_DIRS.has(name)) continue;\n\t\tconst entryPath = join(rootPath, name);\n\t\tif (!statSync(entryPath).isDirectory()) continue;\n\t\tmanifest[name] = packDirFromDisk(entryPath);\n\t}\n\treturn manifest;\n}\n//#endregion\n//#region src/files/resolve-app-root.ts\n/** Walk upward from a module file to find the user app root (`src/agents`, `src/skills`, etc.). */\nfunction resolveAppRoot(fromPath) {\n\tlet dir = statSync(fromPath).isDirectory() ? fromPath : dirname(fromPath);\n\twhile (dir !== dirname(dir)) {\n\t\tif (hasAppLayout(dir)) return dir;\n\t\tdir = dirname(dir);\n\t}\n\treturn process.env.KEYSTROKE_ROOT ?? process.cwd();\n}\n/** Resolve app root from an agent (or other) module URL. */\nfunction resolveAppRootFromModule(moduleUrl) {\n\treturn resolveAppRoot(fileURLToPath(moduleUrl));\n}\nfunction hasAppLayout(dir) {\n\tconst src = join(dir, \"src\");\n\tconst dist = join(dir, \"dist\");\n\treturn existsSync(join(src, \"agents\")) || existsSync(join(src, \"skills\")) || existsSync(join(src, \"files\")) || existsSync(join(dist, \"agents\")) || existsSync(join(dist, \".keystroke\", \"assets.mjs\"));\n}\n//#endregion\nexport { materializeSandbox as a, SandboxDefinitionSchema as c, ensureWorkspaceDir as d, resolveSandboxRoot as f, packDirFromDisk as i, SandboxFileContentSchema as l, resolveAppRootFromModule as n, flattenSandboxFiles as o, packAssetDirs as r, defineSandbox as s, resolveAppRoot as t, SandboxFileSchema as u };\n\n//# sourceMappingURL=files-B0H9_dP4.mjs.map","import { isBuiltin } from \"node:module\";\n\n/** Native addons kept external — resolved from the CLI runtime at app start. */\nexport const NATIVE_RUNTIME_DEPS = [\"pg\", \"better-sqlite3\", \"@parcel/watcher\"];\n\n/** Kept external so .d.ts emission does not inline internal/inferred types. */\nexport const LIBRARY_EXTERNAL_DEPS = [\"better-auth\", /^@better-auth\\//, /^better-auth\\//];\n\n/** Non-auth runtime deps kept external for published entry bundles (platform, etc.). */\nexport const BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS = [\n ...NATIVE_RUNTIME_DEPS,\n \"dockerode\",\n \"ssh2\",\n \"cpu-features\",\n \"microsandbox\",\n /^@aws-sdk\\//,\n /^@napi-rs\\//,\n \"hono\",\n /^@hono\\//,\n \"undici\",\n];\n\n/** Kept external when bundling published entry points (cli, keystroke, platform). */\nexport const BUNDLED_ENTRY_EXTERNAL_DEPS = [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...LIBRARY_EXTERNAL_DEPS,\n];\n\n/** Bundle into CLI — device login uses Better Auth client only. */\nexport const BETTER_AUTH_CLIENT_BUNDLE_PATTERNS = [\n /^better-auth\\/client$/,\n /^better-auth\\/client\\//,\n];\n\n/** Server adapters and root entry — must not ship in the CLI bundle. */\nexport const BETTER_AUTH_SERVER_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^@better-auth\\//,\n /^better-auth\\/(?!client(\\/|$)).+/,\n];\n\nexport function isNativeRuntimeDep(id) {\n return NATIVE_RUNTIME_DEPS.some((dep) => id === dep || id.startsWith(`${dep}/`));\n}\n\nfunction packageName(id) {\n if (id.startsWith(\"@\")) {\n const [scope, name] = id.split(\"/\");\n return name ? `${scope}/${name}` : id;\n }\n\n return id.split(\"/\")[0] ?? id;\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (name.startsWith(\"@keystrokehq/\")) {\n return true;\n }\n\n if (name === \"better-auth\" || name.startsWith(\"@better-auth/\")) {\n return true;\n }\n\n return false;\n}\n\n/** Library packages resolve npm deps from node_modules at runtime. */\nexport function libraryBuildDepsConfig() {\n return {\n alwaysBundle: (_id) => null,\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Bundle npm deps into dist; resolve @keystrokehq/* and natives from the runtime. */\nexport function userAppBuildDepsConfig() {\n return {\n alwaysBundle: (id, _importer) => {\n if (id.startsWith(\".\") || id.startsWith(\"/\") || isBuiltin(id)) {\n return null;\n }\n\n return isRuntimeExternal(id) ? null : true;\n },\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/**\n * Published entry packages (cli, keystroke, platform): declare bundled @keystrokehq/*\n * in dependencies (changesets release graph ignores devDependencies). Inlining is\n * driven by alwaysBundle below, not by dep kind. Runtime npm deps stay external.\n */\nexport function bundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//],\n neverBundle: [...BUNDLED_ENTRY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Published CLI: inline better-auth client + @better-auth/*; keep server adapters external. */\nexport const BETTER_AUTH_CLI_BUNDLE_PATTERNS = [\n ...BETTER_AUTH_CLIENT_BUNDLE_PATTERNS,\n /^@better-auth\\//,\n];\n\nexport const BETTER_AUTH_CLI_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^better-auth\\/(?!client(\\/|$)).+/,\n /^@better-auth\\/drizzle-adapter/,\n \"drizzle-orm\",\n];\n\n/** Rolldown/tsdown — native bindings; stay in CLI node_modules at runtime. */\nexport const CLI_BUILD_TOOL_EXTERNAL_PATTERNS = [\"tsdown\", \"rolldown\", /^@rolldown\\//, \"tsx\"];\n\n/** CLI: inline better-auth/client; keep server + drizzle adapters external. */\nexport function cliBundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...BETTER_AUTH_CLI_EXTERNAL_PATTERNS,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n ],\n onlyBundle: false,\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig, userAppBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n libraryBuildDepsConfig,\n userAppBuildDepsConfig,\n} from \"./deps.js\";\n\nexport const baseTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: libraryBuildDepsConfig(),\n};\n\n/** tsdown config for published bundles (cli, keystroke, platform). */\nexport const bundledEntryTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: bundledEntryDepsConfig(),\n};\n","import { t as walkProject } from \"./walk-project-171B4cvO.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, readdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\n//#region src/resolve-runtime-artifact.ts\nfunction packageRoot(nodeModules, scope, name) {\n\tconst direct = scope ? join(nodeModules, scope, name) : join(nodeModules, name);\n\tif (existsSync(join(direct, \"package.json\"))) return direct;\n\tconst pnpmDir = join(nodeModules, \".pnpm\");\n\tif (!existsSync(pnpmDir)) return null;\n\tfor (const entry of readdirSync(pnpmDir)) {\n\t\tconst candidate = scope ? join(pnpmDir, entry, \"node_modules\", scope, name) : join(pnpmDir, entry, \"node_modules\", name);\n\t\tif (existsSync(join(candidate, \"package.json\"))) return candidate;\n\t}\n\treturn null;\n}\n/** Resolve a file shipped with `@keystrokehq/build` inside the CLI runtime. */\nfunction resolveRuntimeBuildArtifact(runtimeNodeModules, relativePath) {\n\tconst pkgRoot = packageRoot(runtimeNodeModules, \"@keystrokehq\", \"build\");\n\tif (!pkgRoot) throw new Error(\"Keystroke runtime is missing @keystrokehq/build\");\n\tconst artifact = join(pkgRoot, relativePath);\n\tif (!existsSync(artifact)) throw new Error(`Keystroke runtime artifact not found: ${relativePath}`);\n\treturn artifact;\n}\n//#endregion\n//#region src/vitest-plugin.ts\nconst ASSETS_MODULE$1 = \"@keystrokehq/assets\";\nconst virtualPrefix = `\\0${ASSETS_MODULE$1}:`;\n/** Vitest plugin resolving `@keystrokehq/assets` from disk. */\nfunction agentAssetsVitestPlugin(appRoot = process.cwd()) {\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$1) return null;\n\t\t\treturn `${virtualPrefix}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${virtualPrefix}manifest`) return null;\n\t\t\tmanifest ??= packAssetDirs(appRoot);\n\t\t\treturn `export default ${JSON.stringify(manifest)};`;\n\t\t}\n\t};\n}\nfunction findAppRootFromConfig(configFile) {\n\tif (!configFile) return process.cwd();\n\treturn dirname(configFile);\n}\nfunction agentAssetsVitestPluginFromConfig(configFile) {\n\treturn agentAssetsVitestPlugin(findAppRootFromConfig(configFile));\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\nfunction renderAssetModule(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Rolldown plugin: pack src/skills + src/files and expose `@keystrokehq/assets`. */\nfunction agentAssetsPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tbuildStart() {\n\t\t\tmanifest = packAssetDirs(options.root, srcDir);\n\t\t},\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE) return null;\n\t\t\treturn `${VIRTUAL_PREFIX}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX}manifest` || !manifest) return null;\n\t\t\treturn renderAssetModule(manifest);\n\t\t},\n\t\tbuildEnd() {\n\t\t\tif (!manifest) return;\n\t\t\tconst outDir = join(options.root, options.outDir ?? \"dist\", \".keystroke\");\n\t\t\tmkdirSync(outDir, { recursive: true });\n\t\t\twriteFileSync(join(outDir, \"assets.mjs\"), renderAssetModule(manifest));\n\t\t}\n\t};\n}\n/** Full tsdown config for user keystroke apps (config + discovered modules only). */\nfunction createAppBuildConfig(options = {}, buildEntries) {\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 discovered = buildEntries ?? walkProject(root, srcDir).buildEntries;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discovered\n\t};\n\tif (Object.keys(entries).length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\treturn mergeConfig(baseTsdownConfig, {\n\t\tentry: entries,\n\t\tformat: [\"esm\"],\n\t\toutDir: join(root, outDir),\n\t\tclean: options.clean ?? true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [agentAssetsPlugin({\n\t\t\troot,\n\t\t\tsrcDir,\n\t\t\toutDir\n\t\t})]\n\t});\n}\n/** Build user agents, workflows, triggers, and config to `dist/`. */\nasync function buildApp(options = {}) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst emitManifest = options.emitManifest ?? true;\n\tconst collectSources = options.collectSources ?? false;\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources\n\t});\n\ttry {\n\t\tprocess.chdir(root);\n\t\tawait build(createAppBuildConfig({\n\t\t\t...options,\n\t\t\troot\n\t\t}, walked.buildEntries));\n\t\tif (emitManifest) {\n\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn { sourceFiles: walked.sourceFiles };\n}\n/**\n* Watch `src/` and rebuild `dist/` on change.\n*\n* NOT true hot reload — each change runs a full tsdown rebuild. Callers should\n* restart the API server in `onRebuild` so discovery picks up new/changed modules.\n*/\nasync function watchApp(options = {}) {\n\tconst { runWatchApp } = await import(\"./watch-app-DTIeKrbl.mjs\");\n\tawait runWatchApp((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, createAppBuildConfig, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;AAeA,MAAM,2BAA2BA,OAAS;CACzC,MAAMC,OAAS;CACf,MAAMA,OAAS;AAChB,CAAC;;AAED,MAAM,oBAAoBD,OAAS;CAClC,MAAMC,OAAS;;CAEf,MAAMA,OAAS,EAAE,SAAS;;CAE1B,KAAKC,MAAQ,wBAAwB,EAAE,SAAS;AACjD,CAAC;AAC+BF,OAAS;CACxC,KAAKC,OAAS,EAAE,SAAS;CACzB,OAAOC,MAAQ,iBAAiB,EAAE,SAAS;AAC5C,CAAC;AAwDD,MAAM,cAAc,IAAI,IAAI,CAAC,QAAQ,cAAc,CAAC;;AAEpD,SAAS,gBAAgB,UAAU;CAClC,MAAM,OAAO,SAAS,QAAQ;CAC9B,IAAI,KAAK,OAAO,GAAG,OAAO,CAAC;EAC1B,MAAM,SAAS,QAAQ;EACvB,MAAM,aAAa,UAAU,MAAM;CACpC,CAAC;CACD,IAAI,CAAC,KAAK,YAAY,GAAG,MAAM,IAAI,MAAM,mCAAmC,UAAU;CACtF,MAAM,QAAQ,CAAC;CACf,QAAQ,UAAU,UAAU,KAAK;CACjC,OAAO;AACR;AACA,SAAS,QAAQ,UAAU,aAAa,OAAO;CAC9C,KAAK,MAAM,QAAQ,YAAY,WAAW,GAAG;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CAAkC,IAAI;EAC7C;CACD,UAAU;EACT,QAAQ,MAAM,QAAQ;CACvB;CACA,OAAO,EAAE,aAAa,OAAO,YAAY;AAC1C;;;;;;;AAOA,eAAe,SAAS,UAAU,CAAC,GAAG;CACrC,MAAM,EAAE,gBAAgB,MAAM,OAAO;CACrC,MAAM,aAAa,iBAAiB,SAAS;EAC5C,GAAG;EACH,cAAc;EACd,gBAAgB;CACjB,CAAC,GAAG,OAAO;AACZ"}
|
|
@@ -1183,6 +1183,7 @@ const PromptInputSchema = object({
|
|
|
1183
1183
|
});
|
|
1184
1184
|
const PromptResponseSchema = object({
|
|
1185
1185
|
sessionId: string(),
|
|
1186
|
+
runId: string(),
|
|
1186
1187
|
messages: array(record(string(), unknown())),
|
|
1187
1188
|
error: string().nullable()
|
|
1188
1189
|
});
|
|
@@ -1608,6 +1609,7 @@ const HistoryRunDetailSchema = discriminatedUnion("kind", [object({
|
|
|
1608
1609
|
usage: HistoryRunUsageSchema.nullable().optional()
|
|
1609
1610
|
}), object({
|
|
1610
1611
|
kind: literal("agent"),
|
|
1612
|
+
runId: string(),
|
|
1611
1613
|
session: object({
|
|
1612
1614
|
id: string(),
|
|
1613
1615
|
agentKey: string(),
|
|
@@ -2109,4 +2111,4 @@ object({
|
|
|
2109
2111
|
//#endregion
|
|
2110
2112
|
export { OrganizationSidebarBrandingPatchSchema as $, parseErrorResponse as $t, ErrorResponseSchema as A, UpdateCredentialInstanceBodySchema as At, InviteProjectMembersRequestSchema as B, UploadProjectSourceResponseSchema as Bt, CreateOrganizationResponseSchema as C, StartOAuthConnectionResultSchema as Ct, CredentialInstanceListResponseSchema as D, TriggerRunDetailResponseSchema as Dt, CreateProjectResponseSchema as E, TriggerListResponseSchema as Et, HistoryRunDetailResponseSchema as F, UpdateProjectMemberRequestSchema as Ft, ListOrganizationInvitationsResponseSchema as G, UserPreferencesSchema as Gt, ListApiKeysResponseSchema as H, UserAvatarPatchSchema as Ht, HistoryRunListQuerySchema as I, UpdateProjectMemberResponseSchema as It, ListProjectDeploymentsResponseSchema as J, WorkflowSummaryDetailResponseSchema as Jt, ListOrganizationMembersResponseSchema as K, WorkflowRunDetailResponseSchema as Kt, HistoryRunListResponseSchema as L, UpdateProjectRequestSchema as Lt, GetCredentialResponseSchema as M, UpdateOrganizationMemberRequestSchema as Mt, HealthResponseSchema as N, UpdateOrganizationMemberResponseSchema as Nt, CredentialInstanceRecordSchema as O, TriggerRunListResponseSchema as Ot, HistoryRunCancelResponseSchema as P, UpdateOrganizationRequestSchema as Pt, ListProjectsResponseSchema as Q, originFromPublicUrl as Qt, InviteOrganizationMembersRequestSchema as R, UpdateProjectSettingsRequestSchema as Rt, CreateOrganizationRequestSchema as S, StartOAuthConnectionInputSchema as St, CreateProjectRequestSchema as T, TriggerDetailResponseSchema as Tt, ListAppsResponseSchema as U, UserAvatarSchema as Ut, InviteProjectMembersResponseSchema as V, UpsertGatewayAttachmentBodySchema as Vt, ListCredentialsResponseSchema as W, UserPreferencesPatchSchema as Wt, ListProjectMembersResponseSchema as X, listenPortFromPublicUrl as Xt, ListProjectFilesResponseSchema as Y, WorkflowSummaryListResponseSchema as Yt, ListProjectMetricsResponseSchema as Z, normalizeCredentialList as Zt, CreateApiKeyRequestSchema as _, ROUTE_MANIFEST_REL_PATH as _t, AgentSessionListResponseSchema as a, PresignProjectSourceRequestSchema as at, CreateCredentialsRequestSchema as b, SkillSummaryListResponseSchema as bt, BindChannelBodySchema as c, PresignUserAvatarResponseSchema as ct, ChannelConnectionSchema as d, ProjectSettingsResponseSchema as dt, OrganizationSidebarBrandingSchema as et, ChannelDirectoryListResponseSchema as f, ProjectSlugAvailabilityResponseSchema as ft, ConnectProvidersResponseSchema as g, QueuedRunResponseSchema as gt, ConnectAuthorizeUrlResponseSchema as h, QueuedAgentPromptResponseSchema as ht, AgentSessionDetailResponseSchema as i, PresignOrgLogoResponseSchema as it, GatewayAttachmentRecordSchema as j, UpdateCredentialRequestSchema as jt, DeclineOrganizationInvitationResponseSchema as k, UpdateChannelBindingBodySchema as kt, ChannelAccountListResponseSchema as l, ProjectReachabilityResponseSchema as lt, CompleteProjectArtifactResponseSchema as m, PromptResponseSchema as mt, AcceptOrganizationInvitationResponseSchema as n, PollRunResponseSchema as nt, AgentSummaryDetailResponseSchema as o, PresignProjectSourceResponseSchema as ot, ChannelPlatformSchema as p, PromptInputSchema as pt, ListOrganizationsResponseSchema as q, WorkflowRunListResponseSchema as qt, ActiveOrganizationResponseSchema as r, PresignOrgLogoRequestSchema as rt, AgentSummaryListResponseSchema as s, PresignUserAvatarRequestSchema as st, ACTIVE_ORG_HEADER as t, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as tt, ChannelConnectionListResponseSchema as u, ProjectResponseSchema as ut, CreateApiKeyResponseSchema as v, RecentResourceListResponseSchema as vt, CreateProjectArtifactResponseSchema as w, SubmitTeamRequestRequestSchema as wt, CreateCredentialsResponseSchema as x, SlugAvailabilityResponseSchema as xt, CreateCredentialInstanceBodySchema as y, SkillSummaryDetailResponseSchema as yt, InviteOrganizationMembersResponseSchema as z, UploadProjectSourceManifestRequestSchema as zt };
|
|
2111
2113
|
|
|
2112
|
-
//# sourceMappingURL=dist-
|
|
2114
|
+
//# sourceMappingURL=dist-C12M6Kul.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-C12M6Kul.mjs","names":["core._coercedNumber","schemas.ZodNumber","z.string","z.object","z.discriminatedUnion","z.literal","z.number","z.record","z.unknown","z.boolean","z.array","z.enum","z.ZodType","z.custom","z.union","z.coerce.number","z.url"],"sources":["../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js","../../../packages/shared/dist/index.mjs"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from \"zod\";\n//#region src/constants/conventions.ts\n/** File-layout rules shared by agents, workflows, triggers, and OpenAPI `x-keystroke`. */\nconst DISCOVERY_CONVENTIONS = {\n\tagents: {\n\t\tflat: \"{name}.ts → POST /agents/{name}\",\n\t\tnested: \"{path}/agent.ts or {path}/index.ts → POST /agents/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\tworkflows: {\n\t\tflat: \"{name}.ts → POST /workflows/{name}\",\n\t\tnested: \"{path}/workflow.ts or {path}/index.ts → POST /workflows/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\ttriggers: {\n\t\tflat: \"{name}.ts → trigger key {name}, attachment id {triggerKey}:{workflowKey}\",\n\t\tnested: \"{path}/trigger.ts or {path}/index.ts → trigger key {path}\",\n\t\thelpers: \"Reusable sources live under triggers/sources/ and are not discovered.\"\n\t},\n\topenapi: \"GET /openapi.json is built from the same discovery + mount loop as the live server.\"\n};\n//#endregion\n//#region src/constants/http.ts\nconst ACTIVE_ORG_COOKIE = \"keystroke-active-org-id\";\nconst ACTIVE_ORG_HEADER = \"x-keystroke-org-id\";\n//#endregion\n//#region src/organization-slug.ts\n/** Auth, session, and account-entry URL segments. */\nconst AUTH_ACCOUNT_SLUGS = [\n\t\"2fa\",\n\t\"accept-invite\",\n\t\"auth\",\n\t\"authorize\",\n\t\"callback\",\n\t\"callbacks\",\n\t\"confirm-email\",\n\t\"confirmation\",\n\t\"connect\",\n\t\"device\",\n\t\"email-verification\",\n\t\"forgot-password\",\n\t\"invite\",\n\t\"invites\",\n\t\"login\",\n\t\"logout\",\n\t\"magic-link\",\n\t\"mfa\",\n\t\"oauth\",\n\t\"onboarding\",\n\t\"password\",\n\t\"recovery\",\n\t\"register\",\n\t\"reset-password\",\n\t\"saml\",\n\t\"session\",\n\t\"sessions\",\n\t\"sign-in\",\n\t\"sign-up\",\n\t\"signin\",\n\t\"signout\",\n\t\"signup\",\n\t\"sso\",\n\t\"token\",\n\t\"tokens\",\n\t\"unlink\",\n\t\"verify\",\n\t\"verify-email\"\n];\n/** Org, workspace, billing, and account-management URL segments. */\nconst ORG_ACCOUNT_SLUGS = [\n\t\"account\",\n\t\"accounts\",\n\t\"billing\",\n\t\"console\",\n\t\"invoice\",\n\t\"invoices\",\n\t\"member\",\n\t\"members\",\n\t\"me\",\n\t\"org\",\n\t\"organization\",\n\t\"organizations\",\n\t\"orgs\",\n\t\"payment\",\n\t\"payments\",\n\t\"plan\",\n\t\"plans\",\n\t\"portal\",\n\t\"preferences\",\n\t\"profile\",\n\t\"settings\",\n\t\"subscription\",\n\t\"subscriptions\",\n\t\"team\",\n\t\"teams\",\n\t\"upgrade\",\n\t\"usage\",\n\t\"user\",\n\t\"users\",\n\t\"workspace\",\n\t\"workspaces\"\n];\n/** Product surfaces, resource types, and in-app navigation segments. */\nconst PRODUCT_SLUGS = [\n\t\"action\",\n\t\"actions\",\n\t\"activity\",\n\t\"agent\",\n\t\"agents\",\n\t\"analytics\",\n\t\"app\",\n\t\"apps\",\n\t\"artifact\",\n\t\"artifacts\",\n\t\"assistant\",\n\t\"assistants\",\n\t\"audit\",\n\t\"audit-log\",\n\t\"automation\",\n\t\"automations\",\n\t\"branch\",\n\t\"branches\",\n\t\"canvas\",\n\t\"chat\",\n\t\"chats\",\n\t\"connection\",\n\t\"connections\",\n\t\"create\",\n\t\"credential\",\n\t\"credentials\",\n\t\"dashboard\",\n\t\"deployment\",\n\t\"deployments\",\n\t\"examples\",\n\t\"execute\",\n\t\"execution\",\n\t\"executions\",\n\t\"explore\",\n\t\"get-started\",\n\t\"history\",\n\t\"inbox\",\n\t\"inspector\",\n\t\"integration\",\n\t\"integrations\",\n\t\"library\",\n\t\"logs\",\n\t\"marketplace\",\n\t\"mcp\",\n\t\"mcps\",\n\t\"new\",\n\t\"notifications\",\n\t\"observe\",\n\t\"plugin\",\n\t\"plugins\",\n\t\"primitive\",\n\t\"primitives\",\n\t\"project\",\n\t\"projects\",\n\t\"recents\",\n\t\"registry\",\n\t\"reports\",\n\t\"run\",\n\t\"runs\",\n\t\"runtime\",\n\t\"runtimes\",\n\t\"sandbox\",\n\t\"sandboxes\",\n\t\"search\",\n\t\"skill\",\n\t\"skills\",\n\t\"templates\",\n\t\"thread\",\n\t\"threads\",\n\t\"trigger\",\n\t\"triggers\",\n\t\"version\",\n\t\"versions\",\n\t\"workflow\",\n\t\"workflows\"\n];\n/** Marketing, docs, company, and go-to-market URL segments. */\nconst MARKETING_SITE_SLUGS = [\n\t\"about\",\n\t\"affiliates\",\n\t\"ai\",\n\t\"announcements\",\n\t\"anthropic\",\n\t\"blog\",\n\t\"book-demo\",\n\t\"brand\",\n\t\"campaigns\",\n\t\"career\",\n\t\"careers\",\n\t\"case-studies\",\n\t\"casestudies\",\n\t\"changelog\",\n\t\"chatgpt\",\n\t\"chrome-extension\",\n\t\"claude\",\n\t\"codex\",\n\t\"community\",\n\t\"company\",\n\t\"compare\",\n\t\"contact\",\n\t\"contribute\",\n\t\"creators\",\n\t\"customers\",\n\t\"demo\",\n\t\"demos\",\n\t\"discord\",\n\t\"docs\",\n\t\"documentation\",\n\t\"download\",\n\t\"downloads\",\n\t\"dust\",\n\t\"emerging-talent\",\n\t\"engineering-blog\",\n\t\"enterprise\",\n\t\"events\",\n\t\"experts\",\n\t\"extension\",\n\t\"faq\",\n\t\"faqs\",\n\t\"features\",\n\t\"forum\",\n\t\"glean\",\n\t\"grok\",\n\t\"guide\",\n\t\"guides\",\n\t\"gumloop\",\n\t\"handbook\",\n\t\"help\",\n\t\"help-center\",\n\t\"home\",\n\t\"how-it-works\",\n\t\"howitworks\",\n\t\"inspo\",\n\t\"intern\",\n\t\"investors\",\n\t\"jobs\",\n\t\"legal\",\n\t\"lindy\",\n\t\"llm\",\n\t\"llms\",\n\t\"love\",\n\t\"make\",\n\t\"manifesto\",\n\t\"media\",\n\t\"merch\",\n\t\"mission\",\n\t\"mobile\",\n\t\"models\",\n\t\"n8n\",\n\t\"news\",\n\t\"newsroom\",\n\t\"open\",\n\t\"open-claw\",\n\t\"open-source\",\n\t\"openai\",\n\t\"our-story\",\n\t\"overview\",\n\t\"partners\",\n\t\"pi\",\n\t\"pipedream\",\n\t\"platform\",\n\t\"press\",\n\t\"press-kit\",\n\t\"pricing\",\n\t\"privacy\",\n\t\"product\",\n\t\"products\",\n\t\"provider\",\n\t\"providers\",\n\t\"quick-start\",\n\t\"quickstart\",\n\t\"refer\",\n\t\"relay\",\n\t\"relay-app\",\n\t\"reporting\",\n\t\"request-demo\",\n\t\"resources\",\n\t\"roadmap\",\n\t\"schedule-demo\",\n\t\"security\",\n\t\"solutions\",\n\t\"stack-ai\",\n\t\"stackai\",\n\t\"startup\",\n\t\"startups\",\n\t\"status\",\n\t\"stories\",\n\t\"story\",\n\t\"students\",\n\t\"support\",\n\t\"swag\",\n\t\"switch\",\n\t\"talent\",\n\t\"terms\",\n\t\"testimonials\",\n\t\"thesis\",\n\t\"tines\",\n\t\"trust\",\n\t\"tutorials\",\n\t\"university\",\n\t\"use-case\",\n\t\"use-cases\",\n\t\"usecases\",\n\t\"versus\",\n\t\"vellum\",\n\t\"vs\",\n\t\"webinars\",\n\t\"workato\",\n\t\"xai\",\n\t\"yc\",\n\t\"zapier\"\n];\n/** Integrations, competitors, and partner brand slugs (marketing / integration pages). */\nconst INTEGRATION_BRAND_SLUGS = [\n\t\"airtable\",\n\t\"asana\",\n\t\"aws\",\n\t\"azure\",\n\t\"bun\",\n\t\"confluence\",\n\t\"copilot\",\n\t\"cursor\",\n\t\"databricks\",\n\t\"figma\",\n\t\"firebase\",\n\t\"fly\",\n\t\"gcp\",\n\t\"gemini\",\n\t\"github\",\n\t\"gitlab\",\n\t\"gmail\",\n\t\"heroku\",\n\t\"hubspot\",\n\t\"huggingface\",\n\t\"jira\",\n\t\"linear\",\n\t\"mailchimp\",\n\t\"meta\",\n\t\"mistral\",\n\t\"mixmax\",\n\t\"monday\",\n\t\"netlify\",\n\t\"neon\",\n\t\"notion\",\n\t\"npm\",\n\t\"outlook\",\n\t\"outreach\",\n\t\"perplexity\",\n\t\"planetscale\",\n\t\"pnpm\",\n\t\"postmark\",\n\t\"ramp\",\n\t\"railway\",\n\t\"render\",\n\t\"resend\",\n\t\"salesforce\",\n\t\"segment\",\n\t\"sendgrid\",\n\t\"shopify\",\n\t\"slack\",\n\t\"snowflake\",\n\t\"stripe\",\n\t\"supabase\",\n\t\"terraform\",\n\t\"trello\",\n\t\"turso\",\n\t\"twilio\",\n\t\"typeform\",\n\t\"vercel\",\n\t\"vscode\",\n\t\"windsurf\",\n\t\"yarn\"\n];\n/** Company, team, and department landing-page segments. */\nconst COMPANY_TEAM_SLUGS = [\n\t\"engineers\",\n\t\"engineering\",\n\t\"executives\",\n\t\"hc\",\n\t\"intern\",\n\t\"it\",\n\t\"leadership\",\n\t\"marketing\",\n\t\"ops\",\n\t\"revops\",\n\t\"sales\",\n\t\"services\",\n\t\"tech\"\n];\n/** Legal, trust, compliance, and policy URL segments. */\nconst LEGAL_TRUST_SLUGS = [\n\t\"accessibility\",\n\t\"agreement\",\n\t\"a11y\",\n\t\"bug-bounty\",\n\t\"compliance\",\n\t\"cookie-policy\",\n\t\"cookies\",\n\t\"disclose\",\n\t\"dpa\",\n\t\"eula\",\n\t\"gdpr\",\n\t\"hipaa\",\n\t\"iso\",\n\t\"msa\",\n\t\"pci\",\n\t\"responsible-disclosure\",\n\t\"sla\",\n\t\"soc2\",\n\t\"tos\",\n\t\"trust-center\",\n\t\"trustcenter\",\n\t\"vulnerability\"\n];\n/** Developer, API, CLI, and technical URL segments. */\nconst DEVELOPER_TECH_SLUGS = [\n\t\"api\",\n\t\"api-docs\",\n\t\"cli\",\n\t\"code\",\n\t\"config\",\n\t\"developer\",\n\t\"developer-tools\",\n\t\"developers\",\n\t\"dev-tools\",\n\t\"devtools\",\n\t\"dev\",\n\t\"dev-states\",\n\t\"graphql\",\n\t\"graphql-playground\",\n\t\"mcp-server\",\n\t\"mcp-servers\",\n\t\"openapi\",\n\t\"sdk\",\n\t\"swagger\"\n];\n/** Infra, ops, static assets, and system URL segments. */\nconst INFRA_SYSTEM_SLUGS = [\n\t\"acme-challenge\",\n\t\"admin\",\n\t\"apple-app-site-association\",\n\t\"assets\",\n\t\"batch\",\n\t\"cache\",\n\t\"cdn\",\n\t\"cron\",\n\t\"debug\",\n\t\"error\",\n\t\"errors\",\n\t\"favicon\",\n\t\"feed\",\n\t\"files\",\n\t\"health\",\n\t\"healthcheck\",\n\t\"healthz\",\n\t\"hooks\",\n\t\"internal\",\n\t\"item\",\n\t\"manifest\",\n\t\"metrics\",\n\t\"null\",\n\t\"ping\",\n\t\"prod\",\n\t\"public\",\n\t\"redirect\",\n\t\"robots\",\n\t\"rpc\",\n\t\"rss\",\n\t\"sharer\",\n\t\"sitemap\",\n\t\"staging\",\n\t\"static\",\n\t\"storage\",\n\t\"test\",\n\t\"undefined\",\n\t\"universal\",\n\t\"webhooks\",\n\t\"well-known\",\n\t\"www\"\n];\n/** Reserved slugs that are valid org names in theory but blocked for routing safety. */\nconst ROUTING_SAFETY_SLUGS = [\n\t\"alpha\",\n\t\"anonymous\",\n\t\"archive\",\n\t\"archived\",\n\t\"beta\",\n\t\"clone\",\n\t\"copy\",\n\t\"default\",\n\t\"deleted\",\n\t\"demo-org\",\n\t\"draft\",\n\t\"drafts\",\n\t\"duplicate\",\n\t\"early-access\",\n\t\"embed\",\n\t\"embedded\",\n\t\"export\",\n\t\"fork\",\n\t\"free\",\n\t\"guest\",\n\t\"import\",\n\t\"index\",\n\t\"list\",\n\t\"manage\",\n\t\"moderator\",\n\t\"newsletter\",\n\t\"owner\",\n\t\"preview\",\n\t\"previews\",\n\t\"private\",\n\t\"pro\",\n\t\"public-api\",\n\t\"publish\",\n\t\"published\",\n\t\"queue\",\n\t\"remove\",\n\t\"root\",\n\t\"sample\",\n\t\"samples\",\n\t\"selection\",\n\t\"share\",\n\t\"shared\",\n\t\"sponsor\",\n\t\"sponsors\",\n\t\"sponsorship\",\n\t\"subscribe\",\n\t\"super\",\n\t\"superuser\",\n\t\"system\",\n\t\"sys\",\n\t\"test-org\",\n\t\"trash\",\n\t\"unpublish\",\n\t\"unsubscribe\",\n\t\"upload\",\n\t\"uploads\",\n\t\"waitlist\",\n\t\"widget\",\n\t\"widgets\",\n\t\"worker\",\n\t\"workers\"\n];\n/**\n* URL segments reserved for global (non-org) routes — cannot be used as an org slug.\n* Prefer adding new entries to the category arrays above; the Set is the enforcement surface.\n*/\nconst RESERVED_ORGANIZATION_SLUGS = new Set([\n\t...AUTH_ACCOUNT_SLUGS,\n\t...ORG_ACCOUNT_SLUGS,\n\t...PRODUCT_SLUGS,\n\t...MARKETING_SITE_SLUGS,\n\t...INTEGRATION_BRAND_SLUGS,\n\t...COMPANY_TEAM_SLUGS,\n\t...LEGAL_TRUST_SLUGS,\n\t...DEVELOPER_TECH_SLUGS,\n\t...INFRA_SYSTEM_SLUGS,\n\t...ROUTING_SAFETY_SLUGS\n]);\n/**\n* Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.\n*\n* IMPORTANT: this is the schema for *reading* slugs (persisted rows, API\n* responses). It intentionally does NOT enforce the reserved-name list — an org\n* created before a name became reserved must still parse on read. Use\n* `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.\n*/\nconst OrganizationSlugSchema = z.string().trim().toLowerCase().min(2, \"Slug must be at least 2 characters\").max(64, \"Slug must be at most 64 characters\").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use lowercase letters, numbers, and dashes only\");\n/**\n* Slug validation for *claiming* a slug (organization create/rename). Adds the\n* reserved-name check on top of the base format. Never use this to parse\n* existing org data, or pre-existing orgs whose slug later became reserved would\n* fail to load.\n*/\nconst ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), \"This slug is reserved\");\nconst ORGANIZATION_NAME_APOSTROPHE_PATTERN = /[''\\u2018\\u2019]/g;\n/** Normalize a display name into slug-shaped text (may be empty or too short to claim). */\nfunction normalizeOrganizationNameToSlugBase(name) {\n\treturn name.trim().toLowerCase().replace(ORGANIZATION_NAME_APOSTROPHE_PATTERN, \"\").replace(/[^a-z0-9]+/g, \"-\").replace(/-+/g, \"-\").replace(/^-|-$/g, \"\");\n}\n/**\n* Live slug preview while typing an org name. Returns normalized text only —\n* no server-side `\"org\"` fallback when the preview is empty or under min length.\n*/\nfunction previewOrganizationSlugFromName(name) {\n\treturn normalizeOrganizationNameToSlugBase(name);\n}\n/** Derive a URL slug from a display name (not guaranteed unique). */\nfunction slugifyOrganizationName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"org\";\n\tconst parsed = OrganizationSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"org\";\n}\nfunction parseOrganizationSlug(input) {\n\treturn OrganizationSlugSchema.parse(input);\n}\n//#endregion\n//#region src/project-slug.ts\n/** Same format as organization slugs — org-scoped, no global reserved list. */\nconst ProjectSlugSchema = OrganizationSlugSchema;\n/** Derive a URL slug from a project display name (not guaranteed unique within the org). */\nfunction slugifyProjectName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"project\";\n\tconst parsed = ProjectSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"project\";\n}\nfunction parseProjectSlug(input) {\n\treturn ProjectSlugSchema.parse(input);\n}\n//#endregion\n//#region src/constants/projects.ts\n/** Platform wait for project /health before declaring unreachable. */\nconst PROJECT_PING_TIMEOUT_MS = 15e3;\n/** Browser→platform request budget (ping + small platform overhead). */\nconst PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;\n/** Pause between reachability checks after the previous check finishes. */\nconst PROJECT_REACHABILITY_RETRY_MS = 5e3;\n//#endregion\n//#region src/public-url.ts\n/** Normalize a public origin URL (no trailing slash). */\nfunction originFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback.replace(/\\/+$/, \"\");\n\treturn trimmed.replace(/\\/+$/, \"\");\n}\n/** TCP port to bind for a local server, derived from a public URL. */\nfunction listenPortFromUrl(url, fallback) {\n\tconst parsed = new URL(url);\n\tif (parsed.port) {\n\t\tconst port = Number(parsed.port);\n\t\tif (Number.isFinite(port) && port > 0) return port;\n\t}\n\tif (parsed.protocol === \"https:\") return 443;\n\tif (parsed.protocol === \"http:\") return 80;\n\treturn fallback;\n}\n/** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */\nfunction listenPortFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback;\n\ttry {\n\t\treturn listenPortFromUrl(trimmed, fallback);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n//#endregion\n//#region src/tool-parameters.ts\n/** JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0). */\nfunction toolParameters(schema) {\n\treturn z.toJSONSchema(schema, { target: \"draft-2020-12\" });\n}\n//#endregion\n//#region src/constants/route-manifest.ts\n/** On-disk path under the project root (packed in deploy artifacts when present). */\nconst ROUTE_MANIFEST_REL_PATH = \"dist/.keystroke/route-manifest.json\";\n/** HTTP route served by the project server after bootstrap. */\nconst ROUTE_MANIFEST_HTTP_PATH = \"/.keystroke/route-manifest\";\n//#endregion\n//#region src/schemas/route-manifest.ts\nconst StoredRouteManifestSkillSchema = z.object({\n\tslug: z.string(),\n\tname: z.string().optional(),\n\tdescription: z.string().optional(),\n\tmoduleFile: z.string()\n});\nconst serializedRouteManifestEntrySchema = z.discriminatedUnion(\"kind\", [\n\tz.object({\n\t\tkind: z.literal(\"health\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.literal(\"/health\")\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tname: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tmodel: z.string(),\n\t\tsystemPrompt: z.string(),\n\t\ttoolCount: z.number().int().nonnegative(),\n\t\tcredentialCount: z.number().int().nonnegative(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-session-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsubscribable: z.boolean(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-webhook\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tattachmentSchemas: z.record(z.string(), z.object({\n\t\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\t\tfilterSchema: z.record(z.string(), z.unknown()).optional()\n\t\t})),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll-group\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tpollId: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"cron-schedule\"),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"plugin\"),\n\t\tmethod: z.enum([\n\t\t\t\"GET\",\n\t\t\t\"POST\",\n\t\t\t\"PUT\",\n\t\t\t\"PATCH\",\n\t\t\t\"DELETE\"\n\t\t]),\n\t\tpath: z.string(),\n\t\tplugin: z.string()\n\t})\n]);\nconst StoredRouteManifestSchema = z.object({\n\tversion: z.literal(1),\n\tentries: z.array(serializedRouteManifestEntrySchema),\n\tskills: z.array(StoredRouteManifestSkillSchema).default([]),\n\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\n//#endregion\n//#region src/schemas/channels.ts\n/** Messaging platforms that support agent gateway bindings. */\nconst ChannelPlatformKeySchema = z.enum([\"slack\"]);\nconst ChannelReactionSupportSchema = z.enum([\n\t\"full\",\n\t\"read-only\",\n\t\"none\"\n]);\nconst ChannelCardSupportSchema = z.enum([\n\t\"full\",\n\t\"partial\",\n\t\"none\"\n]);\nconst ChannelStreamingSupportSchema = z.enum([\n\t\"native\",\n\t\"post-edit\",\n\t\"buffered\",\n\t\"drafts\",\n\t\"none\"\n]);\nconst ChannelCapabilitiesSchema = z.object({\n\tmentions: z.boolean(),\n\treactions: ChannelReactionSupportSchema,\n\tcards: ChannelCardSupportSchema,\n\tmodals: z.boolean(),\n\tstreaming: ChannelStreamingSupportSchema,\n\tdms: z.boolean()\n});\nconst ChannelListenModeSchema = z.enum([\n\t\"mention\",\n\t\"all\",\n\t\"dm\"\n]);\nconst ChannelBindingKindSchema = z.enum([\n\t\"public\",\n\t\"private\",\n\t\"dm\",\n\t\"group\",\n\t\"space\"\n]);\nconst AppGatewaySchema = z.object({\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\tsupportsChannelDirectory: z.boolean(),\n\twebhookPathHint: z.string().min(1),\n\tdocsUrl: z.string().url().optional(),\n\ttagline: z.string().min(1).optional()\n});\n/** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */\nconst ChannelPlatformSchema = z.object({\n\tkey: ChannelPlatformKeySchema,\n\tname: z.string().min(1),\n\tappLogoId: z.string().min(1),\n\tfallbackDomain: z.string().min(1),\n\tdescription: z.string().min(1),\n\ttagline: z.string().min(1),\n\tauthKind: z.enum([\"oauth\", \"api_key\"]),\n\tcredentialFields: z.array(z.object({\n\t\tkey: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tplaceholder: z.string().optional(),\n\t\thelpText: z.string().optional(),\n\t\ttype: z.enum([\n\t\t\t\"text\",\n\t\t\t\"password\",\n\t\t\t\"textarea\"\n\t\t]),\n\t\trequired: z.boolean(),\n\t\tprefix: z.string().optional()\n\t})),\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\twebhookPathHint: z.string().min(1),\n\tsupportsChannelDirectory: z.boolean(),\n\tdocsUrl: z.string().url().optional()\n});\nconst ChannelBindingSchema = z.object({\n\tid: z.string().min(1),\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema,\n\tmode: ChannelListenModeSchema,\n\tsubscribeOnMention: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst ChannelConnectionSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tagentId: z.string().min(1),\n\taccountLabel: z.string().min(1),\n\taccountId: z.string().min(1),\n\tconnectedAt: z.string(),\n\tbindings: z.array(ChannelBindingSchema)\n});\nconst ChannelDirectoryEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tkind: ChannelBindingKindSchema,\n\tmemberCount: z.number().int().nonnegative().optional(),\n\tisArchived: z.boolean().optional()\n});\nconst ChannelConnectionListResponseSchema = z.object({ connections: z.array(ChannelConnectionSchema) });\nconst ChannelDirectoryListResponseSchema = z.object({ channels: z.array(ChannelDirectoryEntrySchema) });\n/** Channel-relevant fields parsed from an OAuth connection's metadata blob. */\nconst ChannelAccountMetadataSchema = z.object({ teamName: z.string().min(1).optional() });\n/** OAuth workspace available for channel bindings (e.g. Slack team). */\nconst ChannelAccountSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tlabel: z.string().min(1),\n\tconnectedAt: z.string()\n});\nconst ChannelAccountListResponseSchema = z.object({ accounts: z.array(ChannelAccountSchema) });\nconst NewChannelBindingInputSchema = z.object({\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema.optional(),\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst BindChannelBodySchema = z.object({\n\tplatform: ChannelPlatformKeySchema,\n\taccountId: z.string().min(1),\n\tbinding: NewChannelBindingInputSchema\n});\nconst UpdateChannelBindingBodySchema = z.object({ patch: z.object({\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n}) });\n//#endregion\n//#region src/schemas/apps.ts\n/** A single OAuth scope an app can request, with human copy for connect UI. */\nconst OAuthScopeOptionSchema = z.object({\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tdefaultSelected: z.boolean().optional(),\n\trequired: z.boolean().optional()\n});\n/** How an app authenticates when connecting credentials. */\nconst AppAuthKindSchema = z.enum([\"oauth\", \"api_key\"]);\n/**\n* A connectable integration shown in the \"Connect an app\" picker. An \"app\" is\n* an integration / credential set — connected state is whether a credential exists.\n*/\nconst AppCatalogEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tcategory: z.string().min(1),\n\tintegrationDescription: z.string().min(1),\n\tauthKind: AppAuthKindSchema,\n\toauthScopes: z.array(OAuthScopeOptionSchema),\n\t/** When present, the app supports agent gateway bindings (external channels). */\n\tgateway: AppGatewaySchema.optional()\n});\nconst ListAppsResponseSchema = z.object({ apps: z.array(AppCatalogEntrySchema) });\n//#endregion\n//#region src/schemas/credentials.ts\n/** How a credential instance is stored (`credential_instances.auth_kind`). */\nconst CredentialAuthKindSchema = z.enum([\"api_key\", \"oauth_managed\"]);\n/** Where a credential instance is stored (`credential_instances.scope_type`). */\nconst CredentialScopeTypeSchema = z.enum([\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\n/**\n* Resolution chain step when an action/tool looks up credentials.\n* `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.\n*/\nconst CredentialScopeLevelSchema = z.enum([\n\t\"selection\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\nconst CREDENTIAL_AUTH_KINDS = CredentialAuthKindSchema.options;\nconst CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;\nconst CREDENTIAL_SCOPE_LEVELS = CredentialScopeLevelSchema.options;\n/** Default chain when `credential.static(...).scope()` is called with no args. */\nconst DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = [\"organization\", \"project\"];\nconst CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE = {\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\n//#endregion\n//#region src/schemas/app-credentials.ts\n/** Scope of a platform app credential (maps to `credential_instances.scope_type`). */\nconst AppCredentialScopeSchema = z.enum([\n\t\"user\",\n\t\"project\",\n\t\"organization\"\n]);\n/** How the credential was connected (OAuth vs manual api-key entry). */\nconst AppCredentialConnectionKindSchema = z.enum([\"oauth\", \"manual\"]);\n/** Connect-dialog permission preset for OAuth scope selection. */\nconst OAuthPermissionModeSchema = z.enum([\"default\", \"restricted\"]);\nconst optionalTimestamp$1 = z.string().optional();\nconst nullableOptionalTimestamp = z.string().nullable().optional();\n/**\n* Summary row for the apps/credentials table and credential detail page.\n* Plaintext secrets are never returned — only masked `keyPreviews`.\n*/\nconst AppCredentialSummarySchema = z.object({\n\tid: z.string().min(1),\n\tappId: z.string().min(1),\n\tlabel: z.string().min(1),\n\tscope: AppCredentialScopeSchema,\n\tlastRefreshedAt: z.string().nullable(),\n\tappName: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tprojectName: z.string().min(1).optional(),\n\tstatus: z.string().optional(),\n\tcreatedAt: optionalTimestamp$1,\n\tlastUsedAt: nullableOptionalTimestamp,\n\tisDefault: z.boolean().optional(),\n\tconnectionKind: AppCredentialConnectionKindSchema.optional(),\n\townerUserId: z.string().min(1).optional(),\n\townerName: z.string().min(1).optional(),\n\townerAvatarUrl: z.string().url().optional(),\n\tgrantedScopes: z.array(z.string().min(1)).optional(),\n\tcredentialKeys: z.array(z.string().min(1)).optional(),\n\tkeyPreviews: z.record(z.string(), z.string()).optional(),\n\texpiresAt: optionalTimestamp$1\n});\nconst credentialSecretValueSchema = z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" });\nfunction hasCredentialTarget(input) {\n\treturn input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;\n}\nfunction addMissingCredentialTargetIssue(ctx, path = [\"projects\"]) {\n\tctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"At least one credential target is required\",\n\t\tpath\n\t});\n}\n/** Target fields shared by create and OAuth start flows. */\nconst CredentialTargetsFieldsSchema = z.object({\n\tprojects: z.array(z.string().min(1)).default([]),\n\tcreateOrganizationCredential: z.boolean().default(false),\n\tcreateUserProvidedCredential: z.boolean().default(false)\n});\n/** Input for starting an OAuth connection (connect dialog / CLI connect). */\nconst StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tscopes: z.array(z.string().min(1)),\n\tpermissionMode: OAuthPermissionModeSchema\n});\n/** Result of starting an OAuth connection. */\nconst StartOAuthConnectionResultSchema = z.object({\n\tstatus: z.enum([\"connected\", \"redirecting\"]),\n\tauthorizeUrl: z.string().url().nullable()\n});\n/** Request body for `POST /api/credentials` (manual api-key fan-out). */\nconst CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tconnectionKind: AppCredentialConnectionKindSchema,\n\tvalue: credentialSecretValueSchema.optional(),\n\tscopes: z.array(z.string().min(1)).optional()\n}).superRefine((input, ctx) => {\n\tif (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);\n\tif (input.connectionKind === \"manual\" && !input.value) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"value is required for manual connections\",\n\t\tpath: [\"value\"]\n\t});\n\tif (input.connectionKind === \"oauth\") ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"OAuth credentials are created via the OAuth callback\",\n\t\tpath: [\"connectionKind\"]\n\t});\n});\n/** Request body for `PATCH /api/credentials/:id`. */\nconst UpdateCredentialRequestSchema = z.object({\n\tlabel: z.string().trim().min(1).optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: credentialSecretValueSchema.optional()\n}).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: \"At least one field is required\" });\nconst ListCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\nconst GetCredentialResponseSchema = z.object({ credential: AppCredentialSummarySchema });\nconst CreateCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\n//#endregion\n//#region src/schemas/team-requests.ts\nconst TeamRequestTypeSchema = z.enum([\n\t\"org-deletion\",\n\t\"contact\",\n\t\"enterprise-upgrade\"\n]);\nconst SubmitTeamRequestRequestSchema = z.object({\n\ttype: TeamRequestTypeSchema,\n\tmessage: z.string().trim().max(5e3).optional()\n});\nconst SubmitTeamRequestResponseSchema = z.object({ ok: z.literal(true) });\n//#endregion\n//#region src/schemas/credential-spec.ts\nfunction isCredentialInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.key === \"string\" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;\n}\nconst credentialInputSchema = z.custom((value) => isCredentialInput(value), \"must be a credential requirement\");\nfunction createRef(kind, key, schema, options) {\n\tconst tokenField = options?.tokenField;\n\treturn {\n\t\tkind,\n\t\tkey,\n\t\tschema,\n\t\t...tokenField !== void 0 ? { tokenField } : {},\n\t\tscope(...chain) {\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t\tkind,\n\t\t\t\tschema,\n\t\t\t\tchain: chain.length > 0 ? chain : DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t\t\t...tokenField !== void 0 ? { tokenField } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction staticCredential(key, schema) {\n\treturn createRef(\"api_key\", key, schema instanceof z.ZodType ? schema : z.object(schema));\n}\nfunction oauthCredential(key, options) {\n\tconst tokenField = options?.tokenField ?? \"accessToken\";\n\treturn createRef(\"oauth_managed\", key, tokenField === \"accessToken\" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });\n}\nconst credential = {\n\tstatic: staticCredential,\n\toauth: oauthCredential\n};\nfunction defineCredential(input) {\n\tif (input.kind === \"oauth\") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);\n\tif (\"schema\" in input) return credential.static(input.key, input.schema);\n\treturn credential.static(input.key, input.fields);\n}\nfunction normalizeCredentialList(list) {\n\treturn list.map((item) => toCredentialRequirement(item));\n}\nfunction isCredentialRequirement(item) {\n\treturn \"chain\" in item;\n}\nfunction toCredentialRequirement(item) {\n\tif (isCredentialRequirement(item)) return item;\n\treturn {\n\t\tkey: item.key,\n\t\tkind: item.kind,\n\t\tschema: item.schema,\n\t\tchain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}\n\t};\n}\n//#endregion\n//#region src/schemas/organizations.ts\n/** Canonical copy for slug collision errors (API + UI). */\nconst ORGANIZATION_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst PROJECT_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst OrganizationSlugErrorCodeSchema = z.enum([\n\t\"slug_taken\",\n\t\"slug_reserved\",\n\t\"slug_invalid\"\n]);\nconst SlugAvailabilityReasonSchema = z.enum([\n\t\"taken\",\n\t\"reserved\",\n\t\"invalid\"\n]);\nconst SlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: SlugAvailabilityReasonSchema.optional(),\n\tsuggestion: OrganizationSlugSchema.optional()\n});\nconst SlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeOrganizationId: z.string().min(1).optional()\n});\nconst ProjectSlugAvailabilityReasonSchema = z.enum([\"taken\", \"invalid\"]);\nconst ProjectSlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: ProjectSlugAvailabilityReasonSchema.optional(),\n\tsuggestion: ProjectSlugSchema.optional()\n});\nconst ProjectSlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeProjectId: z.string().min(1).optional()\n});\n/** Client-side instant validation before hitting the project slug availability endpoint. */\nfunction validateProjectSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst parsed = ProjectSlugSchema.safeParse(normalized);\n\tif (!parsed.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: parsed.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\treturn { valid: true };\n}\n/** Client-side instant validation before hitting the availability endpoint. */\nfunction validateClaimableOrganizationSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst format = OrganizationSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: format.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\tif (RESERVED_ORGANIZATION_SLUGS.has(format.data)) return {\n\t\tvalid: false,\n\t\treason: \"reserved\",\n\t\tmessage: \"This slug is reserved\"\n\t};\n\treturn { valid: true };\n}\nfunction organizationSlugErrorCodeFromMessage(message) {\n\tif (message === \"That slug is already taken.\" || /already taken/i.test(message)) return \"slug_taken\";\n\tif (/reserved/i.test(message)) return \"slug_reserved\";\n\treturn \"slug_invalid\";\n}\nconst ProjectStatusSchema = z.enum([\n\t\"inactive\",\n\t\"starting\",\n\t\"active\",\n\t\"failed\"\n]);\nconst OrganizationUserRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst isoDateTime$5 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\n\tslug: ProjectSlugSchema,\n\tdescription: z.string().nullable(),\n\tstatus: ProjectStatusSchema,\n\tbaseUrl: z.string().nullable(),\n\truntimeId: z.string().nullable(),\n\tlastError: z.string().nullable(),\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst UserOrganizationSchema = z.object({\n\torganization: OrganizationSchema,\n\trole: OrganizationUserRoleSchema\n});\nconst CurrentOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema.nullable() });\nconst ActiveOrganizationResponseSchema = CurrentOrganizationResponseSchema;\nconst ListOrganizationsResponseSchema = z.object({ organizations: z.array(UserOrganizationSchema) });\nconst CreateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\t/** Format-only at the wire boundary; reserved-name checks run in platform-database. */\n\tslug: OrganizationSlugSchema.optional()\n});\nconst UpdateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tslug: ClaimableOrganizationSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst ProjectListMetricsSchema = z.object({\n\tagentCount: z.number(),\n\tworkflowCount: z.number(),\n\tskillCount: z.number(),\n\tcredentialCount: z.number(),\n\tlastDeploymentAt: isoDateTime$5.nullable()\n});\nconst ListProjectMetricsResponseSchema = z.object({ metrics: z.record(z.string(), ProjectListMetricsSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\nconst UpdateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tdescription: z.string().trim().optional(),\n\tslug: ProjectSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectReachabilityResponseSchema = z.object({ reachable: z.boolean() });\nfunction parseCreateOrganizationRequest(input) {\n\treturn CreateOrganizationRequestSchema.parse(input);\n}\n//#endregion\n//#region src/schemas/errors/schema.ts\nconst ValidationErrorDetailSchema = z.object({\n\tpath: z.string(),\n\tmessage: z.string()\n});\n/** Machine-readable codes returned in standard API error bodies. */\nconst ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([\"needs_org_selection\"]));\n/** Standard JSON error body returned by the HTTP API. */\nconst ErrorResponseSchema = z.object({\n\terror: z.string(),\n\tcode: ErrorResponseCodeSchema.optional(),\n\tmessage: z.string().optional(),\n\tdetails: z.array(ValidationErrorDetailSchema).optional()\n});\n//#endregion\n//#region src/schemas/errors/from-zod.ts\n/** Build the JSON body for HTTP 400 validation failures. */\nfunction validationErrorResponse(error, summary) {\n\treturn {\n\t\terror: summary,\n\t\tdetails: error.issues.map((issue) => ({\n\t\t\tpath: issue.path.join(\".\"),\n\t\t\tmessage: issue.message\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/schemas/errors/parse.ts\nconst MessageOnlyErrorBodySchema = z.object({ message: z.string() });\n/** Parse a JSON error body from the API. */\nfunction parseErrorResponse(body) {\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\tif (parsed.success) return parsed.data;\n\tconst messageOnly = MessageOnlyErrorBodySchema.safeParse(body);\n\tif (messageOnly.success) return {\n\t\terror: messageOnly.data.message,\n\t\tmessage: messageOnly.data.message\n\t};\n}\n//#endregion\n//#region src/schemas/http.ts\nconst CredentialRunContextSchema = z.object({\n\torgId: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tuserId: z.string().min(1).optional(),\n\tuserIds: z.record(z.string(), z.string()).optional(),\n\tselection: z.record(z.string(), z.string()).optional()\n});\nconst ThinkingLevelSchema = z.enum([\n\t\"off\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\"\n]);\nconst PromptInputSchema = z.object({\n\tmessage: z.string().min(1),\n\tsessionId: z.string().min(1).optional(),\n\tsubscriptionId: z.string().min(1).optional(),\n\tcontext: CredentialRunContextSchema.optional(),\n\tthinkingLevel: ThinkingLevelSchema.optional()\n});\nconst PromptResponseSchema = z.object({\n\tsessionId: z.string(),\n\trunId: z.string(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\terror: z.string().nullable()\n});\nconst SkipResponseSchema = z.object({\n\tok: z.literal(true),\n\tskipped: z.literal(true)\n});\nconst HealthResponseSchema = z.object({ ok: z.literal(true) });\nconst PlatformInfoResponseSchema = z.object({ service: z.string() });\nconst ConnectProviderSchema = z.object({\n\tkey: z.string(),\n\tmode: z.enum([\"authorize-url\", \"browser-redirect\"]),\n\tpath: z.string(),\n\trequiresAuth: z.boolean()\n});\nconst ConnectProvidersResponseSchema = z.object({ providers: z.array(ConnectProviderSchema) });\nconst ConnectAuthorizeUrlResponseSchema = z.object({ url: z.string() });\nconst QueuedRunResponseSchema = z.object({ runId: z.string() });\nconst QueuedAgentPromptResponseSchema = z.object({ sessionId: z.string() });\nfunction parsePromptInput(input) {\n\treturn PromptInputSchema.parse(input);\n}\nconst PollRunRequestSchema = z.object({\n\tworkflows: z.array(z.string().min(1)).optional(),\n\tattachments: z.array(z.string().min(1)).optional()\n});\nconst PollAttachmentResultSchema = z.object({\n\tattachmentKey: z.string(),\n\tworkflowKey: z.string(),\n\trunId: z.string().optional(),\n\tbody: z.unknown().optional(),\n\tqueued: z.boolean(),\n\tskipped: z.boolean().optional()\n});\nconst PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });\nconst PollRunResponseSchema = z.union([\n\tz.record(z.string(), z.unknown()),\n\tPollRunMultiResponseSchema,\n\tSkipResponseSchema,\n\tz.object({ runId: z.string() })\n]);\nfunction parsePollRunRequest(body) {\n\tif (body === void 0 || body === null) return {};\n\treturn PollRunRequestSchema.parse(body);\n}\n//#endregion\n//#region src/schemas/runs.ts\nconst RunSourceKindSchema = z.enum([\n\t\"api\",\n\t\"trigger\",\n\t\"gateway\",\n\t\"workflow\",\n\t\"agent\"\n]);\nconst RunSourceSchema = z.object({\n\tkind: RunSourceKindSchema,\n\tid: z.string().nullable()\n});\n//#endregion\n//#region src/schemas/workflow-runs.ts\nconst WorkflowRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst WorkflowRunTriggerSchema = z.enum([\n\t\"api\",\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\",\n\t\"retry\"\n]);\n/**\n* Durable workflow event-log entry types. Shared so the persistence layer\n* (`@keystrokehq/database` schema) and the runtime-agnostic replay engine\n* (`@keystrokehq/workflow`) reference one definition instead of duplicating it.\n*/\nconst WorkflowEventTypeSchema = z.enum([\n\t\"run_started\",\n\t\"step_completed\",\n\t\"step_failed\",\n\t\"step_retrying\",\n\t\"sleep_scheduled\",\n\t\"sleep_completed\",\n\t\"hook_created\",\n\t\"hook_resumed\",\n\t\"run_completed\",\n\t\"run_failed\",\n\t\"run_canceled\"\n]);\nconst WorkflowRunSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable()\n});\nconst WorkflowRunRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowSlug: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable(),\n\tparentWorkflowRunId: z.string().nullable(),\n\tparentSpanId: z.string().nullable(),\n\tinput: z.unknown().nullable(),\n\toutput: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst WorkflowRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: WorkflowRunStatusSchema.optional(),\n\ttrigger: WorkflowRunTriggerSchema.optional()\n});\nconst WorkflowRunListResponseSchema = z.object({\n\titems: z.array(WorkflowRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst WorkflowRunDetailIncludeSchema = z.enum([\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n]);\nconst WorkflowRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$2 = [\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n];\nfunction parseWorkflowRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$2];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => WorkflowRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$2];\n}\nconst TriggerRunDetailSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable(),\n\ttriggerType: z.enum([\n\t\t\"cron\",\n\t\t\"webhook\",\n\t\t\"poll\"\n\t]),\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst WorkflowStepRunSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst TraceTriggerSummarySchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowSlug: z.string().optional(),\n\tagentSlug: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentSlug: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst TraceGatewaySummarySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst TraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst TraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst TraceResponseSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: TraceTriggerSummarySchema,\n\tgateway: TraceGatewaySummarySchema,\n\tspans: z.array(TraceSpanSchema),\n\tlogs: z.array(TraceLogSchema)\n});\nconst WorkflowRunDetailResponseSchema = z.object({\n\trun: WorkflowRunRecordSchema,\n\ttrigger: TriggerRunDetailSchema.nullable(),\n\tsteps: z.array(WorkflowStepRunSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/agent-sessions.ts\nconst AgentSessionStatusSchema = z.enum([\n\t\"running\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst AgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tmessageCount: z.number()\n});\nconst AgentSessionRecordSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tmessageCount: z.number(),\n\terror: z.unknown().nullable()\n});\nconst AgentSessionListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: AgentSessionStatusSchema.optional(),\n\tsource: RunSourceKindSchema.optional()\n});\nconst AgentSessionListResponseSchema = z.object({\n\titems: z.array(AgentSessionSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst AgentSessionDetailIncludeSchema = z.enum([\n\t\"gateway\",\n\t\"messages\",\n\t\"events\",\n\t\"trace\"\n]);\nconst AgentSessionDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$1 = [\n\t\"gateway\",\n\t\"messages\",\n\t\"trace\"\n];\nfunction parseAgentSessionDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$1];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => AgentSessionDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$1];\n}\nconst GatewaySessionDetailSchema = z.object({\n\tthreadId: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable()\n});\nconst AgentEventSchema = z.object({\n\tid: z.string(),\n\tsessionId: z.string(),\n\tseq: z.number(),\n\teventType: z.string(),\n\tpayload: z.unknown(),\n\tcreatedAt: z.string()\n});\nconst AgentSessionDetailResponseSchema = z.object({\n\tsession: AgentSessionRecordSchema,\n\tgateway: GatewaySessionDetailSchema.nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\tevents: z.array(AgentEventSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/gateway-attachments.ts\nconst SlackGatewayModeSchema = z.enum([\n\t\"mention\",\n\t\"channel\",\n\t\"dm\"\n]);\nconst GatewayAttachmentSourceSchema = z.object({\n\tkind: z.literal(\"slack\"),\n\tmode: SlackGatewayModeSchema,\n\tcredentialKey: z.string(),\n\tchannelIds: z.array(z.string()).optional(),\n\tsubscribeOnMention: z.boolean()\n});\nconst GatewayAttachmentRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tagentKey: z.string(),\n\tchannelId: z.string(),\n\tteamId: z.string().nullable().optional(),\n\tplatform: z.string(),\n\tsource: GatewayAttachmentSourceSchema,\n\tregisteredAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst GatewayAttachmentListResponseSchema = z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });\nconst UpsertGatewayAttachmentBodySchema = z.object({\n\tagentKey: z.string().min(1),\n\tteamId: z.string().min(1).optional(),\n\tmode: SlackGatewayModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst AgentListItemSchema = z.object({\n\tkey: z.string(),\n\tname: z.string().optional(),\n\troute: z.string()\n});\nconst AgentListResponseSchema = z.object({ agents: z.array(AgentListItemSchema) });\n//#endregion\n//#region src/schemas/history.ts\nconst HistoryRunKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst HistoryRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst HistoryRunActorSchema = z.object({\n\tuserId: z.string(),\n\tname: z.string(),\n\tavatarUrl: z.string().nullable().optional()\n});\nconst HistoryRunUsageLineItemSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\tamountUsd: z.number()\n});\nconst HistoryRunUsageSchema = z.object({\n\trunDurationMs: z.number().nullable(),\n\tlineItems: z.array(HistoryRunUsageLineItemSchema),\n\ttotalExcludingDurationUsd: z.number().nullable()\n});\nconst HistoryRunSchema = z.object({\n\tid: z.string(),\n\tkind: HistoryRunKindSchema,\n\ttraceId: z.string().nullable(),\n\tprojectId: z.string(),\n\tprojectName: z.string(),\n\tresourceKey: z.string(),\n\tresourceId: z.string(),\n\tresourceName: z.string(),\n\tstatus: HistoryRunStatusSchema,\n\ttriggeredAt: z.string(),\n\ttimeInQueueMs: z.number().nullable(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tdurationMs: z.number().nullable(),\n\ttriggerLabel: z.string(),\n\ttriggerRaw: z.string(),\n\tranAs: HistoryRunActorSchema.nullable(),\n\tmodelsUsed: z.array(z.string()),\n\totherServicesUsed: z.array(z.string()),\n\ttotalCostUsd: z.number().nullable(),\n\tmessageCount: z.number().optional(),\n\tstepCount: z.number().optional()\n});\nconst HistoryTraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst HistoryTraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst HistoryTraceTriggerSchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentKey: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst HistoryTraceGatewaySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst HistoryTraceSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: HistoryTraceTriggerSchema,\n\tgateway: HistoryTraceGatewaySchema,\n\tspans: z.array(HistoryTraceSpanSchema),\n\tlogs: z.array(HistoryTraceLogSchema)\n});\nconst HistoryWorkflowStepSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst HistoryWorkflowRunDetailSchema = z.object({\n\tkind: z.literal(\"workflow\"),\n\trun: z.object({\n\t\tid: z.string(),\n\t\tworkflowKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\ttrigger: z.string(),\n\t\ttriggeredAt: z.string(),\n\t\tstartedAt: z.string().nullable(),\n\t\tfinishedAt: z.string().nullable(),\n\t\tinput: z.unknown().nullable(),\n\t\toutput: z.unknown().nullable(),\n\t\terror: z.unknown().nullable()\n\t}),\n\ttrigger: z.object({\n\t\tid: z.string(),\n\t\tattachmentKey: z.string().nullable(),\n\t\ttriggerType: z.string(),\n\t\tsourcePath: z.string().nullable(),\n\t\tpayload: z.unknown().nullable(),\n\t\ttriggeredAt: z.string()\n\t}).nullable(),\n\tsteps: z.array(HistoryWorkflowStepSchema),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryAgentSessionDetailSchema = z.object({\n\tkind: z.literal(\"agent\"),\n\trunId: z.string(),\n\tsession: z.object({\n\t\tid: z.string(),\n\t\tagentKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\tsource: z.enum([\n\t\t\t\"api\",\n\t\t\t\"gateway\",\n\t\t\t\"trigger\",\n\t\t\t\"workflow\",\n\t\t\t\"agent\"\n\t\t]),\n\t\tsourceId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tmessageCount: z.number(),\n\t\terror: z.unknown().nullable()\n\t}),\n\tgateway: z.object({\n\t\tthreadId: z.string(),\n\t\tattachmentKey: z.string().nullable()\n\t}).nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryRunDetailSchema = z.discriminatedUnion(\"kind\", [HistoryWorkflowRunDetailSchema, HistoryAgentSessionDetailSchema]);\nconst HistoryRunListQuerySchema = z.object({\n\tproject: z.string().min(1).optional(),\n\tstatus: HistoryRunStatusSchema.optional(),\n\tkind: HistoryRunKindSchema.optional()\n});\nconst HistoryRunListResponseSchema = z.array(HistoryRunSchema);\nconst HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();\nconst HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();\n//#endregion\n//#region src/schemas/workflow-deployments.ts\nconst WorkflowSubscriptionRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tuserId: z.string(),\n\tenabled: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst WorkflowSubscriptionListResponseSchema = z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });\nconst UpsertWorkflowSubscriptionBodySchema = z.object({\n\tuserId: z.string().min(1).optional(),\n\tenabled: z.boolean().optional()\n});\nconst CredentialInstanceRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable(),\n\tlabel: z.string().nullable(),\n\tisDefault: z.boolean(),\n\tauthKind: CredentialAuthKindSchema\n});\nconst CredentialInstanceListResponseSchema = z.object({ instances: z.array(CredentialInstanceRecordSchema) });\nconst CreateCredentialInstanceBodySchema = z.object({\n\tkey: z.string().min(1),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable().optional(),\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" })\n});\nconst UpdateCredentialInstanceBodySchema = z.object({\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" }).optional()\n});\n//#endregion\n//#region src/schemas/trigger-runs.ts\nconst TriggerRunTypeSchema = z.enum([\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\"\n]);\nconst TriggerRunWorkflowSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\tworkflowSlug: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunSummarySchema = z.object({\n\tid: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\ttriggeredAt: z.string(),\n\tsourcePath: z.string().nullable(),\n\tworkflowRun: TriggerRunWorkflowSummarySchema.nullable(),\n\tagentSession: TriggerRunAgentSessionSummarySchema.nullable()\n});\nconst TriggerRunRecordSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst TriggerRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\ttriggerType: TriggerRunTypeSchema.optional()\n});\nconst TriggerRunListResponseSchema = z.object({\n\titems: z.array(TriggerRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst TriggerRunDetailIncludeSchema = z.enum([\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n]);\nconst TriggerRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE = [\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n];\nfunction parseTriggerRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => TriggerRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE];\n}\nconst TriggerRunAgentSessionDetailSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunDetailResponseSchema = z.object({\n\trun: TriggerRunRecordSchema,\n\tworkflowRuns: z.array(WorkflowRunSummarySchema),\n\tagentSessions: z.array(TriggerRunAgentSessionDetailSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/triggers.ts\nconst TriggerTypeSchema = z.enum([\n\t\"webhook\",\n\t\"poll\",\n\t\"cron\"\n]);\nconst TriggerTargetKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst TriggerListItemSchema = z.object({\n\tkey: z.string(),\n\ttype: TriggerTypeSchema,\n\troute: z.string().optional(),\n\twebhookUrl: z.string().url().optional(),\n\ttargetKind: TriggerTargetKindSchema,\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional()\n});\nconst TriggerListResponseSchema = z.object({ triggers: z.array(TriggerListItemSchema) });\nconst TriggerListQuerySchema = z.object({ endpoint: z.string().min(1).optional() });\nconst TriggerDetailResponseSchema = TriggerListItemSchema;\n//#endregion\n//#region src/schemas/members.ts\nconst OrganizationMemberRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst OrganizationMemberStatusSchema = z.enum([\n\t\"invited\",\n\t\"active\",\n\t\"rejected\",\n\t\"suspended\"\n]);\nconst InvitableOrganizationMemberRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst isoDateTime$4 = z.string().datetime();\nconst OrganizationMemberSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: OrganizationMemberRoleSchema,\n\tstatus: OrganizationMemberStatusSchema,\n\tavatarUrl: z.string().optional(),\n\tjoinedAt: isoDateTime$4.optional(),\n\tlastActiveAt: isoDateTime$4.nullable().optional()\n});\nconst ListOrganizationMembersResponseSchema = z.object({ members: z.array(OrganizationMemberSchema) });\nconst InviteOrganizationMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: InvitableOrganizationMemberRoleSchema\n});\nconst InviteOrganizationMemberResultStatusSchema = z.enum([\n\t\"sent\",\n\t\"already_member\",\n\t\"pending\",\n\t\"invalid\"\n]);\nconst InviteOrganizationMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteOrganizationMemberResultStatusSchema,\n\tinvitationId: z.string().optional()\n});\nconst InviteOrganizationMembersResponseSchema = z.object({ results: z.array(InviteOrganizationMemberResultSchema) });\nconst UpdateOrganizationMemberRequestSchema = z.object({ role: InvitableOrganizationMemberRoleSchema });\nconst UpdateOrganizationMemberResponseSchema = z.object({ member: OrganizationMemberSchema });\nconst OrganizationInvitationSchema = z.object({\n\tid: z.string(),\n\torganizationName: z.string(),\n\torganizationSlug: OrganizationSlugSchema,\n\tinvitedByName: z.string().optional(),\n\tinvitedByEmail: z.string().email().optional(),\n\trole: OrganizationMemberRoleSchema\n});\nconst ListOrganizationInvitationsResponseSchema = z.object({ invitations: z.array(OrganizationInvitationSchema) });\nconst AcceptOrganizationInvitationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst DeclineOrganizationInvitationResponseSchema = z.object({ success: z.literal(true) });\n/** Web path to auto-accept an invitation after sign-in (used in invite emails). */\nfunction organizationInvitationAcceptPath(invitationId) {\n\treturn `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;\n}\n//#endregion\n//#region src/schemas/api-keys.ts\nconst isoDateTime$3 = z.string().datetime();\nconst ApiKeyCreatorSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email().optional(),\n\tavatarUrl: z.string().optional(),\n\t/** True when the creator user row no longer exists. */\n\tdeleted: z.boolean().optional()\n});\nconst ApiKeySummarySchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tkeyPreview: z.string(),\n\tcreatedAt: isoDateTime$3,\n\tcreatedBy: ApiKeyCreatorSchema,\n\tisCreatedByCurrentUser: z.boolean()\n});\nconst ListApiKeysResponseSchema = z.object({ apiKeys: z.array(ApiKeySummarySchema) });\nconst CreateApiKeyRequestSchema = z.object({ name: z.string().trim().min(1).max(128) });\nconst CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: z.string() });\n//#endregion\n//#region src/schemas/project-members.ts\nconst ProjectUserRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst ProjectInvitePermissionSchema = z.enum([\"admin\", \"all\"]);\nconst ProjectMemberStatusSchema = z.enum([\"active\", \"invited\"]);\nconst isoDateTime$2 = z.string().datetime();\nconst ProjectMemberSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: ProjectUserRoleSchema,\n\tstatus: ProjectMemberStatusSchema,\n\timage: z.string().nullable(),\n\tcreatedAt: isoDateTime$2,\n\tisCurrentUser: z.boolean().optional()\n});\nconst ListProjectMembersResponseSchema = z.object({ members: z.array(ProjectMemberSchema) });\nconst InviteProjectMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: ProjectUserRoleSchema\n});\nconst InviteProjectMemberResultStatusSchema = z.enum([\n\t\"added\",\n\t\"already_member\",\n\t\"not_org_member\",\n\t\"invalid\"\n]);\nconst InviteProjectMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteProjectMemberResultStatusSchema\n});\nconst InviteProjectMembersResponseSchema = z.object({ results: z.array(InviteProjectMemberResultSchema) });\nconst UpdateProjectMemberRequestSchema = z.object({ role: ProjectUserRoleSchema });\nconst UpdateProjectMemberResponseSchema = z.object({ member: ProjectMemberSchema });\nconst ProjectSettingsSchema = z.object({\n\tdescription: z.string(),\n\tdefaultRole: ProjectUserRoleSchema,\n\tinvitePermission: ProjectInvitePermissionSchema\n});\nconst UpdateProjectSettingsRequestSchema = z.object({\n\tdescription: z.string().optional(),\n\tdefaultRole: ProjectUserRoleSchema.optional(),\n\tinvitePermission: ProjectInvitePermissionSchema.optional()\n}).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: \"At least one field is required\" });\nconst ProjectSettingsResponseSchema = z.object({ settings: ProjectSettingsSchema });\n//#endregion\n//#region src/schemas/user-avatar.ts\n/** Custom avatar override; null means fall back to OAuth `users.image`. */\nconst UserAvatarSchema = z.object({ url: z.url().nullable() });\nconst UserAvatarPatchSchema = z.object({ \n/** Storage key returned from presign; null removes the custom override. */\nstorageKey: z.string().min(1).nullable() });\nconst PresignUserAvatarRequestSchema = z.object({ contentType: z.string().trim().min(1) });\nconst PresignUserAvatarResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\n//#endregion\n//#region src/schemas/user-preferences.ts\nconst UserInterfaceThemeSchema = z.enum([\n\t\"system\",\n\t\"light\",\n\t\"dark\"\n]);\nconst UserSurfaceContrastSchema = z.enum([\"off\", \"on\"]);\nconst UserWorkspaceLayoutModeSchema = z.enum([\"default\", \"linear\"]);\nconst UserWorkspaceFontSizeSchema = z.enum([\"default\", \"large\"]);\nconst UserSidebarNavIconVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserSidebarFooterChatRowVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserWorkspaceFavoriteKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\",\n\t\"run\"\n]);\nconst UserWorkspaceFavoriteSchema = z.object({\n\tkind: UserWorkspaceFavoriteKindSchema,\n\tresourceId: z.string().min(1)\n});\nconst UserSidebarPreferencesSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema,\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,\n\thiddenNavItemIds: z.array(z.string()),\n\ttopNavItemOrderIds: z.array(z.string()),\n\tworkspaceNavItemOrderIds: z.array(z.string())\n});\nconst UserPreferencesSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema,\n\tsurfaceContrast: UserSurfaceContrastSchema,\n\tlayoutMode: UserWorkspaceLayoutModeSchema,\n\tfontSize: UserWorkspaceFontSizeSchema,\n\tsidebar: UserSidebarPreferencesSchema,\n\tfavorites: z.array(UserWorkspaceFavoriteSchema),\n\tprojectOrderIds: z.array(z.string()),\n\tprojectDotColors: z.record(z.string(), z.string()),\n\tonboardingTabVisible: z.boolean()\n});\nconst UserSidebarPreferencesPatchSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),\n\thiddenNavItemIds: z.array(z.string()).optional(),\n\ttopNavItemOrderIds: z.array(z.string()).optional(),\n\tworkspaceNavItemOrderIds: z.array(z.string()).optional()\n});\nconst UserPreferencesPatchSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema.optional(),\n\tsurfaceContrast: UserSurfaceContrastSchema.optional(),\n\tlayoutMode: UserWorkspaceLayoutModeSchema.optional(),\n\tfontSize: UserWorkspaceFontSizeSchema.optional(),\n\tsidebar: UserSidebarPreferencesPatchSchema.optional(),\n\tfavorites: z.array(UserWorkspaceFavoriteSchema).optional(),\n\tprojectOrderIds: z.array(z.string()).optional(),\n\tprojectDotColors: z.record(z.string(), z.string()).optional(),\n\tonboardingTabVisible: z.boolean().optional()\n}).refine((value) => value.interfaceTheme !== void 0 || value.surfaceContrast !== void 0 || value.layoutMode !== void 0 || value.fontSize !== void 0 || value.sidebar !== void 0 || value.favorites !== void 0 || value.projectOrderIds !== void 0 || value.projectDotColors !== void 0 || value.onboardingTabVisible !== void 0, { message: \"At least one preference field is required\" });\nconst DEFAULT_USER_SIDEBAR_PREFERENCES = {\n\tnavIconVisibility: \"visible\",\n\tfooterChatRowVisibility: \"visible\",\n\thiddenNavItemIds: [\"registry\"],\n\ttopNavItemOrderIds: [],\n\tworkspaceNavItemOrderIds: []\n};\nconst DEFAULT_USER_PREFERENCES = {\n\tinterfaceTheme: \"system\",\n\tsurfaceContrast: \"on\",\n\tlayoutMode: \"linear\",\n\tfontSize: \"default\",\n\tsidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,\n\tfavorites: [],\n\tprojectOrderIds: [],\n\tprojectDotColors: {},\n\tonboardingTabVisible: true\n};\nfunction normalizeInterfaceTheme(value) {\n\tif (value === \"light\" || value === \"dark\") return value;\n\treturn \"system\";\n}\nfunction normalizeSurfaceContrast(value) {\n\treturn value === \"off\" ? \"off\" : \"on\";\n}\nfunction normalizeLayoutMode(value) {\n\treturn value === \"default\" ? \"default\" : \"linear\";\n}\nfunction normalizeFontSize(value) {\n\treturn value === \"large\" ? \"large\" : \"default\";\n}\nfunction normalizeStringList(value) {\n\tif (!Array.isArray(value)) return [];\n\treturn Array.from(new Set(value.filter((item) => typeof item === \"string\")));\n}\nfunction normalizeHiddenNavItemIds(value) {\n\tif (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;\n\treturn normalizeStringList(value);\n}\nfunction normalizeSidebarPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_SIDEBAR_PREFERENCES;\n\tconst sidebar = value;\n\treturn {\n\t\tnavIconVisibility: sidebar.navIconVisibility === \"visible\" ? \"visible\" : \"hidden\",\n\t\tfooterChatRowVisibility: sidebar.footerChatRowVisibility === \"hidden\" ? \"hidden\" : \"visible\",\n\t\thiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),\n\t\ttopNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),\n\t\tworkspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)\n\t};\n}\nfunction isWorkspaceFavoriteKind(value) {\n\treturn value === \"agent\" || value === \"workflow\" || value === \"skill\" || value === \"run\";\n}\nfunction normalizeFavorites(value) {\n\tif (!Array.isArray(value)) return [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst favorites = [];\n\tfor (const item of value) {\n\t\tif (!item || typeof item !== \"object\") continue;\n\t\tconst favorite = item;\n\t\tif (typeof favorite.kind !== \"string\" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== \"string\" || favorite.resourceId.length === 0) continue;\n\t\tconst key = `${favorite.kind}:${favorite.resourceId}`;\n\t\tif (seenKeys.has(key)) continue;\n\t\tseenKeys.add(key);\n\t\tfavorites.push({\n\t\t\tkind: favorite.kind,\n\t\t\tresourceId: favorite.resourceId\n\t\t});\n\t}\n\treturn favorites;\n}\nfunction normalizeProjectDotColors(value) {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return {};\n\treturn Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === \"string\" && typeof entry[1] === \"string\"));\n}\nfunction normalizeOnboardingTabVisible(value) {\n\treturn typeof value === \"boolean\" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;\n}\nfunction normalizeUserPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_PREFERENCES;\n\tconst preferences = value;\n\treturn UserPreferencesSchema.parse({\n\t\tinterfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),\n\t\tsurfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),\n\t\tlayoutMode: normalizeLayoutMode(preferences.layoutMode),\n\t\tfontSize: normalizeFontSize(preferences.fontSize),\n\t\tsidebar: normalizeSidebarPreferences(preferences.sidebar),\n\t\tfavorites: normalizeFavorites(preferences.favorites),\n\t\tprojectOrderIds: normalizeStringList(preferences.projectOrderIds),\n\t\tprojectDotColors: normalizeProjectDotColors(preferences.projectDotColors),\n\t\tonboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)\n\t});\n}\nfunction mergeUserPreferences(current, patch) {\n\treturn normalizeUserPreferences({\n\t\t...current,\n\t\t...patch,\n\t\tsidebar: patch.sidebar ? {\n\t\t\t...current.sidebar,\n\t\t\t...patch.sidebar\n\t\t} : current.sidebar\n\t});\n}\n//#endregion\n//#region src/schemas/organization-branding.ts\nconst OrganizationLogoVariantSchema = z.enum([\"light\", \"dark\"]);\nconst DEFAULT_LOGO_HEIGHT_PX = 20;\nconst MIN_LOGO_HEIGHT_PX = 14;\nconst MAX_LOGO_HEIGHT_PX = 32;\nconst OrganizationSidebarBrandingSchema = z.object({\n\tcustomLogoEnabled: z.boolean(),\n\tcustomLogoExplicitlyDisabled: z.boolean(),\n\tlogoLightUrl: z.url().nullable(),\n\tlogoDarkUrl: z.url().nullable(),\n\tlogoHeightPx: z.number().int().min(14).max(32)\n});\nconst OrganizationSidebarBrandingPatchSchema = z.object({\n\tcustomLogoEnabled: z.boolean().optional(),\n\tcustomLogoExplicitlyDisabled: z.boolean().optional(),\n\tlogoLightStorageKey: z.string().min(1).nullable().optional(),\n\tlogoDarkStorageKey: z.string().min(1).nullable().optional(),\n\tlogoHeightPx: z.number().int().min(14).max(32).optional()\n}).refine((value) => value.customLogoEnabled !== void 0 || value.customLogoExplicitlyDisabled !== void 0 || value.logoLightStorageKey !== void 0 || value.logoDarkStorageKey !== void 0 || value.logoHeightPx !== void 0, { message: \"At least one branding field is required\" });\nconst PresignOrgLogoRequestSchema = z.object({\n\tvariant: OrganizationLogoVariantSchema,\n\tcontentType: z.string().trim().min(1)\n});\nconst PresignOrgLogoResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\nconst DEFAULT_ORGANIZATION_SIDEBAR_BRANDING = {\n\tcustomLogoEnabled: false,\n\tcustomLogoExplicitlyDisabled: false,\n\tlogoLightUrl: null,\n\tlogoDarkUrl: null,\n\tlogoHeightPx: 20\n};\nfunction normalizeLogoUrl(value) {\n\tif (typeof value !== \"string\") return null;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"http:\" && url.protocol !== \"https:\") return null;\n\t\treturn url.toString();\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction normalizeCustomLogoEnabled(value, branding) {\n\tconst hasCustomLogo = Boolean(normalizeLogoUrl(branding.logoLightUrl) || normalizeLogoUrl(branding.logoDarkUrl));\n\tif (branding.customLogoExplicitlyDisabled === true) return false;\n\tif (typeof value === \"boolean\") return value || hasCustomLogo;\n\treturn hasCustomLogo;\n}\nfunction normalizeLogoHeightPx(value) {\n\tif (typeof value !== \"number\" || !Number.isFinite(value)) return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING.logoHeightPx;\n\treturn Math.min(32, Math.max(14, Math.round(value)));\n}\nfunction normalizeOrganizationSidebarBranding(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\tconst branding = value;\n\treturn OrganizationSidebarBrandingSchema.parse({\n\t\tcustomLogoEnabled: normalizeCustomLogoEnabled(branding.customLogoEnabled, branding),\n\t\tcustomLogoExplicitlyDisabled: branding.customLogoExplicitlyDisabled === true,\n\t\tlogoLightUrl: normalizeLogoUrl(branding.logoLightUrl),\n\t\tlogoDarkUrl: normalizeLogoUrl(branding.logoDarkUrl),\n\t\tlogoHeightPx: normalizeLogoHeightPx(branding.logoHeightPx)\n\t});\n}\nfunction mergeOrganizationSidebarBranding(current, patch) {\n\treturn normalizeOrganizationSidebarBranding({\n\t\t...current,\n\t\t...patch\n\t});\n}\n//#endregion\n//#region src/schemas/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime$1 = z.string().datetime();\nconst ProjectArtifactSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tstorageKey: z.string(),\n\tstatus: ProjectArtifactStatusSchema,\n\tcreatedAt: isoDateTime$1,\n\tupdatedAt: isoDateTime$1\n});\nconst CreateProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tuploadUrl: z.string().url(),\n\texpiresInSeconds: z.number().int().positive()\n});\nconst CompleteProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tproject: ProjectSchema\n});\nconst ProjectDeploymentSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tversion: z.number().int().positive(),\n\tdeployedBy: z.string().nullable(),\n\tdeployedByEmail: z.string().optional(),\n\tdeployedByAvatarUrl: z.string().optional(),\n\tcreatedAt: isoDateTime$1,\n\tactive: z.boolean()\n});\nconst ListProjectDeploymentsResponseSchema = z.object({ deployments: z.array(ProjectDeploymentSchema) });\n//#endregion\n//#region src/schemas/platform-resources.ts\nconst PLATFORM_RESOURCE_UNSUPPORTED_TEXT = \"Not Supported\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP = \"0000\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_COUNT = 0;\nconst optionalCount = z.number().int().nonnegative().nullable().optional();\nconst optionalTimestamp = z.string().nullable().optional();\nconst AgentSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tmodel: z.string().optional(),\n\ttoolCount: optionalCount,\n\tcredentialCount: optionalCount,\n\tlastRunAt: optionalTimestamp\n});\nconst WorkflowSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tlastRunAt: optionalTimestamp\n});\nconst SkillSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional()\n});\nconst AgentSummaryListResponseSchema = z.array(AgentSummarySchema);\nconst AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();\nconst WorkflowSummaryListResponseSchema = z.array(WorkflowSummarySchema);\nconst WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();\nconst SkillSummaryListResponseSchema = z.array(SkillSummarySchema);\nconst SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();\nconst RecentResourceKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\"\n]);\nconst RecentResourceSourceSchema = z.enum([\"owned\", \"shared\"]);\nconst RecentResourceSchema = z.object({\n\tid: z.string().min(1),\n\tresourceKind: RecentResourceKindSchema,\n\tresourceId: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().optional(),\n\tprojectId: z.string().min(1),\n\tprojectName: z.string().min(1),\n\tsourcePath: z.string().min(1).optional(),\n\tsource: RecentResourceSourceSchema,\n\tlastOpenedAt: z.string().min(1),\n\tlastModifiedAt: z.string().min(1)\n});\nconst RecentResourceListResponseSchema = z.array(RecentResourceSchema);\n//#endregion\n//#region src/schemas/project-files.ts\nconst isoDateTime = z.string().datetime();\nconst sha256Hex = z.string().regex(/^[a-f0-9]{64}$/, \"Expected a lowercase hex sha256 digest\");\n/**\n* A single entry in a deploy's file tree, as served to the dashboard. Carries\n* no contents: `id` is a stable, path-derived handle used for selection and\n* `?file=` deep links; `hash` is the content address used to fetch the bytes\n* lazily and to cache them immutably in the browser.\n*/\nconst ProjectFileSummarySchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */\nconst ProjectSourceResourceRefSchema = z.object({\n\tslug: z.string().min(1),\n\tpath: z.string().min(1)\n});\nconst ProjectSourceResourcesSchema = z.object({\n\tagents: z.array(ProjectSourceResourceRefSchema).default([]),\n\tworkflows: z.array(ProjectSourceResourceRefSchema).default([]),\n\tskills: z.array(ProjectSourceResourceRefSchema).default([])\n});\nconst emptyResources = () => ({\n\tagents: [],\n\tworkflows: [],\n\tskills: []\n});\n/** Response for the file-tree listing of a project's active deploy. */\nconst ListProjectFilesResponseSchema = z.object({\n\tartifactId: z.string().nullable(),\n\tfiles: z.array(ProjectFileSummarySchema),\n\tresources: ProjectSourceResourcesSchema.default(emptyResources())\n});\n/**\n* Raw source file as collected by the CLI at deploy time. `hash` is the content\n* address (sha256 of `contents`) used for dedup and immutable storage.\n*/\nconst ProjectSourceFileSchema = z.object({\n\tpath: z.string().min(1),\n\tcontents: z.string(),\n\thash: sha256Hex\n});\n/** A blob the CLI may need to upload, keyed by content hash. */\nconst SourceBlobRefSchema = z.object({\n\thash: sha256Hex,\n\tsize: z.number().int().nonnegative()\n});\n/** Request: ask the platform which blobs are missing and get presigned PUTs. */\nconst PresignProjectSourceRequestSchema = z.object({ blobs: z.array(SourceBlobRefSchema) });\nconst PresignedBlobUploadSchema = z.object({\n\thash: sha256Hex,\n\turl: z.string().url()\n});\n/** Response: presigned PUTs for the subset of blobs not already stored. */\nconst PresignProjectSourceResponseSchema = z.object({ uploads: z.array(PresignedBlobUploadSchema) });\n/** A file reference in a manifest upload: where the path's content lives. */\nconst ManifestFileRefSchema = z.object({\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Request body the CLI sends to finalize a deploy's source manifest. */\nconst UploadProjectSourceManifestRequestSchema = z.object({ files: z.array(ManifestFileRefSchema) });\nconst UploadProjectSourceResponseSchema = z.object({\n\tok: z.literal(true),\n\tfileCount: z.number().int().nonnegative()\n});\n/** A file entry as persisted in the stored manifest (path-derived id added). */\nconst StoredManifestFileSchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** The immutable per-deploy manifest persisted to object storage. */\nconst StoredProjectSourceManifestSchema = z.object({\n\tfiles: z.array(StoredManifestFileSchema),\n\tgeneratedAt: isoDateTime\n});\nconst LANGUAGE_BY_EXTENSION = {\n\tts: \"typescript\",\n\tmts: \"typescript\",\n\tcts: \"typescript\",\n\ttsx: \"tsx\",\n\tjs: \"javascript\",\n\tmjs: \"javascript\",\n\tcjs: \"javascript\",\n\tjsx: \"jsx\",\n\tjson: \"json\",\n\tmd: \"markdown\",\n\tmdx: \"markdown\",\n\tcss: \"css\",\n\thtml: \"html\",\n\tyml: \"yaml\",\n\tyaml: \"yaml\",\n\ttoml: \"toml\",\n\ttxt: \"text\",\n\tsh: \"shell\",\n\tenv: \"shell\"\n};\n/** Best-effort syntax-highlight hint derived from a file path's extension. */\nfunction projectFileLanguage(path) {\n\tconst base = path.split(\"/\").at(-1) ?? path;\n\treturn LANGUAGE_BY_EXTENSION[base.includes(\".\") ? (base.split(\".\").at(-1) ?? \"\").toLowerCase() : \"\"];\n}\n/** Stable, path-derived file id (used by the web for selection + deep links). */\nfunction projectFileId(path) {\n\treturn `file-${path.trim().replace(/^\\.?\\/+/, \"\").replace(/[^a-zA-Z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\").toLowerCase()}`;\n}\n//#endregion\n//#region src/mappers/organizations.ts\nfunction mapOrganization(row) {\n\treturn OrganizationSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapProject(row) {\n\treturn ProjectSchema.parse({\n\t\tid: row.id,\n\t\torganizationId: row.organizationId,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tdescription: row.description,\n\t\tstatus: row.status,\n\t\tbaseUrl: row.baseUrl,\n\t\truntimeId: row.runtimeId,\n\t\tlastError: row.lastError,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapUserOrganization(row) {\n\treturn UserOrganizationSchema.parse({\n\t\torganization: mapOrganization(row.organization),\n\t\trole: row.role\n\t});\n}\n//#endregion\n//#region src/mappers/members.ts\nfunction mapOrganizationMember(row) {\n\treturn OrganizationMemberSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\t...row.image ? { avatarUrl: row.image } : {},\n\t\tjoinedAt: row.createdAt.toISOString(),\n\t\tlastActiveAt: null\n\t});\n}\nfunction mapOrganizationInvitation(row) {\n\treturn OrganizationInvitationSchema.parse({\n\t\tid: row.id,\n\t\torganizationName: row.organizationName,\n\t\torganizationSlug: row.organizationSlug,\n\t\trole: row.role,\n\t\t...row.invitedByName ? { invitedByName: row.invitedByName } : {},\n\t\t...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}\n\t});\n}\n//#endregion\n//#region src/mappers/project-members.ts\nfunction mapProjectMember(row, options) {\n\treturn ProjectMemberSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\timage: row.image,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tisCurrentUser: options?.isCurrentUser\n\t});\n}\nfunction mapProjectSettings(row) {\n\treturn {\n\t\tdescription: row.description ?? \"\",\n\t\tdefaultRole: row.defaultMemberRole,\n\t\tinvitePermission: row.invitePermission\n\t};\n}\n//#endregion\n//#region src/mappers/project-artifacts.ts\nfunction mapProjectArtifact(row) {\n\treturn ProjectArtifactSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tstorageKey: row.storageKey,\n\t\tstatus: row.status,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\n//#endregion\n//#region src/mappers/project-deployments.ts\nfunction mapProjectDeployment(row) {\n\treturn ProjectDeploymentSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tversion: row.version,\n\t\tdeployedBy: row.deployedByName,\n\t\t...row.deployedByEmail ? { deployedByEmail: row.deployedByEmail } : {},\n\t\t...row.deployedByAvatarUrl ? { deployedByAvatarUrl: row.deployedByAvatarUrl } : {},\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tactive: row.active\n\t});\n}\n//#endregion\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, AgentSummaryDetailResponseSchema, AgentSummaryListResponseSchema, AgentSummarySchema, ApiKeyCreatorSchema, ApiKeySummarySchema, AppAuthKindSchema, AppCatalogEntrySchema, AppCredentialConnectionKindSchema, AppCredentialScopeSchema, AppCredentialSummarySchema, AppGatewaySchema, BindChannelBodySchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ChannelAccountListResponseSchema, ChannelAccountMetadataSchema, ChannelAccountSchema, ChannelBindingKindSchema, ChannelBindingSchema, ChannelCapabilitiesSchema, ChannelCardSupportSchema, ChannelConnectionListResponseSchema, ChannelConnectionSchema, ChannelDirectoryEntrySchema, ChannelDirectoryListResponseSchema, ChannelListenModeSchema, ChannelPlatformKeySchema, ChannelPlatformSchema, ChannelReactionSupportSchema, ChannelStreamingSupportSchema, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, CreateCredentialInstanceBodySchema, CreateCredentialsRequestSchema, CreateCredentialsResponseSchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CredentialTargetsFieldsSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DEFAULT_LOGO_HEIGHT_PX, DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, DEFAULT_USER_PREFERENCES, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, GetCredentialResponseSchema, HealthResponseSchema, HistoryAgentSessionDetailSchema, HistoryRunCancelResponseSchema, HistoryRunDetailResponseSchema, HistoryRunDetailSchema, HistoryRunKindSchema, HistoryRunListQuerySchema, HistoryRunListResponseSchema, HistoryRunSchema, HistoryRunStatusSchema, HistoryTraceSchema, HistoryWorkflowRunDetailSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, InviteProjectMembersRequestSchema, InviteProjectMembersResponseSchema, ListApiKeysResponseSchema, ListAppsResponseSchema, ListCredentialsResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectDeploymentsResponseSchema, ListProjectFilesResponseSchema, ListProjectMembersResponseSchema, ListProjectMetricsResponseSchema, ListProjectsResponseSchema, MAX_LOGO_HEIGHT_PX, MIN_LOGO_HEIGHT_PX, ManifestFileRefSchema, NewChannelBindingInputSchema, OAuthPermissionModeSchema, OAuthScopeOptionSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationLogoVariantSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSidebarBrandingPatchSchema, OrganizationSidebarBrandingSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PLATFORM_RESOURCE_UNSUPPORTED_COUNT, PLATFORM_RESOURCE_UNSUPPORTED_TEXT, PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PROJECT_SLUG_TAKEN_MESSAGE, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, PresignOrgLogoRequestSchema, PresignOrgLogoResponseSchema, PresignProjectSourceRequestSchema, PresignProjectSourceResponseSchema, PresignUserAvatarRequestSchema, PresignUserAvatarResponseSchema, PresignedBlobUploadSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectDeploymentSchema, ProjectFileSummarySchema, ProjectInvitePermissionSchema, ProjectListMetricsSchema, ProjectMemberSchema, ProjectMemberStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectSettingsResponseSchema, ProjectSettingsSchema, ProjectSlugAvailabilityQuerySchema, ProjectSlugAvailabilityReasonSchema, ProjectSlugAvailabilityResponseSchema, ProjectSlugSchema, ProjectSourceFileSchema, ProjectSourceResourceRefSchema, ProjectSourceResourcesSchema, ProjectStatusSchema, ProjectUserRoleSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RecentResourceKindSchema, RecentResourceListResponseSchema, RecentResourceSchema, RecentResourceSourceSchema, RunSourceKindSchema, RunSourceSchema, SkillSummaryDetailResponseSchema, SkillSummaryListResponseSchema, SkillSummarySchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, SourceBlobRefSchema, StartOAuthConnectionInputSchema, StartOAuthConnectionResultSchema, StoredManifestFileSchema, StoredProjectSourceManifestSchema, StoredRouteManifestSchema, StoredRouteManifestSkillSchema, SubmitTeamRequestRequestSchema, SubmitTeamRequestResponseSchema, TeamRequestTypeSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateChannelBindingBodySchema, UpdateCredentialInstanceBodySchema, UpdateCredentialRequestSchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpdateProjectMemberRequestSchema, UpdateProjectMemberResponseSchema, UpdateProjectRequestSchema, UpdateProjectSettingsRequestSchema, UploadProjectSourceManifestRequestSchema, UploadProjectSourceResponseSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserAvatarPatchSchema, UserAvatarSchema, UserInterfaceThemeSchema, UserOrganizationSchema, UserPreferencesPatchSchema, UserPreferencesSchema, UserSidebarFooterChatRowVisibilitySchema, UserSidebarNavIconVisibilitySchema, UserSidebarPreferencesPatchSchema, UserSidebarPreferencesSchema, UserSurfaceContrastSchema, UserWorkspaceFavoriteKindSchema, UserWorkspaceFavoriteSchema, UserWorkspaceFontSizeSchema, UserWorkspaceLayoutModeSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, WorkflowSummaryDetailResponseSchema, WorkflowSummaryListResponseSchema, WorkflowSummarySchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapProjectDeployment, mapProjectMember, mapProjectSettings, mapUserOrganization, mergeOrganizationSidebarBranding, mergeUserPreferences, normalizeCredentialList, normalizeLogoUrl, normalizeOrganizationSidebarBranding, normalizeUserPreferences, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parseProjectSlug, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, projectFileId, projectFileLanguage, slugifyOrganizationName, slugifyProjectName, toCredentialRequirement, toolParameters, validateClaimableOrganizationSlug, validateProjectSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAKA,SAAgB,OAAO,QAAQ;CAC3B,OAAOA,eAAoBC,WAAmB,MAAM;AACxD;;;ACiBA,MAAM,oBAAoB;;AAI1B,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,gBAAgB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,0BAA0B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAKA,MAAM,8BAA8B,IAAI,IAAI;CAC3C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ,CAAC;;;;;;;;;AASD,MAAM,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AC,CAAC;AAC3D,CAAC;AACD,MAAM,wBAAwB;CAC7B,QAAQ,CAAC;CACT,WAAW,CAAC;CACZ,QAAQ,CAAC;AACV;;AAEA,MAAM,iCAAiCP,OAAS;CAC/C,YAAYD,OAAS,EAAE,SAAS;CAChC,OAAOQ,MAAQ,wBAAwB;CACvC,WAAW,6BAA6B,QAAQ,eAAe,CAAC;AACjE,CAAC;AAK+BP,OAAS;CACxC,MAAMD,OAAS,EAAE,IAAI,CAAC;CACtB,UAAUA,OAAS;CACnB,MAAM;AACP,CAAC;;AAOD,MAAM,oCAAoCC,OAAS,EAAE,OAAOO,MALhCP,OAAS;CACpC,MAAM;CACN,MAAMG,SAAS,EAAE,IAAI,EAAE,YAAY;AACpC,CAEoE,CAAmB,EAAE,CAAC;;AAM1F,MAAM,qCAAqCH,OAAS,EAAE,SAASO,MAL7BP,OAAS;CAC1C,MAAM;CACN,KAAKD,OAAS,EAAE,IAAI;AACrB,CAEuE,CAAyB,EAAE,CAAC;;AAOnG,MAAM,2CAA2CC,OAAS,EAAE,OAAOO,MALrCP,OAAS;CACtC,MAAMD,OAAS,EAAE,IAAI,CAAC;CACtB,MAAM;AACP,CAE2E,CAAqB,EAAE,CAAC;AACnG,MAAM,oCAAoCC,OAAS;CAClD,IAAIE,QAAU,IAAI;CAClB,WAAWC,SAAS,EAAE,IAAI,EAAE,YAAY;AACzC,CAAC;AAQyCH,OAAS;CAClD,OAAOO,MAPyBP,OAAS;EACzC,IAAID,OAAS;EACb,MAAMA,OAAS,EAAE,IAAI,CAAC;EACtB,MAAM;CACP,CAGgB,CAAwB;CACvC,aAAa;AACd,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { _ as string, c as _function, d as custom, f as discriminatedUnion, h as object, i as walkTypeScriptFiles, l as array, n as discoverModuleFileEntries, o as ZodType, p as literal, r as entryIdFromFile, v as union, x as toJSONSchema } from "./discovery-DV7FkTRA-BFmtZG9u.mjs";
|
|
3
|
-
import { Zt as normalizeCredentialList, _t as ROUTE_MANIFEST_REL_PATH, mt as PromptResponseSchema, pt as PromptInputSchema } from "./dist-
|
|
3
|
+
import { Zt as normalizeCredentialList, _t as ROUTE_MANIFEST_REL_PATH, mt as PromptResponseSchema, pt as PromptInputSchema } from "./dist-C12M6Kul.mjs";
|
|
4
4
|
import { dirname, join, relative, sep } from "node:path";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
@@ -673,4 +673,4 @@ async function emitStoredRouteManifestForProject(projectRoot) {
|
|
|
673
673
|
//#endregion
|
|
674
674
|
export { emitStoredRouteManifestForProject };
|
|
675
675
|
|
|
676
|
-
//# sourceMappingURL=dist-
|
|
676
|
+
//# sourceMappingURL=dist-QTvT7Ltb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-D4vZsmLQ.mjs","names":["z.toJSONSchema","z.custom","z.ZodType","z.string","z.union","z.function","z.object","z.literal","z.array","z.discriminatedUnion"],"sources":["../../../packages/manifest/dist/index.mjs"],"sourcesContent":["import { a as walkTypeScriptFiles, i as discoverEntries, n as discoverModuleFileEntries, o as entryIdFromFile, r as moduleFileKeyFromPath, t as validateUniqueModuleKeys } from \"./discovery-DV7FkTRA.mjs\";\nimport { pathToFileURL } from \"node:url\";\nimport { dirname, join, relative, sep } from \"node:path\";\nimport { PromptInputSchema, PromptResponseSchema, ROUTE_MANIFEST_REL_PATH, normalizeCredentialList, parseStoredRouteManifest } from \"@keystrokehq/shared\";\nimport { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { z } from \"zod\";\n//#region src/guards/agent.ts\nfunction isManifestAgent(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst agent = value;\n\treturn typeof agent.slug === \"string\" && agent.slug.trim().length > 0 && typeof agent.buildRuntime === \"function\" && typeof agent.model === \"string\" && typeof agent.systemPrompt === \"string\";\n}\nfunction validateManifestAgent(value, filePath) {\n\tif (!isManifestAgent(value)) throw new Error(`${filePath} must default-export defineAgent(...)`);\n\treturn value;\n}\n//#endregion\n//#region src/routes.ts\nfunction normalizeWebhookEndpoint(endpoint) {\n\treturn endpoint.replace(/^\\/+|\\/+$/g, \"\").replace(/^triggers\\/?/, \"\");\n}\nfunction agentRouteFromKey(key) {\n\treturn `/agents/${key}`;\n}\nfunction agentSessionsListPath(route) {\n\treturn `${route}/sessions`;\n}\nfunction agentSessionDetailPath(route) {\n\treturn `${route}/sessions/:sessionId`;\n}\nfunction workflowRouteFromKey(key) {\n\treturn `/workflows/${key}`;\n}\nfunction workflowRunsListPath(route) {\n\treturn `${route}/runs`;\n}\nfunction workflowRunDetailPath(route) {\n\treturn `${route}/runs/:runId`;\n}\nfunction triggerRunsListPath(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/runs`;\n}\nfunction triggerRunDetailPath(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/runs/:runId`;\n}\nfunction pollRouteFromKey(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/poll`;\n}\nfunction pollGroupRouteFromId(pollId) {\n\treturn `/triggers/polls/${pollId}/run`;\n}\nfunction webhookRouteFromEndpoint(endpoint) {\n\tconst normalized = normalizeWebhookEndpoint(endpoint);\n\tif (!normalized) throw new Error(\"Webhook endpoint must not be empty\");\n\treturn `/triggers/${normalized}`;\n}\n//#endregion\n//#region src/agents/discover.ts\nasync function discoverAgentEntries(agentsDir) {\n\tconst files = await discoverModuleFileEntries(agentsDir, {\n\t\tnestedEntry: \"agent\",\n\t\tduplicateLabel: \"agent module file\"\n\t});\n\tconst entries = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst agent = await importAgentDefinition(filePath);\n\t\tentries.push({\n\t\t\tkey: agent.slug,\n\t\t\troute: agentRouteFromKey(agent.slug),\n\t\t\tfilePath,\n\t\t\tmoduleFile\n\t\t});\n\t}\n\treturn entries;\n}\nasync function importAgentDefinition(filePath) {\n\treturn validateManifestAgent((await import(pathToFileURL(filePath).href)).default, filePath);\n}\n//#endregion\n//#region src/guards/action.ts\nconst ACTION = Symbol.for(\"keystroke.action\");\nfunction isManifestAction(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn ACTION in value && value[ACTION] === true;\n}\nfunction getManifestActionCredentialRequirements(action) {\n\treturn Array.isArray(action.credentials) ? action.credentials : void 0;\n}\n//#endregion\n//#region src/agents/count-agent-credentials.ts\nfunction countAgentCredentials(agent) {\n\tconst keys = /* @__PURE__ */ new Set();\n\tfor (const tool of agent.tools ?? []) {\n\t\tconst record = tool;\n\t\tconst requirements = isManifestAction(tool) ? getManifestActionCredentialRequirements(tool) : \"credentials\" in record && Array.isArray(record.credentials) ? record.credentials : void 0;\n\t\tif (!requirements?.length) continue;\n\t\tfor (const requirement of normalizeCredentialList(requirements)) keys.add(requirement.key);\n\t}\n\treturn keys.size;\n}\n//#endregion\n//#region src/skills/discover-manifest-entries.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\nfunction toPosix$1(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction parseSkillFrontmatter(raw) {\n\tconst match = raw.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n\tif (!match) return {};\n\tconst out = {};\n\tfor (const line of match[1]?.split(\"\\n\") ?? []) {\n\t\tconst trimmed = line.trim();\n\t\tif (!trimmed || trimmed.startsWith(\"#\")) continue;\n\t\tconst colon = trimmed.indexOf(\":\");\n\t\tif (colon < 0) continue;\n\t\tconst key = trimmed.slice(0, colon).trim();\n\t\tlet value = trimmed.slice(colon + 1).trim();\n\t\tif (value.startsWith(\"\\\"\") && value.endsWith(\"\\\"\") || value.startsWith(\"'\") && value.endsWith(\"'\")) value = value.slice(1, -1);\n\t\tif (key === \"name\") out.name = value;\n\t\telse if (key === \"description\") out.description = value;\n\t}\n\treturn out;\n}\nfunction walkSkillFiles(root, dir, out) {\n\tfor (const name of readdirSync(dir).sort()) {\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (SKIP_DIRS.has(name)) continue;\n\t\t\twalkSkillFiles(root, absolute, out);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stats.isFile() || name !== \"SKILL.md\") continue;\n\t\tconst moduleFile = toPosix$1(relative(root, absolute));\n\t\tconst slug = toPosix$1(relative(join(root, \"src\", \"skills\"), absolute)).replace(/\\/?SKILL\\.md$/, \"\");\n\t\tif (!slug) continue;\n\t\tconst frontmatter = parseSkillFrontmatter(readFileSync(absolute, \"utf8\"));\n\t\tout.push({\n\t\t\tslug,\n\t\t\tname: frontmatter.name,\n\t\t\tdescription: frontmatter.description,\n\t\t\tmoduleFile\n\t\t});\n\t}\n}\n/** Discover skill metadata from src/skills SKILL.md files for the route manifest. */\nfunction discoverSkillManifestEntries(projectRoot) {\n\tconst skillsDir = join(projectRoot, \"src\", \"skills\");\n\tif (!statSync(skillsDir, { throwIfNoEntry: false })?.isDirectory()) return [];\n\tconst entries = [];\n\twalkSkillFiles(projectRoot, skillsDir, entries);\n\treturn entries;\n}\n//#endregion\n//#region src/openapi/schema-to-json.ts\nfunction schemaToJson(schema) {\n\treturn z.toJSONSchema(schema, { target: \"openapi-3.0\" });\n}\n//#endregion\n//#region src/openapi/serialize-manifest.ts\nfunction collectIntegrationKeys(integrations) {\n\treturn integrations.map((integration) => integration.key);\n}\nfunction serializeRouteManifest(manifest) {\n\treturn manifest.map((entry) => {\n\t\tswitch (entry.kind) {\n\t\t\tcase \"health\": return entry;\n\t\t\tcase \"agent\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tagentSlug: entry.agentSlug,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tname: entry.name,\n\t\t\t\tdescription: entry.description,\n\t\t\t\tmodel: entry.model,\n\t\t\t\tsystemPrompt: entry.systemPrompt,\n\t\t\t\ttoolCount: entry.toolCount,\n\t\t\t\tcredentialCount: entry.credentialCount,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"workflow\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tworkflowSlug: entry.workflowSlug,\n\t\t\t\tworkflowName: entry.workflowName,\n\t\t\t\tdescription: entry.description,\n\t\t\t\tsubscribable: entry.subscribable,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-webhook\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tattachmentIds: entry.attachmentIds,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tattachmentSchemas: Object.fromEntries(Object.entries(entry.attachmentSchemas).map(([attachmentKey, schemas]) => [attachmentKey, {\n\t\t\t\t\trequestSchema: schemaToJson(schemas.request),\n\t\t\t\t\t...schemas.filter ? { filterSchema: schemaToJson(schemas.filter) } : {}\n\t\t\t\t}])),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-poll\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tattachmentId: entry.attachmentId,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tschedule: entry.schedule,\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-poll-group\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tpollId: entry.pollId,\n\t\t\t\tattachmentIds: entry.attachmentIds,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tschedule: entry.schedule,\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"plugin\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tplugin: entry.plugin\n\t\t\t};\n\t\t\tdefault: return entry;\n\t\t}\n\t});\n}\nfunction toStoredRouteManifest(manifest, options) {\n\treturn {\n\t\tversion: 1,\n\t\tentries: serializeRouteManifest(manifest),\n\t\tskills: options?.skills ?? [],\n\t\tintegrations: options?.integrations\n\t};\n}\nfunction buildStoredRouteManifestFromContext(ctx) {\n\tconst integrations = ctx.options?.integrations ?? ctx.options?.plugins?.map((plugin) => ({\n\t\tkey: plugin.name,\n\t\tmount: plugin.register\n\t})) ?? [];\n\treturn toStoredRouteManifest(ctx.manifest, {\n\t\tintegrations: collectIntegrationKeys(integrations),\n\t\tskills: ctx.skills ?? (ctx.projectRoot ? discoverSkillManifestEntries(ctx.projectRoot) : void 0) ?? []\n\t});\n}\nfunction findWorkflowManifestEntry(manifest, workflowSlug) {\n\treturn manifest.entries.find((entry) => entry.kind === \"workflow\" && entry.workflowSlug === workflowSlug);\n}\nfunction findWebhookManifestEntryByPath(manifest, route) {\n\treturn manifest.entries.find((entry) => entry.kind === \"trigger-webhook\" && entry.path === route);\n}\n//#endregion\n//#region src/persist.ts\nfunction persistStoredRouteManifest(projectRoot, manifest) {\n\tconst path = join(projectRoot, ROUTE_MANIFEST_REL_PATH);\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, `${JSON.stringify(manifest, null, 2)}\\n`);\n}\n//#endregion\n//#region src/guards/workflow.ts\nconst WORKFLOW = Symbol.for(\"keystroke.workflow\");\nfunction isManifestWorkflow(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;\n\tconst workflow = value;\n\treturn typeof workflow.slug === \"string\" && workflow.slug.trim().length > 0 && workflow.input instanceof Object && \"safeParse\" in workflow.input && workflow.output instanceof Object && \"safeParse\" in workflow.output;\n}\nfunction validateManifestWorkflow(value, filePath) {\n\tif (!isManifestWorkflow(value)) throw new Error(`${filePath} must default-export defineWorkflow(...)`);\n\treturn value;\n}\n//#endregion\n//#region src/guards/trigger.ts\nconst TRIGGER_ATTACHMENT = Symbol.for(\"keystroke.triggerAttachment\");\nconst zodSchema = z.custom((value) => value instanceof z.ZodType, \"must be a Zod schema\");\nconst cronScheduleSchema = z.string().trim().min(1, \"cron schedule must be a non-empty string\");\nconst workflowSchema = z.custom((value) => isManifestWorkflow(value), \"must be defineWorkflow(...)\");\nconst agentSchema = z.custom((value) => typeof value === \"object\" && value !== null && typeof value.slug === \"string\" && value.slug.trim().length > 0 && typeof value.prompt === \"function\", \"must be defineAgent(...)\");\nconst promptSchema = z.union([z.string(), z.function()]);\nconst baseSourceShape = {\n\tkey: z.string().trim().min(1),\n\tattach: z.function()\n};\nconst webhookSourceSchema = z.object({\n\tkind: z.literal(\"webhook\"),\n\t...baseSourceShape,\n\tendpoint: z.string().min(1),\n\trequest: zodSchema,\n\tfilter: zodSchema.optional(),\n\tpasses: z.function()\n});\nconst cronSourceSchema = z.object({\n\tkind: z.literal(\"cron\"),\n\t...baseSourceShape,\n\tschedule: cronScheduleSchema\n});\nconst pollSourceSchema = z.object({\n\tkind: z.literal(\"poll\"),\n\t...baseSourceShape,\n\tid: z.string().optional(),\n\tschedule: cronScheduleSchema,\n\trun: z.function(),\n\tfilters: z.array(z.function()),\n\tpasses: z.function()\n});\nconst triggerSourceSchema = z.discriminatedUnion(\"kind\", [\n\twebhookSourceSchema,\n\tcronSourceSchema,\n\tpollSourceSchema\n]);\nconst workflowAttachmentSchema = z.object({\n\tkey: z.string().trim().min(1),\n\tsource: triggerSourceSchema,\n\ttarget: z.literal(\"workflow\"),\n\tworkflow: workflowSchema,\n\ttransform: z.function().optional()\n});\nconst agentAttachmentSchema = z.object({\n\tkey: z.string().trim().min(1),\n\tsource: triggerSourceSchema,\n\ttarget: z.literal(\"agent\"),\n\tagent: agentSchema,\n\tprompt: promptSchema\n});\nconst triggerAttachmentCoreSchema = z.discriminatedUnion(\"target\", [workflowAttachmentSchema, agentAttachmentSchema]);\nfunction isManifestTriggerAttachment(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(TRIGGER_ATTACHMENT in value) || value[TRIGGER_ATTACHMENT] !== true) return false;\n\treturn triggerAttachmentCoreSchema.safeParse(value).success;\n}\nfunction validateManifestTriggerAttachment(value, filePath) {\n\tif (!isManifestTriggerAttachment(value)) throw new Error(`${filePath} must default-export a trigger attachment from .attach({ workflow }) or .attach({ agent, prompt })`);\n\treturn value;\n}\n//#endregion\n//#region src/triggers/discover.ts\nfunction shouldDiscoverTriggerFile(triggersDir, filePath) {\n\treturn !relative(triggersDir, filePath).split(sep).includes(\"sources\");\n}\nasync function discoverTriggerAttachments(triggersDir) {\n\tconst files = await discoverModuleFileEntries(triggersDir, {\n\t\tnestedEntry: \"trigger\",\n\t\tduplicateLabel: \"trigger module file\",\n\t\tshouldDiscoverFile: (filePath) => shouldDiscoverTriggerFile(triggersDir, filePath)\n\t});\n\tconst attachments = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst attachment = await importTriggerAttachment(filePath);\n\t\tattachments.push({\n\t\t\tkey: attachment.key,\n\t\t\tfilePath,\n\t\t\tmoduleFile,\n\t\t\tattachment\n\t\t});\n\t}\n\treturn attachments;\n}\nfunction validateImportedTriggerAttachment(def, filePath) {\n\treturn validateManifestTriggerAttachment(def, filePath);\n}\nasync function importTriggerAttachment(filePath) {\n\treturn validateImportedTriggerAttachment((await import(pathToFileURL(filePath).href)).default, filePath);\n}\n//#endregion\n//#region src/triggers/poll/groups.ts\nfunction pollGroupId(discovered) {\n\tconst source = discovered.attachment.source;\n\tif (source.kind !== \"poll\") throw new Error(`Attachment \"${discovered.key}\" is not a poll trigger`);\n\treturn source.id ?? source.key;\n}\nfunction buildPollGroups(attachments) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const discovered of attachments) {\n\t\tif (discovered.attachment.source.kind !== \"poll\") continue;\n\t\tconst id = pollGroupId(discovered);\n\t\tconst group = byId.get(id) ?? [];\n\t\tgroup.push(discovered);\n\t\tbyId.set(id, group);\n\t}\n\treturn [...byId.entries()].map(([id, groupAttachments]) => ({\n\t\tid,\n\t\tattachments: groupAttachments\n\t}));\n}\nfunction validatePollGroups(groups) {\n\tfor (const group of groups) {\n\t\tif (group.attachments.length <= 1) continue;\n\t\tif (new Set(group.attachments.map((discovered) => {\n\t\t\tconst source = discovered.attachment.source;\n\t\t\tif (source.kind !== \"poll\") throw new Error(`Poll group \"${group.id}\" has non-poll attachment ${discovered.key}`);\n\t\t\treturn source.schedule;\n\t\t})).size > 1) {\n\t\t\tconst keys = group.attachments.map((discovered) => discovered.key).join(\", \");\n\t\t\tthrow new Error(`Poll group \"${group.id}\" has attachments with different schedules (${keys})`);\n\t\t}\n\t}\n}\nfunction matchesPollRunTarget(attachmentKey, workflowKey, target) {\n\tif (!target?.workflows?.length && !target?.attachments?.length) return true;\n\tif (target.attachments?.length && !target.attachments.includes(attachmentKey)) return false;\n\tif (target.workflows?.length && !target.workflows.includes(workflowKey)) return false;\n\treturn true;\n}\n//#endregion\n//#region src/triggers/webhook/build-webhook-bindings.ts\nfunction buildWebhookBindingsByRoute(attachments, handlerOptionsFor) {\n\tconst webhookBindingsByRoute = /* @__PURE__ */ new Map();\n\tfor (const discovered of attachments) {\n\t\tconst source = discovered.attachment.source;\n\t\tif (source.kind !== \"webhook\") continue;\n\t\tconst route = webhookRouteFromEndpoint(source.endpoint);\n\t\tconst bindings = webhookBindingsByRoute.get(route) ?? [];\n\t\tbindings.push({\n\t\t\tdiscovered,\n\t\t\toptions: handlerOptionsFor(discovered.key)\n\t\t});\n\t\twebhookBindingsByRoute.set(route, bindings);\n\t}\n\treturn webhookBindingsByRoute;\n}\n//#endregion\n//#region src/triggers/webhook/webhook-schemas.ts\nfunction webhookSchemaEntriesFromBindings(bindings) {\n\treturn bindings.flatMap((binding) => {\n\t\tconst source = binding.discovered.attachment.source;\n\t\tif (source.kind !== \"webhook\") return [];\n\t\treturn [{\n\t\t\tattachmentKey: binding.discovered.key,\n\t\t\trequest: source.request,\n\t\t\t...source.filter ? { filter: source.filter } : {}\n\t\t}];\n\t});\n}\nfunction webhookAttachmentSchemasFromBindings(bindings) {\n\treturn webhookSchemaEntriesFromBindings(bindings).map((entry) => ({\n\t\tattachmentKey: entry.attachmentKey,\n\t\trequestSchema: schemaToJson(entry.request),\n\t\t...entry.filter ? { filterSchema: schemaToJson(entry.filter) } : {}\n\t}));\n}\nfunction webhookMatchSchemaForBindings(bindings) {\n\tconst schemas = bindings.flatMap((binding) => {\n\t\tconst source = binding.discovered.attachment.source;\n\t\treturn source.kind === \"webhook\" ? [source.request] : [];\n\t});\n\tif (schemas.length === 0) throw new Error(\"Webhook bindings require at least one webhook source\");\n\tif (schemas.length === 1) return schemas[0];\n\treturn z.union(schemas);\n}\nfunction webhookManifestAttachmentSchemasFromBindings(bindings) {\n\treturn Object.fromEntries(webhookSchemaEntriesFromBindings(bindings).map((entry) => [entry.attachmentKey, {\n\t\trequest: entry.request,\n\t\t...entry.filter ? { filter: entry.filter } : {}\n\t}]));\n}\n//#endregion\n//#region src/workflows/discover.ts\nasync function discoverWorkflowEntries(workflowsDir) {\n\tconst files = await discoverModuleFileEntries(workflowsDir, {\n\t\tnestedEntry: \"workflow\",\n\t\tduplicateLabel: \"workflow module file\"\n\t});\n\tconst entries = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst definition = await importWorkflowDefinition(filePath);\n\t\tentries.push({\n\t\t\tkey: definition.slug,\n\t\t\troute: workflowRouteFromKey(definition.slug),\n\t\t\tfilePath,\n\t\t\tmoduleFile\n\t\t});\n\t}\n\treturn entries;\n}\nfunction validateImportedWorkflowDefinition(def, filePath) {\n\treturn validateManifestWorkflow(def, filePath);\n}\nasync function importWorkflowDefinition(filePath) {\n\treturn validateImportedWorkflowDefinition((await import(pathToFileURL(filePath).href)).default, filePath);\n}\nasync function discoverWorkflows(workflowsDir) {\n\tconst entries = await discoverWorkflowEntries(workflowsDir);\n\tconst workflows = [];\n\tfor (const entry of entries) {\n\t\tconst definition = await importWorkflowDefinition(entry.filePath);\n\t\tworkflows.push({\n\t\t\tkey: definition.slug,\n\t\t\troute: workflowRouteFromKey(definition.slug),\n\t\t\tfilePath: entry.filePath,\n\t\t\tdefinition\n\t\t});\n\t}\n\treturn workflows;\n}\n//#endregion\n//#region src/build-stored-manifest.ts\nfunction resolveDistModuleDirs(projectRoot) {\n\tconst distBase = join(projectRoot, \"dist\");\n\tif (!existsSync(distBase)) throw new Error(`Build output missing at ${distBase}. Run keystroke build before emitting the route manifest.`);\n\treturn {\n\t\tagentsDir: join(distBase, \"agents\"),\n\t\tworkflowsDir: join(distBase, \"workflows\"),\n\t\ttriggersDir: join(distBase, \"triggers\")\n\t};\n}\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\n/**\n* Resolve manifest moduleFile values to project-root-relative source paths.\n*\n* Discovery runs over compiled `dist/` modules, so the raw moduleFile is a\n* dist-relative `.mjs` path. Dist entries are named by their source entry id\n* (`team/escalation.mjs` ← `src/agents/team/escalation/agent.ts`), so walking\n* the matching source dir by the same id rules recovers the source path. Falls\n* back to the dist-relative value when no source file matches (e.g. building\n* a dist-only artifact with no `src/`).\n*/\nvar SourceModuleFileResolver = class {\n\tprojectRoot;\n\tmapsByKind = /* @__PURE__ */ new Map();\n\tconstructor(projectRoot) {\n\t\tthis.projectRoot = projectRoot;\n\t}\n\tasync sourceMapFor(kindDir, nestedEntry) {\n\t\tconst existing = this.mapsByKind.get(kindDir);\n\t\tif (existing) return existing;\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tconst sourceDir = join(this.projectRoot, \"src\", kindDir);\n\t\tfor (const filePath of await walkTypeScriptFiles(sourceDir)) {\n\t\t\tconst id = entryIdFromFile(sourceDir, filePath, { nestedEntry });\n\t\t\tif (id) map.set(id, toPosix(relative(this.projectRoot, filePath)));\n\t\t}\n\t\tthis.mapsByKind.set(kindDir, map);\n\t\treturn map;\n\t}\n\tasync resolve(kindDir, nestedEntry, distDir, distFilePath) {\n\t\tconst fallback = toPosix(relative(distDir, distFilePath));\n\t\tconst id = entryIdFromFile(distDir, distFilePath, { nestedEntry });\n\t\tif (!id) return fallback;\n\t\treturn (await this.sourceMapFor(kindDir, nestedEntry)).get(id) ?? fallback;\n\t}\n};\n/** Build a stored route manifest from compiled dist/ modules without starting a server. */\nasync function buildStoredRouteManifestForProject(projectRoot) {\n\tconst previousRoot = process.env.KEYSTROKE_ROOT;\n\tprocess.env.KEYSTROKE_ROOT = projectRoot;\n\ttry {\n\t\tconst dirs = resolveDistModuleDirs(projectRoot);\n\t\tconst sourcePaths = new SourceModuleFileResolver(projectRoot);\n\t\tconst manifest = [{\n\t\t\tkind: \"health\",\n\t\t\tmethod: \"GET\",\n\t\t\tpath: \"/health\"\n\t\t}];\n\t\tconst agentEntries = await discoverAgentEntries(dirs.agentsDir);\n\t\tfor (const entry of agentEntries) {\n\t\t\tconst agent = await importAgentDefinition(entry.filePath);\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"agents\", \"agent\", dirs.agentsDir, entry.filePath);\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: entry.route,\n\t\t\t\tagentSlug: agent.slug,\n\t\t\t\tmoduleFile,\n\t\t\t\tname: agent.name,\n\t\t\t\tdescription: agent.description,\n\t\t\t\tmodel: agent.model,\n\t\t\t\tsystemPrompt: agent.systemPrompt,\n\t\t\t\ttoolCount: agent.tools?.length ?? 0,\n\t\t\t\tcredentialCount: countAgentCredentials(agent),\n\t\t\t\trequest: PromptInputSchema,\n\t\t\t\tresponse: PromptResponseSchema\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent-sessions-list\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: agentSessionsListPath(entry.route),\n\t\t\t\tagentSlug: entry.key,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent-session-detail\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: agentSessionDetailPath(entry.route),\n\t\t\t\tagentSlug: entry.key,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t}\n\t\tconst workflows = await discoverWorkflows(dirs.workflowsDir);\n\t\tfor (const workflow of workflows) {\n\t\t\tconst route = workflowRouteFromKey(workflow.key);\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"workflows\", \"workflow\", dirs.workflowsDir, workflow.filePath);\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: route,\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tdescription: workflow.definition.description,\n\t\t\t\tsubscribable: workflow.definition.subscription?.mode === \"subscribable\",\n\t\t\t\tmoduleFile,\n\t\t\t\trequest: workflow.definition.input,\n\t\t\t\tresponse: workflow.definition.output\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow-runs-list\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: workflowRunsListPath(route),\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow-run-detail\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: workflowRunDetailPath(route),\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t}\n\t\tconst attachments = await discoverTriggerAttachments(dirs.triggersDir);\n\t\tconst discoveredByKey = new Map(attachments.map((attachment) => [attachment.key, attachment]));\n\t\tconst pollGroups = buildPollGroups(attachments);\n\t\tfor (const discovered of discoveredByKey.values()) {\n\t\t\tconst source = discovered.attachment.source;\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, discovered.filePath);\n\t\t\tif (source.kind === \"cron\") {\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"cron-schedule\",\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\tschedule: source.schedule\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source.kind === \"poll\") {\n\t\t\t\tconst route = pollRouteFromKey(source.key);\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-poll\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tpath: route,\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\tschedule: source.schedule,\n\t\t\t\t\tresponse: PromptResponseSchema\n\t\t\t\t});\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-runs-list\",\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tpath: triggerRunsListPath(discovered.key),\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile\n\t\t\t\t});\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-run-detail\",\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tpath: triggerRunDetailPath(discovered.key),\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source.kind === \"webhook\") {\n\t\t\t\tconst route = webhookRouteFromEndpoint(source.endpoint);\n\t\t\t\tconst bindings = buildWebhookBindingsByRoute(discoveredByKey.values(), () => ({\n\t\t\t\t\texecution: { attachmentKey: discovered.key },\n\t\t\t\t\tattachmentKey: discovered.key\n\t\t\t\t})).get(route) ?? [{\n\t\t\t\t\tdiscovered,\n\t\t\t\t\toptions: { attachmentKey: discovered.key }\n\t\t\t\t}];\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-webhook\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tpath: route,\n\t\t\t\t\tattachmentIds: bindings.map(({ discovered: row }) => row.key),\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\trequest: webhookMatchSchemaForBindings(bindings),\n\t\t\t\t\tattachmentSchemas: webhookManifestAttachmentSchemasFromBindings(bindings),\n\t\t\t\t\tresponse: PromptResponseSchema\n\t\t\t\t});\n\t\t\t\tfor (const { discovered: row } of bindings) {\n\t\t\t\t\tconst rowModuleFile = await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, row.filePath);\n\t\t\t\t\tmanifest.push({\n\t\t\t\t\t\tkind: \"trigger-runs-list\",\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tpath: triggerRunsListPath(row.key),\n\t\t\t\t\t\tattachmentId: row.key,\n\t\t\t\t\t\tmoduleFile: rowModuleFile\n\t\t\t\t\t});\n\t\t\t\t\tmanifest.push({\n\t\t\t\t\t\tkind: \"trigger-run-detail\",\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tpath: triggerRunDetailPath(row.key),\n\t\t\t\t\t\tattachmentId: row.key,\n\t\t\t\t\t\tmoduleFile: rowModuleFile\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const group of pollGroups) {\n\t\t\tif (group.attachments.length <= 1) continue;\n\t\t\tconst first = group.attachments[0];\n\t\t\tconst source = first.attachment.source;\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"trigger-poll-group\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: pollGroupRouteFromId(group.id),\n\t\t\t\tpollId: group.id,\n\t\t\t\tattachmentIds: group.attachments.map((attachment) => attachment.key),\n\t\t\t\tmoduleFile: await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, first.filePath),\n\t\t\t\tschedule: source.kind === \"poll\" ? source.schedule : \"\",\n\t\t\t\tresponse: PromptResponseSchema\n\t\t\t});\n\t\t}\n\t\treturn buildStoredRouteManifestFromContext({\n\t\t\tmanifest,\n\t\t\toptions: {},\n\t\t\tprojectRoot,\n\t\t\tskills: discoverSkillManifestEntries(projectRoot)\n\t\t});\n\t} finally {\n\t\tif (previousRoot === void 0) delete process.env.KEYSTROKE_ROOT;\n\t\telse process.env.KEYSTROKE_ROOT = previousRoot;\n\t}\n}\n/** Write `dist/.keystroke/route-manifest.json` for the project. */\nasync function emitStoredRouteManifestForProject(projectRoot) {\n\tpersistStoredRouteManifest(projectRoot, await buildStoredRouteManifestForProject(projectRoot));\n}\n//#endregion\n//#region src/openapi/manifest.ts\nfunction schedulesFromManifest(manifest) {\n\tconst schedules = [];\n\tfor (const entry of manifest) {\n\t\tif (entry.kind === \"cron-schedule\") {\n\t\t\tschedules.push({\n\t\t\t\tattachmentId: entry.attachmentId,\n\t\t\t\ttype: \"cron\",\n\t\t\t\tschedule: entry.schedule\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.kind === \"trigger-poll\") schedules.push({\n\t\t\tattachmentId: entry.attachmentId,\n\t\t\ttype: \"poll\",\n\t\t\tschedule: entry.schedule\n\t\t});\n\t}\n\treturn schedules;\n}\n//#endregion\n//#region src/load-route-manifest.ts\nfunction routeManifestPathForProjectRoot(projectRoot) {\n\treturn join(projectRoot, ROUTE_MANIFEST_REL_PATH);\n}\nfunction readRouteManifest(projectRoot) {\n\tconst path = routeManifestPathForProjectRoot(projectRoot);\n\tif (!existsSync(path)) throw new Error(`${ROUTE_MANIFEST_REL_PATH} not found — start the project server once to emit the manifest`);\n\tconst raw = readFileSync(path, \"utf8\");\n\treturn parseStoredRouteManifest(JSON.parse(raw));\n}\n//#endregion\nexport { agentRouteFromKey, agentSessionDetailPath, agentSessionsListPath, buildPollGroups, buildStoredRouteManifestForProject, buildStoredRouteManifestFromContext, buildWebhookBindingsByRoute, countAgentCredentials, discoverAgentEntries, discoverEntries, discoverModuleFileEntries, discoverSkillManifestEntries, discoverTriggerAttachments, discoverWorkflowEntries, discoverWorkflows, emitStoredRouteManifestForProject, entryIdFromFile, findWebhookManifestEntryByPath, findWorkflowManifestEntry, importAgentDefinition, importTriggerAttachment, importWorkflowDefinition, matchesPollRunTarget, moduleFileKeyFromPath, persistStoredRouteManifest, pollGroupId, pollGroupRouteFromId, pollRouteFromKey, readRouteManifest, routeManifestPathForProjectRoot, schedulesFromManifest, schemaToJson, serializeRouteManifest, toStoredRouteManifest, triggerRunDetailPath, triggerRunsListPath, validateImportedTriggerAttachment, validateImportedWorkflowDefinition, validatePollGroups, validateUniqueModuleKeys, walkTypeScriptFiles, webhookAttachmentSchemasFromBindings, webhookManifestAttachmentSchemasFromBindings, webhookMatchSchemaForBindings, webhookRouteFromEndpoint, workflowRouteFromKey, workflowRunDetailPath, workflowRunsListPath };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,QAAQ;CACd,OAAO,OAAO,MAAM,SAAS,YAAY,MAAM,KAAK,KAAK,EAAE,SAAS,KAAK,OAAO,MAAM,iBAAiB,cAAc,OAAO,MAAM,UAAU,YAAY,OAAO,MAAM,iBAAiB;AACvL;AACA,SAAS,sBAAsB,OAAO,UAAU;CAC/C,IAAI,CAAC,gBAAgB,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,SAAS,sCAAsC;CAC/F,OAAO;AACR;AAGA,SAAS,yBAAyB,UAAU;CAC3C,OAAO,SAAS,QAAQ,cAAc,EAAE,EAAE,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;OAC3C,QAAQ,IAAI,iBAAiB;CACnC;AACD;;AAEA,eAAe,kCAAkC,aAAa;CAC7D,2BAA2B,aAAa,MAAM,mCAAmC,WAAW,CAAC;AAC9F"}
|
|
1
|
+
{"version":3,"file":"dist-QTvT7Ltb.mjs","names":["z.toJSONSchema","z.custom","z.ZodType","z.string","z.union","z.function","z.object","z.literal","z.array","z.discriminatedUnion"],"sources":["../../../packages/manifest/dist/index.mjs"],"sourcesContent":["import { a as walkTypeScriptFiles, i as discoverEntries, n as discoverModuleFileEntries, o as entryIdFromFile, r as moduleFileKeyFromPath, t as validateUniqueModuleKeys } from \"./discovery-DV7FkTRA.mjs\";\nimport { pathToFileURL } from \"node:url\";\nimport { dirname, join, relative, sep } from \"node:path\";\nimport { PromptInputSchema, PromptResponseSchema, ROUTE_MANIFEST_REL_PATH, normalizeCredentialList, parseStoredRouteManifest } from \"@keystrokehq/shared\";\nimport { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { z } from \"zod\";\n//#region src/guards/agent.ts\nfunction isManifestAgent(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst agent = value;\n\treturn typeof agent.slug === \"string\" && agent.slug.trim().length > 0 && typeof agent.buildRuntime === \"function\" && typeof agent.model === \"string\" && typeof agent.systemPrompt === \"string\";\n}\nfunction validateManifestAgent(value, filePath) {\n\tif (!isManifestAgent(value)) throw new Error(`${filePath} must default-export defineAgent(...)`);\n\treturn value;\n}\n//#endregion\n//#region src/routes.ts\nfunction normalizeWebhookEndpoint(endpoint) {\n\treturn endpoint.replace(/^\\/+|\\/+$/g, \"\").replace(/^triggers\\/?/, \"\");\n}\nfunction agentRouteFromKey(key) {\n\treturn `/agents/${key}`;\n}\nfunction agentSessionsListPath(route) {\n\treturn `${route}/sessions`;\n}\nfunction agentSessionDetailPath(route) {\n\treturn `${route}/sessions/:sessionId`;\n}\nfunction workflowRouteFromKey(key) {\n\treturn `/workflows/${key}`;\n}\nfunction workflowRunsListPath(route) {\n\treturn `${route}/runs`;\n}\nfunction workflowRunDetailPath(route) {\n\treturn `${route}/runs/:runId`;\n}\nfunction triggerRunsListPath(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/runs`;\n}\nfunction triggerRunDetailPath(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/runs/:runId`;\n}\nfunction pollRouteFromKey(attachmentKey) {\n\treturn `/triggers/${attachmentKey}/poll`;\n}\nfunction pollGroupRouteFromId(pollId) {\n\treturn `/triggers/polls/${pollId}/run`;\n}\nfunction webhookRouteFromEndpoint(endpoint) {\n\tconst normalized = normalizeWebhookEndpoint(endpoint);\n\tif (!normalized) throw new Error(\"Webhook endpoint must not be empty\");\n\treturn `/triggers/${normalized}`;\n}\n//#endregion\n//#region src/agents/discover.ts\nasync function discoverAgentEntries(agentsDir) {\n\tconst files = await discoverModuleFileEntries(agentsDir, {\n\t\tnestedEntry: \"agent\",\n\t\tduplicateLabel: \"agent module file\"\n\t});\n\tconst entries = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst agent = await importAgentDefinition(filePath);\n\t\tentries.push({\n\t\t\tkey: agent.slug,\n\t\t\troute: agentRouteFromKey(agent.slug),\n\t\t\tfilePath,\n\t\t\tmoduleFile\n\t\t});\n\t}\n\treturn entries;\n}\nasync function importAgentDefinition(filePath) {\n\treturn validateManifestAgent((await import(pathToFileURL(filePath).href)).default, filePath);\n}\n//#endregion\n//#region src/guards/action.ts\nconst ACTION = Symbol.for(\"keystroke.action\");\nfunction isManifestAction(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn ACTION in value && value[ACTION] === true;\n}\nfunction getManifestActionCredentialRequirements(action) {\n\treturn Array.isArray(action.credentials) ? action.credentials : void 0;\n}\n//#endregion\n//#region src/agents/count-agent-credentials.ts\nfunction countAgentCredentials(agent) {\n\tconst keys = /* @__PURE__ */ new Set();\n\tfor (const tool of agent.tools ?? []) {\n\t\tconst record = tool;\n\t\tconst requirements = isManifestAction(tool) ? getManifestActionCredentialRequirements(tool) : \"credentials\" in record && Array.isArray(record.credentials) ? record.credentials : void 0;\n\t\tif (!requirements?.length) continue;\n\t\tfor (const requirement of normalizeCredentialList(requirements)) keys.add(requirement.key);\n\t}\n\treturn keys.size;\n}\n//#endregion\n//#region src/skills/discover-manifest-entries.ts\nconst SKIP_DIRS = new Set([\".git\", \"node_modules\"]);\nfunction toPosix$1(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction parseSkillFrontmatter(raw) {\n\tconst match = raw.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n\tif (!match) return {};\n\tconst out = {};\n\tfor (const line of match[1]?.split(\"\\n\") ?? []) {\n\t\tconst trimmed = line.trim();\n\t\tif (!trimmed || trimmed.startsWith(\"#\")) continue;\n\t\tconst colon = trimmed.indexOf(\":\");\n\t\tif (colon < 0) continue;\n\t\tconst key = trimmed.slice(0, colon).trim();\n\t\tlet value = trimmed.slice(colon + 1).trim();\n\t\tif (value.startsWith(\"\\\"\") && value.endsWith(\"\\\"\") || value.startsWith(\"'\") && value.endsWith(\"'\")) value = value.slice(1, -1);\n\t\tif (key === \"name\") out.name = value;\n\t\telse if (key === \"description\") out.description = value;\n\t}\n\treturn out;\n}\nfunction walkSkillFiles(root, dir, out) {\n\tfor (const name of readdirSync(dir).sort()) {\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (SKIP_DIRS.has(name)) continue;\n\t\t\twalkSkillFiles(root, absolute, out);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stats.isFile() || name !== \"SKILL.md\") continue;\n\t\tconst moduleFile = toPosix$1(relative(root, absolute));\n\t\tconst slug = toPosix$1(relative(join(root, \"src\", \"skills\"), absolute)).replace(/\\/?SKILL\\.md$/, \"\");\n\t\tif (!slug) continue;\n\t\tconst frontmatter = parseSkillFrontmatter(readFileSync(absolute, \"utf8\"));\n\t\tout.push({\n\t\t\tslug,\n\t\t\tname: frontmatter.name,\n\t\t\tdescription: frontmatter.description,\n\t\t\tmoduleFile\n\t\t});\n\t}\n}\n/** Discover skill metadata from src/skills SKILL.md files for the route manifest. */\nfunction discoverSkillManifestEntries(projectRoot) {\n\tconst skillsDir = join(projectRoot, \"src\", \"skills\");\n\tif (!statSync(skillsDir, { throwIfNoEntry: false })?.isDirectory()) return [];\n\tconst entries = [];\n\twalkSkillFiles(projectRoot, skillsDir, entries);\n\treturn entries;\n}\n//#endregion\n//#region src/openapi/schema-to-json.ts\nfunction schemaToJson(schema) {\n\treturn z.toJSONSchema(schema, { target: \"openapi-3.0\" });\n}\n//#endregion\n//#region src/openapi/serialize-manifest.ts\nfunction collectIntegrationKeys(integrations) {\n\treturn integrations.map((integration) => integration.key);\n}\nfunction serializeRouteManifest(manifest) {\n\treturn manifest.map((entry) => {\n\t\tswitch (entry.kind) {\n\t\t\tcase \"health\": return entry;\n\t\t\tcase \"agent\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tagentSlug: entry.agentSlug,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tname: entry.name,\n\t\t\t\tdescription: entry.description,\n\t\t\t\tmodel: entry.model,\n\t\t\t\tsystemPrompt: entry.systemPrompt,\n\t\t\t\ttoolCount: entry.toolCount,\n\t\t\t\tcredentialCount: entry.credentialCount,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"workflow\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tworkflowSlug: entry.workflowSlug,\n\t\t\t\tworkflowName: entry.workflowName,\n\t\t\t\tdescription: entry.description,\n\t\t\t\tsubscribable: entry.subscribable,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-webhook\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tattachmentIds: entry.attachmentIds,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\trequestSchema: schemaToJson(entry.request),\n\t\t\t\tattachmentSchemas: Object.fromEntries(Object.entries(entry.attachmentSchemas).map(([attachmentKey, schemas]) => [attachmentKey, {\n\t\t\t\t\trequestSchema: schemaToJson(schemas.request),\n\t\t\t\t\t...schemas.filter ? { filterSchema: schemaToJson(schemas.filter) } : {}\n\t\t\t\t}])),\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-poll\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tattachmentId: entry.attachmentId,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tschedule: entry.schedule,\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"trigger-poll-group\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tpollId: entry.pollId,\n\t\t\t\tattachmentIds: entry.attachmentIds,\n\t\t\t\tmoduleFile: entry.moduleFile,\n\t\t\t\tschedule: entry.schedule,\n\t\t\t\tresponseSchema: schemaToJson(entry.response)\n\t\t\t};\n\t\t\tcase \"plugin\": return {\n\t\t\t\tkind: entry.kind,\n\t\t\t\tmethod: entry.method,\n\t\t\t\tpath: entry.path,\n\t\t\t\tplugin: entry.plugin\n\t\t\t};\n\t\t\tdefault: return entry;\n\t\t}\n\t});\n}\nfunction toStoredRouteManifest(manifest, options) {\n\treturn {\n\t\tversion: 1,\n\t\tentries: serializeRouteManifest(manifest),\n\t\tskills: options?.skills ?? [],\n\t\tintegrations: options?.integrations\n\t};\n}\nfunction buildStoredRouteManifestFromContext(ctx) {\n\tconst integrations = ctx.options?.integrations ?? ctx.options?.plugins?.map((plugin) => ({\n\t\tkey: plugin.name,\n\t\tmount: plugin.register\n\t})) ?? [];\n\treturn toStoredRouteManifest(ctx.manifest, {\n\t\tintegrations: collectIntegrationKeys(integrations),\n\t\tskills: ctx.skills ?? (ctx.projectRoot ? discoverSkillManifestEntries(ctx.projectRoot) : void 0) ?? []\n\t});\n}\nfunction findWorkflowManifestEntry(manifest, workflowSlug) {\n\treturn manifest.entries.find((entry) => entry.kind === \"workflow\" && entry.workflowSlug === workflowSlug);\n}\nfunction findWebhookManifestEntryByPath(manifest, route) {\n\treturn manifest.entries.find((entry) => entry.kind === \"trigger-webhook\" && entry.path === route);\n}\n//#endregion\n//#region src/persist.ts\nfunction persistStoredRouteManifest(projectRoot, manifest) {\n\tconst path = join(projectRoot, ROUTE_MANIFEST_REL_PATH);\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, `${JSON.stringify(manifest, null, 2)}\\n`);\n}\n//#endregion\n//#region src/guards/workflow.ts\nconst WORKFLOW = Symbol.for(\"keystroke.workflow\");\nfunction isManifestWorkflow(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;\n\tconst workflow = value;\n\treturn typeof workflow.slug === \"string\" && workflow.slug.trim().length > 0 && workflow.input instanceof Object && \"safeParse\" in workflow.input && workflow.output instanceof Object && \"safeParse\" in workflow.output;\n}\nfunction validateManifestWorkflow(value, filePath) {\n\tif (!isManifestWorkflow(value)) throw new Error(`${filePath} must default-export defineWorkflow(...)`);\n\treturn value;\n}\n//#endregion\n//#region src/guards/trigger.ts\nconst TRIGGER_ATTACHMENT = Symbol.for(\"keystroke.triggerAttachment\");\nconst zodSchema = z.custom((value) => value instanceof z.ZodType, \"must be a Zod schema\");\nconst cronScheduleSchema = z.string().trim().min(1, \"cron schedule must be a non-empty string\");\nconst workflowSchema = z.custom((value) => isManifestWorkflow(value), \"must be defineWorkflow(...)\");\nconst agentSchema = z.custom((value) => typeof value === \"object\" && value !== null && typeof value.slug === \"string\" && value.slug.trim().length > 0 && typeof value.prompt === \"function\", \"must be defineAgent(...)\");\nconst promptSchema = z.union([z.string(), z.function()]);\nconst baseSourceShape = {\n\tkey: z.string().trim().min(1),\n\tattach: z.function()\n};\nconst webhookSourceSchema = z.object({\n\tkind: z.literal(\"webhook\"),\n\t...baseSourceShape,\n\tendpoint: z.string().min(1),\n\trequest: zodSchema,\n\tfilter: zodSchema.optional(),\n\tpasses: z.function()\n});\nconst cronSourceSchema = z.object({\n\tkind: z.literal(\"cron\"),\n\t...baseSourceShape,\n\tschedule: cronScheduleSchema\n});\nconst pollSourceSchema = z.object({\n\tkind: z.literal(\"poll\"),\n\t...baseSourceShape,\n\tid: z.string().optional(),\n\tschedule: cronScheduleSchema,\n\trun: z.function(),\n\tfilters: z.array(z.function()),\n\tpasses: z.function()\n});\nconst triggerSourceSchema = z.discriminatedUnion(\"kind\", [\n\twebhookSourceSchema,\n\tcronSourceSchema,\n\tpollSourceSchema\n]);\nconst workflowAttachmentSchema = z.object({\n\tkey: z.string().trim().min(1),\n\tsource: triggerSourceSchema,\n\ttarget: z.literal(\"workflow\"),\n\tworkflow: workflowSchema,\n\ttransform: z.function().optional()\n});\nconst agentAttachmentSchema = z.object({\n\tkey: z.string().trim().min(1),\n\tsource: triggerSourceSchema,\n\ttarget: z.literal(\"agent\"),\n\tagent: agentSchema,\n\tprompt: promptSchema\n});\nconst triggerAttachmentCoreSchema = z.discriminatedUnion(\"target\", [workflowAttachmentSchema, agentAttachmentSchema]);\nfunction isManifestTriggerAttachment(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(TRIGGER_ATTACHMENT in value) || value[TRIGGER_ATTACHMENT] !== true) return false;\n\treturn triggerAttachmentCoreSchema.safeParse(value).success;\n}\nfunction validateManifestTriggerAttachment(value, filePath) {\n\tif (!isManifestTriggerAttachment(value)) throw new Error(`${filePath} must default-export a trigger attachment from .attach({ workflow }) or .attach({ agent, prompt })`);\n\treturn value;\n}\n//#endregion\n//#region src/triggers/discover.ts\nfunction shouldDiscoverTriggerFile(triggersDir, filePath) {\n\treturn !relative(triggersDir, filePath).split(sep).includes(\"sources\");\n}\nasync function discoverTriggerAttachments(triggersDir) {\n\tconst files = await discoverModuleFileEntries(triggersDir, {\n\t\tnestedEntry: \"trigger\",\n\t\tduplicateLabel: \"trigger module file\",\n\t\tshouldDiscoverFile: (filePath) => shouldDiscoverTriggerFile(triggersDir, filePath)\n\t});\n\tconst attachments = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst attachment = await importTriggerAttachment(filePath);\n\t\tattachments.push({\n\t\t\tkey: attachment.key,\n\t\t\tfilePath,\n\t\t\tmoduleFile,\n\t\t\tattachment\n\t\t});\n\t}\n\treturn attachments;\n}\nfunction validateImportedTriggerAttachment(def, filePath) {\n\treturn validateManifestTriggerAttachment(def, filePath);\n}\nasync function importTriggerAttachment(filePath) {\n\treturn validateImportedTriggerAttachment((await import(pathToFileURL(filePath).href)).default, filePath);\n}\n//#endregion\n//#region src/triggers/poll/groups.ts\nfunction pollGroupId(discovered) {\n\tconst source = discovered.attachment.source;\n\tif (source.kind !== \"poll\") throw new Error(`Attachment \"${discovered.key}\" is not a poll trigger`);\n\treturn source.id ?? source.key;\n}\nfunction buildPollGroups(attachments) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const discovered of attachments) {\n\t\tif (discovered.attachment.source.kind !== \"poll\") continue;\n\t\tconst id = pollGroupId(discovered);\n\t\tconst group = byId.get(id) ?? [];\n\t\tgroup.push(discovered);\n\t\tbyId.set(id, group);\n\t}\n\treturn [...byId.entries()].map(([id, groupAttachments]) => ({\n\t\tid,\n\t\tattachments: groupAttachments\n\t}));\n}\nfunction validatePollGroups(groups) {\n\tfor (const group of groups) {\n\t\tif (group.attachments.length <= 1) continue;\n\t\tif (new Set(group.attachments.map((discovered) => {\n\t\t\tconst source = discovered.attachment.source;\n\t\t\tif (source.kind !== \"poll\") throw new Error(`Poll group \"${group.id}\" has non-poll attachment ${discovered.key}`);\n\t\t\treturn source.schedule;\n\t\t})).size > 1) {\n\t\t\tconst keys = group.attachments.map((discovered) => discovered.key).join(\", \");\n\t\t\tthrow new Error(`Poll group \"${group.id}\" has attachments with different schedules (${keys})`);\n\t\t}\n\t}\n}\nfunction matchesPollRunTarget(attachmentKey, workflowKey, target) {\n\tif (!target?.workflows?.length && !target?.attachments?.length) return true;\n\tif (target.attachments?.length && !target.attachments.includes(attachmentKey)) return false;\n\tif (target.workflows?.length && !target.workflows.includes(workflowKey)) return false;\n\treturn true;\n}\n//#endregion\n//#region src/triggers/webhook/build-webhook-bindings.ts\nfunction buildWebhookBindingsByRoute(attachments, handlerOptionsFor) {\n\tconst webhookBindingsByRoute = /* @__PURE__ */ new Map();\n\tfor (const discovered of attachments) {\n\t\tconst source = discovered.attachment.source;\n\t\tif (source.kind !== \"webhook\") continue;\n\t\tconst route = webhookRouteFromEndpoint(source.endpoint);\n\t\tconst bindings = webhookBindingsByRoute.get(route) ?? [];\n\t\tbindings.push({\n\t\t\tdiscovered,\n\t\t\toptions: handlerOptionsFor(discovered.key)\n\t\t});\n\t\twebhookBindingsByRoute.set(route, bindings);\n\t}\n\treturn webhookBindingsByRoute;\n}\n//#endregion\n//#region src/triggers/webhook/webhook-schemas.ts\nfunction webhookSchemaEntriesFromBindings(bindings) {\n\treturn bindings.flatMap((binding) => {\n\t\tconst source = binding.discovered.attachment.source;\n\t\tif (source.kind !== \"webhook\") return [];\n\t\treturn [{\n\t\t\tattachmentKey: binding.discovered.key,\n\t\t\trequest: source.request,\n\t\t\t...source.filter ? { filter: source.filter } : {}\n\t\t}];\n\t});\n}\nfunction webhookAttachmentSchemasFromBindings(bindings) {\n\treturn webhookSchemaEntriesFromBindings(bindings).map((entry) => ({\n\t\tattachmentKey: entry.attachmentKey,\n\t\trequestSchema: schemaToJson(entry.request),\n\t\t...entry.filter ? { filterSchema: schemaToJson(entry.filter) } : {}\n\t}));\n}\nfunction webhookMatchSchemaForBindings(bindings) {\n\tconst schemas = bindings.flatMap((binding) => {\n\t\tconst source = binding.discovered.attachment.source;\n\t\treturn source.kind === \"webhook\" ? [source.request] : [];\n\t});\n\tif (schemas.length === 0) throw new Error(\"Webhook bindings require at least one webhook source\");\n\tif (schemas.length === 1) return schemas[0];\n\treturn z.union(schemas);\n}\nfunction webhookManifestAttachmentSchemasFromBindings(bindings) {\n\treturn Object.fromEntries(webhookSchemaEntriesFromBindings(bindings).map((entry) => [entry.attachmentKey, {\n\t\trequest: entry.request,\n\t\t...entry.filter ? { filter: entry.filter } : {}\n\t}]));\n}\n//#endregion\n//#region src/workflows/discover.ts\nasync function discoverWorkflowEntries(workflowsDir) {\n\tconst files = await discoverModuleFileEntries(workflowsDir, {\n\t\tnestedEntry: \"workflow\",\n\t\tduplicateLabel: \"workflow module file\"\n\t});\n\tconst entries = [];\n\tfor (const { filePath, moduleFile } of files) {\n\t\tconst definition = await importWorkflowDefinition(filePath);\n\t\tentries.push({\n\t\t\tkey: definition.slug,\n\t\t\troute: workflowRouteFromKey(definition.slug),\n\t\t\tfilePath,\n\t\t\tmoduleFile\n\t\t});\n\t}\n\treturn entries;\n}\nfunction validateImportedWorkflowDefinition(def, filePath) {\n\treturn validateManifestWorkflow(def, filePath);\n}\nasync function importWorkflowDefinition(filePath) {\n\treturn validateImportedWorkflowDefinition((await import(pathToFileURL(filePath).href)).default, filePath);\n}\nasync function discoverWorkflows(workflowsDir) {\n\tconst entries = await discoverWorkflowEntries(workflowsDir);\n\tconst workflows = [];\n\tfor (const entry of entries) {\n\t\tconst definition = await importWorkflowDefinition(entry.filePath);\n\t\tworkflows.push({\n\t\t\tkey: definition.slug,\n\t\t\troute: workflowRouteFromKey(definition.slug),\n\t\t\tfilePath: entry.filePath,\n\t\t\tdefinition\n\t\t});\n\t}\n\treturn workflows;\n}\n//#endregion\n//#region src/build-stored-manifest.ts\nfunction resolveDistModuleDirs(projectRoot) {\n\tconst distBase = join(projectRoot, \"dist\");\n\tif (!existsSync(distBase)) throw new Error(`Build output missing at ${distBase}. Run keystroke build before emitting the route manifest.`);\n\treturn {\n\t\tagentsDir: join(distBase, \"agents\"),\n\t\tworkflowsDir: join(distBase, \"workflows\"),\n\t\ttriggersDir: join(distBase, \"triggers\")\n\t};\n}\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\n/**\n* Resolve manifest moduleFile values to project-root-relative source paths.\n*\n* Discovery runs over compiled `dist/` modules, so the raw moduleFile is a\n* dist-relative `.mjs` path. Dist entries are named by their source entry id\n* (`team/escalation.mjs` ← `src/agents/team/escalation/agent.ts`), so walking\n* the matching source dir by the same id rules recovers the source path. Falls\n* back to the dist-relative value when no source file matches (e.g. building\n* a dist-only artifact with no `src/`).\n*/\nvar SourceModuleFileResolver = class {\n\tprojectRoot;\n\tmapsByKind = /* @__PURE__ */ new Map();\n\tconstructor(projectRoot) {\n\t\tthis.projectRoot = projectRoot;\n\t}\n\tasync sourceMapFor(kindDir, nestedEntry) {\n\t\tconst existing = this.mapsByKind.get(kindDir);\n\t\tif (existing) return existing;\n\t\tconst map = /* @__PURE__ */ new Map();\n\t\tconst sourceDir = join(this.projectRoot, \"src\", kindDir);\n\t\tfor (const filePath of await walkTypeScriptFiles(sourceDir)) {\n\t\t\tconst id = entryIdFromFile(sourceDir, filePath, { nestedEntry });\n\t\t\tif (id) map.set(id, toPosix(relative(this.projectRoot, filePath)));\n\t\t}\n\t\tthis.mapsByKind.set(kindDir, map);\n\t\treturn map;\n\t}\n\tasync resolve(kindDir, nestedEntry, distDir, distFilePath) {\n\t\tconst fallback = toPosix(relative(distDir, distFilePath));\n\t\tconst id = entryIdFromFile(distDir, distFilePath, { nestedEntry });\n\t\tif (!id) return fallback;\n\t\treturn (await this.sourceMapFor(kindDir, nestedEntry)).get(id) ?? fallback;\n\t}\n};\n/** Build a stored route manifest from compiled dist/ modules without starting a server. */\nasync function buildStoredRouteManifestForProject(projectRoot) {\n\tconst previousRoot = process.env.KEYSTROKE_ROOT;\n\tprocess.env.KEYSTROKE_ROOT = projectRoot;\n\ttry {\n\t\tconst dirs = resolveDistModuleDirs(projectRoot);\n\t\tconst sourcePaths = new SourceModuleFileResolver(projectRoot);\n\t\tconst manifest = [{\n\t\t\tkind: \"health\",\n\t\t\tmethod: \"GET\",\n\t\t\tpath: \"/health\"\n\t\t}];\n\t\tconst agentEntries = await discoverAgentEntries(dirs.agentsDir);\n\t\tfor (const entry of agentEntries) {\n\t\t\tconst agent = await importAgentDefinition(entry.filePath);\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"agents\", \"agent\", dirs.agentsDir, entry.filePath);\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: entry.route,\n\t\t\t\tagentSlug: agent.slug,\n\t\t\t\tmoduleFile,\n\t\t\t\tname: agent.name,\n\t\t\t\tdescription: agent.description,\n\t\t\t\tmodel: agent.model,\n\t\t\t\tsystemPrompt: agent.systemPrompt,\n\t\t\t\ttoolCount: agent.tools?.length ?? 0,\n\t\t\t\tcredentialCount: countAgentCredentials(agent),\n\t\t\t\trequest: PromptInputSchema,\n\t\t\t\tresponse: PromptResponseSchema\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent-sessions-list\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: agentSessionsListPath(entry.route),\n\t\t\t\tagentSlug: entry.key,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"agent-session-detail\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: agentSessionDetailPath(entry.route),\n\t\t\t\tagentSlug: entry.key,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t}\n\t\tconst workflows = await discoverWorkflows(dirs.workflowsDir);\n\t\tfor (const workflow of workflows) {\n\t\t\tconst route = workflowRouteFromKey(workflow.key);\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"workflows\", \"workflow\", dirs.workflowsDir, workflow.filePath);\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: route,\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tdescription: workflow.definition.description,\n\t\t\t\tsubscribable: workflow.definition.subscription?.mode === \"subscribable\",\n\t\t\t\tmoduleFile,\n\t\t\t\trequest: workflow.definition.input,\n\t\t\t\tresponse: workflow.definition.output\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow-runs-list\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: workflowRunsListPath(route),\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"workflow-run-detail\",\n\t\t\t\tmethod: \"GET\",\n\t\t\t\tpath: workflowRunDetailPath(route),\n\t\t\t\tworkflowSlug: workflow.definition.slug,\n\t\t\t\tworkflowName: workflow.definition.name,\n\t\t\t\tmoduleFile\n\t\t\t});\n\t\t}\n\t\tconst attachments = await discoverTriggerAttachments(dirs.triggersDir);\n\t\tconst discoveredByKey = new Map(attachments.map((attachment) => [attachment.key, attachment]));\n\t\tconst pollGroups = buildPollGroups(attachments);\n\t\tfor (const discovered of discoveredByKey.values()) {\n\t\t\tconst source = discovered.attachment.source;\n\t\t\tconst moduleFile = await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, discovered.filePath);\n\t\t\tif (source.kind === \"cron\") {\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"cron-schedule\",\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\tschedule: source.schedule\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source.kind === \"poll\") {\n\t\t\t\tconst route = pollRouteFromKey(source.key);\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-poll\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tpath: route,\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\tschedule: source.schedule,\n\t\t\t\t\tresponse: PromptResponseSchema\n\t\t\t\t});\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-runs-list\",\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tpath: triggerRunsListPath(discovered.key),\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile\n\t\t\t\t});\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-run-detail\",\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tpath: triggerRunDetailPath(discovered.key),\n\t\t\t\t\tattachmentId: discovered.key,\n\t\t\t\t\tmoduleFile\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source.kind === \"webhook\") {\n\t\t\t\tconst route = webhookRouteFromEndpoint(source.endpoint);\n\t\t\t\tconst bindings = buildWebhookBindingsByRoute(discoveredByKey.values(), () => ({\n\t\t\t\t\texecution: { attachmentKey: discovered.key },\n\t\t\t\t\tattachmentKey: discovered.key\n\t\t\t\t})).get(route) ?? [{\n\t\t\t\t\tdiscovered,\n\t\t\t\t\toptions: { attachmentKey: discovered.key }\n\t\t\t\t}];\n\t\t\t\tmanifest.push({\n\t\t\t\t\tkind: \"trigger-webhook\",\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tpath: route,\n\t\t\t\t\tattachmentIds: bindings.map(({ discovered: row }) => row.key),\n\t\t\t\t\tmoduleFile,\n\t\t\t\t\trequest: webhookMatchSchemaForBindings(bindings),\n\t\t\t\t\tattachmentSchemas: webhookManifestAttachmentSchemasFromBindings(bindings),\n\t\t\t\t\tresponse: PromptResponseSchema\n\t\t\t\t});\n\t\t\t\tfor (const { discovered: row } of bindings) {\n\t\t\t\t\tconst rowModuleFile = await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, row.filePath);\n\t\t\t\t\tmanifest.push({\n\t\t\t\t\t\tkind: \"trigger-runs-list\",\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tpath: triggerRunsListPath(row.key),\n\t\t\t\t\t\tattachmentId: row.key,\n\t\t\t\t\t\tmoduleFile: rowModuleFile\n\t\t\t\t\t});\n\t\t\t\t\tmanifest.push({\n\t\t\t\t\t\tkind: \"trigger-run-detail\",\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\tpath: triggerRunDetailPath(row.key),\n\t\t\t\t\t\tattachmentId: row.key,\n\t\t\t\t\t\tmoduleFile: rowModuleFile\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const group of pollGroups) {\n\t\t\tif (group.attachments.length <= 1) continue;\n\t\t\tconst first = group.attachments[0];\n\t\t\tconst source = first.attachment.source;\n\t\t\tmanifest.push({\n\t\t\t\tkind: \"trigger-poll-group\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tpath: pollGroupRouteFromId(group.id),\n\t\t\t\tpollId: group.id,\n\t\t\t\tattachmentIds: group.attachments.map((attachment) => attachment.key),\n\t\t\t\tmoduleFile: await sourcePaths.resolve(\"triggers\", \"trigger\", dirs.triggersDir, first.filePath),\n\t\t\t\tschedule: source.kind === \"poll\" ? source.schedule : \"\",\n\t\t\t\tresponse: PromptResponseSchema\n\t\t\t});\n\t\t}\n\t\treturn buildStoredRouteManifestFromContext({\n\t\t\tmanifest,\n\t\t\toptions: {},\n\t\t\tprojectRoot,\n\t\t\tskills: discoverSkillManifestEntries(projectRoot)\n\t\t});\n\t} finally {\n\t\tif (previousRoot === void 0) delete process.env.KEYSTROKE_ROOT;\n\t\telse process.env.KEYSTROKE_ROOT = previousRoot;\n\t}\n}\n/** Write `dist/.keystroke/route-manifest.json` for the project. */\nasync function emitStoredRouteManifestForProject(projectRoot) {\n\tpersistStoredRouteManifest(projectRoot, await buildStoredRouteManifestForProject(projectRoot));\n}\n//#endregion\n//#region src/openapi/manifest.ts\nfunction schedulesFromManifest(manifest) {\n\tconst schedules = [];\n\tfor (const entry of manifest) {\n\t\tif (entry.kind === \"cron-schedule\") {\n\t\t\tschedules.push({\n\t\t\t\tattachmentId: entry.attachmentId,\n\t\t\t\ttype: \"cron\",\n\t\t\t\tschedule: entry.schedule\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (entry.kind === \"trigger-poll\") schedules.push({\n\t\t\tattachmentId: entry.attachmentId,\n\t\t\ttype: \"poll\",\n\t\t\tschedule: entry.schedule\n\t\t});\n\t}\n\treturn schedules;\n}\n//#endregion\n//#region src/load-route-manifest.ts\nfunction routeManifestPathForProjectRoot(projectRoot) {\n\treturn join(projectRoot, ROUTE_MANIFEST_REL_PATH);\n}\nfunction readRouteManifest(projectRoot) {\n\tconst path = routeManifestPathForProjectRoot(projectRoot);\n\tif (!existsSync(path)) throw new Error(`${ROUTE_MANIFEST_REL_PATH} not found — start the project server once to emit the manifest`);\n\tconst raw = readFileSync(path, \"utf8\");\n\treturn parseStoredRouteManifest(JSON.parse(raw));\n}\n//#endregion\nexport { agentRouteFromKey, agentSessionDetailPath, agentSessionsListPath, buildPollGroups, buildStoredRouteManifestForProject, buildStoredRouteManifestFromContext, buildWebhookBindingsByRoute, countAgentCredentials, discoverAgentEntries, discoverEntries, discoverModuleFileEntries, discoverSkillManifestEntries, discoverTriggerAttachments, discoverWorkflowEntries, discoverWorkflows, emitStoredRouteManifestForProject, entryIdFromFile, findWebhookManifestEntryByPath, findWorkflowManifestEntry, importAgentDefinition, importTriggerAttachment, importWorkflowDefinition, matchesPollRunTarget, moduleFileKeyFromPath, persistStoredRouteManifest, pollGroupId, pollGroupRouteFromId, pollRouteFromKey, readRouteManifest, routeManifestPathForProjectRoot, schedulesFromManifest, schemaToJson, serializeRouteManifest, toStoredRouteManifest, triggerRunDetailPath, triggerRunsListPath, validateImportedTriggerAttachment, validateImportedWorkflowDefinition, validatePollGroups, validateUniqueModuleKeys, walkTypeScriptFiles, webhookAttachmentSchemasFromBindings, webhookManifestAttachmentSchemasFromBindings, webhookMatchSchemaForBindings, webhookRouteFromEndpoint, workflowRouteFromKey, workflowRunDetailPath, workflowRunsListPath };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,QAAQ;CACd,OAAO,OAAO,MAAM,SAAS,YAAY,MAAM,KAAK,KAAK,EAAE,SAAS,KAAK,OAAO,MAAM,iBAAiB,cAAc,OAAO,MAAM,UAAU,YAAY,OAAO,MAAM,iBAAiB;AACvL;AACA,SAAS,sBAAsB,OAAO,UAAU;CAC/C,IAAI,CAAC,gBAAgB,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,SAAS,sCAAsC;CAC/F,OAAO;AACR;AAGA,SAAS,yBAAyB,UAAU;CAC3C,OAAO,SAAS,QAAQ,cAAc,EAAE,EAAE,QAAQ,gBAAgB,EAAE;AACrE;AACA,SAAS,kBAAkB,KAAK;CAC/B,OAAO,WAAW;AACnB;AACA,SAAS,sBAAsB,OAAO;CACrC,OAAO,GAAG,MAAM;AACjB;AACA,SAAS,uBAAuB,OAAO;CACtC,OAAO,GAAG,MAAM;AACjB;AACA,SAAS,qBAAqB,KAAK;CAClC,OAAO,cAAc;AACtB;AACA,SAAS,qBAAqB,OAAO;CACpC,OAAO,GAAG,MAAM;AACjB;AACA,SAAS,sBAAsB,OAAO;CACrC,OAAO,GAAG,MAAM;AACjB;AACA,SAAS,oBAAoB,eAAe;CAC3C,OAAO,aAAa,cAAc;AACnC;AACA,SAAS,qBAAqB,eAAe;CAC5C,OAAO,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G,SAAS,KAAK;MACb,MAAM;MACN,QAAQ;MACR,MAAM,oBAAoB,IAAI,GAAG;MACjC,cAAc,IAAI;MAClB,YAAY;KACb,CAAC;KACD,SAAS,KAAK;MACb,MAAM;MACN,QAAQ;MACR,MAAM,qBAAqB,IAAI,GAAG;MAClC,cAAc,IAAI;MAClB,YAAY;KACb,CAAC;IACF;GACD;EACD;EACA,KAAK,MAAM,SAAS,YAAY;GAC/B,IAAI,MAAM,YAAY,UAAU,GAAG;GACnC,MAAM,QAAQ,MAAM,YAAY;GAChC,MAAM,SAAS,MAAM,WAAW;GAChC,SAAS,KAAK;IACb,MAAM;IACN,QAAQ;IACR,MAAM,qBAAqB,MAAM,EAAE;IACnC,QAAQ,MAAM;IACd,eAAe,MAAM,YAAY,KAAK,eAAe,WAAW,GAAG;IACnE,YAAY,MAAM,YAAY,QAAQ,YAAY,WAAW,KAAK,aAAa,MAAM,QAAQ;IAC7F,UAAU,OAAO,SAAS,SAAS,OAAO,WAAW;IACrD,UAAU;GACX,CAAC;EACF;EACA,OAAO,oCAAoC;GAC1C;GACA,SAAS,CAAC;GACV;GACA,QAAQ,6BAA6B,WAAW;EACjD,CAAC;CACF,UAAU;EACT,IAAI,iBAAiB,KAAK,GAAG,OAAO,QAAQ,IAAI;OAC3C,QAAQ,IAAI,iBAAiB;CACnC;AACD;;AAEA,eAAe,kCAAkC,aAAa;CAC7D,2BAA2B,aAAa,MAAM,mCAAmC,WAAW,CAAC;AAC9F"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, Qt as originFromPublicUrl, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-
|
|
2
|
+
import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, Qt as originFromPublicUrl, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-C12M6Kul.mjs";
|
|
3
3
|
import { t as walkProject } from "./walk-project-171B4cvO-DJy3qZKd.mjs";
|
|
4
4
|
import { a as installPlaygroundDependencies, i as installDependencies, n as buildPlaygroundWorkspace, o as resolvePackageManager, s as resolveCliRoot, t as readCliVersion } from "./version-DESgLEkE.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -5534,7 +5534,7 @@ function registerBuildCommand(program) {
|
|
|
5534
5534
|
program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
|
|
5535
5535
|
try {
|
|
5536
5536
|
const root = resolveProjectRoot(options.dir);
|
|
5537
|
-
const { buildApp } = await import("./dist-
|
|
5537
|
+
const { buildApp } = await import("./dist-BtAPGWUl.mjs");
|
|
5538
5538
|
await buildApp({ root });
|
|
5539
5539
|
process.stdout.write(`Built ${root}\n`);
|
|
5540
5540
|
} catch (error) {
|
|
@@ -5631,7 +5631,7 @@ async function runDeploy(options) {
|
|
|
5631
5631
|
const client = createCliPlatformClient(config);
|
|
5632
5632
|
let source;
|
|
5633
5633
|
if (!options.skipBuild) {
|
|
5634
|
-
const { buildApp } = await import("./dist-
|
|
5634
|
+
const { buildApp } = await import("./dist-BtAPGWUl.mjs");
|
|
5635
5635
|
source = { files: (await buildApp({
|
|
5636
5636
|
root,
|
|
5637
5637
|
collectSources: true,
|
|
@@ -5731,7 +5731,7 @@ function runtimeChildEnv(parentEnv, overrides) {
|
|
|
5731
5731
|
//#region src/project/bootstrap-run.ts
|
|
5732
5732
|
/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
|
|
5733
5733
|
async function resolveBootstrapRun(options) {
|
|
5734
|
-
const { resolveRuntimeBuildArtifact } = await import("./dist-
|
|
5734
|
+
const { resolveRuntimeBuildArtifact } = await import("./dist-BtAPGWUl.mjs");
|
|
5735
5735
|
const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
|
|
5736
5736
|
const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/bootstrap.mjs");
|
|
5737
5737
|
const args = [`--import=${loader}`];
|
|
@@ -5881,7 +5881,7 @@ async function runDev(options) {
|
|
|
5881
5881
|
process.on("SIGINT", shutdown);
|
|
5882
5882
|
process.on("SIGTERM", shutdown);
|
|
5883
5883
|
try {
|
|
5884
|
-
const { watchApp } = await import("./dist-
|
|
5884
|
+
const { watchApp } = await import("./dist-BtAPGWUl.mjs");
|
|
5885
5885
|
await watchApp({
|
|
5886
5886
|
root,
|
|
5887
5887
|
clean: false,
|
|
@@ -6709,7 +6709,7 @@ async function runStart(options) {
|
|
|
6709
6709
|
const apiPort = Number(new URL(serverUrl).port || 80);
|
|
6710
6710
|
const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
|
|
6711
6711
|
ensureNativeDeps(runtimeNodeModules);
|
|
6712
|
-
const { buildApp } = await import("./dist-
|
|
6712
|
+
const { buildApp } = await import("./dist-BtAPGWUl.mjs");
|
|
6713
6713
|
await buildApp({
|
|
6714
6714
|
root,
|
|
6715
6715
|
clean: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.161",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dallinbentley/keystroke.git",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"tsx": "^4.22.3",
|
|
36
36
|
"typescript": "^6.0.3",
|
|
37
37
|
"vitest": "^4.1.7",
|
|
38
|
-
"@keystrokehq/oxlint-config": "0.0.3",
|
|
39
38
|
"@keystrokehq/tsconfig": "0.0.3",
|
|
40
|
-
"@keystrokehq/
|
|
41
|
-
"@keystrokehq/vitest-config": "0.0.4"
|
|
39
|
+
"@keystrokehq/oxlint-config": "0.0.3",
|
|
40
|
+
"@keystrokehq/vitest-config": "0.0.4",
|
|
41
|
+
"@keystrokehq/tsdown-config": "0.0.3"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsx scripts/generate-catalog-versions.ts && tsdown && node scripts/copy-templates.mjs && node scripts/copy-skills-bundle.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-Dk0phE6_.mjs","names":["core._coercedNumber","schemas.ZodNumber","z.string","z.object","z.discriminatedUnion","z.literal","z.number","z.record","z.unknown","z.boolean","z.array","z.enum","z.ZodType","z.custom","z.union","z.coerce.number","z.url"],"sources":["../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js","../../../packages/shared/dist/index.mjs"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from \"zod\";\n//#region src/constants/conventions.ts\n/** File-layout rules shared by agents, workflows, triggers, and OpenAPI `x-keystroke`. */\nconst DISCOVERY_CONVENTIONS = {\n\tagents: {\n\t\tflat: \"{name}.ts → POST /agents/{name}\",\n\t\tnested: \"{path}/agent.ts or {path}/index.ts → POST /agents/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\tworkflows: {\n\t\tflat: \"{name}.ts → POST /workflows/{name}\",\n\t\tnested: \"{path}/workflow.ts or {path}/index.ts → POST /workflows/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\ttriggers: {\n\t\tflat: \"{name}.ts → trigger key {name}, attachment id {triggerKey}:{workflowKey}\",\n\t\tnested: \"{path}/trigger.ts or {path}/index.ts → trigger key {path}\",\n\t\thelpers: \"Reusable sources live under triggers/sources/ and are not discovered.\"\n\t},\n\topenapi: \"GET /openapi.json is built from the same discovery + mount loop as the live server.\"\n};\n//#endregion\n//#region src/constants/http.ts\nconst ACTIVE_ORG_COOKIE = \"keystroke-active-org-id\";\nconst ACTIVE_ORG_HEADER = \"x-keystroke-org-id\";\n//#endregion\n//#region src/organization-slug.ts\n/** Auth, session, and account-entry URL segments. */\nconst AUTH_ACCOUNT_SLUGS = [\n\t\"2fa\",\n\t\"accept-invite\",\n\t\"auth\",\n\t\"authorize\",\n\t\"callback\",\n\t\"callbacks\",\n\t\"confirm-email\",\n\t\"confirmation\",\n\t\"connect\",\n\t\"device\",\n\t\"email-verification\",\n\t\"forgot-password\",\n\t\"invite\",\n\t\"invites\",\n\t\"login\",\n\t\"logout\",\n\t\"magic-link\",\n\t\"mfa\",\n\t\"oauth\",\n\t\"onboarding\",\n\t\"password\",\n\t\"recovery\",\n\t\"register\",\n\t\"reset-password\",\n\t\"saml\",\n\t\"session\",\n\t\"sessions\",\n\t\"sign-in\",\n\t\"sign-up\",\n\t\"signin\",\n\t\"signout\",\n\t\"signup\",\n\t\"sso\",\n\t\"token\",\n\t\"tokens\",\n\t\"unlink\",\n\t\"verify\",\n\t\"verify-email\"\n];\n/** Org, workspace, billing, and account-management URL segments. */\nconst ORG_ACCOUNT_SLUGS = [\n\t\"account\",\n\t\"accounts\",\n\t\"billing\",\n\t\"console\",\n\t\"invoice\",\n\t\"invoices\",\n\t\"member\",\n\t\"members\",\n\t\"me\",\n\t\"org\",\n\t\"organization\",\n\t\"organizations\",\n\t\"orgs\",\n\t\"payment\",\n\t\"payments\",\n\t\"plan\",\n\t\"plans\",\n\t\"portal\",\n\t\"preferences\",\n\t\"profile\",\n\t\"settings\",\n\t\"subscription\",\n\t\"subscriptions\",\n\t\"team\",\n\t\"teams\",\n\t\"upgrade\",\n\t\"usage\",\n\t\"user\",\n\t\"users\",\n\t\"workspace\",\n\t\"workspaces\"\n];\n/** Product surfaces, resource types, and in-app navigation segments. */\nconst PRODUCT_SLUGS = [\n\t\"action\",\n\t\"actions\",\n\t\"activity\",\n\t\"agent\",\n\t\"agents\",\n\t\"analytics\",\n\t\"app\",\n\t\"apps\",\n\t\"artifact\",\n\t\"artifacts\",\n\t\"assistant\",\n\t\"assistants\",\n\t\"audit\",\n\t\"audit-log\",\n\t\"automation\",\n\t\"automations\",\n\t\"branch\",\n\t\"branches\",\n\t\"canvas\",\n\t\"chat\",\n\t\"chats\",\n\t\"connection\",\n\t\"connections\",\n\t\"create\",\n\t\"credential\",\n\t\"credentials\",\n\t\"dashboard\",\n\t\"deployment\",\n\t\"deployments\",\n\t\"examples\",\n\t\"execute\",\n\t\"execution\",\n\t\"executions\",\n\t\"explore\",\n\t\"get-started\",\n\t\"history\",\n\t\"inbox\",\n\t\"inspector\",\n\t\"integration\",\n\t\"integrations\",\n\t\"library\",\n\t\"logs\",\n\t\"marketplace\",\n\t\"mcp\",\n\t\"mcps\",\n\t\"new\",\n\t\"notifications\",\n\t\"observe\",\n\t\"plugin\",\n\t\"plugins\",\n\t\"primitive\",\n\t\"primitives\",\n\t\"project\",\n\t\"projects\",\n\t\"recents\",\n\t\"registry\",\n\t\"reports\",\n\t\"run\",\n\t\"runs\",\n\t\"runtime\",\n\t\"runtimes\",\n\t\"sandbox\",\n\t\"sandboxes\",\n\t\"search\",\n\t\"skill\",\n\t\"skills\",\n\t\"templates\",\n\t\"thread\",\n\t\"threads\",\n\t\"trigger\",\n\t\"triggers\",\n\t\"version\",\n\t\"versions\",\n\t\"workflow\",\n\t\"workflows\"\n];\n/** Marketing, docs, company, and go-to-market URL segments. */\nconst MARKETING_SITE_SLUGS = [\n\t\"about\",\n\t\"affiliates\",\n\t\"ai\",\n\t\"announcements\",\n\t\"anthropic\",\n\t\"blog\",\n\t\"book-demo\",\n\t\"brand\",\n\t\"campaigns\",\n\t\"career\",\n\t\"careers\",\n\t\"case-studies\",\n\t\"casestudies\",\n\t\"changelog\",\n\t\"chatgpt\",\n\t\"chrome-extension\",\n\t\"claude\",\n\t\"codex\",\n\t\"community\",\n\t\"company\",\n\t\"compare\",\n\t\"contact\",\n\t\"contribute\",\n\t\"creators\",\n\t\"customers\",\n\t\"demo\",\n\t\"demos\",\n\t\"discord\",\n\t\"docs\",\n\t\"documentation\",\n\t\"download\",\n\t\"downloads\",\n\t\"dust\",\n\t\"emerging-talent\",\n\t\"engineering-blog\",\n\t\"enterprise\",\n\t\"events\",\n\t\"experts\",\n\t\"extension\",\n\t\"faq\",\n\t\"faqs\",\n\t\"features\",\n\t\"forum\",\n\t\"glean\",\n\t\"grok\",\n\t\"guide\",\n\t\"guides\",\n\t\"gumloop\",\n\t\"handbook\",\n\t\"help\",\n\t\"help-center\",\n\t\"home\",\n\t\"how-it-works\",\n\t\"howitworks\",\n\t\"inspo\",\n\t\"intern\",\n\t\"investors\",\n\t\"jobs\",\n\t\"legal\",\n\t\"lindy\",\n\t\"llm\",\n\t\"llms\",\n\t\"love\",\n\t\"make\",\n\t\"manifesto\",\n\t\"media\",\n\t\"merch\",\n\t\"mission\",\n\t\"mobile\",\n\t\"models\",\n\t\"n8n\",\n\t\"news\",\n\t\"newsroom\",\n\t\"open\",\n\t\"open-claw\",\n\t\"open-source\",\n\t\"openai\",\n\t\"our-story\",\n\t\"overview\",\n\t\"partners\",\n\t\"pi\",\n\t\"pipedream\",\n\t\"platform\",\n\t\"press\",\n\t\"press-kit\",\n\t\"pricing\",\n\t\"privacy\",\n\t\"product\",\n\t\"products\",\n\t\"provider\",\n\t\"providers\",\n\t\"quick-start\",\n\t\"quickstart\",\n\t\"refer\",\n\t\"relay\",\n\t\"relay-app\",\n\t\"reporting\",\n\t\"request-demo\",\n\t\"resources\",\n\t\"roadmap\",\n\t\"schedule-demo\",\n\t\"security\",\n\t\"solutions\",\n\t\"stack-ai\",\n\t\"stackai\",\n\t\"startup\",\n\t\"startups\",\n\t\"status\",\n\t\"stories\",\n\t\"story\",\n\t\"students\",\n\t\"support\",\n\t\"swag\",\n\t\"switch\",\n\t\"talent\",\n\t\"terms\",\n\t\"testimonials\",\n\t\"thesis\",\n\t\"tines\",\n\t\"trust\",\n\t\"tutorials\",\n\t\"university\",\n\t\"use-case\",\n\t\"use-cases\",\n\t\"usecases\",\n\t\"versus\",\n\t\"vellum\",\n\t\"vs\",\n\t\"webinars\",\n\t\"workato\",\n\t\"xai\",\n\t\"yc\",\n\t\"zapier\"\n];\n/** Integrations, competitors, and partner brand slugs (marketing / integration pages). */\nconst INTEGRATION_BRAND_SLUGS = [\n\t\"airtable\",\n\t\"asana\",\n\t\"aws\",\n\t\"azure\",\n\t\"bun\",\n\t\"confluence\",\n\t\"copilot\",\n\t\"cursor\",\n\t\"databricks\",\n\t\"figma\",\n\t\"firebase\",\n\t\"fly\",\n\t\"gcp\",\n\t\"gemini\",\n\t\"github\",\n\t\"gitlab\",\n\t\"gmail\",\n\t\"heroku\",\n\t\"hubspot\",\n\t\"huggingface\",\n\t\"jira\",\n\t\"linear\",\n\t\"mailchimp\",\n\t\"meta\",\n\t\"mistral\",\n\t\"mixmax\",\n\t\"monday\",\n\t\"netlify\",\n\t\"neon\",\n\t\"notion\",\n\t\"npm\",\n\t\"outlook\",\n\t\"outreach\",\n\t\"perplexity\",\n\t\"planetscale\",\n\t\"pnpm\",\n\t\"postmark\",\n\t\"ramp\",\n\t\"railway\",\n\t\"render\",\n\t\"resend\",\n\t\"salesforce\",\n\t\"segment\",\n\t\"sendgrid\",\n\t\"shopify\",\n\t\"slack\",\n\t\"snowflake\",\n\t\"stripe\",\n\t\"supabase\",\n\t\"terraform\",\n\t\"trello\",\n\t\"turso\",\n\t\"twilio\",\n\t\"typeform\",\n\t\"vercel\",\n\t\"vscode\",\n\t\"windsurf\",\n\t\"yarn\"\n];\n/** Company, team, and department landing-page segments. */\nconst COMPANY_TEAM_SLUGS = [\n\t\"engineers\",\n\t\"engineering\",\n\t\"executives\",\n\t\"hc\",\n\t\"intern\",\n\t\"it\",\n\t\"leadership\",\n\t\"marketing\",\n\t\"ops\",\n\t\"revops\",\n\t\"sales\",\n\t\"services\",\n\t\"tech\"\n];\n/** Legal, trust, compliance, and policy URL segments. */\nconst LEGAL_TRUST_SLUGS = [\n\t\"accessibility\",\n\t\"agreement\",\n\t\"a11y\",\n\t\"bug-bounty\",\n\t\"compliance\",\n\t\"cookie-policy\",\n\t\"cookies\",\n\t\"disclose\",\n\t\"dpa\",\n\t\"eula\",\n\t\"gdpr\",\n\t\"hipaa\",\n\t\"iso\",\n\t\"msa\",\n\t\"pci\",\n\t\"responsible-disclosure\",\n\t\"sla\",\n\t\"soc2\",\n\t\"tos\",\n\t\"trust-center\",\n\t\"trustcenter\",\n\t\"vulnerability\"\n];\n/** Developer, API, CLI, and technical URL segments. */\nconst DEVELOPER_TECH_SLUGS = [\n\t\"api\",\n\t\"api-docs\",\n\t\"cli\",\n\t\"code\",\n\t\"config\",\n\t\"developer\",\n\t\"developer-tools\",\n\t\"developers\",\n\t\"dev-tools\",\n\t\"devtools\",\n\t\"dev\",\n\t\"dev-states\",\n\t\"graphql\",\n\t\"graphql-playground\",\n\t\"mcp-server\",\n\t\"mcp-servers\",\n\t\"openapi\",\n\t\"sdk\",\n\t\"swagger\"\n];\n/** Infra, ops, static assets, and system URL segments. */\nconst INFRA_SYSTEM_SLUGS = [\n\t\"acme-challenge\",\n\t\"admin\",\n\t\"apple-app-site-association\",\n\t\"assets\",\n\t\"batch\",\n\t\"cache\",\n\t\"cdn\",\n\t\"cron\",\n\t\"debug\",\n\t\"error\",\n\t\"errors\",\n\t\"favicon\",\n\t\"feed\",\n\t\"files\",\n\t\"health\",\n\t\"healthcheck\",\n\t\"healthz\",\n\t\"hooks\",\n\t\"internal\",\n\t\"item\",\n\t\"manifest\",\n\t\"metrics\",\n\t\"null\",\n\t\"ping\",\n\t\"prod\",\n\t\"public\",\n\t\"redirect\",\n\t\"robots\",\n\t\"rpc\",\n\t\"rss\",\n\t\"sharer\",\n\t\"sitemap\",\n\t\"staging\",\n\t\"static\",\n\t\"storage\",\n\t\"test\",\n\t\"undefined\",\n\t\"universal\",\n\t\"webhooks\",\n\t\"well-known\",\n\t\"www\"\n];\n/** Reserved slugs that are valid org names in theory but blocked for routing safety. */\nconst ROUTING_SAFETY_SLUGS = [\n\t\"alpha\",\n\t\"anonymous\",\n\t\"archive\",\n\t\"archived\",\n\t\"beta\",\n\t\"clone\",\n\t\"copy\",\n\t\"default\",\n\t\"deleted\",\n\t\"demo-org\",\n\t\"draft\",\n\t\"drafts\",\n\t\"duplicate\",\n\t\"early-access\",\n\t\"embed\",\n\t\"embedded\",\n\t\"export\",\n\t\"fork\",\n\t\"free\",\n\t\"guest\",\n\t\"import\",\n\t\"index\",\n\t\"list\",\n\t\"manage\",\n\t\"moderator\",\n\t\"newsletter\",\n\t\"owner\",\n\t\"preview\",\n\t\"previews\",\n\t\"private\",\n\t\"pro\",\n\t\"public-api\",\n\t\"publish\",\n\t\"published\",\n\t\"queue\",\n\t\"remove\",\n\t\"root\",\n\t\"sample\",\n\t\"samples\",\n\t\"selection\",\n\t\"share\",\n\t\"shared\",\n\t\"sponsor\",\n\t\"sponsors\",\n\t\"sponsorship\",\n\t\"subscribe\",\n\t\"super\",\n\t\"superuser\",\n\t\"system\",\n\t\"sys\",\n\t\"test-org\",\n\t\"trash\",\n\t\"unpublish\",\n\t\"unsubscribe\",\n\t\"upload\",\n\t\"uploads\",\n\t\"waitlist\",\n\t\"widget\",\n\t\"widgets\",\n\t\"worker\",\n\t\"workers\"\n];\n/**\n* URL segments reserved for global (non-org) routes — cannot be used as an org slug.\n* Prefer adding new entries to the category arrays above; the Set is the enforcement surface.\n*/\nconst RESERVED_ORGANIZATION_SLUGS = new Set([\n\t...AUTH_ACCOUNT_SLUGS,\n\t...ORG_ACCOUNT_SLUGS,\n\t...PRODUCT_SLUGS,\n\t...MARKETING_SITE_SLUGS,\n\t...INTEGRATION_BRAND_SLUGS,\n\t...COMPANY_TEAM_SLUGS,\n\t...LEGAL_TRUST_SLUGS,\n\t...DEVELOPER_TECH_SLUGS,\n\t...INFRA_SYSTEM_SLUGS,\n\t...ROUTING_SAFETY_SLUGS\n]);\n/**\n* Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.\n*\n* IMPORTANT: this is the schema for *reading* slugs (persisted rows, API\n* responses). It intentionally does NOT enforce the reserved-name list — an org\n* created before a name became reserved must still parse on read. Use\n* `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.\n*/\nconst OrganizationSlugSchema = z.string().trim().toLowerCase().min(2, \"Slug must be at least 2 characters\").max(64, \"Slug must be at most 64 characters\").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use lowercase letters, numbers, and dashes only\");\n/**\n* Slug validation for *claiming* a slug (organization create/rename). Adds the\n* reserved-name check on top of the base format. Never use this to parse\n* existing org data, or pre-existing orgs whose slug later became reserved would\n* fail to load.\n*/\nconst ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), \"This slug is reserved\");\nconst ORGANIZATION_NAME_APOSTROPHE_PATTERN = /[''\\u2018\\u2019]/g;\n/** Normalize a display name into slug-shaped text (may be empty or too short to claim). */\nfunction normalizeOrganizationNameToSlugBase(name) {\n\treturn name.trim().toLowerCase().replace(ORGANIZATION_NAME_APOSTROPHE_PATTERN, \"\").replace(/[^a-z0-9]+/g, \"-\").replace(/-+/g, \"-\").replace(/^-|-$/g, \"\");\n}\n/**\n* Live slug preview while typing an org name. Returns normalized text only —\n* no server-side `\"org\"` fallback when the preview is empty or under min length.\n*/\nfunction previewOrganizationSlugFromName(name) {\n\treturn normalizeOrganizationNameToSlugBase(name);\n}\n/** Derive a URL slug from a display name (not guaranteed unique). */\nfunction slugifyOrganizationName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"org\";\n\tconst parsed = OrganizationSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"org\";\n}\nfunction parseOrganizationSlug(input) {\n\treturn OrganizationSlugSchema.parse(input);\n}\n//#endregion\n//#region src/project-slug.ts\n/** Same format as organization slugs — org-scoped, no global reserved list. */\nconst ProjectSlugSchema = OrganizationSlugSchema;\n/** Derive a URL slug from a project display name (not guaranteed unique within the org). */\nfunction slugifyProjectName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"project\";\n\tconst parsed = ProjectSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"project\";\n}\nfunction parseProjectSlug(input) {\n\treturn ProjectSlugSchema.parse(input);\n}\n//#endregion\n//#region src/constants/projects.ts\n/** Platform wait for project /health before declaring unreachable. */\nconst PROJECT_PING_TIMEOUT_MS = 15e3;\n/** Browser→platform request budget (ping + small platform overhead). */\nconst PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;\n/** Pause between reachability checks after the previous check finishes. */\nconst PROJECT_REACHABILITY_RETRY_MS = 5e3;\n//#endregion\n//#region src/public-url.ts\n/** Normalize a public origin URL (no trailing slash). */\nfunction originFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback.replace(/\\/+$/, \"\");\n\treturn trimmed.replace(/\\/+$/, \"\");\n}\n/** TCP port to bind for a local server, derived from a public URL. */\nfunction listenPortFromUrl(url, fallback) {\n\tconst parsed = new URL(url);\n\tif (parsed.port) {\n\t\tconst port = Number(parsed.port);\n\t\tif (Number.isFinite(port) && port > 0) return port;\n\t}\n\tif (parsed.protocol === \"https:\") return 443;\n\tif (parsed.protocol === \"http:\") return 80;\n\treturn fallback;\n}\n/** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */\nfunction listenPortFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback;\n\ttry {\n\t\treturn listenPortFromUrl(trimmed, fallback);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n//#endregion\n//#region src/tool-parameters.ts\n/** JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0). */\nfunction toolParameters(schema) {\n\treturn z.toJSONSchema(schema, { target: \"draft-2020-12\" });\n}\n//#endregion\n//#region src/constants/route-manifest.ts\n/** On-disk path under the project root (packed in deploy artifacts when present). */\nconst ROUTE_MANIFEST_REL_PATH = \"dist/.keystroke/route-manifest.json\";\n/** HTTP route served by the project server after bootstrap. */\nconst ROUTE_MANIFEST_HTTP_PATH = \"/.keystroke/route-manifest\";\n//#endregion\n//#region src/schemas/route-manifest.ts\nconst StoredRouteManifestSkillSchema = z.object({\n\tslug: z.string(),\n\tname: z.string().optional(),\n\tdescription: z.string().optional(),\n\tmoduleFile: z.string()\n});\nconst serializedRouteManifestEntrySchema = z.discriminatedUnion(\"kind\", [\n\tz.object({\n\t\tkind: z.literal(\"health\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.literal(\"/health\")\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tname: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tmodel: z.string(),\n\t\tsystemPrompt: z.string(),\n\t\ttoolCount: z.number().int().nonnegative(),\n\t\tcredentialCount: z.number().int().nonnegative(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-session-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsubscribable: z.boolean(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-webhook\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tattachmentSchemas: z.record(z.string(), z.object({\n\t\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\t\tfilterSchema: z.record(z.string(), z.unknown()).optional()\n\t\t})),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll-group\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tpollId: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"cron-schedule\"),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"plugin\"),\n\t\tmethod: z.enum([\n\t\t\t\"GET\",\n\t\t\t\"POST\",\n\t\t\t\"PUT\",\n\t\t\t\"PATCH\",\n\t\t\t\"DELETE\"\n\t\t]),\n\t\tpath: z.string(),\n\t\tplugin: z.string()\n\t})\n]);\nconst StoredRouteManifestSchema = z.object({\n\tversion: z.literal(1),\n\tentries: z.array(serializedRouteManifestEntrySchema),\n\tskills: z.array(StoredRouteManifestSkillSchema).default([]),\n\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\n//#endregion\n//#region src/schemas/channels.ts\n/** Messaging platforms that support agent gateway bindings. */\nconst ChannelPlatformKeySchema = z.enum([\"slack\"]);\nconst ChannelReactionSupportSchema = z.enum([\n\t\"full\",\n\t\"read-only\",\n\t\"none\"\n]);\nconst ChannelCardSupportSchema = z.enum([\n\t\"full\",\n\t\"partial\",\n\t\"none\"\n]);\nconst ChannelStreamingSupportSchema = z.enum([\n\t\"native\",\n\t\"post-edit\",\n\t\"buffered\",\n\t\"drafts\",\n\t\"none\"\n]);\nconst ChannelCapabilitiesSchema = z.object({\n\tmentions: z.boolean(),\n\treactions: ChannelReactionSupportSchema,\n\tcards: ChannelCardSupportSchema,\n\tmodals: z.boolean(),\n\tstreaming: ChannelStreamingSupportSchema,\n\tdms: z.boolean()\n});\nconst ChannelListenModeSchema = z.enum([\n\t\"mention\",\n\t\"all\",\n\t\"dm\"\n]);\nconst ChannelBindingKindSchema = z.enum([\n\t\"public\",\n\t\"private\",\n\t\"dm\",\n\t\"group\",\n\t\"space\"\n]);\nconst AppGatewaySchema = z.object({\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\tsupportsChannelDirectory: z.boolean(),\n\twebhookPathHint: z.string().min(1),\n\tdocsUrl: z.string().url().optional(),\n\ttagline: z.string().min(1).optional()\n});\n/** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */\nconst ChannelPlatformSchema = z.object({\n\tkey: ChannelPlatformKeySchema,\n\tname: z.string().min(1),\n\tappLogoId: z.string().min(1),\n\tfallbackDomain: z.string().min(1),\n\tdescription: z.string().min(1),\n\ttagline: z.string().min(1),\n\tauthKind: z.enum([\"oauth\", \"api_key\"]),\n\tcredentialFields: z.array(z.object({\n\t\tkey: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tplaceholder: z.string().optional(),\n\t\thelpText: z.string().optional(),\n\t\ttype: z.enum([\n\t\t\t\"text\",\n\t\t\t\"password\",\n\t\t\t\"textarea\"\n\t\t]),\n\t\trequired: z.boolean(),\n\t\tprefix: z.string().optional()\n\t})),\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\twebhookPathHint: z.string().min(1),\n\tsupportsChannelDirectory: z.boolean(),\n\tdocsUrl: z.string().url().optional()\n});\nconst ChannelBindingSchema = z.object({\n\tid: z.string().min(1),\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema,\n\tmode: ChannelListenModeSchema,\n\tsubscribeOnMention: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst ChannelConnectionSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tagentId: z.string().min(1),\n\taccountLabel: z.string().min(1),\n\taccountId: z.string().min(1),\n\tconnectedAt: z.string(),\n\tbindings: z.array(ChannelBindingSchema)\n});\nconst ChannelDirectoryEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tkind: ChannelBindingKindSchema,\n\tmemberCount: z.number().int().nonnegative().optional(),\n\tisArchived: z.boolean().optional()\n});\nconst ChannelConnectionListResponseSchema = z.object({ connections: z.array(ChannelConnectionSchema) });\nconst ChannelDirectoryListResponseSchema = z.object({ channels: z.array(ChannelDirectoryEntrySchema) });\n/** Channel-relevant fields parsed from an OAuth connection's metadata blob. */\nconst ChannelAccountMetadataSchema = z.object({ teamName: z.string().min(1).optional() });\n/** OAuth workspace available for channel bindings (e.g. Slack team). */\nconst ChannelAccountSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tlabel: z.string().min(1),\n\tconnectedAt: z.string()\n});\nconst ChannelAccountListResponseSchema = z.object({ accounts: z.array(ChannelAccountSchema) });\nconst NewChannelBindingInputSchema = z.object({\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema.optional(),\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst BindChannelBodySchema = z.object({\n\tplatform: ChannelPlatformKeySchema,\n\taccountId: z.string().min(1),\n\tbinding: NewChannelBindingInputSchema\n});\nconst UpdateChannelBindingBodySchema = z.object({ patch: z.object({\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n}) });\n//#endregion\n//#region src/schemas/apps.ts\n/** A single OAuth scope an app can request, with human copy for connect UI. */\nconst OAuthScopeOptionSchema = z.object({\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tdefaultSelected: z.boolean().optional(),\n\trequired: z.boolean().optional()\n});\n/** How an app authenticates when connecting credentials. */\nconst AppAuthKindSchema = z.enum([\"oauth\", \"api_key\"]);\n/**\n* A connectable integration shown in the \"Connect an app\" picker. An \"app\" is\n* an integration / credential set — connected state is whether a credential exists.\n*/\nconst AppCatalogEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tcategory: z.string().min(1),\n\tintegrationDescription: z.string().min(1),\n\tauthKind: AppAuthKindSchema,\n\toauthScopes: z.array(OAuthScopeOptionSchema),\n\t/** When present, the app supports agent gateway bindings (external channels). */\n\tgateway: AppGatewaySchema.optional()\n});\nconst ListAppsResponseSchema = z.object({ apps: z.array(AppCatalogEntrySchema) });\n//#endregion\n//#region src/schemas/credentials.ts\n/** How a credential instance is stored (`credential_instances.auth_kind`). */\nconst CredentialAuthKindSchema = z.enum([\"api_key\", \"oauth_managed\"]);\n/** Where a credential instance is stored (`credential_instances.scope_type`). */\nconst CredentialScopeTypeSchema = z.enum([\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\n/**\n* Resolution chain step when an action/tool looks up credentials.\n* `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.\n*/\nconst CredentialScopeLevelSchema = z.enum([\n\t\"selection\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\nconst CREDENTIAL_AUTH_KINDS = CredentialAuthKindSchema.options;\nconst CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;\nconst CREDENTIAL_SCOPE_LEVELS = CredentialScopeLevelSchema.options;\n/** Default chain when `credential.static(...).scope()` is called with no args. */\nconst DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = [\"organization\", \"project\"];\nconst CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE = {\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\n//#endregion\n//#region src/schemas/app-credentials.ts\n/** Scope of a platform app credential (maps to `credential_instances.scope_type`). */\nconst AppCredentialScopeSchema = z.enum([\n\t\"user\",\n\t\"project\",\n\t\"organization\"\n]);\n/** How the credential was connected (OAuth vs manual api-key entry). */\nconst AppCredentialConnectionKindSchema = z.enum([\"oauth\", \"manual\"]);\n/** Connect-dialog permission preset for OAuth scope selection. */\nconst OAuthPermissionModeSchema = z.enum([\"default\", \"restricted\"]);\nconst optionalTimestamp$1 = z.string().optional();\nconst nullableOptionalTimestamp = z.string().nullable().optional();\n/**\n* Summary row for the apps/credentials table and credential detail page.\n* Plaintext secrets are never returned — only masked `keyPreviews`.\n*/\nconst AppCredentialSummarySchema = z.object({\n\tid: z.string().min(1),\n\tappId: z.string().min(1),\n\tlabel: z.string().min(1),\n\tscope: AppCredentialScopeSchema,\n\tlastRefreshedAt: z.string().nullable(),\n\tappName: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tprojectName: z.string().min(1).optional(),\n\tstatus: z.string().optional(),\n\tcreatedAt: optionalTimestamp$1,\n\tlastUsedAt: nullableOptionalTimestamp,\n\tisDefault: z.boolean().optional(),\n\tconnectionKind: AppCredentialConnectionKindSchema.optional(),\n\townerUserId: z.string().min(1).optional(),\n\townerName: z.string().min(1).optional(),\n\townerAvatarUrl: z.string().url().optional(),\n\tgrantedScopes: z.array(z.string().min(1)).optional(),\n\tcredentialKeys: z.array(z.string().min(1)).optional(),\n\tkeyPreviews: z.record(z.string(), z.string()).optional(),\n\texpiresAt: optionalTimestamp$1\n});\nconst credentialSecretValueSchema = z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" });\nfunction hasCredentialTarget(input) {\n\treturn input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;\n}\nfunction addMissingCredentialTargetIssue(ctx, path = [\"projects\"]) {\n\tctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"At least one credential target is required\",\n\t\tpath\n\t});\n}\n/** Target fields shared by create and OAuth start flows. */\nconst CredentialTargetsFieldsSchema = z.object({\n\tprojects: z.array(z.string().min(1)).default([]),\n\tcreateOrganizationCredential: z.boolean().default(false),\n\tcreateUserProvidedCredential: z.boolean().default(false)\n});\n/** Input for starting an OAuth connection (connect dialog / CLI connect). */\nconst StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tscopes: z.array(z.string().min(1)),\n\tpermissionMode: OAuthPermissionModeSchema\n});\n/** Result of starting an OAuth connection. */\nconst StartOAuthConnectionResultSchema = z.object({\n\tstatus: z.enum([\"connected\", \"redirecting\"]),\n\tauthorizeUrl: z.string().url().nullable()\n});\n/** Request body for `POST /api/credentials` (manual api-key fan-out). */\nconst CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tconnectionKind: AppCredentialConnectionKindSchema,\n\tvalue: credentialSecretValueSchema.optional(),\n\tscopes: z.array(z.string().min(1)).optional()\n}).superRefine((input, ctx) => {\n\tif (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);\n\tif (input.connectionKind === \"manual\" && !input.value) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"value is required for manual connections\",\n\t\tpath: [\"value\"]\n\t});\n\tif (input.connectionKind === \"oauth\") ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"OAuth credentials are created via the OAuth callback\",\n\t\tpath: [\"connectionKind\"]\n\t});\n});\n/** Request body for `PATCH /api/credentials/:id`. */\nconst UpdateCredentialRequestSchema = z.object({\n\tlabel: z.string().trim().min(1).optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: credentialSecretValueSchema.optional()\n}).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: \"At least one field is required\" });\nconst ListCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\nconst GetCredentialResponseSchema = z.object({ credential: AppCredentialSummarySchema });\nconst CreateCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\n//#endregion\n//#region src/schemas/team-requests.ts\nconst TeamRequestTypeSchema = z.enum([\n\t\"org-deletion\",\n\t\"contact\",\n\t\"enterprise-upgrade\"\n]);\nconst SubmitTeamRequestRequestSchema = z.object({\n\ttype: TeamRequestTypeSchema,\n\tmessage: z.string().trim().max(5e3).optional()\n});\nconst SubmitTeamRequestResponseSchema = z.object({ ok: z.literal(true) });\n//#endregion\n//#region src/schemas/credential-spec.ts\nfunction isCredentialInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.key === \"string\" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;\n}\nconst credentialInputSchema = z.custom((value) => isCredentialInput(value), \"must be a credential requirement\");\nfunction createRef(kind, key, schema, options) {\n\tconst tokenField = options?.tokenField;\n\treturn {\n\t\tkind,\n\t\tkey,\n\t\tschema,\n\t\t...tokenField !== void 0 ? { tokenField } : {},\n\t\tscope(...chain) {\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t\tkind,\n\t\t\t\tschema,\n\t\t\t\tchain: chain.length > 0 ? chain : DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t\t\t...tokenField !== void 0 ? { tokenField } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction staticCredential(key, schema) {\n\treturn createRef(\"api_key\", key, schema instanceof z.ZodType ? schema : z.object(schema));\n}\nfunction oauthCredential(key, options) {\n\tconst tokenField = options?.tokenField ?? \"accessToken\";\n\treturn createRef(\"oauth_managed\", key, tokenField === \"accessToken\" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });\n}\nconst credential = {\n\tstatic: staticCredential,\n\toauth: oauthCredential\n};\nfunction defineCredential(input) {\n\tif (input.kind === \"oauth\") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);\n\tif (\"schema\" in input) return credential.static(input.key, input.schema);\n\treturn credential.static(input.key, input.fields);\n}\nfunction normalizeCredentialList(list) {\n\treturn list.map((item) => toCredentialRequirement(item));\n}\nfunction isCredentialRequirement(item) {\n\treturn \"chain\" in item;\n}\nfunction toCredentialRequirement(item) {\n\tif (isCredentialRequirement(item)) return item;\n\treturn {\n\t\tkey: item.key,\n\t\tkind: item.kind,\n\t\tschema: item.schema,\n\t\tchain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}\n\t};\n}\n//#endregion\n//#region src/schemas/organizations.ts\n/** Canonical copy for slug collision errors (API + UI). */\nconst ORGANIZATION_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst PROJECT_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst OrganizationSlugErrorCodeSchema = z.enum([\n\t\"slug_taken\",\n\t\"slug_reserved\",\n\t\"slug_invalid\"\n]);\nconst SlugAvailabilityReasonSchema = z.enum([\n\t\"taken\",\n\t\"reserved\",\n\t\"invalid\"\n]);\nconst SlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: SlugAvailabilityReasonSchema.optional(),\n\tsuggestion: OrganizationSlugSchema.optional()\n});\nconst SlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeOrganizationId: z.string().min(1).optional()\n});\nconst ProjectSlugAvailabilityReasonSchema = z.enum([\"taken\", \"invalid\"]);\nconst ProjectSlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: ProjectSlugAvailabilityReasonSchema.optional(),\n\tsuggestion: ProjectSlugSchema.optional()\n});\nconst ProjectSlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeProjectId: z.string().min(1).optional()\n});\n/** Client-side instant validation before hitting the project slug availability endpoint. */\nfunction validateProjectSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst parsed = ProjectSlugSchema.safeParse(normalized);\n\tif (!parsed.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: parsed.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\treturn { valid: true };\n}\n/** Client-side instant validation before hitting the availability endpoint. */\nfunction validateClaimableOrganizationSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst format = OrganizationSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: format.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\tif (RESERVED_ORGANIZATION_SLUGS.has(format.data)) return {\n\t\tvalid: false,\n\t\treason: \"reserved\",\n\t\tmessage: \"This slug is reserved\"\n\t};\n\treturn { valid: true };\n}\nfunction organizationSlugErrorCodeFromMessage(message) {\n\tif (message === \"That slug is already taken.\" || /already taken/i.test(message)) return \"slug_taken\";\n\tif (/reserved/i.test(message)) return \"slug_reserved\";\n\treturn \"slug_invalid\";\n}\nconst ProjectStatusSchema = z.enum([\n\t\"inactive\",\n\t\"starting\",\n\t\"active\",\n\t\"failed\"\n]);\nconst OrganizationUserRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst isoDateTime$5 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\n\tslug: ProjectSlugSchema,\n\tdescription: z.string().nullable(),\n\tstatus: ProjectStatusSchema,\n\tbaseUrl: z.string().nullable(),\n\truntimeId: z.string().nullable(),\n\tlastError: z.string().nullable(),\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst UserOrganizationSchema = z.object({\n\torganization: OrganizationSchema,\n\trole: OrganizationUserRoleSchema\n});\nconst CurrentOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema.nullable() });\nconst ActiveOrganizationResponseSchema = CurrentOrganizationResponseSchema;\nconst ListOrganizationsResponseSchema = z.object({ organizations: z.array(UserOrganizationSchema) });\nconst CreateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\t/** Format-only at the wire boundary; reserved-name checks run in platform-database. */\n\tslug: OrganizationSlugSchema.optional()\n});\nconst UpdateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tslug: ClaimableOrganizationSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst ProjectListMetricsSchema = z.object({\n\tagentCount: z.number(),\n\tworkflowCount: z.number(),\n\tskillCount: z.number(),\n\tcredentialCount: z.number(),\n\tlastDeploymentAt: isoDateTime$5.nullable()\n});\nconst ListProjectMetricsResponseSchema = z.object({ metrics: z.record(z.string(), ProjectListMetricsSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\nconst UpdateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tdescription: z.string().trim().optional(),\n\tslug: ProjectSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectReachabilityResponseSchema = z.object({ reachable: z.boolean() });\nfunction parseCreateOrganizationRequest(input) {\n\treturn CreateOrganizationRequestSchema.parse(input);\n}\n//#endregion\n//#region src/schemas/errors/schema.ts\nconst ValidationErrorDetailSchema = z.object({\n\tpath: z.string(),\n\tmessage: z.string()\n});\n/** Machine-readable codes returned in standard API error bodies. */\nconst ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([\"needs_org_selection\"]));\n/** Standard JSON error body returned by the HTTP API. */\nconst ErrorResponseSchema = z.object({\n\terror: z.string(),\n\tcode: ErrorResponseCodeSchema.optional(),\n\tmessage: z.string().optional(),\n\tdetails: z.array(ValidationErrorDetailSchema).optional()\n});\n//#endregion\n//#region src/schemas/errors/from-zod.ts\n/** Build the JSON body for HTTP 400 validation failures. */\nfunction validationErrorResponse(error, summary) {\n\treturn {\n\t\terror: summary,\n\t\tdetails: error.issues.map((issue) => ({\n\t\t\tpath: issue.path.join(\".\"),\n\t\t\tmessage: issue.message\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/schemas/errors/parse.ts\nconst MessageOnlyErrorBodySchema = z.object({ message: z.string() });\n/** Parse a JSON error body from the API. */\nfunction parseErrorResponse(body) {\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\tif (parsed.success) return parsed.data;\n\tconst messageOnly = MessageOnlyErrorBodySchema.safeParse(body);\n\tif (messageOnly.success) return {\n\t\terror: messageOnly.data.message,\n\t\tmessage: messageOnly.data.message\n\t};\n}\n//#endregion\n//#region src/schemas/http.ts\nconst CredentialRunContextSchema = z.object({\n\torgId: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tuserId: z.string().min(1).optional(),\n\tuserIds: z.record(z.string(), z.string()).optional(),\n\tselection: z.record(z.string(), z.string()).optional()\n});\nconst ThinkingLevelSchema = z.enum([\n\t\"off\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\"\n]);\nconst PromptInputSchema = z.object({\n\tmessage: z.string().min(1),\n\tsessionId: z.string().min(1).optional(),\n\tsubscriptionId: z.string().min(1).optional(),\n\tcontext: CredentialRunContextSchema.optional(),\n\tthinkingLevel: ThinkingLevelSchema.optional()\n});\nconst PromptResponseSchema = z.object({\n\tsessionId: z.string(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\terror: z.string().nullable()\n});\nconst SkipResponseSchema = z.object({\n\tok: z.literal(true),\n\tskipped: z.literal(true)\n});\nconst HealthResponseSchema = z.object({ ok: z.literal(true) });\nconst PlatformInfoResponseSchema = z.object({ service: z.string() });\nconst ConnectProviderSchema = z.object({\n\tkey: z.string(),\n\tmode: z.enum([\"authorize-url\", \"browser-redirect\"]),\n\tpath: z.string(),\n\trequiresAuth: z.boolean()\n});\nconst ConnectProvidersResponseSchema = z.object({ providers: z.array(ConnectProviderSchema) });\nconst ConnectAuthorizeUrlResponseSchema = z.object({ url: z.string() });\nconst QueuedRunResponseSchema = z.object({ runId: z.string() });\nconst QueuedAgentPromptResponseSchema = z.object({ sessionId: z.string() });\nfunction parsePromptInput(input) {\n\treturn PromptInputSchema.parse(input);\n}\nconst PollRunRequestSchema = z.object({\n\tworkflows: z.array(z.string().min(1)).optional(),\n\tattachments: z.array(z.string().min(1)).optional()\n});\nconst PollAttachmentResultSchema = z.object({\n\tattachmentKey: z.string(),\n\tworkflowKey: z.string(),\n\trunId: z.string().optional(),\n\tbody: z.unknown().optional(),\n\tqueued: z.boolean(),\n\tskipped: z.boolean().optional()\n});\nconst PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });\nconst PollRunResponseSchema = z.union([\n\tz.record(z.string(), z.unknown()),\n\tPollRunMultiResponseSchema,\n\tSkipResponseSchema,\n\tz.object({ runId: z.string() })\n]);\nfunction parsePollRunRequest(body) {\n\tif (body === void 0 || body === null) return {};\n\treturn PollRunRequestSchema.parse(body);\n}\n//#endregion\n//#region src/schemas/runs.ts\nconst RunSourceKindSchema = z.enum([\n\t\"api\",\n\t\"trigger\",\n\t\"gateway\",\n\t\"workflow\",\n\t\"agent\"\n]);\nconst RunSourceSchema = z.object({\n\tkind: RunSourceKindSchema,\n\tid: z.string().nullable()\n});\n//#endregion\n//#region src/schemas/workflow-runs.ts\nconst WorkflowRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst WorkflowRunTriggerSchema = z.enum([\n\t\"api\",\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\",\n\t\"retry\"\n]);\n/**\n* Durable workflow event-log entry types. Shared so the persistence layer\n* (`@keystrokehq/database` schema) and the runtime-agnostic replay engine\n* (`@keystrokehq/workflow`) reference one definition instead of duplicating it.\n*/\nconst WorkflowEventTypeSchema = z.enum([\n\t\"run_started\",\n\t\"step_completed\",\n\t\"step_failed\",\n\t\"step_retrying\",\n\t\"sleep_scheduled\",\n\t\"sleep_completed\",\n\t\"hook_created\",\n\t\"hook_resumed\",\n\t\"run_completed\",\n\t\"run_failed\",\n\t\"run_canceled\"\n]);\nconst WorkflowRunSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable()\n});\nconst WorkflowRunRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowSlug: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable(),\n\tparentWorkflowRunId: z.string().nullable(),\n\tparentSpanId: z.string().nullable(),\n\tinput: z.unknown().nullable(),\n\toutput: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst WorkflowRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: WorkflowRunStatusSchema.optional(),\n\ttrigger: WorkflowRunTriggerSchema.optional()\n});\nconst WorkflowRunListResponseSchema = z.object({\n\titems: z.array(WorkflowRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst WorkflowRunDetailIncludeSchema = z.enum([\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n]);\nconst WorkflowRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$2 = [\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n];\nfunction parseWorkflowRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$2];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => WorkflowRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$2];\n}\nconst TriggerRunDetailSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable(),\n\ttriggerType: z.enum([\n\t\t\"cron\",\n\t\t\"webhook\",\n\t\t\"poll\"\n\t]),\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst WorkflowStepRunSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst TraceTriggerSummarySchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowSlug: z.string().optional(),\n\tagentSlug: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentSlug: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst TraceGatewaySummarySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst TraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst TraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst TraceResponseSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: TraceTriggerSummarySchema,\n\tgateway: TraceGatewaySummarySchema,\n\tspans: z.array(TraceSpanSchema),\n\tlogs: z.array(TraceLogSchema)\n});\nconst WorkflowRunDetailResponseSchema = z.object({\n\trun: WorkflowRunRecordSchema,\n\ttrigger: TriggerRunDetailSchema.nullable(),\n\tsteps: z.array(WorkflowStepRunSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/agent-sessions.ts\nconst AgentSessionStatusSchema = z.enum([\n\t\"running\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst AgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tmessageCount: z.number()\n});\nconst AgentSessionRecordSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tmessageCount: z.number(),\n\terror: z.unknown().nullable()\n});\nconst AgentSessionListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: AgentSessionStatusSchema.optional(),\n\tsource: RunSourceKindSchema.optional()\n});\nconst AgentSessionListResponseSchema = z.object({\n\titems: z.array(AgentSessionSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst AgentSessionDetailIncludeSchema = z.enum([\n\t\"gateway\",\n\t\"messages\",\n\t\"events\",\n\t\"trace\"\n]);\nconst AgentSessionDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$1 = [\n\t\"gateway\",\n\t\"messages\",\n\t\"trace\"\n];\nfunction parseAgentSessionDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$1];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => AgentSessionDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$1];\n}\nconst GatewaySessionDetailSchema = z.object({\n\tthreadId: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable()\n});\nconst AgentEventSchema = z.object({\n\tid: z.string(),\n\tsessionId: z.string(),\n\tseq: z.number(),\n\teventType: z.string(),\n\tpayload: z.unknown(),\n\tcreatedAt: z.string()\n});\nconst AgentSessionDetailResponseSchema = z.object({\n\tsession: AgentSessionRecordSchema,\n\tgateway: GatewaySessionDetailSchema.nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\tevents: z.array(AgentEventSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/gateway-attachments.ts\nconst SlackGatewayModeSchema = z.enum([\n\t\"mention\",\n\t\"channel\",\n\t\"dm\"\n]);\nconst GatewayAttachmentSourceSchema = z.object({\n\tkind: z.literal(\"slack\"),\n\tmode: SlackGatewayModeSchema,\n\tcredentialKey: z.string(),\n\tchannelIds: z.array(z.string()).optional(),\n\tsubscribeOnMention: z.boolean()\n});\nconst GatewayAttachmentRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tagentKey: z.string(),\n\tchannelId: z.string(),\n\tteamId: z.string().nullable().optional(),\n\tplatform: z.string(),\n\tsource: GatewayAttachmentSourceSchema,\n\tregisteredAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst GatewayAttachmentListResponseSchema = z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });\nconst UpsertGatewayAttachmentBodySchema = z.object({\n\tagentKey: z.string().min(1),\n\tteamId: z.string().min(1).optional(),\n\tmode: SlackGatewayModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst AgentListItemSchema = z.object({\n\tkey: z.string(),\n\tname: z.string().optional(),\n\troute: z.string()\n});\nconst AgentListResponseSchema = z.object({ agents: z.array(AgentListItemSchema) });\n//#endregion\n//#region src/schemas/history.ts\nconst HistoryRunKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst HistoryRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst HistoryRunActorSchema = z.object({\n\tuserId: z.string(),\n\tname: z.string(),\n\tavatarUrl: z.string().nullable().optional()\n});\nconst HistoryRunUsageLineItemSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\tamountUsd: z.number()\n});\nconst HistoryRunUsageSchema = z.object({\n\trunDurationMs: z.number().nullable(),\n\tlineItems: z.array(HistoryRunUsageLineItemSchema),\n\ttotalExcludingDurationUsd: z.number().nullable()\n});\nconst HistoryRunSchema = z.object({\n\tid: z.string(),\n\tkind: HistoryRunKindSchema,\n\ttraceId: z.string().nullable(),\n\tprojectId: z.string(),\n\tprojectName: z.string(),\n\tresourceKey: z.string(),\n\tresourceId: z.string(),\n\tresourceName: z.string(),\n\tstatus: HistoryRunStatusSchema,\n\ttriggeredAt: z.string(),\n\ttimeInQueueMs: z.number().nullable(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tdurationMs: z.number().nullable(),\n\ttriggerLabel: z.string(),\n\ttriggerRaw: z.string(),\n\tranAs: HistoryRunActorSchema.nullable(),\n\tmodelsUsed: z.array(z.string()),\n\totherServicesUsed: z.array(z.string()),\n\ttotalCostUsd: z.number().nullable(),\n\tmessageCount: z.number().optional(),\n\tstepCount: z.number().optional()\n});\nconst HistoryTraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst HistoryTraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst HistoryTraceTriggerSchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentKey: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst HistoryTraceGatewaySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst HistoryTraceSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: HistoryTraceTriggerSchema,\n\tgateway: HistoryTraceGatewaySchema,\n\tspans: z.array(HistoryTraceSpanSchema),\n\tlogs: z.array(HistoryTraceLogSchema)\n});\nconst HistoryWorkflowStepSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst HistoryWorkflowRunDetailSchema = z.object({\n\tkind: z.literal(\"workflow\"),\n\trun: z.object({\n\t\tid: z.string(),\n\t\tworkflowKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\ttrigger: z.string(),\n\t\ttriggeredAt: z.string(),\n\t\tstartedAt: z.string().nullable(),\n\t\tfinishedAt: z.string().nullable(),\n\t\tinput: z.unknown().nullable(),\n\t\toutput: z.unknown().nullable(),\n\t\terror: z.unknown().nullable()\n\t}),\n\ttrigger: z.object({\n\t\tid: z.string(),\n\t\tattachmentKey: z.string().nullable(),\n\t\ttriggerType: z.string(),\n\t\tsourcePath: z.string().nullable(),\n\t\tpayload: z.unknown().nullable(),\n\t\ttriggeredAt: z.string()\n\t}).nullable(),\n\tsteps: z.array(HistoryWorkflowStepSchema),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryAgentSessionDetailSchema = z.object({\n\tkind: z.literal(\"agent\"),\n\tsession: z.object({\n\t\tid: z.string(),\n\t\tagentKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\tsource: z.enum([\n\t\t\t\"api\",\n\t\t\t\"gateway\",\n\t\t\t\"trigger\",\n\t\t\t\"workflow\",\n\t\t\t\"agent\"\n\t\t]),\n\t\tsourceId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tmessageCount: z.number(),\n\t\terror: z.unknown().nullable()\n\t}),\n\tgateway: z.object({\n\t\tthreadId: z.string(),\n\t\tattachmentKey: z.string().nullable()\n\t}).nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryRunDetailSchema = z.discriminatedUnion(\"kind\", [HistoryWorkflowRunDetailSchema, HistoryAgentSessionDetailSchema]);\nconst HistoryRunListQuerySchema = z.object({\n\tproject: z.string().min(1).optional(),\n\tstatus: HistoryRunStatusSchema.optional(),\n\tkind: HistoryRunKindSchema.optional()\n});\nconst HistoryRunListResponseSchema = z.array(HistoryRunSchema);\nconst HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();\nconst HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();\n//#endregion\n//#region src/schemas/workflow-deployments.ts\nconst WorkflowSubscriptionRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tuserId: z.string(),\n\tenabled: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst WorkflowSubscriptionListResponseSchema = z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });\nconst UpsertWorkflowSubscriptionBodySchema = z.object({\n\tuserId: z.string().min(1).optional(),\n\tenabled: z.boolean().optional()\n});\nconst CredentialInstanceRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable(),\n\tlabel: z.string().nullable(),\n\tisDefault: z.boolean(),\n\tauthKind: CredentialAuthKindSchema\n});\nconst CredentialInstanceListResponseSchema = z.object({ instances: z.array(CredentialInstanceRecordSchema) });\nconst CreateCredentialInstanceBodySchema = z.object({\n\tkey: z.string().min(1),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable().optional(),\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" })\n});\nconst UpdateCredentialInstanceBodySchema = z.object({\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" }).optional()\n});\n//#endregion\n//#region src/schemas/trigger-runs.ts\nconst TriggerRunTypeSchema = z.enum([\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\"\n]);\nconst TriggerRunWorkflowSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\tworkflowSlug: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunSummarySchema = z.object({\n\tid: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\ttriggeredAt: z.string(),\n\tsourcePath: z.string().nullable(),\n\tworkflowRun: TriggerRunWorkflowSummarySchema.nullable(),\n\tagentSession: TriggerRunAgentSessionSummarySchema.nullable()\n});\nconst TriggerRunRecordSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst TriggerRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\ttriggerType: TriggerRunTypeSchema.optional()\n});\nconst TriggerRunListResponseSchema = z.object({\n\titems: z.array(TriggerRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst TriggerRunDetailIncludeSchema = z.enum([\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n]);\nconst TriggerRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE = [\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n];\nfunction parseTriggerRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => TriggerRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE];\n}\nconst TriggerRunAgentSessionDetailSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunDetailResponseSchema = z.object({\n\trun: TriggerRunRecordSchema,\n\tworkflowRuns: z.array(WorkflowRunSummarySchema),\n\tagentSessions: z.array(TriggerRunAgentSessionDetailSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/triggers.ts\nconst TriggerTypeSchema = z.enum([\n\t\"webhook\",\n\t\"poll\",\n\t\"cron\"\n]);\nconst TriggerTargetKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst TriggerListItemSchema = z.object({\n\tkey: z.string(),\n\ttype: TriggerTypeSchema,\n\troute: z.string().optional(),\n\twebhookUrl: z.string().url().optional(),\n\ttargetKind: TriggerTargetKindSchema,\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional()\n});\nconst TriggerListResponseSchema = z.object({ triggers: z.array(TriggerListItemSchema) });\nconst TriggerListQuerySchema = z.object({ endpoint: z.string().min(1).optional() });\nconst TriggerDetailResponseSchema = TriggerListItemSchema;\n//#endregion\n//#region src/schemas/members.ts\nconst OrganizationMemberRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst OrganizationMemberStatusSchema = z.enum([\n\t\"invited\",\n\t\"active\",\n\t\"rejected\",\n\t\"suspended\"\n]);\nconst InvitableOrganizationMemberRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst isoDateTime$4 = z.string().datetime();\nconst OrganizationMemberSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: OrganizationMemberRoleSchema,\n\tstatus: OrganizationMemberStatusSchema,\n\tavatarUrl: z.string().optional(),\n\tjoinedAt: isoDateTime$4.optional(),\n\tlastActiveAt: isoDateTime$4.nullable().optional()\n});\nconst ListOrganizationMembersResponseSchema = z.object({ members: z.array(OrganizationMemberSchema) });\nconst InviteOrganizationMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: InvitableOrganizationMemberRoleSchema\n});\nconst InviteOrganizationMemberResultStatusSchema = z.enum([\n\t\"sent\",\n\t\"already_member\",\n\t\"pending\",\n\t\"invalid\"\n]);\nconst InviteOrganizationMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteOrganizationMemberResultStatusSchema,\n\tinvitationId: z.string().optional()\n});\nconst InviteOrganizationMembersResponseSchema = z.object({ results: z.array(InviteOrganizationMemberResultSchema) });\nconst UpdateOrganizationMemberRequestSchema = z.object({ role: InvitableOrganizationMemberRoleSchema });\nconst UpdateOrganizationMemberResponseSchema = z.object({ member: OrganizationMemberSchema });\nconst OrganizationInvitationSchema = z.object({\n\tid: z.string(),\n\torganizationName: z.string(),\n\torganizationSlug: OrganizationSlugSchema,\n\tinvitedByName: z.string().optional(),\n\tinvitedByEmail: z.string().email().optional(),\n\trole: OrganizationMemberRoleSchema\n});\nconst ListOrganizationInvitationsResponseSchema = z.object({ invitations: z.array(OrganizationInvitationSchema) });\nconst AcceptOrganizationInvitationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst DeclineOrganizationInvitationResponseSchema = z.object({ success: z.literal(true) });\n/** Web path to auto-accept an invitation after sign-in (used in invite emails). */\nfunction organizationInvitationAcceptPath(invitationId) {\n\treturn `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;\n}\n//#endregion\n//#region src/schemas/api-keys.ts\nconst isoDateTime$3 = z.string().datetime();\nconst ApiKeyCreatorSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email().optional(),\n\tavatarUrl: z.string().optional(),\n\t/** True when the creator user row no longer exists. */\n\tdeleted: z.boolean().optional()\n});\nconst ApiKeySummarySchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tkeyPreview: z.string(),\n\tcreatedAt: isoDateTime$3,\n\tcreatedBy: ApiKeyCreatorSchema,\n\tisCreatedByCurrentUser: z.boolean()\n});\nconst ListApiKeysResponseSchema = z.object({ apiKeys: z.array(ApiKeySummarySchema) });\nconst CreateApiKeyRequestSchema = z.object({ name: z.string().trim().min(1).max(128) });\nconst CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: z.string() });\n//#endregion\n//#region src/schemas/project-members.ts\nconst ProjectUserRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst ProjectInvitePermissionSchema = z.enum([\"admin\", \"all\"]);\nconst ProjectMemberStatusSchema = z.enum([\"active\", \"invited\"]);\nconst isoDateTime$2 = z.string().datetime();\nconst ProjectMemberSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: ProjectUserRoleSchema,\n\tstatus: ProjectMemberStatusSchema,\n\timage: z.string().nullable(),\n\tcreatedAt: isoDateTime$2,\n\tisCurrentUser: z.boolean().optional()\n});\nconst ListProjectMembersResponseSchema = z.object({ members: z.array(ProjectMemberSchema) });\nconst InviteProjectMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: ProjectUserRoleSchema\n});\nconst InviteProjectMemberResultStatusSchema = z.enum([\n\t\"added\",\n\t\"already_member\",\n\t\"not_org_member\",\n\t\"invalid\"\n]);\nconst InviteProjectMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteProjectMemberResultStatusSchema\n});\nconst InviteProjectMembersResponseSchema = z.object({ results: z.array(InviteProjectMemberResultSchema) });\nconst UpdateProjectMemberRequestSchema = z.object({ role: ProjectUserRoleSchema });\nconst UpdateProjectMemberResponseSchema = z.object({ member: ProjectMemberSchema });\nconst ProjectSettingsSchema = z.object({\n\tdescription: z.string(),\n\tdefaultRole: ProjectUserRoleSchema,\n\tinvitePermission: ProjectInvitePermissionSchema\n});\nconst UpdateProjectSettingsRequestSchema = z.object({\n\tdescription: z.string().optional(),\n\tdefaultRole: ProjectUserRoleSchema.optional(),\n\tinvitePermission: ProjectInvitePermissionSchema.optional()\n}).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: \"At least one field is required\" });\nconst ProjectSettingsResponseSchema = z.object({ settings: ProjectSettingsSchema });\n//#endregion\n//#region src/schemas/user-avatar.ts\n/** Custom avatar override; null means fall back to OAuth `users.image`. */\nconst UserAvatarSchema = z.object({ url: z.url().nullable() });\nconst UserAvatarPatchSchema = z.object({ \n/** Storage key returned from presign; null removes the custom override. */\nstorageKey: z.string().min(1).nullable() });\nconst PresignUserAvatarRequestSchema = z.object({ contentType: z.string().trim().min(1) });\nconst PresignUserAvatarResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\n//#endregion\n//#region src/schemas/user-preferences.ts\nconst UserInterfaceThemeSchema = z.enum([\n\t\"system\",\n\t\"light\",\n\t\"dark\"\n]);\nconst UserSurfaceContrastSchema = z.enum([\"off\", \"on\"]);\nconst UserWorkspaceLayoutModeSchema = z.enum([\"default\", \"linear\"]);\nconst UserWorkspaceFontSizeSchema = z.enum([\"default\", \"large\"]);\nconst UserSidebarNavIconVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserSidebarFooterChatRowVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserWorkspaceFavoriteKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\",\n\t\"run\"\n]);\nconst UserWorkspaceFavoriteSchema = z.object({\n\tkind: UserWorkspaceFavoriteKindSchema,\n\tresourceId: z.string().min(1)\n});\nconst UserSidebarPreferencesSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema,\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,\n\thiddenNavItemIds: z.array(z.string()),\n\ttopNavItemOrderIds: z.array(z.string()),\n\tworkspaceNavItemOrderIds: z.array(z.string())\n});\nconst UserPreferencesSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema,\n\tsurfaceContrast: UserSurfaceContrastSchema,\n\tlayoutMode: UserWorkspaceLayoutModeSchema,\n\tfontSize: UserWorkspaceFontSizeSchema,\n\tsidebar: UserSidebarPreferencesSchema,\n\tfavorites: z.array(UserWorkspaceFavoriteSchema),\n\tprojectOrderIds: z.array(z.string()),\n\tprojectDotColors: z.record(z.string(), z.string()),\n\tonboardingTabVisible: z.boolean()\n});\nconst UserSidebarPreferencesPatchSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),\n\thiddenNavItemIds: z.array(z.string()).optional(),\n\ttopNavItemOrderIds: z.array(z.string()).optional(),\n\tworkspaceNavItemOrderIds: z.array(z.string()).optional()\n});\nconst UserPreferencesPatchSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema.optional(),\n\tsurfaceContrast: UserSurfaceContrastSchema.optional(),\n\tlayoutMode: UserWorkspaceLayoutModeSchema.optional(),\n\tfontSize: UserWorkspaceFontSizeSchema.optional(),\n\tsidebar: UserSidebarPreferencesPatchSchema.optional(),\n\tfavorites: z.array(UserWorkspaceFavoriteSchema).optional(),\n\tprojectOrderIds: z.array(z.string()).optional(),\n\tprojectDotColors: z.record(z.string(), z.string()).optional(),\n\tonboardingTabVisible: z.boolean().optional()\n}).refine((value) => value.interfaceTheme !== void 0 || value.surfaceContrast !== void 0 || value.layoutMode !== void 0 || value.fontSize !== void 0 || value.sidebar !== void 0 || value.favorites !== void 0 || value.projectOrderIds !== void 0 || value.projectDotColors !== void 0 || value.onboardingTabVisible !== void 0, { message: \"At least one preference field is required\" });\nconst DEFAULT_USER_SIDEBAR_PREFERENCES = {\n\tnavIconVisibility: \"visible\",\n\tfooterChatRowVisibility: \"visible\",\n\thiddenNavItemIds: [\"registry\"],\n\ttopNavItemOrderIds: [],\n\tworkspaceNavItemOrderIds: []\n};\nconst DEFAULT_USER_PREFERENCES = {\n\tinterfaceTheme: \"system\",\n\tsurfaceContrast: \"on\",\n\tlayoutMode: \"linear\",\n\tfontSize: \"default\",\n\tsidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,\n\tfavorites: [],\n\tprojectOrderIds: [],\n\tprojectDotColors: {},\n\tonboardingTabVisible: true\n};\nfunction normalizeInterfaceTheme(value) {\n\tif (value === \"light\" || value === \"dark\") return value;\n\treturn \"system\";\n}\nfunction normalizeSurfaceContrast(value) {\n\treturn value === \"off\" ? \"off\" : \"on\";\n}\nfunction normalizeLayoutMode(value) {\n\treturn value === \"default\" ? \"default\" : \"linear\";\n}\nfunction normalizeFontSize(value) {\n\treturn value === \"large\" ? \"large\" : \"default\";\n}\nfunction normalizeStringList(value) {\n\tif (!Array.isArray(value)) return [];\n\treturn Array.from(new Set(value.filter((item) => typeof item === \"string\")));\n}\nfunction normalizeHiddenNavItemIds(value) {\n\tif (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;\n\treturn normalizeStringList(value);\n}\nfunction normalizeSidebarPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_SIDEBAR_PREFERENCES;\n\tconst sidebar = value;\n\treturn {\n\t\tnavIconVisibility: sidebar.navIconVisibility === \"visible\" ? \"visible\" : \"hidden\",\n\t\tfooterChatRowVisibility: sidebar.footerChatRowVisibility === \"hidden\" ? \"hidden\" : \"visible\",\n\t\thiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),\n\t\ttopNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),\n\t\tworkspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)\n\t};\n}\nfunction isWorkspaceFavoriteKind(value) {\n\treturn value === \"agent\" || value === \"workflow\" || value === \"skill\" || value === \"run\";\n}\nfunction normalizeFavorites(value) {\n\tif (!Array.isArray(value)) return [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst favorites = [];\n\tfor (const item of value) {\n\t\tif (!item || typeof item !== \"object\") continue;\n\t\tconst favorite = item;\n\t\tif (typeof favorite.kind !== \"string\" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== \"string\" || favorite.resourceId.length === 0) continue;\n\t\tconst key = `${favorite.kind}:${favorite.resourceId}`;\n\t\tif (seenKeys.has(key)) continue;\n\t\tseenKeys.add(key);\n\t\tfavorites.push({\n\t\t\tkind: favorite.kind,\n\t\t\tresourceId: favorite.resourceId\n\t\t});\n\t}\n\treturn favorites;\n}\nfunction normalizeProjectDotColors(value) {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return {};\n\treturn Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === \"string\" && typeof entry[1] === \"string\"));\n}\nfunction normalizeOnboardingTabVisible(value) {\n\treturn typeof value === \"boolean\" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;\n}\nfunction normalizeUserPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_PREFERENCES;\n\tconst preferences = value;\n\treturn UserPreferencesSchema.parse({\n\t\tinterfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),\n\t\tsurfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),\n\t\tlayoutMode: normalizeLayoutMode(preferences.layoutMode),\n\t\tfontSize: normalizeFontSize(preferences.fontSize),\n\t\tsidebar: normalizeSidebarPreferences(preferences.sidebar),\n\t\tfavorites: normalizeFavorites(preferences.favorites),\n\t\tprojectOrderIds: normalizeStringList(preferences.projectOrderIds),\n\t\tprojectDotColors: normalizeProjectDotColors(preferences.projectDotColors),\n\t\tonboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)\n\t});\n}\nfunction mergeUserPreferences(current, patch) {\n\treturn normalizeUserPreferences({\n\t\t...current,\n\t\t...patch,\n\t\tsidebar: patch.sidebar ? {\n\t\t\t...current.sidebar,\n\t\t\t...patch.sidebar\n\t\t} : current.sidebar\n\t});\n}\n//#endregion\n//#region src/schemas/organization-branding.ts\nconst OrganizationLogoVariantSchema = z.enum([\"light\", \"dark\"]);\nconst DEFAULT_LOGO_HEIGHT_PX = 20;\nconst MIN_LOGO_HEIGHT_PX = 14;\nconst MAX_LOGO_HEIGHT_PX = 32;\nconst OrganizationSidebarBrandingSchema = z.object({\n\tcustomLogoEnabled: z.boolean(),\n\tcustomLogoExplicitlyDisabled: z.boolean(),\n\tlogoLightUrl: z.url().nullable(),\n\tlogoDarkUrl: z.url().nullable(),\n\tlogoHeightPx: z.number().int().min(14).max(32)\n});\nconst OrganizationSidebarBrandingPatchSchema = z.object({\n\tcustomLogoEnabled: z.boolean().optional(),\n\tcustomLogoExplicitlyDisabled: z.boolean().optional(),\n\tlogoLightStorageKey: z.string().min(1).nullable().optional(),\n\tlogoDarkStorageKey: z.string().min(1).nullable().optional(),\n\tlogoHeightPx: z.number().int().min(14).max(32).optional()\n}).refine((value) => value.customLogoEnabled !== void 0 || value.customLogoExplicitlyDisabled !== void 0 || value.logoLightStorageKey !== void 0 || value.logoDarkStorageKey !== void 0 || value.logoHeightPx !== void 0, { message: \"At least one branding field is required\" });\nconst PresignOrgLogoRequestSchema = z.object({\n\tvariant: OrganizationLogoVariantSchema,\n\tcontentType: z.string().trim().min(1)\n});\nconst PresignOrgLogoResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\nconst DEFAULT_ORGANIZATION_SIDEBAR_BRANDING = {\n\tcustomLogoEnabled: false,\n\tcustomLogoExplicitlyDisabled: false,\n\tlogoLightUrl: null,\n\tlogoDarkUrl: null,\n\tlogoHeightPx: 20\n};\nfunction normalizeLogoUrl(value) {\n\tif (typeof value !== \"string\") return null;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"http:\" && url.protocol !== \"https:\") return null;\n\t\treturn url.toString();\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction normalizeCustomLogoEnabled(value, branding) {\n\tconst hasCustomLogo = Boolean(normalizeLogoUrl(branding.logoLightUrl) || normalizeLogoUrl(branding.logoDarkUrl));\n\tif (branding.customLogoExplicitlyDisabled === true) return false;\n\tif (typeof value === \"boolean\") return value || hasCustomLogo;\n\treturn hasCustomLogo;\n}\nfunction normalizeLogoHeightPx(value) {\n\tif (typeof value !== \"number\" || !Number.isFinite(value)) return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING.logoHeightPx;\n\treturn Math.min(32, Math.max(14, Math.round(value)));\n}\nfunction normalizeOrganizationSidebarBranding(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\tconst branding = value;\n\treturn OrganizationSidebarBrandingSchema.parse({\n\t\tcustomLogoEnabled: normalizeCustomLogoEnabled(branding.customLogoEnabled, branding),\n\t\tcustomLogoExplicitlyDisabled: branding.customLogoExplicitlyDisabled === true,\n\t\tlogoLightUrl: normalizeLogoUrl(branding.logoLightUrl),\n\t\tlogoDarkUrl: normalizeLogoUrl(branding.logoDarkUrl),\n\t\tlogoHeightPx: normalizeLogoHeightPx(branding.logoHeightPx)\n\t});\n}\nfunction mergeOrganizationSidebarBranding(current, patch) {\n\treturn normalizeOrganizationSidebarBranding({\n\t\t...current,\n\t\t...patch\n\t});\n}\n//#endregion\n//#region src/schemas/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime$1 = z.string().datetime();\nconst ProjectArtifactSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tstorageKey: z.string(),\n\tstatus: ProjectArtifactStatusSchema,\n\tcreatedAt: isoDateTime$1,\n\tupdatedAt: isoDateTime$1\n});\nconst CreateProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tuploadUrl: z.string().url(),\n\texpiresInSeconds: z.number().int().positive()\n});\nconst CompleteProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tproject: ProjectSchema\n});\nconst ProjectDeploymentSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tversion: z.number().int().positive(),\n\tdeployedBy: z.string().nullable(),\n\tdeployedByEmail: z.string().optional(),\n\tdeployedByAvatarUrl: z.string().optional(),\n\tcreatedAt: isoDateTime$1,\n\tactive: z.boolean()\n});\nconst ListProjectDeploymentsResponseSchema = z.object({ deployments: z.array(ProjectDeploymentSchema) });\n//#endregion\n//#region src/schemas/platform-resources.ts\nconst PLATFORM_RESOURCE_UNSUPPORTED_TEXT = \"Not Supported\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP = \"0000\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_COUNT = 0;\nconst optionalCount = z.number().int().nonnegative().nullable().optional();\nconst optionalTimestamp = z.string().nullable().optional();\nconst AgentSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tmodel: z.string().optional(),\n\ttoolCount: optionalCount,\n\tcredentialCount: optionalCount,\n\tlastRunAt: optionalTimestamp\n});\nconst WorkflowSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tlastRunAt: optionalTimestamp\n});\nconst SkillSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional()\n});\nconst AgentSummaryListResponseSchema = z.array(AgentSummarySchema);\nconst AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();\nconst WorkflowSummaryListResponseSchema = z.array(WorkflowSummarySchema);\nconst WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();\nconst SkillSummaryListResponseSchema = z.array(SkillSummarySchema);\nconst SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();\nconst RecentResourceKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\"\n]);\nconst RecentResourceSourceSchema = z.enum([\"owned\", \"shared\"]);\nconst RecentResourceSchema = z.object({\n\tid: z.string().min(1),\n\tresourceKind: RecentResourceKindSchema,\n\tresourceId: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().optional(),\n\tprojectId: z.string().min(1),\n\tprojectName: z.string().min(1),\n\tsourcePath: z.string().min(1).optional(),\n\tsource: RecentResourceSourceSchema,\n\tlastOpenedAt: z.string().min(1),\n\tlastModifiedAt: z.string().min(1)\n});\nconst RecentResourceListResponseSchema = z.array(RecentResourceSchema);\n//#endregion\n//#region src/schemas/project-files.ts\nconst isoDateTime = z.string().datetime();\nconst sha256Hex = z.string().regex(/^[a-f0-9]{64}$/, \"Expected a lowercase hex sha256 digest\");\n/**\n* A single entry in a deploy's file tree, as served to the dashboard. Carries\n* no contents: `id` is a stable, path-derived handle used for selection and\n* `?file=` deep links; `hash` is the content address used to fetch the bytes\n* lazily and to cache them immutably in the browser.\n*/\nconst ProjectFileSummarySchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */\nconst ProjectSourceResourceRefSchema = z.object({\n\tslug: z.string().min(1),\n\tpath: z.string().min(1)\n});\nconst ProjectSourceResourcesSchema = z.object({\n\tagents: z.array(ProjectSourceResourceRefSchema).default([]),\n\tworkflows: z.array(ProjectSourceResourceRefSchema).default([]),\n\tskills: z.array(ProjectSourceResourceRefSchema).default([])\n});\nconst emptyResources = () => ({\n\tagents: [],\n\tworkflows: [],\n\tskills: []\n});\n/** Response for the file-tree listing of a project's active deploy. */\nconst ListProjectFilesResponseSchema = z.object({\n\tartifactId: z.string().nullable(),\n\tfiles: z.array(ProjectFileSummarySchema),\n\tresources: ProjectSourceResourcesSchema.default(emptyResources())\n});\n/**\n* Raw source file as collected by the CLI at deploy time. `hash` is the content\n* address (sha256 of `contents`) used for dedup and immutable storage.\n*/\nconst ProjectSourceFileSchema = z.object({\n\tpath: z.string().min(1),\n\tcontents: z.string(),\n\thash: sha256Hex\n});\n/** A blob the CLI may need to upload, keyed by content hash. */\nconst SourceBlobRefSchema = z.object({\n\thash: sha256Hex,\n\tsize: z.number().int().nonnegative()\n});\n/** Request: ask the platform which blobs are missing and get presigned PUTs. */\nconst PresignProjectSourceRequestSchema = z.object({ blobs: z.array(SourceBlobRefSchema) });\nconst PresignedBlobUploadSchema = z.object({\n\thash: sha256Hex,\n\turl: z.string().url()\n});\n/** Response: presigned PUTs for the subset of blobs not already stored. */\nconst PresignProjectSourceResponseSchema = z.object({ uploads: z.array(PresignedBlobUploadSchema) });\n/** A file reference in a manifest upload: where the path's content lives. */\nconst ManifestFileRefSchema = z.object({\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Request body the CLI sends to finalize a deploy's source manifest. */\nconst UploadProjectSourceManifestRequestSchema = z.object({ files: z.array(ManifestFileRefSchema) });\nconst UploadProjectSourceResponseSchema = z.object({\n\tok: z.literal(true),\n\tfileCount: z.number().int().nonnegative()\n});\n/** A file entry as persisted in the stored manifest (path-derived id added). */\nconst StoredManifestFileSchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** The immutable per-deploy manifest persisted to object storage. */\nconst StoredProjectSourceManifestSchema = z.object({\n\tfiles: z.array(StoredManifestFileSchema),\n\tgeneratedAt: isoDateTime\n});\nconst LANGUAGE_BY_EXTENSION = {\n\tts: \"typescript\",\n\tmts: \"typescript\",\n\tcts: \"typescript\",\n\ttsx: \"tsx\",\n\tjs: \"javascript\",\n\tmjs: \"javascript\",\n\tcjs: \"javascript\",\n\tjsx: \"jsx\",\n\tjson: \"json\",\n\tmd: \"markdown\",\n\tmdx: \"markdown\",\n\tcss: \"css\",\n\thtml: \"html\",\n\tyml: \"yaml\",\n\tyaml: \"yaml\",\n\ttoml: \"toml\",\n\ttxt: \"text\",\n\tsh: \"shell\",\n\tenv: \"shell\"\n};\n/** Best-effort syntax-highlight hint derived from a file path's extension. */\nfunction projectFileLanguage(path) {\n\tconst base = path.split(\"/\").at(-1) ?? path;\n\treturn LANGUAGE_BY_EXTENSION[base.includes(\".\") ? (base.split(\".\").at(-1) ?? \"\").toLowerCase() : \"\"];\n}\n/** Stable, path-derived file id (used by the web for selection + deep links). */\nfunction projectFileId(path) {\n\treturn `file-${path.trim().replace(/^\\.?\\/+/, \"\").replace(/[^a-zA-Z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\").toLowerCase()}`;\n}\n//#endregion\n//#region src/mappers/organizations.ts\nfunction mapOrganization(row) {\n\treturn OrganizationSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapProject(row) {\n\treturn ProjectSchema.parse({\n\t\tid: row.id,\n\t\torganizationId: row.organizationId,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tdescription: row.description,\n\t\tstatus: row.status,\n\t\tbaseUrl: row.baseUrl,\n\t\truntimeId: row.runtimeId,\n\t\tlastError: row.lastError,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapUserOrganization(row) {\n\treturn UserOrganizationSchema.parse({\n\t\torganization: mapOrganization(row.organization),\n\t\trole: row.role\n\t});\n}\n//#endregion\n//#region src/mappers/members.ts\nfunction mapOrganizationMember(row) {\n\treturn OrganizationMemberSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\t...row.image ? { avatarUrl: row.image } : {},\n\t\tjoinedAt: row.createdAt.toISOString(),\n\t\tlastActiveAt: null\n\t});\n}\nfunction mapOrganizationInvitation(row) {\n\treturn OrganizationInvitationSchema.parse({\n\t\tid: row.id,\n\t\torganizationName: row.organizationName,\n\t\torganizationSlug: row.organizationSlug,\n\t\trole: row.role,\n\t\t...row.invitedByName ? { invitedByName: row.invitedByName } : {},\n\t\t...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}\n\t});\n}\n//#endregion\n//#region src/mappers/project-members.ts\nfunction mapProjectMember(row, options) {\n\treturn ProjectMemberSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\timage: row.image,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tisCurrentUser: options?.isCurrentUser\n\t});\n}\nfunction mapProjectSettings(row) {\n\treturn {\n\t\tdescription: row.description ?? \"\",\n\t\tdefaultRole: row.defaultMemberRole,\n\t\tinvitePermission: row.invitePermission\n\t};\n}\n//#endregion\n//#region src/mappers/project-artifacts.ts\nfunction mapProjectArtifact(row) {\n\treturn ProjectArtifactSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tstorageKey: row.storageKey,\n\t\tstatus: row.status,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\n//#endregion\n//#region src/mappers/project-deployments.ts\nfunction mapProjectDeployment(row) {\n\treturn ProjectDeploymentSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tversion: row.version,\n\t\tdeployedBy: row.deployedByName,\n\t\t...row.deployedByEmail ? { deployedByEmail: row.deployedByEmail } : {},\n\t\t...row.deployedByAvatarUrl ? { deployedByAvatarUrl: row.deployedByAvatarUrl } : {},\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tactive: row.active\n\t});\n}\n//#endregion\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, AgentSummaryDetailResponseSchema, AgentSummaryListResponseSchema, AgentSummarySchema, ApiKeyCreatorSchema, ApiKeySummarySchema, AppAuthKindSchema, AppCatalogEntrySchema, AppCredentialConnectionKindSchema, AppCredentialScopeSchema, AppCredentialSummarySchema, AppGatewaySchema, BindChannelBodySchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ChannelAccountListResponseSchema, ChannelAccountMetadataSchema, ChannelAccountSchema, ChannelBindingKindSchema, ChannelBindingSchema, ChannelCapabilitiesSchema, ChannelCardSupportSchema, ChannelConnectionListResponseSchema, ChannelConnectionSchema, ChannelDirectoryEntrySchema, ChannelDirectoryListResponseSchema, ChannelListenModeSchema, ChannelPlatformKeySchema, ChannelPlatformSchema, ChannelReactionSupportSchema, ChannelStreamingSupportSchema, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, CreateCredentialInstanceBodySchema, CreateCredentialsRequestSchema, CreateCredentialsResponseSchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CredentialTargetsFieldsSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DEFAULT_LOGO_HEIGHT_PX, DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, DEFAULT_USER_PREFERENCES, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, GetCredentialResponseSchema, HealthResponseSchema, HistoryAgentSessionDetailSchema, HistoryRunCancelResponseSchema, HistoryRunDetailResponseSchema, HistoryRunDetailSchema, HistoryRunKindSchema, HistoryRunListQuerySchema, HistoryRunListResponseSchema, HistoryRunSchema, HistoryRunStatusSchema, HistoryTraceSchema, HistoryWorkflowRunDetailSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, InviteProjectMembersRequestSchema, InviteProjectMembersResponseSchema, ListApiKeysResponseSchema, ListAppsResponseSchema, ListCredentialsResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectDeploymentsResponseSchema, ListProjectFilesResponseSchema, ListProjectMembersResponseSchema, ListProjectMetricsResponseSchema, ListProjectsResponseSchema, MAX_LOGO_HEIGHT_PX, MIN_LOGO_HEIGHT_PX, ManifestFileRefSchema, NewChannelBindingInputSchema, OAuthPermissionModeSchema, OAuthScopeOptionSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationLogoVariantSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSidebarBrandingPatchSchema, OrganizationSidebarBrandingSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PLATFORM_RESOURCE_UNSUPPORTED_COUNT, PLATFORM_RESOURCE_UNSUPPORTED_TEXT, PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PROJECT_SLUG_TAKEN_MESSAGE, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, PresignOrgLogoRequestSchema, PresignOrgLogoResponseSchema, PresignProjectSourceRequestSchema, PresignProjectSourceResponseSchema, PresignUserAvatarRequestSchema, PresignUserAvatarResponseSchema, PresignedBlobUploadSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectDeploymentSchema, ProjectFileSummarySchema, ProjectInvitePermissionSchema, ProjectListMetricsSchema, ProjectMemberSchema, ProjectMemberStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectSettingsResponseSchema, ProjectSettingsSchema, ProjectSlugAvailabilityQuerySchema, ProjectSlugAvailabilityReasonSchema, ProjectSlugAvailabilityResponseSchema, ProjectSlugSchema, ProjectSourceFileSchema, ProjectSourceResourceRefSchema, ProjectSourceResourcesSchema, ProjectStatusSchema, ProjectUserRoleSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RecentResourceKindSchema, RecentResourceListResponseSchema, RecentResourceSchema, RecentResourceSourceSchema, RunSourceKindSchema, RunSourceSchema, SkillSummaryDetailResponseSchema, SkillSummaryListResponseSchema, SkillSummarySchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, SourceBlobRefSchema, StartOAuthConnectionInputSchema, StartOAuthConnectionResultSchema, StoredManifestFileSchema, StoredProjectSourceManifestSchema, StoredRouteManifestSchema, StoredRouteManifestSkillSchema, SubmitTeamRequestRequestSchema, SubmitTeamRequestResponseSchema, TeamRequestTypeSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateChannelBindingBodySchema, UpdateCredentialInstanceBodySchema, UpdateCredentialRequestSchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpdateProjectMemberRequestSchema, UpdateProjectMemberResponseSchema, UpdateProjectRequestSchema, UpdateProjectSettingsRequestSchema, UploadProjectSourceManifestRequestSchema, UploadProjectSourceResponseSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserAvatarPatchSchema, UserAvatarSchema, UserInterfaceThemeSchema, UserOrganizationSchema, UserPreferencesPatchSchema, UserPreferencesSchema, UserSidebarFooterChatRowVisibilitySchema, UserSidebarNavIconVisibilitySchema, UserSidebarPreferencesPatchSchema, UserSidebarPreferencesSchema, UserSurfaceContrastSchema, UserWorkspaceFavoriteKindSchema, UserWorkspaceFavoriteSchema, UserWorkspaceFontSizeSchema, UserWorkspaceLayoutModeSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, WorkflowSummaryDetailResponseSchema, WorkflowSummaryListResponseSchema, WorkflowSummarySchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapProjectDeployment, mapProjectMember, mapProjectSettings, mapUserOrganization, mergeOrganizationSidebarBranding, mergeUserPreferences, normalizeCredentialList, normalizeLogoUrl, normalizeOrganizationSidebarBranding, normalizeUserPreferences, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parseProjectSlug, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, projectFileId, projectFileLanguage, slugifyOrganizationName, slugifyProjectName, toCredentialRequirement, toolParameters, validateClaimableOrganizationSlug, validateProjectSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAKA,SAAgB,OAAO,QAAQ;CAC3B,OAAOA,eAAoBC,WAAmB,MAAM;AACxD;;;ACiBA,MAAM,oBAAoB;;AAI1B,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,gBAAgB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,0BAA0B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAKA,MAAM,8BAA8B,IAAI,IAAI;CAC3C,GAAG;CACH,GAAG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