@sentry/junior-plugin-api 0.71.3 → 0.72.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.
- package/dist/index.d.ts +8 -6
- package/dist/index.js +6 -4
- package/package.json +1 -1
- package/src/index.ts +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,10 @@ export declare const agentPluginCredentialSubjectSchema: z.ZodObject<{
|
|
|
12
12
|
allowedWhen: z.ZodLiteral<"private-direct-conversation">;
|
|
13
13
|
}, z.core.$strict>;
|
|
14
14
|
/** Runtime-provided requester identity visible to plugin hooks. */
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
15
|
+
export declare const requesterSchema: z.ZodObject<{
|
|
16
|
+
platform: z.ZodLiteral<"slack">;
|
|
17
|
+
teamId: z.ZodString;
|
|
18
|
+
userId: z.ZodString;
|
|
17
19
|
userName: z.ZodOptional<z.ZodString>;
|
|
18
20
|
fullName: z.ZodOptional<z.ZodString>;
|
|
19
21
|
email: z.ZodOptional<z.ZodString>;
|
|
@@ -34,7 +36,7 @@ export declare const dispatchOptionsSchema: z.ZodObject<{
|
|
|
34
36
|
input: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
35
37
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
38
|
}, z.core.$strict>;
|
|
37
|
-
export type
|
|
39
|
+
export type Requester = z.output<typeof requesterSchema>;
|
|
38
40
|
export interface AgentPluginMetadata {
|
|
39
41
|
name: string;
|
|
40
42
|
}
|
|
@@ -83,13 +85,13 @@ export interface AgentPluginSandbox {
|
|
|
83
85
|
}): Promise<void>;
|
|
84
86
|
}
|
|
85
87
|
export interface SandboxPrepareHookContext extends AgentPluginContext {
|
|
86
|
-
requester?:
|
|
88
|
+
requester?: Requester;
|
|
87
89
|
sandbox: AgentPluginSandbox;
|
|
88
90
|
}
|
|
89
91
|
export interface BeforeToolExecuteHookContext extends AgentPluginContext {
|
|
90
92
|
decision: AgentPluginDecision;
|
|
91
93
|
env: AgentPluginEnv;
|
|
92
|
-
requester?:
|
|
94
|
+
requester?: Requester;
|
|
93
95
|
tool: {
|
|
94
96
|
input: Record<string, unknown>;
|
|
95
97
|
name: string;
|
|
@@ -152,7 +154,7 @@ export interface ToolRegistrationHookContext extends AgentPluginContext {
|
|
|
152
154
|
*/
|
|
153
155
|
destination?: Destination;
|
|
154
156
|
messageTs?: string;
|
|
155
|
-
requester?:
|
|
157
|
+
requester?: Requester;
|
|
156
158
|
state: AgentPluginState;
|
|
157
159
|
teamId?: string;
|
|
158
160
|
threadTs?: string;
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,10 @@ var agentPluginCredentialSubjectSchema = z.object({
|
|
|
16
16
|
userId: exactActorUserIdSchema,
|
|
17
17
|
allowedWhen: z.literal("private-direct-conversation")
|
|
18
18
|
}).strict();
|
|
19
|
-
var
|
|
20
|
-
|
|
19
|
+
var requesterSchema = z.object({
|
|
20
|
+
platform: z.literal("slack"),
|
|
21
|
+
teamId: slackTeamIdSchema,
|
|
22
|
+
userId: exactActorUserIdSchema,
|
|
21
23
|
userName: nonBlankStringSchema.optional(),
|
|
22
24
|
fullName: nonBlankStringSchema.optional(),
|
|
23
25
|
email: nonBlankStringSchema.optional()
|
|
@@ -173,8 +175,8 @@ export {
|
|
|
173
175
|
agentPluginCredentialSubjectSchema,
|
|
174
176
|
agentPluginGrantSchema,
|
|
175
177
|
agentPluginProviderAccountSchema,
|
|
176
|
-
agentPluginRequesterSchema,
|
|
177
178
|
defineJuniorPlugin,
|
|
178
179
|
destinationSchema,
|
|
179
|
-
dispatchOptionsSchema
|
|
180
|
+
dispatchOptionsSchema,
|
|
181
|
+
requesterSchema
|
|
180
182
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -31,9 +31,11 @@ export const agentPluginCredentialSubjectSchema = z
|
|
|
31
31
|
.strict();
|
|
32
32
|
|
|
33
33
|
/** Runtime-provided requester identity visible to plugin hooks. */
|
|
34
|
-
export const
|
|
34
|
+
export const requesterSchema = z
|
|
35
35
|
.object({
|
|
36
|
-
|
|
36
|
+
platform: z.literal("slack"),
|
|
37
|
+
teamId: slackTeamIdSchema,
|
|
38
|
+
userId: exactActorUserIdSchema,
|
|
37
39
|
userName: nonBlankStringSchema.optional(),
|
|
38
40
|
fullName: nonBlankStringSchema.optional(),
|
|
39
41
|
email: nonBlankStringSchema.optional(),
|
|
@@ -88,7 +90,7 @@ export const dispatchOptionsSchema = z
|
|
|
88
90
|
})
|
|
89
91
|
.strict();
|
|
90
92
|
|
|
91
|
-
export type
|
|
93
|
+
export type Requester = z.output<typeof requesterSchema>;
|
|
92
94
|
|
|
93
95
|
export interface AgentPluginMetadata {
|
|
94
96
|
name: string;
|
|
@@ -146,14 +148,14 @@ export interface AgentPluginSandbox {
|
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
export interface SandboxPrepareHookContext extends AgentPluginContext {
|
|
149
|
-
requester?:
|
|
151
|
+
requester?: Requester;
|
|
150
152
|
sandbox: AgentPluginSandbox;
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
export interface BeforeToolExecuteHookContext extends AgentPluginContext {
|
|
154
156
|
decision: AgentPluginDecision;
|
|
155
157
|
env: AgentPluginEnv;
|
|
156
|
-
requester?:
|
|
158
|
+
requester?: Requester;
|
|
157
159
|
tool: {
|
|
158
160
|
input: Record<string, unknown>;
|
|
159
161
|
name: string;
|
|
@@ -220,7 +222,7 @@ export interface ToolRegistrationHookContext extends AgentPluginContext {
|
|
|
220
222
|
*/
|
|
221
223
|
destination?: Destination;
|
|
222
224
|
messageTs?: string;
|
|
223
|
-
requester?:
|
|
225
|
+
requester?: Requester;
|
|
224
226
|
state: AgentPluginState;
|
|
225
227
|
teamId?: string;
|
|
226
228
|
threadTs?: string;
|