@sentry/junior-plugin-api 0.197.0 → 0.199.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 +2021 -19
- package/package.json +4 -5
- package/dist/annotations.d.ts +0 -75
- package/dist/cli.d.ts +0 -39
- package/dist/code.d.ts +0 -37
- package/dist/context.d.ts +0 -158
- package/dist/conversation-events.d.ts +0 -80
- package/dist/credentials.d.ts +0 -184
- package/dist/dispatch.d.ts +0 -16
- package/dist/egress-policy.d.ts +0 -9
- package/dist/hooks.d.ts +0 -43
- package/dist/manifest.d.ts +0 -76
- package/dist/operations.d.ts +0 -153
- package/dist/prompt.d.ts +0 -56
- package/dist/registration.d.ts +0 -28
- package/dist/resource-events.d.ts +0 -128
- package/dist/schemas.d.ts +0 -261
- package/dist/state.d.ts +0 -10
- package/dist/tasks.d.ts +0 -250
- package/dist/tools.d.ts +0 -351
- package/dist/user-pages.d.ts +0 -97
- package/src/annotations.ts +0 -78
- package/src/cli.ts +0 -54
- package/src/code.ts +0 -37
- package/src/context.ts +0 -241
- package/src/conversation-events.ts +0 -136
- package/src/credentials.ts +0 -221
- package/src/dispatch.ts +0 -31
- package/src/egress-policy.ts +0 -15
- package/src/hooks.ts +0 -118
- package/src/index.ts +0 -29
- package/src/manifest.ts +0 -89
- package/src/operations.ts +0 -199
- package/src/prompt.ts +0 -99
- package/src/registration.ts +0 -173
- package/src/resource-events.ts +0 -320
- package/src/schemas.ts +0 -348
- package/src/state.ts +0 -15
- package/src/tasks.ts +0 -105
- package/src/tools.ts +0 -579
- package/src/user-pages.ts +0 -130
package/dist/hooks.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ConversationSidebarHookContext, ConversationSidebarResult } from "./annotations";
|
|
2
|
-
import type { EgressHookContext, EgressResponseHookContext, IssueCredentialHookContext, PluginCredentialResult, PluginGrant, PluginProviderAccount, ResolveOAuthAccountHookContext } from "./credentials";
|
|
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, WorkspacePrepareHookContext } from "./tools";
|
|
5
|
-
import type { PromptMessage, SystemPromptContext, UserPromptContext, UserPromptContribution } from "./prompt";
|
|
6
|
-
/** Input for a pure Markdown rewrite before destination delivery formatting. */
|
|
7
|
-
export interface FormatMarkdownHookContext {
|
|
8
|
-
text: string;
|
|
9
|
-
}
|
|
10
|
-
export interface PluginHooks {
|
|
11
|
-
conversationSidebar?(ctx: ConversationSidebarHookContext): Promise<ConversationSidebarResult> | ConversationSidebarResult;
|
|
12
|
-
systemPrompt?(ctx: SystemPromptContext): Promise<PromptMessage[]> | PromptMessage[];
|
|
13
|
-
userPrompt?(ctx: UserPromptContext): Promise<UserPromptContribution[] | undefined> | UserPromptContribution[] | undefined;
|
|
14
|
-
beforeToolExecute?(ctx: BeforeToolExecuteHookContext): Promise<void> | void;
|
|
15
|
-
/**
|
|
16
|
-
* Run after a successful hosted MCP tool call.
|
|
17
|
-
*
|
|
18
|
-
* Prefer this for junior-owned side effects such as conversation annotations.
|
|
19
|
-
* Do not use it to invent a parallel tool contract for the provider tool.
|
|
20
|
-
*/
|
|
21
|
-
afterMcpTool?(ctx: AfterMcpToolHookContext): Promise<void> | void;
|
|
22
|
-
grantForEgress?(ctx: EgressHookContext): Promise<PluginGrant | undefined> | PluginGrant | undefined;
|
|
23
|
-
heartbeat?(ctx: HeartbeatHookContext): Promise<HeartbeatResult | void> | HeartbeatResult | void;
|
|
24
|
-
unfinishedWork?(ctx: UnfinishedWorkHookContext): Promise<UnfinishedWorkResult> | UnfinishedWorkResult;
|
|
25
|
-
issueCredential?(ctx: IssueCredentialHookContext): Promise<PluginCredentialResult> | PluginCredentialResult;
|
|
26
|
-
onEgressResponse?(ctx: EgressResponseHookContext): Promise<void> | void;
|
|
27
|
-
operationalReport?(ctx: OperationalReportHookContext): Promise<PluginOperationalReportContent | undefined> | PluginOperationalReportContent | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Return one person-scoped operational report for a profile page.
|
|
30
|
-
* Omit or return undefined when the plugin has nothing to show for the subject.
|
|
31
|
-
*/
|
|
32
|
-
profileReport?(ctx: ProfileReportHookContext): Promise<PluginOperationalReportContent | undefined> | PluginOperationalReportContent | undefined;
|
|
33
|
-
/** Return plugin-owned product API routes mounted under Junior's authenticated plugin namespace. */
|
|
34
|
-
apiRoutes?(ctx: ApiRouteRegistrationHookContext): PluginRouteApp | undefined;
|
|
35
|
-
resolveOAuthAccount?(ctx: ResolveOAuthAccountHookContext): Promise<PluginProviderAccount | undefined> | PluginProviderAccount | undefined;
|
|
36
|
-
routes?(ctx: RouteRegistrationHookContext): PluginRoute[];
|
|
37
|
-
sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
|
|
38
|
-
workspacePrepare?(ctx: WorkspacePrepareHookContext): Promise<void> | void;
|
|
39
|
-
slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
|
|
40
|
-
/** Pure Markdown rewrite. Emit ordinary Markdown only. */
|
|
41
|
-
formatMarkdown?(ctx: FormatMarkdownHookContext): string;
|
|
42
|
-
tools?(ctx: ToolRegistrationHookContext): Record<string, PluginToolDefinition>;
|
|
43
|
-
}
|
package/dist/manifest.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export interface PluginOAuthConfig {
|
|
2
|
-
authorizeEndpoint: string;
|
|
3
|
-
authorizeParams?: Record<string, string>;
|
|
4
|
-
clientIdEnv: string;
|
|
5
|
-
clientSecretEnv: string;
|
|
6
|
-
scope?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Treat a provider token response with `scope: ""` like an omitted scope and
|
|
9
|
-
* fall back to the requested scope string when storing the token.
|
|
10
|
-
*/
|
|
11
|
-
treatEmptyScopeAsUnreported?: boolean;
|
|
12
|
-
tokenAuthMethod?: "body" | "basic";
|
|
13
|
-
tokenEndpoint: string;
|
|
14
|
-
tokenExtraHeaders?: Record<string, string>;
|
|
15
|
-
}
|
|
16
|
-
export interface PluginOAuthBearerCredentials {
|
|
17
|
-
apiHeaders?: Record<string, string>;
|
|
18
|
-
authTokenEnv: string;
|
|
19
|
-
authTokenPlaceholder?: string;
|
|
20
|
-
domains: string[];
|
|
21
|
-
type: "oauth-bearer";
|
|
22
|
-
}
|
|
23
|
-
export type PluginCredentials = PluginOAuthBearerCredentials;
|
|
24
|
-
export interface PluginNpmRuntimeDependency {
|
|
25
|
-
package: string;
|
|
26
|
-
type: "npm";
|
|
27
|
-
version: string;
|
|
28
|
-
}
|
|
29
|
-
export interface PluginSystemRuntimeDependency {
|
|
30
|
-
package: string;
|
|
31
|
-
type: "system";
|
|
32
|
-
}
|
|
33
|
-
export interface PluginSystemRuntimeDependencyFromUrl {
|
|
34
|
-
sha256: string;
|
|
35
|
-
type: "system";
|
|
36
|
-
url: string;
|
|
37
|
-
}
|
|
38
|
-
export type PluginRuntimeDependency = PluginNpmRuntimeDependency | PluginSystemRuntimeDependency | PluginSystemRuntimeDependencyFromUrl;
|
|
39
|
-
export interface PluginRuntimePostinstallCommand {
|
|
40
|
-
args?: string[];
|
|
41
|
-
cmd: string;
|
|
42
|
-
sudo?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface PluginMcpConfig {
|
|
45
|
-
/** Provider tools exposed directly to the model. */
|
|
46
|
-
allowedTools?: string[];
|
|
47
|
-
headers?: Record<string, string>;
|
|
48
|
-
transport: "http";
|
|
49
|
-
url: string;
|
|
50
|
-
/** Provider tools hidden from the model and callable only by plugin-owned wrapper tools. */
|
|
51
|
-
wrappedTools?: string[];
|
|
52
|
-
}
|
|
53
|
-
export interface PluginEnvVarDeclaration {
|
|
54
|
-
default?: string;
|
|
55
|
-
exposeToCommandEnv?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface PluginManifest {
|
|
58
|
-
apiHeaders?: Record<string, string>;
|
|
59
|
-
commandEnv?: Record<string, string>;
|
|
60
|
-
configKeys?: string[];
|
|
61
|
-
credentials?: PluginCredentials;
|
|
62
|
-
description: string;
|
|
63
|
-
displayName: string;
|
|
64
|
-
domains?: string[];
|
|
65
|
-
envVars?: Record<string, PluginEnvVarDeclaration>;
|
|
66
|
-
mcp?: PluginMcpConfig;
|
|
67
|
-
name: string;
|
|
68
|
-
oauth?: PluginOAuthConfig;
|
|
69
|
-
runtimeDependencies?: PluginRuntimeDependency[];
|
|
70
|
-
runtimePostinstall?: PluginRuntimePostinstallCommand[];
|
|
71
|
-
target?: {
|
|
72
|
-
commandFlags?: string[];
|
|
73
|
-
configKey: string;
|
|
74
|
-
type: string;
|
|
75
|
-
};
|
|
76
|
-
}
|
package/dist/operations.d.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { PluginContext, User } from "./context";
|
|
3
|
-
import type { Dispatch, DispatchOptions, DispatchResult } from "./dispatch";
|
|
4
|
-
import type { PluginReadState, PluginState } from "./state";
|
|
5
|
-
import type { ResourceEventPublisher } from "./resource-events";
|
|
6
|
-
import type { PluginConversationAnnotations } from "./annotations";
|
|
7
|
-
import type { PluginConversationEventStats } from "./conversation-events";
|
|
8
|
-
import type { CodeChangePublisher } from "./code";
|
|
9
|
-
export interface HeartbeatHookContext extends PluginContext {
|
|
10
|
-
agent: {
|
|
11
|
-
dispatch(options: DispatchOptions): Promise<DispatchResult>;
|
|
12
|
-
get(id: string): Promise<Dispatch | undefined>;
|
|
13
|
-
};
|
|
14
|
-
nowMs: number;
|
|
15
|
-
state: PluginState;
|
|
16
|
-
}
|
|
17
|
-
export interface HeartbeatResult {
|
|
18
|
-
dispatchCount?: number;
|
|
19
|
-
}
|
|
20
|
-
export interface UnfinishedWorkHookContext extends PluginContext {
|
|
21
|
-
/** Bounded conversation candidates selected by the host. */
|
|
22
|
-
conversationIds: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface UnfinishedWorkResult {
|
|
25
|
-
/** Candidate conversations that have plugin-owned work to finish. */
|
|
26
|
-
conversationIds: string[];
|
|
27
|
-
/**
|
|
28
|
-
* Candidate conversations that have any associated plugin-owned work,
|
|
29
|
-
* finished or unfinished. Omit when the plugin cannot distinguish assignment.
|
|
30
|
-
*
|
|
31
|
-
* The host uses this with unfinished work and finish times to set feed
|
|
32
|
-
* `isPriority`. Finished assigned work stays out of Priority unless the
|
|
33
|
-
* conversation has activity after the finish time.
|
|
34
|
-
*/
|
|
35
|
-
assignedConversationIds?: string[];
|
|
36
|
-
/**
|
|
37
|
-
* Latest time when all known work finished, keyed by conversation id.
|
|
38
|
-
* ISO-8601 timestamps. Used with conversation activity to decide whether
|
|
39
|
-
* finished work still belongs in Priority.
|
|
40
|
-
*/
|
|
41
|
-
finishedWorkAtByConversationId?: Record<string, string>;
|
|
42
|
-
}
|
|
43
|
-
export type PluginOperationalTone = "danger" | "good" | "neutral" | "warning";
|
|
44
|
-
export interface PluginOperationalMetric {
|
|
45
|
-
label: string;
|
|
46
|
-
tone?: PluginOperationalTone;
|
|
47
|
-
value: string;
|
|
48
|
-
}
|
|
49
|
-
export interface PluginOperationalField {
|
|
50
|
-
key: string;
|
|
51
|
-
label: string;
|
|
52
|
-
}
|
|
53
|
-
export interface PluginOperationalRecord {
|
|
54
|
-
id: string;
|
|
55
|
-
tone?: PluginOperationalTone;
|
|
56
|
-
values: Record<string, string>;
|
|
57
|
-
}
|
|
58
|
-
export interface PluginOperationalRecordSet {
|
|
59
|
-
fields?: PluginOperationalField[];
|
|
60
|
-
emptyText?: string;
|
|
61
|
-
records?: PluginOperationalRecord[];
|
|
62
|
-
title: string;
|
|
63
|
-
}
|
|
64
|
-
export interface PluginOperationalChartSeries {
|
|
65
|
-
format?: "usd";
|
|
66
|
-
key: string;
|
|
67
|
-
label: string;
|
|
68
|
-
tone?: PluginOperationalTone;
|
|
69
|
-
}
|
|
70
|
-
export interface PluginOperationalChartCategory {
|
|
71
|
-
id: string;
|
|
72
|
-
label: string;
|
|
73
|
-
values: Record<string, number>;
|
|
74
|
-
}
|
|
75
|
-
export interface PluginOperationalBarChartWidget {
|
|
76
|
-
categories: PluginOperationalChartCategory[];
|
|
77
|
-
description?: string;
|
|
78
|
-
emptyText?: string;
|
|
79
|
-
id: string;
|
|
80
|
-
series: PluginOperationalChartSeries[];
|
|
81
|
-
timeRangeDays?: Array<1 | 7 | 30 | 90>;
|
|
82
|
-
title: string;
|
|
83
|
-
type: "bar_chart";
|
|
84
|
-
}
|
|
85
|
-
export interface PluginOperationalReportContent {
|
|
86
|
-
generatedAt?: string;
|
|
87
|
-
metrics?: PluginOperationalMetric[];
|
|
88
|
-
recordSets?: PluginOperationalRecordSet[];
|
|
89
|
-
title?: string;
|
|
90
|
-
widgets?: PluginOperationalBarChartWidget[];
|
|
91
|
-
}
|
|
92
|
-
export interface PluginOperationalReport extends PluginOperationalReportContent {
|
|
93
|
-
pluginName: string;
|
|
94
|
-
}
|
|
95
|
-
export interface OperationalReportHookContext extends PluginContext {
|
|
96
|
-
eventStats: PluginConversationEventStats;
|
|
97
|
-
nowMs: number;
|
|
98
|
-
state: PluginReadState;
|
|
99
|
-
}
|
|
100
|
-
/** Read-only context for one person-scoped plugin report on a profile page. */
|
|
101
|
-
export interface ProfileReportHookContext extends PluginContext {
|
|
102
|
-
nowMs: number;
|
|
103
|
-
state: PluginReadState;
|
|
104
|
-
/** Canonical user for the profile being viewed. */
|
|
105
|
-
subject: User;
|
|
106
|
-
/** Canonical user for the authenticated viewer. */
|
|
107
|
-
viewer: User;
|
|
108
|
-
}
|
|
109
|
-
export type PluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "ALL";
|
|
110
|
-
export type PluginRouteHandler = {
|
|
111
|
-
bivarianceHack(request: Request): Promise<Response> | Response;
|
|
112
|
-
}["bivarianceHack"];
|
|
113
|
-
export interface PluginRoute {
|
|
114
|
-
handler: PluginRouteHandler;
|
|
115
|
-
method?: PluginRouteMethod | PluginRouteMethod[];
|
|
116
|
-
path: string;
|
|
117
|
-
}
|
|
118
|
-
/** Fetch-compatible plugin HTTP app mounted by Junior. */
|
|
119
|
-
export type PluginRouteApp = {
|
|
120
|
-
fetch(request: Request, context?: PluginApiRouteRequestContext): Promise<Response> | Response;
|
|
121
|
-
};
|
|
122
|
-
export interface RouteRegistrationHookContext extends PluginContext {
|
|
123
|
-
annotations: PluginConversationAnnotations;
|
|
124
|
-
/** Provider-neutral write boundary for Junior's native code index. */
|
|
125
|
-
codeChanges: CodeChangePublisher;
|
|
126
|
-
/** Core-owned delivery boundary for provider webhook events. */
|
|
127
|
-
resourceEvents: ResourceEventPublisher;
|
|
128
|
-
}
|
|
129
|
-
export interface ApiRouteRegistrationHookContext extends PluginContext {
|
|
130
|
-
eventStats: PluginConversationEventStats;
|
|
131
|
-
users: {
|
|
132
|
-
/** Resolve or create the canonical user for one verified email. */
|
|
133
|
-
resolve(email: string): Promise<User | undefined>;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/** Per-request context Junior passes to authenticated plugin product API routes. */
|
|
137
|
-
export declare const pluginApiRouteRequestContextSchema: z.ZodObject<{
|
|
138
|
-
auth: z.ZodObject<{
|
|
139
|
-
user: z.ZodObject<{
|
|
140
|
-
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
-
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
-
}, z.core.$strict>;
|
|
144
|
-
}, z.core.$strict>;
|
|
145
|
-
pluginName: z.ZodString;
|
|
146
|
-
}, z.core.$strict>;
|
|
147
|
-
export type PluginApiRouteRequestContext = z.output<typeof pluginApiRouteRequestContextSchema>;
|
|
148
|
-
export interface SlackConversationLink {
|
|
149
|
-
url: string;
|
|
150
|
-
}
|
|
151
|
-
export interface SlackConversationLinkHookContext extends PluginContext {
|
|
152
|
-
conversationId: string;
|
|
153
|
-
}
|
package/dist/prompt.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { Destination, Platform, PluginContext, PluginEmbedder, PluginModel, Actor, Identity, Source, User } from "./context";
|
|
3
|
-
import type { PluginState } from "./state";
|
|
4
|
-
import type { PluginConversationEvents } from "./conversation-events";
|
|
5
|
-
export declare const promptMessageSchema: z.ZodObject<{
|
|
6
|
-
text: z.ZodString;
|
|
7
|
-
}, z.core.$strict>;
|
|
8
|
-
/** Small plugin-owned prompt text block rendered by Junior core. */
|
|
9
|
-
export type PromptMessage = z.output<typeof promptMessageSchema>;
|
|
10
|
-
export declare const promptContextSchema: z.ZodObject<{
|
|
11
|
-
kind: z.ZodString;
|
|
12
|
-
version: z.ZodNumber;
|
|
13
|
-
content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
14
|
-
}, z.core.$strict>;
|
|
15
|
-
/** Structured plugin context retained alongside its model-visible rendering. */
|
|
16
|
-
export type PromptContext = z.output<typeof promptContextSchema>;
|
|
17
|
-
/** Runtime contribution produced from one validated plugin context value. */
|
|
18
|
-
export interface PromptContextContribution {
|
|
19
|
-
context: PromptContext;
|
|
20
|
-
renderPrompt(): string;
|
|
21
|
-
}
|
|
22
|
-
/** Define one typed, versioned plugin context contribution. */
|
|
23
|
-
export declare function definePromptContext<TSchema extends z.ZodType<Record<string, unknown>>>(definition: {
|
|
24
|
-
kind: string;
|
|
25
|
-
version: number;
|
|
26
|
-
schema: TSchema;
|
|
27
|
-
renderPrompt(content: z.output<TSchema>): string;
|
|
28
|
-
}): (content: z.input<TSchema>) => PromptContextContribution;
|
|
29
|
-
/** One request-scoped plugin contribution to the model-visible user prompt. */
|
|
30
|
-
export type UserPromptContribution = PromptMessage | PromptContextContribution;
|
|
31
|
-
/** Stable platform context for plugin system prompt guidance. */
|
|
32
|
-
export type SystemPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
|
|
33
|
-
platform: Platform;
|
|
34
|
-
};
|
|
35
|
-
/** Runtime facts available while building plugin user prompt context. */
|
|
36
|
-
export type UserPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
|
|
37
|
-
conversationId?: string;
|
|
38
|
-
destination: Destination;
|
|
39
|
-
embedder: PluginEmbedder;
|
|
40
|
-
/** Conversation-bound event writer when the prompt belongs to a durable turn. */
|
|
41
|
-
events?: PluginConversationEvents;
|
|
42
|
-
model: PluginModel;
|
|
43
|
-
/** Location associated with this Conversation. */
|
|
44
|
-
locationId?: string;
|
|
45
|
-
actor?: Actor;
|
|
46
|
-
source: Source;
|
|
47
|
-
state: PluginState;
|
|
48
|
-
text: string;
|
|
49
|
-
users: {
|
|
50
|
-
/** Resolve the current Actor's Identity and User. */
|
|
51
|
-
resolveActor(): Promise<{
|
|
52
|
-
identity: Identity;
|
|
53
|
-
user?: User;
|
|
54
|
-
} | undefined>;
|
|
55
|
-
};
|
|
56
|
-
};
|
package/dist/registration.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { PluginCliDefinition } from "./cli";
|
|
2
|
-
import type { PluginConversationEventDefinition } from "./conversation-events";
|
|
3
|
-
import type { PluginHooks } from "./hooks";
|
|
4
|
-
import type { PluginManifest } from "./manifest";
|
|
5
|
-
import type { PluginTasks } from "./tasks";
|
|
6
|
-
import type { PluginUserPageDefinition } from "./user-pages";
|
|
7
|
-
import { type PluginResourceEvents } from "./resource-events";
|
|
8
|
-
export interface PluginModelConfig {
|
|
9
|
-
/** Host model family used when no explicit structured model id is configured. */
|
|
10
|
-
structuredModel?: "default" | "fast";
|
|
11
|
-
/** Host model id used for this plugin's structured model calls. */
|
|
12
|
-
structuredModelId?: string;
|
|
13
|
-
}
|
|
14
|
-
export type PluginRegistrationInput = {
|
|
15
|
-
cli?: PluginCliDefinition;
|
|
16
|
-
conversationEvents?: PluginConversationEventDefinition[];
|
|
17
|
-
hooks?: PluginHooks;
|
|
18
|
-
manifest: PluginManifest;
|
|
19
|
-
model?: PluginModelConfig;
|
|
20
|
-
packageName?: string;
|
|
21
|
-
resourceEvents?: PluginResourceEvents;
|
|
22
|
-
tasks?: PluginTasks;
|
|
23
|
-
userPages?: PluginUserPageDefinition[];
|
|
24
|
-
};
|
|
25
|
-
export interface PluginRegistration extends PluginRegistrationInput {
|
|
26
|
-
}
|
|
27
|
-
/** Define one Junior plugin registration for app and build-time wiring. */
|
|
28
|
-
export declare function defineJuniorPlugin(plugin: PluginRegistrationInput): PluginRegistration;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const RESOURCE_EVENT_SUMMARY_MAX_LENGTH = 4000;
|
|
3
|
-
export declare const RESOURCE_EVENT_TEXT_MAX_LENGTH = 8000;
|
|
4
|
-
export declare const RESOURCE_EVENT_DATA_MAX_KEYS = 32;
|
|
5
|
-
export declare const RESOURCE_EVENT_DATA_MAX_JSON_BYTES = 4000;
|
|
6
|
-
export declare const RESOURCE_EVENT_GUIDANCE_MAX_LENGTH = 1000;
|
|
7
|
-
/** Small trusted data from the plugin. The agent should not look these up again. */
|
|
8
|
-
export declare const resourceEventDataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
9
|
-
/** Canonical dotted event type published and selected across plugins. */
|
|
10
|
-
export declare const resourceEventTypeSchema: z.ZodString;
|
|
11
|
-
export declare const resourceTypeSchema: z.ZodString;
|
|
12
|
-
/** One exact value a watch or event task may require on trusted event data. */
|
|
13
|
-
export declare const resourceEventMatchFieldSchema: z.ZodObject<{
|
|
14
|
-
kind: z.ZodEnum<{
|
|
15
|
-
string: "string";
|
|
16
|
-
number: "number";
|
|
17
|
-
boolean: "boolean";
|
|
18
|
-
}>;
|
|
19
|
-
description: z.ZodString;
|
|
20
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
-
}, z.core.$strict>;
|
|
22
|
-
export declare const resourceEventMatchFieldsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
23
|
-
kind: z.ZodEnum<{
|
|
24
|
-
string: "string";
|
|
25
|
-
number: "number";
|
|
26
|
-
boolean: "boolean";
|
|
27
|
-
}>;
|
|
28
|
-
description: z.ZodString;
|
|
29
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
-
}, z.core.$strict>>;
|
|
31
|
-
/** Exact trusted values required before a watch or event task runs. */
|
|
32
|
-
export declare const resourceEventMatchSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>]>>;
|
|
33
|
-
export type ResourceEventMatch = z.output<typeof resourceEventMatchSchema>;
|
|
34
|
-
export type ResourceEventMatchFields = z.output<typeof resourceEventMatchFieldsSchema>;
|
|
35
|
-
/** Stable JSON for one match object. List order does not matter. */
|
|
36
|
-
export declare function stableResourceEventMatchKey(match: ResourceEventMatch | undefined): string;
|
|
37
|
-
/** Return whether trusted event data matches one exact match object. */
|
|
38
|
-
export declare function resourceEventMatches(match: ResourceEventMatch | undefined, data: ResourceEventData | undefined): boolean;
|
|
39
|
-
export declare const pluginResourceEventTypeSchema: z.ZodObject<{
|
|
40
|
-
type: z.ZodString;
|
|
41
|
-
supportedEvents: z.ZodArray<z.ZodString>;
|
|
42
|
-
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
-
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
44
|
-
kind: z.ZodEnum<{
|
|
45
|
-
string: "string";
|
|
46
|
-
number: "number";
|
|
47
|
-
boolean: "boolean";
|
|
48
|
-
}>;
|
|
49
|
-
description: z.ZodString;
|
|
50
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
-
}, z.core.$strict>>>;
|
|
52
|
-
guidance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
53
|
-
}, z.core.$strict>;
|
|
54
|
-
export declare const pluginResourceEventsSchema: z.ZodObject<{
|
|
55
|
-
resourceTypes: z.ZodArray<z.ZodObject<{
|
|
56
|
-
type: z.ZodString;
|
|
57
|
-
supportedEvents: z.ZodArray<z.ZodString>;
|
|
58
|
-
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
-
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
60
|
-
kind: z.ZodEnum<{
|
|
61
|
-
string: "string";
|
|
62
|
-
number: "number";
|
|
63
|
-
boolean: "boolean";
|
|
64
|
-
}>;
|
|
65
|
-
description: z.ZodString;
|
|
66
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
-
}, z.core.$strict>>>;
|
|
68
|
-
guidance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
69
|
-
}, z.core.$strict>>;
|
|
70
|
-
isEnabled: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodBoolean>>;
|
|
71
|
-
normalizeIdentifier: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodString>>;
|
|
72
|
-
}, z.core.$strict>;
|
|
73
|
-
export type PluginResourceEventType = z.output<typeof pluginResourceEventTypeSchema>;
|
|
74
|
-
export type PluginResourceEvents = z.output<typeof pluginResourceEventsSchema>;
|
|
75
|
-
/** Apply a plugin's identifier convention at resource-event boundaries. */
|
|
76
|
-
export declare function normalizeResourceEventIdentifier(registration: Pick<PluginResourceEvents, "normalizeIdentifier"> | undefined, identifier: string): string;
|
|
77
|
-
export declare const subscribableResourceSchema: z.ZodObject<{
|
|
78
|
-
identifier: z.ZodString;
|
|
79
|
-
label: z.ZodString;
|
|
80
|
-
namespace: z.ZodString;
|
|
81
|
-
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
supportedEvents: z.ZodArray<z.ZodString>;
|
|
83
|
-
type: z.ZodString;
|
|
84
|
-
}, z.core.$strict>;
|
|
85
|
-
export type SubscribableResource = z.output<typeof subscribableResourceSchema>;
|
|
86
|
-
/** Result returned after a temporary resource subscription is created. */
|
|
87
|
-
export declare const resourceEventSubscriptionResultSchema: z.ZodObject<{
|
|
88
|
-
events: z.ZodArray<z.ZodString>;
|
|
89
|
-
id: z.ZodString;
|
|
90
|
-
}, z.core.$strict>;
|
|
91
|
-
export type ResourceEventSubscriptionResult = z.output<typeof resourceEventSubscriptionResultSchema>;
|
|
92
|
-
export declare const resourceEventInputSchema: z.ZodObject<{
|
|
93
|
-
eventKey: z.ZodString;
|
|
94
|
-
eventType: z.ZodString;
|
|
95
|
-
identifier: z.ZodString;
|
|
96
|
-
occurredAtMs: z.ZodNumber;
|
|
97
|
-
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
-
trustedSummary: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
99
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
|
-
untrustedText: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
101
|
-
}, z.core.$strict>;
|
|
102
|
-
export type ResourceEventData = z.output<typeof resourceEventDataSchema>;
|
|
103
|
-
export type ResourceEventInput = z.output<typeof resourceEventInputSchema>;
|
|
104
|
-
export declare const resourceEventSchema: z.ZodObject<{
|
|
105
|
-
eventKey: z.ZodString;
|
|
106
|
-
eventType: z.ZodString;
|
|
107
|
-
identifier: z.ZodString;
|
|
108
|
-
occurredAtMs: z.ZodNumber;
|
|
109
|
-
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
-
trustedSummary: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
111
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
112
|
-
untrustedText: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
113
|
-
namespace: z.ZodString;
|
|
114
|
-
}, z.core.$strict>;
|
|
115
|
-
export type ResourceEvent = z.output<typeof resourceEventSchema>;
|
|
116
|
-
export interface ResourceEventPublisher {
|
|
117
|
-
/** Publish one normalized event under the owning plugin's namespace. */
|
|
118
|
-
publish(event: ResourceEventInput): Promise<void>;
|
|
119
|
-
/**
|
|
120
|
-
* Return match keys used by active watches or event tasks for these
|
|
121
|
-
* identifiers and event types. Plugins use this to load optional trusted
|
|
122
|
-
* data only when a filter needs it.
|
|
123
|
-
*/
|
|
124
|
-
neededMatchKeys?(input: {
|
|
125
|
-
eventTypes: string[];
|
|
126
|
-
identifiers: string[];
|
|
127
|
-
}): Promise<string[]>;
|
|
128
|
-
}
|