@nextclaw/server 0.12.0 → 0.12.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +916 -909
  2. package/dist/index.js +3998 -5165
  3. package/package.json +7 -8
package/dist/index.d.ts CHANGED
@@ -1,34 +1,36 @@
1
- import * as NextclawCore from '@nextclaw/core';
2
- import { ThinkingLevel, CronService, Config, ConfigActionExecuteRequest as ConfigActionExecuteRequest$1, ConfigActionExecuteResult as ConfigActionExecuteResult$1 } from '@nextclaw/core';
3
- import { PluginChannelBinding, PluginUiMetadata } from '@nextclaw/openclaw-compat';
4
- import { NcpAgentClientEndpoint, NcpSessionSummary, NcpSessionStatus, NcpMessage, NcpSessionApi } from '@nextclaw/ncp';
5
- import { NcpHttpAgentStreamProvider } from '@nextclaw/ncp-http-agent-server';
6
- import { IncomingMessage } from 'node:http';
7
- import { Hono } from 'hono';
1
+ import { Hono } from "hono";
2
+ import * as NextclawCore from "@nextclaw/core";
3
+ import { Config, ConfigActionExecuteRequest as ConfigActionExecuteRequest$1, ConfigActionExecuteResult as ConfigActionExecuteResult$1, CronService, ThinkingLevel } from "@nextclaw/core";
4
+ import { NcpHttpAgentStreamProvider } from "@nextclaw/ncp-http-agent-server";
5
+ import { PluginChannelBinding, PluginUiMetadata } from "@nextclaw/openclaw-compat";
6
+ import { NcpAgentClientEndpoint, NcpMessage, NcpSessionApi, NcpSessionStatus, NcpSessionSummary } from "@nextclaw/ncp";
7
+ import { IncomingMessage } from "node:http";
8
8
 
9
+ //#region src/ui/ncp-attachment.types.d.ts
9
10
  type UiNcpStoredAssetRecord = {
10
- id: string;
11
- uri: string;
12
- storageKey: string;
13
- fileName: string;
14
- storedName: string;
15
- mimeType: string;
16
- sizeBytes: number;
17
- createdAt: string;
18
- sha256: string;
11
+ id: string;
12
+ uri: string;
13
+ storageKey: string;
14
+ fileName: string;
15
+ storedName: string;
16
+ mimeType: string;
17
+ sizeBytes: number;
18
+ createdAt: string;
19
+ sha256: string;
19
20
  };
20
21
  type UiNcpAssetView = {
21
- id: string;
22
- name: string;
23
- mimeType: string;
24
- sizeBytes: number;
25
- assetUri: string;
26
- url: string;
22
+ id: string;
23
+ name: string;
24
+ mimeType: string;
25
+ sizeBytes: number;
26
+ assetUri: string;
27
+ url: string;
27
28
  };
28
29
  type UiNcpAssetPutView = {
29
- assets: UiNcpAssetView[];
30
+ assets: UiNcpAssetView[];
30
31
  };
31
-
32
+ //#endregion
33
+ //#region src/ui/marketplace.types.d.ts
32
34
  type MarketplaceItemType = "plugin" | "skill" | "mcp";
33
35
  type MarketplaceSort = "relevance" | "updated";
34
36
  type MarketplacePluginInstallKind = "npm";
@@ -36,1165 +38,1169 @@ type MarketplaceSkillInstallKind = "builtin" | "marketplace";
36
38
  type MarketplaceMcpInstallKind = "template";
37
39
  type MarketplaceInstallKind = MarketplacePluginInstallKind | MarketplaceSkillInstallKind | MarketplaceMcpInstallKind;
38
40
  type MarketplaceInstallSpec = {
39
- kind: MarketplaceInstallKind;
40
- spec: string;
41
- command: string;
41
+ kind: MarketplaceInstallKind;
42
+ spec: string;
43
+ command: string;
42
44
  };
43
45
  type MarketplaceMcpTemplateInput = {
44
- id: string;
45
- label: string;
46
- description?: string;
47
- required?: boolean;
48
- secret?: boolean;
49
- defaultValue?: string;
46
+ id: string;
47
+ label: string;
48
+ description?: string;
49
+ required?: boolean;
50
+ secret?: boolean;
51
+ defaultValue?: string;
50
52
  };
51
53
  type MarketplaceMcpInstallSpec = MarketplaceInstallSpec & {
52
- kind: "template";
53
- defaultName: string;
54
- transportTypes: Array<"stdio" | "http" | "sse">;
55
- template: Record<string, unknown>;
56
- inputs: MarketplaceMcpTemplateInput[];
54
+ kind: "template";
55
+ defaultName: string;
56
+ transportTypes: Array<"stdio" | "http" | "sse">;
57
+ template: Record<string, unknown>;
58
+ inputs: MarketplaceMcpTemplateInput[];
57
59
  };
58
60
  type MarketplaceLocalizedTextMap = Record<string, string>;
59
61
  type MarketplaceItemSummary = {
60
- id: string;
61
- slug: string;
62
- type: MarketplaceItemType;
63
- name: string;
64
- summary: string;
65
- summaryI18n: MarketplaceLocalizedTextMap;
66
- tags: string[];
67
- author: string;
68
- install: MarketplaceInstallSpec;
69
- updatedAt: string;
62
+ id: string;
63
+ slug: string;
64
+ type: MarketplaceItemType;
65
+ name: string;
66
+ summary: string;
67
+ summaryI18n: MarketplaceLocalizedTextMap;
68
+ tags: string[];
69
+ author: string;
70
+ install: MarketplaceInstallSpec;
71
+ updatedAt: string;
70
72
  };
71
73
  type MarketplaceItemView = MarketplaceItemSummary & {
72
- description?: string;
73
- descriptionI18n?: MarketplaceLocalizedTextMap;
74
- sourceRepo?: string;
75
- homepage?: string;
76
- publishedAt: string;
74
+ description?: string;
75
+ descriptionI18n?: MarketplaceLocalizedTextMap;
76
+ sourceRepo?: string;
77
+ homepage?: string;
78
+ publishedAt: string;
77
79
  };
78
80
  type MarketplaceSkillContentView = {
79
- type: "skill";
80
- slug: string;
81
- name: string;
82
- install: MarketplaceInstallSpec;
83
- source: "builtin" | "marketplace" | "remote";
84
- raw: string;
85
- metadataRaw?: string;
86
- bodyRaw: string;
87
- sourceUrl?: string;
81
+ type: "skill";
82
+ slug: string;
83
+ name: string;
84
+ install: MarketplaceInstallSpec;
85
+ source: "builtin" | "marketplace" | "remote";
86
+ raw: string;
87
+ metadataRaw?: string;
88
+ bodyRaw: string;
89
+ sourceUrl?: string;
88
90
  };
89
91
  type MarketplacePluginContentView = {
90
- type: "plugin";
91
- slug: string;
92
- name: string;
93
- install: MarketplaceInstallSpec;
94
- source: "npm" | "repo" | "remote";
95
- raw?: string;
96
- bodyRaw?: string;
97
- metadataRaw?: string;
98
- sourceUrl?: string;
92
+ type: "plugin";
93
+ slug: string;
94
+ name: string;
95
+ install: MarketplaceInstallSpec;
96
+ source: "npm" | "repo" | "remote";
97
+ raw?: string;
98
+ bodyRaw?: string;
99
+ metadataRaw?: string;
100
+ sourceUrl?: string;
99
101
  };
100
102
  type MarketplaceMcpContentView = {
101
- type: "mcp";
102
- slug: string;
103
- name: string;
104
- install: MarketplaceMcpInstallSpec;
105
- source: "marketplace" | "remote";
106
- raw: string;
107
- metadataRaw?: string;
108
- bodyRaw: string;
109
- sourceUrl?: string;
103
+ type: "mcp";
104
+ slug: string;
105
+ name: string;
106
+ install: MarketplaceMcpInstallSpec;
107
+ source: "marketplace" | "remote";
108
+ raw: string;
109
+ metadataRaw?: string;
110
+ bodyRaw: string;
111
+ sourceUrl?: string;
110
112
  };
111
113
  type MarketplaceListView = {
112
- total: number;
113
- page: number;
114
- pageSize: number;
115
- totalPages: number;
116
- sort: MarketplaceSort;
117
- query?: string;
118
- items: MarketplaceItemSummary[];
114
+ total: number;
115
+ page: number;
116
+ pageSize: number;
117
+ totalPages: number;
118
+ sort: MarketplaceSort;
119
+ query?: string;
120
+ items: MarketplaceItemSummary[];
119
121
  };
120
122
  type MarketplaceRecommendationView = {
121
- type: MarketplaceItemType;
122
- sceneId: string;
123
- title: string;
124
- description?: string;
125
- total: number;
126
- items: MarketplaceItemSummary[];
123
+ type: MarketplaceItemType;
124
+ sceneId: string;
125
+ title: string;
126
+ description?: string;
127
+ total: number;
128
+ items: MarketplaceItemSummary[];
127
129
  };
128
130
  type MarketplaceInstalledRecord = {
129
- type: MarketplaceItemType;
130
- id?: string;
131
- spec: string;
132
- label?: string;
133
- description?: string;
134
- descriptionZh?: string;
135
- source?: string;
136
- installedAt?: string;
137
- enabled?: boolean;
138
- runtimeStatus?: string;
139
- origin?: string;
140
- installPath?: string;
141
- transport?: "stdio" | "http" | "sse";
142
- scope?: {
143
- allAgents: boolean;
144
- agents: string[];
145
- };
146
- catalogSlug?: string;
147
- vendor?: string;
148
- docsUrl?: string;
149
- homepage?: string;
150
- trustLevel?: "official" | "verified" | "community";
151
- toolCount?: number;
152
- accessible?: boolean;
153
- lastReadyAt?: string;
154
- lastDoctorAt?: string;
155
- lastError?: string;
131
+ type: MarketplaceItemType;
132
+ id?: string;
133
+ spec: string;
134
+ label?: string;
135
+ description?: string;
136
+ descriptionZh?: string;
137
+ source?: string;
138
+ installedAt?: string;
139
+ enabled?: boolean;
140
+ runtimeStatus?: string;
141
+ origin?: string;
142
+ installPath?: string;
143
+ transport?: "stdio" | "http" | "sse";
144
+ scope?: {
145
+ allAgents: boolean;
146
+ agents: string[];
147
+ };
148
+ catalogSlug?: string;
149
+ vendor?: string;
150
+ docsUrl?: string;
151
+ homepage?: string;
152
+ trustLevel?: "official" | "verified" | "community";
153
+ toolCount?: number;
154
+ accessible?: boolean;
155
+ lastReadyAt?: string;
156
+ lastDoctorAt?: string;
157
+ lastError?: string;
156
158
  };
157
159
  type MarketplaceInstalledView = {
158
- type: MarketplaceItemType;
159
- total: number;
160
- specs: string[];
161
- records: MarketplaceInstalledRecord[];
160
+ type: MarketplaceItemType;
161
+ total: number;
162
+ specs: string[];
163
+ records: MarketplaceInstalledRecord[];
162
164
  };
