@sentry/junior 0.53.0 → 0.54.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 +3 -2
- package/dist/api-reference.d.ts +7 -0
- package/dist/app.d.ts +5 -10
- package/dist/app.js +1934 -1658
- package/dist/build/copy-build-content.d.ts +4 -0
- package/dist/build/glob-to-regex.d.ts +2 -0
- package/dist/build/rolldown-workarounds.d.ts +14 -0
- package/dist/build/virtual-config.d.ts +4 -0
- package/dist/chat/app/factory.d.ts +10 -0
- package/dist/chat/app/production.d.ts +6 -0
- package/dist/chat/app/services.d.ts +17 -0
- package/dist/chat/capabilities/catalog.d.ts +16 -0
- package/dist/chat/capabilities/factory.d.ts +10 -0
- package/dist/chat/capabilities/jr-rpc-command.d.ts +26 -0
- package/dist/chat/capabilities/router.d.ts +19 -0
- package/dist/chat/coerce.d.ts +6 -0
- package/dist/chat/config.d.ts +46 -0
- package/dist/chat/configuration/defaults.d.ts +4 -0
- package/dist/chat/configuration/service.d.ts +2 -0
- package/dist/chat/configuration/types.d.ts +37 -0
- package/dist/chat/configuration/validation.d.ts +2 -0
- package/dist/chat/credentials/broker.d.ts +22 -0
- package/dist/chat/credentials/header-transforms.d.ts +3 -0
- package/dist/chat/credentials/oauth-scope.d.ts +4 -0
- package/dist/chat/credentials/state-adapter-token-store.d.ts +9 -0
- package/dist/chat/credentials/test-broker.d.ts +19 -0
- package/dist/chat/credentials/unlink-provider.d.ts +2 -0
- package/dist/chat/credentials/user-token-store.d.ts +11 -0
- package/dist/chat/discovery.d.ts +47 -0
- package/dist/chat/ingress/junior-chat.d.ts +26 -0
- package/dist/chat/ingress/message-changed.d.ts +50 -0
- package/dist/chat/ingress/message-router.d.ts +9 -0
- package/dist/chat/ingress/slash-command.d.ts +3 -0
- package/dist/chat/ingress/workspace-membership.d.ts +10 -0
- package/dist/chat/interruption-marker.d.ts +2 -0
- package/dist/chat/logging.d.ts +88 -0
- package/dist/chat/mcp/auth-store.d.ts +41 -0
- package/dist/chat/mcp/client.d.ts +34 -0
- package/dist/chat/mcp/errors.d.ts +8 -0
- package/dist/chat/mcp/oauth-provider.d.ts +27 -0
- package/dist/chat/mcp/oauth.d.ts +17 -0
- package/dist/chat/mcp/tool-manager.d.ts +60 -0
- package/dist/chat/oauth-flow.d.ts +45 -0
- package/dist/chat/optional-string.d.ts +5 -0
- package/dist/chat/pi/client.d.ts +49 -0
- package/dist/chat/pi/messages.d.ts +3 -0
- package/dist/chat/pi/traced-stream.d.ts +9 -0
- package/dist/chat/plugins/auth/api-headers-broker.d.ts +6 -0
- package/dist/chat/plugins/auth/auth-token-placeholder.d.ts +3 -0
- package/dist/chat/plugins/auth/github-app-broker.d.ts +4 -0
- package/dist/chat/plugins/auth/oauth-bearer-broker.d.ts +6 -0
- package/dist/chat/plugins/auth/oauth-request.d.ts +18 -0
- package/dist/chat/plugins/command-env.d.ts +3 -0
- package/dist/chat/plugins/manifest.d.ts +3 -0
- package/dist/chat/plugins/package-discovery.d.ts +14 -0
- package/dist/chat/plugins/registry.d.ts +23 -0
- package/dist/chat/plugins/types.d.ts +146 -0
- package/dist/chat/prompt.d.ts +39 -0
- package/dist/chat/queue/thread-message-dispatcher.d.ts +33 -0
- package/dist/chat/respond-helpers.d.ts +77 -0
- package/dist/chat/respond.d.ts +64 -0
- package/dist/chat/runtime/auth-pause-state.d.ts +11 -0
- package/dist/chat/runtime/delivered-turn-state.d.ts +15 -0
- package/dist/chat/runtime/dev-agent-trace.d.ts +1 -0
- package/dist/chat/runtime/processing-reaction.d.ts +25 -0
- package/dist/chat/runtime/reply-executor.d.ts +56 -0
- package/dist/chat/runtime/report-progress.d.ts +3 -0
- package/dist/chat/runtime/slack-resume.d.ts +50 -0
- package/dist/chat/runtime/slack-runtime.d.ts +100 -0
- package/dist/chat/runtime/thread-context.d.ts +22 -0
- package/dist/chat/runtime/thread-state.d.ts +28 -0
- package/dist/chat/runtime/turn-preparation.d.ts +43 -0
- package/dist/chat/runtime/turn-user-message.d.ts +12 -0
- package/dist/chat/runtime/turn.d.ts +69 -0
- package/dist/chat/sandbox/credentials.d.ts +11 -0
- package/dist/chat/sandbox/egress-oidc.d.ts +3 -0
- package/dist/chat/sandbox/egress-policy.d.ts +11 -0
- package/dist/chat/sandbox/egress-proxy.d.ts +10 -0
- package/dist/chat/sandbox/egress-session.d.ts +27 -0
- package/dist/chat/sandbox/errors.d.ts +12 -0
- package/dist/chat/sandbox/eval-gh-stub.d.ts +2 -0
- package/dist/chat/sandbox/eval-oauth-stub.d.ts +2 -0
- package/dist/chat/sandbox/eval-sentry-stub.d.ts +2 -0
- package/dist/chat/sandbox/fault-injection.d.ts +2 -0
- package/dist/chat/sandbox/http-error-details.d.ts +18 -0
- package/dist/chat/sandbox/noninteractive-command.d.ts +17 -0
- package/dist/chat/sandbox/paths.d.ts +5 -0
- package/dist/chat/sandbox/runtime-dependency-snapshots.d.ts +20 -0
- package/dist/chat/sandbox/sandbox.d.ts +52 -0
- package/dist/chat/sandbox/session.d.ts +53 -0
- package/dist/chat/sandbox/skill-sandbox.d.ts +42 -0
- package/dist/chat/sandbox/skill-sync.d.ts +17 -0
- package/dist/chat/sandbox/workspace.d.ts +55 -0
- package/dist/chat/sentry.d.ts +2 -0
- package/dist/chat/services/attachment-claims.d.ts +2 -0
- package/dist/chat/services/auth-pause-response.d.ts +2 -0
- package/dist/chat/services/auth-pause.d.ts +12 -0
- package/dist/chat/services/channel-intent.d.ts +2 -0
- package/dist/chat/services/conversation-memory.d.ts +33 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +29 -0
- package/dist/chat/services/pending-auth.d.ts +27 -0
- package/dist/chat/services/plugin-auth-orchestration.d.ts +36 -0
- package/dist/chat/services/provider-default-config.d.ts +9 -0
- package/dist/chat/services/provider-retry.d.ts +6 -0
- package/dist/chat/services/reply-delivery-plan.d.ts +17 -0
- package/dist/chat/services/subscribed-decision.d.ts +63 -0
- package/dist/chat/services/subscribed-reply-policy.d.ts +23 -0
- package/dist/chat/services/timeout-resume.d.ts +17 -0
- package/dist/chat/services/turn-checkpoint.d.ts +74 -0
- package/dist/chat/services/turn-continuation-response.d.ts +2 -0
- package/dist/chat/services/turn-failure-response.d.ts +15 -0
- package/dist/chat/services/turn-result.d.ts +55 -0
- package/dist/chat/services/turn-thinking-level.d.ts +49 -0
- package/dist/chat/services/vision-context.d.ts +61 -0
- package/dist/chat/skills.d.ts +48 -0
- package/dist/chat/slack/adapter.d.ts +9 -0
- package/dist/chat/slack/app-home.d.ts +11 -0
- package/dist/chat/slack/assistant-thread/lifecycle.d.ts +13 -0
- package/dist/chat/slack/assistant-thread/status-render.d.ts +28 -0
- package/dist/chat/slack/assistant-thread/status-scheduler.d.ts +23 -0
- package/dist/chat/slack/assistant-thread/status-send.d.ts +31 -0
- package/dist/chat/slack/assistant-thread/status.d.ts +36 -0
- package/dist/chat/slack/assistant-thread/title.d.ts +28 -0
- package/dist/chat/slack/canvas-references.d.ts +2 -0
- package/dist/chat/slack/channel.d.ts +48 -0
- package/dist/chat/slack/client.d.ts +52 -0
- package/dist/chat/slack/context.d.ts +9 -0
- package/dist/chat/slack/emoji.d.ts +1 -0
- package/dist/chat/slack/errors.d.ts +6 -0
- package/dist/chat/slack/footer.d.ts +42 -0
- package/dist/chat/slack/legacy-attachments.d.ts +4 -0
- package/dist/chat/slack/message.d.ts +6 -0
- package/dist/chat/slack/mrkdwn.d.ts +12 -0
- package/dist/chat/slack/outbound.d.ts +57 -0
- package/dist/chat/slack/output.d.ts +54 -0
- package/dist/chat/slack/reply.d.ts +33 -0
- package/dist/chat/slack/status-format.d.ts +2 -0
- package/dist/chat/slack/turn-continuation-notice.d.ts +8 -0
- package/dist/chat/slack/user.d.ts +7 -0
- package/dist/chat/slack/users.d.ts +39 -0
- package/dist/chat/state/adapter.d.ts +9 -0
- package/dist/chat/state/artifacts.d.ts +29 -0
- package/dist/chat/state/conversation.d.ts +81 -0
- package/dist/chat/state/pi-session-message-store.d.ts +15 -0
- package/dist/chat/state/turn-id.d.ts +2 -0
- package/dist/chat/state/turn-session-store.d.ts +49 -0
- package/dist/chat/tools/advisor/session-store.d.ts +9 -0
- package/dist/chat/tools/advisor/tool.d.ts +33 -0
- package/dist/chat/tools/agent-tools.d.ts +9 -0
- package/dist/chat/tools/channel-capabilities.d.ts +11 -0
- package/dist/chat/tools/definition.d.ts +17 -0
- package/dist/chat/tools/execution/build-sandbox-input.d.ts +2 -0
- package/dist/chat/tools/execution/normalize-result.d.ts +6 -0
- package/dist/chat/tools/execution/tool-error-handler.d.ts +3 -0
- package/dist/chat/tools/execution/tool-input-error.d.ts +6 -0
- package/dist/chat/tools/idempotency.d.ts +1 -0
- package/dist/chat/tools/index.d.ts +5 -0
- package/dist/chat/tools/runtime/report-progress.d.ts +4 -0
- package/dist/chat/tools/sandbox/attach-file.d.ts +7 -0
- package/dist/chat/tools/sandbox/bash.d.ts +5 -0
- package/dist/chat/tools/sandbox/edit-file.d.ts +37 -0
- package/dist/chat/tools/sandbox/file-utils.d.ts +52 -0
- package/dist/chat/tools/sandbox/find-files.d.ts +24 -0
- package/dist/chat/tools/sandbox/grep.d.ts +33 -0
- package/dist/chat/tools/sandbox/list-dir.d.ts +22 -0
- package/dist/chat/tools/sandbox/read-file.d.ts +32 -0
- package/dist/chat/tools/sandbox/text-edits.d.ts +28 -0
- package/dist/chat/tools/sandbox/write-file.d.ts +5 -0
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +7 -0
- package/dist/chat/tools/skill/load-skill.d.ts +22 -0
- package/dist/chat/tools/skill/mcp-tool-summary.d.ts +31 -0
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +8 -0
- package/dist/chat/tools/slack/canvas-tools.d.ts +29 -0
- package/dist/chat/tools/slack/canvases.d.ts +45 -0
- package/dist/chat/tools/slack/channel-list-messages.d.ts +9 -0
- package/dist/chat/tools/slack/channel-post-message.d.ts +4 -0
- package/dist/chat/tools/slack/list-tools.d.ts +21 -0
- package/dist/chat/tools/slack/lists.d.ts +42 -0
- package/dist/chat/tools/slack/message-add-reaction.d.ts +4 -0
- package/dist/chat/tools/slack/slack-message-url.d.ts +18 -0
- package/dist/chat/tools/slack/thread-read.d.ts +9 -0
- package/dist/chat/tools/slack/user-lookup.d.ts +8 -0
- package/dist/chat/tools/system-time.d.ts +1 -0
- package/dist/chat/tools/types.d.ts +55 -0
- package/dist/chat/tools/web/constants.d.ts +6 -0
- package/dist/chat/tools/web/fetch-content.d.ts +23 -0
- package/dist/chat/tools/web/fetch-tool.d.ts +5 -0
- package/dist/chat/tools/web/image-generate.d.ts +4 -0
- package/dist/chat/tools/web/network.d.ts +6 -0
- package/dist/chat/tools/web/search.d.ts +5 -0
- package/dist/chat/turn-context-tag.d.ts +6 -0
- package/dist/chat/usage.d.ts +24 -0
- package/dist/chat/xml.d.ts +1 -0
- package/dist/{chunk-XPXD3FCE.js → chunk-5LUISFEY.js} +189 -35
- package/dist/{chunk-KCOKQLBF.js → chunk-7WTXNEPF.js} +120 -15
- package/dist/{chunk-ZNFNY53B.js → chunk-QCHPJ4FD.js} +2 -2
- package/dist/{chunk-Q3FDONU7.js → chunk-YITDDLS3.js} +34 -28
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +1 -0
- package/dist/cli/snapshot-warmup.js +3 -3
- package/dist/handlers/diagnostics-dashboard.d.ts +2 -0
- package/dist/handlers/diagnostics.d.ts +2 -0
- package/dist/handlers/health.d.ts +4 -0
- package/dist/handlers/mcp-oauth-callback.d.ts +2 -0
- package/dist/handlers/oauth-callback.d.ts +2 -0
- package/dist/handlers/oauth-html.d.ts +2 -0
- package/dist/handlers/sandbox-egress-proxy.d.ts +4 -0
- package/dist/handlers/turn-resume.d.ts +3 -0
- package/dist/handlers/types.d.ts +2 -0
- package/dist/handlers/webhooks.d.ts +15 -0
- package/dist/instrumentation.d.ts +1 -3
- package/dist/nitro.d.ts +4 -7
- package/dist/nitro.js +112 -54
- package/dist/package-resolution.d.ts +13 -0
- package/dist/vercel.d.ts +2 -4
- package/package.json +25 -25
- package/dist/cli/check.d.ts +0 -8
- package/dist/cli/env.d.ts +0 -7
- package/dist/cli/init.d.ts +0 -3
- package/dist/cli/run.d.ts +0 -12
- package/dist/cli/snapshot-warmup.d.ts +0 -3
- package/dist/types-X_iCClPb.d.ts +0 -75
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Handles Vercel Sandbox firewall egress proxy requests. */
|
|
2
|
+
export declare function ALL(request: Request): Promise<Response>;
|
|
3
|
+
/** Return whether a request should be routed through sandbox egress proxying. */
|
|
4
|
+
export declare function isSandboxEgressRequest(request: Request): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WaitUntilFn } from "@/handlers/types";
|
|
2
|
+
/**
|
|
3
|
+
* Handles `POST /api/webhooks/:platform`.
|
|
4
|
+
*
|
|
5
|
+
* The router only resolves the platform and delegates to the adapter webhook
|
|
6
|
+
* implementation; request semantics stay owned by the adapter package.
|
|
7
|
+
*
|
|
8
|
+
* For Slack, the body is read once and used to detect `message_changed` events
|
|
9
|
+
* that introduce a new bot @mention, which the Slack adapter silently ignores.
|
|
10
|
+
* The request is then reconstructed so the adapter can consume it normally.
|
|
11
|
+
*/
|
|
12
|
+
export declare function handlePlatformWebhook(request: Request, platform: string, waitUntil: WaitUntilFn, bot?: import("../chat/ingress/junior-chat").JuniorChat<{
|
|
13
|
+
slack: import("@chat-adapter/slack").SlackAdapter;
|
|
14
|
+
}>): Promise<Response>;
|
|
15
|
+
export declare function POST(request: Request, platform: string, waitUntil: WaitUntilFn): Promise<Response>;
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface JuniorNitroOptions {
|
|
1
|
+
import type { PluginConfig } from "@/chat/plugins/types";
|
|
2
|
+
export interface JuniorNitroOptions {
|
|
4
3
|
cwd?: string;
|
|
5
4
|
maxDuration?: number;
|
|
6
5
|
/** Plugin packages and manifest overrides bundled into the app. */
|
|
@@ -9,15 +8,13 @@ interface JuniorNitroOptions {
|
|
|
9
8
|
* Extra file patterns to copy into the server output for files that the
|
|
10
9
|
* bundler cannot trace (e.g. dynamically imported providers).
|
|
11
10
|
* Each entry is `"<package-name>/<subpath-glob>"`, resolved via Node
|
|
12
|
-
* module resolution. Example: `"@
|
|
11
|
+
* module resolution. Example: `"@earendil-works/pi-ai/dist/providers/*.js"`
|
|
13
12
|
*/
|
|
14
13
|
includeFiles?: string[];
|
|
15
14
|
}
|
|
16
15
|
/** Nitro module that copies app and plugin content into the Vercel build output. */
|
|
17
|
-
declare function juniorNitro(options?: JuniorNitroOptions): {
|
|
16
|
+
export declare function juniorNitro(options?: JuniorNitroOptions): {
|
|
18
17
|
nitro: {
|
|
19
18
|
setup(nitro: unknown): void;
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
export { type JuniorNitroOptions, juniorNitro };
|
package/dist/nitro.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
discoverInstalledPluginPackageContent
|
|
3
|
-
|
|
2
|
+
discoverInstalledPluginPackageContent,
|
|
3
|
+
isValidPackageName,
|
|
4
|
+
resolvePackageDir
|
|
5
|
+
} from "./chunk-5LUISFEY.js";
|
|
4
6
|
import "./chunk-2KG3PWR4.js";
|
|
5
7
|
|
|
6
8
|
// src/nitro.ts
|
|
7
|
-
import
|
|
9
|
+
import path2 from "path";
|
|
8
10
|
|
|
9
11
|
// src/build/rolldown-workarounds.ts
|
|
10
12
|
function applyRolldownTreeshakeWorkaround(nitro) {
|
|
@@ -18,8 +20,8 @@ function applyRolldownTreeshakeWorkaround(nitro) {
|
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
// src/build/copy-build-content.ts
|
|
21
|
-
import { cpSync, existsSync
|
|
22
|
-
import
|
|
23
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "fs";
|
|
24
|
+
import path from "path";
|
|
23
25
|
|
|
24
26
|
// src/build/glob-to-regex.ts
|
|
25
27
|
function globToRegex(pattern) {
|
|
@@ -27,39 +29,18 @@ function globToRegex(pattern) {
|
|
|
27
29
|
return new RegExp(`^${escaped}$`);
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
// src/build/resolve-package.ts
|
|
31
|
-
import { existsSync } from "fs";
|
|
32
|
-
import path from "path";
|
|
33
|
-
import { fileURLToPath } from "url";
|
|
34
|
-
function resolvePackageDir(pkgName) {
|
|
35
|
-
try {
|
|
36
|
-
const resolved = import.meta.resolve(pkgName);
|
|
37
|
-
const entry = resolved.startsWith("file://") ? fileURLToPath(resolved) : resolved;
|
|
38
|
-
let dir = path.dirname(entry);
|
|
39
|
-
while (dir !== path.dirname(dir)) {
|
|
40
|
-
if (existsSync(path.join(dir, "package.json"))) return dir;
|
|
41
|
-
dir = path.dirname(dir);
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
32
|
// src/build/copy-build-content.ts
|
|
49
33
|
function copyAppAndPluginContent(cwd, serverRoot, packageNames) {
|
|
50
|
-
copyIfExists(
|
|
34
|
+
copyIfExists(path.join(cwd, "app"), path.join(serverRoot, "app"));
|
|
51
35
|
const packagedContent = discoverInstalledPluginPackageContent(cwd, {
|
|
52
36
|
packageNames
|
|
53
37
|
});
|
|
54
38
|
for (const root of packagedContent.manifestRoots) {
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (!relative || path2.isAbsolute(relative) || relative.startsWith("..")) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
39
|
+
if (existsSync(path.join(root, "plugin.yaml"))) {
|
|
40
|
+
const manifestPath = path.join(root, "plugin.yaml");
|
|
60
41
|
copyIfExists(
|
|
61
|
-
|
|
62
|
-
|
|
42
|
+
manifestPath,
|
|
43
|
+
resolveServerOutputPath(cwd, serverRoot, manifestPath)
|
|
63
44
|
);
|
|
64
45
|
continue;
|
|
65
46
|
}
|
|
@@ -69,43 +50,119 @@ function copyAppAndPluginContent(cwd, serverRoot, packageNames) {
|
|
|
69
50
|
copyRootIntoServerOutput(cwd, serverRoot, root);
|
|
70
51
|
}
|
|
71
52
|
}
|
|
72
|
-
function copyIncludedFiles(serverRoot, patterns) {
|
|
73
|
-
if (
|
|
53
|
+
function copyIncludedFiles(cwd, serverRoot, patterns) {
|
|
54
|
+
if (patterns === void 0) return;
|
|
55
|
+
if (!Array.isArray(patterns)) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
"includeFiles must be an array of package subpath patterns"
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (patterns.length === 0) return;
|
|
74
61
|
for (const pattern of patterns) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
if (typeof pattern !== "string" || !pattern.trim()) {
|
|
63
|
+
throw new Error("includeFiles entries must be package subpath patterns");
|
|
64
|
+
}
|
|
65
|
+
const { pkgName, subDir, fileGlob } = parseIncludePattern(pattern);
|
|
66
|
+
const pkgDir = resolvePackageDir(cwd, pkgName);
|
|
67
|
+
if (!pkgDir) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`includeFiles entry "${pattern}" references package "${pkgName}", but it could not be resolved`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const sourceDir = path.join(pkgDir, subDir);
|
|
73
|
+
if (!isDirectory(sourceDir)) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`includeFiles entry "${pattern}" references missing directory ${sourceDir}`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
85
78
|
const entries = readdirSync(sourceDir);
|
|
86
79
|
const re = fileGlob.includes("*") ? globToRegex(fileGlob) : null;
|
|
80
|
+
let matched = false;
|
|
81
|
+
let copied = false;
|
|
87
82
|
for (const entry of entries) {
|
|
88
83
|
if (re ? !re.test(entry) : entry !== fileGlob) continue;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
matched = true;
|
|
85
|
+
copied = copyIfExists(
|
|
86
|
+
path.join(sourceDir, entry),
|
|
87
|
+
path.join(serverRoot, "node_modules", pkgName, subDir, entry)
|
|
88
|
+
) || copied;
|
|
89
|
+
}
|
|
90
|
+
if (!matched) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`includeFiles entry "${pattern}" did not match any files in ${sourceDir}`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (!copied) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`includeFiles entry "${pattern}" matched files in ${sourceDir} but did not copy any existing files`
|
|
92
98
|
);
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
}
|
|
102
|
+
function parseIncludePattern(pattern) {
|
|
103
|
+
const normalized = pattern.trim().replace(/^node_modules\//, "");
|
|
104
|
+
const parts = normalized.split("/");
|
|
105
|
+
if (!normalized || path.isAbsolute(normalized) || parts.some((part) => !part || part === "." || part === "..")) {
|
|
106
|
+
throw new Error(
|
|
107
|
+
`includeFiles entry "${pattern}" must be a package subpath pattern`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const isScopedPackage = parts[0].startsWith("@");
|
|
111
|
+
const packagePartCount = isScopedPackage ? 2 : 1;
|
|
112
|
+
const pkgName = parts.slice(0, packagePartCount).join("/");
|
|
113
|
+
const subpath = parts.slice(packagePartCount).join("/");
|
|
114
|
+
if (!pkgName || !isValidPackageName(pkgName) || !subpath) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
`includeFiles entry "${pattern}" must include a package subpath`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
pkgName,
|
|
121
|
+
subDir: path.dirname(subpath),
|
|
122
|
+
fileGlob: path.basename(subpath)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function isDirectory(targetPath) {
|
|
126
|
+
try {
|
|
127
|
+
return statSync(targetPath).isDirectory();
|
|
128
|
+
} catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
96
132
|
function copyIfExists(source, target) {
|
|
97
|
-
if (!
|
|
98
|
-
return;
|
|
133
|
+
if (!existsSync(source)) {
|
|
134
|
+
return false;
|
|
99
135
|
}
|
|
100
|
-
mkdirSync(
|
|
136
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
101
137
|
cpSync(source, target, { recursive: true });
|
|
138
|
+
return true;
|
|
102
139
|
}
|
|
103
140
|
function copyRootIntoServerOutput(cwd, serverRoot, root) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
copyIfExists(root, resolveServerOutputPath(cwd, serverRoot, root));
|
|
142
|
+
}
|
|
143
|
+
function resolveServerOutputPath(cwd, serverRoot, sourcePath) {
|
|
144
|
+
const relative = path.relative(cwd, sourcePath);
|
|
145
|
+
if (isLocalRelativePath(relative)) {
|
|
146
|
+
return path.join(serverRoot, relative);
|
|
147
|
+
}
|
|
148
|
+
const nodeModulesRelative = nodeModulesRelativePath(sourcePath);
|
|
149
|
+
if (nodeModulesRelative) {
|
|
150
|
+
return path.join(serverRoot, nodeModulesRelative);
|
|
107
151
|
}
|
|
108
|
-
|
|
152
|
+
throw new Error(
|
|
153
|
+
`Cannot copy configured plugin content outside the app root or node_modules: ${sourcePath}`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function isLocalRelativePath(relativePath) {
|
|
157
|
+
return Boolean(relativePath) && !path.isAbsolute(relativePath) && relativePath !== ".." && !relativePath.startsWith(`..${path.sep}`);
|
|
158
|
+
}
|
|
159
|
+
function nodeModulesRelativePath(sourcePath) {
|
|
160
|
+
const parts = path.resolve(sourcePath).split(path.sep);
|
|
161
|
+
const nodeModulesIndex = parts.lastIndexOf("node_modules");
|
|
162
|
+
if (nodeModulesIndex === -1 || nodeModulesIndex === parts.length - 1) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return path.join("node_modules", ...parts.slice(nodeModulesIndex + 1));
|
|
109
166
|
}
|
|
110
167
|
|
|
111
168
|
// src/build/virtual-config.ts
|
|
@@ -118,7 +175,7 @@ function juniorNitro(options = {}) {
|
|
|
118
175
|
return {
|
|
119
176
|
nitro: {
|
|
120
177
|
setup(nitro) {
|
|
121
|
-
const cwd =
|
|
178
|
+
const cwd = path2.resolve(
|
|
122
179
|
options.cwd ?? nitro.options.rootDir ?? process.cwd()
|
|
123
180
|
);
|
|
124
181
|
nitro.options.vercel ??= {};
|
|
@@ -133,6 +190,7 @@ function juniorNitro(options = {}) {
|
|
|
133
190
|
options.plugins?.packages
|
|
134
191
|
);
|
|
135
192
|
copyIncludedFiles(
|
|
193
|
+
cwd,
|
|
136
194
|
nitro.options.output.serverDir,
|
|
137
195
|
options.includeFiles
|
|
138
196
|
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ResolvedPackageLocation {
|
|
2
|
+
dir: string;
|
|
3
|
+
nodeModulesDir?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ResolvePackageLocationOptions {
|
|
6
|
+
nodeModulesDirs?: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Return whether a string is shaped like an npm package name. */
|
|
9
|
+
export declare function isValidPackageName(packageName: string): boolean;
|
|
10
|
+
/** Resolve a package root from an app cwd without requiring the package to expose a JS entry point. */
|
|
11
|
+
export declare function resolvePackageLocation(cwd: string, packageName: string, options?: ResolvePackageLocationOptions): ResolvedPackageLocation | undefined;
|
|
12
|
+
/** Resolve a package root directory from an app cwd. */
|
|
13
|
+
export declare function resolvePackageDir(cwd: string, packageName: string): string | undefined;
|
package/dist/vercel.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
interface JuniorVercelConfigOptions {
|
|
1
|
+
export interface JuniorVercelConfigOptions {
|
|
2
2
|
buildCommand?: string | null;
|
|
3
3
|
}
|
|
4
4
|
/** Return a minimal Vercel config for scaffolded Junior apps. */
|
|
5
|
-
declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
|
|
6
|
-
|
|
7
|
-
export { type JuniorVercelConfigOptions, juniorVercelConfig };
|
|
5
|
+
export declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,26 +20,26 @@
|
|
|
20
20
|
"bin"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@ai-sdk/gateway": "^3.0.
|
|
24
|
-
"@chat-adapter/slack": "4.
|
|
25
|
-
"@chat-adapter/state-memory": "4.
|
|
26
|
-
"@chat-adapter/state-redis": "4.
|
|
27
|
-
"@logtape/logtape": "^2.
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
23
|
+
"@ai-sdk/gateway": "^3.0.119",
|
|
24
|
+
"@chat-adapter/slack": "4.29.0",
|
|
25
|
+
"@chat-adapter/state-memory": "4.29.0",
|
|
26
|
+
"@chat-adapter/state-redis": "4.29.0",
|
|
27
|
+
"@logtape/logtape": "^2.1.1",
|
|
28
|
+
"@earendil-works/pi-agent-core": "0.74.2",
|
|
29
|
+
"@earendil-works/pi-ai": "0.74.2",
|
|
30
30
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
31
31
|
"@sinclair/typebox": "^0.34.49",
|
|
32
|
-
"@slack/web-api": "^7.
|
|
33
|
-
"@vercel/functions": "^3.
|
|
34
|
-
"@vercel/sandbox": "2.0.0
|
|
35
|
-
"ai": "^6.0.
|
|
32
|
+
"@slack/web-api": "^7.16.0",
|
|
33
|
+
"@vercel/functions": "^3.6.0",
|
|
34
|
+
"@vercel/sandbox": "2.0.0",
|
|
35
|
+
"ai": "^6.0.190",
|
|
36
36
|
"bash-tool": "^1.3.16",
|
|
37
|
-
"chat": "4.
|
|
38
|
-
"hono": "^4.12.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
37
|
+
"chat": "4.29.0",
|
|
38
|
+
"hono": "^4.12.22",
|
|
39
|
+
"jose": "^6.2.3",
|
|
40
|
+
"just-bash": "3.0.1",
|
|
41
41
|
"node-html-markdown": "^2.0.0",
|
|
42
|
-
"yaml": "^2.
|
|
42
|
+
"yaml": "^2.9.0",
|
|
43
43
|
"zod": "^4.4.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@sentry/node": "10.53.1",
|
|
50
|
-
"@types/node": "^25.
|
|
50
|
+
"@types/node": "^25.9.1",
|
|
51
51
|
"dependency-cruiser": "^17.4.0",
|
|
52
|
-
"msw": "^2.14.
|
|
53
|
-
"nitro": "3.0.
|
|
54
|
-
"oxlint": "^1.
|
|
52
|
+
"msw": "^2.14.6",
|
|
53
|
+
"nitro": "3.0.260522-beta",
|
|
54
|
+
"oxlint": "^1.66.0",
|
|
55
55
|
"tsup": "^8.5.1",
|
|
56
|
-
"typescript": "^
|
|
57
|
-
"vercel": "^
|
|
58
|
-
"vitest": "^4.1.
|
|
56
|
+
"typescript": "^6.0.3",
|
|
57
|
+
"vercel": "^54.4.0",
|
|
58
|
+
"vitest": "^4.1.7"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
|
-
"build": "tsup",
|
|
61
|
+
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
62
62
|
"lint": "oxlint --config .oxlintrc.json --deny-warnings src tests scripts bin tsup.config.ts",
|
|
63
63
|
"lint:fix": "oxlint --config .oxlintrc.json --deny-warnings --fix src tests scripts bin tsup.config.ts",
|
|
64
64
|
"test": "pnpm run test:slack-boundary && pnpm run test:arch-boundary && vitest run",
|
package/dist/cli/check.d.ts
DELETED
package/dist/cli/env.d.ts
DELETED
package/dist/cli/init.d.ts
DELETED
package/dist/cli/run.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const CLI_USAGE = "usage: junior init <dir>\n junior snapshot create\n junior check [dir]";
|
|
2
|
-
interface CliHandlers {
|
|
3
|
-
runInit: (dir: string) => Promise<void>;
|
|
4
|
-
runSnapshotCreate: () => Promise<void>;
|
|
5
|
-
runCheck: (dir?: string) => Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
interface CliIo {
|
|
8
|
-
error: (line: string) => void;
|
|
9
|
-
}
|
|
10
|
-
declare function runCli(argv: string[], handlers: CliHandlers, io?: CliIo): Promise<number>;
|
|
11
|
-
|
|
12
|
-
export { CLI_USAGE, runCli };
|
package/dist/types-X_iCClPb.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
interface PluginOAuthConfig {
|
|
2
|
-
clientIdEnv: string;
|
|
3
|
-
clientSecretEnv: string;
|
|
4
|
-
authorizeEndpoint: string;
|
|
5
|
-
tokenEndpoint: string;
|
|
6
|
-
scope?: string;
|
|
7
|
-
authorizeParams?: Record<string, string>;
|
|
8
|
-
tokenAuthMethod?: "body" | "basic";
|
|
9
|
-
tokenExtraHeaders?: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
interface PluginRuntimePostinstallCommand {
|
|
12
|
-
cmd: string;
|
|
13
|
-
args?: string[];
|
|
14
|
-
sudo?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface PluginEnvVarDeclaration {
|
|
17
|
-
default?: string;
|
|
18
|
-
}
|
|
19
|
-
type PluginRuntimeDependencyConfig = {
|
|
20
|
-
type: "npm";
|
|
21
|
-
package: string;
|
|
22
|
-
version?: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: "system";
|
|
25
|
-
package: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: "system";
|
|
28
|
-
url: string;
|
|
29
|
-
sha256: string;
|
|
30
|
-
};
|
|
31
|
-
interface PluginOAuthConfigPatch extends Omit<Partial<PluginOAuthConfig>, "authorizeParams" | "tokenExtraHeaders"> {
|
|
32
|
-
authorizeParams?: Record<string, string | null> | null;
|
|
33
|
-
tokenExtraHeaders?: Record<string, string | null> | null;
|
|
34
|
-
}
|
|
35
|
-
/** Install-level changes applied to one plugin manifest before validation. */
|
|
36
|
-
interface PluginManifestConfig {
|
|
37
|
-
description?: string;
|
|
38
|
-
capabilities?: string[];
|
|
39
|
-
configKeys?: string[];
|
|
40
|
-
domains?: string[] | null;
|
|
41
|
-
apiHeaders?: Record<string, string | null> | null;
|
|
42
|
-
commandEnv?: Record<string, string | null> | null;
|
|
43
|
-
envVars?: Record<string, PluginEnvVarDeclaration | null> | null;
|
|
44
|
-
credentials?: {
|
|
45
|
-
type?: "oauth-bearer" | "github-app";
|
|
46
|
-
domains?: string[];
|
|
47
|
-
apiHeaders?: Record<string, string | null> | null;
|
|
48
|
-
authTokenEnv?: string;
|
|
49
|
-
authTokenPlaceholder?: string | null;
|
|
50
|
-
appIdEnv?: string;
|
|
51
|
-
privateKeyEnv?: string;
|
|
52
|
-
installationIdEnv?: string;
|
|
53
|
-
} | null;
|
|
54
|
-
runtimeDependencies?: PluginRuntimeDependencyConfig[] | null;
|
|
55
|
-
runtimePostinstall?: PluginRuntimePostinstallCommand[] | null;
|
|
56
|
-
mcp?: {
|
|
57
|
-
transport?: "http";
|
|
58
|
-
url?: string;
|
|
59
|
-
headers?: Record<string, string | null> | null;
|
|
60
|
-
allowedTools?: string[] | null;
|
|
61
|
-
} | null;
|
|
62
|
-
oauth?: PluginOAuthConfigPatch | null;
|
|
63
|
-
target?: {
|
|
64
|
-
type?: string;
|
|
65
|
-
configKey?: string;
|
|
66
|
-
commandFlags?: string[] | null;
|
|
67
|
-
} | null;
|
|
68
|
-
}
|
|
69
|
-
/** Install-level plugin package list and manifest configuration. */
|
|
70
|
-
interface PluginConfig {
|
|
71
|
-
packages?: string[];
|
|
72
|
-
manifests?: Record<string, PluginManifestConfig>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export type { PluginConfig as P };
|