blink 0.1.16 → 0.1.18

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/common.d.ts DELETED
@@ -1,207 +0,0 @@
1
- import { AsyncIterableStream, FinishReason, InferUIMessageChunk, ModelMessage, StreamTextResult } from "ai";
2
-
3
- //#region src/api/chat.d.ts
4
- interface Chat {
5
- readonly id: string;
6
- }
7
- type Message = ModelMessage & {
8
- readonly metadata?: Record<string, string>;
9
- };
10
- interface CreateChatOptions {
11
- readonly messages: ReadonlyArray<Message>;
12
- readonly labels?: ReadonlyArray<string>;
13
- readonly title?: string;
14
- }
15
- interface MessageOptions {
16
- readonly behavior?: "interrupt" | "queue";
17
- }
18
- declare const chat: Readonly<{
19
- find(labels: ReadonlyArray<string>): Promise<Chat | undefined>;
20
- create(options: CreateChatOptions): Promise<Chat>;
21
- message(chat: string, message: Message, options?: MessageOptions): Promise<void>;
22
- }>;
23
- //#endregion
24
- //#region src/api/agent.d.ts
25
- interface SendMessagesOptions {
26
- readonly messages: Message[];
27
- readonly abortSignal?: AbortSignal;
28
- }
29
- interface StreamTextResult$1 {
30
- toUIMessageStream(): AsyncIterableStream<InferUIMessageChunk<any>>;
31
- readonly response: StreamTextResult<any, any>["response"];
32
- readonly finishReason: Promise<FinishReason>;
33
- }
34
- interface AgentOptions {
35
- readonly name: string;
36
- readonly description?: string;
37
- sendMessages(options: SendMessagesOptions): Promise<StreamTextResult$1>;
38
- webhook?(request: Request): Promise<Response | void>;
39
- }
40
- declare function agent(options: AgentOptions): {
41
- name: string;
42
- description: string | undefined;
43
- sendMessages: (options: SendMessagesOptions) => Promise<StreamTextResult$1>;
44
- webhook: ((request: Request) => Promise<Response | void>) | undefined;
45
- };
46
- //#endregion
47
- //#region src/api/compute.d.ts
48
- interface WaitProcess {
49
- pid: number;
50
- command: string;
51
- args: string[];
52
- cwd: string;
53
- env: Record<string, string>;
54
- ansiOutput: string;
55
- plainOutput: {
56
- totalLines: number;
57
- lines: string[];
58
- };
59
- title?: string;
60
- durationMs?: number;
61
- exitCode?: number;
62
- exitSignal?: number;
63
- }
64
- interface ReadFileResult {
65
- content: string;
66
- total_lines: number;
67
- lines_read: number;
68
- start_line: number;
69
- mime_type: string;
70
- }
71
- interface ReadDirectoryEntry {
72
- type: "file" | "directory" | "symlink";
73
- name: string;
74
- }
75
- type Options<T = {}> = T & {
76
- instance?: string;
77
- abortSignal?: AbortSignal;
78
- };
79
- declare const compute: Readonly<{
80
- execute(command: string, options?: Options<{
81
- args?: string[];
82
- env?: Record<string, string>;
83
- cwd?: string;
84
- }>): Promise<{
85
- pid: number;
86
- }>;
87
- writeProcessInput(pid: number, input: string, options?: Options): Promise<void>;
88
- waitProcess(pid: number, options?: Options<{
89
- onOutput?: (output: string) => void;
90
- idleOutputTimeoutMs?: number;
91
- timeoutMs?: number;
92
- }>): Promise<WaitProcess>;
93
- readProcessOutput(pid: number, options?: Options<{
94
- mode?: "plain" | "ansi";
95
- }>): Promise<string>;
96
- killProcess(pid: number, signal?: string, options?: Options): Promise<void>;
97
- readFile(path: string, options?: Options<{
98
- lineStart?: number;
99
- lineEnd?: number;
100
- }>): Promise<ReadFileResult>;
101
- writeFile(path: string, content: string, options?: Options): Promise<void>;
102
- readDirectory(path: string, options?: Options): Promise<ReadDirectoryEntry[]>;
103
- }>;
104
- //#endregion
105
- //#region src/api/unsafe_internal.d.ts
106
- interface InternalRequest {
107
- url: string;
108
- headers: Record<string, string>;
109
- method: string;
110
- }
111
- interface RepositoryFilesystem {
112
- readFile(path: string): Promise<string>;
113
- readdir(path: string): Promise<Array<{
114
- type: "file" | "directory";
115
- name: string;
116
- mode: string;
117
- size?: number;
118
- }>>;
119
- }
120
- declare const __unsafe_internal: {
121
- createRepositoryFilesystem?(request: InternalRequest): Promise<RepositoryFilesystem>;
122
- findChat?(labels: ReadonlyArray<string>): Promise<Chat | undefined>;
123
- createChat?(options: CreateChatOptions): Promise<Chat>;
124
- messageChat?(id: string, message: Message, options?: MessageOptions): Promise<void>;
125
- computeExecute?(args: {
126
- instanceID?: string;
127
- command: string;
128
- args?: string[];
129
- env?: Record<string, string>;
130
- cwd?: string;
131
- abortSignal?: AbortSignal;
132
- }): Promise<{
133
- pid: number;
134
- }>;
135
- computeSetenv?(args: {
136
- instanceID?: string;
137
- abortSignal?: AbortSignal;
138
- env: Record<string, string>;
139
- }): Promise<void>;
140
- computeReadFile?(args: {
141
- instanceID?: string;
142
- abortSignal?: AbortSignal;
143
- path: string;
144
- lineStart?: number;
145
- lineEnd?: number;
146
- }): Promise<ReadFileResult>;
147
- computeWriteFile?(args: {
148
- instanceID?: string;
149
- abortSignal?: AbortSignal;
150
- path: string;
151
- content: string;
152
- }): Promise<void>;
153
- computeReadDirectory?(args: {
154
- instanceID?: string;
155
- abortSignal?: AbortSignal;
156
- path: string;
157
- }): Promise<Array<ReadDirectoryEntry>>;
158
- writeProcessInput?(args: {
159
- instanceID?: string;
160
- abortSignal?: AbortSignal;
161
- pid: number;
162
- input: string;
163
- }): Promise<void>;
164
- waitProcess?(args: {
165
- instanceID?: string;
166
- pid: number;
167
- onOutput?: (output: string) => void;
168
- idleOutputTimeoutMs?: number;
169
- timeoutMs?: number;
170
- abortSignal?: AbortSignal;
171
- }): Promise<WaitProcess>;
172
- listProcesses?(args: {
173
- instanceID?: string;
174
- }): Promise<{
175
- pid: number;
176
- command: string;
177
- args: string[];
178
- env: Record<string, string>;
179
- cwd: string;
180
- abortSignal?: AbortSignal;
181
- }>;
182
- readProcessOutput?(args: {
183
- instanceID?: string;
184
- abortSignal?: AbortSignal;
185
- mode?: "plain" | "ansi";
186
- pid: number;
187
- lineStart?: number;
188
- lineEnd?: number;
189
- }): Promise<string>;
190
- killProcess?(args: {
191
- abortSignal?: AbortSignal;
192
- instanceID?: string;
193
- pid: number;
194
- signal?: string;
195
- }): Promise<void>;
196
- };
197
- //#endregion
198
- //#region src/api/index.d.ts
199
- interface Runtime {
200
- readonly name: string;
201
- readonly description?: string;
202
- sendMessages: AgentOptions["sendMessages"];
203
- webhook?(req: Request): Promise<Response | void>;
204
- dispose(): void;
205
- }
206
- //#endregion
207
- export { AgentOptions, Chat, CreateChatOptions, Message, MessageOptions, Options, ReadDirectoryEntry, ReadFileResult, Runtime, SendMessagesOptions, StreamTextResult$1 as StreamTextResult, WaitProcess, __unsafe_internal, agent, chat, compute };
package/dist/runtime.wasm DELETED
Binary file