163
165
  type MarketplaceInstallSkillParams = {
164
- slug: string;
165
- kind?: MarketplaceSkillInstallKind;
166
- skill?: string;
167
- installPath?: string;
168
- force?: boolean;
166
+ slug: string;
167
+ kind?: MarketplaceSkillInstallKind;
168
+ skill?: string;
169
+ installPath?: string;
170
+ force?: boolean;
169
171
  };
170
172
  type MarketplacePluginInstallRequest = {
171
- type?: "plugin";
172
- spec: string;
173
+ type?: "plugin";
174
+ spec: string;
173
175
  };
174
176
  type MarketplaceSkillInstallRequest = {
175
- type?: "skill";
176
- spec: string;
177
- kind?: MarketplaceSkillInstallKind;
178
- skill?: string;
179
- installPath?: string;
180
- force?: boolean;
177
+ type?: "skill";
178
+ spec: string;
179
+ kind?: MarketplaceSkillInstallKind;
180
+ skill?: string;
181
+ installPath?: string;
182
+ force?: boolean;
181
183
  };
182
184
  type MarketplaceMcpInstallRequest = {
183
- type?: "mcp";
184
- spec: string;
185
- name?: string;
186
- enabled?: boolean;
187
- allAgents?: boolean;
188
- agents?: string[];
189
- inputs?: Record<string, string>;
190
- template?: MarketplaceMcpInstallSpec;
185
+ type?: "mcp";
186
+ spec: string;
187
+ name?: string;
188
+ enabled?: boolean;
189
+ allAgents?: boolean;
190
+ agents?: string[];
191
+ inputs?: Record<string, string>;
192
+ template?: MarketplaceMcpInstallSpec;
191
193
  };
192
194
  type MarketplacePluginInstallResult = {
193
- type: "plugin";
194
- spec: string;
195
- message: string;
196
- output?: string;
195
+ type: "plugin";
196
+ spec: string;
197
+ message: string;
198
+ output?: string;
197
199
  };
198
200
  type MarketplaceSkillInstallResult = {
199
- type: "skill";
200
- spec: string;
201
- message: string;
202
- output?: string;
201
+ type: "skill";
202
+ spec: string;
203
+ message: string;
204
+ output?: string;
203
205
  };
204
206
  type MarketplaceMcpInstallResult = {
205
- type: "mcp";
206
- spec: string;
207
- name: string;
208
- message: string;
209
- output?: string;
207
+ type: "mcp";
208
+ spec: string;
209
+ name: string;
210
+ message: string;
211
+ output?: string;
210
212
  };
211
213
  type MarketplacePluginManageAction = "enable" | "disable" | "uninstall";
212
214
  type MarketplaceSkillManageAction = "uninstall";
213
215
  type MarketplaceMcpManageAction = "enable" | "disable" | "remove";
214
216
  type MarketplacePluginManageRequest = {
215
- type?: "plugin";
216
- action: MarketplacePluginManageAction;
217
- id?: string;
218
- spec?: string;
217
+ type?: "plugin";
218
+ action: MarketplacePluginManageAction;
219
+ id?: string;
220
+ spec?: string;
219
221
  };
220
222
  type MarketplaceSkillManageRequest = {
221
- type?: "skill";
222
- action: MarketplaceSkillManageAction;
223
- id?: string;
224
- spec?: string;
223
+ type?: "skill";
224
+ action: MarketplaceSkillManageAction;
225
+ id?: string;
226
+ spec?: string;
225
227
  };
226
228
  type MarketplaceMcpManageRequest = {
227
- type?: "mcp";
228
- action: MarketplaceMcpManageAction;
229
- id?: string;
230
- spec?: string;
229
+ type?: "mcp";
230
+ action: MarketplaceMcpManageAction;
231
+ id?: string;
232
+ spec?: string;
231
233
  };
232
234
  type MarketplacePluginManageResult = {
233
- type: "plugin";
234
- action: MarketplacePluginManageAction;
235
- id: string;
236
- message: string;
237
- output?: string;
235
+ type: "plugin";
236
+ action: MarketplacePluginManageAction;
237
+ id: string;
238
+ message: string;
239
+ output?: string;
238
240
  };
239
241
  type MarketplaceSkillManageResult = {
240
- type: "skill";
241
- action: MarketplaceSkillManageAction;
242
- id: string;
243
- message: string;
244
- output?: string;
242
+ type: "skill";
243
+ action: MarketplaceSkillManageAction;
244
+ id: string;
245
+ message: string;
246
+ output?: string;
245
247
  };
246
248
  type MarketplaceMcpManageResult = {
247
- type: "mcp";
248
- action: MarketplaceMcpManageAction;
249
- id: string;
250
- message: string;
251
- output?: string;
249
+ type: "mcp";
250
+ action: MarketplaceMcpManageAction;
251
+ id: string;
252
+ message: string;
253
+ output?: string;
252
254
  };
253
255
  type MarketplaceMcpDoctorResult = {
254
- name: string;
255
- enabled: boolean;
256
- transport: "stdio" | "http" | "sse";
257
- accessible: boolean;
258
- toolCount: number;
259
- error?: string;
256
+ name: string;
257
+ enabled: boolean;
258
+ transport: "stdio" | "http" | "sse";
259
+ accessible: boolean;
260
+ toolCount: number;
261
+ error?: string;
260
262
  };
261
263
  type MarketplaceInstaller = {
262
- installPlugin?: (spec: string) => Promise<{
263
- message: string;
264
- output?: string;
265
- }>;
266
- installSkill?: (params: MarketplaceInstallSkillParams) => Promise<{
267
- message: string;
268
- output?: string;
269
- }>;
270
- enablePlugin?: (id: string) => Promise<{
271
- message: string;
272
- output?: string;
273
- }>;
274
- disablePlugin?: (id: string) => Promise<{
275
- message: string;
276
- output?: string;
277
- }>;
278
- uninstallPlugin?: (id: string) => Promise<{
279
- message: string;
280
- output?: string;
281
- }>;
282
- uninstallSkill?: (slug: string) => Promise<{
283
- message: string;
284
- output?: string;
285
- }>;
286
- installMcp?: (params: MarketplaceMcpInstallRequest) => Promise<{
287
- name: string;
288
- message: string;
289
- output?: string;
290
- }>;
291
- enableMcp?: (name: string) => Promise<{
292
- message: string;
293
- output?: string;
294
- }>;
295
- disableMcp?: (name: string) => Promise<{
296
- message: string;
297
- output?: string;
298
- }>;
299
- removeMcp?: (name: string) => Promise<{
300
- message: string;
301
- output?: string;
302
- }>;
303
- doctorMcp?: (name: string) => Promise<MarketplaceMcpDoctorResult>;
264
+ installPlugin?: (spec: string) => Promise<{
265
+ message: string;
266
+ output?: string;
267
+ }>;
268
+ installSkill?: (params: MarketplaceInstallSkillParams) => Promise<{
269
+ message: string;
270
+ output?: string;
271
+ }>;
272
+ enablePlugin?: (id: string) => Promise<{
273
+ message: string;
274
+ output?: string;
275
+ }>;
276
+ disablePlugin?: (id: string) => Promise<{
277
+ message: string;
278
+ output?: string;
279
+ }>;
280
+ uninstallPlugin?: (id: string) => Promise<{
281
+ message: string;
282
+ output?: string;
283
+ }>;
284
+ uninstallSkill?: (slug: string) => Promise<{
285
+ message: string;
286
+ output?: string;
287
+ }>;
288
+ installMcp?: (params: MarketplaceMcpInstallRequest) => Promise<{
289
+ name: string;
290
+ message: string;
291
+ output?: string;
292
+ }>;
293
+ enableMcp?: (name: string) => Promise<{
294
+ message: string;
295
+ output?: string;
296
+ }>;
297
+ disableMcp?: (name: string) => Promise<{
298
+ message: string;
299
+ output?: string;
300
+ }>;
301
+ removeMcp?: (name: string) => Promise<{
302
+ message: string;
303
+ output?: string;
304
+ }>;
305
+ doctorMcp?: (name: string) => Promise<MarketplaceMcpDoctorResult>;
304
306
  };
305
307
  type MarketplaceApiConfig = {
306
- apiBaseUrl?: string;
307
- installer?: MarketplaceInstaller;
308
+ apiBaseUrl?: string;
309
+ installer?: MarketplaceInstaller;
308
310
  };
309
-
311
+ //#endregion
312
+ //#region src/ui/auth.service.d.ts
310
313
  declare class UiAuthService {
311
- private readonly configPath;
312
- private readonly sessions;
313
- constructor(configPath: string);
314
- private loadCurrentConfig;
315
- private saveCurrentConfig;
316
- private readAuthConfig;
317
- private isConfigured;
318
- isProtectionEnabled(): boolean;
319
- private getSessionIdFromCookieHeader;
320
- private getValidSession;
321
- isRequestAuthenticated(request: Request): boolean;
322
- isSocketAuthenticated(request: IncomingMessage): boolean;
323
- getStatus(request: Request): AuthStatusView;
324
- private createSession;
325
- private clearAllSessions;
326
- private deleteRequestSession;
327
- private buildLoginCookie;
328
- buildTrustedRequestCookieHeader(): string | null;
329
- buildLogoutCookie(request: Request): string;
330
- setup(request: Request, payload: AuthSetupRequest): {
331
- status: AuthStatusView;
332
- cookie: string;
333
- };
334
- login(request: Request, payload: AuthLoginRequest): {
335
- status: AuthStatusView;
336
- cookie: string;
337
- };
338
- logout(request: Request): void;
339
- updatePassword(request: Request, payload: AuthPasswordUpdateRequest): {
340
- status: AuthStatusView;
341
- cookie?: string;
342
- };
343
- updateEnabled(request: Request, payload: AuthEnabledUpdateRequest): {
344
- status: AuthStatusView;
345
- cookie?: string;
346
- };
314
+ private readonly configPath;
315
+ private readonly sessions;
316
+ constructor(configPath: string);
317
+ private loadCurrentConfig;
318
+ private saveCurrentConfig;
319
+ private readAuthConfig;
320
+ private isConfigured;
321
+ isProtectionEnabled(): boolean;
322
+ private getSessionIdFromCookieHeader;
323
+ private getValidSession;
324
+ isRequestAuthenticated(request: Request): boolean;
325
+ isSocketAuthenticated(request: IncomingMessage): boolean;
326
+ getStatus(request: Request): AuthStatusView;
327
+ private createSession;
328
+ private clearAllSessions;
329
+ private deleteRequestSession;
330
+ private buildLoginCookie;
331
+ buildTrustedRequestCookieHeader(): string | null;
332
+ buildLogoutCookie(request: Request): string;
333
+ setup(request: Request, payload: AuthSetupRequest): {
334
+ status: AuthStatusView;
335
+ cookie: string;
336
+ };
337
+ login(request: Request, payload: AuthLoginRequest): {
338
+ status: AuthStatusView;
339
+ cookie: string;
340
+ };
341
+ logout(request: Request): void;
342
+ updatePassword(request: Request, payload: AuthPasswordUpdateRequest): {
343
+ status: AuthStatusView;
344
+ cookie?: string;
345
+ };
346
+ updateEnabled(request: Request, payload: AuthEnabledUpdateRequest): {
347
+ status: AuthStatusView;
348
+ cookie?: string;
349
+ };
347
350
  }
