blink 1.1.27 → 1.1.29

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.
@@ -3,6 +3,52 @@ import { BuildLog, BuildResult } from "../index-DYOqnOdZ.cjs";
3
3
  import { UIMessage, UIMessageChunk } from "ai";
4
4
  import * as react0 from "react";
5
5
 
6
+ //#region src/agent/client/index.d.ts
7
+ interface ClientOptions {
8
+ readonly baseUrl: string;
9
+ readonly headers?: Record<string, string>;
10
+ }
11
+ type CapabilitiesResponse = Awaited<ReturnType<Client["capabilities"]>>;
12
+ /**
13
+ * Client is a client for the Blink agent HTTP API.
14
+ */
15
+ declare class Client {
16
+ readonly baseUrl: string;
17
+ private readonly client;
18
+ constructor(options: ClientOptions);
19
+ /**
20
+ * chat starts chatting with the agent.
21
+ */
22
+ chat(request: {
23
+ id: ID;
24
+ messages: UIMessage[];
25
+ }, options?: {
26
+ signal?: AbortSignal;
27
+ headers?: Record<string, string>;
28
+ }): Promise<ReadableStream<UIMessageChunk>>;
29
+ /**
30
+ * capabilities returns the capabilities of the agent.
31
+ * This is used to check if the agent supports requests and completions.
32
+ */
33
+ capabilities(): Promise<{
34
+ ui: boolean;
35
+ chat: boolean;
36
+ request: boolean;
37
+ error: boolean;
38
+ }>;
39
+ ui(request: {
40
+ selectedOptions?: UIOptions;
41
+ }, options?: {
42
+ signal?: AbortSignal;
43
+ }): Promise<UIOptionsSchema | undefined>;
44
+ /**
45
+ * health simply returns a 200 response.
46
+ * This is used to check if the agent is running.
47
+ */
48
+ health(): Promise<void>;
49
+ private handleError;
50
+ }
51
+ //#endregion
6
52
  //#region src/local/rw-lock.d.ts
