@sentry/junior 0.181.1 → 0.182.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{agent-hooks-KO56HJ74.js → agent-hooks-3S25UIHO.js} +11 -11
  2. package/dist/api.js +125 -51
  3. package/dist/app-adapter.d.ts +85 -0
  4. package/dist/app.d.ts +6 -1
  5. package/dist/app.js +343 -487
  6. package/dist/{catalog-runtime-CJTFLCK3.js → catalog-runtime-ESLMBQBV.js} +4 -4
  7. package/dist/chat/api-turns/adapter-conversations.d.ts +15 -0
  8. package/dist/chat/api-turns/stop.d.ts +12 -0
  9. package/dist/chat/api-turns/work.d.ts +9 -1
  10. package/dist/chat/app/conversation-work.d.ts +1 -1
  11. package/dist/chat/event-tasks/tool-support.d.ts +7 -1
  12. package/dist/chat/event-tasks/types.d.ts +1 -0
  13. package/dist/chat/experimental.d.ts +1 -1
  14. package/dist/chat/resource-events/catalog.d.ts +11 -1
  15. package/dist/chat/resource-events/store.d.ts +5 -1
  16. package/dist/chat/services/subscribed-decision.d.ts +2 -1
  17. package/dist/chat/tools/create-event-task.d.ts +3 -0
  18. package/dist/chat/tools/delete-event-task.d.ts +2 -0
  19. package/dist/chat/tools/list-event-tasks.d.ts +2 -0
  20. package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
  21. package/dist/chat/tools/search-resource-event-types.d.ts +10 -0
  22. package/dist/chat/tools/update-event-task.d.ts +3 -0
  23. package/dist/chat/tools/watch-resource-events.d.ts +3 -0
  24. package/dist/{chunk-WDNA4LML.js → chunk-2CEOXDG2.js} +20 -11
  25. package/dist/{chunk-VRS6WDK5.js → chunk-2LYHWMR4.js} +1 -1
  26. package/dist/{chunk-6TB7JN63.js → chunk-3ENUMZNG.js} +3 -3
  27. package/dist/{chunk-4WYHL4EH.js → chunk-3NFHI2NA.js} +1 -1
  28. package/dist/{chunk-MR36BRPE.js → chunk-3THPTNN6.js} +4 -4
  29. package/dist/{chunk-ULM7P4EQ.js → chunk-44BQ3TSK.js} +1 -1
  30. package/dist/{chunk-7UF37LNL.js → chunk-4DZ62L36.js} +1 -1
  31. package/dist/{chunk-YCW6RZGX.js → chunk-6TSWXBTQ.js} +3 -3
  32. package/dist/{chunk-IWRPJ3J5.js → chunk-A7THOQ6N.js} +58 -32
  33. package/dist/{chunk-J4ID4ZI6.js → chunk-BDDWVY32.js} +19 -19
  34. package/dist/{chunk-S5X2VQOD.js → chunk-BZD4ADQH.js} +3 -2
  35. package/dist/{chunk-CJRUBOJI.js → chunk-CVBIM4Z3.js} +1 -1
  36. package/dist/{chunk-HPFHC7YR.js → chunk-D6OHGAIO.js} +5 -5
  37. package/dist/{chunk-NRF23QZ4.js → chunk-DZR3L74W.js} +3 -3
  38. package/dist/{chunk-RULGB5NX.js → chunk-GGYA5NPN.js} +9 -9
  39. package/dist/{chunk-KH2SL2HT.js → chunk-JIOKUIAS.js} +2 -2
  40. package/dist/{chunk-XQ56HNH5.js → chunk-KGMHUDVF.js} +6 -6
  41. package/dist/{chunk-YFJDRORU.js → chunk-LB4FWMCV.js} +92 -8
  42. package/dist/{chunk-S63LNPIV.js → chunk-LHQK5XCU.js} +2 -2
  43. package/dist/{chunk-DINF4LMR.js → chunk-LT4QYGKM.js} +7 -7
  44. package/dist/{chunk-4OSVTPYQ.js → chunk-MJISSOWB.js} +1 -1
  45. package/dist/{chunk-PJ7EGFME.js → chunk-PQES5LB5.js} +5 -5
  46. package/dist/{chunk-XL3C4NAR.js → chunk-QHALFHZA.js} +9 -9
  47. package/dist/{chunk-HG6HNOTQ.js → chunk-S35OZMSL.js} +130 -200
  48. package/dist/{chunk-Z2UG4FBT.js → chunk-SVFSYQMT.js} +1 -1
  49. package/dist/{chunk-DTRCZOHE.js → chunk-SXOZIG5X.js} +6 -6
  50. package/dist/{chunk-4GOZBB22.js → chunk-TEFNHMO2.js} +63 -7
  51. package/dist/{chunk-QA6RE6IB.js → chunk-UKIHNBBD.js} +3 -3
  52. package/dist/{chunk-2CZ63QCL.js → chunk-UQP54CXZ.js} +1 -1
  53. package/dist/{chunk-HRTW7FFX.js → chunk-UUMBHORH.js} +1 -1
  54. package/dist/{chunk-ZQQWJMHE.js → chunk-V5UZCCNW.js} +6 -6
  55. package/dist/{chunk-GITIZ6TZ.js → chunk-VHMAFMHB.js} +1 -1
  56. package/dist/{chunk-DXK3VTVP.js → chunk-WOIALVN2.js} +1 -1
  57. package/dist/{chunk-VHSBLFNT.js → chunk-YHL2L2ZZ.js} +1 -1
  58. package/dist/{chunk-H6MPFFBE.js → chunk-Z7ALSQS3.js} +1 -1
  59. package/dist/cli/chat.js +34 -34
  60. package/dist/cli/check.js +5 -5
  61. package/dist/cli/plugins.js +12 -12
  62. package/dist/cli/snapshot-create.js +9 -9
  63. package/dist/cli/upgrade.js +6 -6
  64. package/dist/{db-4PXTD3OH.js → db-NYIWZ4L5.js} +6 -6
  65. package/dist/{experimental-SIJSRDJD.js → experimental-P5FZM4CU.js} +1 -1
  66. package/dist/instrumentation.js +3 -3
  67. package/dist/nitro.js +6 -6
  68. package/dist/{oauth-callback-server-TQWNEVR6.js → oauth-callback-server-A2YTPVVX.js} +26 -26
  69. package/dist/{runner-G5HLQA43.js → runner-VKAEU52J.js} +18 -18
  70. package/dist/{skills-BNNNRYNT.js → skills-52GMXUTY.js} +5 -5
  71. package/dist/spawn-GSS4EBLR.js +37 -0
  72. package/dist/task-runner-DUGDWF5O.js +32 -0
  73. package/dist/{validation-IJSBB6JR.js → validation-VD2YQX2W.js} +5 -5
  74. package/dist/version.js +1 -1
  75. package/dist/{work-5FQI4P2A.js → work-ZWBTGEQP.js} +18 -18
  76. package/dist/worker-XUWD5WS7.js +22 -0
  77. package/package.json +7 -6
  78. package/dist/api/acp/route.d.ts +0 -13
  79. package/dist/spawn-U2RKOFP2.js +0 -37
  80. package/dist/task-runner-CDZJBEXP.js +0 -32
  81. package/dist/worker-KJ362GVB.js +0 -22
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-DXK3VTVP.js";
4
- import "./chunk-7UF37LNL.js";
3
+ } from "./chunk-WOIALVN2.js";
4
+ import "./chunk-4DZ62L36.js";
5
5
  import "./chunk-CEMMLV5L.js";