348
-
351
+ //#endregion
352
+ //#region src/ui/ui-routes/types.d.ts
349
353
  type UiRouterOptions = {
350
- configPath: string;
351
- productVersion?: string;
352
- publish: (event: UiServerEvent) => void;
353
- applyLiveConfigReload?: () => Promise<void>;
354
- initializeAgentHomeDirectory?: (homeDirectory: string) => void;
355
- marketplace?: MarketplaceApiConfig;
356
- cronService?: InstanceType<typeof NextclawCore.CronService>;
357
- ncpAgent?: UiNcpAgent;
358
- ncpSessionService?: UiNcpSessionService;
359
- authService?: UiAuthService;
360
- remoteAccess?: UiRemoteAccessHost;
361
- getBootstrapStatus?: () => BootstrapStatusView;
362
- getPluginChannelBindings?: () => PluginChannelBinding[];
363
- getPluginUiMetadata?: () => PluginUiMetadata[];
354
+ configPath: string;
355
+ productVersion?: string;
356
+ publish: (event: UiServerEvent) => void;
357
+ applyLiveConfigReload?: () => Promise<void>;
358
+ initializeAgentHomeDirectory?: (homeDirectory: string) => void;
359
+ marketplace?: MarketplaceApiConfig;
360
+ cronService?: InstanceType<typeof NextclawCore.CronService>;
361
+ ncpAgent?: UiNcpAgent;
362
+ ncpSessionService?: UiNcpSessionService;
363
+ authService?: UiAuthService;
364
+ remoteAccess?: UiRemoteAccessHost;
365
+ getBootstrapStatus?: () => BootstrapStatusView;
366
+ getPluginChannelBindings?: () => PluginChannelBinding[];
367
+ getPluginUiMetadata?: () => PluginUiMetadata[];
364
368
  };
365
369
  type UiRemoteAccessHost = {
366
- getStatus: () => Promise<RemoteAccessView> | RemoteAccessView;
367
- login: (input: RemoteLoginRequest) => Promise<RemoteAccessView>;
368
- startBrowserAuth: (input: RemoteBrowserAuthStartRequest) => Promise<RemoteBrowserAuthStartResult>;
369
- pollBrowserAuth: (input: RemoteBrowserAuthPollRequest) => Promise<RemoteBrowserAuthPollResult>;
370
- logout: () => Promise<RemoteAccessView> | RemoteAccessView;
371
- updateSettings: (input: RemoteSettingsUpdateRequest) => Promise<RemoteAccessView> | RemoteAccessView;
372
- runDoctor: () => Promise<RemoteDoctorView>;
373
- controlService: (action: RemoteServiceAction) => Promise<RemoteServiceActionResult>;
374
- };
375
-
370
+ getStatus: () => Promise<RemoteAccessView> | RemoteAccessView;
371
+ login: (input: RemoteLoginRequest) => Promise<RemoteAccessView>;
372
+ startBrowserAuth: (input: RemoteBrowserAuthStartRequest) => Promise<RemoteBrowserAuthStartResult>;
373
+ pollBrowserAuth: (input: RemoteBrowserAuthPollRequest) => Promise<RemoteBrowserAuthPollResult>;
374
+ logout: () => Promise<RemoteAccessView> | RemoteAccessView;
375
+ updateSettings: (input: RemoteSettingsUpdateRequest) => Promise<RemoteAccessView> | RemoteAccessView;
376
+ runDoctor: () => Promise<RemoteDoctorView>;
377
+ controlService: (action: RemoteServiceAction) => Promise<RemoteServiceActionResult>;
378
+ };
379
+ //#endregion
380
+ //#region src/ui/chat-session-type.types.d.ts
376
381
  type ChatSessionTypeCtaView = {
377
- kind: string;
378
- label?: string;
379
- href?: string;
382
+ kind: string;
383
+ label?: string;
384
+ href?: string;
380
385
  };
381
386
  type ChatSessionTypeOptionView = {
382
- value: string;
383
- label: string;
384
- ready?: boolean;
385
- reason?: string | null;
386
- reasonMessage?: string | null;
387
- supportedModels?: string[];
388
- recommendedModel?: string | null;
389
- cta?: ChatSessionTypeCtaView | null;
387
+ value: string;
388
+ label: string;
389
+ ready?: boolean;
390
+ reason?: string | null;
391
+ reasonMessage?: string | null;
392
+ supportedModels?: string[];
393
+ recommendedModel?: string | null;
394
+ cta?: ChatSessionTypeCtaView | null;
390
395
  };
391
396
  type ChatSessionTypesView = {
392
- defaultType: string;
393
- options: ChatSessionTypeOptionView[];
397
+ defaultType: string;
398
+ options: ChatSessionTypeOptionView[];
394
399
  };
395
-
400
+ //#endregion
401
+ //#region src/ui/types.d.ts
396
402
  type ApiError = {
397
- code: string;
398
- message: string;
399
- details?: Record<string, unknown>;
403
+ code: string;
404
+ message: string;
405
+ details?: Record<string, unknown>;
400
406
  };
401
407
  type ApiResponse<T> = {
402
- ok: true;
403
- data: T;
408
+ ok: true;
409
+ data: T;
404
410
  } | {
405
- ok: false;
406
- error: ApiError;
411
+ ok: false;
412
+ error: ApiError;
407
413
  };
408
414
  type AppMetaView = {
409
- name: string;
410
- productVersion: string;
415
+ name: string;
416
+ productVersion: string;
411
417
  };
412
418
  type BootstrapPhase = "kernel-starting" | "shell-ready" | "hydrating-capabilities" | "ready" | "error";
413
419
  type BootstrapStageState = "pending" | "running" | "ready" | "error";
414
420
  type BootstrapRemoteState = "pending" | "ready" | "conflict" | "disabled" | "error";
415
421
  type BootstrapStatusView = {
416
- phase: BootstrapPhase;
417
- shellReadyAt?: string;
418
- pluginHydration: {
419
- state: BootstrapStageState;
420
- loadedPluginCount: number;
421
- totalPluginCount: number;
422
- startedAt?: string;
423
- completedAt?: string;
424
- error?: string;
425
- };
426
- channels: {
427
- state: BootstrapStageState;
428
- enabled: string[];
429
- error?: string;
430
- };
431
- remote: {
432
- state: BootstrapRemoteState;
433
- message?: string;
434
- };
435
- lastError?: string;
422
+ phase: BootstrapPhase;
423
+ shellReadyAt?: string;
424
+ pluginHydration: {
425
+ state: BootstrapStageState;
426
+ loadedPluginCount: number;
427
+ totalPluginCount: number;
428
+ startedAt?: string;
429
+ completedAt?: string;
430
+ error?: string;
431
+ };
432
+ channels: {
433
+ state: BootstrapStageState;
434
+ enabled: string[];
435
+ error?: string;
436
+ };
437
+ remote: {
438
+ state: BootstrapRemoteState;
439
+ message?: string;
440
+ };
441
+ lastError?: string;
436
442
  };
437
443
  type ProviderConfigView = {
438
- enabled: boolean;
439
- displayName?: string;
440
- apiKeySet: boolean;
441
- apiKeyMasked?: string;
442
- apiBase?: string | null;
443
- extraHeaders?: Record<string, string> | null;
444
- wireApi?: "auto" | "chat" | "responses" | null;
445
- models?: string[];
446
- modelThinking?: Record<string, {
447
- supported: ThinkingLevel[];
448
- default?: ThinkingLevel | null;
449
- }>;
444
+ enabled: boolean;
445
+ displayName?: string;
446
+ apiKeySet: boolean;
447
+ apiKeyMasked?: string;
448
+ apiBase?: string | null;
449
+ extraHeaders?: Record<string, string> | null;
450
+ wireApi?: "auto" | "chat" | "responses" | null;
451
+ models?: string[];
452
+ modelThinking?: Record<string, {
453
+ supported: ThinkingLevel[];
454
+ default?: ThinkingLevel | null;
455
+ }>;
450
456
  };
451
457
  type ProviderConfigUpdate = {
452
- enabled?: boolean;
453
- displayName?: string | null;
454
- apiKey?: string | null;
455
- apiBase?: string | null;
456
- extraHeaders?: Record<string, string> | null;
457
- wireApi?: "auto" | "chat" | "responses" | null;
458
- models?: string[] | null;
459
- modelThinking?: Record<string, {
460
- supported?: ThinkingLevel[];
461
- default?: ThinkingLevel | null;
462
- }> | null;
458
+ enabled?: boolean;
459
+ displayName?: string | null;
460
+ apiKey?: string | null;
461
+ apiBase?: string | null;
462
+ extraHeaders?: Record<string, string> | null;
463
+ wireApi?: "auto" | "chat" | "responses" | null;
464
+ models?: string[] | null;
465
+ modelThinking?: Record<string, {
466
+ supported?: ThinkingLevel[];
467
+ default?: ThinkingLevel | null;
468
+ }> | null;
463
469
  };
464
470
  type ProviderConnectionTestRequest = ProviderConfigUpdate & {
465
- model?: string | null;
471
+ model?: string | null;
466
472
  };
467
473
  type ProviderCreateRequest = ProviderConfigUpdate;
468
474
  type ProviderCreateResult = {
469
- name: string;
470
- provider: ProviderConfigView;
475
+ name: string;
476
+ provider: ProviderConfigView;
471
477
  };
472
478
  type ProviderDeleteResult = {
473
- deleted: boolean;
474
- provider: string;
479
+ deleted: boolean;
480
+ provider: string;
475
481
  };
476
482
  type ProviderConnectionTestResult = {
477
- success: boolean;
478
- provider: string;
479
- model?: string;
480
- latencyMs: number;
481
- message: string;
483
+ success: boolean;
484
+ provider: string;
485
+ model?: string;
486
+ latencyMs: number;
487
+ message: string;
482
488
  };
483
489
  type SearchProviderName = "bocha" | "brave";
484
490
  type BochaFreshnessValue = "noLimit" | "oneDay" | "oneWeek" | "oneMonth" | "oneYear" | string;
485
491
  type SearchProviderConfigView = {
486
- enabled: boolean;
487
- apiKeySet: boolean;
488
- apiKeyMasked?: string;
489
- baseUrl: string;
490
- docsUrl?: string;
491
- summary?: boolean;
492
- freshness?: BochaFreshnessValue;
492
+ enabled: boolean;
493
+ apiKeySet: boolean;
494
+ apiKeyMasked?: string;
495
+ baseUrl: string;
496
+ docsUrl?: string;
497
+ summary?: boolean;
498
+ freshness?: BochaFreshnessValue;
493
499
  };
