@keystrokehq/cli 0.0.165 → 0.0.167

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.
Files changed (38) hide show
  1. package/README.md +11 -0
  2. package/dist/dist-BMPry9tj.mjs +577 -0
  3. package/dist/dist-BMPry9tj.mjs.map +1 -0
  4. package/dist/dist-CegYAHE0.mjs +3 -0
  5. package/dist/{schemas-Bq8SXmZk.mjs → dist-D_0UmqFb.mjs} +2113 -6
  6. package/dist/dist-D_0UmqFb.mjs.map +1 -0
  7. package/dist/{dist-CgV0MxBq.mjs → dist-WoxxHzM6.mjs} +123 -25
  8. package/dist/dist-WoxxHzM6.mjs.map +1 -0
  9. package/dist/index.mjs +147 -37
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{maybe-auto-update-CIcDJRrg.mjs → maybe-auto-update-B03C4E8i.mjs} +2 -2
  12. package/dist/{maybe-auto-update-CIcDJRrg.mjs.map → maybe-auto-update-B03C4E8i.mjs.map} +1 -1
  13. package/dist/skills-bundle/_AGENTS.md +7 -3
  14. package/dist/skills-bundle/skills/keystroke-actions/SKILL.md +1 -1
  15. package/dist/skills-bundle/skills/keystroke-actions/references/catalog-and-imports.md +2 -3
  16. package/dist/skills-bundle/skills/keystroke-agents/references/tools-mcp-codemode.md +1 -1
  17. package/dist/skills-bundle/skills/keystroke-cli/SKILL.md +4 -2
  18. package/dist/skills-bundle/skills/keystroke-deploy/SKILL.md +92 -0
  19. package/dist/skills-bundle/skills/keystroke-deploy/references/build-and-full-deploy.md +28 -0
  20. package/dist/skills-bundle/skills/keystroke-deploy/references/filtered-deploy.md +49 -0
  21. package/dist/skills-bundle/skills/keystroke-deploy/references/wip-ignore.md +32 -0
  22. package/dist/skills-bundle/skills/keystroke-gateways/SKILL.md +5 -6
  23. package/dist/skills-bundle/skills/keystroke-gateways/references/slack-setup.md +0 -11
  24. package/dist/templates/hello-world/README.md +1 -1
  25. package/dist/templates/hello-world/keystroke.config.ts +1 -5
  26. package/dist/{version-DdbxgFWa.mjs → version-FrEOAEU7.mjs} +2 -2
  27. package/dist/{version-DdbxgFWa.mjs.map → version-FrEOAEU7.mjs.map} +1 -1
  28. package/package.json +1 -1
  29. package/dist/discovery-DV7FkTRA-JYiC_9cY.mjs +0 -71
  30. package/dist/discovery-DV7FkTRA-JYiC_9cY.mjs.map +0 -1
  31. package/dist/dist-CgV0MxBq.mjs.map +0 -1
  32. package/dist/dist-DtqmE5R_.mjs +0 -2113
  33. package/dist/dist-DtqmE5R_.mjs.map +0 -1
  34. package/dist/dist-sXdjEZpP.mjs +0 -293
  35. package/dist/dist-sXdjEZpP.mjs.map +0 -1
  36. package/dist/schemas-Bq8SXmZk.mjs.map +0 -1
  37. package/dist/walk-project-171B4cvO-DKtupJ6Z.mjs +0 -102
  38. package/dist/walk-project-171B4cvO-DKtupJ6Z.mjs.map +0 -1
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env node
2
- import { join, relative, sep } from "node:path";
3
- import { readdir, stat } from "node:fs/promises";
4
- //#region ../../packages/manifest/dist/discovery-DV7FkTRA.mjs
5
- const SOURCE_EXT = /\.(ts|mts|mjs|js)$/;
6
- const DECLARATION_FILE$1 = /\.d\.(ts|mts|cts)$/;
7
- function entryIdFromFile(rootDir, filePath, options) {
8
- if (DECLARATION_FILE$1.test(filePath)) return null;
9
- const baseName = filePath.split(sep).at(-1) ?? "";
10
- if (/\.(int\.)?test\.(ts|mts)$/.test(baseName)) return null;
11
- const segments = relative(rootDir, filePath).replace(SOURCE_EXT, "").split(sep).filter((segment) => segment.length > 0);
12
- if (segments.length === 1) return segments[0] ?? null;
13
- const last = segments.at(-1);
14
- const entryNames = new Set([options.nestedEntry]);
15
- if (options.allowIndex !== false) entryNames.add("index");
16
- if (!last || !entryNames.has(last)) return null;
17
- const id = segments.slice(0, -1).join("/");
18
- return id.length > 0 ? id : null;
19
- }
20
- const SOURCE_FILE = /\.(ts|mts|mjs|js)$/;
21
- const TEST_FILE = /\.(int\.)?test\.(ts|mts)$/;
22
- const DECLARATION_FILE = /\.d\.(ts|mts|cts)$/;
23
- const JUNK_FILE = /^\._|\.DS_Store$/;
24
- async function walkTypeScriptFiles(dir) {
25
- let names;
26
- try {
27
- names = await readdir(dir);
28
- } catch (error) {
29
- if (error.code === "ENOENT") return [];
30
- throw error;
31
- }
32
- const files = [];
33
- for (const name of names) {
34
- const path = join(dir, name);
35
- if ((await stat(path)).isDirectory()) files.push(...await walkTypeScriptFiles(path));
36
- else if (!JUNK_FILE.test(name) && SOURCE_FILE.test(name) && !DECLARATION_FILE.test(name) && !TEST_FILE.test(name)) files.push(path);
37
- }
38
- return files;
39
- }
40
- async function discoverEntries(rootDir, options) {
41
- const files = await walkTypeScriptFiles(rootDir);
42
- const byKey = /* @__PURE__ */ new Map();
43
- for (const filePath of files) {
44
- const id = entryIdFromFile(rootDir, filePath, options);
45
- if (!id) continue;
46
- const key = options.formatKey(id);
47
- const moduleFile = relative(rootDir, filePath);
48
- const existing = byKey.get(key);
49
- if (existing) throw new Error(`Duplicate ${options.duplicateLabel} ${key}: ${existing.filePath} and ${filePath}`);
50
- byKey.set(key, {
51
- key,
52
- filePath,
53
- moduleFile
54
- });
55
- }
56
- return [...byKey.values()];
57
- }
58
- async function discoverModuleFileEntries(rootDir, options) {
59
- return (await discoverEntries(rootDir, {
60
- nestedEntry: options.nestedEntry,
61
- formatKey: (id) => id,
62
- duplicateLabel: options.duplicateLabel
63
- })).filter((entry) => options.shouldDiscoverFile?.(entry.filePath) ?? true).map(({ filePath, moduleFile }) => ({
64
- filePath,
65
- moduleFile
66
- }));
67
- }
68
- //#endregion
69
- export { walkTypeScriptFiles as i, discoverModuleFileEntries as n, entryIdFromFile as r, discoverEntries as t };
70
-
71
- //# sourceMappingURL=discovery-DV7FkTRA-JYiC_9cY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discovery-DV7FkTRA-JYiC_9cY.mjs","names":[],"sources":["../../../packages/manifest/dist/discovery-DV7FkTRA.mjs"],"sourcesContent":["import { join, relative, sep } from \"node:path\";\nimport { readdir, stat } from \"node:fs/promises\";\n//#region src/discovery/entry-from-file.ts\nconst SOURCE_EXT = /\\.(ts|mts|mjs|js)$/;\nconst DECLARATION_FILE$1 = /\\.d\\.(ts|mts|cts)$/;\nfunction entryIdFromFile(rootDir, filePath, options) {\n\tif (DECLARATION_FILE$1.test(filePath)) return null;\n\tconst baseName = filePath.split(sep).at(-1) ?? \"\";\n\tif (/\\.(int\\.)?test\\.(ts|mts)$/.test(baseName)) return null;\n\tconst segments = relative(rootDir, filePath).replace(SOURCE_EXT, \"\").split(sep).filter((segment) => segment.length > 0);\n\tif (segments.length === 1) return segments[0] ?? null;\n\tconst last = segments.at(-1);\n\tconst entryNames = new Set([options.nestedEntry]);\n\tif (options.allowIndex !== false) entryNames.add(\"index\");\n\tif (!last || !entryNames.has(last)) return null;\n\tconst id = segments.slice(0, -1).join(\"/\");\n\treturn id.length > 0 ? id : null;\n}\n//#endregion\n//#region src/discovery/walk-typescript-files.ts\nconst SOURCE_FILE = /\\.(ts|mts|mjs|js)$/;\nconst TEST_FILE = /\\.(int\\.)?test\\.(ts|mts)$/;\nconst DECLARATION_FILE = /\\.d\\.(ts|mts|cts)$/;\nconst JUNK_FILE = /^\\._|\\.DS_Store$/;\nasync function walkTypeScriptFiles(dir) {\n\tlet names;\n\ttry {\n\t\tnames = await readdir(dir);\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return [];\n\t\tthrow error;\n\t}\n\tconst files = [];\n\tfor (const name of names) {\n\t\tconst path = join(dir, name);\n\t\tif ((await stat(path)).isDirectory()) files.push(...await walkTypeScriptFiles(path));\n\t\telse if (!JUNK_FILE.test(name) && SOURCE_FILE.test(name) && !DECLARATION_FILE.test(name) && !TEST_FILE.test(name)) files.push(path);\n\t}\n\treturn files;\n}\n//#endregion\n//#region src/discovery/discover-entries.ts\nasync function discoverEntries(rootDir, options) {\n\tconst files = await walkTypeScriptFiles(rootDir);\n\tconst byKey = /* @__PURE__ */ new Map();\n\tfor (const filePath of files) {\n\t\tconst id = entryIdFromFile(rootDir, filePath, options);\n\t\tif (!id) continue;\n\t\tconst key = options.formatKey(id);\n\t\tconst moduleFile = relative(rootDir, filePath);\n\t\tconst existing = byKey.get(key);\n\t\tif (existing) throw new Error(`Duplicate ${options.duplicateLabel} ${key}: ${existing.filePath} and ${filePath}`);\n\t\tbyKey.set(key, {\n\t\t\tkey,\n\t\t\tfilePath,\n\t\t\tmoduleFile\n\t\t});\n\t}\n\treturn [...byKey.values()];\n}\n//#endregion\n//#region src/discovery/discover-module-entries.ts\nasync function discoverModuleFileEntries(rootDir, options) {\n\treturn (await discoverEntries(rootDir, {\n\t\tnestedEntry: options.nestedEntry,\n\t\tformatKey: (id) => id,\n\t\tduplicateLabel: options.duplicateLabel\n\t})).filter((entry) => options.shouldDiscoverFile?.(entry.filePath) ?? true).map(({ filePath, moduleFile }) => ({\n\t\tfilePath,\n\t\tmoduleFile\n\t}));\n}\nfunction moduleFileKeyFromPath(rootDir, filePath, nestedEntry) {\n\treturn entryIdFromFile(rootDir, filePath, { nestedEntry });\n}\n//#endregion\n//#region src/discovery/validate-unique-module-keys.ts\nfunction validateUniqueModuleKeys(entries) {\n\tconst byKey = /* @__PURE__ */ new Map();\n\tfor (const entry of entries) {\n\t\tconst list = byKey.get(entry.key) ?? [];\n\t\tlist.push(entry);\n\t\tbyKey.set(entry.key, list);\n\t}\n\tfor (const [key, clashes] of byKey) {\n\t\tif (clashes.length <= 1) continue;\n\t\tconst detail = clashes.map((entry) => `${entry.kind} (${entry.filePath})`).join(\", \");\n\t\tthrow new Error(`Duplicate module key \"${key}\": ${detail}`);\n\t}\n}\n//#endregion\nexport { walkTypeScriptFiles as a, discoverEntries as i, discoverModuleFileEntries as n, entryIdFromFile as o, moduleFileKeyFromPath as r, validateUniqueModuleKeys as t };\n\n//# sourceMappingURL=discovery-DV7FkTRA.mjs.map"],"mappings":";;;;AAGA,MAAM,aAAa;AACnB,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AAM,KAAK,IAAI;CACnI;CACA,OAAO;AACR;AAGA,eAAe,gBAAgB,SAAS,SAAS;CAChD,MAAM,QAAQ,MAAM,oBAAoB,OAAO;CAC/C,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,YAAY,OAAO;EAC7B,MAAM,KAAK,gBAAgB,SAAS,UAAU,OAAO;EACrD,IAAI,CAAC,IAAI;EACT,MAAM,MAAM,QAAQ,UAAU,EAAE;EAChC,MAAM,aAAa,SAAS,SAAS,QAAQ;EAC7C,MAAM,WAAW,MAAM,IAAI,GAAG;EAC9B,IAAI,UAAU,MAAM,IAAI,MAAM,aAAa,QAAQ,eAAe,GAAG,IAAI,IAAI,SAAS,SAAS,OAAO,UAAU;EAChH,MAAM,IAAI,KAAK;GACd;GACA;GACA;EACD,CAAC;CACF;CACA,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC;AAC1B;AAGA,eAAe,0BAA0B,SAAS,SAAS;CAC1D,QAAQ,MAAM,gBAAgB,SAAS;EACtC,aAAa,QAAQ;EACrB,YAAY,OAAO;EACnB,gBAAgB,QAAQ;CACzB,CAAC,GAAG,QAAQ,UAAU,QAAQ,qBAAqB,MAAM,QAAQ,KAAK,IAAI,EAAE,KAAK,EAAE,UAAU,kBAAkB;EAC9G;EACA;CACD,EAAE;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-CgV0MxBq.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,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