@sentry/junior 0.62.0 → 0.64.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 +5 -1
- package/dist/api-reference.d.ts +2 -0
- package/dist/app.d.ts +5 -10
- package/dist/app.js +348 -874
- package/dist/build/virtual-config.d.ts +18 -2
- package/dist/chat/logging.d.ts +12 -2
- package/dist/chat/plugins/agent-hooks.d.ts +11 -4
- package/dist/chat/plugins/inline-manifest-source.d.ts +5 -0
- package/dist/chat/plugins/manifest.d.ts +5 -3
- package/dist/chat/plugins/package-discovery.d.ts +5 -0
- package/dist/chat/plugins/registry.d.ts +2 -2
- package/dist/chat/plugins/types.d.ts +8 -3
- package/dist/chat/prompt.d.ts +0 -1
- package/dist/chat/state/turn-session.d.ts +1 -1
- package/dist/{chunk-I4FDGMFI.js → chunk-4CRYMG7M.js} +787 -31
- package/dist/chunk-5VDO6LSG.js +104 -0
- package/dist/{chunk-ITOW4DED.js → chunk-D23WCM66.js} +2 -2
- package/dist/{chunk-FKEKRBUB.js → chunk-IGVHCX2U.js} +28 -2
- package/dist/{chunk-5LUISFEY.js → chunk-KVZL5NZS.js} +6 -1
- package/dist/{chunk-H652GMDH.js → chunk-WDPWFMCE.js} +297 -84
- package/dist/{chunk-QDGD5WVN.js → chunk-WZFQQ6SP.js} +3 -28
- package/dist/cli/check.js +9 -4
- package/dist/cli/snapshot-warmup.js +4 -4
- package/dist/nitro.d.ts +10 -3
- package/dist/nitro.js +161 -6
- package/dist/plugins.d.ts +22 -0
- package/dist/reporting.d.ts +26 -11
- package/dist/reporting.js +62 -25
- package/package.json +3 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// src/plugins.ts
|
|
2
|
+
function cloneManifests(manifests) {
|
|
3
|
+
return manifests ? structuredClone(manifests) : void 0;
|
|
4
|
+
}
|
|
5
|
+
function cloneInlineManifests(registrations) {
|
|
6
|
+
const inlineManifests = registrations.flatMap(
|
|
7
|
+
(plugin) => plugin.manifest ? [
|
|
8
|
+
{
|
|
9
|
+
manifest: {
|
|
10
|
+
...structuredClone(plugin.manifest),
|
|
11
|
+
capabilities: plugin.manifest.capabilities?.map(
|
|
12
|
+
(capability) => capability.includes(".") ? capability : `${plugin.manifest.name}.${capability}`
|
|
13
|
+
) ?? [],
|
|
14
|
+
configKeys: plugin.manifest.configKeys?.map(
|
|
15
|
+
(key) => key.includes(".") ? key : `${plugin.manifest.name}.${key}`
|
|
16
|
+
) ?? [],
|
|
17
|
+
...plugin.manifest.target ? {
|
|
18
|
+
target: {
|
|
19
|
+
...plugin.manifest.target,
|
|
20
|
+
configKey: plugin.manifest.target.configKey.includes(".") ? plugin.manifest.target.configKey : `${plugin.manifest.name}.${plugin.manifest.target.configKey}`
|
|
21
|
+
}
|
|
22
|
+
} : {}
|
|
23
|
+
},
|
|
24
|
+
...plugin.packageName ? { packageName: plugin.packageName } : {}
|
|
25
|
+
}
|
|
26
|
+
] : []
|
|
27
|
+
);
|
|
28
|
+
return inlineManifests.length > 0 ? inlineManifests : void 0;
|
|
29
|
+
}
|
|
30
|
+
function assertUniquePluginNames(registrations) {
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
for (const plugin of registrations) {
|
|
33
|
+
if (seen.has(plugin.name)) {
|
|
34
|
+
throw new Error(`Duplicate plugin registration name "${plugin.name}"`);
|
|
35
|
+
}
|
|
36
|
+
seen.add(plugin.name);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function assertUniquePackageNames(packageNames) {
|
|
40
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41
|
+
for (const packageName of packageNames) {
|
|
42
|
+
if (seen.has(packageName)) {
|
|
43
|
+
throw new Error(`Duplicate plugin package name "${packageName}"`);
|
|
44
|
+
}
|
|
45
|
+
seen.add(packageName);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function normalizePluginInput(input) {
|
|
49
|
+
if (typeof input === "string") {
|
|
50
|
+
return { packageName: input };
|
|
51
|
+
}
|
|
52
|
+
return { registration: input };
|
|
53
|
+
}
|
|
54
|
+
function defineJuniorPlugins(inputs, options = {}) {
|
|
55
|
+
const normalized = inputs.map(normalizePluginInput);
|
|
56
|
+
const packageNames = normalized.flatMap(
|
|
57
|
+
(input) => input.packageName ? [input.packageName] : []
|
|
58
|
+
);
|
|
59
|
+
const registrations = normalized.flatMap(
|
|
60
|
+
(input) => input.registration ? [input.registration] : []
|
|
61
|
+
);
|
|
62
|
+
assertUniquePackageNames(packageNames);
|
|
63
|
+
assertUniquePluginNames(registrations);
|
|
64
|
+
const manifests = cloneManifests(options.manifests);
|
|
65
|
+
return {
|
|
66
|
+
packageNames,
|
|
67
|
+
registrations: registrations.map((plugin) => ({ ...plugin })),
|
|
68
|
+
...manifests ? { manifests } : {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function pluginCatalogConfigFromPluginSet(pluginSet) {
|
|
72
|
+
if (!pluginSet) {
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
const packages = [
|
|
76
|
+
.../* @__PURE__ */ new Set([
|
|
77
|
+
...pluginSet.packageNames,
|
|
78
|
+
...pluginSet.registrations.flatMap(
|
|
79
|
+
(plugin) => plugin.packageName ? [plugin.packageName] : []
|
|
80
|
+
)
|
|
81
|
+
])
|
|
82
|
+
];
|
|
83
|
+
const manifests = cloneManifests(pluginSet.manifests);
|
|
84
|
+
const inlineManifests = cloneInlineManifests(pluginSet.registrations);
|
|
85
|
+
if (packages.length === 0 && !manifests && !inlineManifests) {
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
...inlineManifests ? { inlineManifests } : {},
|
|
90
|
+
...packages.length > 0 ? { packages } : {},
|
|
91
|
+
...manifests ? { manifests } : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function trustedPluginRegistrationsFromPluginSet(pluginSet) {
|
|
95
|
+
return pluginSet?.registrations.filter(
|
|
96
|
+
(plugin) => plugin.hooks || plugin.legacyStatePrefixes
|
|
97
|
+
) ?? [];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
defineJuniorPlugins,
|
|
102
|
+
pluginCatalogConfigFromPluginSet,
|
|
103
|
+
trustedPluginRegistrationsFromPluginSet
|
|
104
|
+
};
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getPluginForSkillPath,
|
|
3
3
|
getPluginSkillRoots,
|
|
4
4
|
logWarn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WDPWFMCE.js";
|
|
6
6
|
import {
|
|
7
7
|
skillRoots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KVZL5NZS.js";
|
|
9
9
|
|
|
10
10
|
// src/chat/skills.ts
|
|
11
11
|
import fs from "fs/promises";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
setSpanAttributes,
|
|
7
7
|
toOptionalString,
|
|
8
8
|
withSpan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WDPWFMCE.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/slack/context.ts
|
|
12
12
|
function toTrimmedSlackString(value) {
|
|
@@ -896,6 +896,27 @@ async function disconnectStateAdapter() {
|
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
+
// src/chat/sandbox/paths.ts
|
|
900
|
+
function normalizeWorkspaceRoot(input) {
|
|
901
|
+
const candidate = (input ?? "").trim();
|
|
902
|
+
if (!candidate) {
|
|
903
|
+
return "/vercel/sandbox";
|
|
904
|
+
}
|
|
905
|
+
const normalized = candidate.replace(/\/+$/, "");
|
|
906
|
+
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
907
|
+
}
|
|
908
|
+
var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
|
|
909
|
+
process.env.VERCEL_SANDBOX_WORKSPACE_DIR
|
|
910
|
+
);
|
|
911
|
+
var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
912
|
+
var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
913
|
+
function sandboxSkillDir(skillName) {
|
|
914
|
+
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
915
|
+
}
|
|
916
|
+
function sandboxSkillFile(skillName) {
|
|
917
|
+
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
918
|
+
}
|
|
919
|
+
|
|
899
920
|
export {
|
|
900
921
|
toOptionalTrimmed,
|
|
901
922
|
parseSlackThreadId,
|
|
@@ -927,5 +948,10 @@ export {
|
|
|
927
948
|
ACTIVE_LOCK_TTL_MS,
|
|
928
949
|
getConnectedStateContext,
|
|
929
950
|
getStateAdapter,
|
|
930
|
-
disconnectStateAdapter
|
|
951
|
+
disconnectStateAdapter,
|
|
952
|
+
SANDBOX_WORKSPACE_ROOT,
|
|
953
|
+
SANDBOX_SKILLS_ROOT,
|
|
954
|
+
SANDBOX_DATA_ROOT,
|
|
955
|
+
sandboxSkillDir,
|
|
956
|
+
sandboxSkillFile
|
|
931
957
|
};
|
|
@@ -383,7 +383,7 @@ function normalizePluginPackageNames(packageNames) {
|
|
|
383
383
|
return [];
|
|
384
384
|
}
|
|
385
385
|
if (!Array.isArray(packageNames)) {
|
|
386
|
-
throw new Error("
|
|
386
|
+
throw new Error("Plugin package names must be an array");
|
|
387
387
|
}
|
|
388
388
|
const normalized = [];
|
|
389
389
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -494,6 +494,11 @@ function discoverInstalledPluginPackageContent(cwd = process.cwd(), options) {
|
|
|
494
494
|
packageNames: uniqueStringsInOrder(
|
|
495
495
|
discoveredPackages.map((pkg) => pkg.name)
|
|
496
496
|
),
|
|
497
|
+
packages: discoveredPackages.map((pkg) => ({
|
|
498
|
+
dir: pkg.dir,
|
|
499
|
+
hasSkillsDir: pkg.hasSkillsDir,
|
|
500
|
+
name: pkg.name
|
|
501
|
+
})),
|
|
497
502
|
manifestRoots: uniqueStringsInOrder(manifestRoots),
|
|
498
503
|
skillRoots: uniqueStringsInOrder(skillRoots2),
|
|
499
504
|
tracingIncludes: uniqueStringsInOrder(tracingIncludes)
|