@sentry/junior 0.10.2 → 0.11.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 +19 -17
- package/dist/app.d.ts +13 -0
- package/dist/{chunk-BID5VOWA.js → app.js} +9523 -8776
- package/dist/chunk-2KG3PWR4.js +17 -0
- package/dist/{chunk-FESDWP3I.js → chunk-IRE2LOEJ.js} +5 -4
- package/dist/{chunk-GTJP3RVX.js → chunk-WELSSJJU.js} +2 -2
- package/dist/{chunk-KCLEEKYX.js → chunk-XH7TV4JS.js} +13 -5
- package/dist/chunk-Z3YD6NHK.js +12 -0
- package/dist/{chunk-LSXXIMX3.js → chunk-ZYB3U7Q4.js} +17 -15
- package/dist/cli/check.js +5 -3
- package/dist/cli/env.js +2 -0
- package/dist/cli/init.js +65 -45
- package/dist/cli/run.js +2 -0
- package/dist/cli/snapshot-warmup.js +9 -3
- package/dist/instrumentation.d.ts +3 -11
- package/dist/instrumentation.js +17 -26
- package/dist/nitro.d.ts +18 -0
- package/dist/nitro.js +59 -0
- package/package.json +16 -25
- package/dist/app/layout.d.ts +0 -11
- package/dist/app/layout.js +0 -8
- package/dist/chunk-4RBEYCOG.js +0 -12
- package/dist/handlers/health.d.ts +0 -6
- package/dist/handlers/health.js +0 -6
- package/dist/handlers/router.d.ts +0 -23
- package/dist/handlers/router.js +0 -827
- package/dist/handlers/webhooks.d.ts +0 -28
- package/dist/handlers/webhooks.js +0 -12
- package/dist/next-config.d.ts +0 -22
- package/dist/next-config.js +0 -114
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vercel function timeout in seconds.
|
|
3
|
-
*
|
|
4
|
-
* Agent turns run inside `after()` which shares the function's timeout budget.
|
|
5
|
-
* This must be at least as large as the configured turn timeout plus buffer.
|
|
6
|
-
*/
|
|
7
|
-
declare const maxDuration: number;
|
|
8
|
-
/**
|
|
9
|
-
* Webhook route contract for `@sentry/junior`.
|
|
10
|
-
*
|
|
11
|
-
* We keep a dedicated `/api/webhooks/:platform` surface so each adapter owns its
|
|
12
|
-
* protocol details (signature verification, challenge flows, retries) while this
|
|
13
|
-
* handler remains a thin dispatcher.
|
|
14
|
-
*/
|
|
15
|
-
type WebhookRouteContext = {
|
|
16
|
-
params: Promise<{
|
|
17
|
-
platform: string;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Handles `POST /api/webhooks/:platform`.
|
|
22
|
-
*
|
|
23
|
-
* The router only resolves the platform and delegates to the adapter webhook
|
|
24
|
-
* implementation; request semantics stay owned by the adapter package.
|
|
25
|
-
*/
|
|
26
|
-
declare function POST(request: Request, context: WebhookRouteContext): Promise<Response>;
|
|
27
|
-
|
|
28
|
-
export { POST, maxDuration };
|
package/dist/next-config.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { NextConfig } from 'next';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Optional overrides for `withJunior`.
|
|
5
|
-
*/
|
|
6
|
-
interface JuniorConfigOptions {
|
|
7
|
-
dataDir?: string;
|
|
8
|
-
skillsDir?: string;
|
|
9
|
-
pluginsDir?: string;
|
|
10
|
-
pluginPackages?: string[];
|
|
11
|
-
}
|
|
12
|
-
type NextConfigFactory = (phase: string, ctx: {
|
|
13
|
-
defaultConfig: NextConfig;
|
|
14
|
-
}) => Promise<NextConfig> | NextConfig;
|
|
15
|
-
/**
|
|
16
|
-
* Extends a Next.js config with Junior runtime defaults.
|
|
17
|
-
*
|
|
18
|
-
* Supports both object and function-style Next config exports.
|
|
19
|
-
*/
|
|
20
|
-
declare function withJunior(options?: JuniorConfigOptions, nextConfig?: NextConfig | NextConfigFactory): NextConfig | NextConfigFactory;
|
|
21
|
-
|
|
22
|
-
export { type JuniorConfigOptions, withJunior };
|
package/dist/next-config.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
discoverInstalledPluginPackageContent,
|
|
3
|
-
discoverNodeModulesDirs,
|
|
4
|
-
isDirectory
|
|
5
|
-
} from "./chunk-KCLEEKYX.js";
|
|
6
|
-
|
|
7
|
-
// src/next-config.ts
|
|
8
|
-
import { createRequire } from "module";
|
|
9
|
-
import path from "path";
|
|
10
|
-
var require2 = createRequire(import.meta.url);
|
|
11
|
-
function unique(values) {
|
|
12
|
-
return [...new Set(values)];
|
|
13
|
-
}
|
|
14
|
-
function sentryConfigured() {
|
|
15
|
-
return Boolean(process.env.NEXT_PUBLIC_SENTRY_DSN || process.env.SENTRY_DSN);
|
|
16
|
-
}
|
|
17
|
-
function isPackageInstalled(cwd, packageName) {
|
|
18
|
-
const nodeModulesDirs = discoverNodeModulesDirs(cwd);
|
|
19
|
-
return nodeModulesDirs.some(
|
|
20
|
-
(nodeModulesDir) => isDirectory(path.join(nodeModulesDir, ...packageName.split("/")))
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
function applyJuniorConfig(nextConfig, options) {
|
|
24
|
-
const existingEnv = nextConfig?.env ?? {};
|
|
25
|
-
const dataDir = options?.dataDir ?? "./app/data";
|
|
26
|
-
const skillsDir = options?.skillsDir ?? "./app/skills";
|
|
27
|
-
const pluginsDir = options?.pluginsDir ?? "./app/plugins";
|
|
28
|
-
const configuredPluginPackages = unique(options?.pluginPackages ?? []);
|
|
29
|
-
const discoveredPlugins = discoverInstalledPluginPackageContent(
|
|
30
|
-
process.cwd(),
|
|
31
|
-
{ packageNames: configuredPluginPackages }
|
|
32
|
-
);
|
|
33
|
-
const unresolvedConfiguredPackages = configuredPluginPackages.filter(
|
|
34
|
-
(packageName) => !discoveredPlugins.packageNames.includes(packageName)
|
|
35
|
-
);
|
|
36
|
-
const invalidPluginPackages = unresolvedConfiguredPackages.filter(
|
|
37
|
-
(packageName) => isPackageInstalled(process.cwd(), packageName)
|
|
38
|
-
);
|
|
39
|
-
const missingPluginPackages = unresolvedConfiguredPackages.filter(
|
|
40
|
-
(packageName) => !invalidPluginPackages.includes(packageName)
|
|
41
|
-
);
|
|
42
|
-
if (invalidPluginPackages.length > 0) {
|
|
43
|
-
throw new Error(
|
|
44
|
-
`withJunior pluginPackages contains installed packages that are not valid Junior plugins: ${invalidPluginPackages.join(", ")}`
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
if (missingPluginPackages.length > 0) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
`withJunior pluginPackages contains unresolved packages: ${missingPluginPackages.join(", ")}`
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
const defaultDataTracingIncludes = options?.dataDir ? [`${dataDir}/**/*`] : ["./app/SOUL.md", "./app/ABOUT.md"];
|
|
53
|
-
const pluginPackageTracingIncludes = discoveredPlugins.tracingIncludes;
|
|
54
|
-
const tracingIncludes = Array.from(
|
|
55
|
-
/* @__PURE__ */ new Set([
|
|
56
|
-
...defaultDataTracingIncludes,
|
|
57
|
-
`${skillsDir}/**/*`,
|
|
58
|
-
`${pluginsDir}/**/*`,
|
|
59
|
-
...pluginPackageTracingIncludes
|
|
60
|
-
])
|
|
61
|
-
);
|
|
62
|
-
const existingGlobalTracingIncludes = nextConfig?.outputFileTracingIncludes?.["/*"] ?? [];
|
|
63
|
-
const mergedGlobalTracingIncludes = Array.from(
|
|
64
|
-
/* @__PURE__ */ new Set([...existingGlobalTracingIncludes, ...tracingIncludes])
|
|
65
|
-
);
|
|
66
|
-
const config = {
|
|
67
|
-
...nextConfig,
|
|
68
|
-
serverExternalPackages: Array.from(
|
|
69
|
-
/* @__PURE__ */ new Set([
|
|
70
|
-
...nextConfig?.serverExternalPackages ?? [],
|
|
71
|
-
"@vercel/sandbox",
|
|
72
|
-
"bash-tool",
|
|
73
|
-
"just-bash",
|
|
74
|
-
"@mariozechner/pi-agent-core",
|
|
75
|
-
"@mariozechner/pi-ai",
|
|
76
|
-
"@chat-adapter/slack",
|
|
77
|
-
"@slack/web-api"
|
|
78
|
-
])
|
|
79
|
-
),
|
|
80
|
-
outputFileTracingIncludes: {
|
|
81
|
-
...nextConfig?.outputFileTracingIncludes,
|
|
82
|
-
"/*": mergedGlobalTracingIncludes
|
|
83
|
-
},
|
|
84
|
-
env: {
|
|
85
|
-
...existingEnv,
|
|
86
|
-
JUNIOR_PLUGIN_PACKAGES: JSON.stringify(configuredPluginPackages)
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
if (!sentryConfigured()) {
|
|
90
|
-
return config;
|
|
91
|
-
}
|
|
92
|
-
const { withSentryConfig } = require2("@sentry/nextjs");
|
|
93
|
-
return withSentryConfig(config, {
|
|
94
|
-
org: process.env.SENTRY_ORG,
|
|
95
|
-
project: process.env.SENTRY_PROJECT,
|
|
96
|
-
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
97
|
-
silent: !process.env.CI,
|
|
98
|
-
sourcemaps: {
|
|
99
|
-
disable: false
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function withJunior(options, nextConfig) {
|
|
104
|
-
if (typeof nextConfig === "function") {
|
|
105
|
-
return async (phase, ctx) => {
|
|
106
|
-
const resolved = await nextConfig(phase, ctx);
|
|
107
|
-
return applyJuniorConfig(resolved, options);
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return applyJuniorConfig(nextConfig, options);
|
|
111
|
-
}
|
|
112
|
-
export {
|
|
113
|
-
withJunior
|
|
114
|
-
};
|