@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/learning",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.20",
4
4
  "description": "Capture clicks, page changes, and network metadata in the browser as AG-UI CUSTOM events",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,7 +45,6 @@ function setup(overrides: Partial<CollectorOptions> = {}) {
45
45
  };
46
46
  const collector = createCollector({
47
47
  sink,
48
- routes: ["/learning/deals/:id"],
49
48
  ...overrides,
50
49
  });
51
50
  stopCurrent = () => collector.stop();
@@ -24,7 +24,6 @@ function setup() {
24
24
  const events: Captured[] = [];
25
25
  uninstall = installNavigationCapture({
26
26
  emit: (name, value) => events.push({ name, value }),
27
- routes: ["/learning/deals/:id"],
28
27
  });
29
28
  return events;
30
29
  }
@@ -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({ routes: [] });
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, routes, beforeSend, enrich } = options;
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, routes);
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, routes, redact }),
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
@@ -50,7 +50,6 @@ function toNavigationType(value: unknown): NavigationType {
50
50
  */
51
51
  export function installNavigationCapture(params: {
52
52
  emit: Emit;
53
- routes?: string[];
54
53
  redact?: Redactor;
55
54
  }) {
56
55
  const { emit, redact = createRedactor() } = params;
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
  }) {
@@ -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. */