@sentry/junior-plugin-api 0.257.0 → 0.259.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 +2111 -2112
- package/dist/index.js +1093 -1266
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Command } from
|
|
3
|
-
|
|
1
|
+
import { ZodTypeAny, z } from "zod";
|
|
2
|
+
import { Command } from "commander";
|
|
4
3
|
/**
|
|
5
4
|
* Verified facts shared by Conversation annotations and Message cards.
|
|
6
5
|
* Plugins select small facts from responses they already have. Each surface owns
|
|
@@ -12,195 +11,109 @@ import { Command } from 'commander';
|
|
|
12
11
|
* Keep raw responses, diffs, logs, credentials, and comments out of this schema.
|
|
13
12
|
* See "Object facts" in packages/junior/src/chat/conversations/README.md.
|
|
14
13
|
*/
|
|
15
|
-
declare const objectAnnotationSchema: z.ZodObject<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
14
|
+
export declare const objectAnnotationSchema: z.ZodObject<{
|
|
15
|
+
kind: z.ZodLiteral<"object">;
|
|
16
|
+
key: z.ZodString;
|
|
17
|
+
label: z.ZodString;
|
|
18
|
+
objectType: z.ZodEnum<{
|
|
19
|
+
automation: "automation";
|
|
20
|
+
calendar_event: "calendar_event";
|
|
21
|
+
code_change: "code_change";
|
|
22
|
+
deployment: "deployment";
|
|
23
|
+
item: "item";
|
|
24
|
+
task: "task";
|
|
25
|
+
}>;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
url: z.ZodNullable<z.ZodURL>;
|
|
28
|
+
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
status: z.ZodOptional<z.ZodString>;
|
|
30
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
31
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
32
|
+
displayType: z.ZodOptional<z.ZodString>;
|
|
33
|
+
sourceUpdatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
34
|
+
facts: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"code_change">;
|
|
36
|
+
author: z.ZodOptional<z.ZodString>;
|
|
37
|
+
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
38
|
+
targetBranch: z.ZodOptional<z.ZodString>;
|
|
39
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
review: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
approved: "approved";
|
|
42
|
+
changes_requested: "changes_requested";
|
|
43
|
+
required: "required";
|
|
44
|
+
}>>;
|
|
45
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
passed: z.ZodNumber;
|
|
47
|
+
failed: z.ZodNumber;
|
|
48
|
+
pending: z.ZodNumber;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
additions: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
deletions: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"task">;
|
|
56
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
58
|
+
project: z.ZodOptional<z.ZodString>;
|
|
59
|
+
cycle: z.ZodOptional<z.ZodString>;
|
|
60
|
+
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
61
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"deployment">;
|
|
64
|
+
project: z.ZodOptional<z.ZodString>;
|
|
65
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
66
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
67
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
70
|
+
when: z.ZodOptional<z.ZodString>;
|
|
71
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
}, z.core.$strict>], "type">>;
|
|
74
73
|
}, z.core.$strict>;
|
|
75
|
-
type ObjectAnnotation = z.output<typeof objectAnnotationSchema>;
|
|
74
|
+
export type ObjectAnnotation = z.output<typeof objectAnnotationSchema>;
|
|
76
75
|
/** A saved object snapshot with its trusted owner. */
|
|
77
|
-
declare const ownedObjectAnnotationSchema: z.ZodObject<{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
deployment: "deployment";
|
|
85
|
-
calendar_event: "calendar_event";
|
|
86
|
-
automation: "automation";
|
|
87
|
-
item: "item";
|
|
88
|
-
}>;
|
|
89
|
-
title: z.ZodString;
|
|
90
|
-
url: z.ZodNullable<z.ZodURL>;
|
|
91
|
-
description: z.ZodOptional<z.ZodString>;
|
|
92
|
-
status: z.ZodOptional<z.ZodString>;
|
|
93
|
-
trigger: z.ZodOptional<z.ZodString>;
|
|
94
|
-
warning: z.ZodOptional<z.ZodString>;
|
|
95
|
-
displayType: z.ZodOptional<z.ZodString>;
|
|
96
|
-
sourceUpdatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
97
|
-
facts: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
-
type: z.ZodLiteral<"code_change">;
|
|
99
|
-
author: z.ZodOptional<z.ZodString>;
|
|
100
|
-
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
101
|
-
targetBranch: z.ZodOptional<z.ZodString>;
|
|
102
|
-
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
-
review: z.ZodOptional<z.ZodEnum<{
|
|
104
|
-
required: "required";
|
|
105
|
-
approved: "approved";
|
|
106
|
-
changes_requested: "changes_requested";
|
|
107
|
-
}>>;
|
|
108
|
-
checks: z.ZodOptional<z.ZodObject<{
|
|
109
|
-
passed: z.ZodNumber;
|
|
110
|
-
failed: z.ZodNumber;
|
|
111
|
-
pending: z.ZodNumber;
|
|
112
|
-
}, z.core.$strict>>;
|
|
113
|
-
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
-
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
115
|
-
additions: z.ZodOptional<z.ZodNumber>;
|
|
116
|
-
deletions: z.ZodOptional<z.ZodNumber>;
|
|
117
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
-
type: z.ZodLiteral<"task">;
|
|
119
|
-
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
-
priority: z.ZodOptional<z.ZodString>;
|
|
121
|
-
project: z.ZodOptional<z.ZodString>;
|
|
122
|
-
cycle: z.ZodOptional<z.ZodString>;
|
|
123
|
-
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
124
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
126
|
-
type: z.ZodLiteral<"deployment">;
|
|
127
|
-
project: z.ZodOptional<z.ZodString>;
|
|
128
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
129
|
-
revision: z.ZodOptional<z.ZodString>;
|
|
130
|
-
branch: z.ZodOptional<z.ZodString>;
|
|
131
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
-
type: z.ZodLiteral<"calendar_event">;
|
|
133
|
-
when: z.ZodOptional<z.ZodString>;
|
|
134
|
-
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
|
-
}, z.core.$strict>], "type">>;
|
|
136
|
-
plugin: z.ZodString;
|
|
137
|
-
}, z.core.$strict>;
|
|
138
|
-
type OwnedObjectAnnotation = z.output<typeof ownedObjectAnnotationSchema>;
|
|
139
|
-
|
|
140
|
-
/** Native object types. `task` is the stored name for a Ticket. */
|
|
141
|
-
declare const objectTypeSchema: z.ZodEnum<{
|
|
76
|
+
export declare const ownedObjectAnnotationSchema: z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"object">;
|
|
78
|
+
key: z.ZodString;
|
|
79
|
+
label: z.ZodString;
|
|
80
|
+
objectType: z.ZodEnum<{
|
|
81
|
+
automation: "automation";
|
|
82
|
+
calendar_event: "calendar_event";
|
|
142
83
|
code_change: "code_change";
|
|
143
|
-
task: "task";
|
|
144
84
|
deployment: "deployment";
|
|
145
|
-
calendar_event: "calendar_event";
|
|
146
|
-
automation: "automation";
|
|
147
85
|
item: "item";
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
160
|
-
}): {
|
|
161
|
-
icon: ObjectIconName;
|
|
162
|
-
tone: ObjectTone;
|
|
163
|
-
label: string;
|
|
164
|
-
};
|
|
165
|
-
/** Public, versioned asset path shared by Slack delivery and the web host. */
|
|
166
|
-
declare function objectIconPath(icon: ObjectIconName): string;
|
|
167
|
-
|
|
168
|
-
/** Original Octicons paths, shared by web and Slack image assets. */
|
|
169
|
-
declare const objectIconPaths: {
|
|
170
|
-
"issue-opened": string[];
|
|
171
|
-
"issue-closed": string[];
|
|
172
|
-
"git-pull-request": string[];
|
|
173
|
-
"git-pull-request-draft": string[];
|
|
174
|
-
"git-pull-request-closed": string[];
|
|
175
|
-
"git-merge": string[];
|
|
176
|
-
workflow: string[];
|
|
177
|
-
rocket: string[];
|
|
178
|
-
calendar: string[];
|
|
179
|
-
package: string[];
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
/** Small, provider-neutral facts. Missing values mean unknown, not success. */
|
|
183
|
-
declare const objectFactsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
86
|
+
task: "task";
|
|
87
|
+
}>;
|
|
88
|
+
title: z.ZodString;
|
|
89
|
+
url: z.ZodNullable<z.ZodURL>;
|
|
90
|
+
description: z.ZodOptional<z.ZodString>;
|
|
91
|
+
status: z.ZodOptional<z.ZodString>;
|
|
92
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
93
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
94
|
+
displayType: z.ZodOptional<z.ZodString>;
|
|
95
|
+
sourceUpdatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
96
|
+
facts: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
184
97
|
type: z.ZodLiteral<"code_change">;
|
|
185
98
|
author: z.ZodOptional<z.ZodString>;
|
|
186
99
|
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
187
100
|
targetBranch: z.ZodOptional<z.ZodString>;
|
|
188
101
|
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
189
102
|
review: z.ZodOptional<z.ZodEnum<{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
103
|
+
approved: "approved";
|
|
104
|
+
changes_requested: "changes_requested";
|
|
105
|
+
required: "required";
|
|
193
106
|
}>>;
|
|
194
107
|
checks: z.ZodOptional<z.ZodObject<{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
108
|
+
passed: z.ZodNumber;
|
|
109
|
+
failed: z.ZodNumber;
|
|
110
|
+
pending: z.ZodNumber;
|
|
198
111
|
}, z.core.$strict>>;
|
|
199
112
|
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
200
113
|
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
201
114
|
additions: z.ZodOptional<z.ZodNumber>;
|
|
202
115
|
deletions: z.ZodOptional<z.ZodNumber>;
|
|
203
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
204
117
|
type: z.ZodLiteral<"task">;
|
|
205
118
|
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
206
119
|
priority: z.ZodOptional<z.ZodString>;
|
|
@@ -208,1742 +121,1817 @@ declare const objectFactsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
208
121
|
cycle: z.ZodOptional<z.ZodString>;
|
|
209
122
|
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
210
123
|
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
211
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
124
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
212
125
|
type: z.ZodLiteral<"deployment">;
|
|
213
126
|
project: z.ZodOptional<z.ZodString>;
|
|
214
127
|
environment: z.ZodOptional<z.ZodString>;
|
|
215
128
|
revision: z.ZodOptional<z.ZodString>;
|
|
216
129
|
branch: z.ZodOptional<z.ZodString>;
|
|
217
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
218
131
|
type: z.ZodLiteral<"calendar_event">;
|
|
219
132
|
when: z.ZodOptional<z.ZodString>;
|
|
220
133
|
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
|
+
}, z.core.$strict>], "type">>;
|
|
135
|
+
plugin: z.ZodString;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
export type OwnedObjectAnnotation = z.output<typeof ownedObjectAnnotationSchema>;
|
|
138
|
+
/** Native object types. `task` is the stored name for a Ticket. */
|
|
139
|
+
export declare const objectTypeSchema: z.ZodEnum<{
|
|
140
|
+
automation: "automation";
|
|
141
|
+
calendar_event: "calendar_event";
|
|
142
|
+
code_change: "code_change";
|
|
143
|
+
deployment: "deployment";
|
|
144
|
+
item: "item";
|
|
145
|
+
task: "task";
|
|
146
|
+
}>;
|
|
147
|
+
export type ObjectType = z.output<typeof objectTypeSchema>;
|
|
148
|
+
declare const objectIconNames: readonly ["issue-opened", "issue-closed", "git-pull-request", "git-pull-request-draft", "git-pull-request-closed", "git-merge", "workflow", "rocket", "calendar", "package"];
|
|
149
|
+
export type ObjectIconName = (typeof objectIconNames)[number];
|
|
150
|
+
export type ObjectTone = "neutral" | "success" | "danger" | "warning" | "info" | "accent";
|
|
151
|
+
/** Resolve identity and state without replacing the type icon with a warning. */
|
|
152
|
+
export declare function objectPresentation(object: {
|
|
153
|
+
objectType: ObjectType;
|
|
154
|
+
status?: string;
|
|
155
|
+
facts?: {
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
}): {
|
|
159
|
+
icon: ObjectIconName;
|
|
160
|
+
tone: ObjectTone;
|
|
161
|
+
label: string;
|
|
162
|
+
};
|
|
163
|
+
/** Public, versioned asset path shared by Slack delivery and the web host. */
|
|
164
|
+
export declare function objectIconPath(icon: ObjectIconName): string;
|
|
165
|
+
/** Original Octicons paths, shared by web and Slack image assets. */
|
|
166
|
+
export declare const objectIconPaths: {
|
|
167
|
+
"issue-opened": string[];
|
|
168
|
+
"issue-closed": string[];
|
|
169
|
+
"git-pull-request": string[];
|
|
170
|
+
"git-pull-request-draft": string[];
|
|
171
|
+
"git-pull-request-closed": string[];
|
|
172
|
+
"git-merge": string[];
|
|
173
|
+
workflow: string[];
|
|
174
|
+
rocket: string[];
|
|
175
|
+
calendar: string[];
|
|
176
|
+
package: string[];
|
|
177
|
+
};
|
|
178
|
+
/** Small, provider-neutral facts. Missing values mean unknown, not success. */
|
|
179
|
+
export declare const objectFactsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"code_change">;
|
|
181
|
+
author: z.ZodOptional<z.ZodString>;
|
|
182
|
+
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
183
|
+
targetBranch: z.ZodOptional<z.ZodString>;
|
|
184
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
+
review: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
approved: "approved";
|
|
187
|
+
changes_requested: "changes_requested";
|
|
188
|
+
required: "required";
|
|
189
|
+
}>>;
|
|
190
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
passed: z.ZodNumber;
|
|
192
|
+
failed: z.ZodNumber;
|
|
193
|
+
pending: z.ZodNumber;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
196
|
+
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
additions: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
deletions: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"task">;
|
|
201
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
203
|
+
project: z.ZodOptional<z.ZodString>;
|
|
204
|
+
cycle: z.ZodOptional<z.ZodString>;
|
|
205
|
+
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
206
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"deployment">;
|
|
209
|
+
project: z.ZodOptional<z.ZodString>;
|
|
210
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
211
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
212
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
214
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
215
|
+
when: z.ZodOptional<z.ZodString>;
|
|
216
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
217
|
}, z.core.$strict>], "type">;
|
|
222
|
-
type ObjectFacts = z.output<typeof objectFactsSchema>;
|
|
218
|
+
export type ObjectFacts = z.output<typeof objectFactsSchema>;
|
|
223
219
|
type ObjectField = {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
220
|
+
key: string;
|
|
221
|
+
label: string;
|
|
222
|
+
value: string;
|
|
227
223
|
};
|
|
228
224
|
/** Show at most four card attributes, in priority order, on every surface. */
|
|
229
|
-
declare function objectFactFields(facts: ObjectFacts | undefined): ObjectField[];
|
|
230
|
-
|
|
225
|
+
export declare function objectFactFields(facts: ObjectFacts | undefined): ObjectField[];
|
|
231
226
|
/** Exact non-blank actor user id that rejects the sentinel "unknown". */
|
|
232
|
-
declare const actorUserIdSchema: z.ZodString;
|
|
233
|
-
declare const nonBlankStringSchema: z.ZodString;
|
|
227
|
+
export declare const actorUserIdSchema: z.ZodString;
|
|
228
|
+
export declare const nonBlankStringSchema: z.ZodString;
|
|
234
229
|
/** Complete Slack Location associated with a Conversation. */
|
|
235
|
-
declare const slackLocationSchema: z.ZodObject<{
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
230
|
+
export declare const slackLocationSchema: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
provider: z.ZodLiteral<"slack">;
|
|
233
|
+
teamId: z.ZodString;
|
|
234
|
+
channelId: z.ZodString;
|
|
235
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
241
236
|
}, z.core.$strict>;
|
|
242
237
|
/** Complete Location types supported by Junior. */
|
|
243
|
-
declare const locationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
238
|
+
export declare const locationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
provider: z.ZodLiteral<"slack">;
|
|
241
|
+
teamId: z.ZodString;
|
|
242
|
+
channelId: z.ZodString;
|
|
243
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
249
244
|
}, z.core.$strict>], "provider">;
|
|
250
245
|
/** Runtime platform names supported by plugin public contracts. */
|
|
251
|
-
declare const platformSchema: z.ZodEnum<{
|
|
252
|
-
|
|
253
|
-
|
|
246
|
+
export declare const platformSchema: z.ZodEnum<{
|
|
247
|
+
local: "local";
|
|
248
|
+
slack: "slack";
|
|
254
249
|
}>;
|
|
255
250
|
/** Runtime source visibility visible to plugins. */
|
|
256
|
-
declare const sourceVisibilitySchema: z.ZodEnum<{
|
|
257
|
-
|
|
258
|
-
|
|
251
|
+
export declare const sourceVisibilitySchema: z.ZodEnum<{
|
|
252
|
+
private: "private";
|
|
253
|
+
public: "public";
|
|
259
254
|
}>;
|
|
260
255
|
/** Provider-neutral visibility of a routed destination. */
|
|
261
|
-
declare const destinationVisibilitySchema: z.ZodEnum<{
|
|
262
|
-
|
|
263
|
-
|
|
256
|
+
export declare const destinationVisibilitySchema: z.ZodEnum<{
|
|
257
|
+
private: "private";
|
|
258
|
+
public: "public";
|
|
264
259
|
}>;
|
|
265
260
|
/** Runtime-owned Slack address for routing future work or side effects. */
|
|
266
|
-
declare const slackDestinationSchema: z.ZodObject<{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
261
|
+
export declare const slackDestinationSchema: z.ZodObject<{
|
|
262
|
+
platform: z.ZodLiteral<"slack">;
|
|
263
|
+
teamId: z.ZodString;
|
|
264
|
+
channelId: z.ZodString;
|
|
265
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
271
266
|
}, z.core.$strict>;
|
|
272
267
|
/** Runtime-owned local CLI conversation address. */
|
|
273
|
-
declare const localDestinationSchema: z.ZodObject<{
|
|
274
|
-
|
|
275
|
-
|
|
268
|
+
export declare const localDestinationSchema: z.ZodObject<{
|
|
269
|
+
platform: z.ZodLiteral<"local">;
|
|
270
|
+
conversationId: z.ZodString;
|
|
276
271
|
}, z.core.$strict>;
|
|
277
272
|
/** Runtime-owned provider-neutral address for routing future work or side effects. */
|
|
278
|
-
declare const destinationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
273
|
+
export declare const destinationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
274
|
+
platform: z.ZodLiteral<"slack">;
|
|
275
|
+
teamId: z.ZodString;
|
|
276
|
+
channelId: z.ZodString;
|
|
277
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
283
278
|
}, z.core.$strict>, z.ZodObject<{
|
|
284
|
-
|
|
285
|
-
|
|
279
|
+
platform: z.ZodLiteral<"local">;
|
|
280
|
+
conversationId: z.ZodString;
|
|
286
281
|
}, z.core.$strict>], "platform">;
|
|
287
282
|
/** One visible effect after successful automated work. */
|
|
288
|
-
declare const taskOutcomeSchema: z.ZodObject<{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
teamId: z.ZodString;
|
|
293
|
-
channelId: z.ZodString;
|
|
294
|
-
threadTs: z.ZodOptional<z.ZodString>;
|
|
295
|
-
}, z.core.$strict>;
|
|
296
|
-
}, z.core.$strict>;
|
|
297
|
-
/** Runtime-owned Slack input Source. */
|
|
298
|
-
declare const slackSourceSchema: z.ZodObject<{
|
|
299
|
-
kind: z.ZodLiteral<"slack">;
|
|
283
|
+
export declare const taskOutcomeSchema: z.ZodObject<{
|
|
284
|
+
action: z.ZodLiteral<"send_message">;
|
|
285
|
+
destination: z.ZodObject<{
|
|
286
|
+
platform: z.ZodLiteral<"slack">;
|
|
300
287
|
teamId: z.ZodString;
|
|
301
288
|
channelId: z.ZodString;
|
|
302
|
-
visibility: z.ZodEnum<{
|
|
303
|
-
public: "public";
|
|
304
|
-
private: "private";
|
|
305
|
-
}>;
|
|
306
|
-
messageTs: z.ZodOptional<z.ZodString>;
|
|
307
289
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
290
|
+
}, z.core.$strict>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
/** Runtime-owned Slack input Source. */
|
|
293
|
+
export declare const slackSourceSchema: z.ZodObject<{
|
|
294
|
+
kind: z.ZodLiteral<"slack">;
|
|
295
|
+
teamId: z.ZodString;
|
|
296
|
+
channelId: z.ZodString;
|
|
297
|
+
visibility: z.ZodEnum<{
|
|
298
|
+
private: "private";
|
|
299
|
+
public: "public";
|
|
300
|
+
}>;
|
|
301
|
+
messageTs: z.ZodOptional<z.ZodString>;
|
|
302
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
308
303
|
}, z.core.$strict>;
|
|
309
304
|
/** Runtime-owned local CLI input Source. */
|
|
310
|
-
declare const localSourceSchema: z.ZodObject<{
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
305
|
+
export declare const localSourceSchema: z.ZodObject<{
|
|
306
|
+
kind: z.ZodLiteral<"local">;
|
|
307
|
+
visibility: z.ZodLiteral<"private">;
|
|
308
|
+
conversationId: z.ZodString;
|
|
314
309
|
}, z.core.$strict>;
|
|
315
310
|
/** Runtime-owned dashboard input Source. */
|
|
316
|
-
declare const webSourceSchema: z.ZodObject<{
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
311
|
+
export declare const webSourceSchema: z.ZodObject<{
|
|
312
|
+
kind: z.ZodLiteral<"web">;
|
|
313
|
+
visibility: z.ZodEnum<{
|
|
314
|
+
private: "private";
|
|
315
|
+
public: "public";
|
|
316
|
+
}>;
|
|
317
|
+
conversationId: z.ZodString;
|
|
323
318
|
}, z.core.$strict>;
|
|
324
319
|
/** Runtime-owned Event input Source. */
|
|
325
|
-
declare const eventSourceSchema: z.ZodObject<{
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
320
|
+
export declare const eventSourceSchema: z.ZodObject<{
|
|
321
|
+
kind: z.ZodLiteral<"event">;
|
|
322
|
+
eventKey: z.ZodString;
|
|
323
|
+
eventType: z.ZodString;
|
|
324
|
+
identifier: z.ZodString;
|
|
325
|
+
namespace: z.ZodString;
|
|
331
326
|
}, z.core.$strict>;
|
|
332
327
|
/** Runtime-owned Scheduled automation input Source. */
|
|
333
|
-
declare const scheduledAutomationSourceSchema: z.ZodObject<{
|
|
334
|
-
|
|
328
|
+
export declare const scheduledAutomationSourceSchema: z.ZodObject<{
|
|
329
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
330
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
331
|
+
kind: z.ZodLiteral<"scheduled_automation">;
|
|
335
332
|
}, z.core.$strict>;
|
|
336
333
|
/** Runtime-owned Event automation input Source. */
|
|
337
|
-
declare const eventAutomationSourceSchema: z.ZodObject<{
|
|
338
|
-
|
|
334
|
+
export declare const eventAutomationSourceSchema: z.ZodObject<{
|
|
335
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
336
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
337
|
+
kind: z.ZodLiteral<"event_automation">;
|
|
339
338
|
}, z.core.$strict>;
|
|
340
339
|
/** Runtime-owned Plugin dispatch input Source. */
|
|
341
|
-
declare const pluginDispatchSourceSchema: z.ZodObject<{
|
|
342
|
-
|
|
340
|
+
export declare const pluginDispatchSourceSchema: z.ZodObject<{
|
|
341
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
343
342
|
}, z.core.$strict>;
|
|
344
343
|
/** Runtime-owned Agent invocation input Source. */
|
|
345
|
-
declare const agentInvocationSourceSchema: z.ZodObject<{
|
|
346
|
-
|
|
344
|
+
export declare const agentInvocationSourceSchema: z.ZodObject<{
|
|
345
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
347
346
|
}, z.core.$strict>;
|
|
348
347
|
/** Runtime-owned input Source. Stored `platform` and Location fields normalize on read. */
|
|
349
|
-
declare const sourceSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
348
|
+
export declare const sourceSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
349
|
+
kind: z.ZodLiteral<"slack">;
|
|
350
|
+
teamId: z.ZodString;
|
|
351
|
+
channelId: z.ZodString;
|
|
352
|
+
visibility: z.ZodEnum<{
|
|
353
|
+
private: "private";
|
|
354
|
+
public: "public";
|
|
355
|
+
}>;
|
|
356
|
+
messageTs: z.ZodOptional<z.ZodString>;
|
|
357
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
359
358
|
}, z.core.$strict>, z.ZodObject<{
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
kind: z.ZodLiteral<"local">;
|
|
360
|
+
visibility: z.ZodLiteral<"private">;
|
|
361
|
+
conversationId: z.ZodString;
|
|
363
362
|
}, z.core.$strict>, z.ZodObject<{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
363
|
+
kind: z.ZodLiteral<"web">;
|
|
364
|
+
visibility: z.ZodEnum<{
|
|
365
|
+
private: "private";
|
|
366
|
+
public: "public";
|
|
367
|
+
}>;
|
|
368
|
+
conversationId: z.ZodString;
|
|
370
369
|
}, z.core.$strict>, z.ZodObject<{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
370
|
+
kind: z.ZodLiteral<"event">;
|
|
371
|
+
eventKey: z.ZodString;
|
|
372
|
+
eventType: z.ZodString;
|
|
373
|
+
identifier: z.ZodString;
|
|
374
|
+
namespace: z.ZodString;
|
|
376
375
|
}, z.core.$strict>, z.ZodObject<{
|
|
377
|
-
|
|
376
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
377
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
378
|
+
kind: z.ZodLiteral<"scheduled_automation">;
|
|
378
379
|
}, z.core.$strict>, z.ZodObject<{
|
|
379
|
-
|
|
380
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
381
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
382
|
+
kind: z.ZodLiteral<"event_automation">;
|
|
380
383
|
}, z.core.$strict>, z.ZodObject<{
|
|
381
|
-
|
|
384
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
382
385
|
}, z.core.$strict>, z.ZodObject<{
|
|
383
|
-
|
|
386
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
384
387
|
}, z.core.$strict>], "kind">, unknown>;
|
|
385
388
|
/** Stable user credential subject shape accepted from plugins. */
|
|
386
|
-
declare const pluginCredentialSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
export declare const pluginCredentialSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
390
|
+
type: z.ZodLiteral<"user">;
|
|
391
|
+
userId: z.ZodString;
|
|
392
|
+
allowedWhen: z.ZodLiteral<"private-direct-conversation">;
|
|
390
393
|
}, z.core.$strict>, z.ZodObject<{
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
type: z.ZodLiteral<"user">;
|
|
395
|
+
userId: z.ZodString;
|
|
396
|
+
allowedWhen: z.ZodLiteral<"scheduled-automation">;
|
|
397
|
+
taskId: z.ZodString;
|
|
395
398
|
}, z.core.$strict>], "allowedWhen">;
|
|
396
|
-
declare const slackActorSchema: z.ZodObject<{
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
export declare const slackActorSchema: z.ZodObject<{
|
|
400
|
+
email: z.ZodOptional<z.ZodString>;
|
|
401
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
402
|
+
userId: z.ZodString;
|
|
403
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
404
|
+
platform: z.ZodLiteral<"slack">;
|
|
405
|
+
teamId: z.ZodString;
|
|
403
406
|
}, z.core.$strict>;
|
|
404
|
-
declare const localActorSchema: z.ZodObject<{
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
export declare const localActorSchema: z.ZodObject<{
|
|
408
|
+
email: z.ZodOptional<z.ZodString>;
|
|
409
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
410
|
+
userId: z.ZodString;
|
|
411
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
412
|
+
platform: z.ZodLiteral<"local">;
|
|
410
413
|
}, z.core.$strict>;
|
|
411
|
-
declare const webActorSchema: z.ZodObject<{
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
export declare const webActorSchema: z.ZodObject<{
|
|
415
|
+
email: z.ZodOptional<z.ZodString>;
|
|
416
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
417
|
+
userId: z.ZodString;
|
|
418
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
419
|
+
platform: z.ZodLiteral<"web">;
|
|
417
420
|
}, z.core.$strict>;
|
|
418
|
-
declare const systemActorSchema: z.ZodObject<{
|
|
419
|
-
|
|
420
|
-
|
|
421
|
+
export declare const systemActorSchema: z.ZodObject<{
|
|
422
|
+
platform: z.ZodLiteral<"system">;
|
|
423
|
+
name: z.ZodString;
|
|
421
424
|
}, z.core.$strict>;
|
|
422
425
|
/** Runtime-provided actor identity visible to plugin hooks. */
|
|
423
|
-
declare const actorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
426
|
+
export declare const actorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
427
|
+
email: z.ZodOptional<z.ZodString>;
|
|
428
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
429
|
+
userId: z.ZodString;
|
|
430
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
431
|
+
platform: z.ZodLiteral<"slack">;
|
|
432
|
+
teamId: z.ZodString;
|
|
430
433
|
}, z.core.$strict>, z.ZodObject<{
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
434
|
+
email: z.ZodOptional<z.ZodString>;
|
|
435
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
436
|
+
userId: z.ZodString;
|
|
437
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
438
|
+
platform: z.ZodLiteral<"local">;
|
|
436
439
|
}, z.core.$strict>, z.ZodObject<{
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
email: z.ZodOptional<z.ZodString>;
|
|
441
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
442
|
+
userId: z.ZodString;
|
|
443
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
444
|
+
platform: z.ZodLiteral<"web">;
|
|
442
445
|
}, z.core.$strict>, z.ZodObject<{
|
|
443
|
-
|
|
444
|
-
|
|
446
|
+
platform: z.ZodLiteral<"system">;
|
|
447
|
+
name: z.ZodString;
|
|
445
448
|
}, z.core.$strict>], "platform">;
|
|
446
449
|
/** Core-owned provider account linked to a user when verified. */
|
|
447
|
-
declare const identitySchema: z.ZodObject<{
|
|
450
|
+
export declare const identitySchema: z.ZodObject<{
|
|
451
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
452
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
453
|
+
id: z.ZodString;
|
|
454
|
+
provider: z.ZodString;
|
|
455
|
+
providerSubjectId: z.ZodString;
|
|
456
|
+
providerTenantId: z.ZodOptional<z.ZodString>;
|
|
457
|
+
}, z.core.$strict>;
|
|
458
|
+
/** Core-owned person with every linked provider identity. */
|
|
459
|
+
export declare const userSchema: z.ZodObject<{
|
|
460
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
461
|
+
email: z.ZodString;
|
|
462
|
+
id: z.ZodString;
|
|
463
|
+
identities: z.ZodArray<z.ZodObject<{
|
|
448
464
|
displayName: z.ZodOptional<z.ZodString>;
|
|
449
465
|
handle: z.ZodOptional<z.ZodString>;
|
|
450
466
|
id: z.ZodString;
|
|
451
467
|
provider: z.ZodString;
|
|
452
468
|
providerSubjectId: z.ZodString;
|
|
453
469
|
providerTenantId: z.ZodOptional<z.ZodString>;
|
|
454
|
-
}, z.core.$strict
|
|
455
|
-
|
|
456
|
-
declare const userSchema: z.ZodObject<{
|
|
457
|
-
displayName: z.ZodOptional<z.ZodString>;
|
|
458
|
-
email: z.ZodString;
|
|
459
|
-
id: z.ZodString;
|
|
460
|
-
identities: z.ZodArray<z.ZodObject<{
|
|
461
|
-
displayName: z.ZodOptional<z.ZodString>;
|
|
462
|
-
handle: z.ZodOptional<z.ZodString>;
|
|
463
|
-
id: z.ZodString;
|
|
464
|
-
provider: z.ZodString;
|
|
465
|
-
providerSubjectId: z.ZodString;
|
|
466
|
-
providerTenantId: z.ZodOptional<z.ZodString>;
|
|
467
|
-
}, z.core.$strict>>;
|
|
468
|
-
isAdmin: z.ZodOptional<z.ZodLiteral<true>>;
|
|
470
|
+
}, z.core.$strict>>;
|
|
471
|
+
isAdmin: z.ZodOptional<z.ZodLiteral<true>>;
|
|
469
472
|
}, z.core.$strict>;
|
|
470
473
|
/** Compact destination-visible context explaining what produced a reply. */
|
|
471
|
-
declare const replyAttributionSchema: z.ZodObject<{
|
|
472
|
-
|
|
473
|
-
|
|
474
|
+
export declare const replyAttributionSchema: z.ZodObject<{
|
|
475
|
+
label: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
476
|
+
detail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
|
|
474
477
|
}, z.core.$strict>;
|
|
475
478
|
/** Plugin dispatch request accepted by Junior core. */
|
|
476
|
-
declare const dispatchOptionsSchema: z.ZodObject<{
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}, z.core.$strict>;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
type
|
|
508
|
-
type
|
|
509
|
-
type
|
|
510
|
-
type
|
|
511
|
-
type
|
|
512
|
-
type
|
|
513
|
-
type
|
|
514
|
-
type
|
|
515
|
-
type Source = z.output<typeof sourceSchema>;
|
|
479
|
+
export declare const dispatchOptionsSchema: z.ZodObject<{
|
|
480
|
+
idempotencyKey: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
481
|
+
credentialSubject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
482
|
+
type: z.ZodLiteral<"user">;
|
|
483
|
+
userId: z.ZodString;
|
|
484
|
+
allowedWhen: z.ZodLiteral<"private-direct-conversation">;
|
|
485
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
486
|
+
type: z.ZodLiteral<"user">;
|
|
487
|
+
userId: z.ZodString;
|
|
488
|
+
allowedWhen: z.ZodLiteral<"scheduled-automation">;
|
|
489
|
+
taskId: z.ZodString;
|
|
490
|
+
}, z.core.$strict>], "allowedWhen">>;
|
|
491
|
+
destination: z.ZodObject<{
|
|
492
|
+
platform: z.ZodLiteral<"slack">;
|
|
493
|
+
teamId: z.ZodString;
|
|
494
|
+
channelId: z.ZodString;
|
|
495
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strict>;
|
|
497
|
+
destinationVisibility: z.ZodEnum<{
|
|
498
|
+
private: "private";
|
|
499
|
+
public: "public";
|
|
500
|
+
}>;
|
|
501
|
+
input: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
502
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
503
|
+
replyAttribution: z.ZodOptional<z.ZodObject<{
|
|
504
|
+
label: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
505
|
+
detail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
|
|
506
|
+
}, z.core.$strict>>;
|
|
507
|
+
}, z.core.$strict>;
|
|
508
|
+
/** Runtime platform name without source or destination coordinates. */
|
|
509
|
+
export type Platform = z.output<typeof platformSchema>;
|
|
510
|
+
export type Actor = z.output<typeof actorSchema>;
|
|
511
|
+
export type SlackActor = z.output<typeof slackActorSchema>;
|
|
512
|
+
export type LocalActor = z.output<typeof localActorSchema>;
|
|
513
|
+
export type WebActor = z.output<typeof webActorSchema>;
|
|
514
|
+
export type SystemActor = z.output<typeof systemActorSchema>;
|
|
515
|
+
export type Identity = z.output<typeof identitySchema>;
|
|
516
|
+
export type User = z.output<typeof userSchema>;
|
|
517
|
+
export type Source = z.output<typeof sourceSchema>;
|
|
516
518
|
/** Validated Location associated with a Conversation. */
|
|
517
|
-
type Location = z.output<typeof locationSchema>;
|
|
519
|
+
export type Location = z.output<typeof locationSchema>;
|
|
518
520
|
/** Complete Slack Location associated with a Conversation. */
|
|
519
|
-
type SlackLocation = z.output<typeof slackLocationSchema>;
|
|
520
|
-
type SlackSource = Extract<Source, {
|
|
521
|
-
|
|
521
|
+
export type SlackLocation = z.output<typeof slackLocationSchema>;
|
|
522
|
+
export type SlackSource = Extract<Source, {
|
|
523
|
+
kind: "slack";
|
|
522
524
|
}>;
|
|
523
|
-
type LocalSource = Extract<Source, {
|
|
524
|
-
|
|
525
|
+
export type LocalSource = Extract<Source, {
|
|
526
|
+
kind: "local";
|
|
525
527
|
}>;
|
|
526
|
-
type WebSource = Extract<Source, {
|
|
527
|
-
|
|
528
|
+
export type WebSource = Extract<Source, {
|
|
529
|
+
kind: "web";
|
|
528
530
|
}>;
|
|
529
|
-
type EventSource = Extract<Source, {
|
|
530
|
-
|
|
531
|
+
export type EventSource = Extract<Source, {
|
|
532
|
+
kind: "event";
|
|
531
533
|
}>;
|
|
532
|
-
type ScheduledAutomationSource = Extract<Source, {
|
|
533
|
-
|
|
534
|
+
export type ScheduledAutomationSource = Extract<Source, {
|
|
535
|
+
kind: "scheduled_automation";
|
|
534
536
|
}>;
|
|
535
|
-
type EventAutomationSource = Extract<Source, {
|
|
536
|
-
|
|
537
|
+
export type EventAutomationSource = Extract<Source, {
|
|
538
|
+
kind: "event_automation";
|
|
537
539
|
}>;
|
|
538
|
-
type PluginDispatchSource = Extract<Source, {
|
|
539
|
-
|
|
540
|
+
export type PluginDispatchSource = Extract<Source, {
|
|
541
|
+
kind: "plugin_dispatch";
|
|
540
542
|
}>;
|
|
541
|
-
type AgentInvocationSource = Extract<Source, {
|
|
542
|
-
|
|
543
|
+
export type AgentInvocationSource = Extract<Source, {
|
|
544
|
+
kind: "agent_invocation";
|
|
543
545
|
}>;
|
|
544
|
-
type SourceVisibility = z.output<typeof sourceVisibilitySchema>;
|
|
545
|
-
type Destination = z.output<typeof destinationSchema>;
|
|
546
|
-
type SlackDestination = Extract<Destination, {
|
|
547
|
-
|
|
546
|
+
export type SourceVisibility = z.output<typeof sourceVisibilitySchema>;
|
|
547
|
+
export type Destination = z.output<typeof destinationSchema>;
|
|
548
|
+
export type SlackDestination = Extract<Destination, {
|
|
549
|
+
platform: "slack";
|
|
548
550
|
}>;
|
|
549
|
-
type LocalDestination = Extract<Destination, {
|
|
550
|
-
|
|
551
|
+
export type LocalDestination = Extract<Destination, {
|
|
552
|
+
platform: "local";
|
|
551
553
|
}>;
|
|
552
|
-
interface PluginMetadata {
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
interface PluginLogger {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}
|
|
560
|
-
interface PluginModel {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
interface PluginEmbedder {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
interface PluginContext {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
554
|
+
export interface PluginMetadata {
|
|
555
|
+
name: string;
|
|
556
|
+
}
|
|
557
|
+
export interface PluginLogger {
|
|
558
|
+
error(message: string, metadata?: Record<string, unknown>): void;
|
|
559
|
+
info(message: string, metadata?: Record<string, unknown>): void;
|
|
560
|
+
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
561
|
+
}
|
|
562
|
+
export interface PluginModel {
|
|
563
|
+
/** Run a host-owned structured model call without exposing provider credentials. */
|
|
564
|
+
completeObject<TSchema extends ZodTypeAny>(input: {
|
|
565
|
+
maxTokens?: number;
|
|
566
|
+
prompt: string;
|
|
567
|
+
schema: TSchema;
|
|
568
|
+
system?: string;
|
|
569
|
+
}): Promise<{
|
|
570
|
+
/** Best-effort estimated provider cost for this completion. */
|
|
571
|
+
costUsd?: number;
|
|
572
|
+
object: z.infer<TSchema>;
|
|
573
|
+
}>;
|
|
574
|
+
}
|
|
575
|
+
export interface PluginEmbedder {
|
|
576
|
+
/** Embed plugin-owned text for derived retrieval without exposing provider credentials. */
|
|
577
|
+
embedTexts(input: {
|
|
578
|
+
texts: string[];
|
|
579
|
+
}): Promise<{
|
|
580
|
+
/** Best-effort estimated provider cost for this embedding call. */
|
|
581
|
+
costUsd?: number;
|
|
582
|
+
dimensions: number;
|
|
583
|
+
model: string;
|
|
584
|
+
provider: string;
|
|
585
|
+
vectors: number[][];
|
|
586
|
+
}>;
|
|
587
|
+
}
|
|
588
|
+
export interface PluginContext {
|
|
589
|
+
/** Shared Drizzle database connection for plugin runtime code. */
|
|
590
|
+
db: unknown;
|
|
591
|
+
log: PluginLogger;
|
|
592
|
+
plugin: PluginMetadata;
|
|
591
593
|
}
|
|
592
594
|
interface BaseInvocationContext {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
interface SlackInvocationContext extends BaseInvocationContext {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
interface LocalInvocationContext extends BaseInvocationContext {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
interface WebInvocationContext extends BaseInvocationContext {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
interface EventInvocationContext extends BaseInvocationContext {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
type InvocationContext = LocalInvocationContext | SlackInvocationContext | WebInvocationContext | (BaseInvocationContext & {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
595
|
+
/**
|
|
596
|
+
* Opaque Junior conversation/session identity for this invocation.
|
|
597
|
+
* Interactive Slack turns use `slack:{channelId}:{threadTs}`.
|
|
598
|
+
*/
|
|
599
|
+
conversationId?: string;
|
|
600
|
+
/** Location associated with this Conversation. */
|
|
601
|
+
locationId?: string;
|
|
602
|
+
}
|
|
603
|
+
export interface SlackInvocationContext extends BaseInvocationContext {
|
|
604
|
+
/** Runtime-owned default outbound destination for this invocation. */
|
|
605
|
+
destination: SlackDestination;
|
|
606
|
+
actor?: SlackActor;
|
|
607
|
+
/** Runtime-owned source where the invocation came from. */
|
|
608
|
+
source: SlackSource;
|
|
609
|
+
}
|
|
610
|
+
export interface LocalInvocationContext extends BaseInvocationContext {
|
|
611
|
+
/** Runtime-owned default outbound destination for this invocation. */
|
|
612
|
+
destination: LocalDestination;
|
|
613
|
+
actor?: LocalActor;
|
|
614
|
+
/** Runtime-owned source where the invocation came from. */
|
|
615
|
+
source: LocalSource;
|
|
616
|
+
}
|
|
617
|
+
export interface WebInvocationContext extends BaseInvocationContext {
|
|
618
|
+
/** Existing conversation destination used for location and tool context. */
|
|
619
|
+
destination: Destination;
|
|
620
|
+
actor?: WebActor;
|
|
621
|
+
/** Runtime-owned dashboard/web source for this invocation. */
|
|
622
|
+
source: WebSource;
|
|
623
|
+
}
|
|
624
|
+
export interface EventInvocationContext extends BaseInvocationContext {
|
|
625
|
+
/** Existing conversation destination used for tool context. */
|
|
626
|
+
destination: Destination;
|
|
627
|
+
actor?: Actor;
|
|
628
|
+
/** Runtime-owned Event Source for this invocation. */
|
|
629
|
+
source: EventSource;
|
|
630
|
+
}
|
|
631
|
+
export type InvocationContext = LocalInvocationContext | SlackInvocationContext | WebInvocationContext | (BaseInvocationContext & {
|
|
632
|
+
destination: Destination;
|
|
633
|
+
actor?: Actor;
|
|
634
|
+
source: AgentInvocationSource | EventAutomationSource | PluginDispatchSource | EventSource | ScheduledAutomationSource;
|
|
633
635
|
});
|
|
634
636
|
/** Build a normalized Slack source from runtime-owned Slack coordinates. */
|
|
635
|
-
declare function createSlackSource(input: {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
637
|
+
export declare function createSlackSource(input: {
|
|
638
|
+
channelId: string;
|
|
639
|
+
messageTs?: string;
|
|
640
|
+
teamId: string;
|
|
641
|
+
threadTs?: string;
|
|
642
|
+
/** Runtime-normalized source visibility. */
|
|
643
|
+
visibility: SourceVisibility;
|
|
642
644
|
}): SlackSource;
|
|
643
645
|
/** Build a normalized local source from a local conversation id. */
|
|
644
|
-
declare function createLocalSource(conversationId: string): LocalSource;
|
|
646
|
+
export declare function createLocalSource(conversationId: string): LocalSource;
|
|
645
647
|
/** Build a normalized web/dashboard source from a conversation id. */
|
|
646
|
-
declare function createWebSource(conversationId: string, visibility?: SourceVisibility): WebSource;
|
|
648
|
+
export declare function createWebSource(conversationId: string, visibility?: SourceVisibility): WebSource;
|
|
647
649
|
/** Build a normalized Event Source from one matched event. */
|
|
648
|
-
declare function createEventSource(input: {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
650
|
+
export declare function createEventSource(input: {
|
|
651
|
+
eventKey: string;
|
|
652
|
+
eventType: string;
|
|
653
|
+
identifier: string;
|
|
654
|
+
namespace: string;
|
|
653
655
|
}): EventSource;
|
|
654
656
|
/** Return whether a source is private to a person or restricted group. */
|
|
655
|
-
declare function isPrivateSource(source: Source): boolean;
|
|
657
|
+
export declare function isPrivateSource(source: Source): boolean;
|
|
656
658
|
/** Return the stable source identity used for idempotency and attribution. */
|
|
657
|
-
declare function getSourceKey(source: Source): string | undefined;
|
|
659
|
+
export declare function getSourceKey(source: Source): string | undefined;
|
|
658
660
|
/** Narrow a runtime destination to the Slack-specific address shape. */
|
|
659
|
-
declare function isSlackDestination(destination: Destination | undefined): destination is SlackDestination;
|
|
660
|
-
|
|
661
|
+
export declare function isSlackDestination(destination: Destination | undefined): destination is SlackDestination;
|
|
661
662
|
/**
|
|
662
663
|
* Link an object to a Conversation when the owner has no typed object preview.
|
|
663
664
|
* Keep a stable key, compact label, source URL, and optional short context or
|
|
664
665
|
* status. Do not fetch a full object merely to save a link. Rich preview intent
|
|
665
666
|
* belongs to objectAnnotationSchema, not a second set of resource-link fields.
|
|
666
667
|
*/
|
|
667
|
-
declare const resourceLinkAnnotationSchema: z.ZodObject<{
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
668
|
+
export declare const resourceLinkAnnotationSchema: z.ZodObject<{
|
|
669
|
+
kind: z.ZodLiteral<"resource_link">;
|
|
670
|
+
objectType: z.ZodOptional<z.ZodEnum<{
|
|
671
|
+
automation: "automation";
|
|
672
|
+
calendar_event: "calendar_event";
|
|
673
|
+
code_change: "code_change";
|
|
674
|
+
deployment: "deployment";
|
|
675
|
+
item: "item";
|
|
676
|
+
task: "task";
|
|
677
|
+
}>>;
|
|
678
|
+
key: z.ZodString;
|
|
679
|
+
label: z.ZodString;
|
|
680
|
+
url: z.ZodString;
|
|
681
|
+
description: z.ZodOptional<z.ZodString>;
|
|
682
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
683
|
+
closed: "closed";
|
|
684
|
+
draft: "draft";
|
|
685
|
+
merged: "merged";
|
|
686
|
+
open: "open";
|
|
687
|
+
warning: "warning";
|
|
688
|
+
}>>;
|
|
688
689
|
}, z.core.$strict>;
|
|
689
690
|
/** Core-known annotation shapes that plugins may attach to a conversation. */
|
|
690
|
-
declare const conversationAnnotationInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
691
|
+
export declare const conversationAnnotationInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
692
|
+
kind: z.ZodLiteral<"resource_link">;
|
|
693
|
+
objectType: z.ZodOptional<z.ZodEnum<{
|
|
694
|
+
automation: "automation";
|
|
695
|
+
calendar_event: "calendar_event";
|
|
696
|
+
code_change: "code_change";
|
|
697
|
+
deployment: "deployment";
|
|
698
|
+
item: "item";
|
|
699
|
+
task: "task";
|
|
700
|
+
}>>;
|
|
701
|
+
key: z.ZodString;
|
|
702
|
+
label: z.ZodString;
|
|
703
|
+
url: z.ZodString;
|
|
704
|
+
description: z.ZodOptional<z.ZodString>;
|
|
705
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
706
|
+
closed: "closed";
|
|
707
|
+
draft: "draft";
|
|
708
|
+
merged: "merged";
|
|
709
|
+
open: "open";
|
|
710
|
+
warning: "warning";
|
|
711
|
+
}>>;
|
|
711
712
|
}, z.core.$strict>, z.ZodObject<{
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
713
|
+
kind: z.ZodLiteral<"object">;
|
|
714
|
+
key: z.ZodString;
|
|
715
|
+
label: z.ZodString;
|
|
716
|
+
objectType: z.ZodEnum<{
|
|
717
|
+
automation: "automation";
|
|
718
|
+
calendar_event: "calendar_event";
|
|
719
|
+
code_change: "code_change";
|
|
720
|
+
deployment: "deployment";
|
|
721
|
+
item: "item";
|
|
722
|
+
task: "task";
|
|
723
|
+
}>;
|
|
724
|
+
title: z.ZodString;
|
|
725
|
+
url: z.ZodNullable<z.ZodURL>;
|
|
726
|
+
description: z.ZodOptional<z.ZodString>;
|
|
727
|
+
status: z.ZodOptional<z.ZodString>;
|
|
728
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
729
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
730
|
+
displayType: z.ZodOptional<z.ZodString>;
|
|
731
|
+
sourceUpdatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
732
|
+
facts: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
733
|
+
type: z.ZodLiteral<"code_change">;
|
|
734
|
+
author: z.ZodOptional<z.ZodString>;
|
|
735
|
+
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
736
|
+
targetBranch: z.ZodOptional<z.ZodString>;
|
|
737
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
738
|
+
review: z.ZodOptional<z.ZodEnum<{
|
|
739
|
+
approved: "approved";
|
|
740
|
+
changes_requested: "changes_requested";
|
|
741
|
+
required: "required";
|
|
742
|
+
}>>;
|
|
743
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
744
|
+
passed: z.ZodNumber;
|
|
745
|
+
failed: z.ZodNumber;
|
|
746
|
+
pending: z.ZodNumber;
|
|
747
|
+
}, z.core.$strict>>;
|
|
748
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
749
|
+
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
750
|
+
additions: z.ZodOptional<z.ZodNumber>;
|
|
751
|
+
deletions: z.ZodOptional<z.ZodNumber>;
|
|
752
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
753
|
+
type: z.ZodLiteral<"task">;
|
|
754
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
755
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
756
|
+
project: z.ZodOptional<z.ZodString>;
|
|
757
|
+
cycle: z.ZodOptional<z.ZodString>;
|
|
758
|
+
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
759
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
760
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
761
|
+
type: z.ZodLiteral<"deployment">;
|
|
762
|
+
project: z.ZodOptional<z.ZodString>;
|
|
763
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
764
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
765
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
766
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
767
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
768
|
+
when: z.ZodOptional<z.ZodString>;
|
|
769
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
770
|
+
}, z.core.$strict>], "type">>;
|
|
770
771
|
}, z.core.$strict>], "kind">;
|
|
771
|
-
type ConversationAnnotationInput = z.output<typeof conversationAnnotationInputSchema>;
|
|
772
|
-
type ConversationAnnotation = ConversationAnnotationInput & {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
772
|
+
export type ConversationAnnotationInput = z.output<typeof conversationAnnotationInputSchema>;
|
|
773
|
+
export type ConversationAnnotation = ConversationAnnotationInput & {
|
|
774
|
+
plugin: string;
|
|
775
|
+
createdAt: string;
|
|
776
|
+
updatedAt: string;
|
|
776
777
|
};
|
|
777
|
-
interface PluginAnnotations {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
interface PluginConversationAnnotations {
|
|
783
|
-
|
|
784
|
-
}
|
|
785
|
-
declare const conversationSidebarIconSchema: z.ZodEnum<{
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
778
|
+
export interface PluginAnnotations {
|
|
779
|
+
upsert(annotation: ConversationAnnotationInput): Promise<void>;
|
|
780
|
+
remove(kind: ConversationAnnotationInput["kind"], key: string): Promise<void>;
|
|
781
|
+
list(): Promise<ConversationAnnotation[]>;
|
|
782
|
+
}
|
|
783
|
+
export interface PluginConversationAnnotations {
|
|
784
|
+
forConversation(conversationId: string): PluginAnnotations;
|
|
785
|
+
}
|
|
786
|
+
export declare const conversationSidebarIconSchema: z.ZodEnum<{
|
|
787
|
+
"circle-dashed": "circle-dashed";
|
|
788
|
+
"circle-dot": "circle-dot";
|
|
789
|
+
"circle-x": "circle-x";
|
|
790
|
+
"git-merge": "git-merge";
|
|
791
|
+
"git-pull-request": "git-pull-request";
|
|
792
|
+
"triangle-alert": "triangle-alert";
|
|
793
|
+
}>;
|
|
794
|
+
export declare const conversationSidebarAnnotationSchema: z.ZodObject<{
|
|
795
|
+
icon: z.ZodOptional<z.ZodEnum<{
|
|
789
796
|
"circle-dashed": "circle-dashed";
|
|
797
|
+
"circle-dot": "circle-dot";
|
|
790
798
|
"circle-x": "circle-x";
|
|
799
|
+
"git-merge": "git-merge";
|
|
800
|
+
"git-pull-request": "git-pull-request";
|
|
791
801
|
"triangle-alert": "triangle-alert";
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
task: "task";
|
|
805
|
-
deployment: "deployment";
|
|
806
|
-
calendar_event: "calendar_event";
|
|
807
|
-
automation: "automation";
|
|
808
|
-
item: "item";
|
|
809
|
-
}>>;
|
|
810
|
-
status: z.ZodOptional<z.ZodString>;
|
|
811
|
-
key: z.ZodString;
|
|
812
|
-
label: z.ZodString;
|
|
802
|
+
}>>;
|
|
803
|
+
objectType: z.ZodOptional<z.ZodEnum<{
|
|
804
|
+
automation: "automation";
|
|
805
|
+
calendar_event: "calendar_event";
|
|
806
|
+
code_change: "code_change";
|
|
807
|
+
deployment: "deployment";
|
|
808
|
+
item: "item";
|
|
809
|
+
task: "task";
|
|
810
|
+
}>>;
|
|
811
|
+
status: z.ZodOptional<z.ZodString>;
|
|
812
|
+
key: z.ZodString;
|
|
813
|
+
label: z.ZodString;
|
|
813
814
|
}, z.core.$strict>;
|
|
814
|
-
type ConversationSidebarAnnotation = z.output<typeof conversationSidebarAnnotationSchema>;
|
|
815
|
-
interface ConversationSidebarHookContext extends PluginContext {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
interface ConversationSidebarResult {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
open: "open";
|
|
815
|
+
export type ConversationSidebarAnnotation = z.output<typeof conversationSidebarAnnotationSchema>;
|
|
816
|
+
export interface ConversationSidebarHookContext extends PluginContext {
|
|
817
|
+
/** Stored annotations owned by this plugin, keyed by candidate conversation. */
|
|
818
|
+
annotationsByConversationId: Record<string, ConversationAnnotation[]>;
|
|
819
|
+
conversationIds: string[];
|
|
820
|
+
}
|
|
821
|
+
export interface ConversationSidebarResult {
|
|
822
|
+
/** Sidebar annotations in display order. Put the newest annotation first. */
|
|
823
|
+
annotationsByConversationId: Record<string, ConversationSidebarAnnotation[]>;
|
|
824
|
+
}
|
|
825
|
+
export declare const codeChangeStateSchema: z.ZodEnum<{
|
|
826
|
+
closed: "closed";
|
|
827
|
+
merged: "merged";
|
|
828
|
+
open: "open";
|
|
829
829
|
}>;
|
|
830
|
-
type CodeChangeState = z.output<typeof codeChangeStateSchema>;
|
|
831
|
-
declare const codeChangeInputSchema: z.ZodObject<{
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
830
|
+
export type CodeChangeState = z.output<typeof codeChangeStateSchema>;
|
|
831
|
+
export declare const codeChangeInputSchema: z.ZodObject<{
|
|
832
|
+
closedAt: z.ZodOptional<z.ZodDate>;
|
|
833
|
+
conversationIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
834
|
+
mergedAt: z.ZodOptional<z.ZodDate>;
|
|
835
|
+
number: z.ZodNumber;
|
|
836
|
+
openedAt: z.ZodDate;
|
|
837
|
+
providerId: z.ZodString;
|
|
838
|
+
repository: z.ZodObject<{
|
|
839
|
+
name: z.ZodString;
|
|
837
840
|
providerId: z.ZodString;
|
|
838
|
-
repository: z.ZodObject<{
|
|
839
|
-
name: z.ZodString;
|
|
840
|
-
providerId: z.ZodString;
|
|
841
|
-
url: z.ZodOptional<z.ZodString>;
|
|
842
|
-
}, z.core.$strict>;
|
|
843
|
-
state: z.ZodEnum<{
|
|
844
|
-
closed: "closed";
|
|
845
|
-
merged: "merged";
|
|
846
|
-
open: "open";
|
|
847
|
-
}>;
|
|
848
|
-
title: z.ZodOptional<z.ZodString>;
|
|
849
|
-
updatedAt: z.ZodDate;
|
|
850
841
|
url: z.ZodOptional<z.ZodString>;
|
|
842
|
+
}, z.core.$strict>;
|
|
843
|
+
state: z.ZodEnum<{
|
|
844
|
+
closed: "closed";
|
|
845
|
+
merged: "merged";
|
|
846
|
+
open: "open";
|
|
847
|
+
}>;
|
|
848
|
+
title: z.ZodOptional<z.ZodString>;
|
|
849
|
+
updatedAt: z.ZodDate;
|
|
850
|
+
url: z.ZodOptional<z.ZodString>;
|
|
851
851
|
}, z.core.$strict>;
|
|
852
|
-
type CodeChangeInput = z.input<typeof codeChangeInputSchema>;
|
|
852
|
+
export type CodeChangeInput = z.input<typeof codeChangeInputSchema>;
|
|
853
853
|
/** Write code changes from a plugin to Junior's code records. */
|
|
854
|
-
interface CodeChangePublisher {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
854
|
+
export interface CodeChangePublisher {
|
|
855
|
+
associateConversations(input: {
|
|
856
|
+
conversationIds: string[];
|
|
857
|
+
providerId: string;
|
|
858
|
+
}): Promise<void>;
|
|
859
|
+
record(input: CodeChangeInput): Promise<void>;
|
|
860
|
+
}
|
|
861
|
+
export declare const conversationEventIconSchema: z.ZodEnum<{
|
|
862
|
+
activity: "activity";
|
|
863
|
+
brain: "brain";
|
|
864
|
+
calendar: "calendar";
|
|
865
|
+
check: "check";
|
|
866
|
+
database: "database";
|
|
867
|
+
info: "info";
|
|
868
|
+
key: "key";
|
|
869
|
+
link: "link";
|
|
870
|
+
sparkles: "sparkles";
|
|
871
|
+
warning: "warning";
|
|
872
|
+
}>;
|
|
873
|
+
/** Safe, core-rendered presentation for one plugin conversation event. */
|
|
874
|
+
export declare const conversationEventPresentationSchema: z.ZodObject<{
|
|
875
|
+
details: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
876
|
+
content: z.ZodOptional<z.ZodString>;
|
|
877
|
+
description: z.ZodOptional<z.ZodString>;
|
|
878
|
+
metadata: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
879
|
+
title: z.ZodString;
|
|
880
|
+
}, z.core.$strict>>>;
|
|
881
|
+
icon: z.ZodOptional<z.ZodEnum<{
|
|
882
|
+
activity: "activity";
|
|
883
|
+
brain: "brain";
|
|
864
884
|
calendar: "calendar";
|
|
865
|
-
|
|
885
|
+
check: "check";
|
|
886
|
+
database: "database";
|
|
866
887
|
info: "info";
|
|
867
888
|
key: "key";
|
|
868
889
|
link: "link";
|
|
869
|
-
activity: "activity";
|
|
870
|
-
brain: "brain";
|
|
871
|
-
database: "database";
|
|
872
890
|
sparkles: "sparkles";
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
content: z.ZodOptional<z.ZodString>;
|
|
878
|
-
description: z.ZodOptional<z.ZodString>;
|
|
879
|
-
metadata: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
880
|
-
title: z.ZodString;
|
|
881
|
-
}, z.core.$strict>>>;
|
|
882
|
-
icon: z.ZodOptional<z.ZodEnum<{
|
|
883
|
-
check: "check";
|
|
884
|
-
calendar: "calendar";
|
|
885
|
-
warning: "warning";
|
|
886
|
-
info: "info";
|
|
887
|
-
key: "key";
|
|
888
|
-
link: "link";
|
|
889
|
-
activity: "activity";
|
|
890
|
-
brain: "brain";
|
|
891
|
-
database: "database";
|
|
892
|
-
sparkles: "sparkles";
|
|
893
|
-
}>>;
|
|
894
|
-
preview: z.ZodOptional<z.ZodString>;
|
|
895
|
-
title: z.ZodString;
|
|
891
|
+
warning: "warning";
|
|
892
|
+
}>>;
|
|
893
|
+
preview: z.ZodOptional<z.ZodString>;
|
|
894
|
+
title: z.ZodString;
|
|
896
895
|
}, z.core.$strict>;
|
|
897
|
-
type ConversationEventPresentation = z.output<typeof conversationEventPresentationSchema>;
|
|
896
|
+
export type ConversationEventPresentation = z.output<typeof conversationEventPresentationSchema>;
|
|
898
897
|
/** One validated plugin event value waiting for conversation-bound emission. */
|
|
899
|
-
interface PluginConversationEventValue {
|
|
900
|
-
|
|
901
|
-
|
|
898
|
+
export interface PluginConversationEventValue {
|
|
899
|
+
readonly data: Record<string, unknown>;
|
|
900
|
+
readonly definition: PluginConversationEventDefinition;
|
|
902
901
|
}
|
|
903
902
|
/** Registered schema and optional transcript presentation for one event version. */
|
|
904
|
-
interface PluginConversationEventDefinition {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
903
|
+
export interface PluginConversationEventDefinition {
|
|
904
|
+
readonly eventName: string;
|
|
905
|
+
readonly version: number;
|
|
906
|
+
parse(data: unknown): Record<string, unknown>;
|
|
907
|
+
renderEvent(data: Record<string, unknown>): ConversationEventPresentation | undefined;
|
|
909
908
|
}
|
|
910
909
|
/** Typed factory returned while authoring one plugin conversation event. */
|
|
911
|
-
interface DefinedConversationEvent<TInput> extends PluginConversationEventDefinition {
|
|
912
|
-
|
|
910
|
+
export interface DefinedConversationEvent<TInput> extends PluginConversationEventDefinition {
|
|
911
|
+
(data: TInput): PluginConversationEventValue;
|
|
913
912
|
}
|
|
914
913
|
/** Define one typed, versioned plugin-owned conversation event. */
|
|
915
|
-
declare function defineConversationEvent<TSchema extends z.ZodType<Record<string, unknown>>>(definition: {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
914
|
+
export declare function defineConversationEvent<TSchema extends z.ZodType<Record<string, unknown>>>(definition: {
|
|
915
|
+
name: string;
|
|
916
|
+
version: number;
|
|
917
|
+
schema: TSchema;
|
|
918
|
+
renderEvent(event: z.output<TSchema>): z.input<typeof conversationEventPresentationSchema> | undefined;
|
|
920
919
|
}): DefinedConversationEvent<z.input<TSchema>>;
|
|
921
920
|
/** Conversation-bound event writer supplied by Junior core. */
|
|
922
|
-
interface PluginConversationEvents {
|
|
923
|
-
|
|
921
|
+
export interface PluginConversationEvents {
|
|
922
|
+
emit(event: PluginConversationEventValue): Promise<void>;
|
|
924
923
|
}
|
|
925
|
-
interface PluginConversationEventCostDay {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
924
|
+
export interface PluginConversationEventCostDay {
|
|
925
|
+
costUsd: number;
|
|
926
|
+
date: string;
|
|
927
|
+
events: number;
|
|
929
928
|
}
|
|
930
|
-
interface PluginConversationEventRecord {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
929
|
+
export interface PluginConversationEventRecord {
|
|
930
|
+
content: Record<string, unknown>;
|
|
931
|
+
createdAt: string;
|
|
932
|
+
version: number;
|
|
934
933
|
}
|
|
935
934
|
/** Read events owned by the current plugin namespace after Conversation access checks. */
|
|
936
|
-
interface PluginConversationEventReader {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
935
|
+
export interface PluginConversationEventReader {
|
|
936
|
+
list(input: {
|
|
937
|
+
conversationId: string;
|
|
938
|
+
eventName: string;
|
|
939
|
+
viewer: User;
|
|
940
|
+
}): Promise<PluginConversationEventRecord[] | undefined>;
|
|
942
941
|
}
|
|
943
942
|
/** Read aggregate costs for events owned by the current plugin namespace. */
|
|
944
|
-
interface PluginConversationEventStats {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
declare const promptMessageSchema: z.ZodObject<{
|
|
967
|
-
text: z.ZodString;
|
|
943
|
+
export interface PluginConversationEventStats {
|
|
944
|
+
costsByDay(input: {
|
|
945
|
+
days: 7 | 30 | 90;
|
|
946
|
+
eventName: string;
|
|
947
|
+
}): Promise<PluginConversationEventCostDay[]>;
|
|
948
|
+
costsByHour(input: {
|
|
949
|
+
eventName: string;
|
|
950
|
+
hours?: number;
|
|
951
|
+
}): Promise<PluginConversationEventCostDay[]>;
|
|
952
|
+
}
|
|
953
|
+
export interface PluginState {
|
|
954
|
+
delete(key: string): Promise<void>;
|
|
955
|
+
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
956
|
+
set(key: string, value: unknown, ttlMs?: number): Promise<void>;
|
|
957
|
+
setIfNotExists(key: string, value: unknown, ttlMs?: number): Promise<boolean>;
|
|
958
|
+
withLock<T>(key: string, ttlMs: number, callback: () => Promise<T>): Promise<T>;
|
|
959
|
+
}
|
|
960
|
+
export interface PluginReadState {
|
|
961
|
+
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
962
|
+
}
|
|
963
|
+
export declare const promptMessageSchema: z.ZodObject<{
|
|
964
|
+
text: z.ZodString;
|
|
968
965
|
}, z.core.$strict>;
|
|
969
966
|
/** Small plugin-owned prompt text block rendered by Junior core. */
|
|
970
967
|
type PromptMessage = z.output<typeof promptMessageSchema>;
|
|
971
|
-
declare const promptContextSchema: z.ZodObject<{
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
968
|
+
export declare const promptContextSchema: z.ZodObject<{
|
|
969
|
+
kind: z.ZodString;
|
|
970
|
+
version: z.ZodNumber;
|
|
971
|
+
content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
975
972
|
}, z.core.$strict>;
|
|
976
973
|
/** Structured plugin context retained alongside its model-visible rendering. */
|
|
977
974
|
type PromptContext = z.output<typeof promptContextSchema>;
|
|
978
975
|
/** Runtime contribution produced from one validated plugin context value. */
|
|
979
976
|
interface PromptContextContribution {
|
|
980
|
-
|
|
981
|
-
|
|
977
|
+
context: PromptContext;
|
|
978
|
+
renderPrompt(): string;
|
|
982
979
|
}
|
|
983
980
|
/** Define one typed, versioned plugin context contribution. */
|
|
984
|
-
declare function definePromptContext<TSchema extends z.ZodType<Record<string, unknown>>>(definition: {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
981
|
+
export declare function definePromptContext<TSchema extends z.ZodType<Record<string, unknown>>>(definition: {
|
|
982
|
+
kind: string;
|
|
983
|
+
version: number;
|
|
984
|
+
schema: TSchema;
|
|
985
|
+
renderPrompt(content: z.output<TSchema>): string;
|
|
989
986
|
}): (content: z.input<TSchema>) => PromptContextContribution;
|
|
990
987
|
/** One request-scoped plugin contribution to the model-visible user prompt. */
|
|
991
988
|
type UserPromptContribution = PromptMessage | PromptContextContribution;
|
|
992
989
|
/** Stable platform context for plugin system prompt guidance. */
|
|
993
990
|
type SystemPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
|
|
994
|
-
|
|
991
|
+
platform: Platform;
|
|
995
992
|
};
|
|
996
993
|
/** Runtime facts available while building plugin user prompt context. */
|
|
997
994
|
type UserPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
995
|
+
conversationId?: string;
|
|
996
|
+
destination: Destination;
|
|
997
|
+
embedder: PluginEmbedder;
|
|
998
|
+
/** Conversation-bound event writer when the prompt belongs to a durable turn. */
|
|
999
|
+
events?: PluginConversationEvents;
|
|
1000
|
+
model: PluginModel;
|
|
1001
|
+
/** Location associated with this Conversation. */
|
|
1002
|
+
locationId?: string;
|
|
1003
|
+
actor?: Actor;
|
|
1004
|
+
source: Source;
|
|
1005
|
+
state: PluginState;
|
|
1006
|
+
text: string;
|
|
1007
|
+
users: {
|
|
1008
|
+
/** Resolve the current Actor's Identity and User. */
|
|
1009
|
+
resolveActor(): Promise<{
|
|
1010
|
+
identity: Identity;
|
|
1011
|
+
user?: User;
|
|
1012
|
+
} | undefined>;
|
|
1013
|
+
};
|
|
1017
1014
|
};
|
|
1018
|
-
|
|
1019
|
-
type
|
|
1020
|
-
type DispatchOptions = z.output<typeof dispatchOptionsSchema>;
|
|
1015
|
+
export type DestinationVisibility = z.output<typeof destinationVisibilitySchema>;
|
|
1016
|
+
export type DispatchOptions = z.output<typeof dispatchOptionsSchema>;
|
|
1021
1017
|
/** Compact destination-visible context explaining what produced a reply. */
|
|
1022
|
-
type ReplyAttribution = z.output<typeof replyAttributionSchema>;
|
|
1023
|
-
type TaskOutcome = z.output<typeof taskOutcomeSchema>;
|
|
1024
|
-
interface DispatchResult {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
}
|
|
1028
|
-
interface Dispatch {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
declare const
|
|
1036
|
-
declare const
|
|
1037
|
-
declare const
|
|
1038
|
-
declare const
|
|
1039
|
-
declare const EVENT_GUIDANCE_MAX_LENGTH = 1000;
|
|
1018
|
+
export type ReplyAttribution = z.output<typeof replyAttributionSchema>;
|
|
1019
|
+
export type TaskOutcome = z.output<typeof taskOutcomeSchema>;
|
|
1020
|
+
export interface DispatchResult {
|
|
1021
|
+
id: string;
|
|
1022
|
+
status: "created" | "already_exists";
|
|
1023
|
+
}
|
|
1024
|
+
export interface Dispatch {
|
|
1025
|
+
errorMessage?: string;
|
|
1026
|
+
id: string;
|
|
1027
|
+
resultMessageTs?: string;
|
|
1028
|
+
status: "pending" | "running" | "awaiting_resume" | "completed" | "failed" | "blocked";
|
|
1029
|
+
}
|
|
1030
|
+
export declare const EVENT_SUMMARY_MAX_LENGTH = 4000;
|
|
1031
|
+
export declare const EVENT_TEXT_MAX_LENGTH = 8000;
|
|
1032
|
+
export declare const EVENT_DATA_MAX_KEYS = 32;
|
|
1033
|
+
export declare const EVENT_DATA_MAX_JSON_BYTES = 4000;
|
|
1034
|
+
export declare const EVENT_GUIDANCE_MAX_LENGTH = 1000;
|
|
1040
1035
|
/** Small trusted data from the plugin. The agent should not look these up again. */
|
|
1041
|
-
declare const eventDataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1036
|
+
export declare const eventDataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1042
1037
|
/** Canonical dotted event type published and selected across plugins. */
|
|
1043
|
-
declare const eventTypeSchema: z.ZodString;
|
|
1044
|
-
declare const resourceTypeSchema: z.ZodString;
|
|
1038
|
+
export declare const eventTypeSchema: z.ZodString;
|
|
1039
|
+
export declare const resourceTypeSchema: z.ZodString;
|
|
1045
1040
|
/** One exact value a watch or event automation may require on trusted event data. */
|
|
1046
|
-
declare const eventMatchFieldSchema: z.ZodObject<{
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1041
|
+
export declare const eventMatchFieldSchema: z.ZodObject<{
|
|
1042
|
+
kind: z.ZodEnum<{
|
|
1043
|
+
boolean: "boolean";
|
|
1044
|
+
number: "number";
|
|
1045
|
+
string: "string";
|
|
1046
|
+
}>;
|
|
1047
|
+
description: z.ZodString;
|
|
1048
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1054
1049
|
}, z.core.$strict>;
|
|
1055
|
-
declare const eventMatchFieldsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1050
|
+
export declare const eventMatchFieldsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1051
|
+
kind: z.ZodEnum<{
|
|
1052
|
+
boolean: "boolean";
|
|
1053
|
+
number: "number";
|
|
1054
|
+
string: "string";
|
|
1055
|
+
}>;
|
|
1056
|
+
description: z.ZodString;
|
|
1057
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1063
1058
|
}, z.core.$strict>>;
|
|
1064
1059
|
/** Exact trusted values required before a watch or event automation runs. */
|
|
1065
|
-
declare const eventMatchSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>;
|
|
1066
|
-
type EventMatch = z.output<typeof eventMatchSchema>;
|
|
1067
|
-
type EventMatchFields = z.output<typeof eventMatchFieldsSchema>;
|
|
1060
|
+
export declare const eventMatchSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>;
|
|
1061
|
+
export type EventMatch = z.output<typeof eventMatchSchema>;
|
|
1062
|
+
export type EventMatchFields = z.output<typeof eventMatchFieldsSchema>;
|
|
1068
1063
|
/** Stable JSON for one match object. List order does not matter. */
|
|
1069
|
-
declare function stableEventMatchKey(match: EventMatch | undefined): string;
|
|
1064
|
+
export declare function stableEventMatchKey(match: EventMatch | undefined): string;
|
|
1070
1065
|
/** Return whether trusted event data matches one exact match object. */
|
|
1071
|
-
declare function eventMatches(match: EventMatch | undefined, data: EventData | undefined): boolean;
|
|
1066
|
+
export declare function eventMatches(match: EventMatch | undefined, data: EventData | undefined): boolean;
|
|
1072
1067
|
/** The identifier shape of one resource type. */
|
|
1073
|
-
declare const eventIdentifierSchema: z.ZodObject<{
|
|
1068
|
+
export declare const eventIdentifierSchema: z.ZodObject<{
|
|
1069
|
+
format: z.ZodString;
|
|
1070
|
+
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1071
|
+
}, z.core.$strict>;
|
|
1072
|
+
export declare const pluginEventTypeSchema: z.ZodObject<{
|
|
1073
|
+
type: z.ZodString;
|
|
1074
|
+
identifier: z.ZodOptional<z.ZodObject<{
|
|
1074
1075
|
format: z.ZodString;
|
|
1075
1076
|
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1077
|
+
}, z.core.$strict>>;
|
|
1078
|
+
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1079
|
+
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1080
|
+
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1081
|
+
kind: z.ZodEnum<{
|
|
1082
|
+
boolean: "boolean";
|
|
1083
|
+
number: "number";
|
|
1084
|
+
string: "string";
|
|
1085
|
+
}>;
|
|
1086
|
+
description: z.ZodString;
|
|
1087
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1088
|
+
}, z.core.$strict>>>;
|
|
1089
|
+
guidance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1076
1090
|
}, z.core.$strict>;
|
|
1077
|
-
declare const
|
|
1091
|
+
export declare const pluginEventsSchema: z.ZodObject<{
|
|
1092
|
+
resourceTypes: z.ZodArray<z.ZodObject<{
|
|
1078
1093
|
type: z.ZodString;
|
|
1079
1094
|
identifier: z.ZodOptional<z.ZodObject<{
|
|
1080
|
-
|
|
1081
|
-
|
|
1095
|
+
format: z.ZodString;
|
|
1096
|
+
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1082
1097
|
}, z.core.$strict>>;
|
|
1083
1098
|
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1084
1099
|
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1085
1100
|
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1101
|
+
kind: z.ZodEnum<{
|
|
1102
|
+
boolean: "boolean";
|
|
1103
|
+
number: "number";
|
|
1104
|
+
string: "string";
|
|
1105
|
+
}>;
|
|
1106
|
+
description: z.ZodString;
|
|
1107
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1093
1108
|
}, z.core.$strict>>>;
|
|
1094
1109
|
guidance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1110
|
+
}, z.core.$strict>>;
|
|
1111
|
+
isEnabled: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodBoolean>>;
|
|
1112
|
+
normalizeIdentifier: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodString>>;
|
|
1095
1113
|
}, z.core.$strict>;
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
type: z.ZodString;
|
|
1099
|
-
identifier: z.ZodOptional<z.ZodObject<{
|
|
1100
|
-
format: z.ZodString;
|
|
1101
|
-
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1102
|
-
}, z.core.$strict>>;
|
|
1103
|
-
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1104
|
-
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1105
|
-
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1106
|
-
kind: z.ZodEnum<{
|
|
1107
|
-
string: "string";
|
|
1108
|
-
number: "number";
|
|
1109
|
-
boolean: "boolean";
|
|
1110
|
-
}>;
|
|
1111
|
-
description: z.ZodString;
|
|
1112
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1113
|
-
}, z.core.$strict>>>;
|
|
1114
|
-
guidance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1115
|
-
}, z.core.$strict>>;
|
|
1116
|
-
isEnabled: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodBoolean>>;
|
|
1117
|
-
normalizeIdentifier: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodString>>;
|
|
1118
|
-
}, z.core.$strict>;
|
|
1119
|
-
type PluginEventType = z.output<typeof pluginEventTypeSchema>;
|
|
1120
|
-
type PluginEvents = z.output<typeof pluginEventsSchema>;
|
|
1114
|
+
export type PluginEventType = z.output<typeof pluginEventTypeSchema>;
|
|
1115
|
+
export type PluginEvents = z.output<typeof pluginEventsSchema>;
|
|
1121
1116
|
/** Apply a plugin's identifier convention at event boundaries. */
|
|
1122
|
-
declare function normalizeEventIdentifier(registration: Pick<PluginEvents, "normalizeIdentifier"> | undefined, identifier: string): string;
|
|
1123
|
-
declare const subscribableResourceSchema: z.ZodObject<{
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1117
|
+
export declare function normalizeEventIdentifier(registration: Pick<PluginEvents, "normalizeIdentifier"> | undefined, identifier: string): string;
|
|
1118
|
+
export declare const subscribableResourceSchema: z.ZodObject<{
|
|
1119
|
+
identifier: z.ZodString;
|
|
1120
|
+
label: z.ZodString;
|
|
1121
|
+
namespace: z.ZodString;
|
|
1122
|
+
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1123
|
+
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1124
|
+
type: z.ZodString;
|
|
1130
1125
|
}, z.core.$strict>;
|
|
1131
|
-
type SubscribableResource = z.output<typeof subscribableResourceSchema>;
|
|
1126
|
+
export type SubscribableResource = z.output<typeof subscribableResourceSchema>;
|
|
1132
1127
|
/** Result returned after a temporary watch is created. */
|
|
1133
|
-
declare const watchResultSchema: z.ZodObject<{
|
|
1134
|
-
|
|
1135
|
-
|
|
1128
|
+
export declare const watchResultSchema: z.ZodObject<{
|
|
1129
|
+
events: z.ZodArray<z.ZodString>;
|
|
1130
|
+
id: z.ZodString;
|
|
1136
1131
|
}, z.core.$strict>;
|
|
1137
|
-
type WatchResult = z.output<typeof watchResultSchema>;
|
|
1132
|
+
export type WatchResult = z.output<typeof watchResultSchema>;
|
|
1138
1133
|
/**
|
|
1139
1134
|
* One person involved in an Event, named by a provider identity or an email.
|
|
1140
1135
|
* Core resolves linked people to mentions. It drops people it cannot resolve.
|
|
1141
1136
|
*/
|
|
1142
|
-
declare const eventPersonSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1137
|
+
export declare const eventPersonSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1138
|
+
provider: z.ZodString;
|
|
1139
|
+
handle: z.ZodString;
|
|
1140
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1141
|
+
email: z.ZodString;
|
|
1142
|
+
}, z.core.$strict>]>;
|
|
1143
|
+
export type EventPerson = z.output<typeof eventPersonSchema>;
|
|
1144
|
+
export declare const eventInputSchema: z.ZodObject<{
|
|
1145
|
+
objectType: z.ZodOptional<z.ZodEnum<{
|
|
1146
|
+
automation: "automation";
|
|
1147
|
+
calendar_event: "calendar_event";
|
|
1148
|
+
code_change: "code_change";
|
|
1149
|
+
deployment: "deployment";
|
|
1150
|
+
item: "item";
|
|
1151
|
+
task: "task";
|
|
1152
|
+
}>>;
|
|
1153
|
+
eventKey: z.ZodString;
|
|
1154
|
+
eventType: z.ZodString;
|
|
1155
|
+
identifier: z.ZodString;
|
|
1156
|
+
occurredAtMs: z.ZodNumber;
|
|
1157
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
1158
|
+
trustedSummary: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1159
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1160
|
+
untrustedText: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1161
|
+
people: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1143
1162
|
provider: z.ZodString;
|
|
1144
1163
|
handle: z.ZodString;
|
|
1145
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1164
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1146
1165
|
email: z.ZodString;
|
|
1147
|
-
}, z.core.$strict>]
|
|
1148
|
-
type EventPerson = z.output<typeof eventPersonSchema>;
|
|
1149
|
-
declare const eventInputSchema: z.ZodObject<{
|
|
1150
|
-
objectType: z.ZodOptional<z.ZodEnum<{
|
|
1151
|
-
code_change: "code_change";
|
|
1152
|
-
task: "task";
|
|
1153
|
-
deployment: "deployment";
|
|
1154
|
-
calendar_event: "calendar_event";
|
|
1155
|
-
automation: "automation";
|
|
1156
|
-
item: "item";
|
|
1157
|
-
}>>;
|
|
1158
|
-
eventKey: z.ZodString;
|
|
1159
|
-
eventType: z.ZodString;
|
|
1160
|
-
identifier: z.ZodString;
|
|
1161
|
-
occurredAtMs: z.ZodNumber;
|
|
1162
|
-
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
1163
|
-
trustedSummary: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1164
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1165
|
-
untrustedText: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1166
|
-
people: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1167
|
-
provider: z.ZodString;
|
|
1168
|
-
handle: z.ZodString;
|
|
1169
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1170
|
-
email: z.ZodString;
|
|
1171
|
-
}, z.core.$strict>]>>>;
|
|
1166
|
+
}, z.core.$strict>]>>>;
|
|
1172
1167
|
}, z.core.$strict>;
|
|
1173
|
-
type EventData = z.output<typeof eventDataSchema>;
|
|
1174
|
-
type EventInput = z.output<typeof eventInputSchema>;
|
|
1175
|
-
declare const eventSchema: z.ZodObject<{
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1168
|
+
export type EventData = z.output<typeof eventDataSchema>;
|
|
1169
|
+
export type EventInput = z.output<typeof eventInputSchema>;
|
|
1170
|
+
export declare const eventSchema: z.ZodObject<{
|
|
1171
|
+
objectType: z.ZodOptional<z.ZodEnum<{
|
|
1172
|
+
automation: "automation";
|
|
1173
|
+
calendar_event: "calendar_event";
|
|
1174
|
+
code_change: "code_change";
|
|
1175
|
+
deployment: "deployment";
|
|
1176
|
+
item: "item";
|
|
1177
|
+
task: "task";
|
|
1178
|
+
}>>;
|
|
1179
|
+
eventKey: z.ZodString;
|
|
1180
|
+
eventType: z.ZodString;
|
|
1181
|
+
identifier: z.ZodString;
|
|
1182
|
+
occurredAtMs: z.ZodNumber;
|
|
1183
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
1184
|
+
trustedSummary: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1185
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1186
|
+
untrustedText: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1187
|
+
people: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1188
|
+
provider: z.ZodString;
|
|
1189
|
+
handle: z.ZodString;
|
|
1190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1191
|
+
email: z.ZodString;
|
|
1192
|
+
}, z.core.$strict>]>>>;
|
|
1193
|
+
namespace: z.ZodString;
|
|
1199
1194
|
}, z.core.$strict>;
|
|
1200
|
-
type Event = z.output<typeof eventSchema>;
|
|
1201
|
-
interface EventPublisher {
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1195
|
+
export type Event = z.output<typeof eventSchema>;
|
|
1196
|
+
export interface EventPublisher {
|
|
1197
|
+
/** Return whether an active watch or event automation matches this event. */
|
|
1198
|
+
hasMatch?(event: EventInput): Promise<boolean>;
|
|
1199
|
+
/** Publish one normalized event under the owning plugin's namespace. */
|
|
1200
|
+
publish(event: EventInput): Promise<void>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Return match keys used by active watches or event automations for these
|
|
1203
|
+
* identifiers and event types. Plugins use this to load optional trusted
|
|
1204
|
+
* data only when a filter needs it.
|
|
1205
|
+
*/
|
|
1206
|
+
neededMatchKeys?(input: {
|
|
1207
|
+
eventTypes: string[];
|
|
1208
|
+
identifiers: string[];
|
|
1209
|
+
}): Promise<string[]>;
|
|
1215
1210
|
}
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* Public plugin background-task contracts.
|
|
1219
|
-
*
|
|
1220
|
-
* Plugins register small task handlers. Junior core owns scheduling, delivery,
|
|
1221
|
-
* retries, and the bounded run projection.
|
|
1222
|
-
*/
|
|
1223
|
-
|
|
1224
1211
|
/**
|
|
1225
1212
|
* Runtime-owned provenance for a transcript message: whether it is a durable
|
|
1226
1213
|
* instruction or ambient context, plus the actor identity when known. Missing
|
|
1227
1214
|
* provenance on an entry means unattributed context.
|
|
1228
1215
|
*/
|
|
1229
|
-
declare const pluginRunTranscriptProvenanceSchema: z.ZodObject<{
|
|
1216
|
+
export declare const pluginRunTranscriptProvenanceSchema: z.ZodObject<{
|
|
1217
|
+
authority: z.ZodEnum<{
|
|
1218
|
+
context: "context";
|
|
1219
|
+
instruction: "instruction";
|
|
1220
|
+
}>;
|
|
1221
|
+
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1222
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1223
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1224
|
+
userId: z.ZodString;
|
|
1225
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1226
|
+
platform: z.ZodLiteral<"slack">;
|
|
1227
|
+
teamId: z.ZodString;
|
|
1228
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1229
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1230
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1231
|
+
userId: z.ZodString;
|
|
1232
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1233
|
+
platform: z.ZodLiteral<"local">;
|
|
1234
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1235
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1236
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1237
|
+
userId: z.ZodString;
|
|
1238
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1239
|
+
platform: z.ZodLiteral<"web">;
|
|
1240
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1241
|
+
platform: z.ZodLiteral<"system">;
|
|
1242
|
+
name: z.ZodString;
|
|
1243
|
+
}, z.core.$strict>], "platform">>;
|
|
1244
|
+
}, z.core.$strict>;
|
|
1245
|
+
/** One normalized transcript entry from the completed run exposed to plugin tasks. */
|
|
1246
|
+
export declare const pluginRunTranscriptEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1247
|
+
type: z.ZodLiteral<"message">;
|
|
1248
|
+
role: z.ZodEnum<{
|
|
1249
|
+
assistant: "assistant";
|
|
1250
|
+
user: "user";
|
|
1251
|
+
}>;
|
|
1252
|
+
text: z.ZodString;
|
|
1253
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
1230
1254
|
authority: z.ZodEnum<{
|
|
1231
|
-
|
|
1232
|
-
|
|
1255
|
+
context: "context";
|
|
1256
|
+
instruction: "instruction";
|
|
1233
1257
|
}>;
|
|
1234
1258
|
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1259
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1260
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1261
|
+
userId: z.ZodString;
|
|
1262
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1263
|
+
platform: z.ZodLiteral<"slack">;
|
|
1264
|
+
teamId: z.ZodString;
|
|
1241
1265
|
}, z.core.$strict>, z.ZodObject<{
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1266
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1267
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1268
|
+
userId: z.ZodString;
|
|
1269
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1270
|
+
platform: z.ZodLiteral<"local">;
|
|
1247
1271
|
}, z.core.$strict>, z.ZodObject<{
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1272
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1273
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1274
|
+
userId: z.ZodString;
|
|
1275
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1276
|
+
platform: z.ZodLiteral<"web">;
|
|
1253
1277
|
}, z.core.$strict>, z.ZodObject<{
|
|
1254
|
-
|
|
1255
|
-
|
|
1278
|
+
platform: z.ZodLiteral<"system">;
|
|
1279
|
+
name: z.ZodString;
|
|
1256
1280
|
}, z.core.$strict>], "platform">>;
|
|
1257
|
-
}, z.core.$strict
|
|
1258
|
-
|
|
1259
|
-
|
|
1281
|
+
}, z.core.$strict>>;
|
|
1282
|
+
isRunActor: z.ZodOptional<z.ZodBoolean>;
|
|
1283
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1284
|
+
type: z.ZodLiteral<"toolResult">;
|
|
1285
|
+
toolName: z.ZodString;
|
|
1286
|
+
isError: z.ZodBoolean;
|
|
1287
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1288
|
+
}, z.core.$strict>], "type">;
|
|
1289
|
+
export type PluginRunTranscriptProvenance = z.output<typeof pluginRunTranscriptProvenanceSchema>;
|
|
1290
|
+
/** Runtime-owned completed-run projection exposed to plugin tasks. */
|
|
1291
|
+
export declare const pluginRunContextSchema: z.ZodObject<{
|
|
1292
|
+
actorUserId: z.ZodOptional<z.ZodString>;
|
|
1293
|
+
completedAtMs: z.ZodNumber;
|
|
1294
|
+
conversationId: z.ZodString;
|
|
1295
|
+
destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1296
|
+
platform: z.ZodLiteral<"slack">;
|
|
1297
|
+
teamId: z.ZodString;
|
|
1298
|
+
channelId: z.ZodString;
|
|
1299
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
1300
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1301
|
+
platform: z.ZodLiteral<"local">;
|
|
1302
|
+
conversationId: z.ZodString;
|
|
1303
|
+
}, z.core.$strict>], "platform">;
|
|
1304
|
+
locationId: z.ZodOptional<z.ZodString>;
|
|
1305
|
+
actors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1306
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1307
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1308
|
+
userId: z.ZodString;
|
|
1309
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1310
|
+
platform: z.ZodLiteral<"slack">;
|
|
1311
|
+
teamId: z.ZodString;
|
|
1312
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1313
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1314
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1315
|
+
userId: z.ZodString;
|
|
1316
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1317
|
+
platform: z.ZodLiteral<"local">;
|
|
1318
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1319
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1320
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1321
|
+
userId: z.ZodString;
|
|
1322
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1323
|
+
platform: z.ZodLiteral<"web">;
|
|
1324
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1325
|
+
platform: z.ZodLiteral<"system">;
|
|
1326
|
+
name: z.ZodString;
|
|
1327
|
+
}, z.core.$strict>], "platform">>;
|
|
1328
|
+
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1329
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1330
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1331
|
+
userId: z.ZodString;
|
|
1332
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1333
|
+
platform: z.ZodLiteral<"slack">;
|
|
1334
|
+
teamId: z.ZodString;
|
|
1335
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1336
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1337
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1338
|
+
userId: z.ZodString;
|
|
1339
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1340
|
+
platform: z.ZodLiteral<"local">;
|
|
1341
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1342
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1343
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1344
|
+
userId: z.ZodString;
|
|
1345
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
1346
|
+
platform: z.ZodLiteral<"web">;
|
|
1347
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1348
|
+
platform: z.ZodLiteral<"system">;
|
|
1349
|
+
name: z.ZodString;
|
|
1350
|
+
}, z.core.$strict>], "platform">>;
|
|
1351
|
+
runId: z.ZodString;
|
|
1352
|
+
source: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1353
|
+
kind: z.ZodLiteral<"slack">;
|
|
1354
|
+
teamId: z.ZodString;
|
|
1355
|
+
channelId: z.ZodString;
|
|
1356
|
+
visibility: z.ZodEnum<{
|
|
1357
|
+
private: "private";
|
|
1358
|
+
public: "public";
|
|
1359
|
+
}>;
|
|
1360
|
+
messageTs: z.ZodOptional<z.ZodString>;
|
|
1361
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
1362
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1363
|
+
kind: z.ZodLiteral<"local">;
|
|
1364
|
+
visibility: z.ZodLiteral<"private">;
|
|
1365
|
+
conversationId: z.ZodString;
|
|
1366
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1367
|
+
kind: z.ZodLiteral<"web">;
|
|
1368
|
+
visibility: z.ZodEnum<{
|
|
1369
|
+
private: "private";
|
|
1370
|
+
public: "public";
|
|
1371
|
+
}>;
|
|
1372
|
+
conversationId: z.ZodString;
|
|
1373
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1374
|
+
kind: z.ZodLiteral<"event">;
|
|
1375
|
+
eventKey: z.ZodString;
|
|
1376
|
+
eventType: z.ZodString;
|
|
1377
|
+
identifier: z.ZodString;
|
|
1378
|
+
namespace: z.ZodString;
|
|
1379
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1380
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
1381
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
1382
|
+
kind: z.ZodLiteral<"scheduled_automation">;
|
|
1383
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1384
|
+
automationId: z.ZodOptional<z.ZodString>;
|
|
1385
|
+
automationRunId: z.ZodOptional<z.ZodString>;
|
|
1386
|
+
kind: z.ZodLiteral<"event_automation">;
|
|
1387
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1388
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
1389
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1390
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
1391
|
+
}, z.core.$strict>], "kind">, unknown>;
|
|
1392
|
+
transcript: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1260
1393
|
type: z.ZodLiteral<"message">;
|
|
1261
1394
|
role: z.ZodEnum<{
|
|
1262
|
-
|
|
1263
|
-
|
|
1395
|
+
assistant: "assistant";
|
|
1396
|
+
user: "user";
|
|
1264
1397
|
}>;
|
|
1265
1398
|
text: z.ZodString;
|
|
1266
1399
|
provenance: z.ZodOptional<z.ZodObject<{
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
platform: z.ZodLiteral<"slack">;
|
|
1273
|
-
teamId: z.ZodString;
|
|
1274
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1275
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1276
|
-
userId: z.ZodString;
|
|
1277
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1278
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1279
|
-
platform: z.ZodLiteral<"local">;
|
|
1280
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1281
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1282
|
-
userId: z.ZodString;
|
|
1283
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1284
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1285
|
-
platform: z.ZodLiteral<"web">;
|
|
1286
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1287
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1288
|
-
userId: z.ZodString;
|
|
1289
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1290
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1291
|
-
platform: z.ZodLiteral<"system">;
|
|
1292
|
-
name: z.ZodString;
|
|
1293
|
-
}, z.core.$strict>], "platform">>;
|
|
1294
|
-
}, z.core.$strict>>;
|
|
1295
|
-
isRunActor: z.ZodOptional<z.ZodBoolean>;
|
|
1296
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1297
|
-
type: z.ZodLiteral<"toolResult">;
|
|
1298
|
-
toolName: z.ZodString;
|
|
1299
|
-
isError: z.ZodBoolean;
|
|
1300
|
-
text: z.ZodOptional<z.ZodString>;
|
|
1301
|
-
}, z.core.$strict>], "type">;
|
|
1302
|
-
type PluginRunTranscriptProvenance = z.output<typeof pluginRunTranscriptProvenanceSchema>;
|
|
1303
|
-
/** Runtime-owned completed-run projection exposed to plugin tasks. */
|
|
1304
|
-
declare const pluginRunContextSchema: z.ZodObject<{
|
|
1305
|
-
actorUserId: z.ZodOptional<z.ZodString>;
|
|
1306
|
-
completedAtMs: z.ZodNumber;
|
|
1307
|
-
conversationId: z.ZodString;
|
|
1308
|
-
destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1309
|
-
platform: z.ZodLiteral<"slack">;
|
|
1310
|
-
teamId: z.ZodString;
|
|
1311
|
-
channelId: z.ZodString;
|
|
1312
|
-
threadTs: z.ZodOptional<z.ZodString>;
|
|
1313
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1314
|
-
platform: z.ZodLiteral<"local">;
|
|
1315
|
-
conversationId: z.ZodString;
|
|
1316
|
-
}, z.core.$strict>], "platform">;
|
|
1317
|
-
locationId: z.ZodOptional<z.ZodString>;
|
|
1318
|
-
actors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1319
|
-
platform: z.ZodLiteral<"slack">;
|
|
1320
|
-
teamId: z.ZodString;
|
|
1321
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1322
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1323
|
-
userId: z.ZodString;
|
|
1324
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1325
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1326
|
-
platform: z.ZodLiteral<"local">;
|
|
1327
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1328
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1329
|
-
userId: z.ZodString;
|
|
1330
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1331
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1332
|
-
platform: z.ZodLiteral<"web">;
|
|
1400
|
+
authority: z.ZodEnum<{
|
|
1401
|
+
context: "context";
|
|
1402
|
+
instruction: "instruction";
|
|
1403
|
+
}>;
|
|
1404
|
+
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1333
1405
|
email: z.ZodOptional<z.ZodString>;
|
|
1334
1406
|
fullName: z.ZodOptional<z.ZodString>;
|
|
1335
1407
|
userId: z.ZodString;
|
|
1336
1408
|
userName: z.ZodOptional<z.ZodString>;
|
|
1337
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1338
|
-
platform: z.ZodLiteral<"system">;
|
|
1339
|
-
name: z.ZodString;
|
|
1340
|
-
}, z.core.$strict>], "platform">>;
|
|
1341
|
-
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1342
1409
|
platform: z.ZodLiteral<"slack">;
|
|
1343
1410
|
teamId: z.ZodString;
|
|
1411
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1344
1412
|
email: z.ZodOptional<z.ZodString>;
|
|
1345
1413
|
fullName: z.ZodOptional<z.ZodString>;
|
|
1346
1414
|
userId: z.ZodString;
|
|
1347
1415
|
userName: z.ZodOptional<z.ZodString>;
|
|
1348
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1349
1416
|
platform: z.ZodLiteral<"local">;
|
|
1417
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1350
1418
|
email: z.ZodOptional<z.ZodString>;
|
|
1351
1419
|
fullName: z.ZodOptional<z.ZodString>;
|
|
1352
1420
|
userId: z.ZodString;
|
|
1353
1421
|
userName: z.ZodOptional<z.ZodString>;
|
|
1354
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1355
1422
|
platform: z.ZodLiteral<"web">;
|
|
1356
|
-
|
|
1357
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1358
|
-
userId: z.ZodString;
|
|
1359
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1360
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1423
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1361
1424
|
platform: z.ZodLiteral<"system">;
|
|
1362
1425
|
name: z.ZodString;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
}>;
|
|
1373
|
-
messageTs: z.ZodOptional<z.ZodString>;
|
|
1374
|
-
threadTs: z.ZodOptional<z.ZodString>;
|
|
1375
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1376
|
-
kind: z.ZodLiteral<"local">;
|
|
1377
|
-
visibility: z.ZodLiteral<"private">;
|
|
1378
|
-
conversationId: z.ZodString;
|
|
1379
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1380
|
-
kind: z.ZodLiteral<"web">;
|
|
1381
|
-
visibility: z.ZodEnum<{
|
|
1382
|
-
public: "public";
|
|
1383
|
-
private: "private";
|
|
1384
|
-
}>;
|
|
1385
|
-
conversationId: z.ZodString;
|
|
1386
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1387
|
-
kind: z.ZodLiteral<"event">;
|
|
1388
|
-
eventKey: z.ZodString;
|
|
1389
|
-
eventType: z.ZodString;
|
|
1390
|
-
identifier: z.ZodString;
|
|
1391
|
-
namespace: z.ZodString;
|
|
1392
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1393
|
-
kind: z.ZodLiteral<"scheduled_automation">;
|
|
1394
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1395
|
-
kind: z.ZodLiteral<"event_automation">;
|
|
1396
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1397
|
-
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
1398
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1399
|
-
kind: z.ZodLiteral<"agent_invocation">;
|
|
1400
|
-
}, z.core.$strict>], "kind">, unknown>;
|
|
1401
|
-
transcript: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1402
|
-
type: z.ZodLiteral<"message">;
|
|
1403
|
-
role: z.ZodEnum<{
|
|
1404
|
-
user: "user";
|
|
1405
|
-
assistant: "assistant";
|
|
1406
|
-
}>;
|
|
1407
|
-
text: z.ZodString;
|
|
1408
|
-
provenance: z.ZodOptional<z.ZodObject<{
|
|
1409
|
-
authority: z.ZodEnum<{
|
|
1410
|
-
instruction: "instruction";
|
|
1411
|
-
context: "context";
|
|
1412
|
-
}>;
|
|
1413
|
-
actor: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1414
|
-
platform: z.ZodLiteral<"slack">;
|
|
1415
|
-
teamId: z.ZodString;
|
|
1416
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1417
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1418
|
-
userId: z.ZodString;
|
|
1419
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1420
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1421
|
-
platform: z.ZodLiteral<"local">;
|
|
1422
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1423
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1424
|
-
userId: z.ZodString;
|
|
1425
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1426
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1427
|
-
platform: z.ZodLiteral<"web">;
|
|
1428
|
-
email: z.ZodOptional<z.ZodString>;
|
|
1429
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
1430
|
-
userId: z.ZodString;
|
|
1431
|
-
userName: z.ZodOptional<z.ZodString>;
|
|
1432
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1433
|
-
platform: z.ZodLiteral<"system">;
|
|
1434
|
-
name: z.ZodString;
|
|
1435
|
-
}, z.core.$strict>], "platform">>;
|
|
1436
|
-
}, z.core.$strict>>;
|
|
1437
|
-
isRunActor: z.ZodOptional<z.ZodBoolean>;
|
|
1438
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
1439
|
-
type: z.ZodLiteral<"toolResult">;
|
|
1440
|
-
toolName: z.ZodString;
|
|
1441
|
-
isError: z.ZodBoolean;
|
|
1442
|
-
text: z.ZodOptional<z.ZodString>;
|
|
1443
|
-
}, z.core.$strict>], "type">>;
|
|
1426
|
+
}, z.core.$strict>], "platform">>;
|
|
1427
|
+
}, z.core.$strict>>;
|
|
1428
|
+
isRunActor: z.ZodOptional<z.ZodBoolean>;
|
|
1429
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1430
|
+
type: z.ZodLiteral<"toolResult">;
|
|
1431
|
+
toolName: z.ZodString;
|
|
1432
|
+
isError: z.ZodBoolean;
|
|
1433
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1434
|
+
}, z.core.$strict>], "type">>;
|
|
1444
1435
|
}, z.core.$strict>;
|
|
1445
|
-
type PluginRunTranscriptEntry = z.output<typeof pluginRunTranscriptEntrySchema>;
|
|
1446
|
-
type PluginRunContext = z.output<typeof pluginRunContextSchema>;
|
|
1436
|
+
export type PluginRunTranscriptEntry = z.output<typeof pluginRunTranscriptEntrySchema>;
|
|
1437
|
+
export type PluginRunContext = z.output<typeof pluginRunContextSchema>;
|
|
1447
1438
|
/** Runtime context passed to a plugin-owned background task. */
|
|
1448
|
-
interface PluginTaskContext extends PluginContext {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1439
|
+
export interface PluginTaskContext extends PluginContext {
|
|
1440
|
+
embedder: PluginEmbedder;
|
|
1441
|
+
events: PluginConversationEvents;
|
|
1442
|
+
id: string;
|
|
1443
|
+
model: PluginModel;
|
|
1444
|
+
name: string;
|
|
1445
|
+
run: {
|
|
1446
|
+
load(): Promise<PluginRunContext>;
|
|
1447
|
+
};
|
|
1448
|
+
state: PluginState;
|
|
1458
1449
|
}
|
|
1459
1450
|
/** Plugin task handler registered by name in a plugin manifest module. */
|
|
1460
|
-
interface PluginTaskDefinition {
|
|
1461
|
-
|
|
1451
|
+
export interface PluginTaskDefinition {
|
|
1452
|
+
run(ctx: PluginTaskContext): Promise<void> | void;
|
|
1462
1453
|
}
|
|
1463
1454
|
/** Task handlers keyed by the plugin-owned task name. */
|
|
1464
|
-
type PluginTasks = Record<string, PluginTaskDefinition>;
|
|
1465
|
-
|
|
1455
|
+
export type PluginTasks = Record<string, PluginTaskDefinition>;
|
|
1466
1456
|
declare const pluginGrantAccessSchema: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
|
|
1467
1457
|
/** Runtime schema for provider authorization a plugin may request. */
|
|
1468
|
-
declare const pluginAuthorizationSchema: z.ZodObject<{
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1458
|
+
export declare const pluginAuthorizationSchema: z.ZodObject<{
|
|
1459
|
+
provider: z.ZodString;
|
|
1460
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1461
|
+
type: z.ZodLiteral<"oauth">;
|
|
1472
1462
|
}, z.core.$strict>;
|
|
1473
1463
|
/** Runtime schema for a provider account attached to stored OAuth tokens. */
|
|
1474
|
-
declare const pluginProviderAccountSchema: z.ZodObject<{
|
|
1464
|
+
export declare const pluginProviderAccountSchema: z.ZodObject<{
|
|
1465
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1466
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
id: z.ZodString;
|
|
1468
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1469
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1470
|
+
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1471
|
+
}, z.core.$strict>;
|
|
1472
|
+
/** Runtime schema for OAuth tokens stored by the host for plugin credentials. */
|
|
1473
|
+
export declare const pluginStoredTokensSchema: z.ZodObject<{
|
|
1474
|
+
account: z.ZodOptional<z.ZodObject<{
|
|
1475
1475
|
displayName: z.ZodOptional<z.ZodString>;
|
|
1476
1476
|
handle: z.ZodOptional<z.ZodString>;
|
|
1477
1477
|
id: z.ZodString;
|
|
1478
1478
|
label: z.ZodOptional<z.ZodString>;
|
|
1479
1479
|
url: z.ZodOptional<z.ZodString>;
|
|
1480
1480
|
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1481
|
-
}, z.core.$strict
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
id: z.ZodString;
|
|
1488
|
-
label: z.ZodOptional<z.ZodString>;
|
|
1489
|
-
url: z.ZodOptional<z.ZodString>;
|
|
1490
|
-
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1491
|
-
}, z.core.$strict>>;
|
|
1492
|
-
accessToken: z.ZodString;
|
|
1493
|
-
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1494
|
-
refreshToken: z.ZodString;
|
|
1495
|
-
refreshTokenExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1496
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
1481
|
+
}, z.core.$strict>>;
|
|
1482
|
+
accessToken: z.ZodString;
|
|
1483
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1484
|
+
refreshToken: z.ZodString;
|
|
1485
|
+
refreshTokenExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1486
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1497
1487
|
}, z.core.$strict>;
|
|
1498
1488
|
/** Runtime schema for a plugin-defined outbound credential grant. */
|
|
1499
|
-
declare const pluginGrantSchema: z.ZodObject<{
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1489
|
+
export declare const pluginGrantSchema: z.ZodObject<{
|
|
1490
|
+
access: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
|
|
1491
|
+
leaseScope: z.ZodOptional<z.ZodString>;
|
|
1492
|
+
name: z.ZodString;
|
|
1493
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1494
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1505
1495
|
}, z.core.$strict>;
|
|
1506
1496
|
/** Runtime schema for plugin-issued header mutations. */
|
|
1507
|
-
declare const pluginCredentialHeaderTransformSchema: z.ZodObject<{
|
|
1497
|
+
export declare const pluginCredentialHeaderTransformSchema: z.ZodObject<{
|
|
1498
|
+
domain: z.ZodString;
|
|
1499
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1500
|
+
}, z.core.$strict>;
|
|
1501
|
+
/** Runtime schema for a short-lived plugin-issued credential lease. */
|
|
1502
|
+
export declare const pluginCredentialLeaseSchema: z.ZodObject<{
|
|
1503
|
+
account: z.ZodOptional<z.ZodObject<{
|
|
1504
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1505
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1506
|
+
id: z.ZodString;
|
|
1507
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1508
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1509
|
+
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1510
|
+
}, z.core.$strict>>;
|
|
1511
|
+
authorization: z.ZodOptional<z.ZodObject<{
|
|
1512
|
+
provider: z.ZodString;
|
|
1513
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1514
|
+
type: z.ZodLiteral<"oauth">;
|
|
1515
|
+
}, z.core.$strict>>;
|
|
1516
|
+
expiresAt: z.ZodString;
|
|
1517
|
+
headerTransforms: z.ZodArray<z.ZodObject<{
|
|
1508
1518
|
domain: z.ZodString;
|
|
1509
1519
|
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1520
|
+
}, z.core.$strict>>;
|
|
1510
1521
|
}, z.core.$strict>;
|
|
1511
|
-
/** Runtime schema for a
|
|
1512
|
-
declare const
|
|
1522
|
+
/** Runtime schema for the result returned by a plugin credential hook. */
|
|
1523
|
+
export declare const pluginCredentialResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1524
|
+
lease: z.ZodObject<{
|
|
1513
1525
|
account: z.ZodOptional<z.ZodObject<{
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1526
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1527
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1528
|
+
id: z.ZodString;
|
|
1529
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1530
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1531
|
+
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1520
1532
|
}, z.core.$strict>>;
|
|
1521
1533
|
authorization: z.ZodOptional<z.ZodObject<{
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1534
|
+
provider: z.ZodString;
|
|
1535
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1536
|
+
type: z.ZodLiteral<"oauth">;
|
|
1525
1537
|
}, z.core.$strict>>;
|
|
1526
1538
|
expiresAt: z.ZodString;
|
|
1527
1539
|
headerTransforms: z.ZodArray<z.ZodObject<{
|
|
1528
|
-
|
|
1529
|
-
|
|
1540
|
+
domain: z.ZodString;
|
|
1541
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1530
1542
|
}, z.core.$strict>>;
|
|
1531
|
-
}, z.core.$strict>;
|
|
1532
|
-
|
|
1533
|
-
declare const pluginCredentialResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1534
|
-
lease: z.ZodObject<{
|
|
1535
|
-
account: z.ZodOptional<z.ZodObject<{
|
|
1536
|
-
displayName: z.ZodOptional<z.ZodString>;
|
|
1537
|
-
handle: z.ZodOptional<z.ZodString>;
|
|
1538
|
-
id: z.ZodString;
|
|
1539
|
-
label: z.ZodOptional<z.ZodString>;
|
|
1540
|
-
url: z.ZodOptional<z.ZodString>;
|
|
1541
|
-
verifiedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1542
|
-
}, z.core.$strict>>;
|
|
1543
|
-
authorization: z.ZodOptional<z.ZodObject<{
|
|
1544
|
-
provider: z.ZodString;
|
|
1545
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
1546
|
-
type: z.ZodLiteral<"oauth">;
|
|
1547
|
-
}, z.core.$strict>>;
|
|
1548
|
-
expiresAt: z.ZodString;
|
|
1549
|
-
headerTransforms: z.ZodArray<z.ZodObject<{
|
|
1550
|
-
domain: z.ZodString;
|
|
1551
|
-
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1552
|
-
}, z.core.$strict>>;
|
|
1553
|
-
}, z.core.$strict>;
|
|
1554
|
-
type: z.ZodLiteral<"lease">;
|
|
1543
|
+
}, z.core.$strict>;
|
|
1544
|
+
type: z.ZodLiteral<"lease">;
|
|
1555
1545
|
}, z.core.$strict>, z.ZodObject<{
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1546
|
+
authorization: z.ZodOptional<z.ZodObject<{
|
|
1547
|
+
provider: z.ZodString;
|
|
1548
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1549
|
+
type: z.ZodLiteral<"oauth">;
|
|
1550
|
+
}, z.core.$strict>>;
|
|
1551
|
+
message: z.ZodString;
|
|
1552
|
+
type: z.ZodLiteral<"needed">;
|
|
1563
1553
|
}, z.core.$strict>, z.ZodObject<{
|
|
1564
|
-
|
|
1565
|
-
|
|
1554
|
+
message: z.ZodString;
|
|
1555
|
+
type: z.ZodLiteral<"unavailable">;
|
|
1566
1556
|
}, z.core.$strict>], "type">;
|
|
1567
|
-
type PluginCredentialSubject = z.output<typeof pluginCredentialSubjectSchema>;
|
|
1568
|
-
type PluginGrantAccess = z.output<typeof pluginGrantAccessSchema>;
|
|
1557
|
+
export type PluginCredentialSubject = z.output<typeof pluginCredentialSubjectSchema>;
|
|
1558
|
+
export type PluginGrantAccess = z.output<typeof pluginGrantAccessSchema>;
|
|
1569
1559
|
/** Provider authorization Junior can start when a plugin-owned grant is missing. */
|
|
1570
|
-
type PluginAuthorization = z.output<typeof pluginAuthorizationSchema>;
|
|
1560
|
+
export type PluginAuthorization = z.output<typeof pluginAuthorizationSchema>;
|
|
1571
1561
|
/** Interrupt sandbox egress so Junior can start provider authorization. */
|
|
1572
|
-
declare class EgressAuthRequired extends Error {
|
|
1562
|
+
export declare class EgressAuthRequired extends Error {
|
|
1563
|
+
authorization?: PluginAuthorization;
|
|
1564
|
+
constructor(message: string, options?: {
|
|
1573
1565
|
authorization?: PluginAuthorization;
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
cause?: unknown;
|
|
1577
|
-
});
|
|
1566
|
+
cause?: unknown;
|
|
1567
|
+
});
|
|
1578
1568
|
}
|
|
1579
1569
|
/** Deny provider egress before Junior issues credentials for a disallowed operation. */
|
|
1580
|
-
declare class EgressPolicyDenied extends Error {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1570
|
+
export declare class EgressPolicyDenied extends Error {
|
|
1571
|
+
constructor(message: string, options?: {
|
|
1572
|
+
cause?: unknown;
|
|
1573
|
+
});
|
|
1584
1574
|
}
|
|
1585
1575
|
/** Provider account identity resolved by a plugin OAuth hook. */
|
|
1586
|
-
type PluginProviderAccount = z.output<typeof pluginProviderAccountSchema>;
|
|
1576
|
+
export type PluginProviderAccount = z.output<typeof pluginProviderAccountSchema>;
|
|
1587
1577
|
/** Plugin-defined grant required before Junior can forward one outbound request. */
|
|
1588
|
-
type PluginGrant = z.output<typeof pluginGrantSchema>;
|
|
1578
|
+
export type PluginGrant = z.output<typeof pluginGrantSchema>;
|
|
1589
1579
|
/** Request details available while selecting the grant for sandbox egress. */
|
|
1590
|
-
interface PluginEgressRequest {
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
}
|
|
1598
|
-
interface EgressHookContext extends PluginContext {
|
|
1599
|
-
|
|
1600
|
-
}
|
|
1601
|
-
interface PluginEgressResponse {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
}
|
|
1607
|
-
interface EgressResponseHookContext extends PluginContext {
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1580
|
+
export interface PluginEgressRequest {
|
|
1581
|
+
/** Capped request body text when the host exposes it for provider-specific grant classification. */
|
|
1582
|
+
bodyText?: string;
|
|
1583
|
+
method: string;
|
|
1584
|
+
/** Plugin-declared operation this request performs, used for grant classification and diagnostics. */
|
|
1585
|
+
operation?: string;
|
|
1586
|
+
url: string;
|
|
1587
|
+
}
|
|
1588
|
+
export interface EgressHookContext extends PluginContext {
|
|
1589
|
+
request: PluginEgressRequest;
|
|
1590
|
+
}
|
|
1591
|
+
export interface PluginEgressResponse {
|
|
1592
|
+
/** Snapshot of upstream response headers; mutations do not affect pass-through. */
|
|
1593
|
+
headers: Headers;
|
|
1594
|
+
readText(maxBytes: number): Promise<string | undefined>;
|
|
1595
|
+
status: number;
|
|
1596
|
+
}
|
|
1597
|
+
export interface EgressResponseHookContext extends PluginContext {
|
|
1598
|
+
grant: PluginGrant;
|
|
1599
|
+
permissionDenied(message: string): void;
|
|
1600
|
+
request: Omit<PluginEgressRequest, "bodyText">;
|
|
1601
|
+
response: PluginEgressResponse;
|
|
1612
1602
|
}
|
|
1613
1603
|
/** Header mutations a plugin-issued credential lease may apply to owned domains. */
|
|
1614
|
-
type PluginCredentialHeaderTransform = z.output<typeof pluginCredentialHeaderTransformSchema>;
|
|
1604
|
+
export type PluginCredentialHeaderTransform = z.output<typeof pluginCredentialHeaderTransformSchema>;
|
|
1615
1605
|
/** Short-lived credential headers issued by a plugin for a selected grant. */
|
|
1616
|
-
type PluginCredentialLease = z.output<typeof pluginCredentialLeaseSchema>;
|
|
1617
|
-
type PluginCredentialResult = z.output<typeof pluginCredentialResultSchema>;
|
|
1618
|
-
type PluginCredentialActor = {
|
|
1619
|
-
|
|
1620
|
-
|
|
1606
|
+
export type PluginCredentialLease = z.output<typeof pluginCredentialLeaseSchema>;
|
|
1607
|
+
export type PluginCredentialResult = z.output<typeof pluginCredentialResultSchema>;
|
|
1608
|
+
export type PluginCredentialActor = {
|
|
1609
|
+
platform: "system";
|
|
1610
|
+
name: string;
|
|
1621
1611
|
} | {
|
|
1622
|
-
|
|
1623
|
-
|
|
1612
|
+
type: "user";
|
|
1613
|
+
userId: string;
|
|
1624
1614
|
};
|
|
1625
|
-
interface PluginResolvedCredentialUser {
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
}
|
|
1629
|
-
type PluginStoredTokens = z.output<typeof pluginStoredTokensSchema>;
|
|
1630
|
-
interface PluginUserTokenSlot {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
}
|
|
1637
|
-
interface PluginTokenStore {
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
}
|
|
1641
|
-
interface ResolveOAuthAccountHookContext extends PluginContext {
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
}
|
|
1649
|
-
interface IssueCredentialHookContext extends PluginContext {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
state: PluginReadState;
|
|
1615
|
+
export interface PluginResolvedCredentialUser {
|
|
1616
|
+
type: "user";
|
|
1617
|
+
userId: string;
|
|
1618
|
+
}
|
|
1619
|
+
export type PluginStoredTokens = z.output<typeof pluginStoredTokensSchema>;
|
|
1620
|
+
export interface PluginUserTokenSlot {
|
|
1621
|
+
get(): Promise<PluginStoredTokens | undefined>;
|
|
1622
|
+
set(tokens: PluginStoredTokens): Promise<void>;
|
|
1623
|
+
/** Run token refresh work after the host has serialized this user/provider slot, or throw after a bounded wait. */
|
|
1624
|
+
withRefresh<T>(callback: () => Promise<T>): Promise<T>;
|
|
1625
|
+
userId: string;
|
|
1626
|
+
}
|
|
1627
|
+
export interface PluginTokenStore {
|
|
1628
|
+
credentialSubject?: PluginUserTokenSlot;
|
|
1629
|
+
currentUser?: PluginUserTokenSlot;
|
|
1630
|
+
}
|
|
1631
|
+
export interface ResolveOAuthAccountHookContext extends PluginContext {
|
|
1632
|
+
tokens: PluginStoredTokens;
|
|
1633
|
+
/**
|
|
1634
|
+
* Parsed JSON body of the provider token response. Some providers return
|
|
1635
|
+
* the authorized account in this body.
|
|
1636
|
+
*/
|
|
1637
|
+
tokenResponse: Record<string, unknown>;
|
|
1638
|
+
}
|
|
1639
|
+
export interface IssueCredentialHookContext extends PluginContext {
|
|
1640
|
+
actor: PluginCredentialActor;
|
|
1641
|
+
credentialSubject?: PluginResolvedCredentialUser;
|
|
1642
|
+
grant: PluginGrant;
|
|
1643
|
+
tokens: PluginTokenStore;
|
|
1644
|
+
}
|
|
1645
|
+
export interface HeartbeatHookContext extends PluginContext {
|
|
1646
|
+
agent: {
|
|
1647
|
+
dispatch(options: DispatchOptions): Promise<DispatchResult>;
|
|
1648
|
+
get(id: string): Promise<Dispatch | undefined>;
|
|
1649
|
+
};
|
|
1650
|
+
nowMs: number;
|
|
1651
|
+
state: PluginState;
|
|
1652
|
+
}
|
|
1653
|
+
export interface HeartbeatResult {
|
|
1654
|
+
dispatchCount?: number;
|
|
1655
|
+
}
|
|
1656
|
+
export interface UnfinishedWorkHookContext extends PluginContext {
|
|
1657
|
+
/** Bounded conversation candidates selected by the host. */
|
|
1658
|
+
conversationIds: string[];
|
|
1659
|
+
}
|
|
1660
|
+
export interface UnfinishedWorkResult {
|
|
1661
|
+
/** Candidate conversations that have plugin-owned work to finish. */
|
|
1662
|
+
conversationIds: string[];
|
|
1663
|
+
/**
|
|
1664
|
+
* Candidate conversations that have any associated plugin-owned work,
|
|
1665
|
+
* finished or unfinished. Omit when the plugin cannot distinguish assignment.
|
|
1666
|
+
*
|
|
1667
|
+
* The host uses this with unfinished work and finish times to set feed
|
|
1668
|
+
* `isPriority`. Finished assigned work stays out of Priority unless the
|
|
1669
|
+
* conversation has activity after the finish time.
|
|
1670
|
+
*/
|
|
1671
|
+
assignedConversationIds?: string[];
|
|
1672
|
+
/**
|
|
1673
|
+
* Latest time when all known work finished, keyed by conversation id.
|
|
1674
|
+
* ISO-8601 timestamps. Used with conversation activity to decide whether
|
|
1675
|
+
* finished work still belongs in Priority.
|
|
1676
|
+
*/
|
|
1677
|
+
finishedWorkAtByConversationId?: Record<string, string>;
|
|
1678
|
+
}
|
|
1679
|
+
export type PluginOperationalTone = "danger" | "good" | "neutral" | "warning";
|
|
1680
|
+
export interface PluginOperationalMetric {
|
|
1681
|
+
label: string;
|
|
1682
|
+
tone?: PluginOperationalTone;
|
|
1683
|
+
value: string;
|
|
1684
|
+
}
|
|
1685
|
+
export interface PluginOperationalField {
|
|
1686
|
+
key: string;
|
|
1687
|
+
label: string;
|
|
1688
|
+
}
|
|
1689
|
+
export interface PluginOperationalRecord {
|
|
1690
|
+
id: string;
|
|
1691
|
+
tone?: PluginOperationalTone;
|
|
1692
|
+
values: Record<string, string>;
|
|
1693
|
+
}
|
|
1694
|
+
export interface PluginOperationalRecordSet {
|
|
1695
|
+
fields?: PluginOperationalField[];
|
|
1696
|
+
emptyText?: string;
|
|
1697
|
+
records?: PluginOperationalRecord[];
|
|
1698
|
+
title: string;
|
|
1699
|
+
}
|
|
1700
|
+
export interface PluginOperationalChartSeries {
|
|
1701
|
+
format?: "usd";
|
|
1702
|
+
key: string;
|
|
1703
|
+
label: string;
|
|
1704
|
+
tone?: PluginOperationalTone;
|
|
1705
|
+
}
|
|
1706
|
+
export interface PluginOperationalChartCategory {
|
|
1707
|
+
id: string;
|
|
1708
|
+
label: string;
|
|
1709
|
+
values: Record<string, number>;
|
|
1710
|
+
}
|
|
1711
|
+
export interface PluginOperationalBarChartWidget {
|
|
1712
|
+
categories: PluginOperationalChartCategory[];
|
|
1713
|
+
description?: string;
|
|
1714
|
+
emptyText?: string;
|
|
1715
|
+
id: string;
|
|
1716
|
+
series: PluginOperationalChartSeries[];
|
|
1717
|
+
timeRangeDays?: Array<1 | 7 | 30 | 90>;
|
|
1718
|
+
title: string;
|
|
1719
|
+
type: "bar_chart";
|
|
1720
|
+
}
|
|
1721
|
+
export interface PluginOperationalReportContent {
|
|
1722
|
+
generatedAt?: string;
|
|
1723
|
+
metrics?: PluginOperationalMetric[];
|
|
1724
|
+
recordSets?: PluginOperationalRecordSet[];
|
|
1725
|
+
title?: string;
|
|
1726
|
+
widgets?: PluginOperationalBarChartWidget[];
|
|
1727
|
+
}
|
|
1728
|
+
export interface PluginOperationalReport extends PluginOperationalReportContent {
|
|
1729
|
+
pluginName: string;
|
|
1730
|
+
}
|
|
1731
|
+
export interface OperationalReportHookContext extends PluginContext {
|
|
1732
|
+
eventStats: PluginConversationEventStats;
|
|
1733
|
+
nowMs: number;
|
|
1734
|
+
state: PluginReadState;
|
|
1746
1735
|
}
|
|
1747
1736
|
/** Read-only context for one person-scoped plugin report on a profile page. */
|
|
1748
|
-
interface ProfileReportHookContext extends PluginContext {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}
|
|
1756
|
-
type PluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "ALL";
|
|
1757
|
-
type PluginRouteHandler = {
|
|
1758
|
-
|
|
1737
|
+
export interface ProfileReportHookContext extends PluginContext {
|
|
1738
|
+
nowMs: number;
|
|
1739
|
+
state: PluginReadState;
|
|
1740
|
+
/** Canonical user for the profile being viewed. */
|
|
1741
|
+
subject: User;
|
|
1742
|
+
/** Canonical user for the authenticated viewer. */
|
|
1743
|
+
viewer: User;
|
|
1744
|
+
}
|
|
1745
|
+
export type PluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "ALL";
|
|
1746
|
+
export type PluginRouteHandler = {
|
|
1747
|
+
bivarianceHack(request: Request): Promise<Response> | Response;
|
|
1759
1748
|
}["bivarianceHack"];
|
|
1760
|
-
interface PluginRoute {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1749
|
+
export interface PluginRoute {
|
|
1750
|
+
handler: PluginRouteHandler;
|
|
1751
|
+
method?: PluginRouteMethod | PluginRouteMethod[];
|
|
1752
|
+
path: string;
|
|
1764
1753
|
}
|
|
1765
1754
|
/** Fetch-compatible plugin HTTP app mounted by Junior. */
|
|
1766
|
-
type PluginRouteApp = {
|
|
1767
|
-
|
|
1755
|
+
export type PluginRouteApp = {
|
|
1756
|
+
fetch(request: Request, context?: PluginApiRouteRequestContext): Promise<Response> | Response;
|
|
1768
1757
|
};
|
|
1769
|
-
interface RouteRegistrationHookContext extends PluginContext {
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
}
|
|
1776
|
-
interface ApiRouteRegistrationHookContext extends PluginContext {
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1758
|
+
export interface RouteRegistrationHookContext extends PluginContext {
|
|
1759
|
+
annotations: PluginConversationAnnotations;
|
|
1760
|
+
/** Provider-neutral write boundary for Junior's native code index. */
|
|
1761
|
+
codeChanges: CodeChangePublisher;
|
|
1762
|
+
/** Core-owned delivery boundary for provider webhook events. */
|
|
1763
|
+
events: EventPublisher;
|
|
1764
|
+
}
|
|
1765
|
+
export interface ApiRouteRegistrationHookContext extends PluginContext {
|
|
1766
|
+
conversationEvents: PluginConversationEventReader;
|
|
1767
|
+
eventStats: PluginConversationEventStats;
|
|
1768
|
+
users: {
|
|
1769
|
+
/** Resolve or create the canonical user for one verified email. */
|
|
1770
|
+
resolve(email: string): Promise<User | undefined>;
|
|
1771
|
+
};
|
|
1783
1772
|
}
|
|
1784
1773
|
/** Per-request context Junior passes to authenticated plugin product API routes. */
|
|
1785
|
-
declare const pluginApiRouteRequestContextSchema: z.ZodObject<{
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
}, z.core.$strict>;
|
|
1774
|
+
export declare const pluginApiRouteRequestContextSchema: z.ZodObject<{
|
|
1775
|
+
auth: z.ZodObject<{
|
|
1776
|
+
user: z.ZodObject<{
|
|
1777
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1778
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
1779
|
+
isAdmin: z.ZodBoolean;
|
|
1780
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1793
1781
|
}, z.core.$strict>;
|
|
1794
|
-
|
|
1782
|
+
}, z.core.$strict>;
|
|
1783
|
+
pluginName: z.ZodString;
|
|
1795
1784
|
}, z.core.$strict>;
|
|
1796
|
-
type PluginApiRouteRequestContext = z.output<typeof pluginApiRouteRequestContextSchema>;
|
|
1797
|
-
interface SlackConversationLink {
|
|
1798
|
-
|
|
1785
|
+
export type PluginApiRouteRequestContext = z.output<typeof pluginApiRouteRequestContextSchema>;
|
|
1786
|
+
export interface SlackConversationLink {
|
|
1787
|
+
url: string;
|
|
1799
1788
|
}
|
|
1800
|
-
interface SlackConversationLinkHookContext extends PluginContext {
|
|
1801
|
-
|
|
1789
|
+
export interface SlackConversationLinkHookContext extends PluginContext {
|
|
1790
|
+
conversationId: string;
|
|
1802
1791
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
set(key: string, value: string): void;
|
|
1792
|
+
export interface PluginEnv {
|
|
1793
|
+
get(key: string): string | undefined;
|
|
1794
|
+
set(key: string, value: string): void;
|
|
1807
1795
|
}
|
|
1808
|
-
interface PluginDecision {
|
|
1809
|
-
|
|
1810
|
-
|
|
1796
|
+
export interface PluginDecision {
|
|
1797
|
+
deny(message: string): void;
|
|
1798
|
+
replaceInput(input: Record<string, unknown>): void;
|
|
1811
1799
|
}
|
|
1812
1800
|
/** Thrown when a plugin tool rejects invalid model or user input. */
|
|
1813
|
-
declare class PluginToolInputError extends Error {
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
}
|
|
1818
|
-
interface PluginSandbox {
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
}
|
|
1840
|
-
interface PluginEgress {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
}
|
|
1854
|
-
declare const pluginToolContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1855
|
-
|
|
1856
|
-
|
|
1801
|
+
export declare class PluginToolInputError extends Error {
|
|
1802
|
+
constructor(message: string, options?: {
|
|
1803
|
+
cause?: unknown;
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
export interface PluginSandbox {
|
|
1807
|
+
juniorRoot: string;
|
|
1808
|
+
root: string;
|
|
1809
|
+
readFile(path: string): Promise<Uint8Array | null>;
|
|
1810
|
+
run(input: {
|
|
1811
|
+
args?: string[];
|
|
1812
|
+
cmd: string;
|
|
1813
|
+
cwd?: string;
|
|
1814
|
+
env?: Record<string, string>;
|
|
1815
|
+
signal?: AbortSignal;
|
|
1816
|
+
sudo?: boolean;
|
|
1817
|
+
}): Promise<{
|
|
1818
|
+
exitCode: number;
|
|
1819
|
+
stderr: string;
|
|
1820
|
+
stdout: string;
|
|
1821
|
+
}>;
|
|
1822
|
+
writeFile(input: {
|
|
1823
|
+
content: string | Uint8Array;
|
|
1824
|
+
mode?: number;
|
|
1825
|
+
path: string;
|
|
1826
|
+
}): Promise<void>;
|
|
1827
|
+
}
|
|
1828
|
+
export interface PluginEgress {
|
|
1829
|
+
/**
|
|
1830
|
+
* Fetch a provider URL with host-owned credentials.
|
|
1831
|
+
*
|
|
1832
|
+
* The runtime selects and injects credentials for `provider`; plugin code
|
|
1833
|
+
* owns the request shape and response handling. `operation` names the
|
|
1834
|
+
* provider action for grant selection and diagnostics.
|
|
1835
|
+
*/
|
|
1836
|
+
fetch(input: {
|
|
1837
|
+
operation: string;
|
|
1838
|
+
provider: string;
|
|
1839
|
+
request: Request;
|
|
1840
|
+
}): Promise<Response>;
|
|
1841
|
+
}
|
|
1842
|
+
export declare const pluginToolContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1843
|
+
type: z.ZodLiteral<"text">;
|
|
1844
|
+
text: z.ZodString;
|
|
1857
1845
|
}, z.core.$strict>, z.ZodObject<{
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1846
|
+
type: z.ZodLiteral<"image">;
|
|
1847
|
+
data: z.ZodString;
|
|
1848
|
+
mimeType: z.ZodString;
|
|
1861
1849
|
}, z.core.$strict>], "type">;
|
|
1862
1850
|
/** Model-visible content returned by a plugin tool. */
|
|
1863
|
-
type PluginToolContent = z.output<typeof pluginToolContentSchema>;
|
|
1851
|
+
export type PluginToolContent = z.output<typeof pluginToolContentSchema>;
|
|
1864
1852
|
/** Pi-native projection with model-facing content and canonical runtime details. */
|
|
1865
|
-
interface PluginToolOutputEnvelope<TDetails = unknown> {
|
|
1866
|
-
|
|
1867
|
-
|
|
1853
|
+
export interface PluginToolOutputEnvelope<TDetails = unknown> {
|
|
1854
|
+
content: PluginToolContent[];
|
|
1855
|
+
details: TDetails;
|
|
1868
1856
|
}
|
|
1869
|
-
type PluginMcpContent = PluginToolContent;
|
|
1857
|
+
export type PluginMcpContent = PluginToolContent;
|
|
1870
1858
|
/** Successful raw provider result returned to a plugin-owned wrapper tool. */
|
|
1871
|
-
type PluginMcpToolSuccess = {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1859
|
+
export type PluginMcpToolSuccess = {
|
|
1860
|
+
content: PluginMcpContent[];
|
|
1861
|
+
status: "success";
|
|
1862
|
+
structuredContent?: unknown;
|
|
1875
1863
|
};
|
|
1876
1864
|
/** Handled provider authorization pause with no provider result to consume. */
|
|
1877
|
-
type PluginMcpAuthorizationPending = {
|
|
1878
|
-
|
|
1865
|
+
export type PluginMcpAuthorizationPending = {
|
|
1866
|
+
status: "authorization_pending";
|
|
1879
1867
|
};
|
|
1880
1868
|
/** Definitive provider rejection; transport and session failures still throw. */
|
|
1881
|
-
type PluginMcpToolError = {
|
|
1882
|
-
|
|
1883
|
-
|
|
1869
|
+
export type PluginMcpToolError = {
|
|
1870
|
+
message: string;
|
|
1871
|
+
status: "error";
|
|
1884
1872
|
};
|
|
1885
|
-
type PluginMcpToolResult = PluginMcpAuthorizationPending | PluginMcpToolError | PluginMcpToolSuccess;
|
|
1873
|
+
export type PluginMcpToolResult = PluginMcpAuthorizationPending | PluginMcpToolError | PluginMcpToolSuccess;
|
|
1886
1874
|
/** Access to this plugin's hosted MCP provider without exposing credentials. */
|
|
1887
|
-
interface PluginMcp {
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1875
|
+
export interface PluginMcp {
|
|
1876
|
+
/**
|
|
1877
|
+
* Call a provider tool declared in `wrappedTools`.
|
|
1878
|
+
*
|
|
1879
|
+
* The host activates the provider when needed. Successful calls return the
|
|
1880
|
+
* provider's original content, provider rejections return an error result,
|
|
1881
|
+
* and authorization pauses return no tool content. Transport failures throw.
|
|
1882
|
+
*/
|
|
1883
|
+
callTool(input: {
|
|
1884
|
+
arguments?: Record<string, unknown>;
|
|
1885
|
+
name: string;
|
|
1886
|
+
toolCallId?: string;
|
|
1887
|
+
}): Promise<PluginMcpToolResult>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Activate the provider before wrapper-owned state changes.
|
|
1890
|
+
*
|
|
1891
|
+
* Ordinary wrappers can call `callTool` directly. Durable mutation wrappers
|
|
1892
|
+
* may prepare first so an initial authorization pause happens before they
|
|
1893
|
+
* record pending work.
|
|
1894
|
+
*/
|
|
1895
|
+
prepare(): Promise<"authorization_pending" | "ready">;
|
|
1908
1896
|
}
|
|
1909
1897
|
/** Complete Workspace repository preparation after credential egress is removed. */
|
|
1910
|
-
type WorkspaceFinalize = () => Promise<void> | void;
|
|
1898
|
+
export type WorkspaceFinalize = () => Promise<void> | void;
|
|
1911
1899
|
/**
|
|
1912
1900
|
* Provider-owned, repeatable repository preparation for a Workspace Sandbox.
|
|
1913
1901
|
* Implementations should refresh complete checkouts and replace missing or
|
|
1914
1902
|
* partial ones.
|
|
1915
1903
|
*/
|
|
1916
|
-
interface WorkspacePrepareHookContext extends PluginContext {
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
interface SandboxPrepareHookContext extends PluginContext {
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1927
|
-
interface BeforeToolExecuteHookContext extends PluginContext {
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1904
|
+
export interface WorkspacePrepareHookContext extends PluginContext {
|
|
1905
|
+
repos: Array<{
|
|
1906
|
+
path: string;
|
|
1907
|
+
repo: string;
|
|
1908
|
+
}>;
|
|
1909
|
+
sandbox: PluginSandbox;
|
|
1910
|
+
}
|
|
1911
|
+
export interface SandboxPrepareHookContext extends PluginContext {
|
|
1912
|
+
actor?: Actor;
|
|
1913
|
+
sandbox: PluginSandbox;
|
|
1914
|
+
}
|
|
1915
|
+
export interface BeforeToolExecuteHookContext extends PluginContext {
|
|
1916
|
+
decision: PluginDecision;
|
|
1917
|
+
env: PluginEnv;
|
|
1918
|
+
actor?: Actor;
|
|
1919
|
+
/** All actors who contributed instructions to the run so far; see `multi-actor-runs.md`. */
|
|
1920
|
+
actors?: Actor[];
|
|
1921
|
+
tool: {
|
|
1922
|
+
input: Record<string, unknown>;
|
|
1923
|
+
name: string;
|
|
1924
|
+
};
|
|
1925
|
+
/**
|
|
1926
|
+
* Resolve the current actor's stored identity and linked user.
|
|
1927
|
+
* Same contract as tool registration; used for commit attribution.
|
|
1928
|
+
*/
|
|
1929
|
+
users: {
|
|
1930
|
+
resolveActor(): Promise<{
|
|
1931
|
+
identity: Identity;
|
|
1932
|
+
user?: User;
|
|
1933
|
+
} | undefined>;
|
|
1934
|
+
};
|
|
1947
1935
|
}
|
|
1948
1936
|
/**
|
|
1949
1937
|
* Context for post-success MCP tool processing.
|
|
@@ -1952,111 +1940,111 @@ interface BeforeToolExecuteHookContext extends PluginContext {
|
|
|
1952
1940
|
* junior-owned side effects such as conversation annotations without replacing
|
|
1953
1941
|
* the provider tool contract.
|
|
1954
1942
|
*/
|
|
1955
|
-
interface AfterMcpToolHookContext extends PluginContext {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
}
|
|
1973
|
-
interface PluginToolExecuteOptions {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
}
|
|
1984
|
-
declare const pluginToolContinuationSchema: z.ZodObject<{
|
|
1985
|
-
|
|
1986
|
-
|
|
1943
|
+
export interface AfterMcpToolHookContext extends PluginContext {
|
|
1944
|
+
/**
|
|
1945
|
+
* Opaque Junior conversation/session identity for this turn.
|
|
1946
|
+
* Interactive Slack turns use `slack:{channelId}:{threadTs}`.
|
|
1947
|
+
*/
|
|
1948
|
+
conversationId?: string;
|
|
1949
|
+
annotations?: PluginAnnotations;
|
|
1950
|
+
result: {
|
|
1951
|
+
/** Provider content before model-facing truncation. */
|
|
1952
|
+
content?: PluginMcpContent[];
|
|
1953
|
+
structuredContent?: unknown;
|
|
1954
|
+
};
|
|
1955
|
+
tool: {
|
|
1956
|
+
arguments: Record<string, unknown>;
|
|
1957
|
+
/** Provider-local MCP tool name, for example `save_issue`. */
|
|
1958
|
+
name: string;
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
export interface PluginToolExecuteOptions {
|
|
1962
|
+
/**
|
|
1963
|
+
* @deprecated Internal compatibility escape hatch for legacy tool bridges.
|
|
1964
|
+
* Plugin tools should use typed input fields and runtime hook context instead.
|
|
1965
|
+
*/
|
|
1966
|
+
experimental_context?: unknown;
|
|
1967
|
+
/** Abort when the owning agent tool call is cancelled or times out. */
|
|
1968
|
+
signal?: AbortSignal;
|
|
1969
|
+
/** Stable runtime tool-call id; durable create tools should derive idempotency keys from it. */
|
|
1970
|
+
toolCallId?: string;
|
|
1971
|
+
}
|
|
1972
|
+
export declare const pluginToolContinuationSchema: z.ZodObject<{
|
|
1973
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1974
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1987
1975
|
}, z.core.$strict>;
|
|
1988
1976
|
/** Shared optional fields for canonical plugin tool outputs. */
|
|
1989
|
-
declare const pluginToolOutputSchema: z.ZodObject<{
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
1977
|
+
export declare const pluginToolOutputSchema: z.ZodObject<{
|
|
1978
|
+
objectAnnotations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1979
|
+
kind: z.ZodLiteral<"object">;
|
|
1980
|
+
key: z.ZodString;
|
|
1981
|
+
label: z.ZodString;
|
|
1982
|
+
objectType: z.ZodEnum<{
|
|
1983
|
+
automation: "automation";
|
|
1984
|
+
calendar_event: "calendar_event";
|
|
1985
|
+
code_change: "code_change";
|
|
1986
|
+
deployment: "deployment";
|
|
1987
|
+
item: "item";
|
|
1988
|
+
task: "task";
|
|
1989
|
+
}>;
|
|
1990
|
+
title: z.ZodString;
|
|
1991
|
+
url: z.ZodNullable<z.ZodURL>;
|
|
1992
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1993
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1994
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
1995
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
1996
|
+
displayType: z.ZodOptional<z.ZodString>;
|
|
1997
|
+
sourceUpdatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1998
|
+
facts: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1999
|
+
type: z.ZodLiteral<"code_change">;
|
|
2000
|
+
author: z.ZodOptional<z.ZodString>;
|
|
2001
|
+
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
2002
|
+
targetBranch: z.ZodOptional<z.ZodString>;
|
|
2003
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2004
|
+
review: z.ZodOptional<z.ZodEnum<{
|
|
2005
|
+
approved: "approved";
|
|
2006
|
+
changes_requested: "changes_requested";
|
|
2007
|
+
required: "required";
|
|
2008
|
+
}>>;
|
|
2009
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
2010
|
+
passed: z.ZodNumber;
|
|
2011
|
+
failed: z.ZodNumber;
|
|
2012
|
+
pending: z.ZodNumber;
|
|
2013
|
+
}, z.core.$strict>>;
|
|
2014
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
2015
|
+
changedFiles: z.ZodOptional<z.ZodNumber>;
|
|
2016
|
+
additions: z.ZodOptional<z.ZodNumber>;
|
|
2017
|
+
deletions: z.ZodOptional<z.ZodNumber>;
|
|
2018
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2019
|
+
type: z.ZodLiteral<"task">;
|
|
2020
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2021
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
2022
|
+
project: z.ZodOptional<z.ZodString>;
|
|
2023
|
+
cycle: z.ZodOptional<z.ZodString>;
|
|
2024
|
+
dueDate: z.ZodOptional<z.ZodISODate>;
|
|
2025
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2026
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2027
|
+
type: z.ZodLiteral<"deployment">;
|
|
2028
|
+
project: z.ZodOptional<z.ZodString>;
|
|
2029
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
2030
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
2031
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
2032
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2033
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
2034
|
+
when: z.ZodOptional<z.ZodString>;
|
|
2035
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2036
|
+
}, z.core.$strict>], "type">>;
|
|
2037
|
+
}, z.core.$strict>>>;
|
|
2038
|
+
target: z.ZodOptional<z.ZodString>;
|
|
2039
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
2040
|
+
continuation: z.ZodOptional<z.ZodObject<{
|
|
2041
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2042
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2043
|
+
}, z.core.$strict>>;
|
|
2056
2044
|
}, z.core.$loose>;
|
|
2057
|
-
type PluginToolOutput = z.output<typeof pluginToolOutputSchema>;
|
|
2058
|
-
type PluginToolExecute<TInput = unknown, TOutput = unknown> = {
|
|
2059
|
-
|
|
2045
|
+
export type PluginToolOutput = z.output<typeof pluginToolOutputSchema>;
|
|
2046
|
+
export type PluginToolExecute<TInput = unknown, TOutput = unknown> = {
|
|
2047
|
+
bivarianceHack(input: TInput, options: PluginToolExecuteOptions): Promise<TOutput> | TOutput;
|
|
2060
2048
|
}["bivarianceHack"];
|
|
2061
2049
|
/**
|
|
2062
2050
|
* Tool-declared approval mode.
|
|
@@ -2067,12 +2055,12 @@ type PluginToolExecute<TInput = unknown, TOutput = unknown> = {
|
|
|
2067
2055
|
*
|
|
2068
2056
|
* Core resolves the effective mode immediately before execution.
|
|
2069
2057
|
*/
|
|
2070
|
-
declare const toolApprovalModeSchema: z.ZodEnum<{
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2058
|
+
export declare const toolApprovalModeSchema: z.ZodEnum<{
|
|
2059
|
+
approve: "approve";
|
|
2060
|
+
auto: "auto";
|
|
2061
|
+
review: "review";
|
|
2074
2062
|
}>;
|
|
2075
|
-
type ToolApprovalMode = z.output<typeof toolApprovalModeSchema>;
|
|
2063
|
+
export type ToolApprovalMode = z.output<typeof toolApprovalModeSchema>;
|
|
2076
2064
|
/**
|
|
2077
2065
|
* Reviewer signals describing a tool's side-effect behavior.
|
|
2078
2066
|
*
|
|
@@ -2080,474 +2068,485 @@ type ToolApprovalMode = z.output<typeof toolApprovalModeSchema>;
|
|
|
2080
2068
|
* them as signals, but they never grant authority or override deterministic
|
|
2081
2069
|
* authorization.
|
|
2082
2070
|
*/
|
|
2083
|
-
interface ToolAnnotations {
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
}
|
|
2091
|
-
declare const REQUIRED_TOOL_ANNOTATION_KEYS: readonly ["destructiveHint", "idempotentHint", "openWorldHint", "readOnlyHint"];
|
|
2092
|
-
type RequiredToolAnnotationKey = (typeof REQUIRED_TOOL_ANNOTATION_KEYS)[number];
|
|
2071
|
+
export interface ToolAnnotations {
|
|
2072
|
+
[key: string]: unknown;
|
|
2073
|
+
destructiveHint?: boolean;
|
|
2074
|
+
idempotentHint?: boolean;
|
|
2075
|
+
openWorldHint?: boolean;
|
|
2076
|
+
readOnlyHint?: boolean;
|
|
2077
|
+
title?: string;
|
|
2078
|
+
}
|
|
2079
|
+
export declare const REQUIRED_TOOL_ANNOTATION_KEYS: readonly ["destructiveHint", "idempotentHint", "openWorldHint", "readOnlyHint"];
|
|
2080
|
+
export type RequiredToolAnnotationKey = (typeof REQUIRED_TOOL_ANNOTATION_KEYS)[number];
|
|
2093
2081
|
/** Return behavioral annotation keys that a tool did not declare. */
|
|
2094
|
-
declare function missingToolAnnotationKeys(annotations: ToolAnnotations | undefined): RequiredToolAnnotationKey[];
|
|
2082
|
+
export declare function missingToolAnnotationKeys(annotations: ToolAnnotations | undefined): RequiredToolAnnotationKey[];
|
|
2095
2083
|
/**
|
|
2096
2084
|
* Canonical approval metadata declared by core and plugin tools.
|
|
2097
2085
|
*/
|
|
2098
|
-
interface ToolApprovalMetadata<TInput = unknown> {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2086
|
+
export interface ToolApprovalMetadata<TInput = unknown> {
|
|
2087
|
+
/** Optional declared approval mode; the owning tool boundary selects defaults. */
|
|
2088
|
+
approvalMode?: ToolApprovalMode;
|
|
2089
|
+
annotations?: ToolAnnotations;
|
|
2090
|
+
/**
|
|
2091
|
+
* Describe the reviewed semantic action for the review request.
|
|
2092
|
+
*
|
|
2093
|
+
* Core owns authoritative tool, actor, source, destination, conversation,
|
|
2094
|
+
* credential, and input data. This description adds domain-specific context
|
|
2095
|
+
* only and is never an authorization grant.
|
|
2096
|
+
*/
|
|
2097
|
+
describeProposal?(input: TInput): string;
|
|
2110
2098
|
}
|
|
2111
2099
|
/** Control whether a tool is visible to the model and available in the tool catalog. */
|
|
2112
|
-
type ToolExposure = "direct" | "deferred" | "modelOnly" | "hidden";
|
|
2113
|
-
interface PluginToolDefinition<TInput = unknown, TOutput = unknown, TExecuteOutput = TOutput> extends ToolApprovalMetadata<TInput> {
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2100
|
+
export type ToolExposure = "direct" | "deferred" | "modelOnly" | "hidden";
|
|
2101
|
+
export interface PluginToolDefinition<TInput = unknown, TOutput = unknown, TExecuteOutput = TOutput> extends ToolApprovalMetadata<TInput> {
|
|
2102
|
+
description: string;
|
|
2103
|
+
executionMode?: unknown;
|
|
2104
|
+
/** Override the host's default tool exposure. */
|
|
2105
|
+
exposure?: ToolExposure;
|
|
2106
|
+
inputSchema: unknown;
|
|
2107
|
+
outputSchema?: unknown;
|
|
2108
|
+
/**
|
|
2109
|
+
* Select result fields that are safe to retain in private traces.
|
|
2110
|
+
* Returning `undefined` suppresses private result capture.
|
|
2111
|
+
*/
|
|
2112
|
+
privateTraceResult?(result: TOutput): unknown;
|
|
2113
|
+
prepareArguments?: (args: unknown) => TInput;
|
|
2114
|
+
/**
|
|
2115
|
+
* @deprecated Put tool-selection and usage guidance directly in `description`
|
|
2116
|
+
* and parameter descriptions. Retained for compatibility; may be removed in a
|
|
2117
|
+
* future major version.
|
|
2118
|
+
*/
|
|
2119
|
+
promptGuidelines?: string[];
|
|
2120
|
+
/**
|
|
2121
|
+
* @deprecated Put tool-selection and usage guidance directly in `description`
|
|
2122
|
+
* and parameter descriptions. Retained for compatibility; may be removed in a
|
|
2123
|
+
* future major version.
|
|
2124
|
+
*/
|
|
2125
|
+
promptSnippet?: string;
|
|
2126
|
+
execute?: PluginToolExecute<TInput, TExecuteOutput>;
|
|
2139
2127
|
}
|
|
2140
2128
|
type ZodPluginToolDefinition<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends z.input<TOutputSchema> | PluginToolOutputEnvelope<z.input<TOutputSchema>>> = Omit<PluginToolDefinition<z.output<TInputSchema>, z.output<TOutputSchema>>, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2129
|
+
inputSchema: TInputSchema;
|
|
2130
|
+
outputSchema: TOutputSchema;
|
|
2131
|
+
prepareArguments?: (args: unknown) => z.input<TInputSchema>;
|
|
2132
|
+
execute?: (input: z.output<TInputSchema>, options: PluginToolExecuteOptions) => Promise<TExecuteResult> | TExecuteResult;
|
|
2145
2133
|
};
|
|
2146
2134
|
type ParsedPluginToolExecuteResult<TOutputSchema extends ZodTypeAny, TResult> = TResult extends PluginToolOutputEnvelope<unknown> ? PluginToolOutputEnvelope<z.output<TOutputSchema>> : z.output<TOutputSchema>;
|
|
2147
2135
|
/** Define a plugin tool with Zod input parsing and validated structured results. */
|
|
2148
|
-
declare function zodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends z.input<TOutputSchema> | PluginToolOutputEnvelope<z.input<TOutputSchema>>>(definition: ZodPluginToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): PluginToolDefinition<z.output<TInputSchema>, z.output<TOutputSchema>, ParsedPluginToolExecuteResult<TOutputSchema, TExecuteResult>>;
|
|
2136
|
+
export declare function zodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends z.input<TOutputSchema> | PluginToolOutputEnvelope<z.input<TOutputSchema>>>(definition: ZodPluginToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): PluginToolDefinition<z.output<TInputSchema>, z.output<TOutputSchema>, ParsedPluginToolExecuteResult<TOutputSchema, TExecuteResult>>;
|
|
2149
2137
|
/** Define a plugin tool with Zod input parsing and the structured result contract. */
|
|
2150
|
-
declare function definePluginTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends z.input<TOutputSchema> | PluginToolOutputEnvelope<z.input<TOutputSchema>>>(definition: ZodPluginToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): PluginToolDefinition<z.output<TInputSchema>, z.output<TOutputSchema>, ParsedPluginToolExecuteResult<TOutputSchema, TExecuteResult>>;
|
|
2151
|
-
interface SlackToolRegistrationHookContext {
|
|
2138
|
+
export declare function definePluginTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends z.input<TOutputSchema> | PluginToolOutputEnvelope<z.input<TOutputSchema>>>(definition: ZodPluginToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): PluginToolDefinition<z.output<TInputSchema>, z.output<TOutputSchema>, ParsedPluginToolExecuteResult<TOutputSchema, TExecuteResult>>;
|
|
2139
|
+
export interface SlackToolRegistrationHookContext {
|
|
2140
|
+
/**
|
|
2141
|
+
* What Slack tools can do in the Conversation Location.
|
|
2142
|
+
* Computed from Location, not from Source or Destination.
|
|
2143
|
+
*/
|
|
2144
|
+
channelCapabilities: {
|
|
2145
|
+
canAddReactions: boolean;
|
|
2146
|
+
canCreateCanvas: boolean;
|
|
2147
|
+
canPostToChannel: boolean;
|
|
2148
|
+
};
|
|
2149
|
+
/** Host-owned link to this conversation, preferring the dashboard when enabled. */
|
|
2150
|
+
conversationLink?: SlackConversationLink;
|
|
2151
|
+
credentialSubject?: Extract<PluginCredentialSubject, {
|
|
2152
|
+
allowedWhen: "private-direct-conversation";
|
|
2153
|
+
}>;
|
|
2154
|
+
}
|
|
2155
|
+
export interface PluginEventToolContext {
|
|
2156
|
+
/** Whether this invocation can create a working watch. */
|
|
2157
|
+
canSubscribe: boolean;
|
|
2158
|
+
/** Create a temporary watch for the current conversation. */
|
|
2159
|
+
subscribe(input: {
|
|
2160
|
+
events: string[];
|
|
2161
|
+
intent: string;
|
|
2162
|
+
resource: SubscribableResource;
|
|
2152
2163
|
/**
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2164
|
+
* Guidance for this Watch only, by event type. Core adds it after the
|
|
2165
|
+
* resource type guidance when a matching Event arrives.
|
|
2155
2166
|
*/
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
canCreateCanvas: boolean;
|
|
2159
|
-
canPostToChannel: boolean;
|
|
2160
|
-
};
|
|
2161
|
-
/** Host-owned link to this conversation, preferring the dashboard when enabled. */
|
|
2162
|
-
conversationLink?: SlackConversationLink;
|
|
2163
|
-
credentialSubject?: Extract<PluginCredentialSubject, {
|
|
2164
|
-
allowedWhen: "private-direct-conversation";
|
|
2165
|
-
}>;
|
|
2167
|
+
guidance?: Partial<Record<string, string>>;
|
|
2168
|
+
}): Promise<WatchResult>;
|
|
2166
2169
|
}
|
|
2167
|
-
interface
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
intent: string;
|
|
2174
|
-
resource: SubscribableResource;
|
|
2175
|
-
/**
|
|
2176
|
-
* Guidance for this Watch only, by event type. Core adds it after the
|
|
2177
|
-
* resource type guidance when a matching Event arrives.
|
|
2178
|
-
*/
|
|
2179
|
-
guidance?: Partial<Record<string, string>>;
|
|
2180
|
-
}): Promise<WatchResult>;
|
|
2181
|
-
}
|
|
2182
|
-
interface PluginWorkspaceToolContext {
|
|
2183
|
-
/** Find named Workspaces that include one provider repository. */
|
|
2184
|
-
findByRepository(input: {
|
|
2185
|
-
provider: string;
|
|
2186
|
-
repo: string;
|
|
2187
|
-
}): Promise<string[]>;
|
|
2170
|
+
export interface PluginWorkspaceToolContext {
|
|
2171
|
+
/** Find named Workspaces that include one provider repository. */
|
|
2172
|
+
findByRepository(input: {
|
|
2173
|
+
provider: string;
|
|
2174
|
+
repo: string;
|
|
2175
|
+
}): Promise<string[]>;
|
|
2188
2176
|
}
|
|
2189
2177
|
interface BaseToolRegistrationHookContext extends PluginContext {
|
|
2178
|
+
/**
|
|
2179
|
+
* Opaque Junior conversation/session identity for this turn.
|
|
2180
|
+
* Interactive Slack turns use `slack:{channelId}:{threadTs}`.
|
|
2181
|
+
* Scheduled/web turns use an internal id such as `agent-dispatch:{id}`.
|
|
2182
|
+
* Do not parse as Slack unless the value starts with `slack:`.
|
|
2183
|
+
*/
|
|
2184
|
+
conversationId?: string;
|
|
2185
|
+
annotations?: PluginAnnotations;
|
|
2186
|
+
/** Host-owned dashboard link to the Automation that started this run. */
|
|
2187
|
+
automationLink?: {
|
|
2188
|
+
url: string;
|
|
2189
|
+
};
|
|
2190
|
+
embedder: PluginEmbedder;
|
|
2191
|
+
egress: PluginEgress;
|
|
2192
|
+
mcp?: PluginMcp;
|
|
2193
|
+
model: PluginModel;
|
|
2194
|
+
events: PluginEventToolContext;
|
|
2195
|
+
/** Sandbox filesystem and command capability for plugin-owned workspace tools. */
|
|
2196
|
+
sandbox: PluginSandbox;
|
|
2197
|
+
state: PluginState;
|
|
2198
|
+
users: {
|
|
2199
|
+
/** Resolve the current actor's stored identity and linked user. */
|
|
2200
|
+
resolveActor(): Promise<{
|
|
2201
|
+
identity: Identity;
|
|
2202
|
+
user?: User;
|
|
2203
|
+
} | undefined>;
|
|
2190
2204
|
/**
|
|
2191
|
-
*
|
|
2192
|
-
*
|
|
2193
|
-
* Scheduled/web turns use an internal id such as `agent-dispatch:{id}`.
|
|
2194
|
-
* Do not parse as Slack unless the value starts with `slack:`.
|
|
2205
|
+
* Resolve the current actor's IANA timezone. Uses their profile when
|
|
2206
|
+
* Junior knows it, else the install default. Always returns a timezone.
|
|
2195
2207
|
*/
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
sandbox: PluginSandbox;
|
|
2205
|
-
state: PluginState;
|
|
2206
|
-
users: {
|
|
2207
|
-
/** Resolve the current actor's stored identity and linked user. */
|
|
2208
|
-
resolveActor(): Promise<{
|
|
2209
|
-
identity: Identity;
|
|
2210
|
-
user?: User;
|
|
2211
|
-
} | undefined>;
|
|
2212
|
-
/**
|
|
2213
|
-
* Resolve the current actor's IANA timezone. Uses their profile when
|
|
2214
|
-
* Junior knows it, else the install default. Always returns a timezone.
|
|
2215
|
-
*/
|
|
2216
|
-
resolveTimezone(): Promise<string>;
|
|
2217
|
-
};
|
|
2218
|
-
userText?: string;
|
|
2219
|
-
workspaces: PluginWorkspaceToolContext;
|
|
2220
|
-
}
|
|
2221
|
-
type ToolRegistrationHookContext = BaseToolRegistrationHookContext & InvocationContext & {
|
|
2222
|
-
/** Slack tool details when the Conversation has a Slack Location. */
|
|
2223
|
-
slack?: SlackToolRegistrationHookContext;
|
|
2208
|
+
resolveTimezone(): Promise<string>;
|
|
2209
|
+
};
|
|
2210
|
+
userText?: string;
|
|
2211
|
+
workspaces: PluginWorkspaceToolContext;
|
|
2212
|
+
}
|
|
2213
|
+
export type ToolRegistrationHookContext = BaseToolRegistrationHookContext & InvocationContext & {
|
|
2214
|
+
/** Slack tool details when the Conversation has a Slack Location. */
|
|
2215
|
+
slack?: SlackToolRegistrationHookContext;
|
|
2224
2216
|
};
|
|
2225
|
-
|
|
2226
2217
|
/**
|
|
2227
2218
|
* Deny provider egress when a plugin policy does not allow the request.
|
|
2228
2219
|
*
|
|
2229
2220
|
* Call from a plugin `grantForEgress` hook before returning a write grant.
|
|
2230
2221
|
*/
|
|
2231
|
-
declare function enforceEgressPolicy(input: {
|
|
2232
|
-
|
|
2233
|
-
|
|
2222
|
+
export declare function enforceEgressPolicy(input: {
|
|
2223
|
+
allowed: boolean;
|
|
2224
|
+
denialMessage: string;
|
|
2234
2225
|
}): void;
|
|
2235
|
-
|
|
2236
2226
|
/** Input for a pure Markdown rewrite before destination delivery formatting. */
|
|
2237
|
-
interface FormatMarkdownHookContext {
|
|
2238
|
-
|
|
2239
|
-
}
|
|
2240
|
-
interface PluginHooks {
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
interface PluginCliIo {
|
|
2292
|
-
writeError(text: string): Promise<void> | void;
|
|
2293
|
-
writeOutput(text: string): Promise<void> | void;
|
|
2294
|
-
}
|
|
2295
|
-
interface PluginCliActionCommand {
|
|
2296
|
-
name: string;
|
|
2297
|
-
summary: string;
|
|
2227
|
+
export interface FormatMarkdownHookContext {
|
|
2228
|
+
text: string;
|
|
2229
|
+
}
|
|
2230
|
+
export interface PluginHooks {
|
|
2231
|
+
conversationSidebar?(ctx: ConversationSidebarHookContext): Promise<ConversationSidebarResult> | ConversationSidebarResult;
|
|
2232
|
+
systemPrompt?(ctx: SystemPromptContext): Promise<PromptMessage[]> | PromptMessage[];
|
|
2233
|
+
userPrompt?(ctx: UserPromptContext): Promise<UserPromptContribution[] | undefined> | UserPromptContribution[] | undefined;
|
|
2234
|
+
beforeToolExecute?(ctx: BeforeToolExecuteHookContext): Promise<void> | void;
|
|
2235
|
+
/**
|
|
2236
|
+
* Run after a successful hosted MCP tool call.
|
|
2237
|
+
*
|
|
2238
|
+
* Prefer this for junior-owned side effects such as conversation annotations.
|
|
2239
|
+
* Do not use it to invent a parallel tool contract for the provider tool.
|
|
2240
|
+
*/
|
|
2241
|
+
afterMcpTool?(ctx: AfterMcpToolHookContext): Promise<{
|
|
2242
|
+
objectAnnotations: ObjectAnnotation[];
|
|
2243
|
+
} | void> | {
|
|
2244
|
+
objectAnnotations: ObjectAnnotation[];
|
|
2245
|
+
} | void;
|
|
2246
|
+
/**
|
|
2247
|
+
* Select the grant for one sandbox egress request.
|
|
2248
|
+
*
|
|
2249
|
+
* When the manifest also declares generic `credentials` or `apiHeaders`,
|
|
2250
|
+
* return undefined to use those credentials for this request.
|
|
2251
|
+
*/
|
|
2252
|
+
grantForEgress?(ctx: EgressHookContext): Promise<PluginGrant | undefined> | PluginGrant | undefined;
|
|
2253
|
+
heartbeat?(ctx: HeartbeatHookContext): Promise<HeartbeatResult | void> | HeartbeatResult | void;
|
|
2254
|
+
unfinishedWork?(ctx: UnfinishedWorkHookContext): Promise<UnfinishedWorkResult> | UnfinishedWorkResult;
|
|
2255
|
+
issueCredential?(ctx: IssueCredentialHookContext): Promise<PluginCredentialResult> | PluginCredentialResult;
|
|
2256
|
+
onEgressResponse?(ctx: EgressResponseHookContext): Promise<void> | void;
|
|
2257
|
+
operationalReport?(ctx: OperationalReportHookContext): Promise<PluginOperationalReportContent | undefined> | PluginOperationalReportContent | undefined;
|
|
2258
|
+
/**
|
|
2259
|
+
* Return one person-scoped operational report for a profile page.
|
|
2260
|
+
* Omit or return undefined when the plugin has nothing to show for the subject.
|
|
2261
|
+
*/
|
|
2262
|
+
profileReport?(ctx: ProfileReportHookContext): Promise<PluginOperationalReportContent | undefined> | PluginOperationalReportContent | undefined;
|
|
2263
|
+
/** Return plugin-owned product API routes mounted under Junior's authenticated plugin namespace. */
|
|
2264
|
+
apiRoutes?(ctx: ApiRouteRegistrationHookContext): PluginRouteApp | undefined;
|
|
2265
|
+
resolveOAuthAccount?(ctx: ResolveOAuthAccountHookContext): Promise<PluginProviderAccount | undefined> | PluginProviderAccount | undefined;
|
|
2266
|
+
routes?(ctx: RouteRegistrationHookContext): PluginRoute[];
|
|
2267
|
+
sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
|
|
2268
|
+
workspacePrepare?(ctx: WorkspacePrepareHookContext): Promise<WorkspaceFinalize | void> | WorkspaceFinalize | void;
|
|
2269
|
+
slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
|
|
2270
|
+
/** Pure Markdown rewrite. Emit ordinary Markdown only. */
|
|
2271
|
+
formatMarkdown?(ctx: FormatMarkdownHookContext): string;
|
|
2272
|
+
tools?(ctx: ToolRegistrationHookContext): Record<string, PluginToolDefinition>;
|
|
2273
|
+
}
|
|
2274
|
+
export interface PluginCliIo {
|
|
2275
|
+
writeError(text: string): Promise<void> | void;
|
|
2276
|
+
writeOutput(text: string): Promise<void> | void;
|
|
2277
|
+
}
|
|
2278
|
+
export interface PluginCliActionCommand {
|
|
2279
|
+
name: string;
|
|
2280
|
+
summary: string;
|
|
2298
2281
|
}
|
|
2299
2282
|
/** Host/admin context exposed to plugin-owned CLI command actions. */
|
|
2300
|
-
interface PluginCliActionContext extends Pick<PluginContext, "db" | "log" | "plugin"> {
|
|
2301
|
-
|
|
2302
|
-
|
|
2283
|
+
export interface PluginCliActionContext extends Pick<PluginContext, "db" | "log" | "plugin"> {
|
|
2284
|
+
command: PluginCliActionCommand;
|
|
2285
|
+
io: PluginCliIo;
|
|
2303
2286
|
}
|
|
2304
2287
|
/** Plugin action callback wrapped by the Junior host for context and exit codes. */
|
|
2305
|
-
type PluginCliActionHandler<Args extends unknown[] = unknown[]> = (ctx: PluginCliActionContext, ...args: Args) => Promise<number | void> | number | void;
|
|
2306
|
-
interface PluginCliHost {
|
|
2307
|
-
|
|
2308
|
-
|
|
2288
|
+
export type PluginCliActionHandler<Args extends unknown[] = unknown[]> = (ctx: PluginCliActionContext, ...args: Args) => Promise<number | void> | number | void;
|
|
2289
|
+
export interface PluginCliHost {
|
|
2290
|
+
/** Wrap a Commander action so Junior can inject context and normalize exits. */
|
|
2291
|
+
action<Args extends unknown[]>(handler: PluginCliActionHandler<Args>): (...args: Args) => Promise<void>;
|
|
2309
2292
|
}
|
|
2310
2293
|
/** Plugin-owned top-level CLI command registration. */
|
|
2311
|
-
interface PluginCliCommandDefinition {
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2294
|
+
export interface PluginCliCommandDefinition {
|
|
2295
|
+
/** Configure subcommands under the host-created top-level namespace. */
|
|
2296
|
+
configure(command: Command, junior: PluginCliHost): void;
|
|
2297
|
+
/** Unique host-level command namespace owned by this plugin. */
|
|
2298
|
+
name: string;
|
|
2299
|
+
/** One-line summary used in generated command help. */
|
|
2300
|
+
summary: string;
|
|
2318
2301
|
}
|
|
2319
2302
|
/** Plugin-owned CLI command catalog. */
|
|
2320
|
-
interface PluginCliDefinition {
|
|
2321
|
-
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
sudo?: boolean;
|
|
2303
|
+
export interface PluginCliDefinition {
|
|
2304
|
+
commands: PluginCliCommandDefinition[];
|
|
2305
|
+
}
|
|
2306
|
+
export interface PluginOAuthConfig {
|
|
2307
|
+
authorizeEndpoint: string;
|
|
2308
|
+
authorizeParams?: Record<string, string>;
|
|
2309
|
+
clientIdEnv: string;
|
|
2310
|
+
clientSecretEnv: string;
|
|
2311
|
+
scope?: string;
|
|
2312
|
+
/**
|
|
2313
|
+
* Treat a provider token response with `scope: ""` like an omitted scope and
|
|
2314
|
+
* fall back to the requested scope string when storing the token.
|
|
2315
|
+
*/
|
|
2316
|
+
treatEmptyScopeAsUnreported?: boolean;
|
|
2317
|
+
tokenAuthMethod?: "body" | "basic";
|
|
2318
|
+
tokenEndpoint: string;
|
|
2319
|
+
tokenExtraHeaders?: Record<string, string>;
|
|
2320
|
+
}
|
|
2321
|
+
export interface PluginOAuthBearerCredentials {
|
|
2322
|
+
apiHeaders?: Record<string, string>;
|
|
2323
|
+
authTokenEnv: string;
|
|
2324
|
+
authTokenPlaceholder?: string;
|
|
2325
|
+
domains: string[];
|
|
2326
|
+
type: "oauth-bearer";
|
|
2327
|
+
}
|
|
2328
|
+
export type PluginCredentials = PluginOAuthBearerCredentials;
|
|
2329
|
+
export interface PluginNpmRuntimeDependency {
|
|
2330
|
+
package: string;
|
|
2331
|
+
type: "npm";
|
|
2332
|
+
version: string;
|
|
2333
|
+
}
|
|
2334
|
+
export interface PluginSystemRuntimeDependency {
|
|
2335
|
+
package: string;
|
|
2336
|
+
type: "system";
|
|
2337
|
+
}
|
|
2338
|
+
export interface PluginSystemRuntimeDependencyFromUrl {
|
|
2339
|
+
sha256: string;
|
|
2340
|
+
type: "system";
|
|
2341
|
+
url: string;
|
|
2342
|
+
}
|
|
2343
|
+
export type PluginRuntimeDependency = PluginNpmRuntimeDependency | PluginSystemRuntimeDependency | PluginSystemRuntimeDependencyFromUrl;
|
|
2344
|
+
export interface PluginRuntimePostinstallCommand {
|
|
2345
|
+
args?: string[];
|
|
2346
|
+
cmd: string;
|
|
2347
|
+
sudo?: boolean;
|
|
2366
2348
|
}
|
|
2367
2349
|
/** Bot credentials for the ID-JAG profile of the RFC 7523 `jwt-bearer` grant. */
|
|
2368
|
-
interface PluginMcpAuthConfig {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2350
|
+
export interface PluginMcpAuthConfig {
|
|
2351
|
+
/** Issuer string the MCP server trusts for this bot. */
|
|
2352
|
+
issuer: string;
|
|
2353
|
+
/** JWKS key id of the published public key that pairs with the private key. */
|
|
2354
|
+
keyId: string;
|
|
2355
|
+
/** Env var holding the PEM (PKCS#8) private signing key. */
|
|
2356
|
+
privateKeyEnv: string;
|
|
2375
2357
|
}
|
|
2376
2358
|
/** Pre-registered OAuth client for per-actor MCP OAuth without dynamic client registration. */
|
|
2377
|
-
interface PluginMcpOAuthClientConfig {
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
}
|
|
2387
|
-
interface PluginMcpConfig {
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
}
|
|
2401
|
-
interface PluginEnvVarDeclaration {
|
|
2402
|
-
default?: string;
|
|
2403
|
-
exposeToCommandEnv?: boolean;
|
|
2404
|
-
}
|
|
2405
|
-
interface PluginManifest {
|
|
2406
|
-
apiHeaders?: Record<string, string>;
|
|
2407
|
-
commandEnv?: Record<string, string>;
|
|
2408
|
-
configKeys?: string[];
|
|
2409
|
-
credentials?: PluginCredentials;
|
|
2410
|
-
description: string;
|
|
2411
|
-
displayName: string;
|
|
2412
|
-
domains?: string[];
|
|
2413
|
-
envVars?: Record<string, PluginEnvVarDeclaration>;
|
|
2414
|
-
mcp?: PluginMcpConfig;
|
|
2415
|
-
name: string;
|
|
2416
|
-
oauth?: PluginOAuthConfig;
|
|
2417
|
-
runtimeDependencies?: PluginRuntimeDependency[];
|
|
2418
|
-
runtimePostinstall?: PluginRuntimePostinstallCommand[];
|
|
2419
|
-
target?: {
|
|
2420
|
-
commandFlags?: string[];
|
|
2421
|
-
configKey: string;
|
|
2422
|
-
type: string;
|
|
2423
|
-
};
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2359
|
+
export interface PluginMcpOAuthClientConfig {
|
|
2360
|
+
/** Extra authorization request parameters, such as `access_type: offline`. */
|
|
2361
|
+
authorizeParams?: Record<string, string>;
|
|
2362
|
+
/** Env var holding the OAuth client id. */
|
|
2363
|
+
clientIdEnv: string;
|
|
2364
|
+
/** Env var holding the OAuth client secret. */
|
|
2365
|
+
clientSecretEnv: string;
|
|
2366
|
+
/** Space-delimited scope requested instead of the scopes the MCP server advertises. */
|
|
2367
|
+
scope?: string;
|
|
2368
|
+
}
|
|
2369
|
+
export interface PluginMcpConfig {
|
|
2370
|
+
/** Provider tools exposed directly to the model. */
|
|
2371
|
+
allowedTools?: string[];
|
|
2372
|
+
/** Bot auth: sign short-lived JWT assertions instead of per-actor OAuth. */
|
|
2373
|
+
auth?: PluginMcpAuthConfig;
|
|
2374
|
+
/** Request headers. Values may use `${NAME}` refs to declared env vars; Junior resolves them at connect time. */
|
|
2375
|
+
headers?: Record<string, string>;
|
|
2376
|
+
/** Per-actor OAuth with a pre-registered client instead of dynamic client registration. */
|
|
2377
|
+
oauthClient?: PluginMcpOAuthClientConfig;
|
|
2378
|
+
transport: "http";
|
|
2379
|
+
url: string;
|
|
2380
|
+
/** Provider tools hidden from the model and callable only by plugin-owned wrapper tools. */
|
|
2381
|
+
wrappedTools?: string[];
|
|
2382
|
+
}
|
|
2426
2383
|
/**
|
|
2427
|
-
*
|
|
2384
|
+
* Which provider accounts Junior may use for one plugin.
|
|
2385
|
+
*
|
|
2386
|
+
* By default, each Actor connects their own account with per-actor OAuth.
|
|
2387
|
+
* A plugin can also allow an optional install-wide service account, often a
|
|
2388
|
+
* bot. An Admin connects it one time on the dashboard Admin page.
|
|
2389
|
+
*
|
|
2390
|
+
* An Actor's own connection always wins. An Actor without their own
|
|
2391
|
+
* connection uses the service account for what it lists. Other requests ask
|
|
2392
|
+
* the Actor to connect their own account.
|
|
2428
2393
|
*
|
|
2429
|
-
*
|
|
2430
|
-
*
|
|
2394
|
+
* With `userOAuth: false`, Junior uses only the service account. It never
|
|
2395
|
+
* asks an Actor to connect, ignores their own connections, and hides tools
|
|
2396
|
+
* that the service account does not list. Until an Admin connects the
|
|
2397
|
+
* account, the plugin is not available.
|
|
2431
2398
|
*/
|
|
2432
|
-
|
|
2399
|
+
export interface PluginAccountsConfig {
|
|
2400
|
+
/** Set false to turn off per-actor OAuth for the plugin. Defaults to true. */
|
|
2401
|
+
userOAuth?: boolean;
|
|
2402
|
+
/** Optional service account and what it may use. Omit for none. */
|
|
2403
|
+
serviceAccount?: PluginServiceAccountConfig;
|
|
2404
|
+
}
|
|
2405
|
+
/** What one plugin's service account may use. */
|
|
2406
|
+
export interface PluginServiceAccountConfig {
|
|
2407
|
+
/** MCP tools that the account may call. Each must be loaded by `mcp`. */
|
|
2408
|
+
tools: string[];
|
|
2409
|
+
}
|
|
2410
|
+
export interface PluginEnvVarDeclaration {
|
|
2411
|
+
default?: string;
|
|
2412
|
+
exposeToCommandEnv?: boolean;
|
|
2413
|
+
}
|
|
2414
|
+
export interface PluginManifest {
|
|
2415
|
+
accounts?: PluginAccountsConfig;
|
|
2416
|
+
apiHeaders?: Record<string, string>;
|
|
2417
|
+
commandEnv?: Record<string, string>;
|
|
2418
|
+
configKeys?: string[];
|
|
2419
|
+
credentials?: PluginCredentials;
|
|
2420
|
+
description: string;
|
|
2421
|
+
displayName: string;
|
|
2422
|
+
domains?: string[];
|
|
2423
|
+
envVars?: Record<string, PluginEnvVarDeclaration>;
|
|
2424
|
+
mcp?: PluginMcpConfig;
|
|
2425
|
+
name: string;
|
|
2426
|
+
oauth?: PluginOAuthConfig;
|
|
2427
|
+
runtimeDependencies?: PluginRuntimeDependency[];
|
|
2428
|
+
runtimePostinstall?: PluginRuntimePostinstallCommand[];
|
|
2429
|
+
target?: {
|
|
2430
|
+
commandFlags?: string[];
|
|
2431
|
+
configKey: string;
|
|
2432
|
+
type: string;
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2433
2435
|
/** Bounded list content returned by a plugin-owned user page. */
|
|
2434
|
-
declare const pluginUserPageContentSchema: z.ZodObject<{
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2436
|
+
export declare const pluginUserPageContentSchema: z.ZodObject<{
|
|
2437
|
+
emptyText: z.ZodOptional<z.ZodString>;
|
|
2438
|
+
metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2439
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
2440
|
+
label: z.ZodString;
|
|
2441
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
2442
|
+
good: "good";
|
|
2443
|
+
neutral: "neutral";
|
|
2444
|
+
warning: "warning";
|
|
2445
|
+
}>>;
|
|
2446
|
+
value: z.ZodString;
|
|
2447
|
+
}, z.core.$strict>>>;
|
|
2448
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
2449
|
+
records: z.ZodArray<z.ZodObject<{
|
|
2450
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2451
|
+
confirmation: z.ZodOptional<z.ZodString>;
|
|
2452
|
+
href: z.ZodString;
|
|
2453
|
+
label: z.ZodString;
|
|
2454
|
+
method: z.ZodEnum<{
|
|
2455
|
+
DELETE: "DELETE";
|
|
2456
|
+
GET: "GET";
|
|
2457
|
+
}>;
|
|
2458
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
2459
|
+
danger: "danger";
|
|
2460
|
+
neutral: "neutral";
|
|
2461
|
+
}>>;
|
|
2445
2462
|
}, z.core.$strict>>>;
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
tone: z.ZodOptional<z.ZodEnum<{
|
|
2457
|
-
neutral: "neutral";
|
|
2458
|
-
danger: "danger";
|
|
2459
|
-
}>>;
|
|
2460
|
-
}, z.core.$strict>>>;
|
|
2461
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2462
|
-
id: z.ZodString;
|
|
2463
|
-
metadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2464
|
-
label: z.ZodString;
|
|
2465
|
-
value: z.ZodString;
|
|
2466
|
-
}, z.core.$strict>>>;
|
|
2467
|
-
title: z.ZodString;
|
|
2468
|
-
}, z.core.$strict>>;
|
|
2469
|
-
searchPlaceholder: z.ZodOptional<z.ZodString>;
|
|
2470
|
-
type: z.ZodLiteral<"list">;
|
|
2463
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2464
|
+
id: z.ZodString;
|
|
2465
|
+
metadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2466
|
+
label: z.ZodString;
|
|
2467
|
+
value: z.ZodString;
|
|
2468
|
+
}, z.core.$strict>>>;
|
|
2469
|
+
title: z.ZodString;
|
|
2470
|
+
}, z.core.$strict>>;
|
|
2471
|
+
searchPlaceholder: z.ZodOptional<z.ZodString>;
|
|
2472
|
+
type: z.ZodLiteral<"list">;
|
|
2471
2473
|
}, z.core.$strict>;
|
|
2472
2474
|
/** Validated content for the current core-rendered list page type. */
|
|
2473
|
-
type PluginUserPageContent = z.output<typeof pluginUserPageContentSchema>;
|
|
2474
|
-
declare const pluginUserPageLinkSchema: z.ZodObject<{
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2475
|
+
export type PluginUserPageContent = z.output<typeof pluginUserPageContentSchema>;
|
|
2476
|
+
export declare const pluginUserPageLinkSchema: z.ZodObject<{
|
|
2477
|
+
description: z.ZodString;
|
|
2478
|
+
id: z.ZodString;
|
|
2479
|
+
label: z.ZodString;
|
|
2480
|
+
navigation: z.ZodEnum<{
|
|
2481
|
+
admin: "admin";
|
|
2482
|
+
primary: "primary";
|
|
2483
|
+
profile: "profile";
|
|
2484
|
+
}>;
|
|
2485
|
+
pluginDisplayName: z.ZodString;
|
|
2486
|
+
pluginName: z.ZodString;
|
|
2485
2487
|
}, z.core.$strict>;
|
|
2486
|
-
declare const pluginUserPageLinksSchema: z.ZodArray<z.ZodObject<{
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2488
|
+
export declare const pluginUserPageLinksSchema: z.ZodArray<z.ZodObject<{
|
|
2489
|
+
description: z.ZodString;
|
|
2490
|
+
id: z.ZodString;
|
|
2491
|
+
label: z.ZodString;
|
|
2492
|
+
navigation: z.ZodEnum<{
|
|
2493
|
+
admin: "admin";
|
|
2494
|
+
primary: "primary";
|
|
2495
|
+
profile: "profile";
|
|
2496
|
+
}>;
|
|
2497
|
+
pluginDisplayName: z.ZodString;
|
|
2498
|
+
pluginName: z.ZodString;
|
|
2497
2499
|
}, z.core.$strict>>;
|
|
2498
2500
|
/** Safe navigation metadata for one registered plugin user page. */
|
|
2499
|
-
type PluginUserPageLink = z.output<typeof pluginUserPageLinkSchema>;
|
|
2501
|
+
export type PluginUserPageLink = z.output<typeof pluginUserPageLinkSchema>;
|
|
2500
2502
|
/** Optional cursor token for one plugin user page reader. */
|
|
2501
|
-
declare const pluginUserPageCursorSchema: z.ZodOptional<z.ZodString>;
|
|
2503
|
+
export declare const pluginUserPageCursorSchema: z.ZodOptional<z.ZodString>;
|
|
2502
2504
|
/** Optional filter token for one plugin user page reader. */
|
|
2503
|
-
declare const pluginUserPageFilterSchema: z.ZodOptional<z.ZodString>;
|
|
2505
|
+
export declare const pluginUserPageFilterSchema: z.ZodOptional<z.ZodString>;
|
|
2504
2506
|
/** Optional free-text query for one plugin user page reader. */
|
|
2505
|
-
declare const pluginUserPageQuerySchema: z.ZodOptional<z.ZodString>;
|
|
2507
|
+
export declare const pluginUserPageQuerySchema: z.ZodOptional<z.ZodString>;
|
|
2506
2508
|
/** Validated query state passed to one plugin user page reader. */
|
|
2507
|
-
declare const pluginUserPageInputSchema: z.ZodObject<{
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2509
|
+
export declare const pluginUserPageInputSchema: z.ZodObject<{
|
|
2510
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
2511
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
2512
|
+
limit: z.ZodNumber;
|
|
2513
|
+
query: z.ZodOptional<z.ZodString>;
|
|
2512
2514
|
}, z.core.$strict>;
|
|
2513
|
-
type PluginUserPageInput = z.output<typeof pluginUserPageInputSchema>;
|
|
2515
|
+
export type PluginUserPageInput = z.output<typeof pluginUserPageInputSchema>;
|
|
2514
2516
|
/** Trusted host context supplied while reading one plugin user page. */
|
|
2515
|
-
interface PluginUserPageContext extends PluginContext {
|
|
2516
|
-
|
|
2517
|
+
export interface PluginUserPageContext extends PluginContext {
|
|
2518
|
+
viewer: User;
|
|
2517
2519
|
}
|
|
2518
2520
|
/** Navigation metadata and reader for one core-rendered plugin user page. */
|
|
2519
|
-
interface PluginUserPageDefinition {
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
}
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
userPages?: PluginUserPageDefinition[];
|
|
2521
|
+
export interface PluginUserPageDefinition {
|
|
2522
|
+
description: string;
|
|
2523
|
+
id: string;
|
|
2524
|
+
label: string;
|
|
2525
|
+
/**
|
|
2526
|
+
* Dashboard navigation surface where this page is linked. Junior lists and
|
|
2527
|
+
* serves `admin` pages only to Junior admins.
|
|
2528
|
+
*/
|
|
2529
|
+
navigation?: "primary" | "profile" | "admin";
|
|
2530
|
+
read(ctx: PluginUserPageContext, input: PluginUserPageInput): Promise<PluginUserPageContent> | PluginUserPageContent;
|
|
2531
|
+
}
|
|
2532
|
+
export interface PluginModelConfig {
|
|
2533
|
+
/** Host model family used when no explicit structured model id is configured. */
|
|
2534
|
+
structuredModel?: "default" | "fast";
|
|
2535
|
+
/** Host model id used for this plugin's structured model calls. */
|
|
2536
|
+
structuredModelId?: string;
|
|
2537
|
+
}
|
|
2538
|
+
export type PluginRegistrationInput = {
|
|
2539
|
+
cli?: PluginCliDefinition;
|
|
2540
|
+
conversationEvents?: PluginConversationEventDefinition[];
|
|
2541
|
+
hooks?: PluginHooks;
|
|
2542
|
+
manifest: PluginManifest;
|
|
2543
|
+
model?: PluginModelConfig;
|
|
2544
|
+
packageName?: string;
|
|
2545
|
+
events?: PluginEvents;
|
|
2546
|
+
tasks?: PluginTasks;
|
|
2547
|
+
userPages?: PluginUserPageDefinition[];
|
|
2547
2548
|
};
|
|
2548
|
-
interface PluginRegistration extends PluginRegistrationInput {
|
|
2549
|
-
}
|
|
2549
|
+
export interface PluginRegistration extends PluginRegistrationInput {}
|
|
2550
2550
|
/** Define one Junior plugin registration for app and build-time wiring. */
|
|
2551
|
-
declare function defineJuniorPlugin(plugin: PluginRegistrationInput): PluginRegistration;
|
|
2552
|
-
|
|
2553
|
-
export { type Actor, type AfterMcpToolHookContext, type AgentInvocationSource, type ApiRouteRegistrationHookContext, type BeforeToolExecuteHookContext, type CodeChangeInput, type CodeChangePublisher, type CodeChangeState, type ConversationAnnotation, type ConversationAnnotationInput, type ConversationEventPresentation, type ConversationSidebarAnnotation, type ConversationSidebarHookContext, type ConversationSidebarResult, type DefinedConversationEvent, type Destination, type DestinationVisibility, type Dispatch, type DispatchOptions, type DispatchResult, EVENT_DATA_MAX_JSON_BYTES, EVENT_DATA_MAX_KEYS, EVENT_GUIDANCE_MAX_LENGTH, EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, EgressAuthRequired, type EgressHookContext, EgressPolicyDenied, type EgressResponseHookContext, type Event, type EventAutomationSource, type EventData, type EventInput, type EventInvocationContext, type EventMatch, type EventMatchFields, type EventPerson, type EventPublisher, type EventSource, type FormatMarkdownHookContext, type HeartbeatHookContext, type HeartbeatResult, type Identity, type InvocationContext, type IssueCredentialHookContext, type LocalActor, type LocalDestination, type LocalInvocationContext, type LocalSource, type Location, type ObjectAnnotation, type ObjectFacts, type ObjectIconName, type ObjectTone, type ObjectType, type OperationalReportHookContext, type OwnedObjectAnnotation, type Platform, type PluginAnnotations, type PluginApiRouteRequestContext, type PluginAuthorization, type PluginCliActionCommand, type PluginCliActionContext, type PluginCliActionHandler, type PluginCliCommandDefinition, type PluginCliDefinition, type PluginCliHost, type PluginCliIo, type PluginContext, type PluginConversationAnnotations, type PluginConversationEventCostDay, type PluginConversationEventDefinition, type PluginConversationEventReader, type PluginConversationEventRecord, type PluginConversationEventStats, type PluginConversationEventValue, type PluginConversationEvents, type PluginCredentialActor, type PluginCredentialHeaderTransform, type PluginCredentialLease, type PluginCredentialResult, type PluginCredentialSubject, type PluginCredentials, type PluginDecision, type PluginDispatchSource, type PluginEgress, type PluginEgressRequest, type PluginEgressResponse, type PluginEmbedder, type PluginEnv, type PluginEnvVarDeclaration, type PluginEventToolContext, type PluginEventType, type PluginEvents, type PluginGrant, type PluginGrantAccess, type PluginHooks, type PluginLogger, type PluginManifest, type PluginMcp, type PluginMcpAuthConfig, type PluginMcpAuthorizationPending, type PluginMcpConfig, type PluginMcpContent, type PluginMcpOAuthClientConfig, type PluginMcpToolError, type PluginMcpToolResult, type PluginMcpToolSuccess, type PluginMetadata, type PluginModel, type PluginModelConfig, type PluginNpmRuntimeDependency, type PluginOAuthBearerCredentials, type PluginOAuthConfig, type PluginOperationalBarChartWidget, type PluginOperationalChartCategory, type PluginOperationalChartSeries, type PluginOperationalField, type PluginOperationalMetric, type PluginOperationalRecord, type PluginOperationalRecordSet, type PluginOperationalReport, type PluginOperationalReportContent, type PluginOperationalTone, type PluginProviderAccount, type PluginReadState, type PluginRegistration, type PluginRegistrationInput, type PluginResolvedCredentialUser, type PluginRoute, type PluginRouteApp, type PluginRouteHandler, type PluginRouteMethod, type PluginRunContext, type PluginRunTranscriptEntry, type PluginRunTranscriptProvenance, type PluginRuntimeDependency, type PluginRuntimePostinstallCommand, type PluginSandbox, type PluginState, type PluginStoredTokens, type PluginSystemRuntimeDependency, type PluginSystemRuntimeDependencyFromUrl, type PluginTaskContext, type PluginTaskDefinition, type PluginTasks, type PluginTokenStore, type PluginToolContent, type PluginToolDefinition, type PluginToolExecute, type PluginToolExecuteOptions, PluginToolInputError, type PluginToolOutput, type PluginToolOutputEnvelope, type PluginUserPageContent, type PluginUserPageContext, type PluginUserPageDefinition, type PluginUserPageInput, type PluginUserPageLink, type PluginUserTokenSlot, type PluginWorkspaceToolContext, type ProfileReportHookContext, type PromptContext, type PromptContextContribution, type PromptMessage, REQUIRED_TOOL_ANNOTATION_KEYS, type ReplyAttribution, type RequiredToolAnnotationKey, type ResolveOAuthAccountHookContext, type RouteRegistrationHookContext, type SandboxPrepareHookContext, type ScheduledAutomationSource, type SlackActor, type SlackConversationLink, type SlackConversationLinkHookContext, type SlackDestination, type SlackInvocationContext, type SlackLocation, type SlackSource, type SlackToolRegistrationHookContext, type Source, type SourceVisibility, type SubscribableResource, type SystemActor, type SystemPromptContext, type TaskOutcome, type ToolAnnotations, type ToolApprovalMetadata, type ToolApprovalMode, type ToolExposure, type ToolRegistrationHookContext, type UnfinishedWorkHookContext, type UnfinishedWorkResult, type User, type UserPromptContext, type UserPromptContribution, type WatchResult, type WebActor, type WebInvocationContext, type WebSource, type WorkspaceFinalize, type WorkspacePrepareHookContext, actorSchema, actorUserIdSchema, agentInvocationSourceSchema, codeChangeInputSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventIconSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, conversationSidebarIconSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, defineConversationEvent, defineJuniorPlugin, definePluginTool, definePromptContext, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, enforceEgressPolicy, eventAutomationSourceSchema, eventDataSchema, eventIdentifierSchema, eventInputSchema, eventMatchFieldSchema, eventMatchFieldsSchema, eventMatchSchema, eventMatches, eventPersonSchema, eventSchema, eventSourceSchema, eventTypeSchema, getSourceKey, identitySchema, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, missingToolAnnotationKeys, nonBlankStringSchema, normalizeEventIdentifier, objectAnnotationSchema, objectFactFields, objectFactsSchema, objectIconPath, objectIconPaths, objectPresentation, objectTypeSchema, ownedObjectAnnotationSchema, platformSchema, pluginApiRouteRequestContextSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialLeaseSchema, pluginCredentialResultSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, pluginEventTypeSchema, pluginEventsSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginRunContextSchema, pluginRunTranscriptEntrySchema, pluginRunTranscriptProvenanceSchema, pluginStoredTokensSchema, pluginToolContentSchema, pluginToolContinuationSchema, pluginToolOutputSchema, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageInputSchema, pluginUserPageLinkSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema, promptContextSchema, promptMessageSchema, replyAttributionSchema, resourceLinkAnnotationSchema, resourceTypeSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, stableEventMatchKey, subscribableResourceSchema, systemActorSchema, taskOutcomeSchema, toolApprovalModeSchema, userSchema, watchResultSchema, webActorSchema, webSourceSchema, zodTool };
|
|
2551
|
+
export declare function defineJuniorPlugin(plugin: PluginRegistrationInput): PluginRegistration;
|
|
2552
|
+
export type { PromptContext, PromptContextContribution, PromptMessage, SystemPromptContext, UserPromptContext, UserPromptContribution };
|