@keystrokehq/cli 0.0.179 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $t as normalizeCredentialList, an as custom, cn as object, dn as toJSONSchema, ht as PromptResponseSchema, in as array, ln as string, mt as PromptInputSchema, nn as ZodType, on as discriminatedUnion, rn as _function, sn as literal, un as union, vt as ROUTE_MANIFEST_REL_PATH } from "./dist-1DXSFd_J.mjs";
2
+ import { $t as normalizeCredentialList, an as custom, cn as object, dn as toJSONSchema, ht as PromptResponseSchema, in as array, ln as string, mt as PromptInputSchema, nn as ZodType, on as discriminatedUnion, rn as _function, sn as literal, un as union, vt as ROUTE_MANIFEST_REL_PATH } from "./dist-DjfxlOWX.mjs";
3
3
  import { dirname, join, relative, sep } from "node:path";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
5
5
  import { pathToFileURL } from "node:url";
@@ -772,4 +772,4 @@ async function emitStoredRouteManifestForProject(projectRoot) {
772
772
  //#endregion
773
773
  export { webhookMatchSchemaForBindings as A, walkTypeScriptFiles as B, serializeRouteManifest as C, validateImportedTriggerAttachment as D, triggerRunsListPath as E, discoverEntries as F, discoverModuleFileEntries as I, entryIdFromFile as L, workflowRouteFromKey as M, workflowRunDetailPath as N, validateImportedWorkflowDefinition as O, workflowRunsListPath as P, readKeystrokeIgnoreDirective as R, schemaToJson as S, triggerRunDetailPath as T, importWorkflowDefinition as _, buildStoredRouteManifestForProject as a, pollGroupRouteFromId as b, countAgentCredentials as c, discoverTriggerAttachments as d, discoverWorkflowEntries as f, importTriggerAttachment as g, importAgentDefinition as h, buildPollGroups as i, webhookRouteFromEndpoint as j, webhookManifestAttachmentSchemasFromBindings as k, discoverAgentEntries as l, emitStoredRouteManifestForProject as m, agentSessionDetailPath as n, buildStoredRouteManifestFromContext as o, discoverWorkflows as p, agentSessionsListPath as r, buildWebhookBindingsByRoute as s, agentRouteFromKey as t, discoverSkillManifestEntries as u, persistStoredRouteManifest as v, toStoredRouteManifest as w, pollRouteFromKey as x, pollGroupId as y, shouldSkipKeystrokeModuleFile as z };
774
774
 
775
- //# sourceMappingURL=dist-D21WXsuv.mjs.map
775
+ //# sourceMappingURL=dist-vwoMCz6d.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-D21WXsuv.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/discovery-CWjr_liZ.mjs","../../../packages/manifest/dist/index.mjs"],"sourcesContent":["import { join, relative, sep } from \"node:path\";\nimport { readdir, stat } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\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/keystroke-ignore-directive.ts\nconst HEADER_BYTES = 2048;\nconst DIRECTIVE_RE = /@keystroke\\s+ignore(?::([a-z]+))?/;\n/** Parse `@keystroke ignore` directives from a file header snippet. */\nfunction parseKeystrokeIgnoreDirective(header) {\n\tfor (const line of header.slice(0, HEADER_BYTES).split(\"\\n\")) {\n\t\tconst trimmed = line.trim();\n\t\tif (trimmed.length === 0) continue;\n\t\tif (!isCommentLine(trimmed)) break;\n\t\tconst match = DIRECTIVE_RE.exec(trimmed);\n\t\tif (!match) continue;\n\t\tconst scope = match[1];\n\t\tif (!scope) return \"ignore\";\n\t\tif (scope === \"deploy\") return \"ignore:deploy\";\n\t\tthrow new Error(`Unknown @keystroke ignore target \"${scope}\" in directive \"@keystroke ignore:${scope}\"`);\n\t}\n\treturn null;\n}\n/** Read `@keystroke ignore` directives from the top of a module file. */\nfunction readKeystrokeIgnoreDirective(filePath) {\n\treturn parseKeystrokeIgnoreDirective(readFileSync(filePath, \"utf8\").slice(0, HEADER_BYTES));\n}\n/** Whether a discovered module file should be skipped for the given build phase. */\nfunction shouldSkipKeystrokeModuleFile(directive, phase) {\n\tif (!directive) return false;\n\tif (directive === \"ignore\") return true;\n\treturn phase === \"deploy\";\n}\nfunction isCommentLine(line) {\n\treturn line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\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 { discoverModuleFileEntries as a, walkTypeScriptFiles as c, shouldSkipKeystrokeModuleFile as i, entryIdFromFile as l, parseKeystrokeIgnoreDirective as n, moduleFileKeyFromPath as o, readKeystrokeIgnoreDirective as r, discoverEntries as s, validateUniqueModuleKeys as t };\n\n//# sourceMappingURL=discovery-CWjr_liZ.mjs.map","import { a as discoverModuleFileEntries, c as walkTypeScriptFiles, l as entryIdFromFile, o as moduleFileKeyFromPath, s as discoverEntries, t as validateUniqueModuleKeys } from \"./discovery-CWjr_liZ.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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateManifestAgent((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateImportedTriggerAttachment((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateImportedWorkflowDefinition((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(href))).default, filePath);\n}\nasync function discoverWorkflows(workflowsDir, options) {\n\tconst entries = await discoverWorkflowEntries(workflowsDir, options);\n\tconst workflows = [];\n\tfor (const entry of entries) {\n\t\tconst definition = await importWorkflowDefinition(entry.filePath, options);\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, options) {\n\tconst previousRoot = process.env.KEYSTROKE_ROOT;\n\tprocess.env.KEYSTROKE_ROOT = projectRoot;\n\tconst reload = options?.reloadModules ? { reload: true } : void 0;\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, reload);\n\t\tfor (const entry of agentEntries) {\n\t\t\tconst agent = await importAgentDefinition(entry.filePath, reload);\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, reload);\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, reload);\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":";;;;;;;AAIA,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,SAAS,gBAAgB,SAAS,UAAU,SAAS;CACpD,IAAI,mBAAmB,KAAK,QAAQ,GAAG,OAAO;CAC9C,MAAM,WAAW,SAAS,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK;CAC/C,IAAI,4BAA4B,KAAK,QAAQ,GAAG,OAAO;CACvD,MAAM,WAAW,SAAS,SAAS,QAAQ,EAAE,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,EAAE,QAAQ,YAAY,QAAQ,SAAS,CAAC;CACtH,IAAI,SAAS,WAAW,GAAG,OAAO,SAAS,MAAM;CACjD,MAAM,OAAO,SAAS,GAAG,EAAE;CAC3B,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,WAAW,CAAC;CAChD,IAAI,QAAQ,eAAe,OAAO,WAAW,IAAI,OAAO;CACxD,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,GAAG,OAAO;CAC3C,MAAM,KAAK,SAAS,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;CACzC,OAAO,GAAG,SAAS,IAAI,KAAK;AAC7B;AAGA,MAAM,cAAc;AACpB,MAAM,YAAY;AAClB,MAAM,mBAAmB;AACzB,MAAM,YAAY;AAClB,eAAe,oBAAoB,KAAK;CACvC,IAAI;CACJ,IAAI;EACH,QAAQ,MAAM,QAAQ,GAAG;CA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,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"}
1
+ {"version":3,"file":"dist-vwoMCz6d.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/discovery-CWjr_liZ.mjs","../../../packages/manifest/dist/index.mjs"],"sourcesContent":["import { join, relative, sep } from \"node:path\";\nimport { readdir, stat } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\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/keystroke-ignore-directive.ts\nconst HEADER_BYTES = 2048;\nconst DIRECTIVE_RE = /@keystroke\\s+ignore(?::([a-z]+))?/;\n/** Parse `@keystroke ignore` directives from a file header snippet. */\nfunction parseKeystrokeIgnoreDirective(header) {\n\tfor (const line of header.slice(0, HEADER_BYTES).split(\"\\n\")) {\n\t\tconst trimmed = line.trim();\n\t\tif (trimmed.length === 0) continue;\n\t\tif (!isCommentLine(trimmed)) break;\n\t\tconst match = DIRECTIVE_RE.exec(trimmed);\n\t\tif (!match) continue;\n\t\tconst scope = match[1];\n\t\tif (!scope) return \"ignore\";\n\t\tif (scope === \"deploy\") return \"ignore:deploy\";\n\t\tthrow new Error(`Unknown @keystroke ignore target \"${scope}\" in directive \"@keystroke ignore:${scope}\"`);\n\t}\n\treturn null;\n}\n/** Read `@keystroke ignore` directives from the top of a module file. */\nfunction readKeystrokeIgnoreDirective(filePath) {\n\treturn parseKeystrokeIgnoreDirective(readFileSync(filePath, \"utf8\").slice(0, HEADER_BYTES));\n}\n/** Whether a discovered module file should be skipped for the given build phase. */\nfunction shouldSkipKeystrokeModuleFile(directive, phase) {\n\tif (!directive) return false;\n\tif (directive === \"ignore\") return true;\n\treturn phase === \"deploy\";\n}\nfunction isCommentLine(line) {\n\treturn line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\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 { discoverModuleFileEntries as a, walkTypeScriptFiles as c, shouldSkipKeystrokeModuleFile as i, entryIdFromFile as l, parseKeystrokeIgnoreDirective as n, moduleFileKeyFromPath as o, readKeystrokeIgnoreDirective as r, discoverEntries as s, validateUniqueModuleKeys as t };\n\n//# sourceMappingURL=discovery-CWjr_liZ.mjs.map","import { a as discoverModuleFileEntries, c as walkTypeScriptFiles, l as entryIdFromFile, o as moduleFileKeyFromPath, s as discoverEntries, t as validateUniqueModuleKeys } from \"./discovery-CWjr_liZ.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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateManifestAgent((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateImportedTriggerAttachment((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(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, options) {\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, options);\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, options) {\n\tconst href = pathToFileURL(filePath).href;\n\treturn validateImportedWorkflowDefinition((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(href))).default, filePath);\n}\nasync function discoverWorkflows(workflowsDir, options) {\n\tconst entries = await discoverWorkflowEntries(workflowsDir, options);\n\tconst workflows = [];\n\tfor (const entry of entries) {\n\t\tconst definition = await importWorkflowDefinition(entry.filePath, options);\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, options) {\n\tconst previousRoot = process.env.KEYSTROKE_ROOT;\n\tprocess.env.KEYSTROKE_ROOT = projectRoot;\n\tconst reload = options?.reloadModules ? { reload: true } : void 0;\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, reload);\n\t\tfor (const entry of agentEntries) {\n\t\t\tconst agent = await importAgentDefinition(entry.filePath, reload);\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, reload);\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, reload);\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":";;;;;;;AAIA,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,SAAS,gBAAgB,SAAS,UAAU,SAAS;CACpD,IAAI,mBAAmB,KAAK,QAAQ,GAAG,OAAO;CAC9C,MAAM,WAAW,SAAS,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK;CAC/C,IAAI,4BAA4B,KAAK,QAAQ,GAAG,OAAO;CACvD,MAAM,WAAW,SAAS,SAAS,QAAQ,EAAE,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,EAAE,QAAQ,YAAY,QAAQ,SAAS,CAAC;CACtH,IAAI,SAAS,WAAW,GAAG,OAAO,SAAS,MAAM;CACjD,MAAM,OAAO,SAAS,GAAG,EAAE;CAC3B,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,WAAW,CAAC;CAChD,IAAI,QAAQ,eAAe,OAAO,WAAW,IAAI,OAAO;CACxD,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,GAAG,OAAO;CAC3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AqB,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,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { $ as ListProjectsResponseSchema, A as DownloadActiveProjectArtifactResponseSchema, At as TriggerRunListResponseSchema, B as InviteOrganizationMembersResponseSchema, Bt as UpdateProjectSettingsRequestSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionInputSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerDetailResponseSchema, E as CreateProjectResponseSchema, Et as SubmitTeamRequestRequestSchema, F as HistoryRunCancelResponseSchema, Ft as UpdateOrganizationMemberResponseSchema, G as ListCredentialsResponseSchema, Gt as UserAvatarSchema, H as InviteProjectMembersResponseSchema, Ht as UploadProjectSourceResponseSchema, I as HistoryRunDetailResponseSchema, It as UpdateOrganizationRequestSchema, J as ListOrganizationsResponseSchema, Jt as WorkflowRunDetailResponseSchema, K as ListOrganizationInvitationsResponseSchema, Kt as UserPreferencesPatchSchema, L as HistoryRunListQuerySchema, Lt as UpdateProjectMemberRequestSchema, M as GatewayAttachmentRecordSchema, Mt as UpdateCredentialInstanceBodySchema, N as GetCredentialResponseSchema, Nt as UpdateCredentialRequestSchema, O as CredentialInstanceRecordSchema, Ot as TriggerListResponseSchema, P as HealthResponseSchema, Pt as UpdateOrganizationMemberRequestSchema, Q as ListProjectMetricsResponseSchema, Qt as listenPortFromPublicUrl, R as HistoryRunListResponseSchema, Rt as UpdateProjectMemberResponseSchema, S as CreateOrganizationRequestSchema, St as SlugAvailabilityResponseSchema, T as CreateProjectRequestSchema, Tt as StoredRouteManifestSchema, U as ListApiKeysResponseSchema, Ut as UpsertGatewayAttachmentBodySchema, V as InviteProjectMembersRequestSchema, Vt as UploadProjectSourceManifestRequestSchema, W as ListAppsResponseSchema, Wt as UserAvatarPatchSchema, X as ListProjectFilesResponseSchema, Xt as WorkflowSummaryDetailResponseSchema, Y as ListProjectDeploymentsResponseSchema, Yt as WorkflowRunListResponseSchema, Z as ListProjectMembersResponseSchema, Zt as WorkflowSummaryListResponseSchema, _ as CreateApiKeyRequestSchema, _t as QueuedRunResponseSchema, a as AgentSessionListResponseSchema, at as PresignOrgLogoResponseSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryDetailResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarRequestSchema, d as ChannelConnectionSchema, dt as ProjectResponseSchema, et as OrganizationSidebarBrandingPatchSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSettingsResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedAgentPromptResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as PromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoRequestSchema, j as ErrorResponseSchema, jt as UpdateChannelBindingBodySchema, k as DeclineOrganizationInvitationResponseSchema, kt as TriggerRunDetailResponseSchema, l as ChannelAccountListResponseSchema, lt as PresignUserAvatarResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptInputSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceRequestSchema, p as ChannelPlatformSchema, pt as ProjectSlugAvailabilityResponseSchema, q as ListOrganizationMembersResponseSchema, qt as UserPreferencesSchema, r as ActiveOrganizationResponseSchema, rt as PollRunResponseSchema, s as AgentSummaryListResponseSchema, st as PresignProjectSourceResponseSchema, t as ACTIVE_ORG_HEADER, tn as parseErrorResponse, tt as OrganizationSidebarBrandingSchema, u as ChannelConnectionListResponseSchema, ut as ProjectReachabilityResponseSchema, v as CreateApiKeyResponseSchema, vt as ROUTE_MANIFEST_REL_PATH, w as CreateProjectArtifactResponseSchema, wt as StartOAuthConnectionResultSchema, x as CreateCredentialsResponseSchema, xt as SkillSummaryListResponseSchema, y as CreateCredentialInstanceBodySchema, yt as RecentResourceListResponseSchema, z as InviteOrganizationMembersRequestSchema, zt as UpdateProjectRequestSchema } from "./dist-1DXSFd_J.mjs";
3
- import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, h as DEFAULT_PLATFORM_URL, i as installDependencies, l as getCliConfigDir, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getServerUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-BjIz17OO.mjs";
2
+ import { $ as ListProjectsResponseSchema, A as DownloadActiveProjectArtifactResponseSchema, At as TriggerRunListResponseSchema, B as InviteOrganizationMembersResponseSchema, Bt as UpdateProjectSettingsRequestSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionInputSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerDetailResponseSchema, E as CreateProjectResponseSchema, Et as SubmitTeamRequestRequestSchema, F as HistoryRunCancelResponseSchema, Ft as UpdateOrganizationMemberResponseSchema, G as ListCredentialsResponseSchema, Gt as UserAvatarSchema, H as InviteProjectMembersResponseSchema, Ht as UploadProjectSourceResponseSchema, I as HistoryRunDetailResponseSchema, It as UpdateOrganizationRequestSchema, J as ListOrganizationsResponseSchema, Jt as WorkflowRunDetailResponseSchema, K as ListOrganizationInvitationsResponseSchema, Kt as UserPreferencesPatchSchema, L as HistoryRunListQuerySchema, Lt as UpdateProjectMemberRequestSchema, M as GatewayAttachmentRecordSchema, Mt as UpdateCredentialInstanceBodySchema, N as GetCredentialResponseSchema, Nt as UpdateCredentialRequestSchema, O as CredentialInstanceRecordSchema, Ot as TriggerListResponseSchema, P as HealthResponseSchema, Pt as UpdateOrganizationMemberRequestSchema, Q as ListProjectMetricsResponseSchema, Qt as listenPortFromPublicUrl, R as HistoryRunListResponseSchema, Rt as UpdateProjectMemberResponseSchema, S as CreateOrganizationRequestSchema, St as SlugAvailabilityResponseSchema, T as CreateProjectRequestSchema, Tt as StoredRouteManifestSchema, U as ListApiKeysResponseSchema, Ut as UpsertGatewayAttachmentBodySchema, V as InviteProjectMembersRequestSchema, Vt as UploadProjectSourceManifestRequestSchema, W as ListAppsResponseSchema, Wt as UserAvatarPatchSchema, X as ListProjectFilesResponseSchema, Xt as WorkflowSummaryDetailResponseSchema, Y as ListProjectDeploymentsResponseSchema, Yt as WorkflowRunListResponseSchema, Z as ListProjectMembersResponseSchema, Zt as WorkflowSummaryListResponseSchema, _ as CreateApiKeyRequestSchema, _t as QueuedRunResponseSchema, a as AgentSessionListResponseSchema, at as PresignOrgLogoResponseSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryDetailResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarRequestSchema, d as ChannelConnectionSchema, dt as ProjectResponseSchema, et as OrganizationSidebarBrandingPatchSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSettingsResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedAgentPromptResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as PromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoRequestSchema, j as ErrorResponseSchema, jt as UpdateChannelBindingBodySchema, k as DeclineOrganizationInvitationResponseSchema, kt as TriggerRunDetailResponseSchema, l as ChannelAccountListResponseSchema, lt as PresignUserAvatarResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptInputSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceRequestSchema, p as ChannelPlatformSchema, pt as ProjectSlugAvailabilityResponseSchema, q as ListOrganizationMembersResponseSchema, qt as UserPreferencesSchema, r as ActiveOrganizationResponseSchema, rt as PollRunResponseSchema, s as AgentSummaryListResponseSchema, st as PresignProjectSourceResponseSchema, t as ACTIVE_ORG_HEADER, tn as parseErrorResponse, tt as OrganizationSidebarBrandingSchema, u as ChannelConnectionListResponseSchema, ut as ProjectReachabilityResponseSchema, v as CreateApiKeyResponseSchema, vt as ROUTE_MANIFEST_REL_PATH, w as CreateProjectArtifactResponseSchema, wt as StartOAuthConnectionResultSchema, x as CreateCredentialsResponseSchema, xt as SkillSummaryListResponseSchema, y as CreateCredentialInstanceBodySchema, yt as RecentResourceListResponseSchema, z as InviteOrganizationMembersRequestSchema, zt as UpdateProjectRequestSchema } from "./dist-DjfxlOWX.mjs";
3
+ import { _ as resolvePlatformUrlForWebUrl, a as installPlaygroundDependencies, c as createCliConfig, d as getEffectiveApiTarget, f as getPlatformUrl, h as DEFAULT_PLATFORM_URL, i as installDependencies, l as getCliConfigDir, m as getWebUrl, n as buildPlaygroundWorkspace, o as resolvePackageManager, p as getServerUrl, s as resolveCliRoot, t as readCliVersion, u as getConfigDir } from "./version-n-JpPeUF.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { Command } from "commander";
6
6
  import { platform, tmpdir } from "node:os";
@@ -1700,7 +1700,7 @@ function createJwtTokenCache(mint) {
1700
1700
  };
1701
1701
  }
1702
1702
  //#endregion
1703
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/version.mjs
1703
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/version.mjs
1704
1704
  const PACKAGE_VERSION = "1.6.11";
1705
1705
  //#endregion
1706
1706
  //#region ../../node_modules/.pnpm/better-call@1.3.5_zod@4.4.3/node_modules/better-call/dist/error.mjs
@@ -1825,7 +1825,7 @@ var BetterAuthError = class extends Error {
1825
1825
  }
1826
1826
  };
