@caido/sdk-frontend 0.51.2-beta.6 → 0.51.2-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido/sdk-frontend",
3
- "version": "0.51.2-beta.6",
3
+ "version": "0.51.2-beta.7",
4
4
  "description": "Typing for the Caido Frontend SDK",
5
5
  "author": "Caido Labs Inc. <dev@caido.io>",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "src/*"
12
12
  ],
13
13
  "peerDependencies": {
14
+ "@ai-sdk/provider": "^2.0.0",
14
15
  "@codemirror/view": "^6.0.0",
15
16
  "@codemirror/state": "^6.0.0",
16
17
  "vue": "^3.0.0"
@@ -14,4 +14,5 @@ export type { Scope } from "./types/scopes";
14
14
  export type { EnvironmentVariable } from "./types/environment";
15
15
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
16
16
  export type { ListenerHandle } from "./types/utils";
17
+ export type { AIProvider } from "./types/ai";
17
18
  export type { API } from "./sdks";
@@ -0,0 +1,12 @@
1
+ import type { AIProvider } from "../types/ai";
2
+ /**
3
+ * Utilities to interact with AI.
4
+ * @category AI
5
+ */
6
+ export type AiSDK = {
7
+ /**
8
+ * Creates a new AI provider instance that can be used with the [ai](https://ai-sdk.dev/) library.
9
+ * @returns A provider instance compatible with the [ai](https://ai-sdk.dev/) library.
10
+ */
11
+ createProvider: () => AIProvider;
12
+ };
@@ -1,5 +1,6 @@
1
1
  import type { Sdk as GraphqlSDK } from "../__generated__/graphql-sdk";
2
2
  import { type BackendEndpoints, type BackendEvents } from "../types/backend";
3
+ import type { AiSDK } from "./ai";
3
4
  import type { AssetsSDK } from "./assets";
4
5
  import type { AutomateSDK } from "./automate";
5
6
  import type { BackendSDK } from "./backend";
@@ -43,6 +44,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
43
44
  * Utilities to create UI components.
44
45
  */
45
46
  ui: UISDK;
47
+ /**
48
+ * Utilities to interact with AI.
49
+ */
50
+ ai: AiSDK;
46
51
  /**
47
52
  * Utilities to interact with scopes
48
53
  */
@@ -0,0 +1,6 @@
1
+ import { type LanguageModelV2, type ProviderV2 } from "@ai-sdk/provider";
2
+ /**
3
+ * Official AI Provider to be used by the [ai](https://ai-sdk.dev/) library.
4
+ * @category AI
5
+ */
6
+ export type AIProvider = ProviderV2 & ((modelId: string) => LanguageModelV2);