@sentry/junior 0.80.1 → 0.82.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-ZGTDOXQY.js → agent-hooks-5ZRILRC3.js} +1 -1
- package/dist/app.js +7 -905
- package/dist/chat/agent-dispatch/runner.d.ts +1 -1
- package/dist/chat/app/services.d.ts +1 -1
- package/dist/chat/egress/credentialed.d.ts +57 -0
- package/dist/chat/egress/plugin.d.ts +24 -0
- package/dist/chat/plugins/credential-hooks.d.ts +2 -0
- package/dist/chat/respond.d.ts +1 -1
- package/dist/chat/sandbox/{egress-credentials.d.ts → egress/credentials.d.ts} +28 -5
- package/dist/chat/sandbox/egress/policy.d.ts +32 -0
- package/dist/chat/sandbox/egress/proxy.d.ts +35 -0
- package/dist/chat/sandbox/{egress-session.d.ts → egress/session.d.ts} +41 -11
- package/dist/chat/sandbox/sandbox.d.ts +2 -2
- package/dist/chat/tools/types.d.ts +2 -1
- package/dist/{chunk-W2QGQCKG.js → chunk-NC6LR6U4.js} +1062 -14
- package/dist/{chunk-Y3YUOEAZ.js → chunk-TR2G37II.js} +14 -5
- package/dist/{chunk-RV5RYIJW.js → chunk-UXPG6ZIN.js} +28 -0
- package/dist/cli/chat.js +3 -3
- package/dist/cli/env.js +7 -1
- package/dist/cli/init.js +1 -0
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +1 -1
- package/dist/handlers/agent-dispatch.d.ts +1 -1
- package/dist/handlers/sandbox-egress-proxy.d.ts +2 -2
- package/dist/reporting.js +1 -1
- package/dist/{runner-JOVPVMIH.js → runner-VRFJLG2M.js} +2 -2
- package/package.json +6 -5
- package/dist/chat/sandbox/egress-policy.d.ts +0 -15
- package/dist/chat/sandbox/egress-proxy.d.ts +0 -19
- /package/dist/chat/sandbox/{egress-oidc.d.ts → egress/oidc.d.ts} +0 -0
- /package/dist/chat/sandbox/{egress-schemas.d.ts → egress/schemas.d.ts} +0 -0
- /package/dist/chat/sandbox/{egress-tracing.d.ts → egress/tracing.d.ts} +0 -0
|
@@ -231,6 +231,11 @@ function basePluginContext(plugin) {
|
|
|
231
231
|
db: getDb()
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
+
function pluginToolNamespace(pluginName) {
|
|
235
|
+
const parts = pluginName.split("-").filter(Boolean);
|
|
236
|
+
const [first = "plugin", ...rest] = parts;
|
|
237
|
+
return `${first}${rest.map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join("")}`;
|
|
238
|
+
}
|
|
234
239
|
function systemPromptPluginContext(plugin) {
|
|
235
240
|
return {
|
|
236
241
|
...basePluginContext(plugin)
|
|
@@ -489,6 +494,7 @@ function getPluginTools(context) {
|
|
|
489
494
|
source: context.source,
|
|
490
495
|
userText: context.userText,
|
|
491
496
|
embedder: createPluginEmbedder(pluginName),
|
|
497
|
+
egress: context.egress,
|
|
492
498
|
model: createPluginModel(pluginName, plugin.model),
|
|
493
499
|
state: createPluginState(pluginName)
|
|
494
500
|
};
|
|
@@ -506,17 +512,20 @@ function getPluginTools(context) {
|
|
|
506
512
|
source: context.source,
|
|
507
513
|
userText: context.userText,
|
|
508
514
|
embedder: createPluginEmbedder(pluginName),
|
|
515
|
+
egress: context.egress,
|
|
509
516
|
model: createPluginModel(pluginName, plugin.model),
|
|
510
517
|
state: createPluginState(pluginName)
|
|
511
518
|
};
|
|
512
519
|
}
|
|
513
520
|
const pluginTools = hook(pluginContext);
|
|
514
|
-
|
|
515
|
-
|
|
521
|
+
const namespace = pluginToolNamespace(pluginName);
|
|
522
|
+
for (const [localName, tool] of Object.entries(pluginTools)) {
|
|
523
|
+
if (!PLUGIN_TOOL_NAME_RE.test(localName)) {
|
|
516
524
|
throw new Error(
|
|
517
|
-
`Plugin tool "${
|
|
525
|
+
`Plugin tool "${localName}" from plugin "${pluginName}" must be a camelCase identifier`
|
|
518
526
|
);
|
|
519
527
|
}
|
|
528
|
+
const name = `${namespace}_${localName}`;
|
|
520
529
|
if (tools[name]) {
|
|
521
530
|
throw new Error(
|
|
522
531
|
`Duplicate plugin tool "${name}" from plugin "${pluginName}"`
|
|
@@ -524,8 +533,8 @@ function getPluginTools(context) {
|
|
|
524
533
|
}
|
|
525
534
|
const definition = tool;
|
|
526
535
|
definition.identity = {
|
|
527
|
-
id: `${pluginName}.${
|
|
528
|
-
name,
|
|
536
|
+
id: `${pluginName}.${localName}`,
|
|
537
|
+
name: localName,
|
|
529
538
|
plugin: pluginName
|
|
530
539
|
};
|
|
531
540
|
tools[name] = definition;
|
|
@@ -10,6 +10,30 @@ function envFileNames(nodeEnv) {
|
|
|
10
10
|
".env.example"
|
|
11
11
|
];
|
|
12
12
|
}
|
|
13
|
+
var JUNIOR_LOCAL_DEV_INTERNAL_SECRET = "junior-local-dev-internal";
|
|
14
|
+
var JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET = "junior-local-dev-heartbeat";
|
|
15
|
+
function hasValue(value) {
|
|
16
|
+
return typeof value === "string" && value.trim() !== "";
|
|
17
|
+
}
|
|
18
|
+
function applyJuniorDevelopmentDefaults(env, options = {}) {
|
|
19
|
+
const nodeEnv = env.NODE_ENV ?? "development";
|
|
20
|
+
if (nodeEnv !== "development") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!hasValue(env.JUNIOR_SECRET)) {
|
|
24
|
+
env.JUNIOR_SECRET = JUNIOR_LOCAL_DEV_INTERNAL_SECRET;
|
|
25
|
+
}
|
|
26
|
+
if (!hasValue(env.JUNIOR_STATE_ADAPTER)) {
|
|
27
|
+
env.JUNIOR_STATE_ADAPTER = "memory";
|
|
28
|
+
}
|
|
29
|
+
if (!hasValue(env.JUNIOR_SCHEDULER_SECRET) && !hasValue(env.CRON_SECRET)) {
|
|
30
|
+
env.JUNIOR_SCHEDULER_SECRET = JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET;
|
|
31
|
+
}
|
|
32
|
+
const baseUrl = options.baseUrl;
|
|
33
|
+
if (!hasValue(env.JUNIOR_BASE_URL) && hasValue(baseUrl)) {
|
|
34
|
+
env.JUNIOR_BASE_URL = baseUrl.trim();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
13
37
|
function hasEnvRootMarker(dir) {
|
|
14
38
|
return fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, "pnpm-workspace.yaml"));
|
|
15
39
|
}
|
|
@@ -49,8 +73,12 @@ function loadCliEnvFiles(cwd = process.cwd()) {
|
|
|
49
73
|
process.loadEnvFile(absolutePath);
|
|
50
74
|
}
|
|
51
75
|
}
|
|
76
|
+
applyJuniorDevelopmentDefaults(process.env);
|
|
52
77
|
}
|
|
53
78
|
|
|
54
79
|
export {
|
|
80
|
+
JUNIOR_LOCAL_DEV_INTERNAL_SECRET,
|
|
81
|
+
JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET,
|
|
82
|
+
applyJuniorDevelopmentDefaults,
|
|
55
83
|
loadCliEnvFiles
|
|
56
84
|
};
|
package/dist/cli/chat.js
CHANGED
|
@@ -130,7 +130,7 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
130
130
|
databaseModule
|
|
131
131
|
] = await Promise.all([
|
|
132
132
|
import("../plugins-PZMDS7AT.js"),
|
|
133
|
-
import("../agent-hooks-
|
|
133
|
+
import("../agent-hooks-5ZRILRC3.js"),
|
|
134
134
|
import("../catalog-runtime-IVWRAPSI.js"),
|
|
135
135
|
import("../validation-TN6HMZAD.js"),
|
|
136
136
|
import("../db-GQJKBX5W.js")
|
|
@@ -195,7 +195,7 @@ async function runPrompt(options, io, pluginSet) {
|
|
|
195
195
|
defaultStateAdapterForLocalChat();
|
|
196
196
|
await configureLocalChatPlugins(pluginSet);
|
|
197
197
|
const conversationId = newRunConversationId();
|
|
198
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
198
|
+
const { runLocalAgentTurn } = await import("../runner-VRFJLG2M.js");
|
|
199
199
|
const result = await runLocalAgentTurn(
|
|
200
200
|
{
|
|
201
201
|
conversationId,
|
|
@@ -219,7 +219,7 @@ async function runInteractive(io, pluginSet) {
|
|
|
219
219
|
defaultStateAdapterForLocalChat();
|
|
220
220
|
await configureLocalChatPlugins(pluginSet);
|
|
221
221
|
const conversationId = newRunConversationId();
|
|
222
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
222
|
+
const { runLocalAgentTurn } = await import("../runner-VRFJLG2M.js");
|
|
223
223
|
const rl = readline.createInterface({
|
|
224
224
|
input: io.input,
|
|
225
225
|
output: io.output,
|
package/dist/cli/env.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET,
|
|
3
|
+
JUNIOR_LOCAL_DEV_INTERNAL_SECRET,
|
|
4
|
+
applyJuniorDevelopmentDefaults,
|
|
2
5
|
loadCliEnvFiles
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-UXPG6ZIN.js";
|
|
4
7
|
import "../chunk-MLKGABMK.js";
|
|
5
8
|
export {
|
|
9
|
+
JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET,
|
|
10
|
+
JUNIOR_LOCAL_DEV_INTERNAL_SECRET,
|
|
11
|
+
applyJuniorDevelopmentDefaults,
|
|
6
12
|
loadCliEnvFiles
|
|
7
13
|
};
|
package/dist/cli/init.js
CHANGED
package/dist/cli/main.js
CHANGED
package/dist/cli/plugins.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress
|
|
1
|
+
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
|
|
2
2
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
3
3
|
interface AgentDispatchHandlerOptions {
|
|
4
4
|
tracePropagation?: SandboxEgressTracePropagationConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type SandboxEgressHttpInterceptor } from "@/chat/sandbox/egress
|
|
2
|
-
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress
|
|
1
|
+
import { type SandboxEgressHttpInterceptor } from "@/chat/sandbox/egress/proxy";
|
|
2
|
+
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
|
|
3
3
|
interface SandboxEgressProxyOptions {
|
|
4
4
|
interceptHttp?: SandboxEgressHttpInterceptor;
|
|
5
5
|
tracePropagation?: SandboxEgressTracePropagationConfig;
|
package/dist/reporting.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
startActiveTurn,
|
|
15
15
|
updateConversationStats,
|
|
16
16
|
upsertConversationMessage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NC6LR6U4.js";
|
|
18
18
|
import {
|
|
19
19
|
coerceThreadConversationState
|
|
20
20
|
} from "./chunk-66NX7MNW.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
commitMessages,
|
|
25
25
|
loadProjection
|
|
26
26
|
} from "./chunk-YA2JCC7G.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-TR2G37II.js";
|
|
28
28
|
import "./chunk-GUO4EE7L.js";
|
|
29
29
|
import "./chunk-PQ2U2AO3.js";
|
|
30
30
|
import "./chunk-G3E7SCME.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"pg": "^8.16.3",
|
|
71
71
|
"yaml": "^2.9.0",
|
|
72
72
|
"zod": "^4.4.3",
|
|
73
|
-
"@sentry/junior-plugin-api": "0.
|
|
73
|
+
"@sentry/junior-plugin-api": "0.82.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@emnapi/core": "^1.10.0",
|
|
@@ -86,9 +86,10 @@
|
|
|
86
86
|
"typescript": "^6.0.3",
|
|
87
87
|
"vercel": "^54.4.0",
|
|
88
88
|
"vitest": "^4.1.7",
|
|
89
|
-
"@sentry/junior-
|
|
90
|
-
"@sentry/junior-
|
|
91
|
-
"@sentry/junior-
|
|
89
|
+
"@sentry/junior-github": "0.82.0",
|
|
90
|
+
"@sentry/junior-memory": "0.82.0",
|
|
91
|
+
"@sentry/junior-scheduler": "0.82.0",
|
|
92
|
+
"@sentry/junior-testing": "0.0.0"
|
|
92
93
|
},
|
|
93
94
|
"scripts": {
|
|
94
95
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NetworkPolicy } from "@vercel/sandbox";
|
|
2
|
-
import type { TracePropagationHeaders } from "@/chat/logging";
|
|
3
|
-
import { type SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress-tracing";
|
|
4
|
-
/** Return whether an outbound host is covered by a sandbox egress domain rule. */
|
|
5
|
-
export declare function matchesSandboxEgressDomain(host: string, domain: string): boolean;
|
|
6
|
-
/** Resolve the plugin provider responsible for an outbound sandbox host. */
|
|
7
|
-
export declare function resolveSandboxEgressProviderForHost(host: string): string | undefined;
|
|
8
|
-
/** Build the policy that forwards credentials and configured trace headers. */
|
|
9
|
-
export declare function buildSandboxEgressNetworkPolicy(input?: {
|
|
10
|
-
credentialToken?: string;
|
|
11
|
-
traceConfig?: SandboxEgressTracePropagationConfig;
|
|
12
|
-
traceHeaders?: TracePropagationHeaders;
|
|
13
|
-
}): NetworkPolicy;
|
|
14
|
-
/** Resolve non-secret command environment values for registered sandbox providers. */
|
|
15
|
-
export declare function resolveSandboxCommandEnvironment(): Promise<Record<string, string>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress-tracing";
|
|
2
|
-
import type { JWTPayload } from "jose";
|
|
3
|
-
/** Intercepts a credential-injected sandbox HTTP request before live forwarding. */
|
|
4
|
-
export type SandboxEgressHttpInterceptor = (input: {
|
|
5
|
-
provider: string;
|
|
6
|
-
request: Request;
|
|
7
|
-
upstreamUrl: URL;
|
|
8
|
-
}) => Promise<Response | undefined>;
|
|
9
|
-
interface ProxyDeps {
|
|
10
|
-
fetch?: typeof fetch;
|
|
11
|
-
interceptHttp?: SandboxEgressHttpInterceptor;
|
|
12
|
-
tracePropagation?: SandboxEgressTracePropagationConfig;
|
|
13
|
-
verifyOidc?: (token: string) => Promise<JWTPayload>;
|
|
14
|
-
}
|
|
15
|
-
/** Return whether a request appears to be from the Vercel Sandbox egress proxy. */
|
|
16
|
-
export declare function isSandboxEgressForwardedRequest(request: Request): boolean;
|
|
17
|
-
/** Proxy one Vercel Sandbox firewall egress request through lazy credential headers. */
|
|
18
|
-
export declare function proxySandboxEgressRequest(request: Request, deps?: ProxyDeps): Promise<Response>;
|
|
19
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|