@sentry/junior 0.39.0 → 0.41.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/app.js +517 -320
- package/dist/{chunk-7QMPV6YJ.js → chunk-7QYONRLH.js} +6 -5
- package/dist/{chunk-EQPY4742.js → chunk-SCE5C645.js} +105 -42
- package/dist/{chunk-DVMGFG4W.js → chunk-Y3UO7NR6.js} +3 -6
- package/dist/cli/check.js +2 -2
- package/dist/cli/init.js +1 -0
- package/dist/cli/snapshot-warmup.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getPluginForSkillPath,
|
|
3
3
|
getPluginSkillRoots,
|
|
4
4
|
logWarn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SCE5C645.js";
|
|
6
6
|
import {
|
|
7
7
|
skillRoots
|
|
8
8
|
} from "./chunk-XPXD3FCE.js";
|
|
@@ -188,6 +188,7 @@ function formatManifestSurface(manifest) {
|
|
|
188
188
|
if (manifest.runtimePostinstall?.length) surface.push("postinstall steps");
|
|
189
189
|
if (manifest.mcp) surface.push("MCP tools");
|
|
190
190
|
if (manifest.credentials) surface.push("credentials");
|
|
191
|
+
if (manifest.commandEnv) surface.push("command env");
|
|
191
192
|
if (manifest.oauth) surface.push("OAuth");
|
|
192
193
|
if (manifest.configKeys.length > 0) surface.push("config keys");
|
|
193
194
|
return surface.length > 0 ? surface.join(", ") : "skill discovery";
|
|
@@ -198,7 +199,7 @@ function buildPluginRuntimeBoundary(manifest) {
|
|
|
198
199
|
"",
|
|
199
200
|
`The ${manifest.name} plugin manifest, not this skill's prose, controls runtime setup.`,
|
|
200
201
|
`Manifest-owned surface: ${formatManifestSurface(manifest)}.`,
|
|
201
|
-
"Do not install provider runtime packages, run installer scripts, configure API keys, create OAuth clients, or set up MCP servers because this skill says to.",
|
|
202
|
+
"Do not install provider runtime packages, run installer scripts, configure API keys or command env, create OAuth clients, or set up MCP servers because this skill says to.",
|
|
202
203
|
`If that surface is unavailable, report a ${manifest.name} plugin runtime setup failure instead of repairing setup from the skill workflow.`
|
|
203
204
|
].join("\n");
|
|
204
205
|
}
|
|
@@ -218,7 +219,7 @@ async function readSkillDirectory(skillDir) {
|
|
|
218
219
|
{},
|
|
219
220
|
{
|
|
220
221
|
"file.path": skillDir,
|
|
221
|
-
"
|
|
222
|
+
"exception.message": parsed.error
|
|
222
223
|
},
|
|
223
224
|
"Invalid skill frontmatter"
|
|
224
225
|
);
|
|
@@ -239,7 +240,7 @@ async function readSkillDirectory(skillDir) {
|
|
|
239
240
|
{},
|
|
240
241
|
{
|
|
241
242
|
"file.path": skillDir,
|
|
242
|
-
"
|
|
243
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
243
244
|
},
|
|
244
245
|
"Failed to read skill directory"
|
|
245
246
|
);
|
|
@@ -275,7 +276,7 @@ async function discoverSkills(options) {
|
|
|
275
276
|
{},
|
|
276
277
|
{
|
|
277
278
|
"file.directory": root,
|
|
278
|
-
"
|
|
279
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
279
280
|
},
|
|
280
281
|
"Failed to read skill root"
|
|
281
282
|
);
|
|
@@ -37,14 +37,14 @@ var SECRETS_RE = [
|
|
|
37
37
|
/\b[A-Z0-9_]+(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD)\s*[=:]\s*([^\s"']{8,})/gi
|
|
38
38
|
];
|
|
39
39
|
var LEGACY_KEY_MAP = {
|
|
40
|
-
error: "
|
|
40
|
+
error: "exception.message",
|
|
41
41
|
"error.stack": "exception.stacktrace",
|
|
42
42
|
"gen_ai.system": "gen_ai.provider.name",
|
|
43
43
|
"gen_ai.request.messages": "gen_ai.input.messages",
|
|
44
44
|
"gen_ai.response.text": "gen_ai.output.messages",
|
|
45
45
|
"messaging.conversation.id": "messaging.message.conversation_id",
|
|
46
46
|
bytes: "file.size",
|
|
47
|
-
media_type: "file.mime_type",
|
|
47
|
+
media_type: "app.file.mime_type",
|
|
48
48
|
skillDir: "file.path",
|
|
49
49
|
root: "file.directory",
|
|
50
50
|
originalLength: "app.output.original_length",
|
|
@@ -70,14 +70,12 @@ var LOGTAPE_BODY_KEY = "__logtape_body";
|
|
|
70
70
|
var ROOT_LOGGER_CATEGORY = ["junior"];
|
|
71
71
|
var CONSOLE_PRIORITY_KEYS = [
|
|
72
72
|
"gen_ai.conversation.id",
|
|
73
|
-
"app.turn.id",
|
|
74
73
|
"event.name",
|
|
75
74
|
"app.log.source",
|
|
76
|
-
"
|
|
75
|
+
"exception.message",
|
|
77
76
|
"messaging.message.id",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"app.agent.id",
|
|
77
|
+
"trace_id",
|
|
78
|
+
"span_id",
|
|
81
79
|
"messaging.message.conversation_id",
|
|
82
80
|
"messaging.destination.name",
|
|
83
81
|
"app.run.id",
|
|
@@ -90,7 +88,7 @@ var CONSOLE_ALWAYS_HIDDEN_KEYS = /* @__PURE__ */ new Set([
|
|
|
90
88
|
"gen_ai.agent.name",
|
|
91
89
|
"app.platform",
|
|
92
90
|
"enduser.id",
|
|
93
|
-
"enduser.
|
|
91
|
+
"enduser.pseudo.id",
|
|
94
92
|
"http.request.method",
|
|
95
93
|
"messaging.system",
|
|
96
94
|
"url.full",
|
|
@@ -290,15 +288,13 @@ function sanitizeValue(value) {
|
|
|
290
288
|
function contextToAttributes(context) {
|
|
291
289
|
const attributes = {
|
|
292
290
|
"gen_ai.conversation.id": context.conversationId,
|
|
293
|
-
"app.turn.id": context.turnId,
|
|
294
|
-
"app.agent.id": context.agentId,
|
|
295
291
|
"app.platform": context.platform,
|
|
296
292
|
"app.request.id": context.requestId,
|
|
297
293
|
"messaging.system": context.platform === "slack" ? "slack" : context.platform,
|
|
298
294
|
"messaging.message.conversation_id": context.slackThreadId,
|
|
299
295
|
"messaging.destination.name": context.slackChannelId,
|
|
300
296
|
"enduser.id": context.slackUserId,
|
|
301
|
-
"enduser.
|
|
297
|
+
"enduser.pseudo.id": context.slackUserName,
|
|
302
298
|
"app.run.id": context.runId,
|
|
303
299
|
"gen_ai.agent.name": context.assistantUserName,
|
|
304
300
|
"gen_ai.request.model": context.modelId,
|
|
@@ -539,9 +535,6 @@ function shouldHideConsoleAttribute(level, eventName, key, attributes) {
|
|
|
539
535
|
if (CONSOLE_DROP_WHEN_COUNTED_KEYS.has(key)) {
|
|
540
536
|
return true;
|
|
541
537
|
}
|
|
542
|
-
if (key === "app.agent.id" && attributes[key] === attributes["app.turn.id"]) {
|
|
543
|
-
return true;
|
|
544
|
-
}
|
|
545
538
|
if (key === "messaging.message.conversation_id" && attributes[key] === attributes["gen_ai.conversation.id"]) {
|
|
546
539
|
return true;
|
|
547
540
|
}
|
|
@@ -673,7 +666,6 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
673
666
|
const conversationId = toOptionalString(
|
|
674
667
|
attributes["gen_ai.conversation.id"]
|
|
675
668
|
);
|
|
676
|
-
const turnId = toOptionalString(attributes["app.turn.id"]);
|
|
677
669
|
const messageId = toOptionalString(attributes["messaging.message.id"]);
|
|
678
670
|
if (conversationId) {
|
|
679
671
|
pushPrettyConsoleToken(
|
|
@@ -681,9 +673,6 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
681
673
|
`conv=${abbreviateConsoleId(conversationId)}`
|
|
682
674
|
);
|
|
683
675
|
}
|
|
684
|
-
if (turnId) {
|
|
685
|
-
pushPrettyConsoleToken(tokens, `turn=${abbreviateConsoleId(turnId)}`);
|
|
686
|
-
}
|
|
687
676
|
if (messageId) {
|
|
688
677
|
pushPrettyConsoleToken(tokens, `msg=${abbreviateConsoleId(messageId)}`);
|
|
689
678
|
}
|
|
@@ -853,7 +842,6 @@ var log = {
|
|
|
853
842
|
{
|
|
854
843
|
...attrs,
|
|
855
844
|
"error.type": normalizedError.name,
|
|
856
|
-
"error.message": normalizedError.message,
|
|
857
845
|
"exception.type": normalizedError.name,
|
|
858
846
|
"exception.message": normalizedError.message,
|
|
859
847
|
"exception.stacktrace": normalizedError.stack
|
|
@@ -1019,6 +1007,16 @@ function toSpanAttributeValue(value) {
|
|
|
1019
1007
|
);
|
|
1020
1008
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
1021
1009
|
}
|
|
1010
|
+
function normalizeSpanAttributes(attributes) {
|
|
1011
|
+
const normalized = {};
|
|
1012
|
+
for (const [rawKey, value] of Object.entries(attributes)) {
|
|
1013
|
+
const normalizedValue = toSpanAttributeValue(value);
|
|
1014
|
+
if (normalizedValue !== void 0) {
|
|
1015
|
+
normalized[normalizeAttributeKey(rawKey)] = normalizedValue;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return normalized;
|
|
1019
|
+
}
|
|
1022
1020
|
function logInfo(eventName, context = {}, attributes = {}, body) {
|
|
1023
1021
|
log.info(eventName, { ...toSpanAttributes(context), ...attributes }, body);
|
|
1024
1022
|
}
|
|
@@ -1048,13 +1046,7 @@ async function withContext(context, callback) {
|
|
|
1048
1046
|
return withLogContext(context, callback);
|
|
1049
1047
|
}
|
|
1050
1048
|
async function withSpan(name, op, context, callback, attributes = {}) {
|
|
1051
|
-
const normalizedAttributes =
|
|
1052
|
-
for (const [key, value] of Object.entries(attributes)) {
|
|
1053
|
-
const normalizedValue = toSpanAttributeValue(value);
|
|
1054
|
-
if (normalizedValue !== void 0) {
|
|
1055
|
-
normalizedAttributes[key] = normalizedValue;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1049
|
+
const normalizedAttributes = normalizeSpanAttributes(attributes);
|
|
1058
1050
|
return withLogContext(context, () => {
|
|
1059
1051
|
const inheritedAttributes = getLogContextAttributes();
|
|
1060
1052
|
return sentry_exports.startSpan(
|
|
@@ -1080,11 +1072,10 @@ function setSpanAttributes(attributes) {
|
|
|
1080
1072
|
if (typeof setAttribute !== "function") {
|
|
1081
1073
|
return;
|
|
1082
1074
|
}
|
|
1083
|
-
for (const [key, value] of Object.entries(
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
}
|
|
1075
|
+
for (const [key, value] of Object.entries(
|
|
1076
|
+
normalizeSpanAttributes(attributes)
|
|
1077
|
+
)) {
|
|
1078
|
+
setAttribute.call(span, key, value);
|
|
1088
1079
|
}
|
|
1089
1080
|
}
|
|
1090
1081
|
function setSpanStatus(status) {
|
|
@@ -1189,6 +1180,18 @@ function toFiniteTokenCount(value) {
|
|
|
1189
1180
|
const rounded = Math.floor(value);
|
|
1190
1181
|
return rounded >= 0 ? rounded : void 0;
|
|
1191
1182
|
}
|
|
1183
|
+
function sumTokenCounts(...values) {
|
|
1184
|
+
let total = 0;
|
|
1185
|
+
let hasValue = false;
|
|
1186
|
+
for (const value of values) {
|
|
1187
|
+
if (value === void 0) {
|
|
1188
|
+
continue;
|
|
1189
|
+
}
|
|
1190
|
+
total += value;
|
|
1191
|
+
hasValue = true;
|
|
1192
|
+
}
|
|
1193
|
+
return hasValue ? total : void 0;
|
|
1194
|
+
}
|
|
1192
1195
|
var PI_USAGE_FIELDS = [
|
|
1193
1196
|
["input", "inputTokens"],
|
|
1194
1197
|
["output", "outputTokens"],
|
|
@@ -1204,7 +1207,7 @@ function readPiUsage(source) {
|
|
|
1204
1207
|
const usage = asRecord(record.usage) ?? record;
|
|
1205
1208
|
const summary = {};
|
|
1206
1209
|
for (const [piKey, ourKey] of PI_USAGE_FIELDS) {
|
|
1207
|
-
const value = toFiniteTokenCount(usage[piKey]);
|
|
1210
|
+
const value = toFiniteTokenCount(usage[piKey]) ?? toFiniteTokenCount(usage[ourKey]);
|
|
1208
1211
|
if (value !== void 0) {
|
|
1209
1212
|
summary[ourKey] = value;
|
|
1210
1213
|
}
|
|
@@ -1224,10 +1227,17 @@ function extractGenAiUsageSummary(...sources) {
|
|
|
1224
1227
|
return summary;
|
|
1225
1228
|
}
|
|
1226
1229
|
function extractGenAiUsageAttributes(...sources) {
|
|
1227
|
-
const { inputTokens, outputTokens } = extractGenAiUsageSummary(...sources);
|
|
1230
|
+
const { inputTokens, outputTokens, cachedInputTokens, cacheCreationTokens } = extractGenAiUsageSummary(...sources);
|
|
1231
|
+
const semanticInputTokens = sumTokenCounts(
|
|
1232
|
+
inputTokens,
|
|
1233
|
+
cachedInputTokens,
|
|
1234
|
+
cacheCreationTokens
|
|
1235
|
+
);
|
|
1228
1236
|
return {
|
|
1229
|
-
...
|
|
1230
|
-
...outputTokens !== void 0 ? { "gen_ai.usage.output_tokens": outputTokens } : {}
|
|
1237
|
+
...semanticInputTokens !== void 0 ? { "gen_ai.usage.input_tokens": semanticInputTokens } : {},
|
|
1238
|
+
...outputTokens !== void 0 ? { "gen_ai.usage.output_tokens": outputTokens } : {},
|
|
1239
|
+
...cachedInputTokens !== void 0 ? { "gen_ai.usage.cache_read.input_tokens": cachedInputTokens } : {},
|
|
1240
|
+
...cacheCreationTokens !== void 0 ? { "gen_ai.usage.cache_creation.input_tokens": cacheCreationTokens } : {}
|
|
1231
1241
|
};
|
|
1232
1242
|
}
|
|
1233
1243
|
|
|
@@ -1430,6 +1440,7 @@ var manifestSourceSchema = z.object({
|
|
|
1430
1440
|
}).optional(),
|
|
1431
1441
|
"api-domains": apiDomainsSchema.optional(),
|
|
1432
1442
|
"api-headers": stringMapSchema.optional(),
|
|
1443
|
+
"command-env": stringMapSchema.optional(),
|
|
1433
1444
|
credentials: z.record(z.string(), z.unknown(), {
|
|
1434
1445
|
error: "must be an object when provided"
|
|
1435
1446
|
}).optional(),
|
|
@@ -1507,6 +1518,39 @@ function normalizeRequiredApiHeaders(value, prefix, envVars) {
|
|
|
1507
1518
|
}
|
|
1508
1519
|
return apiHeaders;
|
|
1509
1520
|
}
|
|
1521
|
+
function assertCommandEnvReferencesArePublic(value, envVars, context) {
|
|
1522
|
+
for (const match of value.matchAll(ENV_PLACEHOLDER_RE)) {
|
|
1523
|
+
const name = match[1];
|
|
1524
|
+
if (!Object.prototype.hasOwnProperty.call(envVars, name)) {
|
|
1525
|
+
throw new Error(
|
|
1526
|
+
`${context} references env var ${name} which is not declared in env-vars`
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
if (envVars[name]?.default === void 0) {
|
|
1530
|
+
throw new Error(
|
|
1531
|
+
`${context} references env var ${name}, but command-env env vars must declare defaults`
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
function normalizeCommandEnv(value, prefix, envVars) {
|
|
1537
|
+
const env = normalizeStringMap(value, prefix);
|
|
1538
|
+
if (!env) {
|
|
1539
|
+
throw new Error(`${prefix} must contain at least one env var`);
|
|
1540
|
+
}
|
|
1541
|
+
for (const [key, envValue] of Object.entries(env)) {
|
|
1542
|
+
if (!ENV_VAR_NAME_RE.test(key)) {
|
|
1543
|
+
throw new Error(`${prefix}.${key} must be an uppercase env var name`);
|
|
1544
|
+
}
|
|
1545
|
+
assertCommandEnvReferencesArePublic(envValue, envVars, `${prefix}.${key}`);
|
|
1546
|
+
}
|
|
1547
|
+
return Object.fromEntries(
|
|
1548
|
+
Object.entries(env).map(([key, envValue]) => [
|
|
1549
|
+
key,
|
|
1550
|
+
expandEnvPlaceholders(envValue, envVars, `${prefix}.${key}`)
|
|
1551
|
+
])
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1510
1554
|
function normalizeCredentials(data, name) {
|
|
1511
1555
|
const schema = data.type === "oauth-bearer" ? oauthBearerCredentialsSchema : data.type === "github-app" ? githubAppCredentialsSchema : void 0;
|
|
1512
1556
|
if (!schema) {
|
|
@@ -1791,6 +1835,11 @@ function parsePluginManifest(raw, dir) {
|
|
|
1791
1835
|
`Plugin ${parsedYaml.name ?? "unknown"} api-headers must be an object when provided`
|
|
1792
1836
|
);
|
|
1793
1837
|
}
|
|
1838
|
+
if (path3 === "command-env") {
|
|
1839
|
+
throw new Error(
|
|
1840
|
+
`Plugin ${parsedYaml.name ?? "unknown"} command-env must be an object when provided`
|
|
1841
|
+
);
|
|
1842
|
+
}
|
|
1794
1843
|
if (path3 === "credentials") {
|
|
1795
1844
|
throw new Error(
|
|
1796
1845
|
`Plugin ${parsedYaml.name ?? "unknown"} credentials must be an object when provided`
|
|
@@ -1855,7 +1904,17 @@ function parsePluginManifest(raw, dir) {
|
|
|
1855
1904
|
if (data["api-domains"] && !apiHeaders) {
|
|
1856
1905
|
throw new Error(`Plugin ${data.name} api-domains requires api-headers`);
|
|
1857
1906
|
}
|
|
1907
|
+
const commandEnv = data["command-env"] ? normalizeCommandEnv(
|
|
1908
|
+
data["command-env"],
|
|
1909
|
+
`Plugin ${data.name} command-env`,
|
|
1910
|
+
envVars
|
|
1911
|
+
) : void 0;
|
|
1858
1912
|
const credentials = data.credentials ? normalizeCredentials(data.credentials, data.name) : void 0;
|
|
1913
|
+
if (commandEnv && !credentials && !apiHeaders) {
|
|
1914
|
+
throw new Error(
|
|
1915
|
+
`Plugin ${data.name} command-env requires credentials or api-headers`
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1859
1918
|
const runtimeDependencies = data["runtime-dependencies"] ? normalizeRuntimeDependencies(data["runtime-dependencies"], data.name) : void 0;
|
|
1860
1919
|
const runtimePostinstall = data["runtime-postinstall"] ? normalizeRuntimePostinstall(data["runtime-postinstall"], data.name) : void 0;
|
|
1861
1920
|
const mcp = data.mcp ? normalizeMcp(data.mcp, envVars, data.name) : void 0;
|
|
@@ -1866,6 +1925,7 @@ function parsePluginManifest(raw, dir) {
|
|
|
1866
1925
|
configKeys,
|
|
1867
1926
|
...data["api-domains"] ? { apiDomains: data["api-domains"] } : {},
|
|
1868
1927
|
...apiHeaders ? { apiHeaders } : {},
|
|
1928
|
+
...commandEnv ? { commandEnv } : {},
|
|
1869
1929
|
...Object.keys(envVars).length > 0 ? { envVars } : {},
|
|
1870
1930
|
...credentials ? { credentials } : {},
|
|
1871
1931
|
...runtimeDependencies ? { runtimeDependencies } : {},
|
|
@@ -2006,7 +2066,7 @@ function createApiHeadersBroker(manifest) {
|
|
|
2006
2066
|
return {
|
|
2007
2067
|
id: randomUUID(),
|
|
2008
2068
|
provider,
|
|
2009
|
-
env: {},
|
|
2069
|
+
env: { ...manifest.commandEnv ?? {} },
|
|
2010
2070
|
headerTransforms,
|
|
2011
2071
|
expiresAt: new Date(Date.now() + MAX_LEASE_MS).toISOString(),
|
|
2012
2072
|
metadata: {
|
|
@@ -2212,7 +2272,7 @@ function createGitHubAppBroker(manifest, credentials) {
|
|
|
2212
2272
|
return {
|
|
2213
2273
|
id: randomUUID2(),
|
|
2214
2274
|
provider,
|
|
2215
|
-
env: { [authTokenEnv]: placeholder },
|
|
2275
|
+
env: { ...manifest.commandEnv ?? {}, [authTokenEnv]: placeholder },
|
|
2216
2276
|
headerTransforms: mergeHeaderTransforms([
|
|
2217
2277
|
...pluginHeaderTransforms(),
|
|
2218
2278
|
...leaseDomains.map((domain) => ({
|
|
@@ -2256,7 +2316,7 @@ function createGitHubAppBroker(manifest, credentials) {
|
|
|
2256
2316
|
return {
|
|
2257
2317
|
id: randomUUID2(),
|
|
2258
2318
|
provider,
|
|
2259
|
-
env: { [authTokenEnv]: placeholder },
|
|
2319
|
+
env: { ...manifest.commandEnv ?? {}, [authTokenEnv]: placeholder },
|
|
2260
2320
|
headerTransforms: mergeHeaderTransforms([
|
|
2261
2321
|
...pluginHeaderTransforms(),
|
|
2262
2322
|
...leaseDomains.map((domain) => ({
|
|
@@ -2435,7 +2495,10 @@ function createOAuthBearerBroker(manifest, credentials, deps) {
|
|
|
2435
2495
|
return {
|
|
2436
2496
|
id: randomUUID3(),
|
|
2437
2497
|
provider,
|
|
2438
|
-
env: {
|
|
2498
|
+
env: {
|
|
2499
|
+
...manifest.commandEnv ?? {},
|
|
2500
|
+
[authTokenEnv]: authTokenPlaceholder
|
|
2501
|
+
},
|
|
2439
2502
|
headerTransforms: mergeHeaderTransforms([
|
|
2440
2503
|
...pluginHeaderTransforms(),
|
|
2441
2504
|
...apiDomains.map((domain) => ({
|
|
@@ -2656,7 +2719,7 @@ function buildLoadedPluginState(source) {
|
|
|
2656
2719
|
{},
|
|
2657
2720
|
{
|
|
2658
2721
|
"file.directory": pluginsRoot,
|
|
2659
|
-
"
|
|
2722
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
2660
2723
|
},
|
|
2661
2724
|
"Failed to read plugin root"
|
|
2662
2725
|
);
|
|
@@ -2684,7 +2747,7 @@ function buildLoadedPluginState(source) {
|
|
|
2684
2747
|
{},
|
|
2685
2748
|
{
|
|
2686
2749
|
"file.directory": pluginsRoot,
|
|
2687
|
-
"
|
|
2750
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
2688
2751
|
},
|
|
2689
2752
|
"Failed to read plugin root"
|
|
2690
2753
|
);
|
|
@@ -2728,7 +2791,7 @@ function logLoadedPlugins(state) {
|
|
|
2728
2791
|
"app.plugin.config_key_count": plugin.manifest.configKeys.length,
|
|
2729
2792
|
"app.plugin.has_mcp": Boolean(plugin.manifest.mcp),
|
|
2730
2793
|
"file.directory": plugin.dir,
|
|
2731
|
-
"file.skill_directory": plugin.skillsDir
|
|
2794
|
+
"app.file.skill_directory": plugin.skillsDir
|
|
2732
2795
|
},
|
|
2733
2796
|
"Loaded plugin"
|
|
2734
2797
|
);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
serializeGenAiAttribute,
|
|
8
8
|
setSpanAttributes,
|
|
9
9
|
withSpan
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SCE5C645.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/state/adapter.ts
|
|
13
13
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
@@ -182,7 +182,7 @@ async function completeText(params) {
|
|
|
182
182
|
{},
|
|
183
183
|
{
|
|
184
184
|
...baseAttributes,
|
|
185
|
-
"
|
|
185
|
+
"exception.message": providerMessage
|
|
186
186
|
},
|
|
187
187
|
"AI completion returned provider error"
|
|
188
188
|
);
|
|
@@ -197,7 +197,6 @@ async function completeText(params) {
|
|
|
197
197
|
);
|
|
198
198
|
}
|
|
199
199
|
async function completeObject(params) {
|
|
200
|
-
const startedAt = Date.now();
|
|
201
200
|
let text = "";
|
|
202
201
|
try {
|
|
203
202
|
({ text } = await completeText({
|
|
@@ -224,8 +223,7 @@ async function completeObject(params) {
|
|
|
224
223
|
{
|
|
225
224
|
"gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
|
|
226
225
|
"gen_ai.operation.name": GEN_AI_OPERATION_CHAT,
|
|
227
|
-
"gen_ai.request.model": params.modelId
|
|
228
|
-
"app.ai.duration_ms": Date.now() - startedAt
|
|
226
|
+
"gen_ai.request.model": params.modelId
|
|
229
227
|
},
|
|
230
228
|
"AI object completion failed"
|
|
231
229
|
);
|
|
@@ -242,7 +240,6 @@ async function completeObject(params) {
|
|
|
242
240
|
"gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
|
|
243
241
|
"gen_ai.operation.name": GEN_AI_OPERATION_CHAT,
|
|
244
242
|
"gen_ai.request.model": params.modelId,
|
|
245
|
-
"app.ai.duration_ms": Date.now() - startedAt,
|
|
246
243
|
"app.ai.response_preview": preview
|
|
247
244
|
},
|
|
248
245
|
"AI object completion schema parse failed"
|
package/dist/cli/check.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7QYONRLH.js";
|
|
4
4
|
import {
|
|
5
5
|
parsePluginManifest
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-SCE5C645.js";
|
|
7
7
|
import "../chunk-Z3YD6NHK.js";
|
|
8
8
|
import "../chunk-XPXD3FCE.js";
|
|
9
9
|
import "../chunk-2KG3PWR4.js";
|
package/dist/cli/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
disconnectStateAdapter,
|
|
3
3
|
resolveRuntimeDependencySnapshot
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-Y3UO7NR6.js";
|
|
5
5
|
import {
|
|
6
6
|
getPluginProviders,
|
|
7
7
|
getPluginRuntimeDependencies,
|
|
8
8
|
getPluginRuntimePostinstall
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-SCE5C645.js";
|
|
10
10
|
import "../chunk-Z3YD6NHK.js";
|
|
11
11
|
import "../chunk-XPXD3FCE.js";
|
|
12
12
|
import "../chunk-2KG3PWR4.js";
|