@sentry/junior-plugin-api 0.314.0 → 0.316.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 +695 -474
- package/dist/index.js +42 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,13 +34,17 @@ const objectFactsSchema = z.discriminatedUnion("type", [
|
|
|
34
34
|
"approved",
|
|
35
35
|
"changes_requested"
|
|
36
36
|
]).optional(),
|
|
37
|
-
checks
|
|
37
|
+
/** `pending` while the provider counts the checks of a new head. */
|
|
38
|
+
checks: z.union([z.strictObject({
|
|
38
39
|
passed: count,
|
|
39
40
|
failed: count,
|
|
40
41
|
pending: count
|
|
41
|
-
}).optional(),
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
}), z.literal("pending")]).optional(),
|
|
43
|
+
/**
|
|
44
|
+
* False while an open change conflicts with its target branch.
|
|
45
|
+
* `pending` while the provider computes it for a new head.
|
|
46
|
+
*/
|
|
47
|
+
mergeable: z.union([z.boolean(), z.literal("pending")]).optional(),
|
|
44
48
|
changedFiles: count.optional(),
|
|
45
49
|
additions: count.optional(),
|
|
46
50
|
deletions: count.optional(),
|
|
@@ -910,9 +914,7 @@ const conversationSidebarAnnotationSchema = z.object({
|
|
|
910
914
|
label: z.string().trim().min(1).max(256),
|
|
911
915
|
title: z.string().trim().min(1).max(512).optional(),
|
|
912
916
|
url: httpUrlSchema.optional(),
|
|
913
|
-
imageUrl: httpUrlSchema.optional()
|
|
914
|
-
/** A code change's size, so a card can show it without a live read. */
|
|
915
|
-
size: codeChangeSizeSchema.optional()
|
|
917
|
+
imageUrl: httpUrlSchema.optional()
|
|
916
918
|
}).strict();
|
|
917
919
|
// src/code.ts
|
|
918
920
|
const codeChangeStateSchema = z.enum([
|
|
@@ -923,11 +925,6 @@ const codeChangeStateSchema = z.enum([
|
|
|
923
925
|
const codeChangeInputSchema = z.object({
|
|
924
926
|
closedAt: z.date().optional(),
|
|
925
927
|
conversationIds: z.array(z.string().min(1)).default([]),
|
|
926
|
-
/**
|
|
927
|
-
* Whether the code change is a draft. When omitted, Junior keeps the
|
|
928
|
-
* stored value; a new code change is not a draft.
|
|
929
|
-
*/
|
|
930
|
-
draft: z.boolean().optional(),
|
|
931
928
|
mergedAt: z.date().optional(),
|
|
932
929
|
number: z.number().int().positive(),
|
|
933
930
|
openedAt: z.date(),
|
|
@@ -936,15 +933,28 @@ const codeChangeInputSchema = z.object({
|
|
|
936
933
|
name: z.string().min(1),
|
|
937
934
|
providerId: z.string().min(1)
|
|
938
935
|
}).strict(),
|
|
939
|
-
/**
|
|
940
|
-
* The size as the provider counts it now. Junior keeps the stored value
|
|
941
|
-
* of each part that is omitted.
|
|
942
|
-
*/
|
|
943
|
-
size: codeChangeSizeSchema.optional(),
|
|
944
936
|
state: codeChangeStateSchema,
|
|
945
937
|
title: z.string().min(1).optional(),
|
|
946
938
|
updatedAt: z.date()
|
|
947
939
|
}).strict();
|
|
940
|
+
const codeRepositoryInputSchema = z.object({
|
|
941
|
+
name: z.string().min(1),
|
|
942
|
+
providerId: z.string().min(1),
|
|
943
|
+
/** When the provider had this name. */
|
|
944
|
+
updatedAt: z.date()
|
|
945
|
+
}).strict();
|
|
946
|
+
const codeChangeFilterSchema = z.object({
|
|
947
|
+
/** Code changes linked to any of these Conversations. */
|
|
948
|
+
conversationIds: z.array(z.string().min(1)).min(1).optional(),
|
|
949
|
+
repository: z.object({
|
|
950
|
+
/** The repository name. Junior matches it in any case. */
|
|
951
|
+
name: z.string().min(1),
|
|
952
|
+
numbers: z.array(z.number().int().positive()).min(1).optional()
|
|
953
|
+
}).strict().optional(),
|
|
954
|
+
state: codeChangeStateSchema.optional(),
|
|
955
|
+
/** Code changes whose last update is before this time. */
|
|
956
|
+
updatedBefore: z.date().optional()
|
|
957
|
+
}).strict();
|
|
948
958
|
// src/conversation-changes.ts
|
|
949
959
|
/** Most entries in one batch, annotations and Inbox items together. */
|
|
950
960
|
const MAX_CONVERSATION_CHANGES = 100;
|
|
@@ -2299,6 +2309,20 @@ const pluginRunContextSchema = z.object({
|
|
|
2299
2309
|
source: sourceSchema,
|
|
2300
2310
|
transcript: z.array(pluginRunTranscriptEntrySchema)
|
|
2301
2311
|
}).strict();
|
|
2312
|
+
/** Input of `tasks.start`. */
|
|
2313
|
+
const pluginTaskStartInputSchema = z.object({
|
|
2314
|
+
/**
|
|
2315
|
+
* One task per plugin and key while the queue keeps the message. A
|
|
2316
|
+
* second start with the key in that time does nothing.
|
|
2317
|
+
*/
|
|
2318
|
+
key: nonBlankStringSchema.max(500),
|
|
2319
|
+
/** Name of a task with a `payload` schema in this plugin's `tasks`. */
|
|
2320
|
+
name: nonBlankStringSchema,
|
|
2321
|
+
/** Seconds before the first attempt. Without it, the task runs soon. */
|
|
2322
|
+
delaySeconds: z.number().int().positive().optional(),
|
|
2323
|
+
/** JSON value that the task's `payload` schema accepts. */
|
|
2324
|
+
payload: z.unknown()
|
|
2325
|
+
}).strict();
|
|
2302
2326
|
// src/tools.ts
|
|
2303
2327
|
/** Thrown when a plugin tool rejects invalid model or user input. */
|
|
2304
2328
|
var PluginToolInputError = class extends Error {
|
|
@@ -2875,4 +2899,4 @@ const pluginUserPageInputSchema = z.object({
|
|
|
2875
2899
|
limit: z.number().int().min(1).max(50),
|
|
2876
2900
|
query: pluginUserPageQuerySchema
|
|
2877
2901
|
}).strict();
|
|
2878
|
-
export { EVENT_DATA_MAX_JSON_BYTES, EVENT_DATA_MAX_KEYS, EVENT_GUIDANCE_MAX_LENGTH, EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, EgressAuthRequired, EgressPolicyDenied, MAX_CONVERSATION_CHANGES, OBJECT_FACTS_MAX_BYTES, OBJECT_SUMMARY_MAX_LENGTH, PluginToolInputError, REQUIRED_TOOL_ANNOTATION_KEYS, actorSchema, actorUserIdSchema, agentEventKeys, agentEventMatchKey, agentEventMatchSchema, anyResourceEvents, anyResourceMatchFields, codeChangeInputSchema, codeChangeSizeSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventIconSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, conversationSidebarIconSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, declaredEventKeys, decodeObjectImageRef, defineConversationEvent, defineJuniorPlugin, definePluginTool, definePromptContext, describeEventTrigger, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, encodeObjectImageRef, enforceEgressPolicy, escapeClosingTag, escapeClosingTags, escapeTagText, escapeTagTextAndQuotes, eventAuthorSchema, eventAutomationSourceSchema, eventDataSchema, eventIdentifierSchema, eventInputSchema, eventMatchFieldSchema, eventMatchFieldsSchema, eventMatchFilterText, eventMatchSchema, eventMatches, eventPersonSchema, eventReachSchema, eventSchema, eventSourceSchema, eventTriggerChoices, eventTriggerFiltersText, eventTriggerProblems, eventTriggerText, eventTypeSchema, eventTypeText, eventsWithoutMatchField, findTag, findTags, formatDuration, getSourceKey, identityDispatchOptionsSchema, identitySchema, indentTagLines, isPluginModelCostEventName, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, markdownNodes, markdownPlainText, markdownText, mentionsTag, mergeEventMatchFields, missingToolAnnotationKeys, nonBlankStringSchema, normalizeEventIdentifier, normalizeEventMatch, objectAnnotationSchema, objectFactFields, objectFactsBytes, objectFactsMatchType, objectFactsSchema, objectIconPath, objectIconPaths, objectLinkFilterMatches, objectLinkFilterSchema, objectLinkFilterSpecificity, objectPresentation, objectSummary, objectTypeSchema, openingTag, ownedObjectAnnotationSchema, parentMessageSourceSchema, parseMarkdown, parseShellCommands, platformSchema, pluginApiRouteRequestContextSchema, pluginAuditAttributesSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialLeaseSchema, pluginCredentialResultSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, pluginEventDeclarationSchema, pluginEventTypeSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginRunContextSchema, pluginRunTranscriptEntrySchema, pluginRunTranscriptProvenanceSchema, pluginStoredTokensSchema, pluginToolContentSchema, pluginToolContinuationSchema, pluginToolOutputSchema, pluginToolReplySchema, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageInputSchema, pluginUserPageLinkSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema, promptContextSchema, promptMessageSchema, readTag, renderEmptyTag, renderInlineTag, renderTag, replyAttributionSchema, resourceLinkAnnotationSchema, resourceTypeSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, stableEventMatchKey, startsWithTag, stripTags, subscribableResourceSchema, systemActorSchema, tagJson, taskOutcomeSchema, toolApprovalModeSchema, unescapeClosingTag, unescapeClosingTags, unescapeTagText, userSchema, watchResultSchema, webActorSchema, webSourceSchema, withToolContext, zodTool };
|
|
2902
|
+
export { EVENT_DATA_MAX_JSON_BYTES, EVENT_DATA_MAX_KEYS, EVENT_GUIDANCE_MAX_LENGTH, EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, EgressAuthRequired, EgressPolicyDenied, MAX_CONVERSATION_CHANGES, OBJECT_FACTS_MAX_BYTES, OBJECT_SUMMARY_MAX_LENGTH, PluginToolInputError, REQUIRED_TOOL_ANNOTATION_KEYS, actorSchema, actorUserIdSchema, agentEventKeys, agentEventMatchKey, agentEventMatchSchema, anyResourceEvents, anyResourceMatchFields, codeChangeFilterSchema, codeChangeInputSchema, codeChangeSizeSchema, codeChangeStateSchema, codeRepositoryInputSchema, conversationAnnotationInputSchema, conversationEventIconSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, conversationSidebarIconSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, declaredEventKeys, decodeObjectImageRef, defineConversationEvent, defineJuniorPlugin, definePluginTool, definePromptContext, describeEventTrigger, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, encodeObjectImageRef, enforceEgressPolicy, escapeClosingTag, escapeClosingTags, escapeTagText, escapeTagTextAndQuotes, eventAuthorSchema, eventAutomationSourceSchema, eventDataSchema, eventIdentifierSchema, eventInputSchema, eventMatchFieldSchema, eventMatchFieldsSchema, eventMatchFilterText, eventMatchSchema, eventMatches, eventPersonSchema, eventReachSchema, eventSchema, eventSourceSchema, eventTriggerChoices, eventTriggerFiltersText, eventTriggerProblems, eventTriggerText, eventTypeSchema, eventTypeText, eventsWithoutMatchField, findTag, findTags, formatDuration, getSourceKey, identityDispatchOptionsSchema, identitySchema, indentTagLines, isPluginModelCostEventName, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, markdownNodes, markdownPlainText, markdownText, mentionsTag, mergeEventMatchFields, missingToolAnnotationKeys, nonBlankStringSchema, normalizeEventIdentifier, normalizeEventMatch, objectAnnotationSchema, objectFactFields, objectFactsBytes, objectFactsMatchType, objectFactsSchema, objectIconPath, objectIconPaths, objectLinkFilterMatches, objectLinkFilterSchema, objectLinkFilterSpecificity, objectPresentation, objectSummary, objectTypeSchema, openingTag, ownedObjectAnnotationSchema, parentMessageSourceSchema, parseMarkdown, parseShellCommands, platformSchema, pluginApiRouteRequestContextSchema, pluginAuditAttributesSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialLeaseSchema, pluginCredentialResultSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, pluginEventDeclarationSchema, pluginEventTypeSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginRunContextSchema, pluginRunTranscriptEntrySchema, pluginRunTranscriptProvenanceSchema, pluginStoredTokensSchema, pluginTaskStartInputSchema, pluginToolContentSchema, pluginToolContinuationSchema, pluginToolOutputSchema, pluginToolReplySchema, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageInputSchema, pluginUserPageLinkSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema, promptContextSchema, promptMessageSchema, readTag, renderEmptyTag, renderInlineTag, renderTag, replyAttributionSchema, resourceLinkAnnotationSchema, resourceTypeSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, stableEventMatchKey, startsWithTag, stripTags, subscribableResourceSchema, systemActorSchema, tagJson, taskOutcomeSchema, toolApprovalModeSchema, unescapeClosingTag, unescapeClosingTags, unescapeTagText, userSchema, watchResultSchema, webActorSchema, webSourceSchema, withToolContext, zodTool };
|