6
6
  import "./chunk-N7TMSOZH.js";
7
7
  import "./chunk-DWPN6SCH.js";
8
8
  import "./chunk-TXKUKMVO.js";
9
- import "./chunk-2CZ63QCL.js";
9
+ import "./chunk-UQP54CXZ.js";
10
10
  import "./chunk-PEQXYSSE.js";
11
- import "./chunk-S5X2VQOD.js";
11
+ import "./chunk-BZD4ADQH.js";
12
12
  export {
13
13
  pluginCatalogRuntime
14
14
  };
@@ -0,0 +1,15 @@
1
+ /** Bind app adapters to Junior's Conversation runtime. */
2
+ import type { StateAdapter } from "chat";
3
+ import type { AdapterConversations } from "@/app-adapter";
4
+ import type { ConversationEventStore } from "@/chat/conversations/history";
5
+ import type { ConversationStore } from "@/chat/conversations/store";
6
+ import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
7
+ interface AdapterConversationOptions {
8
+ conversationStore?: ConversationStore;
9
+ eventStore: ConversationEventStore;
10
+ queue: ConversationWorkQueue;
11
+ state: StateAdapter;
12
+ }
13
+ /** Create the Conversation capability supplied to app adapters. */
14
+ export declare function createAdapterConversations(options: AdapterConversationOptions): AdapterConversations;
15
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { StateAdapter } from "chat";
2
+ import type { ConversationStore } from "@/chat/conversations/store";
3
+ import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
4
+ import { type StopConversationWorkResult } from "@/chat/task-execution/store";
5
+ /** Stop the current API Turn and wake an idle durable resume when needed. */
6
+ export declare function stopApiConversationTurn(args: {
7
+ conversationId: string;
8
+ conversationStore?: ConversationStore;
9
+ nowMs?: number;
10
+ queue: ConversationWorkQueue;
11
+ state?: StateAdapter;
12
+ }): Promise<StopConversationWorkResult>;
@@ -37,6 +37,11 @@ export interface ApiConversationMessageAccepted {
37
37
  messageId: string;
38
38
  status: "accepted" | "duplicate";
39
39
  }
