@sentry/junior-plugin-api 0.108.0 → 0.110.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/README.md +1 -1
- package/dist/hooks.d.ts +1 -2
- package/dist/operations.d.ts +21 -10
- package/package.json +1 -1
- package/src/hooks.ts +0 -8
- package/src/operations.ts +24 -12
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ safe.
|
|
|
30
30
|
## Hooks
|
|
31
31
|
|
|
32
32
|
Plugins may contribute tools, prompt messages, lifecycle work, operational
|
|
33
|
-
reports,
|
|
33
|
+
reports, and other typed hook surfaces exported by this package.
|
|
34
34
|
|
|
35
35
|
- Hook context carries the active source, actor, conversation, plugin metadata,
|
|
36
36
|
database, logging, and only the host capabilities required by that hook.
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EgressHookContext, EgressResponseHookContext, IssueCredentialHookContext, PluginCredentialResult, PluginGrant, PluginProviderAccount, ResolveOAuthAccountHookContext } from "./credentials";
|
|
2
|
-
import type { HeartbeatHookContext, HeartbeatResult, OperationalReportHookContext, ApiRouteRegistrationHookContext, PluginOperationalReportContent, PluginRoute, PluginRouteApp, RouteRegistrationHookContext, SlackConversationLink, SlackConversationLinkHookContext
|
|
2
|
+
import type { HeartbeatHookContext, HeartbeatResult, OperationalReportHookContext, ApiRouteRegistrationHookContext, PluginOperationalReportContent, PluginRoute, PluginRouteApp, RouteRegistrationHookContext, SlackConversationLink, SlackConversationLinkHookContext } from "./operations";
|
|
3
3
|
import type { BeforeToolExecuteHookContext, PluginToolDefinition, SandboxPrepareHookContext, ToolRegistrationHookContext } from "./tools";
|
|
4
4
|
import type { PromptMessage, SystemPromptContext, UserPromptContext } from "./prompt";
|
|
5
5
|
export interface PluginHooks {
|
|
@@ -18,5 +18,4 @@ export interface PluginHooks {
|
|
|
18
18
|
sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
|
|
19
19
|
slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
|
|
20
20
|
tools?(ctx: ToolRegistrationHookContext): Record<string, PluginToolDefinition>;
|
|
21
|
-
migrateStorage?(ctx: StorageMigrationContext): Promise<StorageMigrationResult | undefined> | StorageMigrationResult | undefined;
|
|
22
21
|
}
|
package/dist/operations.d.ts
CHANGED
|
@@ -14,16 +14,6 @@ export interface HeartbeatHookContext extends PluginContext {
|
|
|
14
14
|
export interface HeartbeatResult {
|
|
15
15
|
dispatchCount?: number;
|
|
16
16
|
}
|
|
17
|
-
export interface StorageMigrationResult {
|
|
18
|
-
existing: number;
|
|
19
|
-
migrated: number;
|
|
20
|
-
missing: number;
|
|
21
|
-
scanned: number;
|
|
22
|
-
skipped?: number;
|
|
23
|
-
}
|
|
24
|
-
export interface StorageMigrationContext extends PluginContext {
|
|
25
|
-
state: PluginState;
|
|
26
|
-
}
|
|
27
17
|
export type PluginOperationalTone = "danger" | "good" | "neutral" | "warning";
|
|
28
18
|
export interface PluginOperationalMetric {
|
|
29
19
|
label: string;
|
|
@@ -45,11 +35,32 @@ export interface PluginOperationalRecordSet {
|
|
|
45
35
|
records?: PluginOperationalRecord[];
|
|
46
36
|
title: string;
|
|
47
37
|
}
|
|
38
|
+
export interface PluginOperationalChartSeries {
|
|
39
|
+
key: string;
|
|
40
|
+
label: string;
|
|
41
|
+
tone?: PluginOperationalTone;
|
|
42
|
+
}
|
|
43
|
+
export interface PluginOperationalChartCategory {
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
values: Record<string, number>;
|
|
47
|
+
}
|
|
48
|
+
export interface PluginOperationalBarChartWidget {
|
|
49
|
+
categories: PluginOperationalChartCategory[];
|
|
50
|
+
description?: string;
|
|
51
|
+
emptyText?: string;
|
|
52
|
+
id: string;
|
|
53
|
+
series: PluginOperationalChartSeries[];
|
|
54
|
+
timeRangeDays?: Array<7 | 30 | 90>;
|
|
55
|
+
title: string;
|
|
56
|
+
type: "bar_chart";
|
|
57
|
+
}
|
|
48
58
|
export interface PluginOperationalReportContent {
|
|
49
59
|
generatedAt?: string;
|
|
50
60
|
metrics?: PluginOperationalMetric[];
|
|
51
61
|
recordSets?: PluginOperationalRecordSet[];
|
|
52
62
|
title?: string;
|
|
63
|
+
widgets?: PluginOperationalBarChartWidget[];
|
|
53
64
|
}
|
|
54
65
|
export interface PluginOperationalReport extends PluginOperationalReportContent {
|
|
55
66
|
pluginName: string;
|
package/package.json
CHANGED
package/src/hooks.ts
CHANGED
|
@@ -18,8 +18,6 @@ import type {
|
|
|
18
18
|
RouteRegistrationHookContext,
|
|
19
19
|
SlackConversationLink,
|
|
20
20
|
SlackConversationLinkHookContext,
|
|
21
|
-
StorageMigrationContext,
|
|
22
|
-
StorageMigrationResult,
|
|
23
21
|
} from "./operations";
|
|
24
22
|
import type {
|
|
25
23
|
BeforeToolExecuteHookContext,
|
|
@@ -73,10 +71,4 @@ export interface PluginHooks {
|
|
|
73
71
|
tools?(
|
|
74
72
|
ctx: ToolRegistrationHookContext,
|
|
75
73
|
): Record<string, PluginToolDefinition>;
|
|
76
|
-
migrateStorage?(
|
|
77
|
-
ctx: StorageMigrationContext,
|
|
78
|
-
):
|
|
79
|
-
| Promise<StorageMigrationResult | undefined>
|
|
80
|
-
| StorageMigrationResult
|
|
81
|
-
| undefined;
|
|
82
74
|
}
|
package/src/operations.ts
CHANGED
|
@@ -18,18 +18,6 @@ export interface HeartbeatResult {
|
|
|
18
18
|
dispatchCount?: number;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export interface StorageMigrationResult {
|
|
22
|
-
existing: number;
|
|
23
|
-
migrated: number;
|
|
24
|
-
missing: number;
|
|
25
|
-
scanned: number;
|
|
26
|
-
skipped?: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface StorageMigrationContext extends PluginContext {
|
|
30
|
-
state: PluginState;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
21
|
export type PluginOperationalTone = "danger" | "good" | "neutral" | "warning";
|
|
34
22
|
|
|
35
23
|
export interface PluginOperationalMetric {
|
|
@@ -56,11 +44,35 @@ export interface PluginOperationalRecordSet {
|
|
|
56
44
|
title: string;
|
|
57
45
|
}
|
|
58
46
|
|
|
47
|
+
export interface PluginOperationalChartSeries {
|
|
48
|
+
key: string;
|
|
49
|
+
label: string;
|
|
50
|
+
tone?: PluginOperationalTone;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface PluginOperationalChartCategory {
|
|
54
|
+
id: string;
|
|
55
|
+
label: string;
|
|
56
|
+
values: Record<string, number>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface PluginOperationalBarChartWidget {
|
|
60
|
+
categories: PluginOperationalChartCategory[];
|
|
61
|
+
description?: string;
|
|
62
|
+
emptyText?: string;
|
|
63
|
+
id: string;
|
|
64
|
+
series: PluginOperationalChartSeries[];
|
|
65
|
+
timeRangeDays?: Array<7 | 30 | 90>;
|
|
66
|
+
title: string;
|
|
67
|
+
type: "bar_chart";
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
export interface PluginOperationalReportContent {
|
|
60
71
|
generatedAt?: string;
|
|
61
72
|
metrics?: PluginOperationalMetric[];
|
|
62
73
|
recordSets?: PluginOperationalRecordSet[];
|
|
63
74
|
title?: string;
|
|
75
|
+
widgets?: PluginOperationalBarChartWidget[];
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export interface PluginOperationalReport extends PluginOperationalReportContent {
|