@sentry/junior-plugin-api 0.74.1 → 0.76.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 CHANGED
@@ -1,616 +1,13 @@
1
- import { z } from "zod";
2
- /** Runtime-owned Slack address for routing future work or side effects. */
3
- export declare const slackDestinationSchema: z.ZodObject<{
4
- platform: z.ZodLiteral<"slack">;
5
- teamId: z.ZodString;
6
- channelId: z.ZodString;
7
- }, z.core.$strict>;
8
- /** Runtime-owned local CLI conversation address. */
9
- export declare const localDestinationSchema: z.ZodObject<{
10
- platform: z.ZodLiteral<"local">;
11
- conversationId: z.ZodString;
12
- }, z.core.$strict>;
13
- /** Runtime-owned provider-neutral address for routing future work or side effects. */
14
- export declare const destinationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
15
- platform: z.ZodLiteral<"slack">;
16
- teamId: z.ZodString;
17
- channelId: z.ZodString;
18
- }, z.core.$strict>, z.ZodObject<{
19
- platform: z.ZodLiteral<"local">;
20
- conversationId: z.ZodString;
21
- }, z.core.$strict>], "platform">;
22
- /** Runtime-owned Slack coordinates for the inbound invocation. */
23
- export declare const slackSourceSchema: z.ZodObject<{
24
- platform: z.ZodLiteral<"slack">;
25
- teamId: z.ZodString;
26
- channelId: z.ZodString;
27
- messageTs: z.ZodOptional<z.ZodString>;
28
- threadTs: z.ZodOptional<z.ZodString>;
29
- }, z.core.$strict>;
30
- /** Runtime-owned local CLI coordinates for the inbound invocation. */
31
- export declare const localSourceSchema: z.ZodObject<{
32
- platform: z.ZodLiteral<"local">;
33
- conversationId: z.ZodString;
34
- }, z.core.$strict>;
35
- /** Runtime-owned provider-neutral coordinates for the inbound invocation. */
36
- export declare const sourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
- platform: z.ZodLiteral<"slack">;
38
- teamId: z.ZodString;
39
- channelId: z.ZodString;
40
- messageTs: z.ZodOptional<z.ZodString>;
41
- threadTs: z.ZodOptional<z.ZodString>;
42
- }, z.core.$strict>, z.ZodObject<{
43
- platform: z.ZodLiteral<"local">;
44
- conversationId: z.ZodString;
45
- }, z.core.$strict>], "platform">;
46
- /** Stable user credential subject shape accepted from plugins. */
47
- export declare const agentPluginCredentialSubjectSchema: z.ZodObject<{
48
- type: z.ZodLiteral<"user">;
49
- userId: z.ZodString;
50
- allowedWhen: z.ZodLiteral<"private-direct-conversation">;
51
- }, z.core.$strict>;
52
- export declare const slackRequesterSchema: z.ZodObject<{
53
- platform: z.ZodLiteral<"slack">;
54
- teamId: z.ZodString;
55
- email: z.ZodOptional<z.ZodString>;
56
- fullName: z.ZodOptional<z.ZodString>;
57
- userId: z.ZodString;
58
- userName: z.ZodOptional<z.ZodString>;
59
- }, z.core.$strict>;
60
- export declare const localRequesterSchema: z.ZodObject<{
61
- platform: z.ZodLiteral<"local">;
62
- email: z.ZodOptional<z.ZodString>;
63
- fullName: z.ZodOptional<z.ZodString>;
64
- userId: z.ZodString;
65
- userName: z.ZodOptional<z.ZodString>;
66
- }, z.core.$strict>;
67
- /** Runtime-provided requester identity visible to plugin hooks. */
68
- export declare const requesterSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
69
- platform: z.ZodLiteral<"slack">;
70
- teamId: z.ZodString;
71
- email: z.ZodOptional<z.ZodString>;
72
- fullName: z.ZodOptional<z.ZodString>;
73
- userId: z.ZodString;
74
- userName: z.ZodOptional<z.ZodString>;
75
- }, z.core.$strict>, z.ZodObject<{
76
- platform: z.ZodLiteral<"local">;
77
- email: z.ZodOptional<z.ZodString>;
78
- fullName: z.ZodOptional<z.ZodString>;
79
- userId: z.ZodString;
80
- userName: z.ZodOptional<z.ZodString>;
81
- }, z.core.$strict>], "platform">;
82
- /** Plugin dispatch request accepted by Junior core. */
83
- export declare const dispatchOptionsSchema: z.ZodObject<{
84
- idempotencyKey: z.ZodPipe<z.ZodString, z.ZodString>;
85
- credentialSubject: z.ZodOptional<z.ZodObject<{
86
- type: z.ZodLiteral<"user">;
87
- userId: z.ZodString;
88
- allowedWhen: z.ZodLiteral<"private-direct-conversation">;
89
- }, z.core.$strict>>;
90
- destination: z.ZodObject<{
91
- platform: z.ZodLiteral<"slack">;
92
- teamId: z.ZodString;
93
- channelId: z.ZodString;
94
- }, z.core.$strict>;
95
- input: z.ZodPipe<z.ZodString, z.ZodString>;
96
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
97
- }, z.core.$strict>;
98
- export type Requester = z.output<typeof requesterSchema>;
99
- export type SlackRequester = z.output<typeof slackRequesterSchema>;
100
- export type LocalRequester = z.output<typeof localRequesterSchema>;
101
- export type Source = z.output<typeof sourceSchema>;
102
- export type SlackSource = Extract<Source, {
103
- platform: "slack";
104
- }>;
105
- export type LocalSource = Extract<Source, {
106
- platform: "local";
107
- }>;
108
- export interface AgentPluginMetadata {
109
- name: string;
110
- }
111
- export interface AgentPluginEnv {
112
- get(key: string): string | undefined;
113
- set(key: string, value: string): void;
114
- }
115
- export interface AgentPluginDecision {
116
- deny(message: string): void;
117
- replaceInput(input: Record<string, unknown>): void;
118
- }
119
- export interface AgentPluginLogger {
120
- error(message: string, metadata?: Record<string, unknown>): void;
121
- info(message: string, metadata?: Record<string, unknown>): void;
122
- warn(message: string, metadata?: Record<string, unknown>): void;
123
- }
124
- /** Thrown when a plugin tool rejects invalid model or user input. */
125
- export declare class AgentPluginToolInputError extends Error {
126
- constructor(message: string, options?: {
127
- cause?: unknown;
128
- });
129
- }
130
- export interface AgentPluginContext {
131
- log: AgentPluginLogger;
132
- plugin: AgentPluginMetadata;
133
- }
134
- interface BaseInvocationContext {
135
- /**
136
- * Opaque Junior conversation/session identity for this invocation.
137
- * Interactive Slack turns use `slack:{channelId}:{threadTs}`.
138
- */
139
- conversationId?: string;
140
- }
141
- export interface SlackInvocationContext extends BaseInvocationContext {
142
- /** Runtime-owned default outbound destination for this invocation, if any. */
143
- destination?: SlackDestination;
144
- requester?: SlackRequester;
145
- /** Runtime-owned source where the invocation came from. */
146
- source: SlackSource;
147
- }
148
- export interface LocalInvocationContext extends BaseInvocationContext {
149
- /** Runtime-owned default outbound destination for this invocation, if any. */
150
- destination?: LocalDestination;
151
- requester?: LocalRequester;
152
- /** Runtime-owned source where the invocation came from. */
153
- source: LocalSource;
154
- }
155
- export type InvocationContext = LocalInvocationContext | SlackInvocationContext;
156
- export interface AgentPluginSandbox {
157
- juniorRoot: string;
158
- root: string;
159
- readFile(path: string): Promise<Uint8Array | null>;
160
- run(input: {
161
- args?: string[];
162
- cmd: string;
163
- cwd?: string;
164
- env?: Record<string, string>;
165
- sudo?: boolean;
166
- }): Promise<{
167
- exitCode: number;
168
- stderr: string;
169
- stdout: string;
170
- }>;
171
- writeFile(input: {
172
- content: string | Uint8Array;
173
- mode?: number;
174
- path: string;
175
- }): Promise<void>;
176
- }
177
- export interface SandboxPrepareHookContext extends AgentPluginContext {
178
- requester?: Requester;
179
- sandbox: AgentPluginSandbox;
180
- }
181
- export interface BeforeToolExecuteHookContext extends AgentPluginContext {
182
- decision: AgentPluginDecision;
183
- env: AgentPluginEnv;
184
- requester?: Requester;
185
- tool: {
186
- input: Record<string, unknown>;
187
- name: string;
188
- };
189
- }
190
- export type AgentPluginToolExecute<TInput = unknown> = {
191
- bivarianceHack(input: TInput, options: {
192
- experimental_context?: unknown;
193
- }): Promise<unknown> | unknown;
194
- }["bivarianceHack"];
195
- export interface AgentPluginToolDefinition<TInput = unknown> {
196
- annotations?: unknown;
197
- description: string;
198
- executionMode?: unknown;
199
- inputSchema: unknown;
200
- prepareArguments?: (args: unknown) => unknown;
201
- /**
202
- * @deprecated Put tool-selection and usage guidance directly in `description`
203
- * and parameter descriptions. Retained for compatibility; may be removed in a
204
- * future major version.
205
- */
206
- promptGuidelines?: string[];
207
- /**
208
- * @deprecated Put tool-selection and usage guidance directly in `description`
209
- * and parameter descriptions. Retained for compatibility; may be removed in a
210
- * future major version.
211
- */
212
- promptSnippet?: string;
213
- execute?: AgentPluginToolExecute<TInput>;
214
- }
215
- export interface SlackToolRegistrationHookContext {
216
- /**
217
- * Capabilities of the source Slack conversation exposed to this plugin.
218
- * Recomputed from `source.channelId`, not from `destination`.
219
- */
220
- channelCapabilities: {
221
- canAddReactions: boolean;
222
- canCreateCanvas: boolean;
223
- canPostToChannel: boolean;
224
- };
225
- credentialSubject?: AgentPluginCredentialSubject;
226
- }
227
- interface BaseToolRegistrationHookContext extends AgentPluginContext {
228
- /**
229
- * Opaque Junior conversation/session identity for this turn.
230
- * Interactive Slack turns use `slack:{channelId}:{threadTs}`.
231
- * Scheduled/API turns use an internal id such as `agent-dispatch:{id}`.
232
- * Do not parse as Slack unless the value starts with `slack:`.
233
- */
234
- conversationId?: string;
235
- state: AgentPluginState;
236
- userText?: string;
237
- }
238
- interface SlackToolRegistrationContext extends BaseToolRegistrationHookContext, SlackInvocationContext {
239
- slack: SlackToolRegistrationHookContext;
240
- }
241
- interface LocalToolRegistrationContext extends BaseToolRegistrationHookContext, LocalInvocationContext {
242
- slack?: never;
243
- }
244
- export type ToolRegistrationHookContext = LocalToolRegistrationContext | SlackToolRegistrationContext;
245
- export type AgentPluginCredentialSubject = z.output<typeof agentPluginCredentialSubjectSchema>;
246
- export type Destination = z.output<typeof destinationSchema>;
247
- export type SlackDestination = Extract<Destination, {
248
- platform: "slack";
249
- }>;
250
- export type LocalDestination = Extract<Destination, {
251
- platform: "local";
252
- }>;
253
- /** Narrow a runtime destination to the Slack-specific address shape. */
254
- export declare function isSlackDestination(destination: Destination | undefined): destination is SlackDestination;
255
- export type DispatchOptions = z.output<typeof dispatchOptionsSchema>;
256
- export interface DispatchResult {
257
- id: string;
258
- status: "created" | "already_exists";
259
- }
260
- export interface Dispatch {
261
- errorMessage?: string;
262
- id: string;
263
- resultMessageTs?: string;
264
- status: "pending" | "running" | "awaiting_resume" | "completed" | "failed" | "blocked";
265
- }
266
- export interface AgentPluginState {
267
- delete(key: string): Promise<void>;
268
- get<T = unknown>(key: string): Promise<T | undefined>;
269
- set(key: string, value: unknown, ttlMs?: number): Promise<void>;
270
- setIfNotExists(key: string, value: unknown, ttlMs?: number): Promise<boolean>;
271
- withLock<T>(key: string, ttlMs: number, callback: () => Promise<T>): Promise<T>;
272
- }
273
- export interface AgentPluginReadState {
274
- get<T = unknown>(key: string): Promise<T | undefined>;
275
- }
276
- export type AgentPluginConversationStatus = "active" | "completed" | "failed" | "hung" | "superseded";
277
- export interface AgentPluginConversationSummary {
278
- channelName?: string;
279
- conversationId: string;
280
- displayTitle: string;
281
- lastActivityAt: string;
282
- lastUpdatedAt: string;
283
- source?: "api" | "internal" | "local" | "plugin" | "scheduler" | "slack";
284
- status: AgentPluginConversationStatus;
285
- }
286
- export interface AgentPluginConversations {
287
- listRecent(options?: {
288
- limit?: number;
289
- }): Promise<AgentPluginConversationSummary[]>;
290
- }
291
- export interface HeartbeatHookContext extends AgentPluginContext {
292
- agent: {
293
- dispatch(options: DispatchOptions): Promise<DispatchResult>;
294
- get(id: string): Promise<Dispatch | undefined>;
295
- };
296
- nowMs: number;
297
- state: AgentPluginState;
298
- }
299
- export interface HeartbeatResult {
300
- dispatchCount?: number;
301
- }
302
- export type PluginOperationalTone = "danger" | "good" | "neutral" | "warning";
303
- export interface PluginOperationalMetric {
304
- label: string;
305
- tone?: PluginOperationalTone;
306
- value: string;
307
- }
308
- export interface PluginOperationalField {
309
- key: string;
310
- label: string;
311
- }
312
- export interface PluginOperationalRecord {
313
- id: string;
314
- tone?: PluginOperationalTone;
315
- values: Record<string, string>;
316
- }
317
- export interface PluginOperationalRecordSet {
318
- fields?: PluginOperationalField[];
319
- emptyText?: string;
320
- records?: PluginOperationalRecord[];
321
- title: string;
322
- }
323
- export interface PluginOperationalReportContent {
324
- generatedAt?: string;
325
- metrics?: PluginOperationalMetric[];
326
- recordSets?: PluginOperationalRecordSet[];
327
- title?: string;
328
- }
329
- export interface PluginOperationalReport extends PluginOperationalReportContent {
330
- pluginName: string;
331
- }
332
- export interface OperationalReportHookContext extends AgentPluginContext {
333
- conversations: AgentPluginConversations;
334
- nowMs: number;
335
- state: AgentPluginReadState;
336
- }
337
- export type AgentPluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "ALL";
338
- export type AgentPluginRouteHandler = {
339
- bivarianceHack(request: Request): Promise<Response> | Response;
340
- }["bivarianceHack"];
341
- export interface AgentPluginRoute {
342
- handler: AgentPluginRouteHandler;
343
- method?: AgentPluginRouteMethod | AgentPluginRouteMethod[];
344
- path: string;
345
- }
346
- export interface RouteRegistrationHookContext extends AgentPluginContext {
347
- }
348
- export interface SlackConversationLink {
349
- url: string;
350
- }
351
- export interface SlackConversationLinkHookContext extends AgentPluginContext {
352
- conversationId: string;
353
- }
354
- declare const agentPluginGrantAccessSchema: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
355
- /** Runtime schema for provider authorization a plugin may request. */
356
- export declare const agentPluginAuthorizationSchema: z.ZodObject<{
357
- provider: z.ZodString;
358
- scope: z.ZodOptional<z.ZodString>;
359
- type: z.ZodLiteral<"oauth">;
360
- }, z.core.$strict>;
361
- /** Runtime schema for a provider account attached to stored OAuth tokens. */
362
- export declare const agentPluginProviderAccountSchema: z.ZodObject<{
363
- id: z.ZodString;
364
- label: z.ZodOptional<z.ZodString>;
365
- url: z.ZodOptional<z.ZodString>;
366
- }, z.core.$strict>;
367
- /** Runtime schema for a plugin-defined outbound credential grant. */
368
- export declare const agentPluginGrantSchema: z.ZodObject<{
369
- access: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
370
- name: z.ZodString;
371
- reason: z.ZodOptional<z.ZodString>;
372
- requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
373
- }, z.core.$strict>;
374
- /** Runtime schema for plugin-issued header mutations. */
375
- export declare const agentPluginCredentialHeaderTransformSchema: z.ZodObject<{
376
- domain: z.ZodString;
377
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
378
- }, z.core.$strict>;
379
- /** Runtime schema for a short-lived plugin-issued credential lease. */
380
- export declare const agentPluginCredentialLeaseSchema: z.ZodObject<{
381
- account: z.ZodOptional<z.ZodObject<{
382
- id: z.ZodString;
383
- label: z.ZodOptional<z.ZodString>;
384
- url: z.ZodOptional<z.ZodString>;
385
- }, z.core.$strict>>;
386
- authorization: z.ZodOptional<z.ZodObject<{
387
- provider: z.ZodString;
388
- scope: z.ZodOptional<z.ZodString>;
389
- type: z.ZodLiteral<"oauth">;
390
- }, z.core.$strict>>;
391
- expiresAt: z.ZodString;
392
- headerTransforms: z.ZodArray<z.ZodObject<{
393
- domain: z.ZodString;
394
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
395
- }, z.core.$strict>>;
396
- }, z.core.$strict>;
397
- /** Runtime schema for the result returned by a plugin credential hook. */
398
- export declare const agentPluginCredentialResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
399
- lease: z.ZodObject<{
400
- account: z.ZodOptional<z.ZodObject<{
401
- id: z.ZodString;
402
- label: z.ZodOptional<z.ZodString>;
403
- url: z.ZodOptional<z.ZodString>;
404
- }, z.core.$strict>>;
405
- authorization: z.ZodOptional<z.ZodObject<{
406
- provider: z.ZodString;
407
- scope: z.ZodOptional<z.ZodString>;
408
- type: z.ZodLiteral<"oauth">;
409
- }, z.core.$strict>>;
410
- expiresAt: z.ZodString;
411
- headerTransforms: z.ZodArray<z.ZodObject<{
412
- domain: z.ZodString;
413
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
414
- }, z.core.$strict>>;
415
- }, z.core.$strict>;
416
- type: z.ZodLiteral<"lease">;
417
- }, z.core.$strict>, z.ZodObject<{
418
- authorization: z.ZodOptional<z.ZodObject<{
419
- provider: z.ZodString;
420
- scope: z.ZodOptional<z.ZodString>;
421
- type: z.ZodLiteral<"oauth">;
422
- }, z.core.$strict>>;
423
- message: z.ZodString;
424
- type: z.ZodLiteral<"needed">;
425
- }, z.core.$strict>, z.ZodObject<{
426
- message: z.ZodString;
427
- type: z.ZodLiteral<"unavailable">;
428
- }, z.core.$strict>], "type">;
429
- export type AgentPluginGrantAccess = z.output<typeof agentPluginGrantAccessSchema>;
430
- /** Provider authorization Junior can start when a plugin-owned grant is missing. */
431
- export type AgentPluginAuthorization = z.output<typeof agentPluginAuthorizationSchema>;
432
- /** Interrupt sandbox egress so Junior can start provider authorization. */
433
- export declare class EgressAuthRequired extends Error {
434
- authorization?: AgentPluginAuthorization;
435
- constructor(message: string, options?: {
436
- authorization?: AgentPluginAuthorization;
437
- cause?: unknown;
438
- });
439
- }
440
- /** Provider account identity resolved by a plugin OAuth hook. */
441
- export type AgentPluginProviderAccount = z.output<typeof agentPluginProviderAccountSchema>;
442
- /** Plugin-defined grant required before Junior can forward one outbound request. */
443
- export type AgentPluginGrant = z.output<typeof agentPluginGrantSchema>;
444
- /** Request details available while selecting the grant for sandbox egress. */
445
- export interface AgentPluginEgressRequest {
446
- /** Capped request body text when the host exposes it for provider-specific grant classification. */
447
- bodyText?: string;
448
- method: string;
449
- url: string;
450
- }
451
- export interface EgressHookContext extends AgentPluginContext {
452
- request: AgentPluginEgressRequest;
453
- }
454
- export interface AgentPluginEgressResponse {
455
- /** Snapshot of upstream response headers; mutations do not affect pass-through. */
456
- headers: Headers;
457
- readText(maxBytes: number): Promise<string | undefined>;
458
- status: number;
459
- }
460
- export interface EgressResponseHookContext extends AgentPluginContext {
461
- grant: AgentPluginGrant;
462
- permissionDenied(message: string): void;
463
- request: Omit<AgentPluginEgressRequest, "bodyText">;
464
- response: AgentPluginEgressResponse;
465
- }
466
- /** Header mutations a plugin-issued credential lease may apply to owned domains. */
467
- export type AgentPluginCredentialHeaderTransform = z.output<typeof agentPluginCredentialHeaderTransformSchema>;
468
- /** Short-lived credential headers issued by a plugin for a selected grant. */
469
- export type AgentPluginCredentialLease = z.output<typeof agentPluginCredentialLeaseSchema>;
470
- export type AgentPluginCredentialResult = z.output<typeof agentPluginCredentialResultSchema>;
471
- export type AgentPluginCredentialActor = {
472
- type: "system";
473
- id: string;
474
- } | {
475
- type: "user";
476
- userId: string;
477
- };
478
- export interface AgentPluginResolvedCredentialUser {
479
- type: "user";
480
- userId: string;
481
- }
482
- export interface AgentPluginStoredTokens {
483
- account?: AgentPluginProviderAccount;
484
- accessToken: string;
485
- expiresAt?: number;
486
- refreshToken: string;
487
- scope?: string;
488
- }
489
- export interface AgentPluginUserTokenSlot {
490
- get(): Promise<AgentPluginStoredTokens | undefined>;
491
- set(tokens: AgentPluginStoredTokens): Promise<void>;
492
- userId: string;
493
- }
494
- export interface AgentPluginTokenStore {
495
- credentialSubject?: AgentPluginUserTokenSlot;
496
- currentUser?: AgentPluginUserTokenSlot;
497
- }
498
- export interface ResolveOAuthAccountHookContext extends AgentPluginContext {
499
- tokens: AgentPluginStoredTokens;
500
- }
501
- export interface IssueCredentialHookContext extends AgentPluginContext {
502
- actor: AgentPluginCredentialActor;
503
- credentialSubject?: AgentPluginResolvedCredentialUser;
504
- grant: AgentPluginGrant;
505
- tokens: AgentPluginTokenStore;
506
- }
507
- export interface AgentPluginHooks {
508
- sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
509
- beforeToolExecute?(ctx: BeforeToolExecuteHookContext): Promise<void> | void;
510
- grantForEgress?(ctx: EgressHookContext): Promise<AgentPluginGrant | undefined> | AgentPluginGrant | undefined;
511
- issueCredential?(ctx: IssueCredentialHookContext): Promise<AgentPluginCredentialResult> | AgentPluginCredentialResult;
512
- onEgressResponse?(ctx: EgressResponseHookContext): Promise<void> | void;
513
- resolveOAuthAccount?(ctx: ResolveOAuthAccountHookContext): Promise<AgentPluginProviderAccount | undefined> | AgentPluginProviderAccount | undefined;
514
- routes?(ctx: RouteRegistrationHookContext): AgentPluginRoute[];
515
- tools?(ctx: ToolRegistrationHookContext): Record<string, AgentPluginToolDefinition>;
516
- heartbeat?(ctx: HeartbeatHookContext): Promise<HeartbeatResult | void> | HeartbeatResult | void;
517
- operationalReport?(ctx: OperationalReportHookContext): Promise<PluginOperationalReportContent | undefined> | PluginOperationalReportContent | undefined;
518
- slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
519
- }
520
- export interface JuniorPluginOAuthConfig {
521
- authorizeEndpoint: string;
522
- authorizeParams?: Record<string, string>;
523
- clientIdEnv: string;
524
- clientSecretEnv: string;
525
- scope?: string;
526
- /**
527
- * Treat a provider token response with `scope: ""` like an omitted scope and
528
- * fall back to the requested scope string when storing the token.
529
- *
530
- * Enable this only for providers whose token responses cannot report OAuth
531
- * scopes even though Junior needs a local requested-scope string for
532
- * reauthorization checks. The built-in GitHub App plugin enables this because
533
- * GitHub App user-to-server tokens always return an empty scope value — their
534
- * effective access is enforced by GitHub App permissions, installation
535
- * repository access, and the requesting user's own access, not OAuth scopes.
536
- *
537
- * Do not enable this for standard OAuth providers where an explicit empty
538
- * `scope` means the provider granted no scopes.
539
- */
540
- treatEmptyScopeAsUnreported?: boolean;
541
- tokenAuthMethod?: "body" | "basic";
542
- tokenEndpoint: string;
543
- tokenExtraHeaders?: Record<string, string>;
544
- }
545
- export interface JuniorPluginOAuthBearerCredentials {
546
- apiHeaders?: Record<string, string>;
547
- authTokenEnv: string;
548
- authTokenPlaceholder?: string;
549
- domains: string[];
550
- type: "oauth-bearer";
551
- }
552
- export type JuniorPluginCredentials = JuniorPluginOAuthBearerCredentials;
553
- export interface JuniorPluginNpmRuntimeDependency {
554
- package: string;
555
- type: "npm";
556
- version: string;
557
- }
558
- export interface JuniorPluginSystemRuntimeDependency {
559
- package: string;
560
- type: "system";
561
- }
562
- export interface JuniorPluginSystemRuntimeDependencyFromUrl {
563
- sha256: string;
564
- type: "system";
565
- url: string;
566
- }
567
- export type JuniorPluginRuntimeDependency = JuniorPluginNpmRuntimeDependency | JuniorPluginSystemRuntimeDependency | JuniorPluginSystemRuntimeDependencyFromUrl;
568
- export interface JuniorPluginRuntimePostinstallCommand {
569
- args?: string[];
570
- cmd: string;
571
- sudo?: boolean;
572
- }
573
- export interface JuniorPluginMcpConfig {
574
- allowedTools?: string[];
575
- headers?: Record<string, string>;
576
- transport: "http";
577
- url: string;
578
- }
579
- export interface JuniorPluginEnvVarDeclaration {
580
- default?: string;
581
- exposeToCommandEnv?: boolean;
582
- }
583
- export interface JuniorPluginManifest {
584
- apiHeaders?: Record<string, string>;
585
- capabilities?: string[];
586
- commandEnv?: Record<string, string>;
587
- configKeys?: string[];
588
- credentials?: JuniorPluginCredentials;
589
- description: string;
590
- displayName: string;
591
- domains?: string[];
592
- envVars?: Record<string, JuniorPluginEnvVarDeclaration>;
593
- mcp?: JuniorPluginMcpConfig;
594
- name: string;
595
- oauth?: JuniorPluginOAuthConfig;
596
- runtimeDependencies?: JuniorPluginRuntimeDependency[];
597
- runtimePostinstall?: JuniorPluginRuntimePostinstallCommand[];
598
- target?: {
599
- commandFlags?: string[];
600
- configKey: string;
601
- type: string;
602
- };
603
- }
604
- export type JuniorPluginRegistrationInput = {
605
- hooks?: AgentPluginHooks;
606
- legacyStatePrefixes?: string[];
607
- manifest: JuniorPluginManifest;
608
- name?: string;
609
- packageName?: string;
610
- };
611
- export interface JuniorPluginRegistration extends JuniorPluginRegistrationInput {
612
- name: string;
613
- }
614
- /** Define one Junior plugin registration for app and build-time wiring. */
615
- export declare function defineJuniorPlugin(plugin: JuniorPluginRegistrationInput): JuniorPluginRegistration;
616
- export {};
1
+ export * from "./schemas";
2
+ export * from "./context";
3
+ export * from "./state";
4
+ export { promptMessageSchema, type PromptMessage, type SystemPromptContext, type UserPromptContext, } from "./prompt";
5
+ export * from "./dispatch";
6
+ export * from "./tasks";
7
+ export * from "./tools";
8
+ export * from "./operations";
9
+ export * from "./credentials";
10
+ export * from "./hooks";
11
+ export * from "./cli";
12
+ export * from "./manifest";
13
+ export * from "./registration";