40
+ export type ApiConversationMessageAdmission = ApiConversationMessageAccepted | {
41
+ conversationId: string;
42
+ messageId: string;
43
+ status: "active";
44
+ };
40
45
  /**
41
46
  * Build a durable API conversation id for one viewer + create key.
42
47
  *
@@ -81,7 +86,10 @@ export declare function recordApiConversationActivity(args: {
81
86
  }): Promise<Destination>;
82
87
  /** Create a dashboard root conversation and enqueue its first message. */
83
88
  export declare function createAndEnqueueApiConversation(input: CreateApiConversationInput, options: EnqueueOptions): Promise<ApiConversationMessageAccepted>;
84
- /** Append one API message to an existing conversation and wake the worker. */
89
+ /** Append one API message and optionally require an idle Conversation. */
90
+ export declare function appendAndEnqueueApiConversationMessage(input: AppendApiConversationMessageInput, options: EnqueueOptions & {
91
+ exclusive: true;
92
+ }): Promise<ApiConversationMessageAdmission>;
85
93
  export declare function appendAndEnqueueApiConversationMessage(input: AppendApiConversationMessageInput, options: EnqueueOptions): Promise<ApiConversationMessageAccepted>;
86
94
  /** Build the mailbox consumer for API-authored root turns. */
87
95
  export declare function createApiTurnWorker(options: {
@@ -16,7 +16,7 @@ interface ConversationWorkOptions {
16
16
  state?: StateAdapter;
17
17
  }
18
18
  export type ConversationWorkCallbackOptions = VercelConversationWorkCallbackOptions & {
19
- /** App-scoped control required by the experimental ACP route. */
19
+ /** App-scoped control for API Turn cancellation across request handlers. */
20
20
  apiTurnCancellation?: ApiTurnCancellation;
21
21
  };
22
22
  /**
@@ -19,6 +19,7 @@ export declare const eventTaskToolResultSchema: z.ZodObject<{
19
19
  resourceType: z.ZodString;
20
20
  label: z.ZodString;
21
21
  events: z.ZodArray<z.ZodString>;
22
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
22
23
  credentialMode: z.ZodEnum<{
23
24
  system: "system";
24
25
  creator: "creator";
@@ -47,6 +48,7 @@ export declare const eventTaskListToolResultSchema: z.ZodObject<{
47
48
  resourceType: z.ZodString;
48
49
  label: z.ZodString;
49
50
  events: z.ZodArray<z.ZodString>;
51
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
52
  credentialMode: z.ZodEnum<{
51
53
  system: "system";
52
54
  creator: "creator";
@@ -73,13 +75,15 @@ export declare function registeredEventTaskTriggerSchema(catalog: ResourceEventC
73
75
  events: z.ZodArray<z.ZodString | z.ZodEnum<{
74
76
  [x: string]: string;
75
77
  }>>;
78
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>>;
76
79
  }, z.core.$strict>;
77
80
  /** Reject an event-task trigger that is no longer supported by the catalog. */
78
81
  export declare function requireSupportedEventTaskTrigger(catalog: ResourceEventCatalog, trigger: {
79
82
  events: string[];
83
+ match?: EventTask["trigger"]["match"];
80
84
  namespace: string;
81
85
  resourceType: string;
82
- }): void;
86
+ }): EventTask["trigger"]["match"] | undefined;
83
87
  /** Require the active Slack authority used for event-task management. */
84
88
  export declare function requireEventTaskSlackContext(context: ToolRuntimeContext): {
85
89
  actor: import("../actor").SlackActor;
@@ -121,6 +125,7 @@ export declare function compactEventTask(task: EventTask, catalog: ResourceEvent
121
125
  userName?: string | undefined;
122
126
  };
123
127
  triggerAvailable: boolean;
128
+ match?: Record<string, unknown> | undefined;
124
129
  };
