stitchkit 0.115.0 → 0.117.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/CHANGELOG.md +67 -0
- package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts +9 -2
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts +3 -0
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts +4 -1
- package/dist/agent-runtime/run-failure.d.ts.map +1 -1
- package/dist/agent-runtime/run-store-retry.d.ts +8 -0
- package/dist/agent-runtime/run-store-retry.d.ts.map +1 -0
- package/dist/agent-runtime/run-terminal.d.ts.map +1 -1
- package/dist/agent-runtime/run-unacquired.d.ts +19 -0
- package/dist/agent-runtime/run-unacquired.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +8 -0
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +5 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +34 -4
- package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
- package/dist/entrypoints/agent-runtime/harness.js +4 -4
- package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +7 -7
- package/dist/entrypoints/agent-runtime/sqlite/node.js +7 -7
- package/dist/entrypoints/agent-runtime/testing.js +26 -8
- package/dist/entrypoints/agent-runtime.d.ts +1 -1
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +17 -15
- package/dist/entrypoints/application/diagnostic-journal.js +1 -1
- package/dist/entrypoints/application/directory-inbox.js +3 -3
- package/dist/entrypoints/cli/publish.js +2 -2
- package/dist/entrypoints/cli.js +3 -3
- package/dist/entrypoints/files.js +2 -2
- package/dist/entrypoints/primitives.js +51 -154
- package/dist/entrypoints/server.js +6 -6
- package/dist/entrypoints/telegram/grammy.js +2 -2
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +203 -70
- package/dist/entrypoints/tools.js +3 -3
- package/dist/entrypoints/tracking/contract.d.ts +11 -0
- package/dist/entrypoints/tracking/contract.d.ts.map +1 -0
- package/dist/entrypoints/tracking/contract.js +162 -0
- package/dist/entrypoints/tracking/performance.d.ts +8 -0
- package/dist/entrypoints/tracking/performance.d.ts.map +1 -0
- package/dist/entrypoints/tracking/performance.js +181 -0
- package/dist/entrypoints/tracking/server.d.ts +1 -0
- package/dist/entrypoints/tracking/server.d.ts.map +1 -1
- package/dist/entrypoints/tracking/server.js +40 -12
- package/dist/entrypoints/tracking.d.ts +4 -3
- package/dist/entrypoints/tracking.d.ts.map +1 -1
- package/dist/entrypoints/tracking.js +43 -143
- package/dist/entrypoints/xlsx.d.ts +4 -0
- package/dist/entrypoints/xlsx.d.ts.map +1 -0
- package/dist/entrypoints/xlsx.js +406 -0
- package/dist/{index-crmswbrt.js → index-073nw9qr.js} +8 -8
- package/dist/index-1f40z584.js +7 -0
- package/dist/{index-nregbbsc.js → index-6f49krb5.js} +1 -1
- package/dist/{index-fdk4r4r6.js → index-75ns2ybj.js} +1 -1
- package/dist/{index-x0ddbj85.js → index-arjmb6de.js} +36 -1
- package/dist/{index-944x38nv.js → index-cycp3r3e.js} +125 -182
- package/dist/{index-dx5cm9pc.js → index-ghtpfz4z.js} +9 -9
- package/dist/{index-n3v695sb.js → index-hdjmdwsj.js} +277 -96
- package/dist/{index-7yx8j6ay.js → index-n5sv4z0w.js} +12 -3
- package/dist/{index-zqkz4af9.js → index-nqxrm176.js} +1 -1
- package/dist/{index-j8kf56wx.js → index-q968hy6y.js} +1 -1
- package/dist/index-qezhmp51.js +242 -0
- package/dist/index-vv1sch8a.js +94 -0
- package/dist/{index-3qqdqwxe.js → index-w7jq3fz9.js} +25 -5
- package/dist/{index-fggxgbrk.js → index-xx1j310k.js} +165 -102
- package/dist/internal/contained-files.d.ts +10 -0
- package/dist/internal/contained-files.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/primitives/decimal.d.ts +10 -0
- package/dist/primitives/decimal.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/money.d.ts +20 -0
- package/dist/primitives/money.d.ts.map +1 -1
- package/dist/primitives/quantity.d.ts.map +1 -1
- package/dist/primitives/rounding.d.ts +40 -0
- package/dist/primitives/rounding.d.ts.map +1 -0
- package/dist/telegram/budget-transformer.d.ts +6 -3
- package/dist/telegram/budget-transformer.d.ts.map +1 -1
- package/dist/telegram/not-dispatched.d.ts +2 -2
- package/dist/telegram/not-dispatched.d.ts.map +1 -1
- package/dist/telegram/outbound-budget.d.ts +72 -20
- package/dist/telegram/outbound-budget.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts +5 -0
- package/dist/telegram/outbound-cost.d.ts.map +1 -0
- package/dist/telegram/outbound-pauses.d.ts +17 -0
- package/dist/telegram/outbound-pauses.d.ts.map +1 -0
- package/dist/telegram/outbound-queue.d.ts +17 -0
- package/dist/telegram/outbound-queue.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts +7 -1
- package/dist/tools/cli/view.d.ts.map +1 -1
- package/dist/tracking/attribution.d.ts +1 -1
- package/dist/tracking/attribution.d.ts.map +1 -1
- package/dist/tracking/client-visit.d.ts +3 -1
- package/dist/tracking/client-visit.d.ts.map +1 -1
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/performance/collector.d.ts +61 -0
- package/dist/tracking/performance/collector.d.ts.map +1 -0
- package/dist/tracking/performance/schema.d.ts +45 -0
- package/dist/tracking/performance/schema.d.ts.map +1 -0
- package/dist/tracking/performance/summary.d.ts +12 -0
- package/dist/tracking/performance/summary.d.ts.map +1 -0
- package/dist/tracking/privacy.d.ts +5 -0
- package/dist/tracking/privacy.d.ts.map +1 -0
- package/dist/tracking/server/telemetry-health.d.ts +31 -0
- package/dist/tracking/server/telemetry-health.d.ts.map +1 -0
- package/dist/xlsx/cells.d.ts +17 -0
- package/dist/xlsx/cells.d.ts.map +1 -0
- package/dist/xlsx/render.d.ts +11 -0
- package/dist/xlsx/render.d.ts.map +1 -0
- package/dist/xlsx/schema.d.ts +119 -0
- package/dist/xlsx/schema.d.ts.map +1 -0
- package/dist/xlsx/zip.d.ts +13 -0
- package/dist/xlsx/zip.d.ts.map +1 -0
- package/llms/agent-runtime.2.txt +40 -16
- package/llms/agent-runtime.3.txt +17 -0
- package/llms/agent-runtime.txt +6 -3
- package/llms/cli.txt +3 -1
- package/llms/primitives.txt +21 -0
- package/llms/stitchkit.txt +9 -6
- package/llms/telegram.txt +39 -12
- package/llms/tracking-contract.txt +32 -0
- package/llms/tracking-performance.txt +21 -0
- package/llms/tracking-server.txt +1 -0
- package/llms/tracking.txt +75 -12
- package/llms/{upgrading-0.104.0-0.115.0.txt → upgrading-0.105.0-0.117.0.txt} +73 -124
- package/llms/{upgrading-0.44.0-0.61.0.txt → upgrading-0.44.0-0.62.0.txt} +120 -3
- package/llms/{upgrading-0.62.0-0.78.0.txt → upgrading-0.63.0-0.83.0.txt} +181 -120
- package/llms/{upgrading-0.79.0-0.103.13.txt → upgrading-0.84.0-0.104.0.txt} +124 -181
- package/llms/upgrading.txt +4 -4
- package/llms/xlsx.txt +107 -0
- package/llms-full.txt +390 -34
- package/llms.txt +15 -11
- package/package.json +27 -9
- package/dist/{index-z3d6smer.js → index-tdpmfks8.js} +5 -5
|
@@ -13,11 +13,21 @@
|
|
|
13
13
|
* `forwardMessages` cost their message ids, and the follow-up call to action
|
|
14
14
|
* after an album is one more message.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* Two lanes share that one rate. An `interactive` call is granted before any
|
|
17
|
+
* `bulk` call that is waiting, so a person's reply never queues behind a
|
|
18
|
+
* campaign; a campaign runs at whatever rate replies leave it.
|
|
19
|
+
*
|
|
20
|
+
* **It paces; it does not retry.** A 429 on a method that spends the budget
|
|
21
|
+
* pauses the chat it was sent to for the wait Telegram stated (or a declared
|
|
22
|
+
* fallback when it stated none); every other chat of the token goes on. Telegram
|
|
23
|
+
* words a group's limit, a chat's pace and the bot's own limit alike, and only
|
|
24
|
+
* the addressee differs, so one chat's refusal is read as that chat's. Refusals
|
|
25
|
+
* from several chats inside a short window are read as the bot's own limit and
|
|
26
|
+
* pause the token, as does a 429 with no chat to blame. A 429 on an edit or a
|
|
27
|
+
* read concerns that call and pauses nothing. A network failure or a 5xx is
|
|
28
|
+
* returned to the caller unchanged: repeating a send whose external outcome is
|
|
29
|
+
* unknown is the caller's decision, and a primitive that retried it would turn
|
|
30
|
+
* one unknown message into two.
|
|
21
31
|
*
|
|
22
32
|
* The schedule is a strict token budget, not a bucket with a full burst: the
|
|
23
33
|
* first call after an idle period is immediate, and every later call occupies
|
|
@@ -25,16 +35,25 @@
|
|
|
25
35
|
* saved burst at start and again after a 429 pause, which is exactly the
|
|
26
36
|
* stampede a shared budget exists to prevent.
|
|
27
37
|
*/
|
|
38
|
+
/** Whose turn comes first. `interactive` answers a person; `bulk` is a campaign. */
|
|
39
|
+
export type TelegramOutboundLane = 'interactive' | 'bulk';
|
|
28
40
|
export interface TelegramOutboundBudgetConfig {
|
|
29
41
|
/** The bot token whose sends share this budget. It is never returned or logged. */
|
|
30
42
|
readonly token: string;
|
|
31
43
|
/** Telegram messages per second. Default 24. */
|
|
32
44
|
readonly messagesPerSecond?: number;
|
|
33
45
|
/**
|
|
34
|
-
* How long a 429 without `retry_after` pauses
|
|
46
|
+
* How long a 429 without `retry_after` pauses. Default 1000 ms.
|
|
35
47
|
* Telegram's own `retry_after` is always used instead when present.
|
|
36
48
|
*/
|
|
37
49
|
readonly retryAfterFallbackMs?: number;
|
|
50
|
+
/**
|
|
51
|
+
* How many different chats have to get a 429 inside `tokenPauseWindowMs`
|
|
52
|
+
* before the token pauses instead of those chats. Default 3.
|
|
53
|
+
*/
|
|
54
|
+
readonly tokenPauseChats?: number;
|
|
55
|
+
/** The window `tokenPauseChats` is counted in. Default 5000 ms. */
|
|
56
|
+
readonly tokenPauseWindowMs?: number;
|
|
38
57
|
/**
|
|
39
58
|
* Test seam: the monotonic clock. Default `performance.now`. A wall clock can
|
|
40
59
|
* jump backwards and turn a pause into a burst, so the default is monotonic.
|
|
@@ -52,11 +71,37 @@ export interface TelegramOutboundBudgetStats {
|
|
|
52
71
|
readonly granted: number;
|
|
53
72
|
/** Weighted messages admitted: an album of three counts as three. */
|
|
54
73
|
readonly messages: number;
|
|
55
|
-
/** Calls waiting for their turn. */
|
|
74
|
+
/** Calls waiting for their turn, in both lanes. */
|
|
56
75
|
readonly queued: number;
|
|
76
|
+
/** How many of them are in the `bulk` lane. */
|
|
77
|
+
readonly queuedBulk: number;
|
|
57
78
|
readonly messagesPerSecond: number;
|
|
58
|
-
/** How much of the current
|
|
79
|
+
/** How much of the current token pause is still ahead, in milliseconds. */
|
|
59
80
|
readonly pausedForMs: number;
|
|
81
|
+
/** Chats on their own 429 pause right now. */
|
|
82
|
+
readonly pausedChats: number;
|
|
83
|
+
}
|
|
84
|
+
export interface TelegramOutboundCallOptions {
|
|
85
|
+
/** Default `interactive`. */
|
|
86
|
+
readonly lane?: TelegramOutboundLane;
|
|
87
|
+
/** The addressed chat: a pause of that chat holds this call. `run` reads `chat_id` itself. */
|
|
88
|
+
readonly chatId?: number | string;
|
|
89
|
+
/**
|
|
90
|
+
* What this call's own 429 does. `pause` (the default) pauses its chat. `call`
|
|
91
|
+
* pauses nothing, for a chat known to run into its limit: the refusal concerns
|
|
92
|
+
* this send alone. The call still spends the budget and waits out other pauses.
|
|
93
|
+
*/
|
|
94
|
+
readonly refusal?: 'pause' | 'call';
|
|
95
|
+
/**
|
|
96
|
+
* Give up after this long in the queue with `TelegramNotDispatchedError`,
|
|
97
|
+
* stage `queue`: nothing was sent, so repeating it is safe. A burst to one
|
|
98
|
+
* chat on pause otherwise queues without limit. Default: wait.
|
|
99
|
+
*/
|
|
100
|
+
readonly maxWaitMs?: number;
|
|
101
|
+
}
|
|
102
|
+
/** Which chat a pause or a wait concerns. */
|
|
103
|
+
export interface TelegramOutboundChatOptions {
|
|
104
|
+
readonly chatId?: number | string;
|
|
60
105
|
}
|
|
61
106
|
/**
|
|
62
107
|
* A token's outbound budget. `run` is the narrow adapter a client transformer
|
|
@@ -64,28 +109,35 @@ export interface TelegramOutboundBudgetStats {
|
|
|
64
109
|
*/
|
|
65
110
|
export interface TelegramOutboundBudget {
|
|
66
111
|
/**
|
|
67
|
-
* Run one Bot API call under the budget
|
|
68
|
-
* without spending a message. A 429
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
112
|
+
* Run one Bot API call under the budget, in the `interactive` lane by default.
|
|
113
|
+
* A non-send method passes through without spending a message. A 429 on a send
|
|
114
|
+
* pauses the chat in the payload's `chat_id`, whether `send` throws it or resolves
|
|
115
|
+
* with the Bot API's `{ ok: false, … }` body, as a client transformer's `send`
|
|
116
|
+
* does; several chats refused at once, or a call with no chat, pause the token.
|
|
117
|
+
* A 429 on a non-send method pauses nothing. The error is rethrown, or the
|
|
118
|
+
* response returned, unchanged and the call is not repeated.
|
|
72
119
|
*/
|
|
73
|
-
run<T>(method: string, payload: unknown, signal: AbortSignal | undefined, send: () => Promise<T
|
|
120
|
+
run<T>(method: string, payload: unknown, signal: AbortSignal | undefined, send: () => Promise<T>, options?: TelegramOutboundCallOptions): Promise<T>;
|
|
74
121
|
/**
|
|
75
122
|
* Wait until `cost` messages fit. The wait rejects with `signal.reason`
|
|
76
123
|
* without spending a token; a granted call owns its slots even if its later
|
|
77
124
|
* send is aborted, which the caller must not repeat as a definite failure.
|
|
78
125
|
*/
|
|
79
|
-
acquire(cost: number, signal?: AbortSignal): Promise<void>;
|
|
126
|
+
acquire(cost: number, signal?: AbortSignal, options?: TelegramOutboundCallOptions): Promise<void>;
|
|
80
127
|
/** Pause every sender of this token for at least `milliseconds`. Never shortens an existing pause. */
|
|
81
128
|
pause(milliseconds: number): void;
|
|
82
|
-
/** Pause the token after a rate-limited refusal; another failure does nothing. */
|
|
83
|
-
pauseAfter(error: unknown): void;
|
|
84
129
|
/**
|
|
85
|
-
*
|
|
86
|
-
* is
|
|
130
|
+
* Pause after a rate-limited refusal; another failure does nothing. With
|
|
131
|
+
* `chatId` this is that chat's pause, counted like a refusal `run` saw; without
|
|
132
|
+
* it, the token's.
|
|
133
|
+
*/
|
|
134
|
+
pauseAfter(error: unknown, options?: TelegramOutboundChatOptions): void;
|
|
135
|
+
/**
|
|
136
|
+
* Wait out the current pause without spending a token, and that chat's own
|
|
137
|
+
* with `chatId`. For a retry path that is not a send (edit, delete) and does
|
|
138
|
+
* not go through `acquire`.
|
|
87
139
|
*/
|
|
88
|
-
waitUntilResumed(signal?: AbortSignal): Promise<void>;
|
|
140
|
+
waitUntilResumed(signal?: AbortSignal, options?: TelegramOutboundChatOptions): Promise<void>;
|
|
89
141
|
/** Measured counters. It never contains the token. */
|
|
90
142
|
stats(): TelegramOutboundBudgetStats;
|
|
91
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbound-budget.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-budget.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"outbound-budget.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AA8BH,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,4BAA4B;IAC3C,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;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,6CAA6C;AAC7C,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;OAQG;IACH,GAAG,CAAC,CAAC,EACH,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,CAAC,CAAC,CAAC;IACd;;;;OAIG;IACH,OAAO,CACL,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,sGAAsG;IACtG,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IACxE;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7F,sDAAsD;IACtD,KAAK,IAAI,2BAA2B,CAAC;CACtC;AAkGD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,sBAAsB,CA+CxB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** One message-producing call costs one; an empty or malformed array still costs one. */
|
|
2
|
+
export declare function sendCost(method: string, payload: unknown): number;
|
|
3
|
+
/** The chat a call addresses; a Bot API `chat_id` is a number or an `@username`. */
|
|
4
|
+
export declare function chatOf(payload: unknown): string | undefined;
|
|
5
|
+
//# sourceMappingURL=outbound-cost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-cost.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-cost.ts"],"names":[],"mappings":"AA2CA,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAMjE;AAED,oFAAoF;AACpF,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI3D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** When a refusal is read as the bot's own limit rather than one chat's. */
|
|
2
|
+
export interface OutboundPausePolicy {
|
|
3
|
+
readonly tokenPauseChats: number;
|
|
4
|
+
readonly tokenPauseWindowMs: number;
|
|
5
|
+
}
|
|
6
|
+
/** A token's pauses: its own, and one per chat that got a 429. */
|
|
7
|
+
export interface OutboundPauses {
|
|
8
|
+
/** The instant `chat`, or the token when `chat` is undefined, may send again. */
|
|
9
|
+
resumesAt(chat: string | undefined): number;
|
|
10
|
+
pauseToken(milliseconds: number): void;
|
|
11
|
+
/** One chat's refusal, counted towards reading it as the token's. */
|
|
12
|
+
pauseChat(chat: string, milliseconds: number): void;
|
|
13
|
+
pausedForMs(): number;
|
|
14
|
+
pausedChats(): number;
|
|
15
|
+
}
|
|
16
|
+
export declare function createOutboundPauses({ tokenPauseChats, tokenPauseWindowMs }: OutboundPausePolicy, now: () => number, onPause: () => void): OutboundPauses;
|
|
17
|
+
//# sourceMappingURL=outbound-pauses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-pauses.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-pauses.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5C,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qEAAqE;IACrE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,WAAW,IAAI,MAAM,CAAC;IACtB,WAAW,IAAI,MAAM,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAClC,EAAE,eAAe,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,EAC5D,GAAG,EAAE,MAAM,MAAM,EACjB,OAAO,EAAE,MAAM,IAAI,GAClB,cAAc,CAkDhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TelegramOutboundCallOptions } from './outbound-budget.js';
|
|
2
|
+
import type { OutboundPauses } from './outbound-pauses.js';
|
|
3
|
+
/** One token's waiting calls, granted one interval apart around whatever is paused. */
|
|
4
|
+
export interface OutboundQueue {
|
|
5
|
+
acquire(cost: number, signal?: AbortSignal, options?: TelegramOutboundCallOptions): Promise<void>;
|
|
6
|
+
/** Wake the drain: a pause changed what it was sleeping on. */
|
|
7
|
+
wake(): void;
|
|
8
|
+
wait(milliseconds: number, signal?: AbortSignal): Promise<void>;
|
|
9
|
+
counts(): {
|
|
10
|
+
readonly granted: number;
|
|
11
|
+
readonly messages: number;
|
|
12
|
+
readonly queued: number;
|
|
13
|
+
readonly queuedBulk: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function createOutboundQueue(interval: number, now: () => number, sleepFor: (milliseconds: number, signal?: AbortSignal) => Promise<void>, pauses: OutboundPauses): OutboundQueue;
|
|
17
|
+
//# sourceMappingURL=outbound-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-queue.d.ts","sourceRoot":"","sources":["../../src/telegram/outbound-queue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAwB,MAAM,mBAAmB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAcxD,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,OAAO,CACL,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,+DAA+D;IAC/D,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,IAAI;QACR,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,MAAM,EACjB,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EACvE,MAAM,EAAE,cAAc,GACrB,aAAa,CAwLf"}
|
package/dist/tools/cli/view.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { CliResultView } from './args-view.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* What a view produces: a JSON value, or the one human-facing shape. `order` is the order of
|
|
4
|
+
* a grouped object's keys, which an object cannot hold once a key looks like an integer.
|
|
5
|
+
*/
|
|
3
6
|
export type CliViewOutput = {
|
|
4
7
|
kind: 'json';
|
|
5
8
|
data: unknown;
|
|
9
|
+
order?: readonly string[];
|
|
6
10
|
} | {
|
|
7
11
|
kind: 'text';
|
|
8
12
|
text: string;
|
|
9
13
|
};
|
|
14
|
+
/** One grouped view in its own order, spaced as the CLI spaces any JSON it prints. */
|
|
15
|
+
export declare function stringifyGroups(data: unknown, order: readonly string[], compact: boolean): string;
|
|
10
16
|
/** Compute the requested view, or refuse it with a message naming the field. */
|
|
11
17
|
export declare function renderCliView(data: unknown, view: CliResultView): CliViewOutput;
|
|
12
18
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/view.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/view.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAuGnC,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,OAAO,GACf,MAAM,CAMR;AA6GD,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,GAAG,aAAa,CAgC/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/tracking/attribution.ts"],"names":[],"mappings":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,WAAW,GAAE,SAAS,YAAY,EAAO,GACxC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAY3C;AAmCD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAgB,EAChB,UAAmC,EACnC,KAAgC,EAChC,GAAgB,GACjB,EAAE,uBAAuB,GAAG,mBAAmB,CAwC/C"}
|
|
@@ -7,7 +7,7 @@ import type { Draft } from './client.js';
|
|
|
7
7
|
import { deliverTrackingBatch } from './delivery.js';
|
|
8
8
|
import type { TrackingHost } from './host.js';
|
|
9
9
|
import type { TrackingOutbox, TrackingQueuedEvent } from './outbox.js';
|
|
10
|
-
import type { TrackEventsRequest, TrackEventsResponse, TrackingEventEnvelope, VisitBootstrapResponse, VisitEntryContext } from './schemas.js';
|
|
10
|
+
import type { TrackEventsRequest, TrackEventsResponse, TrackingEventEnvelope, UtmData, VisitBootstrapResponse, VisitEntryContext } from './schemas.js';
|
|
11
11
|
import { createSequenceReserve } from './sequence-reserve.js';
|
|
12
12
|
/** What one tab knows about its visit, shared by bootstrap, delivery and the unload path. */
|
|
13
13
|
export interface VisitState {
|
|
@@ -45,6 +45,8 @@ export declare function createOutboxFlusher<TEvent extends TrackingQueuedEvent>(
|
|
|
45
45
|
}): () => Promise<void>;
|
|
46
46
|
/** The shared sequence source is the outbox; without one, the per-tab fallback is the design. */
|
|
47
47
|
export declare function createVisitSequences(outbox: Pick<TrackingOutbox, 'reserveSequences'> | undefined, visit: VisitState, options: Parameters<typeof createSequenceReserve>[1], fail: (what: string, error: unknown) => void): import("./sequence-reserve.js").SequenceReserve;
|
|
48
|
+
/** Campaign tags arrive in a URL anyone can write, secrets included. */
|
|
49
|
+
export declare function redactedUtm(utm: UtmData): UtmData;
|
|
48
50
|
export declare function pageAttribution(host: TrackingHost, storage: NonNullable<TrackingHost['storage']>, referrerMap: readonly ReferrerRule[] | undefined, search: string, pathname: string): ResolvedAttribution;
|
|
49
51
|
/** A page view; the referrer belongs to the first view of the visit only. */
|
|
50
52
|
export declare function pageViewDraft<TType extends string>(host: TrackingHost, type: TType, pathname: string, previous: string | null): Draft<TType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-visit.d.ts","sourceRoot":"","sources":["../../src/tracking/client-visit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"client-visit.d.ts","sourceRoot":"","sources":["../../src/tracking/client-visit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,OAAO,EACP,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,6FAA6F;AAC7F,MAAM,WAAW,UAAU;IACzB,eAA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CAAC,KAAK,CAAC,KAAK,MAAM,GAAG,IAAI,EACnD,SAAS,EAAE;IAAE,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB;AAED,qGAAqG;AACrG,wBAAsB,oBAAoB,CAAC,MAAM,SAAS,qBAAqB,CAAC,MAAM,CAAC,EACrF,MAAM,EAAE;IACN,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC3E,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;CAC/E,EACD,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACnC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAUrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/tracking/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/tracking/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAanF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,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D,MAAM,EAAE,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAiM5E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare function isLabUserAgent(userAgent: string): boolean;
|
|
2
|
+
/** The part of `web-vitals` this uses, so the declarations do not need the peer. */
|
|
3
|
+
export interface VitalsMetric {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly value: number;
|
|
6
|
+
readonly navigationType?: string;
|
|
7
|
+
}
|
|
8
|
+
export type VitalsObserver = (report: (metric: VitalsMetric) => void, options?: {
|
|
9
|
+
reportAllChanges?: boolean;
|
|
10
|
+
}) => void;
|
|
11
|
+
export interface VitalsLibrary {
|
|
12
|
+
onLCP: VitalsObserver;
|
|
13
|
+
onINP: VitalsObserver;
|
|
14
|
+
onCLS: VitalsObserver;
|
|
15
|
+
onFCP: VitalsObserver;
|
|
16
|
+
onTTFB: VitalsObserver;
|
|
17
|
+
}
|
|
18
|
+
/** What the collector needs from a page. */
|
|
19
|
+
export interface PerformanceHost {
|
|
20
|
+
readonly userAgent: string;
|
|
21
|
+
/** `navigator.webdriver`: a browser under automation. */
|
|
22
|
+
readonly automated: boolean;
|
|
23
|
+
readonly mobile: boolean;
|
|
24
|
+
now(): number;
|
|
25
|
+
route(): string;
|
|
26
|
+
/** Runs `work` once the page has loaded and the main thread is idle. */
|
|
27
|
+
afterLoad(work: () => void): void;
|
|
28
|
+
/** Runs `work` every time the page may be going away. */
|
|
29
|
+
onHidden(work: () => void): void;
|
|
30
|
+
after(delayMs: number, work: () => void): void;
|
|
31
|
+
beacon(url: string, body: string): boolean;
|
|
32
|
+
storage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface PerformanceCollectorConfig {
|
|
35
|
+
/** The build that served the page. */
|
|
36
|
+
buildId: string;
|
|
37
|
+
/**
|
|
38
|
+
* Where `sendBeacon` posts one sample as a JSON string, sent as `text/plain`:
|
|
39
|
+
* the one type a closing page can deliver to another origin. Declare the endpoint
|
|
40
|
+
* `safelistedBody: true`.
|
|
41
|
+
*/
|
|
42
|
+
url: string;
|
|
43
|
+
/** The visit this load belongs to, when the application has one. */
|
|
44
|
+
visitId?: () => string | null;
|
|
45
|
+
/** When the `early` sample leaves, after the library has loaded. Default 5000 ms. */
|
|
46
|
+
earlyDelayMs?: number;
|
|
47
|
+
/** Test seam. Default: the real page. */
|
|
48
|
+
host?: PerformanceHost;
|
|
49
|
+
/** Test seam. Default: `import('web-vitals')`. */
|
|
50
|
+
loadVitals?: () => Promise<VitalsLibrary>;
|
|
51
|
+
}
|
|
52
|
+
export interface PerformanceCollector {
|
|
53
|
+
/** Stop sending, and let a later call start again. Observers of `web-vitals` live on. */
|
|
54
|
+
stop(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Start collecting on this page, and only on a page: on a server, for a lab agent
|
|
58
|
+
* or under automation it returns an inert collector and sends nothing.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createPerformanceCollector(config: PerformanceCollectorConfig): PerformanceCollector;
|
|
61
|
+
//# sourceMappingURL=collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/tracking/performance/collector.ts"],"names":[],"mappings":"AAiCA,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,oFAAoF;AACpF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,EACtC,OAAO,CAAC,EAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;C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3C;AAED,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,IAAI,IAAI,IAAI,CAAC;CACd;AA6ED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,0BAA0B,GACjC,oBAAoB,CA2FtB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The five Web Vitals of one page load. A metric that did not arrive is `null`,
|
|
4
|
+
* never zero: a zero LCP would pull an average down with a page that never
|
|
5
|
+
* painted, and nothing downstream could tell them apart.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PerformanceVitalsSchema: z.ZodObject<{
|
|
8
|
+
lcpMs: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
inpMs: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
fcpMs: z.ZodNullable<z.ZodNumber>;
|
|
11
|
+
ttfbMs: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
cls: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type PerformanceVitals = z.infer<typeof PerformanceVitalsSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* One page load as measured in a real browser. `id` is the same for every sample
|
|
17
|
+
* of that load: `early` arrives while the visitor reads, `final` as the page goes,
|
|
18
|
+
* and the later one replaces the earlier in an application's table.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PerformanceSampleSchema: z.ZodObject<{
|
|
21
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
early: "early";
|
|
25
|
+
final: "final";
|
|
26
|
+
}>;
|
|
27
|
+
route: z.ZodString;
|
|
28
|
+
buildId: z.ZodString;
|
|
29
|
+
visitId: z.ZodNullable<z.ZodString>;
|
|
30
|
+
deviceClass: z.ZodEnum<{
|
|
31
|
+
desktop: "desktop";
|
|
32
|
+
mobile: "mobile";
|
|
33
|
+
}>;
|
|
34
|
+
navigationType: z.ZodNullable<z.ZodString>;
|
|
35
|
+
vitals: z.ZodObject<{
|
|
36
|
+
lcpMs: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
inpMs: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
fcpMs: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
ttfbMs: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
cls: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
capturedAt: z.ZodNumber;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type PerformanceSample = z.infer<typeof PerformanceSampleSchema>;
|
|
45
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tracking/performance/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;iBAYlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PerformanceMetricSummary {
|
|
2
|
+
/** Samples that carried the metric. A `null` is a missing value, not a fast one. */
|
|
3
|
+
readonly samples: number;
|
|
4
|
+
readonly p75: number | null;
|
|
5
|
+
/** `null` below `minSamples`, so a thin route shows no number rather than a wrong one. */
|
|
6
|
+
readonly p95: number | null;
|
|
7
|
+
}
|
|
8
|
+
/** The figures a report may print for one metric of many samples. */
|
|
9
|
+
export declare function summarizePerformanceMetric(values: readonly (number | null)[], options?: {
|
|
10
|
+
readonly minSamples?: number;
|
|
11
|
+
}): PerformanceMetricSummary;
|
|
12
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/tracking/performance/summary.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAOD,qEAAqE;AACrE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAClC,OAAO,GAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,wBAAwB,CAQ1B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Mask secrets in a URL, a query string or free text, cut to 16 KiB. */
|
|
2
|
+
export declare function redactTrackingText(input: string): string;
|
|
3
|
+
/** The same rule through a value of any shape: a secret key masks whatever it holds. */
|
|
4
|
+
export declare function redactTrackingValue(value: unknown): unknown;
|
|
5
|
+
//# sourceMappingURL=privacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../src/tracking/privacy.ts"],"names":[],"mappings":"AA0FA,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyBxD;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAY3D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** What one visit said about its browser's outbox. */
|
|
2
|
+
export interface TrackingOutboxReport {
|
|
3
|
+
/** The browser across its visits: `browserStreamId` of a visit's bootstrap. */
|
|
4
|
+
readonly stream: string;
|
|
5
|
+
readonly state: 'available' | 'unavailable' | 'unknown';
|
|
6
|
+
readonly queued: number;
|
|
7
|
+
/** Lifetime: a browser repeats it with every visit. */
|
|
8
|
+
readonly dropped: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TrackingTelemetryHealth {
|
|
11
|
+
readonly status: 'ok' | 'degraded' | 'unknown';
|
|
12
|
+
readonly observedVisits: number;
|
|
13
|
+
readonly unknownVisits: number;
|
|
14
|
+
readonly unavailable: number;
|
|
15
|
+
/** What each browser last said it still holds. */
|
|
16
|
+
readonly queued: number;
|
|
17
|
+
/** Events lost inside the window. */
|
|
18
|
+
readonly dropped: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Is tracking losing events? A browser keeps `dropped` for life and sends it with
|
|
22
|
+
* every visit, so a sum over visits multiplies an old loss by the number of
|
|
23
|
+
* returns. A loss of this window is what each browser's counter grew by over
|
|
24
|
+
* `baselines`, what it reported before the window; a browser with no earlier report
|
|
25
|
+
* counts from zero, because its loss cannot be told from a new one.
|
|
26
|
+
*
|
|
27
|
+
* `queued` stays out of the verdict: those are a past visit's events, which the
|
|
28
|
+
* next visit delivers. They become a loss only by being dropped.
|
|
29
|
+
*/
|
|
30
|
+
export declare function trackingTelemetryHealth(reports: readonly TrackingOutboxReport[], baselines?: ReadonlyMap<string, number>): TrackingTelemetryHealth;
|
|
31
|
+
//# sourceMappingURL=telemetry-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-health.d.ts","sourceRoot":"","sources":["../../../src/tracking/server/telemetry-health.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,oBAAoB,EAAE,EACxC,SAAS,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GACjD,uBAAuB,CAgCzB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { XlsxColumn } from './schema.js';
|
|
2
|
+
export declare class XlsxCellError extends TypeError {
|
|
3
|
+
readonly name = "XlsxCellError";
|
|
4
|
+
}
|
|
5
|
+
/** What goes into `<c>`: a number as written, a flag, or text. */
|
|
6
|
+
export type XlsxCell = {
|
|
7
|
+
readonly kind: 'number';
|
|
8
|
+
readonly value: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'boolean';
|
|
11
|
+
readonly value: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'text';
|
|
14
|
+
readonly value: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function cellOf(value: unknown, column: XlsxColumn, where: string): XlsxCell;
|
|
17
|
+
//# sourceMappingURL=cells.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cells.d.ts","sourceRoot":"","sources":["../../src/xlsx/cells.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAY3C,qBAAa,aAAc,SAAQ,SAAS;IAC1C,SAAkB,IAAI,mBAAmB;CAC1C;AAED,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA4HtD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAkBlF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type XlsxWorkbook } from './schema.js';
|
|
2
|
+
export declare const XLSX_MEDIA_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
3
|
+
/**
|
|
4
|
+
* A workbook as XLSX bytes: typed cells from rows, identical bytes for identical
|
|
5
|
+
* input on one runtime. Text is stored as text, so a cell that reads `=HYPERLINK("x")` is what it
|
|
6
|
+
* says and the file holds no formula at all. A value of the wrong type, or one
|
|
7
|
+
* Excel could not hold exactly, refuses with the cell's address instead of
|
|
8
|
+
* landing wrong. The whole workbook is built in memory.
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderXlsx(workbook: XlsxWorkbook): Promise<Uint8Array>;
|
|
11
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/xlsx/render.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,YAAY,EAAsB,MAAM,UAAU,CAAC;AAGlF,eAAO,MAAM,eAAe,sEACyC,CAAC;AAsJtE;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAoC5E"}
|