7
53
  declare class ReadLock {
8
54
  private onRelease;
@@ -53,53 +99,6 @@ declare class RWLock {
53
99
  write(): Promise<WriteLock>;
54
100
  }
55
101
  //#endregion
56
- //#region src/agent/client/index.d.ts
57
- interface ClientOptions {
58
- readonly baseUrl: string;
59
- readonly headers?: Record<string, string>;
60
- }
61
- type CapabilitiesResponse = Awaited<ReturnType<Client["capabilities"]>>;
62
- /**
63
- * Client is a client for the Blink agent HTTP API.
64
- */
65
- declare class Client {
66
- readonly baseUrl: string;
67
- private readonly client;
68
- readonly agentLock: RWLock;
69
- constructor(options: ClientOptions);
70
- /**
71
- * chat starts chatting with the agent.
72
- */
73
- chat(request: {
74
- id: ID;
75
- messages: UIMessage[];
76
- }, options?: {
77
- signal?: AbortSignal;
78
- headers?: Record<string, string>;
79
- }): Promise<ReadableStream<UIMessageChunk>>;
80
- /**
81
- * capabilities returns the capabilities of the agent.
82
- * This is used to check if the agent supports requests and completions.
83
- */
84
- capabilities(): Promise<{
85
- ui: boolean;
86
- chat: boolean;
87
- request: boolean;
88
- error: boolean;
89
- }>;
90
- ui(request: {
91
- selectedOptions?: UIOptions;
92
- }, options?: {
93
- signal?: AbortSignal;
94
- }): Promise<UIOptionsSchema | undefined>;
95
- /**
96
- * health simply returns a 200 response.
97
- * This is used to check if the agent is running.
98
- */
99
- health(): Promise<void>;
100
- private handleError;
101
- }
102
- //#endregion
103
102
  //#region src/react/use-agent.d.ts
104
103
  interface AgentLog {
105
104
  readonly level: "log" | "error";
@@ -110,8 +109,12 @@ interface UseAgentOptions {
110
109
  readonly env?: Record<string, string>;
111
110
  readonly apiServerUrl?: string;
112
111
  }
112
+ interface Agent {
113
+ readonly client: Client;
114
+ readonly lock: RWLock;
115
+ }
113
116
  declare function useAgent(options: UseAgentOptions): {
114
- agent: Client | undefined;
117
+ agent: Agent | undefined;
115
118
  logs: AgentLog[];
116
119
  error: Error | undefined;
117
120
  capabilities: {
@@ -315,7 +318,7 @@ declare class ChatManager {
315
318
  /**
316
319
  * Update the agent instance to be used for chats
317
320
  */
318
- setAgent(agent: Client | undefined): void;
321
+ setAgent(agent: Agent | undefined): void;
319
322
  /**
320
323
  * Get the current state
321
324
  */
@@ -369,7 +372,7 @@ declare class ChatManager {
369
372
  //#region src/react/use-chat.d.ts
370
373
  interface UseChatOptions {
371
374
  readonly chatId: ID;
372
- readonly agent: Client | undefined;
375
+ readonly agent: Agent | undefined;
373
376
  readonly chatsDirectory: string;
374
377
  /**
375
378
  * Optional function to filter messages before persisting them.
@@ -402,7 +405,7 @@ declare function useChat(options: UseChatOptions): UseChat;
402
405
  interface CreateLocalServerOptions {
403
406
  readonly dataDirectory: string;
404
407
  readonly port?: number;
405
- readonly getAgent: () => Client | undefined;
408
+ readonly getAgent: () => Agent | undefined;
406
409
  }
407
410
  type LocalServer = ReturnType<typeof createLocalServer>;
408
411
  /**
@@ -521,8 +524,12 @@ interface UseEditAgentOptions {
521
524
  readonly env: Record<string, string>;
522
525
  readonly getDevhookUrl: () => string;
523
526
  }
527
+ interface ClientAndLock {
528
+ readonly client: Client;
529
+ readonly lock: RWLock;
530
+ }
524
531
  declare function useEditAgent(options: UseEditAgentOptions): {
525
- client: Client | undefined;
532
+ agent: ClientAndLock | undefined;
526
533
  error: Error | undefined;
527
534
  missingApiKey: boolean;
528
535
  setUserAgentUrl: (url: string) => void;
@@ -3,6 +3,52 @@ import { BuildLog, BuildResult } from "../index-B4OXlWm3.js";
3
3
  import { UIMessage, UIMessageChunk } from "ai";
4
4
  import * as react0 from "react";
5
5
 
6
+ //#region src/agent/client/index.d.ts
7
+ interface ClientOptions {
8
+ readonly baseUrl: string;
9
+ readonly headers?: Record<string, string>;
10
+ }
11
+ type CapabilitiesResponse = Awaited<ReturnType<Client["capabilities"]>>;
12
+ /**
13
+ * Client is a client for the Blink agent HTTP API.
14
+ */
15
+ declare class Client {
16
+ readonly baseUrl: string;
17
+ private readonly client;
18
+ constructor(options: ClientOptions);
19
+ /**
20
+ * chat starts chatting with the agent.
21
+ */
22
+ chat(request: {
23
+ id: ID;
24
+ messages: UIMessage[];
25
+ }, options?: {
26
+ signal?: AbortSignal;
27
+ headers?: Record<string, string>;
28
+ }): Promise<ReadableStream<UIMessageChunk>>;
29
+ /**
30
+ * capabilities returns the capabilities of the agent.
31
+ * This is used to check if the agent supports requests and completions.
32
+ */
33
+ capabilities(): Promise<{
34
+ ui: boolean;
35
+ chat: boolean;
36
+ request: boolean;
37
+ error: boolean;
38
+ }>;
39
+ ui(request: {
40
+ selectedOptions?: UIOptions;
41
+ }, options?: {
42
+ signal?: AbortSignal;
43
+ }): Promise<UIOptionsSchema | undefined>;
44
+ /**
45
+ * health simply returns a 200 response.
46
+ * This is used to check if the agent is running.
47
+ */
48
+ health(): Promise<void>;
49
+ private handleError;
50
+ }
51
+ //#endregion
6
52
  //#region src/local/rw-lock.d.ts
7
53
  declare class ReadLock {
8
54
  private onRelease;
@@ -53,53 +99,6 @@ declare class RWLock {
53
99
  write(): Promise<WriteLock>;
54
100
  }
55
101
  //#endregion
56
- //#region src/agent/client/index.d.ts
57
- interface ClientOptions {
58
- readonly baseUrl: string;
59
- readonly headers?: Record<string, string>;
60
- }
61
- type CapabilitiesResponse = Awaited<ReturnType<Client["capabilities"]>>;
62
- /**
63
- * Client is a client for the Blink agent HTTP API.
64
- */
65
- declare class Client {
66
- readonly baseUrl: string;
67
- private readonly client;
68
- readonly agentLock: RWLock;
69
- constructor(options: ClientOptions);
70
- /**
71
- * chat starts chatting with the agent.
72
- */
73
- chat(request: {
74
- id: ID;
75
- messages: UIMessage[];
76
- }, options?: {
77
- signal?: AbortSignal;
78
- headers?: Record<string, string>;
79
- }): Promise<ReadableStream<UIMessageChunk>>;
80
- /**
81
- * capabilities returns the capabilities of the agent.
82
- * This is used to check if the agent supports requests and completions.
83
- */
84
- capabilities(): Promise<{
85
- ui: boolean;
86
- chat: boolean;
87
- request: boolean;
88
- error: boolean;
89
- }>;
90
- ui(request: {
91
- selectedOptions?: UIOptions;
92
- }, options?: {
93
- signal?: AbortSignal;
94
- }): Promise<UIOptionsSchema | undefined>;
95
- /**
96
- * health simply returns a 200 response.
97
- * This is used to check if the agent is running.
98
- */
99
- health(): Promise<void>;
100
- private handleError;
101
- }
102
- //#endregion
103
102
  //#region src/react/use-agent.d.ts
104
103
  interface AgentLog {
105
104
  readonly level: "log" | "error";
@@ -110,8 +109,12 @@ interface UseAgentOptions {
110
109
  readonly env?: Record<string, string>;
111
110
  readonly apiServerUrl?: string;
112
111
  }
112
+ interface Agent {
113
+ readonly client: Client;
114
+ readonly lock: RWLock;
115
+ }
113
116
  declare function useAgent(options: UseAgentOptions): {
114
- agent: Client | undefined;
117
+ agent: Agent | undefined;
115
118
  logs: AgentLog[];
116
119
  error: Error | undefined;
117
120
  capabilities: {
@@ -315,7 +318,7 @@ declare class ChatManager {
315
318
  /**
316
319
  * Update the agent instance to be used for chats
317
320
  */
318
- setAgent(agent: Client | undefined): void;
321
+ setAgent(agent: Agent | undefined): void;
319
322
  /**
320
323
  * Get the current state
321
324
  */
@@ -369,7 +372,7 @@ declare class ChatManager {
369
372
  //#region src/react/use-chat.d.ts
370
373
  interface UseChatOptions {
371
374
  readonly chatId: ID;
372
- readonly agent: Client | undefined;
375
+ readonly agent: Agent | undefined;
373
376
  readonly chatsDirectory: string;
374
377
  /**
375
378
  * Optional function to filter messages before persisting them.
@@ -402,7 +405,7 @@ declare function useChat(options: UseChatOptions): UseChat;
402
405
  interface CreateLocalServerOptions {
403
406
  readonly dataDirectory: string;
404
407
  readonly port?: number;
405
- readonly getAgent: () => Client | undefined;
408
+ readonly getAgent: () => Agent | undefined;
406
409
  }
407
410
  type LocalServer = ReturnType<typeof createLocalServer>;
408
411
  /**
@@ -521,8 +524,12 @@ interface UseEditAgentOptions {
521
524
  readonly env: Record<string, string>;
522
525
  readonly getDevhookUrl: () => string;
523
526
  }
527
+ interface ClientAndLock {
528
+ readonly client: Client;
529
+ readonly lock: RWLock;
530
+ }
524
531
  declare function useEditAgent(options: UseEditAgentOptions): {
525
- client: Client | undefined;
532
+ agent: ClientAndLock | undefined;
526
533
  error: Error | undefined;
527
534
  missingApiKey: boolean;
528
535
  setUserAgentUrl: (url: string) => void;