@autohq/cli 0.1.153 → 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.
@@ -21194,26 +21194,52 @@ var AgentToolRefSchema = InlineAgentToolSchema;
21194
21194
  var AgentToolsSchema = external_exports.record(ToolAliasSchema, AgentToolRefSchema);
21195
21195
 
21196
21196
  // ../../packages/schemas/src/trigger-router.ts
21197
- var RouteBySchema = external_exports.discriminatedUnion("kind", [
21197
+ var CANONICAL_ROUTE_BY_KINDS = [
21198
+ "singleton",
21199
+ "ownedArtifact",
21200
+ "allLiveSessions",
21201
+ "attributedSessions"
21202
+ ];
21203
+ var LEGACY_ROUTE_BY_KINDS = ["allLiveRuns", "attributedRuns"];
21204
+ var CanonicalRouteBySchema = external_exports.discriminatedUnion("kind", [
21198
21205
  external_exports.object({
21199
- kind: external_exports.literal("singleton")
21206
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[0])
21200
21207
  }),
21201
21208
  external_exports.object({
21202
- kind: external_exports.literal("ownedArtifact"),
21209
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[1]),
21203
21210
  artifactType: external_exports.string().trim().min(1)
21204
21211
  }),
21205
21212
  external_exports.object({
21206
- kind: external_exports.literal("allLiveRuns")
21213
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[2])
21207
21214
  }),
21208
21215
  // Use attributedSessions for follow-up delivery only. Spawn triggers that can
21209
21216
  // overlap with attributed events should filter `$.auto.attributions` out.
21210
21217
  external_exports.object({
21211
- kind: external_exports.literal("attributedSessions")
21218
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[3])
21219
+ })
21220
+ ]);
21221
+ var LegacyRouteBySchema = external_exports.discriminatedUnion("kind", [
21222
+ external_exports.object({
21223
+ kind: external_exports.literal(LEGACY_ROUTE_BY_KINDS[0])
21212
21224
  }),
21213
21225
  external_exports.object({
21214
- kind: external_exports.literal("attributedRuns")
21226
+ kind: external_exports.literal(LEGACY_ROUTE_BY_KINDS[1])
21215
21227
  })
21228
+ ]).transform((routeBy) => {
21229
+ switch (routeBy.kind) {
21230
+ case "allLiveRuns":
21231
+ return { kind: "allLiveSessions" };
21232
+ case "attributedRuns":
21233
+ return { kind: "attributedSessions" };
21234
+ }
21235
+ });
21236
+ var RouteBySchema = external_exports.union([
21237
+ CanonicalRouteBySchema,
21238
+ LegacyRouteBySchema
21216
21239
  ]);
21240
+ var SingletonRouteBySchema = external_exports.object({
21241
+ kind: external_exports.literal("singleton")
21242
+ });
21217
21243
  var TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
21218
21244
  external_exports.object({
21219
21245
  kind: external_exports.literal("spawn")
@@ -21225,9 +21251,7 @@ var TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
21225
21251
  }),
21226
21252
  external_exports.object({
21227
21253
  kind: external_exports.literal("deliverOrSpawn"),
21228
- routeBy: external_exports.object({
21229
- kind: external_exports.literal("singleton")
21230
- })
21254
+ routeBy: SingletonRouteBySchema
21231
21255
  })
21232
21256
  ]);
