@agenthoney/analytics 0.0.0-stage → 0.14.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.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -2
  3. package/dist/answers.cjs +20034 -0
  4. package/dist/answers.cjs.map +1 -0
  5. package/dist/answers.d.ts +148 -0
  6. package/dist/answers.js +139 -0
  7. package/dist/answers.js.map +1 -0
  8. package/dist/chunk-CD4WLJX7.js +48 -0
  9. package/dist/chunk-CD4WLJX7.js.map +1 -0
  10. package/dist/chunk-F3PRHEXB.js +20143 -0
  11. package/dist/chunk-F3PRHEXB.js.map +1 -0
  12. package/dist/chunk-L22VERBM.js +911 -0
  13. package/dist/chunk-L22VERBM.js.map +1 -0
  14. package/dist/chunk-OH4H2B7O.js +150 -0
  15. package/dist/chunk-OH4H2B7O.js.map +1 -0
  16. package/dist/chunk-R76CTIBG.js +701 -0
  17. package/dist/chunk-R76CTIBG.js.map +1 -0
  18. package/dist/chunk-UG3REZCJ.js +147 -0
  19. package/dist/chunk-UG3REZCJ.js.map +1 -0
  20. package/dist/core/breaker.d.ts +33 -0
  21. package/dist/core/collector.d.ts +51 -0
  22. package/dist/core/config.d.ts +124 -0
  23. package/dist/core/encode.d.ts +32 -0
  24. package/dist/core/queue.d.ts +39 -0
  25. package/dist/core/record-gate.d.ts +17 -0
  26. package/dist/core/safe.d.ts +17 -0
  27. package/dist/core/transport.d.ts +45 -0
  28. package/dist/express.cjs +21789 -0
  29. package/dist/express.cjs.map +1 -0
  30. package/dist/express.d.ts +65 -0
  31. package/dist/express.js +6 -0
  32. package/dist/express.js.map +1 -0
  33. package/dist/index.cjs +22118 -0
  34. package/dist/index.cjs.map +1 -0
  35. package/dist/index.d.ts +51 -0
  36. package/dist/index.js +8 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/next.cjs +21186 -0
  39. package/dist/next.cjs.map +1 -0
  40. package/dist/next.d.ts +90 -0
  41. package/dist/next.js +5 -0
  42. package/dist/next.js.map +1 -0
  43. package/dist/observe/client-ip.d.ts +109 -0
  44. package/dist/observe/next-router.d.ts +22 -0
  45. package/dist/observe/redact.d.ts +58 -0
  46. package/dist/observe/request.d.ts +75 -0
  47. package/dist/observe/response.d.ts +24 -0
  48. package/dist/runtime.d.ts +27 -0
  49. package/dist/serve/accept.d.ts +7 -0
  50. package/dist/serve/discovery.d.ts +56 -0
  51. package/dist/serve/hosted.d.ts +135 -0
  52. package/dist/serve/source.d.ts +48 -0
  53. package/dist/serve/tag-asset.generated.d.ts +14 -0
  54. package/dist/serve/tag.d.ts +131 -0
  55. package/dist/serve/twin.d.ts +162 -0
  56. package/dist/web.cjs +21225 -0
  57. package/dist/web.cjs.map +1 -0
  58. package/dist/web.d.ts +52 -0
  59. package/dist/web.js +6 -0
  60. package/dist/web.js.map +1 -0
  61. package/install.md +463 -0
  62. package/package.json +76 -4
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The seam between the collector and the network.
3
+ *
4
+ * Exists so the collector can be tested without a socket, and so a runtime
5
+ * without `fetch` can supply its own. The three-way outcome below is the
6
+ * important part of the contract.
7
+ */
8
+ export type SendOutcome = {
9
+ outcome: "accepted";
10
+ status: number;
11
+ }
12
+ /**
13
+ * A 4xx that is not 408 or 429: our payload is wrong.
14
+ *
15
+ * ⚠️ **Drop the batch. Do not retry, and do not count it against the
16
+ * breaker.** Retrying a body the server has already judged malformed just
17
+ * sends it again, and treating it as an outage would let one bad field
18
+ * silence all telemetry for thirty seconds at a time while the endpoint is
19
+ * perfectly healthy. This is the same distinction maxidomo-app's
20
+ * `ExpectedError` draws: a failure somebody wrote on purpose is not an
21
+ * incident.
22
+ */
23
+ | {
24
+ outcome: "rejected";
25
+ status: number;
26
+ }
27
+ /** Network error, timeout, 408, 429 or 5xx. Retry, and count it. */
28
+ | {
29
+ outcome: "retryable";
30
+ status?: number;
31
+ retryAfterMs?: number;
32
+ };
33
+ export interface Transport {
34
+ send(body: string, headers: Readonly<Record<string, string>>, signal: AbortSignal): Promise<SendOutcome>;
35
+ }
36
+ /** Map an HTTP status onto the outcome taxonomy above. */
37
+ export declare function outcomeForStatus(status: number, retryAfterMs?: number): SendOutcome;
38
+ /**
39
+ * The default transport: `fetch`, which every supported runtime has.
40
+ *
41
+ * ⚠️ It never throws. A thrown transport would reach the flush loop, and a
42
+ * flush loop that can throw is one unhandled rejection away from taking a
43
+ * customer's process down with it.
44
+ */
45
+ export declare function fetchTransport(url: string): Transport;