125
130
  /** Return the standard successful event-task tool result. */
126
131
  export declare function eventTaskSuccess(task: EventTask, catalog: ResourceEventCatalog): {
@@ -139,5 +144,6 @@ export declare function eventTaskSuccess(task: EventTask, catalog: ResourceEvent
139
144
  userName?: string | undefined;
140
145
  };
141
146
  triggerAvailable: boolean;
147
+ match?: Record<string, unknown> | undefined;
142
148
  };
143
149
  };
@@ -35,6 +35,7 @@ export declare const eventTaskSchema: z.ZodObject<{
35
35
  trigger: z.ZodObject<{
36
36
  events: z.ZodArray<z.ZodString>;
37
37
  label: z.ZodString;
38
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>>;
38
39
  namespace: z.ZodString;
39
40
  identifier: z.ZodString;
40
41
  resourceType: z.ZodString;
@@ -3,7 +3,7 @@
3
3
  * Add new keys here as features graduate from private experiments; remove them
4
4
  * once they become stable defaults.
5
5
  */
6
- export declare const EXPERIMENTAL_FEATURES: readonly ["acp", "subagents"];
6
+ export declare const EXPERIMENTAL_FEATURES: readonly ["passive-routing", "subagents"];
7
7
  /** One known experimental feature name. */
8
8
  export type ExperimentalFeature = (typeof EXPERIMENTAL_FEATURES)[number];
9
9
  /** App-level opt-ins for unstable product features. */
@@ -1,4 +1,4 @@
1
- import { type PluginResourceEvents } from "@sentry/junior-plugin-api";
1
+ import { type PluginResourceEvents, type ResourceEventMatch, type ResourceEventMatchFields } from "@sentry/junior-plugin-api";
2
2
  import { z } from "zod";
3
3
  type ResourceEventRegistration = Pick<PluginResourceEvents, "resourceTypes" | "normalizeIdentifier">;
4
4
  export type ResourceEventCatalog = Readonly<Record<string, ResourceEventRegistration>>;
@@ -18,6 +18,16 @@ export declare function registeredResourceTypeSchema(catalog: ResourceEventCatal
18
18
  export declare function pluginSupportsEvent(catalog: ResourceEventCatalog, namespace: string, resourceType: string, eventType: string): boolean;
19
19
  /** Return app guidance for one registered resource type and event type. */
20
20
  export declare function resourceEventGuidance(catalog: ResourceEventCatalog, namespace: string, resourceType: string, eventType: string): string | undefined;
21
+ /** Return declared match keys for one registered resource type. */
22
+ export declare function resourceEventMatchFields(catalog: ResourceEventCatalog, namespace: string, resourceType: string): ResourceEventMatchFields | undefined;
23
+ /** Build the match object the tools accept for one resource type. */
24
+ export declare function registeredResourceEventMatchSchema(): z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>>;
25
+ /** Reject match keys the resource type does not list. */
26
+ export declare function requireSupportedResourceEventMatch(catalog: ResourceEventCatalog, input: {
27
+ match?: ResourceEventMatch;
28
+ namespace: string;
29
+ resourceType: string;
30
+ }): ResourceEventMatch | undefined;
21
31
  /** Normalize one selector with the convention declared by its plugin. */
22
32
  export declare function normalizeEventIdentifier(catalog: ResourceEventCatalog, namespace: string, identifier: string): string;
23
33
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { StateAdapter } from "chat";
2
- import { type Destination } from "@sentry/junior-plugin-api";
2
+ import { type Destination, type ResourceEventData, type ResourceEventMatch } from "@sentry/junior-plugin-api";
3
3
  import { z } from "zod";
4
4
  declare const subscriptionSchema: z.ZodObject<{
5
5
  conversationId: z.ZodString;
@@ -17,6 +17,7 @@ declare const subscriptionSchema: z.ZodObject<{
17
17
  id: z.ZodString;
18
18
  intent: z.ZodString;
19
19
  label: z.ZodString;
20
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>>;
20
21
  namespace: z.ZodString;
21
22
  identifier: z.ZodString;
22
23
  resourceType: z.ZodString;
@@ -35,6 +36,7 @@ export interface CreateResourceEventSubscriptionInput {
35
36
  expiresAtMs: number;
36
37
  intent: string;
37
38
  label: string;
39
+ match?: ResourceEventMatch;
38
40
  namespace: string;
39
41
  identifier: string;
40
42
  resourceType: string;
@@ -65,6 +67,7 @@ export declare function cancelSubscriptions(input: {
65
67
  }): Promise<void>;
66
68
  /** Find active subscriptions interested in a normalized resource event. */
67
69
  export declare function findMatchingResourceEventSubscriptions(input: {
70
+ data?: ResourceEventData;
68
71
  eventType: string;
69
72
  nowMs?: number;
70
73
  namespace: string;
@@ -74,6 +77,7 @@ export declare function findMatchingResourceEventSubscriptions(input: {
74
77
  }): Promise<ResourceEventSubscription[]>;
75
78
  /** Recheck and deliver a matched subscription while holding its status lock. */
76
79
  export declare function deliverResourceEventSubscription(input: {
80
+ data?: ResourceEventData;
77
81
  deliver: (subscription: ResourceEventSubscription) => Promise<boolean>;
78
82
  eventType: string;
79
83
  nowMs?: number;
@@ -8,7 +8,8 @@ export declare enum SubscribedReplyReason {
8
8
  Classifier = "llm_classifier",
9
9
  SideConversation = "side_conversation",
10
10
  LowConfidence = "low_confidence",
11
- ClassifierError = "classifier_error"
11
+ ClassifierError = "classifier_error",
12
+ PassiveDisabled = "passive_disabled"
12
13
  }
13
14
  export interface SubscribedDecisionInput {
14
15
  rawText: string;
@@ -12,6 +12,7 @@ export declare function createEventTaskTool(context: ToolRuntimeContext, catalog
12
12
  resourceType: string;
13
13
  label: string;
14
14
  events: string[];
15
+ match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
15
16
  };
16
17
  title?: string | null | undefined;
17
18
  credentialMode?: "system" | "creator" | null | undefined;
@@ -32,6 +33,7 @@ export declare function createEventTaskTool(context: ToolRuntimeContext, catalog
32
33
  userName?: string | undefined;
33
34
  };
34
35
  triggerAvailable: boolean;
36
+ match?: Record<string, unknown> | undefined;
35
37
  };
36
38
  target?: string | undefined;
37
39
  truncated?: boolean | undefined;
@@ -56,6 +58,7 @@ export declare function createEventTaskTool(context: ToolRuntimeContext, catalog
56
58
  userName?: string | undefined;
57
59
  };
58
60
  triggerAvailable: boolean;
61
+ match?: Record<string, unknown> | undefined;
59
62
  };
60
63
  target?: string | undefined;
61
64
  truncated?: boolean | undefined;
@@ -23,6 +23,7 @@ export declare function createDeleteEventTaskTool(context: ToolRuntimeContext, c
23
23
  userName?: string | undefined;
24
24
  };
25
25
  triggerAvailable: boolean;
26
+ match?: Record<string, unknown> | undefined;
26
27
  };
27
28
  target?: string | undefined;
28
29
  truncated?: boolean | undefined;
@@ -47,6 +48,7 @@ export declare function createDeleteEventTaskTool(context: ToolRuntimeContext, c
47
48
  userName?: string | undefined;
48
49
  };
49
50
  triggerAvailable: boolean;
51
+ match?: Record<string, unknown> | undefined;
50
52
  };
51
53
  target?: string | undefined;
52
54
  truncated?: boolean | undefined;
@@ -21,6 +21,7 @@ export declare function createListEventTasksTool(context: ToolRuntimeContext, ca
21
21
  userName?: string | undefined;
22
22
  };
23
23
  triggerAvailable: boolean;
24
+ match?: Record<string, unknown> | undefined;
24
25
  }[];
25
26
  truncated: boolean;
26
27
  target?: string | undefined;
@@ -45,6 +46,7 @@ export declare function createListEventTasksTool(context: ToolRuntimeContext, ca
45
46
  userName?: string | undefined;
46
47
  };
47
48
  triggerAvailable: boolean;
49
+ match?: Record<string, unknown> | undefined;
48
50
  }[];
49
51
  truncated: boolean;
50
52
  target?: string | undefined;
@@ -14,6 +14,7 @@ export declare function createListResourceEventSubscriptionsTool(context: ToolRu
14
14
  events: string[];
15
15
  intent: string;
16
16
  expiresAtMs: number;
17
+ match?: Record<string, unknown> | undefined;
17
18
  }[];
18
19
  target?: string | undefined;
19
20
  truncated?: boolean | undefined;
@@ -32,6 +33,7 @@ export declare function createListResourceEventSubscriptionsTool(context: ToolRu
32
33
  events: string[];
33
34
  intent: string;
34
35
  expiresAtMs: number;
36
+ match?: Record<string, unknown> | undefined;
35
37
  }[];
36
38
  target?: string | undefined;
37
39
  truncated?: boolean | undefined;
@@ -17,6 +17,11 @@ export declare function createSearchResourceEventTypesTool(catalog: ResourceEven
17
17
  type: string;
18
18
  supportedEvents: string[];
19
19
  suggestedEvents?: string[] | undefined;
20
+ matchFields?: Record<string, {
21
+ kind: "string" | "number" | "boolean";
22
+ description: string;
23
+ enum?: string[] | undefined;
24
+ }> | undefined;
20
25
  }[];
21
26
  target?: string | undefined;
22
27
  truncated?: boolean | undefined;
@@ -34,6 +39,11 @@ export declare function createSearchResourceEventTypesTool(catalog: ResourceEven
34
39
  type: string;
35
40
  supportedEvents: string[];
36
41
  suggestedEvents?: string[] | undefined;
42
+ matchFields?: Record<string, {
43
+ kind: "string" | "number" | "boolean";
44
+ description: string;
45
+ enum?: string[] | undefined;
46
+ }> | undefined;
37
47
  }[];
38
48
  target?: string | undefined;
39
49
  truncated?: boolean | undefined;
@@ -13,6 +13,7 @@ export declare function createUpdateEventTaskTool(context: ToolRuntimeContext, c
13
13
  resourceType: string;
14
14
  label: string;
15
15
  events: string[];
16
+ match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
16
17
  } | null | undefined;
17
18
  credentialMode?: "system" | "creator" | null | undefined;
18
19
  };
@@ -32,6 +33,7 @@ export declare function createUpdateEventTaskTool(context: ToolRuntimeContext, c
32
33
  userName?: string | undefined;
33
34
  };
34
35
  triggerAvailable: boolean;
36
+ match?: Record<string, unknown> | undefined;
35
37
  };
36
38
  target?: string | undefined;
37
39
  truncated?: boolean | undefined;
@@ -56,6 +58,7 @@ export declare function createUpdateEventTaskTool(context: ToolRuntimeContext, c
56
58
  userName?: string | undefined;
57
59
  };
58
60
  triggerAvailable: boolean;
61
+ match?: Record<string, unknown> | undefined;
59
62
  };
60
63
  target?: string | undefined;
61
64
  truncated?: boolean | undefined;
@@ -11,6 +11,7 @@ export declare function createWatchResourceEventsTool(context: ToolRuntimeContex
11
11
  label: string;
12
12
  events: string[];
13
13
  intent: string;
14
+ match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
14
15
  ttlMs?: number | undefined;
15
16
  };
16
17
  execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
@@ -35,6 +36,7 @@ export declare function createWatchResourceEventsTool(context: ToolRuntimeContex
35
36
  arguments: Record<string, unknown>;
36
37
  reason?: string | undefined;
37
38
  } | undefined;
39
+ match?: Record<string, unknown> | undefined;
38
40
  } | Promise<{
39
41
  id: string;
40
42
  subscription_status: "completed" | "active" | "cancelled";
@@ -57,5 +59,6 @@ export declare function createWatchResourceEventsTool(context: ToolRuntimeContex
57
59
  arguments: Record<string, unknown>;
58
60
  reason?: string | undefined;
59
61
  } | undefined;
62
+ match?: Record<string, unknown> | undefined;
60
63
  }>) | undefined;