494
500
  type SearchConfigView = {
495
- provider: SearchProviderName;
496
- enabledProviders: SearchProviderName[];
497
- defaults: {
498
- maxResults: number;
499
- };
500
- providers: {
501
- bocha: SearchProviderConfigView;
502
- brave: SearchProviderConfigView;
503
- };
501
+ provider: SearchProviderName;
502
+ enabledProviders: SearchProviderName[];
503
+ defaults: {
504
+ maxResults: number;
505
+ };
506
+ providers: {
507
+ bocha: SearchProviderConfigView;
508
+ brave: SearchProviderConfigView;
509
+ };
504
510
  };
505
511
  type SearchConfigUpdate = {
506
- provider?: SearchProviderName;
507
- enabledProviders?: SearchProviderName[];
508
- defaults?: {
509
- maxResults?: number;
512
+ provider?: SearchProviderName;
513
+ enabledProviders?: SearchProviderName[];
514
+ defaults?: {
515
+ maxResults?: number;
516
+ };
517
+ providers?: {
518
+ bocha?: {
519
+ apiKey?: string | null;
520
+ baseUrl?: string | null;
521
+ docsUrl?: string | null;
522
+ summary?: boolean;
523
+ freshness?: BochaFreshnessValue | null;
510
524
  };
511
- providers?: {
512
- bocha?: {
513
- apiKey?: string | null;
514
- baseUrl?: string | null;
515
- docsUrl?: string | null;
516
- summary?: boolean;
517
- freshness?: BochaFreshnessValue | null;
518
- };
519
- brave?: {
520
- apiKey?: string | null;
521
- baseUrl?: string | null;
522
- };
525
+ brave?: {
526
+ apiKey?: string | null;
527
+ baseUrl?: string | null;
523
528
  };
529
+ };
524
530
  };
525
531
  type ProviderAuthStartResult = {
526
- provider: string;
527
- kind: "device_code";
528
- methodId?: string;
529
- sessionId: string;
530
- verificationUri: string;
531
- userCode: string;
532
- expiresAt: string;
533
- intervalMs: number;
534
- note?: string;
532
+ provider: string;
533
+ kind: "device_code";
534
+ methodId?: string;
535
+ sessionId: string;
536
+ verificationUri: string;
537
+ userCode: string;
538
+ expiresAt: string;
539
+ intervalMs: number;
540
+ note?: string;
535
541
  };
536
542
  type ProviderAuthStartRequest = {
537
- methodId?: string;
543
+ methodId?: string;
538
544
  };
539
545
  type ProviderAuthPollRequest = {
540
- sessionId: string;
546
+ sessionId: string;
541
547
  };
542
548
  type ProviderAuthPollResult = {
543
- provider: string;
544
- status: "pending" | "authorized" | "denied" | "expired" | "error";
545
- message?: string;
546
- nextPollMs?: number;
549
+ provider: string;
550
+ status: "pending" | "authorized" | "denied" | "expired" | "error";
551
+ message?: string;
552
+ nextPollMs?: number;
547
553
  };
548
554
  type ProviderAuthImportResult = {
549
- provider: string;
550
- status: "imported";
551
- source: "cli";
552
- expiresAt?: string;
555
+ provider: string;
556
+ status: "imported";
557
+ source: "cli";
558
+ expiresAt?: string;
553
559
  };
554
560
  type ChannelAuthStartRequest = {
555
- accountId?: string;
556
- baseUrl?: string;
561
+ accountId?: string;
562
+ baseUrl?: string;
557
563
  };
558
564
  type ChannelAuthStartResult = {
559
- channel: string;
560
- kind: "qr_code";
561
- sessionId: string;
562
- qrCode: string;
563
- qrCodeUrl: string;
564
- expiresAt: string;
565
- intervalMs: number;
566
- note?: string;
565
+ channel: string;
566
+ kind: "qr_code";
567
+ sessionId: string;
568
+ qrCode: string;
569
+ qrCodeUrl: string;
570
+ expiresAt: string;
571
+ intervalMs: number;
572
+ note?: string;
567
573
  };
568
574
  type ChannelAuthPollRequest = {
569
- sessionId: string;
575
+ sessionId: string;
570
576
  };
571
577
  type ChannelAuthPollResult = {
572
- channel: string;
573
- status: "pending" | "scanned" | "authorized" | "expired" | "error";
574
- message?: string;
575
- nextPollMs?: number;
576
- accountId?: string | null;
577
- notes?: string[];
578
+ channel: string;
579
+ status: "pending" | "scanned" | "authorized" | "expired" | "error";
580
+ message?: string;
581
+ nextPollMs?: number;
582
+ accountId?: string | null;
583
+ notes?: string[];
578
584
  };
579
585
  type AuthStatusView = {
580
- enabled: boolean;
581
- configured: boolean;
582
- authenticated: boolean;
583
- username?: string;
586
+ enabled: boolean;
587
+ configured: boolean;
588
+ authenticated: boolean;
589
+ username?: string;
584
590
  };
585
591
  type AuthSetupRequest = {
586
- username: string;
587
- password: string;
592
+ username: string;
593
+ password: string;
588
594
  };
589
595
  type AuthLoginRequest = {
590
- username: string;
591
- password: string;
596
+ username: string;
597
+ password: string;
592
598
  };
593
599
  type AuthPasswordUpdateRequest = {
594
- password: string;
600
+ password: string;
595
601
  };
596
602
  type AuthEnabledUpdateRequest = {
597
- enabled: boolean;
603
+ enabled: boolean;
598
604
  };
599
605
  type RemoteAccountView = {
600
- loggedIn: boolean;
601
- email?: string;
602
- role?: string;
603
- platformBase?: string | null;
604
- apiBase?: string | null;
606
+ loggedIn: boolean;
607
+ email?: string;
608
+ role?: string;
609
+ platformBase?: string | null;
610
+ apiBase?: string | null;
605
611
  };
606
612
  type RemoteRuntimeView = {
607
- enabled: boolean;
608
- mode: "service" | "foreground";
609
- state: "disabled" | "connecting" | "connected" | "disconnected" | "error";
610
- deviceId?: string;
611
- deviceName?: string;
612
- platformBase?: string;
613
- localOrigin?: string;
614
- lastConnectedAt?: string | null;
615
- lastError?: string | null;
616
- updatedAt: string;
613
+ enabled: boolean;
614
+ mode: "service" | "foreground";
615
+ state: "disabled" | "connecting" | "connected" | "disconnected" | "error";
616
+ deviceId?: string;
617
+ deviceName?: string;
618
+ platformBase?: string;
619
+ localOrigin?: string;
620
+ lastConnectedAt?: string | null;
621
+ lastError?: string | null;
622
+ updatedAt: string;
617
623
  };
618
624
  type RemoteServiceView = {
619
- running: boolean;
620
- pid?: number;
621
- uiUrl?: string;
622
- uiPort?: number;
623
- currentProcess: boolean;
625
+ running: boolean;
626
+ pid?: number;
627
+ uiUrl?: string;
628
+ uiPort?: number;
629
+ currentProcess: boolean;
624
630
  };
625
631
  type RemoteSettingsView = {
626
- enabled: boolean;
627
- deviceName: string;
628
- platformApiBase: string;
632
+ enabled: boolean;
633
+ deviceName: string;
634
+ platformApiBase: string;
629
635
  };
630
636
  type RemoteAccessView = {
631
- account: RemoteAccountView;
632
- settings: RemoteSettingsView;
633
- service: RemoteServiceView;
634
- localOrigin: string;
635
- configuredEnabled: boolean;
636
- platformBase?: string | null;
637
- runtime: RemoteRuntimeView | null;
637
+ account: RemoteAccountView;
638
+ settings: RemoteSettingsView;
639
+ service: RemoteServiceView;
640
+ localOrigin: string;
641
+ configuredEnabled: boolean;
642
+ platformBase?: string | null;
643
+ runtime: RemoteRuntimeView | null;
638
644
  };
639
645
  type RemoteDoctorCheckView = {
640
- name: string;
641
- ok: boolean;
642
- detail: string;
646
+ name: string;
647
+ ok: boolean;
648
+ detail: string;
643
649
  };
644
650
  type RemoteDoctorView = {
645
- generatedAt: string;
646
- checks: RemoteDoctorCheckView[];
647
- snapshot: {
648
- configuredEnabled: boolean;
649
- runtime: RemoteRuntimeView | null;
650
- };
651
+ generatedAt: string;
652
+ checks: RemoteDoctorCheckView[];
653
+ snapshot: {
654
+ configuredEnabled: boolean;
655
+ runtime: RemoteRuntimeView | null;
656
+ };
651
657
  };
652
658
  type RemoteLoginRequest = {
653
- email: string;
654
- password: string;
655
- apiBase?: string;
659
+ email: string;
660
+ password: string;
661
+ apiBase?: string;
656
662
  };
657
663
  type RemoteBrowserAuthStartRequest = {
658
- apiBase?: string;
664
+ apiBase?: string;
659
665
  };
660
666
  type RemoteBrowserAuthStartResult = {
661
- sessionId: string;
662
- verificationUri: string;
663
- expiresAt: string;
664
- intervalMs: number;
667
+ sessionId: string;
668
+ verificationUri: string;
669
+ expiresAt: string;
670
+ intervalMs: number;
665
671
  };
666
672
  type RemoteBrowserAuthPollRequest = {
667
- sessionId: string;
668
- apiBase?: string;
673
+ sessionId: string;
674
+ apiBase?: string;
669
675
  };
670
676
  type RemoteBrowserAuthPollResult = {
671
- status: "pending" | "authorized" | "expired";
672
- message?: string;
673
- nextPollMs?: number;
674
- email?: string;
675
- role?: string;
677
+ status: "pending" | "authorized" | "expired";
678
+ message?: string;
679
+ nextPollMs?: number;
680
+ email?: string;
681
+ role?: string;
676
682
  };
677
683
  type RemoteSettingsUpdateRequest = {
678
- enabled?: boolean;
679
- deviceName?: string;
680
- platformApiBase?: string;
684
+ enabled?: boolean;
685
+ deviceName?: string;
686
+ platformApiBase?: string;
681
687
  };
682
688
  type RemoteServiceAction = "start" | "restart" | "stop";
683
689
  type RemoteServiceActionResult = {
684
- accepted: boolean;
685
- action: RemoteServiceAction;
686
- message: string;
690
+ accepted: boolean;
691
+ action: RemoteServiceAction;
692
+ message: string;
687
693
  };
688
694
  type AgentProfileView = {
689
- id: string;
690
- default?: boolean;
691
- displayName?: string;
692
- description?: string;
693
- avatar?: string;
694
- avatarUrl?: string;
695
- workspace?: string;
696
- model?: string;
697
- engine?: string;
698
- engineConfig?: Record<string, unknown>;
699
- contextTokens?: number;
700
- maxToolIterations?: number;
701
- builtIn?: boolean;
695
+ id: string;
696
+ default?: boolean;
697
+ displayName?: string;
698
+ description?: string;
699
+ avatar?: string;
700
+ avatarUrl?: string;
701
+ workspace?: string;
702
+ model?: string;
703
+ engine?: string;
704
+ engineConfig?: Record<string, unknown>;
705
+ contextTokens?: number;
706
+ maxToolIterations?: number;
707
+ builtIn?: boolean;
702
708
  };
703
709
  type AgentCreateRequest = {
704
- id: string;
705
- displayName?: string;
706
- description?: string;
707
- avatar?: string;
708
- home?: string;
710
+ id: string;
711
+ displayName?: string;
712
+ description?: string;
713
+ avatar?: string;
714
+ home?: string;
709
715
  };
710
716
  type AgentDeleteResult = {
711
- deleted: boolean;
712
- agentId: string;
717
+ deleted: boolean;
718
+ agentId: string;
713
719
  };
714
720
  type BindingPeerView = {
715
- kind: "direct" | "group" | "channel";
716
- id: string;
721
+ kind: "direct" | "group" | "channel";
722
+ id: string;
717
723
  };
718
724
  type AgentBindingView = {
719
- agentId: string;
720
- match: {
721
- channel: string;
722
- accountId?: string;
723
- peer?: BindingPeerView;
724
- };
725
+ agentId: string;
726
+ match: {
727
+ channel: string;
728
+ accountId?: string;
729
+ peer?: BindingPeerView;
730
+ };
725
731
  };
726
732
  type SessionConfigView = {
727
- dmScope?: "main" | "per-peer" | "per-channel-peer" | "per-account-channel-peer";
728
- agentToAgent?: {
729
- maxPingPongTurns?: number;
730
- };
733
+ dmScope?: "main" | "per-peer" | "per-channel-peer" | "per-account-channel-peer";
731
734
  };
732
-
733
735
  type SessionEntryView = {
734
- key: string;
735
- createdAt: string;
736
- updatedAt: string;
737
- label?: string;
738
- preferredModel?: string;
739
- preferredThinking?: ThinkingLevel | null;
740
- sessionType: string;
741
- sessionTypeMutable: boolean;
742
- messageCount: number;
743
- lastRole?: string;
744
- lastTimestamp?: string;
736
+ key: string;
737
+ createdAt: string;
738
+ updatedAt: string;
739
+ label?: string;
740
+ preferredModel?: string;
741
+ preferredThinking?: ThinkingLevel | null;
742
+ sessionType: string;
743
+ sessionTypeMutable: boolean;
744
+ messageCount: number;
745
+ lastRole?: string;
746
+ lastTimestamp?: string;
745
747
  };
746
748
  type SessionsListView = {
747
- sessions: SessionEntryView[];
748
- total: number;
749
+ sessions: SessionEntryView[];
750
+ total: number;
749
751
  };
750
752
  type SessionMessageView = {
751
- role: string;
752
- content: unknown;
753
- timestamp: string;
754
- name?: string;
755
- tool_call_id?: string;
756
- tool_calls?: Array<Record<string, unknown>>;
757
- reasoning_content?: string;
753
+ role: string;
754
+ content: unknown;
755
+ timestamp: string;
756
+ name?: string;
757
+ tool_call_id?: string;
758
+ tool_calls?: Array<Record<string, unknown>>;
759
+ reasoning_content?: string;
758
760
  };
759
761
  type SessionEventView = {
760
- seq: number;
761
- type: string;
762
- timestamp: string;
763
- message?: SessionMessageView;
762
+ seq: number;
763
+ type: string;
764
+ timestamp: string;
765
+ message?: SessionMessageView;
764
766
  };
765
767
  type SessionHistoryView = {
766
- key: string;
767
- totalMessages: number;
768
- totalEvents: number;
769
- sessionType: string;
770
- sessionTypeMutable: boolean;
771
- metadata: Record<string, unknown>;
772
- messages: SessionMessageView[];
773
- events: SessionEventView[];
768
+ key: string;
769
+ totalMessages: number;
770
+ totalEvents: number;
771
+ sessionType: string;
772
+ sessionTypeMutable: boolean;
773
+ metadata: Record<string, unknown>;
774
+ messages: SessionMessageView[];
775
+ events: SessionEventView[];
774
776
  };
775
777
  type SessionPatchUpdate = {
776
- label?: string | null;
777
- preferredModel?: string | null;
778
- preferredThinking?: ThinkingLevel | null;
779
- sessionType?: string | null;
780
- projectRoot?: string | null;
781
- clearHistory?: boolean;
778
+ label?: string | null;
779
+ preferredModel?: string | null;
780
+ preferredThinking?: ThinkingLevel | null;
781
+ sessionType?: string | null;
782
+ projectRoot?: string | null;
783
+ clearHistory?: boolean;
782
784
  };
783
785
  type SessionSkillEntryView = {
784
- ref: string;
785
- name: string;
786
- path: string;
787
- scope: "builtin" | "project" | "workspace";
788
- source: "builtin" | "project" | "workspace";
789
- available: boolean;
790
- description?: string;
791
- descriptionZh?: string;
786
+ ref: string;
787
+ name: string;
788
+ path: string;
789
+ scope: "builtin" | "project" | "workspace";
790
+ source: "builtin" | "project" | "workspace";
791
+ available: boolean;
792
+ description?: string;
793
+ descriptionZh?: string;
792
794
  };
793
795
  type NcpSessionSkillsView = {
794
- sessionId: string;
795
- total: number;
796
- refs: string[];
797
- records: SessionSkillEntryView[];
796
+ sessionId: string;
797
+ total: number;
798
+ refs: string[];
799
+ records: SessionSkillEntryView[];
798
800
  };
799
801
  type ServerPathEntryView = {
800
- name: string;
801
- path: string;
802
- kind: "directory" | "file";
803
- hidden: boolean;
802
+ name: string;
803
+ path: string;
804
+ kind: "directory" | "file";
805
+ hidden: boolean;
804
806
  };
805
807
  type ServerPathBreadcrumbView = {
806
- label: string;
807
- path: string;
808
+ label: string;
809
+ path: string;
808
810
  };
809
811
  type ServerPathBrowseView = {
810
- currentPath: string;
811
- parentPath: string | null;
812
- homePath: string;
813
- breadcrumbs: ServerPathBreadcrumbView[];
814
- entries: ServerPathEntryView[];
812
+ currentPath: string;
813
+ parentPath: string | null;
814
+ homePath: string;
815
+ breadcrumbs: ServerPathBreadcrumbView[];
816
+ entries: ServerPathEntryView[];
815
817
  };
816
818
  type CronScheduleView = {
817
- kind: "at";
818
- atMs?: number | null;
819
+ kind: "at";
820
+ atMs?: number | null;
819
821
  } | {
820
- kind: "every";
821
- everyMs?: number | null;
822
+ kind: "every";
823
+ everyMs?: number | null;
822
824
  } | {
823
- kind: "cron";
824
- expr?: string | null;
825
- tz?: string | null;
825
+ kind: "cron";
826
+ expr?: string | null;
827
+ tz?: string | null;
826
828
  };
827
829
  type CronPayloadView = {
828
- kind?: "system_event" | "agent_turn";
829
- message: string;
830
- deliver?: boolean;
831
- channel?: string | null;
832
- to?: string | null;
830
+ kind?: "system_event" | "agent_turn";
831
+ message: string;
832
+ deliver?: boolean;
833
+ channel?: string | null;
834
+ to?: string | null;
833
835
  };
834
836
  type CronJobStateView = {
835
- nextRunAt?: string | null;
836
- lastRunAt?: string | null;
837
- lastStatus?: "ok" | "error" | "skipped" | null;
838
- lastError?: string | null;
837
+ nextRunAt?: string | null;
838
+ lastRunAt?: string | null;
839
+ lastStatus?: "ok" | "error" | "skipped" | null;
840
+ lastError?: string | null;
839
841
  };
840
842
  type CronJobView = {
841
- id: string;
842
- name: string;
843
- enabled: boolean;
844
- schedule: CronScheduleView;
845
- payload: CronPayloadView;
846
- state: CronJobStateView;
847
- createdAt: string;
848
- updatedAt: string;
849
- deleteAfterRun: boolean;
843
+ id: string;
844
+ name: string;
845
+ enabled: boolean;
846
+ schedule: CronScheduleView;
847
+ payload: CronPayloadView;
848
+ state: CronJobStateView;
849
+ createdAt: string;
850
+ updatedAt: string;
851
+ deleteAfterRun: boolean;
850
852
  };
851
853
  type CronListView = {
852
- jobs: CronJobView[];
853
- total: number;
854
+ jobs: CronJobView[];
855
+ total: number;
854
856
  };
855
857
  type CronEnableRequest = {
856
- enabled: boolean;
858
+ enabled: boolean;
857
859
  };
858
860
  type CronRunRequest = {
859
- force?: boolean;
861
+ force?: boolean;
860
862
  };
861
863
  type CronActionResult = {
862
- job: CronJobView | null;
863
- executed?: boolean;
864
+ job: CronJobView | null;
865
+ executed?: boolean;
864
866
  };
865
867
  type RuntimeConfigUpdate = {
866
- agents?: {
867
- defaults?: {
868
- contextTokens?: number;
869
- engine?: string;
870
- engineConfig?: Record<string, unknown>;
871
- };
872
- list?: AgentProfileView[];
868
+ agents?: {
869
+ defaults?: {
870
+ contextTokens?: number;
871
+ engine?: string;
872
+ engineConfig?: Record<string, unknown>;
873
873
  };
874
- bindings?: AgentBindingView[];
875
- session?: SessionConfigView;
874
+ list?: AgentProfileView[];
875
+ };
876
+ bindings?: AgentBindingView[];
877
+ session?: SessionConfigView;
876
878
  };
877
879
  type SecretSourceView = "env" | "file" | "exec";
878
880
  type SecretRefView = {
879
- source: SecretSourceView;
880
- provider?: string;
881
- id: string;
881
+ source: SecretSourceView;
882
+ provider?: string;
883
+ id: string;
882
884
  };
883
885
  type SecretProviderEnvView = {
884
- source: "env";
885
- prefix?: string;
886
+ source: "env";
887
+ prefix?: string;
886
888
  };
887
889
  type SecretProviderFileView = {
888
- source: "file";
889
- path: string;
890
- format?: "json";
890
+ source: "file";
891
+ path: string;
892
+ format?: "json";
891
893
  };
892
894
  type SecretProviderExecView = {
893
- source: "exec";
894
- command: string;
895
- args?: string[];
896
- cwd?: string;
897
- timeoutMs?: number;
895
+ source: "exec";
896
+ command: string;
897
+ args?: string[];
898
+ cwd?: string;
899
+ timeoutMs?: number;
898
900
  };
899
901
  type SecretProviderView = SecretProviderEnvView | SecretProviderFileView | SecretProviderExecView;
900
902
  type SecretsView = {
901
- enabled: boolean;
902
- defaults: {
903
- env?: string;
904
- file?: string;
905
- exec?: string;
906
- };
907
- providers: Record<string, SecretProviderView>;
908
- refs: Record<string, SecretRefView>;
903
+ enabled: boolean;
904
+ defaults: {
905
+ env?: string;
906
+ file?: string;
907
+ exec?: string;
908
+ };
909
+ providers: Record<string, SecretProviderView>;
910
+ refs: Record<string, SecretRefView>;
909
911
  };
910
912
  type SecretsConfigUpdate = {
911
- enabled?: boolean;
912
- defaults?: {
913
- env?: string | null;
914
- file?: string | null;
915
- exec?: string | null;
916
- };
917
- providers?: Record<string, SecretProviderView> | null;
918
- refs?: Record<string, SecretRefView> | null;
913
+ enabled?: boolean;
914
+ defaults?: {
915
+ env?: string | null;
916
+ file?: string | null;
917
+ exec?: string | null;
918
+ };
919
+ providers?: Record<string, SecretProviderView> | null;
920
+ refs?: Record<string, SecretRefView> | null;
919
921
  };
920
922
  type UiNcpSessionListView = {
921
- sessions: NcpSessionSummary[];
922
- total: number;
923
+ sessions: NcpSessionSummary[];
924
+ total: number;
923
925
  };
924
926
  type UiNcpSessionMessagesView = {
925
- sessionId: string;
926
- status: NcpSessionStatus;
927
- messages: NcpMessage[];
928
- total: number;
927
+ sessionId: string;
928
+ status: NcpSessionStatus;
929
+ messages: NcpMessage[];
930
+ total: number;
929
931
  };
930
932
  type SessionTypeDescribeParams = {
931
- describeMode?: "observation" | "probe";
933
+ describeMode?: "observation" | "probe";
932
934
  };
933
935
  type UiNcpSessionService = NcpSessionApi;
934
936
  type UiNcpAgent = {
935
- agentClientEndpoint: NcpAgentClientEndpoint;
936
- streamProvider?: NcpHttpAgentStreamProvider;
937
- listSessionTypes?: (params?: SessionTypeDescribeParams) => Promise<ChatSessionTypesView> | ChatSessionTypesView;
938
- assetApi?: {
939
- put: (input: {
940
- fileName: string;
941
- mimeType?: string | null;
942
- bytes: Uint8Array;
943
- createdAt?: Date;
944
- }) => Promise<UiNcpStoredAssetRecord>;
945
- stat: (uri: string) => Promise<UiNcpStoredAssetRecord | null> | UiNcpStoredAssetRecord | null;
946
- resolveContentPath: (uri: string) => string | null;
947
- };
948
- basePath?: string;
937
+ agentClientEndpoint: NcpAgentClientEndpoint;
938
+ streamProvider?: NcpHttpAgentStreamProvider;
939
+ listSessionTypes?: (params?: SessionTypeDescribeParams) => Promise<ChatSessionTypesView> | ChatSessionTypesView;
940
+ assetApi?: {
941
+ put: (input: {
942
+ fileName: string;
943
+ mimeType?: string | null;
944
+ bytes: Uint8Array;
945
+ createdAt?: Date;
946
+ }) => Promise<UiNcpStoredAssetRecord>;
947
+ stat: (uri: string) => Promise<UiNcpStoredAssetRecord | null> | UiNcpStoredAssetRecord | null;
948
+ resolveContentPath: (uri: string) => string | null;
949
+ };
950
+ basePath?: string;
949
951
  };
950
952
  type ConfigView = {
951
- agents: {
952
- defaults: {
953
- model: string;
954
- workspace?: string;
955
- engine?: string;
956
- engineConfig?: Record<string, unknown>;
957
- contextTokens?: number;
958
- maxToolIterations?: number;
959
- };
960
- list?: AgentProfileView[];
961
- context?: {
962
- bootstrap?: {
963
- files?: string[];
964
- minimalFiles?: string[];
965
- heartbeatFiles?: string[];
966
- perFileChars?: number;
967
- totalChars?: number;
968
- };
969
- memory?: {
970
- enabled?: boolean;
971
- maxChars?: number;
972
- };
973
- };
953
+ agents: {
954
+ defaults: {
955
+ model: string;
956
+ workspace?: string;
957
+ engine?: string;
958
+ engineConfig?: Record<string, unknown>;
959
+ contextTokens?: number;
960
+ maxToolIterations?: number;
961
+ };
962
+ list?: AgentProfileView[];
963
+ context?: {
964
+ bootstrap?: {
965
+ files?: string[];
966
+ minimalFiles?: string[];
967
+ heartbeatFiles?: string[];
968
+ perFileChars?: number;
969
+ totalChars?: number;
970
+ };
971
+ memory?: {
972
+ enabled?: boolean;
973
+ maxChars?: number;
974
+ };
974
975
  };
975
- providers: Record<string, ProviderConfigView>;
976
- search: SearchConfigView;
977
- channels: Record<string, Record<string, unknown>>;
978
- bindings?: AgentBindingView[];
979
- session?: SessionConfigView;
980
- tools?: Record<string, unknown>;
981
- gateway?: Record<string, unknown>;
982
- ui?: Record<string, unknown>;
983
- secrets?: SecretsView;
976
+ };
977
+ providers: Record<string, ProviderConfigView>;
978
+ search: SearchConfigView;
979
+ channels: Record<string, Record<string, unknown>>;
980
+ bindings?: AgentBindingView[];
981
+ session?: SessionConfigView;
982
+ tools?: Record<string, unknown>;
983
+ gateway?: Record<string, unknown>;
984
+ ui?: Record<string, unknown>;
985
+ secrets?: SecretsView;
984
986
  };
985
987
  type ProviderSpecView = {
986
- name: string;
988
+ name: string;
989
+ displayName?: string;
990
+ isCustom?: boolean;
991
+ modelPrefix?: string;
992
+ keywords: string[];
993
+ envKey: string;
994
+ isGateway?: boolean;
995
+ isLocal?: boolean;
996
+ defaultApiBase?: string;
997
+ logo?: string;
998
+ apiBaseHelp?: {
999
+ en?: string;
1000
+ zh?: string;
1001
+ };
1002
+ auth?: {
1003
+ kind: "device_code";
987
1004
  displayName?: string;
988
- isCustom?: boolean;
989
- modelPrefix?: string;
990
- keywords: string[];
991
- envKey: string;
992
- isGateway?: boolean;
993
- isLocal?: boolean;
994
- defaultApiBase?: string;
995
- logo?: string;
996
- apiBaseHelp?: {
1005
+ note?: {
1006
+ en?: string;
1007
+ zh?: string;
1008
+ };
1009
+ methods?: Array<{
1010
+ id: string;
1011
+ label?: {
997
1012
  en?: string;
998
1013
  zh?: string;
999
- };
1000
- auth?: {
1001
- kind: "device_code";
1002
- displayName?: string;
1003
- note?: {
1004
- en?: string;
1005
- zh?: string;
1006
- };
1007
- methods?: Array<{
1008
- id: string;
1009
- label?: {
1010
- en?: string;
1011
- zh?: string;
1012
- };
1013
- hint?: {
1014
- en?: string;
1015
- zh?: string;
1016
- };
1017
- }>;
1018
- defaultMethodId?: string;
1019
- supportsCliImport?: boolean;
1020
- };
1021
- defaultModels?: string[];
1022
- supportsWireApi?: boolean;
1023
- wireApiOptions?: Array<"auto" | "chat" | "responses">;
1024
- defaultWireApi?: "auto" | "chat" | "responses";
1025
- };
1026
- type ChannelSpecView = {
1027
- name: string;
1028
- displayName?: string;
1029
- enabled: boolean;
1030
- tutorialUrl?: string;
1031
- tutorialUrls?: {
1032
- default?: string;
1014
+ };
1015
+ hint?: {
1033
1016
  en?: string;
1034
1017
  zh?: string;
1035
- };
1018
+ };
1019
+ }>;
1020
+ defaultMethodId?: string;
1021
+ supportsCliImport?: boolean;
1022
+ };
1023
+ defaultModels?: string[];
1024
+ supportsWireApi?: boolean;
1025
+ wireApiOptions?: Array<"auto" | "chat" | "responses">;
1026
+ defaultWireApi?: "auto" | "chat" | "responses";
1027
+ };
1028
+ type ChannelSpecView = {
1029
+ name: string;
1030
+ displayName?: string;
1031
+ enabled: boolean;
1032
+ tutorialUrl?: string;
1033
+ tutorialUrls?: {
1034
+ default?: string;
1035
+ en?: string;
1036
+ zh?: string;
1037
+ };
1036
1038
  };
1037
1039
  type SearchProviderSpecView = {
1038
- name: SearchProviderName;
1039
- displayName: string;
1040
- description: string;
1041
- docsUrl?: string;
1042
- isDefault?: boolean;
1043
- supportsSummary?: boolean;
1040
+ name: SearchProviderName;
1041
+ displayName: string;
1042
+ description: string;
1043
+ docsUrl?: string;
1044
+ isDefault?: boolean;
1045
+ supportsSummary?: boolean;
1044
1046
  };
1045
1047
  type ConfigMetaView = {
1046
- providers: ProviderSpecView[];
1047
- search: SearchProviderSpecView[];
1048
- channels: ChannelSpecView[];
1048
+ providers: ProviderSpecView[];
1049
+ search: SearchProviderSpecView[];
1050
+ channels: ChannelSpecView[];
1049
1051
  };
1050
1052
  type ConfigUiHint = {
1051
- label?: string;
1052
- help?: string;
1053
- group?: string;
1054
- order?: number;
1055
- advanced?: boolean;
1056
- sensitive?: boolean;
1057
- placeholder?: string;
1058
- readOnly?: boolean;
1053
+ label?: string;
1054
+ help?: string;
1055
+ group?: string;
1056
+ order?: number;
1057
+ advanced?: boolean;
1058
+ sensitive?: boolean;
1059
+ placeholder?: string;
1060
+ readOnly?: boolean;
1059
1061
  };
1060
1062
  type ConfigUiHints = Record<string, ConfigUiHint>;
1061
1063
  type ConfigSchemaResponse = {
1062
- schema: Record<string, unknown>;
1063
- uiHints: ConfigUiHints;
1064
- actions: ConfigActionManifest[];
1065
- version: string;
1066
- generatedAt: string;
1064
+ schema: Record<string, unknown>;
1065
+ uiHints: ConfigUiHints;
1066
+ actions: ConfigActionManifest[];
1067
+ version: string;
1068
+ generatedAt: string;
1067
1069
  };
1068
1070
  type ConfigActionType = "httpProbe" | "oauthStart" | "webhookVerify" | "openUrl" | "copyToken";
1069
1071
  type ConfigActionManifest = {
1070
- id: string;
1071
- version: string;
1072
- scope: string;
1073
- title: string;
1074
- description?: string;
1075
- type: ConfigActionType;
1076
- trigger: "manual" | "afterSave";
1077
- requires?: string[];
1078
- request: {
1079
- method: "GET" | "POST" | "PUT";
1080
- path: string;
1081
- timeoutMs?: number;
1082
- };
1083
- success?: {
1084
- message?: string;
1085
- };
1086
- failure?: {
1087
- message?: string;
1088
- };
1089
- saveBeforeRun?: boolean;
1090
- savePatch?: Record<string, unknown>;
1091
- resultMap?: Record<string, string>;
1092
- policy?: {
1093
- roles?: string[];
1094
- rateLimitKey?: string;
1095
- cooldownMs?: number;
1096
- audit?: boolean;
1097
- };
1072
+ id: string;
1073
+ version: string;
1074
+ scope: string;
1075
+ title: string;
1076
+ description?: string;
1077
+ type: ConfigActionType;
1078
+ trigger: "manual" | "afterSave";
1079
+ requires?: string[];
1080
+ request: {
1081
+ method: "GET" | "POST" | "PUT";
1082
+ path: string;
1083
+ timeoutMs?: number;
1084
+ };
1085
+ success?: {
1086
+ message?: string;
1087
+ };
1088
+ failure?: {
1089
+ message?: string;
1090
+ };
1091
+ saveBeforeRun?: boolean;
1092
+ savePatch?: Record<string, unknown>;
1093
+ resultMap?: Record<string, string>;
1094
+ policy?: {
1095
+ roles?: string[];
1096
+ rateLimitKey?: string;
1097
+ cooldownMs?: number;
1098
+ audit?: boolean;
1099
+ };
1098
1100
  };
1099
1101
  type ConfigActionExecuteRequest = {
1100
- scope?: string;
1101
- draftConfig?: Record<string, unknown>;
1102
- context?: {
1103
- actor?: string;
1104
- traceId?: string;
1105
- };
1102
+ scope?: string;
1103
+ draftConfig?: Record<string, unknown>;
1104
+ context?: {
1105
+ actor?: string;
1106
+ traceId?: string;
1107
+ };
1106
1108
  };
1107
1109
  type ConfigActionExecuteResult = {
1108
- ok: boolean;
1109
- status: "success" | "failed";
1110
- message: string;
1111
- data?: Record<string, unknown>;
1112
- patch?: Record<string, unknown>;
1113
- nextActions?: string[];
1110
+ ok: boolean;
1111
+ status: "success" | "failed";
1112
+ message: string;
1113
+ data?: Record<string, unknown>;
1114
+ patch?: Record<string, unknown>;
1115
+ nextActions?: string[];
1114
1116
  };
1115
1117
  type UiServerEvent = {
1116
- type: "config.updated";
1117
- payload: {
1118
- path: string;
1119
- };
1118
+ type: "config.updated";
1119
+ payload: {
1120
+ path: string;
1121
+ };
1120
1122
  } | {
1121
- type: "session.updated";
1122
- payload: {
1123
- sessionKey: string;
1124
- };
1123
+ type: "session.updated";
1124
+ payload: {
1125
+ sessionKey: string;
1126
+ };
1125
1127
  } | {
1126
- type: "session.run-status";
1127
- payload: {
1128
- sessionKey: string;
1129
- status: "running" | "idle";
1130
- };
1128
+ type: "session.run-status";
1129
+ payload: {
1130
+ sessionKey: string;
1131
+ status: "running" | "idle";
1132
+ };
1131
1133
  } | {
1132
- type: "session.summary.upsert";
1133
- payload: {
1134
- summary: NcpSessionSummary;
1135
- };
1134
+ type: "session.summary.upsert";
1135
+ payload: {
1136
+ summary: NcpSessionSummary;
1137
+ };
1136
1138
  } | {
1137
- type: "session.summary.delete";
1138
- payload: {
1139
- sessionKey: string;
1140
- };
1139
+ type: "session.summary.delete";
1140
+ payload: {
1141
+ sessionKey: string;
1142
+ };
1141
1143
  } | {
1142
- type: "config.reload.started";
1143
- payload?: Record<string, unknown>;
1144
+ type: "config.reload.started";
1145
+ payload?: Record<string, unknown>;
1144
1146
  } | {
1145
- type: "config.reload.finished";
1146
- payload?: Record<string, unknown>;
1147
+ type: "config.reload.finished";
1148
+ payload?: Record<string, unknown>;
1147
1149
  } | {
1148
- type: "error";
1149
- payload: {
1150
- message: string;
1151
- code?: string;
1152
- };
1150
+ type: "error";
1151
+ payload: {
1152
+ message: string;
1153
+ code?: string;
1154
+ };
1153
1155
  };
1154
1156
  type UiServerOptions = {
1155
- host: string;
1156
- port: number;
1157
- configPath: string;
1158
- productVersion?: string;
1159
- corsOrigins?: string[] | "*";
1160
- staticDir?: string;
1161
- initializeAgentHomeDirectory?: (homeDirectory: string) => void;
1162
- marketplace?: MarketplaceApiConfig;
1163
- cronService?: CronService;
1164
- ncpAgent?: UiNcpAgent;
1165
- ncpSessionService?: UiNcpSessionService;
1166
- remoteAccess?: UiRemoteAccessHost;
1167
- getBootstrapStatus?: () => BootstrapStatusView;
1168
- getPluginChannelBindings?: () => PluginChannelBinding[];
1169
- getPluginUiMetadata?: () => PluginUiMetadata[];
1157
+ host: string;
1158
+ port: number;
1159
+ configPath: string;
1160
+ productVersion?: string;
1161
+ corsOrigins?: string[] | "*";
1162
+ staticDir?: string;
1163
+ initializeAgentHomeDirectory?: (homeDirectory: string) => void;
1164
+ marketplace?: MarketplaceApiConfig;
1165
+ cronService?: CronService;
1166
+ ncpAgent?: UiNcpAgent;
1167
+ ncpSessionService?: UiNcpSessionService;
1168
+ remoteAccess?: UiRemoteAccessHost;
1169
+ getBootstrapStatus?: () => BootstrapStatusView;
1170
+ getPluginChannelBindings?: () => PluginChannelBinding[];
1171
+ getPluginUiMetadata?: () => PluginUiMetadata[];
1170
1172
  };
1171
1173
  type UiServerHandle = {
1172
- host: string;
1173
- port: number;
1174
- close: () => Promise<void>;
1175
- publish: (event: UiServerEvent) => void;
1174
+ host: string;
1175
+ port: number;
1176
+ close: () => Promise<void>;
1177
+ publish: (event: UiServerEvent) => void;
1176
1178
  };
1177
-
1179
+ //#endregion
1180
+ //#region src/ui/server.d.ts
1178
1181
  type UiServerStartOptions = UiServerOptions & {
1179
- applyLiveConfigReload?: () => Promise<void>;
1182
+ applyLiveConfigReload?: () => Promise<void>;
1180
1183
  };
1181
1184
  declare function startUiServer(options: UiServerStartOptions): UiServerHandle;
1182
-
1185
+ //#endregion
1186
+ //#region src/ui/router.d.ts
1183
1187
  declare function createUiRouter(options: UiRouterOptions): Hono;
1184
-
1188
+ //#endregion
1189
+ //#region src/ui/plugin-channel-config.projection.d.ts
1185
1190
  type PluginConfigProjectionOptions = {
1186
- pluginChannelBindings?: PluginChannelBinding[];
1187
- pluginUiMetadata?: PluginUiMetadata[];
1191
+ pluginChannelBindings?: PluginChannelBinding[];
1192
+ pluginUiMetadata?: PluginUiMetadata[];
1188
1193
  };
1189
-
1194
+ //#endregion
1195
+ //#region src/ui/config.d.ts
1190
1196
  type ExecuteActionResult = {
1191
- ok: true;
1192
- data: ConfigActionExecuteResult$1;
1197
+ ok: true;
1198
+ data: ConfigActionExecuteResult$1;
1193
1199
  } | {
1194
- ok: false;
1195
- code: string;
1196
- message: string;
1197
- details?: Record<string, unknown>;
1200
+ ok: false;
1201
+ code: string;
1202
+ message: string;
1203
+ details?: Record<string, unknown>;
1198
1204
  };
1199
1205
  declare function buildConfigView(config: Config, options?: PluginConfigProjectionOptions): ConfigView;
1200
1206
  declare function buildConfigMeta(config: Config, options?: PluginConfigProjectionOptions): ConfigMetaView;
@@ -1202,38 +1208,39 @@ declare function buildConfigSchemaView(_config: Config, options?: PluginConfigPr
1202
1208
  declare function executeConfigAction(configPath: string, actionId: string, request: ConfigActionExecuteRequest$1): Promise<ExecuteActionResult>;
1203
1209
  declare function loadConfigOrDefault(configPath: string): Config;
1204
1210
  declare function updateModel(configPath: string, patch: {
1205
- model?: string;
1206
- workspace?: string;
1211
+ model?: string;
1212
+ workspace?: string;
1207
1213
  }): ConfigView;
1208
1214
  declare function updateSearch(configPath: string, patch: SearchConfigUpdate): ConfigView["search"];
1209
1215
  declare function updateProvider(configPath: string, providerName: string, patch: ProviderConfigUpdate): ProviderConfigView | null;
1210
1216
  declare function createCustomProvider(configPath: string, patch?: ProviderConfigUpdate): {
1211
- name: string;
1212
- provider: ProviderConfigView;
1217
+ name: string;
1218
+ provider: ProviderConfigView;
1213
1219
  };
1214
1220
  declare function deleteCustomProvider(configPath: string, providerName: string): boolean | null;
1215
1221
  declare function testProviderConnection(configPath: string, providerName: string, patch: ProviderConnectionTestRequest): Promise<ProviderConnectionTestResult | null>;
1216
1222
  declare function updateChannel(configPath: string, channelName: string, patch: Record<string, unknown>, options?: PluginConfigProjectionOptions): Record<string, unknown> | null;
1217
1223
  declare const DEFAULT_SESSION_TYPE = "native";
1218
1224
  declare class SessionPatchValidationError extends Error {
1219
- readonly code: "SESSION_TYPE_INVALID" | "SESSION_TYPE_IMMUTABLE" | "SESSION_TYPE_UNAVAILABLE" | "PREFERRED_THINKING_INVALID";
1220
- constructor(code: "SESSION_TYPE_INVALID" | "SESSION_TYPE_IMMUTABLE" | "SESSION_TYPE_UNAVAILABLE" | "PREFERRED_THINKING_INVALID", message: string);
1225
+ readonly code: "SESSION_TYPE_INVALID" | "SESSION_TYPE_IMMUTABLE" | "SESSION_TYPE_UNAVAILABLE" | "PREFERRED_THINKING_INVALID";
1226
+ constructor(code: "SESSION_TYPE_INVALID" | "SESSION_TYPE_IMMUTABLE" | "SESSION_TYPE_UNAVAILABLE" | "PREFERRED_THINKING_INVALID", message: string);
1221
1227
  }
1222
1228
  declare function listSessions(configPath: string, query?: {
1223
- q?: string;
1224
- limit?: number;
1225
- activeMinutes?: number;
1229
+ q?: string;
1230
+ limit?: number;
1231
+ activeMinutes?: number;
1226
1232
  }): SessionsListView;
1227
1233
  declare function getSessionHistory(configPath: string, key: string, limit?: number): SessionHistoryView | null;
1228
1234
  declare function patchSession(configPath: string, key: string, patch: SessionPatchUpdate, options?: {
1229
- availableSessionTypes?: string[];
1235
+ availableSessionTypes?: string[];
1230
1236
  }): SessionHistoryView | null;
1231
1237
  declare function deleteSession(configPath: string, key: string): boolean;
1232
1238
  declare function updateRuntime(configPath: string, patch: RuntimeConfigUpdate): Pick<ConfigView, "agents" | "bindings" | "session">;
1233
1239
  declare function updateSecrets(configPath: string, patch: SecretsConfigUpdate): SecretsView;
1234
-
1240
+ //#endregion
1241
+ //#region src/ui/auth-bridge.d.ts
1235
1242
  declare function getUiBridgeSecretPath(): string;
1236
1243
  declare function readUiBridgeSecret(): string | null;
1237
1244
  declare function ensureUiBridgeSecret(): string;
1238
-
1239
- export { type AgentBindingView, type AgentCreateRequest, type AgentDeleteResult, type AgentProfileView, type ApiError, type ApiResponse, type AppMetaView, type AuthEnabledUpdateRequest, type AuthLoginRequest, type AuthPasswordUpdateRequest, type AuthSetupRequest, type AuthStatusView, type BindingPeerView, type BochaFreshnessValue, type BootstrapPhase, type BootstrapRemoteState, type BootstrapStageState, type BootstrapStatusView, type ChannelAuthPollRequest, type ChannelAuthPollResult, type ChannelAuthStartRequest, type ChannelAuthStartResult, type ChannelSpecView, type ChatSessionTypeCtaView, type ChatSessionTypeOptionView, type ChatSessionTypesView, type ConfigActionExecuteRequest, type ConfigActionExecuteResult, type ConfigActionManifest, type ConfigActionType, type ConfigMetaView, type ConfigSchemaResponse, type ConfigUiHint, type ConfigUiHints, type ConfigView, type CronActionResult, type CronEnableRequest, type CronJobStateView, type CronJobView, type CronListView, type CronPayloadView, type CronRunRequest, type CronScheduleView, DEFAULT_SESSION_TYPE, type MarketplaceApiConfig, type MarketplaceInstallKind, type MarketplaceInstallSkillParams, type MarketplaceInstallSpec, type MarketplaceInstalledRecord, type MarketplaceInstalledView, type MarketplaceInstaller, type MarketplaceItemSummary, type MarketplaceItemType, type MarketplaceItemView, type MarketplaceListView, type MarketplaceLocalizedTextMap, type MarketplaceMcpContentView, type MarketplaceMcpDoctorResult, type MarketplaceMcpInstallKind, type MarketplaceMcpInstallRequest, type MarketplaceMcpInstallResult, type MarketplaceMcpInstallSpec, type MarketplaceMcpManageAction, type MarketplaceMcpManageRequest, type MarketplaceMcpManageResult, type MarketplaceMcpTemplateInput, type MarketplacePluginContentView, type MarketplacePluginInstallKind, type MarketplacePluginInstallRequest, type MarketplacePluginInstallResult, type MarketplacePluginManageAction, type MarketplacePluginManageRequest, type MarketplacePluginManageResult, type MarketplaceRecommendationView, type MarketplaceSkillContentView, type MarketplaceSkillInstallKind, type MarketplaceSkillInstallRequest, type MarketplaceSkillInstallResult, type MarketplaceSkillManageAction, type MarketplaceSkillManageRequest, type MarketplaceSkillManageResult, type MarketplaceSort, type NcpSessionSkillsView, type ProviderAuthImportResult, type ProviderAuthPollRequest, type ProviderAuthPollResult, type ProviderAuthStartRequest, type ProviderAuthStartResult, type ProviderConfigUpdate, type ProviderConfigView, type ProviderConnectionTestRequest, type ProviderConnectionTestResult, type ProviderCreateRequest, type ProviderCreateResult, type ProviderDeleteResult, type ProviderSpecView, type RemoteAccessView, type RemoteAccountView, type RemoteBrowserAuthPollRequest, type RemoteBrowserAuthPollResult, type RemoteBrowserAuthStartRequest, type RemoteBrowserAuthStartResult, type RemoteDoctorCheckView, type RemoteDoctorView, type RemoteLoginRequest, type RemoteRuntimeView, type RemoteServiceAction, type RemoteServiceActionResult, type RemoteServiceView, type RemoteSettingsUpdateRequest, type RemoteSettingsView, type RuntimeConfigUpdate, type SearchConfigUpdate, type SearchConfigView, type SearchProviderConfigView, type SearchProviderName, type SearchProviderSpecView, type SecretProviderEnvView, type SecretProviderExecView, type SecretProviderFileView, type SecretProviderView, type SecretRefView, type SecretSourceView, type SecretsConfigUpdate, type SecretsView, type ServerPathBreadcrumbView, type ServerPathBrowseView, type ServerPathEntryView, type SessionConfigView, type SessionEntryView, type SessionEventView, type SessionHistoryView, type SessionMessageView, type SessionPatchUpdate, SessionPatchValidationError, type SessionSkillEntryView, type SessionTypeDescribeParams, type SessionsListView, type UiNcpAgent, type UiNcpAssetPutView, type UiNcpAssetView, type UiNcpSessionListView, type UiNcpSessionMessagesView, type UiNcpSessionService, type UiNcpStoredAssetRecord, type UiRemoteAccessHost, type UiServerEvent, type UiServerHandle, type UiServerOptions, buildConfigMeta, buildConfigSchemaView, buildConfigView, createCustomProvider, createUiRouter, deleteCustomProvider, deleteSession, ensureUiBridgeSecret, executeConfigAction, getSessionHistory, getUiBridgeSecretPath, listSessions, loadConfigOrDefault, patchSession, readUiBridgeSecret, startUiServer, testProviderConnection, updateChannel, updateModel, updateProvider, updateRuntime, updateSearch, updateSecrets };
1245
+ //#endregion
1246
+ export { AgentBindingView, AgentCreateRequest, AgentDeleteResult, AgentProfileView, ApiError, ApiResponse, AppMetaView, AuthEnabledUpdateRequest, AuthLoginRequest, AuthPasswordUpdateRequest, AuthSetupRequest, AuthStatusView, BindingPeerView, BochaFreshnessValue, BootstrapPhase, BootstrapRemoteState, BootstrapStageState, BootstrapStatusView, ChannelAuthPollRequest, ChannelAuthPollResult, ChannelAuthStartRequest, ChannelAuthStartResult, ChannelSpecView, type ChatSessionTypeCtaView, type ChatSessionTypeOptionView, type ChatSessionTypesView, ConfigActionExecuteRequest, ConfigActionExecuteResult, ConfigActionManifest, ConfigActionType, ConfigMetaView, ConfigSchemaResponse, ConfigUiHint, ConfigUiHints, ConfigView, CronActionResult, CronEnableRequest, CronJobStateView, CronJobView, CronListView, CronPayloadView, CronRunRequest, CronScheduleView, DEFAULT_SESSION_TYPE, MarketplaceApiConfig, MarketplaceInstallKind, MarketplaceInstallSkillParams, MarketplaceInstallSpec, MarketplaceInstalledRecord, MarketplaceInstalledView, MarketplaceInstaller, MarketplaceItemSummary, MarketplaceItemType, MarketplaceItemView, MarketplaceListView, MarketplaceLocalizedTextMap, MarketplaceMcpContentView, MarketplaceMcpDoctorResult, MarketplaceMcpInstallKind, MarketplaceMcpInstallRequest, MarketplaceMcpInstallResult, MarketplaceMcpInstallSpec, MarketplaceMcpManageAction, MarketplaceMcpManageRequest, MarketplaceMcpManageResult, MarketplaceMcpTemplateInput, MarketplacePluginContentView, MarketplacePluginInstallKind, MarketplacePluginInstallRequest, MarketplacePluginInstallResult, MarketplacePluginManageAction, MarketplacePluginManageRequest, MarketplacePluginManageResult, MarketplaceRecommendationView, MarketplaceSkillContentView, MarketplaceSkillInstallKind, MarketplaceSkillInstallRequest, MarketplaceSkillInstallResult, MarketplaceSkillManageAction, MarketplaceSkillManageRequest, MarketplaceSkillManageResult, MarketplaceSort, NcpSessionSkillsView, ProviderAuthImportResult, ProviderAuthPollRequest, ProviderAuthPollResult, ProviderAuthStartRequest, ProviderAuthStartResult, ProviderConfigUpdate, ProviderConfigView, ProviderConnectionTestRequest, ProviderConnectionTestResult, ProviderCreateRequest, ProviderCreateResult, ProviderDeleteResult, ProviderSpecView, RemoteAccessView, RemoteAccountView, RemoteBrowserAuthPollRequest, RemoteBrowserAuthPollResult, RemoteBrowserAuthStartRequest, RemoteBrowserAuthStartResult, RemoteDoctorCheckView, RemoteDoctorView, RemoteLoginRequest, RemoteRuntimeView, RemoteServiceAction, RemoteServiceActionResult, RemoteServiceView, RemoteSettingsUpdateRequest, RemoteSettingsView, RuntimeConfigUpdate, SearchConfigUpdate, SearchConfigView, SearchProviderConfigView, SearchProviderName, SearchProviderSpecView, SecretProviderEnvView, SecretProviderExecView, SecretProviderFileView, SecretProviderView, SecretRefView, SecretSourceView, SecretsConfigUpdate, SecretsView, ServerPathBreadcrumbView, ServerPathBrowseView, ServerPathEntryView, SessionConfigView, SessionEntryView, SessionEventView, SessionHistoryView, SessionMessageView, SessionPatchUpdate, SessionPatchValidationError, SessionSkillEntryView, SessionTypeDescribeParams, SessionsListView, UiNcpAgent, UiNcpAssetPutView, UiNcpAssetView, UiNcpSessionListView, UiNcpSessionMessagesView, UiNcpSessionService, UiNcpStoredAssetRecord, type UiRemoteAccessHost, UiServerEvent, UiServerHandle, UiServerOptions, buildConfigMeta, buildConfigSchemaView, buildConfigView, createCustomProvider, createUiRouter, deleteCustomProvider, deleteSession, ensureUiBridgeSecret, executeConfigAction, getSessionHistory, getUiBridgeSecretPath, listSessions, loadConfigOrDefault, patchSession, readUiBridgeSecret, startUiServer, testProviderConnection, updateChannel, updateModel, updateProvider, updateRuntime, updateSearch, updateSecrets };