@supernova-studio/supernova-sdk-beta 2.2.0 → 2.2.1

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.
@@ -1,5 +1,12 @@
1
1
  import { DataCore } from "../data/SDKDataCore";
2
2
  import { RemoteWorkspaceVersionIdentifier } from "./SDKRemoteIdentifiers";
3
+ export declare enum AIGetRouteQueryTask {
4
+ answer = "answer",
5
+ answerWithStream = "answerWithStream",
6
+ autocomplete = "autocomplete",
7
+ reindex = "reindex",
8
+ summarize = "summarize"
9
+ }
3
10
  export declare class AreaAI {
4
11
  /** Internal: Engine */
5
12
  private dataCore;
@@ -17,14 +24,19 @@ export declare class AreaAI {
17
24
  }): Promise<string>;
18
25
  /** Autocompletes a prompt into a full text. Response is not streamed.
19
26
  * @param from - Version identifier
20
- * @param text - Text to autocomplete
27
+ * @param textToComplete - Text to autocomplete
21
28
  * @param options - Autocomplete options
22
29
  * @returns Autocompleted text
23
30
  * @disclaimer This method will throw if the user is not authorized to use AI features (if you are reading this, you are not authorized).
24
31
  */
25
- autocompleteText(from: RemoteWorkspaceVersionIdentifier, text: string, options?: {
32
+ autocompleteText(from: RemoteWorkspaceVersionIdentifier, textToComplete: string, options?: {
26
33
  maximumLength: number;
27
- }): Promise<string>;
34
+ previousText?: string;
35
+ afterText?: string;
36
+ }): Promise<{
37
+ completion: string;
38
+ fullText: string;
39
+ }>;
28
40
  /** Answers question based on the data of design system in natural language. This method is non-streaming.
29
41
  * @param from - Version identifier
30
42
  * @param prompt - Question to answer
@@ -48,11 +60,16 @@ export declare class AreaAI {
48
60
  persona: "designer" | "developer";
49
61
  scope: "all" | "tokens" | "components" | "assets" | "docs";
50
62
  density: "compact" | "full";
51
- }): Promise<ReadableStream<Uint8Array>>;
63
+ }): Promise<ReadableStreamDefaultReader<Uint8Array>>;
52
64
  /** Indexes or reindexes a design system to prepare it for QA engine
53
65
  * @param from - Version identifier
54
66
  * @returns Indexing status
55
67
  * @disclaimer This method will throw if the user is not authorized to use AI features (if you are reading this, you are not authorized).
56
68
  */
57
- rebuildAnswerIndex(from: RemoteWorkspaceVersionIdentifier): Promise<string>;
69
+ rebuildAnswerIndex(from: RemoteWorkspaceVersionIdentifier): Promise<void>;
70
+ /** Temp: Retrieves dynamic URL for all AI tasks
71
+ * @param task - Which task to retrieve URL for
72
+ * @returns Url for the task
73
+ */
74
+ executableTaskUrl(task: AIGetRouteQueryTask): Promise<string>;
58
75
  }
@@ -43,15 +43,20 @@ export declare class DataBridge {
43
43
  constructor(conf: DataBridgeConfiguration);
44
44
  delete(endpoint: string): Promise<any>;
45
45
  get(endpoint: string): Promise<any>;
46
+ getStreamed(endpoint: string): Promise<ReadableStreamDefaultReader<Uint8Array>>;
46
47
  getAsData(endpoint: string): Promise<any>;
47
48
  put(endpoint: string, payload: any | null): Promise<any>;
48
49
  post(endpoint: string, payload: any | null): Promise<any>;
50
+ postStreamed(endpoint: string, payload: any | null): Promise<ReadableStreamDefaultReader<Uint8Array>>;
49
51
  upload(endpoint: string, formData: FormData, method?: "PUT" | "POST"): Promise<any>;
50
52
  private request;
53
+ private streamedRequest;
51
54
  private handleResponse;
55
+ private handleStreamedResponse;
52
56
  private buildRequestConfig;
53
57
  private getProxyAgent;
54
58
  getFetchInvoker(): any;
59
+ getAIEndpoint(fragment: string | null): string;
55
60
  getApiEndpoint(fragment: string | null): string;
56
61
  getBaseEndpoint(fragment: string | null): string;
57
62
  getPublicEndpoint(fragment: string): string;
@@ -71,6 +71,7 @@ import { GitProvidersBranches } from "../../model/workspaces/integrations/GitPro
71
71
  import { GitProvidersOrganizations } from "../../model/workspaces/integrations/GitProvidersOrganizations";
72
72
  import { GitProvidersProjects } from "../../model/workspaces/integrations/GitProvidersProjects";
73
73
  import { GitProvidersRepositories } from "../../model/workspaces/integrations/GitProvidersRepositories";
74
+ import { AIGetRouteQueryTask } from "../areas/SDKAreaAI";
74
75
  import { ComponentUpdateTransactionData, TokenUpdateTransactionData } from "../areas/SDKAreaBulkOperations";
75
76
  import { DataCoreReadRequests } from "./requests/SDKDataCoreReadRequests";
76
77
  import { RenderedAssetRequestSettings } from "./requests/SDKDataCoreRenderRequests";
@@ -101,9 +102,14 @@ export declare class DataCore {
101
102
  strategy: "noun" | "verb";
102
103
  }): Promise<string>;
