durable-actors-observer 0.18.5 → 0.18.7

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/README.md CHANGED
@@ -56,6 +56,10 @@ Residency uses lifecycle reports, including immediate notifications when the exe
56
56
 
57
57
  Custom observer clients can implement `listResidency` to enable the timeline. `HttpObserverClient` and the TypeScript and Python observer proxies use the authenticated project endpoint `/v1/projects/{project_id}/observe/residency?actorName=…`. `ResidencyTimeline` and its props and data types are also exported for embedding.
58
58
 
59
+ ## Events
60
+
61
+ An actor's page and each instance's page list its sandbox kills, newest first: sandboxes that stopped without the platform asking, which needs Kubernetes sandboxes. They are read from `/v1/projects/{project_id}/observe/events/history?types=kill`, which the TypeScript and Python observer proxies serve as `events/history`, and arrive live as `kill` events.
62
+
59
63
  ## Persisted actor state
60
64
 
61
65
  Select an actor instance in `ActorObserver` to inspect persisted fields, JSON types, nested values, and version diffs. Request and connection links filter the existing request history. The standard `HttpObserverClient` and `durable-actors observe` include this capability; custom clients implement `getState` and `listStateHistory` to enable it.
@@ -2,6 +2,7 @@ import type { LogFilter } from "../types/Logs.js";
2
2
  export declare const actorsKey: (baseUrl: string) => readonly ["actors", string];
3
3
  export declare const requestsKey: (baseUrl: string) => readonly ["requests", string];
4
4
  export declare const residencyKey: (baseUrl: string, actorName: string, actorId?: string) => readonly ["residency", string, string, string | undefined];
5
+ export declare const eventHistoryKey: (baseUrl: string, types: string[], actorName?: string, actorId?: string) => readonly ["events/history", string, string, string | undefined, string | undefined];
5
6
  export declare const webSocketsKey: (baseUrl: string) => readonly ["websockets", string];
6
7
  export declare const logsKey: (baseUrl: string, { actorName, actorId, requestId, level, search }: LogFilter) => readonly ["logs", string, string, string, string | null, import("../types/Logs.js").LogLevel | null, string];
7
8
  export declare const logHistogramKey: (baseUrl: string, { actorName, actorId, requestId, search }: LogFilter) => readonly ["logs/histogram", string, string, string, string | null, string];
@@ -1,4 +1,5 @@
1
1
  import type { ActorInventory } from "../types/Actors.js";
2
+ import type { EventHistory, RecordedEvent } from "../types/Events.js";
2
3
  import type { ActorLogPage, LogFilter, LogHistogram } from "../types/Logs.js";
3
4
  import type { RequestHistoryQuery, RequestTrace, RequestTracePage } from "../types/Requests.js";
4
5
  import type { ResidencyHistory } from "../types/Residency.js";
@@ -9,6 +10,7 @@ export interface ObserverClient {
9
10
  listActorTypes(): Promise<ActorInventory>;
10
11
  listRequests(query: RequestHistoryQuery): Promise<RequestTracePage>;
11
12
  listResidency(actorName: string, bounds: TimeBounds, actorId?: string): Promise<ResidencyHistory>;
13
+ listEventHistory(types: RecordedEvent["type"][], bounds: TimeBounds, actorName?: string, actorId?: string): Promise<EventHistory>;
12
14
  listWebSockets(): Promise<SocketSession[]>;
13
15
  listLogs(filter: LogFilter, bounds: TimeBounds, cursor: string | null): Promise<ActorLogPage>;
14
16
  getLogHistogram(filter: LogFilter, bounds: TimeBounds, bucketMs: number): Promise<LogHistogram>;
@@ -19,6 +21,7 @@ export declare class HttpObserverClient implements ObserverClient {
19
21
  listActorTypes(): Promise<ActorInventory>;
20
22
  listRequests({ fromMs, toMs, limit, cursor, actorName, actorId }: RequestHistoryQuery): Promise<RequestTracePage>;
21
23
  listResidency(actorName: string, { fromMs, toMs }: TimeBounds, actorId?: string): Promise<ResidencyHistory>;
24
+ listEventHistory(types: RecordedEvent["type"][], { fromMs, toMs }: TimeBounds, actorName?: string, actorId?: string): Promise<EventHistory>;
22
25
  listWebSockets(): Promise<SocketSession[]>;
23
26
  listLogs(filter: LogFilter, { fromMs, toMs }: TimeBounds, cursor: string | null): Promise<ActorLogPage>;
24
27
  getLogHistogram(filter: LogFilter, { fromMs, toMs }: TimeBounds, bucketMs: number): Promise<LogHistogram>;
@@ -0,0 +1,6 @@
1
+ import type { TimeWindow } from "../../types/TimeRange.js";
2
+ export type ActorTypeEventsCardProps = {
3
+ actorName: string;
4
+ timeWindow: TimeWindow;
5
+ };
6
+ export declare function ActorTypeEventsCard({ actorName, timeWindow }: ActorTypeEventsCardProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ActorKill } from "../../types/Kills.js";
2
+ export type EventListProps = {
3
+ events: ActorKill[];
4
+ noun: string;
5
+ /** Adds a column that names each event's instance, for a list that covers more than one. */
6
+ showInstance?: boolean;
7
+ expanded: boolean;
8
+ onToggle: () => void;
9
+ };
10
+ export declare function EventList({ events, noun, showInstance, expanded, onToggle }: EventListProps): import("react").JSX.Element;
11
+ export declare function EventRowSkeletons({ showInstance }: {
12
+ showInstance?: boolean;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { TimeWindow } from "../../types/TimeRange.js";
2
+ export type EventsCardProps = {
3
+ actorName: string;
4
+ actorId: string;
5
+ timeWindow: TimeWindow;
6
+ };
7
+ export declare function EventsCard({ actorName, actorId, timeWindow }: EventsCardProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
- import type { ActorLog } from "../../types/Logs.js";
1
+ import { type ReactNode } from "react";
2
+ import type { ActorLog, LogLevel } from "../../types/Logs.js";
2
3
  export type LogColumns = {
3
4
  level: boolean;
4
5
  request: boolean;
@@ -14,3 +15,8 @@ export type LogListProps = {
14
15
  columns: LogColumns;
15
16
  };
16
17
  export declare function LogList({ lines, failed, search, filtered, onFilterRequest, onClearFilters, onReachEnd, columns }: LogListProps): import("react").JSX.Element;
18
+ export declare function LevelBadge({ level, className, children }: {
19
+ level: LogLevel;
20
+ className?: string;
21
+ children: ReactNode;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { RecordedEvent } from "../types/Events.js";
2
+ import type { TimeWindow } from "../types/TimeRange.js";
3
+ /** The project's past events of these types, or only one class's or instance's when named. */
4
+ export declare function useEventHistory(types: RecordedEvent["type"][], timeWindow: TimeWindow, actorName?: string, actorId?: string): {
5
+ history: import("../types/Events.js").EventHistory | null;
6
+ isLoading: boolean;
7
+ isError: boolean;
8
+ error: any;
9
+ };