blink 0.1.110 → 0.1.112
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/dist/browser/control/index.d.cts +16 -16
- package/dist/browser/control/index.d.ts +16 -16
- package/dist/cli/{auth-DjAEZyZZ.js → auth-CWRMZ2tP.js} +17 -17
- package/dist/cli/{chat-manager-DnV2OvBw.js → chat-manager-YT0kz5vw.js} +1 -1
- package/dist/cli/{dev-BvMDj_Q6.js → dev-BTVgKrbG.js} +24 -14
- package/dist/cli/index.js +3 -3
- package/dist/cli/login-D75ec5Dp.js +1 -0
- package/dist/cli/{run-Bfj_0Gkl.js → run-_O9yjIdI.js} +1 -1
- package/dist/cli/{util-8br3-4M3.js → util-uh1Rtjp-.js} +1 -1
- package/dist/node/agent/index.node.cjs +1 -1
- package/dist/node/agent/index.node.d.cts +1 -1
- package/dist/node/agent/index.node.d.ts +1 -1
- package/dist/node/agent/index.node.js +1 -1
- package/dist/node/{index.node-B0EokVTD.js → index.node-BZbn7b9M.js} +1 -1
- package/dist/node/{index.node-GlFXJEaB.d.ts → index.node-C_bJ2rBz.d.ts} +3 -1
- package/dist/node/{index.node-ztcay7c1.d.cts → index.node-HdKpjD23.d.cts} +3 -1
- package/dist/node/{index.node-YNZMDo7o.cjs → index.node-p8Lbll65.cjs} +1 -1
- package/dist/node/react/index.node.cjs +143 -139
- package/dist/node/react/index.node.d.cts +58 -2
- package/dist/node/react/index.node.d.ts +58 -2
- package/dist/node/react/index.node.js +66 -62
- package/package.json +1 -1
- package/dist/cli/login-B84QSb5o.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, UIOptions, UIOptionsSchema } from "../index.browser-CS2PXHA_.cjs";
|
|
2
|
-
import "../index.node-
|
|
2
|
+
import "../index.node-HdKpjD23.cjs";
|
|
3
3
|
import { BuildLog, BuildResult } from "../index-DZ_cKJPr.cjs";
|
|
4
4
|
import { CapabilitiesResponse, Client } from "../index-BDhvk5TM.cjs";
|
|
5
5
|
import { UIMessage } from "ai";
|
|
@@ -26,6 +26,58 @@ declare function useAgent(options: UseAgentOptions): {
|
|
|
26
26
|
} | undefined;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
|
+
//#region src/react/use-auth.d.ts
|
|
30
|
+
interface UseAuthOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Whether to automatically check auth status on mount.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
readonly autoCheck?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when authentication status changes.
|
|
38
|
+
*/
|
|
39
|
+
readonly onAuthChange?: (user: UserInfo | undefined) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback when login URL is generated (for custom UI flows).
|
|
42
|
+
*/
|
|
43
|
+
readonly onLoginUrl?: (url: string, id: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Optional test path for auth token file (for testing only).
|
|
46
|
+
* When set, uses this path instead of the default XDG config path.
|
|
47
|
+
*/
|
|
48
|
+
readonly testAuthPath?: string;
|
|
49
|
+
}
|
|
50
|
+
interface UserInfo {
|
|
51
|
+
readonly email: string;
|
|
52
|
+
}
|
|
53
|
+
interface UseAuth {
|
|
54
|
+
/** Current user info if authenticated, undefined if not */
|
|
55
|
+
readonly user: UserInfo | undefined;
|
|
56
|
+
/** Current auth token (if any) */
|
|
57
|
+
readonly token: string | undefined;
|
|
58
|
+
/** Error message if any */
|
|
59
|
+
readonly error: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Start the login flow. This will:
|
|
62
|
+
* 1. Generate a login URL via the API
|
|
63
|
+
* 2. Call onLoginUrl callback (if provided)
|
|
64
|
+
* 3. Wait for authentication to complete
|
|
65
|
+
* 4. Save the token and fetch user info
|
|
66
|
+
*
|
|
67
|
+
* @returns The authenticated user info
|
|
68
|
+
*/
|
|
69
|
+
readonly login: () => Promise<UserInfo>;
|
|
70
|
+
/**
|
|
71
|
+
* Logout the current user by clearing the token.
|
|
72
|
+
*/
|
|
73
|
+
readonly logout: () => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Hook for managing Blink authentication state.
|
|
77
|
+
* This is UI-agnostic and can be used in both TUI and Desktop apps.
|
|
78
|
+
*/
|
|
79
|
+
declare function useAuth(options?: UseAuthOptions): UseAuth;
|
|
80
|
+
//#endregion
|
|
29
81
|
//#region src/react/use-bundler.d.ts
|
|
30
82
|
type BundlerStatus = "building" | "success" | "error";
|
|
31
83
|
interface BundlerContext {
|
|
@@ -260,6 +312,8 @@ interface UseDevModeOptions {
|
|
|
260
312
|
}) => void;
|
|
261
313
|
readonly onError?: (error: string) => void;
|
|
262
314
|
readonly onModeChange?: (mode: DevMode) => void;
|
|
315
|
+
readonly onAuthChange?: (user: UserInfo | undefined) => void;
|
|
316
|
+
readonly onLoginUrl?: (url: string, id: string) => void;
|
|
263
317
|
}
|
|
264
318
|
interface BuildStatus {
|
|
265
319
|
readonly status: BundlerStatus;
|
|
@@ -302,6 +356,7 @@ interface UseDevMode {
|
|
|
302
356
|
readonly options: AgentOptions;
|
|
303
357
|
readonly approval: ApprovalRequest | undefined;
|
|
304
358
|
readonly tokenUsage: TokenUsage | undefined;
|
|
359
|
+
readonly auth: UseAuth;
|
|
305
360
|
readonly server: LocalServer;
|
|
306
361
|
readonly showWaitingPlaceholder: boolean;
|
|
307
362
|
}
|
|
@@ -329,6 +384,7 @@ declare function useDotenv(directory: string, name?: string): Record<string, str
|
|
|
329
384
|
interface UseEditAgentOptions {
|
|
330
385
|
readonly directory: string;
|
|
331
386
|
readonly apiServerUrl?: string;
|
|
387
|
+
readonly token?: string;
|
|
332
388
|
}
|
|
333
389
|
declare function useEditAgent(options: UseEditAgentOptions): {
|
|
334
390
|
client: Client | undefined;
|
|
@@ -361,4 +417,4 @@ declare function useOptions({
|
|
|
361
417
|
error: Error | undefined;
|
|
362
418
|
};
|
|
363
419
|
//#endregion
|
|
364
|
-
export { useAgent, useBundler, useChat, useDevMode, useDevhook, useDotenv, useEditAgent, useOptions };
|
|
420
|
+
export { useAgent, useAuth, useBundler, useChat, useDevMode, useDevhook, useDotenv, useEditAgent, useOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, UIOptions, UIOptionsSchema } from "../index.browser-BsqAq16G.js";
|
|
2
|
-
import "../index.node-
|
|
2
|
+
import "../index.node-C_bJ2rBz.js";
|
|
3
3
|
import { BuildLog, BuildResult } from "../index-BNMqN1Am.js";
|
|
4
4
|
import { CapabilitiesResponse, Client } from "../index-DHCYXwb2.js";
|
|
5
5
|
import { UIMessage } from "ai";
|
|
@@ -26,6 +26,58 @@ declare function useAgent(options: UseAgentOptions): {
|
|
|
26
26
|
} | undefined;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
|
+
//#region src/react/use-auth.d.ts
|
|
30
|
+
interface UseAuthOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Whether to automatically check auth status on mount.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
readonly autoCheck?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when authentication status changes.
|
|
38
|
+
*/
|
|
39
|
+
readonly onAuthChange?: (user: UserInfo | undefined) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback when login URL is generated (for custom UI flows).
|
|
42
|
+
*/
|
|
43
|
+
readonly onLoginUrl?: (url: string, id: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Optional test path for auth token file (for testing only).
|
|
46
|
+
* When set, uses this path instead of the default XDG config path.
|
|
47
|
+
*/
|
|
48
|
+
readonly testAuthPath?: string;
|
|
49
|
+
}
|
|
50
|
+
interface UserInfo {
|
|
51
|
+
readonly email: string;
|
|
52
|
+
}
|
|
53
|
+
interface UseAuth {
|
|
54
|
+
/** Current user info if authenticated, undefined if not */
|
|
55
|
+
readonly user: UserInfo | undefined;
|
|
56
|
+
/** Current auth token (if any) */
|
|
57
|
+
readonly token: string | undefined;
|
|
58
|
+
/** Error message if any */
|
|
59
|
+
readonly error: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Start the login flow. This will:
|
|
62
|
+
* 1. Generate a login URL via the API
|
|
63
|
+
* 2. Call onLoginUrl callback (if provided)
|
|
64
|
+
* 3. Wait for authentication to complete
|
|
65
|
+
* 4. Save the token and fetch user info
|
|
66
|
+
*
|
|
67
|
+
* @returns The authenticated user info
|
|
68
|
+
*/
|
|
69
|
+
readonly login: () => Promise<UserInfo>;
|
|
70
|
+
/**
|
|
71
|
+
* Logout the current user by clearing the token.
|
|
72
|
+
*/
|
|
73
|
+
readonly logout: () => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Hook for managing Blink authentication state.
|
|
77
|
+
* This is UI-agnostic and can be used in both TUI and Desktop apps.
|
|
78
|
+
*/
|
|
79
|
+
declare function useAuth(options?: UseAuthOptions): UseAuth;
|
|
80
|
+
//#endregion
|
|
29
81
|
//#region src/react/use-bundler.d.ts
|
|
30
82
|
type BundlerStatus = "building" | "success" | "error";
|
|
31
83
|
interface BundlerContext {
|
|
@@ -260,6 +312,8 @@ interface UseDevModeOptions {
|
|
|
260
312
|
}) => void;
|
|
261
313
|
readonly onError?: (error: string) => void;
|
|
262
314
|
readonly onModeChange?: (mode: DevMode) => void;
|
|
315
|
+
readonly onAuthChange?: (user: UserInfo | undefined) => void;
|
|
316
|
+
readonly onLoginUrl?: (url: string, id: string) => void;
|
|
263
317
|
}
|
|
264
318
|
interface BuildStatus {
|
|
265
319
|
readonly status: BundlerStatus;
|
|
@@ -302,6 +356,7 @@ interface UseDevMode {
|
|
|
302
356
|
readonly options: AgentOptions;
|
|
303
357
|
readonly approval: ApprovalRequest | undefined;
|
|
304
358
|
readonly tokenUsage: TokenUsage | undefined;
|
|
359
|
+
readonly auth: UseAuth;
|
|
305
360
|
readonly server: LocalServer;
|
|
306
361
|
readonly showWaitingPlaceholder: boolean;
|
|
307
362
|
}
|
|
@@ -329,6 +384,7 @@ declare function useDotenv(directory: string, name?: string): Record<string, str
|
|
|
329
384
|
interface UseEditAgentOptions {
|
|
330
385
|
readonly directory: string;
|
|
331
386
|
readonly apiServerUrl?: string;
|
|
387
|
+
readonly token?: string;
|
|
332
388
|
}
|
|
333
389
|
declare function useEditAgent(options: UseEditAgentOptions): {
|
|
334
390
|
client: Client | undefined;
|
|
@@ -361,4 +417,4 @@ declare function useOptions({
|
|
|
361
417
|
error: Error | undefined;
|
|
362
418
|
};
|
|
363
419
|
//#endregion
|
|
364
|
-
export { useAgent, useBundler, useChat, useDevMode, useDevhook, useDotenv, useEditAgent, useOptions };
|
|
420
|
+
export { useAgent, useAuth, useBundler, useChat, useDevMode, useDevhook, useDotenv, useEditAgent, useOptions };
|