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