@caido/sdk-frontend 0.54.2-beta.0 → 0.54.2-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido/sdk-frontend",
3
- "version": "0.54.2-beta.0",
3
+ "version": "0.54.2-beta.2",
4
4
  "description": "Typing for the Caido Frontend SDK",
5
5
  "author": "Caido Labs Inc. <dev@caido.io>",
6
6
  "repository": "https://github.com/caido/sdk-js/",
@@ -2,7 +2,7 @@ export { FooterSlot, type FooterSlotContent } from "./types/footer";
2
2
  export type { DialogOptions } from "./types/window";
3
3
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
4
4
  export type { MenuItem } from "./types/menu";
5
- export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
5
+ export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, type AddSessionIndicatorOptions, type SessionIndicator, } from "./types/replay";
6
6
  export { SearchSlot, type SearchSlotContent } from "./types/search";
7
7
  export type { HostedFile } from "./types/files";
8
8
  export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
@@ -17,7 +17,7 @@ export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHisto
17
17
  export type { EnvironmentVariable } from "./types/environment";
18
18
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
19
19
  export type { ListenerHandle } from "./types/utils";
20
- export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, } from "./types/ai";
20
+ export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
21
21
  export type { SelectedProjectChangeEvent } from "./types/projects";
22
22
  export type { CommandPaletteView } from "./sdks/commandPalette";
23
23
  export type { LogSDK } from "./sdks/log";
@@ -1,4 +1,4 @@
1
- import type { AIProvider } from "../types/ai";
1
+ import type { AIProvider, AIUpstreamProvider } from "../types/ai";
2
2
  /**
3
3
  * Utilities to interact with AI.
4
4
  * @category AI
@@ -9,4 +9,9 @@ export type AiSDK = {
9
9
  * @returns A provider instance compatible with the [ai](https://ai-sdk.dev/) library.
10
10
  */
11
11
  createProvider: () => AIProvider;
12
+ /**
13
+ * Gets the list of upstream AI providers with their configuration status.
14
+ * @returns An array of AI upstream providers with their configuration status.
15
+ */
16
+ getUpstreamProviders: () => AIUpstreamProvider[];
12
17
  };
@@ -1,5 +1,5 @@
1
1
  import { type Extension } from "@codemirror/state";
2
- import { type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
2
+ import { type AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions, type SessionIndicator } from "../types/replay";
3
3
  import type { RequestViewModeOptions } from "../types/request";
4
4
  import { type DefineAddToSlotFn } from "../types/slots";
5
5
  import type { ID, ListenerHandle } from "../types/utils";
@@ -224,4 +224,22 @@ export type ReplaySDK = {
224
224
  * ```
225
225
  */
226
226
  onCollectionCreate: (callback: (event: ReplayCollectionCreatedEvent) => void) => ListenerHandle;
227
+ /**
228
+ * Add an indicator to a replay session.
229
+ * Indicators are displayed next to the session name in the collections tree.
230
+ * @param sessionId The ID of the session to add the indicator to.
231
+ * @param indicator The indicator configuration.
232
+ * @returns A handle object with a `remove` method to remove the indicator.
233
+ * @example
234
+ *
235
+ * const indicator = sdk.replay.addSessionIndicator(sessionId, {
236
+ * icon: "fas fa-exclamation-triangle",
237
+ * description: "Security warning",
238
+ * });
239
+ *
240
+ * // Later, remove the indicator
241
+ * indicator.remove();
242
+ *
243
+ */
244
+ addSessionIndicator: (sessionId: ID, indicator: AddSessionIndicatorOptions) => SessionIndicator;
227
245
  };
@@ -22,3 +22,23 @@ export type AILanguageModelSettings = {
22
22
  * @category AI
23
23
  */
24
24
  export type AIProvider = ProviderV2 & ((modelId: string, settings?: AILanguageModelSettings) => LanguageModelV2);
25
+ /**
26
+ * AI upstream provider ID.
27
+ * @category AI
28
+ */
29
+ export type AIUpstreamProviderId = "anthropic" | "google" | "openai" | "openrouter";
30
+ /**
31
+ * AI upstream provider information.
32
+ * @category AI
33
+ */
34
+ export type AIUpstreamProvider = {
35
+ id: AIUpstreamProviderId;
36
+ status: AIUpstreamProviderStatus;
37
+ };
38
+ /**
39
+ * AI upstream provider status.
40
+ * Ready: The upstream provider is ready to use.
41
+ * Missing: The upstream provider is not configured.
42
+ * @category AI
43
+ */
44
+ export type AIUpstreamProviderStatus = "Ready" | "Missing";
@@ -218,3 +218,19 @@ export type ReplayCollectionCreatedEvent = {
218
218
  */
219
219
  collection: ReplayCollection;
220
220
  };
221
+ /**
222
+ * Visual indicator displayed next to a session label in the replay tree component.
223
+ * Includes an icon and an associated description.
224
+ * @category Replay
225
+ */
226
+ export type AddSessionIndicatorOptions = {
227
+ icon: string;
228
+ description: string;
229
+ };
230
+ /**
231
+ * Providing operations that can be performed on a session indicator.
232
+ * @category Replay
233
+ */
234
+ export type SessionIndicator = {
235
+ remove: () => void;
236
+ };