21233
21257
  var SourceEventRequestSchema = external_exports.object({
@@ -21728,7 +21752,7 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
21728
21752
  continue;
21729
21753
  }
21730
21754
  const eventTrigger = trigger;
21731
- if (!isAttributedRunsDeliverTrigger(eventTrigger) || !isChatMessageEvent(eventTrigger)) {
21755
+ if (!isAttributedSessionsDeliverTrigger(eventTrigger) || !isChatMessageEvent(eventTrigger)) {
21732
21756
  continue;
21733
21757
  }
21734
21758
  if (hasFilterValue(eventTrigger, "$.auto.authored", false)) {
@@ -21748,7 +21772,7 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
21748
21772
  continue;
21749
21773
  }
21750
21774
  for (const [deliverIndex, deliverTrigger] of triggers.entries()) {
21751
- if (deliverTrigger.kind === "heartbeat" || !deliverTrigger.event || spawnIndex === deliverIndex || spawnTrigger.event !== deliverTrigger.event || !isAttributedRunsDeliverTrigger(deliverTrigger)) {
21775
+ if (deliverTrigger.kind === "heartbeat" || !deliverTrigger.event || spawnIndex === deliverIndex || spawnTrigger.event !== deliverTrigger.event || !isAttributedSessionsDeliverTrigger(deliverTrigger)) {
21752
21776
  continue;
21753
21777
  }
21754
21778
  if (hasAutoAttributionsExists(spawnTrigger, false) && hasAutoAttributionsExists(deliverTrigger, true)) {
@@ -21765,8 +21789,8 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
21765
21789
  function isSpawnTrigger(trigger) {
21766
21790
  return trigger.routing.kind === "spawn";
21767
21791
  }
21768
- function isAttributedRunsDeliverTrigger(trigger) {
21769
- return trigger.routing.kind === "deliver" && (trigger.routing.routeBy.kind === "attributedSessions" || trigger.routing.routeBy.kind === "attributedRuns");
21792
+ function isAttributedSessionsDeliverTrigger(trigger) {
21793
+ return trigger.routing.kind === "deliver" && trigger.routing.routeBy.kind === "attributedSessions";
21770
21794
  }
21771
21795
  function hasAutoAttributionsExists(trigger, expected) {
21772
21796
  const clause = trigger.where?.["$.auto.attributions"];
@@ -26296,7 +26320,7 @@ Object.assign(lookup, {
26296
26320
  // package.json
26297
26321
  var package_default = {
26298
26322
  name: "@autohq/cli",
26299
- version: "0.1.153",
26323
+ version: "0.1.155",
26300
26324
  license: "SEE LICENSE IN README.md",
26301
26325
  publishConfig: {
26302
26326
  access: "public"
package/dist/index.js CHANGED
@@ -17796,33 +17796,59 @@ var init_tools = __esm({
17796
17796
  });
17797
17797
 
17798
17798
  // ../../packages/schemas/src/trigger-router.ts
17799
- var RouteBySchema, TriggerRoutingSchema, SourceEventRequestSchema, EventRoutingWorkflowInputSchema, HeartbeatTickWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowResultSchema, EventRoutingTriggerResultSchema;
17799
+ var CANONICAL_ROUTE_BY_KINDS, LEGACY_ROUTE_BY_KINDS, CanonicalRouteBySchema, LegacyRouteBySchema, RouteBySchema, SingletonRouteBySchema, TriggerRoutingSchema, SourceEventRequestSchema, EventRoutingWorkflowInputSchema, HeartbeatTickWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowResultSchema, EventRoutingTriggerResultSchema;
17800
17800
  var init_trigger_router = __esm({
17801
17801
  "../../packages/schemas/src/trigger-router.ts"() {
17802
17802
  "use strict";
17803
17803
  init_zod();
17804
17804
  init_ids();
17805
17805
  init_primitives();
17806
- RouteBySchema = external_exports.discriminatedUnion("kind", [
17806
+ CANONICAL_ROUTE_BY_KINDS = [
17807
+ "singleton",
17808
+ "ownedArtifact",
17809
+ "allLiveSessions",
17810
+ "attributedSessions"
17811
+ ];
17812
+ LEGACY_ROUTE_BY_KINDS = ["allLiveRuns", "attributedRuns"];
17813
+ CanonicalRouteBySchema = external_exports.discriminatedUnion("kind", [
17807
17814
  external_exports.object({
17808
- kind: external_exports.literal("singleton")
17815
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[0])
17809
17816
  }),
17810
17817
  external_exports.object({
17811
- kind: external_exports.literal("ownedArtifact"),
17818
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[1]),
17812
17819
  artifactType: external_exports.string().trim().min(1)
17813
17820
  }),
17814
17821
  external_exports.object({
17815
- kind: external_exports.literal("allLiveRuns")
17822
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[2])
17816
17823
  }),
17817
17824
  // Use attributedSessions for follow-up delivery only. Spawn triggers that can
17818
17825
  // overlap with attributed events should filter `$.auto.attributions` out.
17819
17826
  external_exports.object({
17820
- kind: external_exports.literal("attributedSessions")
17827
+ kind: external_exports.literal(CANONICAL_ROUTE_BY_KINDS[3])
17828
+ })
17829
+ ]);
17830
+ LegacyRouteBySchema = external_exports.discriminatedUnion("kind", [
17831
+ external_exports.object({
17832
+ kind: external_exports.literal(LEGACY_ROUTE_BY_KINDS[0])
17821
17833
  }),
17822
17834
  external_exports.object({
17823
- kind: external_exports.literal("attributedRuns")
17835
+ kind: external_exports.literal(LEGACY_ROUTE_BY_KINDS[1])
17824
17836
  })
17837
+ ]).transform((routeBy) => {
17838
+ switch (routeBy.kind) {
17839
+ case "allLiveRuns":
17840
+ return { kind: "allLiveSessions" };
17841
+ case "attributedRuns":
17842
+ return { kind: "attributedSessions" };
17843
+ }
17844
+ });
17845
+ RouteBySchema = external_exports.union([
17846
+ CanonicalRouteBySchema,
17847
+ LegacyRouteBySchema
17825
17848
  ]);
17849
+ SingletonRouteBySchema = external_exports.object({
17850
+ kind: external_exports.literal("singleton")
17851
+ });
17826
17852
  TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
17827
17853
  external_exports.object({
17828
17854
  kind: external_exports.literal("spawn")
@@ -17834,9 +17860,7 @@ var init_trigger_router = __esm({
17834
17860
  }),
17835
17861
  external_exports.object({
17836
17862
  kind: external_exports.literal("deliverOrSpawn"),
17837
- routeBy: external_exports.object({
17838
- kind: external_exports.literal("singleton")
17839
- })
17863
+ routeBy: SingletonRouteBySchema
17840
17864
  })
17841
17865
  ]);
17842
17866
  SourceEventRequestSchema = external_exports.object({
@@ -18075,7 +18099,7 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
18075
18099
  continue;
18076
18100
  }
18077
18101
  const eventTrigger = trigger;
18078
- if (!isAttributedRunsDeliverTrigger(eventTrigger) || !isChatMessageEvent(eventTrigger)) {
18102
+ if (!isAttributedSessionsDeliverTrigger(eventTrigger) || !isChatMessageEvent(eventTrigger)) {
18079
18103
  continue;
18080
18104
  }
18081
18105
  if (hasFilterValue(eventTrigger, "$.auto.authored", false)) {
@@ -18095,7 +18119,7 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
18095
18119
  continue;
18096
18120
  }
18097
18121
  for (const [deliverIndex, deliverTrigger] of triggers.entries()) {
18098
- if (deliverTrigger.kind === "heartbeat" || !deliverTrigger.event || spawnIndex === deliverIndex || spawnTrigger.event !== deliverTrigger.event || !isAttributedRunsDeliverTrigger(deliverTrigger)) {
18122
+ if (deliverTrigger.kind === "heartbeat" || !deliverTrigger.event || spawnIndex === deliverIndex || spawnTrigger.event !== deliverTrigger.event || !isAttributedSessionsDeliverTrigger(deliverTrigger)) {
18099
18123
  continue;
18100
18124
  }
18101
18125
  if (hasAutoAttributionsExists(spawnTrigger, false) && hasAutoAttributionsExists(deliverTrigger, true)) {
@@ -18112,8 +18136,8 @@ function validateAttributedRunsTriggerPairing(triggers, context) {
18112
18136
  function isSpawnTrigger(trigger) {
18113
18137
  return trigger.routing.kind === "spawn";
18114
18138
  }
18115
- function isAttributedRunsDeliverTrigger(trigger) {
18116
- return trigger.routing.kind === "deliver" && (trigger.routing.routeBy.kind === "attributedSessions" || trigger.routing.routeBy.kind === "attributedRuns");
18139
+ function isAttributedSessionsDeliverTrigger(trigger) {
18140
+ return trigger.routing.kind === "deliver" && trigger.routing.routeBy.kind === "attributedSessions";
18117
18141
  }
18118
18142
  function hasAutoAttributionsExists(trigger, expected) {
18119
18143
  const clause = trigger.where?.["$.auto.attributions"];
@@ -21306,7 +21330,7 @@ var init_package = __esm({
21306
21330
  "package.json"() {
21307
21331
  package_default = {
21308
21332
  name: "@autohq/cli",
21309
- version: "0.1.153",
21333
+ version: "0.1.155",
21310
21334
  license: "SEE LICENSE IN README.md",
21311
21335
  publishConfig: {
21312
21336
  access: "public"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.153",
3
+ "version": "0.1.155",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"