@copilotkit/learning 2.0.0-rc.2 → 2.0.0-rc.20
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/index.cjs +2 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/collector.test.ts +0 -1
- package/src/__tests__/navigation.test.ts +0 -1
- package/src/__tests__/network.test.ts +0 -1
- package/src/__tests__/trajectory-collector.test.ts +1 -2
- package/src/collector.ts +3 -4
- package/src/navigation.ts +0 -1
- package/src/network.ts +0 -1
- package/src/trajectory-types.ts +0 -2
- package/src/types.ts +0 -2
package/package.json
CHANGED
|
@@ -39,7 +39,6 @@ function setup(fakeFetch: typeof fetch, ignoreUrls: (string | RegExp)[] = []) {
|
|
|
39
39
|
const events: Captured[] = [];
|
|
40
40
|
uninstall = installNetworkCapture({
|
|
41
41
|
emit: (name, value) => events.push({ name, value } as Captured),
|
|
42
|
-
routes: ["/api/deals/:id"],
|
|
43
42
|
ignoreUrls,
|
|
44
43
|
});
|
|
45
44
|
return events;
|
|
@@ -40,7 +40,6 @@ function setup(options: TrajectoryCaptureOptions = {}) {
|
|
|
40
40
|
const send = vi.fn<(event: TrajectoryEvent) => void>();
|
|
41
41
|
const onError = vi.fn();
|
|
42
42
|
const collector = createTrajectoryCollector({
|
|
43
|
-
routes: ["/deals", "/deals/:id"],
|
|
44
43
|
send,
|
|
45
44
|
onError,
|
|
46
45
|
...options,
|
|
@@ -122,7 +121,7 @@ describe("Trajectory capture contract", () => {
|
|
|
122
121
|
});
|
|
123
122
|
|
|
124
123
|
it("retains unconfigured paths and user edits without Thread enrichment", () => {
|
|
125
|
-
const { collector, send } = setup(
|
|
124
|
+
const { collector, send } = setup();
|
|
126
125
|
collector.start();
|
|
127
126
|
history.pushState(
|
|
128
127
|
null,
|
package/src/collector.ts
CHANGED
|
@@ -40,7 +40,7 @@ interface Session {
|
|
|
40
40
|
* collector.start({ trajectoryId: crypto.randomUUID() });
|
|
41
41
|
*/
|
|
42
42
|
export function createCollector(options: CollectorOptions) {
|
|
43
|
-
const { sink,
|
|
43
|
+
const { sink, beforeSend, enrich } = options;
|
|
44
44
|
const capture = {
|
|
45
45
|
clicks: true,
|
|
46
46
|
navigation: true,
|
|
@@ -51,7 +51,7 @@ export function createCollector(options: CollectorOptions) {
|
|
|
51
51
|
let session: Session | null = null;
|
|
52
52
|
let seq = 0;
|
|
53
53
|
|
|
54
|
-
const getRoute = () => toRoute(location.pathname
|
|
54
|
+
const getRoute = () => toRoute(location.pathname);
|
|
55
55
|
|
|
56
56
|
const flush = (sendOptions?: SinkSendOptions) => {
|
|
57
57
|
const current = session;
|
|
@@ -138,13 +138,12 @@ export function createCollector(options: CollectorOptions) {
|
|
|
138
138
|
);
|
|
139
139
|
if (capture.navigation)
|
|
140
140
|
current.uninstalls.push(
|
|
141
|
-
installNavigationCapture({ emit: recordCurrent,
|
|
141
|
+
installNavigationCapture({ emit: recordCurrent, redact }),
|
|
142
142
|
);
|
|
143
143
|
if (capture.network)
|
|
144
144
|
current.uninstalls.push(
|
|
145
145
|
installNetworkCapture({
|
|
146
146
|
emit: recordCurrent,
|
|
147
|
-
routes,
|
|
148
147
|
ignoreUrls,
|
|
149
148
|
redact,
|
|
150
149
|
}),
|
package/src/navigation.ts
CHANGED
package/src/network.ts
CHANGED
|
@@ -54,7 +54,6 @@ function isAbortError(error: unknown) {
|
|
|
54
54
|
/** Records browser-visible request/response data without consuming the app's bodies. */
|
|
55
55
|
export function installNetworkCapture(params: {
|
|
56
56
|
emit: Emit;
|
|
57
|
-
routes?: string[];
|
|
58
57
|
ignoreUrls: (string | RegExp)[];
|
|
59
58
|
redact?: Redactor;
|
|
60
59
|
}) {
|
package/src/trajectory-types.ts
CHANGED
|
@@ -32,8 +32,6 @@ export interface TrajectoryError {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export interface TrajectoryCaptureOptions {
|
|
35
|
-
/** @deprecated Capture retains raw URLs; route templates no longer transform events. */
|
|
36
|
-
routes?: string[];
|
|
37
35
|
capture?: CaptureOptions;
|
|
38
36
|
/** Explicit app exclusions, plus Core transport URLs to prevent self-capture. */
|
|
39
37
|
ignoreUrls?: (string | RegExp)[];
|
package/src/types.ts
CHANGED
|
@@ -77,8 +77,6 @@ export interface CaptureOptions {
|
|
|
77
77
|
|
|
78
78
|
export interface CollectorOptions {
|
|
79
79
|
sink: LearningSink;
|
|
80
|
-
/** @deprecated Capture retains raw URLs; route templates no longer transform events. */
|
|
81
|
-
routes?: string[];
|
|
82
80
|
/** URLs (prefix match on the absolute URL) or patterns that network capture skips. */
|
|
83
81
|
ignoreUrls?: (string | RegExp)[];
|
|
84
82
|
/** Turns capture modules on or off. All are on by default. */
|