61
64
  };
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-YCW6RZGX.js";
8
+ } from "./chunk-6TSWXBTQ.js";
9
9
  import {
10
10
  juniorConversationAnnotations,
11
11
  juniorConversationEvents,
@@ -14,7 +14,7 @@ import {
14
14
  juniorUsers,
15
15
  juniorWorkspaceRepos,
16
16
  juniorWorkspaces
17
- } from "./chunk-ULM7P4EQ.js";
17
+ } from "./chunk-44BQ3TSK.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT,
20
20
  getVercelSandboxCredentials,
@@ -22,17 +22,17 @@ import {
22
22
  isSandboxMissingError,
23
23
  runNonInteractiveCommand,
24
24
  sleep
25
- } from "./chunk-QA6RE6IB.js";
25
+ } from "./chunk-UKIHNBBD.js";
26
26
  import {
27
27
  getStateAdapter
28
- } from "./chunk-H6MPFFBE.js";
28
+ } from "./chunk-Z7ALSQS3.js";
29
29
  import {
30
30
  botConfig,
31
31
  completeObject,
32
32
  defaultModelId,
33
33
  embedTexts,
34
34
  getSlackBotToken
35
- } from "./chunk-S63LNPIV.js";
35
+ } from "./chunk-LHQK5XCU.js";
36
36
  import {
37
37
  isActorUserId,
38
38
  parseActorUserId,
@@ -48,7 +48,7 @@ import {
48
48
  setSpanAttributes,
49
49
  setSpanStatus,
50
50
  withSpan
51
- } from "./chunk-2CZ63QCL.js";
51
+ } from "./chunk-UQP54CXZ.js";
52
52
 
