@autohq/cli 0.1.419 → 0.1.420

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.
@@ -30820,7 +30820,7 @@ Object.assign(lookup, {
30820
30820
  // package.json
30821
30821
  var package_default = {
30822
30822
  name: "@autohq/cli",
30823
- version: "0.1.419",
30823
+ version: "0.1.420",
30824
30824
  license: "SEE LICENSE IN README.md",
30825
30825
  publishConfig: {
30826
30826
  access: "public"
@@ -34000,6 +34000,11 @@ var TRIGGER_BINDING_TARGET_TYPES = [
34000
34000
  "linear.issue",
34001
34001
  "auto.session"
34002
34002
  ];
34003
+ var OBSERVED_TARGET_EVENT_KEYS = [
34004
+ "auto.session.binding.bound",
34005
+ "auto.session.binding.updated",
34006
+ "auto.session.binding.unbound"
34007
+ ];
34003
34008
  var SESSION_BINDING_SOURCES = [
34004
34009
  "trigger_spawn",
34005
34010
  "agent_tool",
@@ -34022,6 +34027,7 @@ var BINDING_TRANSITION_CAUSES = [
34022
34027
  "manual_update",
34023
34028
  "attributed_event",
34024
34029
  "mention",
34030
+ "observed_binding_event",
34025
34031
  "session_spawn",
34026
34032
  "trigger_spawn",
34027
34033
  "chat_send",
@@ -34284,6 +34290,17 @@ var TriggerReleaseSchema = external_exports.union([
34284
34290
  external_exports.literal(true).transform(() => ({ context: null })),
34285
34291
  external_exports.object({ context: JsonObjectSchema.nullable().default(null) }).strict()
34286
34292
  ]);
34293
+ var ObservedTargetActionSchema = external_exports.discriminatedUnion("action", [
34294
+ external_exports.object({
34295
+ action: external_exports.literal("bind"),
34296
+ context: JsonObjectSchema.nullable().default(null),
34297
+ eventContext: JsonObjectSchema.nullable().default(null)
34298
+ }).strict(),
34299
+ external_exports.object({
34300
+ action: external_exports.literal("unbind"),
34301
+ eventContext: JsonObjectSchema.nullable().default(null)
34302
+ }).strict()
34303
+ ]);
34287
34304
  var CanonicalTriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
34288
34305
  external_exports.object({
34289
34306
  kind: external_exports.literal("spawn"),
@@ -34312,7 +34329,17 @@ var CanonicalTriggerRoutingSchema = external_exports.discriminatedUnion("kind",
34312
34329
  // routing completes. No-op when no active binding exists. `agent.singleton`
34313
34330
  // is rejected at apply time (singleton slots are pool-membership state
34314
34331
  // owned by the reconciler).
34315
- release: TriggerReleaseSchema.default(false)
34332
+ release: TriggerReleaseSchema.default(false),
34333
+ // Observed-target lifecycle action: after the router delivers a matching
34334
+ // binding-transition event to the observer session this trigger's
34335
+ // `auto.session` target resolved, the platform binds or unbinds that
34336
+ // session to/from the target carried by the observed event. Apply-time
34337
+ // validation restricts this to `target: auto.session` triggers on the
34338
+ // `auto.session.binding.bound|updated|unbound` event keys; the target type
34339
+ // is authorized at runtime against the observer agent's own bindable
34340
+ // targets. Distinct from `release` above, which releases this route's own
34341
+ // `auto.session` observation binding.
34342
+ observedTarget: ObservedTargetActionSchema.optional()
34316
34343
  })
34317
34344
  ]);
34318
34345
  var LegacySingletonRouteBySchema = external_exports.object({
@@ -34812,6 +34839,7 @@ var AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
34812
34839
  validateConcurrencyConfig(spec, context);
34813
34840
  validateBindingsConfig(spec, context);
34814
34841
  validateTriggerReleaseConfig(spec, context);
34842
+ validateTriggerObservedTargetConfig(spec, context);
34815
34843
  });
34816
34844
  function validateConcurrencyConfig(spec, context) {
34817
34845
  if (spec.concurrency === void 0 && spec.replace !== void 0) {
@@ -34913,6 +34941,28 @@ function validateTriggerReleaseConfig(spec, context) {
34913
34941
  }
34914
34942
  }
34915
34943
  }
34944
+ function validateTriggerObservedTargetConfig(spec, context) {
34945
+ const legalEvents = new Set(OBSERVED_TARGET_EVENT_KEYS);
34946
+ for (const [index, trigger] of spec.triggers.entries()) {
34947
+ if (trigger.routing.kind !== "bind" || !trigger.routing.observedTarget) {
34948
+ continue;
34949
+ }
34950
+ if (trigger.routing.target !== "auto.session") {
34951
+ context.addIssue({
34952
+ code: external_exports.ZodIssueCode.custom,
34953
+ path: ["triggers", index, "routing", "observedTarget"],
34954
+ message: "`observedTarget` requires `target: auto.session`: only the observed child-session relationship may drive an observed-target action"
34955
+ });
34956
+ }
34957
+ if (!trigger.event || !legalEvents.has(trigger.event)) {
34958
+ context.addIssue({
34959
+ code: external_exports.ZodIssueCode.custom,
34960
+ path: ["triggers", index, "routing", "observedTarget"],
34961
+ message: `\`observedTarget\` requires an \`event\` in [${OBSERVED_TARGET_EVENT_KEYS.join(", ")}]: the binding lifecycle transitions are the events that carry the target to act on`
34962
+ });
34963
+ }
34964
+ }
34965
+ }
34916
34966
  var AgentStatusSchema = external_exports.object({
34917
34967
  runCount: external_exports.number().int().nonnegative().default(0),
34918
34968
  lastActivityAt: external_exports.string().datetime().nullable().default(null)
package/dist/index.js CHANGED
@@ -17966,7 +17966,7 @@ var init_secrets = __esm({
17966
17966
  });
17967
17967
 
17968
17968
  // ../../packages/schemas/src/session-bindings.ts
17969
- var BINDING_TARGET_TYPES, TRIGGER_BINDING_TARGET_TYPES, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, SESSION_BINDING_RELEASE_POLICIES, SESSION_BINDING_CONTINUITIES, SESSION_BINDING_RELEASED_BY, BINDING_TRANSITION_CAUSES, BindingTargetTypeSchema, TriggerBindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, SessionBindingReleasePolicySchema, SessionBindingContinuitySchema, SessionBindingReleasedBySchema, BindingTransitionCauseSchema, BindingTargetSchema, BINDING_AUTO_BIND_VALUES, BindingAutoBindSchema, AUTO_BIND_LEGAL_TARGETS;
17969
+ var BINDING_TARGET_TYPES, TRIGGER_BINDING_TARGET_TYPES, OBSERVED_TARGET_EVENT_KEYS, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, SESSION_BINDING_RELEASE_POLICIES, SESSION_BINDING_CONTINUITIES, SESSION_BINDING_RELEASED_BY, BINDING_TRANSITION_CAUSES, BindingTargetTypeSchema, TriggerBindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, SessionBindingReleasePolicySchema, SessionBindingContinuitySchema, SessionBindingReleasedBySchema, BindingTransitionCauseSchema, BindingTargetSchema, BINDING_AUTO_BIND_VALUES, BindingAutoBindSchema, AUTO_BIND_LEGAL_TARGETS;
17970
17970
  var init_session_bindings = __esm({
17971
17971
  "../../packages/schemas/src/session-bindings.ts"() {
17972
17972
  "use strict";
@@ -17989,6 +17989,11 @@ var init_session_bindings = __esm({
17989
17989
  "linear.issue",
17990
17990
  "auto.session"
17991
17991
  ];
17992
+ OBSERVED_TARGET_EVENT_KEYS = [
17993
+ "auto.session.binding.bound",
17994
+ "auto.session.binding.updated",
17995
+ "auto.session.binding.unbound"
17996
+ ];
17992
17997
  SESSION_BINDING_SOURCES = [
17993
17998
  "trigger_spawn",
17994
17999
  "agent_tool",
@@ -18011,6 +18016,7 @@ var init_session_bindings = __esm({
18011
18016
  "manual_update",
18012
18017
  "attributed_event",
18013
18018
  "mention",
18019
+ "observed_binding_event",
18014
18020
  "session_spawn",
18015
18021
  "trigger_spawn",
18016
18022
  "chat_send",
@@ -18248,7 +18254,7 @@ function normalizeLegacyHeartbeatTickWorkflowInput(input) {
18248
18254
  agentResourceId: sessionResourceId
18249
18255
  };
18250
18256
  }
18251
- var CANONICAL_ROUTE_BY_KINDS, LEGACY_ROUTE_BY_KINDS, CanonicalRouteBySchema, LegacyRouteBySchema, RouteBySchema, TRIGGER_ON_UNMATCHED_POLICIES, OnUnmatchedSchema, SpawnBindSchema, TriggerReleaseSchema, CanonicalTriggerRoutingSchema, LegacySingletonRouteBySchema, LegacySingletonDeliverRoutingSchema, LegacyOwnedArtifactDeliverRoutingSchema, LegacyDeliverOrSpawnRoutingSchema, TriggerRoutingSchema, SourceEventRequestSchema, EventRoutingWorkflowInputSchema, HeartbeatTickWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowResultSchema, EventRoutingTriggerResultSchema;
18257
+ var CANONICAL_ROUTE_BY_KINDS, LEGACY_ROUTE_BY_KINDS, CanonicalRouteBySchema, LegacyRouteBySchema, RouteBySchema, TRIGGER_ON_UNMATCHED_POLICIES, OnUnmatchedSchema, SpawnBindSchema, TriggerReleaseSchema, ObservedTargetActionSchema, CanonicalTriggerRoutingSchema, LegacySingletonRouteBySchema, LegacySingletonDeliverRoutingSchema, LegacyOwnedArtifactDeliverRoutingSchema, LegacyDeliverOrSpawnRoutingSchema, TriggerRoutingSchema, SourceEventRequestSchema, EventRoutingWorkflowInputSchema, HeartbeatTickWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowInputSchema, GithubPullRequestMergeabilityWorkflowResultSchema, EventRoutingTriggerResultSchema;
18252
18258
  var init_trigger_router = __esm({
18253
18259
  "../../packages/schemas/src/trigger-router.ts"() {
18254
18260
  "use strict";
@@ -18308,6 +18314,17 @@ var init_trigger_router = __esm({
18308
18314
  external_exports.literal(true).transform(() => ({ context: null })),
18309
18315
  external_exports.object({ context: JsonObjectSchema.nullable().default(null) }).strict()
18310
18316
  ]);
18317
+ ObservedTargetActionSchema = external_exports.discriminatedUnion("action", [
18318
+ external_exports.object({
18319
+ action: external_exports.literal("bind"),
18320
+ context: JsonObjectSchema.nullable().default(null),
18321
+ eventContext: JsonObjectSchema.nullable().default(null)
18322
+ }).strict(),
18323
+ external_exports.object({
18324
+ action: external_exports.literal("unbind"),
18325
+ eventContext: JsonObjectSchema.nullable().default(null)
18326
+ }).strict()
18327
+ ]);
18311
18328
  CanonicalTriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
18312
18329
  external_exports.object({
18313
18330
  kind: external_exports.literal("spawn"),
@@ -18336,7 +18353,17 @@ var init_trigger_router = __esm({
18336
18353
  // routing completes. No-op when no active binding exists. `agent.singleton`
18337
18354
  // is rejected at apply time (singleton slots are pool-membership state
18338
18355
  // owned by the reconciler).
18339
- release: TriggerReleaseSchema.default(false)
18356
+ release: TriggerReleaseSchema.default(false),
18357
+ // Observed-target lifecycle action: after the router delivers a matching
18358
+ // binding-transition event to the observer session this trigger's
18359
+ // `auto.session` target resolved, the platform binds or unbinds that
18360
+ // session to/from the target carried by the observed event. Apply-time
18361
+ // validation restricts this to `target: auto.session` triggers on the
18362
+ // `auto.session.binding.bound|updated|unbound` event keys; the target type
18363
+ // is authorized at runtime against the observer agent's own bindable
18364
+ // targets. Distinct from `release` above, which releases this route's own
18365
+ // `auto.session` observation binding.
18366
+ observedTarget: ObservedTargetActionSchema.optional()
18340
18367
  })
18341
18368
  ]);
18342
18369
  LegacySingletonRouteBySchema = external_exports.object({
@@ -18749,6 +18776,28 @@ function validateTriggerReleaseConfig(spec, context) {
18749
18776
  }
18750
18777
  }
18751
18778
  }
18779
+ function validateTriggerObservedTargetConfig(spec, context) {
18780
+ const legalEvents = new Set(OBSERVED_TARGET_EVENT_KEYS);
18781
+ for (const [index, trigger] of spec.triggers.entries()) {
18782
+ if (trigger.routing.kind !== "bind" || !trigger.routing.observedTarget) {
18783
+ continue;
18784
+ }
18785
+ if (trigger.routing.target !== "auto.session") {
18786
+ context.addIssue({
18787
+ code: external_exports.ZodIssueCode.custom,
18788
+ path: ["triggers", index, "routing", "observedTarget"],
18789
+ message: "`observedTarget` requires `target: auto.session`: only the observed child-session relationship may drive an observed-target action"
18790
+ });
18791
+ }
18792
+ if (!trigger.event || !legalEvents.has(trigger.event)) {
18793
+ context.addIssue({
18794
+ code: external_exports.ZodIssueCode.custom,
18795
+ path: ["triggers", index, "routing", "observedTarget"],
18796
+ message: `\`observedTarget\` requires an \`event\` in [${OBSERVED_TARGET_EVENT_KEYS.join(", ")}]: the binding lifecycle transitions are the events that carry the target to act on`
18797
+ });
18798
+ }
18799
+ }
18800
+ }
18752
18801
  function validateTriggerChecks(trigger, context, eventKeys) {
18753
18802
  const checks = trigger.checks ?? [];
18754
18803
  if (checks.length === 0) {
@@ -19118,6 +19167,7 @@ var init_agents = __esm({
19118
19167
  validateConcurrencyConfig(spec, context);
19119
19168
  validateBindingsConfig(spec, context);
19120
19169
  validateTriggerReleaseConfig(spec, context);
19170
+ validateTriggerObservedTargetConfig(spec, context);
19121
19171
  });
19122
19172
  AgentStatusSchema = external_exports.object({
19123
19173
  runCount: external_exports.number().int().nonnegative().default(0),
@@ -38670,7 +38720,7 @@ var init_package = __esm({
38670
38720
  "package.json"() {
38671
38721
  package_default = {
38672
38722
  name: "@autohq/cli",
38673
- version: "0.1.419",
38723
+ version: "0.1.420",
38674
38724
  license: "SEE LICENSE IN README.md",
38675
38725
  publishConfig: {
38676
38726
  access: "public"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.419",
3
+ "version": "0.1.420",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"