stitchkit 0.112.1 → 0.112.2
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 +6 -0
- package/dist/entrypoints/tracking.js +12 -6
- package/dist/tracking/clicks.d.ts +3 -1
- package/dist/tracking/clicks.d.ts.map +1 -1
- package/dist/tracking/client-listeners.d.ts +1 -0
- package/dist/tracking/client-listeners.d.ts.map +1 -1
- package/dist/tracking/client.d.ts +3 -1
- package/dist/tracking/client.d.ts.map +1 -1
- package/llms/tracking.txt +20 -2
- package/llms-full.txt +20 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,12 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.112.2] - 2026-10-25
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `stitchkit/tracking` — `resolveTrackedClick` and `createTrackingClient` accept `hrefPolicy: 'full'` to retain internal and outbound click query parameters and fragments before consumer `decorate` redaction. The default `path-only` policy, navigation classification, labels and listener cleanup stay unchanged; URL credentials remain excluded.
|
|
23
|
+
|
|
18
24
|
## [0.112.1] - 2026-10-25
|
|
19
25
|
|
|
20
26
|
### Fixed
|
|
@@ -204,17 +204,18 @@ function sendUnloadBeacon(url, body, sender = typeof navigator === "undefined" ?
|
|
|
204
204
|
function label(target) {
|
|
205
205
|
return (target?.textContent ?? "").trim().slice(0, 100) || undefined;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function trackedHref(value, origin, policy) {
|
|
208
208
|
if (!value)
|
|
209
209
|
return;
|
|
210
210
|
try {
|
|
211
211
|
const url = new URL(value, origin);
|
|
212
|
-
|
|
212
|
+
const path = `${url.pathname}${policy === "full" ? url.search + url.hash : ""}`;
|
|
213
|
+
return url.origin === origin ? path : `${url.origin}${path}`;
|
|
213
214
|
} catch {
|
|
214
215
|
return;
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
|
-
function resolveTrackedClick(target, { origin, attributes = {}, isAction = () => true }) {
|
|
218
|
+
function resolveTrackedClick(target, { origin, attributes = {}, isAction = () => true, hrefPolicy }) {
|
|
218
219
|
if (!target)
|
|
219
220
|
return null;
|
|
220
221
|
const trackAttribute = attributes.track ?? "data-track";
|
|
@@ -247,12 +248,15 @@ function resolveTrackedClick(target, { origin, attributes = {}, isAction = () =>
|
|
|
247
248
|
result.click = {
|
|
248
249
|
element,
|
|
249
250
|
elementText: label(tracked),
|
|
250
|
-
href:
|
|
251
|
+
href: trackedHref(href, origin, hrefPolicy)
|
|
251
252
|
};
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
255
|
if (outbound && href) {
|
|
255
|
-
result.outbound = {
|
|
256
|
+
result.outbound = {
|
|
257
|
+
href: trackedHref(href, origin, hrefPolicy) ?? href,
|
|
258
|
+
label: label(anchor)
|
|
259
|
+
};
|
|
256
260
|
}
|
|
257
261
|
return result.interaction || result.click || result.outbound ? result : null;
|
|
258
262
|
}
|
|
@@ -299,7 +303,8 @@ function wireTrackingListeners(deps) {
|
|
|
299
303
|
const click = resolveTrackedClick(target, {
|
|
300
304
|
origin: host.page().origin,
|
|
301
305
|
attributes: deps.clickAttributes,
|
|
302
|
-
isAction: deps.isAction
|
|
306
|
+
isAction: deps.isAction,
|
|
307
|
+
hrefPolicy: deps.hrefPolicy
|
|
303
308
|
});
|
|
304
309
|
if (!click)
|
|
305
310
|
return;
|
|
@@ -789,6 +794,7 @@ function createTrackingClient(config) {
|
|
|
789
794
|
});
|
|
790
795
|
},
|
|
791
796
|
clickAttributes: config.clickAttributes,
|
|
797
|
+
hrefPolicy: config.hrefPolicy,
|
|
792
798
|
isAction: config.isAction
|
|
793
799
|
});
|
|
794
800
|
return () => {
|
|
@@ -24,6 +24,8 @@ export interface ResolveTrackedClickOptions {
|
|
|
24
24
|
attributes?: TrackedClickAttributes;
|
|
25
25
|
/** Whether an action name is one the application knows. Default: any. */
|
|
26
26
|
isAction?: (action: string) => boolean;
|
|
27
|
+
/** Click URLs omit query/fragment by default. `full` retains both for consumer redaction. */
|
|
28
|
+
hrefPolicy?: 'path-only' | 'full';
|
|
27
29
|
}
|
|
28
30
|
export interface TrackedClick {
|
|
29
31
|
interaction?: {
|
|
@@ -42,5 +44,5 @@ export interface TrackedClick {
|
|
|
42
44
|
/** The click navigates away — send its facts on the unload path. */
|
|
43
45
|
leavesPage: boolean;
|
|
44
46
|
}
|
|
45
|
-
export declare function resolveTrackedClick(target: ClickTarget | null, { origin, attributes, isAction }: ResolveTrackedClickOptions): TrackedClick | null;
|
|
47
|
+
export declare function resolveTrackedClick(target: ClickTarget | null, { origin, attributes, isAction, hrefPolicy }: ResolveTrackedClickOptions): TrackedClick | null;
|
|
46
48
|
//# sourceMappingURL=clicks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clicks.d.ts","sourceRoot":"","sources":["../../src/tracking/clicks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CA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AC;CACrB;AAqBD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,EAAE,MAAM,EAAE,UAAe,EAAE,QAAqB,EAAE,UAAU,EAAE,EAAE,0BAA0B,GACzF,YAAY,GAAG,IAAI,CA6CrB"}
|
|
@@ -25,6 +25,7 @@ export interface TrackingListenerDeps<TType extends string> {
|
|
|
25
25
|
releaseLease(): void;
|
|
26
26
|
readonly clickAttributes: Parameters<typeof resolveTrackedClick>[1]['attributes'];
|
|
27
27
|
readonly isAction: Parameters<typeof resolveTrackedClick>[1]['isAction'];
|
|
28
|
+
readonly hrefPolicy: Parameters<typeof resolveTrackedClick>[1]['hrefPolicy'];
|
|
28
29
|
}
|
|
29
30
|
export declare function wireTrackingListeners<TType extends string>(deps: TrackingListenerDeps<TType>): Array<() => void>;
|
|
30
31
|
//# sourceMappingURL=client-listeners.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-listeners.d.ts","sourceRoot":"","sources":["../../src/tracking/client-listeners.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,MAAM;IACxD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC,KAAK,CAAC,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC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CAAC,YAAY,CAAC,CAAC;CAC9E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,EACxD,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAChC,KAAK,CAAC,MAAM,IAAI,CAAC,CAuEnB"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* session. → ADR 0166.
|
|
13
13
|
*/
|
|
14
14
|
import type { ReferrerRule, ResolvedAttribution } from './attribution.js';
|
|
15
|
-
import type { TrackedClickAttributes } from './clicks.js';
|
|
15
|
+
import type { ResolveTrackedClickOptions, TrackedClickAttributes } from './clicks.js';
|
|
16
16
|
import type { TrackingHost } from './host.js';
|
|
17
17
|
import type { TrackingOutbox } from './outbox.js';
|
|
18
18
|
import type { TrackEventsRequest, TrackEventsResponse, TrackingEventEnvelope, VisitBootstrapResponse, VisitEntryContext } from './schemas.js';
|
|
@@ -88,6 +88,8 @@ export interface TrackingClientConfig<TMetadata extends object, TEvent extends T
|
|
|
88
88
|
isAction?: (action: string) => boolean;
|
|
89
89
|
referrerMap?: readonly ReferrerRule[];
|
|
90
90
|
clickAttributes?: TrackedClickAttributes;
|
|
91
|
+
/** Click URL retention before `decorate`. Default `path-only`; `full` includes query/fragment. */
|
|
92
|
+
hrefPolicy?: ResolveTrackedClickOptions['hrefPolicy'];
|
|
91
93
|
scrollMilestones?: readonly number[];
|
|
92
94
|
/** Heartbeat and flush period. Default 30 s. */
|
|
93
95
|
heartbeatMs?: number;
|
|
@@ -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,sBAAsB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/tracking/client.ts"],"names":[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AAM,MAAM,KAAK,CAAC,KAAK,SAAS,MAAM,IAAI,IAAI,CAC5C,qBAAqB,CAAC,KAAK,CAAC,EAC5B,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,CAC9D,CAAC;AA0CF,wBAAgB,oBAAoB,CAClC,SAAS,SAAS,MAAM,EACxB,MAAM,SAAS,qBAAqB,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,qBAAqB,CACpF,MAAM,SAAS,GAAG,MAAM,CACzB,EACD,MAAM,EAAE,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAiM5E"}
|
package/llms/tracking.txt
CHANGED
|
@@ -100,6 +100,24 @@ createTrackingClient<BrowserEvents, TrackingEventEnvelope<keyof BrowserEvents> &
|
|
|
100
100
|
})
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
### Click URL retention
|
|
104
|
+
|
|
105
|
+
`resolveTrackedClick(target, { origin, hrefPolicy: 'full' })` and
|
|
106
|
+
`createTrackingClient({ …, hrefPolicy: 'full' })` retain the clicked URL's pathname,
|
|
107
|
+
query and fragment. Internal URLs are relative (`/item?offer=one#details`);
|
|
108
|
+
outbound URLs include their origin (`https://other.example/item?offer=one#details`).
|
|
109
|
+
URL credentials are excluded. Omitting the option, or selecting `path-only`,
|
|
110
|
+
keeps the default that omits query and fragment. Navigation classification,
|
|
111
|
+
labels and subscriptions are independent of this policy.
|
|
112
|
+
|
|
113
|
+
Full URLs may contain sensitive values. Supply your application's password and
|
|
114
|
+
secret redactor through `decorate` before enabling `full`: it receives the retained
|
|
115
|
+
`event.metadata.href` and must return the redacted metadata. The returned event is
|
|
116
|
+
what the outbox, synchronous unload and normal delivery receive. The framework
|
|
117
|
+
has no application-specific password policy. This option controls click and
|
|
118
|
+
outbound-click metadata; it does not change attribution, page tracking or interaction
|
|
119
|
+
metadata. Use the same redactor on your other ingestion paths.
|
|
120
|
+
|
|
103
121
|
A `bootstrap` operation that needs extra fields of its own (a locale, a RUM
|
|
104
122
|
flag) is not the factory's: build the `entry` schema with
|
|
105
123
|
`createTrackingSchemas(…).entry.extend({ … })` and declare that endpoint yourself.
|
|
@@ -234,7 +252,7 @@ application's — it owns the router and the session. The server half is
|
|
|
234
252
|
| Export | Kind | Summary |
|
|
235
253
|
|--------|------|---------|
|
|
236
254
|
| `createTrackingClient` | function | the client: visit lease and renewal, pending queue, synchronous identity from reserved sequences, outbox and flush lease, delivery, the string-body page-leave beacon plus a queued copy, visible time, scroll milestones, declarative clicks, heartbeats |
|
|
237
|
-
| `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `scrollMilestones`, `batchSize`, periods and limits |
|
|
255
|
+
| `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `hrefPolicy` (`path-only` by default; `full` retains click query/fragment before `decorate`), `scrollMilestones`, `batchSize`, periods and limits |
|
|
238
256
|
| `TrackFn` / `EventsWithMetadata` / `EventsWithoutMetadata` | _type_ | `track(type)` / `track(type, metadata)` typed by the application's metadata map, and the two halves of that map |
|
|
239
257
|
| `BuiltinTrackingEventTypes` / `CONVENTIONAL_TRACKING_EVENT_TYPES` | _type_ / const | the application's names for the events the client emits itself; the conventional `PAGE_VIEW` … `INTERACTION` set |
|
|
240
258
|
| `browserTrackingHost` / `TrackingHost` / `TrackingPageContext` | function / _type_ | everything the client takes from a browser tab behind one interface — page context, visibility, scroll depth, events, intervals, clocks, storage — so a test or a non-tab host can supply its own |
|
|
@@ -258,6 +276,6 @@ application's — it owns the router and the session. The server half is
|
|
|
258
276
|
| `createOncePerPage` / `OncePerPage` | function / _type_ | one fact per key per page within a window — the guard a twice-mounted component cannot keep itself |
|
|
259
277
|
| `resolveAttribution` / `ResolveAttributionInput` / `ResolvedAttribution` / `AttributionStorage` / `ReferrerRule` | function / _type_ | first-touch once, current-touch on every new UTM; the referrer → source/medium map is the application's, there is no built-in list |
|
|
260
278
|
| `parseUtmFromSearch` / `parseReferrer` | function | the two parsers `resolveAttribution` is built from |
|
|
261
|
-
| `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `leavesPage` says which path to send on |
|
|
279
|
+
| `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `hrefPolicy: 'full'` retains query/fragment (default `path-only` omits them), URL credentials excluded; `leavesPage` says which path to send on |
|
|
262
280
|
|
|
263
281
|
---
|
package/llms-full.txt
CHANGED
|
@@ -511,6 +511,24 @@ createTrackingClient<BrowserEvents, TrackingEventEnvelope<keyof BrowserEvents> &
|
|
|
511
511
|
})
|
|
512
512
|
```
|
|
513
513
|
|
|
514
|
+
### Click URL retention
|
|
515
|
+
|
|
516
|
+
`resolveTrackedClick(target, { origin, hrefPolicy: 'full' })` and
|
|
517
|
+
`createTrackingClient({ …, hrefPolicy: 'full' })` retain the clicked URL's pathname,
|
|
518
|
+
query and fragment. Internal URLs are relative (`/item?offer=one#details`);
|
|
519
|
+
outbound URLs include their origin (`https://other.example/item?offer=one#details`).
|
|
520
|
+
URL credentials are excluded. Omitting the option, or selecting `path-only`,
|
|
521
|
+
keeps the default that omits query and fragment. Navigation classification,
|
|
522
|
+
labels and subscriptions are independent of this policy.
|
|
523
|
+
|
|
524
|
+
Full URLs may contain sensitive values. Supply your application's password and
|
|
525
|
+
secret redactor through `decorate` before enabling `full`: it receives the retained
|
|
526
|
+
`event.metadata.href` and must return the redacted metadata. The returned event is
|
|
527
|
+
what the outbox, synchronous unload and normal delivery receive. The framework
|
|
528
|
+
has no application-specific password policy. This option controls click and
|
|
529
|
+
outbound-click metadata; it does not change attribution, page tracking or interaction
|
|
530
|
+
metadata. Use the same redactor on your other ingestion paths.
|
|
531
|
+
|
|
514
532
|
A `bootstrap` operation that needs extra fields of its own (a locale, a RUM
|
|
515
533
|
flag) is not the factory's: build the `entry` schema with
|
|
516
534
|
`createTrackingSchemas(…).entry.extend({ … })` and declare that endpoint yourself.
|
|
@@ -23280,7 +23298,7 @@ application's — it owns the router and the session. The server half is
|
|
|
23280
23298
|
| Export | Kind | Summary |
|
|
23281
23299
|
|--------|------|---------|
|
|
23282
23300
|
| `createTrackingClient` | function | the client: visit lease and renewal, pending queue, synchronous identity from reserved sequences, outbox and flush lease, delivery, the string-body page-leave beacon plus a queued copy, visible time, scroll milestones, declarative clicks, heartbeats |
|
|
23283
|
-
| `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `scrollMilestones`, `batchSize`, periods and limits |
|
|
23301
|
+
| `TrackingClient` / `TrackingClientConfig` | _type_ | `track` / `onNavigate` / `start` / `visitId` / `browserStreamId` / `attribution`, and the host, `buildId`, `builtin` names, `bootstrap`, `deliver`, optional `decorate` (your `eventExtras` on every minted event), `unload` / `unloadUrl`, `outbox`, `onUnauthorized`, `onVisit`, `onFailure`, `isAction`, `referrerMap`, `clickAttributes`, `hrefPolicy` (`path-only` by default; `full` retains click query/fragment before `decorate`), `scrollMilestones`, `batchSize`, periods and limits |
|
|
23284
23302
|
| `TrackFn` / `EventsWithMetadata` / `EventsWithoutMetadata` | _type_ | `track(type)` / `track(type, metadata)` typed by the application's metadata map, and the two halves of that map |
|
|
23285
23303
|
| `BuiltinTrackingEventTypes` / `CONVENTIONAL_TRACKING_EVENT_TYPES` | _type_ / const | the application's names for the events the client emits itself; the conventional `PAGE_VIEW` … `INTERACTION` set |
|
|
23286
23304
|
| `browserTrackingHost` / `TrackingHost` / `TrackingPageContext` | function / _type_ | everything the client takes from a browser tab behind one interface — page context, visibility, scroll depth, events, intervals, clocks, storage — so a test or a non-tab host can supply its own |
|
|
@@ -23304,7 +23322,7 @@ application's — it owns the router and the session. The server half is
|
|
|
23304
23322
|
| `createOncePerPage` / `OncePerPage` | function / _type_ | one fact per key per page within a window — the guard a twice-mounted component cannot keep itself |
|
|
23305
23323
|
| `resolveAttribution` / `ResolveAttributionInput` / `ResolvedAttribution` / `AttributionStorage` / `ReferrerRule` | function / _type_ | first-touch once, current-touch on every new UTM; the referrer → source/medium map is the application's, there is no built-in list |
|
|
23306
23324
|
| `parseUtmFromSearch` / `parseReferrer` | function | the two parsers `resolveAttribution` is built from |
|
|
23307
|
-
| `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `leavesPage` says which path to send on |
|
|
23325
|
+
| `resolveTrackedClick` / `ResolveTrackedClickOptions` / `TrackedClick` / `TrackedClickAttributes` / `ClickTarget` | function / _type_ | `data-track` → click, `data-track-action` → interaction, a link to another origin → outbound; attribute names configurable; `hrefPolicy: 'full'` retains query/fragment (default `path-only` omits them), URL credentials excluded; `leavesPage` says which path to send on |
|
|
23308
23326
|
|
|
23309
23327
|
---
|
|
23310
23328
|
|
package/llms.txt
CHANGED
|
@@ -45,7 +45,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
45
45
|
- **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 36.6 KB
|
|
46
46
|
- **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
|
|
47
47
|
- **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
|
|
48
|
-
- **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt)
|
|
48
|
+
- **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 18.1 KB
|
|
49
49
|
- **stitchkit/release**: [llms/release.txt](llms/release.txt) 8.9 KB
|
|
50
50
|
- **stitchkit/tracking/server**: [llms/tracking-server.txt](llms/tracking-server.txt) 2.5 KB
|
|
51
51
|
- **stitchkit/geo**: [llms/geo.txt](llms/geo.txt) 4.1 KB
|
package/package.json
CHANGED