@copilotkit/web-inspector 1.66.2 → 1.66.4

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/package.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region package.json
3
- var version = "1.66.2";
3
+ var version = "1.66.4";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'version', {
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.66.2";
2
+ var version = "1.66.4";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/web-inspector",
3
- "version": "1.66.2",
3
+ "version": "1.66.4",
4
4
  "description": "Lit-based web component for the CopilotKit web inspector",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "lit": "^3.2.0",
28
28
  "lucide": "^0.525.0",
29
29
  "marked": "^12.0.2",
30
- "@copilotkit/core": "1.66.2"
30
+ "@copilotkit/core": "1.66.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@tailwindcss/cli": "^4.1.11",
@@ -328,6 +328,30 @@ describe("WebInspectorElement", () => {
328
328
  );
329
329
  });
330
330
 
331
+ it("records step lifecycle events", async () => {
332
+ const { agent, controller } = createMockAgent("alpha");
333
+ const { core, emitAgentsChanged } = createMockCore({ alpha: agent });
334
+ const inspector = createInspectorWithCore(core);
335
+
336
+ emitAgentsChanged();
337
+ await inspector.updateComplete;
338
+
339
+ controller.emit("onStepStartedEvent", {
340
+ event: { stepName: "test-step" },
341
+ });
342
+ controller.emit("onStepFinishedEvent", {
343
+ event: { stepName: "test-step" },
344
+ });
345
+ await inspector.updateComplete;
346
+
347
+ const internals = getInternals(inspector);
348
+
349
+ expect(internals.flattenedEvents.map((event) => event.type)).toEqual([
350
+ "STEP_FINISHED",
351
+ "STEP_STARTED",
352
+ ]);
353
+ });
354
+
331
355
  it("normalizes context, persists state, and copies context values", async () => {
332
356
  const { core, emitContextChanged } = createMockCore();
333
357
  const inspector = createInspectorWithCore(core);
package/src/index.ts CHANGED
@@ -159,6 +159,8 @@ type InspectorAgentEventType =
159
159
  | "RUN_STARTED"
160
160
  | "RUN_FINISHED"
161
161
  | "RUN_ERROR"
162
+ | "STEP_STARTED"
163
+ | "STEP_FINISHED"
162
164
  | "TEXT_MESSAGE_START"
163
165
  | "TEXT_MESSAGE_CONTENT"
164
166
  | "TEXT_MESSAGE_END"
@@ -184,6 +186,8 @@ const AGENT_EVENT_TYPES: readonly InspectorAgentEventType[] = [
184
186
  "RUN_STARTED",
185
187
  "RUN_FINISHED",
186
188
  "RUN_ERROR",
189
+ "STEP_STARTED",
190
+ "STEP_FINISHED",
187
191
  "TEXT_MESSAGE_START",
188
192
  "TEXT_MESSAGE_CONTENT",
189
193
  "TEXT_MESSAGE_END",
@@ -5320,6 +5324,12 @@ export class WebInspectorElement extends LitElement {
5320
5324
  onRunErrorEvent: ({ event }) => {
5321
5325
  this.recordAgentEvent(agentId, "RUN_ERROR", event);
5322
5326
  },
5327
+ onStepStartedEvent: ({ event }) => {
5328
+ this.recordAgentEvent(agentId, "STEP_STARTED", event);
5329
+ },
5330
+ onStepFinishedEvent: ({ event }) => {
5331
+ this.recordAgentEvent(agentId, "STEP_FINISHED", event);
5332
+ },
5323
5333
  onTextMessageStartEvent: ({ event }) => {
5324
5334
  this.recordAgentEvent(agentId, "TEXT_MESSAGE_START", event);
5325
5335
  },