@sentry/junior 0.74.1 → 0.75.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/agent-hooks-2HEB4C3Q.js +33 -0
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +5211 -5316
- package/dist/build/copy-build-content.d.ts +1 -1
- package/dist/chat/agent-dispatch/context.d.ts +2 -3
- package/dist/chat/agent-dispatch/types.d.ts +2 -1
- package/dist/chat/config.d.ts +2 -0
- package/dist/chat/conversations/configured.d.ts +2 -0
- package/dist/chat/credentials/subject.d.ts +3 -3
- package/dist/chat/plugins/agent-hooks.d.ts +13 -13
- package/dist/chat/plugins/credential-hooks.d.ts +6 -6
- package/dist/chat/plugins/db.d.ts +31 -0
- package/dist/chat/plugins/logging.d.ts +2 -2
- package/dist/chat/plugins/package-discovery.d.ts +2 -1
- package/dist/chat/plugins/registry.d.ts +4 -0
- package/dist/chat/plugins/state.d.ts +3 -5
- package/dist/chat/plugins/types.d.ts +1 -0
- package/dist/chat/plugins/validation.d.ts +5 -0
- package/dist/chat/prompt.d.ts +11 -1
- package/dist/chat/respond.d.ts +10 -1
- package/dist/chat/runtime/slack-runtime.d.ts +6 -1
- package/dist/chat/sandbox/egress-credentials.d.ts +8 -8
- package/dist/chat/sandbox/sandbox.d.ts +2 -2
- package/dist/chat/sql/db.d.ts +3 -0
- package/dist/chat/sql/executor.d.ts +7 -0
- package/dist/chat/sql/neon.d.ts +2 -4
- package/dist/chat/sql/postgres.d.ts +6 -0
- package/dist/chat/task-execution/state.d.ts +7 -2
- package/dist/chat/task-execution/worker.d.ts +1 -1
- package/dist/chat/tools/agent-tools.d.ts +2 -2
- package/dist/chat/tools/types.d.ts +3 -0
- package/dist/{chunk-7Q5YOUUT.js → chunk-2RWFUS5F.js} +47 -10
- package/dist/{chunk-YRDS7VKO.js → chunk-62FUNJYS.js} +3 -54
- package/dist/{chunk-M4FLLXXD.js → chunk-74HO27II.js} +1 -1
- package/dist/chunk-BNJIEFQC.js +115 -0
- package/dist/{chunk-YOHFWWBV.js → chunk-C3AM4Z4J.js} +1 -103
- package/dist/chunk-D7NFH5GD.js +570 -0
- package/dist/chunk-EE6PJWY4.js +130 -0
- package/dist/{chunk-CYUI7JU5.js → chunk-EIYL7I4S.js} +1 -1
- package/dist/{chunk-GM7HTXYC.js → chunk-FCZO7LAR.js} +13 -2
- package/dist/{chunk-2LUZA3LY.js → chunk-JEELK46E.js} +5 -5
- package/dist/chunk-MCMROINU.js +12 -0
- package/dist/chunk-NPVUAXUE.js +694 -0
- package/dist/{chunk-OR6NQJ5E.js → chunk-OJODNL2P.js} +3 -3
- package/dist/{chunk-3BYAPS6B.js → chunk-OK4KKR7B.js} +1 -11
- package/dist/chunk-OZSPLAQ4.js +71 -0
- package/dist/{chunk-KVZL5NZS.js → chunk-Q3XNY442.js} +17 -7
- package/dist/{chunk-SQGMG7OD.js → chunk-TQ74BATR.js} +100 -58
- package/dist/{chunk-JL2SLRAT.js → chunk-UJ7OTHPO.js} +76 -312
- package/dist/{chunk-HYHKTFG2.js → chunk-VNTLUFTY.js} +80 -843
- package/dist/chunk-WBZ4M5N5.js +59 -0
- package/dist/{chunk-6UP2Z2RZ.js → chunk-XJHDZUGD.js} +7 -7
- package/dist/chunk-Y2CM7HXH.js +111 -0
- package/dist/{chunk-F6HWCPOC.js → chunk-ZNNTSPNF.js} +1 -1
- package/dist/cli/chat.js +52 -2
- package/dist/cli/check.js +6 -5
- package/dist/cli/snapshot-warmup.js +10 -9
- package/dist/cli/upgrade.js +256 -16
- package/dist/db-A3ILH67H.js +20 -0
- package/dist/handlers/sandbox-egress-route.d.ts +4 -0
- package/dist/handlers/slack-webhook.d.ts +4 -0
- package/dist/handlers/webhooks.d.ts +6 -13
- package/dist/nitro.js +34 -89
- package/dist/plugin-module.d.ts +21 -0
- package/dist/plugins-OMJKLRJ2.js +13 -0
- package/dist/plugins.d.ts +6 -4
- package/dist/registry-NLZFIW23.js +46 -0
- package/dist/reporting/conversations.d.ts +3 -3
- package/dist/reporting.d.ts +6 -5
- package/dist/reporting.js +23 -17
- package/dist/{runner-27NP2TEO.js → runner-LUQZ5G67.js} +18 -13
- package/dist/validation-VMCPP3YO.js +15 -0
- package/package.json +11 -9
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeConfiguredPluginDb,
|
|
3
|
+
createPluginDbForExecutor,
|
|
4
|
+
getPluginDbForRegistration,
|
|
5
|
+
migratePluginSchemas,
|
|
6
|
+
readPluginMigrations,
|
|
7
|
+
validatePluginDatabaseRequirements
|
|
8
|
+
} from "./chunk-D7NFH5GD.js";
|
|
9
|
+
import "./chunk-FCZO7LAR.js";
|
|
10
|
+
import "./chunk-OK4KKR7B.js";
|
|
11
|
+
import "./chunk-SJHUF3DP.js";
|
|
12
|
+
import "./chunk-2KG3PWR4.js";
|
|
13
|
+
export {
|
|
14
|
+
closeConfiguredPluginDb,
|
|
15
|
+
createPluginDbForExecutor,
|
|
16
|
+
getPluginDbForRegistration,
|
|
17
|
+
migratePluginSchemas,
|
|
18
|
+
readPluginMigrations,
|
|
19
|
+
validatePluginDatabaseRequirements
|
|
20
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SlackWebhookServices } from "@/chat/ingress/slack-webhook";
|
|
2
|
+
import type { WaitUntilFn } from "@/handlers/types";
|
|
3
|
+
/** Handle the production Slack webhook route. */
|
|
4
|
+
export declare function POST(request: Request, waitUntil: WaitUntilFn, services: SlackWebhookServices): Promise<Response>;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import type { SlackAdapter } from "@chat-adapter/slack";
|
|
2
|
-
import { type SlackWebhookServices } from "@/chat/ingress/slack-webhook";
|
|
3
2
|
import { JuniorChat } from "@/chat/ingress/junior-chat";
|
|
4
3
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
5
|
-
type
|
|
4
|
+
type ChatSdkBot = JuniorChat<{
|
|
6
5
|
slack: SlackAdapter;
|
|
7
6
|
}>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* kept for integration tests that still exercise Chat SDK fixtures directly.
|
|
14
|
-
* The optional `services` parameter carries app-scoped runtime services.
|
|
15
|
-
*/
|
|
16
|
-
export declare function handlePlatformWebhook(request: Request, platform: string, waitUntil: WaitUntilFn, legacyBot?: LegacyChatSdkBot, services?: SlackWebhookServices): Promise<Response>;
|
|
17
|
-
/** Handle a platform webhook request from the app route. */
|
|
18
|
-
export declare function POST(request: Request, platform: string, waitUntil: WaitUntilFn, services?: SlackWebhookServices): Promise<Response>;
|
|
7
|
+
type WebhookRunner = () => Promise<Response>;
|
|
8
|
+
/** Run a platform webhook with shared request tracing and error logging. */
|
|
9
|
+
export declare function handleWebhookRequest(request: Request, platform: string, run: WebhookRunner): Promise<Response>;
|
|
10
|
+
/** Handle a Chat SDK webhook fixture through the shared webhook wrapper. */
|
|
11
|
+
export declare function handleChatSdkPlatformWebhook(request: Request, platform: string, waitUntil: WaitUntilFn, chat: ChatSdkBot): Promise<Response>;
|
|
19
12
|
export {};
|
package/dist/nitro.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
pluginCatalogConfigFromPluginSet,
|
|
3
|
-
pluginHookRegistrationsFromPluginSet,
|
|
4
2
|
resolveConversationWorkQueueTopic
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import
|
|
3
|
+
} from "./chunk-C3AM4Z4J.js";
|
|
4
|
+
import {
|
|
5
|
+
pluginCatalogConfigFromPluginSet,
|
|
6
|
+
pluginHookRegistrationsFromPluginSet
|
|
7
|
+
} from "./chunk-EE6PJWY4.js";
|
|
8
|
+
import "./chunk-WBZ4M5N5.js";
|
|
9
|
+
import "./chunk-62FUNJYS.js";
|
|
10
|
+
import {
|
|
11
|
+
loadPluginSetFromModule,
|
|
12
|
+
resolvePluginModule
|
|
13
|
+
} from "./chunk-Y2CM7HXH.js";
|
|
14
|
+
import "./chunk-FCZO7LAR.js";
|
|
7
15
|
import {
|
|
8
16
|
discoverInstalledPluginPackageContent,
|
|
9
17
|
isValidPackageName,
|
|
10
18
|
resolvePackageDir
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-Q3XNY442.js";
|
|
20
|
+
import "./chunk-MCMROINU.js";
|
|
21
|
+
import "./chunk-OK4KKR7B.js";
|
|
14
22
|
import {
|
|
15
23
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
16
24
|
JUNIOR_HEARTBEAT_CRON_SCHEDULE,
|
|
@@ -20,9 +28,6 @@ import "./chunk-2KG3PWR4.js";
|
|
|
20
28
|
|
|
21
29
|
// src/nitro.ts
|
|
22
30
|
import path2 from "path";
|
|
23
|
-
import { statSync as statSync2 } from "fs";
|
|
24
|
-
import { createRequire } from "module";
|
|
25
|
-
import { pathToFileURL } from "url";
|
|
26
31
|
|
|
27
32
|
// src/build/rolldown-workarounds.ts
|
|
28
33
|
function applyRolldownTreeshakeWorkaround(nitro) {
|
|
@@ -65,6 +70,15 @@ function copyAppAndPluginContent(cwd, serverRoot, packageNames) {
|
|
|
65
70
|
for (const root of packagedContent.skillRoots) {
|
|
66
71
|
copyRootIntoServerOutput(cwd, serverRoot, root);
|
|
67
72
|
}
|
|
73
|
+
for (const pkg of packagedContent.packages) {
|
|
74
|
+
if (pkg.hasMigrationsDir) {
|
|
75
|
+
copyRootIntoServerOutput(
|
|
76
|
+
cwd,
|
|
77
|
+
serverRoot,
|
|
78
|
+
path.join(pkg.dir, "migrations")
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
68
82
|
}
|
|
69
83
|
function copyIncludedFiles(cwd, serverRoot, patterns) {
|
|
70
84
|
if (patterns === void 0) return;
|
|
@@ -210,7 +224,7 @@ function injectVirtualConfig(nitro, options = {}) {
|
|
|
210
224
|
plugins: pluginCatalogConfigFromPluginSet(pluginSet),
|
|
211
225
|
pluginHookRegistrations: pluginHookRegistrationsFromPluginSet(
|
|
212
226
|
pluginSet
|
|
213
|
-
).map((plugin) => plugin.name)
|
|
227
|
+
).map((plugin) => plugin.manifest.name)
|
|
214
228
|
});
|
|
215
229
|
};
|
|
216
230
|
}
|
|
@@ -218,15 +232,6 @@ function injectVirtualConfig(nitro, options = {}) {
|
|
|
218
232
|
// src/nitro.ts
|
|
219
233
|
var DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 300;
|
|
220
234
|
var VERCEL_QUEUE_TRIGGER_TYPE = "queue/v2beta";
|
|
221
|
-
var PLUGIN_MODULE_EXTENSIONS = [
|
|
222
|
-
"",
|
|
223
|
-
".ts",
|
|
224
|
-
".tsx",
|
|
225
|
-
".mts",
|
|
226
|
-
".mjs",
|
|
227
|
-
".js",
|
|
228
|
-
".cjs"
|
|
229
|
-
];
|
|
230
235
|
function isPluginModuleReference(value) {
|
|
231
236
|
return typeof value === "string" || Boolean(value && "module" in value);
|
|
232
237
|
}
|
|
@@ -236,75 +241,9 @@ function isPluginSet(value) {
|
|
|
236
241
|
}
|
|
237
242
|
return "packageNames" in value && "registrations" in value;
|
|
238
243
|
}
|
|
239
|
-
function resolveRelativePluginModule(cwd, specifier) {
|
|
240
|
-
const basePath = path2.resolve(cwd, specifier);
|
|
241
|
-
for (const extension of PLUGIN_MODULE_EXTENSIONS) {
|
|
242
|
-
const candidate = `${basePath}${extension}`;
|
|
243
|
-
try {
|
|
244
|
-
if (statSync2(candidate).isFile()) {
|
|
245
|
-
return candidate;
|
|
246
|
-
}
|
|
247
|
-
} catch {
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
for (const extension of PLUGIN_MODULE_EXTENSIONS) {
|
|
251
|
-
const candidate = path2.join(basePath, `index${extension}`);
|
|
252
|
-
try {
|
|
253
|
-
if (statSync2(candidate).isFile()) {
|
|
254
|
-
return candidate;
|
|
255
|
-
}
|
|
256
|
-
} catch {
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
throw new Error(`Plugin module "${specifier}" could not be resolved`);
|
|
260
|
-
}
|
|
261
|
-
function resolvePluginModule(cwd, input) {
|
|
262
|
-
const moduleSpecifier = typeof input === "string" ? input : input.module;
|
|
263
|
-
const exportName = typeof input === "string" ? "plugins" : input.exportName ?? "plugins";
|
|
264
|
-
if (!moduleSpecifier.trim()) {
|
|
265
|
-
throw new Error("Plugin module specifier must not be empty");
|
|
266
|
-
}
|
|
267
|
-
if (moduleSpecifier.startsWith(".") || path2.isAbsolute(moduleSpecifier)) {
|
|
268
|
-
const resolvedPath2 = resolveRelativePluginModule(cwd, moduleSpecifier);
|
|
269
|
-
return {
|
|
270
|
-
exportName,
|
|
271
|
-
importUrl: pathToFileURL(resolvedPath2).href,
|
|
272
|
-
runtimeModule: {
|
|
273
|
-
exportName,
|
|
274
|
-
specifier: resolvedPath2.split(path2.sep).join("/")
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
const requireFromApp = createRequire(path2.join(cwd, "package.json"));
|
|
279
|
-
const resolvedPath = requireFromApp.resolve(moduleSpecifier);
|
|
280
|
-
return {
|
|
281
|
-
exportName,
|
|
282
|
-
importUrl: pathToFileURL(resolvedPath).href,
|
|
283
|
-
runtimeModule: {
|
|
284
|
-
exportName,
|
|
285
|
-
specifier: moduleSpecifier
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
function assertPluginSet(value, source) {
|
|
290
|
-
if (!value || typeof value !== "object" || !Array.isArray(value.packageNames) || !Array.isArray(value.registrations)) {
|
|
291
|
-
throw new Error(
|
|
292
|
-
`Plugin module ${source} must export a defineJuniorPlugins(...) set`
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
return value;
|
|
296
|
-
}
|
|
297
|
-
async function loadPluginSetFromModule(moduleRef) {
|
|
298
|
-
const mod = await import(moduleRef.importUrl);
|
|
299
|
-
const value = moduleRef.exportName === "default" ? mod.default : mod[moduleRef.exportName];
|
|
300
|
-
return assertPluginSet(
|
|
301
|
-
value,
|
|
302
|
-
`${moduleRef.importUrl}#${moduleRef.exportName}`
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
244
|
function assertSerializableDirectPluginSet(pluginSet) {
|
|
306
245
|
const pluginHookNames = pluginHookRegistrationsFromPluginSet(pluginSet).map(
|
|
307
|
-
(plugin) => plugin.name
|
|
246
|
+
(plugin) => plugin.manifest.name
|
|
308
247
|
);
|
|
309
248
|
if (pluginHookNames.length === 0) {
|
|
310
249
|
return;
|
|
@@ -313,6 +252,12 @@ function assertSerializableDirectPluginSet(pluginSet) {
|
|
|
313
252
|
`juniorNitro({ plugins }) cannot receive a direct defineJuniorPlugins(...) set with runtime hook registration(s): ${pluginHookNames.join(", ")}. Export the set from a runtime-safe plugin module and pass juniorNitro({ plugins: "./plugins" }) so createApp() can import the same hooks at runtime.`
|
|
314
253
|
);
|
|
315
254
|
}
|
|
255
|
+
function runtimeModuleForResolvedPluginModule(moduleRef) {
|
|
256
|
+
return {
|
|
257
|
+
exportName: moduleRef.exportName,
|
|
258
|
+
specifier: moduleRef.kind === "file" ? moduleRef.importPath.split(path2.sep).join("/") : moduleRef.sourceSpecifier
|
|
259
|
+
};
|
|
260
|
+
}
|
|
316
261
|
function bundleOpenTelemetryLoaderHooks(nitro) {
|
|
317
262
|
const existing = Array.isArray(nitro.options.noExternals) ? nitro.options.noExternals : [];
|
|
318
263
|
const additions = ["import-in-the-middle", "require-in-the-middle"].filter(
|
|
@@ -383,11 +328,11 @@ function juniorNitro(options = {}) {
|
|
|
383
328
|
const pluginCatalogConfig = pluginCatalogConfigFromPluginSet(directPluginSet);
|
|
384
329
|
const pluginHookRegistrations = pluginHookRegistrationsFromPluginSet(
|
|
385
330
|
directPluginSet
|
|
386
|
-
).map((plugin) => plugin.name);
|
|
331
|
+
).map((plugin) => plugin.manifest.name);
|
|
387
332
|
injectVirtualConfig(nitro, {
|
|
388
333
|
...pluginModule ? {
|
|
389
334
|
loadPluginSet: loadConfiguredPluginSet,
|
|
390
|
-
pluginModule: pluginModule
|
|
335
|
+
pluginModule: runtimeModuleForResolvedPluginModule(pluginModule)
|
|
391
336
|
} : {},
|
|
392
337
|
plugins: pluginCatalogConfig,
|
|
393
338
|
pluginHookRegistrations
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { JuniorPluginSet } from "./plugins";
|
|
2
|
+
interface JuniorPluginModuleReference {
|
|
3
|
+
/** Runtime-safe module that exports a `defineJuniorPlugins(...)` set. */
|
|
4
|
+
module: string;
|
|
5
|
+
/** Named export to import from `module`. Defaults to `plugins`. */
|
|
6
|
+
exportName?: string;
|
|
7
|
+
}
|
|
8
|
+
interface ResolvedPluginModuleReference {
|
|
9
|
+
exportName: string;
|
|
10
|
+
importPath: string;
|
|
11
|
+
importUrl: string;
|
|
12
|
+
kind: "file" | "package";
|
|
13
|
+
sourceSpecifier: string;
|
|
14
|
+
}
|
|
15
|
+
/** Resolve the runtime-safe plugin module used by Junior app wiring. */
|
|
16
|
+
export declare function resolvePluginModule(cwd: string, input: JuniorPluginModuleReference | string): ResolvedPluginModuleReference;
|
|
17
|
+
/** Load a resolved plugin module and return its configured plugin set. */
|
|
18
|
+
export declare function loadPluginSetFromModule(moduleRef: ResolvedPluginModuleReference, importModule?: (moduleRef: ResolvedPluginModuleReference) => Promise<Record<string, unknown>>): Promise<JuniorPluginSet>;
|
|
19
|
+
/** Load an app-local `./plugins` module when one exists. */
|
|
20
|
+
export declare function loadAppPluginSet(cwd: string, importModule?: (moduleRef: ResolvedPluginModuleReference) => Promise<Record<string, unknown>>): Promise<JuniorPluginSet | undefined>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineJuniorPlugins,
|
|
3
|
+
pluginCatalogConfigFromEnv,
|
|
4
|
+
pluginCatalogConfigFromPluginSet,
|
|
5
|
+
pluginHookRegistrationsFromPluginSet
|
|
6
|
+
} from "./chunk-EE6PJWY4.js";
|
|
7
|
+
import "./chunk-2KG3PWR4.js";
|
|
8
|
+
export {
|
|
9
|
+
defineJuniorPlugins,
|
|
10
|
+
pluginCatalogConfigFromEnv,
|
|
11
|
+
pluginCatalogConfigFromPluginSet,
|
|
12
|
+
pluginHookRegistrationsFromPluginSet
|
|
13
|
+
};
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginRegistration } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { PluginCatalogConfig, PluginManifestConfig } from "./chat/plugins/types";
|
|
3
|
-
export type JuniorPluginInput =
|
|
3
|
+
export type JuniorPluginInput = PluginRegistration | string;
|
|
4
4
|
export interface JuniorPluginSetOptions {
|
|
5
5
|
/** Install-level manifest overrides applied before validation. */
|
|
6
6
|
manifests?: Record<string, PluginManifestConfig>;
|
|
@@ -12,11 +12,13 @@ export interface JuniorPluginSet {
|
|
|
12
12
|
/** Manifest-only plugin packages included by package name. */
|
|
13
13
|
packageNames: string[];
|
|
14
14
|
/** JavaScript plugin definitions included by package factories. */
|
|
15
|
-
registrations:
|
|
15
|
+
registrations: PluginRegistration[];
|
|
16
16
|
}
|
|
17
17
|
/** Define package-name plugins and JS plugin definitions for one app. */
|
|
18
18
|
export declare function defineJuniorPlugins(inputs: JuniorPluginInput[], options?: JuniorPluginSetOptions): JuniorPluginSet;
|
|
19
19
|
/** Build the manifest catalog config implied by one plugin set. */
|
|
20
20
|
export declare function pluginCatalogConfigFromPluginSet(pluginSet: JuniorPluginSet | undefined): PluginCatalogConfig | undefined;
|
|
21
|
+
/** Build the manifest catalog config implied by plugin package env. */
|
|
22
|
+
export declare function pluginCatalogConfigFromEnv(env?: NodeJS.ProcessEnv): PluginCatalogConfig | undefined;
|
|
21
23
|
/** Return registrations that expose in-process runtime hooks. */
|
|
22
|
-
export declare function pluginHookRegistrationsFromPluginSet(pluginSet: JuniorPluginSet | undefined):
|
|
24
|
+
export declare function pluginHookRegistrationsFromPluginSet(pluginSet: JuniorPluginSet | undefined): PluginRegistration[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPluginBroker,
|
|
3
|
+
getPluginCapabilityProviders,
|
|
4
|
+
getPluginCatalogSignature,
|
|
5
|
+
getPluginDefinition,
|
|
6
|
+
getPluginDisplayName,
|
|
7
|
+
getPluginForSkillPath,
|
|
8
|
+
getPluginMcpProviders,
|
|
9
|
+
getPluginMigrationRoots,
|
|
10
|
+
getPluginOAuthConfig,
|
|
11
|
+
getPluginPackageContent,
|
|
12
|
+
getPluginProviders,
|
|
13
|
+
getPluginRuntimeDependencies,
|
|
14
|
+
getPluginRuntimePostinstall,
|
|
15
|
+
getPluginSkillRoots,
|
|
16
|
+
isPluginCapability,
|
|
17
|
+
isPluginConfigKey,
|
|
18
|
+
isPluginProvider,
|
|
19
|
+
setPluginCatalogConfig
|
|
20
|
+
} from "./chunk-2RWFUS5F.js";
|
|
21
|
+
import "./chunk-Q3XNY442.js";
|
|
22
|
+
import "./chunk-EIYL7I4S.js";
|
|
23
|
+
import "./chunk-MCMROINU.js";
|
|
24
|
+
import "./chunk-OK4KKR7B.js";
|
|
25
|
+
import "./chunk-SJHUF3DP.js";
|
|
26
|
+
import "./chunk-2KG3PWR4.js";
|
|
27
|
+
export {
|
|
28
|
+
createPluginBroker,
|
|
29
|
+
getPluginCapabilityProviders,
|
|
30
|
+
getPluginCatalogSignature,
|
|
31
|
+
getPluginDefinition,
|
|
32
|
+
getPluginDisplayName,
|
|
33
|
+
getPluginForSkillPath,
|
|
34
|
+
getPluginMcpProviders,
|
|
35
|
+
getPluginMigrationRoots,
|
|
36
|
+
getPluginOAuthConfig,
|
|
37
|
+
getPluginPackageContent,
|
|
38
|
+
getPluginProviders,
|
|
39
|
+
getPluginRuntimeDependencies,
|
|
40
|
+
getPluginRuntimePostinstall,
|
|
41
|
+
getPluginSkillRoots,
|
|
42
|
+
isPluginCapability,
|
|
43
|
+
isPluginConfigKey,
|
|
44
|
+
isPluginProvider,
|
|
45
|
+
setPluginCatalogConfig
|
|
46
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginConversationStatus, PluginConversations, PluginConversationSummary } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { ConversationStore } from "@/chat/conversations/store";
|
|
3
|
-
export type {
|
|
3
|
+
export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, };
|
|
4
4
|
interface ConversationReaderOptions {
|
|
5
5
|
conversationStore?: ConversationStore;
|
|
6
6
|
}
|
|
@@ -121,6 +121,6 @@ export declare function readConversationStatsReport(options?: ConversationReader
|
|
|
121
121
|
/** List recent conversation summaries for plugin operational reports. */
|
|
122
122
|
export declare function listRecentConversationSummaries(options?: {
|
|
123
123
|
limit?: number;
|
|
124
|
-
} & ConversationReaderOptions): Promise<
|
|
124
|
+
} & ConversationReaderOptions): Promise<PluginConversationSummary[]>;
|
|
125
125
|
/** Read one conversation transcript for reporting consumers. */
|
|
126
126
|
export declare function readConversationReport(conversationId: string, options?: ConversationReaderOptions): Promise<ConversationReport>;
|
package/dist/reporting.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginOperationalReport } from "@sentry/junior-plugin-api";
|
|
2
|
-
import { type ConversationFeed, type
|
|
3
|
-
export type {
|
|
2
|
+
import { type ConversationFeed, type PluginConversationSummary, type ConversationReport, type ConversationStatsReport } from "./reporting/conversations";
|
|
3
|
+
export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, ConversationFeed, ConversationReport, ConversationReportStatus, ConversationRunReport, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationUsage, RequesterIdentity, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./reporting/conversations";
|
|
4
4
|
export interface HealthReport {
|
|
5
5
|
status: "ok";
|
|
6
6
|
service: string;
|
|
@@ -23,8 +23,9 @@ export interface RuntimeInfoReport {
|
|
|
23
23
|
}
|
|
24
24
|
export interface PluginPackageContentItemReport {
|
|
25
25
|
dir: string;
|
|
26
|
+
hasMigrationsDir: boolean;
|
|
26
27
|
hasSkillsDir: boolean;
|
|
27
|
-
|
|
28
|
+
packageName: string;
|
|
28
29
|
}
|
|
29
30
|
export interface PluginPackageContentReport {
|
|
30
31
|
packageNames: string[];
|
|
@@ -55,7 +56,7 @@ export interface JuniorReporting {
|
|
|
55
56
|
/** Read recent conversation summaries without transcript payloads. */
|
|
56
57
|
listRecentConversations?(options?: {
|
|
57
58
|
limit?: number;
|
|
58
|
-
}): Promise<
|
|
59
|
+
}): Promise<PluginConversationSummary[]>;
|
|
59
60
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
60
61
|
getPluginOperationalReports?(): Promise<PluginOperationalReportFeed>;
|
|
61
62
|
/**
|
|
@@ -72,6 +73,6 @@ export declare function createJuniorReporting(): JuniorReporting & {
|
|
|
72
73
|
getConversationStats(): Promise<ConversationStatsReport>;
|
|
73
74
|
listRecentConversations(options?: {
|
|
74
75
|
limit?: number;
|
|
75
|
-
}): Promise<
|
|
76
|
+
}): Promise<PluginConversationSummary[]>;
|
|
76
77
|
getPluginOperationalReports(): Promise<PluginOperationalReportFeed>;
|
|
77
78
|
};
|
package/dist/reporting.js
CHANGED
|
@@ -6,37 +6,43 @@ import {
|
|
|
6
6
|
getConversationDetails,
|
|
7
7
|
getConversationDetailsForIds,
|
|
8
8
|
resolveSlackConversationContextFromThreadId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JEELK46E.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSystemPrompt,
|
|
12
|
-
getAgentPluginOperationalReports,
|
|
13
12
|
getAgentTurnSessionRecord,
|
|
14
13
|
getConfiguredConversationStore,
|
|
15
14
|
listAgentTurnSessionSummariesForConversation
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VNTLUFTY.js";
|
|
16
|
+
import {
|
|
17
|
+
getPluginOperationalReports
|
|
18
|
+
} from "./chunk-NPVUAXUE.js";
|
|
17
19
|
import {
|
|
18
20
|
discoverSkills
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-OJODNL2P.js";
|
|
22
|
+
import "./chunk-UJ7OTHPO.js";
|
|
23
|
+
import "./chunk-WBZ4M5N5.js";
|
|
24
|
+
import "./chunk-BNJIEFQC.js";
|
|
25
|
+
import "./chunk-62FUNJYS.js";
|
|
26
|
+
import "./chunk-D7NFH5GD.js";
|
|
22
27
|
import "./chunk-G3E7SCME.js";
|
|
28
|
+
import "./chunk-ZNNTSPNF.js";
|
|
29
|
+
import {
|
|
30
|
+
canExposeConversationPayload,
|
|
31
|
+
parseSlackThreadId,
|
|
32
|
+
resolveConversationPrivacy
|
|
33
|
+
} from "./chunk-FCZO7LAR.js";
|
|
23
34
|
import {
|
|
24
35
|
getPluginPackageContent,
|
|
25
36
|
getPluginProviders
|
|
26
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2RWFUS5F.js";
|
|
27
38
|
import {
|
|
28
39
|
homeDir
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import
|
|
32
|
-
canExposeConversationPayload,
|
|
33
|
-
parseSlackThreadId,
|
|
34
|
-
resolveConversationPrivacy
|
|
35
|
-
} from "./chunk-GM7HTXYC.js";
|
|
36
|
-
import "./chunk-CYUI7JU5.js";
|
|
40
|
+
} from "./chunk-Q3XNY442.js";
|
|
41
|
+
import "./chunk-EIYL7I4S.js";
|
|
42
|
+
import "./chunk-MCMROINU.js";
|
|
37
43
|
import {
|
|
38
44
|
isRecord
|
|
39
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-OK4KKR7B.js";
|
|
40
46
|
import "./chunk-SJHUF3DP.js";
|
|
41
47
|
import "./chunk-2KG3PWR4.js";
|
|
42
48
|
|
|
@@ -982,7 +988,7 @@ function createJuniorReporting() {
|
|
|
982
988
|
return {
|
|
983
989
|
source: "plugins",
|
|
984
990
|
generatedAt: new Date(nowMs).toISOString(),
|
|
985
|
-
reports: await
|
|
991
|
+
reports: await getPluginOperationalReports(nowMs, {
|
|
986
992
|
listRecent
|
|
987
993
|
})
|
|
988
994
|
};
|
|
@@ -12,28 +12,33 @@ import {
|
|
|
12
12
|
startActiveTurn,
|
|
13
13
|
updateConversationStats,
|
|
14
14
|
upsertConversationMessage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TQ74BATR.js";
|
|
16
16
|
import {
|
|
17
17
|
commitMessages,
|
|
18
18
|
loadProjection
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-VNTLUFTY.js";
|
|
20
|
+
import "./chunk-NPVUAXUE.js";
|
|
21
|
+
import "./chunk-OJODNL2P.js";
|
|
21
22
|
import {
|
|
22
23
|
coerceThreadConversationState
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-74HO27II.js";
|
|
25
|
+
import "./chunk-UJ7OTHPO.js";
|
|
26
|
+
import "./chunk-WBZ4M5N5.js";
|
|
27
|
+
import "./chunk-BNJIEFQC.js";
|
|
28
|
+
import "./chunk-62FUNJYS.js";
|
|
29
|
+
import "./chunk-D7NFH5GD.js";
|
|
30
|
+
import "./chunk-XJHDZUGD.js";
|
|
27
31
|
import "./chunk-G3E7SCME.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-KVZL5NZS.js";
|
|
30
|
-
import "./chunk-F6HWCPOC.js";
|
|
32
|
+
import "./chunk-ZNNTSPNF.js";
|
|
31
33
|
import {
|
|
32
34
|
stripRuntimeTurnContext,
|
|
33
35
|
trimTrailingAssistantMessages
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-FCZO7LAR.js";
|
|
37
|
+
import "./chunk-2RWFUS5F.js";
|
|
38
|
+
import "./chunk-Q3XNY442.js";
|
|
39
|
+
import "./chunk-EIYL7I4S.js";
|
|
40
|
+
import "./chunk-MCMROINU.js";
|
|
41
|
+
import "./chunk-OK4KKR7B.js";
|
|
37
42
|
import "./chunk-SJHUF3DP.js";
|
|
38
43
|
import "./chunk-2KG3PWR4.js";
|
|
39
44
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validatePluginEgressCredentialHooks,
|
|
3
|
+
validatePluginRegistrations
|
|
4
|
+
} from "./chunk-OZSPLAQ4.js";
|
|
5
|
+
import "./chunk-2RWFUS5F.js";
|
|
6
|
+
import "./chunk-Q3XNY442.js";
|
|
7
|
+
import "./chunk-EIYL7I4S.js";
|
|
8
|
+
import "./chunk-MCMROINU.js";
|
|
9
|
+
import "./chunk-OK4KKR7B.js";
|
|
10
|
+
import "./chunk-SJHUF3DP.js";
|
|
11
|
+
import "./chunk-2KG3PWR4.js";
|
|
12
|
+
export {
|
|
13
|
+
validatePluginEgressCredentialHooks,
|
|
14
|
+
validatePluginRegistrations
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -62,17 +62,20 @@
|
|
|
62
62
|
"chat": "4.29.0",
|
|
63
63
|
"drizzle-orm": "^0.45.2",
|
|
64
64
|
"hono": "^4.12.22",
|
|
65
|
+
"jiti": "^2.7.0",
|
|
65
66
|
"jose": "^6.2.3",
|
|
66
67
|
"just-bash": "3.0.1",
|
|
67
68
|
"node-html-markdown": "^2.0.0",
|
|
69
|
+
"pg": "^8.16.3",
|
|
68
70
|
"yaml": "^2.9.0",
|
|
69
71
|
"zod": "^4.4.3",
|
|
70
|
-
"@sentry/junior-plugin-api": "0.
|
|
72
|
+
"@sentry/junior-plugin-api": "0.75.0"
|
|
71
73
|
},
|
|
72
74
|
"devDependencies": {
|
|
73
75
|
"@emnapi/core": "^1.10.0",
|
|
74
76
|
"@emnapi/runtime": "^1.10.0",
|
|
75
77
|
"@types/node": "^25.9.1",
|
|
78
|
+
"@types/pg": "^8.15.6",
|
|
76
79
|
"@vitest/coverage-v8": "4.1.7",
|
|
77
80
|
"dependency-cruiser": "^17.4.0",
|
|
78
81
|
"msw": "^2.14.6",
|
|
@@ -82,19 +85,18 @@
|
|
|
82
85
|
"typescript": "^6.0.3",
|
|
83
86
|
"vercel": "^54.4.0",
|
|
84
87
|
"vitest": "^4.1.7",
|
|
85
|
-
"@sentry/junior-
|
|
86
|
-
"@sentry/junior-
|
|
88
|
+
"@sentry/junior-scheduler": "0.75.0",
|
|
89
|
+
"@sentry/junior-testing": "0.0.0",
|
|
90
|
+
"@sentry/junior-test-fixtures": "0.72.0"
|
|
87
91
|
},
|
|
88
92
|
"scripts": {
|
|
89
93
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
90
|
-
"lint": "oxlint --config .oxlintrc.json --deny-warnings src tests scripts bin tsup.config.ts",
|
|
94
|
+
"lint": "oxlint --config .oxlintrc.json --deny-warnings src tests scripts bin tsup.config.ts && depcruise --config .dependency-cruiser.mjs src/chat",
|
|
91
95
|
"lint:fix": "oxlint --config .oxlintrc.json --deny-warnings --fix src tests scripts bin tsup.config.ts",
|
|
92
|
-
"test": "
|
|
96
|
+
"test": "vitest run --maxWorkers=4",
|
|
93
97
|
"test:watch": "vitest",
|
|
94
|
-
"test:slack-boundary": "node scripts/check-slack-test-boundary.mjs",
|
|
95
|
-
"test:arch-boundary": "depcruise --config .dependency-cruiser.mjs src/chat",
|
|
96
98
|
"typecheck": "tsc --noEmit",
|
|
97
99
|
"skills:check": "node scripts/check-skills.mjs",
|
|
98
|
-
"test:coverage": "
|
|
100
|
+
"test:coverage": "vitest run --maxWorkers=4 --coverage --reporter=default --reporter=junit --outputFile.junit=coverage/results.junit.xml"
|
|
99
101
|
}
|
|
100
102
|
}
|