@sentry/junior-plugin-api 0.162.0 → 0.164.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/hooks.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ConversationSidebarHookContext, ConversationSidebarResult } from "./annotations";
2
2
  import type { EgressHookContext, EgressResponseHookContext, IssueCredentialHookContext, PluginCredentialResult, PluginGrant, PluginProviderAccount, ResolveOAuthAccountHookContext } from "./credentials";
3
3
  import type { HeartbeatHookContext, HeartbeatResult, OperationalReportHookContext, ProfileReportHookContext, ApiRouteRegistrationHookContext, PluginOperationalReportContent, PluginRoute, PluginRouteApp, RouteRegistrationHookContext, SlackConversationLink, SlackConversationLinkHookContext, UnfinishedWorkHookContext, UnfinishedWorkResult } from "./operations";
4
- import type { AfterMcpToolHookContext, BeforeToolExecuteHookContext, PluginToolDefinition, SandboxPrepareHookContext, ToolRegistrationHookContext } from "./tools";
4
+ import type { AfterMcpToolHookContext, BeforeToolExecuteHookContext, PluginToolDefinition, SandboxPrepareHookContext, ToolRegistrationHookContext, WorkspacePrepareHookContext } from "./tools";
5
5
  import type { PromptMessage, SystemPromptContext, UserPromptContext, UserPromptContribution } from "./prompt";
6
6
  /** Input for a pure Markdown rewrite before destination delivery formatting. */
7
7
  export interface FormatMarkdownHookContext {
@@ -35,6 +35,7 @@ export interface PluginHooks {
35
35
  resolveOAuthAccount?(ctx: ResolveOAuthAccountHookContext): Promise<PluginProviderAccount | undefined> | PluginProviderAccount | undefined;
36
36
  routes?(ctx: RouteRegistrationHookContext): PluginRoute[];
37
37
  sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
38
+ workspacePrepare?(ctx: WorkspacePrepareHookContext): Promise<void> | void;
38
39
  slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
39
40
  /** Pure Markdown rewrite. Emit ordinary Markdown only. */
40
41
  formatMarkdown?(ctx: FormatMarkdownHookContext): string;
package/dist/tools.d.ts CHANGED
@@ -109,6 +109,14 @@ export interface PluginMcp {
109
109
  */
110
110
  prepare(): Promise<"authorization_pending" | "ready">;
111
111
  }
112
+ /** Provider-owned repository preparation for one Workspace snapshot build. */
113
+ export interface WorkspacePrepareHookContext extends PluginContext {
114
+ repos: Array<{
115
+ path: string;
116
+ repo: string;
117
+ }>;
118
+ sandbox: PluginSandbox;
119
+ }
112
120
  export interface SandboxPrepareHookContext extends PluginContext {
113
121
  actor?: Actor;
114
122
  sandbox: PluginSandbox;
@@ -281,6 +289,13 @@ export interface PluginResourceEventToolContext {
281
289
  /** Whether this invocation can create a working resource-event subscription. */
282
290
  canSubscribe: boolean;
283
291
  }
292
+ export interface PluginWorkspaceToolContext {
293
+ /** Find named Workspaces that include one provider repository. */
294
+ findByRepository(input: {
295
+ provider: string;
296
+ repo: string;
297
+ }): Promise<string[]>;
298
+ }
284
299
  interface BaseToolRegistrationHookContext extends PluginContext {
285
300
  /**
286
301
  * Opaque Junior conversation/session identity for this turn.
@@ -306,6 +321,7 @@ interface BaseToolRegistrationHookContext extends PluginContext {
306
321
  } | undefined>;
307
322
  };
308
323
  userText?: string;
324
+ workspaces: PluginWorkspaceToolContext;
309
325
  }
310
326
  interface SlackToolRegistrationContext extends BaseToolRegistrationHookContext, SlackInvocationContext {
311
327
  slack: SlackToolRegistrationHookContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-plugin-api",
3
- "version": "0.162.0",
3
+ "version": "0.164.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/hooks.ts CHANGED
@@ -32,6 +32,7 @@ import type {
32
32
  PluginToolDefinition,
33
33
  SandboxPrepareHookContext,
34
34
  ToolRegistrationHookContext,
35
+ WorkspacePrepareHookContext,
35
36
  } from "./tools";
36
37
  import type {
37
38
  PromptMessage,
@@ -105,6 +106,7 @@ export interface PluginHooks {
105
106
  | undefined;
106
107
  routes?(ctx: RouteRegistrationHookContext): PluginRoute[];
107
108
  sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
109
+ workspacePrepare?(ctx: WorkspacePrepareHookContext): Promise<void> | void;
108
110
  slackConversationLink?(
109
111
  ctx: SlackConversationLinkHookContext,
110
112
  ): SlackConversationLink | undefined;
package/src/tools.ts CHANGED
@@ -140,6 +140,15 @@ export interface PluginMcp {
140
140
  prepare(): Promise<"authorization_pending" | "ready">;
141
141
  }
142
142
 
143
+ /** Provider-owned repository preparation for one Workspace snapshot build. */
144
+ export interface WorkspacePrepareHookContext extends PluginContext {
145
+ repos: Array<{
146
+ path: string;
147
+ repo: string;
148
+ }>;
149
+ sandbox: PluginSandbox;
150
+ }
151
+
143
152
  export interface SandboxPrepareHookContext extends PluginContext {
144
153
  actor?: Actor;
145
154
  sandbox: PluginSandbox;
@@ -511,6 +520,14 @@ export interface PluginResourceEventToolContext {
511
520
  canSubscribe: boolean;
512
521
  }
513
522
 
523
+ export interface PluginWorkspaceToolContext {
524
+ /** Find named Workspaces that include one provider repository. */
525
+ findByRepository(input: {
526
+ provider: string;
527
+ repo: string;
528
+ }): Promise<string[]>;
529
+ }
530
+
514
531
  interface BaseToolRegistrationHookContext extends PluginContext {
515
532
  /**
516
533
  * Opaque Junior conversation/session identity for this turn.
@@ -533,6 +550,7 @@ interface BaseToolRegistrationHookContext extends PluginContext {
533
550
  resolveActor(): Promise<{ identity: Identity; user?: User } | undefined>;
534
551
  };
535
552
  userText?: string;
553
+ workspaces: PluginWorkspaceToolContext;
536
554
  }
537
555
 
538
556
  interface SlackToolRegistrationContext