@nextclaw/server 0.11.24 → 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.
- package/dist/index.d.ts +920 -894
- package/dist/index.js +4013 -5029
- package/package.json +8 -9
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,1146 +38,1169 @@ 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
|
-
|
|
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[];
|
|
363
368
|
};
|
|
364
369
|
type UiRemoteAccessHost = {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
};
|
|
374
|
-
|
|
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
|
|
375
381
|
type ChatSessionTypeCtaView = {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
382
|
+
kind: string;
|
|
383
|
+
label?: string;
|
|
384
|
+
href?: string;
|
|
379
385
|
};
|
|
380
386
|
type ChatSessionTypeOptionView = {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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;
|
|
389
395
|
};
|
|
390
396
|
type ChatSessionTypesView = {
|
|
391
|
-
|
|
392
|
-
|
|
397
|
+
defaultType: string;
|
|
398
|
+
options: ChatSessionTypeOptionView[];
|
|
393
399
|
};
|
|
394
|
-
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/ui/types.d.ts
|
|
395
402
|
type ApiError = {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
403
|
+
code: string;
|
|
404
|
+
message: string;
|
|
405
|
+
details?: Record<string, unknown>;
|
|
399
406
|
};
|
|
400
407
|
type ApiResponse<T> = {
|
|
401
|
-
|
|
402
|
-
|
|
408
|
+
ok: true;
|
|
409
|
+
data: T;
|
|
403
410
|
} | {
|
|
404
|
-
|
|
405
|
-
|
|
411
|
+
ok: false;
|
|
412
|
+
error: ApiError;
|
|
406
413
|
};
|
|
407
414
|
type AppMetaView = {
|
|
408
|
-
|
|
409
|
-
|
|
415
|
+
name: string;
|
|
416
|
+
productVersion: string;
|
|
410
417
|
};
|
|
411
418
|
type BootstrapPhase = "kernel-starting" | "shell-ready" | "hydrating-capabilities" | "ready" | "error";
|
|
412
419
|
type BootstrapStageState = "pending" | "running" | "ready" | "error";
|
|
413
420
|
type BootstrapRemoteState = "pending" | "ready" | "conflict" | "disabled" | "error";
|
|
414
421
|
type BootstrapStatusView = {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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;
|
|
435
442
|
};
|
|
436
443
|
type ProviderConfigView = {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
+
}>;
|
|
449
456
|
};
|
|
450
457
|
type ProviderConfigUpdate = {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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;
|
|
462
469
|
};
|
|
463
470
|
type ProviderConnectionTestRequest = ProviderConfigUpdate & {
|
|
464
|
-
|
|
471
|
+
model?: string | null;
|
|
465
472
|
};
|
|
466
473
|
type ProviderCreateRequest = ProviderConfigUpdate;
|
|
467
474
|
type ProviderCreateResult = {
|
|
468
|
-
|
|
469
|
-
|
|
475
|
+
name: string;
|
|
476
|
+
provider: ProviderConfigView;
|
|
470
477
|
};
|
|
471
478
|
type ProviderDeleteResult = {
|
|
472
|
-
|
|
473
|
-
|
|
479
|
+
deleted: boolean;
|
|
480
|
+
provider: string;
|
|
474
481
|
};
|
|
475
482
|
type ProviderConnectionTestResult = {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
483
|
+
success: boolean;
|
|
484
|
+
provider: string;
|
|
485
|
+
model?: string;
|
|
486
|
+
latencyMs: number;
|
|
487
|
+
message: string;
|
|
481
488
|
};
|
|
482
489
|
type SearchProviderName = "bocha" | "brave";
|
|
483
490
|
type BochaFreshnessValue = "noLimit" | "oneDay" | "oneWeek" | "oneMonth" | "oneYear" | string;
|
|
484
491
|
type SearchProviderConfigView = {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
+
enabled: boolean;
|
|
493
|
+
apiKeySet: boolean;
|
|
494
|
+
apiKeyMasked?: string;
|
|
495
|
+
baseUrl: string;
|
|
496
|
+
docsUrl?: string;
|
|
497
|
+
summary?: boolean;
|
|
498
|
+
freshness?: BochaFreshnessValue;
|
|
492
499
|
};
|
|
493
500
|
type SearchConfigView = {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
501
|
+
provider: SearchProviderName;
|
|
502
|
+
enabledProviders: SearchProviderName[];
|
|
503
|
+
defaults: {
|
|
504
|
+
maxResults: number;
|
|
505
|
+
};
|
|
506
|
+
providers: {
|
|
507
|
+
bocha: SearchProviderConfigView;
|
|
508
|
+
brave: SearchProviderConfigView;
|
|
509
|
+
};
|
|
503
510
|
};
|
|
504
511
|
type SearchConfigUpdate = {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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;
|
|
509
524
|
};
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
baseUrl?: string | null;
|
|
514
|
-
docsUrl?: string | null;
|
|
515
|
-
summary?: boolean;
|
|
516
|
-
freshness?: BochaFreshnessValue | null;
|
|
517
|
-
};
|
|
518
|
-
brave?: {
|
|
519
|
-
apiKey?: string | null;
|
|
520
|
-
baseUrl?: string | null;
|
|
521
|
-
};
|
|
525
|
+
brave?: {
|
|
526
|
+
apiKey?: string | null;
|
|
527
|
+
baseUrl?: string | null;
|
|
522
528
|
};
|
|
529
|
+
};
|
|
523
530
|
};
|
|
524
531
|
type ProviderAuthStartResult = {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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;
|
|
534
541
|
};
|
|
535
542
|
type ProviderAuthStartRequest = {
|
|
536
|
-
|
|
543
|
+
methodId?: string;
|
|
537
544
|
};
|
|
538
545
|
type ProviderAuthPollRequest = {
|
|
539
|
-
|
|
546
|
+
sessionId: string;
|
|
540
547
|
};
|
|
541
548
|
type ProviderAuthPollResult = {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
549
|
+
provider: string;
|
|
550
|
+
status: "pending" | "authorized" | "denied" | "expired" | "error";
|
|
551
|
+
message?: string;
|
|
552
|
+
nextPollMs?: number;
|
|
546
553
|
};
|
|
547
554
|
type ProviderAuthImportResult = {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
555
|
+
provider: string;
|
|
556
|
+
status: "imported";
|
|
557
|
+
source: "cli";
|
|
558
|
+
expiresAt?: string;
|
|
552
559
|
};
|
|
553
560
|
type ChannelAuthStartRequest = {
|
|
554
|
-
|
|
555
|
-
|
|
561
|
+
accountId?: string;
|
|
562
|
+
baseUrl?: string;
|
|
556
563
|
};
|
|
557
564
|
type ChannelAuthStartResult = {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
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;
|
|
566
573
|
};
|
|
567
574
|
type ChannelAuthPollRequest = {
|
|
568
|
-
|
|
575
|
+
sessionId: string;
|
|
569
576
|
};
|
|
570
577
|
type ChannelAuthPollResult = {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
578
|
+
channel: string;
|
|
579
|
+
status: "pending" | "scanned" | "authorized" | "expired" | "error";
|
|
580
|
+
message?: string;
|
|
581
|
+
nextPollMs?: number;
|
|
582
|
+
accountId?: string | null;
|
|
583
|
+
notes?: string[];
|
|
577
584
|
};
|
|
578
585
|
type AuthStatusView = {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
586
|
+
enabled: boolean;
|
|
587
|
+
configured: boolean;
|
|
588
|
+
authenticated: boolean;
|
|
589
|
+
username?: string;
|
|
583
590
|
};
|
|
584
591
|
type AuthSetupRequest = {
|
|
585
|
-
|
|
586
|
-
|
|
592
|
+
username: string;
|
|
593
|
+
password: string;
|
|
587
594
|
};
|
|
588
595
|
type AuthLoginRequest = {
|
|
589
|
-
|
|
590
|
-
|
|
596
|
+
username: string;
|
|
597
|
+
password: string;
|
|
591
598
|
};
|
|
592
599
|
type AuthPasswordUpdateRequest = {
|
|
593
|
-
|
|
600
|
+
password: string;
|
|
594
601
|
};
|
|
595
602
|
type AuthEnabledUpdateRequest = {
|
|
596
|
-
|
|
603
|
+
enabled: boolean;
|
|
597
604
|
};
|
|
598
605
|
type RemoteAccountView = {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
606
|
+
loggedIn: boolean;
|
|
607
|
+
email?: string;
|
|
608
|
+
role?: string;
|
|
609
|
+
platformBase?: string | null;
|
|
610
|
+
apiBase?: string | null;
|
|
604
611
|
};
|
|
605
612
|
type RemoteRuntimeView = {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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;
|
|
616
623
|
};
|
|
617
624
|
type RemoteServiceView = {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
625
|
+
running: boolean;
|
|
626
|
+
pid?: number;
|
|
627
|
+
uiUrl?: string;
|
|
628
|
+
uiPort?: number;
|
|
629
|
+
currentProcess: boolean;
|
|
623
630
|
};
|
|
624
631
|
type RemoteSettingsView = {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
632
|
+
enabled: boolean;
|
|
633
|
+
deviceName: string;
|
|
634
|
+
platformApiBase: string;
|
|
628
635
|
};
|
|
629
636
|
type RemoteAccessView = {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
+
account: RemoteAccountView;
|
|
638
|
+
settings: RemoteSettingsView;
|
|
639
|
+
service: RemoteServiceView;
|
|
640
|
+
localOrigin: string;
|
|
641
|
+
configuredEnabled: boolean;
|
|
642
|
+
platformBase?: string | null;
|
|
643
|
+
runtime: RemoteRuntimeView | null;
|
|
637
644
|
};
|
|
638
645
|
type RemoteDoctorCheckView = {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
646
|
+
name: string;
|
|
647
|
+
ok: boolean;
|
|
648
|
+
detail: string;
|
|
642
649
|
};
|
|
643
650
|
type RemoteDoctorView = {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
651
|
+
generatedAt: string;
|
|
652
|
+
checks: RemoteDoctorCheckView[];
|
|
653
|
+
snapshot: {
|
|
654
|
+
configuredEnabled: boolean;
|
|
655
|
+
runtime: RemoteRuntimeView | null;
|
|
656
|
+
};
|
|
650
657
|
};
|
|
651
658
|
type RemoteLoginRequest = {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
659
|
+
email: string;
|
|
660
|
+
password: string;
|
|
661
|
+
apiBase?: string;
|
|
655
662
|
};
|
|
656
663
|
type RemoteBrowserAuthStartRequest = {
|
|
657
|
-
|
|
664
|
+
apiBase?: string;
|
|
658
665
|
};
|
|
659
666
|
type RemoteBrowserAuthStartResult = {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
sessionId: string;
|
|
668
|
+
verificationUri: string;
|
|
669
|
+
expiresAt: string;
|
|
670
|
+
intervalMs: number;
|
|
664
671
|
};
|
|
665
672
|
type RemoteBrowserAuthPollRequest = {
|
|
666
|
-
|
|
667
|
-
|
|
673
|
+
sessionId: string;
|
|
674
|
+
apiBase?: string;
|
|
668
675
|
};
|
|
669
676
|
type RemoteBrowserAuthPollResult = {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
677
|
+
status: "pending" | "authorized" | "expired";
|
|
678
|
+
message?: string;
|
|
679
|
+
nextPollMs?: number;
|
|
680
|
+
email?: string;
|
|
681
|
+
role?: string;
|
|
675
682
|
};
|
|
676
683
|
type RemoteSettingsUpdateRequest = {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
684
|
+
enabled?: boolean;
|
|
685
|
+
deviceName?: string;
|
|
686
|
+
platformApiBase?: string;
|
|
680
687
|
};
|
|
681
688
|
type RemoteServiceAction = "start" | "restart" | "stop";
|
|
682
689
|
type RemoteServiceActionResult = {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
690
|
+
accepted: boolean;
|
|
691
|
+
action: RemoteServiceAction;
|
|
692
|
+
message: string;
|
|
686
693
|
};
|
|
687
694
|
type AgentProfileView = {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
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;
|
|
708
|
+
};
|
|
709
|
+
type AgentCreateRequest = {
|
|
710
|
+
id: string;
|
|
711
|
+
displayName?: string;
|
|
712
|
+
description?: string;
|
|
713
|
+
avatar?: string;
|
|
714
|
+
home?: string;
|
|
715
|
+
};
|
|
716
|
+
type AgentDeleteResult = {
|
|
717
|
+
deleted: boolean;
|
|
718
|
+
agentId: string;
|
|
696
719
|
};
|
|
697
720
|
type BindingPeerView = {
|
|
698
|
-
|
|
699
|
-
|
|
721
|
+
kind: "direct" | "group" | "channel";
|
|
722
|
+
id: string;
|
|
700
723
|
};
|
|
701
724
|
type AgentBindingView = {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
725
|
+
agentId: string;
|
|
726
|
+
match: {
|
|
727
|
+
channel: string;
|
|
728
|
+
accountId?: string;
|
|
729
|
+
peer?: BindingPeerView;
|
|
730
|
+
};
|
|
708
731
|
};
|
|
709
732
|
type SessionConfigView = {
|
|
710
|
-
|
|
711
|
-
agentToAgent?: {
|
|
712
|
-
maxPingPongTurns?: number;
|
|
713
|
-
};
|
|
733
|
+
dmScope?: "main" | "per-peer" | "per-channel-peer" | "per-account-channel-peer";
|
|
714
734
|
};
|
|
715
|
-
|
|
716
735
|
type SessionEntryView = {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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;
|
|
728
747
|
};
|
|
729
748
|
type SessionsListView = {
|
|
730
|
-
|
|
731
|
-
|
|
749
|
+
sessions: SessionEntryView[];
|
|
750
|
+
total: number;
|
|
732
751
|
};
|
|
733
752
|
type SessionMessageView = {
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
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;
|
|
741
760
|
};
|
|
742
761
|
type SessionEventView = {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
762
|
+
seq: number;
|
|
763
|
+
type: string;
|
|
764
|
+
timestamp: string;
|
|
765
|
+
message?: SessionMessageView;
|
|
747
766
|
};
|
|
748
767
|
type SessionHistoryView = {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
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[];
|
|
757
776
|
};
|
|
758
777
|
type SessionPatchUpdate = {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
778
|
+
label?: string | null;
|
|
779
|
+
preferredModel?: string | null;
|
|
780
|
+
preferredThinking?: ThinkingLevel | null;
|
|
781
|
+
sessionType?: string | null;
|
|
782
|
+
projectRoot?: string | null;
|
|
783
|
+
clearHistory?: boolean;
|
|
765
784
|
};
|
|
766
785
|
type SessionSkillEntryView = {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
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;
|
|
775
794
|
};
|
|
776
795
|
type NcpSessionSkillsView = {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
796
|
+
sessionId: string;
|
|
797
|
+
total: number;
|
|
798
|
+
refs: string[];
|
|
799
|
+
records: SessionSkillEntryView[];
|
|
781
800
|
};
|
|
782
801
|
type ServerPathEntryView = {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
802
|
+
name: string;
|
|
803
|
+
path: string;
|
|
804
|
+
kind: "directory" | "file";
|
|
805
|
+
hidden: boolean;
|
|
787
806
|
};
|
|
788
807
|
type ServerPathBreadcrumbView = {
|
|
789
|
-
|
|
790
|
-
|
|
808
|
+
label: string;
|
|
809
|
+
path: string;
|
|
791
810
|
};
|
|
792
811
|
type ServerPathBrowseView = {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
812
|
+
currentPath: string;
|
|
813
|
+
parentPath: string | null;
|
|
814
|
+
homePath: string;
|
|
815
|
+
breadcrumbs: ServerPathBreadcrumbView[];
|
|
816
|
+
entries: ServerPathEntryView[];
|
|
798
817
|
};
|
|
799
818
|
type CronScheduleView = {
|
|
800
|
-
|
|
801
|
-
|
|
819
|
+
kind: "at";
|
|
820
|
+
atMs?: number | null;
|
|
802
821
|
} | {
|
|
803
|
-
|
|
804
|
-
|
|
822
|
+
kind: "every";
|
|
823
|
+
everyMs?: number | null;
|
|
805
824
|
} | {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
825
|
+
kind: "cron";
|
|
826
|
+
expr?: string | null;
|
|
827
|
+
tz?: string | null;
|
|
809
828
|
};
|
|
810
829
|
type CronPayloadView = {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
830
|
+
kind?: "system_event" | "agent_turn";
|
|
831
|
+
message: string;
|
|
832
|
+
deliver?: boolean;
|
|
833
|
+
channel?: string | null;
|
|
834
|
+
to?: string | null;
|
|
816
835
|
};
|
|
817
836
|
type CronJobStateView = {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
837
|
+
nextRunAt?: string | null;
|
|
838
|
+
lastRunAt?: string | null;
|
|
839
|
+
lastStatus?: "ok" | "error" | "skipped" | null;
|
|
840
|
+
lastError?: string | null;
|
|
822
841
|
};
|
|
823
842
|
type CronJobView = {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
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;
|
|
833
852
|
};
|
|
834
853
|
type CronListView = {
|
|
835
|
-
|
|
836
|
-
|
|
854
|
+
jobs: CronJobView[];
|
|
855
|
+
total: number;
|
|
837
856
|
};
|
|
838
857
|
type CronEnableRequest = {
|
|
839
|
-
|
|
858
|
+
enabled: boolean;
|
|
840
859
|
};
|
|
841
860
|
type CronRunRequest = {
|
|
842
|
-
|
|
861
|
+
force?: boolean;
|
|
843
862
|
};
|
|
844
863
|
type CronActionResult = {
|
|
845
|
-
|
|
846
|
-
|
|
864
|
+
job: CronJobView | null;
|
|
865
|
+
executed?: boolean;
|
|
847
866
|
};
|
|
848
867
|
type RuntimeConfigUpdate = {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
};
|
|
855
|
-
list?: AgentProfileView[];
|
|
868
|
+
agents?: {
|
|
869
|
+
defaults?: {
|
|
870
|
+
contextTokens?: number;
|
|
871
|
+
engine?: string;
|
|
872
|
+
engineConfig?: Record<string, unknown>;
|
|
856
873
|
};
|
|
857
|
-
|
|
858
|
-
|
|
874
|
+
list?: AgentProfileView[];
|
|
875
|
+
};
|
|
876
|
+
bindings?: AgentBindingView[];
|
|
877
|
+
session?: SessionConfigView;
|
|
859
878
|
};
|
|
860
879
|
type SecretSourceView = "env" | "file" | "exec";
|
|
861
880
|
type SecretRefView = {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
881
|
+
source: SecretSourceView;
|
|
882
|
+
provider?: string;
|
|
883
|
+
id: string;
|
|
865
884
|
};
|
|
866
885
|
type SecretProviderEnvView = {
|
|
867
|
-
|
|
868
|
-
|
|
886
|
+
source: "env";
|
|
887
|
+
prefix?: string;
|
|
869
888
|
};
|
|
870
889
|
type SecretProviderFileView = {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
890
|
+
source: "file";
|
|
891
|
+
path: string;
|
|
892
|
+
format?: "json";
|
|
874
893
|
};
|
|
875
894
|
type SecretProviderExecView = {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
895
|
+
source: "exec";
|
|
896
|
+
command: string;
|
|
897
|
+
args?: string[];
|
|
898
|
+
cwd?: string;
|
|
899
|
+
timeoutMs?: number;
|
|
881
900
|
};
|
|
882
901
|
type SecretProviderView = SecretProviderEnvView | SecretProviderFileView | SecretProviderExecView;
|
|
883
902
|
type SecretsView = {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
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>;
|
|
892
911
|
};
|
|
893
912
|
type SecretsConfigUpdate = {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
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;
|
|
902
921
|
};
|
|
903
922
|
type UiNcpSessionListView = {
|
|
904
|
-
|
|
905
|
-
|
|
923
|
+
sessions: NcpSessionSummary[];
|
|
924
|
+
total: number;
|
|
906
925
|
};
|
|
907
926
|
type UiNcpSessionMessagesView = {
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
927
|
+
sessionId: string;
|
|
928
|
+
status: NcpSessionStatus;
|
|
929
|
+
messages: NcpMessage[];
|
|
930
|
+
total: number;
|
|
911
931
|
};
|
|
912
932
|
type SessionTypeDescribeParams = {
|
|
913
|
-
|
|
933
|
+
describeMode?: "observation" | "probe";
|
|
914
934
|
};
|
|
915
935
|
type UiNcpSessionService = NcpSessionApi;
|
|
916
936
|
type UiNcpAgent = {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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;
|
|
931
951
|
};
|
|
932
952
|
type ConfigView = {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
};
|
|
942
|
-
list?: AgentProfileView[];
|
|
943
|
-
context?: {
|
|
944
|
-
bootstrap?: {
|
|
945
|
-
files?: string[];
|
|
946
|
-
minimalFiles?: string[];
|
|
947
|
-
heartbeatFiles?: string[];
|
|
948
|
-
perFileChars?: number;
|
|
949
|
-
totalChars?: number;
|
|
950
|
-
};
|
|
951
|
-
memory?: {
|
|
952
|
-
enabled?: boolean;
|
|
953
|
-
maxChars?: number;
|
|
954
|
-
};
|
|
955
|
-
};
|
|
953
|
+
agents: {
|
|
954
|
+
defaults: {
|
|
955
|
+
model: string;
|
|
956
|
+
workspace?: string;
|
|
957
|
+
engine?: string;
|
|
958
|
+
engineConfig?: Record<string, unknown>;
|
|
959
|
+
contextTokens?: number;
|
|
960
|
+
maxToolIterations?: number;
|
|
956
961
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
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
|
+
};
|
|
975
|
+
};
|
|
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;
|
|
966
986
|
};
|
|
967
987
|
type ProviderSpecView = {
|
|
968
|
-
|
|
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";
|
|
969
1004
|
displayName?: string;
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
logo?: string;
|
|
978
|
-
apiBaseHelp?: {
|
|
1005
|
+
note?: {
|
|
1006
|
+
en?: string;
|
|
1007
|
+
zh?: string;
|
|
1008
|
+
};
|
|
1009
|
+
methods?: Array<{
|
|
1010
|
+
id: string;
|
|
1011
|
+
label?: {
|
|
979
1012
|
en?: string;
|
|
980
1013
|
zh?: string;
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
kind: "device_code";
|
|
984
|
-
displayName?: string;
|
|
985
|
-
note?: {
|
|
986
|
-
en?: string;
|
|
987
|
-
zh?: string;
|
|
988
|
-
};
|
|
989
|
-
methods?: Array<{
|
|
990
|
-
id: string;
|
|
991
|
-
label?: {
|
|
992
|
-
en?: string;
|
|
993
|
-
zh?: string;
|
|
994
|
-
};
|
|
995
|
-
hint?: {
|
|
996
|
-
en?: string;
|
|
997
|
-
zh?: string;
|
|
998
|
-
};
|
|
999
|
-
}>;
|
|
1000
|
-
defaultMethodId?: string;
|
|
1001
|
-
supportsCliImport?: boolean;
|
|
1002
|
-
};
|
|
1003
|
-
defaultModels?: string[];
|
|
1004
|
-
supportsWireApi?: boolean;
|
|
1005
|
-
wireApiOptions?: Array<"auto" | "chat" | "responses">;
|
|
1006
|
-
defaultWireApi?: "auto" | "chat" | "responses";
|
|
1007
|
-
};
|
|
1008
|
-
type ChannelSpecView = {
|
|
1009
|
-
name: string;
|
|
1010
|
-
displayName?: string;
|
|
1011
|
-
enabled: boolean;
|
|
1012
|
-
tutorialUrl?: string;
|
|
1013
|
-
tutorialUrls?: {
|
|
1014
|
-
default?: string;
|
|
1014
|
+
};
|
|
1015
|
+
hint?: {
|
|
1015
1016
|
en?: string;
|
|
1016
1017
|
zh?: string;
|
|
1017
|
-
|
|
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
|
+
};
|
|
1018
1038
|
};
|
|
1019
1039
|
type SearchProviderSpecView = {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1040
|
+
name: SearchProviderName;
|
|
1041
|
+
displayName: string;
|
|
1042
|
+
description: string;
|
|
1043
|
+
docsUrl?: string;
|
|
1044
|
+
isDefault?: boolean;
|
|
1045
|
+
supportsSummary?: boolean;
|
|
1026
1046
|
};
|
|
1027
1047
|
type ConfigMetaView = {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1048
|
+
providers: ProviderSpecView[];
|
|
1049
|
+
search: SearchProviderSpecView[];
|
|
1050
|
+
channels: ChannelSpecView[];
|
|
1031
1051
|
};
|
|
1032
1052
|
type ConfigUiHint = {
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1053
|
+
label?: string;
|
|
1054
|
+
help?: string;
|
|
1055
|
+
group?: string;
|
|
1056
|
+
order?: number;
|
|
1057
|
+
advanced?: boolean;
|
|
1058
|
+
sensitive?: boolean;
|
|
1059
|
+
placeholder?: string;
|
|
1060
|
+
readOnly?: boolean;
|
|
1041
1061
|
};
|
|
1042
1062
|
type ConfigUiHints = Record<string, ConfigUiHint>;
|
|
1043
1063
|
type ConfigSchemaResponse = {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1064
|
+
schema: Record<string, unknown>;
|
|
1065
|
+
uiHints: ConfigUiHints;
|
|
1066
|
+
actions: ConfigActionManifest[];
|
|
1067
|
+
version: string;
|
|
1068
|
+
generatedAt: string;
|
|
1049
1069
|
};
|
|
1050
1070
|
type ConfigActionType = "httpProbe" | "oauthStart" | "webhookVerify" | "openUrl" | "copyToken";
|
|
1051
1071
|
type ConfigActionManifest = {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
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
|
+
};
|
|
1080
1100
|
};
|
|
1081
1101
|
type ConfigActionExecuteRequest = {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1102
|
+
scope?: string;
|
|
1103
|
+
draftConfig?: Record<string, unknown>;
|
|
1104
|
+
context?: {
|
|
1105
|
+
actor?: string;
|
|
1106
|
+
traceId?: string;
|
|
1107
|
+
};
|
|
1088
1108
|
};
|
|
1089
1109
|
type ConfigActionExecuteResult = {
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1110
|
+
ok: boolean;
|
|
1111
|
+
status: "success" | "failed";
|
|
1112
|
+
message: string;
|
|
1113
|
+
data?: Record<string, unknown>;
|
|
1114
|
+
patch?: Record<string, unknown>;
|
|
1115
|
+
nextActions?: string[];
|
|
1096
1116
|
};
|
|
1097
1117
|
type UiServerEvent = {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1118
|
+
type: "config.updated";
|
|
1119
|
+
payload: {
|
|
1120
|
+
path: string;
|
|
1121
|
+
};
|
|
1102
1122
|
} | {
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1123
|
+
type: "session.updated";
|
|
1124
|
+
payload: {
|
|
1125
|
+
sessionKey: string;
|
|
1126
|
+
};
|
|
1107
1127
|
} | {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1128
|
+
type: "session.run-status";
|
|
1129
|
+
payload: {
|
|
1130
|
+
sessionKey: string;
|
|
1131
|
+
status: "running" | "idle";
|
|
1132
|
+
};
|
|
1113
1133
|
} | {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1134
|
+
type: "session.summary.upsert";
|
|
1135
|
+
payload: {
|
|
1136
|
+
summary: NcpSessionSummary;
|
|
1137
|
+
};
|
|
1118
1138
|
} | {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1139
|
+
type: "session.summary.delete";
|
|
1140
|
+
payload: {
|
|
1141
|
+
sessionKey: string;
|
|
1142
|
+
};
|
|
1123
1143
|
} | {
|
|
1124
|
-
|
|
1125
|
-
|
|
1144
|
+
type: "config.reload.started";
|
|
1145
|
+
payload?: Record<string, unknown>;
|
|
1126
1146
|
} | {
|
|
1127
|
-
|
|
1128
|
-
|
|
1147
|
+
type: "config.reload.finished";
|
|
1148
|
+
payload?: Record<string, unknown>;
|
|
1129
1149
|
} | {
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1150
|
+
type: "error";
|
|
1151
|
+
payload: {
|
|
1152
|
+
message: string;
|
|
1153
|
+
code?: string;
|
|
1154
|
+
};
|
|
1135
1155
|
};
|
|
1136
1156
|
type UiServerOptions = {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
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[];
|
|
1151
1172
|
};
|
|
1152
1173
|
type UiServerHandle = {
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1174
|
+
host: string;
|
|
1175
|
+
port: number;
|
|
1176
|
+
close: () => Promise<void>;
|
|
1177
|
+
publish: (event: UiServerEvent) => void;
|
|
1157
1178
|
};
|
|
1158
|
-
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/ui/server.d.ts
|
|
1159
1181
|
type UiServerStartOptions = UiServerOptions & {
|
|
1160
|
-
|
|
1182
|
+
applyLiveConfigReload?: () => Promise<void>;
|
|
1161
1183
|
};
|
|
1162
1184
|
declare function startUiServer(options: UiServerStartOptions): UiServerHandle;
|
|
1163
|
-
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/ui/router.d.ts
|
|
1164
1187
|
declare function createUiRouter(options: UiRouterOptions): Hono;
|
|
1165
|
-
|
|
1188
|
+
//#endregion
|
|
1189
|
+
//#region src/ui/plugin-channel-config.projection.d.ts
|
|
1166
1190
|
type PluginConfigProjectionOptions = {
|
|
1167
|
-
|
|
1168
|
-
|
|
1191
|
+
pluginChannelBindings?: PluginChannelBinding[];
|
|
1192
|
+
pluginUiMetadata?: PluginUiMetadata[];
|
|
1169
1193
|
};
|
|
1170
|
-
|
|
1194
|
+
//#endregion
|
|
1195
|
+
//#region src/ui/config.d.ts
|
|
1171
1196
|
type ExecuteActionResult = {
|
|
1172
|
-
|
|
1173
|
-
|
|
1197
|
+
ok: true;
|
|
1198
|
+
data: ConfigActionExecuteResult$1;
|
|
1174
1199
|
} | {
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1200
|
+
ok: false;
|
|
1201
|
+
code: string;
|
|
1202
|
+
message: string;
|
|
1203
|
+
details?: Record<string, unknown>;
|
|
1179
1204
|
};
|
|
1180
1205
|
declare function buildConfigView(config: Config, options?: PluginConfigProjectionOptions): ConfigView;
|
|
1181
1206
|
declare function buildConfigMeta(config: Config, options?: PluginConfigProjectionOptions): ConfigMetaView;
|
|
@@ -1183,38 +1208,39 @@ declare function buildConfigSchemaView(_config: Config, options?: PluginConfigPr
|
|
|
1183
1208
|
declare function executeConfigAction(configPath: string, actionId: string, request: ConfigActionExecuteRequest$1): Promise<ExecuteActionResult>;
|
|
1184
1209
|
declare function loadConfigOrDefault(configPath: string): Config;
|
|
1185
1210
|
declare function updateModel(configPath: string, patch: {
|
|
1186
|
-
|
|
1187
|
-
|
|
1211
|
+
model?: string;
|
|
1212
|
+
workspace?: string;
|
|
1188
1213
|
}): ConfigView;
|
|
1189
1214
|
declare function updateSearch(configPath: string, patch: SearchConfigUpdate): ConfigView["search"];
|
|
1190
1215
|
declare function updateProvider(configPath: string, providerName: string, patch: ProviderConfigUpdate): ProviderConfigView | null;
|
|
1191
1216
|
declare function createCustomProvider(configPath: string, patch?: ProviderConfigUpdate): {
|
|
1192
|
-
|
|
1193
|
-
|
|
1217
|
+
name: string;
|
|
1218
|
+
provider: ProviderConfigView;
|
|
1194
1219
|
};
|
|
1195
1220
|
declare function deleteCustomProvider(configPath: string, providerName: string): boolean | null;
|
|
1196
1221
|
declare function testProviderConnection(configPath: string, providerName: string, patch: ProviderConnectionTestRequest): Promise<ProviderConnectionTestResult | null>;
|
|
1197
1222
|
declare function updateChannel(configPath: string, channelName: string, patch: Record<string, unknown>, options?: PluginConfigProjectionOptions): Record<string, unknown> | null;
|
|
1198
1223
|
declare const DEFAULT_SESSION_TYPE = "native";
|
|
1199
1224
|
declare class SessionPatchValidationError extends Error {
|
|
1200
|
-
|
|
1201
|
-
|
|
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);
|
|
1202
1227
|
}
|
|
1203
1228
|
declare function listSessions(configPath: string, query?: {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1229
|
+
q?: string;
|
|
1230
|
+
limit?: number;
|
|
1231
|
+
activeMinutes?: number;
|
|
1207
1232
|
}): SessionsListView;
|
|
1208
1233
|
declare function getSessionHistory(configPath: string, key: string, limit?: number): SessionHistoryView | null;
|
|
1209
1234
|
declare function patchSession(configPath: string, key: string, patch: SessionPatchUpdate, options?: {
|
|
1210
|
-
|
|
1235
|
+
availableSessionTypes?: string[];
|
|
1211
1236
|
}): SessionHistoryView | null;
|
|
1212
1237
|
declare function deleteSession(configPath: string, key: string): boolean;
|
|
1213
1238
|
declare function updateRuntime(configPath: string, patch: RuntimeConfigUpdate): Pick<ConfigView, "agents" | "bindings" | "session">;
|
|
1214
1239
|
declare function updateSecrets(configPath: string, patch: SecretsConfigUpdate): SecretsView;
|
|
1215
|
-
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region src/ui/auth-bridge.d.ts
|
|
1216
1242
|
declare function getUiBridgeSecretPath(): string;
|
|
1217
1243
|
declare function readUiBridgeSecret(): string | null;
|
|
1218
1244
|
declare function ensureUiBridgeSecret(): string;
|
|
1219
|
-
|
|
1220
|
-
export {
|
|
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 };
|