@osfactory/otel-hook 0.13.0 → 0.13.1
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/cli.js +124 -31
- package/dist/cli.js.map +1 -1
- package/dist/{export-destinations-Bey2djRk.d.ts → export-destinations-DUeQKr_C.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +116 -23
- package/dist/index.js.map +1 -1
- package/dist/install.js +4 -1
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +2 -2
- package/dist/integration.js +105 -18
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +8 -1
- package/dist/lifecycle.js +10 -3
- package/dist/lifecycle.js.map +1 -1
- package/dist/{metric-model-CFIeUwqd.d.ts → metric-model-B4lIuk6i.d.ts} +8 -0
- package/dist/providers.js +11 -2
- package/dist/providers.js.map +1 -1
- package/dist/state.js +20 -6
- package/dist/state.js.map +1 -1
- package/dist/telemetry.d.ts +2 -2
- package/dist/telemetry.js +69 -6
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.js +11 -2
- package/dist/testing.js.map +1 -1
- package/package.json +2 -1
package/dist/testing.js
CHANGED
|
@@ -2232,7 +2232,10 @@ var postToolUseFailurePayloadSchema = z16.object({
|
|
|
2232
2232
|
hook_event_name: z16.literal("PostToolUseFailure"),
|
|
2233
2233
|
tool_name: z16.string().min(1),
|
|
2234
2234
|
tool_input: z16.unknown().optional(),
|
|
2235
|
-
|
|
2235
|
+
// Optional: a failure that names no message still ends its tool call. The
|
|
2236
|
+
// `error` spelling Claude Code 2.1.x sends is folded onto it by
|
|
2237
|
+
// `normalizeClaudeHookPayload`.
|
|
2238
|
+
tool_error: z16.unknown().optional(),
|
|
2236
2239
|
tool_use_id: z16.string().min(1)
|
|
2237
2240
|
});
|
|
2238
2241
|
var permissionRequestPayloadSchema = z16.object({
|
|
@@ -2601,7 +2604,13 @@ var normalizeClaudeHookPayload = (payload) => {
|
|
|
2601
2604
|
if (record === void 0) {
|
|
2602
2605
|
return payload;
|
|
2603
2606
|
}
|
|
2604
|
-
return applyUsageShape(applyPrintResultShape(applyFieldAliases(record)));
|
|
2607
|
+
return applyUsageShape(applyToolFailureShape(applyPrintResultShape(applyFieldAliases(record))));
|
|
2608
|
+
};
|
|
2609
|
+
var applyToolFailureShape = (record) => {
|
|
2610
|
+
if (record.hook_event_name !== "PostToolUseFailure" || record.tool_error !== void 0 || record.error === void 0) {
|
|
2611
|
+
return record;
|
|
2612
|
+
}
|
|
2613
|
+
return { ...record, tool_error: record.error };
|
|
2605
2614
|
};
|
|
2606
2615
|
var applyUsageShape = (record) => {
|
|
2607
2616
|
const usage = coerceClaudeUsage(record.usage) ?? coerceClaudeUsage(record.token_usage) ?? coerceClaudeUsage(record.tokenUsage);
|