@keystrokehq/cli 0.1.154 → 0.1.155

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,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-DiodbrVj.mjs";
3
- import { Ca as string, Da as datetime, Dn as ProjectArtifactIndexSchema, Ea as url, Ei as zodToStoredJsonSchema, Fi as getOpenApiJsonSchema, Ii as normalizeCredentialList, Li as requiredDisplayTextSchema, Ln as PromptResponseSchema, Oa as safeParse$1, Pi as credentialInputSchema, Ri as DEFAULT_CLOUD_PLATFORM_ORIGIN, Sa as record, Si as parseStoredRouteManifest, Ta as unknown, Wi as PublicModelsResponseSchema, _a as looseObject, aa as ZodType, an as PROJECT_MANIFEST_REL_PATH, ba as optional, bi as parseProjectManifest, ca as _null, da as boolean$1, fa as custom, ga as literal, ha as lazy, ia as ZodIssueCode, ka as NEVER, la as any, ma as intersection, oa as _enum, pa as discriminatedUnion, ra as number$1, sa as _function, ua as array, va as number, wa as union, xa as preprocess, ya as object } from "./dist-CzjQQX4X.mjs";
3
+ import { Ca as string, Da as datetime, Dn as ProjectArtifactIndexSchema, Ea as url, Ei as zodToStoredJsonSchema, Fi as getOpenApiJsonSchema, Ii as normalizeCredentialList, Li as requiredDisplayTextSchema, Ln as PromptResponseSchema, Oa as safeParse$1, Pi as credentialInputSchema, Ri as DEFAULT_CLOUD_PLATFORM_ORIGIN, Sa as record, Si as parseStoredRouteManifest, Ta as unknown, Wi as PublicModelsResponseSchema, _a as looseObject, aa as ZodType, an as PROJECT_MANIFEST_REL_PATH, ba as optional, bi as parseProjectManifest, ca as _null, da as boolean$1, fa as custom, ga as literal, ha as lazy, ia as ZodIssueCode, ka as NEVER, la as any, ma as intersection, oa as _enum, pa as discriminatedUnion, ra as number$1, sa as _function, ua as array, va as number, wa as union, xa as preprocess, ya as object } from "./dist-Cy2nsWsI.mjs";
4
4
  import "./chunk-4RUAZWKT-D60fyWAB.mjs";
5
5
  import "./chunk-SAI2SPQQ-CVRoDNs9.mjs";
6
6
  import "./chunk-WNH3HOQA-BCZUOjCJ.mjs";
@@ -46069,21 +46069,6 @@ async function importTriggerAttachments(filePath, options) {
46069
46069
  if (candidates.length === 0) return [validateImportedTriggerAttachment(void 0, filePath)];
46070
46070
  return candidates.map((candidate) => validateImportedTriggerAttachment(candidate, filePath));
46071
46071
  }