1827
1827
  //#endregion
1828
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
1828
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
1829
1829
  const deviceAuthorizationClient = () => {
1830
1830
  return {
1831
1831
  id: "device-authorization",
@@ -1970,7 +1970,7 @@ let onMount = ($store, initialize) => {
1970
1970
  });
1971
1971
  };
1972
1972
  //#endregion
1973
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/query.mjs
1973
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/query.mjs
1974
1974
  const isServer = () => typeof window === "undefined";
1975
1975
  const useAuthQuery = (initializedAtom, path, $fetch, options) => {
1976
1976
  const value = /* @__PURE__ */ atom({
@@ -2064,7 +2064,7 @@ const useAuthQuery = (initializedAtom, path, $fetch, options) => {
2064
2064
  return value;
2065
2065
  };
2066
2066
  //#endregion
2067
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/broadcast-channel.mjs
2067
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/broadcast-channel.mjs
2068
2068
  const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
2069
2069
  const now$1 = () => Math.floor(Date.now() / 1e3);
2070
2070
  var WindowBroadcastChannel = class {
@@ -2107,7 +2107,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
2107
2107
  return globalThis[kBroadcastChannel];
2108
2108
  }
2109
2109
  //#endregion
2110
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/focus-manager.mjs
2110
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/focus-manager.mjs
2111
2111
  const kFocusManager = Symbol.for("better-auth:focus-manager");
2112
2112
  var WindowFocusManager = class {
2113
2113
  listeners = /* @__PURE__ */ new Set();
@@ -2136,7 +2136,7 @@ function getGlobalFocusManager() {
2136
2136
  return globalThis[kFocusManager];
2137
2137
  }
2138
2138
  //#endregion
2139
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/online-manager.mjs
2139
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/online-manager.mjs
2140
2140
  const kOnlineManager = Symbol.for("better-auth:online-manager");
2141
2141
  var WindowOnlineManager = class {
2142
2142
  listeners = /* @__PURE__ */ new Set();
@@ -2168,7 +2168,7 @@ function getGlobalOnlineManager() {
2168
2168
  return globalThis[kOnlineManager];
2169
2169
  }
2170
2170
  //#endregion
2171
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/parser.mjs
2171
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/parser.mjs
2172
2172
  const PROTO_POLLUTION_PATTERNS = {
2173
2173
  proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
2174
2174
  constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
@@ -2238,7 +2238,7 @@ function parseJSON(value, options = { strict: true }) {
2238
2238
  return betterJSONParse(value, options);
2239
2239
  }
2240
2240
  //#endregion
2241
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/session-refresh.mjs
2241
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/session-refresh.mjs
2242
2242
  const now = () => Math.floor(Date.now() / 1e3);
2243
2243
  /**
2244
2244
  * Normalize $fetch response: `throw: true` returns data directly, otherwise `{ data, error }`.
@@ -2436,7 +2436,7 @@ Object.freeze({
2436
2436
  }
2437
2437
  });
2438
2438
  //#endregion
2439
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/utils/url.mjs
2439
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/utils/url.mjs
2440
2440
  function checkHasPath(url) {
2441
2441
  try {
2442
2442
  return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
@@ -2508,7 +2508,7 @@ function getOrigin(url) {
2508
2508
  }
2509
2509
  }
2510
2510
  //#endregion
2511
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/fetch-plugins.mjs
2511
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/fetch-plugins.mjs
2512
2512
  const redirectPlugin = {
2513
2513
  id: "redirect",
2514
2514
  name: "Redirect",
@@ -2523,7 +2523,7 @@ const redirectPlugin = {
2523
2523
  } }
2524
2524
  };
2525
2525
  //#endregion
2526
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/session-atom.mjs
2526
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/session-atom.mjs
2527
2527
  function getSessionAtom($fetch, options) {
2528
2528
  const $signal = /* @__PURE__ */ atom(false);
2529
2529
  const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
@@ -3010,7 +3010,7 @@ var betterFetch = async (url, options) => {
3010
3010
  };
3011
3011
  };
3012
3012
  //#endregion
3013
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/config.mjs
3013
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/config.mjs
3014
3014
  const resolvePublicAuthUrl = (basePath) => {
3015
3015
  if (typeof process === "undefined") return void 0;
3016
3016
  const path = basePath ?? "/api/auth";
@@ -3108,12 +3108,12 @@ const getClientConfig = (options, loadEnv) => {
3108
3108
  };
3109
3109
  };
3110
3110
  //#endregion
3111
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/utils/is-atom.mjs
3111
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/utils/is-atom.mjs
3112
3112
  function isAtom(value) {
3113
3113
  return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
3114
3114
  }
3115
3115
  //#endregion
3116
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/proxy.mjs
3116
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/proxy.mjs
3117
3117
  function getMethod(path, knownPathMethods, args) {
3118
3118
  const method = knownPathMethods[path];
3119
3119
  const { fetchOptions, query: _query, ...body } = args || {};
@@ -3193,7 +3193,7 @@ function capitalizeFirstLetter(str) {
3193
3193
  return str.charAt(0).toUpperCase() + str.slice(1);
3194
3194
  }
3195
3195
  //#endregion
3196
- //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.25_crossws@0.4._0c1072578fd2732837c26a655dd07a9b/node_modules/better-auth/dist/client/vanilla.mjs
3196
+ //#region ../../node_modules/.pnpm/better-auth@1.6.11_@opentelemetry+api@1.9.1_@tanstack+react-start@1.168.26_crossws@0.4._648f7a3b727ed48c95c8caf5024eaef9/node_modules/better-auth/dist/client/vanilla.mjs
3197
3197
  function createAuthClient(options) {
3198
3198
  const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
3199
3199
  const resolvedHooks = {};
@@ -5476,7 +5476,7 @@ function registerBuildCommand(program) {
5476
5476
  program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
5477
5477
  try {
5478
5478
  const root = resolveProjectRoot(options.dir);
5479
- const { buildApp } = await import("./dist-_jYszAW_.mjs");
5479
+ const { buildApp } = await import("./dist-DWcRd4Se.mjs");
5480
5480
  await buildApp({ root });
5481
5481
  process.stdout.write(`Built ${root}\n`);
5482
5482
  } catch (error) {
@@ -5633,7 +5633,7 @@ async function sleep(ms) {
5633
5633
  }
5634
5634
  async function buildDeployArchive(client, root, projectId, filter) {
5635
5635
  if (filter?.length) {
5636
- const { buildFilteredApp } = await import("./dist-_jYszAW_.mjs");
5636
+ const { buildFilteredApp } = await import("./dist-DWcRd4Se.mjs");
5637
5637
  const filtered = await buildFilteredApp({
5638
5638
  root,
5639
5639
  filter,
@@ -5655,7 +5655,7 @@ async function buildDeployArchive(client, root, projectId, filter) {
5655
5655
  sourceFiles: filtered.sourceFiles
5656
5656
  };
5657
5657
  }
5658
- const { buildApp } = await import("./dist-_jYszAW_.mjs");
5658
+ const { buildApp } = await import("./dist-DWcRd4Se.mjs");
5659
5659
  const { sourceFiles } = await buildApp({
5660
5660
  root,
5661
5661
  collectSources: true,
@@ -5757,16 +5757,18 @@ function runtimeChildEnv(parentEnv, overrides) {
5757
5757
  "POSTGRES_PASSWORD",
5758
5758
  "DATABASE_SEARCH_PATH"
5759
5759
  ]) delete env[key];
5760
- if (!env.DATABASE_URL?.trim()) env.DATABASE_URL = "file:./data/dev.db";
5760
+ env.DATABASE_URL = "file:./data/public.db";
5761
+ env.KEYSTROKE_APP_MODE ??= "standalone";
5762
+ env.PROJECT_ID ??= "default";
5761
5763
  return env;
5762
5764
  }
5763
5765
  //#endregion
5764
5766
  //#region src/project/bootstrap-run.ts
5765
5767
  /** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
5766
5768
  async function resolveBootstrapRun(options) {
5767
- const { resolveRuntimeBuildArtifact } = await import("./dist-_jYszAW_.mjs");
5769
+ const { resolveRuntimeBuildArtifact } = await import("./dist-DWcRd4Se.mjs");
5768
5770
  const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
5769
- const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/bootstrap.mjs");
5771
+ const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/standalone-bootstrap.mjs");
5770
5772
  const args = [`--import=${loader}`];
5771
5773
  const envFile = join(options.root, ".env");
5772
5774
  if (existsSync(envFile)) args.push(`--env-file=${envFile}`);
@@ -5774,6 +5776,7 @@ async function resolveBootstrapRun(options) {
5774
5776
  const childEnv = runtimeChildEnv(process.env, {
5775
5777
  KEYSTROKE_ROOT: options.root,
5776
5778
  KEYSTROKE_RUNTIME_NODE_MODULES: options.runtimeNodeModules,
5779
+ KEYSTROKE_APP_MODE: "standalone",
5777
5780
  PROJECT_ID: process.env.PROJECT_ID ?? "default"
5778
5781
  });
5779
5782
  childEnv.PORT = String(listenPortFromPublicUrl(childEnv.PUBLIC_SERVER_URL, options.apiPort));
@@ -5852,15 +5855,15 @@ function ensureNativeDeps(nodeModulesRoot) {
5852
5855
  }
5853
5856
  //#endregion
5854
5857
  //#region src/runtime/resolve-runtime-node-modules.ts
5855
- /** Directory whose `node_modules/@keystrokehq/server` ships with the CLI pack. */
5858
+ /** Directory whose `node_modules/@keystrokehq/runtime` ships with the CLI pack. */
5856
5859
  function resolveCliRuntimeNodeModules(cliRoot) {
5857
5860
  let dir = cliRoot;
5858
5861
  while (dir !== dirname(dir)) {
5859
5862
  const nodeModules = join(dir, "node_modules");
5860
- if (existsSync(join(nodeModules, "@keystrokehq", "server"))) return nodeModules;
5863
+ if (existsSync(join(nodeModules, "@keystrokehq", "runtime"))) return nodeModules;
5861
5864
  dir = dirname(dir);
5862
5865
  }
5863
- throw new Error("Keystroke runtime packages are missing. Reinstall or repack the CLI (expected @keystrokehq/server in node_modules).");
5866
+ throw new Error("Keystroke runtime packages are missing. Reinstall or repack the CLI (expected @keystrokehq/runtime in node_modules).");
5864
5867
  }
5865
5868
  //#endregion
5866
5869
  //#region src/commands/dev.ts
@@ -5914,7 +5917,7 @@ async function runDev(options) {
5914
5917
  process.on("SIGINT", shutdown);
5915
5918
  process.on("SIGTERM", shutdown);
5916
5919
  try {
5917
- const { watchApp } = await import("./dist-_jYszAW_.mjs");
5920
+ const { watchApp } = await import("./dist-DWcRd4Se.mjs");
5918
5921
  await watchApp({
5919
5922
  root,
5920
5923
  clean: false,
@@ -6127,8 +6130,6 @@ function buildPlaygroundPackageJson(projectName, targetDir, monorepoRoot) {
6127
6130
  "@keystrokehq/action": linkSpec(targetDir, join(monorepoRoot, "packages/action")),
6128
6131
  "@keystrokehq/agent": linkSpec(targetDir, join(monorepoRoot, "packages/agent")),
6129
6132
  "@keystrokehq/config": linkSpec(targetDir, join(monorepoRoot, "packages/config")),
6130
- "@keystrokehq/google": linkSpec(targetDir, join(monorepoRoot, "packages/integrations/google")),
6131
- "@keystrokehq/slack": linkSpec(targetDir, join(monorepoRoot, "packages/integrations/slack")),
6132
6133
  "@keystrokehq/workflow": linkSpec(targetDir, join(monorepoRoot, "packages/workflow")),
6133
6134
  zod: INIT_CATALOG_VERSIONS.zod
6134
6135
  },
@@ -6742,7 +6743,7 @@ async function runStart(options) {
6742
6743
  const apiPort = Number(new URL(serverUrl).port || 80);
6743
6744
  const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
6744
6745
  ensureNativeDeps(runtimeNodeModules);
6745
- const { buildApp } = await import("./dist-_jYszAW_.mjs");
6746
+ const { buildApp } = await import("./dist-DWcRd4Se.mjs");
6746
6747
  await buildApp({
6747
6748
  root,
6748
6749
  clean: false
@@ -7278,7 +7279,7 @@ function createProgram() {
7278
7279
  return program;
7279
7280
  }
7280
7281
  async function runCli(argv) {
7281
- const { maybeAutoUpdate } = await import("./maybe-auto-update-xRtXTKb_.mjs");
7282
+ const { maybeAutoUpdate } = await import("./maybe-auto-update-Ou7H6dXT.mjs");
7282
7283
  await maybeAutoUpdate(argv);
7283
7284
  createProgram().parse(argv);
7284
7285
  }