a24z 1.0.17 → 1.0.18

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/brandonin/Projects/a24z-observability/apps/a24z-cli/src/hook-handler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ interface HttpTransportOptions {
2
+ url: string;
3
+ headers: Record<string, string>;
4
+ filter?: (obj: any) => boolean;
5
+ }
6
+ export default function (options: HttpTransportOptions): any;
7
+ export {};
8
+ //# sourceMappingURL=http-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport.d.ts","sourceRoot":"","sources":["../src/http-transport.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,oBAAoB,OAiCrD"}
@@ -0,0 +1,33 @@
1
+ import build from 'pino-abstract-transport';
2
+ export default function (options) {
3
+ return build(async function (source) {
4
+ for await (const obj of source) {
5
+ // Apply filter if provided
6
+ if (options.filter && !options.filter(obj)) {
7
+ continue;
8
+ }
9
+ // Remove pino-specific fields before sending
10
+ const { level, time, pid, hostname, ...cleanObj } = obj;
11
+ try {
12
+ const response = await fetch(options.url, {
13
+ method: 'POST',
14
+ headers: {
15
+ ...options.headers,
16
+ 'User-Agent': 'a24z-cli/1.0.0',
17
+ },
18
+ body: JSON.stringify(cleanObj),
19
+ });
20
+ if (!response.ok) {
21
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
22
+ }
23
+ // Successfully sent hook data
24
+ }
25
+ catch (error) {
26
+ // Log transport errors without causing infinite loops
27
+ // Use a simple console.error to avoid recursion
28
+ console.error(`Failed to send hook data to ${options.url}:`, error instanceof Error ? error.message : String(error));
29
+ }
30
+ }
31
+ });
32
+ }
33
+ //# sourceMappingURL=http-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport.js","sourceRoot":"","sources":["../src/http-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAQ5C,MAAM,CAAC,OAAO,WAAW,OAA6B;IACpD,OAAO,KAAK,CAAC,KAAK,WAAW,MAAM;QACjC,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YAC/B,2BAA2B;YAC3B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3C,SAAS;YACX,CAAC;YAED,6CAA6C;YAC7C,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,GAAG,GAAG,CAAC;YAExD,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;oBACxC,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE;wBACP,GAAG,OAAO,CAAC,OAAO;wBAClB,YAAY,EAAE,gBAAgB;qBAC/B;oBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;iBAC/B,CAAC,CAAC;gBAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;gBACrE,CAAC;gBAED,8BAA8B;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,sDAAsD;gBACtD,gDAAgD;gBAChD,OAAO,CAAC,KAAK,CAAC,+BAA+B,OAAO,CAAC,GAAG,GAAG,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}