46072
- function buildWebhookBindingsByRoute(attachments, handlerOptionsFor) {
46073
- const webhookBindingsByRoute = /* @__PURE__ */ new Map();
46074
- for (const discovered of attachments) {
46075
- const source = discovered.attachment.source;
46076
- if (source.kind !== "webhook") continue;
46077
- const route = webhookRouteFromEndpoint(source.endpoint);
46078
- const bindings = webhookBindingsByRoute.get(route) ?? [];
46079
- bindings.push({
46080
- discovered,
46081
- options: handlerOptionsFor(discovered.slug)
46082
- });
46083
- webhookBindingsByRoute.set(route, bindings);
46084
- }
46085
- return webhookBindingsByRoute;
46086
- }
46087
46072
  function webhookSchemaEntriesFromBindings(bindings) {
46088
46073
  return bindings.flatMap((binding) => {
46089
46074
  const source = binding.discovered.attachment.source;
@@ -46582,26 +46567,35 @@ async function buildStoredRouteManifestForProject(projectRoot, options) {
46582
46567
  response: PromptResponseSchema
46583
46568
  });
46584
46569
  }
46570
+ const webhooksByTrigger = /* @__PURE__ */ new Map();
46585
46571
  for (const discovered of discoveredBySlug.values()) {
46586
46572
  const source = discovered.attachment.source;
46587
46573
  if (source.kind !== "webhook") continue;
46588
- const { moduleFile, sourceHash } = await sourcePaths.resolveSource("triggers", "trigger", dirs.triggersDir, discovered.filePath);
46589
- const route = webhookRouteFromEndpoint(source.endpoint);
46590
- const bindings = buildWebhookBindingsByRoute(discoveredBySlug.values(), () => ({
46591
- execution: { attachmentSlug: discovered.slug },
46592
- attachmentSlug: discovered.slug
46593
- })).get(route) ?? [{
46574
+ const triggerSlug = sourceSlugFrom(source);
46575
+ const group = webhooksByTrigger.get(triggerSlug) ?? [];
46576
+ group.push(discovered);
46577
+ webhooksByTrigger.set(triggerSlug, group);
46578
+ }
46579
+ for (const [, group] of webhooksByTrigger) {
46580
+ const first = group[0];
46581
+ const source = first.attachment.source;
46582
+ if (source.kind !== "webhook") continue;
46583
+ const { moduleFile, sourceHash } = await sourcePaths.resolveSource("triggers", "trigger", dirs.triggersDir, first.filePath);
46584
+ const bindings = group.map((discovered) => ({
46594
46585
  discovered,
46595
- options: { attachmentSlug: discovered.slug }
46596
- }];
46597
- const attachmentMeta = Object.fromEntries(bindings.map(({ discovered: row }) => {
46586
+ options: {
46587
+ execution: { attachmentSlug: discovered.slug },
46588
+ attachmentSlug: discovered.slug
46589
+ }
46590
+ }));
46591
+ const attachmentMeta = Object.fromEntries(group.map((row) => {
46598
46592
  const meta = triggerMetaFromAttachment(row.attachment);
46599
46593
  return [row.slug, meta];
46600
46594
  }));
46601
46595
  manifest.push({
46602
46596
  kind: "trigger-webhook",
46603
46597
  endpoint: source.endpoint,
46604
- attachmentIds: bindings.map(({ discovered: row }) => row.slug),
46598
+ attachmentIds: group.map((row) => row.slug),
46605
46599
  moduleFile,
46606
46600
  ...sourceHash ? { sourceHash } : {},
46607
46601
  request: webhookMatchSchemaForBindings(bindings),
@@ -46627,6 +46621,6 @@ async function emitStoredRouteManifestForProject(projectRoot) {
46627
46621
  persistModularRouteManifest(projectRoot, await buildStoredRouteManifestForProject(projectRoot));
46628
46622
  }
46629
46623
  //#endregion
46630
- export { withMcpReadClient as $, schemaToJson as A, validatePollGroups as B, integrationPackagesFingerprint as C, pollGroupRouteFromId as D, pollGroupId as E, toStoredRouteManifest as F, webhookManifestAttachmentSchemasFromBindings as G, validateTriggerAttachments as H, tryReadProjectManifest as I, workflowKeyForAttachment as J, webhookMatchSchemaForBindings as K, validateAttachmentTargets as L, sha256Bytes as M, sha256File as N, pollRouteFromSourceSlug as O, splitStoredRouteManifest as P, assertPublicHttpUrl as Q, validateImportedTriggerAttachment as R, importWorkflowDefinition as S, persistModularRouteManifest as T, validateUniqueAttachmentSlugs as U, validateProjectModules as V, validateUniqueTriggerSourceSlugs as W, attachmentSlugFromRecord as X, workflowRouteFromKey as Y, PublicHttpUrlError as Z, discoverWorkflows as _, captureException as _t, buildPollGroups as a, classifyCall as at, importAgentDefinition as b, flushTelemetry as bt, buildWebhookBindingsByRoute as c, locateWorkflow as ct, contentHashForModule as d, entryIdFromFile as dt, artifactIndexFromModules as et, countAgentCredentials as f, readKeystrokeIgnoreDirective as ft, discoverWorkflowEntries as g, alias as gt, discoverTriggerAttachments as h, walkTypeScriptFiles as ht, agentRouteFromKey as i, packDirFromDisk as it, serializeRouteManifest as j, projectActionsFingerprint as k, collectAgentAppSlugs as l, discoverEntries as lt, discoverSkillManifestEntries as m, validateUniqueModuleKeys as mt, agentKeyForAttachment as n, mapInParallelBatches as nt, buildStoredRouteManifestForProject as o, computeCallSiteIds as ot, discoverAgentEntries as p, shouldSkipKeystrokeModuleFile as pt, webhookRouteFromEndpoint as q, agentManifestEntry as r, moduleBlobRefsFromModules as rt, buildStoredRouteManifestFromContext as s, diagnoseWorkflowSource as st, actionsCatalogFingerprint as t, collectArtifactModules as tt, collectAgentToolSlugs as u, discoverModuleFileEntries as ut, emitStoredRouteManifestForProject as v, configureTelemetry as vt, isModularManifestEmitCacheHit as w, importTriggerAttachments as x, shutdownTelemetry as xt, hashDirectoryContents as y, event as yt, validateImportedWorkflowDefinition as z };
46624
+ export { artifactIndexFromModules as $, serializeRouteManifest as A, validateProjectModules as B, isModularManifestEmitCacheHit as C, pollRouteFromSourceSlug as D, pollGroupRouteFromId as E, tryReadProjectManifest as F, webhookMatchSchemaForBindings as G, validateUniqueAttachmentSlugs as H, validateAttachmentTargets as I, workflowRouteFromKey as J, webhookRouteFromEndpoint as K, validateImportedTriggerAttachment as L, sha256File as M, splitStoredRouteManifest as N, projectActionsFingerprint as O, toStoredRouteManifest as P, withMcpReadClient as Q, validateImportedWorkflowDefinition as R, integrationPackagesFingerprint as S, pollGroupId as T, validateUniqueTriggerSourceSlugs as U, validateTriggerAttachments as V, webhookManifestAttachmentSchemasFromBindings as W, PublicHttpUrlError as X, attachmentSlugFromRecord as Y, assertPublicHttpUrl as Z, emitStoredRouteManifestForProject as _, configureTelemetry as _t, buildPollGroups as a, computeCallSiteIds as at, importTriggerAttachments as b, shutdownTelemetry as bt, collectAgentAppSlugs as c, discoverEntries as ct, countAgentCredentials as d, readKeystrokeIgnoreDirective as dt, collectArtifactModules as et, discoverAgentEntries as f, shouldSkipKeystrokeModuleFile as ft, discoverWorkflows as g, captureException as gt, discoverWorkflowEntries as h, alias as ht, agentRouteFromKey as i, classifyCall as it, sha256Bytes as j, schemaToJson as k, collectAgentToolSlugs as l, discoverModuleFileEntries as lt, discoverTriggerAttachments as m, walkTypeScriptFiles as mt, agentKeyForAttachment as n, moduleBlobRefsFromModules as nt, buildStoredRouteManifestForProject as o, diagnoseWorkflowSource as ot, discoverSkillManifestEntries as p, validateUniqueModuleKeys as pt, workflowKeyForAttachment as q, agentManifestEntry as r, packDirFromDisk as rt, buildStoredRouteManifestFromContext as s, locateWorkflow as st, actionsCatalogFingerprint as t, mapInParallelBatches as tt, contentHashForModule as u, entryIdFromFile as ut, hashDirectoryContents as v, event as vt, persistModularRouteManifest as w, importWorkflowDefinition as x, importAgentDefinition as y, flushTelemetry as yt, validatePollGroups as z };
46631
46625
 
46632
- //# sourceMappingURL=dist-BvOVZp_0.mjs.map
46626
+ //# sourceMappingURL=dist-D-qnmHDz.mjs.map