@blade-hq/agent-kit 1.0.34 → 1.0.35
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 +95 -2
- package/dist/chunk-6KO3AOJ7.js +251 -0
- package/dist/chunk-6KO3AOJ7.js.map +1 -0
- package/dist/{chunk-FK4CV6R2.js → chunk-C63X3RCM.js} +629 -32
- package/dist/chunk-C63X3RCM.js.map +1 -0
- package/dist/{chunk-BDGMBHYV.js → chunk-DOBX7XP3.js} +5 -5
- package/dist/{chunk-EGGBOVVF.js → chunk-IP7EZVT5.js} +2 -2
- package/dist/{chunk-OICNN4K4.js → chunk-J6H4TMTH.js} +2 -2
- package/dist/{chunk-F4Y7SUBC.js → chunk-SEHOWQVO.js} +2 -2
- package/dist/{chunk-IDVNG3YJ.js → chunk-YJSN44Q4.js} +16 -3
- package/dist/{chunk-IDVNG3YJ.js.map → chunk-YJSN44Q4.js.map} +1 -1
- package/dist/{chunk-E7FQV4IX.js → chunk-ZPPYDQPU.js} +3 -3
- package/dist/client/auth.d.ts +55 -0
- package/dist/client/blade-client.d.ts +19 -3
- package/dist/client/connection.d.ts +41 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +11 -3
- package/dist/client/resources/auth.d.ts +1 -26
- package/dist/client/socket.d.ts +1 -0
- package/dist/client/types/rest.d.ts +151 -0
- package/dist/client/types/socket-events.d.ts +4 -0
- package/dist/react/api/published-apps.js +3 -3
- package/dist/react/api/sessions.js +2 -2
- package/dist/react/bootstrap.d.ts +1 -1
- package/dist/react/components/chat/index.js +5 -5
- package/dist/react/components/connection/BladeConnectionButton.d.ts +7 -0
- package/dist/react/components/connection/BladeConnectionPanel.d.ts +7 -0
- package/dist/react/components/connection/index.d.ts +2 -0
- package/dist/react/components/connection/index.js +15 -0
- package/dist/react/components/connection/index.js.map +1 -0
- package/dist/react/components/plan/index.js +4 -4
- package/dist/react/components/session/index.js +3 -3
- package/dist/react/components/workspace/index.js +3 -3
- package/dist/react/hooks/use-blade-connection.d.ts +14 -0
- package/dist/react/index.d.ts +5 -1
- package/dist/react/index.js +20 -22
- package/dist/react/index.js.map +1 -1
- package/dist/react/sockets/event-bridge.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/dist/chunk-FK4CV6R2.js.map +0 -1
- /package/dist/{chunk-BDGMBHYV.js.map → chunk-DOBX7XP3.js.map} +0 -0
- /package/dist/{chunk-EGGBOVVF.js.map → chunk-IP7EZVT5.js.map} +0 -0
- /package/dist/{chunk-OICNN4K4.js.map → chunk-J6H4TMTH.js.map} +0 -0
- /package/dist/{chunk-F4Y7SUBC.js.map → chunk-SEHOWQVO.js.map} +0 -0
- /package/dist/{chunk-E7FQV4IX.js.map → chunk-ZPPYDQPU.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSessionFilePath,
|
|
3
3
|
resolveSessionFilePreviewTarget
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-J6H4TMTH.js";
|
|
5
5
|
import {
|
|
6
6
|
CardJSON,
|
|
7
7
|
cardRegistry
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
formatToolName,
|
|
12
12
|
getAuthedUrl,
|
|
13
13
|
useUiStore
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YJSN44Q4.js";
|
|
15
15
|
import {
|
|
16
16
|
cn,
|
|
17
17
|
copyToClipboard
|
|
@@ -2065,4 +2065,4 @@ export {
|
|
|
2065
2065
|
PlanSummaryCard,
|
|
2066
2066
|
extractLatestPlanMessages
|
|
2067
2067
|
};
|
|
2068
|
-
//# sourceMappingURL=chunk-
|
|
2068
|
+
//# sourceMappingURL=chunk-ZPPYDQPU.js.map
|
package/dist/client/auth.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { BladeClient } from "./blade-client.js";
|
|
2
|
+
import { type BladeAuthenticatedUser, type BladeConnectionSnapshot, type BladePopupOptions, type BladeServiceInfo } from "./connection.js";
|
|
1
3
|
export interface AuthOptions {
|
|
2
4
|
token?: string | (() => string | null | undefined);
|
|
3
5
|
}
|
|
@@ -6,3 +8,56 @@ export declare function buildSocketAuth(options: AuthOptions): {
|
|
|
6
8
|
token: string;
|
|
7
9
|
} | undefined;
|
|
8
10
|
export declare function resolveAuthToken(options: AuthOptions): string | null;
|
|
11
|
+
export interface UserInfo extends BladeAuthenticatedUser {
|
|
12
|
+
token: string;
|
|
13
|
+
auth_type: "casdoor" | "api_key";
|
|
14
|
+
is_admin?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ProvidersResponse {
|
|
17
|
+
providers: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
authorize_url: string;
|
|
20
|
+
}>;
|
|
21
|
+
password_enabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class AuthResource {
|
|
24
|
+
private client;
|
|
25
|
+
private readonly listeners;
|
|
26
|
+
private readonly memoryStorage;
|
|
27
|
+
private storage;
|
|
28
|
+
private persistent;
|
|
29
|
+
private restorePromise;
|
|
30
|
+
private baseUrlGeneration;
|
|
31
|
+
private pendingConnection;
|
|
32
|
+
private activePopup;
|
|
33
|
+
private cancelPending;
|
|
34
|
+
private snapshot;
|
|
35
|
+
constructor(client: BladeClient);
|
|
36
|
+
getProviders(): Promise<ProvidersResponse>;
|
|
37
|
+
getMe(): Promise<UserInfo>;
|
|
38
|
+
logout(): Promise<{
|
|
39
|
+
logout_url: string;
|
|
40
|
+
}>;
|
|
41
|
+
getConnectionSnapshot(): BladeConnectionSnapshot;
|
|
42
|
+
subscribe(listener: () => void): () => void;
|
|
43
|
+
probe(): Promise<BladeServiceInfo>;
|
|
44
|
+
restore(): Promise<BladeConnectionSnapshot>;
|
|
45
|
+
private runRestore;
|
|
46
|
+
retry(): Promise<BladeConnectionSnapshot>;
|
|
47
|
+
connectWithPopup(options?: BladePopupOptions): Promise<BladeAuthenticatedUser>;
|
|
48
|
+
disconnect(): Promise<void>;
|
|
49
|
+
_handleUnauthorized(): Promise<void>;
|
|
50
|
+
_handleBaseUrlChange(): Promise<void>;
|
|
51
|
+
private runPopupFlow;
|
|
52
|
+
private waitForPopup;
|
|
53
|
+
private assertNoMixedContent;
|
|
54
|
+
private assertGeneration;
|
|
55
|
+
private url;
|
|
56
|
+
private storageKey;
|
|
57
|
+
private storageGet;
|
|
58
|
+
private storageSet;
|
|
59
|
+
private clearManagedAuth;
|
|
60
|
+
private useMemoryStorage;
|
|
61
|
+
private update;
|
|
62
|
+
private toConnectionError;
|
|
63
|
+
}
|
|
@@ -16,18 +16,25 @@ import { SkillsResource } from "./resources/skills.js";
|
|
|
16
16
|
import { SolutionsResource } from "./resources/solutions.js";
|
|
17
17
|
import { UserPreferencesResource } from "./resources/user-preferences.js";
|
|
18
18
|
import { type TypedSocket } from "./socket.js";
|
|
19
|
+
import type { BladeAuthStorage } from "./connection.js";
|
|
19
20
|
export interface BladeClientOptions {
|
|
20
|
-
baseUrl
|
|
21
|
+
baseUrl?: string;
|
|
22
|
+
port?: number;
|
|
21
23
|
token?: string | (() => string | null | undefined);
|
|
24
|
+
authStorage?: BladeAuthStorage | false;
|
|
22
25
|
fetchImpl?: typeof fetch;
|
|
23
26
|
onRefreshSuccess?: () => void | Promise<void>;
|
|
24
27
|
}
|
|
25
28
|
export declare class BladeClient {
|
|
26
29
|
private refreshPromise;
|
|
27
30
|
private socketInstance;
|
|
31
|
+
private managedToken;
|
|
32
|
+
private readonly baseUrlChangeListeners;
|
|
28
33
|
private storeRestTokenResolver;
|
|
29
34
|
private storeSocketTokenResolver;
|
|
30
|
-
readonly options: BladeClientOptions
|
|
35
|
+
readonly options: BladeClientOptions & {
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
};
|
|
31
38
|
readonly apiKeys: ApiKeysResource;
|
|
32
39
|
readonly appDevTemplates: AppDevTemplatesResource;
|
|
33
40
|
readonly auth: AuthResource;
|
|
@@ -44,10 +51,15 @@ export declare class BladeClient {
|
|
|
44
51
|
readonly skills: SkillsResource;
|
|
45
52
|
readonly solutions: SolutionsResource;
|
|
46
53
|
readonly userPreferences: UserPreferencesResource;
|
|
47
|
-
constructor(options
|
|
54
|
+
constructor(options?: BladeClientOptions);
|
|
48
55
|
_attachStoreRestTokenResolver(fn: () => string | null | undefined): void;
|
|
49
56
|
_attachStoreSocketTokenResolver(fn: () => string | null | undefined): void;
|
|
50
57
|
setBaseUrl(baseUrl: string): void;
|
|
58
|
+
onBaseUrlChange(listener: () => void): () => void;
|
|
59
|
+
get baseUrl(): string;
|
|
60
|
+
_setManagedToken(token: string | null): void;
|
|
61
|
+
_reconnectSocketWithCurrentAuth(): void;
|
|
62
|
+
_disconnectSocket(): void;
|
|
51
63
|
socket(): TypedSocket;
|
|
52
64
|
json<T>(method: HttpMethod, path: string, body?: unknown): Promise<T>;
|
|
53
65
|
jsonFromInit<T>(path: string, init?: RequestInit): Promise<T>;
|
|
@@ -67,12 +79,15 @@ export declare class BladeClient {
|
|
|
67
79
|
private toBaseRelativePath;
|
|
68
80
|
private isSameBackendUrl;
|
|
69
81
|
private shouldRefreshFor401;
|
|
82
|
+
private defaultCredentials;
|
|
83
|
+
private shouldOmitManagedCredentials;
|
|
70
84
|
private hasExplicitBearerToken;
|
|
71
85
|
private tryRefresh;
|
|
72
86
|
private resolveTokenForUrl;
|
|
73
87
|
private resolveRestToken;
|
|
74
88
|
private resolveSocketToken;
|
|
75
89
|
private resolveToken;
|
|
90
|
+
private resolveConfiguredToken;
|
|
76
91
|
private formDataWithUploadProgress;
|
|
77
92
|
}
|
|
78
93
|
export interface UploadProgress {
|
|
@@ -80,3 +95,4 @@ export interface UploadProgress {
|
|
|
80
95
|
total?: number;
|
|
81
96
|
percent?: number;
|
|
82
97
|
}
|
|
98
|
+
export declare function resolveBladeBaseUrl(options?: Pick<BladeClientOptions, "baseUrl" | "port">): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface BladeAuthenticatedUser {
|
|
2
|
+
id: string;
|
|
3
|
+
username: string;
|
|
4
|
+
display_name?: string | null;
|
|
5
|
+
avatar_url: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface BladeStoredAuth {
|
|
8
|
+
accessToken: string;
|
|
9
|
+
user: BladeAuthenticatedUser;
|
|
10
|
+
savedAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BladeAuthStorage {
|
|
13
|
+
get(key: string): BladeStoredAuth | null | Promise<BladeStoredAuth | null>;
|
|
14
|
+
set(key: string, value: BladeStoredAuth): void | Promise<void>;
|
|
15
|
+
remove(key: string): void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export type BladeConnectionStatus = "checking_service" | "service_unavailable" | "signed_out" | "waiting_for_authorization" | "connecting" | "connected" | "expired" | "configuration_error";
|
|
18
|
+
export type BladeConnectionErrorCode = "invalid_url" | "service_unreachable" | "not_blade_agent" | "incompatible_server" | "mixed_content" | "popup_blocked" | "popup_closed" | "authorization_denied" | "authorization_expired" | "origin_mismatch" | "invalid_credentials" | "token_exchange_failed";
|
|
19
|
+
export declare class BladeConnectionError extends Error {
|
|
20
|
+
readonly code: BladeConnectionErrorCode;
|
|
21
|
+
constructor(code: BladeConnectionErrorCode, message: string, options?: ErrorOptions);
|
|
22
|
+
}
|
|
23
|
+
export interface BladeConnectionSnapshot {
|
|
24
|
+
status: BladeConnectionStatus;
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
user: BladeAuthenticatedUser | null;
|
|
27
|
+
error: BladeConnectionError | null;
|
|
28
|
+
persistent: boolean;
|
|
29
|
+
managedBySdk: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface BladeServiceInfo {
|
|
32
|
+
status: "ok";
|
|
33
|
+
service: "blade-agent";
|
|
34
|
+
sdk_auth_version: "1";
|
|
35
|
+
}
|
|
36
|
+
export interface BladePopupOptions {
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
windowFeatures?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function createMemoryAuthStorage(): BladeAuthStorage;
|
|
41
|
+
export declare function createLocalAuthStorage(): BladeAuthStorage;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export { BladeApiError } from "./rest.js";
|
|
|
4
4
|
export type { BladeFetchInit, HttpMethod } from "./rest.js";
|
|
5
5
|
export { createSocket } from "./socket.js";
|
|
6
6
|
export type { CreateSocketOptions, TypedSocket } from "./socket.js";
|
|
7
|
+
export { resolveBladeBaseUrl } from "./blade-client.js";
|
|
8
|
+
export { BladeConnectionError, createLocalAuthStorage, createMemoryAuthStorage, } from "./connection.js";
|
|
9
|
+
export type { BladeAuthenticatedUser, BladeAuthStorage, BladeConnectionErrorCode, BladeConnectionSnapshot, BladeConnectionStatus, BladePopupOptions, BladeServiceInfo, BladeStoredAuth, } from "./connection.js";
|
|
7
10
|
export * from "./resources/api-keys.js";
|
|
8
11
|
export * from "./resources/app-dev-templates.js";
|
|
9
12
|
export * from "./resources/auth.js";
|
package/dist/client/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
AuthResource,
|
|
5
5
|
BladeApiError,
|
|
6
6
|
BladeClient,
|
|
7
|
+
BladeConnectionError,
|
|
7
8
|
GisResource,
|
|
8
9
|
HeadlessError,
|
|
9
10
|
HeadlessResource,
|
|
@@ -20,9 +21,12 @@ import {
|
|
|
20
21
|
SkillsResource,
|
|
21
22
|
SolutionsResource,
|
|
22
23
|
UserPreferencesResource,
|
|
24
|
+
createLocalAuthStorage,
|
|
25
|
+
createMemoryAuthStorage,
|
|
23
26
|
createSocket,
|
|
24
|
-
normalizeResource
|
|
25
|
-
|
|
27
|
+
normalizeResource,
|
|
28
|
+
resolveBladeBaseUrl
|
|
29
|
+
} from "../chunk-C63X3RCM.js";
|
|
26
30
|
import "../chunk-PZ5AY32C.js";
|
|
27
31
|
export {
|
|
28
32
|
ApiKeysResource,
|
|
@@ -30,6 +34,7 @@ export {
|
|
|
30
34
|
AuthResource,
|
|
31
35
|
BladeApiError,
|
|
32
36
|
BladeClient,
|
|
37
|
+
BladeConnectionError,
|
|
33
38
|
GisResource,
|
|
34
39
|
HeadlessError,
|
|
35
40
|
HeadlessResource,
|
|
@@ -46,7 +51,10 @@ export {
|
|
|
46
51
|
SkillsResource,
|
|
47
52
|
SolutionsResource,
|
|
48
53
|
UserPreferencesResource,
|
|
54
|
+
createLocalAuthStorage,
|
|
55
|
+
createMemoryAuthStorage,
|
|
49
56
|
createSocket,
|
|
50
|
-
normalizeResource
|
|
57
|
+
normalizeResource,
|
|
58
|
+
resolveBladeBaseUrl
|
|
51
59
|
};
|
|
52
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface UserInfo {
|
|
3
|
-
id: string;
|
|
4
|
-
username: string;
|
|
5
|
-
display_name?: string | null;
|
|
6
|
-
avatar_url: string | null;
|
|
7
|
-
token: string;
|
|
8
|
-
auth_type: "casdoor";
|
|
9
|
-
is_admin?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface ProvidersResponse {
|
|
12
|
-
providers: Array<{
|
|
13
|
-
name: string;
|
|
14
|
-
authorize_url: string;
|
|
15
|
-
}>;
|
|
16
|
-
password_enabled: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare class AuthResource {
|
|
19
|
-
private client;
|
|
20
|
-
constructor(client: BladeClient);
|
|
21
|
-
getProviders(): Promise<ProvidersResponse>;
|
|
22
|
-
getMe(): Promise<UserInfo>;
|
|
23
|
-
logout(): Promise<{
|
|
24
|
-
logout_url: string;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
1
|
+
export { AuthResource, type ProvidersResponse, type UserInfo, } from "../auth.js";
|
package/dist/client/socket.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export type TypedSocket = Socket<ServerToClientEvents, ClientToServerEvents>;
|
|
|
5
5
|
export interface CreateSocketOptions extends AuthOptions {
|
|
6
6
|
baseUrl: string;
|
|
7
7
|
path?: string;
|
|
8
|
+
withCredentials?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare function createSocket(options: CreateSocketOptions): TypedSocket;
|
|
@@ -305,6 +305,41 @@ export interface paths {
|
|
|
305
305
|
patch?: never;
|
|
306
306
|
trace?: never;
|
|
307
307
|
};
|
|
308
|
+
"/api/auth/sdk/authorize": {
|
|
309
|
+
parameters: {
|
|
310
|
+
query?: never;
|
|
311
|
+
header?: never;
|
|
312
|
+
path?: never;
|
|
313
|
+
cookie?: never;
|
|
314
|
+
};
|
|
315
|
+
/** Authorize Sdk */
|
|
316
|
+
get: operations["authorize_sdk_api_auth_sdk_authorize_get"];
|
|
317
|
+
put?: never;
|
|
318
|
+
/** Confirm Sdk Authorization */
|
|
319
|
+
post: operations["confirm_sdk_authorization_api_auth_sdk_authorize_post"];
|
|
320
|
+
delete?: never;
|
|
321
|
+
options?: never;
|
|
322
|
+
head?: never;
|
|
323
|
+
patch?: never;
|
|
324
|
+
trace?: never;
|
|
325
|
+
};
|
|
326
|
+
"/api/auth/sdk/token": {
|
|
327
|
+
parameters: {
|
|
328
|
+
query?: never;
|
|
329
|
+
header?: never;
|
|
330
|
+
path?: never;
|
|
331
|
+
cookie?: never;
|
|
332
|
+
};
|
|
333
|
+
get?: never;
|
|
334
|
+
put?: never;
|
|
335
|
+
/** Exchange Sdk Token */
|
|
336
|
+
post: operations["exchange_sdk_token_api_auth_sdk_token_post"];
|
|
337
|
+
delete?: never;
|
|
338
|
+
options?: never;
|
|
339
|
+
head?: never;
|
|
340
|
+
patch?: never;
|
|
341
|
+
trace?: never;
|
|
342
|
+
};
|
|
308
343
|
"/api/browser-extension/sessions": {
|
|
309
344
|
parameters: {
|
|
310
345
|
query?: never;
|
|
@@ -6016,6 +6051,37 @@ export interface components {
|
|
|
6016
6051
|
/** Model */
|
|
6017
6052
|
model?: string | null;
|
|
6018
6053
|
};
|
|
6054
|
+
/** SdkAuthorizedUser */
|
|
6055
|
+
SdkAuthorizedUser: {
|
|
6056
|
+
/** Id */
|
|
6057
|
+
id: string;
|
|
6058
|
+
/** Username */
|
|
6059
|
+
username: string;
|
|
6060
|
+
/** Display Name */
|
|
6061
|
+
display_name: string;
|
|
6062
|
+
/** Avatar Url */
|
|
6063
|
+
avatar_url: string | null;
|
|
6064
|
+
};
|
|
6065
|
+
/** SdkTokenRequest */
|
|
6066
|
+
SdkTokenRequest: {
|
|
6067
|
+
/** Code */
|
|
6068
|
+
code: string;
|
|
6069
|
+
/** State */
|
|
6070
|
+
state: string;
|
|
6071
|
+
/** Client Origin */
|
|
6072
|
+
client_origin: string;
|
|
6073
|
+
};
|
|
6074
|
+
/** SdkTokenResponse */
|
|
6075
|
+
SdkTokenResponse: {
|
|
6076
|
+
/** Access Token */
|
|
6077
|
+
access_token: string;
|
|
6078
|
+
/**
|
|
6079
|
+
* Token Type
|
|
6080
|
+
* @default Bearer
|
|
6081
|
+
*/
|
|
6082
|
+
token_type: string;
|
|
6083
|
+
user: components["schemas"]["SdkAuthorizedUser"];
|
|
6084
|
+
};
|
|
6019
6085
|
/** SessionMemoryRequest */
|
|
6020
6086
|
SessionMemoryRequest: {
|
|
6021
6087
|
/** Memory Enabled */
|
|
@@ -7183,6 +7249,91 @@ export interface operations {
|
|
|
7183
7249
|
};
|
|
7184
7250
|
};
|
|
7185
7251
|
};
|
|
7252
|
+
authorize_sdk_api_auth_sdk_authorize_get: {
|
|
7253
|
+
parameters: {
|
|
7254
|
+
query: {
|
|
7255
|
+
client_origin: string;
|
|
7256
|
+
state: string;
|
|
7257
|
+
};
|
|
7258
|
+
header?: never;
|
|
7259
|
+
path?: never;
|
|
7260
|
+
cookie?: never;
|
|
7261
|
+
};
|
|
7262
|
+
requestBody?: never;
|
|
7263
|
+
responses: {
|
|
7264
|
+
/** @description Successful Response */
|
|
7265
|
+
200: {
|
|
7266
|
+
headers: {
|
|
7267
|
+
[name: string]: unknown;
|
|
7268
|
+
};
|
|
7269
|
+
content: {
|
|
7270
|
+
"application/json": unknown;
|
|
7271
|
+
};
|
|
7272
|
+
};
|
|
7273
|
+
/** @description Validation Error */
|
|
7274
|
+
422: {
|
|
7275
|
+
headers: {
|
|
7276
|
+
[name: string]: unknown;
|
|
7277
|
+
};
|
|
7278
|
+
content: {
|
|
7279
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
7280
|
+
};
|
|
7281
|
+
};
|
|
7282
|
+
};
|
|
7283
|
+
};
|
|
7284
|
+
confirm_sdk_authorization_api_auth_sdk_authorize_post: {
|
|
7285
|
+
parameters: {
|
|
7286
|
+
query?: never;
|
|
7287
|
+
header?: never;
|
|
7288
|
+
path?: never;
|
|
7289
|
+
cookie?: never;
|
|
7290
|
+
};
|
|
7291
|
+
requestBody?: never;
|
|
7292
|
+
responses: {
|
|
7293
|
+
/** @description Successful Response */
|
|
7294
|
+
200: {
|
|
7295
|
+
headers: {
|
|
7296
|
+
[name: string]: unknown;
|
|
7297
|
+
};
|
|
7298
|
+
content: {
|
|
7299
|
+
"application/json": unknown;
|
|
7300
|
+
};
|
|
7301
|
+
};
|
|
7302
|
+
};
|
|
7303
|
+
};
|
|
7304
|
+
exchange_sdk_token_api_auth_sdk_token_post: {
|
|
7305
|
+
parameters: {
|
|
7306
|
+
query?: never;
|
|
7307
|
+
header?: never;
|
|
7308
|
+
path?: never;
|
|
7309
|
+
cookie?: never;
|
|
7310
|
+
};
|
|
7311
|
+
requestBody: {
|
|
7312
|
+
content: {
|
|
7313
|
+
"application/json": components["schemas"]["SdkTokenRequest"];
|
|
7314
|
+
};
|
|
7315
|
+
};
|
|
7316
|
+
responses: {
|
|
7317
|
+
/** @description Successful Response */
|
|
7318
|
+
200: {
|
|
7319
|
+
headers: {
|
|
7320
|
+
[name: string]: unknown;
|
|
7321
|
+
};
|
|
7322
|
+
content: {
|
|
7323
|
+
"application/json": components["schemas"]["SdkTokenResponse"];
|
|
7324
|
+
};
|
|
7325
|
+
};
|
|
7326
|
+
/** @description Validation Error */
|
|
7327
|
+
422: {
|
|
7328
|
+
headers: {
|
|
7329
|
+
[name: string]: unknown;
|
|
7330
|
+
};
|
|
7331
|
+
content: {
|
|
7332
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
7333
|
+
};
|
|
7334
|
+
};
|
|
7335
|
+
};
|
|
7336
|
+
};
|
|
7186
7337
|
list_extension_sessions_api_browser_extension_sessions_get: {
|
|
7187
7338
|
parameters: {
|
|
7188
7339
|
query?: {
|
|
@@ -166,11 +166,15 @@ export declare namespace SessionUpdatedPayloadSchema {
|
|
|
166
166
|
[k: string]: unknown;
|
|
167
167
|
} | null);
|
|
168
168
|
type Intent = (string | null);
|
|
169
|
+
type ProjectId = (number | null);
|
|
170
|
+
type ProjectName = (string | null);
|
|
169
171
|
interface SessionUpdatedPayload {
|
|
170
172
|
session_id: SessionId;
|
|
171
173
|
model?: Model;
|
|
172
174
|
replay_state?: ReplayState;
|
|
173
175
|
intent?: Intent;
|
|
176
|
+
project_id?: ProjectId;
|
|
177
|
+
project_name?: ProjectName;
|
|
174
178
|
[k: string]: unknown;
|
|
175
179
|
}
|
|
176
180
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listPublishedApps,
|
|
3
3
|
unpublishApp
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-IP7EZVT5.js";
|
|
5
|
+
import "../../chunk-YJSN44Q4.js";
|
|
6
6
|
import "../../chunk-J3XVFPOV.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-C63X3RCM.js";
|
|
8
8
|
import "../../chunk-JCJFFJ42.js";
|
|
9
9
|
import "../../chunk-PZ5AY32C.js";
|
|
10
10
|
export {
|
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
updateSharing,
|
|
42
42
|
uploadFiles,
|
|
43
43
|
writeFile
|
|
44
|
-
} from "../../chunk-
|
|
44
|
+
} from "../../chunk-YJSN44Q4.js";
|
|
45
45
|
import "../../chunk-J3XVFPOV.js";
|
|
46
|
-
import "../../chunk-
|
|
46
|
+
import "../../chunk-C63X3RCM.js";
|
|
47
47
|
import "../../chunk-JCJFFJ42.js";
|
|
48
48
|
import "../../chunk-PZ5AY32C.js";
|
|
49
49
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BladeClient, type BladeClientOptions } from "../client/index.js";
|
|
2
2
|
export declare function attachClientToStores(client: BladeClient): void;
|
|
3
|
-
export declare function bootstrapBladeClient(options
|
|
3
|
+
export declare function bootstrapBladeClient(options?: BladeClientOptions): BladeClient;
|
|
4
4
|
export declare function getBootstrappedClient(): BladeClient;
|
|
@@ -18,16 +18,16 @@ import {
|
|
|
18
18
|
isErrorMessage,
|
|
19
19
|
isUserMessage,
|
|
20
20
|
useWhatIfQuoteContext
|
|
21
|
-
} from "../../../chunk-
|
|
21
|
+
} from "../../../chunk-DOBX7XP3.js";
|
|
22
22
|
import "../../../chunk-H62LH2AG.js";
|
|
23
23
|
import {
|
|
24
24
|
AskUserQuestionBlock
|
|
25
|
-
} from "../../../chunk-
|
|
26
|
-
import "../../../chunk-
|
|
25
|
+
} from "../../../chunk-ZPPYDQPU.js";
|
|
26
|
+
import "../../../chunk-J6H4TMTH.js";
|
|
27
27
|
import "../../../chunk-2UP7MG3J.js";
|
|
28
|
-
import "../../../chunk-
|
|
28
|
+
import "../../../chunk-YJSN44Q4.js";
|
|
29
29
|
import "../../../chunk-J3XVFPOV.js";
|
|
30
|
-
import "../../../chunk-
|
|
30
|
+
import "../../../chunk-C63X3RCM.js";
|
|
31
31
|
import "../../../chunk-7LEKQI47.js";
|
|
32
32
|
import "../../../chunk-JCJFFJ42.js";
|
|
33
33
|
import "../../../chunk-PZ5AY32C.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BladeAuthenticatedUser, BladeConnectionError } from "../../../client/index.js";
|
|
2
|
+
export interface BladeConnectionButtonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
onConnected?: (user: BladeAuthenticatedUser) => void;
|
|
5
|
+
onError?: (error: BladeConnectionError) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function BladeConnectionButton({ className, onConnected, onError, }: BladeConnectionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BladeAuthenticatedUser, BladeConnectionError } from "../../../client/index.js";
|
|
2
|
+
export interface BladeConnectionPanelProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
onConnected?: (user: BladeAuthenticatedUser) => void;
|
|
5
|
+
onError?: (error: BladeConnectionError) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function BladeConnectionPanel({ className, onConnected, onError, }: BladeConnectionPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BladeConnectionButton,
|
|
3
|
+
BladeConnectionPanel
|
|
4
|
+
} from "../../../chunk-6KO3AOJ7.js";
|
|
5
|
+
import "../../../chunk-YJSN44Q4.js";
|
|
6
|
+
import "../../../chunk-J3XVFPOV.js";
|
|
7
|
+
import "../../../chunk-C63X3RCM.js";
|
|
8
|
+
import "../../../chunk-7LEKQI47.js";
|
|
9
|
+
import "../../../chunk-JCJFFJ42.js";
|
|
10
|
+
import "../../../chunk-PZ5AY32C.js";
|
|
11
|
+
export {
|
|
12
|
+
BladeConnectionButton,
|
|
13
|
+
BladeConnectionPanel
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
PlanSummaryCard,
|
|
4
4
|
extractLatestPlanMessages,
|
|
5
5
|
parsePlanMessages
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-ZPPYDQPU.js";
|
|
7
|
+
import "../../../chunk-J6H4TMTH.js";
|
|
8
8
|
import "../../../chunk-2UP7MG3J.js";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-YJSN44Q4.js";
|
|
10
10
|
import "../../../chunk-J3XVFPOV.js";
|
|
11
|
-
import "../../../chunk-
|
|
11
|
+
import "../../../chunk-C63X3RCM.js";
|
|
12
12
|
import {
|
|
13
13
|
cn
|
|
14
14
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSession
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-SEHOWQVO.js";
|
|
4
4
|
import {
|
|
5
5
|
checkoutSession,
|
|
6
6
|
getSessionCheckpoints,
|
|
7
7
|
useChatStore,
|
|
8
8
|
useSessionStore
|
|
9
|
-
} from "../../../chunk-
|
|
9
|
+
} from "../../../chunk-YJSN44Q4.js";
|
|
10
10
|
import "../../../chunk-J3XVFPOV.js";
|
|
11
|
-
import "../../../chunk-
|
|
11
|
+
import "../../../chunk-C63X3RCM.js";
|
|
12
12
|
import {
|
|
13
13
|
cn
|
|
14
14
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../../../chunk-H62LH2AG.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSessionFilePreviewTarget
|
|
8
|
-
} from "../../../chunk-
|
|
8
|
+
} from "../../../chunk-J6H4TMTH.js";
|
|
9
9
|
import {
|
|
10
10
|
apiFetchText,
|
|
11
11
|
copyFile,
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
useChatStore,
|
|
20
20
|
useSessionStore,
|
|
21
21
|
useUiStore
|
|
22
|
-
} from "../../../chunk-
|
|
22
|
+
} from "../../../chunk-YJSN44Q4.js";
|
|
23
23
|
import "../../../chunk-J3XVFPOV.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-C63X3RCM.js";
|
|
25
25
|
import {
|
|
26
26
|
cn
|
|
27
27
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BladePopupOptions } from "../../client/index.js";
|
|
2
|
+
export declare function useBladeConnection(): {
|
|
3
|
+
status: import("../../client/index.js").BladeConnectionStatus;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
user: import("../../client/index.js").BladeAuthenticatedUser | null;
|
|
6
|
+
error: import("../../client/index.js").BladeConnectionError | null;
|
|
7
|
+
persistent: boolean;
|
|
8
|
+
managedBySdk: boolean;
|
|
9
|
+
connect: (options?: BladePopupOptions) => Promise<import("../../client/index.js").BladeAuthenticatedUser>;
|
|
10
|
+
disconnect: () => Promise<void>;
|
|
11
|
+
retry: () => Promise<import("../../client/index.js").BladeConnectionSnapshot>;
|
|
12
|
+
setBaseUrl: (baseUrl: string) => void;
|
|
13
|
+
};
|
|
14
|
+
export type UseBladeConnectionResult = ReturnType<typeof useBladeConnection>;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ export { attachClientToStores, bootstrapBladeClient, getBootstrappedClient } fro
|
|
|
2
2
|
export { BladeContext } from "./context.js";
|
|
3
3
|
export { BladeClientProvider, useBladeClient } from "./provider.js";
|
|
4
4
|
export type { BladeClientProviderProps } from "./provider.js";
|
|
5
|
+
export { useBladeConnection } from "./hooks/use-blade-connection.js";
|
|
6
|
+
export type { UseBladeConnectionResult } from "./hooks/use-blade-connection.js";
|
|
7
|
+
export { BladeConnectionButton, BladeConnectionPanel, } from "./components/connection/index.js";
|
|
8
|
+
export type { BladeConnectionButtonProps, BladeConnectionPanelProps, } from "./components/connection/index.js";
|
|
5
9
|
export * as apiKeysApi from "./api/api-keys.js";
|
|
6
10
|
export * as appDevTemplatesApi from "./api/app-dev-templates.js";
|
|
7
11
|
export type { ApiKeyCreateResponse, ApiKeyPublic } from "./api/api-keys.js";
|
|
@@ -60,7 +64,7 @@ export { locateHtmlElementSource } from "./lib/html-source-locator.js";
|
|
|
60
64
|
export type { HtmlSourceLocation, HtmlSourceLocatorElement } from "./lib/html-source-locator.js";
|
|
61
65
|
export { buildHtmlElementSelectionContext } from "./lib/html-element-selection.js";
|
|
62
66
|
export type { BuildHtmlElementSelectionInput, HtmlElementSelectionContext, HtmlElementSelectionRaw, PendingHtmlElementContext, } from "./lib/html-element-selection.js";
|
|
63
|
-
export { buildMessageContent, getTextContent, groupMessagesByLoop, transformSlashCommand, } from "./lib/chat.js";
|
|
67
|
+
export { buildMessageContent, getTextContent, groupMessagesByLoop, isHiddenInternalMessage, transformSlashCommand, } from "./lib/chat.js";
|
|
64
68
|
export { ATTACHMENT_SIZE_LIMIT_BYTES, formatFileSize, splitFilesBySize, } from "./lib/attachment-upload.js";
|
|
65
69
|
export type { OversizedFileInfo } from "./lib/attachment-upload.js";
|
|
66
70
|
export { getCodeLanguageFromFilename, normalizeCodeLanguage, useHighlightedCodeHtml, } from "./lib/code-highlight.js";
|