53
53
  // src/chat/plugins/agent-hooks.ts
54
54
  import {
@@ -902,7 +902,10 @@ function createResourceEventTeamIdResolver() {
902
902
  import { createHash as createHash2 } from "crypto";
903
903
  import {
904
904
  destinationSchema,
905
- resourceEventTypeSchema
905
+ resourceEventMatchSchema,
906
+ resourceEventMatches,
907
+ resourceEventTypeSchema,
908
+ stableResourceEventMatchKey
906
909
  } from "@sentry/junior-plugin-api";
907
910
  import { z as z2 } from "zod";
908
911
  var RESOURCE_EVENT_PREFIX = "junior:resource_event_subscription:v3";
@@ -922,6 +925,7 @@ var subscriptionSchema = z2.object({
922
925
  id: z2.string().min(1),
923
926
  intent: z2.string().min(1),
924
927
  label: z2.string().min(1),
928
+ match: resourceEventMatchSchema.optional(),
925
929
  namespace: z2.string().min(1),
926
930
  identifier: z2.string().min(1),
927
931
  resourceType: z2.string().min(1),
@@ -1029,9 +1033,9 @@ async function readSubscriptionIdIndex(state, key) {
1029
1033
  }
1030
1034
  function buildSubscriptionId(input) {
1031
1035
  const eventKey = [...new Set(input.events)].sort().join("\0");
1032
- return `resub_${digest(
1033
- `${input.teamId}\0${input.namespace}\0${input.identifier}\0${input.conversationId}\0${eventKey}`
1034
- )}`;
1036
+ const matchKey = stableResourceEventMatchKey(input.match);
1037
+ const material = matchKey ? `${input.teamId}\0${input.namespace}\0${input.identifier}\0${input.conversationId}\0${eventKey}\0${matchKey}` : `${input.teamId}\0${input.namespace}\0${input.identifier}\0${input.conversationId}\0${eventKey}`;
1038
+ return `resub_${digest(material)}`;
1035
1039
  }
1036
1040
  async function withIndexLock(state, key, callback) {
1037
1041
  const lock = await state.acquireLock(indexLockKey(key), INDEX_LOCK_TTL_MS);
@@ -1082,7 +1086,7 @@ function activeAt(subscription, nowMs) {
1082
1086
  return subscription.status === "active" && subscription.expiresAtMs > nowMs;
1083
1087
  }
1084
1088
  function matchesEvent(subscription, input) {
1085
- return subscription.namespace === input.namespace && subscription.identifier === input.identifier && subscriptionTeamId(subscription.destination) === input.teamId && subscription.events.includes(input.eventType) && activeAt(subscription, input.nowMs);
1089
+ return subscription.namespace === input.namespace && subscription.identifier === input.identifier && subscriptionTeamId(subscription.destination) === input.teamId && subscription.events.includes(input.eventType) && activeAt(subscription, input.nowMs) && resourceEventMatches(subscription.match, input.data);
1086
1090
  }
1087
1091
  async function createResourceEventSubscription(input, options = {}) {
1088
1092
  const state = options.state ?? getStateAdapter();
@@ -1097,9 +1101,11 @@ async function createResourceEventSubscription(input, options = {}) {
1097
1101
  if (input.expiresAtMs <= nowMs) {
1098
1102
  throw new Error("Resource event subscription expiry must be in the future");
1099
1103
  }
1104
+ const match = input.match && Object.keys(input.match).length > 0 ? input.match : void 0;
1100
1105
  const id = buildSubscriptionId({
1101
1106
  conversationId: input.conversationId,
1102
1107
  events,
1108
+ match,
1103
1109
  namespace: input.namespace,
1104
1110
  identifier: input.identifier,
1105
1111
  teamId: subscriptionTeamId(input.destination)
@@ -1113,6 +1119,7 @@ async function createResourceEventSubscription(input, options = {}) {
1113
1119
  id,
1114
1120
  intent: input.intent,
1115
1121
  label: input.label,
1122
+ ...match ? { match } : void 0,
1116
1123
  namespace: input.namespace,
1117
1124
  identifier: input.identifier,
1118
1125
  resourceType: input.resourceType,
@@ -1226,6 +1233,7 @@ async function findMatchingResourceEventSubscriptions(input) {
1226
1233
  );
1227
1234
  return records.filter(
1228
1235
  (record) => record !== void 0 && matchesEvent(record, {
1236
+ data: input.data,
1229
1237
  eventType: input.eventType,
1230
1238
  nowMs,
1231
1239
  namespace: input.namespace,
@@ -1246,6 +1254,7 @@ async function deliverResourceEventSubscription(input) {
1246
1254
  await state.get(subscriptionKey(input.subscription.id))
1247
1255
  );
1248
1256
  if (!current || !matchesEvent(current, {
1257
+ data: input.data,
1249
1258
  eventType: input.eventType,
1250
1259
  nowMs,
1251
1260
  namespace: input.namespace,
@@ -1,5 +1,5 @@
1
1
  // src/chat/experimental.ts
2
- var EXPERIMENTAL_FEATURES = ["acp", "subagents"];
2
+ var EXPERIMENTAL_FEATURES = ["passive-routing", "subagents"];
3
3
  var EXPERIMENTAL_FEATURE_SET = new Set(EXPERIMENTAL_FEATURES);
4
4
  var configuredExperimental = {};
5
5
  function isExperimentalFeature(value) {
@@ -6,14 +6,14 @@ import {
6
6
  isStale,
7
7
  runNonInteractiveCommand,
8
8
  sleep
9
- } from "./chunk-QA6RE6IB.js";
9
+ } from "./chunk-UKIHNBBD.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-H6MPFFBE.js";
12
+ } from "./chunk-Z7ALSQS3.js";
13
13
  import {
14
14
  setSpanAttributes,
15
15
  withSpan
16
- } from "./chunk-2CZ63QCL.js";
16
+ } from "./chunk-UQP54CXZ.js";
17
17
 
18
18
  // src/chat/sandbox/resources.ts
19
19
  var configuredResources;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-DXK3VTVP.js";
3
+ } from "./chunk-WOIALVN2.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -19,23 +19,23 @@ import {
19
19
  releaseConversationWork,
20
20
  requestAnotherSlice,
21
21
  startConversationWork
22
- } from "./chunk-4GOZBB22.js";
22
+ } from "./chunk-TEFNHMO2.js";
23
23
  import {
24
24
  ConversationQueueMessageRejectedError
25
25
  } from "./chunk-JAL3CH4G.js";
26
26
  import {
27
27
  getTurnRequestDeadline
28
- } from "./chunk-HRTW7FFX.js";
28
+ } from "./chunk-UUMBHORH.js";
29
29
  import {
30
30
  getChatConfig,
31
31
  isProviderRetryError
32
- } from "./chunk-S63LNPIV.js";
32
+ } from "./chunk-LHQK5XCU.js";
33
33
  import {
34
34
  logException,
35
35
  logInfo,
36
36
  logWarn,
37
37
  withLogContext
38
- } from "./chunk-2CZ63QCL.js";
38
+ } from "./chunk-UQP54CXZ.js";
39
39
 
40
40
  // src/chat/task-execution/worker.ts
41
41
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFUK3X5B.js";
5
5
  import {
6
6
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
7
- } from "./chunk-S63LNPIV.js";
7
+ } from "./chunk-LHQK5XCU.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-2CZ63QCL.js";
15
+ } from "./chunk-UQP54CXZ.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -8,7 +8,7 @@ import {
8
8
  juniorConversations,
9
9
  juniorIdentities,
10
10
  juniorUsers
11
- } from "./chunk-ULM7P4EQ.js";
11
+ } from "./chunk-44BQ3TSK.js";
12
12
  import {
13
13
  juniorDestinations
14
14
  } from "./chunk-VFUK3X5B.js";
@@ -16,7 +16,7 @@ import {
16
16
  TURN_REASONING_LEVELS,
17
17
  getChatConfig,
18
18
  modelProfileSchema
19
- } from "./chunk-S63LNPIV.js";
19
+ } from "./chunk-LHQK5XCU.js";
20
20
  import {
21
21
  parseActorUserId,
22
22
  parseSlackChannelReferenceId,
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-N7TMSOZH.js";
25
25
  import {
26
26
  normalizeIdentityEmail
27
- } from "./chunk-2CZ63QCL.js";
27
+ } from "./chunk-UQP54CXZ.js";
28
28
 
29
29
  // src/chat/conversations/sql/store.ts
30
30
  import { randomUUID as randomUUID2 } from "crypto";