103
104
  /** Remote: Autocompletes a prompt into a full text. Response is not streamed. */
104
- aiAutocompleteText(workspaceId: string, designSystemId: string, versionId: string, text: string, options: {
105
+ aiAutocompleteText(workspaceId: string, designSystemId: string, versionId: string, textToComplete: string, options?: {
105
106
  maximumLength: number;
106
- }): Promise<string>;
107
+ previousText?: string;
108
+ afterText?: string;
109
+ }): Promise<{
110
+ completion: string;
111
+ fullText: string;
112
+ }>;
107
113
  /** Remote: Answers question based on the data of design system in natural language. This method is non-streaming. */
108
114
  aiAnswer(workspaceId: string, designSystemId: string, versionId: string, prompt: string, options: {
109
115
  persona: "designer" | "developer";
@@ -115,9 +121,11 @@ export declare class DataCore {
115
121
  persona: "designer" | "developer";
116
122
  scope: "all" | "tokens" | "components" | "assets" | "docs";
117
123
  density: "compact" | "full";
118
- }): Promise<ReadableStream<Uint8Array>>;
124
+ }): Promise<ReadableStreamDefaultReader<Uint8Array>>;
119
125
  /** Indexes or reindexes a design system to prepare it for QA engine */
120
- aiRebuildAnswerIndex(workspaceId: string, designSystemId: string, versionId: string): Promise<string>;
126
+ aiRebuildAnswerIndex(workspaceId: string, designSystemId: string, versionId: string): Promise<void>;
127
+ /** Remote: Retrieves executable url for various AI tasks */
128
+ executableTaskUrl(task: AIGetRouteQueryTask): Promise<string>;
121
129
  /** Remote: Get information about currently logged in user */
122
130
  currentUser(): Promise<User>;
123
131
  /** Remote: Get information about a specific user */
@@ -1,3 +1,4 @@
1
+ import { AIGetRouteQueryTask } from "../../areas/SDKAreaAI";
1
2
  import { DataBridge } from "../SDKDataBridge";
2
3
  export declare class DataCoreAIRequests {
3
4
  private bridge;
@@ -8,9 +9,14 @@ export declare class DataCoreAIRequests {
8
9
  strategy: "noun" | "verb";
9
10
  }): Promise<string>;
10
11
  /** Remote: Autocompletes a prompt into a full text. Response is not streamed. */
11
- autocompleteText(workspaceId: string, designSystemId: string, versionId: string, text: string, options: {
12
+ autocompleteText(workspaceId: string, designSystemId: string, versionId: string, textToComplete: string, options?: {
12
13
  maximumLength: number;
13
- }): Promise<string>;
14
+ previousText?: string;
15
+ afterText?: string;
16
+ }): Promise<{
17
+ completion: string;
18
+ fullText: string;
19
+ }>;
14
20
  /** Remote: Answers question based on the data of design system in natural language. This method is non-streaming. */
15
21
  answer(workspaceId: string, designSystemId: string, versionId: string, question: string, options: {
16
22
  persona: "designer" | "developer";
@@ -22,7 +28,11 @@ export declare class DataCoreAIRequests {
22
28
  persona: "designer" | "developer";
23
29
  scope: "all" | "tokens" | "components" | "assets" | "docs";
24
30
  density: "compact" | "full";
25
- }): Promise<ReadableStream<Uint8Array>>;
31
+ }): Promise<ReadableStreamDefaultReader<Uint8Array>>;
26
32
  /** Indexes or reindexes a design system to prepare it for QA engine */
27
- rebuildAnswerIndex(workspaceId: string, designSystemId: string, versionId: string): Promise<string>;
33
+ rebuildAnswerIndex(workspaceId: string, designSystemId: string, versionId: string): Promise<void>;
34
+ /** Retrieves executable url for various AI tasks */
35
+ executableTaskUrl(task: AIGetRouteQueryTask): Promise<string>;
36
+ cachedEndpoints: Map<AIGetRouteQueryTask, string>;
37
+ private getCachedAIEndpoint;
28
38
  }